@veltdev/sdk-staging 6.0.0-beta.22 → 6.0.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/velt-comment.js CHANGED
@@ -1,4 +1,4 @@
1
- import{C as Gu}from"./chunk-AAZAJXGE.js";import{a as Hb}from"./chunk-TYMRWTZD.js";import{a as Wb}from"./chunk-TH6YKCXO.js";import{a as Mh,b as Ah,c as Lg,d as Bg}from"./chunk-TCAK4M4C.js";import{a as Vg}from"./chunk-35J3HFXX.js";import"./chunk-G35OSTOG.js";import"./chunk-MWSODQ6X.js";import{b as yh,c as wh,d as Ih}from"./chunk-RFCFKIUM.js";import{a as Yr}from"./chunk-MMLFNU6G.js";import{b as zb}from"./chunk-WD2ZEHH2.js";import{a as pg,c as Bh,d as Vh}from"./chunk-7YVQR4BL.js";import{a as hn}from"./chunk-WDA4SVMN.js";import{a as no}from"./chunk-XA2U66CN.js";import{a as Sb,b as ro,c as Fb,d as Pg,e as Nb,f as Rb,g as Cr,h as Fg,i as Ub,j as Ng,k as pn,n as Rg,o as Lb,p as Bb,q as $v,r as Vb,s as $b,t as Gb}from"./chunk-7USARX44.js";import"./chunk-HCYE7VHY.js";import{b as sg,c as gg,g as ug,l as Rh,m as Uh,r as Lh,s as jh,w as Hh,x as Pt}from"./chunk-DJYRZD7H.js";import{a as Ug}from"./chunk-XK65RTYQ.js";import{a as Wt}from"./chunk-NTNPNLFT.js";import{a as mt,b as qt}from"./chunk-BYJ7FNFA.js";import{A as P,B as F,a as Og,b as Eg,u as Ab,y as Pb,z as Ag}from"./chunk-PFRELWAV.js";import{a as Be,b as Mg}from"./chunk-SZKZ3DG3.js";import{a as Mb,b as W,c as Jr,d as Ut}from"./chunk-SJ45VMIG.js";import{a as jb}from"./chunk-2XFMMSIA.js";import{a as Dr}from"./chunk-B4IA4XDT.js";import{a as Ph}from"./chunk-MNSD5X74.js";import{A as nn,F as Oh,G as gt,H as bt,I as Eh,Y as $h,ba as Gh,ca as $t,da as D,ea as Et,f as dg,fa as xe,ga as At,j as _h,m as Fv,n as vg,p as Sh,r as cg,s as Dh,t as mg,v as Th}from"./chunk-RU3S5WM7.js";import{$ as et,$b as rn,$f as un,A as rh,Aa as Ir,Ab as pr,Bb as hr,Bf as wo,Bg as lb,C as nh,Ca as ur,Ce as Ur,Cf as mr,Cg as zr,D as Eu,Db as ft,De as it,Df as xg,Dg as db,E as jt,Ea as Qs,Eb as Ct,Ec as jr,Ed as Fh,Ee as X,Ef as Uv,Fa as d,Fb as kt,Fc as It,Ff as dr,G as yn,Ga as Le,Gb as In,Gc as ge,Gf as Mn,Gi as Eb,Ha as eg,Hb as Mv,Hf as sr,I as Ov,Ia as vh,Ib as we,If as An,Ig as Io,Ih as ln,Ii as to,J as Jn,Jb as at,Jf as Pn,Jg as Rc,Jh as $u,Kb as ue,Ke as fg,Kf as Fu,Kg as Uc,L as gr,Lc as qe,Lf as Yh,M as wn,Ma as tg,Mb as Av,Mf as gn,N as oh,Nb as le,Nc as Pv,Nf as Kh,Nh as Dg,O as ah,Oa as Ev,Ob as je,Oc as sn,Od as Nh,Oe as Yt,Of as zt,Oh as ub,Pa as j,Pb as Ce,Pc as kh,Pe as En,Ph as pb,Q as Zs,Qb as og,Qe as Nt,Qh as hb,R as ih,Ra as ch,Rb as hh,Re as Wh,Rf as Nu,Rh as bb,S as Mu,Se as qn,Sf as on,Sh as fb,T as Me,Ta as mh,Td as Kn,Tf as Zh,Th as Cb,Ua as T,Ud as Zn,Uf as Xh,Uh as kb,Va as sh,Vf as qh,Vh as Tg,W as Ac,Wa as gh,Wd as Au,Wf as Qh,Wh as Bv,Xc as xh,Xd as Ke,Y as Pc,Ya as M,Yb as bh,Yh as xb,Zb as ag,Zd as dt,Ze as Qn,Zf as Nc,Zg as vb,_ as Xs,_a as s,_b as U,_f as _g,_g as cb,_h as Do,a as g,aa as lh,ac as ct,ae as hg,ag as an,ah as wg,b as f,ba as dh,bb as rg,bc as ce,bg as Ru,bh as Lv,bi as fr,ca as be,cc as C,cg as eb,ci as vr,da as se,db as k,dc as fe,di as N,eb as Gr,ec as Je,ef as Cg,eg as tb,ei as Vv,fb as y,fc as O,fg as Sg,fh as ye,g as Pe,gb as w,gc as St,h as Xp,ha as B,hb as uh,hc as Yn,hg as Uu,hh as Ig,hi as _b,i as qp,ia as V,ib as ng,if as Jh,ig as yg,ih as mb,ii as yb,ja as de,jb as rt,jc as Dn,jg as Lu,jh as Wr,k as Gt,ka as xt,kb as nt,kc as A,kg as eo,l as De,la as qs,lb as v,lc as R,lh as Lc,li as Ne,m as Qp,mb as b,mc as Er,mi as ot,nb as x,nc as fh,ni as Mr,o as eh,ob as E,oc as Ch,oe as ke,oh as Bc,oi as wb,p as Wn,pc as Ge,pd as br,pe as bg,pg as rb,q as _n,qa as Fe,qe as On,qg as nb,qi as Xt,r as Ee,rc as ig,rf as Fc,rh as sb,ri as Ib,sb as u,sc as L,se as Hr,sh as Bu,si as Qe,tb as p,tc as yt,te as Nv,th as gb,ti as Db,ua as tt,ub as ze,uc as or,uf as kg,ug as ob,v as Oe,va as Y,vb as J,vc as q,ve as Pu,vg as ab,vh as ne,w as kr,wa as me,wb as ph,wc as Tn,we as lr,wg as ib,wh as Vu,wi as Tb,x as th,xb as H,xc as ar,xe as Rv,ye as zh,yi as ut,z as Sn,zb as l,zc as lg,ze as Xn,zi as Ob}from"./chunk-FXUDI3M6.js";var Dt=(()=>{let o=class o{constructor(e){this.loggingService=e,this._customStatusMap=new De(X.CommentAnnotationStatusMap),this._customPriorityMap=new De(X.CommentAnnotationPriorityMap),this._customCategoryMap=new De(X.CommentCategoryMap);try{let t=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP);t&&this._customPriorityMap.next(JSON.parse(t));let a=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP);a&&this._customStatusMap.next(JSON.parse(a));let i=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP);i&&this._customCategoryMap.next(JSON.parse(i))}catch(t){this.loggingService.catch("Error in CustomFilterService constructor: ",t)}}setCustomStatusFilters(e){try{if(e.length<2){this._customStatusMap.next(X.CommentAnnotationStatusMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(X.CommentAnnotationStatusMap)),this.loggingService.catch("Custom status filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a,a.type||(a.type="ongoing")}),this._customStatusMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomStatusFilters: ",t)}}setCustomPriorityFilters(e){try{if(e.length<2){this._customPriorityMap.next(X.CommentAnnotationPriorityMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(X.CommentAnnotationPriorityMap)),this.loggingService.catch("Custom priority filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a}),this._customPriorityMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomPriorityFilters: ",t)}}setCustomCategories(e){try{let t={};e.forEach(a=>{t[a.id]=a}),this._customCategoryMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomCategories: ",t)}}get customStatusMap$(){return this._customStatusMap.asObservable()}get customPriorityMap$(){return this._customPriorityMap.asObservable()}get customCategoryMap$(){return this._customCategoryMap.asObservable()}get defaultStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="default");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService defaultStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get resolvedStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="terminal");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService resolvedStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get ongoingStatuses(){try{let t=Object.entries(this._customStatusMap.value).filter(([a,i])=>i.type==="ongoing");if(t)return t.map(a=>a[1])}catch(e){this.loggingService.catch("Error in CustomFilterService ongoingStatuses: ",e)}return[X.CommentAnnotationStatusMap.IN_PROGRESS]}get terminalStatuses(){try{return Object.entries(this._customStatusMap.value).filter(([t,a])=>a.type==="terminal").map(t=>t[1])}catch(e){this.loggingService.catch("Error in CustomFilterService terminalStatuses: ",e)}return[]}convertLegacyAnnotationStatus(e){try{if(typeof e.status=="string"||e.status===void 0){let t=Object.entries(this._customStatusMap.value),a=t.find(([i,c])=>c.type==="default");switch(e.status){case"open":a&&(e.status=a[1]);break;case"inProgress":let i=t.find(([m,h])=>h.type==="ongoing");i&&(e.status=i[1]);break;case"resolved":let c=t.find(([m,h])=>h.type==="terminal");c&&(e.status=c[1]);break;default:a&&(e.status=a[1]);break}}return e}catch(t){return this.loggingService.catch("Error in CustomFilterService convertLegacyAnnotation: ",t),e}}convertLegacyPriority(e){try{typeof e.priority=="string"&&(e.priority=X.CommentAnnotationPriorityMap[e.priority])}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyPriority: ",t)}return e}convertLegacyCategory(e){try{if(e.commentCategories===void 0||e.commentCategories===null||!Array.isArray(e.commentCategories)||e.commentCategories.length===0)return e;typeof e.commentCategories[0]=="string"&&(e.commentCategories=e.commentCategories.map(t=>X.CommentCategoryMap[t]))}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyCategory: ",t)}return e}};o.\u0275fac=function(t){return new(t||o)(be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Jb=(()=>{let o=class o{constructor(e,t){this.domService=e,this.loggingService=t,this.keyEventSubject$=new Gt;try{this.loggingService.log("%c[WB] Creating CLASS: HotkeyService","color: blue;"),this.keyEvent$=this.keyEventSubject$.asObservable().pipe(ah()),this.domService.onWindowKeydown$().subscribe(a=>{this.keyEventSubject$.next(a)})}catch(a){this.loggingService.catch("Error in HotkeyService constructor: ",a)}}getKeyPressEvent(e,t={}){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getKeyPressEvent","color: green;"),this.keyEvent$.pipe(jt(a=>a?.key===e),jt(a=>!(!!t?.includeCtrl!==a.ctrlKey||!!t?.includeAlt!==a.altKey||!!t?.includeShift!==a.shiftKey||!!t?.includeMeta!==a.metaKey)),jt(()=>this.isNoInputFocused()))}catch(a){return this.loggingService.catch("Error in HotkeyService getKeyPressEvent: ",a),new qp}}isNoInputFocused(){try{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;for(;e&&e?.tagName!=="BODY";){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e?.isContentEditable)return!1;e=e.parentElement??e.getRootNode()?.host??null}return!0}catch(e){return this.loggingService.catch("Error in HotkeyService isNoInputFocused: ",e),!1}}};o.\u0275fac=function(t){return new(t||o)(be(Ne),be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Iy=["access","accessFields"];function Dy(r){return r?Object.keys(r).length>0:!1}var ie=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z,$,G,Z,ae,pe,Se,oe,he,_e,Re,Ye,lt,Xe){this.analyticsService=e,this.commonDbService=t,this.configService=a,this.docService=i,this.databaseService=c,this.authService=m,this.domService=h,this.afAuth=_,this.avatarService=I,this.contactService=S,this.storageService=z,this.functions=$,this.dialog=G,this.iamService=Z,this.loggingService=ae,this.notificationService=pe,this.customFilterService=Se,this.hotkeyService=oe,this.serviceBook=he,this.buttonService=_e,this.metadataService=Re,this.commonDbUtilsService=Ye,this.attachmentResolverService=lt,this.userPermissionService=Xe,this.endpointsService=se(_b),this.customPinsById=new Map,this.commentAdded$=new Gt,this.commentUpdated$=new Gt,this.commentAccepted$=new Gt,this.commentRejected$=new Gt,this.commentAnnotationDeleted$=new Gt,this.multiThreadCommentAnnotationDeleted$=new Gt,this.commentAnnotationById$=new De(null),this.multiThreadCommentAnnotationById$=new De(null),this.ghostCommentAnnotationMap$=new De({}),this.unreadCommentsMap$=new De(null),this.documentPaths=null,this.user=null,this.customCategoryMap=X.CommentCategoryMap,this.allowedElementIds$=new De([]),this.allowedElementClassNames$=new De([]),this.allowedElementQuerySelectors$=new De([]),this.addCommentMode$=new De(!1),this.persistentCommentMode$=new De(!1),this.seenByUsers$=new De(!0),this.deleteReplyConfirmation$=new De(!1),this.persistentModeBanner$=new De(!0),this.commentAddedEmitter=null,this.commentContextProvider=null,this.textCommentMode$=new De(!0),this.sidebarVisible$=new De(!1),this.sidebarOpenedByCustomTrigger$=new De(!1),this.floatingCommentsEnabled$=new De(!0),this.moderatorMode$=new De(!1),this.streamMode$=new De(!1),this.enableSignInButton$=new De(!1),this.enableUpgradeButton$=new De(!1),this.onSignInClick$=new Gt,this.onUpgradeClick$=new Gt,this.enableAttachment$=new De(!0),this.enableAttachmentDownload$=new De(!0),this.enableReactions$=new De(!0),this.enableAnonymousEmail$=new De(!0),this.enableFormatOptions$=new De(!1),this.formatConfig$=new De({bold:{enable:!0},italic:{enable:!0},underline:{enable:!0},strikethrough:{enable:!0}}),this.allowedRecordings$=new De(["audio","video","screen"]),this.openSidebar$=new Gt,this.showScreenSizeInfo$=new De(!1),this.showCommentIndex$=new De(!1),this.popoverMode$=new De(!1),this.popoverTriangleComponent$=new De(!0),this.draftMode$=new De(!0),this.enableDialogOnHover$=new De(!0),this.enableDialogOnTargetElementClick$=new De(!1),this.enablePriority$=new De(!1),this.enableStatus$=new De(!0),this.visibilityOptions$=new De(!1),this.enableResolve$=new De(!0),this.enableGhostComments$=new De(!1),this.enableGhostCommentsMessage$=new De(!0),this.inboxMode$=new De(!1),this.enableAutoCategorize$=new De(!1),this.commentContainerDarkMode$=new De(!1),this.suggestionMode$=new De(!1),this.mobileMode$=new De(!0),this.inlineCommentMode$=new De(!1),this.minimap$=new De(!1),this.commentsOnDom$=new De(!0),this.commentToolEnabled$=new De(!0),this.totalMediaLength$=new De(0),this.sidebarUrlNavigationEnabled$=new De(!1),this.detectionStrategy$=new De(Pu.DEFAULT),this.sidebarButtonOnCommentDialogVisible$=new De(!1),this.sidebarButtonOnCommentDialogClick$=new Gt,this.commentNavigationButtonClick$=new Gt,this.deviceIndicatorOnCommentPins$=new De(!1),this.sidebarCommentClick$=new Gt,this.privateCommentMode$=new De(!1),this.privateCommentAllowed$=new De(!1),this.privateModeConfig$=new De(null),this.scrollToComment$=new De(!0),this.userMentions$=new De(!0),this.paginatedContactList$=new De(!1),this.deleteOnBackspace$=new De(!0),this.hotkeyEnabled$=new De(!1),this.recordingSummaryEnabled$=new De(!0),this.unreadIndicatorMode$=new De(Rv.MINIMAL),this.composerMode$=new De(zh.DEFAULT),this.enterKeyToSubmit$=new De(!1),this.resolvedCommentsOnDom$=new De(!1),this.bubbleOnPinEnabled$=new De(!1),this.bubbleOnPinHoverEnabled$=new De(!0),this.pinDragEnabled$=new De(!0),this.excludeLocationIdsFromSidebar$=new De([]),this.multiThread$=new De(!1),this.groupMatchedComments$=new De(!1),this.restrictTextSearchToAnchor$=new De(!1),this.shortUserName$=new De(!0),this.collapsedComments$=new De(!1),this.collapsedRepliesPreview$=new De(!1),this.fullExpanded$=new De(!1),this.queryParamsComments$=new De(!1),this.resolveStatusAccessAdminOnly$=new De(!1),this.linkCallback$=new De(!1),this.svgAsImg$=new De(!1),this.commentToNearestAllowedElement$=new De(!1),this.filterCommentsOnDom$=new De(!1),this.maxReplyAvatars$=new De(3),this.replyAvatars$=new De(!1),this.commentplaceholder$=new De(void 0),this.replyplaceholder$=new De(void 0),this.editplaceholder$=new De(void 0),this.editcommentplaceholder$=new De(void 0),this.editreplyplaceholder$=new De(void 0),this.screenshotEnabled$=new De(!1),this.pinShadowDOM$=new De(!0),this.dialogShadowDOM$=new De(!0),this.dialogShadowDOMExplicit$=new De(void 0),this.textCommentToolShadowDOM$=new De(!0),this.pinDarkMode$=new De(null),this.textCommentToolDarkMode$=new De(null),this.textCommentToolbarDarkMode$=new De(null),this.textCommentToolbarShadowDOM$=new De(!0),this.sidebarShadowDOM$=new De(!0),this.changeDetectionInCommentMode$=new De(!1),this.commentSelectionChange$=new Gt,this.visibilityOptionClicked$=new Gt,this.submitComment$=new Gt,this.clearComposer$=new Gt,this.composerDataMap=new Map,this.commentsFromSidebarMap$=new De(null),this.sidebarButtonCountType$=new De("default"),this.filterGhostCommentsInSidebar$=new De(!1),this.commentSidebarFilters$=new De(null),this.effectiveSidebarFilters$=new De({}),this.customSidebarDataAnnotationIds$=new De(null),this.commentSidebarSystemFiltersOperator$=new De(Ur.AND),this.bubbleCommentAnnotationIds$=new De([]),this.updateCommentDialogPositionTriggerSubject$=new De(void 0),this.areaCommentEnabled$=new De(!0),this.commentPinCursorImage$=new De(""),this.commentAnnotationsFromCommentsContainer$=new De([]),this.customChipDropdownData$=new De(null),this.originalCommentAnnotationsByDocumentId$=new De({}),this.draftCommentAnnotationsByAnnotationId$=new De(null),this.draftMultiThreadCommentAnnotationsByAnnotationId$=new De({}),this.pendingAddCommentAnnotationData=new Map,this.copyLink$=new De(""),this.addCommentDragMode=!1,this.dragSubscriptions=[],this.hotkeySubscriptions=[],this.sidebarData$=new De(null),this.sidebarCustomActionEventData$=new De(null),this.sidebarCustomActionEventDataAllChanges$=new De(null),this.sidebarCustomActionEventDataOnInit$=new De(null),this.customActions$=new De(!1),this.focusedThreadMode$=new De(!1),this.openAnnotationInFocusMode$=new De(!1),this.customStatusesShown$=new De(!1),this.readOnly$=new De(!1),this.customAutocompleteSearch$=new De(!1),this.deleteThreadWithFirstComment$=new De(!0),this.assignToType$=new De("dropdown"),this.pageModeComposerContext$=new De(null),this.contextInPageModeComposer$=new De(!1),this.focusPageModeComposer$=new Gt,this.transformContext$=new De(null),this.expandMentionGroups$=new De(!1),this.showMentionGroupsFirst$=new De(!1),this.showMentionGroupsOnly$=new De(!1),this.fullScreenInSidebar$=new De(!1),this.composerFileAttachments$=new De(null),this.attachmentNameInMessage$=new De(!1),this.allowedFileTypes$=new De([]),this.forceCloseAllOnEsc$=new De(!1),this.autoCompleteScrollConfig$=new De({itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350}),this.commentAnnotationContextDraft=null,this.reactionService=null,this.areaService=null,this.viewsService=null,this.getCommentAnnotationForClient=Ve=>{try{let ht=["commentCategories","color","resolved","inProgress","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","position","documentParamsId","documentParams","ghostComment","areaAnnotationId","iam","commentSource","involvedUserIds","mentionedUserIds","viewedByUserIds","views"],Ze=JSON.parse(JSON.stringify(Ve)),Tt={};Object.keys(Ze).forEach(Lt=>{ht.includes(Lt)||(Tt[Lt]=Ze[Lt])}),Tt?.comments?.forEach(Lt=>{let We=[];Lt?.reactionAnnotationIds&&Lt?.reactionAnnotationIds?.forEach(Tu=>{let Ks=this.reactionService?.getAnnotationById(Tu);if(Ks){let Mc=this.reactionService.getReactionAnnotationForClient(Ks);We.push(Mc)}}),Lt.reactionAnnotations=We}),Ze?.viewedByUserIds?.forEach(Lt=>{let We=this.contactService.getUserBySnippylyId(Lt);We&&(Tt.viewedBy||(Tt.viewedBy=[]),Tt.viewedBy.push(We))}),this.user?.userSnippylyId&&(Tt.unread=!Ze?.viewedByUserIds?.includes(this.user.userSnippylyId));let Ue=Ze?.targetElement?.anchor?.fXPath||Ze?.targetElement?.fXpath;return Ue&&(Tt.basicAnchorData={xpath:Ue,topPercentage:Ze?.targetElement?.topPercentage||0,leftPercentage:Ze?.targetElement?.leftPercentage||0}),JSON.parse(JSON.stringify(Tt))}catch{return null}},this.loggingService.log("%c[WB] Creating CLASS: CommentService","color: blue;"),this.serviceBook.set(Dg,this),this.serviceBook.observe(Tg).subscribe(Ve=>{this.reactionService=Ve}),this.serviceBook.observe(xb).subscribe(Ve=>{this.areaService=Ve}),this.serviceBook.observe(Do).subscribe(Ve=>{this.viewsService=Ve}),this.domService.getSelectedAnnotationsMap$().pipe(Ov(100),wn()).subscribe(([Ve,ht])=>{try{if(this.draftCommentAnnotationsByAnnotationId$.value){let Ze=Object.keys(this.draftCommentAnnotationsByAnnotationId$.value||{}),Tt=[];Object.keys(Ve||{}).forEach(Lt=>{!ht?.[Lt]&&Ze.includes(Lt)&&Tt.push(Lt)});let Ue=JSON.parse(JSON.stringify(this.draftCommentAnnotationsByAnnotationId$.value||{}));Tt.forEach(Lt=>{delete Ue[Lt]}),an(Ue,this.draftCommentAnnotationsByAnnotationId$.value)||this.draftCommentAnnotationsByAnnotationId$.next(Ue)}}catch{}}),this.docService.getDocumentPaths$().pipe(wn()).subscribe(([Ve,ht])=>{Ve?.documentId!==ht?.documentId&&this.unreadCommentsMap$.next(null),ht&&this.shouldEnableReadOnly()},Ve=>{this.loggingService.catch("Error in CommentService getDocumentPaths$ subscription: ",Ve)}),this.draftCommentAnnotationsByAnnotationId$.pipe(wn()).subscribe(([Ve,ht])=>{try{if(this.pendingAddCommentAnnotationData.size===0)return;let Ze=Object.keys(Ve||{});if(Ze.length===0)return;let Tt=new Set(Object.keys(ht||{}));Ze.forEach(Ue=>{!Tt.has(Ue)&&this.pendingAddCommentAnnotationData.has(Ue)&&this.pendingAddCommentAnnotationData.delete(Ue)})}catch(Ze){this.loggingService.catch("Error in CommentService pendingAddCommentAnnotationData reconcile: ",Ze)}}),this.authService.getUser$().subscribe(Ve=>{Ve||this.resetCacheData()},Ve=>{this.loggingService.catch("Error in CommentService getUser$ subscription: ",Ve)}),this.authService.getUser$().pipe(Me(Ve=>Ve?kr([this.iamService.isUserAdmin$(),this.contactService.getUserOrganizationContacts$()]).pipe(Oe(([ht,Ze])=>{let Tt=!1;return Ze?.find(Ue=>Ue.userId===Ve?.userId)&&(Tt=!0),{isUserAdmin:ht,isOrgUser:Tt}})):Ee({isUserAdmin:!1,isOrgUser:!1}))).subscribe(({isUserAdmin:Ve,isOrgUser:ht})=>{let Ze=Ve||ht;Ze!==this.privateCommentAllowed$.value&&this.privateCommentAllowed$.next(Ze)}),this.databaseService.getDb().pipe(jt(Ve=>!!Ve),Jn(1)).subscribe(Ve=>{Ve&&this.getDocumentPaths()},Ve=>{this.loggingService.catch("Error in CommentService getDb subscription: ",Ve)}),this.domService.onWindowPointerMove$().subscribe(Ve=>{if(this.addCommentMode$.value){let ht=!0;if(this.addCommentDragMode)this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{let Ze=this.domService.getBackgroundElement(Ve.clientX,Ve.clientY,!0,!0);if(Ze&&gb(Ze,{x:Ve.clientX,y:Ve.clientY})&&(Ze=Ze?.parentElement),Ze)if(this.isElementInsideAllowedElements(Ze))if(eo(Ve.target))this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{this.domService.addClassToElement(document.body,"show-pin-cursor"),this.hightlightElement&&this.hightlightElement!==Ze&&this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=Ze;let Tt=this.domService.getSelectedAnnotationsMap("comment")||{},Ue=this.commentPinCursorImage$.value||X.CURSOR.COMMENT_PIN;this.domService.highlightElement(this.hightlightElement,Ue,!!Object.keys(Tt)?.length),ht=!1}else this.domService.removeClassFromElement(document.body,"show-pin-cursor")}this.hightlightElement&&ht&&(this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=null)}},Ve=>{this.loggingService.catch("Error in CommentService onWindowPointerMove$ subscription: ",Ve)}),this.domService.onWindowKeyupEsc$().subscribe(Ve=>{if(this.addCommentMode$.value){let ht=this.domService.getSelectedAnnotationsMap("comment")||{};Object.keys(ht)?.length&&this.domService.resetSelectedAnnotationsMap(),this.disableAddCommentMode()}},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupEsc$ subscription: ",Ve)}),this.domService.onDocumentClick$().subscribe(Ve=>{if(Ve&&!_g(Ve)){let ht=this.domService.getSelectedAnnotationsMap("comment")||{};if(ht=g(g({},ht),this.domService.getSelectedAnnotationsMap("multiThread")||{}),ht=g(g({},ht),this.domService.getSelectedAnnotationsMap("suggestion")||{}),Object.keys(ht)?.length&&(this.domService.resetSelectedAnnotationsMap(),this.persistentCommentMode$?.value)){this.addCommentMode$.value&&this.detectToAddAreaComment(),Ve.preventDefault(),Ve.stopPropagation();return}}if(Ve&&this.addCommentMode$.value&&!eo(Ve.target)){let ht=!1;if(this.addCommentDragMode)Ve.preventDefault(),Ve.stopPropagation(),this.addCommentDragMode=!1;else if(!this.domService.getDraftCommentAnnotationDialogs()?.length){let Ze=this.domService.getBackgroundElement(Ve.clientX,Ve.clientY);if((this.persistentCommentMode$?.value&&this.domService.getBackgroundVeltElement(Ve.clientX,Ve.clientY)||Ve&&_g(Ve))&&(Ze=null),Ze&&(this.isElementInsideAllowedElements(Ze)||this.getCommentToNearestAllowedElement()&&this.getNearestAllowedElement(Ze))&&(ht=this.isElementInsideManualCommentContainer(Ze),!ht)){Ve.preventDefault(),Ve.stopPropagation();let Tt=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment(Ve,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Tt)}}this.persistentCommentMode$?.value?this.detectToAddAreaComment():ht||this.disableAddCommentMode()}},Ve=>{this.loggingService.catch("Error in CommentService onDocumentClick$ subscription: ",Ve)}),this.addCommentMode$.subscribe(Ve=>{this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement),Ve?(this.domService.addClassToElement(document.body,"snippyly-add-comment-mode"),this.detectToAddAreaComment(),this.addIframeContainerStaticAttribute()):(this.removeIframeContainerStaticAttribute(),this.domService.removeClassFromElement(document.body,"snippyly-add-comment-mode"),this.domService.removeClassFromElement(document.body,"show-pin-cursor"),this.dragSubscriptions.forEach(ht=>ht.unsubscribe()),this.clearFreeStyleCommentContext())},Ve=>{this.loggingService.catch("Error in CommentService addCommentMode$ subscription: ",Ve)}),this.domService.onWindowKeyupBackspace$().subscribe(Ve=>{this.getDeleteOnBackspace()&&this.deleteCommentPinAnnotations("keyupBackspace")},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupBackspace$ subscription: ",Ve)}),this.domService.onWindowKeyupDelete$().subscribe(Ve=>{this.deleteCommentPinAnnotations("keyupDelete")},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",Ve)}),this.domService.getDeleteCommmentAnnotations$().subscribe(Ve=>{Ve?.length&&(Ve?.filter(Ze=>!["tag","recorder","rewriter","arrow","area","multiThread"].includes(Ze.type))).forEach(Ze=>Pe(this,null,function*(){yield this.deleteCommentPinAnnotation(Ze)}))},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",Ve)}),this.getPopoverMode$().subscribe(Ve=>{Ve?document?.body?.setAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE,"true"):document?.body?.removeAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE)},Ve=>{this.loggingService.catch("Error in CommentService getPopoverMode subscription: ",Ve)}),this.customFilterService.customCategoryMap$.subscribe(Ve=>{this.customCategoryMap=Ve},Ve=>{this.loggingService.catch("Error in CommentService customCategoryMap$ subscription: ",Ve)}),this.hotkeyEnabled$.subscribe(Ve=>{Ve?this.subscribeHotkeyEvents():this.unsubscribeHotkeyEvents()},Ve=>{this.loggingService.catch("Error in CommentService hotkeyEnabled$ subscription: ",Ve)}),this.domService.getSelectedAnnotationsMap$().pipe(wn()).subscribe(([Ve,ht])=>{try{let Ze=Object.values(Ve||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type)),Tt=Object.values(ht||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type));Ze?.forEach(Ue=>{Tt?.find(Lt=>Lt.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!1})}),Tt?.forEach(Ue=>{Ze?.find(Lt=>Lt.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!0})})}catch(Ze){this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$: ",Ze)}},Ve=>{this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$ subscription: ",Ve)})}clearCache(){try{this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in CommentService","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear(),this.customAutocompleteSearch$.next(!1),this.hightlightElement=null,this.addCommentMode$.next(!1),this.unreadCommentsMap$.next(null),this.documentPaths=null,this.commentsFromSidebarMap$.next(null),this.customSidebarDataAnnotationIds$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearCache: ",e)}}setCommentActionsService(e){try{this.commentActionsService=e}catch(t){this.loggingService.catch("Error in CommentService setCommentActionsService: ",t)}}detectToAddAreaComment(){try{let e=this.areaService?.getAreaEnabled()??!1,t=this.getAreaCommentEnabled();if(e&&t){let a,i,c,m=null,h=null;this.dragSubscriptions.forEach(_=>_.unsubscribe()),this.dragSubscriptions.push(this.domService.onWindowMouseDown$().pipe(jt(_=>!(_&&_g(_))),Jn(1)).subscribe(_=>{m=null,h=null,this.dragSubscriptions.push(this.domService.getClickAndDragPointsObservable().subscribe(I=>{if(m===null){let S=I?.startPoint?.event?.target,z=Nc(S),$=eo(S),G=this.isElementInsideAllowedElements(S);m=!z&&!$&&G}if(m){this.addCommentDragMode=!0,a=I.startPoint,i=I.curPoint;let S=I?.curPoint?.event?.target,z=Nc(S),$=eo(S),G=this.isElementInsideAllowedElements(S);h=!z&&!$&&G,h?c=this.domService.drawRectangle(a,i):c?.remove()}})),this.domService.onWindowPointerUp$().pipe(Zs(1),Jn(1)).subscribe(I=>{if(i={x:I.clientX,y:I.clientY},a&&i&&(c?.remove(),m&&h)){let S=[{x:a.x-window.scrollX,y:a.y-window.scrollY},{x:i.x,y:i.y}],z=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment(I,void 0,S,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,z)}this.dragSubscriptions.forEach(S=>S.unsubscribe())})}))}}catch(e){this.loggingService.catch("Error in CommentService detectToAddAreaComment: ",e)}}resetCacheData(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: resetCacheData","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear()}catch(e){this.loggingService.catch("Error in CommentService resetCacheData: ",e)}}addAreaContainerTag(){try{if(!(document.querySelector(X.TAGS.VELT_AREAS)||document.querySelector(X.TAGS.SNIPPYLY_AREAS))){let t=document.createElement(X.TAGS.VELT_AREAS);document.body.appendChild(t)}}catch(e){this.loggingService.catch("Error in CommentService addAreaContainerTag: ",e)}}addIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER}]`).forEach(t=>{window.getComputedStyle(t).position==="static"&&t.setAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC,"true")})}catch(e){this.loggingService.catch("Error in CommentService addIframeContainerStaticAttribute: ",e)}}removeIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC}]`).forEach(t=>{t.removeAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC)})}catch(e){this.loggingService.catch("Error in CommentService removeIframeContainerStaticAttribute: ",e)}}subscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: subscribeHotkeyEvents","color: green;"),this.unsubscribeHotkeyEvents(),this.hotkeySubscriptions.push(this.hotkeyService.getKeyPressEvent("c").subscribe(e=>{e&&!this.addCommentMode$.value&&this.enableAddCommentMode()},e=>{this.loggingService.catch("Error in CommentService hotkeyService.getKeyPressEvent subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CommentService subscribeHotkeyEvents: ",e)}}unsubscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribeHotkeyEvents","color: green;"),this.hotkeySubscriptions.forEach(e=>e?.unsubscribe())}catch(e){this.loggingService.catch("Error in CommentService unsubscribeHotkeyEvents: ",e)}}setCommentAddedEmitter(e){try{this.commentAddedEmitter=e}catch(t){this.loggingService.catch("Error in CommentService setCommentAddedEmitter: ",t)}}setContextProvider(e){try{this.commentContextProvider=e}catch(t){this.loggingService.catch("Error in CommentService setContextProvider: ",t)}}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$()}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}setAllowedElementIds(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementIds:e}}),this.allowedElementIds$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementIds: ",t)}}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}setAllowedElementClassNames(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementClassNames:e}}),this.allowedElementClassNames$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementClassNames: ",t)}}getAllowedElementClassNames(){return this.allowedElementClassNames$.asObservable()}setAllowedElementQuerySelectors(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementQuerySelectors:e}}),this.allowedElementQuerySelectors$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementQuerySelectors: ",t)}}getAllowedElementQuerySelectors(){return this.allowedElementQuerySelectors$.asObservable()}getAllCommentAnnotations({customClientDocumentId:e,params:t,excludeDomChanges:a,detectGhostComments:i,skipPositionCalculation:c,query:m,fromCommentSidebar:h,analytics:_,addFilterCommentsOnDomCheck:I}){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentAnnotations","color: green;");let S,z,$;_?.enabled&&this.analyticsService.trackEvent(_?.eventName||ne.Events.Comments.GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED_INTERNAL,_?.properties);try{if(e&&($=`${wo(e)}`),t&&typeof t=="object"){let G=Nu(t);z=G?.id,S=wo(JSON.stringify(G))}}catch(G){this.loggingService.catch("Error in CommentService getAllCommentAnnotations: ",G)}return this.authService.getAuthState$().pipe(jt(G=>!!G),Me(G=>this.isFeatureAllowed({firebaseUser:G,annotations:[],filteredAnnotations:[]})),Me(G=>G.featureAllowed?this.iamService.isUserAllowed$().pipe(Oe(Z=>(G.featureAllowed=Z,G))):Ee(G)),Me(G=>G.featureAllowed?Ee(G).pipe(Me(Z=>this.docService.getDocumentPaths$().pipe(Oe(ae=>(this.documentPaths=ae,Z.documentPaths=ae,Z)))),Me(Z=>m?.documentIds?.length||$?this.getDataFromDocumentIds({documentIds:$?[$]:m?.documentIds?.map(ae=>`${wo(ae)}`),organizationId:this.documentPaths?.organizationId,query:m}).pipe(Oe(ae=>({res:Z,data:ae}))):this.docService.getDocumentIds$().pipe(Me(ae=>{let pe=ae?.length>0?ae.map(Se=>Se.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds({documentIds:pe.length>0?pe:[$??""],organizationId:this.documentPaths?.organizationId,query:m}).pipe(Oe(Se=>({res:Z,data:Se})))}))),Me(Z=>Z?.data?(Z.res.annotations=Z.data||[],Ee(Z.res).pipe(Me(ae=>this.docService.getLocation$().pipe(Oe(pe=>(ae.location=pe,ae)))),Me(ae=>this.docService.getLocations$().pipe(Oe(pe=>(ae.customLocations=pe,ae)))),Me(ae=>this.docService.getExcludedLocationIds$().pipe(Oe(pe=>(ae.excludedLocationIds=pe,ae)))),Oe(ae=>{if(ae.filteredAnnotations=[],m)return ae.filteredAnnotations=ae.annotations?.slice(),ae;if($&&!S||h)return ae.filteredAnnotations=ae.annotations?.slice(),ae?.excludedLocationIds?.length&&(ae.filteredAnnotations=ae.filteredAnnotations?.filter(pe=>pe?.location?.id?!ae.excludedLocationIds.includes(pe.location.id):!0)),ae;{let pe=[],Se=[];return S?(pe.push(S),z&&Se.push(z)):(pe.push(ae?.location?.locationId),pe.push(...Object.values(ae?.customLocations||[]).map(oe=>oe.locationId)),ae?.location?.location?.id&&Se.push(ae?.location?.location?.id),Se.push(...Object.values(ae?.customLocations||{}).map(oe=>oe.location?.id).filter(oe=>!!oe))),ae.filteredAnnotations=this.filterAnnotationsByLocationIds(ae?.annotations,pe,Se),ae?.excludedLocationIds?.length&&(ae.filteredAnnotations=ae.filteredAnnotations?.filter(oe=>oe?.location?.id?!ae.excludedLocationIds.includes(oe.location.id):!0)),ae}}),Me(ae=>this.isPrivateCommentAllowed$().pipe(Oe(pe=>(pe||(ae.filteredAnnotations=ae.filteredAnnotations?.filter(Se=>!sr(Se))),ae)))),Me(ae=>this.draftCommentAnnotationsByAnnotationId$.pipe(Oe(pe=>(ae.filteredAnnotations=ae.filteredAnnotations?.filter(Se=>!Se.isDraft),pe&&ae.filteredAnnotations.push(...Object.values(pe)),ae)))),Me(ae=>a?Ee(ae):ae?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Oe(()=>ae)):Ee(ae)),Me(ae=>a?Ee(ae):this.addCommentMode$.pipe(Me(pe=>pe&&!this.getChangeDetectionInCommentMode()?Ee(ae):ae?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllCommentAnnotations").pipe(Oe(()=>ae)):Ee(ae)))),Oe(ae=>{if(!c){(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&(ae.filteredAnnotations=ae.filteredAnnotations?.map(Se=>{let oe=Object.assign({},Se);return this.calculateCommentAnnotationPosition(oe,i),oe}));let pe={};ae.filteredAnnotations?.forEach(Se=>{if(Se?.targetTextRange){let oe=this.domService.getElementFromTargetTextRange(Se?.targetTextRange);pe[Se.annotationId]=!!oe}}),ae.textAnnotationsElementMap=pe}return ae}),Me(ae=>ae?.annotations?.length?this.serviceBook.observe(Do).pipe(Me(pe=>pe?pe.getCommentFeatureViews$():Ee({})),Oe(pe=>(this.updateUnreadAnnotationsMap(ae?.annotations,pe),ae))):(Dy(this.unreadCommentsMap$.value)&&this.unreadCommentsMap$.next({}),Ee(ae))))):Ee(null))):Ee(null)),Oe(G=>{try{return typeof G=="object"&&G?JSON.parse(JSON.stringify(G)):G}catch{return G}}),gr((G,Z)=>Wr(G?.filteredAnnotations,Z?.filteredAnnotations)&&Wr(G?.textAnnotationsElementMap,Z?.textAnnotationsElementMap)),Me(G=>G?G?.filteredAnnotations?Ee(G?.filteredAnnotations||[]):Ee([]):Ee(null)),Me(G=>I?this.filterCommentsUsingSidebarSettings(G):Ee(G)))}getAllMultiThreadCommentAnnotations(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: getAllMultiThreadCommentAnnotations","color: green;");let h,_;try{if(e&&(_=wo(e)),t&&typeof t=="object"){let I=Nu(t);h=wo(JSON.stringify(I))}}catch(I){this.loggingService.catch("Error in CommentService getAllMultiThreadCommentAnnotations: ",I)}return this.authService.getAuthState$().pipe(jt(I=>!!I),Me(I=>this.isFeatureAllowed({firebaseUser:I,annotations:[],filteredAnnotations:[]})),Me(I=>I.featureAllowed?this.iamService.isUserAllowed$().pipe(Oe(S=>(I.featureAllowed=S,I))):Ee(I)),Me(I=>I.featureAllowed?Ee(I).pipe(Me(S=>this.docService.getDocumentPaths$().pipe(Oe(z=>(this.documentPaths=z,S.documentPaths=z,S)))),Me(S=>_?this.getMultiThreadDataFromDocumentIds([_]).pipe(Oe(z=>({res:S,data:z}))):this.docService.getDocumentIds$().pipe(Me(z=>{let $=z?.length>0?z.map(G=>G.documentId):[this.documentPaths?.documentId??""];return this.getMultiThreadDataFromDocumentIds($.length>0?$:[`${_}`]).pipe(Oe(G=>({res:S,data:G})))}))),Me(({res:S,data:z})=>z?(S.annotations=z||[],Ee(S).pipe(Me($=>this.docService.getLocation$().pipe(Oe(G=>($.location=G,$)))),Me($=>this.docService.getLocations$().pipe(Oe(G=>($.customLocations=G,$)))),Me($=>this.docService.getExcludedLocationIds$().pipe(Oe(G=>($.excludedLocationIds=G,$)))),Oe($=>{if($.filteredAnnotations=[],_&&!h)return $.filteredAnnotations=$.annotations?.slice(),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(G=>G?.location?.id?!$.excludedLocationIds.includes(G.location.id):!0)),$;{let G=[],Z=[];return h?G.push(h):(G.push($?.location?.locationId),G.push(...Object.values($?.customLocations||[]).map(ae=>ae.locationId)),$?.location?.location?.id&&Z.push($?.location?.location?.id),Z.push(...Object.values($?.customLocations||{}).map(ae=>ae.location?.id).filter(ae=>!!ae))),$.filteredAnnotations=this.filterAnnotationsByLocationIds($?.annotations,G,Z),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(ae=>ae?.location?.id?!$.excludedLocationIds.includes(ae.location.id):!0)),$}}),Me($=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Oe(G=>($.filteredAnnotations=$.filteredAnnotations?.filter(Z=>!Z.isDraft),G&&$.filteredAnnotations.push(...Object.values(G)),$)))),Me($=>a?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Oe(()=>$)):Ee($)),Me($=>a?Ee($):this.addCommentMode$.pipe(Me(G=>G&&!this.getChangeDetectionInCommentMode()?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllMultiThreadCommentAnnotations").pipe(Oe(()=>$)):Ee($)))),Oe($=>(c||(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&($.filteredAnnotations=$.filteredAnnotations?.map(G=>{let Z=Object.assign({},G);return this.calculateCommentAnnotationPosition(Z,i),Z})),$)),Me($=>$?.filteredAnnotations?Ee($?.filteredAnnotations||[]):Ee([])))):Ee(null))):Ee(null)),gr(Wr),Me(I=>m?this.filterCommentsUsingSidebarSettings(I):Ee(I)))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(jt(t=>!!t),Oe(t=>f(g({},e),{config:t})),Me(t=>this.authService.getUser$().pipe(Oe(a=>(this.user=a,f(g({},t),{user:a}))))),Me(t=>Kh(t.config,t.user,ke.COMMENT)?Ee(f(g({},t),{featureAllowed:!0})):(this.loggingService.warn("Comment feature is not allowed."),Ee(f(g({},t),{featureAllowed:!1})))),gr((t,a)=>t?.featureAllowed===a?.featureAllowed))}buildVisibilityTokens(e){return Pe(this,null,function*(){try{let a=this.authService.getUser()?.clientOrganizationId,i=a?yield this.isViewerOrgMembershipConfirmed(e,a):!1;return Fu({userId:e,clientOrganizationId:i?a:void 0,fallbackServerOrganizationId:a?void 0:this.documentPaths?.organizationId})}catch(t){this.loggingService.catch("Error in CommentService buildVisibilityTokens: ",t);try{return[X.DEFAULT_VELT_CONTEXT,`${X.VISIBILITY_SELF_PREFIX}${mr(e)}`]}catch{return[X.DEFAULT_VELT_CONTEXT]}}})}isViewerOrgMembershipConfirmed(e,t){return Pe(this,null,function*(){try{let i=(yield this.userPermissionService.getUserPermissionsFromCacheOrFetch({organizationId:t}))?.[e]?.organization?.[t];return!!i&&i.errorCode!==kg.PERMISSION_DENIED}catch(a){return this.loggingService.catch("Error in CommentService isViewerOrgMembershipConfirmed: ",a),!1}})}getDataFromDocuments(e){let{documentIds:t,organizationId:a,query:i}=e;if(!this.configService?.getApiKey())return Ee(null);if(t?.some(z=>!z)||!this.documentPaths)return Ee(null);let c,m,h=[];if(i)i?.folderId&&(c=dr(i?.folderId)),i?.locationId&&(h=[...h,i?.locationId]),i?.locationIds?.length&&(h=[...h,...i?.locationIds]),m=i?.statusIds;else{c=this.docService.getDocumentPaths()?.veltFolderId;let z=this.docService.getDocumentPaths()?.locationId;z&&(h=[...h,z])}let _={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(_.documentId=t?.length?t[0]:void 0,_.organizationId=this.documentPaths?.organizationId);let I=this.authService.getUser()?.userId;if(!I)return Ee(null);let S=this.authService.getIsPrivateCommentsEnabled();return th(()=>(S?_n(this.buildVisibilityTokens(I)):Ee([X.DEFAULT_VELT_CONTEXT])).pipe(Me($=>{let G=this.userPermissionService?.getIsContextEnabled()?this.docService.getProcessedDocContext():[],Z=[...$,...G],ae=this.userPermissionService?.getIsContextEnabled(),pe;if(ae){let Se=[];for(let oe=0;oe<Z.length;oe+=X.LISTENER_CONTEXT_BATCH_SIZE)Se.push(Z.slice(oe,oe+X.LISTENER_CONTEXT_BATCH_SIZE));this.loggingService.logContext("[CONTEXT] getDataFromDocuments called with accessFields:",JSON.parse(JSON.stringify(Z??"nil"))),pe=kr(Se.map(oe=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},_),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",a??this.documentPaths?.organizationId),Qe("metadata.documentId","in",t),...m?.length?[Qe("status.id","in",m)]:[],...c?[Qe("metadata.veltFolderId","==",c)]:[],...h?.length?[Qe("location.id","in",h)]:[],...oe?.length?[Qe("context.accessFields","array-contains-any",oe)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Pc()))).pipe(Oe(oe=>Lc(JSON.parse(JSON.stringify(oe)))))}else{let Se=[];for(let oe=0;oe<(t?.length??0);oe+=X.LISTENER_BATCH_SIZE)Se.push(t?.slice(oe,oe+X.LISTENER_BATCH_SIZE)??[]);pe=kr(Se.map(oe=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},_),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",a??this.documentPaths?.organizationId),Qe("metadata.documentId","in",oe),...m?.length?[Qe("status.id","in",m)]:[],...c?[Qe("metadata.veltFolderId","==",c)]:[],...h?.length?[Qe("location.id","in",h)]:[],...Z?.length&&S?[Qe("context.accessFields","array-contains-any",Z)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Pc()))).pipe(Oe(oe=>Lc(JSON.parse(JSON.stringify(oe)))))}return pe.pipe(Me(Se=>Se?.data?Ee(Se).pipe(Me(oe=>this.commonDbUtilsService.mergeLocationMetadataWithData$({data:oe,feature:"allComments"}).pipe(Oe(he=>({data:Object.values(he?.data||{}).filter(_e=>typeof _e=="object"),operation:he?.operation})))),Oe(({data:oe,operation:he})=>{let _e=oe.reduce((Re,Ye)=>{let lt=Ye.metadata?.documentId;return lt&&(Re[lt]||(Re[lt]=[]),Re[lt].push(Ye)),Re},{});return{data:oe,documentMap:_e,operation:he}}),Oe(({data:oe,documentMap:he,operation:_e})=>m?{data:oe,documentMap:he,operation:_e}:(oe?.length&&(oe?.forEach(Re=>{this.sanitizeCommentAnnotation(Re)}),this.setAnnotationIndex(oe),this.updateAnnotationsForSelectAllContentMode(oe),oe.forEach(Re=>{this.customFilterService.convertLegacyAnnotationStatus(Re),this.customFilterService.convertLegacyPriority(Re),this.customFilterService.convertLegacyCategory(Re)})),{data:oe,documentMap:he,operation:_e})),yn(oe=>(this.loggingService.catch("Error in CommentService getDataFromDocuments: ",oe),Ee([]))),Ac(({documentMap:oe})=>{m||Object.entries(oe??{}).forEach(([he,_e])=>{this.setOriginalCommentAnnotationsByAnnotationId(JSON.parse(JSON.stringify(_e)))})}),Oe(({data:oe,documentMap:he,operation:_e})=>({data:this.filterUserDraftComments(oe),documentMap:he,operation:_e})),Oe(({data:oe,documentMap:he,operation:_e})=>({data:this.removeDraftFlags(oe),documentMap:he,operation:_e})),Me(({data:oe,documentMap:he,operation:_e})=>m?Ee({data:oe,documentMap:he,operation:_e}):this.mergeDraftAnnotations(oe).pipe(Oe(Re=>({data:Re,documentMap:he,operation:_e})))),Oe(({data:oe,documentMap:he,operation:_e})=>{if(!m)if(_e?.type==="removed"){if(_e?.ids?.length){let Re=this.commentAnnotationById$.value??{};_e?.ids?.forEach(Ye=>{delete Re?.[Ye]}),this.commentAnnotationById$.next(Re)}}else Object.entries(he??{}).length?Object.entries(he??{}).forEach(([Ye,lt])=>{this.setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:Ye,annotations:lt})}):this.commentAnnotationById$.value||this.commentAnnotationById$.next({});return oe})):Ee(null)))})))}fetchCommentAnnotations(e){return Pe(this,null,function*(){try{let t=this.authService.getUser();if(!t)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),{data:[],hasMore:!1};let a=this.configService?.getApiKey(),i=e?.organizationId??t?.clientOrganizationId,c=Uv(i??""),m=[];e?.allDocuments||(m=e?.documentIds?.map(pe=>xg(pe??""))??this.docService.getDocumentIds()?.map(pe=>pe.documentId));let h=[];if(h.push(Qe("metadata.organizationId","==",c)),h.push(Qe("metadata.apiKey","==",a)),e?.folderId){let pe=dr(e?.folderId);h.push(Qe("metadata.veltFolderId","==",pe))}if(e?.locationId&&h.push(Qe("location.id","==",e?.locationId)),m?.length&&h.push(Qe("metadata.documentId","in",m)),e?.resolvedBy){if(e?.order==="asc")throw new Error("Order by resolvedBy is not supported in ascending order.");h.push(Qe("resolvedByUserId","==",e?.resolvedBy))}if(e?.mentionedUserIds?.length){if(e?.order==="asc")throw new Error("Order by mentionedUserIds is not supported in ascending order.");h.push(Qe("mentionedUserIds","array-contains-any",e?.mentionedUserIds))}if(e?.userIds?.length){if(e?.order==="asc")throw new Error("Order by userIds is not supported in ascending order.");h.push(Qe("from.userId","in",e?.userIds))}if(e?.statusIds?.length){if(e?.order==="asc")throw new Error("Order by status id is not supported in ascending order.");h.push(Qe("status.id","in",e?.statusIds))}let _=new Date().getTime();if(e?.createdAfter&&h.push(Qe("createdAt",">=",e?.createdAfter)),e?.createdBefore&&h.push(Qe("createdAt","<=",e?.createdBefore??_)),e?.updatedAfter&&h.push(Qe("lastUpdated",">=",e?.updatedAfter??_)),e?.updatedBefore&&h.push(Qe("lastUpdated","<=",e?.updatedBefore??_)),h.push(Xt("lastUpdated",e?.order??"desc"),Xt("createdAt",e?.order??"desc")),e?.pageToken){let pe=yield qh(e?.pageToken??"","veltencrypttoken","veltencrypttoken");h.push(Ib(parseInt(pe,10),"lastUpdated"))}let I=e?.pageSize??100;h.push(wb(I+1));let S=yield this.commonDbService.queryData({feature:"allComments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:h,apiKey:a??"",organizationId:c}}),z=S.length>I;S=S.slice(0,I);let $=S?.reduce((pe,Se)=>(pe[Se?.annotationId]=Se,pe),{});$=yield this.commonDbUtilsService.formatResponse({feature:"allComments",data:$,shouldAwait:!0}),$=this.commonDbUtilsService.mergeUsersWithData({feature:"allComments",data:$});let G=t.clientOrganizationId?yield this.isViewerOrgMembershipConfirmed(t.userId,t.clientOrganizationId):!1,Z=Fu({userId:t.userId,clientOrganizationId:G?t.clientOrganizationId:void 0,fallbackServerOrganizationId:t.clientOrganizationId?void 0:c});return{data:Yh(Object.values($??{}),{userId:t.userId,tokens:Z}),hasMore:z}}catch(t){throw this.loggingService.catch("Error in CommentService fetchCommentAnnotations:",t),t}})}filterUserDraftComments(e){let t=this.authService.getUser();return e.filter(a=>(a.comments=a?.comments?.filter(i=>i?.from?.userId===t?.userId||!i?.isDraft),!!a?.comments?.length))}removeDraftFlags(e){return e.forEach(t=>delete t.isDraft),e}mergeDraftAnnotations(e){return this.draftCommentAnnotationsByAnnotationId$.pipe(Oe(t=>{let a=t||{};return e?.filter(i=>{a?.[i?.annotationId]&&delete a[i?.annotationId]}),a}),Oe(t=>{if(t){let a=e.slice();return a.push(...Object.values(t)),a}return e}))}getDataFromDocumentIds({documentIds:e,organizationId:t,query:a}){return this.getDataFromDocuments({documentIds:e,organizationId:t,query:a})}getMultiThreadDataFromDocumentIds(e){return this.getMultiThreadDataFromDocuments({documentIds:e})}getMultiThreadDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t}=e;if(t?.some(m=>!m)||!this.documentPaths)return Ee(null);let a=this.docService.getDocumentPaths()?.veltFolderId,i=Ee([]),c={useCollectionGroup:!0,isCollection:!0,useQuery:!0};if(this.commonDbService.shouldUseFirestore()||(c.documentId=t?.length?t[0]:void 0,c.organizationId=this.documentPaths?.organizationId),this.userPermissionService?.getIsContextEnabled()){let m=[X.DEFAULT_VELT_CONTEXT,...this.docService.getProcessedDocContext()],h=[];for(let _=0;_<(m?.length??0);_+=X.LISTENER_CONTEXT_BATCH_SIZE)h.push(m?.slice(_,_+X.LISTENER_CONTEXT_BATCH_SIZE)??[]);i=kr(h.map(_=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",t),...a?[Qe("metadata.veltFolderId","==",a)]:[],..._?.length?[Qe("context.accessFields","array-contains-any",_)]:[])]})}).pipe(Pc()))).pipe(Oe(_=>Lc(_)))}else{let m=[];for(let h=0;h<(t?.length??0);h+=X.LISTENER_BATCH_SIZE)m.push(t?.slice(h,h+X.LISTENER_BATCH_SIZE)??[]);i=kr(m.map(h=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",h),...a?[Qe("metadata.veltFolderId","==",a)]:[])]})}).pipe(Pc()))).pipe(Oe(h=>Lc(h)))}return i.pipe(Me(m=>m?.data?Ee(m).pipe(Oe(h=>({data:h?.data,operation:h?.operation})),Oe(({data:h,operation:_})=>{let I=[];return h&&(I=Object.values(h??{}).filter(S=>typeof S=="object")),{data:I,operation:_}}),yn(h=>(this.loggingService.catch("Error in CommentService getMultiThreadDataFromDocumentId: ",h),Ee({data:[],operation:null}))),Oe(({data:h,operation:_})=>{h.forEach(S=>{delete S.isDraft});let I=h.reduce((S,z)=>{let $=z.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(z)),S},{});return{data:h,documentMap:I,operation:_}}),Me(({data:h,documentMap:_,operation:I})=>{let S=[];return this.commentAnnotationById$.pipe(Me(()=>this.domService.getSelectedAnnotationsMap$().pipe(Oe(z=>({selectedAnnotationsMap:z})))),Oe(({selectedAnnotationsMap:z})=>{let $={};return Object.keys(_??{}).forEach(G=>{let Z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:G});Z&&Z?.forEach(ae=>{$[ae?.annotationId]=ae})}),S=h.filter(G=>{let Z=!1;if(G?.commentAnnotations){for(let ae in G?.commentAnnotations)if($?.[ae]&&$?.[ae]?.status?.id!==this.customFilterService.resolvedStatus.id){Z=!0;break}}return Z}),S.forEach(G=>{Object.keys(G?.commentAnnotations||{}).forEach(Z=>{G.commentAnnotationsMap||(G.commentAnnotationsMap={}),G.commentAnnotationsMap[Z]=$?.[Z]})}),{data:S,operation:I}}))}),Me(({data:h,operation:_})=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Oe(I=>{let S=I||{};return h?.filter(z=>{S?.[z?.annotationId]&&delete S[z?.annotationId]}),S}),Oe(I=>{if(I){let S=h.slice();return S.push(...Object.values(I)),{data:S,operation:_}}return{data:h,operation:_}}))),Oe(({data:h,operation:_})=>{let I=h.reduce((S,z)=>{let $=z.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(z)),S},{});if(_?.type==="removed"){if(_?.ids?.length){let S=this.multiThreadCommentAnnotationById$.value;_?.ids?.forEach(z=>{delete S?.[z]}),this.multiThreadCommentAnnotationById$.next(S)}}else Object.keys(I??{}).forEach(S=>{this.setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:S,annotations:I[S]})});return h})):Ee(null)))}else return Ee(null)}updateUnreadAnnotationsMap(e,t){try{let a=new Date(X.UNREAD_COMMENTS_CHECK_FROM_DATE)?.getTime(),i=e.filter(c=>c?.lastUpdated>a);if(t){let c={},m=!1;i.forEach(h=>{let _=0,I=t?.[h?.annotationId];if(I){let S=I?.comments;S&&h?.comments?.forEach(z=>{S?.[z?.commentId]?.views?.[this.user?.userSnippylyId]||_++})}_?_!==c?.[h?.annotationId]&&(c[h?.annotationId]=_,m=!0):c?.[h?.annotationId]&&(delete c[h?.annotationId],m=!0)}),this.unreadCommentsMap$.next(c)}}catch(a){this.loggingService.catch("Error in CommentService updateUnreadAnnotationsMap:",a)}}updateAnnotationsForSelectAllContentMode(e){try{e.forEach(t=>{if(t?.selectAllContent&&t?.targetElementId){let a=zr(t.targetElementId,["id","data-id"]);if(a){let i=a.textContent;i&&(t.targetTextRange={commonAncestorContainer:this.domService.getXPath(a),text:i,occurrence:1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(a)??void 0},delete t?.targetElement)}}})}catch(t){this.loggingService.catch("Error in CommentService updateAnnotationsForSelectAllContentMode:",t)}}setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a?.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.commentAnnotationById$.value??{}),c);this.commentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Oe(()=>this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId$:",a),Ee([])}}getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a=null;this.commentAnnotationById$.value&&(a={},Object.values(this.commentAnnotationById$.value).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)}));let i=this.draftCommentAnnotationsByAnnotationId$.value;return i&&(a===null&&(a={}),Object.values(i).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)})),a?Object.values(a):null}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getCommentAnnotationsByDocumentId$({clientDocumentId:e,documentId:t}){try{return e&&!t&&(t=this.docService.generateDocumentId(e)),t?this.docService.getDocumentPaths$().pipe(Me(a=>this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:a?.organizationId,documentId:t}))):Ee(null)}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByDocumentId$:",a),Ee(null)}}getCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Me(e=>e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId}):[]}catch(e){return this.loggingService.catch("Error in CommentService getCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}setOriginalCommentAnnotationsByAnnotationId(e){try{let t={};e?.forEach(a=>{a?.annotationId&&(t[a?.annotationId]=a)}),this.originalCommentAnnotationsByDocumentId$.next(g(g({},this.originalCommentAnnotationsByDocumentId$.value),t))}catch(t){this.loggingService.catch("Error in CommentService setOriginalCommentAnnotationsByAnnotationId:",t)}}setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.multiThreadCommentAnnotationById$.value),c);this.multiThreadCommentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){return this.multiThreadCommentAnnotationById$.pipe(Oe(()=>this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a={};Object.values(this.multiThreadCommentAnnotationById$.value??{}).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)});let i=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;return i&&Object.values(i??{}).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)}),Object.values(a)}catch(a){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Me(e=>e?.documentId?this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId})}catch(e){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}getLocations$(){return this.docService.getLocation$().pipe(Me(e=>this.docService.getLocations$().pipe(Oe(t=>({location:e,locations:t})))),Oe(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(a=>a.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t,a){try{return e.filter(i=>t.includes(i.locationId)||a?.includes(i?.location?.id)||t?.find(c=>c==i?.location?.id)||a?.find(c=>c==i?.locationId+""))}catch(i){return this.loggingService.catch("Error in CommentService filterAnnotationsByLocations:",i),[]}}setAnnotationIndex(e){try{e.forEach((t,a)=>{t?.annotationId&&(t.annotationIndex=a+1)})}catch(t){this.loggingService.catch("Error in CommentService setAnnotationIndex:",t)}}calculateCommentAnnotationPosition(e,t){try{if(e.multiThreadAnnotationId)return;if(e.targetElementId){let a=zr(e.targetElementId,["id","data-id"]);if(a&&this.domService.isElementVisible(a)){let i=a.getAttribute(X.ATTRIBUTES.VELT_COMMENT_TYPE),c=!0;if(i)i==="popover"?c=!0:c=!1;else{let m=document.querySelector(`${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_INLINE_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_ELEMENT_ID}="${e.targetElementId}"]`);m&&a?.contains(m)&&(c=!1)}c?e.targetElement={xpath:this.domService.getXPath(a),fXpath:this.domService.getXPath(a,!0),cfXpath:this.domService.getXPath(a,!0,!0),topPercentage:e.targetElement?.topPercentage||50,leftPercentage:e.targetElement?.leftPercentage||90}:e.targetElement=null}else e.targetElement=null}if(e.targetElement){e.position=null,e.ghostComment=null;let a=e.targetElement?.xpath,i=null,c=e?.targetElement?.anchor;if(c){let h=this.domService.resolveAnchorRecord(c);h?.element&&this.domService.isElementVisible(h.element)&&un(h.element)&&(i=h.element)}else a&&(i=this.domService.getElementFromXPath(a),this.domService.isXpathWithId(a)||((!i||!this.domService.isElementVisible(i))&&e.targetElement?.cfXpath&&(a=e.targetElement?.cfXpath,i=this.domService.getElementFromXPath(a)),this.getDetectionStrategy()===Pu.DYNAMIC_ID&&(!i||!this.domService.isElementVisible(i))&&(a=e.targetElement?.fXpath,a&&(i=this.domService.getElementFromXPath(a)))));(!i||!this.domService.isElementVisible(i))&&t&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=this.getGhostCommentTargetElement(e),e?.ghostComment?.targetElement?.xpath&&(i=this.domService.getElementFromXPath(e?.ghostComment?.targetElement?.xpath)));let m=!1;if(e?.locationId){let h=this.docService.getLocation();if(!Ig({location:h?.location,locationId:h?.locationId},{location:e?.location,locationId:e?.locationId})){let _=this.docService.getAdditionLocationFromElement(i),I=_?this.docService.genarateLocationId(_):void 0;e?.location?.id&&e?.location?.id===_?.id||I&&I===e?.locationId?m=!1:m=!0}}if(m&&(e.ghostComment=null),!m&&i&&un(i)&&!i?.closest(".cdk-overlay-container")&&i?.getBoundingClientRect()){let _=this.popoverMode$?.value?0:e.targetElement?.topPercentage,I=this.popoverMode$?.value?100:e.targetElement?.leftPercentage,{height:S,width:z}=vb(i);e.position={top:S*(_||0)/100,left:z*(I||0)/100};let $=window.getComputedStyle(i).transform;if($&&$!=="none")try{let G=new DOMMatrixReadOnly($),Z=Math.sqrt(G.a*G.a+G.b*G.b)||1,ae=Math.sqrt(G.c*G.c+G.d*G.d)||1;(Math.abs(Z-1)>.01||Math.abs(ae-1)>.01)&&(e.position.parentScaleX=Z,e.position.parentScaleY=ae)}catch{}if(this.transformContext$.value){let{containerSelector:G,transforms:Z}=this.transformContext$.value,ae=document.querySelector(G);ae&&ae.contains(i)&&(e.position.transformContext=Z)}}!m&&t&&!e?.position&&!e?.ghostComment&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=e.targetElement)}t&&(e.ghostComment?this.addAnnotationToGhostCommentAnnotationMap(e):this.removeAnnotationFromGhostCommentAnnotationMap(e))}catch(a){this.loggingService.catch("Error in CommentService calculateCommentAnnotationPosition:",a)}}addComment(Ve,ht,Ze,Tt,Ue){return Pe(this,arguments,function*(e,t,a,i,c,m=[],h,_,I,S,z,$,G,Z,ae,pe,Se,oe,he,_e,Re,Ye,lt,Xe){this.loggingService.log("%c[WB] Calling FUNCTION: addComment","color: green;");try{let Lt=this.authService.getUser();if(Lt)if(Lt.isReadOnly||Lt.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add comments.");else{yield this.triggerAddCommentAnnotationDraftEvent();let We=new Nt;Se&&(We=g(g({},We),Se)),We.comments=[],Se?.comments?.length&&(We.comments=Se.comments.map(_t=>{let Ot=new qn;return Ot=g(g({},Ot),_t),Ot.from=Lt,Ot.lastUpdated=new Date,Ot.createdAt=this.timestamp,Ot})),We.from=Lt,We.color=We?.color||X.DEFAULT_ANNOTATION_COLOR,We.lastUpdated=this.timestamp,We.createdAt=this.timestamp,We.sourceId=ae,We.assignedTo=Se?.assignedTo||pe,We.customList=Se?.customList||[],Ye&&(We.targetElementId=Ye);let{topPositionX:Tu,topPositionY:Ks}=this.domService.getTopLeftPosition();We.positionX=Tu,We.positionY=Ks;let Mc=this.domService.getCurrentWindowSizeValue();if(We.screenWidth=Mc.screenWidth,We.screenHeight=Mc.screenHeight,We.screenScrollHeight=Mc.screenScrollHeight,We.taggedElementPath="",e&&(We.targetElement=this.domService.getTargetElementForCursorPosition(e,!0,!0,!0,_t=>{if(this.getSvgAsImg()){let Ot=_t?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);Ot&&Ot instanceof HTMLElement&&(_t=Ot)}if(this.getPopoverMode()){let Ot=_t?.closest(`[${X.ATTRIBUTES.VELT_TARGET_COMMENT_ELEMENT_ID}]`);if(Ot&&Ot instanceof HTMLElement)return Ot}return _t}),this.getCommentToNearestAllowedElement()&&We.targetElement?.xpath)){let _t=this.domService.getElementFromXPath(We.targetElement.xpath);if(_t&&!this.isElementInsideAllowedElements(_t)){let Ot=this.getNearestAllowedElement(_t);if(Ot)We.targetElement.xpath=this.domService.getXPath(Ot),We.targetElement.fXpath=this.domService.getXPath(Ot,!0),We.targetElement.cfXpath=this.domService.getXPath(Ot,!0,!0),We.targetElement.anchor=this.domService.generateAnchorRecord(Ot);else return}}if(t&&(We.targetTextRange=t),We?.targetElement?.xpath){let _t=this.domService.getXPath(We.targetElement.xpath);if(_t){let Ot=_t.iterateNext();Ot&&(un(Ot)||(We.targetElement=null))}}this.customFilterService.defaultStatus&&!Se?.status&&(We.status=this.customFilterService.defaultStatus),We.pageInfo=Lu(),We.pageInfo&&(We.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth);let Cy=this.docService.getClientDocumentId(),ky=this.docService.getLocation()?.location;if(he&&(We.context=he&&on(he),We.contextId=this.generateContextId(We.context)),this.commentContextProvider!==null){let _t=this.commentContextProvider(Cy,ky),Ot=_t instanceof Promise?yield _t:_t;Ot&&(We.context=Ot&&on(Ot),We.contextId=this.generateContextId(We.context),Ot?.commentType==="manual"&&(We.commentType="manual",delete We.targetElement))}if(i){We.sourceId=i?.sourceId;let _t=i?.targetElement,Ot=i?.commentData;if(_t?.targetText)We.targetTextRange={commonAncestorContainer:"/html/body",text:_t.targetText,occurrence:_t?.occurrence||1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(document.body)??void 0};else if(_t?.elementId)if(We.targetElementId=_t.elementId,_t?.selectAllContent)We.selectAllContent=!!_t?.selectAllContent;else{let Rr=zr(_t.elementId,["id","data-id"]);Rr?We.targetElement={xpath:this.domService.getXPath(Rr),fXpath:this.domService.getXPath(Rr,!0),cfXpath:this.domService.getXPath(Rr,!0,!0),anchor:this.domService.generateAnchorRecord(Rr),topPercentage:50,leftPercentage:90}:We.targetElement={xpath:"/html/body",fXpath:"/html/body",cfXpath:"/html/body",anchor:this.domService.generateAnchorRecord(document.body),topPercentage:50,leftPercentage:90}}i?.status&&(We.status=i.status),i?.context&&(We.context=i.context?on(i.context):i.context,We.contextId=this.generateContextId(We.context)),We.comments||(We.comments=[]);let Ou=this.authService.getUser();Ot?.forEach(Rr=>{let Tv=new qn;Tv.commentText=Rr.commentText,Tv.commentHtml=Rr.commentHtml,Tv.replaceContentHtml=Rr.replaceContentHtml,Tv.replaceContentText=Rr.replaceContentText,Tv.from=Ou,We.comments.push(Tv)})}if(c&&(We.isPageAnnotation=!0),m?.length&&(We.comments=m),h&&(We.commentType="chart",We.metadata=h),I?.sourceId&&(We.sourceId=I.sourceId),We?.targetElement?.xpath&&!I){let _t=this.domService.getElementFromXPath(We.targetElement.xpath);_t&&(I=this.getInlineCommentSectionConfig(_t))}I?.targetInlineCommentElementId&&(We.targetInlineCommentElementId=I?.targetInlineCommentElementId,We.targetElementId=I.targetInlineCommentElementId,I?.config?.id&&(We.inlineCommentSectionConfig=I?.config));let xy=!We?.comments?.length,_y=!!(i?.openComment===!1||_e);this.getPrivateCommentMode()&&(We?.iam||(We.iam=new Wh),We.iam.accessMode=lr.PRIVATE),S&&(We.context=S.context?on(S.context):S.context,We.commentType="manual",delete We.targetElement,We.contextId=this.generateContextId(We.context)),z&&(We.targetElementId=z.targetElementId,We.targetElement=z.targetElement);let Zp=this.getPrivateModeConfig();if(Zp)try{let _t=g({},Zp),Ot=this.authService.getUser();if(_t.type==="restricted"&&Ot?.userId&&(_t=Mn(_t,Ot.userId)),_t.type==="organizationPrivate"&&!_t.organizationId&&!_t.organizationIds?.length){let Rr=this.docService.getOrganizationConfig();Rr?.clientOrganizationId&&(_t.organizationId=Rr.clientOrganizationId)}let Ou=An(_t,Ot?.userId);We.context||(We.context={}),We.context._setAccessFields=Ou,We.visibilityConfig=Pn(_t,Ot?.userId)}catch(_t){this.loggingService.catch("Error building accessFields from privateModeConfig: ",_t)}this.saveCommentToDb(We,a,xy,_y,_,$,G,oe,Z,Re,lt,Xe)}}catch(Lt){this.loggingService.catch("Error in CommentService addComment: ",Lt)}})}triggerAddCommentAnnotationDraftEvent(){return Pe(this,null,function*(){try{this.commentAnnotationContextDraft=null;let e={addContext:a=>{this.commentAnnotationContextDraft=a}},t=yield this.commentActionsService?.getAddCommentAnnotationDraftEventFromCommentAddEventData(e);t&&this.commentActionsService?.triggerAddCommentAnnotationDraftEvent(t)}catch(e){this.loggingService.catch("Error in CommentService triggerAddCommentAnnotationDraftEvent: ",e)}})}triggerAddCommentDraftEventOnAbandon(e,t){return Pe(this,null,function*(){try{if(!e||!t)return;let a=this.getAnnotationById(e),i=!!a?.comments?.some(c=>c&&!c.isDraft);a&&i&&(yield this.commentActionsService?.triggerAddCommentDraftEventForAnnotation(a,t))}catch(a){this.loggingService.catch("Error in CommentService triggerAddCommentDraftEventOnAbandon: ",a)}})}willDeleteWholeAnnotation(e,t){try{if(!e?.comments?.length)return!1;let a=e.comments.findIndex(i=>i?.commentId===t);return a<0?!1:a===0&&this.deleteThreadWithFirstComment$.value!==!1||e.comments.length===1}catch(a){return this.loggingService.catch("Error in CommentService willDeleteWholeAnnotation: ",a),!1}}confirmDeleteCommentIfRequired(e,t){return Pe(this,null,function*(){try{if(!e?.comments?.length||!t)return!0;let a=e.comments.findIndex(h=>h?.commentId===t?.commentId);if(a<0||!(a===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value))return!0;let c;return this.deleteReplyConfirmation$.value&&(a!==0||this.deleteThreadWithFirstComment$.value===!1)?c={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:c={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!!(yield this.dialog.open(Mg,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:c}).afterClosed().toPromise())}catch(a){return this.loggingService.catch("Error in CommentService confirmDeleteCommentIfRequired: ",a),!1}})}setLocationToCommentAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let a;e.targetElement?a=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?a=zr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(a=this.domService.getElementFromTargetTextRange(e.targetTextRange));let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.addLocation({location:i,source:"internal"});c?.[0]&&(e.locationId=c[0].locationId,e.location=c[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in CommentService setLocationToCommentAnnotation:",t)}}getElementForCommentAnnotation(e){try{let t;return e.targetElement?t=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?t=zr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(t=this.domService.getElementFromTargetTextRange(e.targetTextRange)),t}catch(t){return this.loggingService.catch("Error in CommentService getElementForCommentAnnotation: ",t),null}}saveCommentToDb(e,t,a=!1,i=!1,c,m,h,_,I,S,z,$){this.loggingService.log("%c[WB] Calling FUNCTION: saveCommentToDb","color: green;");try{this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)&&this.docService.getDocumentPaths$().pipe(jt(G=>!!G),Jn(1),Me(G=>(this.documentPaths=G,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(jt(Z=>!!Z),Jn(1),Me(Z=>Pe(this,null,function*(){if(this.documentPaths?.comment){e.annotationId=this.commonDbService.generateDocumentId();let ae=this.docService.getClientDocumentId(),pe=this.docService.getLocation()?.location;if(h)e.multiThreadAnnotationId=h;else if(this.getMultiThread()){let Xe=gn();e.targetElementId&&(Xe=gn(e.targetElementId),e?.location?.id?Xe=gn([e?.location?.id,e.targetElementId]):e?.locationId&&(Xe=gn([e?.locationId+"",e.targetElementId]))),e.multiThreadAnnotationId=Xe}let Se={addContext:Xe=>{Xe.access&&(Xe.accessFields=Bc(Xe)),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADD_CONTEXT_TRIGGERED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode(),context:Xe}),e.context=Xe&&on(Xe),e.contextId=this.generateContextId(e.context),Xe?.commentType==="manual"&&(e.commentType="manual",delete e.targetElement),e?.annotationId&&setTimeout(()=>{this.updateCommentAnnotationContext(e.annotationId,Xe)},200)},documentId:ae,location:pe,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e?.annotationId,targetCommentId:e?.comments?.length?e?.comments[0]?.commentId:void 0};e?.targetElement?.xpath?Se.elementRef={xpath:e.targetElement.xpath}:Se.elementRef=void 0,this.commentAddedEmitter!==null&&"emit"in this.commentAddedEmitter&&this.commentAddedEmitter.emit(Se),this.commentAdded$.next(Se),I&&I(Se),Se?.annotation?.annotationId&&this.pendingAddCommentAnnotationData.set(Se.annotation.annotationId,Se),this.setLocationToCommentAnnotation(e);let oe=this.getElementForCommentAnnotation(e),he=this.docService.getBaseMetadata("comment",{element:oe,multiThreadAnnotationId:e.multiThreadAnnotationId});if(!he?.apiKey)return;if(e?.metadata||(e.metadata={}),e.metadata=g(g({},e.metadata),he),S&&(e.metadata=g(g({},e.metadata),S)),c&&typeof c=="object"&&(e.locationId=_||this.docService.genarateLocationId(c),e.location=c,$||this.docService.addLocation({location:c})),a)window.localStorage.setItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT,JSON.stringify(e));else{let Xe=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);Xe&&JSON.parse(Xe).annotationId===e.annotationId&&e.comments!==void 0&&e.comments.length>0&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT)}e.pageInfo&&(e.pageInfo.commentUrl=this.generateCommentUrl(e));let _e=e.comments,Re=JSON.parse(JSON.stringify(e));if(this.commentAnnotationContextDraft){let Xe=this.commentAnnotationContextDraft;this.commentAnnotationContextDraft=null,Xe.access&&(Xe.accessFields=Bc(Xe)),Re.context=Xe&&on(Xe)}if(!this.handleDirectAccessFieldsAssignment(Re?.context)&&!Re?.context?.access&&(Re?.context||(Re.context={}),Re.context.access={default:"velt"},Re.context.accessFields=[...Re.context.accessFields||[],X.DEFAULT_VELT_CONTEXT]),Re.visibilityConfig||(Re.visibilityConfig={type:"public"}),Re.position=null,t){Re.targetElement=null,Re.targetTextRange=null;let Xe={annotationId:e.multiThreadAnnotationId?e.multiThreadAnnotationId:e.annotationId,type:e.multiThreadAnnotationId?ke.MULTI_THREAD:ke.COMMENT},Ve=yield this.areaService?.generateAreaAnnotationId();Re.areaAnnotationId=Ve;let ht=this.areaService?.addArea(void 0,t,Xe,Ve,{locationId:Re.locationId,location:Re.location},Re.context);ht&&(Re.metadata=g(g({},Re.metadata),ht?.metadata||{}))}!i&&!Re?.targetInlineCommentElementId&&!Re?.isPageAnnotation&&this.domService.toggleAnnotationSelection(Re,m),e.targetTextRange&&sessionStorage.setItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e?.multiThreadAnnotationId?e?.multiThreadAnnotationId:e.annotationId),Re?.comments?.length?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADDED,{annotationId:e.annotationId,commentThreadId:Re?.comments[0]?.commentId,commentThreadIndex:0,commentType:this.getCommentType(Re),commentMode:this.getCommentMode(),source:z??"internal",commentAnnotationCreatedAt:e.createdAt,taggedClientUserIds:Re?.comments[0]?.taggedUserContacts?.map(Xe=>Xe.contact?.userId).filter(Xe=>!!Xe),taggedSnippylyUserIds:Re?.comments[0]?.taggedUserContacts?.filter(Xe=>!!Re?.metadata?.apiKey&&!!Xe.contact?.userId).map(Xe=>yg(Re.metadata.apiKey,Xe.contact.userId))}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_DRAFT_ADDED,{annotationId:e.annotationId,commentType:this.getCommentType(Re),commentMode:this.getCommentMode()});let lt=this.getAnnotationNumber(e);lt&&(Re.annotationNumber=lt),Re?.comments?.length?Re.comments=[]:Re.isDraft=!0,Re?.multiThreadAnnotationId&&this.saveMultiThreadCommentAnnotation(Re),Re?.context&&(Re.contextId=this.generateContextId(Re.context),Re.context?.commentType==="manual"&&(Re.commentType="manual",delete Re.targetElement)),_e?.length?this.saveComment(Re,{type:Ke.NEWLY_ADDED,updatedComment:_e[0]}):this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:Re}))}})))))).subscribe(()=>{},G=>{this.loggingService.catch("Error in CommentService saveCommentToDb subscription: ",G)})}catch(G){this.loggingService.catch("Error in CommentService saveCommentToDb: ",G)}}saveMultiThreadCommentAnnotation(e){return Pe(this,null,function*(){try{if(e?.multiThreadAnnotationId){let t=this.docService.getDocumentPaths();if(this.databaseService.getDbValue()&&t?.multiThread){let a={annotationId:e.multiThreadAnnotationId,targetElement:e.targetElement,targetElementId:e.targetElementId,targetInlineCommentElementId:e.targetInlineCommentElementId,inlineCommentSectionConfig:e.inlineCommentSectionConfig,areaAnnotationId:e.areaAnnotationId,targetTextRange:e.targetTextRange,from:e.from,locationId:e.locationId,location:e.location,sourceId:e.sourceId,type:"multiThread",metadata:e.metadata,context:e.context};delete e?.targetElement,delete e?.areaAnnotationId,delete e?.targetTextRange;let i=this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:t?.documentId})?.find(c=>c.annotationId===e.multiThreadAnnotationId);if(i||(i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:t?.documentId??"",organizationId:t?.organizationId??"",id:e.multiThreadAnnotationId}})),i&&(i=JSON.parse(JSON.stringify(i)),delete i.from,a=g(g({},i),a)),a?.commentAnnotations||(a.commentAnnotations={}),a.commentAnnotations[e.annotationId]=!0,e?.isDraft)this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(f(g({},this.draftMultiThreadCommentAnnotationsByAnnotationId$.value),{[a.annotationId]:f(g({},a),{isDraft:!0})}));else{let m=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[a.annotationId];if(m&&(a=g(g({},a),m)),delete a.isDraft,a.commentAnnotationsMap={},!a?.metadata?.documentId){a?.metadata||(a.metadata={});let I=this.docService.getBaseMetadata("multiThread");a.metadata=g(g({},a?.metadata),I)}let{documentId:h,organizationId:_}=a?.metadata||{};yield this.commonDbService.updateData({feature:"multiThread",properties:{id:a.annotationId,documentId:h,organizationId:_},data:JSON.parse(JSON.stringify(a)),callback:()=>{let I=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;I[e.annotationId]&&(delete I[e.annotationId],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(I))}})}return a}}return null}catch(t){return this.loggingService.catch("Error in CommentService saveMultiThreadCommentAnnotation: ",t),null}})}setCommentCategory(e){return Pe(this,null,function*(){try{if(e?.comments?.length){let t=e.comments[0].commentText?.trim();if(t){let a=yield this.getCommentCategory(t).toPromise();if(a){let i=this.docService.getDocumentPaths();if(i?.comment&&e?.annotationId){let c=this.getCommentAnnotationsOnCurrentOrganizationAndDocument()?.find(m=>m.annotationId===e.annotationId);if(c||(c=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:i?.documentId??"",organizationId:i?.organizationId??"",id:e.annotationId}})),c?.annotationId){let m=c;m.commentCategories=[a];let{documentId:h,organizationId:_}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);yield this.commonDbService.updateData({feature:"comment",properties:{id:e.annotationId,documentId:h,organizationId:_,metadata:{apiKey:this.configService.getApiKey(),organizationId:_,veltFolderId:m?.metadata?.veltFolderId,documentId:h}},data:JSON.parse(JSON.stringify(m))})}}}}}}catch(t){this.loggingService.catch("Error in CommentService setCommentCategory: ",t)}})}getCommentCategory(e){try{let t=Vu(this.functions,Bu({url:this.endpointsService.getCloudFunctionUrl("chatgptCompletion"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i=[{role:"system",content:`Identify category of this sentence from these categories, ${Object.keys(this.customCategoryMap)?.join(", ")}:`},{role:"user",content:e}];return _n(t({messages:i,apiKey:this.configService.getApiKey(),sdkVersion:rb(),sdkType:this.configService.getSdkType(),numResponse:1})).pipe(Oe(c=>{if(c?.data){let m=c.data,h=m?.length?m[0]?.content?.trim():void 0;return h&&Object.keys(this.customCategoryMap).includes(h)?this.customCategoryMap[h]:void 0}else return}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentCategory: ",t),Ee(void 0)}}handleDirectAccessFieldsAssignment(e){try{if(!e||typeof e!="object")return!1;if("_setAccessFields"in e||"_replaceAccessFields"in e){let t=e._setAccessFields??e._replaceAccessFields;return delete e.access,delete e.accessFields,Array.isArray(t)&&t.length>0?e.accessFields=t:t==null&&delete e.accessFields,delete e._setAccessFields,delete e._replaceAccessFields,!0}return!1}catch(t){return this.loggingService.catch("Error in CommentService handleDirectAccessFieldsAssignment: ",t),!1}}updateCommentAnnotationContext(e,t,a){return Pe(this,null,function*(){try{this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_TRIGGERED,{annotationId:e,context:t,merge:a?.merge});let i=this.authService.getUser(),c=this.docService.getDocumentPaths();if(i&&c?.comment&&e){let m=this.getAnnotationById(e);if(typeof m=="object"&&(m=JSON.parse(JSON.stringify(m))),m||(m=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:c?.documentId??"",organizationId:c?.organizationId??"",id:e}})),m?.annotationId){let h=t,_=JSON.parse(JSON.stringify(m.context||{}));a?.merge&&(h=g(g({},_),t));let I=this.handleDirectAccessFieldsAssignment(h);if(h&&"_setVisibilityConfig"in h&&(m.visibilityConfig=h._setVisibilityConfig,delete h._setVisibilityConfig),h&&typeof h=="object"&&!I)if("access"in t)t.access!==null&&t.access!==void 0?h.accessFields=Bc(h):(delete h.access,delete h.accessFields);else{if(!a?.merge)for(let $ of Iy)!($ in t)&&_?.[$]!==void 0&&(h[$]=_[$]);h.access!==null&&h.access!==void 0&&(h.accessFields=Bc(h))}let S={context:JSON.parse(JSON.stringify(h||{}))},z=!1;if(S?.context?.commentType==="manual"&&(S.commentType="manual",S.targetElement=null,m?.targetElement&&(m.targetElement=null,z=!0)),m.context=S.context?on(S.context):S.context,m.contextId=this.generateContextId(m.context),an(_,h)&&!z)return Promise.resolve("Comment annotation context is already updated.");if(m?.comments?.length){m.lastUpdated=this.timestamp;let{documentId:$,organizationId:G}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);return this.commonDbService.setData({feature:"comment",properties:{id:e,documentId:$,organizationId:G,metadata:{apiKey:this.configService.getApiKey(),organizationId:G,veltFolderId:m?.metadata?.veltFolderId,documentId:$}},data:JSON.parse(JSON.stringify(m)),callback:()=>{this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_SUCCESS,{annotationId:e,context:S?.context,merge:a?.merge})}})}else return this.draftCommentAnnotationsByAnnotationId$.value?.[e]?(this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e]:m})),Promise.resolve("Draft comment annotation context updated.")):(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Draft comment annotation not found."}),Promise.resolve("Draft comment annotation not found."))}else return this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Comment annotation not found in database."}),Promise.resolve("Comment annotation not found in database.")}}catch(i){return this.loggingService.catch("Error in CommentService updateCommentAnnotationContext: ",i),Promise.resolve("Error in CommentService updateCommentAnnotationContext.")}})}updateComment(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{if(this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)){if(t&&this.setLocationToCommentAnnotation(e),e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let _=h.iterateNext();_&&(un(_)||(e.targetElement=null))}}if(e?.type==="multiThread"){let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h?.context&&this.handleDirectAccessFieldsAssignment(h.context),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let S=this.docService.getBaseMetadata("multiThread");h.metadata=g(g({},h?.metadata),S)}let{documentId:_,organizationId:I}=h?.metadata||{};a?this.commonDbService.updateData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))}):this.commonDbService.setData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))})}else{this.setSubscribedUsersDataInCommentAnnotation(e);let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h.lastUpdated=this.timestamp,h.status||(h.status=this.customFilterService.defaultStatus),delete h.resolved,delete h.inProgress,this.setLocationFromDocumentParams(h),h?.context&&this.handleDirectAccessFieldsAssignment(h.context),h?.annotationId?.startsWith("TEMP_COMPOSER_"))return;let _=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);if(_&&JSON.parse(_).annotationId===h.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),h?.multiThreadAnnotationId&&!c&&this.saveMultiThreadCommentAnnotation(h).then(I=>{}),h?.comments?.length){if(delete h?.isDraft,h?.multiThreadAnnotationId&&this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[h?.multiThreadAnnotationId]&&this.saveMultiThreadCommentAnnotation(h),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let $=this.docService.getBaseMetadata("comment");h.metadata=g(g({},h?.metadata),$)}let{documentId:I,organizationId:S}=h?.metadata||{},z=i?g({annotationData:i?.commentAnnotation,targetAnnotationData:i?.targetComment,actionType:i?.actionType,notificationSource:"comment"},i?.otherFields||{}):null;this.viewsService?.updateCommentAnnotationViews(h),this.commonDbService.setData({feature:"comment",properties:{id:h.annotationId,documentId:I,targetCommentId:m?.commentId,organizationId:S,metadata:{apiKey:this.configService.getApiKey(),organizationId:S,veltFolderId:h?.metadata?.veltFolderId,documentId:I}},extraData:z,data:JSON.parse(JSON.stringify(h)),callback:$=>Pe(this,null,function*(){if(i&&!$?.firestoreAvailable&&this.updateNotificationsDatabase(i.commentAnnotation,i.targetComment,i.actionType,i.otherFields||{}),this.getScreenshotEnabled()&&i?.actionType===Ke.NEWLY_ADDED&&this.captureScreenshot(e),i?.actionType===Ke.NEWLY_ADDED||i?.actionType===Ke.ADDED)try{let G=yield this.metadataService.getGlobalMetadata(),Z={annotationId:h.annotationId,commentAnnotation:this.getCommentAnnotationForClient(h),metadata:G};this.commentActionsService?.triggerAction(dt.COMMENT_SAVED,Z)}catch(G){this.loggingService.catch("Error triggering commentSaved event: ",G)}})})}else this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:h}))}}}catch(h){this.loggingService.catch("Error in CommentService updateComment: ",h)}}captureScreenshot(e){return Pe(this,null,function*(){try{if(this.getScreenshotEnabled()){let a=Vu(this.functions,Bu({url:this.endpointsService.getCloudFunctionUrl("screenshot"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i,c={source:"velt",sourceData:{commentAnnotation:e},eventType:"screenshot"};e?.areaAnnotationId&&(i=this.areaService?.getAnnotationById(e?.areaAnnotationId),i&&(c.sourceData||(c.sourceData={}),c.sourceData.areaAnnotation=i));let m=yield Qh(c,this.authService.getUser()?.userId??"");yield a({veltData:m})}}catch(t){this.loggingService.catch("Error in CommentService captureScreenshot: ",t)}})}getDocumentIdAndOrganizationIdFromCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromCommentAnnotation: ",t),{}}}getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation: ",t),{}}}setLocationFromDocumentParams(e){e?.documentParams&&(e.location=e.documentParams,delete e.documentParams),e?.documentParamsId&&(e.locationId=e.documentParamsId,delete e.documentParamsId)}deleteCommentPinAnnotations(e){return new Promise((t,a)=>Pe(this,null,function*(){try{let i=this.domService.getSelectedAnnotationsMap(),c=this.authService.getUser(),m=[];Object.keys(i).forEach(h=>{let _=i[h];["tag","recorder","rewriter","arrow","area","multiThread"].includes(_.type)||c&&_.from&&(c?.isAdmin||_.from.userId===c.userId)&&m.push(_)}),m?.length?(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_DELETE_TRIGGERED,{triggerType:e,annotationId:m.map(h=>h.annotationId).join(),commentMode:this.getCommentMode()}),this.dialog.open(Mg,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:{title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"}}).afterClosed().pipe(Jn(1)).subscribe(h=>{try{h?(m.forEach(_=>Pe(this,null,function*(){yield this.deleteCommentPinAnnotation(_)})),setTimeout(()=>{document.querySelectorAll(`[${X.SNIPPYLY_HIGHLIGHT}]`).forEach(I=>{this.domService.removeHighlightFromElement(I)}),t()},100)):t()}catch(_){a(_)}},h=>{a(h)})):t(),this.domService.resetSelectedAnnotationsMap(!0,"comment")}catch(i){this.loggingService.catch("Error in CommentService deleteCommentPinAnnotations: ",i),a(i)}}))}deleteCommentPinAnnotation(e,t){return Pe(this,null,function*(){try{if(setTimeout(()=>{if(this.draftCommentAnnotationsByAnnotationId$?.value?.[e.annotationId]){let a=this.draftCommentAnnotationsByAnnotationId$.value;delete a[e.annotationId],this.draftCommentAnnotationsByAnnotationId$.next(a)}},50),e?.annotationId&&this.pendingAddCommentAnnotationData.delete(e.annotationId),this.authService.isFeatureAllowed(ke.COMMENT))if((t||e.comments?.length)&&this.updateNotificationsDatabase(e,null,Ke.DELETED),e.comments?.forEach(a=>{a.reactionAnnotationIds&&a.reactionAnnotationIds.forEach(i=>{this.deleteReaction(i)})}),e?.annotationId){this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_DELETED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode()});let a=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);a&&JSON.parse(a).annotationId===e.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),this.areaService?.onDeleteTargetAnnotation(e?.annotationId,e?.areaAnnotationId);let i={type:"delete",annotation:null,targetAnnotationId:e.annotationId};this.commentUpdated$.next(i),e?.multiThreadAnnotationId&&(yield this.removeCommentAnnotationFromMultiThread(e)),this.commentAnnotationDeleted$.next(e);let{documentId:c,organizationId:m}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(e);if(e?.isDraft)return Promise.resolve();{let h={annotationData:e,targetAnnotationData:null,actionType:Ke.DELETED,notificationSource:"comment",isAnnotationDelete:!0};return this.commonDbService.deleteData({feature:"comment",properties:{id:e.annotationId,documentId:c,organizationId:m,metadata:{apiKey:this.configService.getApiKey(),organizationId:m,veltFolderId:e?.metadata?.veltFolderId,documentId:c}},extraData:h})}}else return Promise.resolve();return Promise.resolve()}catch(a){return this.loggingService.catch("Error in CommentService deleteCommentPinAnnotation: ",a),Promise.resolve()}})}removeCommentAnnotationFromMultiThread(e){return Pe(this,null,function*(){try{let t=e?.multiThreadAnnotationId;if(t){let a=this.docService.getDocumentPaths(),i=this.getMultiThreadAnnotationById(t);if(!i){let _=e?.metadata?.documentId||a?.documentId,I=e?.metadata?.organizationId||a?.organizationId;i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:_,organizationId:I,id:t}})}let c=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t];i&&delete i?.commentAnnotations?.[e.annotationId],c&&(delete c?.commentAnnotations?.[e.annotationId],Object.keys(c?.commentAnnotations||{}).length===0&&(delete this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(this.draftMultiThreadCommentAnnotationsByAnnotationId$.value))),delete i.commentAnnotationsMap;let{documentId:m,organizationId:h}=this.getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(i);return Object.keys(i?.commentAnnotations||{}).length===0?(this.areaService?.onDeleteTargetAnnotation(i?.annotationId,i?.areaAnnotationId),this.multiThreadCommentAnnotationDeleted$.next(i),this.commonDbService.deleteData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h}})):this.commonDbService.setData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h},data:JSON.parse(JSON.stringify(i))})}}catch(t){this.loggingService.catch("Error in CommentService removeCommentAnnotationFromMultiThread: ",t)}})}getAnnotationById(e,t){try{let a=this.commentAnnotationById$.value?.[e]||this.draftCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromCommentAnnotationId(e){try{let t=this.commentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromCommentAnnotationId: ",t)}}isCommentAnnotationCacheLoaded(){try{return this.commentAnnotationById$.value!=null}catch(e){return this.loggingService.catch("Error in CommentService isCommentAnnotationCacheLoaded: ",e),!1}}getMultiThreadAnnotationById(e,t){try{let a=this.multiThreadCommentAnnotationById$.value?.[e]||this.draftMultiThreadCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromMultiThreadCommentAnnotationId(e){try{let t=this.multiThreadCommentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromMultiThreadCommentAnnotationId: ",t)}}getElementRefByAnnotationId(e){try{let t=this.getAnnotationById(e);if(t){let a=t?.targetElement?.xpath;if(a)return{xpath:a}}return}catch(t){this.loggingService.catch("Error in CommentService getElementRefByAnnotationId: ",t);return}}scrollToCommentByAnnotationId(e){try{let t=this.getAnnotationById(e),a=document.getElementById(`comment-pin-container-${e}`);a||(a=document.querySelector(`[data-velt-id='${e}']`)),a||(a=document.querySelector(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e}"]`)),a&&(a.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),t&&(this.domService.getSelectedAnnotationsMap()[e]||this.domService.toggleAnnotationSelection(t)))}catch(t){this.loggingService.catch("Error in CommentService scrollToCommentByAnnotationId: ",t)}}selectCommentByAnnotationId(e,t){try{this.loggingService.log("%c[WB] Calling FUNCTION: selectCommentByAnnotationId","color: green;");let a=e?this.getAnnotationById(e):void 0;a?this.domService.toggleAnnotationSelection(a,void 0,void 0,!0):this.domService.resetSelectedAnnotationsMap()}catch(a){this.loggingService.catch("Error in CommentService selectCommentByAnnotationId: ",a)}}enableAddCommentMode(){try{this.authService.isFeatureAllowed(ke.COMMENT)?!this.authService.isPlanExpired()&&this.iamService.hasRoleAny([Nv.ADMIN,Nv.COMMENTER])?(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADD_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!0)):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","User is not allowed to add comment."):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","Comment feature is not enabled.")}catch(e){this.loggingService.catch("Error in CommentService enableAddCommentMode: ",e)}}disableAddCommentMode(){this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADD_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!1)}addCommentModeChange(){return this.addCommentMode$.asObservable()}setFreeStyleCommentContext(e){try{this.freeStyleCommentContext=e}catch(t){this.loggingService.catch("Error in CommentService setFreeStyleCommentContext: ",t)}}clearFreeStyleCommentContext(){try{this.freeStyleCommentContext=void 0}catch(e){this.loggingService.catch("Error in CommentService resetFreeStyleCommentContext: ",e)}}enablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!0}}),this.persistentCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePersistentCommentMode: ",e)}}enableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!0}}),this.deleteReplyConfirmation$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteReplyConfirmation: ",e)}}enableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!0}}),this.seenByUsers$.value===!0)return;this.seenByUsers$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSeenByUsers: ",e)}}disableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!1}}),this.seenByUsers$.value===!1)return;this.seenByUsers$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSeenByUsers: ",e)}}getSeenByUsers$(){return this.seenByUsers$.asObservable()}disableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!1}}),this.deleteReplyConfirmation$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteReplyConfirmation: ",e)}}disablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!1}}),this.persistentCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePersistentCommentMode: ",e)}}persistentCommentModeChange(){return this.persistentCommentMode$.asObservable()}enablePersistentModeBanner(){this.persistentModeBanner$.next(!0)}disablePersistentModeBanner(){this.persistentModeBanner$.next(!1)}persistentModeBannerChange(){return this.persistentModeBanner$.asObservable()}setAssignToType(e){try{this.assignToType$.next(e.type)}catch(t){this.loggingService.catch("Error in CommentService setAssignToType: ",t)}}getAssignToType$(){return this.assignToType$.asObservable()}getAssignToType(){return this.assignToType$.value}setPageModeComposerContext(e){try{this.pageModeComposerContext$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPageModeComposerContext: ",t)}}clearPageModeComposerContext(){try{this.pageModeComposerContext$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearPageModeComposerContext: ",e)}}getPageModeComposerContext$(){return this.pageModeComposerContext$.asObservable()}getPageModeComposerContext(){return this.pageModeComposerContext$.value}enableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableContextInPageModeComposer: ",e)}}disableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableContextInPageModeComposer: ",e)}}getContextInPageModeComposer$(){return this.contextInPageModeComposer$.asObservable()}getContextInPageModeComposer(){return this.contextInPageModeComposer$.value}focusPageModeComposer(){try{this.focusPageModeComposer$.next()}catch(e){this.loggingService.catch("Error in CommentService focusPageModeComposer: ",e)}}getFocusPageModeComposer$(){return this.focusPageModeComposer$.asObservable()}showCommentIndex(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentIndex:e}}),this.showCommentIndex$.value===e)return;this.showCommentIndex$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showCommentIndex: ",t)}}getShowCommentIndex(){return this.showCommentIndex$.asObservable()}enablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!0}}),this.popoverMode$.value===!0)return;this.popoverMode$.next(!0),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_POPOVER_MODE_ENABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService enablePopoverMode: ",e)}}disablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!1}}),this.popoverMode$.value===!1)return;this.popoverMode$.next(!1),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_POPOVER_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService disablePopoverMode: ",e)}}getPopoverMode(){try{return this.popoverMode$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverMode: ",e),!1}}getPopoverMode$(){return this.popoverMode$.asObservable()}enablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!0}}),this.popoverTriangleComponent$.value===!0)return;this.popoverTriangleComponent$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePopoverTriangleComponent: ",e)}}disablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!1}}),this.popoverTriangleComponent$.value===!1)return;this.popoverTriangleComponent$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePopoverTriangleComponent: ",e)}}getPopoverTriangleComponent(){try{return this.popoverTriangleComponent$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverTriangleComponent: ",e),!1}}getPopoverTriangleComponent$(){return this.popoverTriangleComponent$.asObservable()}enableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!0}}),this.draftMode$.value===!0)return;this.draftMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDraftMode: ",e)}}disableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!1}}),this.draftMode$.value===!1)return;this.draftMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDraftMode: ",e)}}getDraftMode$(){return this.draftMode$.asObservable()}getDraftMode(){return this.draftMode$.value}enableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!0}}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_TEXT_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!0)return;this.textCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextComments: ",e)}}disableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!1}}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_TEXT_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!1)return;this.textCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextComments: ",e)}}getTextCommentMode$(){return this.textCommentMode$.asObservable()}isUserGlobalContact$(){return this.contactService.isUserGlobalContact$()}isSidebarOpenedByCustomTrigger(){try{return this.sidebarOpenedByCustomTrigger$.value}catch(e){return this.loggingService.catch("Error in CommentService isSidebarOpenedByCustomTrigger: ",e),!1}}setSidebarVisibility(e,t=!1,a=!1){try{this.domService.resetSelectedAnnotationsMap(),e?(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?this.sidebarVisible$.next(e):this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),t&&this.sidebarOpenedByCustomTrigger$.next(!0)):(!this.sidebarOpenedByCustomTrigger$.value||t||a)&&(this.sidebarVisible$.next(e),this.sidebarOpenedByCustomTrigger$.next(!1),this.clearPageModeComposerContext()),e?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_OPENED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_CLOSED,{commentMode:this.getCommentMode()})}catch{this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}toggleSidebarVisibility(e=!1,t=!1){try{this.domService.resetSelectedAnnotationsMap(),this.sidebarVisible$.value?(!this.sidebarOpenedByCustomTrigger$.value||e||t)&&(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarOpenedByCustomTrigger$.next(!1),this.sidebarVisible$.value||this.clearPageModeComposerContext()):(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarVisible$.value?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"closed"}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"opened"})):this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),e&&this.sidebarOpenedByCustomTrigger$.next(!0))}catch{this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}getSidebarVisibility$(){return this.sidebarVisible$.asObservable()}disableFloatingComments(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{floatingCommentDialog:!e}}),this.floatingCommentsEnabled$.value===!e)return;this.floatingCommentsEnabled$.next(!e)}catch(t){this.loggingService.catch("Error in CommentService disableFloatingComments: ",t)}}showFloatingComments$(){return this.floatingCommentsEnabled$.asObservable()}showFloatingComments(){return this.floatingCommentsEnabled$.value}setModeratorMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{moderatorMode:e}}),this.moderatorMode$.value===e)return;this.moderatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setModeratorMode: ",t)}}getModeratorMode(){return this.moderatorMode$.value}getModeratorMode$(){return this.moderatorMode$.asObservable()}setStreamMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{streamMode:e}}),this.streamMode$.value===e)return;this.streamMode$.next(e),e?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_STREAM_MODE_ENABLED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_STREAM_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(t){this.loggingService.catch("Error in CommentService setStreamMode: ",t)}}getStreamMode(){return this.streamMode$.value}getStreamMode$(){return this.streamMode$.asObservable()}getEnableDialogOnHover(){return this.enableDialogOnHover$.value}getEnableDialogOnHover$(){return this.enableDialogOnHover$.asObservable()}setEnableDialogOnHover(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnHover:e}}),this.enableDialogOnHover$.value===e)return;this.enableDialogOnHover$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnHover: ",t)}}getEnableDialogOnTargetElementClick(){return this.enableDialogOnTargetElementClick$.value}getEnableDialogOnTargetElementClick$(){return this.enableDialogOnTargetElementClick$.asObservable()}setEnableDialogOnTargetElementClick(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnTargetElementClick:e}}),this.enableDialogOnTargetElementClick$.value===e)return;this.enableDialogOnTargetElementClick$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnTargetElementClick: ",t)}}getEnablePriority(){return this.enablePriority$.value}getEnablePriority$(){return this.enablePriority$.asObservable()}setEnablePriority(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{priority:e}}),this.enablePriority$.value===e)return;this.enablePriority$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnablePriority: ",t)}}getEnableStatus(){return this.enableStatus$.value}getEnableStatus$(){return this.enableStatus$.asObservable()}setEnableStatus(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{status:e}}),this.getEnableStatus()===e)return;this.enableStatus$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableStatus: ",t)}}getEnableVisibilityOptions(){return this.visibilityOptions$.value}getEnableVisibilityOptions$(){return this.visibilityOptions$.asObservable()}setEnableVisibilityOptions(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{visibilityOptions:e}}),this.visibilityOptions$.value===e)return;this.visibilityOptions$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableVisibilityOptions: ",t)}}getEnableResolve(){return this.enableResolve$.value}getEnableResolve$(){return this.enableResolve$.asObservable()}setEnableResolve(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveButton:e}}),this.getEnableResolve()===e)return;this.enableResolve$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableResolve: ",t)}}getEnableGhostComments(){return this.enableGhostComments$.value}getEnableGhostComments$(){return this.enableGhostComments$.asObservable()}enableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!0}}),this.enableGhostComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGhostComments: ",e)}}disableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!1}}),this.enableGhostComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGhostComments: ",e)}}getEnableGhostCommentsMessage(){return this.enableGhostCommentsMessage$.value}getEnableGhostCommentsMessage$(){return this.enableGhostCommentsMessage$.asObservable()}enableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!0}}),this.enableGhostCommentsMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowGhostCommentsMessage: ",e)}}disableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!1}}),this.enableGhostCommentsMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowGhostCommentsMessage: ",e)}}enableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!0}}),this.inboxMode$.value===!0)return;this.inboxMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInboxMode: ",e)}}disableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!1}}),this.inboxMode$.value===!1)return;this.inboxMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInboxMode: ",e)}}getInboxMode(){return this.inboxMode$.value}getInboxMode$(){return this.inboxMode$.asObservable()}setEnableAutoCategorize(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCategorize:e}}),this.enableAutoCategorize$.value===e)return;this.enableAutoCategorize$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableAutoCategorize: ",t)}}getEnableAutoCategorize(){return this.enableAutoCategorize$.value}getEnableAutoCategorize$(){return this.enableAutoCategorize$.asObservable()}setCommentContainerDarkMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{darkMode:e}}),this.commentContainerDarkMode$.value===e)return;this.commentContainerDarkMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentContainerDarkMode: ",t)}}getCommentContainerDarkMode(){return this.commentContainerDarkMode$.asObservable()}getSuggestionMode(){return this.suggestionMode$.value}getSuggestionMode$(){return this.suggestionMode$.asObservable()}setSuggestionMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{suggestionMode:e}}),this.getSuggestionMode()===e)return;this.suggestionMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSuggestionMode: ",t)}}getMobileMode(){return this.mobileMode$.value}getMobileMode$(){return this.mobileMode$.asObservable()}setMobileMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{mobileMode:e}}),this.getMobileMode()===e)return;this.mobileMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMobileMode: ",t)}}enableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!0}}),this.inlineCommentMode$.value===!0)return;this.inlineCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInlineCommentMode: ",e)}}disableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!1}}),this.inlineCommentMode$.value===!1)return;this.inlineCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInlineCommentMode: ",e)}}getInlineCommentMode(){return this.inlineCommentMode$.value}getInlineCommentMode$(){return this.inlineCommentMode$.asObservable()}enableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!0}}),this.minimap$.value===!0)return;this.minimap$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMinimap: ",e)}}disableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!1}}),this.minimap$.value===!1)return;this.minimap$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMinimap: ",e)}}getMinimap(){return this.minimap$.value}getMinimap$(){return this.minimap$.asObservable()}showCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!0}}),this.commentsOnDom$.value===!0)return;this.commentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showCommentsOnDom: ",e)}}hideCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!1}}),this.commentsOnDom$.value===!1)return;this.commentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideCommentsOnDom: ",e)}}getCommentsOnDom(){return this.commentsOnDom$.value}getCommentsOnDom$(){return this.commentsOnDom$.asObservable()}enableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!0}}),this.commentToolEnabled$.value===!0)return;this.commentToolEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentTool: ",e)}}disableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!1}}),this.commentToolEnabled$.value===!1)return;this.commentToolEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentTool: ",e)}}getCommentTool(){return this.commentToolEnabled$.value}getCommentTool$(){return this.commentToolEnabled$.asObservable()}setTotalMediaLength(e){try{if(this.totalMediaLength$.value===e)return;this.totalMediaLength$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setTotalMediaLength: ",t)}}getTotalMediaLength(){return this.totalMediaLength$.value}getTotalMediaLength$(){return this.totalMediaLength$.asObservable()}enableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!0}}),this.sidebarUrlNavigationEnabled$.value===!0)return;this.sidebarUrlNavigationEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarUrlNavigation: ",e)}}disableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!1}}),this.sidebarUrlNavigationEnabled$.value===!1)return;this.sidebarUrlNavigationEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarUrlNavigation: ",e)}}getSidebarUrlNavigation(){return this.sidebarUrlNavigationEnabled$.value}getSidebarUrlNavigation$(){return this.sidebarUrlNavigationEnabled$.asObservable()}setDetectionStrategy(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{detectionStrategy:e}}),this.detectionStrategy$.value===e)return;this.detectionStrategy$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setDetectionStrategy: ",t)}}getDetectionStrategy(){return this.detectionStrategy$.value}getDetectionStrategy$(){return this.detectionStrategy$.asObservable()}enableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!0}}),this.sidebarButtonOnCommentDialogVisible$.value===!0)return;this.sidebarButtonOnCommentDialogVisible$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarButtonOnCommentDialog: ",e)}}disableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!1}}),this.sidebarButtonOnCommentDialogVisible$.value===!1)return;this.sidebarButtonOnCommentDialogVisible$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarButtonOnCommentDialog: ",e)}}getSidebarButtonOnCommentDialogVisibility(){return this.sidebarButtonOnCommentDialogVisible$.value}getSidebarButtonOnCommentDialogVisibility$(){return this.sidebarButtonOnCommentDialogVisible$.asObservable()}onSidebarButtonOnCommentDialogClick(){this.sidebarButtonOnCommentDialogClick$.next()}getSidebarButtonOnCommentDialogClick$(){return this.sidebarButtonOnCommentDialogClick$.asObservable()}enableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!0}}),this.deviceIndicatorOnCommentPins$.value===!0)return;this.deviceIndicatorOnCommentPins$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeviceIndicatorOnCommentPins: ",e)}}disableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!1}}),this.deviceIndicatorOnCommentPins$.value===!1)return;this.deviceIndicatorOnCommentPins$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeviceIndicatorOnCommentPins: ",e)}}getDeviceIndicatorOnCommentPins(){return this.deviceIndicatorOnCommentPins$.value}getDeviceIndicatorOnCommentPins$(){return this.deviceIndicatorOnCommentPins$.asObservable()}onSidebarCommentClick(e){this.sidebarCommentClick$.next(e)}getSidebarCommentClick$(){return this.sidebarCommentClick$.asObservable()}onCommentNavigationButtonClick(e){this.commentNavigationButtonClick$.next(e)}getCommentNavigationButtonClick$(){return this.commentNavigationButtonClick$.asObservable()}addBubbleCommentAnnotationIds(e){try{let a=[...this.bubbleCommentAnnotationIds$.value||[],...e],i=[...new Set(a)];this.bubbleCommentAnnotationIds$.next(i)}catch(t){this.loggingService.catch("Error in CommentService addBubbleCommentAnnotationIds: ",t)}}getBubbleCommentAnnotationIds(){return this.bubbleCommentAnnotationIds$.value}getBubbleCommentAnnotationIds$(){return this.bubbleCommentAnnotationIds$.asObservable()}removeBubbleCommentAnnotationIds(e){try{let a=(this.bubbleCommentAnnotationIds$.value||[]).filter(i=>!e.includes(i));this.bubbleCommentAnnotationIds$.next(a)}catch(t){this.loggingService.catch("Error in CommentService removeBubbleCommentAnnotationIds: ",t)}}enableSignInButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{signInButton:e}}),this.enableSignInButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableSignInButton: ",t)}}getSignInButton(){return this.enableSignInButton$.value}getSignInButton$(){return this.enableSignInButton$.asObservable()}onSignInClick(){this.onSignInClick$.next()}getSignInButtonClick$(){return this.onSignInClick$.asObservable()}enableUpgradeButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{upgradeButton:e}}),this.enableUpgradeButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableUpgradeButton: ",t)}}getUpgradeButton(){return this.enableUpgradeButton$.value}getUpgradeButton$(){return this.enableUpgradeButton$.asObservable()}onUpgradeClick(){this.onUpgradeClick$.next()}getUpgradeButtonClick$(){return this.onUpgradeClick$.asObservable()}openSidebar(){this.openSidebar$.next()}getOpenSidebar$(){return this.openSidebar$.asObservable()}enableAttachment(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachments:e}}),this.enableAttachment$.value===e)return;this.enableAttachment$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableAttachment: ",t)}}getEnableAttachment$(){return this.enableAttachment$.asObservable()}enableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!0}}),this.enableAttachmentDownload$.value===!0)return;this.enableAttachmentDownload$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentDownload: ",e)}}disableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!1}}),this.enableAttachmentDownload$.value===!1)return;this.enableAttachmentDownload$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentDownload: ",e)}}getEnableAttachmentDownload$(){return this.enableAttachmentDownload$.asObservable()}getEnableAttachmentDownload(){return this.enableAttachmentDownload$.value}enableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!0}}),this.enableFormatOptions$.value===!0)return;this.enableFormatOptions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFormatOptions: ",e)}}disableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!1}}),this.enableFormatOptions$.value===!1)return;this.enableFormatOptions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFormatOptions: ",e)}}getEnableFormatOptions$(){return this.enableFormatOptions$.asObservable()}setFormatConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatConfig:e}}),this.formatConfig$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setFormatConfig: ",t)}}getFormatConfig$(){return this.formatConfig$.asObservable()}setAllowedRecordings(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordings:e}}),e?.includes("all")?this.allowedRecordings$.next(["audio","video","screen"]):e?.includes("none")?this.allowedRecordings$.next([]):this.allowedRecordings$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedRecordings: ",t)}}getAllowedRecordings(){return this.allowedRecordings$.value}getAllowedRecordings$(){return this.allowedRecordings$.asObservable()}enableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!0}}),this.enableReactions$.value===!0)return;this.enableReactions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReactions: ",e)}}disableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!1}}),this.enableReactions$.value===!1)return;this.enableReactions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReactions: ",e)}}getEnableReactions(){return this.enableReactions$.value}getEnableReactions$(){return this.enableReactions$.asObservable()}enableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!0)return;this.enableAnonymousEmail$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAnonymousEmail: ",e)}}disableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!1)return;this.enableAnonymousEmail$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAnonymousEmail: ",e)}}getEnableAnonymousEmail(){return this.enableAnonymousEmail$.value}getEnableAnonymousEmail$(){return this.enableAnonymousEmail$.asObservable()}addCommentOnElement(e){this.addComment(void 0,void 0,void 0,e)}enablePrivateCommentMode(){return Pe(this,null,function*(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!0}}),this.privateCommentMode$.value===!0)return;this.isPrivateCommentAllowed$().pipe(Jn(1)).subscribe(e=>{e?(this.privateCommentMode$.next(!0),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_ENABLED)):this.loggingService.logsEnabled&&console.warn("You are not allowed to enable private comment mode.")})}catch(e){this.loggingService.catch("Error in CommentService enablePrivateCommentMode: ",e)}})}disablePrivateCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!1}}),this.privateCommentMode$.value===!1)return;this.privateCommentMode$.next(!1),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_DISABLED)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateCommentMode: ",e)}}getPrivateCommentMode(){return this.privateCommentMode$.value}getPrivateCommentMode$(){return this.privateCommentMode$.asObservable()}isPrivateCommentAllowed(){return this.privateCommentAllowed$.value}isPrivateCommentAllowed$(){return this.privateCommentAllowed$.asObservable()}enablePrivateMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:e}}),!e?.type){this.loggingService.catch("enablePrivateMode: type is required in config");return}let t=g({},e);if(t.type==="restricted"){let a=this.authService.getUser();if(!a?.userId){this.loggingService.catch("enablePrivateMode: Current user not found. Cannot set restricted visibility without userIds.");return}t=Mn(t,a.userId)}this.privateModeConfig$.next(t)}catch(t){this.loggingService.catch("Error in CommentService enablePrivateMode: ",t)}}disablePrivateMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:null}}),this.privateModeConfig$.value===null)return;this.privateModeConfig$.next(null)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateMode: ",e)}}getPrivateModeConfig(){return this.privateModeConfig$.value}getPrivateModeConfig$(){return this.privateModeConfig$.asObservable()}enableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!0}}),this.scrollToComment$.value===!0)return;this.scrollToComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScrollToComment: ",e)}}disableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!1}}),this.scrollToComment$.value===!1)return;this.scrollToComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScrollToComment: ",e)}}getScrollToComment(){return this.scrollToComment$.value}getScrollToComment$(){return this.scrollToComment$.asObservable()}showScreenSizeInfo(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceInfo:e}}),this.showScreenSizeInfo$.value===e)return;this.showScreenSizeInfo$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showScreenSizeInfo: ",t)}}getShowScreenSizeInfo$(){return this.showScreenSizeInfo$.asObservable()}enableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!0}}),this.userMentions$.value===!0)return;this.userMentions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableUserMentions: ",e)}}disableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!1}}),this.userMentions$.value===!1)return;this.userMentions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableUserMentions: ",e)}}getUserMentions(){return this.userMentions$.value}getUserMentions$(){return this.userMentions$.asObservable()}enablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!0)return;this.paginatedContactList$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePaginatedContactList: ",e)}}disablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!1)return;this.paginatedContactList$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePaginatedContactList: ",e)}}getPaginatedContactList(){return this.paginatedContactList$.value}getPaginatedContactList$(){return this.paginatedContactList$.asObservable()}enableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!0}}),this.deleteOnBackspace$.value===!0)return;this.deleteOnBackspace$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteOnBackspace: ",e)}}disableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!1}}),this.deleteOnBackspace$.value===!1)return;this.deleteOnBackspace$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteOnBackspace: ",e)}}getDeleteOnBackspace(){return this.deleteOnBackspace$.value}getDeleteOnBackspace$(){return this.deleteOnBackspace$.asObservable()}enableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!0}}),this.hotkeyEnabled$.value===!0)return;this.hotkeyEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableHotkey: ",e)}}disableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!1}}),this.hotkeyEnabled$.value===!1)return;this.hotkeyEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableHotkey: ",e)}}enableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!0}}),this.recordingSummaryEnabled$.value===!0)return;this.recordingSummaryEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRecordingSummary: ",e)}}disableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!1}}),this.recordingSummaryEnabled$.value===!1)return;this.recordingSummaryEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRecordingSummary: ",e)}}getRecordingSummaryEnabled(){return this.recordingSummaryEnabled$.value}getRecordingSummaryEnabled$(){return this.recordingSummaryEnabled$.asObservable()}setUnreadIndicatorMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setUnreadIndicatorMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{unreadIndicatorMode:e}}),this.unreadIndicatorMode$.value===e)return;this.unreadIndicatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setUnreadIndicatorMode: ",t)}}getUnreadIndicatorMode(){return this.unreadIndicatorMode$.value}getUnreadIndicatorMode$(){return this.unreadIndicatorMode$.asObservable()}setComposerMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setComposerMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{composerMode:e}}),this.composerMode$.value===e)return;this.composerMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerMode: ",t)}}getComposerMode(){return this.composerMode$.value}getComposerMode$(){return this.composerMode$.asObservable()}enableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!0}}),this.enterKeyToSubmit$.value===!0)return;this.enterKeyToSubmit$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableEnterKeyToSubmit: ",e)}}disableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!1}}),this.enterKeyToSubmit$.value===!1)return;this.enterKeyToSubmit$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableEnterKeyToSubmit: ",e)}}getEnterKeyToSubmit(){return this.enterKeyToSubmit$.value}getEnterKeyToSubmit$(){return this.enterKeyToSubmit$.asObservable()}enablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!0}}),this.pinShadowDOM$.value===!0)return;this.pinShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinShadowDOM: ",e)}}disablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!1}}),this.pinShadowDOM$.value===!1)return;this.pinShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinShadowDOM: ",e)}}getPinShadowDOM(){return this.pinShadowDOM$.value}getPinDarkMode(){return this.pinDarkMode$.value}getPinDarkMode$(){return this.pinDarkMode$.asObservable()}getTextCommentToolDarkMode(){return this.textCommentToolDarkMode$.value}getTextCommentToolDarkMode$(){return this.textCommentToolDarkMode$.asObservable()}getTextCommentToolbarDarkMode(){return this.textCommentToolbarDarkMode$.value}getTextCommentToolbarDarkMode$(){return this.textCommentToolbarDarkMode$.asObservable()}getPinShadowDOM$(){return this.pinShadowDOM$.asObservable()}getTextCommentToolShadowDOM$(){return this.textCommentToolShadowDOM$.asObservable()}getTextCommentToolbarShadowDOM$(){return this.textCommentToolbarShadowDOM$.asObservable()}enableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!0}}),this.dialogShadowDOM$.value===!0)return;this.dialogShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDialogShadowDOM: ",e)}}enableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!0}}),this.textCommentToolbarShadowDOM$.value===!0)return;this.textCommentToolbarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarShadowDOM: ",e)}}disableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!1}}),this.textCommentToolbarShadowDOM$.value===!1)return;this.textCommentToolbarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarShadowDOM: ",e)}}enableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!0}}),this.textCommentToolShadowDOM$.value===!0)return;this.textCommentToolShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolShadowDOM: ",e)}}disableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!1}}),this.textCommentToolShadowDOM$.value===!1)return;this.textCommentToolShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolShadowDOM: ",e)}}enableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!0}}),this.textCommentToolDarkMode$.value===!0)return;this.textCommentToolDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolDarkMode: ",e)}}disableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!1}}),this.textCommentToolDarkMode$.value===!1)return;this.textCommentToolDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolDarkMode: ",e)}}enableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!0}}),this.textCommentToolbarDarkMode$.value===!0)return;this.textCommentToolbarDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarDarkMode: ",e)}}disableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!1}}),this.textCommentToolbarDarkMode$.value===!1)return;this.textCommentToolbarDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarDarkMode: ",e)}}enablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!0}}),this.pinDarkMode$.value===!0)return;this.pinDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDarkMode: ",e)}}disablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!1}}),this.pinDarkMode$.value===!1)return;this.pinDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDarkMode: ",e)}}disableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!1}}),this.dialogShadowDOM$.value===!1)return;this.dialogShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDialogShadowDOM: ",e)}}getDialogShadowDOM(){return this.dialogShadowDOM$.value}getDialogShadowDOM$(){return this.dialogShadowDOM$.asObservable()}setDialogShadowDOMExplicit(e){this.dialogShadowDOMExplicit$.next(e)}getDialogShadowDOMExplicit$(){return this.dialogShadowDOMExplicit$.asObservable()}enableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!0}}),this.sidebarShadowDOM$.value===!0)return;this.sidebarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarShadowDOM: ",e)}}disableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!1}}),this.sidebarShadowDOM$.value===!1)return;this.sidebarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarShadowDOM: ",e)}}getSidebarShadowDOM(){return this.sidebarShadowDOM$.value}getSidebarShadowDOM$(){return this.sidebarShadowDOM$.asObservable()}enableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!0}}),this.changeDetectionInCommentMode$.value===!0)return;this.changeDetectionInCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableChangeDetectionInCommentMode: ",e)}}disableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!1}}),this.changeDetectionInCommentMode$.value===!1)return;this.changeDetectionInCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableChangeDetectionInCommentMode: ",e)}}getChangeDetectionInCommentMode(){return this.changeDetectionInCommentMode$.value}getChangeDetectionInCommentMode$(){return this.changeDetectionInCommentMode$.asObservable()}showResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!0}}),this.resolvedCommentsOnDom$.value===!0)return;this.resolvedCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showResolvedCommentsOnDom: ",e)}}hideResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!1}}),this.resolvedCommentsOnDom$.value===!1)return;this.resolvedCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideResolvedCommentsOnDom: ",e)}}getResolvedCommentsOnDom(){return this.resolvedCommentsOnDom$.value}getResolvedCommentsOnDom$(){return this.resolvedCommentsOnDom$.asObservable()}enableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!0}}),this.bubbleOnPinEnabled$.value===!0)return;this.bubbleOnPinEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPin: ",e)}}disableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!1}}),this.bubbleOnPinEnabled$.value===!1)return;this.bubbleOnPinEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPin: ",e)}}getBubbleOnPin(){return this.bubbleOnPinEnabled$.value}getBubbleOnPin$(){return this.bubbleOnPinEnabled$.asObservable()}enableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!0}}),this.bubbleOnPinHoverEnabled$.value===!0)return;this.bubbleOnPinHoverEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPinHover: ",e)}}disableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!1}}),this.bubbleOnPinHoverEnabled$.value===!1)return;this.bubbleOnPinHoverEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPinHover: ",e)}}getBubbleOnPinHover(){return this.bubbleOnPinHoverEnabled$.value}getBubbleOnPinHover$(){return this.bubbleOnPinHoverEnabled$.asObservable()}enablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!0}}),this.pinDragEnabled$.value===!0)return;this.pinDragEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDrag: ",e)}}disablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!1}}),this.pinDragEnabled$.value===!1)return;this.pinDragEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDrag: ",e)}}getPinDrag(){return this.pinDragEnabled$.value}getPinDrag$(){return this.pinDragEnabled$.asObservable()}setExcludeLocationIdsFromSidebar(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{excludeLocationIdsFromSidebar:e}}),this.excludeLocationIdsFromSidebar$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setExcludeLocationIdsFromSidebar: ",t)}}getExcludeLocationIdsFromSidebar(){return this.excludeLocationIdsFromSidebar$.value}getExcludeLocationIdsFromSidebar$(){return this.excludeLocationIdsFromSidebar$.asObservable()}enableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!0}}),this.multiThread$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMultiThread: ",e)}}disableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!1}}),this.multiThread$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMultiThread: ",e)}}getMultiThread(){return this.multiThread$.value}getMultiThread$(){return this.multiThread$.asObservable()}enableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!0}}),this.groupMatchedComments$.value===!0)return;this.groupMatchedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGroupMatchedComments: ",e)}}disableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!1}}),this.groupMatchedComments$.value===!1)return;this.groupMatchedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGroupMatchedComments: ",e)}}getGroupMatchedComments(){return this.groupMatchedComments$.value}getGroupMatchedComments$(){return this.groupMatchedComments$.asObservable()}enableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!0}}),this.restrictTextSearchToAnchor$.value===!0)return;this.restrictTextSearchToAnchor$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRestrictTextSearchToAnchor: ",e)}}disableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!1}}),this.restrictTextSearchToAnchor$.value===!1)return;this.restrictTextSearchToAnchor$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRestrictTextSearchToAnchor: ",e)}}getRestrictTextSearchToAnchor(){return this.restrictTextSearchToAnchor$.value}getRestrictTextSearchToAnchor$(){return this.restrictTextSearchToAnchor$.asObservable()}enableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!0}}),this.shortUserName$.value===!0)return;this.shortUserName$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShortUserName: ",e)}}disableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!1}}),this.shortUserName$.value===!1)return;this.shortUserName$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShortUserName: ",e)}}getShortUserName(){return this.shortUserName$.value}getShortUserName$(){return this.shortUserName$.asObservable()}enableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!0}}),this.serviceBook.get(ln)?.enableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService enableRecordingCountdown: ",e)}}disableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!1}}),this.serviceBook.get(ln)?.disableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService disableRecordingCountdown: ",e)}}setCommentSidebarFilters(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentSidebarFilters","color: green;"),this.commentSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarFilters: ",t)}}getCommentSidebarFilters(){return this.commentSidebarFilters$.value??{}}getCommentSidebarFilters$(){return this.commentSidebarFilters$.asObservable()}setEffectiveSidebarFilters(e){try{this.effectiveSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEffectiveSidebarFilters: ",t)}}getEffectiveSidebarFilters$(){return this.effectiveSidebarFilters$.asObservable()}setCommentSidebarSystemFiltersOperator(e){try{this.commentSidebarSystemFiltersOperator$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarSystemFiltersOperator: ",t)}}getCommentSidebarSystemFiltersOperator(){return this.commentSidebarSystemFiltersOperator$.value}getCommentSidebarSystemFiltersOperator$(){return this.commentSidebarSystemFiltersOperator$.asObservable()}enableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!0}}),this.domService.enableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService enableCommentPinHighlighter: ",e)}}disableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!1}}),this.domService.disableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService disableCommentPinHighlighter: ",e)}}setCustomReactions(e){try{this.reactionService?.setCustomReactions(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomReactions: ",t)}}onCommentSelectionChange$(){return this.commentSelectionChange$.asObservable()}onVisibilityOptionClicked$(){return this.visibilityOptionClicked$.asObservable()}emitVisibilityOptionClicked(e){this.visibilityOptionClicked$.next(e)}onCommentAdd$(){return this.commentAdded$.asObservable()}onCommentUpdate$(){return this.commentUpdated$.asObservable()}onCommentAnnotationDelete$(){return this.commentAnnotationDeleted$.asObservable()}onMultiThreadCommentAnnotationDelete$(){return this.multiThreadCommentAnnotationDeleted$.asObservable()}getCommentMode(){try{let e="freestyle";return this.getStreamMode()?e="stream":this.getPopoverMode()&&(e="popover"),e}catch(e){return this.loggingService.catch("Error in CommentService getCommentMode: ",e),"freestyle"}}getCommentType(e){try{return e.targetElement?"element":e.targetTextRange?"text":e.areaAnnotationId?"area":""}catch(t){return this.loggingService.catch("Error in CommentService getCommentType: ",t),""}}getCommentAnnotationAvailableOnXPath(e,t,a){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(i=>(!a&&t&&(a=zr(t,["id","data-id"])),Ee(f(g({},i),{element:a})))),Me(i=>this.getLocations$().pipe(Oe(c=>f(g({},i),{locationIds:c})))),Oe(({locationIds:i,element:c})=>{let m=[],h=this.docService.getDocumentPaths();if(h?.documentId){let _=this.docService.getAdditionalDocumentIdFromElement(c),I=_?this.docService.generateDocumentId(_):h?.documentId,S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:h?.organizationId,documentId:I||""});if(S)for(let z of S)(t&&z?.targetElementId===t||z?.targetElement?.xpath===e)&&i?.includes(z?.locationId)&&m.push(z)}return m.length?m:null}))}catch(i){return this.loggingService.catch("Error in CommentService isCommentAnnotationAvailableOnXPath: ",i),Ee(null)}}getCommentAnnotationsByContext({context:e,contextOptions:t,element:a,clientDocumentId:i}){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(()=>this.docService.getDocumentPaths$()),Oe(()=>{let c=null,m=this.docService.getDocumentPaths(),h=on(e),_=this.generateContextId(h);if(m?.documentId){let I=i||this.docService.getAdditionalDocumentIdFromElement(a??null),S=I?this.docService.generateDocumentId(I):m?.documentId,z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:m?.organizationId,documentId:S||""});if(z){c=[];for(let $ of z)t?.partialMatch?Zh($?.context,h)&&c.push($):_&&$?.contextId===_&&c.push($)}}return c}))}catch(c){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByContext: ",c),Ee(null)}}getCommentAnnotationByAnnotationId(e){try{return this.commentAnnotationById$.pipe(Oe(()=>this.getAnnotationById(e)),Me(t=>t?t?.iam?.accessMode===lr.PRIVATE?this.isPrivateCommentAllowed$().pipe(Oe(a=>{if(a)return t})):Ee(t):Ee(t)),Me(t=>t?this.filterCommentsUsingSidebarSettings(t).pipe(Oe(a=>{if(a)return a})):Ee(t)))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationByAnnotationId: ",t),Ee(void 0)}}getMultiThreadCommentAnnotationByAnnotationId(e){return this.multiThreadCommentAnnotationById$.pipe(Oe(()=>this.getMultiThreadAnnotationById(e)))}getCommentBubbleElement(e){try{let t=document.querySelector(`${X.TAGS.VELT_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`);return t||(t=document.querySelector(`${X.TAGS.SNIPPYLY_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`)),t}catch(t){return this.loggingService.catch("Error in CommentService getCommentBubbleElement: ",t),null}}getCommentAnnotationsBySectionId(e){try{return this.commentAnnotationById$.pipe(Me(()=>this.docService.getDocumentPaths$().pipe(Oe(t=>({documentPaths:t,sectionId:e})))),Me(t=>{let a=zr(e,["id","data-id"]);if(a){let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.genarateLocationId(i);return this.docService.getLocations$().pipe(Oe(m=>{let _=Object.values(m||{}).find(I=>I.locationId===c||i?.id&&I.location.id===i.id);return f(g({},t),{additionalLocation:_,locationOnElement:!!i})}))}}return Ee(f(g({},t),{additionalLocation:null,element:a}))}),Me(t=>t?.locationOnElement?Ee(t):this.docService.getLocation$().pipe(Oe(a=>f(g({},t),{location:a})))),Oe(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c,element:m})=>{let h=null;if(this.authService.getUser()&&t?.documentId){let I=this.docService.getAdditionalDocumentIdFromElement(m),S=I?this.docService.generateDocumentId(I):t?.documentId,z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:S||""});if(z){h=[];let $=gn(e);c?i?.location?.id?$=gn([i?.location?.id,e]):i?.locationId&&($=gn([i?.locationId+"",e])):a&&(a?.location?.id?$=gn([a?.location?.id,e]):a?.locationId&&($=gn([a?.locationId+"",e])));for(let G of z)G?.multiThreadAnnotationId===$?h.push(G):(G?.targetInlineCommentElementId===e||G?.targetElementId===e)&&(c?i&&Ig({location:i?.location,locationId:i?.locationId},{location:G.location,locationId:G.locationId})&&h.push(G):a?Ig({location:a?.location,locationId:a?.locationId},{location:G.location,locationId:G.locationId})&&h.push(G):G?.locationId||h.push(G))}}return h}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByMultiThreadAnnotationId(e){try{return this.commentAnnotationById$.pipe(Me(()=>this.multiThreadCommentAnnotationById$),Me(()=>this.docService.getDocumentPaths$().pipe(Oe(t=>({documentPaths:t,multiThreadAnnotationId:e})))),Oe(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c})=>{let m=null;if(t?.documentId){let h=this.getMultiThreadAnnotationById(e),{documentId:_,organizationId:I}=h?.metadata||{documentId:t?.documentId,organizationId:t?.organizationId},S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:I,documentId:_||""});if(S){m=[];for(let z of S)z?.multiThreadAnnotationId===e&&h?.commentAnnotations?.[z?.annotationId]&&m.push(z)}}return m}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByAnnotationIds(e){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(()=>this.docService.getDocumentPaths$().pipe(Oe(t=>({documentPaths:t,annotationIds:e})))),Oe(({documentPaths:t})=>{let a=null;if(t?.documentId){let i=this.commentAnnotationById$.value?Object.values(this.commentAnnotationById$.value):[],c=this.draftCommentAnnotationsByAnnotationId$.value?Object.values(this.draftCommentAnnotationsByAnnotationId$.value):[];if(i=[...i,...c],i){a=[];for(let m of i)e.includes(m?.annotationId)&&a.push(m)}}return a}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByAnnotationIds: ",t),Ee(null)}}getCommentAnnotationsByFolderId({folderId:e,veltFolderId:t}){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(()=>this.docService.getDocumentPaths$()),Oe(()=>{e&&!t&&(t=dr(e));let a=this.authService.getUser(),i=this.docService.getDocumentPaths(),c=null;if(a&&i?.documentId){this.commentAnnotationById$.value&&(c={},Object.values(this.commentAnnotationById$.value).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&(c[h?.annotationId]=h)}));let m=this.draftCommentAnnotationsByAnnotationId$.value;m&&(c===null&&(c={}),Object.values(m).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&!c[h?.annotationId]&&(c[h?.annotationId]=h)}))}return c?Object.values(c):null}))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByFolderId: ",a),Ee(null)}}getCommentAnnotationsForCommentComponent(e){try{let{annotationId:t,folderId:a,veltFolderId:i,targetElementId:c,clientDocumentId:m,documentId:h,context:_,contextOptions:I,element:S,type:z,sectionId:$,locationId:G}=e||{};if(m&&!h&&(h=this.docService.generateDocumentId(m)),a&&!i&&(i=dr(a)),t)return this.getCommentAnnotationByAnnotationId(t).pipe(Oe(ae=>ae?[ae]:null));let Z=[];if(c&&(z==="pin"||z==="tool"||z==="bubble")){let ae=zr(c,["id","data-id"]);if(ae){let pe=ae,Se=this.domService.getXPath(ae);Z.push(this.getCommentAnnotationAvailableOnXPath(Se,c,pe))}}return $&&Z.push(this.getCommentAnnotationsBySectionId($)),_&&Z.push(this.getCommentAnnotationsByContext({context:_,contextOptions:I,element:S,clientDocumentId:m})),h&&Z.push(this.getCommentAnnotationsByDocumentId$({documentId:h})),a&&Z.push(this.getCommentAnnotationsByFolderId({folderId:a,veltFolderId:i})),Z.length===0?Ee(null):kr(Z).pipe(Oe(ae=>{let pe=ae.filter(oe=>oe!==null&&Array.isArray(oe));if(pe.length===0)return null;if(pe.length===1){let oe=pe[0];return G&&oe?.length?oe.filter(_e=>_e?.location?.id===G):oe}let Se=pe[0];for(let oe=1;oe<pe.length;oe++){let he=pe[oe];Se=Se.filter(_e=>he.some(Ye=>Ye.annotationId===_e.annotationId))}return G&&Se?.length&&(Se=Se.filter(oe=>oe?.location?.id===G)),Se}),gr(Wr))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsForCommentComponent: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}isElementInsideAllowedElements(e){try{return this.allowedElementIds$.value?.length||this.allowedElementClassNames$.value?.length||this.allowedElementQuerySelectors$.value?.length?!!(this.allowedElementIds$.value?.length&&this.domService.isElementInsideListedElementIds(e,this.allowedElementIds$.value)||this.allowedElementClassNames$.value?.length&&this.domService.isElementInsideListedElementClassNames(e,this.allowedElementClassNames$.value)||this.allowedElementQuerySelectors$.value?.length&&this.domService.isElementInsideListedElementQuerySelectors(e,this.allowedElementQuerySelectors$.value)):!0}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideAllowedElements: ",t),!1}}getNearestAllowedElement(e){try{let t=this.domService.getListedElements({elementIds:this.allowedElementIds$.value,elementClassNames:this.allowedElementClassNames$.value,elementQuerySelectors:this.allowedElementQuerySelectors$.value});if(t?.length){for(let a=0;a<t.length;a++){let i=t[a];if(e.contains(i))return i}return null}return null}catch(t){return this.loggingService.catch("Error in CommentService getNearestAllowedElement: ",t),null}}isElementInsideManualCommentContainer(e){try{return this.domService.isElementInsideParentWithAttribute(e,X.ATTRIBUTES.VELT_MANUAL_COMMENT_CONTAINER,"true")}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideManualCommentContainer: ",t),!1}}saveComment(e,t){return Pe(this,null,function*(){try{t?.annotation&&(e=t.annotation),e&&(e=JSON.parse(JSON.stringify(e)));let a=this.originalCommentAnnotationsByDocumentId$.value[e.annotationId];if(a?.comments?.length){let I=JSON.parse(JSON.stringify(e.comments||[]));e.comments=[],a.comments?.forEach(S=>{let z=I.find($=>$.commentId===S.commentId);z?e.comments.push(z):e.comments.push(S)})}e.comments||(e.comments=[]);let i=!1,c=!1,m;switch(t.type){case Ke.NEWLY_ADDED:case Ke.ADDED:if(!t.updatedComment)break;e?.comments?.length||(c=!0),e.comments.push(t.updatedComment);let I=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:t.type,otherFields:{assigned:I}};break;case Ke.APPROVED:e.approved=!0,m={commentAnnotation:e,targetComment:null,actionType:Ke.APPROVED};break;case Ke.ASSIGNED:{let pe=a?.assignedTo;e.assignedTo=t.assignedTo,m={commentAnnotation:e,targetComment:null,actionType:Ke.ASSIGNED,otherFields:{oldAssignedTo:pe,newAssignedTo:t.assignedTo}};break}case Ke.UPDATED:if(!t.updatedComment)break;let S=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);if(S>=0){let pe=e.comments[S]?.commentText;e.comments[S]=t.updatedComment,e.comments[S].status=Ke.UPDATED;let Se=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.UPDATED,otherFields:{assigned:Se,oldCommentText:pe}}}break;case Ke.REACTION_ADDED:if(!t.updatedComment)break;let z=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);z>=0&&(e.comments[z]=t.updatedComment,e.comments[z].status=Ke.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.REACTION_ADDED});break;case Ke.REACTION_DELETED:if(!t.updatedComment)break;let $=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);$>=0&&(e.comments[$]=t.updatedComment,e.comments[$].status=Ke.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.REACTION_DELETED});break;case Ke.STATUS_CHANGED:if(e.status.type==="terminal"){this.domService.resetSelectedAnnotationsMap(!1,"comment");let pe=this.authService.getUser();e.resolvedByUserId=pe?.userId,e.resolvedByUser=pe}m={commentAnnotation:e,targetComment:null,actionType:Ke.STATUS_CHANGED,otherFields:{oldStatus:t.oldStatus,newStatus:t.newStatus}};break;case Ke.PRIORITY_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ke.PRIORITY_CHANGED,otherFields:{oldPriority:t.oldPriority,newPriority:t.newPriority}};break;case Ke.ACCESS_MODE_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ke.ACCESS_MODE_CHANGED,otherFields:{oldAccessMode:t.oldAccessMode,newAccessMode:t.newAccessMode}};break;case Ke.CUSTOM_LIST_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ke.CUSTOM_LIST_CHANGED,otherFields:{oldCustomList:t.oldCustomList,newCustomList:t.newCustomList}};break;case Ke.SUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ke.SUBSCRIBED};break;case Ke.UNSUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ke.UNSUBSCRIBED};break;case Ke.DELETED:if(!t.updatedComment)break;let G=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);if(G>=0){if((G===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value)&&!t.skipDeleteThreadConfirmation){let oe={};if(this.deleteReplyConfirmation$.value&&(G!==0||this.deleteThreadWithFirstComment$.value===!1)?oe={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:oe={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!(yield this.dialog.open(Mg,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:oe}).afterClosed().toPromise()))return}let pe=e.comments.splice(G,1),Se=e.metadata;pe?.length&&pe.forEach(oe=>{oe?.attachments&&oe.attachments.forEach(he=>{let _e={attachmentId:he.attachmentId,organizationId:Se?.clientOrganizationId??Se?.organizationId??null,documentId:Se?.clientDocumentId??Se?.documentId??null,folderId:Se?.folderId??null,commentAnnotationId:e.annotationId,apiKey:Se?.apiKey??null};this.deleteAttachment({attachment:he,metadata:_e})}),oe?.reactionAnnotationIds&&oe.reactionAnnotationIds.forEach(he=>{this.deleteReaction(he)})})}e?.status?.type==="terminal"&&(e.status=this.customFilterService.defaultStatus),G===0&&this.deleteThreadWithFirstComment$.value!==!1||e.comments?.length===0?i=!0:(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_THREAD_DELETED,{annotationId:e.annotationId,commentThreadId:t.updatedComment.commentId,commentMode:this.getCommentMode()}),m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.DELETED});break;case Ke.ACCEPTED:let Z={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ke.ACCEPTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentAccepted$.next(Z),m={commentAnnotation:e,targetComment:null,actionType:Ke.ACCEPTED};break;case Ke.REJECTED:let ae={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ke.REJECTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentRejected$.next(ae),this.domService.resetSelectedAnnotationsMap(),m={commentAnnotation:e,targetComment:null,actionType:Ke.REJECTED};break;case Ke.SUGGESTION_ACCEPTED:m={commentAnnotation:e,targetComment:null,actionType:Ke.SUGGESTION_ACCEPTED,otherFields:{resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;case Ke.SUGGESTION_REJECTED:m={commentAnnotation:e,targetComment:null,actionType:Ke.SUGGESTION_REJECTED,otherFields:{rejectReason:e?.suggestion?.rejectReason,resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;default:break}if(e.resolvedByUserId&&e.status.type!=="terminal"&&(e.resolvedByUserId=null,e.resolvedByUser=null),t.visibility)try{let I=g({},t.visibility);if(I.type==="organizationPrivate"&&!I.organizationId&&!I.organizationIds?.length){let $=this.docService.getOrganizationConfig();$?.clientOrganizationId&&(I.organizationId=$.clientOrganizationId)}let S=e.from?.userId||this.authService.getUser()?.userId,z=An(I,S);z.length>0&&(e.context||(e.context={}),e.context._setAccessFields=z,e.visibilityConfig=Pn(I,S))}catch(I){this.loggingService.catch("Error building accessFields from visibility in saveComment:",I)}if(t?.updatedComment?.isDraft&&(m=void 0),i)this.deleteCommentPinAnnotation(e,!0),this.domService.resetSelectedAnnotationsMap(!1,"comment");else{if(c&&e.comments?.length&&this.enableAutoCategorize$?.value&&this.setCommentCategory(e),e.context?.access&&e.context?.accessFields&&t.updatedComment?.from?.userId&&!this.userPermissionService?.hasUserContextAccess({userId:t.updatedComment?.from?.userId,accessFields:e.context.accessFields})){this.loggingService.catch("User does not have context access to update comment annotation.",void 0,void 0,!0);return}this.updateComment(e,!1,!1,m,!0,t.updatedComment),e?.multiThreadAnnotationId&&(t.type===Ke.ADDED||t.type===Ke.NEWLY_ADDED)&&e.comments?.length===1?setTimeout(()=>{this.domService.resetSelectedAnnotationsMap(!1,"comment")},100):this.domService.updateSelectedAnnotationInMap([e])}let h=this.getCustomPinById(e.annotationId),_={type:t.type,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e.annotationId,targetCommentId:t.updatedComment?.commentId,updateContext:(I,S)=>{this.updateCommentAnnotationContext(e.annotationId,I,S)}};if(h!==void 0&&(_.element=h),delete _?.annotation?.pageInfo,delete _?.annotation?.targetElement,delete _?.annotation?.targetTextRange,_?.type===Ke.DELETED&&(e.comments?.length||(_.annotation=null)),i||this.commentUpdated$.next(_),t.type===Ke.NEWLY_ADDED&&!i&&e?.annotationId){let I=this.pendingAddCommentAnnotationData.get(e.annotationId);if(I){this.pendingAddCommentAnnotationData.delete(e.annotationId);let S=f(g({},I),{annotation:this.getCommentAnnotationForClient(e),targetCommentId:t.updatedComment?.commentId}),z=yield this.commentActionsService?.getAddCommentAnnotationEventFromCommentAddEventData(S);z&&this.commentActionsService?.triggerAddCommentAnnotationEvent(z),t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}}t.type===Ke.ADDED&&t._dispatchAddCommentEvent&&!i&&e?.annotationId&&t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}catch(a){this.loggingService.catch("Error in CommentService saveComment: ",a)}})}attachComment(e,t=[],a,i,c,m,h,_){try{this.loggingService.log("%c[WB] Calling FUNCTION: attachComment","color: green;");let I;if(e){let S=zr(e,t);S&&(I={targetElement:{xpath:this.domService.getXPath(S),topPercentage:50,leftPercentage:90},targetElementId:e})}(I||a||c)&&this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,m,void 0,void 0,I,_,void 0,void 0,i,void 0,void 0,void 0,a,void 0,c,void 0,void 0,h)}catch(I){this.loggingService.catch("Error in CommentService attachComment: ",I)}}generateComponentIdFromObject(e){try{let t=on(e||{});return mr(JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CommentService generateComponentIdFromObject: ",t);return}}updateNotificationsDatabase(e,t,a,i={}){try{let c=g({annotationData:e,targetAnnotationData:t,actionType:a,notificationSource:"comment"},i);this.notificationService.updateNotificationDatabase(c)}catch(c){this.loggingService.catch("Error in CommentService updateNotificationsDatabase: ",c)}}getUserContacts$(){return this.contactService.getUserContacts$()}addUserContact(e){this.contactService.addUserContact(e)}getCustomUserContacts(){try{return this.contactService.getCustomUserContacts()}catch(e){return this.loggingService.catch("Error in CommentService getCustomUserContacts:",e),null}}getCustomUserContactsConfig(){try{return this.contactService.getCustomUserContactsConfig()}catch(e){this.loggingService.catch("Error in CommentService getCustomUserContactsConfig:",e);return}}getElementFromComment(e){try{let t=null;if(e?.ghostComment)!t&&e.ghostComment?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.xpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null));else{let a=!1,i=e?.targetElement?.anchor;if(!t&&i){let c=this.domService.resolveAnchorRecord(i);c?.element&&this.domService.isElementVisible(c.element)&&un(c.element)&&(t=c.element)}!t&&e?.targetElement?.xpath&&(a=this.domService.isXpathWithId(e?.targetElement?.xpath),t=this.domService.getElementFromXPath(e?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null)),a||(!t&&e?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)))}return t&&!un(t)&&(t=null),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),null}}getElementFromComments(e){try{let t=[],a=null;if(e?.ghostComment)!a&&e.ghostComment?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.xpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null));else{let i=!1,c=e?.targetElement?.anchor;if(!a&&c){let m=this.domService.resolveAnchorRecord(c);m?.element&&this.domService.isElementVisible(m.element)&&un(m.element)&&(a=m.element)}!a&&e?.targetElement?.xpath&&(i=this.domService.isXpathWithId(e?.targetElement?.xpath),a=this.domService.getElementFromXPath(e?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null)),i||(!a&&e?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)))}return a&&!un(a)&&(a=null),e?.targetElementId&&(t=Array.from(db(e.targetElementId,["id","data-id"]))),a&&!t.includes(a)&&t.push(a),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),[]}}getGhostCommentTargetElement(e){try{let t=e.targetElement?.fXpath||e.targetElement?.xpath,a=null;if(t)for(;!a&&t;)a=this.domService.getElementFromXPath(t),a&&(!this.domService.isElementVisible(a)||!un(a))&&(a=null),a||(t=t.substring(0,t.lastIndexOf("/")));return t==="/"&&(t=""),t?{xpath:t,topPercentage:e?.targetElement?.topPercentage||0,leftPercentage:e?.targetElement?.leftPercentage||0}:null}catch(t){return this.loggingService.catch("Error in CommentService getGhostCommentTargetElement: ",t),null}}setGhostCommentMessage(e){try{if(e?.ghostComment){e.ghostComment.message="Original content not found.",e.ghostComment.type=Hr.ELEMENT_DELETED;let t=e?.pageInfo?.deviceInfo?.deviceType,a=new fg().getDeviceType();t&&t!==a&&(e.ghostComment.type=Hr.DIFFERENT_DEVICE,e.ghostComment.message=`Original comment was added on ${t}.`,[On.MOBILE,On.TABLET].includes(t)&&[On.MOBILE,On.TABLET].includes(a)||[On.DESKTOP,On.MONITOR].includes(t)&&[On.DESKTOP,On.MONITOR].includes(a)?e.ghostComment.isSameGroup=!0:e.ghostComment.isSameGroup=!1)}}catch(t){this.loggingService.catch("Error in CommentService setGhostCommentMessage: ",t)}}addAnnotationToGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{},a=t[e?.annotationId]||{};an(e.ghostComment,a)||(t[e?.annotationId]=e.ghostComment,this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService addAnnotationToGhostCommentAnnotationMap: ",t)}}removeAnnotationFromGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{};t[e?.annotationId]&&(delete t[e?.annotationId],this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService removeAnnotationFromGhostCommentAnnotationMap: ",t)}}getGhostCommentAnnotationMap$(){return this.ghostCommentAnnotationMap$.asObservable()}getGhostCommentAnnotationMap(){return this.ghostCommentAnnotationMap$.value||{}}getUnreadCommentsMap$(){return this.unreadCommentsMap$.asObservable().pipe(gr(Wr))}getUnreadCommentsMap(){return this.unreadCommentsMap$.value}getUnreadCommentCountByAnnotationId$(e){return this.getUnreadCommentsMap$().pipe(Oe(t=>t?{count:t[e]||0}:null))}getUnreadCommentAnnotationCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Oe(e=>e?{count:Object.keys(e??{}).length||0}:null))}getUnreadCommentCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Oe(e=>e?{count:Object.values(e).reduce((a,i)=>a+i,0)}:null))}getUnreadCommentCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Oe(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),i&&Object.keys(t).forEach(m=>{i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=t[m])})),{count:c}}else return null}))}getUnreadCommentAnnotationCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Oe(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),Object.keys(t).forEach(m=>{t[m]&&i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=1)})),{count:c}}else return null}))}setCommentAnnotationsAsRead(e){try{for(let t of e)this.viewsService?.setCommentAnnotationAsRead(t)}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsRead: ",t)}}setCommentAnnotationsAsResolved(e){try{let t=this.customFilterService.resolvedStatus,a=this.authService.getUser();if(t){for(let i of e)if(t?.id!==i?.status?.id){let c=JSON.parse(JSON.stringify(i||{}));i.status=this.customFilterService.resolvedStatus,i.statusUpdatedByUserId=a?.userId;let m={annotation:i,type:Ke.STATUS_CHANGED,oldStatus:c.status,newStatus:this.customFilterService.resolvedStatus};this.saveComment(i,m)}}}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsResolved: ",t)}}isCommentAnnotationUnread(e){try{let t=this.authService.getUser();return!(t?.userSnippylyId&&e?.viewedByUserIds?.length&&e?.viewedByUserIds?.includes(t?.userSnippylyId))}catch(t){return this.loggingService.catch("Error in CommentService isCommentAnnotationUnread: ",t),!1}}updateCommentDialogPosition(){try{this.updateCommentDialogPositionTriggerSubject$.next()}catch(e){this.loggingService.catch("Error in CommentService updateCommentDialogPosition: ",e)}}updateCommentDialogPositionTrigger$(){return this.updateCommentDialogPositionTriggerSubject$.asObservable()}enableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!0}}),this.areaCommentEnabled$.value===!0)return;this.areaCommentEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAreaComment: ",e)}}disableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!1}}),this.areaCommentEnabled$.value===!1)return;this.areaCommentEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAreaComment: ",e)}}getAreaCommentEnabled$(){return this.areaCommentEnabled$.asObservable()}getAreaCommentEnabled(){return this.areaCommentEnabled$.value}setPinCursorImage(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setPinCursorImage","color: green;"),e&&(e=`url(${e}) 0 31, auto`),this.commentPinCursorImage$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPinCursorImage: ",t)}}getPinCursorImage$(){return this.commentPinCursorImage$.asObservable()}getPinCursorImage(){return this.commentPinCursorImage$.value}setCommentAnnotationsFromCommentsContainer(e){try{this.commentAnnotationsFromCommentsContainer$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsFromCommentsContainer: ",t)}}getCommentAnnotationsFromCommentsContainer$(){return this.commentAnnotationsFromCommentsContainer$.asObservable()}getCommentAnnotationsFromCommentsContainer(){return this.commentAnnotationsFromCommentsContainer$.value}addManualComment(e){return Pe(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: addManualComment","color: green;"),new Promise((t,a)=>{let i=this.domService.getLastDocumentClick()?.target,c=e?.location||this.docService.getAdditionLocationFromElement(i);if(c?.id){let m=this.docService.getLocationByClientLocationId(c.id);m&&(c=m)}this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,c,void 0,e,void 0,void 0,void 0,m=>{t(m)}),this.addCommentMode$?.value&&!this.persistentCommentMode$?.value&&this.disableAddCommentMode()})}catch(t){return this.loggingService.catch("Error in CommentService addManualComment: ",t),null}})}getCommentUrl(e){try{return e?.pageInfo?.commentUrl?e.pageInfo.commentUrl:(e?.pageInfo||(e.pageInfo=Lu(),e.pageInfo&&(e.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth)),e.pageInfo.commentUrl=this.generateCommentUrl(e),this.updateComment(e),e.pageInfo?.commentUrl)}catch(t){this.loggingService.catch("Error in CommentService getCommentUrl: ",t);return}}uploadFile(e,t){let a=`${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`;this.documentPaths?.organizationId&&(a=`${X.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${this.documentPaths.organizationId}/${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`);let i={organizationId:t.metadata?.clientOrganizationId??this.documentPaths?.clientOrganizationId??null,documentId:t.metadata?.clientDocumentId??this.documentPaths?.clientDocumentId??null,commentAnnotationId:t.annotationId,apiKey:t.metadata?.apiKey??this.configService?.getApiKey()??null,folderId:t.metadata?.folderId??this.documentPaths?.folderId??null,attachmentId:null};return this.storageService.uploadFile({path:a,file:e,metadata:i,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}downloadAttachment(e){this.storageService.downloadAttachment(e)}deleteAttachment({attachment:e,metadata:t}){return this.storageService.deleteAttachment({attachment:e,metadata:t,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}deleteReaction(e){try{this.reactionService?.deleteReactionPinAnnotation(e)}catch(t){this.loggingService.catch("Error in CommentService deleteReaction: ",t)}}generateCommentUrl(e){let t;try{t=new URL(e?.pageInfo?.url||window.location.href)}catch(a){this.loggingService.catch("Error in CommentService generateCommentUrl: ",a),t=new URL(window.location.href)}return t.searchParams.delete(X.URL_PARAMS.COMMENT_ID),t.searchParams.append(X.URL_PARAMS.COMMENT_ID,e.annotationId),t.href}getCustomPinById(e){if(this.customPinsById.has(e))return this.customPinsById.get(e)}setCustomStatuses(e){try{if(e===void 0)return;this.customStatusesShown$.next(!0),this.customFilterService.setCustomStatusFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomStatuses: ",t)}}getCustomStatusesShown$(){return this.customStatusesShown$.asObservable()}getCustomStatusesShown(){return this.customStatusesShown$.value}setCustomPriorities(e){try{if(e===void 0)return;this.customFilterService.setCustomPriorityFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomPriorities: ",t)}}setCustomCategories(e){try{if(e===void 0)return;this.customFilterService.setCustomCategories(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomCategories: ",t)}}addCommentOnSelectedText(){try{let e=this.authService.getUser();if(this.textCommentMode$.value&&e&&!(e?.isReadOnly||e?.isAnonymous)&&this.authService.isFeatureAllowed(ke.COMMENT)){let t=this.domService.getRange();if(window.getSelection()?.toString()&&!Uc()&&t?.commonAncestorContainer&&this.isElementInsideAllowedElements(t.commonAncestorContainer)&&!eo(t.commonAncestorContainer)){let a=t?this.domService.getTargetTextRangeFromSelectionRange(t):void 0;this.domService.clearTextSelection(),setTimeout(()=>{this.addComment(void 0,a)},100)}}}catch(e){this.loggingService.catch("Error in CommentService addCommentOnSelectedText: ",e)}}getInlineCommentSectionConfig(e){try{let t;if(e){let a=e?.closest(`[${X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID}]`);if(a){let i=a.getAttribute(X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID);i&&(t={},t.targetInlineCommentElementId=i,a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)&&(t.config=JSON.parse(a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)||"{}")))}}return t}catch(t){this.loggingService.catch("Error in CommentService getInlineCommentSectionConfig: ",t)}}createCustomListDataOnAnnotation(e){try{if(e===void 0)return;this.customChipDropdownData$.next(e)}catch(t){this.loggingService.catch("Error in CommentService createCustomListDataOnAnnotation: ",t)}}getCustomChipDropdownData$(){return this.customChipDropdownData$.asObservable()}getCustomChipDropdownData(){return this.customChipDropdownData$.value}setSubscribedUsersDataInCommentAnnotation(e){try{let t={},a=e?.unsubscribedUsers||{},i={};if(e?.subscribedUsers&&Object.keys(e.subscribedUsers||{}).forEach(c=>{let m=e.subscribedUsers?.[c];m?.type==="manual"&&(t[c]=m)}),e?.assignedTo?.userId){let c=mr(e?.assignedTo?.userId);a[c]||t[c]?.type!=="manual"&&(t[c]={user:e?.assignedTo,type:"auto"})}e?.comments?.filter(c=>!c?.isDraft)?.forEach(c=>{if(c?.from?.userId){let m=mr(c?.from?.userId);a[m]||t[m]?.type!=="manual"&&(t[m]={user:c?.from,type:"auto"})}c?.to?.forEach(m=>{if(m?.userId){let h=mr(m.userId);a[h]||t[h]?.type!=="manual"&&(t[h]={user:m,type:"auto"})}}),c?.toOrganizationUserGroup?.forEach(m=>{if(m?.groupId)i[m?.groupId]={type:"auto"};else if(m?.clientGroupId){let h=mr(m.clientGroupId);i[h]={type:"auto"}}})}),e.subscribedUsers=t,e.unsubscribedUsers=a,e.subscribedGroups=i}catch(t){this.loggingService.catch("Error in CommentService setSubscribeUsersDataInCommentAnnotation: ",t)}}getCopyLink$(){return this.copyLink$.asObservable()}setCopyLink(e){try{this.copyLink$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCopyLink: ",t)}}getCommentAnnotationById(e){return this.commentAnnotationById$.pipe(Me(()=>{let{annotationId:t,documentId:a}=e;if(a){let i=wo(a).toString();return this.getDataCommentAnnotationsFromDocumentId(i).pipe(Oe(c=>c.find(h=>h.annotationId===t)||null))}else{let i=this.docService.getDocumentPaths();if(i?.documentId){let c=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:i?.organizationId,documentId:i?.documentId});if(c){let m=c.find(h=>h.annotationId===t);return Ee(m||null)}}}return Ee(null)}),yn(t=>(this.loggingService.catch("Error in CommentService getCommentAnnotationById: ",t),Ee(null))))}getCommentAnnotationByIdSync(e){try{return this.commentAnnotationById$.value?.[e]}catch(t){this.loggingService.catch("Error in CommentService getCommentAnnotationByIdSync: ",t);return}}getDataCommentAnnotationsFromDocumentId(e){return this.configService?.getApiKey()?this.commonDbService.dbListener({feature:"allComments",properties:{documentId:e||this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,isCollection:!0}}).pipe(Oe(t=>t?.data),Oe(t=>{let a=[];return t&&(a=Object.values(t??{}).filter(i=>typeof i=="object")),a})):Ee([])}enableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!0}}),this.collapsedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedComments: ",e)}}disableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!1}}),this.collapsedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedComments: ",e)}}getCollapsedComments$(){return this.collapsedComments$.asObservable()}enableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!0}}),this.collapsedRepliesPreview$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedRepliesPreview: ",e)}}disableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!1}}),this.collapsedRepliesPreview$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedRepliesPreview: ",e)}}getCollapsedRepliesPreview$(){return this.collapsedRepliesPreview$.asObservable()}enableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!0}}),this.fullExpanded$.value===!0)return;this.fullExpanded$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullExpanded: ",e)}}disableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!1}}),this.fullExpanded$.value===!1)return;this.fullExpanded$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullExpanded: ",e)}}getFullExpanded$(){return this.fullExpanded$.asObservable()}getFullExpanded(){return this.fullExpanded$.value}setSidebarCustomActionEventData(e,t,a,i,c){try{this.sidebarCustomActionEventData$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c})}catch(m){this.loggingService.catch("Error in CommentService emitOnSidebarCustomAction: ",m)}}getSidebarCustomActionEventData(){return this.sidebarCustomActionEventData$.asObservable()}setCommentSidebarData(e,t){try{let a=new Set;(e||[]).forEach(c=>{(c?.annotations||[]).forEach(m=>{m?.annotationId&&a.add(m.annotationId)})});let i=this.customSidebarDataAnnotationIds$.value;this.areAnnotationIdSetsEqual(i,a)||this.customSidebarDataAnnotationIds$.next(a),this.sidebarData$.next({data:e,options:t})}catch(a){this.loggingService.catch("Error in CommentService setCommentSidebarData: ",a)}}areAnnotationIdSetsEqual(e,t){if(e===t)return!0;if(e===null||t===null||e.size!==t.size)return!1;for(let a of e)if(!t.has(a))return!1;return!0}getSidebarCustomData(){return this.sidebarData$.asObservable()}getCustomSidebarDataAnnotationIds$(){return this.customSidebarDataAnnotationIds$.asObservable()}getCustomSidebarDataAnnotationIds(){return this.customSidebarDataAnnotationIds$.value}setSidebarCustomActionEventDataAllChanges(e,t,a,i,c){return Pe(this,null,function*(){try{this.sidebarCustomActionEventDataAllChanges$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let m=yield this.metadataService.getGlobalMetadata(),h={buttonContext:{selections:this.buttonService.buttonToggleMapValue()},unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,metadata:m,customFilters:c};this.commentActionsService?.triggerAction(dt.COMMENT_SIDEBAR_DATA_UPDATE,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataAllChanges: ",m)}})}setSidebarCustomActionEventDataOnInit(e,t,a,i,c){return Pe(this,null,function*(){try{this.sidebarCustomActionEventDataOnInit$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let h={metadata:yield this.metadataService.getGlobalMetadata(),unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,buttonContext:{selections:this.buttonService.buttonToggleMapValue()},customFilters:c};this.commentActionsService?.triggerAction(dt.COMMENT_SIDEBAR_DATA_INIT,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataOnInit: ",m)}})}getSidebarCustomActionEventDataAllChanges(){return this.sidebarCustomActionEventDataAllChanges$.asObservable()}getSidebarCustomActionEventDataOnInit(){return this.sidebarCustomActionEventDataOnInit$.asObservable()}getSidebarCustomActionEventDataOnInitValue(){return this.sidebarCustomActionEventDataOnInit$.getValue()}setTransformContext(e){try{e?an(this.transformContext$.value,e)||this.transformContext$.next(e):this.transformContext$.next(null)}catch(t){this.loggingService.catch("Error in CommentService setTransformContext: ",t)}}getTransformContext$(){return this.transformContext$.asObservable()}getTransformContext(){return this.transformContext$.value}enableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!0}}),this.customActions$.value===!0)return;this.customActions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarCustomActions: ",e)}}disableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!1}}),this.customActions$.value===!1)return;this.customActions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarCustomActions: ",e)}}getSidebarCustomActionsValue(){return this.customActions$.getValue()}enableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!0}}),this.queryParamsComments$.value===!0)return;this.queryParamsComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableQueryParamsComments: ",e)}}disableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!1}}),this.queryParamsComments$.value===!1)return;this.queryParamsComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableQueryParamsComments: ",e)}}getQueryParamsComments$(){return this.queryParamsComments$.asObservable()}getQueryParamsComments(){return this.queryParamsComments$.value}enableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!0}}),this.resolveStatusAccessAdminOnly$.value===!0)return;this.resolveStatusAccessAdminOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableResolveStatusAccessAdminOnly: ",e)}}disableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!1}}),this.resolveStatusAccessAdminOnly$.value===!1)return;this.resolveStatusAccessAdminOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableResolveStatusAccessAdminOnly: ",e)}}enableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!0}}),this.linkCallback$.value===!0)return;this.linkCallback$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableLinkCallback: ",e)}}disableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!1}}),this.linkCallback$.value===!1)return;this.linkCallback$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableLinkCallback: ",e)}}getResolveStatusAccessAdminOnly$(){return this.resolveStatusAccessAdminOnly$.asObservable()}getLinkCallback$(){return this.linkCallback$.asObservable()}getResolveStatusAccessAdminOnly(){return this.resolveStatusAccessAdminOnly$.value}getLinkCallback(){return this.linkCallback$.value}enableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!0}}),this.svgAsImg$.value===!0)return;this.svgAsImg$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSvgAsImg: ",e)}}disableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!1}}),this.svgAsImg$.value===!1)return;this.svgAsImg$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSvgAsImg: ",e)}}getSvgAsImg$(){return this.svgAsImg$.asObservable()}getSvgAsImg(){return this.svgAsImg$.value}enableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!0}}),this.commentToNearestAllowedElement$.value===!0)return;this.commentToNearestAllowedElement$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentToNearestAllowedElement: ",e)}}disableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!1}}),this.commentToNearestAllowedElement$.value===!1)return;this.commentToNearestAllowedElement$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentToNearestAllowedElement: ",e)}}getCommentToNearestAllowedElement$(){return this.commentToNearestAllowedElement$.asObservable()}getCommentToNearestAllowedElement(){return this.commentToNearestAllowedElement$.value}enableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!0}}),this.filterCommentsOnDom$.value===!0)return;this.filterCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterCommentsOnDom: ",e)}}disableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!1}}),this.filterCommentsOnDom$.value===!1)return;this.filterCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterCommentsOnDom: ",e)}}getFilterCommentsOnDom$(){return this.filterCommentsOnDom$.asObservable()}getFilterCommentsOnDom(){return this.filterCommentsOnDom$.value}setCommentsFromSidebarMap(e){try{let{comments:t,sidebarVisible:a}=e||{},i=null;t&&(i={},t.forEach(m=>{m?.annotationId&&i&&(i[m.annotationId]=m)}));let c={};t===void 0?c.data=this.commentsFromSidebarMap$.value?.data:c.data=i,a===void 0?c.sidebarVisible=this.commentsFromSidebarMap$.value?.sidebarVisible:c.sidebarVisible=a,an(this.commentsFromSidebarMap$.value,c)||this.commentsFromSidebarMap$.next(c)}catch(t){this.loggingService.catch("Error in CommentService setCommentsFromSidebarMap: ",t)}}getCommentsFromSidebarMap$(){return this.commentsFromSidebarMap$.asObservable()}getCommentsFromSidebarMap(){return this.commentsFromSidebarMap$.value}hasActiveFilters(e){try{return e?!!(e.people?.length||e.assigned?.length||e.tagged?.length||e.involved?.length||e.priority?.length||e.status?.length||e.category?.length||e.location?.length||e.document?.length||e.version?.length||e.accessModes?.length||this.hasCustomContextFilters(e)):!1}catch(t){return this.loggingService.catch("Error in CommentService hasActiveFilters: ",t),!1}}hasCustomContextFilters(e){try{if(!e)return!1;let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]);return Object.keys(e).some(a=>!t.has(a)&&Array.isArray(e[a])&&e[a]?.length>0)}catch(t){return this.loggingService.catch("Error in CommentService hasCustomContextFilters: ",t),!1}}applyDirectFilters(e,t){try{let a=this.commentSidebarSystemFiltersOperator$.value,i,c=!1,m=new Set;a===Ur.AND?i=e.slice():i=[];let h=_=>{a===Ur.AND?i=i.filter(I=>_.some(S=>S.annotationId===I.annotationId)):_.forEach(I=>m.add(I.annotationId)),c=!0};if(t.people?.length){let _=[];t.people.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByPeople({id:S,name:I.name},e)])}),h(_)}if(t.assigned?.length){let _=[];t.assigned.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByAssigned({id:S,name:I.name},e)])}),h(_)}if(t.tagged?.length){let _=[];t.tagged.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByTagged({id:S,name:I.name},e)])}),h(_)}if(t.involved?.length){let _=[];t.involved.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByInvolved({id:S,name:I.name},e)])}),h(_)}if(t.priority?.length){let _=[];t.priority.forEach(I=>_=[..._,...this.filterAnnotationsByPriority({id:I},e)]),h(_)}if(t.status?.length){let _=[];t.status.forEach(I=>_=[..._,...this.filterAnnotationsByStatus({id:I},e)]),h(_)}if(t.category?.length){let _=[];t.category.forEach(I=>_=[..._,...this.filterAnnotationsByCommentCategory({id:I},e)]),h(_)}if(t.version?.length){let _=[];t.version.forEach(I=>_=[..._,...this.filterAnnotationsByVersion(I,e)]),h(_)}if(t.document?.length){let _=[];t.document.forEach(I=>_=[..._,...this.filterAnnotationsByDocument(I,e)]),h(_)}if(t.location?.length){let _=[];t.location.forEach(I=>{I.id&&(_=[..._,...e.filter(S=>S.location?.id===I.id||S.documentParams?.id===I.id)])}),h(_)}if(t.accessModes?.length){let _=[];t.accessModes.forEach(I=>{I===lr.PRIVATE?_=[..._,...e.filter(S=>sr(S))]:I===lr.PUBLIC&&(_=[..._,...e.filter(S=>!sr(S))])}),h(_)}return this.getCustomContextFilterEntries(t).forEach(({key:_,values:I})=>{let S=this.matchAnnotationsByContext(e,_,I);h(S)}),a!==Ur.AND&&(c?i=e.filter(_=>m.has(_.annotationId)):i=e),i}catch(a){return this.loggingService.catch("Error in CommentService applyDirectFilters: ",a),e}}applyCommentSidebarClientFilters(e,t){return this.applyDirectFilters(e,t)}getCustomContextFilterEntries(e){try{if(!e)return[];let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]),a=[];return Object.keys(e).forEach(i=>{if(t.has(i))return;let c=e[i];!Array.isArray(c)||!c.length||a.push({key:i,values:c})}),a}catch(t){return this.loggingService.catch("Error in CommentService getCustomContextFilterEntries: ",t),[]}}matchAnnotationsByContext(e,t,a){try{return e.filter(i=>{let c=i.context?.[t];return c==null?!1:a.some(m=>{let h=typeof m=="string"?m:m?.id;return c===h||c?.toString()===h})})}catch(i){return this.loggingService.catch("Error in CommentService matchAnnotationsByContext: ",i),[]}}filterAnnotationsByPeople(e,t){try{return e.id?t.filter(a=>a?.from?.userId===e.id||a?.from?.email===e.id):t}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPeople: ",a),[]}}filterAnnotationsByTagged(e,t){try{return t.filter(a=>a?.comments?.some(i=>i.taggedUserContacts?.some(c=>c?.contact?.userId===e.id)))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByTagged: ",a),[]}}filterAnnotationsByAssigned(e,t){try{return t.filter(a=>a?.assignedTo?.userId===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByAssigned: ",a),[]}}filterAnnotationsByInvolved(e,t){try{return t.filter(a=>{let i=a?.from?.userId===e.id||a?.from?.email===e.id,c=a?.assignedTo?.userId===e.id,m=a?.comments?.some(h=>h.taggedUserContacts?.some(_=>_?.contact?.userId===e.id));return i||c||m})}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByInvolved: ",a),[]}}filterAnnotationsByPriority(e,t){try{return e.id==="unset"?t.filter(a=>!a?.priority):t.filter(a=>a?.priority?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPriority: ",a),[]}}filterAnnotationsByStatus(e,t){try{return t.filter(a=>a?.status?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByStatus: ",a),[]}}filterAnnotationsByCommentCategory(e,t){try{return e.id==="other"?t.filter(a=>!a?.commentCategories?.length||a?.commentCategories?.some(i=>i.id===e.id)):t.filter(a=>(a?.commentCategories||[]).some(i=>i.id===e.id))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByCommentCategory: ",a),[]}}filterAnnotationsByVersion(e,t){try{return e.id==="unset"?t.filter(a=>!a?.location?.version):t.filter(a=>a?.location?.version?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByVersion: ",a),[]}}filterAnnotationsByDocument(e,t){try{return e?.id&&e.id!=="other"?t.filter(a=>a?.metadata?.clientDocumentId?.toString()===e.id):t.filter(a=>!a?.metadata?.clientDocumentId)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByDocument: ",a),[]}}setSidebarButtonCountType(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonCountType:e}}),this.sidebarButtonCountType$.value===e)return;this.sidebarButtonCountType$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSidebarButtonCountType: ",t)}}getSidebarButtonCountType$(){return this.sidebarButtonCountType$.asObservable()}getSidebarButtonCountType(){return this.sidebarButtonCountType$.value}enableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!0}}),this.filterGhostCommentsInSidebar$.value===!0)return;this.filterGhostCommentsInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterGhostCommentsInSidebar: ",e)}}disableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!1}}),this.filterGhostCommentsInSidebar$.value===!1)return;this.filterGhostCommentsInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterGhostCommentsInSidebar: ",e)}}getFilterGhostCommentsInSidebar$(){return this.filterGhostCommentsInSidebar$.asObservable()}getFilterGhostCommentsInSidebar(){return this.filterGhostCommentsInSidebar$.value}filterCommentsUsingSidebarSettings(e){try{let t=Array.isArray(e),a;return t?a=e||[]:e?a=[e]:a=[],this.getFilterCommentsOnDom$().pipe(Me(i=>i?a.length===0?Ee(e):kr([this.effectiveSidebarFilters$,this.customSidebarDataAnnotationIds$]).pipe(Oe(([c,m])=>{let h=a,_=!1;if(this.hasActiveFilters(c)){let I=this.applyDirectFilters(a,c),S=new Set(I.map(z=>z.annotationId));h=h.filter(z=>z?.isDraft||S.has(z.annotationId)),_=!0}return m&&(h=h.filter(I=>I?.isDraft||I?.annotationId&&m.has(I.annotationId)),_=!0),_?t?h:h.length>0?h[0]:null:e})):Ee(e)))}catch{return Ee(e)}}enableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!0)return;this.focusedThreadMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFocusedThreadMode: ",e)}}disableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!1)return;this.focusedThreadMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFocusedThreadMode: ",e)}}getFocusedThreadMode$(){return this.focusedThreadMode$.asObservable()}enableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!0}}),this.openAnnotationInFocusMode$.value===!0)return;this.openAnnotationInFocusMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableOpenAnnotationInFocusMode: ",e)}}disableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!1}}),this.openAnnotationInFocusMode$.value===!1)return;this.openAnnotationInFocusMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableOpenAnnotationInFocusMode: ",e)}}getOpenAnnotationInFocusMode$(){return this.openAnnotationInFocusMode$.asObservable()}getOpenAnnotationInFocusMode(){return this.openAnnotationInFocusMode$.value}enableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!0}}),this.readOnly$.value===!0)return;this.readOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReadOnly: ",e)}}disableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!1}}),this.readOnly$.value===!1)return;this.readOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReadOnly: ",e)}}getReadOnly$(){return this.readOnly$.asObservable()}getReadOnly(){return this.readOnly$.value}shouldEnableReadOnly(){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: shouldEnableReadOnly","color: green;");let e=this.authService.getUser(),t=this.docService.getDocumentPaths()?.folderId,a=this.docService.getDocumentIds().map(i=>i.clientDocumentId);if(e){let i=this.userPermissionService.getCurrentUserPermissions();i?.[e.userId]?t&&i[e.userId]?.folders?.[t]?.accessRole==="viewer"?this.enableReadOnly():a.forEach(c=>{i[e.userId]?.documents?.[c]?.accessRole==="viewer"&&this.enableReadOnly()}):this.getReadOnly()||this.disableReadOnly()}}catch(e){this.loggingService.catch("Error in CommentService shouldEnableReadOnly:",e)}})}sanitizeCommentAnnotation(e){try{return e?.comments?.length&&e.comments.forEach(t=>{t?.commentHtml&&(t.commentHtml=this.domService.sanitizeHtml(t.commentHtml))}),e}catch(t){return this.loggingService.catch("Error in CommentService sanitizeCommentAnnotation: ",t),e}}enableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!0}}),this.customAutocompleteSearch$.value===!0)return;this.customAutocompleteSearch$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCustomAutocompleteSearch: ",e)}}disableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!1}}),this.customAutocompleteSearch$.value===!1)return;this.customAutocompleteSearch$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCustomAutocompleteSearch: ",e)}}getCustomAutocompleteSearch$(){return this.customAutocompleteSearch$.asObservable()}getCustomAutocompleteSearch(){return this.customAutocompleteSearch$.value}enableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!0}}),this.deleteThreadWithFirstComment$.value===!0)return;this.deleteThreadWithFirstComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteThreadWithFirstComment: ",e)}}disableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!1}}),this.deleteThreadWithFirstComment$.value===!1)return;this.deleteThreadWithFirstComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteThreadWithFirstComment: ",e)}}getDeleteThreadWithFirstComment$(){return this.deleteThreadWithFirstComment$.asObservable()}enableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!0}}),this.expandMentionGroups$.value===!0)return;this.expandMentionGroups$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableExpandMentionGroups: ",e)}}disableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!1}}),this.expandMentionGroups$.value===!1)return;this.expandMentionGroups$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableExpandMentionGroups: ",e)}}getExpandMentionGroups$(){return this.expandMentionGroups$.asObservable()}getExpandMentionGroups(){return this.expandMentionGroups$.value}enableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!0}}),this.showMentionGroupsFirst$.value===!0)return;this.showMentionGroupsFirst$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsFirst: ",e)}}disableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!1}}),this.showMentionGroupsFirst$.value===!1)return;this.showMentionGroupsFirst$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsFirst: ",e)}}getShowMentionGroupsFirst$(){return this.showMentionGroupsFirst$.asObservable()}getShowMentionGroupsFirst(){return this.showMentionGroupsFirst$.value}enableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!0}}),this.showMentionGroupsOnly$.value===!0)return;this.showMentionGroupsOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsOnly: ",e)}}disableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!1}}),this.showMentionGroupsOnly$.value===!1)return;this.showMentionGroupsOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsOnly: ",e)}}getShowMentionGroupsOnly$(){return this.showMentionGroupsOnly$.asObservable()}getShowMentionGroupsOnly(){return this.showMentionGroupsOnly$.value}setAnalyticsFeatureConfig({config:e,feature:t}){try{this.analyticsService.setFeatureConfig({feature:t||ke.COMMENT,config:e})}catch(a){this.loggingService.catch("Error in CommentService setAnalyticsFeatureConfig: ",a)}}generateContextId(e){try{let t;if(e&&typeof e=="object"){let a=JSON.parse(JSON.stringify(e));if(delete a.accessFields,delete a.access,Object.keys(a).length){let i=on(a),c=JSON.stringify(i);t=mr(c)}}return t}catch{return}}setMaxReplyAvatars(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{maxReplyAvatars:e}}),this.maxReplyAvatars$.value===e)return;this.maxReplyAvatars$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMaxReplyAvatars: ",t)}}getMaxReplyAvatars$(){return this.maxReplyAvatars$.asObservable()}getMaxReplyAvatars(){return this.maxReplyAvatars$.value}enableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!0}}),this.replyAvatars$.value===!0)return;this.replyAvatars$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReplyAvatars: ",e)}}disableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!1}}),this.replyAvatars$.value===!1)return;this.replyAvatars$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReplyAvatars: ",e)}}getReplyAvatars$(){return this.replyAvatars$.asObservable()}getReplyAvatars(){return this.replyAvatars$.value}setCommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentplaceholder:e}}),this.commentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentplaceholder: ",t)}}getCommentplaceholder$(){return this.commentplaceholder$.asObservable()}getCommentplaceholder(){return this.commentplaceholder$.value}setReplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyplaceholder:e}}),this.replyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setReplyplaceholder: ",t)}}getReplyplaceholder$(){return this.replyplaceholder$.asObservable()}getReplyplaceholder(){return this.replyplaceholder$.value}setEditplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editplaceholder:e}}),this.editplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditplaceholder: ",t)}}getEditplaceholder$(){return this.editplaceholder$.asObservable()}getEditplaceholder(){return this.editplaceholder$.value}setEditcommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editcommentplaceholder:e}}),this.editcommentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditcommentplaceholder: ",t)}}getEditcommentplaceholder$(){return this.editcommentplaceholder$.asObservable()}getEditcommentplaceholder(){return this.editcommentplaceholder$.value}setEditreplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editreplyplaceholder:e}}),this.editreplyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditreplyplaceholder: ",t)}}getEditreplyplaceholder$(){return this.editreplyplaceholder$.asObservable()}getEditreplyplaceholder(){return this.editreplyplaceholder$.value}enableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!0}}),this.screenshotEnabled$.value===!0)return;this.screenshotEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScreenshot: ",e)}}disableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!1}}),this.screenshotEnabled$.value===!1)return;this.screenshotEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScreenshot: ",e)}}getScreenshotEnabled$(){return this.screenshotEnabled$.asObservable()}getScreenshotEnabled(){return this.screenshotEnabled$.value}getAnnotationNumber(e){try{let t=this.commentAnnotationById$.value||{},a=-1,i=Object.values(t).filter(c=>{let m=c.metadata?.documentId===e.metadata?.documentId;return m&&c.annotationNumber&&(a=Math.max(a,c.annotationNumber)),m});return a===-1?i.length+1:a+1}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationNumber: ",t),null}}enableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!0}}),this.fullScreenInSidebar$.value===!0)return;this.fullScreenInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullScreenInSidebar: ",e)}}disableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!1}}),this.fullScreenInSidebar$.value===!1)return;this.fullScreenInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullScreenInSidebar: ",e)}}getFullScreenInSidebar$(){return this.fullScreenInSidebar$.asObservable()}getFullScreenInSidebar(){return this.fullScreenInSidebar$.value}setComposerFileAttachments(e){try{this.composerFileAttachments$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerFileAttachments: ",t)}}getComposerFileAttachments$(){return this.composerFileAttachments$.asObservable()}getComposerFileAttachments(){return this.composerFileAttachments$.value}clearComposerFileAttachments(){try{this.composerFileAttachments$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearComposerFileAttachments: ",e)}}enableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!0}}),this.attachmentNameInMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentNameInMessage: ",e)}}disableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!1}}),this.attachmentNameInMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentNameInMessage: ",e)}}getAttachmentNameInMessage$(){return this.attachmentNameInMessage$.asObservable()}getAttachmentNameInMessage(){return this.attachmentNameInMessage$.value}setAllowedFileTypes(e){try{this.allowedFileTypes$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedFileTypes: ",t)}}getAllowedFileTypes$(){return this.allowedFileTypes$.asObservable()}getAllowedFileTypes(){return this.allowedFileTypes$.value}enableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!0}}),this.forceCloseAllOnEsc$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableForceCloseAllOnEsc: ",e)}}disableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!1}}),this.forceCloseAllOnEsc$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableForceCloseAllOnEsc: ",e)}}getForceCloseAllOnEsc$(){return this.forceCloseAllOnEsc$.asObservable()}getForceCloseAllOnEsc(){return this.forceCloseAllOnEsc$.value}markAsRead(e){return Pe(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.viewsService?.setCommentAnnotationAsRead(t))}catch(t){this.loggingService.catch("Error in ViewsService markAsRead:",t)}})}markAsUnread(e){return Pe(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.viewsService?.setCommentAnnotationAsUnread(t))}catch(t){this.loggingService.catch("Error in ViewsService markAsUnread:",t)}})}setAutoCompleteScrollConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCompleteScrollConfig:e}});let t=this.autoCompleteScrollConfig$.value,a={itemSize:e.itemSize??t.itemSize,minBufferPx:e.minBufferPx??t.minBufferPx,maxBufferPx:e.maxBufferPx??t.maxBufferPx,templateCacheSize:e.templateCacheSize??t.templateCacheSize};this.autoCompleteScrollConfig$.next(a)}catch(t){this.loggingService.catch("Error in CommentService setAutoCompleteScrollConfig: ",t)}}getAutoCompleteScrollConfig(){return this.autoCompleteScrollConfig$.value}getAutoCompleteScrollConfig$(){return this.autoCompleteScrollConfig$.asObservable()}submitComment(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: submitComment","color: green;"),this.submitComment$.next(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService submitComment: ",t)}}onSubmitComment$(){return this.submitComment$.asObservable()}clearComposer(e){try{this.clearComposer$.next(e.targetComposerElementId),this.composerDataMap.delete(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService clearComposer: ",t)}}onClearComposer$(){return this.clearComposer$.asObservable()}emitComposerTextChange(e,t,a){try{this.commentActionsService?.onComposerTextChange({text:e,annotation:t,targetComposerElementId:a})}catch(i){this.loggingService.catch("Error in CommentService emitComposerTextChange: ",i)}}setComposerData(e,t){try{this.composerDataMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentService setComposerData: ",a)}}clearComposerData(e){try{this.composerDataMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentService clearComposerData: ",t)}}getComposerData(e){try{return this.composerDataMap.get(e.targetComposerElementId)||null}catch(t){return this.loggingService.catch("Error in CommentService getComposerData: ",t),null}}};o.\u0275fac=function(t){return new(t||o)(be(vr),be(to),be(Vv),be(ut),be(Db),be(ot),be(Ne),be(Fh),be(yb),be($t),be(Hb),be(Nh),be($h),be(Dr),be(N),be(zb),be(Dt),be(Jb),be(fr),be(Ab),be(Eg),be(Eb),be(Tb),be(Ug))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Gg=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.authService=e,this.iamService=t,this.docService=a,this.configService=i,this.commonDbService=c,this.loggingService=m,this.commentService=h,this.userPermissionService=_,this.documentPaths=null,this.LISTENER_BATCH_SIZE=5}getAnnotationsCount(e){try{return this.authService.getUser$().pipe(jt(t=>!!t),Me(t=>this.docService.getOrganizationConfig$().pipe(jt(a=>!!a),Oe(()=>t))),Me(t=>this.commentService.isFeatureAllowed({firebaseUser:t,annotations:[],filteredAnnotations:[]})),Me(t=>t.featureAllowed?this.iamService.isUserAllowed$().pipe(Oe(a=>(t.featureAllowed=a,t))):Ee(t)),Me(t=>t.featureAllowed?this.processRequest(t,e):Ee(null)),Oe(t=>t??{data:null}),gr(Wr))}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",t),Ee({data:null})}}processRequest(e,t){try{return Ee(e).pipe(Me(()=>this.initializeDocumentPaths(t,e)),Me(()=>this.getDocumentIds$(t)),Me(a=>{let i=this.authService.getUser()?.userSnippylyId,c=this.buildRequestContext(t,a);if(!this.validateRequestContext(c,t))return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});if(!c.organizationId)return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});let m=this.setupTriggers$(c.mode,c.organizationId,c.clientOrganizationId,c.veltFolderId,c.serverDocumentIds);if(this.shouldUseAggregateMode(c.mode))return this.handleAggregateCounts$({triggers$:m,serverDocumentIds:c.serverDocumentIds,request:t,userId:i,organizationId:c.organizationId,clientOrganizationId:c.clientOrganizationId,veltFolderId:c.veltFolderId,folderId:c.folderId,mode:c.mode}).pipe(Oe(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})));if(c.mode.isBatchedGroupedMode){let h=t?.debounceMs??5e3;return this.handleBatchedGroupedCounts$({triggers$:m,documentIds:a,request:t,userId:i,organizationId:c.organizationId,veltFolderId:c.veltFolderId,debounceMs:h}).pipe(Oe(_=>({data:_,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}else return this.handleGroupedCounts$(m,a,t,i,c.organizationId,c.veltFolderId).pipe(Oe(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}),Me(a=>{if(!a?.data)return Ee(null);let{data:i,mode:c,serverDocumentIds:m}=a;return t?.filterGhostComments?this.filterGhostComments$(i,c,m):Ee(i)}),yn(a=>(this.loggingService.catch("Error processing request: ",a),Ee(null))))}catch(a){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",a),Ee(null)}}initializeDocumentPaths(e,t){try{return e?Ee(t):this.docService.getDocumentPaths$().pipe(jt(a=>!!a),Ac(a=>{this.documentPaths=a,t.documentPaths=a}),Oe(()=>{}))}catch(a){return this.loggingService.catch("Error in CommentService initializeDocumentPaths: ",a),Ee(t)}}buildRequestContext(e,t){try{let a=this.docService.getOrganizationConfig(),i=this.documentPaths?.organizationId??a?.organizationId,c=this.documentPaths?.clientOrganizationId??a?.clientOrganizationId,m,h,_;if(e?.allDocuments||e?.documentIds||e?.folderId||e?.organizationId||e?.locationIds){if(e.organizationId&&(i=Uv(e.organizationId),c=e.organizationId),!i)throw new Error("organizationId is required for this request type");e.folderId&&(m=dr(e.folderId),h=e.folderId),e.allDocuments&&(_=!0)}else m=this.documentPaths?.veltFolderId,h=this.documentPaths?.folderId,_=this.documentPaths?.allDocuments;let I=this.determineMode(e,m,_,t),S=I.isOrgMode?[]:t.length>0?t.map(z=>z.documentId):[this.documentPaths?.documentId??""];return{organizationId:i,clientOrganizationId:c,veltFolderId:m,folderId:h,allDocuments:_,mode:I,serverDocumentIds:S}}catch(a){return this.loggingService.catch("Error in CommentService buildRequestContext: ",a),{organizationId:void 0,clientOrganizationId:void 0,veltFolderId:void 0,folderId:void 0,allDocuments:void 0,mode:{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1},serverDocumentIds:[]}}}validateRequestContext(e,t){try{if(t?.aggregateDocuments&&!e.serverDocumentIds.length)throw this.loggingService.catch("Error in CommentService getAnnotationsCount: documentIds is required when aggregateDocuments is true"),new Error("documentIds is required when aggregateDocuments is true");return!(!e.organizationId||!(e.mode.isOrgMode||e.mode.isFolderMode)&&e.serverDocumentIds.some(a=>!a))}catch(a){return this.loggingService.catch("Error in CommentService validateRequestContext: ",a),!1}}shouldUseAggregateMode(e){try{return e.isFolderMode||e.isOrgMode||e.isBatchMode}catch(t){return this.loggingService.catch("Error in CommentService shouldUseAggregateMode: ",t),!1}}getDocumentIds$(e){try{return e?.documentIds?.length?Ee(e.documentIds.map(t=>({clientDocumentId:t,documentId:xg(t)}))):this.docService.getDocumentIds$().pipe(Oe(t=>t.length>0?t:[{documentId:this.documentPaths?.documentId??"",clientDocumentId:this.documentPaths?.clientDocumentId||""}]))}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIds: ",t),Ee([])}}determineMode(e,t,a,i){try{let c=!!e?.organizationId&&!e?.documentIds?.length&&!t&&!a,m=!!t&&!!a,h=!!e?.aggregateDocuments&&!a&&!!i?.length,_=(!!e?.batchedPerDocument||i.length>1)&&!!i?.length&&!e?.aggregateDocuments&&!a;return{isOrgMode:c,isFolderMode:m,isBatchMode:h,isBatchedGroupedMode:_}}catch(c){return this.loggingService.catch("Error in CommentService determineMode: ",c),{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1}}}setupTriggers$(e,t,a,i,c){try{if(e.isOrgMode){let m=this.authService.getUser()?.userId??"";return[_n(this.userPermissionService?.getUserPermissionsFromCacheOrFetch({organizationId:a})??Promise.resolve({})).pipe(Me(_=>m&&_?.[m]?.organization?.[a]?.errorCode===kg.PERMISSION_DENIED?(this.loggingService.log(`%c[WB] commentViews org listener skipped \u2014 user does not have access to organization: ${a}`,"color: orange;"),Wn):this.commonDbService.dbListener({feature:"organizationMetadata",properties:{useCollectionGroup:!1,isCollection:!1,organizationId:t}}))).pipe(Oe(_=>_?.data?.commentViewsUpdatedAt??null),jt(_=>!!_),gr(Wr))]}else{if(e.isFolderMode)return[this.commonDbService.dbListener({feature:"folder",properties:{useCollectionGroup:!1,isCollection:!1,folderId:i,organizationId:t}}).pipe(Oe(h=>h?.data?.commentViewsUpdatedAt??null),jt(h=>!!h),gr(Wr))];if(e.isBatchMode||e.isBatchedGroupedMode){let m=[];for(let h=0;h<c.length;h+=this.LISTENER_BATCH_SIZE)m.push(c.slice(h,h+this.LISTENER_BATCH_SIZE));return m.map(h=>this.commonDbService.dbListener({feature:"allDocuments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",t),Qe("metadata.documentId","in",h))]}}).pipe(Oe(I=>Object.values(I?.data||{}).map(z=>z?.commentViewsUpdatedAt??null).sort().join(",")),gr(Wr)))}else return c.map(m=>this.commonDbService.dbListener({feature:"documentMetadata",properties:{useCollectionGroup:!1,isCollection:!1,documentId:m,organizationId:t}}).pipe(Oe(_=>_?.data?.commentViewsUpdatedAt??null),jt(_=>!!_),gr(Wr)))}}catch(m){return this.loggingService.catch("Error in CommentService setupTriggers: ",m),[]}}handleGroupedCounts$(e,t,a,i,c,m){try{let h=t.map((_,I)=>e[I].pipe(Mu(void 0),Me(()=>_n(this.getCountsForDocument$(_.documentId,_.clientDocumentId,a,i,c,m)))));return kr(h).pipe(Oe(_=>{let I={};return _.forEach(S=>{S&&(I[S.clientDocumentId]={total:S.total,unread:S.unread})}),{data:I}}),yn(_=>(this.loggingService.catch("Error in grouped counts: ",_),Ee(null))))}catch(h){return this.loggingService.catch("Error in CommentService handleGroupedCounts: ",h),Ee(null)}}handleBatchedGroupedCounts$(e){try{let{triggers$:t,documentIds:a,request:i,userId:c,organizationId:m,veltFolderId:h,debounceMs:_}=e,I=this.LISTENER_BATCH_SIZE,S=new Qp(1),z=t.map((ae,pe)=>ae.pipe(ih(S),Oe(()=>pe))),$=Eu(...z).pipe(Ov(_)),G=Ee(-1).pipe(Me(()=>_n(this.fetchAllDocumentCounts$(a,i,c,m,h))),Oe(ae=>({batchIndex:-1,data:ae?.data||{}})),Ac(()=>{S.next()})),Z=$.pipe(Me(ae=>{let pe=ae*I,Se=Math.min(pe+I,a.length),oe=a.slice(pe,Se);return _n(this.fetchAllDocumentCounts$(oe,i,c,m,h)).pipe(Oe(he=>({batchIndex:ae,data:he?.data||{}})))}));return Eu(G,Z).pipe(oh((ae,pe)=>({data:g(g({},ae.data),pe.data)}),{data:{}}),yn(ae=>(this.loggingService.catch("Error in batched grouped counts: ",ae),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleBatchedGroupedCounts: ",t),Ee(null)}}fetchAllDocumentCounts$(e,t,a,i,c){return Pe(this,null,function*(){try{let m=e.map(I=>this.getCountsForDocument$(I.documentId,I.clientDocumentId,t,a,i,c)),h=yield Promise.allSettled(m),_={};return h.forEach(I=>{if(I.status==="fulfilled"&&I.value){let{clientDocumentId:S,total:z,unread:$}=I.value;_[S]={total:z,unread:$}}}),{data:_}}catch(m){return this.loggingService.catch("Error in CommentService fetchAllDocumentCounts: ",m),null}})}handleAggregateCounts$(e){try{let{triggers$:t,serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e;return kr(t).pipe(Oe(()=>{})).pipe(Mu(void 0),Me(()=>_n(this.getAggregateCounts({serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}))),yn($=>(this.loggingService.catch("Error in aggregate counts: ",$),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleAggregateCounts: ",t),Ee(null)}}getCountsForDocument$(e,t,a,i,c,m){return Pe(this,null,function*(){try{let h=this.configService?.getApiKey(),_={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},I=[Qe("metadata.apiKey","==",h),Qe("metadata.organizationId","==",c),Qe("metadata.documentId","in",[e]),...m?[Qe("metadata.veltFolderId","==",m)]:[],...a?.statusIds?.length?[Qe("status.id","in",a.statusIds)]:[],...a?.locationIds?.length?[Qe("location.id","in",a.locationIds)]:[],...a?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",a.agentFields)]:[]],S=[Mr(...I),Xt("lastUpdated","desc"),Xt("createdAt","desc")],z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:S})}),$=0;if(!a?.agentFields?.length){let G=[...I,Qe("viewedByUserIds","array-contains",i)],Z=[Mr(...G),Xt("lastUpdated","desc"),Xt("createdAt","desc")];$=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:Z})})}return{clientDocumentId:t,total:z,unread:z-$}}catch(h){return this.loggingService.catch("Error in CommentService getCountsForDocument: ",h),null}})}getAggregateCounts(e){return Pe(this,null,function*(){try{let t="",{serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e,z=this.configService?.getApiKey(),$={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},G=[Qe("metadata.apiKey","==",z),Qe("metadata.organizationId","==",m),...i?.statusIds?.length?[Qe("status.id","in",i.statusIds)]:[],...i?.locationIds?.length?[Qe("location.id","in",i.locationIds)]:[],...i?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",i.agentFields)]:[]],Z,ae=0;if(S.isFolderMode){t=I??"",G.push(Qe("metadata.veltFolderId","==",_));let pe=[Mr(...G),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:pe})}),!i?.agentFields?.length){let Se=[...G,Qe("viewedByUserIds","array-contains",c)],oe=[Mr(...Se),Xt("lastUpdated","desc"),Xt("createdAt","desc")];ae=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:oe})})}}else if(S.isOrgMode){t=h??"";let pe=[Mr(...G),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:pe})}),!i?.agentFields?.length){let Se=[...G,Qe("viewedByUserIds","array-contains",c)],oe=[Mr(...Se),Xt("lastUpdated","desc"),Xt("createdAt","desc")];ae=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:oe})})}}else{t="result";let pe=[];for(let he=0;he<a.length;he+=this.LISTENER_BATCH_SIZE)pe.push(a.slice(he,he+this.LISTENER_BATCH_SIZE));let Se=pe.map(he=>Pe(this,null,function*(){let _e=[...G,Qe("metadata.documentId","in",he),..._?[Qe("metadata.veltFolderId","==",_)]:[]],Re=[Mr(..._e),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:Re})})}));if(Z=(yield Promise.allSettled(Se)).reduce((he,_e)=>he+(_e.status==="fulfilled"&&_e.value||0),0),!i?.agentFields?.length){let he=pe.map(Re=>Pe(this,null,function*(){let Ye=[...G,Qe("metadata.documentId","in",Re),..._?[Qe("metadata.veltFolderId","==",_)]:[],Qe("viewedByUserIds","array-contains",c)],lt=[Mr(...Ye),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:lt})})}));ae=(yield Promise.allSettled(he)).reduce((Re,Ye)=>Re+(Ye.status==="fulfilled"&&Ye.value||0),0)}}return{data:{[t]:{total:Z,unread:Z-ae}}}}catch(t){return this.loggingService.catch("Error in CommentService getAggregateCounts: ",t),null}})}filterGhostComments$(e,t,a){try{return e?this.commentService.getGhostCommentAnnotationMap$().pipe(Oe(i=>{if(!i)return e;let c=this.buildGhostCommentAnnotationMap(i),m=this.groupGhostCommentsByModeId(c,t,a);return this.adjustCountsForGhostComments(e,m),e})):Ee(null)}catch(i){return this.loggingService.catch("Error in CommentService filterGhostComments: ",i),Ee(null)}}buildGhostCommentAnnotationMap(e){let t={};return Object.keys(e).forEach(a=>{let i=this.commentService.getAnnotationById(a);i&&(t[a]=i)}),t}groupGhostCommentsByModeId(e,t,a){try{let i={};return Object.values(e).forEach(c=>{let m=this.getModeIdForAnnotation(c,t,a);m&&(i[m]||(i[m]=[]),i[m].push(c))}),i}catch(i){return this.loggingService.catch("Error in CommentService groupGhostCommentsByModeId: ",i),{}}}getModeIdForAnnotation(e,t,a){try{return t.isOrgMode?e?.metadata?.clientOrganizationId||null:t.isFolderMode?e?.metadata?.folderId||null:t.isBatchMode?a.includes(e?.metadata?.documentId??"")?"result":null:e?.metadata?.clientDocumentId||null}catch(i){return this.loggingService.catch("Error in CommentService getModeIdForAnnotation: ",i),null}}adjustCountsForGhostComments(e,t){try{if(typeof e?.data!="object")return;let i=this.authService.getUser()?.userSnippylyId;Object.keys(e.data||{}).forEach(c=>{let m=t[c];if(!(!m||!e?.data?.[c]?.total)&&(e.data[c].total=Math.max(0,e.data[c].total-m.length),i)){let h=m.filter(_=>_?.viewedByUserIds&&!_?.viewedByUserIds?.includes(i));h.length>0&&(e.data[c].unread=Math.max(0,e.data[c].unread-h.length))}})}catch(a){this.loggingService.catch("Error in CommentService adjustCountsForGhostComments: ",a)}}};o.\u0275fac=function(t){return new(t||o)(be(ot),be(Dr),be(ut),be(Vv),be(to),be(N),be(ie),be(Ug))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var vt=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z,$,G,Z){this.analyticsService=e,this.authService=t,this.commentService=a,this.commentViewsService=i,this.contactService=c,this.customFilterService=m,this.docService=h,this.iamService=_,this.loggingService=I,this.metadataService=S,this.commonDbService=z,this.serviceBook=$,this.suggestionActions=G,this.targetRegistry=Z,this.actionSubjects=new Map,this.defaultSource="internal",this.isUserAdmin=!1,this.subscriptions=[],this.reactionService=null,this.loggingService.log("%c[WB] Creating CLASS: CommentActionsService","color: blue;");try{this.commentService.setCommentActionsService(this),this.iamService.isUserAdmin$().subscribe(ae=>{this.isUserAdmin=ae}),this.serviceBook.observe(Tg).subscribe(ae=>{this.reactionService=ae})}catch(ae){this.loggingService.catch("Error in CommentActionsService constructor: ",ae)}}addCommentAnnotation(c,m){return Pe(this,arguments,function*({annotation:e,options:t,visibility:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addCommentAnnotation","color: green;"),a){if(a.type==="restricted"){let I=this.authService.getUser();I?.userId&&(a=Mn(a,I.userId))}if(a.type==="organizationPrivate"&&!a.organizationId&&!a.organizationIds?.length){let I=this.authService.getUser()?.clientOrganizationId;I&&(a=f(g({},a),{organizationId:I}))}let h=this.authService.getUser()?.userId,_=An(a,h);_.length>0&&(e.context||(e.context={}),e.context._setAccessFields=_,e.visibilityConfig=Pn(a,h))}return new Promise(h=>{this.commentService.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,_=>Pe(this,null,function*(){let I=yield this.getAddCommentAnnotationEventFromCommentAddEventData(_);h(I)}),void 0,void 0,e,void 0,void 0,void 0,void 0,void 0,i)})}catch(h){return this.loggingService.catch("Error in CommentActionsService addCommentAnnotation: ",h),null}})}getAddCommentAnnotationEventFromCommentAddEventData(e){return Pe(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata();return{commentAnnotation:this.commentService.getCommentAnnotationForClient(e?.annotation),annotationId:e?.annotation?.annotationId,metadata:t,addContext:e?.addContext,elementRef:e?.elementRef}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationEvent(e){try{this.triggerAction(dt.ADD_COMMENT_ANNOTATION,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationEvent: ",t)}}getAddCommentAnnotationDraftEventFromCommentAddEventData(e){return Pe(this,null,function*(){try{return{metadata:yield this.metadataService.getGlobalMetadata(),addContext:e?.addContext}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationDraftEvent(e){try{this.triggerAction(dt.ADD_COMMENT_ANNOTATION_DRAFT,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationDraftEvent: ",t)}}triggerAddCommentDraftEventForAnnotation(e,t){return Pe(this,null,function*(){try{if(!e?.annotationId||!t)return;let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),comment:t,metadata:a};this.triggerAction(dt.ADD_COMMENT_DRAFT,i)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAddCommentDraftEventForAnnotation: ",a)}})}triggerAnnotationNotFoundError(e){try{this.loggingService.catch("Annotation not found:","The annotation with the given id was not found.")}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAnnotationNotFoundError: ",t)}}deleteCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteCommentAnnotation","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){this.commentService.deleteCommentPinAnnotation(h);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:h.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I};return this.triggerAction(dt.DELETE_COMMENT_ANNOTATION,S),S}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it.")}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteCommentAnnotation: ",m),null}})}updatePriority(c,m){return Pe(this,arguments,function*({annotationId:e,priority:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updatePriority","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.priority?JSON.parse(JSON.stringify(_.priority)):null;I&&t&&I?.id===t?.id?_.priority=void 0:_.priority=t,this.commentService.saveComment(_,{type:Ke.PRIORITY_CHANGED,newPriority:t,oldPriority:I});let S=yield this.metadataService.getGlobalMetadata(),z={newPriority:t,oldPriority:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(dt.UPDATE_PRIORITY,z),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PRIORITY_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldPriority:_.priority,newPriority:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource}),z}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updatePriority: ",h),null}})}updateStatus(c,m){return Pe(this,arguments,function*({annotationId:e,status:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateStatus","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.status?JSON.parse(JSON.stringify(_.status)):null;_.status=t,_.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(_,{type:Ke.STATUS_CHANGED,newStatus:t,oldStatus:I});let S=yield this.metadataService.getGlobalMetadata(),z={newStatus:t,oldStatus:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(dt.UPDATE_STATUS,z),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_STATUS_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldStatus:I,newStatus:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,commentAnnotationCreatedAt:_.createdAt}),z}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateStatus: ",h),null}})}updateAccess(c,m){return Pe(this,arguments,function*({annotationId:e,accessMode:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateAccess","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_)if(this.commentService.isPrivateCommentAllowed()){_=JSON.parse(JSON.stringify(_));let I=_.iam?.accessMode;_.iam.accessMode=t,this.commentService.saveComment(_,{type:Ke.ACCESS_MODE_CHANGED,newAccessMode:t,oldAccessMode:I});let S=yield this.metadataService.getGlobalMetadata(),z={newAccessMode:t,oldAccessMode:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};switch(this.triggerAction(dt.UPDATE_ACCESS,z),t){case lr.PRIVATE:this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:lr.PRIVATE,source:i??this.defaultSource});break;case lr.PUBLIC:this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:lr.PUBLIC,source:i??this.defaultSource});break;default:break}return z}else this.loggingService.catch("Access Denied","You must be an admin to update the access mode of the comment.");else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateAccess: ",h),null}})}resolveCommentAnnotation(a){return Pe(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: resolveCommentAnnotation","color: green;");let i=this.authService.getUser();if(!i)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let c=this.commentService.getAnnotationById(e,t);if(c){c=JSON.parse(JSON.stringify(c));let m=this.customFilterService.resolvedStatus,h=c.status?JSON.parse(JSON.stringify(c.status)):null;m&&(c.status=m,c.statusUpdatedByUserId=i?.userId,this.commentService.saveComment(c,{type:Ke.STATUS_CHANGED,newStatus:m,oldStatus:h}));let _=yield this.metadataService.getGlobalMetadata(),I={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(c),metadata:_};return this.triggerAction(dt.RESOLVE_COMMENT,I),I}else this.triggerAnnotationNotFoundError(e);return null}catch(i){return this.loggingService.catch("Error in CommentActionsService resolveCommentAnnotation: ",i),null}})}getLink(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getLink","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){let h=this.commentService.getCommentUrl(m)??null,_=yield this.metadataService.getGlobalMetadata();return{link:h,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:_}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService getLink: ",m),null}})}copyLink(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: copyLink","color: green;");let m=yield this.getLink({annotationId:e,options:t},a);if(m?.link){nb(m.link),this.commentService.setCopyLink(m.link),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_LINK_COPIED,{annotationId:e,commentType:this.commentService.getCommentType(m.commentAnnotation),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource,link:m.link});let h=yield this.metadataService.getGlobalMetadata(),_={link:m.link,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m.commentAnnotation),metadata:h};return this.triggerAction(dt.COPY_LINK,_),_}return null}catch(m){return this.loggingService.catch("Error in CommentActionsService copyLink: ",m),null}})}addComment(_,I){return Pe(this,arguments,function*({annotationId:e,comment:t,assignedTo:a,assigned:i,options:c,visibility:m},h){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addComment","color: green;");let S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(S){let z=this.commentService.getAnnotationById(e,c),$=z?.comments?.length?Ke.ADDED:Ke.NEWLY_ADDED;if(z){z.status.type==="terminal"&&(z.status=this.customFilterService.defaultStatus);let G=new qn;G=g(g({},G),t),G.lastUpdated=new Date,G.attachments||(G.attachments=[]),G.attachments=G.attachments.filter(oe=>oe?.attachmentId),G.createdAt=this.timestamp,G.from=S,a&&(z.assignedTo=a),this.commentService.saveComment(z,{type:$,updatedComment:G,assigned:i,visibility:m,_dispatchAddCommentEvent:!0});let Z=f(g({},z),{comments:[...z.comments||[],G]}),ae=yield this.buildAddCommentEvent({annotation:Z,newComment:G});if(!ae)return null;let pe=t?.commentId,Se=this.calculateCommentThreadIndex(t,z);return this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADDED,{annotationId:e,commentThreadId:pe,commentThreadIndex:Se,commentType:this.commentService.getCommentType(z),commentMode:this.commentService.getCommentMode(),source:h??this.defaultSource,commentAnnotationCreatedAt:z.createdAt,taggedClientUserIds:G.taggedUserContacts?.map(oe=>oe.contact?.userId).filter(oe=>!!oe),taggedSnippylyUserIds:G.taggedUserContacts?.filter(oe=>!!z?.metadata?.apiKey&&!!oe.contact?.userId).map(oe=>yg(z.metadata.apiKey,oe.contact.userId))}),ae}else this.triggerAnnotationNotFoundError(e)}return null}catch(S){return this.loggingService.catch("Error in CommentActionsService addComment: ",S),null}})}buildAddCommentEvent(a){return Pe(this,arguments,function*({annotation:e,newComment:t}){try{let i=yield this.metadataService.getGlobalMetadata();return{annotationId:e.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:i}}catch(i){return this.loggingService.catch("Error in CommentActionsService buildAddCommentEvent: ",i),null}})}triggerAddCommentEvent(a){return Pe(this,arguments,function*({annotation:e,newComment:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: triggerAddCommentEvent","color: green;");let i=yield this.buildAddCommentEvent({annotation:e,newComment:t});return i&&this.triggerAction(dt.ADD_COMMENT,i),i}catch(i){return this.loggingService.catch("Error in CommentActionsService triggerAddCommentEvent: ",i),null}})}approveCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: approveCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){m.approved=!0,this.commentService.saveComment(m,{type:Ke.APPROVED}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_APPROVED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource});let h=yield this.metadataService.getGlobalMetadata(),_={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:h};return this.triggerAction(dt.APPROVE_COMMENT_ANNOTATION,_),_}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService approveComment: ",m),null}})}acceptCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentAcceptStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ke.ACCEPTED,oldStatus:_,newStatus:X.CommentAcceptStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(dt.ACCEPT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptCommentAnnotation: ",m),null}})}rejectCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentRejectStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ke.REJECTED,oldStatus:_,newStatus:X.CommentRejectStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(dt.REJECT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_REJECTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService rejectCommentAnnotation: ",m),null}})}ensureSuggestionObject(e){try{if(!e||e?.suggestion||!(e?.type==="suggestion"||e?.commentType==="suggestion"))return;e.suggestion={status:"pending",targetId:"",targetType:"custom",oldValue:null,newValue:null,summary:null,driftDetected:!1,rejectReason:null,resolvedBy:null,resolvedAt:null}}catch(t){this.loggingService.catch("Error in CommentActionsService ensureSuggestionObject: ",t)}}acceptSuggestion(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptSuggestion","color: green;");let m=this.authService.getUser();if(!m)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(!h)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(h),!(h.type==="suggestion"||h.commentType==="suggestion")||!h.suggestion||h.suggestion.status!=="pending")return null;let _=h.suggestion.targetId;if(_){if(!this.targetRegistry.getNode(_)){h.suggestion.status="stale",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"stale",targetId:_}),this.commentService.updateComment(h),this.suggestionActions.projectAndTrigger(hg.SUGGESTION_STALE,h);let Z=yield this.metadataService.getGlobalMetadata(),ae={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:Z,actionUser:m};return this.triggerAction(dt.SUGGESTION_ACCEPTED,ae),ae}let $=this.targetRegistry.getGetter(_),G=!1;if($)try{let Z=$();G=!an(Z,h.suggestion.oldValue)}catch{G=!1}h.suggestion.driftDetected=G}h.suggestion.status="accepted",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,h.type="comment",h?.agent?.agentFields&&typeof h.agent.agentFields=="object"&&Array.isArray(h.agent.agentFields)&&(h.agent.agentFields=h.agent.agentFields.filter(z=>z!=="status:suggestion"),h.agent.agentFields.includes("status:accepted")||h.agent.agentFields.push("status:accepted")),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"accepted",targetId:_,driftDetected:h.suggestion?.driftDetected}),this.commentService.saveComment(h,{type:Ke.SUGGESTION_ACCEPTED}),this.suggestionActions.projectAndTrigger(hg.SUGGESTION_APPROVED,h),this.analyticsService.trackEvent(ne.Events.Comments.SUGGESTION_ACCEPTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I,actionUser:m};return this.triggerAction(dt.SUGGESTION_ACCEPTED,S),S}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptSuggestion: ",m),null}})}rejectSuggestion(c,m){return Pe(this,arguments,function*({annotationId:e,reason:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectSuggestion","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(!_)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(_),!(_.type==="suggestion"||_.commentType==="suggestion")||!_.suggestion||_.suggestion.status!=="pending")return null;_.suggestion.status="rejected",_.suggestion.rejectReason=t??null,_.suggestion.resolvedBy=h,_.suggestion.resolvedAt=this.timestamp,_.statusUpdatedByUserId=h?.userId,_.type="comment",_?.agent?.agentFields&&typeof _.agent.agentFields=="object"&&Array.isArray(_.agent.agentFields)&&(_.agent.agentFields=_.agent.agentFields.filter(z=>z!=="status:suggestion"),_.agent.agentFields.includes("status:rejected")||_.agent.agentFields.push("status:rejected")),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"rejected",targetId:_.suggestion.targetId}),this.commentService.saveComment(_,{type:Ke.SUGGESTION_REJECTED}),this.suggestionActions.projectAndTrigger(hg.SUGGESTION_REJECTED,_),this.analyticsService.trackEvent(ne.Events.Comments.SUGGESTION_REJECTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I,actionUser:h,rejectReason:t??null};return this.triggerAction(dt.SUGGESTION_REJECTED,S),S}catch(h){return this.loggingService.catch("Error in CommentActionsService rejectSuggestion: ",h),null}})}toggleNotificationSubscription(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleNotificationSubscription","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=mr(h.userId);if(_){m.subscribedUsers||(m.subscribedUsers={}),m.unsubscribedUsers||(m.unsubscribedUsers={});let I,S=!1;if(m?.unsubscribedUsers?.[_])S=!1;else if(m?.subscribedUsers?.[_])S=!0;else{let G=this.contactService.getCurrentOrganizationUserIAM();if(G){let Z=G.groups||{};Object.keys(Z).forEach(ae=>{m?.subscribedGroups?.[ae]&&(S=!0)})}}if(a==="subscribe"||!a&&!S)delete m.unsubscribedUsers[_],m.subscribedUsers[_]={user:h,type:"manual"},I=Ke.SUBSCRIBED;else if(a==="unsubscribe"||!a&&S)delete m.subscribedUsers[_],m.unsubscribedUsers[_]={user:h,type:"manual"},I=Ke.UNSUBSCRIBED;else return null;this.commentService.saveComment(m,{type:I});let z=yield this.metadataService.getGlobalMetadata(),$={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:z};return I===Ke.SUBSCRIBED?this.triggerAction(dt.SUBSCRIBE_COMMENT_ANNOTATION,$):this.triggerAction(dt.UNSUBSCRIBE_COMMENT_ANNOTATION,$),$}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService toggleNotificationSubscription: ",m),null}})}assignUser(c,m){return Pe(this,arguments,function*({annotationId:e,assignedTo:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: assignUser","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_.assignedTo=t,this.commentService.saveComment(_,{type:Ke.ASSIGNED,assignedTo:t});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,assignedTo:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I};return this.triggerAction(dt.ASSIGN_USER,S),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ASSIGNED,{annotationId:e,commentType:this.commentService.getCommentType(_),commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,assignedToUserId:t?.userId}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService assignUser: ",h),null}})}getComment(a){return Pe(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getComment","color: green;");let i=this.commentService.getAnnotationById(e,t);return i?i.comments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(i){return this.loggingService.catch("Error in CommentActionsService getComment: ",i),[]}})}updateOrDeleteComment(e,t,a,i,c){return Pe(this,null,function*(){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateOrDeleteComment","color: green;"),t?.commentText?.trim()||t?.attachments?.length||t?.recorders?.length){let m=this.authService.getUser();if(this.isUserAdmin||m?.userId===t?.from?.userId){t.lastUpdated=new Date,t.status=Ke.UPDATED,t.isEdited||(t.isEdited=!0,t.editedAt=new Date),this.commentService.saveComment(e,{type:Ke.UPDATED,updatedComment:t});let h=yield this.metadataService.getGlobalMetadata(),_={annotationId:e?.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:h};return this.triggerAction(dt.UPDATE_COMMENT,_),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_EDITED,{annotationId:e?.annotationId,commentThreadId:t?.commentId,commentType:this.commentService.getCommentType(e),commentMode:this.commentService.getCommentMode(),source:c??this.defaultSource}),_}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}else yield this.deleteComment({annotationId:e?.annotationId,commentId:t.commentId,skipDeleteThreadConfirmation:a,options:i});return null}catch(m){return this.loggingService.catch("Error in CommentActionsService updateOrDeleteComment: ",m),null}})}updateComment(h,_){return Pe(this,arguments,function*({annotationId:e,comment:t,skipDeleteThreadConfirmation:a,merge:i,options:c},m){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateComment","color: green;");let I=this.commentService.getAnnotationById(e,c),S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(I&&S){let z=t,$=I.comments?.find(G=>G.commentId===t.commentId);if($){if(this.isUserAdmin||S?.userId===$?.from?.userId)return I?.status.type==="terminal"&&(I.status=this.customFilterService.defaultStatus),i&&(z=g(g({},$),t)),z.from=$.from,z.createdAt=$.createdAt,z.lastUpdated=new Date,yield this.updateOrDeleteComment(I,z,a,c,m);this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(I){return this.loggingService.catch("Error in CommentActionsService updateComment: ",I),null}})}deleteComment(m,h){return Pe(this,arguments,function*({annotationId:e,commentId:t,skipDeleteThreadConfirmation:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteComment","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(!_)return this.triggerAnnotationNotFoundError(e),null;let S=_.comments?.find(ae=>ae?.commentId===t);if(!S)return null;if(!(this.isUserAdmin||I?.userId===S?.from?.userId))return this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it."),null;let z=this.commentService.willDeleteWholeAnnotation(_,t),$=this.commentService.getCommentAnnotationForClient(_);if(!a&&!(yield this.commentService.confirmDeleteCommentIfRequired(_,S)))return null;this.commentService.saveComment(_,{type:Ke.DELETED,updatedComment:S,skipDeleteThreadConfirmation:!0});let G=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,commentAnnotation:$,comment:S,metadata:G};if(z){let ae={annotationId:e,commentAnnotation:$,metadata:G};this.triggerAction(dt.DELETE_COMMENT_ANNOTATION,ae)}else this.triggerAction(dt.DELETE_COMMENT,Z);return Z}catch(_){return this.loggingService.catch("Error in CommentActionsService deleteComment: ",_),null}})}addAttachment(c,m){return Pe(this,arguments,function*({annotationId:e,files:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addAttachment","color: green;");let h=[],_=this.commentService.getAnnotationById(e,a);if(_||i==="internal"){let z=[];t.forEach($=>{let{valid:G,file:Z,maxAllowedSize:ae,error:pe}=this.validateFile($);G&&Z?z.push(this.uploadFile(Z,_||{}).then(Se=>({valid:G,file:Z,maxAllowedSize:ae,error:pe,attachment:Se||void 0}))):z.push(Promise.resolve({valid:G,file:Z,maxAllowedSize:ae,error:pe,attachment:void 0}))}),h=yield Promise.all(z)}else this.triggerAnnotationNotFoundError(e);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:_?this.commentService.getCommentAnnotationForClient(_):void 0,attachments:h,metadata:I};return this.triggerAction(dt.ADD_ATTACHMENT,S),h}catch(h){return this.loggingService.catch("Error in CommentActionsService addAttachment: ",h),[]}})}validateFile(e){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: validateFile","color: green;");let t=100*1024*1024;(e?.type?.includes("image")||e?.type?.includes("pdf"))&&(t=15*1024*1024);let a=e.size<=t;return{valid:a,file:e,maxAllowedSize:t,maxAllowedSizeInMB:t/1024/1024,error:a?void 0:`File size should be less than ${t/1024/1024} MB`}}catch(t){return this.loggingService.catch("Error in CommentActionsService validateFile: ",t),{valid:!1,maxAllowedSize:0,maxAllowedSizeInMB:0,error:"Error in validating file"}}}deleteAttachment(c){return Pe(this,arguments,function*({annotationId:e,commentId:t,attachmentId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteAttachment","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(I=>I?.commentId===t),_=m.metadata;if(h){let I=this.authService.getUser();if(this.isUserAdmin||I?.userId===h?.from?.userId){let S=h.attachments?.find(z=>z?.attachmentId===a);if(S){h.attachments=h.attachments?.filter(Z=>Z?.attachmentId!==a);let z={attachmentId:S.attachmentId,organizationId:_?.clientOrganizationId??_?.organizationId??null,documentId:_?.clientDocumentId??_?.documentId??null,folderId:_?.folderId??null,commentAnnotationId:m.annotationId,apiKey:_?.apiKey??null};yield this.commentService.deleteAttachment({attachment:S,metadata:z});let $=yield this.metadataService.getGlobalMetadata(),G={attachment:S,annotationId:e,commentId:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:$};return this.triggerAction(dt.DELETE_ATTACHMENT,G),this.updateComment({annotationId:e,comment:h,options:i}),G}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the attachment.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteAttachment: ",m),null}})}getAttachment(i){return Pe(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getAttachment","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.attachments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getAttachment: ",c),[]}})}uploadFile(e,t){return Pe(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: uploadFile","color: green;"),this.commentService.uploadFile(e,t)}catch(a){return this.loggingService.catch("Error in CommentActionsService uploadFile: ",a),null}})}getRecording(i){return Pe(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getRecording","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.recorders||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getRecording: ",c),[]}})}deleteRecording(c){return Pe(this,arguments,function*({annotationId:e,commentId:t,recorderId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteRecording","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(_=>_?.commentId===t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){let I=h.recorders?.find(S=>S?.id===a);if(I){h.recorders=h.recorders?.filter($=>$?.id!==a);let S=yield this.metadataService.getGlobalMetadata(),z={annotationId:e,commentId:t,recording:I,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:S};return this.triggerAction(dt.DELETE_RECORDING,z),this.updateComment({annotationId:e,comment:h,skipDeleteThreadConfirmation:!0,options:i}),z}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the recording.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteRecording: ",m),null}})}fetchCommentAnnotations(e){return Pe(this,null,function*(){try{let t=yield this.commentService.fetchCommentAnnotations(e),a;if(t?.hasMore){let c=t?.data[t?.data?.length-1];a=yield Xh(c?.lastUpdated?.toString()??"","veltencrypttoken","veltencrypttoken")}let i=t?.data?.reduce((c,m)=>(c[m.metadata.clientDocumentId??m.metadata.documentId]=c[m.metadata.clientDocumentId??m.metadata.documentId]||[],c[m.metadata.clientDocumentId??m.metadata.documentId].push(this.commentService.getCommentAnnotationForClient(m)),c),{});return g({data:i},t?.hasMore?{nextPageToken:a}:{})}catch(t){return this.loggingService.catch("Error in CommentActionsService fetchCommentAnnotations: ",t),{data:null}}})}toggleReaction(m,h){return Pe(this,arguments,function*({annotationId:e,commentId:t,reaction:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleReaction","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(_&&I){let S=_.comments?.find(z=>z?.commentId===t);if(S){let z=yield this.reactionService?.addOrUpdateReaction(a.reactionId,S?.reactionAnnotationIds||[],void 0,void 0,_?.annotationId,a.customReaction,c),$=Ke.REACTION_ADDED;if(z){z?.reactions?.find(ae=>ae.from?.userId===I?.userId)||($=Ke.REACTION_DELETED),S.reactionAnnotationIds||(S.reactionAnnotationIds=[]),S.reactionAnnotationIds.includes(z.annotationId)||S.reactionAnnotationIds.push(z.annotationId),z?.reactions?.length||(S.reactionAnnotationIds=S.reactionAnnotationIds.filter(ae=>ae!==z.annotationId)),this.commentService.saveComment(_,{type:$,updatedComment:S});let G=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,reaction:z,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:G};return c==="add"?this.triggerAction(dt.ADD_REACTION,Z):c==="delete"?this.triggerAction(dt.DELETE_REACTION,Z):this.triggerAction(dt.TOGGLE_REACTION,Z),$===Ke.REACTION_ADDED?this.analyticsService.trackEvent(ne.Events.Comments.REACTION_ADDED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}):$===Ke.REACTION_DELETED&&this.analyticsService.trackEvent(ne.Events.Comments.REACTION_DELETED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}),Z}}}else this.triggerAnnotationNotFoundError(e);return null}catch(_){return this.loggingService.catch("Error in CommentActionsService toggleReaction: ",_),null}})}onComposerClick(t){return Pe(this,arguments,function*({commentAnnotation:e}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onComposerClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={commentAnnotation:e?.annotationId?this.commentService.getCommentAnnotationForClient(e):void 0,metadata:a};this.triggerAction(dt.COMPOSER_CLICKED,i)}catch(a){this.loggingService.catch("Error in CommentActionsService onComposerClick: ",a)}})}onComposerTextChange(e){return Pe(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata(),a={text:e.text,annotation:e.annotation,targetComposerElementId:e.targetComposerElementId,metadata:t};this.commentService.setComposerData(e.targetComposerElementId,a),this.triggerAction(dt.COMPOSER_TEXT_CHANGE,a)}catch(t){this.loggingService.catch("Error in CommentActionsService onComposerTextChange: ",t)}})}autocompleteSearch(e){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: autocompleteSearch","color: green;");let t=yield this.metadataService.getGlobalMetadata();e.metadata=t,this.triggerAction(dt.AUTOCOMPLETE_SEARCH,e)}catch(t){this.loggingService.catch("Error in CommentActionsService autocompleteSearch: ",t)}})}onCommentPinClick(e){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentPinClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(dt.COMMENT_PIN_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentPinClick: ",t),null}})}onCommentBubbleClick(e){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentBubbleClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(dt.COMMENT_BUBBLE_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentBubbleClick: ",t),null}})}onCommentToolClick(e,t){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentToolClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={context:e,targetElementId:t,metadata:a},c={context:e,targetElementId:t,metadata:a};return this.triggerAction(dt.COMMENT_TOOL_CLICK,i),this.triggerAction(dt.COMMENT_TOOL_CLICKED,c),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentToolClick: ",a),null}})}onSidebarButtonClick(){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onSidebarButtonClick","color: green;");let e=yield this.metadataService.getGlobalMetadata(),t={metadata:e},a={metadata:e};return this.triggerAction(dt.SIDEBAR_BUTTON_CLICK,t),this.triggerAction(dt.SIDEBAR_BUTTON_CLICKED,a),t}catch(e){return this.loggingService.catch("Error in CommentActionsService onSidebarButtonClick: ",e),null}})}onAttachmentDownloadClick(e,t){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onAttachmentDownloadClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),attachment:t,metadata:a};return this.triggerAction(dt.ATTACHMENT_DOWNLOAD_CLICKED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onAttachmentDownloadClick: ",a),null}})}onCommentSaveTriggered(e,t){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentSaveTriggered","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(t),metadata:a};return this.triggerAction(dt.COMMENT_SAVE_TRIGGERED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentSaveTriggered: ",a),null}})}onVisibilityOptionClick(e,t,a){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onVisibilityOptionClick","color: green;");let i=yield this.metadataService.getGlobalMetadata(),c={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),visibility:t,users:a?.map(m=>sb(m)).filter(Boolean),metadata:i};return this.triggerAction(dt.VISIBILITY_OPTION_CLICKED,c),c}catch(i){return this.loggingService.catch("Error in CommentActionsService onVisibilityOptionClick: ",i),null}})}convert(e){try{if(e?.options){let{documentId:t,organizationId:a}=this.docService.getServerId(e?.options);e.options=f(g({},e?.options),{documentId:t,organizationId:a})}return this}catch(t){return this.loggingService.catch("Error in CommentActionsService convert: ",t),this}}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new Gt),this.actionSubjects.get(e)?.next(t)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAction: ",a)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new Gt),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in CommentActionsService onAction: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getCommentAnnotations(e){try{if(e){if(e?.allDocuments&&!e?.folderId)return this.loggingService.catch("folderId is required when allDocuments is true."),Ee({data:null});if(!e?.allDocuments&&!e?.documentIds?.length)return this.loggingService.catch("documentIds is required."),Ee({data:null})}return this.commentService.getAllCommentAnnotations({excludeDomChanges:!0,skipPositionCalculation:!0,query:e,addFilterCommentsOnDomCheck:!0}).pipe(Oe(t=>t?t.reduce((a,i)=>{let c=i.metadata?.clientDocumentId;return!c||e?.documentIds&&!e?.documentIds?.includes(c)||(a[c]||(a[c]=[]),a[c].push(i)),a},{}):null),Oe(t=>({data:t})))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}getCommentAnnotationsCount$(e){try{return this.commentViewsService.getAnnotationsCount(e).pipe(Oe(t=>t||{data:null}))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}updateVisibility(e){this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateVisibility","color: green;");try{let t=e.annotationId;if(!t)throw new Error("annotationId is required in visibility config");if(e.type==="restricted"){let h=this.authService.getUser();if(!h?.userId)throw new Error("Current user not found. Cannot set restricted visibility without userIds.");e=Mn(e,h.userId)}if(e.type==="organizationPrivate"&&!e.organizationId&&!e.organizationIds?.length){let h=this.authService.getUser()?.clientOrganizationId;if(!h)throw new Error("No organizationId found. Cannot set organizationPrivate visibility without organizationId.");e=f(g({},e),{organizationId:h})}this.analyticsService.trackEvent(ne.Events.Comments.UPDATE_VISIBILITY_TRIGGERED,{payload:{annotationId:t,visibility:e}});let a=this.commentService.getCommentAnnotationByIdSync(t)?.from?.userId,i=a??this.authService.getUser()?.userId;a||this.loggingService.warn(`updateVisibility: annotation ${t} not in local cache \u2014 falling back to current user for the author access token`);let c=An(e,i),m=Pn(e,i);return this.commentService.updateCommentAnnotationContext(t,{_setAccessFields:c,_setVisibilityConfig:m},{merge:!0})}catch(t){return this.loggingService.catch("Error in updateVisibility: ",t),Promise.resolve()}}calculateCommentThreadIndex(e,t){try{let a=e?.commentId,i;return a&&(i=t?.comments?.findIndex(c=>c.commentId===a)),i===-1&&(i=t?.comments?.length),i}catch(a){this.loggingService.catch("Error in calculateCommentThreadIndex: ",a);return}}};o.\u0275fac=function(t){return new(t||o)(be(vr),be(ot),be(ie),be(Gg),be($t),be(Dt),be(ut),be(Dr),be(N),be(Eg),be(to),be(fr),be(Bg),be(Lg))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var jg=(()=>{let o=class o{constructor(e){this.loggingService=e,this.commentTextData$=new De({});try{this.loggingService.log("%c[WB] Creating CLASS: CommentTextService","color: blue;")}catch(t){this.loggingService.catch("Error in CommentTextService constructor: ",t)}}setCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: setCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();i[t]||(i[t]={}),i[t][a]=e,this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService setCommentTextData: ",t)}}removeCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: removeCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();delete i[t][a],this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService removeCommentTextData: ",t)}}updateLastPositionInDataByAnnotationId(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: updateLastPositionInDataByAnnotationId","color: green;");let t=this.commentTextData$.getValue();Object.values(t[e]).forEach(a=>{a.last=this.checkIfLast(a)}),this.commentTextData$.next(t)}catch(t){this.loggingService.catch("Error in CommentTextService updateLastPositionInDataByAnnotationId: ",t)}}checkIfLast(e){try{if(this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: checkIfLast","color: green;"),e?.elementRef?.nativeElement){let t=e.elementRef.nativeElement.getRootNode(),a=t instanceof Document||t instanceof ShadowRoot?t:document,i=[];if(e.annotationId?i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)):e.multiThreadAnnotationId&&(i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.MULTI_THREAD_ANNOTATION_ID}="${e.multiThreadAnnotationId}"]`))),i.length&&i[i.length-1]===e.elementRef.nativeElement)return!0}return!1}catch(t){return this.loggingService.catch("Error in CommentTextService checkIfLast: ",t),!1}}getCommentTextDataByAnnotationIdAndComponentId(e,t){try{return this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: getCommentTextDataByAnnotationIdAndComponentId","color: green;"),this.commentTextData$.pipe(Oe(a=>a&&e&&t&&a[e]?a[e][t]:null))}catch(a){return this.loggingService.catch("Error in CommentTextService getCommentTextDataByAnnotationIdAndComponentId: ",a),Ee(null)}}};o.\u0275fac=function(t){return new(t||o)(be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function Hg(r,o){return r?{commentPinSelected:!0,textClicked:!!o}:{commentPinSelected:!1,textClicked:!1}}function zg(r,o,n){return r!=null&&r===o&&!!n}function Kb(r){return r instanceof Document||r instanceof ShadowRoot?r:document}function Zb(r,o){let n=e=>{if(!e)return null;let t=null;return(e instanceof Document||e instanceof DocumentFragment)&&(t=e.getElementById(`comment-pin-container-${o}`)),t||e.querySelector(`[data-velt-id='${o}']`)||null};return n(r)||(r!==document?n(document):null)}var Ay=["overlay"],Py=()=>["snippyly-overlay-panel","velt-overlay-panel"];function Fy(r,o){if(r&1&&E(0,"span",8),r&2){let n,e=l().ngIf;ue("index-3-digit",(e.commentPinAnnotation==null||e.commentPinAnnotation.annotationNumber==null||(n=e.commentPinAnnotation.annotationNumber.toString())==null?null:n.length)===3),k("data-comment-annotation-number","#"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationNumber))}}function Ny(r,o){if(r&1){let n=J();u(0),b(1,"velt-multi-thread-comment-dialog-internal",10),H("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))})("pointerUp",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))}),x(),p()}if(r&2){let n=l(2).ngIf;d(),v("multiThreadAnnotationId",n.commentPinAnnotation.annotationId)("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)}}function Ry(r,o){if(r&1){let n=J();b(0,"velt-comment-dialog-internal",11),H("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()}if(r&2){let n=l(2).ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("inlineCommentMode",n.inlineCommentMode)("isInsidePdfViewer",n.isInsidePdfViewer)}}function Uy(r,o){if(r&1&&s(0,Ny,2,4,"ng-container",9)(1,Ry,1,5,"ng-template",null,2,Ge),r&2){let n=we(2),e=l().ngIf;v("ngIf",(e==null||e.commentPinAnnotation==null?null:e.commentPinAnnotation.type)==="multiThread")("ngIfElse",n)}}function Ly(r,o){if(r&1){let n=J();b(0,"snippyly-comment-bottom-sheet",12),H("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))}),x()}if(r&2){let n=l().ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("isInsidePdfViewer",n.isInsidePdfViewer)}}function By(r,o){if(r&1){let n=J();u(0),b(1,"snippyly-comment-text",4,0),H("pointerover",function(t){return B(n),l().onPointerOver(t),V(t.stopPropagation())})("pointerout",function(){B(n);let t=l();return V(t.onPointerOut())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("pointerup",function(t){return B(n),l().togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("click",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())}),x(),s(3,Fy,1,3,"span",5)(4,Uy,3,2,"ng-template",6,1,Ge)(6,Ly,1,3,"snippyly-comment-bottom-sheet",7),p()}if(r&2){let n=o.ngIf,e=we(2),t=l();d(),ue("inline-comment-mode",n.inlineCommentMode&&!n.isInsidePdfViewer)("agent-comment",(n.commentPinAnnotation==null?null:n.commentPinAnnotation.sourceType)==="agent")("selected",n.commentPinHover||n.commentPinSelected),d(2),v("ngIf",n.last&&n.showCommentIndex&&(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationNumber)),d(),v("cdkConnectedOverlayOrigin",e)("cdkConnectedOverlayOpen",(!n.mobileMode||!n.isPhone)&&!n.inboxMode&&!n.streamMode&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&n.floatingCommentsEnabled&&(n.textClicked&&n.commentPinSelected||n.commentPinHover&&!n.commentPinSelected))("cdkConnectedOverlayOffsetY",n.overlayOriginY==="top"?-8:2)("cdkConnectedOverlayPanelClass",ct(17,Py))("cdkConnectedOverlayBackdropClass","snippyly-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",t.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0),d(2),v("ngIf",(n==null?null:n.user)&&n.mobileMode&&n.isPhone&&!n.sidebarVisible&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&!n.inboxMode&&!n.streamMode&&n.floatingCommentsEnabled&&n.textClicked&&n.commentPinSelected)}}var Wg=(()=>{let o=class o{onEnter(e){this.onKeyupEnter&&this.onKeyupEnter()}constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.breakpointObserver=a,this.domService=i,this.commentService=c,this.loggingService=m,this.serviceBook=h,this.elementRef=_,this.subscriptions=[],this.selectedAnnotationsMap={},this.customScrollableParentEventsListenersSubscriptions=[],this.isDialogOnHoverEnabled=!1,this.componentConfigSignal=Fe({inlineCommentMode:!1,isInsidePdfViewer:!1,commentPinHover:!1,commentPinSelected:!1,first:!1,last:!1,showCommentIndex:!1,commentPinAnnotation:null,isPhone:!1,mobileMode:!1,streamMode:!1,inboxMode:!1,textClicked:!1,floatingCommentsEnabled:!0,sidebarVisible:!1,user:null,overlayOriginX:"start",overlayOriginY:"top"}),this.positions=X.OVERLAY_POSITIONS.map(I=>new nn({originX:I.originX,originY:I.originY},{overlayX:I.overlayX,overlayY:I.overlayY})),this.veltElement=!0,this.componentId="velt-comment-text-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{sidebarVisible:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getSidebarVisibility$ subscription: ",I)})),this.subscriptions.push(this.commentService.showFloatingComments$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{floatingCommentsEnabled:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent showFloatingComments$ subscription: ",I)})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{showCommentIndex:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getShowCommentIndex subscription: ",I)})),this.subscriptions.push(this.commentService.getEnableDialogOnHover$().subscribe(I=>{this.isDialogOnHoverEnabled=I},I=>{this.catchError("Error in CommentPinComponent getEnableDialogOnHover subscription: ",I)})),this.subscriptions.push(this.breakpointObserver.observe(Zn.XSmall).subscribe(I=>{let S=!1;I.matches?S=!0:S=!1,this.componentConfigSignal.update(z=>(z=f(g({},z),{isPhone:S}),z))},I=>{this.catchError("Error in CommentTextPortalComponent breakpointObserver subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent setupA11yAttributes:",e)}}ngAfterViewInit(){try{let e=this.element.childNodes[0];this.element.childNodes[1].childNodes[0].appendChild(e),this.componentConfigSignal.update(a=>{let i=Lv(this.element,X.ATTRIBUTES.VELT_PDF_VIEWER);return a=f(g({},a),{isInsidePdfViewer:i}),a}),this.subscriptions.push(this.overlay?.positionChange?.subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{overlayOriginX:a.connectionPair.originX,overlayOriginY:a.connectionPair.originY}),i))},a=>{this.catchError("Error in CommentTextPortalComponent positionChange subscription: ",a)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(a=>{this.selectedAnnotationsMap=a,this.checkPinSelection()},a=>{this.catchError("Error in CommentTextPortalComponent getSelectedAnnotationsMap$ subscription: ",a)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{streamMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getStreamMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inboxMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInboxMode subscription: ",a)})),this.subscriptions.push(this.commentService.getMobileMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{mobileMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getMobileMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInlineCommentMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inlineCommentMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInlineCommentMode$ subscription: ",a)})),this.subscriptions.push(this.serviceBook.observe(ln).pipe(Me(a=>a?.onInitRecording()??Wn)).subscribe(a=>{this.recorderInitConfig=a},a=>{this.catchError("Error in CommentTextPortalComponent onInitRecording subscription: ",a)}))}catch(e){this.catchError("Error in CommentTextPortalComponent AfterViewInit: ",e)}}setFirst(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{first:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setFirst: ",t)}}setLast(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{last:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setLast: ",t)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setCommentPinAnnotation: ",t)}}setElement(e){try{this.element=e,this.element?this.customScrollableParents=Sg(this.element):this.customScrollableParents=[],this.addCustomScrollableParentsEventListeners()}catch(t){this.catchError("Error in CommentTextPortalComponent setElement: ",t)}}checkPinSelection(){try{let e=!!this.selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation?.annotationId];this.componentConfigSignal.update(t=>{let a=Hg(e,t.last);return g(g({},t),a)}),zg(sessionStorage.getItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID),this.componentConfigSignal().commentPinAnnotation.annotationId,this.componentConfigSignal().last)&&(this.componentConfigSignal.update(t=>(t=f(g({},t),{textClicked:!0}),t)),sessionStorage.removeItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID))}catch(e){this.catchError("Error in CommentTextPortalComponent checkPinSelection: ",e)}}onPointerOver(e){try{if(this.componentConfigSignal().commentPinHover)return;e.buttons?this.componentConfigSignal().commentPinHover&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!1}),t)):!this.componentConfigSignal().commentPinHover&&this.isDialogOnHoverEnabled&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!0}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent onPointerOver: ",t)}}onPointerOut(){this.componentConfigSignal.update(e=>(e=f(g({},e),{commentPinHover:!1}),e))}togglePinSelection(e){try{if(this.recorderInitConfig?.isCommentRecording||this.componentConfigSignal().textClicked&&!e)return;let t=e||this.componentConfigSignal().commentPinAnnotation;if(this.selectedAnnotationsMap[t.annotationId])e||(document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)?this.domService.resetSelectedAnnotationsMap(!0,"comments"):(this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)));else{let a=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(a||(a=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),a){let i=a.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(i){let c=document.getElementById(`comment-pin-container-${i}`)||document.querySelector(`[data-velt-id='${i}']`);c&&(c.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)}}catch(t){this.catchError("Error in CommentTextPortalComponent togglePinSelection: ",t)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentTextPortalComponent saveComment: ",t)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().commentPinAnnotation?.annotationId),this.overlay&&this.overlay?.overlayRef?.updatePosition()}catch(e){this.catchError("Error in CommentTextPortalComponent updateOverlayPosition: ",e)}}addCustomScrollableParentsEventListeners(){try{this.removeCustomScrollableParentsEventListeners(),this.customScrollableParents?.length&&this.customScrollableParents?.forEach(e=>{this.customScrollableParentEventsListenersSubscriptions.push(Sn(e,"scroll").subscribe(t=>{this.updateOverlayPosition()},t=>{this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners scroll subscription: ",t)}))})}catch(e){this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners: ",e)}}removeCustomScrollableParentsEventListeners(){try{this.customScrollableParentEventsListenersSubscriptions.map(e=>{e.unsubscribe()}),this.customScrollableParentEventsListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent removeCustomScrollableParentsEventListeners: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeCustomScrollableParentsEventListeners(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(j(vr),j(ot),j(Kn),j(Ne),j(ie),j(N),j(fr),j(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-text-portal"]],viewQuery:function(t,a){if(t&1&&ft(Ay,5),t&2){let i;Ct(i=kt())&&(a.overlay=i.first)}},hostVars:1,hostBindings:function(t,a){t&1&&H("keyup.enter",function(c){return a.onEnter(c)},Qs),t&2&&k("data-velt-element",a.veltElement)},standalone:!1,decls:1,vars:1,consts:[["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],["commentDialogRef",""],[4,"ngIf"],["cdkOverlayOrigin","","data-velt-comment-disabled","true",1,"comment-text-highlight",3,"pointerover","pointerout","pointerdown","pointerup","touchend","click"],["class","comment-annotation-number",3,"index-3-digit",4,"ngIf"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayOffsetY","cdkConnectedOverlayPanelClass","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayDisableClose"],[3,"annotation","user","isInsidePdfViewer","saveComment",4,"ngIf"],[1,"comment-annotation-number"],[4,"ngIf","ngIfElse"],[3,"saveComment","pointerUp","multiThreadAnnotationId","annotation","user","commentPinSelected"],[3,"saveComment","annotation","user","commentPinSelected","inlineCommentMode","isInsidePdfViewer"],[3,"saveComment","annotation","user","isInsidePdfViewer"]],template:function(t,a){t&1&&s(0,By,7,18,"ng-container",3),t&2&&v("ngIf",a.componentConfigSignal())},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}*[_ngcontent-%COMP%]{box-sizing:border-box;margin:0;padding:0;height:inherit;width:inherit;text-align:inherit;line-height:inherit;font-size:inherit;text-transform:inherit;float:inherit;-webkit-text-fill-color:initial}*[_ngcontent-%COMP%]:empty{display:revert}[_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);font-family:inherit}.comment-text-highlight[_ngcontent-%COMP%]{cursor:pointer} snippyly-text-highlight.snippyly-text-highlight{color:var(--velt-black)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight{color:var(--velt-warning-hover);background-color:var(--velt-warning-transparent);border-bottom:1px solid var(--velt-warning-hover)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.selected{color:var(--velt-black);background-color:var(--velt-warning)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent);border-bottom-color:var(--velt-agent-accent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment.selected{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode{background-color:inherit} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode.selected{background-color:inherit}.comment-annotation-number[_ngcontent-%COMP%]{border-radius:50%;border:1px solid var(--velt-gray);width:20px;height:20px;font-size:calc((.7rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;background:var(--velt-white);color:var(--velt-black);position:relative}.comment-annotation-number.index-3-digit[_ngcontent-%COMP%]{width:32px;height:32px}.comment-annotation-number[_ngcontent-%COMP%]:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}"],changeDetection:0});let r=o;return r})();var jv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h){this.docService=e,this.domService=t,this.commentService=a,this.componentFactoryResolver=i,this.injector=c,this.appRef=m,this.loggingService=h,this.commentsTextById={},this.commonAncestorElementObservers=new Map,this.commonAncestorElementObserverCounts=new Map,this.inlineCommentMode=!1,this.restrictTextSearchToAnchor=!1;try{this.commentService.getInlineCommentMode$().subscribe(_=>{this.inlineCommentMode=_}),this.commentService.getRestrictTextSearchToAnchor$().subscribe(_=>{this.restrictTextSearchToAnchor=_})}catch(_){this.loggingService.catch("Error in CommentPinPortalService constructor: ",_)}}updateTextCommentAnnotations(e){try{this.checkToRemoveTextCommentAnnotations(e),e.forEach(t=>{this.updateTextCommentAnnotation(t)})}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateTextCommentAnnotations: ",t)}}updateTextCommentAnnotation(e){let t=this.commentsTextById[e.annotationId];if(t)if(an(t?.annotation?.targetTextRange,e?.targetTextRange)){let a=!1;t?.texts?.length?t.texts.forEach(i=>{document.body.contains(i?.textNode)||(a=!0)}):a=!0,a?(this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e)):(t.texts.forEach(i=>{i.portalRef&&i.portalRef.instance.setCommentPinAnnotation(e)}),t.annotation=e)}else this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e);else this.getCommonAncestorContainer(e)}getCommonAncestorContainer(e){try{let t=this.domService.getElementFromTargetTextRange(e?.targetTextRange);if(t&&this.domService.isElementVisible(t)){let a=t?.nodeType===Node.ELEMENT_NODE?t:t?.parentElement;this.commentsTextById[e.annotationId]={texts:[],annotation:e,commonAncestorContainer:t,commonAncestorElement:a,commonAncestorText:a?.textContent},this.setTextCommentPortal(e),this.observeCommonAncestorElementChanges(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService getCommonAncestorContainer: ",t)}}setTextCommentPortal(e){try{let t=this.commentsTextById[e.annotationId];if(t){let a=this.domService.getElementFromTargetTextRange(e?.targetTextRange),i=document.body;if(e?.locationId&&this.docService.getLocation()?.locationId!==e?.locationId){let h=this.docService.getElementMapWithLocation();h[e?.locationId]&&(a=h[e?.locationId]?.element,i=a)}let c=this.resolveHighlightRange(e,a,i);if(c){let m=c.commonAncestorContainer?.nodeType===Node.ELEMENT_NODE?c.commonAncestorContainer:c.commonAncestorContainer?.parentElement??null;m&&t.commonAncestorElement&&!t.commonAncestorElement.contains(m)&&(t.commonAncestorElement=m,t.commonAncestorContainer=m,t.commonAncestorText=m.textContent);let h=Wb(c),_=[],I=h?.find(S=>!S?.textContent);if(I&&I?.remove(),h=h?.filter(S=>S?.textContent),h&&h.length){let S=-1,z=-1;if(h.forEach(($,G)=>{this.textHighlighterClass?this.domService.addClassToElement($,this.textHighlighterClass):this.domService.addClassToElement($,$.tagName?.toLowerCase()),$.setAttribute(X.ATTRIBUTES.VELT_ID,e.annotationId);let Z=$.childNodes[0],ae=new cg(Wg),pe=new mg($,this.appRef,this.injector),Se=pe.attach(ae);Se.instance.setCommentPinAnnotation(e),Se.instance.setElement($),Se.instance.onKeyupEnter=()=>{this.onCommonAncestorElementChange(e)},S<0&&(S=G),z=G,_.push({host:pe,portal:ae,portalRef:Se,element:$,textNode:Z})}),S>=0&&_[S]?.portalRef&&_[S].portalRef.instance.setFirst(!0),z>=0&&_[z]?.portalRef&&_[z].portalRef.instance.setLast(!0),t.texts=_,this.inlineCommentMode&&!document.querySelector(`${X.TAGS.VELT_INLINE_COMMENT}[${X.ATTRIBUTES.VELT_INLINE_COMMENT_ID}="${e.annotationId}"]`)){let G=t.texts?.filter(ae=>!!ae?.element)?.map(ae=>ae?.element),Z=G?.length?G[G.length-1]:null;if(Z&&!Lv(Z,X.ATTRIBUTES.VELT_PDF_VIEWER)){let pe=Z?.parentElement;if(pe){let Se=document.createElement(X.TAGS.VELT_INLINE_COMMENT);Se.setAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_ID,e.annotationId),pe.insertAdjacentElement("afterend",Se),t.inlineCommentElement=Se}}}}this.removeGhostComment(e)}else this.setGhostComment(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setTextCommentPortal: ",t)}}resolveHighlightRange(e,t,a=document.body){try{let i=e.targetTextRange?.text,c=e.targetTextRange?.occurrence,m=t?this.buildValidRange(Ru(i,t,c),i):null;return!m&&!this.restrictTextSearchToAnchor&&a&&t!==a&&(m=this.buildValidRange(Ru(i,a,c),i)),m}catch(i){return this.loggingService.catch("Error in CommentPinPortalService resolveHighlightRange: ",i),null}}buildValidRange(e,t){try{if(!e?.length||e.some(c=>c?.textNode?.parentElement?.closest("script")))return null;let i=new Range;try{i.setStart(e[0].textNode,e[0].startOffset||0),i.setEnd(e[e.length-1].textNode,e[e.length-1].endOffset||0)}catch{return null}return i.toString()===t?i:null}catch(a){return this.loggingService.catch("Error in CommentPinPortalService buildValidRange: ",a),null}}checkToRemoveTextCommentAnnotations(e){try{let t=e.map(i=>i.annotationId),a=!1;if(Object.keys(this.commentsTextById).forEach(i=>{t.includes(i)||(this.commentsTextById[i]?.annotation?.targetTextRange&&(a=!0),this.removeTextCommentAnnotation(this.commentsTextById[i].annotation))}),a){let i=[];Object.keys(this.commentsTextById).forEach(c=>{this.commentsTextById[c]?.annotation?.targetTextRange&&(i.push(this.commentsTextById[c]?.annotation),this.removeTextCommentAnnotation(this.commentsTextById[c]?.annotation))}),i?.length&&i.forEach(c=>{this.updateTextCommentAnnotation(c)})}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToRemoveTextCommentAnnotations: ",t)}}removeTextCommentAnnotation(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts.forEach(a=>{a?.host&&a.host.detach(),a?.element&&a?.textNode&&a.element.replaceWith(a.textNode),a.textNode&&a.textNode.parentNode?.normalize()}),t.texts?.length){let a=document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`);a?.length&&a.forEach(i=>{let c=i?.parentNode;if(i?.textContent){let m=document.createTextNode(i.textContent);i.replaceWith(m)}c&&c.normalize()})}t?.inlineCommentElement&&t?.inlineCommentElement?.remove(),this.checkToUnsubscribeCommonAncestorElementChanges(e),delete this.commentsTextById[e.annotationId]}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeTextCommentAnnotation: ",t)}}observeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);if(a)a.annotations.find(i=>i.annotationId===e.annotationId)||a.annotations.push(e);else{let i=new MutationObserver(c=>{let m="";if(ob(t?.commonAncestorElement).forEach(_=>{_?.parentElement?.closest(".comment-annotation-number")||(m+=_.textContent)}),t?.commonAncestorText!==m&&c.filter(_=>[Node.ELEMENT_NODE,Node.TEXT_NODE].includes(_.target.nodeType)).filter(_=>_.target?.parentElement&&(_?.target?.parentElement?.classList?.contains("comment-text-highlight")||!Nc(_.target?.parentElement))).length){this.commonAncestorElementObservers.get(t.commonAncestorElement)?.annotations?.forEach($=>{this.onCommonAncestorElementChange($)});let{count:I,lastUpdated:S}=this.commonAncestorElementObserverCounts.get(t.commonAncestorElement)||{count:0,lastUpdated:0},z=Date.now();this.commonAncestorElementObserverCounts.set(t.commonAncestorElement,{count:z-S<100?I+1:1,lastUpdated:Date.now()}),I>5&&(i.disconnect(),this.loggingService.catch("Failed to detect text changes."))}});i.observe(t.commonAncestorElement,{characterData:!0,subtree:!0}),a={observer:i,annotations:[e]}}this.commonAncestorElementObservers.set(t.commonAncestorElement,a)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService observeCommonAncestorElementChanges: ",t)}}onCommonAncestorElementChange(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts?.length){let a="";t.texts.forEach(I=>a+=I.textNode?.textContent);let i=t.texts[0].textNode,c=[];document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`)?.forEach(I=>{c.push(I)});let m=!1;if(c?.length!==t?.texts?.length&&(m=!0),c?.length){let I="";c.forEach(S=>{I+=S?.textContent||""}),I&&(a=I,m&&this.removeTextCommentAnnotation(e))}let h=eb(t.commonAncestorContainer,0,i,0,a)+1,_={};_.commonAncestorContainer=e.targetTextRange?.commonAncestorContainer,_.text=a,_.occurrence=h,an(e.targetTextRange,_)||(t.annotation.targetTextRange=_,this.updateAnnotationToFirebase(t.annotation))}else this.setTextCommentPortal(t.annotation)}catch(t){this.loggingService.catch("Error in CommentPinPortalService onCommonAncestorElementChange: ",t)}}updateAnnotationToFirebase(e){try{this.commentService.updateComment(e,!1,!0)}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateAnnotationToFirebase: ",t)}}checkToUnsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);a&&(a.annotations=a?.annotations.filter(i=>i.annotationId!==e.annotationId),a.annotations.length||this.unsubscribeCommonAncestorElementChanges(e))}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToUnsubscribeCommonAncestorElementChanges: ",t)}}setGhostComment(e){try{e.ghostComment={},this.commentService.setGhostCommentMessage(e),this.commentService.addAnnotationToGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setGhostComment: ",t)}}removeGhostComment(e){try{delete e.ghostComment,this.commentService.removeAnnotationFromGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeGhostComment: ",t)}}onAcceptComment(e){try{let t=this.commentsTextById[e.annotationId];if(t?.texts?.length){let a=t.texts.length-1,i=t.texts[a].textNode;if(i&&i.parentNode){let c=e.comments?.length?e.comments[0]:null,m=wg(c?.replaceContentHtml)?null:c?.replaceContentHtml,h=c?.replaceContentText||c?.commentText||"";if(wg(m)&&!c?.replaceContentText&&(m=c?.commentHtml||""),e?.selectAllContent&&e?.targetElementId){let _=zr(e.targetElementId,["id","data-id"]);_&&(_.innerHTML=this.domService.sanitizeHtml(wg(m)?h||"":m||""))}else{if(m&&m!==h){let _=document.createElement("span");_.innerHTML=this.domService.sanitizeHtml(m||h||""),i.parentNode.replaceChild(_,i),t.texts[a].textNode=_}else t.texts[a].textNode.textContent=h||"";for(let _=0;_<a;_++){let I=t.texts[_].textNode;I&&(I.textContent="")}}this.removeTextCommentAnnotation(e),this.domService.resetSelectedAnnotationsMap()}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService onAcceptComment: ",t)}}unsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];this.commonAncestorElementObservers.get(t.commonAncestorElement)?.observer?.disconnect(),this.commonAncestorElementObservers.delete(t.commonAncestorElement)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unsubscribeCommonAncestorElementChanges: ",t)}}};o.\u0275fac=function(t){return new(t||o)(be(ut),be(Ne),be(ie),be(tg),be(qs),be(rg),be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function Vy(r,o){if(r&1){let n=J();b(0,"div",4),H("pointerup",function(t){return B(n),l(2).togglePinSelection(),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(2);return V(t.onPinDragStart())}),b(1,"snippyly-comment-pin",5),H("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))})("commentTargetElementClicked",function(){B(n);let t=l(2);return V(t.togglePinSelection())})("togglePinSelection",function(t){B(n);let a=l(2);return V(a.togglePinSelection(t))}),x()()}if(r&2){let n=l().ngIf,e=l();at("top",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.top)-0+n.offsetTop,"px")("left",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.left)-10+n.offsetLeft,"px"),v("id","comment-pin-container-"+(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationId)),k("data-testid",e.componentId+"-popover")("role","button")("aria-expanded",n.commentPinSelected),d(),v("annotation",n.commentPinAnnotation)("containerComponentId",n.componentId)("commentPinSelected",n.commentPinSelected&&!n.annotationDragging)("multipleCommentPinSelected",n.commentPinSelected&&e.objectKeys(n.selectedAnnotationsMap).length>1)("targetElement",n.targetElement)("user",n.user)}}function $y(r,o){if(r&1){let n=J();b(0,"div",7),H("pointerup",function(t){return B(n),l(3).togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("mousedown",function(t){return B(n),V(t.stopPropagation())})("touchstart",function(t){return B(n),V(t.stopPropagation())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(3);return V(t.onPinDragStart())})("cdkDragMoved",function(t){B(n);let a=l(3);return V(a.onPinMove(t))})("cdkDragReleased",function(){B(n);let t=l(3);return V(t.onPinRelease())}),b(1,"snippyly-comment-pin",8,1),H("togglePinSelection",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))})("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()()}if(r&2){let n=we(2),e=l(2).ngIf,t=l();at("top",e.annotationDragging?(e.dragPosition==null?null:e.dragPosition.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40):(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40)+e.offsetTop,"px")("left",e.annotationDragging?e.dragPosition==null?null:e.dragPosition.left:(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.left)+e.offsetLeft,"px")("--velt-comment-pin-transform",e.annotationDragging?"none":e.pinTransform??"none")("transform",!e.annotationDragging&&(!(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null)&&e.commentPinAnnotation.position.parentScaleX)?"scale("+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleX)||1)+", "+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleY)||1)+")":""),ue("pin-dragging",e.annotationDragging),v("id","comment-pin-container-"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationId))("cdkDragDisabled",!e.pinDragEnabled||(e.commentPinAnnotation==null||e.commentPinAnnotation.from==null?null:e.commentPinAnnotation.from.userId)!==(e.user==null?null:e.user.userId)),k("data-testid",t.componentId+"-default")("role","button")("aria-expanded",e.commentPinSelected)("aria-grabbed",e.annotationDragging)("data-transform-inside",e.transformContext?"true":"false"),d(),v("annotation",e.commentPinAnnotation)("annotationDragging",e.annotationDragging)("containerComponentId",e.componentId)("commentPinSelected",e.commentPinSelected&&!e.annotationDragging)("multipleCommentPinSelected",e.commentPinSelected&&t.objectKeys(e.selectedAnnotationsMap).length>1)("targetElement",e.targetElement)("user",e.user)}}function Gy(r,o){if(r&1&&s(0,$y,3,24,"div",6),r&2){let n=l().ngIf;v("ngIf",n.commentPinAnnotation==null?null:n.commentPinAnnotation.position)}}function jy(r,o){if(r&1&&(u(0),s(1,Vy,2,14,"div",3)(2,Gy,1,1,"ng-template",null,0,Ge),p()),r&2){let n=o.ngIf,e=we(3);d(),v("ngIf",n.popoverMode)("ngIfElse",e)}}var Jg=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.docService=a,this.domService=i,this.commentService=c,this.commentActionsService=m,this.loggingService=h,this.elementRef=_,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.objectKeys=Object.keys,this.selectedAnnotationsLocationMap={},this.subscriptions=[],this.componentConfigSignal=Fe({popoverMode:!1,commentPinAnnotation:void 0,commentPinSelected:!1,offsetLeft:0,offsetTop:0,selectedAnnotationsMap:{},annotationDragging:!1,dragPosition:null,targetElement:void 0,user:void 0,componentId:`comment-pin-portal-${zt()}`,pinDragEnabled:!0}),this.veltElement=!0,this.componentId="velt-comment-pin-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{selectedAnnotationsMap:I}),S)),this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsMap$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsLocationMap$().subscribe(I=>{this.selectedAnnotationsLocationMap=I||{},this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsLocationMap$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPinDrag$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{pinDragEnabled:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPinDrag$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{popoverMode:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPopoverMode subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getTransformContext$().subscribe(e=>{this.componentConfigSignal.update(t=>{if(t=f(g({},t),{transformContext:e}),e&&this.isElementInsideTransformContainer(this.elementRef?.nativeElement,e.containerSelector)){let a=e.transforms.scale?1/e.transforms.scale:1;t.pinTransform=`scale(${a})`}else t.pinTransform=void 0;return t})}))}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent ngOnInit:",e)}}isElementInsideTransformContainer(e,t){try{return document.querySelector(t)?.contains(e)??!1}catch(a){return this.loggingService.catch("Error in CommentPinPortalComponent isElementInsideTransformContainer:",a),!1}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent setupA11yAttributes:",e)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t)),this.id=this.componentConfigSignal().commentPinAnnotation?.annotationId,this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setCommentPinAnnotation: ",t)}}setSourceId(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{sourceId:e}),t)),this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setSourceId: ",t)}}getMultiThreadCommentAnnotations(){}checkCommentPinSelected(){try{let e=this.componentConfigSignal().selectedAnnotationsMap,t=this.componentConfigSignal().commentPinAnnotation,a=this.componentConfigSignal().sourceId;if(t){let i=!!e[t.annotationId];if(i)if(t?.isDraft)t?.sourceId&&(i=t?.sourceId===a,i&&this.domService.setSelectedAnnotationLocation(t.annotationId,this.componentConfigSignal().componentId));else{let c=this.selectedAnnotationsLocationMap?.[t.annotationId];c&&(i=c===this.componentConfigSignal().componentId)}i!==this.componentConfigSignal().commentPinSelected&&this.componentConfigSignal.update(c=>(c=f(g({},c),{commentPinSelected:i}),c))}}catch(e){this.catchError("Error in CommentPinPortalComponent checkCommentPinSelected: ",e)}}setTargetElement(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{targetElement:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setTargetElement: ",t)}}setOffsetLeft(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetLeft:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetLeft: ",t)}}setOffsetTop(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetTop:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetTop: ",t)}}togglePinSelection(e){try{let t=e||this.componentConfigSignal().commentPinAnnotation;if(t&&this.commentActionsService.onCommentPinClick(t).catch(i=>{this.catchError("Error in CommentPinPortalComponent togglePinSelection onCommentPinClick: ",i)}),this.componentConfigSignal().selectedAnnotationsMap[t?.annotationId]&&this.selectedAnnotationsLocationMap?.[t?.annotationId]===this.componentConfigSignal().componentId)t?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)&&this.domService.resetSelectedAnnotationsMap(!0,"comments");else{let i=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(i||(i=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),i){let c=i.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(c){let m=document.getElementById(`comment-pin-container-${c}`)||document.querySelector(`[data-velt-id='${c}']`);m&&(m.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal().targetElement&&this.domService.isElementVisibleOnScreen(this.componentConfigSignal().targetElement)&&(this.componentConfigSignal().annotationDragging||this.domService.toggleAnnotationSelection(t,this.componentConfigSignal().componentId,void 0,!0))}}catch(t){this.catchError("Error in CommentPinPortalComponent togglePinSelection: ",t)}}onPinDragStart(){try{this.componentConfigSignal().selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation.annotationId]&&this.componentConfigSignal().commentPinAnnotation?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&this.domService.toggleAnnotationSelection(this.componentConfigSignal().commentPinAnnotation,this.componentConfigSignal().componentId);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e)return;this.parentElement=e.parentElement;let t=this.componentConfigSignal().commentPinAnnotation.position,a=this.componentConfigSignal().transformContext,i=this.parentElement.getBoundingClientRect(),c=i.left+t.left,m=i.top+t.top,h=a&&this.isElementInsideTransformContainer(e,a.containerSelector);this.componentConfigSignal.update(_=>(_=f(g({},_),{elementInTransformedContainer:h}),_)),e.style.width="20px",e.style.height="20px",e.style.margin="0",e.style.padding="0",e.style.display="block",e.style.visibility="visible",e.style.opacity="1",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.pointerEvents="auto",e.offsetWidth,document.body.appendChild(e),e.style.position="fixed",e.style.top=`${m}px`,e.style.left=`${c}px`,e.style.zIndex="10000",e.style.transform="none",e.offsetWidth,document.body.classList.add(X.BODY_CLASSES.VELT_PIN_DRAGGING),this.componentConfigSignal.update(_=>(_=f(g({},_),{annotationDragging:!0}),_))}catch(e){this.catchError("Error in CommentPinPortalComponent onPinDragStart: ",e)}}onPinMove(e){try{this.updateCurrentPinPosition(e)}catch(t){this.catchError("Error in CommentPinPortalComponent onPinMove: ",t)}}updateCurrentPinPosition(e){try{this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=e.event,a=t?.touches?.length?t.touches[0]?.clientX:t.clientX,i=t?.touches?.length?t.touches[0]?.clientY:t.clientY,c=this.componentConfigSignal().transformContext,m=this.domService.getBackgroundElement(a,i);m&&this.commentService.isElementInsideAllowedElements(m)&&(this.componentConfigSignal.update(h=>(h=f(g({},h),{targetElement:m}),h)),this.domService.highlightElement(this.componentConfigSignal().targetElement),this.pointerMoveEvent=e.event,this.componentConfigSignal.update(h=>(h=f(g({},h),{dragPosition:{top:i,left:a}}),h)))}catch(t){this.catchError("Error in CommentPinPortalComponent updateCurrentPinPosition: ",t)}}onPinRelease(){try{document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e||!this.parentElement)return;this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=this.domService.getElementFromXPath(this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath),a=this.componentConfigSignal().commentPinAnnotation?.targetElement;if(this.pointerMoveEvent){let ae=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent,!0,!0,!0,pe=>{if(this.commentService.getSvgAsImg()){let Se=pe?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);Se&&Se instanceof HTMLElement&&(pe=Se)}return pe});ae&&(a=ae)}let i=this.domService.getElementFromXPath(a?.xpath),c=this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath,m=a?.xpath,h=c===m;if(!i)return;let _=this.componentConfigSignal().dragPosition,I=i.getBoundingClientRect(),S=50,z=50;if(_){let ae=_.left-I.left,pe=_.top-I.top;S=ae/I.width*100,z=pe/I.height*100,S=Math.max(0,Math.min(100,S)),z=Math.max(0,Math.min(100,z))}let $=g({},this.componentConfigSignal().commentPinAnnotation);$.targetElement=g({},a),$.targetElement.leftPercentage=S,$.targetElement.topPercentage=z,this.commentService.calculateCommentAnnotationPosition($),this.componentConfigSignal.update(ae=>(ae=f(g({},ae),{commentPinAnnotation:$,targetElement:i}),ae));let G=this.domService.isElementInsideAdditionalLocationContainer(t)||this.domService.isElementInsideAdditionalLocationContainer(i),Z=this.docService.getAdditionalDocumentIdFromElement(i)||this.docService.getDocumentPaths()?.clientDocumentId;if(!this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId||this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId==Z?(this.componentConfigSignal.update(ae=>(ae=f(g({},ae),{commentPinAnnotation:f(g({},ae.commentPinAnnotation),{targetElement:a})}),ae)),this.commentService.updateComment(this.componentConfigSignal().commentPinAnnotation,G)):this.componentConfigSignal.update(ae=>(ae=f(g({},ae),{targetElement:t}),ae)),h){let ae=this.componentConfigSignal().transformContext,pe=this.componentConfigSignal().elementInTransformedContainer,Se=ae&&this.isElementInsideTransformContainer(i,ae.containerSelector);this.componentConfigSignal.update(he=>(he=f(g({},he),{elementInTransformedContainer:Se}),he));let oe=e.getBoundingClientRect();if(!pe&&Se){e.style.transition="none";let he=oe.top,_e=oe.left;this.parentElement.appendChild(e),e.style.position="fixed",e.style.top=`${he}px`,e.style.left=`${_e}px`,e.offsetWidth,requestAnimationFrame(()=>{e.style.position="absolute",Se&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`,$.position.transformContext.scale!==1&&(e.style.transform=`scale(${1/$.position.transformContext.scale})`)):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`)})}else e.style.transition="none",this.parentElement.appendChild(e),e.style.position="absolute",e.style.width="20px",e.style.height="20px",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.visibility="visible",e.style.display="block",e.offsetWidth,Se&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`);e.offsetWidth,this.componentConfigSignal.update(he=>(he=f(g({},he),{annotationDragging:!1,dragPosition:null}),he))}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PIN_DRAGGED,{annotationId:this.componentConfigSignal().commentPinAnnotation.annotationId,commentMode:this.commentService.getCommentMode()})}catch(e){this.catchError("Error in CommentPinPortalComponent onPinRelease: ",e)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentPinPortalComponent saveComment: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),this.componentConfigSignal()?.annotationDragging&&document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING)}catch(e){this.catchError("Error in CommentPinPortalComponent 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.catchError("Error in CommentPinPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(j(vr),j(ot),j(ut),j(Ne),j(ie),j(vt),j(N),j(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-pin-portal"]],hostVars:2,hostBindings:function(t,a){t&2&&(ph("id",a.id),k("data-velt-element",a.veltElement))},inputs:{multipleCommentPinsSelected:"multipleCommentPinsSelected",avatarErrorImage:"avatarErrorImage"},standalone:!1,decls:1,vars:1,consts:[["defaultPinPortalRef",""],["commentPinRef",""],[4,"ngIf"],["class","comment-pin-portal",3,"id","top","left","pointerup","click","cdkDragStarted",4,"ngIf","ngIfElse"],[1,"comment-pin-portal",3,"pointerup","click","cdkDragStarted","id"],[3,"saveComment","commentTargetElementClicked","togglePinSelection","annotation","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"],["class","comment-pin-portal","cdkDrag","","cdkDragHandle","",3,"id","pin-dragging","top","left","--velt-comment-pin-transform","transform","cdkDragDisabled","pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased",4,"ngIf"],["cdkDrag","","cdkDragHandle","",1,"comment-pin-portal",3,"pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased","id","cdkDragDisabled"],[3,"togglePinSelection","saveComment","annotation","annotationDragging","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"]],template:function(t,a){t&1&&s(0,jy,4,2,"ng-container",2),t&2&&v("ngIf",a.componentConfigSignal())},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:absolute!important;top:0!important;left:0!important;box-sizing:border-box!important;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset!important;width:unset!important;text-align:left!important;z-index:var(--velt-comment-pin-z-index)!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));-webkit-text-fill-color:initial!important}*[_ngcontent-%COMP%]:empty{display:revert!important}.comment-pin-portal[_ngcontent-%COMP%]{position:absolute;transform:var(--velt-comment-pin-transform, none)!important;transform-origin:0 100%!important;transform-box:fill-box!important;top:0;left:0}.comment-pin-portal.pin-dragging[_ngcontent-%COMP%]{position:fixed;z-index:var(--velt-comment-pin-z-index)!important}"],changeDetection:0});let r=o;return r})();var io=(()=>{let o=class o{constructor(e,t,a,i,c,m){this.commentService=e,this.domService=t,this.componentFactoryResolver=a,this.injector=i,this.appRef=c,this.loggingService=m,this.commentsPinById={},this.commentPinTemplate$=new De(null),this.customPinEvents$=new Gt}setCommentPin(e){try{if(!this.commentsPinById[e.annotationId])this.setPinPortal(e);else{let t=!1;if(e?.ghostComment?t=e?.ghostComment?.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?.targetElement?.xpath:this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?t=!0:t=e.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.targetElement?.xpath,!t)this.commentsPinById[e.annotationId]?.forEach(a=>{let i=a.portalRef,c=a.userTargetElement,m=a.pinHostElement;if(document.body.contains(c)&&document.body.contains(m))i&&(i.instance.setCommentPinAnnotation(e),this.updateElementOffset(e));else{let h=a.pinHostDomPortalOutlet;h&&(this.removeCommentPinHostAttributes(e.annotationId,a.pinHostElement),this.removeCommentDisabledAttribute(m),h.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}});else{let a=this.commentsPinById[e.annotationId]?.[0]?.pinHostDomPortalOutlet;a&&(this.removeCommentPinHostAttributes(e.annotationId,this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),this.removeCommentDisabledAttribute(this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),a.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentPin: ",t)}}unselectCommentAnnotation(e){try{this.loggingService.log("%c[WB] Calling CommentPinPortalService FUNCTION: unselectCommentAnnotation","color: green;"),this.domService.getSelectedAnnotationsMap()?.[e?.annotationId]&&this.domService.toggleAnnotationSelection(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unselectCommentAnnotation: ",t)}}setPinPortal(e){try{let t=this.commentService.getElementFromComments(e);t.length>0&&(this.commentsPinById[e.annotationId]=[],t.forEach(a=>{if(a){let i=this.domService.getHostElement(a),c=new cg(Jg),m=new mg(i,this.appRef,this.injector),h=m.attach(c);h.instance.setCommentPinAnnotation(e),h.instance.setTargetElement(a);let _=a?.getAttribute(X.ATTRIBUTES.VELT_SOURCE_ID);_&&h.instance.setSourceId(_),this.commentsPinById[e.annotationId].push({pinHostDomPortalOutlet:m,pinPortal:c,portalRef:h,annotation:JSON.parse(JSON.stringify(e)),userTargetElement:a,pinHostElement:i}),this.setCommentPinHostAttributes(e.annotationId,i),this.setCommentDisabledAttribute(i),this.updateElementOffset(e)}}))}catch(t){this.loggingService.catch("Error in CommentPinPortalService setPinPortal: ",t)}}setCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(",");i.includes(e)||(i.push(e),t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")))}else t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,e);this.domService.isElementOriginallyStatic(t)&&t.offsetHeight>0&&(cb(t)||t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC,"true"))}catch(a){this.loggingService.catch("Error in CommentPinPortalService setCommentPinHostAttributes: ",a)}}removeCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(","),c=i.indexOf(e);c>-1&&(i.splice(c,1),i.length>0?t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")):t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST))}t?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST)||t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)}catch(a){this.loggingService.catch("Error in CommentPinPortalService removeCommentPinHostAttributes: ",a)}}setCommentDisabledAttribute(e){try{this.commentService.getPopoverMode()&&e.setAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED,"auto")}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentDisabledAttribute: ",t)}}removeCommentDisabledAttribute(e){try{e?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)==="auto"&&e.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeCommentDisabledAttribute: ",t)}}updateElementOffset(e){try{for(let t of this.commentsPinById[e.annotationId]){let{portalRef:a,userTargetElement:i,pinHostElement:c}=t,m=this.domService.getElementOffset(i,c);a.instance.setOffsetLeft(m.offsetLeft),a.instance.setOffsetTop(m.offsetTop)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateElementOffset: ",t)}}checkPinsToRemove(e){try{let t=e.map(a=>a.annotationId);Object.keys(this.commentsPinById).forEach(a=>{t.includes(a)||(this.commentService.customPinsById.has(a)&&this.commentService.customPinsById.delete(a),this.commentsPinById[a].forEach(c=>{c.pinHostDomPortalOutlet.detach(),this.removeCommentPinHostAttributes(a,c.pinHostElement),this.removeCommentDisabledAttribute(c.pinHostElement),this.domService.removeHighlightFromElement(c.pinHostElement),c.userTargetElement&&this.domService.removeHighlightFromElement(c.userTargetElement)}),delete this.commentsPinById[a])})}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkPinsToRemove: ",t)}}getAnnotationIdsByUserTargetElement(e){try{let t=[];return Object.keys(this.commentsPinById||{}).forEach(a=>{this.commentsPinById[a]?.forEach(c=>{c.userTargetElement===e&&t.push(a)})}),t?.length>0?Array.from(new Set(t)):[]}catch(t){return this.loggingService.catch("Error in CommentPinPortalService getAnnotationIdsByUserTargetElement: ",t),[]}}setCommentPinOverrideTemplate(e){this.commentPinTemplate$.next(e)}getCommentPinTemplate$(){return this.commentPinTemplate$}emitCustomPinEvent(e){try{let{element:t,annotation:a}=e;a&&this.commentService.customPinsById.set(a.annotationId,t),this.customPinEvents$.next(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService emitCustomPinEvent",t)}}getCustomPinEvents$(){return this.customPinEvents$}};o.\u0275fac=function(t){return new(t||o)(be(ie),be(Ne),be(tg),be(qs),be(rg),be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function zu(){return{sidebarMode:!1,inboxMode:!1,dialogMode:!0,inlineCommentMode:!1,inlineCommentSectionMode:!1,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,darkMode:!1,variant:"dialog",disabled:!1,commentPinSelected:!1,fullExpanded:!1,commentDialogSelected:!1,readOnly:!1,dialogShadowDOM:!0,locationVersion:"",composerPosition:"bottom",dialogOpenedInSidebar:!1,expandOnSelection:!0,commentPinType:"pin",containerComponentId:"",dialogInstanceId:zt(),editComment:null,editCommentIndex:null,composerInOpenState:!1,assignToMenuOpened:!1,composerContent:"",composerContentHTML:"",selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[],selectedVisibility:"public",selectedVisibilityUsers:[]}}var Yg=new dh("LocalUIStateSignal"),bn=class{constructor(){this.appState={user:new Qn,isUserAdmin:!1,isKnownUser:!1,repliesUniqueUsers:[]},this.featureState={inlineCommentMode:!1,inlineCommentSectionMode:!1,sidebarMode:!1,dialogMode:!0,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,inboxMode:!1,fullExpanded:!1,canResolveAnnotation:!1,canUnresolveAnnotation:!1,dialogSelectedByKnownUser:!1,resolveStatusAccessAdminOnly:!1,enableResolve:!1,isPlanExpired:!1,moderatorMode:!1,enableAutoCategorize:!1,suggestionMode:!1,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:!1,enableUpgradeButton:!1,enableGhostCommentsMessage:!1,replyAvatars:!1,userMentions:!0,anonymousEmail:!0,recordingSummaryEnabled:!1,enableAttachment:!0,enableAttachmentDownload:!0,allowedFileTypes:[],allowedRecordings:["audio","video","screen"],screenSharingSupported:!0,enterKeyToSubmit:!0,deleteOnBackspace:!0,enableReactions:!0,isInsidePdfViewer:!1,sidebarButtonOnCommentDialogVisible:!1,enableAssignment:!0,enableNotifications:!0,enableEdit:!0,enableDelete:!0,enablePrivateMode:!1,deleteThreadWithFirstComment:!0,seenByUsers:!0,enableStatus:!0,enablePriority:!1,visibilityOptions:!1,isPrivateCommentsEnabled:!1,privateModeEnabled:!1,privateModeType:null,privateModeUserIds:null,dialogSelection:!0,multiThread:!1,assignToType:"dropdown"},this.data={annotation:new Nt,ghostComment:null,assignTo:void 0,isAssignedCheckbox:!1,selectedUserContacts:[],currentDialogView:{}},this.uiState={darkMode:!1,variant:"dialog",disabled:!1,commentDialogSelected:!1,commentPinSelected:!1,readOnly:!1,dialogShadowDOM:!0,composerPosition:"bottom",dialogOpenedInSidebar:!1,containerComponentId:void 0,locationVersion:void 0,isPrivateComment:!1,sidebarButtonOnCommentDialogVisible:!1,showGhostCommentMessage:!1,showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:!1,showAllComments:!0,multiThreadAnnotationId:void 0,maxReplyAvatars:3,showSuggestionModeActions:!1,uploadingAttachments:!1,playVideoInFullScreen:!0,commentDialogUniqueId:void 0,reactionToolOpenIndex:-1,openDropdownIndexValue:-1,hasReactionsByCommentId:{}},this.unreadCommentsMap=null,this.unreadIndicatorMode=Rv.MINIMAL,this.context={},this.trackById=o=>{try{return o?.commentId?.toString()||""}catch{return""}},this.trackByAttachmentId=o=>{try{return o?.attachmentId?.toString()||""}catch{return""}},this.trackByRecorderId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByStatusId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByPriorityId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByCustomChipId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByViewUserId=o=>{try{return o?.user?.userId?.toString()||""}catch{return""}},this.scrollToBottom=new Le,this.messageScrollOffset=0,this.setMessageScrollOffset=o=>{try{let n=o?.target;n&&(this.messageScrollOffset=n.scrollTop)}catch{}}}};function Qb(){return{composerContent:"",composerContentHTML:"",localRecordedData:[],selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[]}}function Kg(r){return r?!r.composerContent&&!r.selectedFiles?.length&&!r.invalidSelectedFiles?.length&&!r.selectedAttachments?.length&&!r.localRecordedData?.length:!0}var lo=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z){this.commentService=e,this.authService=t,this.iamService=a,this.usersService=i,this.loggingService=c,this.serviceBook=m,this.customFilterService=h,this.contactService=_,this.themeService=I,this.docService=S,this.domService=z,this.contextMap=new Map,this.annotationSubscriptions=new Map,this.registryMap=new Map,this.localUIStateRegistry=new Map,this.selectedDialogInstancesByAnnotation=new Map,this.composerDraftMap=new Map,this.standaloneComposerOwners=new Set,this.localAnonymousEmailOverrides=new Map,this.serviceSubscriptions=[],this.currentUser=new Qn,this.currentIsUserAdmin=!1,this.currentResolveStatusAccessAdminOnly=!1,this.currentEnableResolve=!0,this.currentIsPlanExpired=!1,this.currentSidebarButtonOnCommentDialogVisible=!1,this.currentModeratorMode=!1,this.currentEnableSignInButton=!1,this.currentEnableUpgradeButton=!1,this.currentSuggestionMode=!1,this.currentEnableAutoCategorize=!1,this.currentEnableGhostCommentsMessage=!1,this.currentReadOnly=!1,this.currentMaxReplyAvatars=3,this.currentReplyAvatars=!1,this.currentEnableAttachment=!0,this.currentEnableAttachmentDownload=!0,this.currentEnableFormatOptions=!1,this.currentFormatConfig=null,this.currentAllowedFileTypes=[],this.currentAllowedRecordings=["audio","video","screen"],this.currentScreenSharingSupported=!!navigator?.mediaDevices?.getDisplayMedia,this.currentUserMentions=!0,this.currentAnonymousEmail=!0,this.currentDeleteOnBackspace=!0,this.currentEnterKeyToSubmit=!0,this.currentDialogShadowDOM=!0,this.currentRecordingSummaryEnabled=!1,this.currentEnableReactions=!0,this.currentEnableStatus=!1,this.currentCustomStatusesShown=!1,this.currentStatusOptions=[],this.currentEnablePriority=!0,this.currentPriorityOptions=[],this.currentEnableVisibilityOptions=!1,this.currentIsPrivateCommentsEnabled=!1,this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.currentPrivateModeUserIds=null,this.currentDeleteThreadWithFirstComment=!0,this.currentCustomChipData=null,this.currentUnreadCommentsMap=null,this.currentUnreadIndicatorMode=void 0,this.currentSeenByUsers=!0,this.currentCommentViews=null,this.viewsService=null,this.currentUserContactsBySnippylyId=null,this.currentDarkMode=!1,this.ghostCommentSubscription=null,this.currentGhostCommentAnnotationMap=null,this.currentCommentplaceholder=void 0,this.currentReplyplaceholder=void 0,this.currentEditplaceholder=void 0,this.currentEditcommentplaceholder=void 0,this.currentEditreplyplaceholder=void 0,this.currentAtHereLabel=void 0,this.currentShortUserName=!1,this.currentAttachmentNameInMessage=!1,this.currentShowAllComments=!0,this.currentCollapsedRepliesPreview=!1,this.currentPlayVideoInFullScreen=void 0,this.currentShowScreenSizeInfo=!1,this.currentInlineCommentMode=!1,this.currentFullExpanded=!1,this.currentShowCommentIndex=!1,this.currentIsPrivateCommentAllowed=!1,this.currentLinkCallback=!1,this.currentDialogOpenedInSidebar=!1,this.currentAddCommentMode=!1,this.currentAssignToType="dropdown",this.editDraftsMap=Fe(new Map),this.serviceSubscriptions.push(this.usersService.getUserById$().subscribe(()=>{this.contextMap.forEach($=>{this.updateComputedProperties($)})})),this.serviceSubscriptions.push(this.authService.getUser$().subscribe($=>{$&&(this.currentUser=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{appState:f(g({},Z.appState),{user:$})})),this.updateComputedProperties(G)}))})),this.serviceSubscriptions.push(this.iamService.isUserAdmin$().subscribe($=>{this.currentIsUserAdmin=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{appState:f(g({},Z.appState),{isUserAdmin:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getResolveStatusAccessAdminOnly$().subscribe($=>{this.currentResolveStatusAccessAdminOnly=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{resolveStatusAccessAdminOnly:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableResolve$().subscribe($=>{this.currentEnableResolve=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableResolve:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.authService.isPlanExpired$().subscribe($=>{this.currentIsPlanExpired=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPlanExpired:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getSidebarButtonOnCommentDialogVisibility$().subscribe($=>{this.currentSidebarButtonOnCommentDialogVisible=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{sidebarButtonOnCommentDialogVisible:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.themeService.getDarkMode$().subscribe($=>{this.currentDarkMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{darkMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getModeratorMode$().subscribe($=>{this.currentModeratorMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{moderatorMode:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getSignInButton$().subscribe($=>{this.currentEnableSignInButton=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableSignInButton:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUpgradeButton$().subscribe($=>{this.currentEnableUpgradeButton=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableUpgradeButton:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getSuggestionMode$().subscribe($=>{this.currentSuggestionMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{suggestionMode:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAutoCategorize$().subscribe($=>{this.currentEnableAutoCategorize=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAutoCategorize:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableGhostCommentsMessage$().subscribe($=>{this.currentEnableGhostCommentsMessage=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableGhostCommentsMessage:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getReadOnly$().subscribe($=>{this.currentReadOnly=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{readOnly:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getMaxReplyAvatars$().subscribe($=>{this.currentMaxReplyAvatars=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{maxReplyAvatars:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getReplyAvatars$().subscribe($=>{this.currentReplyAvatars=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{replyAvatars:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachment$().subscribe($=>{this.currentEnableAttachment=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachment:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachmentDownload$().subscribe($=>{this.currentEnableAttachmentDownload=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachmentDownload:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableFormatOptions$().subscribe($=>{this.currentEnableFormatOptions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableFormatOptions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getFormatConfig$().subscribe($=>{this.currentFormatConfig=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{formatConfig:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableReactions$().subscribe($=>{this.currentEnableReactions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableReactions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableStatus$().subscribe($=>{this.currentEnableStatus=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableStatus:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getCustomStatusesShown$().subscribe($=>{this.currentCustomStatusesShown=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{customStatusesShown:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.customFilterService.customStatusMap$.subscribe($=>{let G=$?Object.values($):[];this.currentStatusOptions=G,this.contextMap.forEach(Z=>{let ae=Z();Z.set(f(g({},ae),{featureState:f(g({},ae.featureState),{statusOptions:G})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getEnablePriority$().subscribe($=>{this.currentEnablePriority=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enablePriority:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableVisibilityOptions$().subscribe($=>{this.currentEnableVisibilityOptions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{visibilityOptions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.authService.getIsPrivateCommentsEnabled$().subscribe($=>{this.currentIsPrivateCommentsEnabled=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentsEnabled:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getPrivateModeConfig$().subscribe($=>{let G=$!==null,Z=$?.type??null,ae=$?.userIds??null;this.currentPrivateModeType=Z,this.currentPrivateModeUserIds=ae,this.currentPrivateModeEnabled!==G&&(this.currentPrivateModeEnabled=G),this.updatePrivateModeEnabledInAllContexts()})),this.serviceSubscriptions.push(this.commentService.getPrivateCommentMode$().subscribe($=>{$&&!this.currentPrivateModeEnabled?(this.currentPrivateModeEnabled=!0,this.currentPrivateModeType="organizationPrivate",this.updatePrivateModeEnabledInAllContexts()):!$&&!this.commentService.getPrivateModeConfig()&&(this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.updatePrivateModeEnabledInAllContexts())})),this.serviceSubscriptions.push(this.customFilterService.customPriorityMap$.subscribe($=>{let G=$?Object.values($):[];this.currentPriorityOptions=G,this.contextMap.forEach(Z=>{let ae=Z();Z.set(f(g({},ae),{featureState:f(g({},ae.featureState),{priorityOptions:G})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getDeleteThreadWithFirstComment$().subscribe($=>{this.currentDeleteThreadWithFirstComment=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteThreadWithFirstComment:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getCustomChipDropdownData$().subscribe($=>{this.currentCustomChipData=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{data:f(g({},Z.data),{customChipData:$,selectedCustomChipSet:Z.data.selectedCustomChipSet||new Set})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getAllowedFileTypes$().subscribe($=>{this.currentAllowedFileTypes=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedFileTypes:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getAllowedRecordings$().subscribe($=>{this.currentAllowedRecordings=$||[],this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedRecordings:$||[]})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUserMentions$().subscribe($=>{this.currentUserMentions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{userMentions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAnonymousEmail$().subscribe($=>{this.currentAnonymousEmail=$,this.contextMap.forEach((G,Z)=>{if(this.localAnonymousEmailOverrides.has(Z))return;let ae=G();G.set(f(g({},ae),{featureState:f(g({},ae.featureState),{anonymousEmail:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getAssignToType$().subscribe($=>{this.currentAssignToType=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{assignToType:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getDeleteOnBackspace$().subscribe($=>{this.currentDeleteOnBackspace=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteOnBackspace:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnterKeyToSubmit$().subscribe($=>{this.currentEnterKeyToSubmit=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enterKeyToSubmit:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getDialogShadowDOM$().subscribe($=>{this.currentDialogShadowDOM=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogShadowDOM:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getComposerMode$().subscribe($=>{this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{composerMode:$||"default"})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getRecordingSummaryEnabled$().subscribe($=>{this.currentRecordingSummaryEnabled=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{recordingSummaryEnabled:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe($=>{this.currentUnreadCommentsMap=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{unreadCommentsMap:$})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUnreadIndicatorMode$().subscribe($=>{this.currentUnreadIndicatorMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{unreadIndicatorMode:$})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.serviceBook.observe(ln).pipe(Me($=>$?.onInitRecording()??Wn)).subscribe($=>{this.contextMap.forEach((G,Z)=>{let ae=G();($?.panelId===ae.uiState?.commentDialogUniqueId||$?.commentAnnotationId===Z||!$)&&(G.set(f(g({},ae),{uiState:f(g({},ae.uiState),{recorderInitConfig:$})})),this.updateComputedProperties(G),$?.commentAnnotationId&&$?.commentAnnotationId===Z&&!ae.featureState?.sidebarMode&&this.domService.setRecordingInProgress($.commentAnnotationId,!0))})})),this.ghostCommentSubscription=this.commentService.getGhostCommentAnnotationMap$().subscribe($=>{this.currentGhostCommentAnnotationMap=$||null,this.contextMap.forEach((G,Z)=>{let ae=G(),pe=$?$[Z]:null;G.set(f(g({},ae),{data:f(g({},ae.data),{ghostComment:pe||null})})),this.updateComputedProperties(G)})}),this.ghostCommentSubscription&&this.serviceSubscriptions.push(this.ghostCommentSubscription),this.serviceSubscriptions.push(this.commentService.getSeenByUsers$().subscribe($=>{this.currentSeenByUsers=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{seenByUsers:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.serviceBook.observe(Do).pipe(Me($=>(this.viewsService=$??null,$?$.getCommentFeatureViews$():Ee({})))).subscribe($=>{this.currentCommentViews=$,this.contextMap.forEach(G=>{this.computeCurrentDialogView(G)})})),this.serviceSubscriptions.push(this.contactService.getUserContactsBySnippylyId$().subscribe($=>{this.currentUserContactsBySnippylyId=$,this.contextMap.forEach(G=>{this.computeCurrentDialogView(G)})})),this.serviceSubscriptions.push(this.commentService.getCommentplaceholder$().subscribe($=>{this.currentCommentplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{commentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getReplyplaceholder$().subscribe($=>{this.currentReplyplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{replyplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditplaceholder$().subscribe($=>{this.currentEditplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{editplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditcommentplaceholder$().subscribe($=>{this.currentEditcommentplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{editcommentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditreplyplaceholder$().subscribe($=>{this.currentEditreplyplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{editreplyplaceholder:$}))})})),this.serviceSubscriptions.push(this.contactService.getAtHereLabel().subscribe($=>{this.currentAtHereLabel=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{atHereLabel:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShortUserName$().subscribe($=>{this.currentShortUserName=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{shortUserName:$})}))})})),this.serviceSubscriptions.push(this.commentService.getAttachmentNameInMessage$().subscribe($=>{this.currentAttachmentNameInMessage=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{attachmentNameInMessage:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedComments$().subscribe($=>{this.currentShowAllComments=!$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showAllComments:!$,collapsedComments:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedRepliesPreview$().subscribe($=>{this.currentCollapsedRepliesPreview=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{collapsedRepliesPreview:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(ln).pipe(Me($=>$?.getPlayVideoInFullScreen$()??Wn)).subscribe($=>{this.currentPlayVideoInFullScreen=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{playVideoInFullScreen:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShowScreenSizeInfo$().subscribe($=>{this.currentShowScreenSizeInfo=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showScreenSizeInfo:$})}))})})),this.serviceSubscriptions.push(this.commentService.getInlineCommentMode$().subscribe($=>{this.currentInlineCommentMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{inlineCommentMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getFullExpanded$().subscribe($=>{this.currentFullExpanded=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{fullExpanded:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getShowCommentIndex().subscribe($=>{this.currentShowCommentIndex=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showCommentIndex:$})}))})})),this.serviceSubscriptions.push(this.commentService.isPrivateCommentAllowed$().subscribe($=>{this.currentIsPrivateCommentAllowed=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentAllowed:$})}))})})),this.serviceSubscriptions.push(this.commentService.getLinkCallback$().subscribe($=>{this.currentLinkCallback=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{linkCallback:$})}))})})),this.serviceSubscriptions.push(this.commentService.addCommentModeChange().subscribe($=>{this.currentAddCommentMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{addCommentMode:$})}))})})),this.serviceSubscriptions.push(this.domService.getDialogOpenedInSidebar().subscribe($=>{this.currentDialogOpenedInSidebar=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogOpenedInSidebar:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(ln).pipe(Me($=>$?.onRecordingAttributeRemovedFromBody$()??Wn)).subscribe(()=>{this.contextMap.forEach($=>{let G=$();$.set(f(g({},G),{uiState:f(g({},G.uiState),{recordingAttributeRemovedTimestamp:Date.now()})}))})}))}setRegistry(e,t){try{this.registryMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setRegistry:",a)}}getRegistry(e){try{return this.registryMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getRegistry:",t);return}}clearRegistry(e){try{this.registryMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearRegistry:",t)}}createDefaultComponentConfig(){try{let e=new bn,t=new Nt;return e.appState={user:this.currentUser,isUserAdmin:this.currentIsUserAdmin,isKnownUser:!1},e.data={annotation:t,customChipData:this.currentCustomChipData,selectedCustomChipSet:new Set,customList:t.customList||[],currentDialogView:{}},e.featureState={inlineCommentMode:this.currentInlineCommentMode,inlineCommentSectionMode:!1,canResolveAnnotation:!1,resolveStatusAccessAdminOnly:this.currentResolveStatusAccessAdminOnly,sidebarMode:!1,enableResolve:this.currentEnableResolve,dialogSelectedByKnownUser:!1,isPlanExpired:this.currentIsPlanExpired,dialogMode:!0,moderatorMode:this.currentModeratorMode,enableAutoCategorize:this.currentEnableAutoCategorize,suggestionMode:this.currentSuggestionMode,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:this.currentEnableSignInButton,enableUpgradeButton:this.currentEnableUpgradeButton,enableGhostCommentsMessage:this.currentEnableGhostCommentsMessage,replyAvatars:this.currentReplyAvatars,userMentions:this.currentUserMentions,anonymousEmail:this.currentAnonymousEmail,recordingSummaryEnabled:this.currentRecordingSummaryEnabled,enableAttachment:this.currentEnableAttachment,enableAttachmentDownload:this.currentEnableAttachmentDownload,enableFormatOptions:this.currentEnableFormatOptions,formatConfig:this.currentFormatConfig??void 0,allowedFileTypes:this.currentAllowedFileTypes,allowedRecordings:this.currentAllowedRecordings,screenSharingSupported:this.currentScreenSharingSupported,enterKeyToSubmit:this.currentEnterKeyToSubmit,deleteOnBackspace:this.currentDeleteOnBackspace,enableReactions:this.currentEnableReactions,enableStatus:this.currentEnableStatus,customStatusesShown:this.currentCustomStatusesShown,statusOptions:this.currentStatusOptions,enablePriority:this.currentEnablePriority,priorityOptions:this.currentPriorityOptions,visibilityOptions:this.currentEnableVisibilityOptions,isPrivateCommentsEnabled:this.currentIsPrivateCommentsEnabled,privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds,deleteThreadWithFirstComment:this.currentDeleteThreadWithFirstComment,fullExpanded:this.currentFullExpanded,seenByUsers:this.currentSeenByUsers,isPrivateCommentAllowed:this.currentIsPrivateCommentAllowed,linkCallback:this.currentLinkCallback,assignToType:this.currentAssignToType,messageTruncation:!1,messageTruncationLines:4},e.uiState={darkMode:this.currentDarkMode,variant:"dialog",disabled:!1,isPrivateComment:!1,commentDialogSelected:!1,commentPinSelected:!1,sidebarButtonOnCommentDialogVisible:this.currentSidebarButtonOnCommentDialogVisible,readOnly:this.currentReadOnly,maxReplyAvatars:this.currentMaxReplyAvatars,uploadingAttachments:!1,dialogShadowDOM:this.currentDialogShadowDOM,commentDialogUniqueId:zt(),composerMode:"default",showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:this.currentCollapsedRepliesPreview,showAllComments:this.currentShowAllComments,shortUserName:this.currentShortUserName,attachmentNameInMessage:this.currentAttachmentNameInMessage,showScreenSizeInfo:this.currentShowScreenSizeInfo,showCommentIndex:this.currentShowCommentIndex,playVideoInFullScreen:this.currentPlayVideoInFullScreen,addCommentMode:this.currentAddCommentMode,dialogOpenedInSidebar:this.currentDialogOpenedInSidebar,atHereLabel:this.currentAtHereLabel},e.unreadCommentsMap=this.currentUnreadCommentsMap,e.unreadIndicatorMode=this.currentUnreadIndicatorMode,e.commentplaceholder=this.currentCommentplaceholder,e.replyplaceholder=this.currentReplyplaceholder,e.editplaceholder=this.currentEditplaceholder,e.editcommentplaceholder=this.currentEditcommentplaceholder,e.editreplyplaceholder=this.currentEditreplyplaceholder,e}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService createDefaultComponentConfig:",e),new bn}}getDefaultBase(){try{let e=this.createDefaultComponentConfig();return{appState:{user:e.appState.user,isUserAdmin:e.appState.isUserAdmin,isKnownUser:e.appState.isKnownUser,repliesUniqueUsers:e.appState.repliesUniqueUsers},data:{annotation:e.data.annotation,customChipData:e.data.customChipData,selectedCustomChipSet:e.data.selectedCustomChipSet,customList:e.data.customList},featureState:{inlineCommentMode:e.featureState.inlineCommentMode,inlineCommentSectionMode:e.featureState.inlineCommentSectionMode,canResolveAnnotation:e.featureState.canResolveAnnotation,canUnresolveAnnotation:e.featureState.canUnresolveAnnotation,resolveStatusAccessAdminOnly:e.featureState.resolveStatusAccessAdminOnly,sidebarMode:e.featureState.sidebarMode,enableResolve:e.featureState.enableResolve,dialogSelectedByKnownUser:e.featureState.dialogSelectedByKnownUser,isPlanExpired:e.featureState.isPlanExpired,moderatorMode:e.featureState.moderatorMode,enableAutoCategorize:e.featureState.enableAutoCategorize,suggestionMode:e.featureState.suggestionMode,commentAcceptedStatus:e.featureState.commentAcceptedStatus,commentRejectedStatus:e.featureState.commentRejectedStatus,enableSignInButton:e.featureState.enableSignInButton,enableUpgradeButton:e.featureState.enableUpgradeButton,enableGhostCommentsMessage:e.featureState.enableGhostCommentsMessage,replyAvatars:e.featureState.replyAvatars,userMentions:e.featureState.userMentions,anonymousEmail:e.featureState.anonymousEmail,recordingSummaryEnabled:e.featureState.recordingSummaryEnabled,enableAttachment:e.featureState.enableAttachment,enableFormatOptions:e.featureState.enableFormatOptions,formatConfig:e.featureState.formatConfig,allowedFileTypes:e.featureState.allowedFileTypes,allowedRecordings:e.featureState.allowedRecordings,screenSharingSupported:e.featureState.screenSharingSupported,enterKeyToSubmit:e.featureState.enterKeyToSubmit,deleteOnBackspace:e.featureState.deleteOnBackspace,enableReactions:e.featureState.enableReactions,enableStatus:e.featureState.enableStatus,customStatusesShown:e.featureState.customStatusesShown,statusOptions:e.featureState.statusOptions,enablePriority:e.featureState.enablePriority,priorityOptions:e.featureState.priorityOptions,deleteThreadWithFirstComment:e.featureState.deleteThreadWithFirstComment,seenByUsers:e.featureState.seenByUsers,fullExpanded:e.featureState.fullExpanded,isPrivateCommentAllowed:e.featureState.isPrivateCommentAllowed,linkCallback:e.featureState.linkCallback,assignToType:e.featureState.assignToType,visibilityOptions:e.featureState.visibilityOptions,isPrivateCommentsEnabled:e.featureState.isPrivateCommentsEnabled,messageTruncation:e.featureState.messageTruncation,messageTruncationLines:e.featureState.messageTruncationLines},uiState:{darkMode:e.uiState?.darkMode,variant:e.uiState?.variant,disabled:e.uiState?.disabled,isPrivateComment:e.uiState?.isPrivateComment,dialogShadowDOM:e.uiState?.dialogShadowDOM,composerMode:e.uiState?.composerMode??"default",showAllComments:e.uiState?.showAllComments,collapsedComments:e.uiState?.collapsedComments,collapsedRepliesPreview:e.uiState?.collapsedRepliesPreview,shortUserName:e.uiState?.shortUserName,attachmentNameInMessage:e.uiState?.attachmentNameInMessage,showScreenSizeInfo:e.uiState?.showScreenSizeInfo,showCommentIndex:e.uiState?.showCommentIndex,playVideoInFullScreen:e.uiState?.playVideoInFullScreen,addCommentMode:e.uiState?.addCommentMode,dialogOpenedInSidebar:e.uiState?.dialogOpenedInSidebar,atHereLabel:e.uiState?.atHereLabel},unreadCommentsMap:e.unreadCommentsMap,unreadIndicatorMode:e.unreadIndicatorMode,commentplaceholder:e.commentplaceholder,replyplaceholder:e.replyplaceholder}}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService getDefaultBase:",e),{}}}getOrCreateContextConfig(e){try{if(!this.contextMap.has(e)){let t=this.createDefaultComponentConfig();this.currentGhostCommentAnnotationMap&&this.currentGhostCommentAnnotationMap[e]&&(t.data=f(g({},t.data),{ghostComment:this.currentGhostCommentAnnotationMap[e]}));let a=Fe(t);this.contextMap.set(e,a),this.updateComputedProperties(a),this.fetchAndUpdateAnnotation(e)}return this.contextMap.get(e)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getOrCreateContextConfig:",t),Fe(new bn)}}getContextConfig(e){try{return this.contextMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getContextConfig:",t);return}}setLocalAnonymousEmail(e,t){try{this.localAnonymousEmailOverrides.set(e,t);let a=this.contextMap.get(e);if(a){let i=a();a.set(f(g({},i),{featureState:f(g({},i.featureState),{anonymousEmail:t})})),this.updateComputedProperties(a)}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setLocalAnonymousEmail:",a)}}clearLocalAnonymousEmail(e){try{this.localAnonymousEmailOverrides.delete(e);let t=this.contextMap.get(e);if(t){let a=t();t.set(f(g({},a),{featureState:f(g({},a.featureState),{anonymousEmail:this.currentAnonymousEmail})})),this.updateComputedProperties(t)}}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearLocalAnonymousEmail:",t)}}registerLocalUIState(e,t){this.localUIStateRegistry.set(e,t)}unregisterLocalUIState(e){this.localUIStateRegistry.delete(e)}getLocalUIState(e){return this.localUIStateRegistry.get(e)}getOrCreateComposerDraft(e){let t=this.composerDraftMap.get(e);return t||(t=Fe(g({},Qb())),this.composerDraftMap.set(e,t)),t}clearComposerDraft(e){let t=this.composerDraftMap.get(e);t&&t.set(g({},Qb()))}appendComposerDraftRecording(e,t){this.getOrCreateComposerDraft(e).update(i=>{let c=i.localRecordedData||[];return c.some(m=>m?.id&&m.id===t?.id)?i:f(g({},i),{localRecordedData:[...c,t]})})}removeComposerDraftRecording(e,t){if(!t)return;this.getOrCreateComposerDraft(e).update(i=>f(g({},i),{localRecordedData:(i.localRecordedData||[]).filter(c=>c?.id!==t)}))}setComposerDraftAttachments(e,t){this.getOrCreateComposerDraft(e).update(i=>g(g(g(g({},i),t.selectedFiles!==void 0?{selectedFiles:t.selectedFiles}:{}),t.invalidSelectedFiles!==void 0?{invalidSelectedFiles:t.invalidSelectedFiles}:{}),t.selectedAttachments!==void 0?{selectedAttachments:t.selectedAttachments}:{}))}markStandaloneComposerOwner(e){this.standaloneComposerOwners.add(e)}unmarkStandaloneComposerOwner(e){this.standaloneComposerOwners.delete(e)}isStandaloneComposerOwner(e){return!!e&&this.standaloneComposerOwners.has(e)}getStandaloneRecorderPanelId(e){return`velt-standalone-composer-recorder-${e}`}editDraftKey(e,t){return`${e}:${t}`}getEditDraft(e,t){try{return!e||t===void 0||t===null?null:this.editDraftsMap().get(this.editDraftKey(e,t))??null}catch(a){return this.loggingService.catch("Error in getEditDraft:",a),null}}setEditDraft(e,t,a){try{let i=this.editDraftKey(e,t);this.editDraftsMap.update(c=>{let m=c.get(i);if(m&&m.composerContent===a.composerContent&&m.composerContentHTML===a.composerContentHTML)return c;let h=new Map(c);return h.set(i,a),h})}catch(i){this.loggingService.catch("Error in setEditDraft:",i)}}clearEditDraft(e,t){try{let a=this.editDraftKey(e,t);this.editDraftsMap.update(i=>{if(!i.has(a))return i;let c=new Map(i);return c.delete(a),c})}catch(a){this.loggingService.catch("Error in clearEditDraft:",a)}}setContextConfig(e,t){try{this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=g(g({},i),a);this.localAnonymousEmailOverrides.has(e)&&(c.featureState=f(g({},c.featureState),{anonymousEmail:this.localAnonymousEmailOverrides.get(e)})),t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setContextConfig:",a)}}clearContext(e){try{this.contextMap.delete(e),this.localAnonymousEmailOverrides.delete(e),this.selectedDialogInstancesByAnnotation.delete(e);let t=this.annotationSubscriptions.get(e);t&&(t.unsubscribe(),this.annotationSubscriptions.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearContext:",t)}}generateTempAnnotationId(e){try{let t=e||zt();return`${o.TEMP_ID_PREFIX}${t}`}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService generateTempAnnotationId:",t),"TEMP_ANNOTATION_ID"}}isTempAnnotationId(e){try{return e?.startsWith(o.TEMP_ID_PREFIX)||!1}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService isTempAnnotationId:",t),!1}}registerTempContext(e,t){try{if(!this.isTempAnnotationId(e)){this.loggingService.warn(`[registerTempContext] ID "${e}" is not a valid temp ID`);return}this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=f(g(g({},i),a),{data:f(g(g({},i.data),a.data),{annotation:a.data?.annotation||i.data?.annotation}),appState:g(g({},i.appState),a.appState),featureState:f(g(g({},i.featureState),a.featureState),{allowedRecordings:i.featureState?.allowedRecordings,enableAttachment:i.featureState?.enableAttachment,enableReactions:i.featureState?.enableReactions,allowedFileTypes:i.featureState?.allowedFileTypes,screenSharingSupported:i.featureState?.screenSharingSupported,userMentions:i.featureState?.userMentions,anonymousEmail:i.featureState?.anonymousEmail,enterKeyToSubmit:i.featureState?.enterKeyToSubmit,deleteOnBackspace:i.featureState?.deleteOnBackspace,recordingSummaryEnabled:i.featureState?.recordingSummaryEnabled,enableResolve:i.featureState?.enableResolve,enableStatus:i.featureState?.enableStatus,enablePriority:i.featureState?.enablePriority,statusOptions:i.featureState?.statusOptions,priorityOptions:i.featureState?.priorityOptions,assignToType:i.featureState?.assignToType,visibilityOptions:i.featureState?.visibilityOptions,isPrivateCommentsEnabled:i.featureState?.isPrivateCommentsEnabled}),uiState:g(g({},i.uiState),a.uiState)});t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService registerTempContext:",a)}}clearTempContext(e){try{this.isTempAnnotationId(e)&&this.contextMap.has(e)&&(this.contextMap.delete(e),this.registryMap.delete(e),this.selectedDialogInstancesByAnnotation.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearTempContext:",t)}}computeNewCommentPlaceholder(e,t,a,i){try{if(t)return t;if(e?.placeholder)return e.placeholder;let c=e?.featureState?.userMentions===!0,m=(e?.data?.annotation?.comments?.length||0)>0,h=a||e?.replyplaceholder,_=i||e?.commentplaceholder;return m&&h?h:!m&&_?_:c?m?"Reply or add others with @":"Comment or add others with @":m?"Write a reply...":"Write a comment..."}catch(c){return this.loggingService.catch("Error in CommentDialogCoreService computeNewCommentPlaceholder:",c),"Write a comment..."}}computeEditCommentPlaceholder(e,t,a,i=!1,c,m,h){try{if(t)return t;if(e?.placeholder)return e.placeholder;let _=c||e?.editcommentplaceholder,I=m||e?.editreplyplaceholder,S;if(typeof h=="number"?S=h>0:S=(e?.data?.annotation?.comments?.length||0)>0,S&&I)return I;if(!S&&_)return _;let z=a||e?.editplaceholder;return z||(i?S?"Edit your reply...":"Edit your comment...":"Edit comment...")}catch(_){return this.loggingService.catch("Error in CommentDialogCoreService computeEditCommentPlaceholder:",_),"Edit comment..."}}recomputeDerivedProperties(e){try{let t=this.getContextConfig(e);t&&this.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService recomputeDerivedProperties:",t)}}markDialogSelected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);a||(a=new Set,this.selectedDialogInstancesByAnnotation.set(e,a)),a.add(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogSelected:",a)}}markDialogDeselected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);if(!a)return;a.delete(t),a.size===0&&this.selectedDialogInstancesByAnnotation.delete(e)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogDeselected:",a)}}hasOtherSelectedDialogInstance(e,t){try{let a=this.selectedDialogInstancesByAnnotation.get(e);return!a||a.size===0?!1:t?!(a.size===1&&a.has(t)):a.size>0}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService hasOtherSelectedDialogInstance:",a),!1}}resetCollapsedCommentsToDefault(e,t){try{if(this.hasOtherSelectedDialogInstance(e,t))return;let a=this.getContextConfig(e);if(!a)return;let i=a();if(i.uiState?.showAllComments===this.currentShowAllComments&&i.uiState?.collapsedComments===!this.currentShowAllComments&&!i.uiState?.showReplies&&!i.uiState?.showReplyComposer)return;a.set(f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:this.currentShowAllComments,collapsedComments:!this.currentShowAllComments,showReplies:!1,showReplyComposer:!1})}))}catch(a){this.loggingService.catch("Error in CommentDialogCoreService resetCollapsedCommentsToDefault:",a)}}ngOnDestroy(){try{this.serviceSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.serviceSubscriptions=[],this.ghostCommentSubscription=null,this.annotationSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.annotationSubscriptions.clear()}catch(e){this.loggingService.catch("Error in CommentDialogCoreService ngOnDestroy:",e)}}fetchAndUpdateAnnotation(e,t){try{if(this.annotationSubscriptions.has(e))t&&t();else{let a=this.commentService.getCommentAnnotationByAnnotationId(e).subscribe({next:i=>{if(i){let c=this.getContextConfig(e);if(c){let m=c(),h=f(g({},i),{annotationId:e});c.update(_=>f(g({},_),{data:f(g({},_.data),{annotation:h})})),this.updateComputedProperties(c),this.computeCurrentDialogView(c)}t&&t()}},error:i=>{},complete:()=>{}});this.annotationSubscriptions.set(e,a)}}catch{}}updateContextConfig(e,t){try{let a=this.getContextConfig(e);if(a){let i=a();a.set(g(g({},i),t))}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService updateContextConfig:",a)}}updatePrivateModeEnabledInAllContexts(){this.contextMap.forEach(e=>{let t=e();e.set(f(g({},t),{featureState:f(g({},t.featureState),{privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds})})),this.updateComputedProperties(e)})}updateComputedProperties(e){try{let t=e(),a=this.computeIsKnownUser(t),i=this.computeDialogSelectedByKnownUser(t,a),c=this.computeIsPrivateComment(t),m=this.computeCanResolveAnnotation(t,i),h=this.computeCanUnresolveAnnotation(t,i),_=this.computeShowGhostCommentMessage(t),I=this.computeRepliesUniqueUsers(t),S=this.computeShowSuggestionModeActions(t,i),z=this.computeHasReactionsByCommentId(t),$=this.computeUnreadStatus(t),G=!1,Z={};t.appState.isKnownUser!==a&&(G=!0,Z.appState=f(g({},t.appState),{isKnownUser:a})),t.featureState.dialogSelectedByKnownUser!==i&&(G=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{dialogSelectedByKnownUser:i})),t.featureState.canResolveAnnotation!==m&&(G=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canResolveAnnotation:m})),t.featureState.canUnresolveAnnotation!==h&&(G=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canUnresolveAnnotation:h})),t.uiState.isPrivateComment!==c&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{isPrivateComment:c})),t.uiState.showGhostCommentMessage!==_&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showGhostCommentMessage:_}));let ae=(t.appState.repliesUniqueUsers||[]).map(Xe=>Xe?.userId).sort().join(","),pe=(I||[]).map(Xe=>Xe?.userId).sort().join(",");ae!==pe&&(G=!0,Z.appState=f(g(g({},t.appState),Z.appState),{repliesUniqueUsers:I})),t.uiState.showSuggestionModeActions!==S&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showSuggestionModeActions:S}));let Se=JSON.stringify(t.uiState.hasReactionsByCommentId||{}),oe=JSON.stringify(z||{});Se!==oe&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{hasReactionsByCommentId:z})),t.uiState.unread!==$&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{unread:$}));let _e=(t.data?.annotation?.customList||[]).map(Xe=>Xe?.id).filter(Boolean),Re=t.data?.selectedCustomChipSet;(Re instanceof Set?Array.from(Re):[]).slice().sort().join("\0")!==_e.slice().sort().join("\0")&&(G=!0,Z.data=f(g(g({},t.data),Z.data),{selectedCustomChipSet:new Set(_e)})),G&&e.update(Xe=>f(g(g({},Xe),Z),{appState:g(g({},Xe.appState),Z.appState),featureState:g(g({},Xe.featureState),Z.featureState),uiState:g(g({},Xe.uiState),Z.uiState),data:g(g({},Xe.data),Z.data)}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService updateComputedProperties:",t)}}computeIsKnownUser(e){try{let t=e.appState?.user;return!!(t&&!t.isReadOnly&&!t.isAnonymous)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsKnownUser:",t),!1}}computeDialogSelectedByKnownUser(e,t){try{return t&&!!e.appState?.user}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeDialogSelectedByKnownUser:",a),!1}}computeCanResolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type!=="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanResolveAnnotation:",a),!1}}computeCanUnresolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type==="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanUnresolveAnnotation:",a),!1}}computeIsPrivateComment(e){try{return sr(e.data?.annotation)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsPrivateComment:",t),!1}}computeShowGhostCommentMessage(e){try{let t=e.data?.ghostComment,a=e.featureState?.enableGhostCommentsMessage,i=e.data?.annotation,c=e.featureState?.commentAcceptedStatus,m=e.featureState?.commentRejectedStatus;return!!(t&&a&&![c?.id,m?.id].includes(i?.status?.id))}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeShowGhostCommentMessage:",t),!1}}computeRepliesUniqueUsers(e){try{let t=e.data?.annotation;if(!t?.comments||t.comments.length<=1)return[];let a=t.comments.slice(1).map(m=>m?.from).filter(m=>m);return this.getUniqueUsers(a).map(m=>m?.userId&&this.usersService.getUserById(m.userId)||m).filter(m=>m)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeRepliesUniqueUsers:",t),[]}}getUniqueUsers(e){try{let t=new Map;return e.forEach(a=>{a?.userId&&!t.has(a.userId)&&t.set(a.userId,a)}),Array.from(t.values())}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getUniqueUsers:",t),[]}}computeShowSuggestionModeActions(e,t){try{let a=e.data?.annotation;if(a?.type==="suggestion"&&!!a?.suggestion&&a.suggestion.status==="pending"&&t)return!0;let c=e.featureState?.suggestionMode,m=!!a?.comments?.length,h=a?.status?.type!=="terminal";return!!(c&&t&&h&&m)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeShowSuggestionModeActions:",a),!1}}computeHasReactionsByCommentId(e){try{let t={},a=e.data?.annotation;return a?.comments&&Array.isArray(a.comments)&&a.comments.forEach(i=>{i?.commentId&&(t[i.commentId]=i?.reactionAnnotationIds?.length>0)}),t}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeHasReactionsByCommentId:",t),{}}}computeUnreadStatus(e){try{let t=e.data?.annotation,a=e.appState?.user;return!t||!a?.userSnippylyId?void 0:!t?.viewedByUserIds?.includes(a.userSnippylyId)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeUnreadStatus:",t);return}}computeCurrentDialogView(e){try{let t=e(),a=t.data?.annotation,i=a?.annotationId,c=t.appState?.user?.userId,m=a?.from?.userId,h={};if(i&&this.currentCommentViews){let S=this.currentCommentViews?.[i]?.comments;Object.keys(S||{}).forEach(z=>{let $=[],G=0;Object.keys(S[z]?.views||{}).forEach(Z=>{let ae={};ae.user=this.currentUserContactsBySnippylyId?.[Z],ae.viewedAt=S[z]?.views?.[Z]?.timestamp,ae.user?.userId!==c&&ae.user?.userId!==m&&($.push(ae),(ae.user?.email||ae.user?.name)&&G++)}),h[z]={count:G,views:$}})}let _=JSON.stringify(t.data?.currentDialogView||{}),I=JSON.stringify(h);_!==I&&e.update(S=>f(g({},S),{data:f(g({},S.data),{currentDialogView:h})}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeCurrentDialogView:",t)}}findParentAnnotationId(e,t=20){try{let a=e.nativeElement.parentElement,i=0;for(;a&&i<t;){if(a.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let m=a.getAttribute("annotation-id");if(m)return m;let h=a.__veltContext;if(h?.annotationId)return h.annotationId;let _=a.__ngContext__;if(_&&Array.isArray(_))for(let I=0;I<_.length;I++){let S=_[I];if(S&&typeof S=="object"&&S.annotationId)return S.annotationId}}a=a.parentElement,i++}return""}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService findParentAnnotationId:",a),""}}};o.TEMP_ID_PREFIX="TEMP_COMPOSER_",o.\u0275fac=function(t){return new(t||o)(be(ie),be(ot),be(Dr),be(Ob),be(N),be(fr),be(Dt),be($t),be(Et),be(ut),be(Ne))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var fn=(()=>{let o=class o{constructor(e){this.loggingService=e,this.subscribers=new Set}register(e){try{if(this.subscribers.add(e),this.lastPayload)try{e(this.lastPayload)}catch(t){this.loggingService.catch("[REGISTRY] Error initializing subscriber:",t)}}catch(t){this.loggingService.catch("[REGISTRY] Error in register:",t)}}unregister(e){try{this.subscribers.delete(e)}catch(t){this.loggingService.catch("[REGISTRY] Error in unregister:",t)}}broadcast(e){try{this.lastPayload=e;let t=0,a=0;this.subscribers.forEach((i,c)=>{try{i(e),t++}catch(m){a++,this.loggingService.catch(`[REGISTRY] Error in subscriber #${t+a}:`,m)}})}catch(t){this.loggingService.catch("[REGISTRY] Error in broadcast:",t)}}getLastPayload(){try{return this.lastPayload}catch(e){this.loggingService.catch("[REGISTRY] Error in getLastPayload:",e);return}}};o.\u0275fac=function(t){return new(t||o)(be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac});let r=o;return r})();var Zg=new WeakMap;function Vc(r){try{if(!r)return;let o=Zg.get(r);o&&o()}catch{}}function zy(r,o,n){if(r)return r;if(o)return o;try{return n()||void 0}catch{return}}function Wy(r,o){return r&&r!==o?{nextCachedId:r,annotationChanged:!0}:{nextCachedId:o,annotationChanged:!1}}var te=(()=>{let o=class o extends At{getCachedAnnotationId(){return this._annotationId}setCachedAnnotationId(e){this._annotationId=e}set parentLocalUIState(e){e&&(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1)}get elementRef(){return this.hostElementRef}flushChangeDetection(){this.runScopedFlush();try{(typeof requestAnimationFrame<"u"?requestAnimationFrame:t=>setTimeout(()=>t(0),16))(()=>this.runScopedFlush())}catch{}}runScopedFlush(){try{let e=this.localUIStateSignal?Zg.get(this.localUIStateSignal):void 0;e?e():this.cd.detectChanges()}catch{try{this.cd.markForCheck()}catch{}}}constructor(){let e=se(me),t=se(Et),a=se(ar),i=se(ie,{optional:!0}),c=se(D),m=se(N);super(e,t,a,i??void 0,void 0,c,m),this.annotationId=q(),this.inlineCommentSectionMode=q(!1,{transform:h=>{try{return typeof h=="string"?h==="true"||h==="":h}catch{return!1}}}),this.defaultCondition=q(!0,{transform:h=>{try{return typeof h=="string"?h==="true"||h==="":h}catch{return!0}}}),this._contextData={},this.isLocalUIStateOwner=!1,this.isContextInitialized=!1,this.registryCheckAttempts=0,this.MAX_REGISTRY_CHECK_ATTEMPTS=50,this.composerDraft=L(()=>{try{let h=this.componentConfigSignal()?.data?.annotation?.annotationId||this._annotationId;if(!h)return null;let _=this.coreService.getOrCreateComposerDraft(h)();return Kg(_)?null:_}catch{return null}}),this.onContextPayload=h=>{try{this.isContextInitialized||(this.isContextInitialized=!0),this._annotationId=h.annotationId,this._contextData=h.contextData||{};let _=this.coreService.getContextConfig(h.annotationId);if(_){if(this.componentConfigSignal.update(I=>g({},I)),this.componentConfigSignal=_,this.isLocalUIStateOwner){let I=this._contextData["comment-pin-selected"],S=I==="true"||I==="",z=this._contextData["full-expanded"],$=z==="true"||z==="",G=S||$,Z=this._contextData["inline-comment-section-mode"],ae=Z==="true"||Z==="";this.localUIStateSignal.update(pe=>f(g({},pe),{commentPinSelected:S,fullExpanded:$,commentDialogSelected:G})),_.update(pe=>f(g({},pe),{featureState:f(g({},pe.featureState),{inlineCommentSectionMode:ae||pe.featureState.inlineCommentSectionMode,fullExpanded:$})}))}this.coreService.recomputeDerivedProperties(h.annotationId),this.cd.markForCheck()}}catch(_){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent onContextPayload:",_)}},this.hostElementRef=e,this.themeService=t,this.dynamicDataService=c,this.loggingService=m,this.coreService=se(lo),this.actionService=se(Hv),this.cd=a,this.commentService=i??void 0,this.registry=se(fn,{optional:!0})??void 0,this.initializeLocalUIState()}initializeLocalUIState(){try{let e=se(Yg,{optional:!0,skipSelf:!0});e?(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1):(this.localUIStateSignal=Fe(zu()),this.isLocalUIStateOwner=!0)}catch{this.localUIStateSignal=Fe(zu()),this.isLocalUIStateOwner=!0}}ngOnInit(){try{super.ngOnInit(),this.isLocalUIStateOwner&&this.localUIStateSignal&&Zg.set(this.localUIStateSignal,()=>{try{this.cd.detectChanges()}catch{}});let e=this.annotationId();if(!e){let a=this.hostElementRef?.nativeElement?.getAttribute?.("annotation-id");a&&(e=a)}if(this.componentConfigSignal&&this.componentConfigSignal()&&Object.keys(this.componentConfigSignal()).length>0){this.initializeFromConfigSignal(this.componentConfigSignal),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(e){this._annotationId=e,this.initializeFromAnnotationId(e),this.setupA11yAttributes(),this.setupDarkModeSync();return}let t=this.findNearestParentWrapperRegistry();if(t){this.registry=t,this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(this.registry){this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}this.tryRegisterWithContext(),this.setupA11yAttributes(),this.setupDarkModeSync()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnInit:",e)}}ngOnChanges(e){try{super.ngOnChanges(e);let t=e.componentConfigSignal;t&&!t.firstChange&&this.refreshAnnotationContextFromSignal()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnChanges:",t)}}refreshAnnotationContextFromSignal(){try{let e=ig(()=>this.componentConfigSignal?.()?.data?.annotation?.annotationId),{nextCachedId:t,annotationChanged:a}=Wy(e,this._annotationId);if(a){let i=this._annotationId;this._annotationId=t,this.onAnnotationContextChanged(i,t),this.cd?.markForCheck()}}catch(e){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent refreshAnnotationContextFromSignal:",e)}}onAnnotationContextChanged(e,t){}ngOnDestroy(){try{this.registryCheckTimer&&(clearTimeout(this.registryCheckTimer),this.registryCheckTimer=void 0),this.registry&&this.registry.unregister(this.onContextPayload),this.darkModeConfigSyncSubscription&&this.darkModeConfigSyncSubscription.unsubscribe(),this.isLocalUIStateOwner&&this.localUIStateSignal&&Zg.delete(this.localUIStateSignal),super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnDestroy:",e)}}setupA11yAttributes(){}setupDarkModeSync(){try{this.darkModeConfigSyncSubscription=this.onDarkModeChange().subscribe(e=>{try{if(this.componentConfigSignal&&typeof this.componentConfigSignal=="function"){let t=this.componentConfigSignal();t&&t.uiState&&t.uiState.darkMode!==e&&this.componentConfigSignal.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{darkMode:e})}))}}catch(t){this.loggingService.catch("Error in darkMode sync subscription:",t)}})}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent setupDarkModeSync:",e)}}findNearestParentWrapperRegistry(){try{let e=this.hostElementRef?.nativeElement;if(!e)return;let t=e.parentElement;for(;t;){if(t.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let a=t.__veltContext;if(a?.registry instanceof fn)return a.contextData&&(this._contextData=a.contextData),a.registry;let i=window.ng;if(i?.getComponent){let m=i.getComponent(t);if(m?.registry)return m.registry}let c=t.__ngContext__;if(c&&Array.isArray(c))for(let m=0;m<c.length;m++){let h=c[m];if(h&&typeof h=="object"&&h.registry instanceof fn)return h.registry}}t=t.parentElement}}catch(e){this.loggingService.catch("[PRIMITIVE BASE] Error finding parent wrapper registry:",e)}}tryRegisterWithContext(){try{let e=this.coreService.findParentAnnotationId(this.hostElementRef);if(!e){this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS&&(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10));return}this.registry=this.coreService.getRegistry(e),this.registry?this.registry.register(this.onContextPayload):this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS?(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10)):this.initializeFromDOM(e)}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent tryRegisterWithContext:",e)}}getContextValue(e){try{let t=this._contextData[e];if(t!=null)return t;let a=this.hostElementRef?.nativeElement?.getAttribute(e);return a!==null?a:void 0}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextValue:",t);return}}getContextCommentId(){try{let e=this.getContextValue("comment-id");if(e==null)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextCommentId:",e);return}}getAnnotationId(){try{return zy(this.componentConfigSignal()?.data?.annotation?.annotationId,this._annotationId,()=>this.coreService.findParentAnnotationId(this.hostElementRef))}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getAnnotationId:",e);return}}initializeFromDOM(e){try{this._annotationId=e;let t=this.coreService.getContextConfig(e);t&&(this.componentConfigSignal.update(a=>g({},a)),this.componentConfigSignal=t,this.isContextInitialized=!0,this.cd.markForCheck())}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromDOM:",t)}}initializeFromAnnotationId(e){try{this._annotationId=e;let t=this.coreService.getOrCreateContextConfig(e);this.componentConfigSignal.update(S=>g({},S)),this.componentConfigSignal=t,this.isContextInitialized=!0;let a=!1,i=!1,c=this.hostElementRef?.nativeElement?.getAttribute?.("comment-pin-selected");(c==="true"||c==="")&&(a=!0);let m=this.hostElementRef?.nativeElement?.getAttribute?.("full-expanded");(m==="true"||m==="")&&(i=!0);let h=a||i,_=t(),I=this.inlineCommentSectionMode();t.set(f(g({},_),{featureState:f(g({},_.featureState),{inlineCommentSectionMode:I!==!1?I:_.featureState.inlineCommentSectionMode,fullExpanded:i})})),this.isLocalUIStateOwner&&this.localUIStateSignal.update(S=>f(g({},S),{commentPinSelected:a,fullExpanded:i,commentDialogSelected:h})),this.coreService.recomputeDerivedProperties(e),this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromAnnotationId:",t)}}initializeFromConfigSignal(e){try{let a=e().data?.annotation?.annotationId;a&&(this._annotationId=a),this.isContextInitialized=!0,this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromConfigSignal:",t)}}veltEmit(e){return typeof CustomEvent<"u"&&e instanceof CustomEvent?e.detail:e}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["app-comment-dialog-primitive-themed-base"]],inputs:{annotationId:[1,"annotationId"],inlineCommentSectionMode:[1,"inlineCommentSectionMode"],defaultCondition:[1,"defaultCondition"],parentLocalUIState:"parentLocalUIState"},standalone:!1,features:[M,tt],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();function tf(r,o){try{let n=r??[];if(n.some(a=>a.startsWith("organizationPrivate:")))return it.ORGANIZATION_PRIVATE;let e=X.VISIBILITY_SELF_PREFIX,t=n.filter(a=>a.startsWith(e));if(t.length>0){if(t.length===1&&o?.userId){let a=new Set(t.map(c=>c.substring(e.length))),i=mr(o.userId).toString();if(a.has(i))return it.RESTRICTED_SELF}return it.RESTRICTED_SELECTED_PEOPLE}return it.PUBLIC}catch{return it.PUBLIC}}function Wu(r,o){try{let n=r??[],e=X.VISIBILITY_SELF_PREFIX,t=n.filter(m=>m.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(m=>m.substring(e.length))),i=o??[],c=[];for(let m of i)if(m?.userId){let h=mr(m.userId).toString();a.has(h)&&c.push(m)}return c}catch{return[]}}function Jy(r,o,n){try{let e=r?.visibilityConfig?.type==="restricted"?r?.visibilityConfig?.userIds:void 0;return e&&e.length>0?nf(e,n):Wu(o,n)}catch{return[]}}function vo(r,o){try{let n=r??[],e="organizationPrivate:",t=n.filter(i=>i.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(i=>i.substring(e.length)));return(o??[]).filter(i=>i?.id&&a.has(Uv(i.id)))}catch{return[]}}function rf(r){try{let o=r?.privateModeEnabled,n=r?.privateModeType;if(!o||!n)return it.PUBLIC;switch(n){case"organizationPrivate":return it.ORGANIZATION_PRIVATE;case"restricted":{let e=r?.privateModeUserIds;return e&&e.length>0?it.RESTRICTED_SELECTED_PEOPLE:it.RESTRICTED_SELF}default:return it.PUBLIC}}catch{return it.PUBLIC}}function nf(r,o){try{let n=r??[];if(n.length===0)return[];let e=o??[],t=new Set(n),a=e.filter(c=>t.has(c?.userId)),i=new Set(a.map(c=>c.userId));for(let c of n)i.has(c)||a.push({userId:c});return a}catch{return[]}}function Tr(r){try{let n=r?.data?.annotation?.context?.accessFields??[];return n.length>0?tf(n,r?.appState?.user):rf(r?.featureState)}catch{return it.PUBLIC}}function Cn(r,o,n){try{return r&&r.length>0?r:$c(o,n).users}catch{return[]}}function $c(r,o){try{let n=r?.data?.annotation,e=n?.context?.accessFields??[];if(e.length>0){let i=tf(e,r?.appState?.user),c=i===it.RESTRICTED_SELECTED_PEOPLE?Jy(n,e,o):[];return{visibility:i,users:c}}let t=rf(r?.featureState),a=t===it.RESTRICTED_SELECTED_PEOPLE?nf(r?.featureState?.privateModeUserIds,o):[];return{visibility:t,users:a}}catch{return{visibility:it.PUBLIC,users:[]}}}var Hv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z,$,G,Z,ae,pe){this.commentActionsService=e,this.commentService=t,this.domService=a,this.coreService=i,this.customFilterService=c,this.loggingService=m,this.analyticsService=h,this.commentTextPortalService=_,this.serviceBook=I,this.domSanitizer=S,this.contactService=z,this.authService=$,this.docService=G,this.targetRegistry=Z,this.suggestionActions=ae,this.commonDbService=pe,this.viewsService=null,this.inFlightSubmits=new Set,this.serviceBook.observe(Do).subscribe(Se=>{this.viewsService=Se??null})}isSubmitInFlight(e){return!!e&&this.inFlightSubmits.has(e)}get timestamp(){return this.commonDbService.getServerTimestamp()}deleteComment(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),m=t;t||(m=c.data?.annotation?.comments?.length?c.data?.annotation?.comments[0]:null),this.commentActionsService.deleteComment({annotationId:e,commentId:m?.commentId,skipDeleteThreadConfirmation:a}),m?.commentId&&this.clearEditDraftFromSession(e,m.commentId)}catch(i){this.loggingService.catch("Error in CommentDialogActionService deleteComment:",i)}}changeCommentStatus(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:t.status})}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeCommentStatus:",a)}}changeStatus(e,t){try{this.changeCommentStatus(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeStatus:",a)}}openAllComments(e){try{if(!this.coreService.getContextConfig(e))return;this.commentService.onSidebarButtonOnCommentDialogClick(),this.commentService.setSidebarVisibility(!0),(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR))?.hasAttribute(X.ATTRIBUTES.EMBED_MODE)&&this.commentService.openSidebar()}catch(t){this.loggingService.catch("Error in CommentDialogActionService openAllComments:",t)}}copyLink(e){return Pe(this,null,function*(){try{return this.coreService.getContextConfig(e)?!!(yield this.commentActionsService.copyLink({annotationId:e})):!1}catch(t){return this.loggingService.catch("Error in CommentDialogActionService copyLink:",t),!1}})}approveComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t().data?.annotation&&this.commentActionsService.approveCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService approveComment:",t)}}closeAssignToMenu(e,t){try{let a=t?this.coreService.getLocalUIState(t):void 0;a&&a.update(i=>f(g({},i),{assignToMenuOpened:!1}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService closeAssignToMenu:",a)}}assignCommentToUser(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i().data?.annotation&&(this.commentActionsService.assignUser({annotationId:e,assignedTo:t}),this.closeAssignToMenu(e,a))}catch(i){this.loggingService.catch("Error in CommentDialogActionService assignCommentToUser:",i)}}closeDialog(){try{this.domService.resetSelectedAnnotationsMap()}catch(e){this.loggingService.catch("Error in CommentDialogActionService closeDialog:",e)}}toggleHideReply(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(t.update(c=>(c.uiState.showReplies=!1,c.uiState.collapsedComments=!0,c.uiState.showAllComments=!1,c)),this.coreService.recomputeDerivedProperties(e),i)if(a.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,"sidebarShowReplies");else{let c=i.multiThreadAnnotationId||a.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,void 0,void 0,c)}}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleHideReply:",t)}}toggleFormatToolbar(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{formatToolbarOpen:!a.uiState?.formatToolbarOpen})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleFormatToolbar:",t)}}showReplyComposer(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{showReplyComposer:!0})})),setTimeout(()=>this.focusOnComposerInput(e),100)}catch(t){this.loggingService.catch("Error in CommentDialogActionService showReplyComposer:",t)}}onMoreRepliesClick(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:e,commentType:this.commentService.getCommentType(a.data?.annotation),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),t.update(i=>{let c=!i.uiState.showAllComments;return i.uiState.showAllComments=c,i.uiState.collapsedComments=!c,i})}catch(t){this.loggingService.catch("Error in CommentDialogActionService onMoreRepliesClick:",t)}}navigateToComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return null;let i=t().data?.annotation;return i?(this.commentService.onCommentNavigationButtonClick(i),i):null}catch(t){return this.loggingService.catch("Error in CommentDialogActionService navigateToComment:",t),null}}onInboxModeChange(e,t){try{if(t){let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:!0,collapsedComments:!1})}))}}catch(a){this.loggingService.catch("Error in CommentDialogActionService onInboxModeChange:",a)}}onSignInClick(){try{this.commentService.onSignInClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onSignInClick:",e)}}onUpgradeClick(){try{this.commentService.onUpgradeClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onUpgradeClick:",e)}}resolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: resolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.resolvedStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService resolveComment:",a)}}unresolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: unresolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.defaultStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService unresolveComment:",a)}}toggleShowReplies(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return{openFocusedThread:!1,annotation:null};let i=a(),c=i.data?.annotation;if(c){if(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:c.annotationId,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),i.featureState?.isFocusedThreadEnabled&&i.featureState?.openAnnotationInFocusMode)return{openFocusedThread:!0,annotation:c};if(a.update(m=>{let h=t!==void 0?t:!m.uiState.showReplies;return f(g({},m),{uiState:f(g({},m.uiState),{showReplies:h,collapsedComments:!1,showAllComments:!0,commentDialogSelected:h})})}),this.coreService.recomputeDerivedProperties(e),!i.uiState?.commentPinSelected)if(i.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,"sidebarShowReplies");else{let m=c.multiThreadAnnotationId||i.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,void 0,void 0,m)}}return{openFocusedThread:!1,annotation:null}}catch(a){return this.loggingService.catch("Error in CommentDialogActionService toggleShowReplies:",a),{openFocusedThread:!1,annotation:null}}}acceptCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentTextPortalService.onAcceptComment(i),this.commentActionsService.acceptCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptCommentAnnotation:",t)}}acceptSuggestion(e){return Pe(this,null,function*(){try{this.commentActionsService.acceptSuggestion({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptSuggestion:",t)}})}rejectSuggestion(e,t){return Pe(this,null,function*(){try{this.commentActionsService.rejectSuggestion({annotationId:e,reason:t})}catch(a){this.loggingService.catch("Error in CommentDialogActionService rejectSuggestion:",a)}})}deleteSuggestionThread(e){return Pe(this,null,function*(){try{if(!e)return;yield this.commentActionsService.deleteCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService deleteSuggestionThread:",t)}})}openSuggestionComment(e){try{if(!e)return;this.commentService.scrollToCommentByAnnotationId(e),this.commentService.selectCommentByAnnotationId(e)}catch(t){this.loggingService.catch("Error in CommentDialogActionService openSuggestionComment:",t)}}rejectCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentActionsService.rejectCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService rejectCommentAnnotation:",t)}}deleteAttachment(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;let m=c(),h=i?this.coreService.getLocalUIState(i):void 0,_=h?.()?.editComment,I=null;if(a?I=_?.attachments?.[t]:I=h?.()?.selectedAttachments?.[t],I?.attachmentId){let S=_?m.uiState?.editCommentTextArea?.nativeElement:m.uiState?.newCommentTextArea?.nativeElement;S&&this.removeAttachmentTag(e,I.attachmentId,S,i)}if(a&&h){let S=h()?.editComment;if(S?.attachments){let z=[...S.attachments],$=z.splice(t,1);h.update(G=>f(g({},G),{editComment:f(g({},G.editComment),{attachments:z}),attachmentsToDelete:[...G.attachmentsToDelete||[],...$]}))}}else if(h){let z=h()?.selectedFiles?.[t];if(z?.url)try{URL.revokeObjectURL(z.url)}catch{}h.update($=>{let G=$.selectedFiles?[...$.selectedFiles.slice(0,t),...$.selectedFiles.slice(t+1)]:[],Z=$.selectedAttachments?[...$.selectedAttachments.slice(0,t),...$.selectedAttachments.slice(t+1)]:[];return f(g({},$),{selectedFiles:G,selectedAttachments:Z})})}if(!a){let z=this.coreService.getOrCreateComposerDraft(e)();if(z.selectedFiles?.length||z.selectedAttachments?.length){let $=z.selectedFiles?.[t];if($?.url)try{URL.revokeObjectURL($.url)}catch{}this.coreService.setComposerDraftAttachments(e,{selectedFiles:(z.selectedFiles||[]).filter((G,Z)=>Z!==t),selectedAttachments:(z.selectedAttachments||[]).filter((G,Z)=>Z!==t)}),Vc(h)}}!a&&I&&this.deleteAttachments(e,[I]),this.checkGetAnnotationDraftAttribute(e,i)}catch(c){this.loggingService.catch("Error in CommentDialogActionService deleteAttachment:",c)}}removeInvalidFile(e,t,a){try{let c=this.coreService.getOrCreateComposerDraft(e)(),m=!1;if(c.invalidSelectedFiles?.length&&t>=0&&t<c.invalidSelectedFiles.length){let I=c.invalidSelectedFiles[t];if(I?.url)try{URL.revokeObjectURL(I.url)}catch{}this.coreService.setComposerDraftAttachments(e,{invalidSelectedFiles:c.invalidSelectedFiles.filter((S,z)=>z!==t)}),m=!0}let h=a?this.coreService.getLocalUIState(a):void 0;if(!h)return;let _=h();if(_?.invalidSelectedFiles&&_.invalidSelectedFiles.length>t){let I=[..._.invalidSelectedFiles.slice(0,t),..._.invalidSelectedFiles.slice(t+1)];this.loggingService.log(`Invalid file removed at index ${t} for annotation ${e}. Remaining: ${I.length}`),h.update(S=>f(g({},S),{invalidSelectedFiles:I}))}else m||this.loggingService.catch(`Cannot remove invalid file: Index ${t} out of bounds for annotation ${e}`,new Error("Index out of bounds"))}catch(i){this.loggingService.catch("Error in CommentDialogActionService removeInvalidFile:",i)}}setAssignTo(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>{let c=i.featureState?.assignToType==="checkbox"?!0:i.data?.isAssignedCheckbox;return f(g({},i),{data:f(g({},i.data),{assignTo:t,isAssignedCheckbox:c})})})}catch(a){this.loggingService.catch("Error in CommentDialogActionService setAssignTo:",a)}}toggleAssignToCheckbox(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{data:f(g({},a.data),{isAssignedCheckbox:!a.data?.isAssignedCheckbox})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleAssignToCheckbox:",t)}}onDeleteRecorderAnnotation(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=a?this.coreService.getLocalUIState(a):void 0;c&&c.update(I=>f(g({},I),{localRecordedData:(I.localRecordedData||[]).filter(S=>S.id!==t.annotationId)}));let m=c?.()?.editComment,_=i().data?.annotation;m?.commentId&&_?.annotationId&&this.commentActionsService.deleteRecording({annotationId:_.annotationId,commentId:m.commentId,recorderId:t.annotationId})}catch(i){this.loggingService.catch("Error in CommentDialogActionService onDeleteRecorderAnnotation:",i)}}onRecordedData(e,t,a){try{let i=a?this.coreService.getLocalUIState(a):void 0;i&&(i.update(c=>f(g({},c),{localRecordedData:[...c.localRecordedData||[],t]})),Vc(i)),this.domService.setRecordingInProgress(e,!1),this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService onRecordedData:",i)}}addFiles(e,t,a){return Pe(this,null,function*(){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot add files: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot add files: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_BUTTON_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()});let h=a?this.coreService.getLocalUIState(a):void 0,_=[],I=[];if(t.length)for(let z=0;z<t.length;z++){let $=t[z],G=URL.createObjectURL($),Z=this.domSanitizer.bypassSecurityTrustUrl(G),ae=this.commentActionsService.validateFile($);if(ae.valid){let pe=$?.type,Se={file:$,url:$?.type?.includes("svg")?Z:G,fileType:pe};_.push(Se),h&&h.update(oe=>f(g({},oe),{selectedFiles:[...oe.selectedFiles||[],Se]}))}else{let pe={file:$,url:G,errorMessage:ae?.maxAllowedSizeInMB?`Size > ${ae?.maxAllowedSizeInMB}MB`:"Size > 15MB"};I.push(pe),h&&h.update(Se=>f(g({},Se),{invalidSelectedFiles:[...Se.invalidSelectedFiles||[],pe]})),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_SIZE_EXCEEDED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentSize:$.size,attachmentType:$.type})}}if(i.update(z=>f(g({},z),{uiState:f(g({},z.uiState),{uploadingAttachments:!0})})),Vc(h),this.coreService.isStandaloneComposerOwner(a)){let z=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedFiles:[...z.selectedFiles||[],..._],invalidSelectedFiles:[...z.invalidSelectedFiles||[],...I]})}let S=yield this.uploadFiles(e,a);if(h&&h.update(z=>f(g({},z),{selectedAttachments:[...z.selectedAttachments||[],...S]})),i.update(z=>f(g({},z),{uiState:f(g({},z.uiState),{uploadingAttachments:!1})})),Vc(h),this.coreService.isStandaloneComposerOwner(a)){let z=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedAttachments:[...z.selectedAttachments||[],...S||[]]})}this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService addFiles:",i);let c=this.coreService.getContextConfig(e);c&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{uploadingAttachments:!1})}))}})}uploadFiles(e,t){return Pe(this,null,function*(){try{let a=this.coreService.getContextConfig(e);if(!a)return[];let i=a(),c=i.data?.annotation,m=t?this.coreService.getLocalUIState(t):void 0,h=m?.()?.selectedFiles||[];if(!c||!h.length)return[];let _=[],I=(S,z)=>{m&&m.update($=>f(g({},$),{selectedFiles:$.selectedFiles?.map((G,Z)=>Z===S?g(g({},G),z):G)}))};for(let S=0;S<h.length;S++){let z=h[S];if(!z.uploaded&&!z.uploading){I(S,{uploading:!0});let $=z.file;try{let[G]=yield this.commentActionsService.addAttachment({annotationId:c.annotationId,files:[$]},"internal"),Z=G?.attachment;if(Z){this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_ADDED,{annotationId:c.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:Z.attachmentId,attachmentSize:Z.size,attachmentType:Z.type}),_.push(Z);let ae=a(),pe=ae.uiState?.editCommentTextArea?.nativeElement||ae.uiState?.newCommentTextArea?.nativeElement;pe&&ae.uiState?.attachmentNameInMessage&&setTimeout(()=>{this.focusOnComposerInput(e,!0),this.insertAttachmentTag(e,pe,Z,t)},100)}I(S,{uploaded:!0,uploading:!1})}catch(G){this.loggingService.catch("Error uploading individual file:",G),I(S,{uploading:!1})}}}return _}catch(a){return this.loggingService.catch("Error in CommentDialogActionService uploadFiles:",a),[]}})}startRecording(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot start recording: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot start recording: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_RECORDING_TOOL_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),recorderType:t});let h=m?.metadata?.clientDocumentId,_=c.uiState?.commentDialogUniqueId,I=c.uiState?.darkMode,S=c.uiState?.dialogShadowDOM;this.serviceBook.get(ln)?.initRecording(t,a??_,!0,I,S,m.annotationId,h),setTimeout(()=>{this.checkGetAnnotationDraftAttribute(e,a)},100)}catch(i){this.loggingService.catch("Error in CommentDialogActionService startRecording:",i)}}checkGetAnnotationDraftAttribute(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),m=(t?this.coreService.getLocalUIState(t):void 0)?.(),h=m?.composerContent,_=h&&h!==`
1
+ import{C as Gu}from"./chunk-AAZAJXGE.js";import{a as Hb}from"./chunk-TYMRWTZD.js";import{a as Wb}from"./chunk-TH6YKCXO.js";import{a as Mh,b as Ah,c as Lg,d as Bg}from"./chunk-TCAK4M4C.js";import{a as Vg}from"./chunk-35J3HFXX.js";import"./chunk-G35OSTOG.js";import"./chunk-MWSODQ6X.js";import{b as yh,c as wh,d as Ih}from"./chunk-RFCFKIUM.js";import{a as Yr}from"./chunk-MMLFNU6G.js";import{b as zb}from"./chunk-WD2ZEHH2.js";import{a as pg,c as Bh,d as Vh}from"./chunk-7YVQR4BL.js";import{a as hn}from"./chunk-WDA4SVMN.js";import{a as no}from"./chunk-XA2U66CN.js";import{a as Sb,b as ro,c as Fb,d as Pg,e as Nb,f as Rb,g as Cr,h as Fg,i as Ub,j as Ng,k as pn,n as Rg,o as Lb,p as Bb,q as $v,r as Vb,s as $b,t as Gb}from"./chunk-Z67AKZUH.js";import"./chunk-HCYE7VHY.js";import{b as sg,c as gg,g as ug,l as Rh,m as Uh,r as Lh,s as jh,w as Hh,x as Pt}from"./chunk-DJYRZD7H.js";import{a as Ug}from"./chunk-XK65RTYQ.js";import{a as Wt}from"./chunk-NTNPNLFT.js";import{a as mt,b as qt}from"./chunk-BYJ7FNFA.js";import{A as P,B as F,a as Og,b as Eg,u as Ab,y as Pb,z as Ag}from"./chunk-PFRELWAV.js";import{a as Be,b as Mg}from"./chunk-SZKZ3DG3.js";import{a as Mb,b as W,c as Jr,d as Ut}from"./chunk-SJ45VMIG.js";import{a as jb}from"./chunk-2XFMMSIA.js";import{a as Dr}from"./chunk-B4IA4XDT.js";import{a as Ph}from"./chunk-MNSD5X74.js";import{A as nn,F as Oh,G as gt,H as bt,I as Eh,Y as $h,ba as Gh,ca as $t,da as D,ea as Et,f as dg,fa as xe,ga as At,j as _h,m as Fv,n as vg,p as Sh,r as cg,s as Dh,t as mg,v as Th}from"./chunk-RU3S5WM7.js";import{$ as et,$b as rn,$f as un,A as rh,Aa as Ir,Ab as pr,Bb as hr,Bf as wo,Bg as lb,C as nh,Ca as ur,Ce as Ur,Cf as mr,Cg as zr,D as Eu,Db as ft,De as it,Df as xg,Dg as db,E as jt,Ea as Qs,Eb as Ct,Ec as jr,Ed as Fh,Ee as X,Ef as Uv,Fa as d,Fb as kt,Fc as It,Ff as dr,G as yn,Ga as Le,Gb as In,Gc as ge,Gf as Mn,Gi as Eb,Ha as eg,Hb as Mv,Hf as sr,I as Ov,Ia as vh,Ib as we,If as An,Ig as Io,Ih as ln,Ii as to,J as Jn,Jb as at,Jf as Pn,Jg as Rc,Jh as $u,Kb as ue,Ke as fg,Kf as Fu,Kg as Uc,L as gr,Lc as qe,Lf as Yh,M as wn,Ma as tg,Mb as Av,Mf as gn,N as oh,Nb as le,Nc as Pv,Nf as Kh,Nh as Dg,O as ah,Oa as Ev,Ob as je,Oc as sn,Od as Nh,Oe as Yt,Of as zt,Oh as ub,Pa as j,Pb as Ce,Pc as kh,Pe as En,Ph as pb,Q as Zs,Qb as og,Qe as Nt,Qh as hb,R as ih,Ra as ch,Rb as hh,Re as Wh,Rf as Nu,Rh as bb,S as Mu,Se as qn,Sf as on,Sh as fb,T as Me,Ta as mh,Td as Kn,Tf as Zh,Th as Cb,Ua as T,Ud as Zn,Uf as Xh,Uh as kb,Va as sh,Vf as qh,Vh as Tg,W as Ac,Wa as gh,Wd as Au,Wf as Qh,Wh as Bv,Xc as xh,Xd as Ke,Y as Pc,Ya as M,Yb as bh,Yh as xb,Zb as ag,Zd as dt,Ze as Qn,Zf as Nc,Zg as vb,_ as Xs,_a as s,_b as U,_f as _g,_g as cb,_h as Do,a as g,aa as lh,ac as ct,ae as hg,ag as an,ah as wg,b as f,ba as dh,bb as rg,bc as ce,bg as Ru,bh as Lv,bi as fr,ca as be,cc as C,cg as eb,ci as vr,da as se,db as k,dc as fe,di as N,eb as Gr,ec as Je,ef as Cg,eg as tb,ei as Vv,fb as y,fc as O,fg as Sg,fh as ye,g as Pe,gb as w,gc as St,h as Xp,ha as B,hb as uh,hc as Yn,hg as Uu,hh as Ig,hi as _b,i as qp,ia as V,ib as ng,if as Jh,ig as yg,ih as mb,ii as yb,ja as de,jb as rt,jc as Dn,jg as Lu,jh as Wr,k as Gt,ka as xt,kb as nt,kc as A,kg as eo,l as De,la as qs,lb as v,lc as R,lh as Lc,li as Ne,m as Qp,mb as b,mc as Er,mi as ot,nb as x,nc as fh,ni as Mr,o as eh,ob as E,oc as Ch,oe as ke,oh as Bc,oi as wb,p as Wn,pc as Ge,pd as br,pe as bg,pg as rb,q as _n,qa as Fe,qe as On,qg as nb,qi as Xt,r as Ee,rc as ig,rf as Fc,rh as sb,ri as Ib,sb as u,sc as L,se as Hr,sh as Bu,si as Qe,tb as p,tc as yt,te as Nv,th as gb,ti as Db,ua as tt,ub as ze,uc as or,uf as kg,ug as ob,v as Oe,va as Y,vb as J,vc as q,ve as Pu,vg as ab,vh as ne,w as kr,wa as me,wb as ph,wc as Tn,we as lr,wg as ib,wh as Vu,wi as Tb,x as th,xb as H,xc as ar,xe as Rv,ye as zh,yi as ut,z as Sn,zb as l,zc as lg,ze as Xn,zi as Ob}from"./chunk-FXUDI3M6.js";var Dt=(()=>{let o=class o{constructor(e){this.loggingService=e,this._customStatusMap=new De(X.CommentAnnotationStatusMap),this._customPriorityMap=new De(X.CommentAnnotationPriorityMap),this._customCategoryMap=new De(X.CommentCategoryMap);try{let t=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP);t&&this._customPriorityMap.next(JSON.parse(t));let a=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP);a&&this._customStatusMap.next(JSON.parse(a));let i=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP);i&&this._customCategoryMap.next(JSON.parse(i))}catch(t){this.loggingService.catch("Error in CustomFilterService constructor: ",t)}}setCustomStatusFilters(e){try{if(e.length<2){this._customStatusMap.next(X.CommentAnnotationStatusMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(X.CommentAnnotationStatusMap)),this.loggingService.catch("Custom status filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a,a.type||(a.type="ongoing")}),this._customStatusMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomStatusFilters: ",t)}}setCustomPriorityFilters(e){try{if(e.length<2){this._customPriorityMap.next(X.CommentAnnotationPriorityMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(X.CommentAnnotationPriorityMap)),this.loggingService.catch("Custom priority filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a}),this._customPriorityMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomPriorityFilters: ",t)}}setCustomCategories(e){try{let t={};e.forEach(a=>{t[a.id]=a}),this._customCategoryMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomCategories: ",t)}}get customStatusMap$(){return this._customStatusMap.asObservable()}get customPriorityMap$(){return this._customPriorityMap.asObservable()}get customCategoryMap$(){return this._customCategoryMap.asObservable()}get defaultStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="default");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService defaultStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get resolvedStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="terminal");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService resolvedStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get ongoingStatuses(){try{let t=Object.entries(this._customStatusMap.value).filter(([a,i])=>i.type==="ongoing");if(t)return t.map(a=>a[1])}catch(e){this.loggingService.catch("Error in CustomFilterService ongoingStatuses: ",e)}return[X.CommentAnnotationStatusMap.IN_PROGRESS]}get terminalStatuses(){try{return Object.entries(this._customStatusMap.value).filter(([t,a])=>a.type==="terminal").map(t=>t[1])}catch(e){this.loggingService.catch("Error in CustomFilterService terminalStatuses: ",e)}return[]}convertLegacyAnnotationStatus(e){try{if(typeof e.status=="string"||e.status===void 0){let t=Object.entries(this._customStatusMap.value),a=t.find(([i,c])=>c.type==="default");switch(e.status){case"open":a&&(e.status=a[1]);break;case"inProgress":let i=t.find(([m,h])=>h.type==="ongoing");i&&(e.status=i[1]);break;case"resolved":let c=t.find(([m,h])=>h.type==="terminal");c&&(e.status=c[1]);break;default:a&&(e.status=a[1]);break}}return e}catch(t){return this.loggingService.catch("Error in CustomFilterService convertLegacyAnnotation: ",t),e}}convertLegacyPriority(e){try{typeof e.priority=="string"&&(e.priority=X.CommentAnnotationPriorityMap[e.priority])}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyPriority: ",t)}return e}convertLegacyCategory(e){try{if(e.commentCategories===void 0||e.commentCategories===null||!Array.isArray(e.commentCategories)||e.commentCategories.length===0)return e;typeof e.commentCategories[0]=="string"&&(e.commentCategories=e.commentCategories.map(t=>X.CommentCategoryMap[t]))}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyCategory: ",t)}return e}};o.\u0275fac=function(t){return new(t||o)(be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Jb=(()=>{let o=class o{constructor(e,t){this.domService=e,this.loggingService=t,this.keyEventSubject$=new Gt;try{this.loggingService.log("%c[WB] Creating CLASS: HotkeyService","color: blue;"),this.keyEvent$=this.keyEventSubject$.asObservable().pipe(ah()),this.domService.onWindowKeydown$().subscribe(a=>{this.keyEventSubject$.next(a)})}catch(a){this.loggingService.catch("Error in HotkeyService constructor: ",a)}}getKeyPressEvent(e,t={}){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getKeyPressEvent","color: green;"),this.keyEvent$.pipe(jt(a=>a?.key===e),jt(a=>!(!!t?.includeCtrl!==a.ctrlKey||!!t?.includeAlt!==a.altKey||!!t?.includeShift!==a.shiftKey||!!t?.includeMeta!==a.metaKey)),jt(()=>this.isNoInputFocused()))}catch(a){return this.loggingService.catch("Error in HotkeyService getKeyPressEvent: ",a),new qp}}isNoInputFocused(){try{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;for(;e&&e?.tagName!=="BODY";){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e?.isContentEditable)return!1;e=e.parentElement??e.getRootNode()?.host??null}return!0}catch(e){return this.loggingService.catch("Error in HotkeyService isNoInputFocused: ",e),!1}}};o.\u0275fac=function(t){return new(t||o)(be(Ne),be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Iy=["access","accessFields"];function Dy(r){return r?Object.keys(r).length>0:!1}var ie=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z,$,G,Z,ae,pe,Se,oe,he,_e,Re,Ye,lt,Xe){this.analyticsService=e,this.commonDbService=t,this.configService=a,this.docService=i,this.databaseService=c,this.authService=m,this.domService=h,this.afAuth=_,this.avatarService=I,this.contactService=S,this.storageService=z,this.functions=$,this.dialog=G,this.iamService=Z,this.loggingService=ae,this.notificationService=pe,this.customFilterService=Se,this.hotkeyService=oe,this.serviceBook=he,this.buttonService=_e,this.metadataService=Re,this.commonDbUtilsService=Ye,this.attachmentResolverService=lt,this.userPermissionService=Xe,this.endpointsService=se(_b),this.customPinsById=new Map,this.commentAdded$=new Gt,this.commentUpdated$=new Gt,this.commentAccepted$=new Gt,this.commentRejected$=new Gt,this.commentAnnotationDeleted$=new Gt,this.multiThreadCommentAnnotationDeleted$=new Gt,this.commentAnnotationById$=new De(null),this.multiThreadCommentAnnotationById$=new De(null),this.ghostCommentAnnotationMap$=new De({}),this.unreadCommentsMap$=new De(null),this.documentPaths=null,this.user=null,this.customCategoryMap=X.CommentCategoryMap,this.allowedElementIds$=new De([]),this.allowedElementClassNames$=new De([]),this.allowedElementQuerySelectors$=new De([]),this.addCommentMode$=new De(!1),this.persistentCommentMode$=new De(!1),this.seenByUsers$=new De(!0),this.deleteReplyConfirmation$=new De(!1),this.persistentModeBanner$=new De(!0),this.commentAddedEmitter=null,this.commentContextProvider=null,this.textCommentMode$=new De(!0),this.sidebarVisible$=new De(!1),this.sidebarOpenedByCustomTrigger$=new De(!1),this.floatingCommentsEnabled$=new De(!0),this.moderatorMode$=new De(!1),this.streamMode$=new De(!1),this.enableSignInButton$=new De(!1),this.enableUpgradeButton$=new De(!1),this.onSignInClick$=new Gt,this.onUpgradeClick$=new Gt,this.enableAttachment$=new De(!0),this.enableAttachmentDownload$=new De(!0),this.enableReactions$=new De(!0),this.enableAnonymousEmail$=new De(!0),this.enableFormatOptions$=new De(!1),this.formatConfig$=new De({bold:{enable:!0},italic:{enable:!0},underline:{enable:!0},strikethrough:{enable:!0}}),this.allowedRecordings$=new De(["audio","video","screen"]),this.openSidebar$=new Gt,this.showScreenSizeInfo$=new De(!1),this.showCommentIndex$=new De(!1),this.popoverMode$=new De(!1),this.popoverTriangleComponent$=new De(!0),this.draftMode$=new De(!0),this.enableDialogOnHover$=new De(!0),this.enableDialogOnTargetElementClick$=new De(!1),this.enablePriority$=new De(!1),this.enableStatus$=new De(!0),this.visibilityOptions$=new De(!1),this.enableResolve$=new De(!0),this.enableGhostComments$=new De(!1),this.enableGhostCommentsMessage$=new De(!0),this.inboxMode$=new De(!1),this.enableAutoCategorize$=new De(!1),this.commentContainerDarkMode$=new De(!1),this.suggestionMode$=new De(!1),this.mobileMode$=new De(!0),this.inlineCommentMode$=new De(!1),this.minimap$=new De(!1),this.commentsOnDom$=new De(!0),this.commentToolEnabled$=new De(!0),this.totalMediaLength$=new De(0),this.sidebarUrlNavigationEnabled$=new De(!1),this.detectionStrategy$=new De(Pu.DEFAULT),this.sidebarButtonOnCommentDialogVisible$=new De(!1),this.sidebarButtonOnCommentDialogClick$=new Gt,this.commentNavigationButtonClick$=new Gt,this.deviceIndicatorOnCommentPins$=new De(!1),this.sidebarCommentClick$=new Gt,this.privateCommentMode$=new De(!1),this.privateCommentAllowed$=new De(!1),this.privateModeConfig$=new De(null),this.scrollToComment$=new De(!0),this.userMentions$=new De(!0),this.paginatedContactList$=new De(!1),this.deleteOnBackspace$=new De(!0),this.hotkeyEnabled$=new De(!1),this.recordingSummaryEnabled$=new De(!0),this.unreadIndicatorMode$=new De(Rv.MINIMAL),this.composerMode$=new De(zh.DEFAULT),this.enterKeyToSubmit$=new De(!1),this.resolvedCommentsOnDom$=new De(!1),this.bubbleOnPinEnabled$=new De(!1),this.bubbleOnPinHoverEnabled$=new De(!0),this.pinDragEnabled$=new De(!0),this.excludeLocationIdsFromSidebar$=new De([]),this.multiThread$=new De(!1),this.groupMatchedComments$=new De(!1),this.restrictTextSearchToAnchor$=new De(!1),this.shortUserName$=new De(!0),this.collapsedComments$=new De(!1),this.collapsedRepliesPreview$=new De(!1),this.fullExpanded$=new De(!1),this.queryParamsComments$=new De(!1),this.resolveStatusAccessAdminOnly$=new De(!1),this.linkCallback$=new De(!1),this.svgAsImg$=new De(!1),this.commentToNearestAllowedElement$=new De(!1),this.filterCommentsOnDom$=new De(!1),this.maxReplyAvatars$=new De(3),this.replyAvatars$=new De(!1),this.commentplaceholder$=new De(void 0),this.replyplaceholder$=new De(void 0),this.editplaceholder$=new De(void 0),this.editcommentplaceholder$=new De(void 0),this.editreplyplaceholder$=new De(void 0),this.screenshotEnabled$=new De(!1),this.pinShadowDOM$=new De(!0),this.dialogShadowDOM$=new De(!0),this.dialogShadowDOMExplicit$=new De(void 0),this.textCommentToolShadowDOM$=new De(!0),this.pinDarkMode$=new De(null),this.textCommentToolDarkMode$=new De(null),this.textCommentToolbarDarkMode$=new De(null),this.textCommentToolbarShadowDOM$=new De(!0),this.sidebarShadowDOM$=new De(!0),this.changeDetectionInCommentMode$=new De(!1),this.commentSelectionChange$=new Gt,this.visibilityOptionClicked$=new Gt,this.submitComment$=new Gt,this.clearComposer$=new Gt,this.composerDataMap=new Map,this.commentsFromSidebarMap$=new De(null),this.sidebarButtonCountType$=new De("default"),this.filterGhostCommentsInSidebar$=new De(!1),this.commentSidebarFilters$=new De(null),this.effectiveSidebarFilters$=new De({}),this.customSidebarDataAnnotationIds$=new De(null),this.commentSidebarSystemFiltersOperator$=new De(Ur.AND),this.bubbleCommentAnnotationIds$=new De([]),this.updateCommentDialogPositionTriggerSubject$=new De(void 0),this.areaCommentEnabled$=new De(!0),this.commentPinCursorImage$=new De(""),this.commentAnnotationsFromCommentsContainer$=new De([]),this.customChipDropdownData$=new De(null),this.originalCommentAnnotationsByDocumentId$=new De({}),this.draftCommentAnnotationsByAnnotationId$=new De(null),this.draftMultiThreadCommentAnnotationsByAnnotationId$=new De({}),this.pendingAddCommentAnnotationData=new Map,this.copyLink$=new De(""),this.addCommentDragMode=!1,this.dragSubscriptions=[],this.hotkeySubscriptions=[],this.sidebarData$=new De(null),this.sidebarCustomActionEventData$=new De(null),this.sidebarCustomActionEventDataAllChanges$=new De(null),this.sidebarCustomActionEventDataOnInit$=new De(null),this.customActions$=new De(!1),this.focusedThreadMode$=new De(!1),this.openAnnotationInFocusMode$=new De(!1),this.customStatusesShown$=new De(!1),this.readOnly$=new De(!1),this.customAutocompleteSearch$=new De(!1),this.deleteThreadWithFirstComment$=new De(!0),this.assignToType$=new De("dropdown"),this.pageModeComposerContext$=new De(null),this.contextInPageModeComposer$=new De(!1),this.focusPageModeComposer$=new Gt,this.transformContext$=new De(null),this.expandMentionGroups$=new De(!1),this.showMentionGroupsFirst$=new De(!1),this.showMentionGroupsOnly$=new De(!1),this.fullScreenInSidebar$=new De(!1),this.composerFileAttachments$=new De(null),this.attachmentNameInMessage$=new De(!1),this.allowedFileTypes$=new De([]),this.forceCloseAllOnEsc$=new De(!1),this.autoCompleteScrollConfig$=new De({itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350}),this.commentAnnotationContextDraft=null,this.reactionService=null,this.areaService=null,this.viewsService=null,this.getCommentAnnotationForClient=Ve=>{try{let ht=["commentCategories","color","resolved","inProgress","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","position","documentParamsId","documentParams","ghostComment","areaAnnotationId","iam","commentSource","involvedUserIds","mentionedUserIds","viewedByUserIds","views"],Ze=JSON.parse(JSON.stringify(Ve)),Tt={};Object.keys(Ze).forEach(Lt=>{ht.includes(Lt)||(Tt[Lt]=Ze[Lt])}),Tt?.comments?.forEach(Lt=>{let We=[];Lt?.reactionAnnotationIds&&Lt?.reactionAnnotationIds?.forEach(Tu=>{let Ks=this.reactionService?.getAnnotationById(Tu);if(Ks){let Mc=this.reactionService.getReactionAnnotationForClient(Ks);We.push(Mc)}}),Lt.reactionAnnotations=We}),Ze?.viewedByUserIds?.forEach(Lt=>{let We=this.contactService.getUserBySnippylyId(Lt);We&&(Tt.viewedBy||(Tt.viewedBy=[]),Tt.viewedBy.push(We))}),this.user?.userSnippylyId&&(Tt.unread=!Ze?.viewedByUserIds?.includes(this.user.userSnippylyId));let Ue=Ze?.targetElement?.anchor?.fXPath||Ze?.targetElement?.fXpath;return Ue&&(Tt.basicAnchorData={xpath:Ue,topPercentage:Ze?.targetElement?.topPercentage||0,leftPercentage:Ze?.targetElement?.leftPercentage||0}),JSON.parse(JSON.stringify(Tt))}catch{return null}},this.loggingService.log("%c[WB] Creating CLASS: CommentService","color: blue;"),this.serviceBook.set(Dg,this),this.serviceBook.observe(Tg).subscribe(Ve=>{this.reactionService=Ve}),this.serviceBook.observe(xb).subscribe(Ve=>{this.areaService=Ve}),this.serviceBook.observe(Do).subscribe(Ve=>{this.viewsService=Ve}),this.domService.getSelectedAnnotationsMap$().pipe(Ov(100),wn()).subscribe(([Ve,ht])=>{try{if(this.draftCommentAnnotationsByAnnotationId$.value){let Ze=Object.keys(this.draftCommentAnnotationsByAnnotationId$.value||{}),Tt=[];Object.keys(Ve||{}).forEach(Lt=>{!ht?.[Lt]&&Ze.includes(Lt)&&Tt.push(Lt)});let Ue=JSON.parse(JSON.stringify(this.draftCommentAnnotationsByAnnotationId$.value||{}));Tt.forEach(Lt=>{delete Ue[Lt]}),an(Ue,this.draftCommentAnnotationsByAnnotationId$.value)||this.draftCommentAnnotationsByAnnotationId$.next(Ue)}}catch{}}),this.docService.getDocumentPaths$().pipe(wn()).subscribe(([Ve,ht])=>{Ve?.documentId!==ht?.documentId&&this.unreadCommentsMap$.next(null),ht&&this.shouldEnableReadOnly()},Ve=>{this.loggingService.catch("Error in CommentService getDocumentPaths$ subscription: ",Ve)}),this.draftCommentAnnotationsByAnnotationId$.pipe(wn()).subscribe(([Ve,ht])=>{try{if(this.pendingAddCommentAnnotationData.size===0)return;let Ze=Object.keys(Ve||{});if(Ze.length===0)return;let Tt=new Set(Object.keys(ht||{}));Ze.forEach(Ue=>{!Tt.has(Ue)&&this.pendingAddCommentAnnotationData.has(Ue)&&this.pendingAddCommentAnnotationData.delete(Ue)})}catch(Ze){this.loggingService.catch("Error in CommentService pendingAddCommentAnnotationData reconcile: ",Ze)}}),this.authService.getUser$().subscribe(Ve=>{Ve||this.resetCacheData()},Ve=>{this.loggingService.catch("Error in CommentService getUser$ subscription: ",Ve)}),this.authService.getUser$().pipe(Me(Ve=>Ve?kr([this.iamService.isUserAdmin$(),this.contactService.getUserOrganizationContacts$()]).pipe(Oe(([ht,Ze])=>{let Tt=!1;return Ze?.find(Ue=>Ue.userId===Ve?.userId)&&(Tt=!0),{isUserAdmin:ht,isOrgUser:Tt}})):Ee({isUserAdmin:!1,isOrgUser:!1}))).subscribe(({isUserAdmin:Ve,isOrgUser:ht})=>{let Ze=Ve||ht;Ze!==this.privateCommentAllowed$.value&&this.privateCommentAllowed$.next(Ze)}),this.databaseService.getDb().pipe(jt(Ve=>!!Ve),Jn(1)).subscribe(Ve=>{Ve&&this.getDocumentPaths()},Ve=>{this.loggingService.catch("Error in CommentService getDb subscription: ",Ve)}),this.domService.onWindowPointerMove$().subscribe(Ve=>{if(this.addCommentMode$.value){let ht=!0;if(this.addCommentDragMode)this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{let Ze=this.domService.getBackgroundElement(Ve.clientX,Ve.clientY,!0,!0);if(Ze&&gb(Ze,{x:Ve.clientX,y:Ve.clientY})&&(Ze=Ze?.parentElement),Ze)if(this.isElementInsideAllowedElements(Ze))if(eo(Ve.target))this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{this.domService.addClassToElement(document.body,"show-pin-cursor"),this.hightlightElement&&this.hightlightElement!==Ze&&this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=Ze;let Tt=this.domService.getSelectedAnnotationsMap("comment")||{},Ue=this.commentPinCursorImage$.value||X.CURSOR.COMMENT_PIN;this.domService.highlightElement(this.hightlightElement,Ue,!!Object.keys(Tt)?.length),ht=!1}else this.domService.removeClassFromElement(document.body,"show-pin-cursor")}this.hightlightElement&&ht&&(this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=null)}},Ve=>{this.loggingService.catch("Error in CommentService onWindowPointerMove$ subscription: ",Ve)}),this.domService.onWindowKeyupEsc$().subscribe(Ve=>{if(this.addCommentMode$.value){let ht=this.domService.getSelectedAnnotationsMap("comment")||{};Object.keys(ht)?.length&&this.domService.resetSelectedAnnotationsMap(),this.disableAddCommentMode()}},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupEsc$ subscription: ",Ve)}),this.domService.onDocumentClick$().subscribe(Ve=>{if(Ve&&!_g(Ve)){let ht=this.domService.getSelectedAnnotationsMap("comment")||{};if(ht=g(g({},ht),this.domService.getSelectedAnnotationsMap("multiThread")||{}),ht=g(g({},ht),this.domService.getSelectedAnnotationsMap("suggestion")||{}),Object.keys(ht)?.length&&(this.domService.resetSelectedAnnotationsMap(),this.persistentCommentMode$?.value)){this.addCommentMode$.value&&this.detectToAddAreaComment(),Ve.preventDefault(),Ve.stopPropagation();return}}if(Ve&&this.addCommentMode$.value&&!eo(Ve.target)){let ht=!1;if(this.addCommentDragMode)Ve.preventDefault(),Ve.stopPropagation(),this.addCommentDragMode=!1;else if(!this.domService.getDraftCommentAnnotationDialogs()?.length){let Ze=this.domService.getBackgroundElement(Ve.clientX,Ve.clientY);if((this.persistentCommentMode$?.value&&this.domService.getBackgroundVeltElement(Ve.clientX,Ve.clientY)||Ve&&_g(Ve))&&(Ze=null),Ze&&(this.isElementInsideAllowedElements(Ze)||this.getCommentToNearestAllowedElement()&&this.getNearestAllowedElement(Ze))&&(ht=this.isElementInsideManualCommentContainer(Ze),!ht)){Ve.preventDefault(),Ve.stopPropagation();let Tt=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment(Ve,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Tt)}}this.persistentCommentMode$?.value?this.detectToAddAreaComment():ht||this.disableAddCommentMode()}},Ve=>{this.loggingService.catch("Error in CommentService onDocumentClick$ subscription: ",Ve)}),this.addCommentMode$.subscribe(Ve=>{this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement),Ve?(this.domService.addClassToElement(document.body,"snippyly-add-comment-mode"),this.detectToAddAreaComment(),this.addIframeContainerStaticAttribute()):(this.removeIframeContainerStaticAttribute(),this.domService.removeClassFromElement(document.body,"snippyly-add-comment-mode"),this.domService.removeClassFromElement(document.body,"show-pin-cursor"),this.dragSubscriptions.forEach(ht=>ht.unsubscribe()),this.clearFreeStyleCommentContext())},Ve=>{this.loggingService.catch("Error in CommentService addCommentMode$ subscription: ",Ve)}),this.domService.onWindowKeyupBackspace$().subscribe(Ve=>{this.getDeleteOnBackspace()&&this.deleteCommentPinAnnotations("keyupBackspace")},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupBackspace$ subscription: ",Ve)}),this.domService.onWindowKeyupDelete$().subscribe(Ve=>{this.deleteCommentPinAnnotations("keyupDelete")},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",Ve)}),this.domService.getDeleteCommmentAnnotations$().subscribe(Ve=>{Ve?.length&&(Ve?.filter(Ze=>!["tag","recorder","rewriter","arrow","area","multiThread"].includes(Ze.type))).forEach(Ze=>Pe(this,null,function*(){yield this.deleteCommentPinAnnotation(Ze)}))},Ve=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",Ve)}),this.getPopoverMode$().subscribe(Ve=>{Ve?document?.body?.setAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE,"true"):document?.body?.removeAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE)},Ve=>{this.loggingService.catch("Error in CommentService getPopoverMode subscription: ",Ve)}),this.customFilterService.customCategoryMap$.subscribe(Ve=>{this.customCategoryMap=Ve},Ve=>{this.loggingService.catch("Error in CommentService customCategoryMap$ subscription: ",Ve)}),this.hotkeyEnabled$.subscribe(Ve=>{Ve?this.subscribeHotkeyEvents():this.unsubscribeHotkeyEvents()},Ve=>{this.loggingService.catch("Error in CommentService hotkeyEnabled$ subscription: ",Ve)}),this.domService.getSelectedAnnotationsMap$().pipe(wn()).subscribe(([Ve,ht])=>{try{let Ze=Object.values(Ve||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type)),Tt=Object.values(ht||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type));Ze?.forEach(Ue=>{Tt?.find(Lt=>Lt.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!1})}),Tt?.forEach(Ue=>{Ze?.find(Lt=>Lt.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!0})})}catch(Ze){this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$: ",Ze)}},Ve=>{this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$ subscription: ",Ve)})}clearCache(){try{this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in CommentService","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear(),this.customAutocompleteSearch$.next(!1),this.hightlightElement=null,this.addCommentMode$.next(!1),this.unreadCommentsMap$.next(null),this.documentPaths=null,this.commentsFromSidebarMap$.next(null),this.customSidebarDataAnnotationIds$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearCache: ",e)}}setCommentActionsService(e){try{this.commentActionsService=e}catch(t){this.loggingService.catch("Error in CommentService setCommentActionsService: ",t)}}detectToAddAreaComment(){try{let e=this.areaService?.getAreaEnabled()??!1,t=this.getAreaCommentEnabled();if(e&&t){let a,i,c,m=null,h=null;this.dragSubscriptions.forEach(_=>_.unsubscribe()),this.dragSubscriptions.push(this.domService.onWindowMouseDown$().pipe(jt(_=>!(_&&_g(_))),Jn(1)).subscribe(_=>{m=null,h=null,this.dragSubscriptions.push(this.domService.getClickAndDragPointsObservable().subscribe(I=>{if(m===null){let S=I?.startPoint?.event?.target,z=Nc(S),$=eo(S),G=this.isElementInsideAllowedElements(S);m=!z&&!$&&G}if(m){this.addCommentDragMode=!0,a=I.startPoint,i=I.curPoint;let S=I?.curPoint?.event?.target,z=Nc(S),$=eo(S),G=this.isElementInsideAllowedElements(S);h=!z&&!$&&G,h?c=this.domService.drawRectangle(a,i):c?.remove()}})),this.domService.onWindowPointerUp$().pipe(Zs(1),Jn(1)).subscribe(I=>{if(i={x:I.clientX,y:I.clientY},a&&i&&(c?.remove(),m&&h)){let S=[{x:a.x-window.scrollX,y:a.y-window.scrollY},{x:i.x,y:i.y}],z=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment(I,void 0,S,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,z)}this.dragSubscriptions.forEach(S=>S.unsubscribe())})}))}}catch(e){this.loggingService.catch("Error in CommentService detectToAddAreaComment: ",e)}}resetCacheData(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: resetCacheData","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear()}catch(e){this.loggingService.catch("Error in CommentService resetCacheData: ",e)}}addAreaContainerTag(){try{if(!(document.querySelector(X.TAGS.VELT_AREAS)||document.querySelector(X.TAGS.SNIPPYLY_AREAS))){let t=document.createElement(X.TAGS.VELT_AREAS);document.body.appendChild(t)}}catch(e){this.loggingService.catch("Error in CommentService addAreaContainerTag: ",e)}}addIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER}]`).forEach(t=>{window.getComputedStyle(t).position==="static"&&t.setAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC,"true")})}catch(e){this.loggingService.catch("Error in CommentService addIframeContainerStaticAttribute: ",e)}}removeIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC}]`).forEach(t=>{t.removeAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC)})}catch(e){this.loggingService.catch("Error in CommentService removeIframeContainerStaticAttribute: ",e)}}subscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: subscribeHotkeyEvents","color: green;"),this.unsubscribeHotkeyEvents(),this.hotkeySubscriptions.push(this.hotkeyService.getKeyPressEvent("c").subscribe(e=>{e&&!this.addCommentMode$.value&&this.enableAddCommentMode()},e=>{this.loggingService.catch("Error in CommentService hotkeyService.getKeyPressEvent subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CommentService subscribeHotkeyEvents: ",e)}}unsubscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribeHotkeyEvents","color: green;"),this.hotkeySubscriptions.forEach(e=>e?.unsubscribe())}catch(e){this.loggingService.catch("Error in CommentService unsubscribeHotkeyEvents: ",e)}}setCommentAddedEmitter(e){try{this.commentAddedEmitter=e}catch(t){this.loggingService.catch("Error in CommentService setCommentAddedEmitter: ",t)}}setContextProvider(e){try{this.commentContextProvider=e}catch(t){this.loggingService.catch("Error in CommentService setContextProvider: ",t)}}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$()}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}setAllowedElementIds(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementIds:e}}),this.allowedElementIds$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementIds: ",t)}}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}setAllowedElementClassNames(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementClassNames:e}}),this.allowedElementClassNames$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementClassNames: ",t)}}getAllowedElementClassNames(){return this.allowedElementClassNames$.asObservable()}setAllowedElementQuerySelectors(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementQuerySelectors:e}}),this.allowedElementQuerySelectors$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementQuerySelectors: ",t)}}getAllowedElementQuerySelectors(){return this.allowedElementQuerySelectors$.asObservable()}getAllCommentAnnotations({customClientDocumentId:e,params:t,excludeDomChanges:a,detectGhostComments:i,skipPositionCalculation:c,query:m,fromCommentSidebar:h,analytics:_,addFilterCommentsOnDomCheck:I}){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentAnnotations","color: green;");let S,z,$;_?.enabled&&this.analyticsService.trackEvent(_?.eventName||ne.Events.Comments.GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED_INTERNAL,_?.properties);try{if(e&&($=`${wo(e)}`),t&&typeof t=="object"){let G=Nu(t);z=G?.id,S=wo(JSON.stringify(G))}}catch(G){this.loggingService.catch("Error in CommentService getAllCommentAnnotations: ",G)}return this.authService.getAuthState$().pipe(jt(G=>!!G),Me(G=>this.isFeatureAllowed({firebaseUser:G,annotations:[],filteredAnnotations:[]})),Me(G=>G.featureAllowed?this.iamService.isUserAllowed$().pipe(Oe(Z=>(G.featureAllowed=Z,G))):Ee(G)),Me(G=>G.featureAllowed?Ee(G).pipe(Me(Z=>this.docService.getDocumentPaths$().pipe(Oe(ae=>(this.documentPaths=ae,Z.documentPaths=ae,Z)))),Me(Z=>m?.documentIds?.length||$?this.getDataFromDocumentIds({documentIds:$?[$]:m?.documentIds?.map(ae=>`${wo(ae)}`),organizationId:this.documentPaths?.organizationId,query:m}).pipe(Oe(ae=>({res:Z,data:ae}))):this.docService.getDocumentIds$().pipe(Me(ae=>{let pe=ae?.length>0?ae.map(Se=>Se.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds({documentIds:pe.length>0?pe:[$??""],organizationId:this.documentPaths?.organizationId,query:m}).pipe(Oe(Se=>({res:Z,data:Se})))}))),Me(Z=>Z?.data?(Z.res.annotations=Z.data||[],Ee(Z.res).pipe(Me(ae=>this.docService.getLocation$().pipe(Oe(pe=>(ae.location=pe,ae)))),Me(ae=>this.docService.getLocations$().pipe(Oe(pe=>(ae.customLocations=pe,ae)))),Me(ae=>this.docService.getExcludedLocationIds$().pipe(Oe(pe=>(ae.excludedLocationIds=pe,ae)))),Oe(ae=>{if(ae.filteredAnnotations=[],m)return ae.filteredAnnotations=ae.annotations?.slice(),ae;if($&&!S||h)return ae.filteredAnnotations=ae.annotations?.slice(),ae?.excludedLocationIds?.length&&(ae.filteredAnnotations=ae.filteredAnnotations?.filter(pe=>pe?.location?.id?!ae.excludedLocationIds.includes(pe.location.id):!0)),ae;{let pe=[],Se=[];return S?(pe.push(S),z&&Se.push(z)):(pe.push(ae?.location?.locationId),pe.push(...Object.values(ae?.customLocations||[]).map(oe=>oe.locationId)),ae?.location?.location?.id&&Se.push(ae?.location?.location?.id),Se.push(...Object.values(ae?.customLocations||{}).map(oe=>oe.location?.id).filter(oe=>!!oe))),ae.filteredAnnotations=this.filterAnnotationsByLocationIds(ae?.annotations,pe,Se),ae?.excludedLocationIds?.length&&(ae.filteredAnnotations=ae.filteredAnnotations?.filter(oe=>oe?.location?.id?!ae.excludedLocationIds.includes(oe.location.id):!0)),ae}}),Me(ae=>this.isPrivateCommentAllowed$().pipe(Oe(pe=>(pe||(ae.filteredAnnotations=ae.filteredAnnotations?.filter(Se=>!sr(Se))),ae)))),Me(ae=>this.draftCommentAnnotationsByAnnotationId$.pipe(Oe(pe=>(ae.filteredAnnotations=ae.filteredAnnotations?.filter(Se=>!Se.isDraft),pe&&ae.filteredAnnotations.push(...Object.values(pe)),ae)))),Me(ae=>a?Ee(ae):ae?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Oe(()=>ae)):Ee(ae)),Me(ae=>a?Ee(ae):this.addCommentMode$.pipe(Me(pe=>pe&&!this.getChangeDetectionInCommentMode()?Ee(ae):ae?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllCommentAnnotations").pipe(Oe(()=>ae)):Ee(ae)))),Oe(ae=>{if(!c){(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&(ae.filteredAnnotations=ae.filteredAnnotations?.map(Se=>{let oe=Object.assign({},Se);return this.calculateCommentAnnotationPosition(oe,i),oe}));let pe={};ae.filteredAnnotations?.forEach(Se=>{if(Se?.targetTextRange){let oe=this.domService.getElementFromTargetTextRange(Se?.targetTextRange);pe[Se.annotationId]=!!oe}}),ae.textAnnotationsElementMap=pe}return ae}),Me(ae=>ae?.annotations?.length?this.serviceBook.observe(Do).pipe(Me(pe=>pe?pe.getCommentFeatureViews$():Ee({})),Oe(pe=>(this.updateUnreadAnnotationsMap(ae?.annotations,pe),ae))):(Dy(this.unreadCommentsMap$.value)&&this.unreadCommentsMap$.next({}),Ee(ae))))):Ee(null))):Ee(null)),Oe(G=>{try{return typeof G=="object"&&G?JSON.parse(JSON.stringify(G)):G}catch{return G}}),gr((G,Z)=>Wr(G?.filteredAnnotations,Z?.filteredAnnotations)&&Wr(G?.textAnnotationsElementMap,Z?.textAnnotationsElementMap)),Me(G=>G?G?.filteredAnnotations?Ee(G?.filteredAnnotations||[]):Ee([]):Ee(null)),Me(G=>I?this.filterCommentsUsingSidebarSettings(G):Ee(G)))}getAllMultiThreadCommentAnnotations(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: getAllMultiThreadCommentAnnotations","color: green;");let h,_;try{if(e&&(_=wo(e)),t&&typeof t=="object"){let I=Nu(t);h=wo(JSON.stringify(I))}}catch(I){this.loggingService.catch("Error in CommentService getAllMultiThreadCommentAnnotations: ",I)}return this.authService.getAuthState$().pipe(jt(I=>!!I),Me(I=>this.isFeatureAllowed({firebaseUser:I,annotations:[],filteredAnnotations:[]})),Me(I=>I.featureAllowed?this.iamService.isUserAllowed$().pipe(Oe(S=>(I.featureAllowed=S,I))):Ee(I)),Me(I=>I.featureAllowed?Ee(I).pipe(Me(S=>this.docService.getDocumentPaths$().pipe(Oe(z=>(this.documentPaths=z,S.documentPaths=z,S)))),Me(S=>_?this.getMultiThreadDataFromDocumentIds([_]).pipe(Oe(z=>({res:S,data:z}))):this.docService.getDocumentIds$().pipe(Me(z=>{let $=z?.length>0?z.map(G=>G.documentId):[this.documentPaths?.documentId??""];return this.getMultiThreadDataFromDocumentIds($.length>0?$:[`${_}`]).pipe(Oe(G=>({res:S,data:G})))}))),Me(({res:S,data:z})=>z?(S.annotations=z||[],Ee(S).pipe(Me($=>this.docService.getLocation$().pipe(Oe(G=>($.location=G,$)))),Me($=>this.docService.getLocations$().pipe(Oe(G=>($.customLocations=G,$)))),Me($=>this.docService.getExcludedLocationIds$().pipe(Oe(G=>($.excludedLocationIds=G,$)))),Oe($=>{if($.filteredAnnotations=[],_&&!h)return $.filteredAnnotations=$.annotations?.slice(),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(G=>G?.location?.id?!$.excludedLocationIds.includes(G.location.id):!0)),$;{let G=[],Z=[];return h?G.push(h):(G.push($?.location?.locationId),G.push(...Object.values($?.customLocations||[]).map(ae=>ae.locationId)),$?.location?.location?.id&&Z.push($?.location?.location?.id),Z.push(...Object.values($?.customLocations||{}).map(ae=>ae.location?.id).filter(ae=>!!ae))),$.filteredAnnotations=this.filterAnnotationsByLocationIds($?.annotations,G,Z),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(ae=>ae?.location?.id?!$.excludedLocationIds.includes(ae.location.id):!0)),$}}),Me($=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Oe(G=>($.filteredAnnotations=$.filteredAnnotations?.filter(Z=>!Z.isDraft),G&&$.filteredAnnotations.push(...Object.values(G)),$)))),Me($=>a?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Oe(()=>$)):Ee($)),Me($=>a?Ee($):this.addCommentMode$.pipe(Me(G=>G&&!this.getChangeDetectionInCommentMode()?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllMultiThreadCommentAnnotations").pipe(Oe(()=>$)):Ee($)))),Oe($=>(c||(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&($.filteredAnnotations=$.filteredAnnotations?.map(G=>{let Z=Object.assign({},G);return this.calculateCommentAnnotationPosition(Z,i),Z})),$)),Me($=>$?.filteredAnnotations?Ee($?.filteredAnnotations||[]):Ee([])))):Ee(null))):Ee(null)),gr(Wr),Me(I=>m?this.filterCommentsUsingSidebarSettings(I):Ee(I)))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(jt(t=>!!t),Oe(t=>f(g({},e),{config:t})),Me(t=>this.authService.getUser$().pipe(Oe(a=>(this.user=a,f(g({},t),{user:a}))))),Me(t=>Kh(t.config,t.user,ke.COMMENT)?Ee(f(g({},t),{featureAllowed:!0})):(this.loggingService.warn("Comment feature is not allowed."),Ee(f(g({},t),{featureAllowed:!1})))),gr((t,a)=>t?.featureAllowed===a?.featureAllowed))}buildVisibilityTokens(e){return Pe(this,null,function*(){try{let a=this.authService.getUser()?.clientOrganizationId,i=a?yield this.isViewerOrgMembershipConfirmed(e,a):!1;return Fu({userId:e,clientOrganizationId:i?a:void 0,fallbackServerOrganizationId:a?void 0:this.documentPaths?.organizationId})}catch(t){this.loggingService.catch("Error in CommentService buildVisibilityTokens: ",t);try{return[X.DEFAULT_VELT_CONTEXT,`${X.VISIBILITY_SELF_PREFIX}${mr(e)}`]}catch{return[X.DEFAULT_VELT_CONTEXT]}}})}isViewerOrgMembershipConfirmed(e,t){return Pe(this,null,function*(){try{let i=(yield this.userPermissionService.getUserPermissionsFromCacheOrFetch({organizationId:t}))?.[e]?.organization?.[t];return!!i&&i.errorCode!==kg.PERMISSION_DENIED}catch(a){return this.loggingService.catch("Error in CommentService isViewerOrgMembershipConfirmed: ",a),!1}})}getDataFromDocuments(e){let{documentIds:t,organizationId:a,query:i}=e;if(!this.configService?.getApiKey())return Ee(null);if(t?.some(z=>!z)||!this.documentPaths)return Ee(null);let c,m,h=[];if(i)i?.folderId&&(c=dr(i?.folderId)),i?.locationId&&(h=[...h,i?.locationId]),i?.locationIds?.length&&(h=[...h,...i?.locationIds]),m=i?.statusIds;else{c=this.docService.getDocumentPaths()?.veltFolderId;let z=this.docService.getDocumentPaths()?.locationId;z&&(h=[...h,z])}let _={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(_.documentId=t?.length?t[0]:void 0,_.organizationId=this.documentPaths?.organizationId);let I=this.authService.getUser()?.userId;if(!I)return Ee(null);let S=this.authService.getIsPrivateCommentsEnabled();return th(()=>(S?_n(this.buildVisibilityTokens(I)):Ee([X.DEFAULT_VELT_CONTEXT])).pipe(Me($=>{let G=this.userPermissionService?.getIsContextEnabled()?this.docService.getProcessedDocContext():[],Z=[...$,...G],ae=this.userPermissionService?.getIsContextEnabled(),pe;if(ae){let Se=[];for(let oe=0;oe<Z.length;oe+=X.LISTENER_CONTEXT_BATCH_SIZE)Se.push(Z.slice(oe,oe+X.LISTENER_CONTEXT_BATCH_SIZE));this.loggingService.logContext("[CONTEXT] getDataFromDocuments called with accessFields:",JSON.parse(JSON.stringify(Z??"nil"))),pe=kr(Se.map(oe=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},_),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",a??this.documentPaths?.organizationId),Qe("metadata.documentId","in",t),...m?.length?[Qe("status.id","in",m)]:[],...c?[Qe("metadata.veltFolderId","==",c)]:[],...h?.length?[Qe("location.id","in",h)]:[],...oe?.length?[Qe("context.accessFields","array-contains-any",oe)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Pc()))).pipe(Oe(oe=>Lc(JSON.parse(JSON.stringify(oe)))))}else{let Se=[];for(let oe=0;oe<(t?.length??0);oe+=X.LISTENER_BATCH_SIZE)Se.push(t?.slice(oe,oe+X.LISTENER_BATCH_SIZE)??[]);pe=kr(Se.map(oe=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},_),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",a??this.documentPaths?.organizationId),Qe("metadata.documentId","in",oe),...m?.length?[Qe("status.id","in",m)]:[],...c?[Qe("metadata.veltFolderId","==",c)]:[],...h?.length?[Qe("location.id","in",h)]:[],...Z?.length&&S?[Qe("context.accessFields","array-contains-any",Z)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Pc()))).pipe(Oe(oe=>Lc(JSON.parse(JSON.stringify(oe)))))}return pe.pipe(Me(Se=>Se?.data?Ee(Se).pipe(Me(oe=>this.commonDbUtilsService.mergeLocationMetadataWithData$({data:oe,feature:"allComments"}).pipe(Oe(he=>({data:Object.values(he?.data||{}).filter(_e=>typeof _e=="object"),operation:he?.operation})))),Oe(({data:oe,operation:he})=>{let _e=oe.reduce((Re,Ye)=>{let lt=Ye.metadata?.documentId;return lt&&(Re[lt]||(Re[lt]=[]),Re[lt].push(Ye)),Re},{});return{data:oe,documentMap:_e,operation:he}}),Oe(({data:oe,documentMap:he,operation:_e})=>m?{data:oe,documentMap:he,operation:_e}:(oe?.length&&(oe?.forEach(Re=>{this.sanitizeCommentAnnotation(Re)}),this.setAnnotationIndex(oe),this.updateAnnotationsForSelectAllContentMode(oe),oe.forEach(Re=>{this.customFilterService.convertLegacyAnnotationStatus(Re),this.customFilterService.convertLegacyPriority(Re),this.customFilterService.convertLegacyCategory(Re)})),{data:oe,documentMap:he,operation:_e})),yn(oe=>(this.loggingService.catch("Error in CommentService getDataFromDocuments: ",oe),Ee([]))),Ac(({documentMap:oe})=>{m||Object.entries(oe??{}).forEach(([he,_e])=>{this.setOriginalCommentAnnotationsByAnnotationId(JSON.parse(JSON.stringify(_e)))})}),Oe(({data:oe,documentMap:he,operation:_e})=>({data:this.filterUserDraftComments(oe),documentMap:he,operation:_e})),Oe(({data:oe,documentMap:he,operation:_e})=>({data:this.removeDraftFlags(oe),documentMap:he,operation:_e})),Me(({data:oe,documentMap:he,operation:_e})=>m?Ee({data:oe,documentMap:he,operation:_e}):this.mergeDraftAnnotations(oe).pipe(Oe(Re=>({data:Re,documentMap:he,operation:_e})))),Oe(({data:oe,documentMap:he,operation:_e})=>{if(!m)if(_e?.type==="removed"){if(_e?.ids?.length){let Re=this.commentAnnotationById$.value??{};_e?.ids?.forEach(Ye=>{delete Re?.[Ye]}),this.commentAnnotationById$.next(Re)}}else Object.entries(he??{}).length?Object.entries(he??{}).forEach(([Ye,lt])=>{this.setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:Ye,annotations:lt})}):this.commentAnnotationById$.value||this.commentAnnotationById$.next({});return oe})):Ee(null)))})))}fetchCommentAnnotations(e){return Pe(this,null,function*(){try{let t=this.authService.getUser();if(!t)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),{data:[],hasMore:!1};let a=this.configService?.getApiKey(),i=e?.organizationId??t?.clientOrganizationId,c=Uv(i??""),m=[];e?.allDocuments||(m=e?.documentIds?.map(pe=>xg(pe??""))??this.docService.getDocumentIds()?.map(pe=>pe.documentId));let h=[];if(h.push(Qe("metadata.organizationId","==",c)),h.push(Qe("metadata.apiKey","==",a)),e?.folderId){let pe=dr(e?.folderId);h.push(Qe("metadata.veltFolderId","==",pe))}if(e?.locationId&&h.push(Qe("location.id","==",e?.locationId)),m?.length&&h.push(Qe("metadata.documentId","in",m)),e?.resolvedBy){if(e?.order==="asc")throw new Error("Order by resolvedBy is not supported in ascending order.");h.push(Qe("resolvedByUserId","==",e?.resolvedBy))}if(e?.mentionedUserIds?.length){if(e?.order==="asc")throw new Error("Order by mentionedUserIds is not supported in ascending order.");h.push(Qe("mentionedUserIds","array-contains-any",e?.mentionedUserIds))}if(e?.userIds?.length){if(e?.order==="asc")throw new Error("Order by userIds is not supported in ascending order.");h.push(Qe("from.userId","in",e?.userIds))}if(e?.statusIds?.length){if(e?.order==="asc")throw new Error("Order by status id is not supported in ascending order.");h.push(Qe("status.id","in",e?.statusIds))}let _=new Date().getTime();if(e?.createdAfter&&h.push(Qe("createdAt",">=",e?.createdAfter)),e?.createdBefore&&h.push(Qe("createdAt","<=",e?.createdBefore??_)),e?.updatedAfter&&h.push(Qe("lastUpdated",">=",e?.updatedAfter??_)),e?.updatedBefore&&h.push(Qe("lastUpdated","<=",e?.updatedBefore??_)),h.push(Xt("lastUpdated",e?.order??"desc"),Xt("createdAt",e?.order??"desc")),e?.pageToken){let pe=yield qh(e?.pageToken??"","veltencrypttoken","veltencrypttoken");h.push(Ib(parseInt(pe,10),"lastUpdated"))}let I=e?.pageSize??100;h.push(wb(I+1));let S=yield this.commonDbService.queryData({feature:"allComments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:h,apiKey:a??"",organizationId:c}}),z=S.length>I;S=S.slice(0,I);let $=S?.reduce((pe,Se)=>(pe[Se?.annotationId]=Se,pe),{});$=yield this.commonDbUtilsService.formatResponse({feature:"allComments",data:$,shouldAwait:!0}),$=this.commonDbUtilsService.mergeUsersWithData({feature:"allComments",data:$});let G=t.clientOrganizationId?yield this.isViewerOrgMembershipConfirmed(t.userId,t.clientOrganizationId):!1,Z=Fu({userId:t.userId,clientOrganizationId:G?t.clientOrganizationId:void 0,fallbackServerOrganizationId:t.clientOrganizationId?void 0:c});return{data:Yh(Object.values($??{}),{userId:t.userId,tokens:Z}),hasMore:z}}catch(t){throw this.loggingService.catch("Error in CommentService fetchCommentAnnotations:",t),t}})}filterUserDraftComments(e){let t=this.authService.getUser();return e.filter(a=>(a.comments=a?.comments?.filter(i=>i?.from?.userId===t?.userId||!i?.isDraft),!!a?.comments?.length))}removeDraftFlags(e){return e.forEach(t=>delete t.isDraft),e}mergeDraftAnnotations(e){return this.draftCommentAnnotationsByAnnotationId$.pipe(Oe(t=>{let a=t||{};return e?.filter(i=>{a?.[i?.annotationId]&&delete a[i?.annotationId]}),a}),Oe(t=>{if(t){let a=e.slice();return a.push(...Object.values(t)),a}return e}))}getDataFromDocumentIds({documentIds:e,organizationId:t,query:a}){return this.getDataFromDocuments({documentIds:e,organizationId:t,query:a})}getMultiThreadDataFromDocumentIds(e){return this.getMultiThreadDataFromDocuments({documentIds:e})}getMultiThreadDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t}=e;if(t?.some(m=>!m)||!this.documentPaths)return Ee(null);let a=this.docService.getDocumentPaths()?.veltFolderId,i=Ee([]),c={useCollectionGroup:!0,isCollection:!0,useQuery:!0};if(this.commonDbService.shouldUseFirestore()||(c.documentId=t?.length?t[0]:void 0,c.organizationId=this.documentPaths?.organizationId),this.userPermissionService?.getIsContextEnabled()){let m=[X.DEFAULT_VELT_CONTEXT,...this.docService.getProcessedDocContext()],h=[];for(let _=0;_<(m?.length??0);_+=X.LISTENER_CONTEXT_BATCH_SIZE)h.push(m?.slice(_,_+X.LISTENER_CONTEXT_BATCH_SIZE)??[]);i=kr(h.map(_=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",t),...a?[Qe("metadata.veltFolderId","==",a)]:[],..._?.length?[Qe("context.accessFields","array-contains-any",_)]:[])]})}).pipe(Pc()))).pipe(Oe(_=>Lc(_)))}else{let m=[];for(let h=0;h<(t?.length??0);h+=X.LISTENER_BATCH_SIZE)m.push(t?.slice(h,h+X.LISTENER_BATCH_SIZE)??[]);i=kr(m.map(h=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",h),...a?[Qe("metadata.veltFolderId","==",a)]:[])]})}).pipe(Pc()))).pipe(Oe(h=>Lc(h)))}return i.pipe(Me(m=>m?.data?Ee(m).pipe(Oe(h=>({data:h?.data,operation:h?.operation})),Oe(({data:h,operation:_})=>{let I=[];return h&&(I=Object.values(h??{}).filter(S=>typeof S=="object")),{data:I,operation:_}}),yn(h=>(this.loggingService.catch("Error in CommentService getMultiThreadDataFromDocumentId: ",h),Ee({data:[],operation:null}))),Oe(({data:h,operation:_})=>{h.forEach(S=>{delete S.isDraft});let I=h.reduce((S,z)=>{let $=z.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(z)),S},{});return{data:h,documentMap:I,operation:_}}),Me(({data:h,documentMap:_,operation:I})=>{let S=[];return this.commentAnnotationById$.pipe(Me(()=>this.domService.getSelectedAnnotationsMap$().pipe(Oe(z=>({selectedAnnotationsMap:z})))),Oe(({selectedAnnotationsMap:z})=>{let $={};return Object.keys(_??{}).forEach(G=>{let Z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:G});Z&&Z?.forEach(ae=>{$[ae?.annotationId]=ae})}),S=h.filter(G=>{let Z=!1;if(G?.commentAnnotations){for(let ae in G?.commentAnnotations)if($?.[ae]&&$?.[ae]?.status?.id!==this.customFilterService.resolvedStatus.id){Z=!0;break}}return Z}),S.forEach(G=>{Object.keys(G?.commentAnnotations||{}).forEach(Z=>{G.commentAnnotationsMap||(G.commentAnnotationsMap={}),G.commentAnnotationsMap[Z]=$?.[Z]})}),{data:S,operation:I}}))}),Me(({data:h,operation:_})=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Oe(I=>{let S=I||{};return h?.filter(z=>{S?.[z?.annotationId]&&delete S[z?.annotationId]}),S}),Oe(I=>{if(I){let S=h.slice();return S.push(...Object.values(I)),{data:S,operation:_}}return{data:h,operation:_}}))),Oe(({data:h,operation:_})=>{let I=h.reduce((S,z)=>{let $=z.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(z)),S},{});if(_?.type==="removed"){if(_?.ids?.length){let S=this.multiThreadCommentAnnotationById$.value;_?.ids?.forEach(z=>{delete S?.[z]}),this.multiThreadCommentAnnotationById$.next(S)}}else Object.keys(I??{}).forEach(S=>{this.setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:S,annotations:I[S]})});return h})):Ee(null)))}else return Ee(null)}updateUnreadAnnotationsMap(e,t){try{let a=new Date(X.UNREAD_COMMENTS_CHECK_FROM_DATE)?.getTime(),i=e.filter(c=>c?.lastUpdated>a);if(t){let c={},m=!1;i.forEach(h=>{let _=0,I=t?.[h?.annotationId];if(I){let S=I?.comments;S&&h?.comments?.forEach(z=>{S?.[z?.commentId]?.views?.[this.user?.userSnippylyId]||_++})}_?_!==c?.[h?.annotationId]&&(c[h?.annotationId]=_,m=!0):c?.[h?.annotationId]&&(delete c[h?.annotationId],m=!0)}),this.unreadCommentsMap$.next(c)}}catch(a){this.loggingService.catch("Error in CommentService updateUnreadAnnotationsMap:",a)}}updateAnnotationsForSelectAllContentMode(e){try{e.forEach(t=>{if(t?.selectAllContent&&t?.targetElementId){let a=zr(t.targetElementId,["id","data-id"]);if(a){let i=a.textContent;i&&(t.targetTextRange={commonAncestorContainer:this.domService.getXPath(a),text:i,occurrence:1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(a)??void 0},delete t?.targetElement)}}})}catch(t){this.loggingService.catch("Error in CommentService updateAnnotationsForSelectAllContentMode:",t)}}setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a?.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.commentAnnotationById$.value??{}),c);this.commentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Oe(()=>this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId$:",a),Ee([])}}getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a=null;this.commentAnnotationById$.value&&(a={},Object.values(this.commentAnnotationById$.value).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)}));let i=this.draftCommentAnnotationsByAnnotationId$.value;return i&&(a===null&&(a={}),Object.values(i).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)})),a?Object.values(a):null}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getCommentAnnotationsByDocumentId$({clientDocumentId:e,documentId:t}){try{return e&&!t&&(t=this.docService.generateDocumentId(e)),t?this.docService.getDocumentPaths$().pipe(Me(a=>this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:a?.organizationId,documentId:t}))):Ee(null)}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByDocumentId$:",a),Ee(null)}}getCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Me(e=>e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId}):[]}catch(e){return this.loggingService.catch("Error in CommentService getCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}setOriginalCommentAnnotationsByAnnotationId(e){try{let t={};e?.forEach(a=>{a?.annotationId&&(t[a?.annotationId]=a)}),this.originalCommentAnnotationsByDocumentId$.next(g(g({},this.originalCommentAnnotationsByDocumentId$.value),t))}catch(t){this.loggingService.catch("Error in CommentService setOriginalCommentAnnotationsByAnnotationId:",t)}}setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.multiThreadCommentAnnotationById$.value),c);this.multiThreadCommentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){return this.multiThreadCommentAnnotationById$.pipe(Oe(()=>this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a={};Object.values(this.multiThreadCommentAnnotationById$.value??{}).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)});let i=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;return i&&Object.values(i??{}).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)}),Object.values(a)}catch(a){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Me(e=>e?.documentId?this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId})}catch(e){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}getLocations$(){return this.docService.getLocation$().pipe(Me(e=>this.docService.getLocations$().pipe(Oe(t=>({location:e,locations:t})))),Oe(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(a=>a.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t,a){try{return e.filter(i=>t.includes(i.locationId)||a?.includes(i?.location?.id)||t?.find(c=>c==i?.location?.id)||a?.find(c=>c==i?.locationId+""))}catch(i){return this.loggingService.catch("Error in CommentService filterAnnotationsByLocations:",i),[]}}setAnnotationIndex(e){try{e.forEach((t,a)=>{t?.annotationId&&(t.annotationIndex=a+1)})}catch(t){this.loggingService.catch("Error in CommentService setAnnotationIndex:",t)}}calculateCommentAnnotationPosition(e,t){try{if(e.multiThreadAnnotationId)return;if(e.targetElementId){let a=zr(e.targetElementId,["id","data-id"]);if(a&&this.domService.isElementVisible(a)){let i=a.getAttribute(X.ATTRIBUTES.VELT_COMMENT_TYPE),c=!0;if(i)i==="popover"?c=!0:c=!1;else{let m=document.querySelector(`${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_INLINE_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_ELEMENT_ID}="${e.targetElementId}"]`);m&&a?.contains(m)&&(c=!1)}c?e.targetElement={xpath:this.domService.getXPath(a),fXpath:this.domService.getXPath(a,!0),cfXpath:this.domService.getXPath(a,!0,!0),topPercentage:e.targetElement?.topPercentage||50,leftPercentage:e.targetElement?.leftPercentage||90}:e.targetElement=null}else e.targetElement=null}if(e.targetElement){e.position=null,e.ghostComment=null;let a=e.targetElement?.xpath,i=null,c=e?.targetElement?.anchor;if(c){let h=this.domService.resolveAnchorRecord(c);h?.element&&this.domService.isElementVisible(h.element)&&un(h.element)&&(i=h.element)}else a&&(i=this.domService.getElementFromXPath(a),this.domService.isXpathWithId(a)||((!i||!this.domService.isElementVisible(i))&&e.targetElement?.cfXpath&&(a=e.targetElement?.cfXpath,i=this.domService.getElementFromXPath(a)),this.getDetectionStrategy()===Pu.DYNAMIC_ID&&(!i||!this.domService.isElementVisible(i))&&(a=e.targetElement?.fXpath,a&&(i=this.domService.getElementFromXPath(a)))));(!i||!this.domService.isElementVisible(i))&&t&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=this.getGhostCommentTargetElement(e),e?.ghostComment?.targetElement?.xpath&&(i=this.domService.getElementFromXPath(e?.ghostComment?.targetElement?.xpath)));let m=!1;if(e?.locationId){let h=this.docService.getLocation();if(!Ig({location:h?.location,locationId:h?.locationId},{location:e?.location,locationId:e?.locationId})){let _=this.docService.getAdditionLocationFromElement(i),I=_?this.docService.genarateLocationId(_):void 0;e?.location?.id&&e?.location?.id===_?.id||I&&I===e?.locationId?m=!1:m=!0}}if(m&&(e.ghostComment=null),!m&&i&&un(i)&&!i?.closest(".cdk-overlay-container")&&i?.getBoundingClientRect()){let _=this.popoverMode$?.value?0:e.targetElement?.topPercentage,I=this.popoverMode$?.value?100:e.targetElement?.leftPercentage,{height:S,width:z}=vb(i);e.position={top:S*(_||0)/100,left:z*(I||0)/100};let $=window.getComputedStyle(i).transform;if($&&$!=="none")try{let G=new DOMMatrixReadOnly($),Z=Math.sqrt(G.a*G.a+G.b*G.b)||1,ae=Math.sqrt(G.c*G.c+G.d*G.d)||1;(Math.abs(Z-1)>.01||Math.abs(ae-1)>.01)&&(e.position.parentScaleX=Z,e.position.parentScaleY=ae)}catch{}if(this.transformContext$.value){let{containerSelector:G,transforms:Z}=this.transformContext$.value,ae=document.querySelector(G);ae&&ae.contains(i)&&(e.position.transformContext=Z)}}!m&&t&&!e?.position&&!e?.ghostComment&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=e.targetElement)}t&&(e.ghostComment?this.addAnnotationToGhostCommentAnnotationMap(e):this.removeAnnotationFromGhostCommentAnnotationMap(e))}catch(a){this.loggingService.catch("Error in CommentService calculateCommentAnnotationPosition:",a)}}addComment(Ve,ht,Ze,Tt,Ue){return Pe(this,arguments,function*(e,t,a,i,c,m=[],h,_,I,S,z,$,G,Z,ae,pe,Se,oe,he,_e,Re,Ye,lt,Xe){this.loggingService.log("%c[WB] Calling FUNCTION: addComment","color: green;");try{let Lt=this.authService.getUser();if(Lt)if(Lt.isReadOnly||Lt.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add comments.");else{yield this.triggerAddCommentAnnotationDraftEvent();let We=new Nt;Se&&(We=g(g({},We),Se)),We.comments=[],Se?.comments?.length&&(We.comments=Se.comments.map(_t=>{let Ot=new qn;return Ot=g(g({},Ot),_t),Ot.from=Lt,Ot.lastUpdated=new Date,Ot.createdAt=this.timestamp,Ot})),We.from=Lt,We.color=We?.color||X.DEFAULT_ANNOTATION_COLOR,We.lastUpdated=this.timestamp,We.createdAt=this.timestamp,We.sourceId=ae,We.assignedTo=Se?.assignedTo||pe,We.customList=Se?.customList||[],Ye&&(We.targetElementId=Ye);let{topPositionX:Tu,topPositionY:Ks}=this.domService.getTopLeftPosition();We.positionX=Tu,We.positionY=Ks;let Mc=this.domService.getCurrentWindowSizeValue();if(We.screenWidth=Mc.screenWidth,We.screenHeight=Mc.screenHeight,We.screenScrollHeight=Mc.screenScrollHeight,We.taggedElementPath="",e&&(We.targetElement=this.domService.getTargetElementForCursorPosition(e,!0,!0,!0,_t=>{if(this.getSvgAsImg()){let Ot=_t?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);Ot&&Ot instanceof HTMLElement&&(_t=Ot)}if(this.getPopoverMode()){let Ot=_t?.closest(`[${X.ATTRIBUTES.VELT_TARGET_COMMENT_ELEMENT_ID}]`);if(Ot&&Ot instanceof HTMLElement)return Ot}return _t}),this.getCommentToNearestAllowedElement()&&We.targetElement?.xpath)){let _t=this.domService.getElementFromXPath(We.targetElement.xpath);if(_t&&!this.isElementInsideAllowedElements(_t)){let Ot=this.getNearestAllowedElement(_t);if(Ot)We.targetElement.xpath=this.domService.getXPath(Ot),We.targetElement.fXpath=this.domService.getXPath(Ot,!0),We.targetElement.cfXpath=this.domService.getXPath(Ot,!0,!0),We.targetElement.anchor=this.domService.generateAnchorRecord(Ot);else return}}if(t&&(We.targetTextRange=t),We?.targetElement?.xpath){let _t=this.domService.getXPath(We.targetElement.xpath);if(_t){let Ot=_t.iterateNext();Ot&&(un(Ot)||(We.targetElement=null))}}this.customFilterService.defaultStatus&&!Se?.status&&(We.status=this.customFilterService.defaultStatus),We.pageInfo=Lu(),We.pageInfo&&(We.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth);let Cy=this.docService.getClientDocumentId(),ky=this.docService.getLocation()?.location;if(he&&(We.context=he&&on(he),We.contextId=this.generateContextId(We.context)),this.commentContextProvider!==null){let _t=this.commentContextProvider(Cy,ky),Ot=_t instanceof Promise?yield _t:_t;Ot&&(We.context=Ot&&on(Ot),We.contextId=this.generateContextId(We.context),Ot?.commentType==="manual"&&(We.commentType="manual",delete We.targetElement))}if(i){We.sourceId=i?.sourceId;let _t=i?.targetElement,Ot=i?.commentData;if(_t?.targetText)We.targetTextRange={commonAncestorContainer:"/html/body",text:_t.targetText,occurrence:_t?.occurrence||1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(document.body)??void 0};else if(_t?.elementId)if(We.targetElementId=_t.elementId,_t?.selectAllContent)We.selectAllContent=!!_t?.selectAllContent;else{let Rr=zr(_t.elementId,["id","data-id"]);Rr?We.targetElement={xpath:this.domService.getXPath(Rr),fXpath:this.domService.getXPath(Rr,!0),cfXpath:this.domService.getXPath(Rr,!0,!0),anchor:this.domService.generateAnchorRecord(Rr),topPercentage:50,leftPercentage:90}:We.targetElement={xpath:"/html/body",fXpath:"/html/body",cfXpath:"/html/body",anchor:this.domService.generateAnchorRecord(document.body),topPercentage:50,leftPercentage:90}}i?.status&&(We.status=i.status),i?.context&&(We.context=i.context?on(i.context):i.context,We.contextId=this.generateContextId(We.context)),We.comments||(We.comments=[]);let Ou=this.authService.getUser();Ot?.forEach(Rr=>{let Tv=new qn;Tv.commentText=Rr.commentText,Tv.commentHtml=Rr.commentHtml,Tv.replaceContentHtml=Rr.replaceContentHtml,Tv.replaceContentText=Rr.replaceContentText,Tv.from=Ou,We.comments.push(Tv)})}if(c&&(We.isPageAnnotation=!0),m?.length&&(We.comments=m),h&&(We.commentType="chart",We.metadata=h),I?.sourceId&&(We.sourceId=I.sourceId),We?.targetElement?.xpath&&!I){let _t=this.domService.getElementFromXPath(We.targetElement.xpath);_t&&(I=this.getInlineCommentSectionConfig(_t))}I?.targetInlineCommentElementId&&(We.targetInlineCommentElementId=I?.targetInlineCommentElementId,We.targetElementId=I.targetInlineCommentElementId,I?.config?.id&&(We.inlineCommentSectionConfig=I?.config));let xy=!We?.comments?.length,_y=!!(i?.openComment===!1||_e);this.getPrivateCommentMode()&&(We?.iam||(We.iam=new Wh),We.iam.accessMode=lr.PRIVATE),S&&(We.context=S.context?on(S.context):S.context,We.commentType="manual",delete We.targetElement,We.contextId=this.generateContextId(We.context)),z&&(We.targetElementId=z.targetElementId,We.targetElement=z.targetElement);let Zp=this.getPrivateModeConfig();if(Zp)try{let _t=g({},Zp),Ot=this.authService.getUser();if(_t.type==="restricted"&&Ot?.userId&&(_t=Mn(_t,Ot.userId)),_t.type==="organizationPrivate"&&!_t.organizationId&&!_t.organizationIds?.length){let Rr=this.docService.getOrganizationConfig();Rr?.clientOrganizationId&&(_t.organizationId=Rr.clientOrganizationId)}let Ou=An(_t,Ot?.userId);We.context||(We.context={}),We.context._setAccessFields=Ou,We.visibilityConfig=Pn(_t,Ot?.userId)}catch(_t){this.loggingService.catch("Error building accessFields from privateModeConfig: ",_t)}this.saveCommentToDb(We,a,xy,_y,_,$,G,oe,Z,Re,lt,Xe)}}catch(Lt){this.loggingService.catch("Error in CommentService addComment: ",Lt)}})}triggerAddCommentAnnotationDraftEvent(){return Pe(this,null,function*(){try{this.commentAnnotationContextDraft=null;let e={addContext:a=>{this.commentAnnotationContextDraft=a}},t=yield this.commentActionsService?.getAddCommentAnnotationDraftEventFromCommentAddEventData(e);t&&this.commentActionsService?.triggerAddCommentAnnotationDraftEvent(t)}catch(e){this.loggingService.catch("Error in CommentService triggerAddCommentAnnotationDraftEvent: ",e)}})}triggerAddCommentDraftEventOnAbandon(e,t){return Pe(this,null,function*(){try{if(!e||!t)return;let a=this.getAnnotationById(e),i=!!a?.comments?.some(c=>c&&!c.isDraft);a&&i&&(yield this.commentActionsService?.triggerAddCommentDraftEventForAnnotation(a,t))}catch(a){this.loggingService.catch("Error in CommentService triggerAddCommentDraftEventOnAbandon: ",a)}})}willDeleteWholeAnnotation(e,t){try{if(!e?.comments?.length)return!1;let a=e.comments.findIndex(i=>i?.commentId===t);return a<0?!1:a===0&&this.deleteThreadWithFirstComment$.value!==!1||e.comments.length===1}catch(a){return this.loggingService.catch("Error in CommentService willDeleteWholeAnnotation: ",a),!1}}confirmDeleteCommentIfRequired(e,t){return Pe(this,null,function*(){try{if(!e?.comments?.length||!t)return!0;let a=e.comments.findIndex(h=>h?.commentId===t?.commentId);if(a<0||!(a===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value))return!0;let c;return this.deleteReplyConfirmation$.value&&(a!==0||this.deleteThreadWithFirstComment$.value===!1)?c={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:c={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!!(yield this.dialog.open(Mg,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:c}).afterClosed().toPromise())}catch(a){return this.loggingService.catch("Error in CommentService confirmDeleteCommentIfRequired: ",a),!1}})}setLocationToCommentAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let a;e.targetElement?a=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?a=zr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(a=this.domService.getElementFromTargetTextRange(e.targetTextRange));let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.addLocation({location:i,source:"internal"});c?.[0]&&(e.locationId=c[0].locationId,e.location=c[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in CommentService setLocationToCommentAnnotation:",t)}}getElementForCommentAnnotation(e){try{let t;return e.targetElement?t=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?t=zr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(t=this.domService.getElementFromTargetTextRange(e.targetTextRange)),t}catch(t){return this.loggingService.catch("Error in CommentService getElementForCommentAnnotation: ",t),null}}saveCommentToDb(e,t,a=!1,i=!1,c,m,h,_,I,S,z,$){this.loggingService.log("%c[WB] Calling FUNCTION: saveCommentToDb","color: green;");try{this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)&&this.docService.getDocumentPaths$().pipe(jt(G=>!!G),Jn(1),Me(G=>(this.documentPaths=G,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(jt(Z=>!!Z),Jn(1),Me(Z=>Pe(this,null,function*(){if(this.documentPaths?.comment){e.annotationId=this.commonDbService.generateDocumentId();let ae=this.docService.getClientDocumentId(),pe=this.docService.getLocation()?.location;if(h)e.multiThreadAnnotationId=h;else if(this.getMultiThread()){let Xe=gn();e.targetElementId&&(Xe=gn(e.targetElementId),e?.location?.id?Xe=gn([e?.location?.id,e.targetElementId]):e?.locationId&&(Xe=gn([e?.locationId+"",e.targetElementId]))),e.multiThreadAnnotationId=Xe}let Se={addContext:Xe=>{Xe.access&&(Xe.accessFields=Bc(Xe)),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADD_CONTEXT_TRIGGERED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode(),context:Xe}),e.context=Xe&&on(Xe),e.contextId=this.generateContextId(e.context),Xe?.commentType==="manual"&&(e.commentType="manual",delete e.targetElement),e?.annotationId&&setTimeout(()=>{this.updateCommentAnnotationContext(e.annotationId,Xe)},200)},documentId:ae,location:pe,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e?.annotationId,targetCommentId:e?.comments?.length?e?.comments[0]?.commentId:void 0};e?.targetElement?.xpath?Se.elementRef={xpath:e.targetElement.xpath}:Se.elementRef=void 0,this.commentAddedEmitter!==null&&"emit"in this.commentAddedEmitter&&this.commentAddedEmitter.emit(Se),this.commentAdded$.next(Se),I&&I(Se),Se?.annotation?.annotationId&&this.pendingAddCommentAnnotationData.set(Se.annotation.annotationId,Se),this.setLocationToCommentAnnotation(e);let oe=this.getElementForCommentAnnotation(e),he=this.docService.getBaseMetadata("comment",{element:oe,multiThreadAnnotationId:e.multiThreadAnnotationId});if(!he?.apiKey)return;if(e?.metadata||(e.metadata={}),e.metadata=g(g({},e.metadata),he),S&&(e.metadata=g(g({},e.metadata),S)),c&&typeof c=="object"&&(e.locationId=_||this.docService.genarateLocationId(c),e.location=c,$||this.docService.addLocation({location:c})),a)window.localStorage.setItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT,JSON.stringify(e));else{let Xe=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);Xe&&JSON.parse(Xe).annotationId===e.annotationId&&e.comments!==void 0&&e.comments.length>0&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT)}e.pageInfo&&(e.pageInfo.commentUrl=this.generateCommentUrl(e));let _e=e.comments,Re=JSON.parse(JSON.stringify(e));if(this.commentAnnotationContextDraft){let Xe=this.commentAnnotationContextDraft;this.commentAnnotationContextDraft=null,Xe.access&&(Xe.accessFields=Bc(Xe)),Re.context=Xe&&on(Xe)}if(!this.handleDirectAccessFieldsAssignment(Re?.context)&&!Re?.context?.access&&(Re?.context||(Re.context={}),Re.context.access={default:"velt"},Re.context.accessFields=[...Re.context.accessFields||[],X.DEFAULT_VELT_CONTEXT]),Re.visibilityConfig||(Re.visibilityConfig={type:"public"}),Re.position=null,t){Re.targetElement=null,Re.targetTextRange=null;let Xe={annotationId:e.multiThreadAnnotationId?e.multiThreadAnnotationId:e.annotationId,type:e.multiThreadAnnotationId?ke.MULTI_THREAD:ke.COMMENT},Ve=yield this.areaService?.generateAreaAnnotationId();Re.areaAnnotationId=Ve;let ht=this.areaService?.addArea(void 0,t,Xe,Ve,{locationId:Re.locationId,location:Re.location},Re.context);ht&&(Re.metadata=g(g({},Re.metadata),ht?.metadata||{}))}!i&&!Re?.targetInlineCommentElementId&&!Re?.isPageAnnotation&&this.domService.toggleAnnotationSelection(Re,m),e.targetTextRange&&sessionStorage.setItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e?.multiThreadAnnotationId?e?.multiThreadAnnotationId:e.annotationId),Re?.comments?.length?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADDED,{annotationId:e.annotationId,commentThreadId:Re?.comments[0]?.commentId,commentThreadIndex:0,commentType:this.getCommentType(Re),commentMode:this.getCommentMode(),source:z??"internal",commentAnnotationCreatedAt:e.createdAt,taggedClientUserIds:Re?.comments[0]?.taggedUserContacts?.map(Xe=>Xe.contact?.userId).filter(Xe=>!!Xe),taggedSnippylyUserIds:Re?.comments[0]?.taggedUserContacts?.filter(Xe=>!!Re?.metadata?.apiKey&&!!Xe.contact?.userId).map(Xe=>yg(Re.metadata.apiKey,Xe.contact.userId))}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_DRAFT_ADDED,{annotationId:e.annotationId,commentType:this.getCommentType(Re),commentMode:this.getCommentMode()});let lt=this.getAnnotationNumber(e);lt&&(Re.annotationNumber=lt),Re?.comments?.length?Re.comments=[]:Re.isDraft=!0,Re?.multiThreadAnnotationId&&this.saveMultiThreadCommentAnnotation(Re),Re?.context&&(Re.contextId=this.generateContextId(Re.context),Re.context?.commentType==="manual"&&(Re.commentType="manual",delete Re.targetElement)),_e?.length?this.saveComment(Re,{type:Ke.NEWLY_ADDED,updatedComment:_e[0]}):this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:Re}))}})))))).subscribe(()=>{},G=>{this.loggingService.catch("Error in CommentService saveCommentToDb subscription: ",G)})}catch(G){this.loggingService.catch("Error in CommentService saveCommentToDb: ",G)}}saveMultiThreadCommentAnnotation(e){return Pe(this,null,function*(){try{if(e?.multiThreadAnnotationId){let t=this.docService.getDocumentPaths();if(this.databaseService.getDbValue()&&t?.multiThread){let a={annotationId:e.multiThreadAnnotationId,targetElement:e.targetElement,targetElementId:e.targetElementId,targetInlineCommentElementId:e.targetInlineCommentElementId,inlineCommentSectionConfig:e.inlineCommentSectionConfig,areaAnnotationId:e.areaAnnotationId,targetTextRange:e.targetTextRange,from:e.from,locationId:e.locationId,location:e.location,sourceId:e.sourceId,type:"multiThread",metadata:e.metadata,context:e.context};delete e?.targetElement,delete e?.areaAnnotationId,delete e?.targetTextRange;let i=this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:t?.documentId})?.find(c=>c.annotationId===e.multiThreadAnnotationId);if(i||(i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:t?.documentId??"",organizationId:t?.organizationId??"",id:e.multiThreadAnnotationId}})),i&&(i=JSON.parse(JSON.stringify(i)),delete i.from,a=g(g({},i),a)),a?.commentAnnotations||(a.commentAnnotations={}),a.commentAnnotations[e.annotationId]=!0,e?.isDraft)this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(f(g({},this.draftMultiThreadCommentAnnotationsByAnnotationId$.value),{[a.annotationId]:f(g({},a),{isDraft:!0})}));else{let m=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[a.annotationId];if(m&&(a=g(g({},a),m)),delete a.isDraft,a.commentAnnotationsMap={},!a?.metadata?.documentId){a?.metadata||(a.metadata={});let I=this.docService.getBaseMetadata("multiThread");a.metadata=g(g({},a?.metadata),I)}let{documentId:h,organizationId:_}=a?.metadata||{};yield this.commonDbService.updateData({feature:"multiThread",properties:{id:a.annotationId,documentId:h,organizationId:_},data:JSON.parse(JSON.stringify(a)),callback:()=>{let I=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;I[e.annotationId]&&(delete I[e.annotationId],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(I))}})}return a}}return null}catch(t){return this.loggingService.catch("Error in CommentService saveMultiThreadCommentAnnotation: ",t),null}})}setCommentCategory(e){return Pe(this,null,function*(){try{if(e?.comments?.length){let t=e.comments[0].commentText?.trim();if(t){let a=yield this.getCommentCategory(t).toPromise();if(a){let i=this.docService.getDocumentPaths();if(i?.comment&&e?.annotationId){let c=this.getCommentAnnotationsOnCurrentOrganizationAndDocument()?.find(m=>m.annotationId===e.annotationId);if(c||(c=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:i?.documentId??"",organizationId:i?.organizationId??"",id:e.annotationId}})),c?.annotationId){let m=c;m.commentCategories=[a];let{documentId:h,organizationId:_}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);yield this.commonDbService.updateData({feature:"comment",properties:{id:e.annotationId,documentId:h,organizationId:_,metadata:{apiKey:this.configService.getApiKey(),organizationId:_,veltFolderId:m?.metadata?.veltFolderId,documentId:h}},data:JSON.parse(JSON.stringify(m))})}}}}}}catch(t){this.loggingService.catch("Error in CommentService setCommentCategory: ",t)}})}getCommentCategory(e){try{let t=Vu(this.functions,Bu({url:this.endpointsService.getCloudFunctionUrl("chatgptCompletion"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i=[{role:"system",content:`Identify category of this sentence from these categories, ${Object.keys(this.customCategoryMap)?.join(", ")}:`},{role:"user",content:e}];return _n(t({messages:i,apiKey:this.configService.getApiKey(),sdkVersion:rb(),sdkType:this.configService.getSdkType(),numResponse:1})).pipe(Oe(c=>{if(c?.data){let m=c.data,h=m?.length?m[0]?.content?.trim():void 0;return h&&Object.keys(this.customCategoryMap).includes(h)?this.customCategoryMap[h]:void 0}else return}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentCategory: ",t),Ee(void 0)}}handleDirectAccessFieldsAssignment(e){try{if(!e||typeof e!="object")return!1;if("_setAccessFields"in e||"_replaceAccessFields"in e){let t=e._setAccessFields??e._replaceAccessFields;return delete e.access,delete e.accessFields,Array.isArray(t)&&t.length>0?e.accessFields=t:t==null&&delete e.accessFields,delete e._setAccessFields,delete e._replaceAccessFields,!0}return!1}catch(t){return this.loggingService.catch("Error in CommentService handleDirectAccessFieldsAssignment: ",t),!1}}updateCommentAnnotationContext(e,t,a){return Pe(this,null,function*(){try{this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_TRIGGERED,{annotationId:e,context:t,merge:a?.merge});let i=this.authService.getUser(),c=this.docService.getDocumentPaths();if(i&&c?.comment&&e){let m=this.getAnnotationById(e);if(typeof m=="object"&&(m=JSON.parse(JSON.stringify(m))),m||(m=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:c?.documentId??"",organizationId:c?.organizationId??"",id:e}})),m?.annotationId){let h=t,_=JSON.parse(JSON.stringify(m.context||{}));a?.merge&&(h=g(g({},_),t));let I=this.handleDirectAccessFieldsAssignment(h);if(h&&"_setVisibilityConfig"in h&&(m.visibilityConfig=h._setVisibilityConfig,delete h._setVisibilityConfig),h&&typeof h=="object"&&!I)if("access"in t)t.access!==null&&t.access!==void 0?h.accessFields=Bc(h):(delete h.access,delete h.accessFields);else{if(!a?.merge)for(let $ of Iy)!($ in t)&&_?.[$]!==void 0&&(h[$]=_[$]);h.access!==null&&h.access!==void 0&&(h.accessFields=Bc(h))}let S={context:JSON.parse(JSON.stringify(h||{}))},z=!1;if(S?.context?.commentType==="manual"&&(S.commentType="manual",S.targetElement=null,m?.targetElement&&(m.targetElement=null,z=!0)),m.context=S.context?on(S.context):S.context,m.contextId=this.generateContextId(m.context),an(_,h)&&!z)return Promise.resolve("Comment annotation context is already updated.");if(m?.comments?.length){m.lastUpdated=this.timestamp;let{documentId:$,organizationId:G}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);return this.commonDbService.setData({feature:"comment",properties:{id:e,documentId:$,organizationId:G,metadata:{apiKey:this.configService.getApiKey(),organizationId:G,veltFolderId:m?.metadata?.veltFolderId,documentId:$}},data:JSON.parse(JSON.stringify(m)),callback:()=>{this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_SUCCESS,{annotationId:e,context:S?.context,merge:a?.merge})}})}else return this.draftCommentAnnotationsByAnnotationId$.value?.[e]?(this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e]:m})),Promise.resolve("Draft comment annotation context updated.")):(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Draft comment annotation not found."}),Promise.resolve("Draft comment annotation not found."))}else return this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Comment annotation not found in database."}),Promise.resolve("Comment annotation not found in database.")}}catch(i){return this.loggingService.catch("Error in CommentService updateCommentAnnotationContext: ",i),Promise.resolve("Error in CommentService updateCommentAnnotationContext.")}})}updateComment(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{if(this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)){if(t&&this.setLocationToCommentAnnotation(e),e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let _=h.iterateNext();_&&(un(_)||(e.targetElement=null))}}if(e?.type==="multiThread"){let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h?.context&&this.handleDirectAccessFieldsAssignment(h.context),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let S=this.docService.getBaseMetadata("multiThread");h.metadata=g(g({},h?.metadata),S)}let{documentId:_,organizationId:I}=h?.metadata||{};a?this.commonDbService.updateData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))}):this.commonDbService.setData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))})}else{this.setSubscribedUsersDataInCommentAnnotation(e);let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h.lastUpdated=this.timestamp,h.status||(h.status=this.customFilterService.defaultStatus),delete h.resolved,delete h.inProgress,this.setLocationFromDocumentParams(h),h?.context&&this.handleDirectAccessFieldsAssignment(h.context),h?.annotationId?.startsWith("TEMP_COMPOSER_"))return;let _=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);if(_&&JSON.parse(_).annotationId===h.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),h?.multiThreadAnnotationId&&!c&&this.saveMultiThreadCommentAnnotation(h).then(I=>{}),h?.comments?.length){if(delete h?.isDraft,h?.multiThreadAnnotationId&&this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[h?.multiThreadAnnotationId]&&this.saveMultiThreadCommentAnnotation(h),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let $=this.docService.getBaseMetadata("comment");h.metadata=g(g({},h?.metadata),$)}let{documentId:I,organizationId:S}=h?.metadata||{},z=i?g({annotationData:i?.commentAnnotation,targetAnnotationData:i?.targetComment,actionType:i?.actionType,notificationSource:"comment"},i?.otherFields||{}):null;this.viewsService?.updateCommentAnnotationViews(h),this.commonDbService.setData({feature:"comment",properties:{id:h.annotationId,documentId:I,targetCommentId:m?.commentId,organizationId:S,metadata:{apiKey:this.configService.getApiKey(),organizationId:S,veltFolderId:h?.metadata?.veltFolderId,documentId:I}},extraData:z,data:JSON.parse(JSON.stringify(h)),callback:$=>Pe(this,null,function*(){if(i&&!$?.firestoreAvailable&&this.updateNotificationsDatabase(i.commentAnnotation,i.targetComment,i.actionType,i.otherFields||{}),this.getScreenshotEnabled()&&i?.actionType===Ke.NEWLY_ADDED&&this.captureScreenshot(e),i?.actionType===Ke.NEWLY_ADDED||i?.actionType===Ke.ADDED)try{let G=yield this.metadataService.getGlobalMetadata(),Z={annotationId:h.annotationId,commentAnnotation:this.getCommentAnnotationForClient(h),metadata:G};this.commentActionsService?.triggerAction(dt.COMMENT_SAVED,Z)}catch(G){this.loggingService.catch("Error triggering commentSaved event: ",G)}})})}else this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:h}))}}}catch(h){this.loggingService.catch("Error in CommentService updateComment: ",h)}}captureScreenshot(e){return Pe(this,null,function*(){try{if(this.getScreenshotEnabled()){let a=Vu(this.functions,Bu({url:this.endpointsService.getCloudFunctionUrl("screenshot"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i,c={source:"velt",sourceData:{commentAnnotation:e},eventType:"screenshot"};e?.areaAnnotationId&&(i=this.areaService?.getAnnotationById(e?.areaAnnotationId),i&&(c.sourceData||(c.sourceData={}),c.sourceData.areaAnnotation=i));let m=yield Qh(c,this.authService.getUser()?.userId??"");yield a({veltData:m})}}catch(t){this.loggingService.catch("Error in CommentService captureScreenshot: ",t)}})}getDocumentIdAndOrganizationIdFromCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromCommentAnnotation: ",t),{}}}getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation: ",t),{}}}setLocationFromDocumentParams(e){e?.documentParams&&(e.location=e.documentParams,delete e.documentParams),e?.documentParamsId&&(e.locationId=e.documentParamsId,delete e.documentParamsId)}deleteCommentPinAnnotations(e){return new Promise((t,a)=>Pe(this,null,function*(){try{let i=this.domService.getSelectedAnnotationsMap(),c=this.authService.getUser(),m=[];Object.keys(i).forEach(h=>{let _=i[h];["tag","recorder","rewriter","arrow","area","multiThread"].includes(_.type)||c&&_.from&&(c?.isAdmin||_.from.userId===c.userId)&&m.push(_)}),m?.length?(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_DELETE_TRIGGERED,{triggerType:e,annotationId:m.map(h=>h.annotationId).join(),commentMode:this.getCommentMode()}),this.dialog.open(Mg,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:{title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"}}).afterClosed().pipe(Jn(1)).subscribe(h=>{try{h?(m.forEach(_=>Pe(this,null,function*(){yield this.deleteCommentPinAnnotation(_)})),setTimeout(()=>{document.querySelectorAll(`[${X.SNIPPYLY_HIGHLIGHT}]`).forEach(I=>{this.domService.removeHighlightFromElement(I)}),t()},100)):t()}catch(_){a(_)}},h=>{a(h)})):t(),this.domService.resetSelectedAnnotationsMap(!0,"comment")}catch(i){this.loggingService.catch("Error in CommentService deleteCommentPinAnnotations: ",i),a(i)}}))}deleteCommentPinAnnotation(e,t){return Pe(this,null,function*(){try{if(setTimeout(()=>{if(this.draftCommentAnnotationsByAnnotationId$?.value?.[e.annotationId]){let a=this.draftCommentAnnotationsByAnnotationId$.value;delete a[e.annotationId],this.draftCommentAnnotationsByAnnotationId$.next(a)}},50),e?.annotationId&&this.pendingAddCommentAnnotationData.delete(e.annotationId),this.authService.isFeatureAllowed(ke.COMMENT))if((t||e.comments?.length)&&this.updateNotificationsDatabase(e,null,Ke.DELETED),e.comments?.forEach(a=>{a.reactionAnnotationIds&&a.reactionAnnotationIds.forEach(i=>{this.deleteReaction(i)})}),e?.annotationId){this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_DELETED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode()});let a=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);a&&JSON.parse(a).annotationId===e.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),this.areaService?.onDeleteTargetAnnotation(e?.annotationId,e?.areaAnnotationId);let i={type:"delete",annotation:null,targetAnnotationId:e.annotationId};this.commentUpdated$.next(i),e?.multiThreadAnnotationId&&(yield this.removeCommentAnnotationFromMultiThread(e)),this.commentAnnotationDeleted$.next(e);let{documentId:c,organizationId:m}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(e);if(e?.isDraft)return Promise.resolve();{let h={annotationData:e,targetAnnotationData:null,actionType:Ke.DELETED,notificationSource:"comment",isAnnotationDelete:!0};return this.commonDbService.deleteData({feature:"comment",properties:{id:e.annotationId,documentId:c,organizationId:m,metadata:{apiKey:this.configService.getApiKey(),organizationId:m,veltFolderId:e?.metadata?.veltFolderId,documentId:c}},extraData:h})}}else return Promise.resolve();return Promise.resolve()}catch(a){return this.loggingService.catch("Error in CommentService deleteCommentPinAnnotation: ",a),Promise.resolve()}})}removeCommentAnnotationFromMultiThread(e){return Pe(this,null,function*(){try{let t=e?.multiThreadAnnotationId;if(t){let a=this.docService.getDocumentPaths(),i=this.getMultiThreadAnnotationById(t);if(!i){let _=e?.metadata?.documentId||a?.documentId,I=e?.metadata?.organizationId||a?.organizationId;i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:_,organizationId:I,id:t}})}let c=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t];i&&delete i?.commentAnnotations?.[e.annotationId],c&&(delete c?.commentAnnotations?.[e.annotationId],Object.keys(c?.commentAnnotations||{}).length===0&&(delete this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(this.draftMultiThreadCommentAnnotationsByAnnotationId$.value))),delete i.commentAnnotationsMap;let{documentId:m,organizationId:h}=this.getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(i);return Object.keys(i?.commentAnnotations||{}).length===0?(this.areaService?.onDeleteTargetAnnotation(i?.annotationId,i?.areaAnnotationId),this.multiThreadCommentAnnotationDeleted$.next(i),this.commonDbService.deleteData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h}})):this.commonDbService.setData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h},data:JSON.parse(JSON.stringify(i))})}}catch(t){this.loggingService.catch("Error in CommentService removeCommentAnnotationFromMultiThread: ",t)}})}getAnnotationById(e,t){try{let a=this.commentAnnotationById$.value?.[e]||this.draftCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromCommentAnnotationId(e){try{let t=this.commentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromCommentAnnotationId: ",t)}}isCommentAnnotationCacheLoaded(){try{return this.commentAnnotationById$.value!=null}catch(e){return this.loggingService.catch("Error in CommentService isCommentAnnotationCacheLoaded: ",e),!1}}getMultiThreadAnnotationById(e,t){try{let a=this.multiThreadCommentAnnotationById$.value?.[e]||this.draftMultiThreadCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromMultiThreadCommentAnnotationId(e){try{let t=this.multiThreadCommentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromMultiThreadCommentAnnotationId: ",t)}}getElementRefByAnnotationId(e){try{let t=this.getAnnotationById(e);if(t){let a=t?.targetElement?.xpath;if(a)return{xpath:a}}return}catch(t){this.loggingService.catch("Error in CommentService getElementRefByAnnotationId: ",t);return}}scrollToCommentByAnnotationId(e){try{let t=this.getAnnotationById(e),a=document.getElementById(`comment-pin-container-${e}`);a||(a=document.querySelector(`[data-velt-id='${e}']`)),a||(a=document.querySelector(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e}"]`)),a&&(a.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),t&&(this.domService.getSelectedAnnotationsMap()[e]||this.domService.toggleAnnotationSelection(t)))}catch(t){this.loggingService.catch("Error in CommentService scrollToCommentByAnnotationId: ",t)}}selectCommentByAnnotationId(e,t){try{this.loggingService.log("%c[WB] Calling FUNCTION: selectCommentByAnnotationId","color: green;");let a=e?this.getAnnotationById(e):void 0;a?this.domService.toggleAnnotationSelection(a,void 0,void 0,!0):this.domService.resetSelectedAnnotationsMap()}catch(a){this.loggingService.catch("Error in CommentService selectCommentByAnnotationId: ",a)}}enableAddCommentMode(){try{this.authService.isFeatureAllowed(ke.COMMENT)?!this.authService.isPlanExpired()&&this.iamService.hasRoleAny([Nv.ADMIN,Nv.COMMENTER])?(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADD_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!0)):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","User is not allowed to add comment."):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","Comment feature is not enabled.")}catch(e){this.loggingService.catch("Error in CommentService enableAddCommentMode: ",e)}}disableAddCommentMode(){this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADD_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!1)}addCommentModeChange(){return this.addCommentMode$.asObservable()}setFreeStyleCommentContext(e){try{this.freeStyleCommentContext=e}catch(t){this.loggingService.catch("Error in CommentService setFreeStyleCommentContext: ",t)}}clearFreeStyleCommentContext(){try{this.freeStyleCommentContext=void 0}catch(e){this.loggingService.catch("Error in CommentService resetFreeStyleCommentContext: ",e)}}enablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!0}}),this.persistentCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePersistentCommentMode: ",e)}}enableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!0}}),this.deleteReplyConfirmation$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteReplyConfirmation: ",e)}}enableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!0}}),this.seenByUsers$.value===!0)return;this.seenByUsers$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSeenByUsers: ",e)}}disableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!1}}),this.seenByUsers$.value===!1)return;this.seenByUsers$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSeenByUsers: ",e)}}getSeenByUsers$(){return this.seenByUsers$.asObservable()}disableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!1}}),this.deleteReplyConfirmation$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteReplyConfirmation: ",e)}}disablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!1}}),this.persistentCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePersistentCommentMode: ",e)}}persistentCommentModeChange(){return this.persistentCommentMode$.asObservable()}enablePersistentModeBanner(){this.persistentModeBanner$.next(!0)}disablePersistentModeBanner(){this.persistentModeBanner$.next(!1)}persistentModeBannerChange(){return this.persistentModeBanner$.asObservable()}setAssignToType(e){try{this.assignToType$.next(e.type)}catch(t){this.loggingService.catch("Error in CommentService setAssignToType: ",t)}}getAssignToType$(){return this.assignToType$.asObservable()}getAssignToType(){return this.assignToType$.value}setPageModeComposerContext(e){try{this.pageModeComposerContext$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPageModeComposerContext: ",t)}}clearPageModeComposerContext(){try{this.pageModeComposerContext$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearPageModeComposerContext: ",e)}}getPageModeComposerContext$(){return this.pageModeComposerContext$.asObservable()}getPageModeComposerContext(){return this.pageModeComposerContext$.value}enableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableContextInPageModeComposer: ",e)}}disableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableContextInPageModeComposer: ",e)}}getContextInPageModeComposer$(){return this.contextInPageModeComposer$.asObservable()}getContextInPageModeComposer(){return this.contextInPageModeComposer$.value}focusPageModeComposer(){try{this.focusPageModeComposer$.next()}catch(e){this.loggingService.catch("Error in CommentService focusPageModeComposer: ",e)}}getFocusPageModeComposer$(){return this.focusPageModeComposer$.asObservable()}showCommentIndex(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentIndex:e}}),this.showCommentIndex$.value===e)return;this.showCommentIndex$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showCommentIndex: ",t)}}getShowCommentIndex(){return this.showCommentIndex$.asObservable()}enablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!0}}),this.popoverMode$.value===!0)return;this.popoverMode$.next(!0),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_POPOVER_MODE_ENABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService enablePopoverMode: ",e)}}disablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!1}}),this.popoverMode$.value===!1)return;this.popoverMode$.next(!1),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_POPOVER_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService disablePopoverMode: ",e)}}getPopoverMode(){try{return this.popoverMode$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverMode: ",e),!1}}getPopoverMode$(){return this.popoverMode$.asObservable()}enablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!0}}),this.popoverTriangleComponent$.value===!0)return;this.popoverTriangleComponent$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePopoverTriangleComponent: ",e)}}disablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!1}}),this.popoverTriangleComponent$.value===!1)return;this.popoverTriangleComponent$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePopoverTriangleComponent: ",e)}}getPopoverTriangleComponent(){try{return this.popoverTriangleComponent$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverTriangleComponent: ",e),!1}}getPopoverTriangleComponent$(){return this.popoverTriangleComponent$.asObservable()}enableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!0}}),this.draftMode$.value===!0)return;this.draftMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDraftMode: ",e)}}disableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!1}}),this.draftMode$.value===!1)return;this.draftMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDraftMode: ",e)}}getDraftMode$(){return this.draftMode$.asObservable()}getDraftMode(){return this.draftMode$.value}enableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!0}}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_TEXT_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!0)return;this.textCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextComments: ",e)}}disableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!1}}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_TEXT_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!1)return;this.textCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextComments: ",e)}}getTextCommentMode$(){return this.textCommentMode$.asObservable()}isUserGlobalContact$(){return this.contactService.isUserGlobalContact$()}isSidebarOpenedByCustomTrigger(){try{return this.sidebarOpenedByCustomTrigger$.value}catch(e){return this.loggingService.catch("Error in CommentService isSidebarOpenedByCustomTrigger: ",e),!1}}setSidebarVisibility(e,t=!1,a=!1){try{this.domService.resetSelectedAnnotationsMap(),e?(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?this.sidebarVisible$.next(e):this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),t&&this.sidebarOpenedByCustomTrigger$.next(!0)):(!this.sidebarOpenedByCustomTrigger$.value||t||a)&&(this.sidebarVisible$.next(e),this.sidebarOpenedByCustomTrigger$.next(!1),this.clearPageModeComposerContext()),e?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_OPENED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_CLOSED,{commentMode:this.getCommentMode()})}catch{this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}toggleSidebarVisibility(e=!1,t=!1){try{this.domService.resetSelectedAnnotationsMap(),this.sidebarVisible$.value?(!this.sidebarOpenedByCustomTrigger$.value||e||t)&&(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarOpenedByCustomTrigger$.next(!1),this.sidebarVisible$.value||this.clearPageModeComposerContext()):(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarVisible$.value?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"closed"}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"opened"})):this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),e&&this.sidebarOpenedByCustomTrigger$.next(!0))}catch{this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}getSidebarVisibility$(){return this.sidebarVisible$.asObservable()}disableFloatingComments(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{floatingCommentDialog:!e}}),this.floatingCommentsEnabled$.value===!e)return;this.floatingCommentsEnabled$.next(!e)}catch(t){this.loggingService.catch("Error in CommentService disableFloatingComments: ",t)}}showFloatingComments$(){return this.floatingCommentsEnabled$.asObservable()}showFloatingComments(){return this.floatingCommentsEnabled$.value}setModeratorMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{moderatorMode:e}}),this.moderatorMode$.value===e)return;this.moderatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setModeratorMode: ",t)}}getModeratorMode(){return this.moderatorMode$.value}getModeratorMode$(){return this.moderatorMode$.asObservable()}setStreamMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{streamMode:e}}),this.streamMode$.value===e)return;this.streamMode$.next(e),e?this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_STREAM_MODE_ENABLED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_STREAM_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(t){this.loggingService.catch("Error in CommentService setStreamMode: ",t)}}getStreamMode(){return this.streamMode$.value}getStreamMode$(){return this.streamMode$.asObservable()}getEnableDialogOnHover(){return this.enableDialogOnHover$.value}getEnableDialogOnHover$(){return this.enableDialogOnHover$.asObservable()}setEnableDialogOnHover(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnHover:e}}),this.enableDialogOnHover$.value===e)return;this.enableDialogOnHover$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnHover: ",t)}}getEnableDialogOnTargetElementClick(){return this.enableDialogOnTargetElementClick$.value}getEnableDialogOnTargetElementClick$(){return this.enableDialogOnTargetElementClick$.asObservable()}setEnableDialogOnTargetElementClick(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnTargetElementClick:e}}),this.enableDialogOnTargetElementClick$.value===e)return;this.enableDialogOnTargetElementClick$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnTargetElementClick: ",t)}}getEnablePriority(){return this.enablePriority$.value}getEnablePriority$(){return this.enablePriority$.asObservable()}setEnablePriority(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{priority:e}}),this.enablePriority$.value===e)return;this.enablePriority$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnablePriority: ",t)}}getEnableStatus(){return this.enableStatus$.value}getEnableStatus$(){return this.enableStatus$.asObservable()}setEnableStatus(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{status:e}}),this.getEnableStatus()===e)return;this.enableStatus$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableStatus: ",t)}}getEnableVisibilityOptions(){return this.visibilityOptions$.value}getEnableVisibilityOptions$(){return this.visibilityOptions$.asObservable()}setEnableVisibilityOptions(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{visibilityOptions:e}}),this.visibilityOptions$.value===e)return;this.visibilityOptions$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableVisibilityOptions: ",t)}}getEnableResolve(){return this.enableResolve$.value}getEnableResolve$(){return this.enableResolve$.asObservable()}setEnableResolve(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveButton:e}}),this.getEnableResolve()===e)return;this.enableResolve$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableResolve: ",t)}}getEnableGhostComments(){return this.enableGhostComments$.value}getEnableGhostComments$(){return this.enableGhostComments$.asObservable()}enableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!0}}),this.enableGhostComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGhostComments: ",e)}}disableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!1}}),this.enableGhostComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGhostComments: ",e)}}getEnableGhostCommentsMessage(){return this.enableGhostCommentsMessage$.value}getEnableGhostCommentsMessage$(){return this.enableGhostCommentsMessage$.asObservable()}enableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!0}}),this.enableGhostCommentsMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowGhostCommentsMessage: ",e)}}disableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!1}}),this.enableGhostCommentsMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowGhostCommentsMessage: ",e)}}enableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!0}}),this.inboxMode$.value===!0)return;this.inboxMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInboxMode: ",e)}}disableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!1}}),this.inboxMode$.value===!1)return;this.inboxMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInboxMode: ",e)}}getInboxMode(){return this.inboxMode$.value}getInboxMode$(){return this.inboxMode$.asObservable()}setEnableAutoCategorize(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCategorize:e}}),this.enableAutoCategorize$.value===e)return;this.enableAutoCategorize$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableAutoCategorize: ",t)}}getEnableAutoCategorize(){return this.enableAutoCategorize$.value}getEnableAutoCategorize$(){return this.enableAutoCategorize$.asObservable()}setCommentContainerDarkMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{darkMode:e}}),this.commentContainerDarkMode$.value===e)return;this.commentContainerDarkMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentContainerDarkMode: ",t)}}getCommentContainerDarkMode(){return this.commentContainerDarkMode$.asObservable()}getSuggestionMode(){return this.suggestionMode$.value}getSuggestionMode$(){return this.suggestionMode$.asObservable()}setSuggestionMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{suggestionMode:e}}),this.getSuggestionMode()===e)return;this.suggestionMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSuggestionMode: ",t)}}getMobileMode(){return this.mobileMode$.value}getMobileMode$(){return this.mobileMode$.asObservable()}setMobileMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{mobileMode:e}}),this.getMobileMode()===e)return;this.mobileMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMobileMode: ",t)}}enableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!0}}),this.inlineCommentMode$.value===!0)return;this.inlineCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInlineCommentMode: ",e)}}disableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!1}}),this.inlineCommentMode$.value===!1)return;this.inlineCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInlineCommentMode: ",e)}}getInlineCommentMode(){return this.inlineCommentMode$.value}getInlineCommentMode$(){return this.inlineCommentMode$.asObservable()}enableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!0}}),this.minimap$.value===!0)return;this.minimap$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMinimap: ",e)}}disableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!1}}),this.minimap$.value===!1)return;this.minimap$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMinimap: ",e)}}getMinimap(){return this.minimap$.value}getMinimap$(){return this.minimap$.asObservable()}showCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!0}}),this.commentsOnDom$.value===!0)return;this.commentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showCommentsOnDom: ",e)}}hideCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!1}}),this.commentsOnDom$.value===!1)return;this.commentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideCommentsOnDom: ",e)}}getCommentsOnDom(){return this.commentsOnDom$.value}getCommentsOnDom$(){return this.commentsOnDom$.asObservable()}enableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!0}}),this.commentToolEnabled$.value===!0)return;this.commentToolEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentTool: ",e)}}disableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!1}}),this.commentToolEnabled$.value===!1)return;this.commentToolEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentTool: ",e)}}getCommentTool(){return this.commentToolEnabled$.value}getCommentTool$(){return this.commentToolEnabled$.asObservable()}setTotalMediaLength(e){try{if(this.totalMediaLength$.value===e)return;this.totalMediaLength$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setTotalMediaLength: ",t)}}getTotalMediaLength(){return this.totalMediaLength$.value}getTotalMediaLength$(){return this.totalMediaLength$.asObservable()}enableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!0}}),this.sidebarUrlNavigationEnabled$.value===!0)return;this.sidebarUrlNavigationEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarUrlNavigation: ",e)}}disableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!1}}),this.sidebarUrlNavigationEnabled$.value===!1)return;this.sidebarUrlNavigationEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarUrlNavigation: ",e)}}getSidebarUrlNavigation(){return this.sidebarUrlNavigationEnabled$.value}getSidebarUrlNavigation$(){return this.sidebarUrlNavigationEnabled$.asObservable()}setDetectionStrategy(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{detectionStrategy:e}}),this.detectionStrategy$.value===e)return;this.detectionStrategy$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setDetectionStrategy: ",t)}}getDetectionStrategy(){return this.detectionStrategy$.value}getDetectionStrategy$(){return this.detectionStrategy$.asObservable()}enableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!0}}),this.sidebarButtonOnCommentDialogVisible$.value===!0)return;this.sidebarButtonOnCommentDialogVisible$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarButtonOnCommentDialog: ",e)}}disableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!1}}),this.sidebarButtonOnCommentDialogVisible$.value===!1)return;this.sidebarButtonOnCommentDialogVisible$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarButtonOnCommentDialog: ",e)}}getSidebarButtonOnCommentDialogVisibility(){return this.sidebarButtonOnCommentDialogVisible$.value}getSidebarButtonOnCommentDialogVisibility$(){return this.sidebarButtonOnCommentDialogVisible$.asObservable()}onSidebarButtonOnCommentDialogClick(){this.sidebarButtonOnCommentDialogClick$.next()}getSidebarButtonOnCommentDialogClick$(){return this.sidebarButtonOnCommentDialogClick$.asObservable()}enableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!0}}),this.deviceIndicatorOnCommentPins$.value===!0)return;this.deviceIndicatorOnCommentPins$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeviceIndicatorOnCommentPins: ",e)}}disableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!1}}),this.deviceIndicatorOnCommentPins$.value===!1)return;this.deviceIndicatorOnCommentPins$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeviceIndicatorOnCommentPins: ",e)}}getDeviceIndicatorOnCommentPins(){return this.deviceIndicatorOnCommentPins$.value}getDeviceIndicatorOnCommentPins$(){return this.deviceIndicatorOnCommentPins$.asObservable()}onSidebarCommentClick(e){this.sidebarCommentClick$.next(e)}getSidebarCommentClick$(){return this.sidebarCommentClick$.asObservable()}onCommentNavigationButtonClick(e){this.commentNavigationButtonClick$.next(e)}getCommentNavigationButtonClick$(){return this.commentNavigationButtonClick$.asObservable()}addBubbleCommentAnnotationIds(e){try{let a=[...this.bubbleCommentAnnotationIds$.value||[],...e],i=[...new Set(a)];this.bubbleCommentAnnotationIds$.next(i)}catch(t){this.loggingService.catch("Error in CommentService addBubbleCommentAnnotationIds: ",t)}}getBubbleCommentAnnotationIds(){return this.bubbleCommentAnnotationIds$.value}getBubbleCommentAnnotationIds$(){return this.bubbleCommentAnnotationIds$.asObservable()}removeBubbleCommentAnnotationIds(e){try{let a=(this.bubbleCommentAnnotationIds$.value||[]).filter(i=>!e.includes(i));this.bubbleCommentAnnotationIds$.next(a)}catch(t){this.loggingService.catch("Error in CommentService removeBubbleCommentAnnotationIds: ",t)}}enableSignInButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{signInButton:e}}),this.enableSignInButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableSignInButton: ",t)}}getSignInButton(){return this.enableSignInButton$.value}getSignInButton$(){return this.enableSignInButton$.asObservable()}onSignInClick(){this.onSignInClick$.next()}getSignInButtonClick$(){return this.onSignInClick$.asObservable()}enableUpgradeButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{upgradeButton:e}}),this.enableUpgradeButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableUpgradeButton: ",t)}}getUpgradeButton(){return this.enableUpgradeButton$.value}getUpgradeButton$(){return this.enableUpgradeButton$.asObservable()}onUpgradeClick(){this.onUpgradeClick$.next()}getUpgradeButtonClick$(){return this.onUpgradeClick$.asObservable()}openSidebar(){this.openSidebar$.next()}getOpenSidebar$(){return this.openSidebar$.asObservable()}enableAttachment(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachments:e}}),this.enableAttachment$.value===e)return;this.enableAttachment$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableAttachment: ",t)}}getEnableAttachment$(){return this.enableAttachment$.asObservable()}enableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!0}}),this.enableAttachmentDownload$.value===!0)return;this.enableAttachmentDownload$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentDownload: ",e)}}disableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!1}}),this.enableAttachmentDownload$.value===!1)return;this.enableAttachmentDownload$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentDownload: ",e)}}getEnableAttachmentDownload$(){return this.enableAttachmentDownload$.asObservable()}getEnableAttachmentDownload(){return this.enableAttachmentDownload$.value}enableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!0}}),this.enableFormatOptions$.value===!0)return;this.enableFormatOptions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFormatOptions: ",e)}}disableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!1}}),this.enableFormatOptions$.value===!1)return;this.enableFormatOptions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFormatOptions: ",e)}}getEnableFormatOptions$(){return this.enableFormatOptions$.asObservable()}setFormatConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatConfig:e}}),this.formatConfig$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setFormatConfig: ",t)}}getFormatConfig$(){return this.formatConfig$.asObservable()}setAllowedRecordings(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordings:e}}),e?.includes("all")?this.allowedRecordings$.next(["audio","video","screen"]):e?.includes("none")?this.allowedRecordings$.next([]):this.allowedRecordings$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedRecordings: ",t)}}getAllowedRecordings(){return this.allowedRecordings$.value}getAllowedRecordings$(){return this.allowedRecordings$.asObservable()}enableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!0}}),this.enableReactions$.value===!0)return;this.enableReactions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReactions: ",e)}}disableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!1}}),this.enableReactions$.value===!1)return;this.enableReactions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReactions: ",e)}}getEnableReactions(){return this.enableReactions$.value}getEnableReactions$(){return this.enableReactions$.asObservable()}enableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!0)return;this.enableAnonymousEmail$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAnonymousEmail: ",e)}}disableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!1)return;this.enableAnonymousEmail$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAnonymousEmail: ",e)}}getEnableAnonymousEmail(){return this.enableAnonymousEmail$.value}getEnableAnonymousEmail$(){return this.enableAnonymousEmail$.asObservable()}addCommentOnElement(e){this.addComment(void 0,void 0,void 0,e)}enablePrivateCommentMode(){return Pe(this,null,function*(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!0}}),this.privateCommentMode$.value===!0)return;this.isPrivateCommentAllowed$().pipe(Jn(1)).subscribe(e=>{e?(this.privateCommentMode$.next(!0),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_ENABLED)):this.loggingService.logsEnabled&&console.warn("You are not allowed to enable private comment mode.")})}catch(e){this.loggingService.catch("Error in CommentService enablePrivateCommentMode: ",e)}})}disablePrivateCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!1}}),this.privateCommentMode$.value===!1)return;this.privateCommentMode$.next(!1),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_DISABLED)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateCommentMode: ",e)}}getPrivateCommentMode(){return this.privateCommentMode$.value}getPrivateCommentMode$(){return this.privateCommentMode$.asObservable()}isPrivateCommentAllowed(){return this.privateCommentAllowed$.value}isPrivateCommentAllowed$(){return this.privateCommentAllowed$.asObservable()}enablePrivateMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:e}}),!e?.type){this.loggingService.catch("enablePrivateMode: type is required in config");return}let t=g({},e);if(t.type==="restricted"){let a=this.authService.getUser();if(!a?.userId){this.loggingService.catch("enablePrivateMode: Current user not found. Cannot set restricted visibility without userIds.");return}t=Mn(t,a.userId)}this.privateModeConfig$.next(t)}catch(t){this.loggingService.catch("Error in CommentService enablePrivateMode: ",t)}}disablePrivateMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:null}}),this.privateModeConfig$.value===null)return;this.privateModeConfig$.next(null)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateMode: ",e)}}getPrivateModeConfig(){return this.privateModeConfig$.value}getPrivateModeConfig$(){return this.privateModeConfig$.asObservable()}enableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!0}}),this.scrollToComment$.value===!0)return;this.scrollToComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScrollToComment: ",e)}}disableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!1}}),this.scrollToComment$.value===!1)return;this.scrollToComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScrollToComment: ",e)}}getScrollToComment(){return this.scrollToComment$.value}getScrollToComment$(){return this.scrollToComment$.asObservable()}showScreenSizeInfo(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceInfo:e}}),this.showScreenSizeInfo$.value===e)return;this.showScreenSizeInfo$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showScreenSizeInfo: ",t)}}getShowScreenSizeInfo$(){return this.showScreenSizeInfo$.asObservable()}enableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!0}}),this.userMentions$.value===!0)return;this.userMentions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableUserMentions: ",e)}}disableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!1}}),this.userMentions$.value===!1)return;this.userMentions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableUserMentions: ",e)}}getUserMentions(){return this.userMentions$.value}getUserMentions$(){return this.userMentions$.asObservable()}enablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!0)return;this.paginatedContactList$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePaginatedContactList: ",e)}}disablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!1)return;this.paginatedContactList$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePaginatedContactList: ",e)}}getPaginatedContactList(){return this.paginatedContactList$.value}getPaginatedContactList$(){return this.paginatedContactList$.asObservable()}enableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!0}}),this.deleteOnBackspace$.value===!0)return;this.deleteOnBackspace$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteOnBackspace: ",e)}}disableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!1}}),this.deleteOnBackspace$.value===!1)return;this.deleteOnBackspace$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteOnBackspace: ",e)}}getDeleteOnBackspace(){return this.deleteOnBackspace$.value}getDeleteOnBackspace$(){return this.deleteOnBackspace$.asObservable()}enableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!0}}),this.hotkeyEnabled$.value===!0)return;this.hotkeyEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableHotkey: ",e)}}disableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!1}}),this.hotkeyEnabled$.value===!1)return;this.hotkeyEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableHotkey: ",e)}}enableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!0}}),this.recordingSummaryEnabled$.value===!0)return;this.recordingSummaryEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRecordingSummary: ",e)}}disableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!1}}),this.recordingSummaryEnabled$.value===!1)return;this.recordingSummaryEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRecordingSummary: ",e)}}getRecordingSummaryEnabled(){return this.recordingSummaryEnabled$.value}getRecordingSummaryEnabled$(){return this.recordingSummaryEnabled$.asObservable()}setUnreadIndicatorMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setUnreadIndicatorMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{unreadIndicatorMode:e}}),this.unreadIndicatorMode$.value===e)return;this.unreadIndicatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setUnreadIndicatorMode: ",t)}}getUnreadIndicatorMode(){return this.unreadIndicatorMode$.value}getUnreadIndicatorMode$(){return this.unreadIndicatorMode$.asObservable()}setComposerMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setComposerMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{composerMode:e}}),this.composerMode$.value===e)return;this.composerMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerMode: ",t)}}getComposerMode(){return this.composerMode$.value}getComposerMode$(){return this.composerMode$.asObservable()}enableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!0}}),this.enterKeyToSubmit$.value===!0)return;this.enterKeyToSubmit$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableEnterKeyToSubmit: ",e)}}disableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!1}}),this.enterKeyToSubmit$.value===!1)return;this.enterKeyToSubmit$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableEnterKeyToSubmit: ",e)}}getEnterKeyToSubmit(){return this.enterKeyToSubmit$.value}getEnterKeyToSubmit$(){return this.enterKeyToSubmit$.asObservable()}enablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!0}}),this.pinShadowDOM$.value===!0)return;this.pinShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinShadowDOM: ",e)}}disablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!1}}),this.pinShadowDOM$.value===!1)return;this.pinShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinShadowDOM: ",e)}}getPinShadowDOM(){return this.pinShadowDOM$.value}getPinDarkMode(){return this.pinDarkMode$.value}getPinDarkMode$(){return this.pinDarkMode$.asObservable()}getTextCommentToolDarkMode(){return this.textCommentToolDarkMode$.value}getTextCommentToolDarkMode$(){return this.textCommentToolDarkMode$.asObservable()}getTextCommentToolbarDarkMode(){return this.textCommentToolbarDarkMode$.value}getTextCommentToolbarDarkMode$(){return this.textCommentToolbarDarkMode$.asObservable()}getPinShadowDOM$(){return this.pinShadowDOM$.asObservable()}getTextCommentToolShadowDOM$(){return this.textCommentToolShadowDOM$.asObservable()}getTextCommentToolbarShadowDOM$(){return this.textCommentToolbarShadowDOM$.asObservable()}enableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!0}}),this.dialogShadowDOM$.value===!0)return;this.dialogShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDialogShadowDOM: ",e)}}enableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!0}}),this.textCommentToolbarShadowDOM$.value===!0)return;this.textCommentToolbarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarShadowDOM: ",e)}}disableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!1}}),this.textCommentToolbarShadowDOM$.value===!1)return;this.textCommentToolbarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarShadowDOM: ",e)}}enableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!0}}),this.textCommentToolShadowDOM$.value===!0)return;this.textCommentToolShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolShadowDOM: ",e)}}disableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!1}}),this.textCommentToolShadowDOM$.value===!1)return;this.textCommentToolShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolShadowDOM: ",e)}}enableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!0}}),this.textCommentToolDarkMode$.value===!0)return;this.textCommentToolDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolDarkMode: ",e)}}disableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!1}}),this.textCommentToolDarkMode$.value===!1)return;this.textCommentToolDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolDarkMode: ",e)}}enableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!0}}),this.textCommentToolbarDarkMode$.value===!0)return;this.textCommentToolbarDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarDarkMode: ",e)}}disableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!1}}),this.textCommentToolbarDarkMode$.value===!1)return;this.textCommentToolbarDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarDarkMode: ",e)}}enablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!0}}),this.pinDarkMode$.value===!0)return;this.pinDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDarkMode: ",e)}}disablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!1}}),this.pinDarkMode$.value===!1)return;this.pinDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDarkMode: ",e)}}disableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!1}}),this.dialogShadowDOM$.value===!1)return;this.dialogShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDialogShadowDOM: ",e)}}getDialogShadowDOM(){return this.dialogShadowDOM$.value}getDialogShadowDOM$(){return this.dialogShadowDOM$.asObservable()}setDialogShadowDOMExplicit(e){this.dialogShadowDOMExplicit$.next(e)}getDialogShadowDOMExplicit$(){return this.dialogShadowDOMExplicit$.asObservable()}enableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!0}}),this.sidebarShadowDOM$.value===!0)return;this.sidebarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarShadowDOM: ",e)}}disableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!1}}),this.sidebarShadowDOM$.value===!1)return;this.sidebarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarShadowDOM: ",e)}}getSidebarShadowDOM(){return this.sidebarShadowDOM$.value}getSidebarShadowDOM$(){return this.sidebarShadowDOM$.asObservable()}enableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!0}}),this.changeDetectionInCommentMode$.value===!0)return;this.changeDetectionInCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableChangeDetectionInCommentMode: ",e)}}disableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!1}}),this.changeDetectionInCommentMode$.value===!1)return;this.changeDetectionInCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableChangeDetectionInCommentMode: ",e)}}getChangeDetectionInCommentMode(){return this.changeDetectionInCommentMode$.value}getChangeDetectionInCommentMode$(){return this.changeDetectionInCommentMode$.asObservable()}showResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!0}}),this.resolvedCommentsOnDom$.value===!0)return;this.resolvedCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showResolvedCommentsOnDom: ",e)}}hideResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!1}}),this.resolvedCommentsOnDom$.value===!1)return;this.resolvedCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideResolvedCommentsOnDom: ",e)}}getResolvedCommentsOnDom(){return this.resolvedCommentsOnDom$.value}getResolvedCommentsOnDom$(){return this.resolvedCommentsOnDom$.asObservable()}enableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!0}}),this.bubbleOnPinEnabled$.value===!0)return;this.bubbleOnPinEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPin: ",e)}}disableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!1}}),this.bubbleOnPinEnabled$.value===!1)return;this.bubbleOnPinEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPin: ",e)}}getBubbleOnPin(){return this.bubbleOnPinEnabled$.value}getBubbleOnPin$(){return this.bubbleOnPinEnabled$.asObservable()}enableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!0}}),this.bubbleOnPinHoverEnabled$.value===!0)return;this.bubbleOnPinHoverEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPinHover: ",e)}}disableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!1}}),this.bubbleOnPinHoverEnabled$.value===!1)return;this.bubbleOnPinHoverEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPinHover: ",e)}}getBubbleOnPinHover(){return this.bubbleOnPinHoverEnabled$.value}getBubbleOnPinHover$(){return this.bubbleOnPinHoverEnabled$.asObservable()}enablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!0}}),this.pinDragEnabled$.value===!0)return;this.pinDragEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDrag: ",e)}}disablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!1}}),this.pinDragEnabled$.value===!1)return;this.pinDragEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDrag: ",e)}}getPinDrag(){return this.pinDragEnabled$.value}getPinDrag$(){return this.pinDragEnabled$.asObservable()}setExcludeLocationIdsFromSidebar(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{excludeLocationIdsFromSidebar:e}}),this.excludeLocationIdsFromSidebar$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setExcludeLocationIdsFromSidebar: ",t)}}getExcludeLocationIdsFromSidebar(){return this.excludeLocationIdsFromSidebar$.value}getExcludeLocationIdsFromSidebar$(){return this.excludeLocationIdsFromSidebar$.asObservable()}enableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!0}}),this.multiThread$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMultiThread: ",e)}}disableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!1}}),this.multiThread$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMultiThread: ",e)}}getMultiThread(){return this.multiThread$.value}getMultiThread$(){return this.multiThread$.asObservable()}enableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!0}}),this.groupMatchedComments$.value===!0)return;this.groupMatchedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGroupMatchedComments: ",e)}}disableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!1}}),this.groupMatchedComments$.value===!1)return;this.groupMatchedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGroupMatchedComments: ",e)}}getGroupMatchedComments(){return this.groupMatchedComments$.value}getGroupMatchedComments$(){return this.groupMatchedComments$.asObservable()}enableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!0}}),this.restrictTextSearchToAnchor$.value===!0)return;this.restrictTextSearchToAnchor$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRestrictTextSearchToAnchor: ",e)}}disableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!1}}),this.restrictTextSearchToAnchor$.value===!1)return;this.restrictTextSearchToAnchor$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRestrictTextSearchToAnchor: ",e)}}getRestrictTextSearchToAnchor(){return this.restrictTextSearchToAnchor$.value}getRestrictTextSearchToAnchor$(){return this.restrictTextSearchToAnchor$.asObservable()}enableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!0}}),this.shortUserName$.value===!0)return;this.shortUserName$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShortUserName: ",e)}}disableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!1}}),this.shortUserName$.value===!1)return;this.shortUserName$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShortUserName: ",e)}}getShortUserName(){return this.shortUserName$.value}getShortUserName$(){return this.shortUserName$.asObservable()}enableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!0}}),this.serviceBook.get(ln)?.enableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService enableRecordingCountdown: ",e)}}disableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!1}}),this.serviceBook.get(ln)?.disableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService disableRecordingCountdown: ",e)}}setCommentSidebarFilters(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentSidebarFilters","color: green;"),this.commentSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarFilters: ",t)}}getCommentSidebarFilters(){return this.commentSidebarFilters$.value??{}}getCommentSidebarFilters$(){return this.commentSidebarFilters$.asObservable()}setEffectiveSidebarFilters(e){try{this.effectiveSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEffectiveSidebarFilters: ",t)}}getEffectiveSidebarFilters$(){return this.effectiveSidebarFilters$.asObservable()}setCommentSidebarSystemFiltersOperator(e){try{this.commentSidebarSystemFiltersOperator$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarSystemFiltersOperator: ",t)}}getCommentSidebarSystemFiltersOperator(){return this.commentSidebarSystemFiltersOperator$.value}getCommentSidebarSystemFiltersOperator$(){return this.commentSidebarSystemFiltersOperator$.asObservable()}enableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!0}}),this.domService.enableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService enableCommentPinHighlighter: ",e)}}disableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!1}}),this.domService.disableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService disableCommentPinHighlighter: ",e)}}setCustomReactions(e){try{this.reactionService?.setCustomReactions(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomReactions: ",t)}}onCommentSelectionChange$(){return this.commentSelectionChange$.asObservable()}onVisibilityOptionClicked$(){return this.visibilityOptionClicked$.asObservable()}emitVisibilityOptionClicked(e){this.visibilityOptionClicked$.next(e)}onCommentAdd$(){return this.commentAdded$.asObservable()}onCommentUpdate$(){return this.commentUpdated$.asObservable()}onCommentAnnotationDelete$(){return this.commentAnnotationDeleted$.asObservable()}onMultiThreadCommentAnnotationDelete$(){return this.multiThreadCommentAnnotationDeleted$.asObservable()}getCommentMode(){try{let e="freestyle";return this.getStreamMode()?e="stream":this.getPopoverMode()&&(e="popover"),e}catch(e){return this.loggingService.catch("Error in CommentService getCommentMode: ",e),"freestyle"}}getCommentType(e){try{return e.targetElement?"element":e.targetTextRange?"text":e.areaAnnotationId?"area":""}catch(t){return this.loggingService.catch("Error in CommentService getCommentType: ",t),""}}getCommentAnnotationAvailableOnXPath(e,t,a){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(i=>(!a&&t&&(a=zr(t,["id","data-id"])),Ee(f(g({},i),{element:a})))),Me(i=>this.getLocations$().pipe(Oe(c=>f(g({},i),{locationIds:c})))),Oe(({locationIds:i,element:c})=>{let m=[],h=this.docService.getDocumentPaths();if(h?.documentId){let _=this.docService.getAdditionalDocumentIdFromElement(c),I=_?this.docService.generateDocumentId(_):h?.documentId,S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:h?.organizationId,documentId:I||""});if(S)for(let z of S)(t&&z?.targetElementId===t||z?.targetElement?.xpath===e)&&i?.includes(z?.locationId)&&m.push(z)}return m.length?m:null}))}catch(i){return this.loggingService.catch("Error in CommentService isCommentAnnotationAvailableOnXPath: ",i),Ee(null)}}getCommentAnnotationsByContext({context:e,contextOptions:t,element:a,clientDocumentId:i}){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(()=>this.docService.getDocumentPaths$()),Oe(()=>{let c=null,m=this.docService.getDocumentPaths(),h=on(e),_=this.generateContextId(h);if(m?.documentId){let I=i||this.docService.getAdditionalDocumentIdFromElement(a??null),S=I?this.docService.generateDocumentId(I):m?.documentId,z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:m?.organizationId,documentId:S||""});if(z){c=[];for(let $ of z)t?.partialMatch?Zh($?.context,h)&&c.push($):_&&$?.contextId===_&&c.push($)}}return c}))}catch(c){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByContext: ",c),Ee(null)}}getCommentAnnotationByAnnotationId(e){try{return this.commentAnnotationById$.pipe(Oe(()=>this.getAnnotationById(e)),Me(t=>t?t?.iam?.accessMode===lr.PRIVATE?this.isPrivateCommentAllowed$().pipe(Oe(a=>{if(a)return t})):Ee(t):Ee(t)),Me(t=>t?this.filterCommentsUsingSidebarSettings(t).pipe(Oe(a=>{if(a)return a})):Ee(t)))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationByAnnotationId: ",t),Ee(void 0)}}getMultiThreadCommentAnnotationByAnnotationId(e){return this.multiThreadCommentAnnotationById$.pipe(Oe(()=>this.getMultiThreadAnnotationById(e)))}getCommentBubbleElement(e){try{let t=document.querySelector(`${X.TAGS.VELT_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`);return t||(t=document.querySelector(`${X.TAGS.SNIPPYLY_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`)),t}catch(t){return this.loggingService.catch("Error in CommentService getCommentBubbleElement: ",t),null}}getCommentAnnotationsBySectionId(e){try{return this.commentAnnotationById$.pipe(Me(()=>this.docService.getDocumentPaths$().pipe(Oe(t=>({documentPaths:t,sectionId:e})))),Me(t=>{let a=zr(e,["id","data-id"]);if(a){let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.genarateLocationId(i);return this.docService.getLocations$().pipe(Oe(m=>{let _=Object.values(m||{}).find(I=>I.locationId===c||i?.id&&I.location.id===i.id);return f(g({},t),{additionalLocation:_,locationOnElement:!!i})}))}}return Ee(f(g({},t),{additionalLocation:null,element:a}))}),Me(t=>t?.locationOnElement?Ee(t):this.docService.getLocation$().pipe(Oe(a=>f(g({},t),{location:a})))),Oe(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c,element:m})=>{let h=null;if(this.authService.getUser()&&t?.documentId){let I=this.docService.getAdditionalDocumentIdFromElement(m),S=I?this.docService.generateDocumentId(I):t?.documentId,z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:S||""});if(z){h=[];let $=gn(e);c?i?.location?.id?$=gn([i?.location?.id,e]):i?.locationId&&($=gn([i?.locationId+"",e])):a&&(a?.location?.id?$=gn([a?.location?.id,e]):a?.locationId&&($=gn([a?.locationId+"",e])));for(let G of z)G?.multiThreadAnnotationId===$?h.push(G):(G?.targetInlineCommentElementId===e||G?.targetElementId===e)&&(c?i&&Ig({location:i?.location,locationId:i?.locationId},{location:G.location,locationId:G.locationId})&&h.push(G):a?Ig({location:a?.location,locationId:a?.locationId},{location:G.location,locationId:G.locationId})&&h.push(G):G?.locationId||h.push(G))}}return h}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByMultiThreadAnnotationId(e){try{return this.commentAnnotationById$.pipe(Me(()=>this.multiThreadCommentAnnotationById$),Me(()=>this.docService.getDocumentPaths$().pipe(Oe(t=>({documentPaths:t,multiThreadAnnotationId:e})))),Oe(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c})=>{let m=null;if(t?.documentId){let h=this.getMultiThreadAnnotationById(e),{documentId:_,organizationId:I}=h?.metadata||{documentId:t?.documentId,organizationId:t?.organizationId},S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:I,documentId:_||""});if(S){m=[];for(let z of S)z?.multiThreadAnnotationId===e&&h?.commentAnnotations?.[z?.annotationId]&&m.push(z)}}return m}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByAnnotationIds(e){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(()=>this.docService.getDocumentPaths$().pipe(Oe(t=>({documentPaths:t,annotationIds:e})))),Oe(({documentPaths:t})=>{let a=null;if(t?.documentId){let i=this.commentAnnotationById$.value?Object.values(this.commentAnnotationById$.value):[],c=this.draftCommentAnnotationsByAnnotationId$.value?Object.values(this.draftCommentAnnotationsByAnnotationId$.value):[];if(i=[...i,...c],i){a=[];for(let m of i)e.includes(m?.annotationId)&&a.push(m)}}return a}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByAnnotationIds: ",t),Ee(null)}}getCommentAnnotationsByFolderId({folderId:e,veltFolderId:t}){try{return this.commentAnnotationById$.pipe(Me(()=>this.draftCommentAnnotationsByAnnotationId$),Me(()=>this.docService.getDocumentPaths$()),Oe(()=>{e&&!t&&(t=dr(e));let a=this.authService.getUser(),i=this.docService.getDocumentPaths(),c=null;if(a&&i?.documentId){this.commentAnnotationById$.value&&(c={},Object.values(this.commentAnnotationById$.value).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&(c[h?.annotationId]=h)}));let m=this.draftCommentAnnotationsByAnnotationId$.value;m&&(c===null&&(c={}),Object.values(m).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&!c[h?.annotationId]&&(c[h?.annotationId]=h)}))}return c?Object.values(c):null}))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByFolderId: ",a),Ee(null)}}getCommentAnnotationsForCommentComponent(e){try{let{annotationId:t,folderId:a,veltFolderId:i,targetElementId:c,clientDocumentId:m,documentId:h,context:_,contextOptions:I,element:S,type:z,sectionId:$,locationId:G}=e||{};if(m&&!h&&(h=this.docService.generateDocumentId(m)),a&&!i&&(i=dr(a)),t)return this.getCommentAnnotationByAnnotationId(t).pipe(Oe(ae=>ae?[ae]:null));let Z=[];if(c&&(z==="pin"||z==="tool"||z==="bubble")){let ae=zr(c,["id","data-id"]);if(ae){let pe=ae,Se=this.domService.getXPath(ae);Z.push(this.getCommentAnnotationAvailableOnXPath(Se,c,pe))}}return $&&Z.push(this.getCommentAnnotationsBySectionId($)),_&&Z.push(this.getCommentAnnotationsByContext({context:_,contextOptions:I,element:S,clientDocumentId:m})),h&&Z.push(this.getCommentAnnotationsByDocumentId$({documentId:h})),a&&Z.push(this.getCommentAnnotationsByFolderId({folderId:a,veltFolderId:i})),Z.length===0?Ee(null):kr(Z).pipe(Oe(ae=>{let pe=ae.filter(oe=>oe!==null&&Array.isArray(oe));if(pe.length===0)return null;if(pe.length===1){let oe=pe[0];return G&&oe?.length?oe.filter(_e=>_e?.location?.id===G):oe}let Se=pe[0];for(let oe=1;oe<pe.length;oe++){let he=pe[oe];Se=Se.filter(_e=>he.some(Ye=>Ye.annotationId===_e.annotationId))}return G&&Se?.length&&(Se=Se.filter(oe=>oe?.location?.id===G)),Se}),gr(Wr))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsForCommentComponent: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}isElementInsideAllowedElements(e){try{return this.allowedElementIds$.value?.length||this.allowedElementClassNames$.value?.length||this.allowedElementQuerySelectors$.value?.length?!!(this.allowedElementIds$.value?.length&&this.domService.isElementInsideListedElementIds(e,this.allowedElementIds$.value)||this.allowedElementClassNames$.value?.length&&this.domService.isElementInsideListedElementClassNames(e,this.allowedElementClassNames$.value)||this.allowedElementQuerySelectors$.value?.length&&this.domService.isElementInsideListedElementQuerySelectors(e,this.allowedElementQuerySelectors$.value)):!0}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideAllowedElements: ",t),!1}}getNearestAllowedElement(e){try{let t=this.domService.getListedElements({elementIds:this.allowedElementIds$.value,elementClassNames:this.allowedElementClassNames$.value,elementQuerySelectors:this.allowedElementQuerySelectors$.value});if(t?.length){for(let a=0;a<t.length;a++){let i=t[a];if(e.contains(i))return i}return null}return null}catch(t){return this.loggingService.catch("Error in CommentService getNearestAllowedElement: ",t),null}}isElementInsideManualCommentContainer(e){try{return this.domService.isElementInsideParentWithAttribute(e,X.ATTRIBUTES.VELT_MANUAL_COMMENT_CONTAINER,"true")}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideManualCommentContainer: ",t),!1}}saveComment(e,t){return Pe(this,null,function*(){try{t?.annotation&&(e=t.annotation),e&&(e=JSON.parse(JSON.stringify(e)));let a=this.originalCommentAnnotationsByDocumentId$.value[e.annotationId];if(a?.comments?.length){let I=JSON.parse(JSON.stringify(e.comments||[]));e.comments=[],a.comments?.forEach(S=>{let z=I.find($=>$.commentId===S.commentId);z?e.comments.push(z):e.comments.push(S)})}e.comments||(e.comments=[]);let i=!1,c=!1,m;switch(t.type){case Ke.NEWLY_ADDED:case Ke.ADDED:if(!t.updatedComment)break;e?.comments?.length||(c=!0),e.comments.push(t.updatedComment);let I=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:t.type,otherFields:{assigned:I}};break;case Ke.APPROVED:e.approved=!0,m={commentAnnotation:e,targetComment:null,actionType:Ke.APPROVED};break;case Ke.ASSIGNED:{let pe=a?.assignedTo;e.assignedTo=t.assignedTo,m={commentAnnotation:e,targetComment:null,actionType:Ke.ASSIGNED,otherFields:{oldAssignedTo:pe,newAssignedTo:t.assignedTo}};break}case Ke.UPDATED:if(!t.updatedComment)break;let S=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);if(S>=0){let pe=e.comments[S]?.commentText;e.comments[S]=t.updatedComment,e.comments[S].status=Ke.UPDATED;let Se=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.UPDATED,otherFields:{assigned:Se,oldCommentText:pe}}}break;case Ke.REACTION_ADDED:if(!t.updatedComment)break;let z=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);z>=0&&(e.comments[z]=t.updatedComment,e.comments[z].status=Ke.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.REACTION_ADDED});break;case Ke.REACTION_DELETED:if(!t.updatedComment)break;let $=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);$>=0&&(e.comments[$]=t.updatedComment,e.comments[$].status=Ke.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.REACTION_DELETED});break;case Ke.STATUS_CHANGED:if(e.status.type==="terminal"){this.domService.resetSelectedAnnotationsMap(!1,"comment");let pe=this.authService.getUser();e.resolvedByUserId=pe?.userId,e.resolvedByUser=pe}m={commentAnnotation:e,targetComment:null,actionType:Ke.STATUS_CHANGED,otherFields:{oldStatus:t.oldStatus,newStatus:t.newStatus}};break;case Ke.PRIORITY_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ke.PRIORITY_CHANGED,otherFields:{oldPriority:t.oldPriority,newPriority:t.newPriority}};break;case Ke.ACCESS_MODE_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ke.ACCESS_MODE_CHANGED,otherFields:{oldAccessMode:t.oldAccessMode,newAccessMode:t.newAccessMode}};break;case Ke.CUSTOM_LIST_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ke.CUSTOM_LIST_CHANGED,otherFields:{oldCustomList:t.oldCustomList,newCustomList:t.newCustomList}};break;case Ke.SUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ke.SUBSCRIBED};break;case Ke.UNSUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ke.UNSUBSCRIBED};break;case Ke.DELETED:if(!t.updatedComment)break;let G=e.comments.findIndex(pe=>pe.commentId===t.updatedComment.commentId);if(G>=0){if((G===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value)&&!t.skipDeleteThreadConfirmation){let oe={};if(this.deleteReplyConfirmation$.value&&(G!==0||this.deleteThreadWithFirstComment$.value===!1)?oe={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:oe={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!(yield this.dialog.open(Mg,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:oe}).afterClosed().toPromise()))return}let pe=e.comments.splice(G,1),Se=e.metadata;pe?.length&&pe.forEach(oe=>{oe?.attachments&&oe.attachments.forEach(he=>{let _e={attachmentId:he.attachmentId,organizationId:Se?.clientOrganizationId??Se?.organizationId??null,documentId:Se?.clientDocumentId??Se?.documentId??null,folderId:Se?.folderId??null,commentAnnotationId:e.annotationId,apiKey:Se?.apiKey??null};this.deleteAttachment({attachment:he,metadata:_e})}),oe?.reactionAnnotationIds&&oe.reactionAnnotationIds.forEach(he=>{this.deleteReaction(he)})})}e?.status?.type==="terminal"&&(e.status=this.customFilterService.defaultStatus),G===0&&this.deleteThreadWithFirstComment$.value!==!1||e.comments?.length===0?i=!0:(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_THREAD_DELETED,{annotationId:e.annotationId,commentThreadId:t.updatedComment.commentId,commentMode:this.getCommentMode()}),m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ke.DELETED});break;case Ke.ACCEPTED:let Z={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ke.ACCEPTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentAccepted$.next(Z),m={commentAnnotation:e,targetComment:null,actionType:Ke.ACCEPTED};break;case Ke.REJECTED:let ae={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ke.REJECTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentRejected$.next(ae),this.domService.resetSelectedAnnotationsMap(),m={commentAnnotation:e,targetComment:null,actionType:Ke.REJECTED};break;case Ke.SUGGESTION_ACCEPTED:m={commentAnnotation:e,targetComment:null,actionType:Ke.SUGGESTION_ACCEPTED,otherFields:{resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;case Ke.SUGGESTION_REJECTED:m={commentAnnotation:e,targetComment:null,actionType:Ke.SUGGESTION_REJECTED,otherFields:{rejectReason:e?.suggestion?.rejectReason,resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;default:break}if(e.resolvedByUserId&&e.status.type!=="terminal"&&(e.resolvedByUserId=null,e.resolvedByUser=null),t.visibility)try{let I=g({},t.visibility);if(I.type==="organizationPrivate"&&!I.organizationId&&!I.organizationIds?.length){let $=this.docService.getOrganizationConfig();$?.clientOrganizationId&&(I.organizationId=$.clientOrganizationId)}let S=e.from?.userId||this.authService.getUser()?.userId,z=An(I,S);z.length>0&&(e.context||(e.context={}),e.context._setAccessFields=z,e.visibilityConfig=Pn(I,S))}catch(I){this.loggingService.catch("Error building accessFields from visibility in saveComment:",I)}if(t?.updatedComment?.isDraft&&(m=void 0),i)this.deleteCommentPinAnnotation(e,!0),this.domService.resetSelectedAnnotationsMap(!1,"comment");else{if(c&&e.comments?.length&&this.enableAutoCategorize$?.value&&this.setCommentCategory(e),e.context?.access&&e.context?.accessFields&&t.updatedComment?.from?.userId&&!this.userPermissionService?.hasUserContextAccess({userId:t.updatedComment?.from?.userId,accessFields:e.context.accessFields})){this.loggingService.catch("User does not have context access to update comment annotation.",void 0,void 0,!0);return}this.updateComment(e,!1,!1,m,!0,t.updatedComment),e?.multiThreadAnnotationId&&(t.type===Ke.ADDED||t.type===Ke.NEWLY_ADDED)&&e.comments?.length===1?setTimeout(()=>{this.domService.resetSelectedAnnotationsMap(!1,"comment")},100):this.domService.updateSelectedAnnotationInMap([e])}let h=this.getCustomPinById(e.annotationId),_={type:t.type,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e.annotationId,targetCommentId:t.updatedComment?.commentId,updateContext:(I,S)=>{this.updateCommentAnnotationContext(e.annotationId,I,S)}};if(h!==void 0&&(_.element=h),delete _?.annotation?.pageInfo,delete _?.annotation?.targetElement,delete _?.annotation?.targetTextRange,_?.type===Ke.DELETED&&(e.comments?.length||(_.annotation=null)),i||this.commentUpdated$.next(_),t.type===Ke.NEWLY_ADDED&&!i&&e?.annotationId){let I=this.pendingAddCommentAnnotationData.get(e.annotationId);if(I){this.pendingAddCommentAnnotationData.delete(e.annotationId);let S=f(g({},I),{annotation:this.getCommentAnnotationForClient(e),targetCommentId:t.updatedComment?.commentId}),z=yield this.commentActionsService?.getAddCommentAnnotationEventFromCommentAddEventData(S);z&&this.commentActionsService?.triggerAddCommentAnnotationEvent(z),t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}}t.type===Ke.ADDED&&t._dispatchAddCommentEvent&&!i&&e?.annotationId&&t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}catch(a){this.loggingService.catch("Error in CommentService saveComment: ",a)}})}attachComment(e,t=[],a,i,c,m,h,_){try{this.loggingService.log("%c[WB] Calling FUNCTION: attachComment","color: green;");let I;if(e){let S=zr(e,t);S&&(I={targetElement:{xpath:this.domService.getXPath(S),topPercentage:50,leftPercentage:90},targetElementId:e})}(I||a||c)&&this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,m,void 0,void 0,I,_,void 0,void 0,i,void 0,void 0,void 0,a,void 0,c,void 0,void 0,h)}catch(I){this.loggingService.catch("Error in CommentService attachComment: ",I)}}generateComponentIdFromObject(e){try{let t=on(e||{});return mr(JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CommentService generateComponentIdFromObject: ",t);return}}updateNotificationsDatabase(e,t,a,i={}){try{let c=g({annotationData:e,targetAnnotationData:t,actionType:a,notificationSource:"comment"},i);this.notificationService.updateNotificationDatabase(c)}catch(c){this.loggingService.catch("Error in CommentService updateNotificationsDatabase: ",c)}}getUserContacts$(){return this.contactService.getUserContacts$()}addUserContact(e){this.contactService.addUserContact(e)}getCustomUserContacts(){try{return this.contactService.getCustomUserContacts()}catch(e){return this.loggingService.catch("Error in CommentService getCustomUserContacts:",e),null}}getCustomUserContactsConfig(){try{return this.contactService.getCustomUserContactsConfig()}catch(e){this.loggingService.catch("Error in CommentService getCustomUserContactsConfig:",e);return}}getElementFromComment(e){try{let t=null;if(e?.ghostComment)!t&&e.ghostComment?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.xpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null));else{let a=!1,i=e?.targetElement?.anchor;if(!t&&i){let c=this.domService.resolveAnchorRecord(i);c?.element&&this.domService.isElementVisible(c.element)&&un(c.element)&&(t=c.element)}!t&&e?.targetElement?.xpath&&(a=this.domService.isXpathWithId(e?.targetElement?.xpath),t=this.domService.getElementFromXPath(e?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null)),a||(!t&&e?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)))}return t&&!un(t)&&(t=null),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),null}}getElementFromComments(e){try{let t=[],a=null;if(e?.ghostComment)!a&&e.ghostComment?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.xpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null));else{let i=!1,c=e?.targetElement?.anchor;if(!a&&c){let m=this.domService.resolveAnchorRecord(c);m?.element&&this.domService.isElementVisible(m.element)&&un(m.element)&&(a=m.element)}!a&&e?.targetElement?.xpath&&(i=this.domService.isXpathWithId(e?.targetElement?.xpath),a=this.domService.getElementFromXPath(e?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null)),i||(!a&&e?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)))}return a&&!un(a)&&(a=null),e?.targetElementId&&(t=Array.from(db(e.targetElementId,["id","data-id"]))),a&&!t.includes(a)&&t.push(a),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),[]}}getGhostCommentTargetElement(e){try{let t=e.targetElement?.fXpath||e.targetElement?.xpath,a=null;if(t)for(;!a&&t;)a=this.domService.getElementFromXPath(t),a&&(!this.domService.isElementVisible(a)||!un(a))&&(a=null),a||(t=t.substring(0,t.lastIndexOf("/")));return t==="/"&&(t=""),t?{xpath:t,topPercentage:e?.targetElement?.topPercentage||0,leftPercentage:e?.targetElement?.leftPercentage||0}:null}catch(t){return this.loggingService.catch("Error in CommentService getGhostCommentTargetElement: ",t),null}}setGhostCommentMessage(e){try{if(e?.ghostComment){e.ghostComment.message="Original content not found.",e.ghostComment.type=Hr.ELEMENT_DELETED;let t=e?.pageInfo?.deviceInfo?.deviceType,a=new fg().getDeviceType();t&&t!==a&&(e.ghostComment.type=Hr.DIFFERENT_DEVICE,e.ghostComment.message=`Original comment was added on ${t}.`,[On.MOBILE,On.TABLET].includes(t)&&[On.MOBILE,On.TABLET].includes(a)||[On.DESKTOP,On.MONITOR].includes(t)&&[On.DESKTOP,On.MONITOR].includes(a)?e.ghostComment.isSameGroup=!0:e.ghostComment.isSameGroup=!1)}}catch(t){this.loggingService.catch("Error in CommentService setGhostCommentMessage: ",t)}}addAnnotationToGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{},a=t[e?.annotationId]||{};an(e.ghostComment,a)||(t[e?.annotationId]=e.ghostComment,this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService addAnnotationToGhostCommentAnnotationMap: ",t)}}removeAnnotationFromGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{};t[e?.annotationId]&&(delete t[e?.annotationId],this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService removeAnnotationFromGhostCommentAnnotationMap: ",t)}}getGhostCommentAnnotationMap$(){return this.ghostCommentAnnotationMap$.asObservable()}getGhostCommentAnnotationMap(){return this.ghostCommentAnnotationMap$.value||{}}getUnreadCommentsMap$(){return this.unreadCommentsMap$.asObservable().pipe(gr(Wr))}getUnreadCommentsMap(){return this.unreadCommentsMap$.value}getUnreadCommentCountByAnnotationId$(e){return this.getUnreadCommentsMap$().pipe(Oe(t=>t?{count:t[e]||0}:null))}getUnreadCommentAnnotationCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Oe(e=>e?{count:Object.keys(e??{}).length||0}:null))}getUnreadCommentCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Oe(e=>e?{count:Object.values(e).reduce((a,i)=>a+i,0)}:null))}getUnreadCommentCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Oe(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),i&&Object.keys(t).forEach(m=>{i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=t[m])})),{count:c}}else return null}))}getUnreadCommentAnnotationCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Oe(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),Object.keys(t).forEach(m=>{t[m]&&i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=1)})),{count:c}}else return null}))}setCommentAnnotationsAsRead(e){try{for(let t of e)this.viewsService?.setCommentAnnotationAsRead(t)}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsRead: ",t)}}setCommentAnnotationsAsResolved(e){try{let t=this.customFilterService.resolvedStatus,a=this.authService.getUser();if(t){for(let i of e)if(t?.id!==i?.status?.id){let c=JSON.parse(JSON.stringify(i||{}));i.status=this.customFilterService.resolvedStatus,i.statusUpdatedByUserId=a?.userId;let m={annotation:i,type:Ke.STATUS_CHANGED,oldStatus:c.status,newStatus:this.customFilterService.resolvedStatus};this.saveComment(i,m)}}}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsResolved: ",t)}}isCommentAnnotationUnread(e){try{let t=this.authService.getUser();return!(t?.userSnippylyId&&e?.viewedByUserIds?.length&&e?.viewedByUserIds?.includes(t?.userSnippylyId))}catch(t){return this.loggingService.catch("Error in CommentService isCommentAnnotationUnread: ",t),!1}}updateCommentDialogPosition(){try{this.updateCommentDialogPositionTriggerSubject$.next()}catch(e){this.loggingService.catch("Error in CommentService updateCommentDialogPosition: ",e)}}updateCommentDialogPositionTrigger$(){return this.updateCommentDialogPositionTriggerSubject$.asObservable()}enableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!0}}),this.areaCommentEnabled$.value===!0)return;this.areaCommentEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAreaComment: ",e)}}disableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!1}}),this.areaCommentEnabled$.value===!1)return;this.areaCommentEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAreaComment: ",e)}}getAreaCommentEnabled$(){return this.areaCommentEnabled$.asObservable()}getAreaCommentEnabled(){return this.areaCommentEnabled$.value}setPinCursorImage(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setPinCursorImage","color: green;"),e&&(e=`url(${e}) 0 31, auto`),this.commentPinCursorImage$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPinCursorImage: ",t)}}getPinCursorImage$(){return this.commentPinCursorImage$.asObservable()}getPinCursorImage(){return this.commentPinCursorImage$.value}setCommentAnnotationsFromCommentsContainer(e){try{this.commentAnnotationsFromCommentsContainer$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsFromCommentsContainer: ",t)}}getCommentAnnotationsFromCommentsContainer$(){return this.commentAnnotationsFromCommentsContainer$.asObservable()}getCommentAnnotationsFromCommentsContainer(){return this.commentAnnotationsFromCommentsContainer$.value}addManualComment(e){return Pe(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: addManualComment","color: green;"),new Promise((t,a)=>{let i=this.domService.getLastDocumentClick()?.target,c=e?.location||this.docService.getAdditionLocationFromElement(i);if(c?.id){let m=this.docService.getLocationByClientLocationId(c.id);m&&(c=m)}this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,c,void 0,e,void 0,void 0,void 0,m=>{t(m)}),this.addCommentMode$?.value&&!this.persistentCommentMode$?.value&&this.disableAddCommentMode()})}catch(t){return this.loggingService.catch("Error in CommentService addManualComment: ",t),null}})}getCommentUrl(e){try{return e?.pageInfo?.commentUrl?e.pageInfo.commentUrl:(e?.pageInfo||(e.pageInfo=Lu(),e.pageInfo&&(e.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth)),e.pageInfo.commentUrl=this.generateCommentUrl(e),this.updateComment(e),e.pageInfo?.commentUrl)}catch(t){this.loggingService.catch("Error in CommentService getCommentUrl: ",t);return}}uploadFile(e,t){let a=`${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`;this.documentPaths?.organizationId&&(a=`${X.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${this.documentPaths.organizationId}/${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`);let i={organizationId:t.metadata?.clientOrganizationId??this.documentPaths?.clientOrganizationId??null,documentId:t.metadata?.clientDocumentId??this.documentPaths?.clientDocumentId??null,commentAnnotationId:t.annotationId,apiKey:t.metadata?.apiKey??this.configService?.getApiKey()??null,folderId:t.metadata?.folderId??this.documentPaths?.folderId??null,attachmentId:null};return this.storageService.uploadFile({path:a,file:e,metadata:i,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}downloadAttachment(e){this.storageService.downloadAttachment(e)}deleteAttachment({attachment:e,metadata:t}){return this.storageService.deleteAttachment({attachment:e,metadata:t,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}deleteReaction(e){try{this.reactionService?.deleteReactionPinAnnotation(e)}catch(t){this.loggingService.catch("Error in CommentService deleteReaction: ",t)}}generateCommentUrl(e){let t;try{t=new URL(e?.pageInfo?.url||window.location.href)}catch(a){this.loggingService.catch("Error in CommentService generateCommentUrl: ",a),t=new URL(window.location.href)}return t.searchParams.delete(X.URL_PARAMS.COMMENT_ID),t.searchParams.append(X.URL_PARAMS.COMMENT_ID,e.annotationId),t.href}getCustomPinById(e){if(this.customPinsById.has(e))return this.customPinsById.get(e)}setCustomStatuses(e){try{if(e===void 0)return;this.customStatusesShown$.next(!0),this.customFilterService.setCustomStatusFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomStatuses: ",t)}}getCustomStatusesShown$(){return this.customStatusesShown$.asObservable()}getCustomStatusesShown(){return this.customStatusesShown$.value}setCustomPriorities(e){try{if(e===void 0)return;this.customFilterService.setCustomPriorityFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomPriorities: ",t)}}setCustomCategories(e){try{if(e===void 0)return;this.customFilterService.setCustomCategories(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomCategories: ",t)}}addCommentOnSelectedText(){try{let e=this.authService.getUser();if(this.textCommentMode$.value&&e&&!(e?.isReadOnly||e?.isAnonymous)&&this.authService.isFeatureAllowed(ke.COMMENT)){let t=this.domService.getRange();if(window.getSelection()?.toString()&&!Uc()&&t?.commonAncestorContainer&&this.isElementInsideAllowedElements(t.commonAncestorContainer)&&!eo(t.commonAncestorContainer)){let a=t?this.domService.getTargetTextRangeFromSelectionRange(t):void 0;this.domService.clearTextSelection(),setTimeout(()=>{this.addComment(void 0,a)},100)}}}catch(e){this.loggingService.catch("Error in CommentService addCommentOnSelectedText: ",e)}}getInlineCommentSectionConfig(e){try{let t;if(e){let a=e?.closest(`[${X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID}]`);if(a){let i=a.getAttribute(X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID);i&&(t={},t.targetInlineCommentElementId=i,a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)&&(t.config=JSON.parse(a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)||"{}")))}}return t}catch(t){this.loggingService.catch("Error in CommentService getInlineCommentSectionConfig: ",t)}}createCustomListDataOnAnnotation(e){try{if(e===void 0)return;this.customChipDropdownData$.next(e)}catch(t){this.loggingService.catch("Error in CommentService createCustomListDataOnAnnotation: ",t)}}getCustomChipDropdownData$(){return this.customChipDropdownData$.asObservable()}getCustomChipDropdownData(){return this.customChipDropdownData$.value}setSubscribedUsersDataInCommentAnnotation(e){try{let t={},a=e?.unsubscribedUsers||{},i={};if(e?.subscribedUsers&&Object.keys(e.subscribedUsers||{}).forEach(c=>{let m=e.subscribedUsers?.[c];m?.type==="manual"&&(t[c]=m)}),e?.assignedTo?.userId){let c=mr(e?.assignedTo?.userId);a[c]||t[c]?.type!=="manual"&&(t[c]={user:e?.assignedTo,type:"auto"})}e?.comments?.filter(c=>!c?.isDraft)?.forEach(c=>{if(c?.from?.userId){let m=mr(c?.from?.userId);a[m]||t[m]?.type!=="manual"&&(t[m]={user:c?.from,type:"auto"})}c?.to?.forEach(m=>{if(m?.userId){let h=mr(m.userId);a[h]||t[h]?.type!=="manual"&&(t[h]={user:m,type:"auto"})}}),c?.toOrganizationUserGroup?.forEach(m=>{if(m?.groupId)i[m?.groupId]={type:"auto"};else if(m?.clientGroupId){let h=mr(m.clientGroupId);i[h]={type:"auto"}}})}),e.subscribedUsers=t,e.unsubscribedUsers=a,e.subscribedGroups=i}catch(t){this.loggingService.catch("Error in CommentService setSubscribeUsersDataInCommentAnnotation: ",t)}}getCopyLink$(){return this.copyLink$.asObservable()}setCopyLink(e){try{this.copyLink$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCopyLink: ",t)}}getCommentAnnotationById(e){return this.commentAnnotationById$.pipe(Me(()=>{let{annotationId:t,documentId:a}=e;if(a){let i=wo(a).toString();return this.getDataCommentAnnotationsFromDocumentId(i).pipe(Oe(c=>c.find(h=>h.annotationId===t)||null))}else{let i=this.docService.getDocumentPaths();if(i?.documentId){let c=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:i?.organizationId,documentId:i?.documentId});if(c){let m=c.find(h=>h.annotationId===t);return Ee(m||null)}}}return Ee(null)}),yn(t=>(this.loggingService.catch("Error in CommentService getCommentAnnotationById: ",t),Ee(null))))}getCommentAnnotationByIdSync(e){try{return this.commentAnnotationById$.value?.[e]}catch(t){this.loggingService.catch("Error in CommentService getCommentAnnotationByIdSync: ",t);return}}getDataCommentAnnotationsFromDocumentId(e){return this.configService?.getApiKey()?this.commonDbService.dbListener({feature:"allComments",properties:{documentId:e||this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,isCollection:!0}}).pipe(Oe(t=>t?.data),Oe(t=>{let a=[];return t&&(a=Object.values(t??{}).filter(i=>typeof i=="object")),a})):Ee([])}enableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!0}}),this.collapsedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedComments: ",e)}}disableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!1}}),this.collapsedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedComments: ",e)}}getCollapsedComments$(){return this.collapsedComments$.asObservable()}enableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!0}}),this.collapsedRepliesPreview$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedRepliesPreview: ",e)}}disableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!1}}),this.collapsedRepliesPreview$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedRepliesPreview: ",e)}}getCollapsedRepliesPreview$(){return this.collapsedRepliesPreview$.asObservable()}enableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!0}}),this.fullExpanded$.value===!0)return;this.fullExpanded$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullExpanded: ",e)}}disableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!1}}),this.fullExpanded$.value===!1)return;this.fullExpanded$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullExpanded: ",e)}}getFullExpanded$(){return this.fullExpanded$.asObservable()}getFullExpanded(){return this.fullExpanded$.value}setSidebarCustomActionEventData(e,t,a,i,c){try{this.sidebarCustomActionEventData$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c})}catch(m){this.loggingService.catch("Error in CommentService emitOnSidebarCustomAction: ",m)}}getSidebarCustomActionEventData(){return this.sidebarCustomActionEventData$.asObservable()}setCommentSidebarData(e,t){try{let a=new Set;(e||[]).forEach(c=>{(c?.annotations||[]).forEach(m=>{m?.annotationId&&a.add(m.annotationId)})});let i=this.customSidebarDataAnnotationIds$.value;this.areAnnotationIdSetsEqual(i,a)||this.customSidebarDataAnnotationIds$.next(a),this.sidebarData$.next({data:e,options:t})}catch(a){this.loggingService.catch("Error in CommentService setCommentSidebarData: ",a)}}areAnnotationIdSetsEqual(e,t){if(e===t)return!0;if(e===null||t===null||e.size!==t.size)return!1;for(let a of e)if(!t.has(a))return!1;return!0}getSidebarCustomData(){return this.sidebarData$.asObservable()}getCustomSidebarDataAnnotationIds$(){return this.customSidebarDataAnnotationIds$.asObservable()}getCustomSidebarDataAnnotationIds(){return this.customSidebarDataAnnotationIds$.value}setSidebarCustomActionEventDataAllChanges(e,t,a,i,c){return Pe(this,null,function*(){try{this.sidebarCustomActionEventDataAllChanges$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let m=yield this.metadataService.getGlobalMetadata(),h={buttonContext:{selections:this.buttonService.buttonToggleMapValue()},unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,metadata:m,customFilters:c};this.commentActionsService?.triggerAction(dt.COMMENT_SIDEBAR_DATA_UPDATE,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataAllChanges: ",m)}})}setSidebarCustomActionEventDataOnInit(e,t,a,i,c){return Pe(this,null,function*(){try{this.sidebarCustomActionEventDataOnInit$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let h={metadata:yield this.metadataService.getGlobalMetadata(),unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,buttonContext:{selections:this.buttonService.buttonToggleMapValue()},customFilters:c};this.commentActionsService?.triggerAction(dt.COMMENT_SIDEBAR_DATA_INIT,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataOnInit: ",m)}})}getSidebarCustomActionEventDataAllChanges(){return this.sidebarCustomActionEventDataAllChanges$.asObservable()}getSidebarCustomActionEventDataOnInit(){return this.sidebarCustomActionEventDataOnInit$.asObservable()}getSidebarCustomActionEventDataOnInitValue(){return this.sidebarCustomActionEventDataOnInit$.getValue()}setTransformContext(e){try{e?an(this.transformContext$.value,e)||this.transformContext$.next(e):this.transformContext$.next(null)}catch(t){this.loggingService.catch("Error in CommentService setTransformContext: ",t)}}getTransformContext$(){return this.transformContext$.asObservable()}getTransformContext(){return this.transformContext$.value}enableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!0}}),this.customActions$.value===!0)return;this.customActions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarCustomActions: ",e)}}disableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!1}}),this.customActions$.value===!1)return;this.customActions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarCustomActions: ",e)}}getSidebarCustomActionsValue(){return this.customActions$.getValue()}enableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!0}}),this.queryParamsComments$.value===!0)return;this.queryParamsComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableQueryParamsComments: ",e)}}disableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!1}}),this.queryParamsComments$.value===!1)return;this.queryParamsComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableQueryParamsComments: ",e)}}getQueryParamsComments$(){return this.queryParamsComments$.asObservable()}getQueryParamsComments(){return this.queryParamsComments$.value}enableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!0}}),this.resolveStatusAccessAdminOnly$.value===!0)return;this.resolveStatusAccessAdminOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableResolveStatusAccessAdminOnly: ",e)}}disableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!1}}),this.resolveStatusAccessAdminOnly$.value===!1)return;this.resolveStatusAccessAdminOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableResolveStatusAccessAdminOnly: ",e)}}enableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!0}}),this.linkCallback$.value===!0)return;this.linkCallback$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableLinkCallback: ",e)}}disableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!1}}),this.linkCallback$.value===!1)return;this.linkCallback$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableLinkCallback: ",e)}}getResolveStatusAccessAdminOnly$(){return this.resolveStatusAccessAdminOnly$.asObservable()}getLinkCallback$(){return this.linkCallback$.asObservable()}getResolveStatusAccessAdminOnly(){return this.resolveStatusAccessAdminOnly$.value}getLinkCallback(){return this.linkCallback$.value}enableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!0}}),this.svgAsImg$.value===!0)return;this.svgAsImg$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSvgAsImg: ",e)}}disableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!1}}),this.svgAsImg$.value===!1)return;this.svgAsImg$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSvgAsImg: ",e)}}getSvgAsImg$(){return this.svgAsImg$.asObservable()}getSvgAsImg(){return this.svgAsImg$.value}enableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!0}}),this.commentToNearestAllowedElement$.value===!0)return;this.commentToNearestAllowedElement$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentToNearestAllowedElement: ",e)}}disableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!1}}),this.commentToNearestAllowedElement$.value===!1)return;this.commentToNearestAllowedElement$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentToNearestAllowedElement: ",e)}}getCommentToNearestAllowedElement$(){return this.commentToNearestAllowedElement$.asObservable()}getCommentToNearestAllowedElement(){return this.commentToNearestAllowedElement$.value}enableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!0}}),this.filterCommentsOnDom$.value===!0)return;this.filterCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterCommentsOnDom: ",e)}}disableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!1}}),this.filterCommentsOnDom$.value===!1)return;this.filterCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterCommentsOnDom: ",e)}}getFilterCommentsOnDom$(){return this.filterCommentsOnDom$.asObservable()}getFilterCommentsOnDom(){return this.filterCommentsOnDom$.value}setCommentsFromSidebarMap(e){try{let{comments:t,sidebarVisible:a}=e||{},i=null;t&&(i={},t.forEach(m=>{m?.annotationId&&i&&(i[m.annotationId]=m)}));let c={};t===void 0?c.data=this.commentsFromSidebarMap$.value?.data:c.data=i,a===void 0?c.sidebarVisible=this.commentsFromSidebarMap$.value?.sidebarVisible:c.sidebarVisible=a,an(this.commentsFromSidebarMap$.value,c)||this.commentsFromSidebarMap$.next(c)}catch(t){this.loggingService.catch("Error in CommentService setCommentsFromSidebarMap: ",t)}}getCommentsFromSidebarMap$(){return this.commentsFromSidebarMap$.asObservable()}getCommentsFromSidebarMap(){return this.commentsFromSidebarMap$.value}hasActiveFilters(e){try{return e?!!(e.people?.length||e.assigned?.length||e.tagged?.length||e.involved?.length||e.priority?.length||e.status?.length||e.category?.length||e.location?.length||e.document?.length||e.version?.length||e.accessModes?.length||this.hasCustomContextFilters(e)):!1}catch(t){return this.loggingService.catch("Error in CommentService hasActiveFilters: ",t),!1}}hasCustomContextFilters(e){try{if(!e)return!1;let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]);return Object.keys(e).some(a=>!t.has(a)&&Array.isArray(e[a])&&e[a]?.length>0)}catch(t){return this.loggingService.catch("Error in CommentService hasCustomContextFilters: ",t),!1}}applyDirectFilters(e,t){try{let a=this.commentSidebarSystemFiltersOperator$.value,i,c=!1,m=new Set;a===Ur.AND?i=e.slice():i=[];let h=_=>{a===Ur.AND?i=i.filter(I=>_.some(S=>S.annotationId===I.annotationId)):_.forEach(I=>m.add(I.annotationId)),c=!0};if(t.people?.length){let _=[];t.people.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByPeople({id:S,name:I.name},e)])}),h(_)}if(t.assigned?.length){let _=[];t.assigned.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByAssigned({id:S,name:I.name},e)])}),h(_)}if(t.tagged?.length){let _=[];t.tagged.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByTagged({id:S,name:I.name},e)])}),h(_)}if(t.involved?.length){let _=[];t.involved.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByInvolved({id:S,name:I.name},e)])}),h(_)}if(t.priority?.length){let _=[];t.priority.forEach(I=>_=[..._,...this.filterAnnotationsByPriority({id:I},e)]),h(_)}if(t.status?.length){let _=[];t.status.forEach(I=>_=[..._,...this.filterAnnotationsByStatus({id:I},e)]),h(_)}if(t.category?.length){let _=[];t.category.forEach(I=>_=[..._,...this.filterAnnotationsByCommentCategory({id:I},e)]),h(_)}if(t.version?.length){let _=[];t.version.forEach(I=>_=[..._,...this.filterAnnotationsByVersion(I,e)]),h(_)}if(t.document?.length){let _=[];t.document.forEach(I=>_=[..._,...this.filterAnnotationsByDocument(I,e)]),h(_)}if(t.location?.length){let _=[];t.location.forEach(I=>{I.id&&(_=[..._,...e.filter(S=>S.location?.id===I.id||S.documentParams?.id===I.id)])}),h(_)}if(t.accessModes?.length){let _=[];t.accessModes.forEach(I=>{I===lr.PRIVATE?_=[..._,...e.filter(S=>sr(S))]:I===lr.PUBLIC&&(_=[..._,...e.filter(S=>!sr(S))])}),h(_)}return this.getCustomContextFilterEntries(t).forEach(({key:_,values:I})=>{let S=this.matchAnnotationsByContext(e,_,I);h(S)}),a!==Ur.AND&&(c?i=e.filter(_=>m.has(_.annotationId)):i=e),i}catch(a){return this.loggingService.catch("Error in CommentService applyDirectFilters: ",a),e}}applyCommentSidebarClientFilters(e,t){return this.applyDirectFilters(e,t)}getCustomContextFilterEntries(e){try{if(!e)return[];let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]),a=[];return Object.keys(e).forEach(i=>{if(t.has(i))return;let c=e[i];!Array.isArray(c)||!c.length||a.push({key:i,values:c})}),a}catch(t){return this.loggingService.catch("Error in CommentService getCustomContextFilterEntries: ",t),[]}}matchAnnotationsByContext(e,t,a){try{return e.filter(i=>{let c=i.context?.[t];return c==null?!1:a.some(m=>{let h=typeof m=="string"?m:m?.id;return c===h||c?.toString()===h})})}catch(i){return this.loggingService.catch("Error in CommentService matchAnnotationsByContext: ",i),[]}}filterAnnotationsByPeople(e,t){try{return e.id?t.filter(a=>a?.from?.userId===e.id||a?.from?.email===e.id):t}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPeople: ",a),[]}}filterAnnotationsByTagged(e,t){try{return t.filter(a=>a?.comments?.some(i=>i.taggedUserContacts?.some(c=>c?.contact?.userId===e.id)))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByTagged: ",a),[]}}filterAnnotationsByAssigned(e,t){try{return t.filter(a=>a?.assignedTo?.userId===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByAssigned: ",a),[]}}filterAnnotationsByInvolved(e,t){try{return t.filter(a=>{let i=a?.from?.userId===e.id||a?.from?.email===e.id,c=a?.assignedTo?.userId===e.id,m=a?.comments?.some(h=>h.taggedUserContacts?.some(_=>_?.contact?.userId===e.id));return i||c||m})}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByInvolved: ",a),[]}}filterAnnotationsByPriority(e,t){try{return e.id==="unset"?t.filter(a=>!a?.priority):t.filter(a=>a?.priority?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPriority: ",a),[]}}filterAnnotationsByStatus(e,t){try{return t.filter(a=>a?.status?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByStatus: ",a),[]}}filterAnnotationsByCommentCategory(e,t){try{return e.id==="other"?t.filter(a=>!a?.commentCategories?.length||a?.commentCategories?.some(i=>i.id===e.id)):t.filter(a=>(a?.commentCategories||[]).some(i=>i.id===e.id))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByCommentCategory: ",a),[]}}filterAnnotationsByVersion(e,t){try{return e.id==="unset"?t.filter(a=>!a?.location?.version):t.filter(a=>a?.location?.version?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByVersion: ",a),[]}}filterAnnotationsByDocument(e,t){try{return e?.id&&e.id!=="other"?t.filter(a=>a?.metadata?.clientDocumentId?.toString()===e.id):t.filter(a=>!a?.metadata?.clientDocumentId)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByDocument: ",a),[]}}setSidebarButtonCountType(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonCountType:e}}),this.sidebarButtonCountType$.value===e)return;this.sidebarButtonCountType$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSidebarButtonCountType: ",t)}}getSidebarButtonCountType$(){return this.sidebarButtonCountType$.asObservable()}getSidebarButtonCountType(){return this.sidebarButtonCountType$.value}enableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!0}}),this.filterGhostCommentsInSidebar$.value===!0)return;this.filterGhostCommentsInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterGhostCommentsInSidebar: ",e)}}disableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!1}}),this.filterGhostCommentsInSidebar$.value===!1)return;this.filterGhostCommentsInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterGhostCommentsInSidebar: ",e)}}getFilterGhostCommentsInSidebar$(){return this.filterGhostCommentsInSidebar$.asObservable()}getFilterGhostCommentsInSidebar(){return this.filterGhostCommentsInSidebar$.value}filterCommentsUsingSidebarSettings(e){try{let t=Array.isArray(e),a;return t?a=e||[]:e?a=[e]:a=[],this.getFilterCommentsOnDom$().pipe(Me(i=>i?a.length===0?Ee(e):kr([this.effectiveSidebarFilters$,this.customSidebarDataAnnotationIds$]).pipe(Oe(([c,m])=>{let h=a,_=!1;if(this.hasActiveFilters(c)){let I=this.applyDirectFilters(a,c),S=new Set(I.map(z=>z.annotationId));h=h.filter(z=>z?.isDraft||S.has(z.annotationId)),_=!0}return m&&(h=h.filter(I=>I?.isDraft||I?.annotationId&&m.has(I.annotationId)),_=!0),_?t?h:h.length>0?h[0]:null:e})):Ee(e)))}catch{return Ee(e)}}enableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!0)return;this.focusedThreadMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFocusedThreadMode: ",e)}}disableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!1)return;this.focusedThreadMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFocusedThreadMode: ",e)}}getFocusedThreadMode$(){return this.focusedThreadMode$.asObservable()}enableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!0}}),this.openAnnotationInFocusMode$.value===!0)return;this.openAnnotationInFocusMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableOpenAnnotationInFocusMode: ",e)}}disableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!1}}),this.openAnnotationInFocusMode$.value===!1)return;this.openAnnotationInFocusMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableOpenAnnotationInFocusMode: ",e)}}getOpenAnnotationInFocusMode$(){return this.openAnnotationInFocusMode$.asObservable()}getOpenAnnotationInFocusMode(){return this.openAnnotationInFocusMode$.value}enableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!0}}),this.readOnly$.value===!0)return;this.readOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReadOnly: ",e)}}disableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!1}}),this.readOnly$.value===!1)return;this.readOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReadOnly: ",e)}}getReadOnly$(){return this.readOnly$.asObservable()}getReadOnly(){return this.readOnly$.value}shouldEnableReadOnly(){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: shouldEnableReadOnly","color: green;");let e=this.authService.getUser(),t=this.docService.getDocumentPaths()?.folderId,a=this.docService.getDocumentIds().map(i=>i.clientDocumentId);if(e){let i=this.userPermissionService.getCurrentUserPermissions();i?.[e.userId]?t&&i[e.userId]?.folders?.[t]?.accessRole==="viewer"?this.enableReadOnly():a.forEach(c=>{i[e.userId]?.documents?.[c]?.accessRole==="viewer"&&this.enableReadOnly()}):this.getReadOnly()||this.disableReadOnly()}}catch(e){this.loggingService.catch("Error in CommentService shouldEnableReadOnly:",e)}})}sanitizeCommentAnnotation(e){try{return e?.comments?.length&&e.comments.forEach(t=>{t?.commentHtml&&(t.commentHtml=this.domService.sanitizeHtml(t.commentHtml))}),e}catch(t){return this.loggingService.catch("Error in CommentService sanitizeCommentAnnotation: ",t),e}}enableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!0}}),this.customAutocompleteSearch$.value===!0)return;this.customAutocompleteSearch$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCustomAutocompleteSearch: ",e)}}disableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!1}}),this.customAutocompleteSearch$.value===!1)return;this.customAutocompleteSearch$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCustomAutocompleteSearch: ",e)}}getCustomAutocompleteSearch$(){return this.customAutocompleteSearch$.asObservable()}getCustomAutocompleteSearch(){return this.customAutocompleteSearch$.value}enableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!0}}),this.deleteThreadWithFirstComment$.value===!0)return;this.deleteThreadWithFirstComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteThreadWithFirstComment: ",e)}}disableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!1}}),this.deleteThreadWithFirstComment$.value===!1)return;this.deleteThreadWithFirstComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteThreadWithFirstComment: ",e)}}getDeleteThreadWithFirstComment$(){return this.deleteThreadWithFirstComment$.asObservable()}enableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!0}}),this.expandMentionGroups$.value===!0)return;this.expandMentionGroups$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableExpandMentionGroups: ",e)}}disableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!1}}),this.expandMentionGroups$.value===!1)return;this.expandMentionGroups$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableExpandMentionGroups: ",e)}}getExpandMentionGroups$(){return this.expandMentionGroups$.asObservable()}getExpandMentionGroups(){return this.expandMentionGroups$.value}enableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!0}}),this.showMentionGroupsFirst$.value===!0)return;this.showMentionGroupsFirst$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsFirst: ",e)}}disableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!1}}),this.showMentionGroupsFirst$.value===!1)return;this.showMentionGroupsFirst$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsFirst: ",e)}}getShowMentionGroupsFirst$(){return this.showMentionGroupsFirst$.asObservable()}getShowMentionGroupsFirst(){return this.showMentionGroupsFirst$.value}enableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!0}}),this.showMentionGroupsOnly$.value===!0)return;this.showMentionGroupsOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsOnly: ",e)}}disableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!1}}),this.showMentionGroupsOnly$.value===!1)return;this.showMentionGroupsOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsOnly: ",e)}}getShowMentionGroupsOnly$(){return this.showMentionGroupsOnly$.asObservable()}getShowMentionGroupsOnly(){return this.showMentionGroupsOnly$.value}setAnalyticsFeatureConfig({config:e,feature:t}){try{this.analyticsService.setFeatureConfig({feature:t||ke.COMMENT,config:e})}catch(a){this.loggingService.catch("Error in CommentService setAnalyticsFeatureConfig: ",a)}}generateContextId(e){try{let t;if(e&&typeof e=="object"){let a=JSON.parse(JSON.stringify(e));if(delete a.accessFields,delete a.access,Object.keys(a).length){let i=on(a),c=JSON.stringify(i);t=mr(c)}}return t}catch{return}}setMaxReplyAvatars(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{maxReplyAvatars:e}}),this.maxReplyAvatars$.value===e)return;this.maxReplyAvatars$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMaxReplyAvatars: ",t)}}getMaxReplyAvatars$(){return this.maxReplyAvatars$.asObservable()}getMaxReplyAvatars(){return this.maxReplyAvatars$.value}enableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!0}}),this.replyAvatars$.value===!0)return;this.replyAvatars$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReplyAvatars: ",e)}}disableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!1}}),this.replyAvatars$.value===!1)return;this.replyAvatars$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReplyAvatars: ",e)}}getReplyAvatars$(){return this.replyAvatars$.asObservable()}getReplyAvatars(){return this.replyAvatars$.value}setCommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentplaceholder:e}}),this.commentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentplaceholder: ",t)}}getCommentplaceholder$(){return this.commentplaceholder$.asObservable()}getCommentplaceholder(){return this.commentplaceholder$.value}setReplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyplaceholder:e}}),this.replyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setReplyplaceholder: ",t)}}getReplyplaceholder$(){return this.replyplaceholder$.asObservable()}getReplyplaceholder(){return this.replyplaceholder$.value}setEditplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editplaceholder:e}}),this.editplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditplaceholder: ",t)}}getEditplaceholder$(){return this.editplaceholder$.asObservable()}getEditplaceholder(){return this.editplaceholder$.value}setEditcommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editcommentplaceholder:e}}),this.editcommentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditcommentplaceholder: ",t)}}getEditcommentplaceholder$(){return this.editcommentplaceholder$.asObservable()}getEditcommentplaceholder(){return this.editcommentplaceholder$.value}setEditreplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editreplyplaceholder:e}}),this.editreplyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditreplyplaceholder: ",t)}}getEditreplyplaceholder$(){return this.editreplyplaceholder$.asObservable()}getEditreplyplaceholder(){return this.editreplyplaceholder$.value}enableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!0}}),this.screenshotEnabled$.value===!0)return;this.screenshotEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScreenshot: ",e)}}disableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!1}}),this.screenshotEnabled$.value===!1)return;this.screenshotEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScreenshot: ",e)}}getScreenshotEnabled$(){return this.screenshotEnabled$.asObservable()}getScreenshotEnabled(){return this.screenshotEnabled$.value}getAnnotationNumber(e){try{let t=this.commentAnnotationById$.value||{},a=-1,i=Object.values(t).filter(c=>{let m=c.metadata?.documentId===e.metadata?.documentId;return m&&c.annotationNumber&&(a=Math.max(a,c.annotationNumber)),m});return a===-1?i.length+1:a+1}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationNumber: ",t),null}}enableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!0}}),this.fullScreenInSidebar$.value===!0)return;this.fullScreenInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullScreenInSidebar: ",e)}}disableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!1}}),this.fullScreenInSidebar$.value===!1)return;this.fullScreenInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullScreenInSidebar: ",e)}}getFullScreenInSidebar$(){return this.fullScreenInSidebar$.asObservable()}getFullScreenInSidebar(){return this.fullScreenInSidebar$.value}setComposerFileAttachments(e){try{this.composerFileAttachments$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerFileAttachments: ",t)}}getComposerFileAttachments$(){return this.composerFileAttachments$.asObservable()}getComposerFileAttachments(){return this.composerFileAttachments$.value}clearComposerFileAttachments(){try{this.composerFileAttachments$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearComposerFileAttachments: ",e)}}enableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!0}}),this.attachmentNameInMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentNameInMessage: ",e)}}disableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!1}}),this.attachmentNameInMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentNameInMessage: ",e)}}getAttachmentNameInMessage$(){return this.attachmentNameInMessage$.asObservable()}getAttachmentNameInMessage(){return this.attachmentNameInMessage$.value}setAllowedFileTypes(e){try{this.allowedFileTypes$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedFileTypes: ",t)}}getAllowedFileTypes$(){return this.allowedFileTypes$.asObservable()}getAllowedFileTypes(){return this.allowedFileTypes$.value}enableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!0}}),this.forceCloseAllOnEsc$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableForceCloseAllOnEsc: ",e)}}disableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!1}}),this.forceCloseAllOnEsc$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableForceCloseAllOnEsc: ",e)}}getForceCloseAllOnEsc$(){return this.forceCloseAllOnEsc$.asObservable()}getForceCloseAllOnEsc(){return this.forceCloseAllOnEsc$.value}markAsRead(e){return Pe(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.viewsService?.setCommentAnnotationAsRead(t))}catch(t){this.loggingService.catch("Error in ViewsService markAsRead:",t)}})}markAsUnread(e){return Pe(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.viewsService?.setCommentAnnotationAsUnread(t))}catch(t){this.loggingService.catch("Error in ViewsService markAsUnread:",t)}})}setAutoCompleteScrollConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCompleteScrollConfig:e}});let t=this.autoCompleteScrollConfig$.value,a={itemSize:e.itemSize??t.itemSize,minBufferPx:e.minBufferPx??t.minBufferPx,maxBufferPx:e.maxBufferPx??t.maxBufferPx,templateCacheSize:e.templateCacheSize??t.templateCacheSize};this.autoCompleteScrollConfig$.next(a)}catch(t){this.loggingService.catch("Error in CommentService setAutoCompleteScrollConfig: ",t)}}getAutoCompleteScrollConfig(){return this.autoCompleteScrollConfig$.value}getAutoCompleteScrollConfig$(){return this.autoCompleteScrollConfig$.asObservable()}submitComment(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: submitComment","color: green;"),this.submitComment$.next(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService submitComment: ",t)}}onSubmitComment$(){return this.submitComment$.asObservable()}clearComposer(e){try{this.clearComposer$.next(e.targetComposerElementId),this.composerDataMap.delete(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService clearComposer: ",t)}}onClearComposer$(){return this.clearComposer$.asObservable()}emitComposerTextChange(e,t,a){try{this.commentActionsService?.onComposerTextChange({text:e,annotation:t,targetComposerElementId:a})}catch(i){this.loggingService.catch("Error in CommentService emitComposerTextChange: ",i)}}setComposerData(e,t){try{this.composerDataMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentService setComposerData: ",a)}}clearComposerData(e){try{this.composerDataMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentService clearComposerData: ",t)}}getComposerData(e){try{return this.composerDataMap.get(e.targetComposerElementId)||null}catch(t){return this.loggingService.catch("Error in CommentService getComposerData: ",t),null}}};o.\u0275fac=function(t){return new(t||o)(be(vr),be(to),be(Vv),be(ut),be(Db),be(ot),be(Ne),be(Fh),be(yb),be($t),be(Hb),be(Nh),be($h),be(Dr),be(N),be(zb),be(Dt),be(Jb),be(fr),be(Ab),be(Eg),be(Eb),be(Tb),be(Ug))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Gg=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.authService=e,this.iamService=t,this.docService=a,this.configService=i,this.commonDbService=c,this.loggingService=m,this.commentService=h,this.userPermissionService=_,this.documentPaths=null,this.LISTENER_BATCH_SIZE=5}getAnnotationsCount(e){try{return this.authService.getUser$().pipe(jt(t=>!!t),Me(t=>this.docService.getOrganizationConfig$().pipe(jt(a=>!!a),Oe(()=>t))),Me(t=>this.commentService.isFeatureAllowed({firebaseUser:t,annotations:[],filteredAnnotations:[]})),Me(t=>t.featureAllowed?this.iamService.isUserAllowed$().pipe(Oe(a=>(t.featureAllowed=a,t))):Ee(t)),Me(t=>t.featureAllowed?this.processRequest(t,e):Ee(null)),Oe(t=>t??{data:null}),gr(Wr))}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",t),Ee({data:null})}}processRequest(e,t){try{return Ee(e).pipe(Me(()=>this.initializeDocumentPaths(t,e)),Me(()=>this.getDocumentIds$(t)),Me(a=>{let i=this.authService.getUser()?.userSnippylyId,c=this.buildRequestContext(t,a);if(!this.validateRequestContext(c,t))return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});if(!c.organizationId)return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});let m=this.setupTriggers$(c.mode,c.organizationId,c.clientOrganizationId,c.veltFolderId,c.serverDocumentIds);if(this.shouldUseAggregateMode(c.mode))return this.handleAggregateCounts$({triggers$:m,serverDocumentIds:c.serverDocumentIds,request:t,userId:i,organizationId:c.organizationId,clientOrganizationId:c.clientOrganizationId,veltFolderId:c.veltFolderId,folderId:c.folderId,mode:c.mode}).pipe(Oe(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})));if(c.mode.isBatchedGroupedMode){let h=t?.debounceMs??5e3;return this.handleBatchedGroupedCounts$({triggers$:m,documentIds:a,request:t,userId:i,organizationId:c.organizationId,veltFolderId:c.veltFolderId,debounceMs:h}).pipe(Oe(_=>({data:_,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}else return this.handleGroupedCounts$(m,a,t,i,c.organizationId,c.veltFolderId).pipe(Oe(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}),Me(a=>{if(!a?.data)return Ee(null);let{data:i,mode:c,serverDocumentIds:m}=a;return t?.filterGhostComments?this.filterGhostComments$(i,c,m):Ee(i)}),yn(a=>(this.loggingService.catch("Error processing request: ",a),Ee(null))))}catch(a){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",a),Ee(null)}}initializeDocumentPaths(e,t){try{return e?Ee(t):this.docService.getDocumentPaths$().pipe(jt(a=>!!a),Ac(a=>{this.documentPaths=a,t.documentPaths=a}),Oe(()=>{}))}catch(a){return this.loggingService.catch("Error in CommentService initializeDocumentPaths: ",a),Ee(t)}}buildRequestContext(e,t){try{let a=this.docService.getOrganizationConfig(),i=this.documentPaths?.organizationId??a?.organizationId,c=this.documentPaths?.clientOrganizationId??a?.clientOrganizationId,m,h,_;if(e?.allDocuments||e?.documentIds||e?.folderId||e?.organizationId||e?.locationIds){if(e.organizationId&&(i=Uv(e.organizationId),c=e.organizationId),!i)throw new Error("organizationId is required for this request type");e.folderId&&(m=dr(e.folderId),h=e.folderId),e.allDocuments&&(_=!0)}else m=this.documentPaths?.veltFolderId,h=this.documentPaths?.folderId,_=this.documentPaths?.allDocuments;let I=this.determineMode(e,m,_,t),S=I.isOrgMode?[]:t.length>0?t.map(z=>z.documentId):[this.documentPaths?.documentId??""];return{organizationId:i,clientOrganizationId:c,veltFolderId:m,folderId:h,allDocuments:_,mode:I,serverDocumentIds:S}}catch(a){return this.loggingService.catch("Error in CommentService buildRequestContext: ",a),{organizationId:void 0,clientOrganizationId:void 0,veltFolderId:void 0,folderId:void 0,allDocuments:void 0,mode:{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1},serverDocumentIds:[]}}}validateRequestContext(e,t){try{if(t?.aggregateDocuments&&!e.serverDocumentIds.length)throw this.loggingService.catch("Error in CommentService getAnnotationsCount: documentIds is required when aggregateDocuments is true"),new Error("documentIds is required when aggregateDocuments is true");return!(!e.organizationId||!(e.mode.isOrgMode||e.mode.isFolderMode)&&e.serverDocumentIds.some(a=>!a))}catch(a){return this.loggingService.catch("Error in CommentService validateRequestContext: ",a),!1}}shouldUseAggregateMode(e){try{return e.isFolderMode||e.isOrgMode||e.isBatchMode}catch(t){return this.loggingService.catch("Error in CommentService shouldUseAggregateMode: ",t),!1}}getDocumentIds$(e){try{return e?.documentIds?.length?Ee(e.documentIds.map(t=>({clientDocumentId:t,documentId:xg(t)}))):this.docService.getDocumentIds$().pipe(Oe(t=>t.length>0?t:[{documentId:this.documentPaths?.documentId??"",clientDocumentId:this.documentPaths?.clientDocumentId||""}]))}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIds: ",t),Ee([])}}determineMode(e,t,a,i){try{let c=!!e?.organizationId&&!e?.documentIds?.length&&!t&&!a,m=!!t&&!!a,h=!!e?.aggregateDocuments&&!a&&!!i?.length,_=(!!e?.batchedPerDocument||i.length>1)&&!!i?.length&&!e?.aggregateDocuments&&!a;return{isOrgMode:c,isFolderMode:m,isBatchMode:h,isBatchedGroupedMode:_}}catch(c){return this.loggingService.catch("Error in CommentService determineMode: ",c),{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1}}}setupTriggers$(e,t,a,i,c){try{if(e.isOrgMode){let m=this.authService.getUser()?.userId??"";return[_n(this.userPermissionService?.getUserPermissionsFromCacheOrFetch({organizationId:a})??Promise.resolve({})).pipe(Me(_=>m&&_?.[m]?.organization?.[a]?.errorCode===kg.PERMISSION_DENIED?(this.loggingService.log(`%c[WB] commentViews org listener skipped \u2014 user does not have access to organization: ${a}`,"color: orange;"),Wn):this.commonDbService.dbListener({feature:"organizationMetadata",properties:{useCollectionGroup:!1,isCollection:!1,organizationId:t}}))).pipe(Oe(_=>_?.data?.commentViewsUpdatedAt??null),jt(_=>!!_),gr(Wr))]}else{if(e.isFolderMode)return[this.commonDbService.dbListener({feature:"folder",properties:{useCollectionGroup:!1,isCollection:!1,folderId:i,organizationId:t}}).pipe(Oe(h=>h?.data?.commentViewsUpdatedAt??null),jt(h=>!!h),gr(Wr))];if(e.isBatchMode||e.isBatchedGroupedMode){let m=[];for(let h=0;h<c.length;h+=this.LISTENER_BATCH_SIZE)m.push(c.slice(h,h+this.LISTENER_BATCH_SIZE));return m.map(h=>this.commonDbService.dbListener({feature:"allDocuments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",t),Qe("metadata.documentId","in",h))]}}).pipe(Oe(I=>Object.values(I?.data||{}).map(z=>z?.commentViewsUpdatedAt??null).sort().join(",")),gr(Wr)))}else return c.map(m=>this.commonDbService.dbListener({feature:"documentMetadata",properties:{useCollectionGroup:!1,isCollection:!1,documentId:m,organizationId:t}}).pipe(Oe(_=>_?.data?.commentViewsUpdatedAt??null),jt(_=>!!_),gr(Wr)))}}catch(m){return this.loggingService.catch("Error in CommentService setupTriggers: ",m),[]}}handleGroupedCounts$(e,t,a,i,c,m){try{let h=t.map((_,I)=>e[I].pipe(Mu(void 0),Me(()=>_n(this.getCountsForDocument$(_.documentId,_.clientDocumentId,a,i,c,m)))));return kr(h).pipe(Oe(_=>{let I={};return _.forEach(S=>{S&&(I[S.clientDocumentId]={total:S.total,unread:S.unread})}),{data:I}}),yn(_=>(this.loggingService.catch("Error in grouped counts: ",_),Ee(null))))}catch(h){return this.loggingService.catch("Error in CommentService handleGroupedCounts: ",h),Ee(null)}}handleBatchedGroupedCounts$(e){try{let{triggers$:t,documentIds:a,request:i,userId:c,organizationId:m,veltFolderId:h,debounceMs:_}=e,I=this.LISTENER_BATCH_SIZE,S=new Qp(1),z=t.map((ae,pe)=>ae.pipe(ih(S),Oe(()=>pe))),$=Eu(...z).pipe(Ov(_)),G=Ee(-1).pipe(Me(()=>_n(this.fetchAllDocumentCounts$(a,i,c,m,h))),Oe(ae=>({batchIndex:-1,data:ae?.data||{}})),Ac(()=>{S.next()})),Z=$.pipe(Me(ae=>{let pe=ae*I,Se=Math.min(pe+I,a.length),oe=a.slice(pe,Se);return _n(this.fetchAllDocumentCounts$(oe,i,c,m,h)).pipe(Oe(he=>({batchIndex:ae,data:he?.data||{}})))}));return Eu(G,Z).pipe(oh((ae,pe)=>({data:g(g({},ae.data),pe.data)}),{data:{}}),yn(ae=>(this.loggingService.catch("Error in batched grouped counts: ",ae),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleBatchedGroupedCounts: ",t),Ee(null)}}fetchAllDocumentCounts$(e,t,a,i,c){return Pe(this,null,function*(){try{let m=e.map(I=>this.getCountsForDocument$(I.documentId,I.clientDocumentId,t,a,i,c)),h=yield Promise.allSettled(m),_={};return h.forEach(I=>{if(I.status==="fulfilled"&&I.value){let{clientDocumentId:S,total:z,unread:$}=I.value;_[S]={total:z,unread:$}}}),{data:_}}catch(m){return this.loggingService.catch("Error in CommentService fetchAllDocumentCounts: ",m),null}})}handleAggregateCounts$(e){try{let{triggers$:t,serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e;return kr(t).pipe(Oe(()=>{})).pipe(Mu(void 0),Me(()=>_n(this.getAggregateCounts({serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}))),yn($=>(this.loggingService.catch("Error in aggregate counts: ",$),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleAggregateCounts: ",t),Ee(null)}}getCountsForDocument$(e,t,a,i,c,m){return Pe(this,null,function*(){try{let h=this.configService?.getApiKey(),_={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},I=[Qe("metadata.apiKey","==",h),Qe("metadata.organizationId","==",c),Qe("metadata.documentId","in",[e]),...m?[Qe("metadata.veltFolderId","==",m)]:[],...a?.statusIds?.length?[Qe("status.id","in",a.statusIds)]:[],...a?.locationIds?.length?[Qe("location.id","in",a.locationIds)]:[],...a?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",a.agentFields)]:[]],S=[Mr(...I),Xt("lastUpdated","desc"),Xt("createdAt","desc")],z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:S})}),$=0;if(!a?.agentFields?.length){let G=[...I,Qe("viewedByUserIds","array-contains",i)],Z=[Mr(...G),Xt("lastUpdated","desc"),Xt("createdAt","desc")];$=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:Z})})}return{clientDocumentId:t,total:z,unread:z-$}}catch(h){return this.loggingService.catch("Error in CommentService getCountsForDocument: ",h),null}})}getAggregateCounts(e){return Pe(this,null,function*(){try{let t="",{serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e,z=this.configService?.getApiKey(),$={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},G=[Qe("metadata.apiKey","==",z),Qe("metadata.organizationId","==",m),...i?.statusIds?.length?[Qe("status.id","in",i.statusIds)]:[],...i?.locationIds?.length?[Qe("location.id","in",i.locationIds)]:[],...i?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",i.agentFields)]:[]],Z,ae=0;if(S.isFolderMode){t=I??"",G.push(Qe("metadata.veltFolderId","==",_));let pe=[Mr(...G),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:pe})}),!i?.agentFields?.length){let Se=[...G,Qe("viewedByUserIds","array-contains",c)],oe=[Mr(...Se),Xt("lastUpdated","desc"),Xt("createdAt","desc")];ae=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:oe})})}}else if(S.isOrgMode){t=h??"";let pe=[Mr(...G),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:pe})}),!i?.agentFields?.length){let Se=[...G,Qe("viewedByUserIds","array-contains",c)],oe=[Mr(...Se),Xt("lastUpdated","desc"),Xt("createdAt","desc")];ae=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:oe})})}}else{t="result";let pe=[];for(let he=0;he<a.length;he+=this.LISTENER_BATCH_SIZE)pe.push(a.slice(he,he+this.LISTENER_BATCH_SIZE));let Se=pe.map(he=>Pe(this,null,function*(){let _e=[...G,Qe("metadata.documentId","in",he),..._?[Qe("metadata.veltFolderId","==",_)]:[]],Re=[Mr(..._e),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:Re})})}));if(Z=(yield Promise.allSettled(Se)).reduce((he,_e)=>he+(_e.status==="fulfilled"&&_e.value||0),0),!i?.agentFields?.length){let he=pe.map(Re=>Pe(this,null,function*(){let Ye=[...G,Qe("metadata.documentId","in",Re),..._?[Qe("metadata.veltFolderId","==",_)]:[],Qe("viewedByUserIds","array-contains",c)],lt=[Mr(...Ye),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:lt})})}));ae=(yield Promise.allSettled(he)).reduce((Re,Ye)=>Re+(Ye.status==="fulfilled"&&Ye.value||0),0)}}return{data:{[t]:{total:Z,unread:Z-ae}}}}catch(t){return this.loggingService.catch("Error in CommentService getAggregateCounts: ",t),null}})}filterGhostComments$(e,t,a){try{return e?this.commentService.getGhostCommentAnnotationMap$().pipe(Oe(i=>{if(!i)return e;let c=this.buildGhostCommentAnnotationMap(i),m=this.groupGhostCommentsByModeId(c,t,a);return this.adjustCountsForGhostComments(e,m),e})):Ee(null)}catch(i){return this.loggingService.catch("Error in CommentService filterGhostComments: ",i),Ee(null)}}buildGhostCommentAnnotationMap(e){let t={};return Object.keys(e).forEach(a=>{let i=this.commentService.getAnnotationById(a);i&&(t[a]=i)}),t}groupGhostCommentsByModeId(e,t,a){try{let i={};return Object.values(e).forEach(c=>{let m=this.getModeIdForAnnotation(c,t,a);m&&(i[m]||(i[m]=[]),i[m].push(c))}),i}catch(i){return this.loggingService.catch("Error in CommentService groupGhostCommentsByModeId: ",i),{}}}getModeIdForAnnotation(e,t,a){try{return t.isOrgMode?e?.metadata?.clientOrganizationId||null:t.isFolderMode?e?.metadata?.folderId||null:t.isBatchMode?a.includes(e?.metadata?.documentId??"")?"result":null:e?.metadata?.clientDocumentId||null}catch(i){return this.loggingService.catch("Error in CommentService getModeIdForAnnotation: ",i),null}}adjustCountsForGhostComments(e,t){try{if(typeof e?.data!="object")return;let i=this.authService.getUser()?.userSnippylyId;Object.keys(e.data||{}).forEach(c=>{let m=t[c];if(!(!m||!e?.data?.[c]?.total)&&(e.data[c].total=Math.max(0,e.data[c].total-m.length),i)){let h=m.filter(_=>_?.viewedByUserIds&&!_?.viewedByUserIds?.includes(i));h.length>0&&(e.data[c].unread=Math.max(0,e.data[c].unread-h.length))}})}catch(a){this.loggingService.catch("Error in CommentService adjustCountsForGhostComments: ",a)}}};o.\u0275fac=function(t){return new(t||o)(be(ot),be(Dr),be(ut),be(Vv),be(to),be(N),be(ie),be(Ug))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var vt=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z,$,G,Z){this.analyticsService=e,this.authService=t,this.commentService=a,this.commentViewsService=i,this.contactService=c,this.customFilterService=m,this.docService=h,this.iamService=_,this.loggingService=I,this.metadataService=S,this.commonDbService=z,this.serviceBook=$,this.suggestionActions=G,this.targetRegistry=Z,this.actionSubjects=new Map,this.defaultSource="internal",this.isUserAdmin=!1,this.subscriptions=[],this.reactionService=null,this.loggingService.log("%c[WB] Creating CLASS: CommentActionsService","color: blue;");try{this.commentService.setCommentActionsService(this),this.iamService.isUserAdmin$().subscribe(ae=>{this.isUserAdmin=ae}),this.serviceBook.observe(Tg).subscribe(ae=>{this.reactionService=ae})}catch(ae){this.loggingService.catch("Error in CommentActionsService constructor: ",ae)}}addCommentAnnotation(c,m){return Pe(this,arguments,function*({annotation:e,options:t,visibility:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addCommentAnnotation","color: green;"),a){if(a.type==="restricted"){let I=this.authService.getUser();I?.userId&&(a=Mn(a,I.userId))}if(a.type==="organizationPrivate"&&!a.organizationId&&!a.organizationIds?.length){let I=this.authService.getUser()?.clientOrganizationId;I&&(a=f(g({},a),{organizationId:I}))}let h=this.authService.getUser()?.userId,_=An(a,h);_.length>0&&(e.context||(e.context={}),e.context._setAccessFields=_,e.visibilityConfig=Pn(a,h))}return new Promise(h=>{this.commentService.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,_=>Pe(this,null,function*(){let I=yield this.getAddCommentAnnotationEventFromCommentAddEventData(_);h(I)}),void 0,void 0,e,void 0,void 0,void 0,void 0,void 0,i)})}catch(h){return this.loggingService.catch("Error in CommentActionsService addCommentAnnotation: ",h),null}})}getAddCommentAnnotationEventFromCommentAddEventData(e){return Pe(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata();return{commentAnnotation:this.commentService.getCommentAnnotationForClient(e?.annotation),annotationId:e?.annotation?.annotationId,metadata:t,addContext:e?.addContext,elementRef:e?.elementRef}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationEvent(e){try{this.triggerAction(dt.ADD_COMMENT_ANNOTATION,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationEvent: ",t)}}getAddCommentAnnotationDraftEventFromCommentAddEventData(e){return Pe(this,null,function*(){try{return{metadata:yield this.metadataService.getGlobalMetadata(),addContext:e?.addContext}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationDraftEvent(e){try{this.triggerAction(dt.ADD_COMMENT_ANNOTATION_DRAFT,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationDraftEvent: ",t)}}triggerAddCommentDraftEventForAnnotation(e,t){return Pe(this,null,function*(){try{if(!e?.annotationId||!t)return;let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),comment:t,metadata:a};this.triggerAction(dt.ADD_COMMENT_DRAFT,i)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAddCommentDraftEventForAnnotation: ",a)}})}triggerAnnotationNotFoundError(e){try{this.loggingService.catch("Annotation not found:","The annotation with the given id was not found.")}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAnnotationNotFoundError: ",t)}}deleteCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteCommentAnnotation","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){this.commentService.deleteCommentPinAnnotation(h);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:h.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I};return this.triggerAction(dt.DELETE_COMMENT_ANNOTATION,S),S}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it.")}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteCommentAnnotation: ",m),null}})}updatePriority(c,m){return Pe(this,arguments,function*({annotationId:e,priority:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updatePriority","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.priority?JSON.parse(JSON.stringify(_.priority)):null;I&&t&&I?.id===t?.id?_.priority=void 0:_.priority=t,this.commentService.saveComment(_,{type:Ke.PRIORITY_CHANGED,newPriority:t,oldPriority:I});let S=yield this.metadataService.getGlobalMetadata(),z={newPriority:t,oldPriority:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(dt.UPDATE_PRIORITY,z),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PRIORITY_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldPriority:_.priority,newPriority:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource}),z}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updatePriority: ",h),null}})}updateStatus(c,m){return Pe(this,arguments,function*({annotationId:e,status:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateStatus","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.status?JSON.parse(JSON.stringify(_.status)):null;_.status=t,_.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(_,{type:Ke.STATUS_CHANGED,newStatus:t,oldStatus:I});let S=yield this.metadataService.getGlobalMetadata(),z={newStatus:t,oldStatus:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(dt.UPDATE_STATUS,z),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_STATUS_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldStatus:I,newStatus:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,commentAnnotationCreatedAt:_.createdAt}),z}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateStatus: ",h),null}})}updateAccess(c,m){return Pe(this,arguments,function*({annotationId:e,accessMode:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateAccess","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_)if(this.commentService.isPrivateCommentAllowed()){_=JSON.parse(JSON.stringify(_));let I=_.iam?.accessMode;_.iam.accessMode=t,this.commentService.saveComment(_,{type:Ke.ACCESS_MODE_CHANGED,newAccessMode:t,oldAccessMode:I});let S=yield this.metadataService.getGlobalMetadata(),z={newAccessMode:t,oldAccessMode:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};switch(this.triggerAction(dt.UPDATE_ACCESS,z),t){case lr.PRIVATE:this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:lr.PRIVATE,source:i??this.defaultSource});break;case lr.PUBLIC:this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:lr.PUBLIC,source:i??this.defaultSource});break;default:break}return z}else this.loggingService.catch("Access Denied","You must be an admin to update the access mode of the comment.");else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateAccess: ",h),null}})}resolveCommentAnnotation(a){return Pe(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: resolveCommentAnnotation","color: green;");let i=this.authService.getUser();if(!i)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let c=this.commentService.getAnnotationById(e,t);if(c){c=JSON.parse(JSON.stringify(c));let m=this.customFilterService.resolvedStatus,h=c.status?JSON.parse(JSON.stringify(c.status)):null;m&&(c.status=m,c.statusUpdatedByUserId=i?.userId,this.commentService.saveComment(c,{type:Ke.STATUS_CHANGED,newStatus:m,oldStatus:h}));let _=yield this.metadataService.getGlobalMetadata(),I={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(c),metadata:_};return this.triggerAction(dt.RESOLVE_COMMENT,I),I}else this.triggerAnnotationNotFoundError(e);return null}catch(i){return this.loggingService.catch("Error in CommentActionsService resolveCommentAnnotation: ",i),null}})}getLink(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getLink","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){let h=this.commentService.getCommentUrl(m)??null,_=yield this.metadataService.getGlobalMetadata();return{link:h,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:_}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService getLink: ",m),null}})}copyLink(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: copyLink","color: green;");let m=yield this.getLink({annotationId:e,options:t},a);if(m?.link){nb(m.link),this.commentService.setCopyLink(m.link),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_LINK_COPIED,{annotationId:e,commentType:this.commentService.getCommentType(m.commentAnnotation),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource,link:m.link});let h=yield this.metadataService.getGlobalMetadata(),_={link:m.link,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m.commentAnnotation),metadata:h};return this.triggerAction(dt.COPY_LINK,_),_}return null}catch(m){return this.loggingService.catch("Error in CommentActionsService copyLink: ",m),null}})}addComment(_,I){return Pe(this,arguments,function*({annotationId:e,comment:t,assignedTo:a,assigned:i,options:c,visibility:m},h){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addComment","color: green;");let S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(S){let z=this.commentService.getAnnotationById(e,c),$=z?.comments?.length?Ke.ADDED:Ke.NEWLY_ADDED;if(z){z.status.type==="terminal"&&(z.status=this.customFilterService.defaultStatus);let G=new qn;G=g(g({},G),t),G.lastUpdated=new Date,G.attachments||(G.attachments=[]),G.attachments=G.attachments.filter(oe=>oe?.attachmentId),G.createdAt=this.timestamp,G.from=S,a&&(z.assignedTo=a),this.commentService.saveComment(z,{type:$,updatedComment:G,assigned:i,visibility:m,_dispatchAddCommentEvent:!0});let Z=f(g({},z),{comments:[...z.comments||[],G]}),ae=yield this.buildAddCommentEvent({annotation:Z,newComment:G});if(!ae)return null;let pe=t?.commentId,Se=this.calculateCommentThreadIndex(t,z);return this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ADDED,{annotationId:e,commentThreadId:pe,commentThreadIndex:Se,commentType:this.commentService.getCommentType(z),commentMode:this.commentService.getCommentMode(),source:h??this.defaultSource,commentAnnotationCreatedAt:z.createdAt,taggedClientUserIds:G.taggedUserContacts?.map(oe=>oe.contact?.userId).filter(oe=>!!oe),taggedSnippylyUserIds:G.taggedUserContacts?.filter(oe=>!!z?.metadata?.apiKey&&!!oe.contact?.userId).map(oe=>yg(z.metadata.apiKey,oe.contact.userId))}),ae}else this.triggerAnnotationNotFoundError(e)}return null}catch(S){return this.loggingService.catch("Error in CommentActionsService addComment: ",S),null}})}buildAddCommentEvent(a){return Pe(this,arguments,function*({annotation:e,newComment:t}){try{let i=yield this.metadataService.getGlobalMetadata();return{annotationId:e.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:i}}catch(i){return this.loggingService.catch("Error in CommentActionsService buildAddCommentEvent: ",i),null}})}triggerAddCommentEvent(a){return Pe(this,arguments,function*({annotation:e,newComment:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: triggerAddCommentEvent","color: green;");let i=yield this.buildAddCommentEvent({annotation:e,newComment:t});return i&&this.triggerAction(dt.ADD_COMMENT,i),i}catch(i){return this.loggingService.catch("Error in CommentActionsService triggerAddCommentEvent: ",i),null}})}approveCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: approveCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){m.approved=!0,this.commentService.saveComment(m,{type:Ke.APPROVED}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_APPROVED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource});let h=yield this.metadataService.getGlobalMetadata(),_={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:h};return this.triggerAction(dt.APPROVE_COMMENT_ANNOTATION,_),_}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService approveComment: ",m),null}})}acceptCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentAcceptStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ke.ACCEPTED,oldStatus:_,newStatus:X.CommentAcceptStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(dt.ACCEPT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptCommentAnnotation: ",m),null}})}rejectCommentAnnotation(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentRejectStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ke.REJECTED,oldStatus:_,newStatus:X.CommentRejectStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(dt.REJECT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_REJECTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService rejectCommentAnnotation: ",m),null}})}ensureSuggestionObject(e){try{if(!e||e?.suggestion||!(e?.type==="suggestion"||e?.commentType==="suggestion"))return;e.suggestion={status:"pending",targetId:"",targetType:"custom",oldValue:null,newValue:null,summary:null,driftDetected:!1,rejectReason:null,resolvedBy:null,resolvedAt:null}}catch(t){this.loggingService.catch("Error in CommentActionsService ensureSuggestionObject: ",t)}}acceptSuggestion(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptSuggestion","color: green;");let m=this.authService.getUser();if(!m)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(!h)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(h),!(h.type==="suggestion"||h.commentType==="suggestion")||!h.suggestion||h.suggestion.status!=="pending")return null;let _=h.suggestion.targetId;if(_){if(!this.targetRegistry.getNode(_)){h.suggestion.status="stale",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"stale",targetId:_}),this.commentService.updateComment(h),this.suggestionActions.projectAndTrigger(hg.SUGGESTION_STALE,h);let Z=yield this.metadataService.getGlobalMetadata(),ae={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:Z,actionUser:m};return this.triggerAction(dt.SUGGESTION_ACCEPTED,ae),ae}let $=this.targetRegistry.getGetter(_),G=!1;if($)try{let Z=$();G=!an(Z,h.suggestion.oldValue)}catch{G=!1}h.suggestion.driftDetected=G}h.suggestion.status="accepted",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,h.type="comment",h?.agent?.agentFields&&typeof h.agent.agentFields=="object"&&Array.isArray(h.agent.agentFields)&&(h.agent.agentFields=h.agent.agentFields.filter(z=>z!=="status:suggestion"),h.agent.agentFields.includes("status:accepted")||h.agent.agentFields.push("status:accepted")),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"accepted",targetId:_,driftDetected:h.suggestion?.driftDetected}),this.commentService.saveComment(h,{type:Ke.SUGGESTION_ACCEPTED}),this.suggestionActions.projectAndTrigger(hg.SUGGESTION_APPROVED,h),this.analyticsService.trackEvent(ne.Events.Comments.SUGGESTION_ACCEPTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I,actionUser:m};return this.triggerAction(dt.SUGGESTION_ACCEPTED,S),S}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptSuggestion: ",m),null}})}rejectSuggestion(c,m){return Pe(this,arguments,function*({annotationId:e,reason:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectSuggestion","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(!_)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(_),!(_.type==="suggestion"||_.commentType==="suggestion")||!_.suggestion||_.suggestion.status!=="pending")return null;_.suggestion.status="rejected",_.suggestion.rejectReason=t??null,_.suggestion.resolvedBy=h,_.suggestion.resolvedAt=this.timestamp,_.statusUpdatedByUserId=h?.userId,_.type="comment",_?.agent?.agentFields&&typeof _.agent.agentFields=="object"&&Array.isArray(_.agent.agentFields)&&(_.agent.agentFields=_.agent.agentFields.filter(z=>z!=="status:suggestion"),_.agent.agentFields.includes("status:rejected")||_.agent.agentFields.push("status:rejected")),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"rejected",targetId:_.suggestion.targetId}),this.commentService.saveComment(_,{type:Ke.SUGGESTION_REJECTED}),this.suggestionActions.projectAndTrigger(hg.SUGGESTION_REJECTED,_),this.analyticsService.trackEvent(ne.Events.Comments.SUGGESTION_REJECTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I,actionUser:h,rejectReason:t??null};return this.triggerAction(dt.SUGGESTION_REJECTED,S),S}catch(h){return this.loggingService.catch("Error in CommentActionsService rejectSuggestion: ",h),null}})}toggleNotificationSubscription(i,c){return Pe(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleNotificationSubscription","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=mr(h.userId);if(_){m.subscribedUsers||(m.subscribedUsers={}),m.unsubscribedUsers||(m.unsubscribedUsers={});let I,S=!1;if(m?.unsubscribedUsers?.[_])S=!1;else if(m?.subscribedUsers?.[_])S=!0;else{let G=this.contactService.getCurrentOrganizationUserIAM();if(G){let Z=G.groups||{};Object.keys(Z).forEach(ae=>{m?.subscribedGroups?.[ae]&&(S=!0)})}}if(a==="subscribe"||!a&&!S)delete m.unsubscribedUsers[_],m.subscribedUsers[_]={user:h,type:"manual"},I=Ke.SUBSCRIBED;else if(a==="unsubscribe"||!a&&S)delete m.subscribedUsers[_],m.unsubscribedUsers[_]={user:h,type:"manual"},I=Ke.UNSUBSCRIBED;else return null;this.commentService.saveComment(m,{type:I});let z=yield this.metadataService.getGlobalMetadata(),$={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:z};return I===Ke.SUBSCRIBED?this.triggerAction(dt.SUBSCRIBE_COMMENT_ANNOTATION,$):this.triggerAction(dt.UNSUBSCRIBE_COMMENT_ANNOTATION,$),$}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService toggleNotificationSubscription: ",m),null}})}assignUser(c,m){return Pe(this,arguments,function*({annotationId:e,assignedTo:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: assignUser","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_.assignedTo=t,this.commentService.saveComment(_,{type:Ke.ASSIGNED,assignedTo:t});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,assignedTo:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I};return this.triggerAction(dt.ASSIGN_USER,S),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ASSIGNED,{annotationId:e,commentType:this.commentService.getCommentType(_),commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,assignedToUserId:t?.userId}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService assignUser: ",h),null}})}getComment(a){return Pe(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getComment","color: green;");let i=this.commentService.getAnnotationById(e,t);return i?i.comments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(i){return this.loggingService.catch("Error in CommentActionsService getComment: ",i),[]}})}updateOrDeleteComment(e,t,a,i,c){return Pe(this,null,function*(){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateOrDeleteComment","color: green;"),t?.commentText?.trim()||t?.attachments?.length||t?.recorders?.length){let m=this.authService.getUser();if(this.isUserAdmin||m?.userId===t?.from?.userId){t.lastUpdated=new Date,t.status=Ke.UPDATED,t.isEdited||(t.isEdited=!0,t.editedAt=new Date),this.commentService.saveComment(e,{type:Ke.UPDATED,updatedComment:t});let h=yield this.metadataService.getGlobalMetadata(),_={annotationId:e?.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:h};return this.triggerAction(dt.UPDATE_COMMENT,_),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_EDITED,{annotationId:e?.annotationId,commentThreadId:t?.commentId,commentType:this.commentService.getCommentType(e),commentMode:this.commentService.getCommentMode(),source:c??this.defaultSource}),_}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}else yield this.deleteComment({annotationId:e?.annotationId,commentId:t.commentId,skipDeleteThreadConfirmation:a,options:i});return null}catch(m){return this.loggingService.catch("Error in CommentActionsService updateOrDeleteComment: ",m),null}})}updateComment(h,_){return Pe(this,arguments,function*({annotationId:e,comment:t,skipDeleteThreadConfirmation:a,merge:i,options:c},m){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateComment","color: green;");let I=this.commentService.getAnnotationById(e,c),S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(I&&S){let z=t,$=I.comments?.find(G=>G.commentId===t.commentId);if($){if(this.isUserAdmin||S?.userId===$?.from?.userId)return I?.status.type==="terminal"&&(I.status=this.customFilterService.defaultStatus),i&&(z=g(g({},$),t)),z.from=$.from,z.createdAt=$.createdAt,z.lastUpdated=new Date,yield this.updateOrDeleteComment(I,z,a,c,m);this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(I){return this.loggingService.catch("Error in CommentActionsService updateComment: ",I),null}})}deleteComment(m,h){return Pe(this,arguments,function*({annotationId:e,commentId:t,skipDeleteThreadConfirmation:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteComment","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(!_)return this.triggerAnnotationNotFoundError(e),null;let S=_.comments?.find(ae=>ae?.commentId===t);if(!S)return null;if(!(this.isUserAdmin||I?.userId===S?.from?.userId))return this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it."),null;let z=this.commentService.willDeleteWholeAnnotation(_,t),$=this.commentService.getCommentAnnotationForClient(_);if(!a&&!(yield this.commentService.confirmDeleteCommentIfRequired(_,S)))return null;this.commentService.saveComment(_,{type:Ke.DELETED,updatedComment:S,skipDeleteThreadConfirmation:!0});let G=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,commentAnnotation:$,comment:S,metadata:G};if(z){let ae={annotationId:e,commentAnnotation:$,metadata:G};this.triggerAction(dt.DELETE_COMMENT_ANNOTATION,ae)}else this.triggerAction(dt.DELETE_COMMENT,Z);return Z}catch(_){return this.loggingService.catch("Error in CommentActionsService deleteComment: ",_),null}})}addAttachment(c,m){return Pe(this,arguments,function*({annotationId:e,files:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addAttachment","color: green;");let h=[],_=this.commentService.getAnnotationById(e,a);if(_||i==="internal"){let z=[];t.forEach($=>{let{valid:G,file:Z,maxAllowedSize:ae,error:pe}=this.validateFile($);G&&Z?z.push(this.uploadFile(Z,_||{}).then(Se=>({valid:G,file:Z,maxAllowedSize:ae,error:pe,attachment:Se||void 0}))):z.push(Promise.resolve({valid:G,file:Z,maxAllowedSize:ae,error:pe,attachment:void 0}))}),h=yield Promise.all(z)}else this.triggerAnnotationNotFoundError(e);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:_?this.commentService.getCommentAnnotationForClient(_):void 0,attachments:h,metadata:I};return this.triggerAction(dt.ADD_ATTACHMENT,S),h}catch(h){return this.loggingService.catch("Error in CommentActionsService addAttachment: ",h),[]}})}validateFile(e){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: validateFile","color: green;");let t=100*1024*1024;(e?.type?.includes("image")||e?.type?.includes("pdf"))&&(t=15*1024*1024);let a=e.size<=t;return{valid:a,file:e,maxAllowedSize:t,maxAllowedSizeInMB:t/1024/1024,error:a?void 0:`File size should be less than ${t/1024/1024} MB`}}catch(t){return this.loggingService.catch("Error in CommentActionsService validateFile: ",t),{valid:!1,maxAllowedSize:0,maxAllowedSizeInMB:0,error:"Error in validating file"}}}deleteAttachment(c){return Pe(this,arguments,function*({annotationId:e,commentId:t,attachmentId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteAttachment","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(I=>I?.commentId===t),_=m.metadata;if(h){let I=this.authService.getUser();if(this.isUserAdmin||I?.userId===h?.from?.userId){let S=h.attachments?.find(z=>z?.attachmentId===a);if(S){h.attachments=h.attachments?.filter(Z=>Z?.attachmentId!==a);let z={attachmentId:S.attachmentId,organizationId:_?.clientOrganizationId??_?.organizationId??null,documentId:_?.clientDocumentId??_?.documentId??null,folderId:_?.folderId??null,commentAnnotationId:m.annotationId,apiKey:_?.apiKey??null};yield this.commentService.deleteAttachment({attachment:S,metadata:z});let $=yield this.metadataService.getGlobalMetadata(),G={attachment:S,annotationId:e,commentId:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:$};return this.triggerAction(dt.DELETE_ATTACHMENT,G),this.updateComment({annotationId:e,comment:h,options:i}),G}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the attachment.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteAttachment: ",m),null}})}getAttachment(i){return Pe(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getAttachment","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.attachments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getAttachment: ",c),[]}})}uploadFile(e,t){return Pe(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: uploadFile","color: green;"),this.commentService.uploadFile(e,t)}catch(a){return this.loggingService.catch("Error in CommentActionsService uploadFile: ",a),null}})}getRecording(i){return Pe(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getRecording","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.recorders||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getRecording: ",c),[]}})}deleteRecording(c){return Pe(this,arguments,function*({annotationId:e,commentId:t,recorderId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteRecording","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(_=>_?.commentId===t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){let I=h.recorders?.find(S=>S?.id===a);if(I){h.recorders=h.recorders?.filter($=>$?.id!==a);let S=yield this.metadataService.getGlobalMetadata(),z={annotationId:e,commentId:t,recording:I,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:S};return this.triggerAction(dt.DELETE_RECORDING,z),this.updateComment({annotationId:e,comment:h,skipDeleteThreadConfirmation:!0,options:i}),z}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the recording.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteRecording: ",m),null}})}fetchCommentAnnotations(e){return Pe(this,null,function*(){try{let t=yield this.commentService.fetchCommentAnnotations(e),a;if(t?.hasMore){let c=t?.data[t?.data?.length-1];a=yield Xh(c?.lastUpdated?.toString()??"","veltencrypttoken","veltencrypttoken")}let i=t?.data?.reduce((c,m)=>(c[m.metadata.clientDocumentId??m.metadata.documentId]=c[m.metadata.clientDocumentId??m.metadata.documentId]||[],c[m.metadata.clientDocumentId??m.metadata.documentId].push(this.commentService.getCommentAnnotationForClient(m)),c),{});return g({data:i},t?.hasMore?{nextPageToken:a}:{})}catch(t){return this.loggingService.catch("Error in CommentActionsService fetchCommentAnnotations: ",t),{data:null}}})}toggleReaction(m,h){return Pe(this,arguments,function*({annotationId:e,commentId:t,reaction:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleReaction","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(_&&I){let S=_.comments?.find(z=>z?.commentId===t);if(S){let z=yield this.reactionService?.addOrUpdateReaction(a.reactionId,S?.reactionAnnotationIds||[],void 0,void 0,_?.annotationId,a.customReaction,c),$=Ke.REACTION_ADDED;if(z){z?.reactions?.find(ae=>ae.from?.userId===I?.userId)||($=Ke.REACTION_DELETED),S.reactionAnnotationIds||(S.reactionAnnotationIds=[]),S.reactionAnnotationIds.includes(z.annotationId)||S.reactionAnnotationIds.push(z.annotationId),z?.reactions?.length||(S.reactionAnnotationIds=S.reactionAnnotationIds.filter(ae=>ae!==z.annotationId)),this.commentService.saveComment(_,{type:$,updatedComment:S});let G=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,reaction:z,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:G};return c==="add"?this.triggerAction(dt.ADD_REACTION,Z):c==="delete"?this.triggerAction(dt.DELETE_REACTION,Z):this.triggerAction(dt.TOGGLE_REACTION,Z),$===Ke.REACTION_ADDED?this.analyticsService.trackEvent(ne.Events.Comments.REACTION_ADDED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}):$===Ke.REACTION_DELETED&&this.analyticsService.trackEvent(ne.Events.Comments.REACTION_DELETED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}),Z}}}else this.triggerAnnotationNotFoundError(e);return null}catch(_){return this.loggingService.catch("Error in CommentActionsService toggleReaction: ",_),null}})}onComposerClick(t){return Pe(this,arguments,function*({commentAnnotation:e}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onComposerClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={commentAnnotation:e?.annotationId?this.commentService.getCommentAnnotationForClient(e):void 0,metadata:a};this.triggerAction(dt.COMPOSER_CLICKED,i)}catch(a){this.loggingService.catch("Error in CommentActionsService onComposerClick: ",a)}})}onComposerTextChange(e){return Pe(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata(),a={text:e.text,annotation:e.annotation,targetComposerElementId:e.targetComposerElementId,metadata:t};this.commentService.setComposerData(e.targetComposerElementId,a),this.triggerAction(dt.COMPOSER_TEXT_CHANGE,a)}catch(t){this.loggingService.catch("Error in CommentActionsService onComposerTextChange: ",t)}})}autocompleteSearch(e){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: autocompleteSearch","color: green;");let t=yield this.metadataService.getGlobalMetadata();e.metadata=t,this.triggerAction(dt.AUTOCOMPLETE_SEARCH,e)}catch(t){this.loggingService.catch("Error in CommentActionsService autocompleteSearch: ",t)}})}onCommentPinClick(e){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentPinClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(dt.COMMENT_PIN_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentPinClick: ",t),null}})}onCommentBubbleClick(e){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentBubbleClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(dt.COMMENT_BUBBLE_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentBubbleClick: ",t),null}})}onCommentToolClick(e,t){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentToolClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={context:e,targetElementId:t,metadata:a},c={context:e,targetElementId:t,metadata:a};return this.triggerAction(dt.COMMENT_TOOL_CLICK,i),this.triggerAction(dt.COMMENT_TOOL_CLICKED,c),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentToolClick: ",a),null}})}onSidebarButtonClick(){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onSidebarButtonClick","color: green;");let e=yield this.metadataService.getGlobalMetadata(),t={metadata:e},a={metadata:e};return this.triggerAction(dt.SIDEBAR_BUTTON_CLICK,t),this.triggerAction(dt.SIDEBAR_BUTTON_CLICKED,a),t}catch(e){return this.loggingService.catch("Error in CommentActionsService onSidebarButtonClick: ",e),null}})}onAttachmentDownloadClick(e,t){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onAttachmentDownloadClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),attachment:t,metadata:a};return this.triggerAction(dt.ATTACHMENT_DOWNLOAD_CLICKED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onAttachmentDownloadClick: ",a),null}})}onCommentSaveTriggered(e,t){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentSaveTriggered","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(t),metadata:a};return this.triggerAction(dt.COMMENT_SAVE_TRIGGERED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentSaveTriggered: ",a),null}})}onVisibilityOptionClick(e,t,a){return Pe(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onVisibilityOptionClick","color: green;");let i=yield this.metadataService.getGlobalMetadata(),c={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),visibility:t,users:a?.map(m=>sb(m)).filter(Boolean),metadata:i};return this.triggerAction(dt.VISIBILITY_OPTION_CLICKED,c),c}catch(i){return this.loggingService.catch("Error in CommentActionsService onVisibilityOptionClick: ",i),null}})}convert(e){try{if(e?.options){let{documentId:t,organizationId:a}=this.docService.getServerId(e?.options);e.options=f(g({},e?.options),{documentId:t,organizationId:a})}return this}catch(t){return this.loggingService.catch("Error in CommentActionsService convert: ",t),this}}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new Gt),this.actionSubjects.get(e)?.next(t)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAction: ",a)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new Gt),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in CommentActionsService onAction: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getCommentAnnotations(e){try{if(e){if(e?.allDocuments&&!e?.folderId)return this.loggingService.catch("folderId is required when allDocuments is true."),Ee({data:null});if(!e?.allDocuments&&!e?.documentIds?.length)return this.loggingService.catch("documentIds is required."),Ee({data:null})}return this.commentService.getAllCommentAnnotations({excludeDomChanges:!0,skipPositionCalculation:!0,query:e,addFilterCommentsOnDomCheck:!0}).pipe(Oe(t=>t?t.reduce((a,i)=>{let c=i.metadata?.clientDocumentId;return!c||e?.documentIds&&!e?.documentIds?.includes(c)||(a[c]||(a[c]=[]),a[c].push(i)),a},{}):null),Oe(t=>({data:t})))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}getCommentAnnotationsCount$(e){try{return this.commentViewsService.getAnnotationsCount(e).pipe(Oe(t=>t||{data:null}))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}updateVisibility(e){this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateVisibility","color: green;");try{let t=e.annotationId;if(!t)throw new Error("annotationId is required in visibility config");if(e.type==="restricted"){let h=this.authService.getUser();if(!h?.userId)throw new Error("Current user not found. Cannot set restricted visibility without userIds.");e=Mn(e,h.userId)}if(e.type==="organizationPrivate"&&!e.organizationId&&!e.organizationIds?.length){let h=this.authService.getUser()?.clientOrganizationId;if(!h)throw new Error("No organizationId found. Cannot set organizationPrivate visibility without organizationId.");e=f(g({},e),{organizationId:h})}this.analyticsService.trackEvent(ne.Events.Comments.UPDATE_VISIBILITY_TRIGGERED,{payload:{annotationId:t,visibility:e}});let a=this.commentService.getCommentAnnotationByIdSync(t)?.from?.userId,i=a??this.authService.getUser()?.userId;a||this.loggingService.warn(`updateVisibility: annotation ${t} not in local cache \u2014 falling back to current user for the author access token`);let c=An(e,i),m=Pn(e,i);return this.commentService.updateCommentAnnotationContext(t,{_setAccessFields:c,_setVisibilityConfig:m},{merge:!0})}catch(t){return this.loggingService.catch("Error in updateVisibility: ",t),Promise.resolve()}}calculateCommentThreadIndex(e,t){try{let a=e?.commentId,i;return a&&(i=t?.comments?.findIndex(c=>c.commentId===a)),i===-1&&(i=t?.comments?.length),i}catch(a){this.loggingService.catch("Error in calculateCommentThreadIndex: ",a);return}}};o.\u0275fac=function(t){return new(t||o)(be(vr),be(ot),be(ie),be(Gg),be($t),be(Dt),be(ut),be(Dr),be(N),be(Eg),be(to),be(fr),be(Bg),be(Lg))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var jg=(()=>{let o=class o{constructor(e){this.loggingService=e,this.commentTextData$=new De({});try{this.loggingService.log("%c[WB] Creating CLASS: CommentTextService","color: blue;")}catch(t){this.loggingService.catch("Error in CommentTextService constructor: ",t)}}setCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: setCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();i[t]||(i[t]={}),i[t][a]=e,this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService setCommentTextData: ",t)}}removeCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: removeCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();delete i[t][a],this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService removeCommentTextData: ",t)}}updateLastPositionInDataByAnnotationId(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: updateLastPositionInDataByAnnotationId","color: green;");let t=this.commentTextData$.getValue();Object.values(t[e]).forEach(a=>{a.last=this.checkIfLast(a)}),this.commentTextData$.next(t)}catch(t){this.loggingService.catch("Error in CommentTextService updateLastPositionInDataByAnnotationId: ",t)}}checkIfLast(e){try{if(this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: checkIfLast","color: green;"),e?.elementRef?.nativeElement){let t=e.elementRef.nativeElement.getRootNode(),a=t instanceof Document||t instanceof ShadowRoot?t:document,i=[];if(e.annotationId?i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)):e.multiThreadAnnotationId&&(i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.MULTI_THREAD_ANNOTATION_ID}="${e.multiThreadAnnotationId}"]`))),i.length&&i[i.length-1]===e.elementRef.nativeElement)return!0}return!1}catch(t){return this.loggingService.catch("Error in CommentTextService checkIfLast: ",t),!1}}getCommentTextDataByAnnotationIdAndComponentId(e,t){try{return this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: getCommentTextDataByAnnotationIdAndComponentId","color: green;"),this.commentTextData$.pipe(Oe(a=>a&&e&&t&&a[e]?a[e][t]:null))}catch(a){return this.loggingService.catch("Error in CommentTextService getCommentTextDataByAnnotationIdAndComponentId: ",a),Ee(null)}}};o.\u0275fac=function(t){return new(t||o)(be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function Hg(r,o){return r?{commentPinSelected:!0,textClicked:!!o}:{commentPinSelected:!1,textClicked:!1}}function zg(r,o,n){return r!=null&&r===o&&!!n}function Kb(r){return r instanceof Document||r instanceof ShadowRoot?r:document}function Zb(r,o){let n=e=>{if(!e)return null;let t=null;return(e instanceof Document||e instanceof DocumentFragment)&&(t=e.getElementById(`comment-pin-container-${o}`)),t||e.querySelector(`[data-velt-id='${o}']`)||null};return n(r)||(r!==document?n(document):null)}var Ay=["overlay"],Py=()=>["snippyly-overlay-panel","velt-overlay-panel"];function Fy(r,o){if(r&1&&E(0,"span",8),r&2){let n,e=l().ngIf;ue("index-3-digit",(e.commentPinAnnotation==null||e.commentPinAnnotation.annotationNumber==null||(n=e.commentPinAnnotation.annotationNumber.toString())==null?null:n.length)===3),k("data-comment-annotation-number","#"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationNumber))}}function Ny(r,o){if(r&1){let n=J();u(0),b(1,"velt-multi-thread-comment-dialog-internal",10),H("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))})("pointerUp",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))}),x(),p()}if(r&2){let n=l(2).ngIf;d(),v("multiThreadAnnotationId",n.commentPinAnnotation.annotationId)("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)}}function Ry(r,o){if(r&1){let n=J();b(0,"velt-comment-dialog-internal",11),H("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()}if(r&2){let n=l(2).ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("inlineCommentMode",n.inlineCommentMode)("isInsidePdfViewer",n.isInsidePdfViewer)}}function Uy(r,o){if(r&1&&s(0,Ny,2,4,"ng-container",9)(1,Ry,1,5,"ng-template",null,2,Ge),r&2){let n=we(2),e=l().ngIf;v("ngIf",(e==null||e.commentPinAnnotation==null?null:e.commentPinAnnotation.type)==="multiThread")("ngIfElse",n)}}function Ly(r,o){if(r&1){let n=J();b(0,"snippyly-comment-bottom-sheet",12),H("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))}),x()}if(r&2){let n=l().ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("isInsidePdfViewer",n.isInsidePdfViewer)}}function By(r,o){if(r&1){let n=J();u(0),b(1,"snippyly-comment-text",4,0),H("pointerover",function(t){return B(n),l().onPointerOver(t),V(t.stopPropagation())})("pointerout",function(){B(n);let t=l();return V(t.onPointerOut())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("pointerup",function(t){return B(n),l().togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("click",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())}),x(),s(3,Fy,1,3,"span",5)(4,Uy,3,2,"ng-template",6,1,Ge)(6,Ly,1,3,"snippyly-comment-bottom-sheet",7),p()}if(r&2){let n=o.ngIf,e=we(2),t=l();d(),ue("inline-comment-mode",n.inlineCommentMode&&!n.isInsidePdfViewer)("agent-comment",(n.commentPinAnnotation==null?null:n.commentPinAnnotation.sourceType)==="agent")("selected",n.commentPinHover||n.commentPinSelected),d(2),v("ngIf",n.last&&n.showCommentIndex&&(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationNumber)),d(),v("cdkConnectedOverlayOrigin",e)("cdkConnectedOverlayOpen",(!n.mobileMode||!n.isPhone)&&!n.inboxMode&&!n.streamMode&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&n.floatingCommentsEnabled&&(n.textClicked&&n.commentPinSelected||n.commentPinHover&&!n.commentPinSelected))("cdkConnectedOverlayOffsetY",n.overlayOriginY==="top"?-8:2)("cdkConnectedOverlayPanelClass",ct(17,Py))("cdkConnectedOverlayBackdropClass","snippyly-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",t.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0),d(2),v("ngIf",(n==null?null:n.user)&&n.mobileMode&&n.isPhone&&!n.sidebarVisible&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&!n.inboxMode&&!n.streamMode&&n.floatingCommentsEnabled&&n.textClicked&&n.commentPinSelected)}}var Wg=(()=>{let o=class o{onEnter(e){this.onKeyupEnter&&this.onKeyupEnter()}constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.breakpointObserver=a,this.domService=i,this.commentService=c,this.loggingService=m,this.serviceBook=h,this.elementRef=_,this.subscriptions=[],this.selectedAnnotationsMap={},this.customScrollableParentEventsListenersSubscriptions=[],this.isDialogOnHoverEnabled=!1,this.componentConfigSignal=Fe({inlineCommentMode:!1,isInsidePdfViewer:!1,commentPinHover:!1,commentPinSelected:!1,first:!1,last:!1,showCommentIndex:!1,commentPinAnnotation:null,isPhone:!1,mobileMode:!1,streamMode:!1,inboxMode:!1,textClicked:!1,floatingCommentsEnabled:!0,sidebarVisible:!1,user:null,overlayOriginX:"start",overlayOriginY:"top"}),this.positions=X.OVERLAY_POSITIONS.map(I=>new nn({originX:I.originX,originY:I.originY},{overlayX:I.overlayX,overlayY:I.overlayY})),this.veltElement=!0,this.componentId="velt-comment-text-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{sidebarVisible:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getSidebarVisibility$ subscription: ",I)})),this.subscriptions.push(this.commentService.showFloatingComments$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{floatingCommentsEnabled:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent showFloatingComments$ subscription: ",I)})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{showCommentIndex:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getShowCommentIndex subscription: ",I)})),this.subscriptions.push(this.commentService.getEnableDialogOnHover$().subscribe(I=>{this.isDialogOnHoverEnabled=I},I=>{this.catchError("Error in CommentPinComponent getEnableDialogOnHover subscription: ",I)})),this.subscriptions.push(this.breakpointObserver.observe(Zn.XSmall).subscribe(I=>{let S=!1;I.matches?S=!0:S=!1,this.componentConfigSignal.update(z=>(z=f(g({},z),{isPhone:S}),z))},I=>{this.catchError("Error in CommentTextPortalComponent breakpointObserver subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent setupA11yAttributes:",e)}}ngAfterViewInit(){try{let e=this.element.childNodes[0];this.element.childNodes[1].childNodes[0].appendChild(e),this.componentConfigSignal.update(a=>{let i=Lv(this.element,X.ATTRIBUTES.VELT_PDF_VIEWER);return a=f(g({},a),{isInsidePdfViewer:i}),a}),this.subscriptions.push(this.overlay?.positionChange?.subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{overlayOriginX:a.connectionPair.originX,overlayOriginY:a.connectionPair.originY}),i))},a=>{this.catchError("Error in CommentTextPortalComponent positionChange subscription: ",a)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(a=>{this.selectedAnnotationsMap=a,this.checkPinSelection()},a=>{this.catchError("Error in CommentTextPortalComponent getSelectedAnnotationsMap$ subscription: ",a)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{streamMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getStreamMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inboxMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInboxMode subscription: ",a)})),this.subscriptions.push(this.commentService.getMobileMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{mobileMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getMobileMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInlineCommentMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inlineCommentMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInlineCommentMode$ subscription: ",a)})),this.subscriptions.push(this.serviceBook.observe(ln).pipe(Me(a=>a?.onInitRecording()??Wn)).subscribe(a=>{this.recorderInitConfig=a},a=>{this.catchError("Error in CommentTextPortalComponent onInitRecording subscription: ",a)}))}catch(e){this.catchError("Error in CommentTextPortalComponent AfterViewInit: ",e)}}setFirst(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{first:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setFirst: ",t)}}setLast(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{last:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setLast: ",t)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setCommentPinAnnotation: ",t)}}setElement(e){try{this.element=e,this.element?this.customScrollableParents=Sg(this.element):this.customScrollableParents=[],this.addCustomScrollableParentsEventListeners()}catch(t){this.catchError("Error in CommentTextPortalComponent setElement: ",t)}}checkPinSelection(){try{let e=!!this.selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation?.annotationId];this.componentConfigSignal.update(t=>{let a=Hg(e,t.last);return g(g({},t),a)}),zg(sessionStorage.getItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID),this.componentConfigSignal().commentPinAnnotation.annotationId,this.componentConfigSignal().last)&&(this.componentConfigSignal.update(t=>(t=f(g({},t),{textClicked:!0}),t)),sessionStorage.removeItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID))}catch(e){this.catchError("Error in CommentTextPortalComponent checkPinSelection: ",e)}}onPointerOver(e){try{if(this.componentConfigSignal().commentPinHover)return;e.buttons?this.componentConfigSignal().commentPinHover&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!1}),t)):!this.componentConfigSignal().commentPinHover&&this.isDialogOnHoverEnabled&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!0}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent onPointerOver: ",t)}}onPointerOut(){this.componentConfigSignal.update(e=>(e=f(g({},e),{commentPinHover:!1}),e))}togglePinSelection(e){try{if(this.recorderInitConfig?.isCommentRecording||this.componentConfigSignal().textClicked&&!e)return;let t=e||this.componentConfigSignal().commentPinAnnotation;if(this.selectedAnnotationsMap[t.annotationId])e||(document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)?this.domService.resetSelectedAnnotationsMap(!0,"comments"):(this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)));else{let a=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(a||(a=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),a){let i=a.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(i){let c=document.getElementById(`comment-pin-container-${i}`)||document.querySelector(`[data-velt-id='${i}']`);c&&(c.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)}}catch(t){this.catchError("Error in CommentTextPortalComponent togglePinSelection: ",t)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentTextPortalComponent saveComment: ",t)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().commentPinAnnotation?.annotationId),this.overlay&&this.overlay?.overlayRef?.updatePosition()}catch(e){this.catchError("Error in CommentTextPortalComponent updateOverlayPosition: ",e)}}addCustomScrollableParentsEventListeners(){try{this.removeCustomScrollableParentsEventListeners(),this.customScrollableParents?.length&&this.customScrollableParents?.forEach(e=>{this.customScrollableParentEventsListenersSubscriptions.push(Sn(e,"scroll").subscribe(t=>{this.updateOverlayPosition()},t=>{this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners scroll subscription: ",t)}))})}catch(e){this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners: ",e)}}removeCustomScrollableParentsEventListeners(){try{this.customScrollableParentEventsListenersSubscriptions.map(e=>{e.unsubscribe()}),this.customScrollableParentEventsListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent removeCustomScrollableParentsEventListeners: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeCustomScrollableParentsEventListeners(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(j(vr),j(ot),j(Kn),j(Ne),j(ie),j(N),j(fr),j(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-text-portal"]],viewQuery:function(t,a){if(t&1&&ft(Ay,5),t&2){let i;Ct(i=kt())&&(a.overlay=i.first)}},hostVars:1,hostBindings:function(t,a){t&1&&H("keyup.enter",function(c){return a.onEnter(c)},Qs),t&2&&k("data-velt-element",a.veltElement)},standalone:!1,decls:1,vars:1,consts:[["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],["commentDialogRef",""],[4,"ngIf"],["cdkOverlayOrigin","","data-velt-comment-disabled","true",1,"comment-text-highlight",3,"pointerover","pointerout","pointerdown","pointerup","touchend","click"],["class","comment-annotation-number",3,"index-3-digit",4,"ngIf"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayOffsetY","cdkConnectedOverlayPanelClass","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayDisableClose"],[3,"annotation","user","isInsidePdfViewer","saveComment",4,"ngIf"],[1,"comment-annotation-number"],[4,"ngIf","ngIfElse"],[3,"saveComment","pointerUp","multiThreadAnnotationId","annotation","user","commentPinSelected"],[3,"saveComment","annotation","user","commentPinSelected","inlineCommentMode","isInsidePdfViewer"],[3,"saveComment","annotation","user","isInsidePdfViewer"]],template:function(t,a){t&1&&s(0,By,7,18,"ng-container",3),t&2&&v("ngIf",a.componentConfigSignal())},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}*[_ngcontent-%COMP%]{box-sizing:border-box;margin:0;padding:0;height:inherit;width:inherit;text-align:inherit;line-height:inherit;font-size:inherit;text-transform:inherit;float:inherit;-webkit-text-fill-color:initial}*[_ngcontent-%COMP%]:empty{display:revert}[_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);font-family:inherit}.comment-text-highlight[_ngcontent-%COMP%]{cursor:pointer} snippyly-text-highlight.snippyly-text-highlight{color:var(--velt-black)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight{color:var(--velt-warning-hover);background-color:var(--velt-warning-transparent);border-bottom:1px solid var(--velt-warning-hover)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.selected{color:var(--velt-black);background-color:var(--velt-warning)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent);border-bottom-color:var(--velt-agent-accent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment.selected{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode{background-color:inherit} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode.selected{background-color:inherit}.comment-annotation-number[_ngcontent-%COMP%]{border-radius:50%;border:1px solid var(--velt-gray);width:20px;height:20px;font-size:calc((.7rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;background:var(--velt-white);color:var(--velt-black);position:relative}.comment-annotation-number.index-3-digit[_ngcontent-%COMP%]{width:32px;height:32px}.comment-annotation-number[_ngcontent-%COMP%]:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}"],changeDetection:0});let r=o;return r})();var jv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h){this.docService=e,this.domService=t,this.commentService=a,this.componentFactoryResolver=i,this.injector=c,this.appRef=m,this.loggingService=h,this.commentsTextById={},this.commonAncestorElementObservers=new Map,this.commonAncestorElementObserverCounts=new Map,this.inlineCommentMode=!1,this.restrictTextSearchToAnchor=!1;try{this.commentService.getInlineCommentMode$().subscribe(_=>{this.inlineCommentMode=_}),this.commentService.getRestrictTextSearchToAnchor$().subscribe(_=>{this.restrictTextSearchToAnchor=_})}catch(_){this.loggingService.catch("Error in CommentPinPortalService constructor: ",_)}}updateTextCommentAnnotations(e){try{this.checkToRemoveTextCommentAnnotations(e),e.forEach(t=>{this.updateTextCommentAnnotation(t)})}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateTextCommentAnnotations: ",t)}}updateTextCommentAnnotation(e){let t=this.commentsTextById[e.annotationId];if(t)if(an(t?.annotation?.targetTextRange,e?.targetTextRange)){let a=!1;t?.texts?.length?t.texts.forEach(i=>{document.body.contains(i?.textNode)||(a=!0)}):a=!0,a?(this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e)):(t.texts.forEach(i=>{i.portalRef&&i.portalRef.instance.setCommentPinAnnotation(e)}),t.annotation=e)}else this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e);else this.getCommonAncestorContainer(e)}getCommonAncestorContainer(e){try{let t=this.domService.getElementFromTargetTextRange(e?.targetTextRange);if(t&&this.domService.isElementVisible(t)){let a=t?.nodeType===Node.ELEMENT_NODE?t:t?.parentElement;this.commentsTextById[e.annotationId]={texts:[],annotation:e,commonAncestorContainer:t,commonAncestorElement:a,commonAncestorText:a?.textContent},this.setTextCommentPortal(e),this.observeCommonAncestorElementChanges(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService getCommonAncestorContainer: ",t)}}setTextCommentPortal(e){try{let t=this.commentsTextById[e.annotationId];if(t){let a=this.domService.getElementFromTargetTextRange(e?.targetTextRange),i=document.body;if(e?.locationId&&this.docService.getLocation()?.locationId!==e?.locationId){let h=this.docService.getElementMapWithLocation();h[e?.locationId]&&(a=h[e?.locationId]?.element,i=a)}let c=this.resolveHighlightRange(e,a,i);if(c){let m=c.commonAncestorContainer?.nodeType===Node.ELEMENT_NODE?c.commonAncestorContainer:c.commonAncestorContainer?.parentElement??null;m&&t.commonAncestorElement&&!t.commonAncestorElement.contains(m)&&(t.commonAncestorElement=m,t.commonAncestorContainer=m,t.commonAncestorText=m.textContent);let h=Wb(c),_=[],I=h?.find(S=>!S?.textContent);if(I&&I?.remove(),h=h?.filter(S=>S?.textContent),h&&h.length){let S=-1,z=-1;if(h.forEach(($,G)=>{this.textHighlighterClass?this.domService.addClassToElement($,this.textHighlighterClass):this.domService.addClassToElement($,$.tagName?.toLowerCase()),$.setAttribute(X.ATTRIBUTES.VELT_ID,e.annotationId);let Z=$.childNodes[0],ae=new cg(Wg),pe=new mg($,this.appRef,this.injector),Se=pe.attach(ae);Se.instance.setCommentPinAnnotation(e),Se.instance.setElement($),Se.instance.onKeyupEnter=()=>{this.onCommonAncestorElementChange(e)},S<0&&(S=G),z=G,_.push({host:pe,portal:ae,portalRef:Se,element:$,textNode:Z})}),S>=0&&_[S]?.portalRef&&_[S].portalRef.instance.setFirst(!0),z>=0&&_[z]?.portalRef&&_[z].portalRef.instance.setLast(!0),t.texts=_,this.inlineCommentMode&&!document.querySelector(`${X.TAGS.VELT_INLINE_COMMENT}[${X.ATTRIBUTES.VELT_INLINE_COMMENT_ID}="${e.annotationId}"]`)){let G=t.texts?.filter(ae=>!!ae?.element)?.map(ae=>ae?.element),Z=G?.length?G[G.length-1]:null;if(Z&&!Lv(Z,X.ATTRIBUTES.VELT_PDF_VIEWER)){let pe=Z?.parentElement;if(pe){let Se=document.createElement(X.TAGS.VELT_INLINE_COMMENT);Se.setAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_ID,e.annotationId),pe.insertAdjacentElement("afterend",Se),t.inlineCommentElement=Se}}}}this.removeGhostComment(e)}else this.setGhostComment(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setTextCommentPortal: ",t)}}resolveHighlightRange(e,t,a=document.body){try{let i=e.targetTextRange?.text,c=e.targetTextRange?.occurrence,m=t?this.buildValidRange(Ru(i,t,c),i):null;return!m&&!this.restrictTextSearchToAnchor&&a&&t!==a&&(m=this.buildValidRange(Ru(i,a,c),i)),m}catch(i){return this.loggingService.catch("Error in CommentPinPortalService resolveHighlightRange: ",i),null}}buildValidRange(e,t){try{if(!e?.length||e.some(c=>c?.textNode?.parentElement?.closest("script")))return null;let i=new Range;try{i.setStart(e[0].textNode,e[0].startOffset||0),i.setEnd(e[e.length-1].textNode,e[e.length-1].endOffset||0)}catch{return null}return i.toString()===t?i:null}catch(a){return this.loggingService.catch("Error in CommentPinPortalService buildValidRange: ",a),null}}checkToRemoveTextCommentAnnotations(e){try{let t=e.map(i=>i.annotationId),a=!1;if(Object.keys(this.commentsTextById).forEach(i=>{t.includes(i)||(this.commentsTextById[i]?.annotation?.targetTextRange&&(a=!0),this.removeTextCommentAnnotation(this.commentsTextById[i].annotation))}),a){let i=[];Object.keys(this.commentsTextById).forEach(c=>{this.commentsTextById[c]?.annotation?.targetTextRange&&(i.push(this.commentsTextById[c]?.annotation),this.removeTextCommentAnnotation(this.commentsTextById[c]?.annotation))}),i?.length&&i.forEach(c=>{this.updateTextCommentAnnotation(c)})}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToRemoveTextCommentAnnotations: ",t)}}removeTextCommentAnnotation(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts.forEach(a=>{a?.host&&a.host.detach(),a?.element&&a?.textNode&&a.element.replaceWith(a.textNode),a.textNode&&a.textNode.parentNode?.normalize()}),t.texts?.length){let a=document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`);a?.length&&a.forEach(i=>{let c=i?.parentNode;if(i?.textContent){let m=document.createTextNode(i.textContent);i.replaceWith(m)}c&&c.normalize()})}t?.inlineCommentElement&&t?.inlineCommentElement?.remove(),this.checkToUnsubscribeCommonAncestorElementChanges(e),delete this.commentsTextById[e.annotationId]}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeTextCommentAnnotation: ",t)}}observeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);if(a)a.annotations.find(i=>i.annotationId===e.annotationId)||a.annotations.push(e);else{let i=new MutationObserver(c=>{let m="";if(ob(t?.commonAncestorElement).forEach(_=>{_?.parentElement?.closest(".comment-annotation-number")||(m+=_.textContent)}),t?.commonAncestorText!==m&&c.filter(_=>[Node.ELEMENT_NODE,Node.TEXT_NODE].includes(_.target.nodeType)).filter(_=>_.target?.parentElement&&(_?.target?.parentElement?.classList?.contains("comment-text-highlight")||!Nc(_.target?.parentElement))).length){this.commonAncestorElementObservers.get(t.commonAncestorElement)?.annotations?.forEach($=>{this.onCommonAncestorElementChange($)});let{count:I,lastUpdated:S}=this.commonAncestorElementObserverCounts.get(t.commonAncestorElement)||{count:0,lastUpdated:0},z=Date.now();this.commonAncestorElementObserverCounts.set(t.commonAncestorElement,{count:z-S<100?I+1:1,lastUpdated:Date.now()}),I>5&&(i.disconnect(),this.loggingService.catch("Failed to detect text changes."))}});i.observe(t.commonAncestorElement,{characterData:!0,subtree:!0}),a={observer:i,annotations:[e]}}this.commonAncestorElementObservers.set(t.commonAncestorElement,a)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService observeCommonAncestorElementChanges: ",t)}}onCommonAncestorElementChange(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts?.length){let a="";t.texts.forEach(I=>a+=I.textNode?.textContent);let i=t.texts[0].textNode,c=[];document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`)?.forEach(I=>{c.push(I)});let m=!1;if(c?.length!==t?.texts?.length&&(m=!0),c?.length){let I="";c.forEach(S=>{I+=S?.textContent||""}),I&&(a=I,m&&this.removeTextCommentAnnotation(e))}let h=eb(t.commonAncestorContainer,0,i,0,a)+1,_={};_.commonAncestorContainer=e.targetTextRange?.commonAncestorContainer,_.text=a,_.occurrence=h,an(e.targetTextRange,_)||(t.annotation.targetTextRange=_,this.updateAnnotationToFirebase(t.annotation))}else this.setTextCommentPortal(t.annotation)}catch(t){this.loggingService.catch("Error in CommentPinPortalService onCommonAncestorElementChange: ",t)}}updateAnnotationToFirebase(e){try{this.commentService.updateComment(e,!1,!0)}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateAnnotationToFirebase: ",t)}}checkToUnsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);a&&(a.annotations=a?.annotations.filter(i=>i.annotationId!==e.annotationId),a.annotations.length||this.unsubscribeCommonAncestorElementChanges(e))}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToUnsubscribeCommonAncestorElementChanges: ",t)}}setGhostComment(e){try{e.ghostComment={},this.commentService.setGhostCommentMessage(e),this.commentService.addAnnotationToGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setGhostComment: ",t)}}removeGhostComment(e){try{delete e.ghostComment,this.commentService.removeAnnotationFromGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeGhostComment: ",t)}}onAcceptComment(e){try{let t=this.commentsTextById[e.annotationId];if(t?.texts?.length){let a=t.texts.length-1,i=t.texts[a].textNode;if(i&&i.parentNode){let c=e.comments?.length?e.comments[0]:null,m=wg(c?.replaceContentHtml)?null:c?.replaceContentHtml,h=c?.replaceContentText||c?.commentText||"";if(wg(m)&&!c?.replaceContentText&&(m=c?.commentHtml||""),e?.selectAllContent&&e?.targetElementId){let _=zr(e.targetElementId,["id","data-id"]);_&&(_.innerHTML=this.domService.sanitizeHtml(wg(m)?h||"":m||""))}else{if(m&&m!==h){let _=document.createElement("span");_.innerHTML=this.domService.sanitizeHtml(m||h||""),i.parentNode.replaceChild(_,i),t.texts[a].textNode=_}else t.texts[a].textNode.textContent=h||"";for(let _=0;_<a;_++){let I=t.texts[_].textNode;I&&(I.textContent="")}}this.removeTextCommentAnnotation(e),this.domService.resetSelectedAnnotationsMap()}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService onAcceptComment: ",t)}}unsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];this.commonAncestorElementObservers.get(t.commonAncestorElement)?.observer?.disconnect(),this.commonAncestorElementObservers.delete(t.commonAncestorElement)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unsubscribeCommonAncestorElementChanges: ",t)}}};o.\u0275fac=function(t){return new(t||o)(be(ut),be(Ne),be(ie),be(tg),be(qs),be(rg),be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function Vy(r,o){if(r&1){let n=J();b(0,"div",4),H("pointerup",function(t){return B(n),l(2).togglePinSelection(),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(2);return V(t.onPinDragStart())}),b(1,"snippyly-comment-pin",5),H("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))})("commentTargetElementClicked",function(){B(n);let t=l(2);return V(t.togglePinSelection())})("togglePinSelection",function(t){B(n);let a=l(2);return V(a.togglePinSelection(t))}),x()()}if(r&2){let n=l().ngIf,e=l();at("top",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.top)-0+n.offsetTop,"px")("left",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.left)-10+n.offsetLeft,"px"),v("id","comment-pin-container-"+(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationId)),k("data-testid",e.componentId+"-popover")("role","button")("aria-expanded",n.commentPinSelected),d(),v("annotation",n.commentPinAnnotation)("containerComponentId",n.componentId)("commentPinSelected",n.commentPinSelected&&!n.annotationDragging)("multipleCommentPinSelected",n.commentPinSelected&&e.objectKeys(n.selectedAnnotationsMap).length>1)("targetElement",n.targetElement)("user",n.user)}}function $y(r,o){if(r&1){let n=J();b(0,"div",7),H("pointerup",function(t){return B(n),l(3).togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("mousedown",function(t){return B(n),V(t.stopPropagation())})("touchstart",function(t){return B(n),V(t.stopPropagation())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(3);return V(t.onPinDragStart())})("cdkDragMoved",function(t){B(n);let a=l(3);return V(a.onPinMove(t))})("cdkDragReleased",function(){B(n);let t=l(3);return V(t.onPinRelease())}),b(1,"snippyly-comment-pin",8,1),H("togglePinSelection",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))})("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()()}if(r&2){let n=we(2),e=l(2).ngIf,t=l();at("top",e.annotationDragging?(e.dragPosition==null?null:e.dragPosition.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40):(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40)+e.offsetTop,"px")("left",e.annotationDragging?e.dragPosition==null?null:e.dragPosition.left:(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.left)+e.offsetLeft,"px")("--velt-comment-pin-transform",e.annotationDragging?"none":e.pinTransform??"none")("transform",!e.annotationDragging&&(!(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null)&&e.commentPinAnnotation.position.parentScaleX)?"scale("+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleX)||1)+", "+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleY)||1)+")":""),ue("pin-dragging",e.annotationDragging),v("id","comment-pin-container-"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationId))("cdkDragDisabled",!e.pinDragEnabled||(e.commentPinAnnotation==null||e.commentPinAnnotation.from==null?null:e.commentPinAnnotation.from.userId)!==(e.user==null?null:e.user.userId)),k("data-testid",t.componentId+"-default")("role","button")("aria-expanded",e.commentPinSelected)("aria-grabbed",e.annotationDragging)("data-transform-inside",e.transformContext?"true":"false"),d(),v("annotation",e.commentPinAnnotation)("annotationDragging",e.annotationDragging)("containerComponentId",e.componentId)("commentPinSelected",e.commentPinSelected&&!e.annotationDragging)("multipleCommentPinSelected",e.commentPinSelected&&t.objectKeys(e.selectedAnnotationsMap).length>1)("targetElement",e.targetElement)("user",e.user)}}function Gy(r,o){if(r&1&&s(0,$y,3,24,"div",6),r&2){let n=l().ngIf;v("ngIf",n.commentPinAnnotation==null?null:n.commentPinAnnotation.position)}}function jy(r,o){if(r&1&&(u(0),s(1,Vy,2,14,"div",3)(2,Gy,1,1,"ng-template",null,0,Ge),p()),r&2){let n=o.ngIf,e=we(3);d(),v("ngIf",n.popoverMode)("ngIfElse",e)}}var Jg=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.docService=a,this.domService=i,this.commentService=c,this.commentActionsService=m,this.loggingService=h,this.elementRef=_,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.objectKeys=Object.keys,this.selectedAnnotationsLocationMap={},this.subscriptions=[],this.componentConfigSignal=Fe({popoverMode:!1,commentPinAnnotation:void 0,commentPinSelected:!1,offsetLeft:0,offsetTop:0,selectedAnnotationsMap:{},annotationDragging:!1,dragPosition:null,targetElement:void 0,user:void 0,componentId:`comment-pin-portal-${zt()}`,pinDragEnabled:!0}),this.veltElement=!0,this.componentId="velt-comment-pin-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{selectedAnnotationsMap:I}),S)),this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsMap$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsLocationMap$().subscribe(I=>{this.selectedAnnotationsLocationMap=I||{},this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsLocationMap$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPinDrag$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{pinDragEnabled:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPinDrag$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{popoverMode:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPopoverMode subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getTransformContext$().subscribe(e=>{this.componentConfigSignal.update(t=>{if(t=f(g({},t),{transformContext:e}),e&&this.isElementInsideTransformContainer(this.elementRef?.nativeElement,e.containerSelector)){let a=e.transforms.scale?1/e.transforms.scale:1;t.pinTransform=`scale(${a})`}else t.pinTransform=void 0;return t})}))}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent ngOnInit:",e)}}isElementInsideTransformContainer(e,t){try{return document.querySelector(t)?.contains(e)??!1}catch(a){return this.loggingService.catch("Error in CommentPinPortalComponent isElementInsideTransformContainer:",a),!1}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent setupA11yAttributes:",e)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t)),this.id=this.componentConfigSignal().commentPinAnnotation?.annotationId,this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setCommentPinAnnotation: ",t)}}setSourceId(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{sourceId:e}),t)),this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setSourceId: ",t)}}getMultiThreadCommentAnnotations(){}checkCommentPinSelected(){try{let e=this.componentConfigSignal().selectedAnnotationsMap,t=this.componentConfigSignal().commentPinAnnotation,a=this.componentConfigSignal().sourceId;if(t){let i=!!e[t.annotationId];if(i)if(t?.isDraft)t?.sourceId&&(i=t?.sourceId===a,i&&this.domService.setSelectedAnnotationLocation(t.annotationId,this.componentConfigSignal().componentId));else{let c=this.selectedAnnotationsLocationMap?.[t.annotationId];c&&(i=c===this.componentConfigSignal().componentId)}i!==this.componentConfigSignal().commentPinSelected&&this.componentConfigSignal.update(c=>(c=f(g({},c),{commentPinSelected:i}),c))}}catch(e){this.catchError("Error in CommentPinPortalComponent checkCommentPinSelected: ",e)}}setTargetElement(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{targetElement:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setTargetElement: ",t)}}setOffsetLeft(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetLeft:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetLeft: ",t)}}setOffsetTop(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetTop:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetTop: ",t)}}togglePinSelection(e){try{let t=e||this.componentConfigSignal().commentPinAnnotation;if(t&&this.commentActionsService.onCommentPinClick(t).catch(i=>{this.catchError("Error in CommentPinPortalComponent togglePinSelection onCommentPinClick: ",i)}),this.componentConfigSignal().selectedAnnotationsMap[t?.annotationId]&&this.selectedAnnotationsLocationMap?.[t?.annotationId]===this.componentConfigSignal().componentId)t?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)&&this.domService.resetSelectedAnnotationsMap(!0,"comments");else{let i=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(i||(i=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),i){let c=i.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(c){let m=document.getElementById(`comment-pin-container-${c}`)||document.querySelector(`[data-velt-id='${c}']`);m&&(m.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal().targetElement&&this.domService.isElementVisibleOnScreen(this.componentConfigSignal().targetElement)&&(this.componentConfigSignal().annotationDragging||this.domService.toggleAnnotationSelection(t,this.componentConfigSignal().componentId,void 0,!0))}}catch(t){this.catchError("Error in CommentPinPortalComponent togglePinSelection: ",t)}}onPinDragStart(){try{this.componentConfigSignal().selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation.annotationId]&&this.componentConfigSignal().commentPinAnnotation?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&this.domService.toggleAnnotationSelection(this.componentConfigSignal().commentPinAnnotation,this.componentConfigSignal().componentId);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e)return;this.parentElement=e.parentElement;let t=this.componentConfigSignal().commentPinAnnotation.position,a=this.componentConfigSignal().transformContext,i=this.parentElement.getBoundingClientRect(),c=i.left+t.left,m=i.top+t.top,h=a&&this.isElementInsideTransformContainer(e,a.containerSelector);this.componentConfigSignal.update(_=>(_=f(g({},_),{elementInTransformedContainer:h}),_)),e.style.width="20px",e.style.height="20px",e.style.margin="0",e.style.padding="0",e.style.display="block",e.style.visibility="visible",e.style.opacity="1",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.pointerEvents="auto",e.offsetWidth,document.body.appendChild(e),e.style.position="fixed",e.style.top=`${m}px`,e.style.left=`${c}px`,e.style.zIndex="10000",e.style.transform="none",e.offsetWidth,document.body.classList.add(X.BODY_CLASSES.VELT_PIN_DRAGGING),this.componentConfigSignal.update(_=>(_=f(g({},_),{annotationDragging:!0}),_))}catch(e){this.catchError("Error in CommentPinPortalComponent onPinDragStart: ",e)}}onPinMove(e){try{this.updateCurrentPinPosition(e)}catch(t){this.catchError("Error in CommentPinPortalComponent onPinMove: ",t)}}updateCurrentPinPosition(e){try{this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=e.event,a=t?.touches?.length?t.touches[0]?.clientX:t.clientX,i=t?.touches?.length?t.touches[0]?.clientY:t.clientY,c=this.componentConfigSignal().transformContext,m=this.domService.getBackgroundElement(a,i);m&&this.commentService.isElementInsideAllowedElements(m)&&(this.componentConfigSignal.update(h=>(h=f(g({},h),{targetElement:m}),h)),this.domService.highlightElement(this.componentConfigSignal().targetElement),this.pointerMoveEvent=e.event,this.componentConfigSignal.update(h=>(h=f(g({},h),{dragPosition:{top:i,left:a}}),h)))}catch(t){this.catchError("Error in CommentPinPortalComponent updateCurrentPinPosition: ",t)}}onPinRelease(){try{document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e||!this.parentElement)return;this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=this.domService.getElementFromXPath(this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath),a=this.componentConfigSignal().commentPinAnnotation?.targetElement;if(this.pointerMoveEvent){let ae=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent,!0,!0,!0,pe=>{if(this.commentService.getSvgAsImg()){let Se=pe?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);Se&&Se instanceof HTMLElement&&(pe=Se)}return pe});ae&&(a=ae)}let i=this.domService.getElementFromXPath(a?.xpath),c=this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath,m=a?.xpath,h=c===m;if(!i)return;let _=this.componentConfigSignal().dragPosition,I=i.getBoundingClientRect(),S=50,z=50;if(_){let ae=_.left-I.left,pe=_.top-I.top;S=ae/I.width*100,z=pe/I.height*100,S=Math.max(0,Math.min(100,S)),z=Math.max(0,Math.min(100,z))}let $=g({},this.componentConfigSignal().commentPinAnnotation);$.targetElement=g({},a),$.targetElement.leftPercentage=S,$.targetElement.topPercentage=z,this.commentService.calculateCommentAnnotationPosition($),this.componentConfigSignal.update(ae=>(ae=f(g({},ae),{commentPinAnnotation:$,targetElement:i}),ae));let G=this.domService.isElementInsideAdditionalLocationContainer(t)||this.domService.isElementInsideAdditionalLocationContainer(i),Z=this.docService.getAdditionalDocumentIdFromElement(i)||this.docService.getDocumentPaths()?.clientDocumentId;if(!this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId||this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId==Z?(this.componentConfigSignal.update(ae=>(ae=f(g({},ae),{commentPinAnnotation:f(g({},ae.commentPinAnnotation),{targetElement:a})}),ae)),this.commentService.updateComment(this.componentConfigSignal().commentPinAnnotation,G)):this.componentConfigSignal.update(ae=>(ae=f(g({},ae),{targetElement:t}),ae)),h){let ae=this.componentConfigSignal().transformContext,pe=this.componentConfigSignal().elementInTransformedContainer,Se=ae&&this.isElementInsideTransformContainer(i,ae.containerSelector);this.componentConfigSignal.update(he=>(he=f(g({},he),{elementInTransformedContainer:Se}),he));let oe=e.getBoundingClientRect();if(!pe&&Se){e.style.transition="none";let he=oe.top,_e=oe.left;this.parentElement.appendChild(e),e.style.position="fixed",e.style.top=`${he}px`,e.style.left=`${_e}px`,e.offsetWidth,requestAnimationFrame(()=>{e.style.position="absolute",Se&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`,$.position.transformContext.scale!==1&&(e.style.transform=`scale(${1/$.position.transformContext.scale})`)):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`)})}else e.style.transition="none",this.parentElement.appendChild(e),e.style.position="absolute",e.style.width="20px",e.style.height="20px",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.visibility="visible",e.style.display="block",e.offsetWidth,Se&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`);e.offsetWidth,this.componentConfigSignal.update(he=>(he=f(g({},he),{annotationDragging:!1,dragPosition:null}),he))}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_PIN_DRAGGED,{annotationId:this.componentConfigSignal().commentPinAnnotation.annotationId,commentMode:this.commentService.getCommentMode()})}catch(e){this.catchError("Error in CommentPinPortalComponent onPinRelease: ",e)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentPinPortalComponent saveComment: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),this.componentConfigSignal()?.annotationDragging&&document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING)}catch(e){this.catchError("Error in CommentPinPortalComponent 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.catchError("Error in CommentPinPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(j(vr),j(ot),j(ut),j(Ne),j(ie),j(vt),j(N),j(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-pin-portal"]],hostVars:2,hostBindings:function(t,a){t&2&&(ph("id",a.id),k("data-velt-element",a.veltElement))},inputs:{multipleCommentPinsSelected:"multipleCommentPinsSelected",avatarErrorImage:"avatarErrorImage"},standalone:!1,decls:1,vars:1,consts:[["defaultPinPortalRef",""],["commentPinRef",""],[4,"ngIf"],["class","comment-pin-portal",3,"id","top","left","pointerup","click","cdkDragStarted",4,"ngIf","ngIfElse"],[1,"comment-pin-portal",3,"pointerup","click","cdkDragStarted","id"],[3,"saveComment","commentTargetElementClicked","togglePinSelection","annotation","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"],["class","comment-pin-portal","cdkDrag","","cdkDragHandle","",3,"id","pin-dragging","top","left","--velt-comment-pin-transform","transform","cdkDragDisabled","pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased",4,"ngIf"],["cdkDrag","","cdkDragHandle","",1,"comment-pin-portal",3,"pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased","id","cdkDragDisabled"],[3,"togglePinSelection","saveComment","annotation","annotationDragging","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"]],template:function(t,a){t&1&&s(0,jy,4,2,"ng-container",2),t&2&&v("ngIf",a.componentConfigSignal())},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:absolute!important;top:0!important;left:0!important;box-sizing:border-box!important;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset!important;width:unset!important;text-align:left!important;z-index:var(--velt-comment-pin-z-index)!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));-webkit-text-fill-color:initial!important}*[_ngcontent-%COMP%]:empty{display:revert!important}.comment-pin-portal[_ngcontent-%COMP%]{position:absolute;transform:var(--velt-comment-pin-transform, none)!important;transform-origin:0 100%!important;transform-box:fill-box!important;top:0;left:0}.comment-pin-portal.pin-dragging[_ngcontent-%COMP%]{position:fixed;z-index:var(--velt-comment-pin-z-index)!important}"],changeDetection:0});let r=o;return r})();var io=(()=>{let o=class o{constructor(e,t,a,i,c,m){this.commentService=e,this.domService=t,this.componentFactoryResolver=a,this.injector=i,this.appRef=c,this.loggingService=m,this.commentsPinById={},this.commentPinTemplate$=new De(null),this.customPinEvents$=new Gt}setCommentPin(e){try{if(!this.commentsPinById[e.annotationId])this.setPinPortal(e);else{let t=!1;if(e?.ghostComment?t=e?.ghostComment?.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?.targetElement?.xpath:this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?t=!0:t=e.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.targetElement?.xpath,!t)this.commentsPinById[e.annotationId]?.forEach(a=>{let i=a.portalRef,c=a.userTargetElement,m=a.pinHostElement;if(document.body.contains(c)&&document.body.contains(m))i&&(i.instance.setCommentPinAnnotation(e),this.updateElementOffset(e));else{let h=a.pinHostDomPortalOutlet;h&&(this.removeCommentPinHostAttributes(e.annotationId,a.pinHostElement),this.removeCommentDisabledAttribute(m),h.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}});else{let a=this.commentsPinById[e.annotationId]?.[0]?.pinHostDomPortalOutlet;a&&(this.removeCommentPinHostAttributes(e.annotationId,this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),this.removeCommentDisabledAttribute(this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),a.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentPin: ",t)}}unselectCommentAnnotation(e){try{this.loggingService.log("%c[WB] Calling CommentPinPortalService FUNCTION: unselectCommentAnnotation","color: green;"),this.domService.getSelectedAnnotationsMap()?.[e?.annotationId]&&this.domService.toggleAnnotationSelection(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unselectCommentAnnotation: ",t)}}setPinPortal(e){try{let t=this.commentService.getElementFromComments(e);t.length>0&&(this.commentsPinById[e.annotationId]=[],t.forEach(a=>{if(a){let i=this.domService.getHostElement(a),c=new cg(Jg),m=new mg(i,this.appRef,this.injector),h=m.attach(c);h.instance.setCommentPinAnnotation(e),h.instance.setTargetElement(a);let _=a?.getAttribute(X.ATTRIBUTES.VELT_SOURCE_ID);_&&h.instance.setSourceId(_),this.commentsPinById[e.annotationId].push({pinHostDomPortalOutlet:m,pinPortal:c,portalRef:h,annotation:JSON.parse(JSON.stringify(e)),userTargetElement:a,pinHostElement:i}),this.setCommentPinHostAttributes(e.annotationId,i),this.setCommentDisabledAttribute(i),this.updateElementOffset(e)}}))}catch(t){this.loggingService.catch("Error in CommentPinPortalService setPinPortal: ",t)}}setCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(",");i.includes(e)||(i.push(e),t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")))}else t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,e);this.domService.isElementOriginallyStatic(t)&&t.offsetHeight>0&&(cb(t)||t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC,"true"))}catch(a){this.loggingService.catch("Error in CommentPinPortalService setCommentPinHostAttributes: ",a)}}removeCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(","),c=i.indexOf(e);c>-1&&(i.splice(c,1),i.length>0?t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")):t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST))}t?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST)||t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)}catch(a){this.loggingService.catch("Error in CommentPinPortalService removeCommentPinHostAttributes: ",a)}}setCommentDisabledAttribute(e){try{this.commentService.getPopoverMode()&&e.setAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED,"auto")}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentDisabledAttribute: ",t)}}removeCommentDisabledAttribute(e){try{e?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)==="auto"&&e.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeCommentDisabledAttribute: ",t)}}updateElementOffset(e){try{for(let t of this.commentsPinById[e.annotationId]){let{portalRef:a,userTargetElement:i,pinHostElement:c}=t,m=this.domService.getElementOffset(i,c);a.instance.setOffsetLeft(m.offsetLeft),a.instance.setOffsetTop(m.offsetTop)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateElementOffset: ",t)}}checkPinsToRemove(e){try{let t=e.map(a=>a.annotationId);Object.keys(this.commentsPinById).forEach(a=>{t.includes(a)||(this.commentService.customPinsById.has(a)&&this.commentService.customPinsById.delete(a),this.commentsPinById[a].forEach(c=>{c.pinHostDomPortalOutlet.detach(),this.removeCommentPinHostAttributes(a,c.pinHostElement),this.removeCommentDisabledAttribute(c.pinHostElement),this.domService.removeHighlightFromElement(c.pinHostElement),c.userTargetElement&&this.domService.removeHighlightFromElement(c.userTargetElement)}),delete this.commentsPinById[a])})}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkPinsToRemove: ",t)}}getAnnotationIdsByUserTargetElement(e){try{let t=[];return Object.keys(this.commentsPinById||{}).forEach(a=>{this.commentsPinById[a]?.forEach(c=>{c.userTargetElement===e&&t.push(a)})}),t?.length>0?Array.from(new Set(t)):[]}catch(t){return this.loggingService.catch("Error in CommentPinPortalService getAnnotationIdsByUserTargetElement: ",t),[]}}setCommentPinOverrideTemplate(e){this.commentPinTemplate$.next(e)}getCommentPinTemplate$(){return this.commentPinTemplate$}emitCustomPinEvent(e){try{let{element:t,annotation:a}=e;a&&this.commentService.customPinsById.set(a.annotationId,t),this.customPinEvents$.next(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService emitCustomPinEvent",t)}}getCustomPinEvents$(){return this.customPinEvents$}};o.\u0275fac=function(t){return new(t||o)(be(ie),be(Ne),be(tg),be(qs),be(rg),be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function zu(){return{sidebarMode:!1,inboxMode:!1,dialogMode:!0,inlineCommentMode:!1,inlineCommentSectionMode:!1,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,darkMode:!1,variant:"dialog",disabled:!1,commentPinSelected:!1,fullExpanded:!1,commentDialogSelected:!1,readOnly:!1,dialogShadowDOM:!0,locationVersion:"",composerPosition:"bottom",dialogOpenedInSidebar:!1,expandOnSelection:!0,commentPinType:"pin",containerComponentId:"",dialogInstanceId:zt(),editComment:null,editCommentIndex:null,composerInOpenState:!1,assignToMenuOpened:!1,composerContent:"",composerContentHTML:"",selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[],selectedVisibility:"public",selectedVisibilityUsers:[]}}var Yg=new dh("LocalUIStateSignal"),bn=class{constructor(){this.appState={user:new Qn,isUserAdmin:!1,isKnownUser:!1,repliesUniqueUsers:[]},this.featureState={inlineCommentMode:!1,inlineCommentSectionMode:!1,sidebarMode:!1,dialogMode:!0,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,inboxMode:!1,fullExpanded:!1,canResolveAnnotation:!1,canUnresolveAnnotation:!1,dialogSelectedByKnownUser:!1,resolveStatusAccessAdminOnly:!1,enableResolve:!1,isPlanExpired:!1,moderatorMode:!1,enableAutoCategorize:!1,suggestionMode:!1,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:!1,enableUpgradeButton:!1,enableGhostCommentsMessage:!1,replyAvatars:!1,userMentions:!0,anonymousEmail:!0,recordingSummaryEnabled:!1,enableAttachment:!0,enableAttachmentDownload:!0,allowedFileTypes:[],allowedRecordings:["audio","video","screen"],screenSharingSupported:!0,enterKeyToSubmit:!0,deleteOnBackspace:!0,enableReactions:!0,isInsidePdfViewer:!1,sidebarButtonOnCommentDialogVisible:!1,enableAssignment:!0,enableNotifications:!0,enableEdit:!0,enableDelete:!0,enablePrivateMode:!1,deleteThreadWithFirstComment:!0,seenByUsers:!0,enableStatus:!0,enablePriority:!1,visibilityOptions:!1,isPrivateCommentsEnabled:!1,privateModeEnabled:!1,privateModeType:null,privateModeUserIds:null,dialogSelection:!0,multiThread:!1,assignToType:"dropdown"},this.data={annotation:new Nt,ghostComment:null,assignTo:void 0,isAssignedCheckbox:!1,selectedUserContacts:[],currentDialogView:{}},this.uiState={darkMode:!1,variant:"dialog",disabled:!1,commentDialogSelected:!1,commentPinSelected:!1,readOnly:!1,dialogShadowDOM:!0,composerPosition:"bottom",dialogOpenedInSidebar:!1,containerComponentId:void 0,locationVersion:void 0,isPrivateComment:!1,sidebarButtonOnCommentDialogVisible:!1,showGhostCommentMessage:!1,showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:!1,showAllComments:!0,multiThreadAnnotationId:void 0,maxReplyAvatars:3,showSuggestionModeActions:!1,uploadingAttachments:!1,playVideoInFullScreen:!0,commentDialogUniqueId:void 0,reactionToolOpenIndex:-1,openDropdownIndexValue:-1,hasReactionsByCommentId:{}},this.unreadCommentsMap=null,this.unreadIndicatorMode=Rv.MINIMAL,this.context={},this.trackById=o=>{try{return o?.commentId?.toString()||""}catch{return""}},this.trackByAttachmentId=o=>{try{return o?.attachmentId?.toString()||""}catch{return""}},this.trackByRecorderId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByStatusId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByPriorityId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByCustomChipId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByViewUserId=o=>{try{return o?.user?.userId?.toString()||""}catch{return""}},this.scrollToBottom=new Le,this.messageScrollOffset=0,this.setMessageScrollOffset=o=>{try{let n=o?.target;n&&(this.messageScrollOffset=n.scrollTop)}catch{}}}};function Qb(){return{composerContent:"",composerContentHTML:"",localRecordedData:[],selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[]}}function Kg(r){return r?!r.composerContent&&!r.selectedFiles?.length&&!r.invalidSelectedFiles?.length&&!r.selectedAttachments?.length&&!r.localRecordedData?.length:!0}var lo=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z){this.commentService=e,this.authService=t,this.iamService=a,this.usersService=i,this.loggingService=c,this.serviceBook=m,this.customFilterService=h,this.contactService=_,this.themeService=I,this.docService=S,this.domService=z,this.contextMap=new Map,this.annotationSubscriptions=new Map,this.registryMap=new Map,this.localUIStateRegistry=new Map,this.selectedDialogInstancesByAnnotation=new Map,this.composerDraftMap=new Map,this.standaloneComposerOwners=new Set,this.localAnonymousEmailOverrides=new Map,this.serviceSubscriptions=[],this.currentUser=new Qn,this.currentIsUserAdmin=!1,this.currentResolveStatusAccessAdminOnly=!1,this.currentEnableResolve=!0,this.currentIsPlanExpired=!1,this.currentSidebarButtonOnCommentDialogVisible=!1,this.currentModeratorMode=!1,this.currentEnableSignInButton=!1,this.currentEnableUpgradeButton=!1,this.currentSuggestionMode=!1,this.currentEnableAutoCategorize=!1,this.currentEnableGhostCommentsMessage=!1,this.currentReadOnly=!1,this.currentMaxReplyAvatars=3,this.currentReplyAvatars=!1,this.currentEnableAttachment=!0,this.currentEnableAttachmentDownload=!0,this.currentEnableFormatOptions=!1,this.currentFormatConfig=null,this.currentAllowedFileTypes=[],this.currentAllowedRecordings=["audio","video","screen"],this.currentScreenSharingSupported=!!navigator?.mediaDevices?.getDisplayMedia,this.currentUserMentions=!0,this.currentAnonymousEmail=!0,this.currentDeleteOnBackspace=!0,this.currentEnterKeyToSubmit=!0,this.currentDialogShadowDOM=!0,this.currentRecordingSummaryEnabled=!1,this.currentEnableReactions=!0,this.currentEnableStatus=!1,this.currentCustomStatusesShown=!1,this.currentStatusOptions=[],this.currentEnablePriority=!0,this.currentPriorityOptions=[],this.currentEnableVisibilityOptions=!1,this.currentIsPrivateCommentsEnabled=!1,this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.currentPrivateModeUserIds=null,this.currentDeleteThreadWithFirstComment=!0,this.currentCustomChipData=null,this.currentUnreadCommentsMap=null,this.currentUnreadIndicatorMode=void 0,this.currentSeenByUsers=!0,this.currentCommentViews=null,this.viewsService=null,this.currentUserContactsBySnippylyId=null,this.currentDarkMode=!1,this.ghostCommentSubscription=null,this.currentGhostCommentAnnotationMap=null,this.currentCommentplaceholder=void 0,this.currentReplyplaceholder=void 0,this.currentEditplaceholder=void 0,this.currentEditcommentplaceholder=void 0,this.currentEditreplyplaceholder=void 0,this.currentAtHereLabel=void 0,this.currentShortUserName=!1,this.currentAttachmentNameInMessage=!1,this.currentShowAllComments=!0,this.currentCollapsedRepliesPreview=!1,this.currentPlayVideoInFullScreen=void 0,this.currentShowScreenSizeInfo=!1,this.currentInlineCommentMode=!1,this.currentFullExpanded=!1,this.currentShowCommentIndex=!1,this.currentIsPrivateCommentAllowed=!1,this.currentLinkCallback=!1,this.currentDialogOpenedInSidebar=!1,this.currentAddCommentMode=!1,this.currentAssignToType="dropdown",this.editDraftsMap=Fe(new Map),this.serviceSubscriptions.push(this.usersService.getUserById$().subscribe(()=>{this.contextMap.forEach($=>{this.updateComputedProperties($)})})),this.serviceSubscriptions.push(this.authService.getUser$().subscribe($=>{$&&(this.currentUser=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{appState:f(g({},Z.appState),{user:$})})),this.updateComputedProperties(G)}))})),this.serviceSubscriptions.push(this.iamService.isUserAdmin$().subscribe($=>{this.currentIsUserAdmin=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{appState:f(g({},Z.appState),{isUserAdmin:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getResolveStatusAccessAdminOnly$().subscribe($=>{this.currentResolveStatusAccessAdminOnly=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{resolveStatusAccessAdminOnly:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableResolve$().subscribe($=>{this.currentEnableResolve=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableResolve:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.authService.isPlanExpired$().subscribe($=>{this.currentIsPlanExpired=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPlanExpired:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getSidebarButtonOnCommentDialogVisibility$().subscribe($=>{this.currentSidebarButtonOnCommentDialogVisible=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{sidebarButtonOnCommentDialogVisible:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.themeService.getDarkMode$().subscribe($=>{this.currentDarkMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{darkMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getModeratorMode$().subscribe($=>{this.currentModeratorMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{moderatorMode:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getSignInButton$().subscribe($=>{this.currentEnableSignInButton=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableSignInButton:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUpgradeButton$().subscribe($=>{this.currentEnableUpgradeButton=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableUpgradeButton:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getSuggestionMode$().subscribe($=>{this.currentSuggestionMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{suggestionMode:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAutoCategorize$().subscribe($=>{this.currentEnableAutoCategorize=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAutoCategorize:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableGhostCommentsMessage$().subscribe($=>{this.currentEnableGhostCommentsMessage=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableGhostCommentsMessage:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getReadOnly$().subscribe($=>{this.currentReadOnly=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{readOnly:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getMaxReplyAvatars$().subscribe($=>{this.currentMaxReplyAvatars=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{maxReplyAvatars:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getReplyAvatars$().subscribe($=>{this.currentReplyAvatars=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{replyAvatars:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachment$().subscribe($=>{this.currentEnableAttachment=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachment:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachmentDownload$().subscribe($=>{this.currentEnableAttachmentDownload=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachmentDownload:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableFormatOptions$().subscribe($=>{this.currentEnableFormatOptions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableFormatOptions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getFormatConfig$().subscribe($=>{this.currentFormatConfig=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{formatConfig:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableReactions$().subscribe($=>{this.currentEnableReactions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableReactions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableStatus$().subscribe($=>{this.currentEnableStatus=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableStatus:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getCustomStatusesShown$().subscribe($=>{this.currentCustomStatusesShown=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{customStatusesShown:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.customFilterService.customStatusMap$.subscribe($=>{let G=$?Object.values($):[];this.currentStatusOptions=G,this.contextMap.forEach(Z=>{let ae=Z();Z.set(f(g({},ae),{featureState:f(g({},ae.featureState),{statusOptions:G})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getEnablePriority$().subscribe($=>{this.currentEnablePriority=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enablePriority:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableVisibilityOptions$().subscribe($=>{this.currentEnableVisibilityOptions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{visibilityOptions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.authService.getIsPrivateCommentsEnabled$().subscribe($=>{this.currentIsPrivateCommentsEnabled=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentsEnabled:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getPrivateModeConfig$().subscribe($=>{let G=$!==null,Z=$?.type??null,ae=$?.userIds??null;this.currentPrivateModeType=Z,this.currentPrivateModeUserIds=ae,this.currentPrivateModeEnabled!==G&&(this.currentPrivateModeEnabled=G),this.updatePrivateModeEnabledInAllContexts()})),this.serviceSubscriptions.push(this.commentService.getPrivateCommentMode$().subscribe($=>{$&&!this.currentPrivateModeEnabled?(this.currentPrivateModeEnabled=!0,this.currentPrivateModeType="organizationPrivate",this.updatePrivateModeEnabledInAllContexts()):!$&&!this.commentService.getPrivateModeConfig()&&(this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.updatePrivateModeEnabledInAllContexts())})),this.serviceSubscriptions.push(this.customFilterService.customPriorityMap$.subscribe($=>{let G=$?Object.values($):[];this.currentPriorityOptions=G,this.contextMap.forEach(Z=>{let ae=Z();Z.set(f(g({},ae),{featureState:f(g({},ae.featureState),{priorityOptions:G})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getDeleteThreadWithFirstComment$().subscribe($=>{this.currentDeleteThreadWithFirstComment=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteThreadWithFirstComment:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getCustomChipDropdownData$().subscribe($=>{this.currentCustomChipData=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{data:f(g({},Z.data),{customChipData:$,selectedCustomChipSet:Z.data.selectedCustomChipSet||new Set})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getAllowedFileTypes$().subscribe($=>{this.currentAllowedFileTypes=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedFileTypes:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getAllowedRecordings$().subscribe($=>{this.currentAllowedRecordings=$||[],this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedRecordings:$||[]})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUserMentions$().subscribe($=>{this.currentUserMentions=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{userMentions:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnableAnonymousEmail$().subscribe($=>{this.currentAnonymousEmail=$,this.contextMap.forEach((G,Z)=>{if(this.localAnonymousEmailOverrides.has(Z))return;let ae=G();G.set(f(g({},ae),{featureState:f(g({},ae.featureState),{anonymousEmail:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getAssignToType$().subscribe($=>{this.currentAssignToType=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{assignToType:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getDeleteOnBackspace$().subscribe($=>{this.currentDeleteOnBackspace=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteOnBackspace:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getEnterKeyToSubmit$().subscribe($=>{this.currentEnterKeyToSubmit=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enterKeyToSubmit:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getDialogShadowDOM$().subscribe($=>{this.currentDialogShadowDOM=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogShadowDOM:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getComposerMode$().subscribe($=>{this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{composerMode:$||"default"})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getRecordingSummaryEnabled$().subscribe($=>{this.currentRecordingSummaryEnabled=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{recordingSummaryEnabled:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe($=>{this.currentUnreadCommentsMap=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{unreadCommentsMap:$})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getUnreadIndicatorMode$().subscribe($=>{this.currentUnreadIndicatorMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{unreadIndicatorMode:$})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.serviceBook.observe(ln).pipe(Me($=>$?.onInitRecording()??Wn)).subscribe($=>{this.contextMap.forEach((G,Z)=>{let ae=G();($?.panelId===ae.uiState?.commentDialogUniqueId||$?.commentAnnotationId===Z||!$)&&(G.set(f(g({},ae),{uiState:f(g({},ae.uiState),{recorderInitConfig:$})})),this.updateComputedProperties(G),$?.commentAnnotationId&&$?.commentAnnotationId===Z&&!ae.featureState?.sidebarMode&&this.domService.setRecordingInProgress($.commentAnnotationId,!0))})})),this.ghostCommentSubscription=this.commentService.getGhostCommentAnnotationMap$().subscribe($=>{this.currentGhostCommentAnnotationMap=$||null,this.contextMap.forEach((G,Z)=>{let ae=G(),pe=$?$[Z]:null;G.set(f(g({},ae),{data:f(g({},ae.data),{ghostComment:pe||null})})),this.updateComputedProperties(G)})}),this.ghostCommentSubscription&&this.serviceSubscriptions.push(this.ghostCommentSubscription),this.serviceSubscriptions.push(this.commentService.getSeenByUsers$().subscribe($=>{this.currentSeenByUsers=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{seenByUsers:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.serviceBook.observe(Do).pipe(Me($=>(this.viewsService=$??null,$?$.getCommentFeatureViews$():Ee({})))).subscribe($=>{this.currentCommentViews=$,this.contextMap.forEach(G=>{this.computeCurrentDialogView(G)})})),this.serviceSubscriptions.push(this.contactService.getUserContactsBySnippylyId$().subscribe($=>{this.currentUserContactsBySnippylyId=$,this.contextMap.forEach(G=>{this.computeCurrentDialogView(G)})})),this.serviceSubscriptions.push(this.commentService.getCommentplaceholder$().subscribe($=>{this.currentCommentplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{commentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getReplyplaceholder$().subscribe($=>{this.currentReplyplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{replyplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditplaceholder$().subscribe($=>{this.currentEditplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{editplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditcommentplaceholder$().subscribe($=>{this.currentEditcommentplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{editcommentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditreplyplaceholder$().subscribe($=>{this.currentEditreplyplaceholder=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{editreplyplaceholder:$}))})})),this.serviceSubscriptions.push(this.contactService.getAtHereLabel().subscribe($=>{this.currentAtHereLabel=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{atHereLabel:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShortUserName$().subscribe($=>{this.currentShortUserName=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{shortUserName:$})}))})})),this.serviceSubscriptions.push(this.commentService.getAttachmentNameInMessage$().subscribe($=>{this.currentAttachmentNameInMessage=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{attachmentNameInMessage:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedComments$().subscribe($=>{this.currentShowAllComments=!$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showAllComments:!$,collapsedComments:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedRepliesPreview$().subscribe($=>{this.currentCollapsedRepliesPreview=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{collapsedRepliesPreview:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(ln).pipe(Me($=>$?.getPlayVideoInFullScreen$()??Wn)).subscribe($=>{this.currentPlayVideoInFullScreen=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{playVideoInFullScreen:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShowScreenSizeInfo$().subscribe($=>{this.currentShowScreenSizeInfo=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showScreenSizeInfo:$})}))})})),this.serviceSubscriptions.push(this.commentService.getInlineCommentMode$().subscribe($=>{this.currentInlineCommentMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{inlineCommentMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getFullExpanded$().subscribe($=>{this.currentFullExpanded=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{fullExpanded:$})})),this.updateComputedProperties(G)})})),this.serviceSubscriptions.push(this.commentService.getShowCommentIndex().subscribe($=>{this.currentShowCommentIndex=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showCommentIndex:$})}))})})),this.serviceSubscriptions.push(this.commentService.isPrivateCommentAllowed$().subscribe($=>{this.currentIsPrivateCommentAllowed=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentAllowed:$})}))})})),this.serviceSubscriptions.push(this.commentService.getLinkCallback$().subscribe($=>{this.currentLinkCallback=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{featureState:f(g({},Z.featureState),{linkCallback:$})}))})})),this.serviceSubscriptions.push(this.commentService.addCommentModeChange().subscribe($=>{this.currentAddCommentMode=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{addCommentMode:$})}))})})),this.serviceSubscriptions.push(this.domService.getDialogOpenedInSidebar().subscribe($=>{this.currentDialogOpenedInSidebar=$,this.contextMap.forEach(G=>{let Z=G();G.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogOpenedInSidebar:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(ln).pipe(Me($=>$?.onRecordingAttributeRemovedFromBody$()??Wn)).subscribe(()=>{this.contextMap.forEach($=>{let G=$();$.set(f(g({},G),{uiState:f(g({},G.uiState),{recordingAttributeRemovedTimestamp:Date.now()})}))})}))}setRegistry(e,t){try{this.registryMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setRegistry:",a)}}getRegistry(e){try{return this.registryMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getRegistry:",t);return}}clearRegistry(e){try{this.registryMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearRegistry:",t)}}createDefaultComponentConfig(){try{let e=new bn,t=new Nt;return e.appState={user:this.currentUser,isUserAdmin:this.currentIsUserAdmin,isKnownUser:!1},e.data={annotation:t,customChipData:this.currentCustomChipData,selectedCustomChipSet:new Set,customList:t.customList||[],currentDialogView:{}},e.featureState={inlineCommentMode:this.currentInlineCommentMode,inlineCommentSectionMode:!1,canResolveAnnotation:!1,resolveStatusAccessAdminOnly:this.currentResolveStatusAccessAdminOnly,sidebarMode:!1,enableResolve:this.currentEnableResolve,dialogSelectedByKnownUser:!1,isPlanExpired:this.currentIsPlanExpired,dialogMode:!0,moderatorMode:this.currentModeratorMode,enableAutoCategorize:this.currentEnableAutoCategorize,suggestionMode:this.currentSuggestionMode,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:this.currentEnableSignInButton,enableUpgradeButton:this.currentEnableUpgradeButton,enableGhostCommentsMessage:this.currentEnableGhostCommentsMessage,replyAvatars:this.currentReplyAvatars,userMentions:this.currentUserMentions,anonymousEmail:this.currentAnonymousEmail,recordingSummaryEnabled:this.currentRecordingSummaryEnabled,enableAttachment:this.currentEnableAttachment,enableAttachmentDownload:this.currentEnableAttachmentDownload,enableFormatOptions:this.currentEnableFormatOptions,formatConfig:this.currentFormatConfig??void 0,allowedFileTypes:this.currentAllowedFileTypes,allowedRecordings:this.currentAllowedRecordings,screenSharingSupported:this.currentScreenSharingSupported,enterKeyToSubmit:this.currentEnterKeyToSubmit,deleteOnBackspace:this.currentDeleteOnBackspace,enableReactions:this.currentEnableReactions,enableStatus:this.currentEnableStatus,customStatusesShown:this.currentCustomStatusesShown,statusOptions:this.currentStatusOptions,enablePriority:this.currentEnablePriority,priorityOptions:this.currentPriorityOptions,visibilityOptions:this.currentEnableVisibilityOptions,isPrivateCommentsEnabled:this.currentIsPrivateCommentsEnabled,privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds,deleteThreadWithFirstComment:this.currentDeleteThreadWithFirstComment,fullExpanded:this.currentFullExpanded,seenByUsers:this.currentSeenByUsers,isPrivateCommentAllowed:this.currentIsPrivateCommentAllowed,linkCallback:this.currentLinkCallback,assignToType:this.currentAssignToType,messageTruncation:!1,messageTruncationLines:4},e.uiState={darkMode:this.currentDarkMode,variant:"dialog",disabled:!1,isPrivateComment:!1,commentDialogSelected:!1,commentPinSelected:!1,sidebarButtonOnCommentDialogVisible:this.currentSidebarButtonOnCommentDialogVisible,readOnly:this.currentReadOnly,maxReplyAvatars:this.currentMaxReplyAvatars,uploadingAttachments:!1,dialogShadowDOM:this.currentDialogShadowDOM,commentDialogUniqueId:zt(),composerMode:"default",showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:this.currentCollapsedRepliesPreview,showAllComments:this.currentShowAllComments,shortUserName:this.currentShortUserName,attachmentNameInMessage:this.currentAttachmentNameInMessage,showScreenSizeInfo:this.currentShowScreenSizeInfo,showCommentIndex:this.currentShowCommentIndex,playVideoInFullScreen:this.currentPlayVideoInFullScreen,addCommentMode:this.currentAddCommentMode,dialogOpenedInSidebar:this.currentDialogOpenedInSidebar,atHereLabel:this.currentAtHereLabel},e.unreadCommentsMap=this.currentUnreadCommentsMap,e.unreadIndicatorMode=this.currentUnreadIndicatorMode,e.commentplaceholder=this.currentCommentplaceholder,e.replyplaceholder=this.currentReplyplaceholder,e.editplaceholder=this.currentEditplaceholder,e.editcommentplaceholder=this.currentEditcommentplaceholder,e.editreplyplaceholder=this.currentEditreplyplaceholder,e}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService createDefaultComponentConfig:",e),new bn}}getDefaultBase(){try{let e=this.createDefaultComponentConfig();return{appState:{user:e.appState.user,isUserAdmin:e.appState.isUserAdmin,isKnownUser:e.appState.isKnownUser,repliesUniqueUsers:e.appState.repliesUniqueUsers},data:{annotation:e.data.annotation,customChipData:e.data.customChipData,selectedCustomChipSet:e.data.selectedCustomChipSet,customList:e.data.customList},featureState:{inlineCommentMode:e.featureState.inlineCommentMode,inlineCommentSectionMode:e.featureState.inlineCommentSectionMode,canResolveAnnotation:e.featureState.canResolveAnnotation,canUnresolveAnnotation:e.featureState.canUnresolveAnnotation,resolveStatusAccessAdminOnly:e.featureState.resolveStatusAccessAdminOnly,sidebarMode:e.featureState.sidebarMode,enableResolve:e.featureState.enableResolve,dialogSelectedByKnownUser:e.featureState.dialogSelectedByKnownUser,isPlanExpired:e.featureState.isPlanExpired,moderatorMode:e.featureState.moderatorMode,enableAutoCategorize:e.featureState.enableAutoCategorize,suggestionMode:e.featureState.suggestionMode,commentAcceptedStatus:e.featureState.commentAcceptedStatus,commentRejectedStatus:e.featureState.commentRejectedStatus,enableSignInButton:e.featureState.enableSignInButton,enableUpgradeButton:e.featureState.enableUpgradeButton,enableGhostCommentsMessage:e.featureState.enableGhostCommentsMessage,replyAvatars:e.featureState.replyAvatars,userMentions:e.featureState.userMentions,anonymousEmail:e.featureState.anonymousEmail,recordingSummaryEnabled:e.featureState.recordingSummaryEnabled,enableAttachment:e.featureState.enableAttachment,enableFormatOptions:e.featureState.enableFormatOptions,formatConfig:e.featureState.formatConfig,allowedFileTypes:e.featureState.allowedFileTypes,allowedRecordings:e.featureState.allowedRecordings,screenSharingSupported:e.featureState.screenSharingSupported,enterKeyToSubmit:e.featureState.enterKeyToSubmit,deleteOnBackspace:e.featureState.deleteOnBackspace,enableReactions:e.featureState.enableReactions,enableStatus:e.featureState.enableStatus,customStatusesShown:e.featureState.customStatusesShown,statusOptions:e.featureState.statusOptions,enablePriority:e.featureState.enablePriority,priorityOptions:e.featureState.priorityOptions,deleteThreadWithFirstComment:e.featureState.deleteThreadWithFirstComment,seenByUsers:e.featureState.seenByUsers,fullExpanded:e.featureState.fullExpanded,isPrivateCommentAllowed:e.featureState.isPrivateCommentAllowed,linkCallback:e.featureState.linkCallback,assignToType:e.featureState.assignToType,visibilityOptions:e.featureState.visibilityOptions,isPrivateCommentsEnabled:e.featureState.isPrivateCommentsEnabled,messageTruncation:e.featureState.messageTruncation,messageTruncationLines:e.featureState.messageTruncationLines},uiState:{darkMode:e.uiState?.darkMode,variant:e.uiState?.variant,disabled:e.uiState?.disabled,isPrivateComment:e.uiState?.isPrivateComment,dialogShadowDOM:e.uiState?.dialogShadowDOM,composerMode:e.uiState?.composerMode??"default",showAllComments:e.uiState?.showAllComments,collapsedComments:e.uiState?.collapsedComments,collapsedRepliesPreview:e.uiState?.collapsedRepliesPreview,shortUserName:e.uiState?.shortUserName,attachmentNameInMessage:e.uiState?.attachmentNameInMessage,showScreenSizeInfo:e.uiState?.showScreenSizeInfo,showCommentIndex:e.uiState?.showCommentIndex,playVideoInFullScreen:e.uiState?.playVideoInFullScreen,addCommentMode:e.uiState?.addCommentMode,dialogOpenedInSidebar:e.uiState?.dialogOpenedInSidebar,atHereLabel:e.uiState?.atHereLabel},unreadCommentsMap:e.unreadCommentsMap,unreadIndicatorMode:e.unreadIndicatorMode,commentplaceholder:e.commentplaceholder,replyplaceholder:e.replyplaceholder}}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService getDefaultBase:",e),{}}}getOrCreateContextConfig(e){try{if(!this.contextMap.has(e)){let t=this.createDefaultComponentConfig();this.currentGhostCommentAnnotationMap&&this.currentGhostCommentAnnotationMap[e]&&(t.data=f(g({},t.data),{ghostComment:this.currentGhostCommentAnnotationMap[e]}));let a=Fe(t);this.contextMap.set(e,a),this.updateComputedProperties(a),this.fetchAndUpdateAnnotation(e)}return this.contextMap.get(e)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getOrCreateContextConfig:",t),Fe(new bn)}}getContextConfig(e){try{return this.contextMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getContextConfig:",t);return}}setLocalAnonymousEmail(e,t){try{this.localAnonymousEmailOverrides.set(e,t);let a=this.contextMap.get(e);if(a){let i=a();a.set(f(g({},i),{featureState:f(g({},i.featureState),{anonymousEmail:t})})),this.updateComputedProperties(a)}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setLocalAnonymousEmail:",a)}}clearLocalAnonymousEmail(e){try{this.localAnonymousEmailOverrides.delete(e);let t=this.contextMap.get(e);if(t){let a=t();t.set(f(g({},a),{featureState:f(g({},a.featureState),{anonymousEmail:this.currentAnonymousEmail})})),this.updateComputedProperties(t)}}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearLocalAnonymousEmail:",t)}}registerLocalUIState(e,t){this.localUIStateRegistry.set(e,t)}unregisterLocalUIState(e){this.localUIStateRegistry.delete(e)}getLocalUIState(e){return this.localUIStateRegistry.get(e)}getOrCreateComposerDraft(e){let t=this.composerDraftMap.get(e);return t||(t=Fe(g({},Qb())),this.composerDraftMap.set(e,t)),t}clearComposerDraft(e){let t=this.composerDraftMap.get(e);t&&t.set(g({},Qb()))}appendComposerDraftRecording(e,t){this.getOrCreateComposerDraft(e).update(i=>{let c=i.localRecordedData||[];return c.some(m=>m?.id&&m.id===t?.id)?i:f(g({},i),{localRecordedData:[...c,t]})})}removeComposerDraftRecording(e,t){if(!t)return;this.getOrCreateComposerDraft(e).update(i=>f(g({},i),{localRecordedData:(i.localRecordedData||[]).filter(c=>c?.id!==t)}))}setComposerDraftAttachments(e,t){this.getOrCreateComposerDraft(e).update(i=>g(g(g(g({},i),t.selectedFiles!==void 0?{selectedFiles:t.selectedFiles}:{}),t.invalidSelectedFiles!==void 0?{invalidSelectedFiles:t.invalidSelectedFiles}:{}),t.selectedAttachments!==void 0?{selectedAttachments:t.selectedAttachments}:{}))}markStandaloneComposerOwner(e){this.standaloneComposerOwners.add(e)}unmarkStandaloneComposerOwner(e){this.standaloneComposerOwners.delete(e)}isStandaloneComposerOwner(e){return!!e&&this.standaloneComposerOwners.has(e)}getStandaloneRecorderPanelId(e){return`velt-standalone-composer-recorder-${e}`}editDraftKey(e,t){return`${e}:${t}`}getEditDraft(e,t){try{return!e||t===void 0||t===null?null:this.editDraftsMap().get(this.editDraftKey(e,t))??null}catch(a){return this.loggingService.catch("Error in getEditDraft:",a),null}}setEditDraft(e,t,a){try{let i=this.editDraftKey(e,t);this.editDraftsMap.update(c=>{let m=c.get(i);if(m&&m.composerContent===a.composerContent&&m.composerContentHTML===a.composerContentHTML)return c;let h=new Map(c);return h.set(i,a),h})}catch(i){this.loggingService.catch("Error in setEditDraft:",i)}}clearEditDraft(e,t){try{let a=this.editDraftKey(e,t);this.editDraftsMap.update(i=>{if(!i.has(a))return i;let c=new Map(i);return c.delete(a),c})}catch(a){this.loggingService.catch("Error in clearEditDraft:",a)}}setContextConfig(e,t){try{this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=g(g({},i),a);this.localAnonymousEmailOverrides.has(e)&&(c.featureState=f(g({},c.featureState),{anonymousEmail:this.localAnonymousEmailOverrides.get(e)})),t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setContextConfig:",a)}}clearContext(e){try{this.contextMap.delete(e),this.localAnonymousEmailOverrides.delete(e),this.selectedDialogInstancesByAnnotation.delete(e);let t=this.annotationSubscriptions.get(e);t&&(t.unsubscribe(),this.annotationSubscriptions.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearContext:",t)}}generateTempAnnotationId(e){try{let t=e||zt();return`${o.TEMP_ID_PREFIX}${t}`}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService generateTempAnnotationId:",t),"TEMP_ANNOTATION_ID"}}isTempAnnotationId(e){try{return e?.startsWith(o.TEMP_ID_PREFIX)||!1}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService isTempAnnotationId:",t),!1}}registerTempContext(e,t){try{if(!this.isTempAnnotationId(e)){this.loggingService.warn(`[registerTempContext] ID "${e}" is not a valid temp ID`);return}this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=f(g(g({},i),a),{data:f(g(g({},i.data),a.data),{annotation:a.data?.annotation||i.data?.annotation}),appState:g(g({},i.appState),a.appState),featureState:f(g(g({},i.featureState),a.featureState),{allowedRecordings:i.featureState?.allowedRecordings,enableAttachment:i.featureState?.enableAttachment,enableReactions:i.featureState?.enableReactions,allowedFileTypes:i.featureState?.allowedFileTypes,screenSharingSupported:i.featureState?.screenSharingSupported,userMentions:i.featureState?.userMentions,anonymousEmail:i.featureState?.anonymousEmail,enterKeyToSubmit:i.featureState?.enterKeyToSubmit,deleteOnBackspace:i.featureState?.deleteOnBackspace,recordingSummaryEnabled:i.featureState?.recordingSummaryEnabled,enableResolve:i.featureState?.enableResolve,enableStatus:i.featureState?.enableStatus,enablePriority:i.featureState?.enablePriority,statusOptions:i.featureState?.statusOptions,priorityOptions:i.featureState?.priorityOptions,assignToType:i.featureState?.assignToType,visibilityOptions:i.featureState?.visibilityOptions,isPrivateCommentsEnabled:i.featureState?.isPrivateCommentsEnabled}),uiState:g(g({},i.uiState),a.uiState)});t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService registerTempContext:",a)}}clearTempContext(e){try{this.isTempAnnotationId(e)&&this.contextMap.has(e)&&(this.contextMap.delete(e),this.registryMap.delete(e),this.selectedDialogInstancesByAnnotation.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearTempContext:",t)}}computeNewCommentPlaceholder(e,t,a,i){try{if(t)return t;if(e?.placeholder)return e.placeholder;let c=e?.featureState?.userMentions===!0,m=(e?.data?.annotation?.comments?.length||0)>0,h=a||e?.replyplaceholder,_=i||e?.commentplaceholder;return m&&h?h:!m&&_?_:c?m?"Reply or add others with @":"Comment or add others with @":m?"Write a reply...":"Write a comment..."}catch(c){return this.loggingService.catch("Error in CommentDialogCoreService computeNewCommentPlaceholder:",c),"Write a comment..."}}computeEditCommentPlaceholder(e,t,a,i=!1,c,m,h){try{if(t)return t;if(e?.placeholder)return e.placeholder;let _=c||e?.editcommentplaceholder,I=m||e?.editreplyplaceholder,S;if(typeof h=="number"?S=h>0:S=(e?.data?.annotation?.comments?.length||0)>0,S&&I)return I;if(!S&&_)return _;let z=a||e?.editplaceholder;return z||(i?S?"Edit your reply...":"Edit your comment...":"Edit comment...")}catch(_){return this.loggingService.catch("Error in CommentDialogCoreService computeEditCommentPlaceholder:",_),"Edit comment..."}}recomputeDerivedProperties(e){try{let t=this.getContextConfig(e);t&&this.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService recomputeDerivedProperties:",t)}}markDialogSelected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);a||(a=new Set,this.selectedDialogInstancesByAnnotation.set(e,a)),a.add(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogSelected:",a)}}markDialogDeselected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);if(!a)return;a.delete(t),a.size===0&&this.selectedDialogInstancesByAnnotation.delete(e)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogDeselected:",a)}}hasOtherSelectedDialogInstance(e,t){try{let a=this.selectedDialogInstancesByAnnotation.get(e);return!a||a.size===0?!1:t?!(a.size===1&&a.has(t)):a.size>0}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService hasOtherSelectedDialogInstance:",a),!1}}resetCollapsedCommentsToDefault(e,t){try{if(this.hasOtherSelectedDialogInstance(e,t))return;let a=this.getContextConfig(e);if(!a)return;let i=a();if(i.uiState?.showAllComments===this.currentShowAllComments&&i.uiState?.collapsedComments===!this.currentShowAllComments&&!i.uiState?.showReplies&&!i.uiState?.showReplyComposer)return;a.set(f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:this.currentShowAllComments,collapsedComments:!this.currentShowAllComments,showReplies:!1,showReplyComposer:!1})}))}catch(a){this.loggingService.catch("Error in CommentDialogCoreService resetCollapsedCommentsToDefault:",a)}}ngOnDestroy(){try{this.serviceSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.serviceSubscriptions=[],this.ghostCommentSubscription=null,this.annotationSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.annotationSubscriptions.clear()}catch(e){this.loggingService.catch("Error in CommentDialogCoreService ngOnDestroy:",e)}}fetchAndUpdateAnnotation(e,t){try{if(this.annotationSubscriptions.has(e))t&&t();else{let a=this.commentService.getCommentAnnotationByAnnotationId(e).subscribe({next:i=>{if(i){let c=this.getContextConfig(e);if(c){let m=c(),h=f(g({},i),{annotationId:e});c.update(_=>f(g({},_),{data:f(g({},_.data),{annotation:h})})),this.updateComputedProperties(c),this.computeCurrentDialogView(c)}t&&t()}},error:i=>{},complete:()=>{}});this.annotationSubscriptions.set(e,a)}}catch{}}updateContextConfig(e,t){try{let a=this.getContextConfig(e);if(a){let i=a();a.set(g(g({},i),t))}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService updateContextConfig:",a)}}updatePrivateModeEnabledInAllContexts(){this.contextMap.forEach(e=>{let t=e();e.set(f(g({},t),{featureState:f(g({},t.featureState),{privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds})})),this.updateComputedProperties(e)})}updateComputedProperties(e){try{let t=e(),a=this.computeIsKnownUser(t),i=this.computeDialogSelectedByKnownUser(t,a),c=this.computeIsPrivateComment(t),m=this.computeCanResolveAnnotation(t,i),h=this.computeCanUnresolveAnnotation(t,i),_=this.computeShowGhostCommentMessage(t),I=this.computeRepliesUniqueUsers(t),S=this.computeShowSuggestionModeActions(t,i),z=this.computeHasReactionsByCommentId(t),$=this.computeUnreadStatus(t),G=!1,Z={};t.appState.isKnownUser!==a&&(G=!0,Z.appState=f(g({},t.appState),{isKnownUser:a})),t.featureState.dialogSelectedByKnownUser!==i&&(G=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{dialogSelectedByKnownUser:i})),t.featureState.canResolveAnnotation!==m&&(G=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canResolveAnnotation:m})),t.featureState.canUnresolveAnnotation!==h&&(G=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canUnresolveAnnotation:h})),t.uiState.isPrivateComment!==c&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{isPrivateComment:c})),t.uiState.showGhostCommentMessage!==_&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showGhostCommentMessage:_}));let ae=(t.appState.repliesUniqueUsers||[]).map(Xe=>Xe?.userId).sort().join(","),pe=(I||[]).map(Xe=>Xe?.userId).sort().join(",");ae!==pe&&(G=!0,Z.appState=f(g(g({},t.appState),Z.appState),{repliesUniqueUsers:I})),t.uiState.showSuggestionModeActions!==S&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showSuggestionModeActions:S}));let Se=JSON.stringify(t.uiState.hasReactionsByCommentId||{}),oe=JSON.stringify(z||{});Se!==oe&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{hasReactionsByCommentId:z})),t.uiState.unread!==$&&(G=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{unread:$}));let _e=(t.data?.annotation?.customList||[]).map(Xe=>Xe?.id).filter(Boolean),Re=t.data?.selectedCustomChipSet;(Re instanceof Set?Array.from(Re):[]).slice().sort().join("\0")!==_e.slice().sort().join("\0")&&(G=!0,Z.data=f(g(g({},t.data),Z.data),{selectedCustomChipSet:new Set(_e)})),G&&e.update(Xe=>f(g(g({},Xe),Z),{appState:g(g({},Xe.appState),Z.appState),featureState:g(g({},Xe.featureState),Z.featureState),uiState:g(g({},Xe.uiState),Z.uiState),data:g(g({},Xe.data),Z.data)}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService updateComputedProperties:",t)}}computeIsKnownUser(e){try{let t=e.appState?.user;return!!(t&&!t.isReadOnly&&!t.isAnonymous)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsKnownUser:",t),!1}}computeDialogSelectedByKnownUser(e,t){try{return t&&!!e.appState?.user}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeDialogSelectedByKnownUser:",a),!1}}computeCanResolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type!=="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanResolveAnnotation:",a),!1}}computeCanUnresolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type==="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanUnresolveAnnotation:",a),!1}}computeIsPrivateComment(e){try{return sr(e.data?.annotation)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsPrivateComment:",t),!1}}computeShowGhostCommentMessage(e){try{let t=e.data?.ghostComment,a=e.featureState?.enableGhostCommentsMessage,i=e.data?.annotation,c=e.featureState?.commentAcceptedStatus,m=e.featureState?.commentRejectedStatus;return!!(t&&a&&![c?.id,m?.id].includes(i?.status?.id))}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeShowGhostCommentMessage:",t),!1}}computeRepliesUniqueUsers(e){try{let t=e.data?.annotation;if(!t?.comments||t.comments.length<=1)return[];let a=t.comments.slice(1).map(m=>m?.from).filter(m=>m);return this.getUniqueUsers(a).map(m=>m?.userId&&this.usersService.getUserById(m.userId)||m).filter(m=>m)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeRepliesUniqueUsers:",t),[]}}getUniqueUsers(e){try{let t=new Map;return e.forEach(a=>{a?.userId&&!t.has(a.userId)&&t.set(a.userId,a)}),Array.from(t.values())}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getUniqueUsers:",t),[]}}computeShowSuggestionModeActions(e,t){try{let a=e.data?.annotation;if(a?.type==="suggestion"&&!!a?.suggestion&&a.suggestion.status==="pending"&&t)return!0;let c=e.featureState?.suggestionMode,m=!!a?.comments?.length,h=a?.status?.type!=="terminal";return!!(c&&t&&h&&m)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeShowSuggestionModeActions:",a),!1}}computeHasReactionsByCommentId(e){try{let t={},a=e.data?.annotation;return a?.comments&&Array.isArray(a.comments)&&a.comments.forEach(i=>{i?.commentId&&(t[i.commentId]=i?.reactionAnnotationIds?.length>0)}),t}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeHasReactionsByCommentId:",t),{}}}computeUnreadStatus(e){try{let t=e.data?.annotation,a=e.appState?.user;return!t||!a?.userSnippylyId?void 0:!t?.viewedByUserIds?.includes(a.userSnippylyId)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeUnreadStatus:",t);return}}computeCurrentDialogView(e){try{let t=e(),a=t.data?.annotation,i=a?.annotationId,c=t.appState?.user?.userId,m=a?.from?.userId,h={};if(i&&this.currentCommentViews){let S=this.currentCommentViews?.[i]?.comments;Object.keys(S||{}).forEach(z=>{let $=[],G=0;Object.keys(S[z]?.views||{}).forEach(Z=>{let ae={};ae.user=this.currentUserContactsBySnippylyId?.[Z],ae.viewedAt=S[z]?.views?.[Z]?.timestamp,ae.user?.userId!==c&&ae.user?.userId!==m&&($.push(ae),(ae.user?.email||ae.user?.name)&&G++)}),h[z]={count:G,views:$}})}let _=JSON.stringify(t.data?.currentDialogView||{}),I=JSON.stringify(h);_!==I&&e.update(S=>f(g({},S),{data:f(g({},S.data),{currentDialogView:h})}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeCurrentDialogView:",t)}}findParentAnnotationId(e,t=20){try{let a=e.nativeElement.parentElement,i=0;for(;a&&i<t;){if(a.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let m=a.getAttribute("annotation-id");if(m)return m;let h=a.__veltContext;if(h?.annotationId)return h.annotationId;let _=a.__ngContext__;if(_&&Array.isArray(_))for(let I=0;I<_.length;I++){let S=_[I];if(S&&typeof S=="object"&&S.annotationId)return S.annotationId}}a=a.parentElement,i++}return""}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService findParentAnnotationId:",a),""}}};o.TEMP_ID_PREFIX="TEMP_COMPOSER_",o.\u0275fac=function(t){return new(t||o)(be(ie),be(ot),be(Dr),be(Ob),be(N),be(fr),be(Dt),be($t),be(Et),be(ut),be(Ne))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var fn=(()=>{let o=class o{constructor(e){this.loggingService=e,this.subscribers=new Set}register(e){try{if(this.subscribers.add(e),this.lastPayload)try{e(this.lastPayload)}catch(t){this.loggingService.catch("[REGISTRY] Error initializing subscriber:",t)}}catch(t){this.loggingService.catch("[REGISTRY] Error in register:",t)}}unregister(e){try{this.subscribers.delete(e)}catch(t){this.loggingService.catch("[REGISTRY] Error in unregister:",t)}}broadcast(e){try{this.lastPayload=e;let t=0,a=0;this.subscribers.forEach((i,c)=>{try{i(e),t++}catch(m){a++,this.loggingService.catch(`[REGISTRY] Error in subscriber #${t+a}:`,m)}})}catch(t){this.loggingService.catch("[REGISTRY] Error in broadcast:",t)}}getLastPayload(){try{return this.lastPayload}catch(e){this.loggingService.catch("[REGISTRY] Error in getLastPayload:",e);return}}};o.\u0275fac=function(t){return new(t||o)(be(N))},o.\u0275prov=et({token:o,factory:o.\u0275fac});let r=o;return r})();var Zg=new WeakMap;function Vc(r){try{if(!r)return;let o=Zg.get(r);o&&o()}catch{}}function zy(r,o,n){if(r)return r;if(o)return o;try{return n()||void 0}catch{return}}function Wy(r,o){return r&&r!==o?{nextCachedId:r,annotationChanged:!0}:{nextCachedId:o,annotationChanged:!1}}var te=(()=>{let o=class o extends At{getCachedAnnotationId(){return this._annotationId}setCachedAnnotationId(e){this._annotationId=e}set parentLocalUIState(e){e&&(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1)}get elementRef(){return this.hostElementRef}flushChangeDetection(){this.runScopedFlush();try{(typeof requestAnimationFrame<"u"?requestAnimationFrame:t=>setTimeout(()=>t(0),16))(()=>this.runScopedFlush())}catch{}}runScopedFlush(){try{let e=this.localUIStateSignal?Zg.get(this.localUIStateSignal):void 0;e?e():this.cd.detectChanges()}catch{try{this.cd.markForCheck()}catch{}}}constructor(){let e=se(me),t=se(Et),a=se(ar),i=se(ie,{optional:!0}),c=se(D),m=se(N);super(e,t,a,i??void 0,void 0,c,m),this.annotationId=q(),this.inlineCommentSectionMode=q(!1,{transform:h=>{try{return typeof h=="string"?h==="true"||h==="":h}catch{return!1}}}),this.defaultCondition=q(!0,{transform:h=>{try{return typeof h=="string"?h==="true"||h==="":h}catch{return!0}}}),this._contextData={},this.isLocalUIStateOwner=!1,this.isContextInitialized=!1,this.registryCheckAttempts=0,this.MAX_REGISTRY_CHECK_ATTEMPTS=50,this.composerDraft=L(()=>{try{let h=this.componentConfigSignal()?.data?.annotation?.annotationId||this._annotationId;if(!h)return null;let _=this.coreService.getOrCreateComposerDraft(h)();return Kg(_)?null:_}catch{return null}}),this.onContextPayload=h=>{try{this.isContextInitialized||(this.isContextInitialized=!0),this._annotationId=h.annotationId,this._contextData=h.contextData||{};let _=this.coreService.getContextConfig(h.annotationId);if(_){if(this.componentConfigSignal.update(I=>g({},I)),this.componentConfigSignal=_,this.isLocalUIStateOwner){let I=this._contextData["comment-pin-selected"],S=I==="true"||I==="",z=this._contextData["full-expanded"],$=z==="true"||z==="",G=S||$,Z=this._contextData["inline-comment-section-mode"],ae=Z==="true"||Z==="";this.localUIStateSignal.update(pe=>f(g({},pe),{commentPinSelected:S,fullExpanded:$,commentDialogSelected:G})),_.update(pe=>f(g({},pe),{featureState:f(g({},pe.featureState),{inlineCommentSectionMode:ae||pe.featureState.inlineCommentSectionMode,fullExpanded:$})}))}this.coreService.recomputeDerivedProperties(h.annotationId),this.cd.markForCheck()}}catch(_){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent onContextPayload:",_)}},this.hostElementRef=e,this.themeService=t,this.dynamicDataService=c,this.loggingService=m,this.coreService=se(lo),this.actionService=se(Hv),this.cd=a,this.commentService=i??void 0,this.registry=se(fn,{optional:!0})??void 0,this.initializeLocalUIState()}initializeLocalUIState(){try{let e=se(Yg,{optional:!0,skipSelf:!0});e?(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1):(this.localUIStateSignal=Fe(zu()),this.isLocalUIStateOwner=!0)}catch{this.localUIStateSignal=Fe(zu()),this.isLocalUIStateOwner=!0}}ngOnInit(){try{super.ngOnInit(),this.isLocalUIStateOwner&&this.localUIStateSignal&&Zg.set(this.localUIStateSignal,()=>{try{this.cd.detectChanges()}catch{}});let e=this.annotationId();if(!e){let a=this.hostElementRef?.nativeElement?.getAttribute?.("annotation-id");a&&(e=a)}if(this.componentConfigSignal&&this.componentConfigSignal()&&Object.keys(this.componentConfigSignal()).length>0){this.initializeFromConfigSignal(this.componentConfigSignal),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(e){this._annotationId=e,this.initializeFromAnnotationId(e),this.setupA11yAttributes(),this.setupDarkModeSync();return}let t=this.findNearestParentWrapperRegistry();if(t){this.registry=t,this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(this.registry){this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}this.tryRegisterWithContext(),this.setupA11yAttributes(),this.setupDarkModeSync()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnInit:",e)}}ngOnChanges(e){try{super.ngOnChanges(e);let t=e.componentConfigSignal;t&&!t.firstChange&&this.refreshAnnotationContextFromSignal()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnChanges:",t)}}refreshAnnotationContextFromSignal(){try{let e=ig(()=>this.componentConfigSignal?.()?.data?.annotation?.annotationId),{nextCachedId:t,annotationChanged:a}=Wy(e,this._annotationId);if(a){let i=this._annotationId;this._annotationId=t,this.onAnnotationContextChanged(i,t),this.cd?.markForCheck()}}catch(e){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent refreshAnnotationContextFromSignal:",e)}}onAnnotationContextChanged(e,t){}ngOnDestroy(){try{this.registryCheckTimer&&(clearTimeout(this.registryCheckTimer),this.registryCheckTimer=void 0),this.registry&&this.registry.unregister(this.onContextPayload),this.darkModeConfigSyncSubscription&&this.darkModeConfigSyncSubscription.unsubscribe(),this.isLocalUIStateOwner&&this.localUIStateSignal&&Zg.delete(this.localUIStateSignal),super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnDestroy:",e)}}setupA11yAttributes(){}setupDarkModeSync(){try{this.darkModeConfigSyncSubscription=this.onDarkModeChange().subscribe(e=>{try{if(this.componentConfigSignal&&typeof this.componentConfigSignal=="function"){let t=this.componentConfigSignal();t&&t.uiState&&t.uiState.darkMode!==e&&this.componentConfigSignal.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{darkMode:e})}))}}catch(t){this.loggingService.catch("Error in darkMode sync subscription:",t)}})}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent setupDarkModeSync:",e)}}findNearestParentWrapperRegistry(){try{let e=this.hostElementRef?.nativeElement;if(!e)return;let t=e.parentElement;for(;t;){if(t.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let a=t.__veltContext;if(a?.registry instanceof fn)return a.contextData&&(this._contextData=a.contextData),a.registry;let i=window.ng;if(i?.getComponent){let m=i.getComponent(t);if(m?.registry)return m.registry}let c=t.__ngContext__;if(c&&Array.isArray(c))for(let m=0;m<c.length;m++){let h=c[m];if(h&&typeof h=="object"&&h.registry instanceof fn)return h.registry}}t=t.parentElement}}catch(e){this.loggingService.catch("[PRIMITIVE BASE] Error finding parent wrapper registry:",e)}}tryRegisterWithContext(){try{let e=this.coreService.findParentAnnotationId(this.hostElementRef);if(!e){this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS&&(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10));return}this.registry=this.coreService.getRegistry(e),this.registry?this.registry.register(this.onContextPayload):this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS?(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10)):this.initializeFromDOM(e)}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent tryRegisterWithContext:",e)}}getContextValue(e){try{let t=this._contextData[e];if(t!=null)return t;let a=this.hostElementRef?.nativeElement?.getAttribute(e);return a!==null?a:void 0}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextValue:",t);return}}getContextCommentId(){try{let e=this.getContextValue("comment-id");if(e==null)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextCommentId:",e);return}}getAnnotationId(){try{return zy(this.componentConfigSignal()?.data?.annotation?.annotationId,this._annotationId,()=>this.coreService.findParentAnnotationId(this.hostElementRef))}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getAnnotationId:",e);return}}initializeFromDOM(e){try{this._annotationId=e;let t=this.coreService.getContextConfig(e);t&&(this.componentConfigSignal.update(a=>g({},a)),this.componentConfigSignal=t,this.isContextInitialized=!0,this.cd.markForCheck())}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromDOM:",t)}}initializeFromAnnotationId(e){try{this._annotationId=e;let t=this.coreService.getOrCreateContextConfig(e);this.componentConfigSignal.update(S=>g({},S)),this.componentConfigSignal=t,this.isContextInitialized=!0;let a=!1,i=!1,c=this.hostElementRef?.nativeElement?.getAttribute?.("comment-pin-selected");(c==="true"||c==="")&&(a=!0);let m=this.hostElementRef?.nativeElement?.getAttribute?.("full-expanded");(m==="true"||m==="")&&(i=!0);let h=a||i,_=t(),I=this.inlineCommentSectionMode();t.set(f(g({},_),{featureState:f(g({},_.featureState),{inlineCommentSectionMode:I!==!1?I:_.featureState.inlineCommentSectionMode,fullExpanded:i})})),this.isLocalUIStateOwner&&this.localUIStateSignal.update(S=>f(g({},S),{commentPinSelected:a,fullExpanded:i,commentDialogSelected:h})),this.coreService.recomputeDerivedProperties(e),this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromAnnotationId:",t)}}initializeFromConfigSignal(e){try{let a=e().data?.annotation?.annotationId;a&&(this._annotationId=a),this.isContextInitialized=!0,this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromConfigSignal:",t)}}veltEmit(e){return typeof CustomEvent<"u"&&e instanceof CustomEvent?e.detail:e}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["app-comment-dialog-primitive-themed-base"]],inputs:{annotationId:[1,"annotationId"],inlineCommentSectionMode:[1,"inlineCommentSectionMode"],defaultCondition:[1,"defaultCondition"],parentLocalUIState:"parentLocalUIState"},standalone:!1,features:[M,tt],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();function tf(r,o){try{let n=r??[];if(n.some(a=>a.startsWith("organizationPrivate:")))return it.ORGANIZATION_PRIVATE;let e=X.VISIBILITY_SELF_PREFIX,t=n.filter(a=>a.startsWith(e));if(t.length>0){if(t.length===1&&o?.userId){let a=new Set(t.map(c=>c.substring(e.length))),i=mr(o.userId).toString();if(a.has(i))return it.RESTRICTED_SELF}return it.RESTRICTED_SELECTED_PEOPLE}return it.PUBLIC}catch{return it.PUBLIC}}function Wu(r,o){try{let n=r??[],e=X.VISIBILITY_SELF_PREFIX,t=n.filter(m=>m.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(m=>m.substring(e.length))),i=o??[],c=[];for(let m of i)if(m?.userId){let h=mr(m.userId).toString();a.has(h)&&c.push(m)}return c}catch{return[]}}function Jy(r,o,n){try{let e=r?.visibilityConfig?.type==="restricted"?r?.visibilityConfig?.userIds:void 0;return e&&e.length>0?nf(e,n):Wu(o,n)}catch{return[]}}function vo(r,o){try{let n=r??[],e="organizationPrivate:",t=n.filter(i=>i.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(i=>i.substring(e.length)));return(o??[]).filter(i=>i?.id&&a.has(Uv(i.id)))}catch{return[]}}function rf(r){try{let o=r?.privateModeEnabled,n=r?.privateModeType;if(!o||!n)return it.PUBLIC;switch(n){case"organizationPrivate":return it.ORGANIZATION_PRIVATE;case"restricted":{let e=r?.privateModeUserIds;return e&&e.length>0?it.RESTRICTED_SELECTED_PEOPLE:it.RESTRICTED_SELF}default:return it.PUBLIC}}catch{return it.PUBLIC}}function nf(r,o){try{let n=r??[];if(n.length===0)return[];let e=o??[],t=new Set(n),a=e.filter(c=>t.has(c?.userId)),i=new Set(a.map(c=>c.userId));for(let c of n)i.has(c)||a.push({userId:c});return a}catch{return[]}}function Tr(r){try{let n=r?.data?.annotation?.context?.accessFields??[];return n.length>0?tf(n,r?.appState?.user):rf(r?.featureState)}catch{return it.PUBLIC}}function Cn(r,o,n){try{return r&&r.length>0?r:$c(o,n).users}catch{return[]}}function $c(r,o){try{let n=r?.data?.annotation,e=n?.context?.accessFields??[];if(e.length>0){let i=tf(e,r?.appState?.user),c=i===it.RESTRICTED_SELECTED_PEOPLE?Jy(n,e,o):[];return{visibility:i,users:c}}let t=rf(r?.featureState),a=t===it.RESTRICTED_SELECTED_PEOPLE?nf(r?.featureState?.privateModeUserIds,o):[];return{visibility:t,users:a}}catch{return{visibility:it.PUBLIC,users:[]}}}var Hv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,z,$,G,Z,ae,pe){this.commentActionsService=e,this.commentService=t,this.domService=a,this.coreService=i,this.customFilterService=c,this.loggingService=m,this.analyticsService=h,this.commentTextPortalService=_,this.serviceBook=I,this.domSanitizer=S,this.contactService=z,this.authService=$,this.docService=G,this.targetRegistry=Z,this.suggestionActions=ae,this.commonDbService=pe,this.viewsService=null,this.inFlightSubmits=new Set,this.serviceBook.observe(Do).subscribe(Se=>{this.viewsService=Se??null})}isSubmitInFlight(e){return!!e&&this.inFlightSubmits.has(e)}get timestamp(){return this.commonDbService.getServerTimestamp()}deleteComment(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),m=t;t||(m=c.data?.annotation?.comments?.length?c.data?.annotation?.comments[0]:null),this.commentActionsService.deleteComment({annotationId:e,commentId:m?.commentId,skipDeleteThreadConfirmation:a}),m?.commentId&&this.clearEditDraftFromSession(e,m.commentId)}catch(i){this.loggingService.catch("Error in CommentDialogActionService deleteComment:",i)}}changeCommentStatus(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:t.status})}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeCommentStatus:",a)}}changeStatus(e,t){try{this.changeCommentStatus(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeStatus:",a)}}openAllComments(e){try{if(!this.coreService.getContextConfig(e))return;this.commentService.onSidebarButtonOnCommentDialogClick(),this.commentService.setSidebarVisibility(!0),(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR))?.hasAttribute(X.ATTRIBUTES.EMBED_MODE)&&this.commentService.openSidebar()}catch(t){this.loggingService.catch("Error in CommentDialogActionService openAllComments:",t)}}copyLink(e){return Pe(this,null,function*(){try{return this.coreService.getContextConfig(e)?!!(yield this.commentActionsService.copyLink({annotationId:e})):!1}catch(t){return this.loggingService.catch("Error in CommentDialogActionService copyLink:",t),!1}})}approveComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t().data?.annotation&&this.commentActionsService.approveCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService approveComment:",t)}}closeAssignToMenu(e,t){try{let a=t?this.coreService.getLocalUIState(t):void 0;a&&a.update(i=>f(g({},i),{assignToMenuOpened:!1}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService closeAssignToMenu:",a)}}assignCommentToUser(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i().data?.annotation&&(this.commentActionsService.assignUser({annotationId:e,assignedTo:t}),this.closeAssignToMenu(e,a))}catch(i){this.loggingService.catch("Error in CommentDialogActionService assignCommentToUser:",i)}}closeDialog(){try{this.domService.resetSelectedAnnotationsMap()}catch(e){this.loggingService.catch("Error in CommentDialogActionService closeDialog:",e)}}toggleHideReply(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(t.update(c=>(c.uiState.showReplies=!1,c.uiState.collapsedComments=!0,c.uiState.showAllComments=!1,c)),this.coreService.recomputeDerivedProperties(e),i)if(a.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,"sidebarShowReplies");else{let c=i.multiThreadAnnotationId||a.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,void 0,void 0,c)}}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleHideReply:",t)}}toggleFormatToolbar(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{formatToolbarOpen:!a.uiState?.formatToolbarOpen})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleFormatToolbar:",t)}}showReplyComposer(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{showReplyComposer:!0})})),setTimeout(()=>this.focusOnComposerInput(e),100)}catch(t){this.loggingService.catch("Error in CommentDialogActionService showReplyComposer:",t)}}onMoreRepliesClick(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:e,commentType:this.commentService.getCommentType(a.data?.annotation),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),t.update(i=>{let c=!i.uiState.showAllComments;return i.uiState.showAllComments=c,i.uiState.collapsedComments=!c,i})}catch(t){this.loggingService.catch("Error in CommentDialogActionService onMoreRepliesClick:",t)}}navigateToComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return null;let i=t().data?.annotation;return i?(this.commentService.onCommentNavigationButtonClick(i),i):null}catch(t){return this.loggingService.catch("Error in CommentDialogActionService navigateToComment:",t),null}}onInboxModeChange(e,t){try{if(t){let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:!0,collapsedComments:!1})}))}}catch(a){this.loggingService.catch("Error in CommentDialogActionService onInboxModeChange:",a)}}onSignInClick(){try{this.commentService.onSignInClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onSignInClick:",e)}}onUpgradeClick(){try{this.commentService.onUpgradeClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onUpgradeClick:",e)}}resolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: resolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.resolvedStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService resolveComment:",a)}}unresolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: unresolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.defaultStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService unresolveComment:",a)}}toggleShowReplies(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return{openFocusedThread:!1,annotation:null};let i=a(),c=i.data?.annotation;if(c){if(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:c.annotationId,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),i.featureState?.isFocusedThreadEnabled&&i.featureState?.openAnnotationInFocusMode)return{openFocusedThread:!0,annotation:c};if(a.update(m=>{let h=t!==void 0?t:!m.uiState.showReplies;return f(g({},m),{uiState:f(g({},m.uiState),{showReplies:h,collapsedComments:!1,showAllComments:!0,commentDialogSelected:h})})}),this.coreService.recomputeDerivedProperties(e),!i.uiState?.commentPinSelected)if(i.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,"sidebarShowReplies");else{let m=c.multiThreadAnnotationId||i.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,void 0,void 0,m)}}return{openFocusedThread:!1,annotation:null}}catch(a){return this.loggingService.catch("Error in CommentDialogActionService toggleShowReplies:",a),{openFocusedThread:!1,annotation:null}}}acceptCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentTextPortalService.onAcceptComment(i),this.commentActionsService.acceptCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptCommentAnnotation:",t)}}acceptSuggestion(e){return Pe(this,null,function*(){try{this.commentActionsService.acceptSuggestion({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptSuggestion:",t)}})}rejectSuggestion(e,t){return Pe(this,null,function*(){try{this.commentActionsService.rejectSuggestion({annotationId:e,reason:t})}catch(a){this.loggingService.catch("Error in CommentDialogActionService rejectSuggestion:",a)}})}deleteSuggestionThread(e){return Pe(this,null,function*(){try{if(!e)return;yield this.commentActionsService.deleteCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService deleteSuggestionThread:",t)}})}openSuggestionComment(e){try{if(!e)return;this.commentService.scrollToCommentByAnnotationId(e),this.commentService.selectCommentByAnnotationId(e)}catch(t){this.loggingService.catch("Error in CommentDialogActionService openSuggestionComment:",t)}}rejectCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentActionsService.rejectCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService rejectCommentAnnotation:",t)}}deleteAttachment(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;let m=c(),h=i?this.coreService.getLocalUIState(i):void 0,_=h?.()?.editComment,I=null;if(a?I=_?.attachments?.[t]:I=h?.()?.selectedAttachments?.[t],I?.attachmentId){let S=_?m.uiState?.editCommentTextArea?.nativeElement:m.uiState?.newCommentTextArea?.nativeElement;S&&this.removeAttachmentTag(e,I.attachmentId,S,i)}if(a&&h){let S=h()?.editComment;if(S?.attachments){let z=[...S.attachments],$=z.splice(t,1);h.update(G=>f(g({},G),{editComment:f(g({},G.editComment),{attachments:z}),attachmentsToDelete:[...G.attachmentsToDelete||[],...$]}))}}else if(h){let z=h()?.selectedFiles?.[t];if(z?.url)try{URL.revokeObjectURL(z.url)}catch{}h.update($=>{let G=$.selectedFiles?[...$.selectedFiles.slice(0,t),...$.selectedFiles.slice(t+1)]:[],Z=$.selectedAttachments?[...$.selectedAttachments.slice(0,t),...$.selectedAttachments.slice(t+1)]:[];return f(g({},$),{selectedFiles:G,selectedAttachments:Z})})}if(!a){let z=this.coreService.getOrCreateComposerDraft(e)();if(z.selectedFiles?.length||z.selectedAttachments?.length){let $=z.selectedFiles?.[t];if($?.url)try{URL.revokeObjectURL($.url)}catch{}this.coreService.setComposerDraftAttachments(e,{selectedFiles:(z.selectedFiles||[]).filter((G,Z)=>Z!==t),selectedAttachments:(z.selectedAttachments||[]).filter((G,Z)=>Z!==t)}),Vc(h)}}!a&&I&&this.deleteAttachments(e,[I]),this.checkGetAnnotationDraftAttribute(e,i)}catch(c){this.loggingService.catch("Error in CommentDialogActionService deleteAttachment:",c)}}removeInvalidFile(e,t,a){try{let c=this.coreService.getOrCreateComposerDraft(e)(),m=!1;if(c.invalidSelectedFiles?.length&&t>=0&&t<c.invalidSelectedFiles.length){let I=c.invalidSelectedFiles[t];if(I?.url)try{URL.revokeObjectURL(I.url)}catch{}this.coreService.setComposerDraftAttachments(e,{invalidSelectedFiles:c.invalidSelectedFiles.filter((S,z)=>z!==t)}),m=!0}let h=a?this.coreService.getLocalUIState(a):void 0;if(!h)return;let _=h();if(_?.invalidSelectedFiles&&_.invalidSelectedFiles.length>t){let I=[..._.invalidSelectedFiles.slice(0,t),..._.invalidSelectedFiles.slice(t+1)];this.loggingService.log(`Invalid file removed at index ${t} for annotation ${e}. Remaining: ${I.length}`),h.update(S=>f(g({},S),{invalidSelectedFiles:I}))}else m||this.loggingService.catch(`Cannot remove invalid file: Index ${t} out of bounds for annotation ${e}`,new Error("Index out of bounds"))}catch(i){this.loggingService.catch("Error in CommentDialogActionService removeInvalidFile:",i)}}setAssignTo(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>{let c=i.featureState?.assignToType==="checkbox"?!0:i.data?.isAssignedCheckbox;return f(g({},i),{data:f(g({},i.data),{assignTo:t,isAssignedCheckbox:c})})})}catch(a){this.loggingService.catch("Error in CommentDialogActionService setAssignTo:",a)}}toggleAssignToCheckbox(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{data:f(g({},a.data),{isAssignedCheckbox:!a.data?.isAssignedCheckbox})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleAssignToCheckbox:",t)}}onDeleteRecorderAnnotation(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=a?this.coreService.getLocalUIState(a):void 0;c&&c.update(I=>f(g({},I),{localRecordedData:(I.localRecordedData||[]).filter(S=>S.id!==t.annotationId)}));let m=c?.()?.editComment,_=i().data?.annotation;m?.commentId&&_?.annotationId&&this.commentActionsService.deleteRecording({annotationId:_.annotationId,commentId:m.commentId,recorderId:t.annotationId})}catch(i){this.loggingService.catch("Error in CommentDialogActionService onDeleteRecorderAnnotation:",i)}}onRecordedData(e,t,a){try{let i=a?this.coreService.getLocalUIState(a):void 0;i&&(i.update(c=>f(g({},c),{localRecordedData:[...c.localRecordedData||[],t]})),Vc(i)),this.domService.setRecordingInProgress(e,!1),this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService onRecordedData:",i)}}addFiles(e,t,a){return Pe(this,null,function*(){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot add files: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot add files: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_BUTTON_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()});let h=a?this.coreService.getLocalUIState(a):void 0,_=[],I=[];if(t.length)for(let z=0;z<t.length;z++){let $=t[z],G=URL.createObjectURL($),Z=this.domSanitizer.bypassSecurityTrustUrl(G),ae=this.commentActionsService.validateFile($);if(ae.valid){let pe=$?.type,Se={file:$,url:$?.type?.includes("svg")?Z:G,fileType:pe};_.push(Se),h&&h.update(oe=>f(g({},oe),{selectedFiles:[...oe.selectedFiles||[],Se]}))}else{let pe={file:$,url:G,errorMessage:ae?.maxAllowedSizeInMB?`Size > ${ae?.maxAllowedSizeInMB}MB`:"Size > 15MB"};I.push(pe),h&&h.update(Se=>f(g({},Se),{invalidSelectedFiles:[...Se.invalidSelectedFiles||[],pe]})),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_SIZE_EXCEEDED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentSize:$.size,attachmentType:$.type})}}if(i.update(z=>f(g({},z),{uiState:f(g({},z.uiState),{uploadingAttachments:!0})})),Vc(h),this.coreService.isStandaloneComposerOwner(a)){let z=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedFiles:[...z.selectedFiles||[],..._],invalidSelectedFiles:[...z.invalidSelectedFiles||[],...I]})}let S=yield this.uploadFiles(e,a);if(h&&h.update(z=>f(g({},z),{selectedAttachments:[...z.selectedAttachments||[],...S]})),i.update(z=>f(g({},z),{uiState:f(g({},z.uiState),{uploadingAttachments:!1})})),Vc(h),this.coreService.isStandaloneComposerOwner(a)){let z=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedAttachments:[...z.selectedAttachments||[],...S||[]]})}this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService addFiles:",i);let c=this.coreService.getContextConfig(e);c&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{uploadingAttachments:!1})}))}})}uploadFiles(e,t){return Pe(this,null,function*(){try{let a=this.coreService.getContextConfig(e);if(!a)return[];let i=a(),c=i.data?.annotation,m=t?this.coreService.getLocalUIState(t):void 0,h=m?.()?.selectedFiles||[];if(!c||!h.length)return[];let _=[],I=(S,z)=>{m&&m.update($=>f(g({},$),{selectedFiles:$.selectedFiles?.map((G,Z)=>Z===S?g(g({},G),z):G)}))};for(let S=0;S<h.length;S++){let z=h[S];if(!z.uploaded&&!z.uploading){I(S,{uploading:!0});let $=z.file;try{let[G]=yield this.commentActionsService.addAttachment({annotationId:c.annotationId,files:[$]},"internal"),Z=G?.attachment;if(Z){this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_ADDED,{annotationId:c.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:Z.attachmentId,attachmentSize:Z.size,attachmentType:Z.type}),_.push(Z);let ae=a(),pe=ae.uiState?.editCommentTextArea?.nativeElement||ae.uiState?.newCommentTextArea?.nativeElement;pe&&ae.uiState?.attachmentNameInMessage&&setTimeout(()=>{this.focusOnComposerInput(e,!0),this.insertAttachmentTag(e,pe,Z,t)},100)}I(S,{uploaded:!0,uploading:!1})}catch(G){this.loggingService.catch("Error uploading individual file:",G),I(S,{uploading:!1})}}}return _}catch(a){return this.loggingService.catch("Error in CommentDialogActionService uploadFiles:",a),[]}})}startRecording(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot start recording: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot start recording: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_RECORDING_TOOL_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),recorderType:t});let h=m?.metadata?.clientDocumentId,_=c.uiState?.commentDialogUniqueId,I=c.uiState?.darkMode,S=c.uiState?.dialogShadowDOM;this.serviceBook.get(ln)?.initRecording(t,a??_,!0,I,S,m.annotationId,h),setTimeout(()=>{this.checkGetAnnotationDraftAttribute(e,a)},100)}catch(i){this.loggingService.catch("Error in CommentDialogActionService startRecording:",i)}}checkGetAnnotationDraftAttribute(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),m=(t?this.coreService.getLocalUIState(t):void 0)?.(),h=m?.composerContent,_=h&&h!==`
2
2
  `&&h.trim()!=="",I=m?.selectedAttachments,S=m?.localRecordedData,z=i.uiState?.recorderInitConfig,G=!!(_||I?.length||S?.length||z&&(z?.panelId===t||z?.commentAnnotationId===e))?e:null;i.uiState?.getAnnotationDraftAttribute!==G&&a.update(Z=>f(g({},Z),{uiState:f(g({},Z.uiState),{getAnnotationDraftAttribute:G})}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService checkGetAnnotationDraftAttribute:",a)}}saveDraftComment(e,t){return Pe(this,null,function*(){try{let a=this.commentService.getDraftMode(),i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),h=(t?this.coreService.getLocalUIState(t):void 0)?.(),_=!!h?.editComment,I=!!c.uiState?.getAnnotationDraftAttribute,S=h?.composerContent,z=!!(S&&S!==`
3
3
  `&&S.trim()||h?.selectedAttachments?.length||h?.localRecordedData?.length);a&&!_&&(I||z)&&(yield this.addComment(e,!0,t))}catch(a){this.loggingService.catch("Error in CommentDialogActionService saveDraftComment:",a)}})}saveEditDraftToSession(e,t){try{if(!t)return;let i=this.coreService.getLocalUIState(t)?.(),c=i?.editComment,m=c?.commentId;if(!c||!m)return;let h=i?.composerContent??"",_=i?.composerContentHTML??"",z=this.coreService.getContextConfig(e)?.()?.uiState?.editCommentTextArea?.nativeElement?.innerHTML??_,$=c.commentText??"",G=c.commentHtml??"";if(!(h!==$||z!==G)){this.clearEditDraftFromSession(e,m);return}this.coreService.setEditDraft(e,m,{composerContent:h,composerContentHTML:z})}catch(a){this.loggingService.catch("Error in CommentDialogActionService saveEditDraftToSession:",a)}}restoreEditDraftFromSession(e,t){try{return this.coreService.getEditDraft(e,t)}catch(a){return this.loggingService.catch("Error in CommentDialogActionService restoreEditDraftFromSession:",a),null}}clearEditDraftFromSession(e,t){try{this.coreService.clearEditDraft(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService clearEditDraftFromSession:",a)}}buildDraftCommentSnapshot(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return null;let i=a(),m=(t?this.coreService.getLocalUIState(t):void 0)?.(),h=(m?.composerContent??"").trim(),_=m?.composerContentHTML??"",I=m?.editComment,S=i.uiState?.editCommentTextArea?.nativeElement,z=i.uiState?.newCommentTextArea?.nativeElement,$=I?S:z;$&&(_=$.innerHTML);let G=m?.selectedAttachments?m.selectedAttachments.slice():[],Z=m?.localRecordedData?m.localRecordedData.slice():[],ae=new qn;return I?(Object.assign(ae,I),ae.attachments=[...I.attachments||[],...G],ae.recorders=[...I.recorders||[],...Z]):(ae.from=i.appState?.user??this.authService.getUser(),ae.createdAt=new Date,ae.attachments=G,ae.recorders=Z),ae.commentText=h,ae.commentHtml=_,ae.isDraft=!0,ae.lastUpdated=new Date,ae}catch(a){return this.loggingService.catch("Error in CommentDialogActionService buildDraftCommentSnapshot:",a),null}}addComment(e,t=!1,a){return Pe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addComment","color: green;");let i=!t&&!!a;i&&this.inFlightSubmits.add(a);try{let c=this.coreService.getContextConfig(e);if(!c){this.loggingService.catch(`Cannot add comment: No config found for annotation ${e}`,new Error("Config not found"));return}let m=c(),h=m.data?.annotation,_=a?this.coreService.getLocalUIState(a):void 0,I=_?.(),S=I?.selectedVisibility,z=I?.selectedVisibilityUsers,$=null;if(S&&S!=="public")try{switch(S){case it.RESTRICTED_SELF:let oe=this.authService.getUser();oe?.userId&&($={type:"restricted",userIds:[oe.userId]});break;case it.RESTRICTED_SELECTED_PEOPLE:{let he=(h?.visibilityConfig?.type==="restricted"?h?.visibilityConfig?.userIds??[]:[]).filter(Ue=>!!Ue);if(he.length){$={type:"restricted",userIds:Array.from(new Set(he))};break}let _e=h?.context?.accessFields??[],Re=X.VISIBILITY_SELF_PREFIX,Ye=_e.filter(Ue=>typeof Ue=="string"&&Ue.startsWith(Re)).length,lt=Wu(_e,this.contactService.getInternalUserContacts()).map(Ue=>Ue.userId).filter(Ue=>!!Ue);if(Ye>0&&lt.length===Ye){$={type:"restricted",userIds:lt};break}let Xe=(z??[]).map(Ue=>Ue.userId).filter(Ue=>!!Ue),Ve=this.commentService.getPrivateModeConfig(),ht=Ve?.type==="restricted"?(Ve.userIds??[]).filter(Ue=>!!Ue):[],Ze=Array.from(new Set([...Xe,...ht]));if(Ze.length){$={type:"restricted",userIds:Ze};break}let Tt=this.authService.getUser();Tt?.userId&&($={type:"restricted",userIds:[Tt.userId]});break}case it.ORGANIZATION_PRIVATE:{let he=h?.context?.accessFields??[],_e=he.filter(Xe=>typeof Xe=="string"&&Xe.startsWith("organizationPrivate:")).length,Re=vo(he,this.contactService.getOrgList()).map(Xe=>Xe.id).filter(Boolean);if(_e>0&&Re.length===_e){$={type:"organizationPrivate",organizationIds:Re};break}let Ye=this.commentService.getPrivateModeConfig();if(Ye?.type==="organizationPrivate"&&(Ye.organizationIds?.length||Ye.organizationId)){$=g(g({type:"organizationPrivate"},Ye.organizationIds?.length&&{organizationIds:Ye.organizationIds}),Ye.organizationId&&{organizationId:Ye.organizationId});break}let lt=this.authService.getUser()?.clientOrganizationId;lt&&($={type:"organizationPrivate",organizationId:lt});break}}if($?.type==="restricted"){let oe=this.authService.getUser();oe?.userId&&($=Mn($,oe.userId))}}catch(oe){this.loggingService.catch("Error converting visibility config:",oe)}let G=I?.composerContent,Z=I?.composerContentHTML,ae=I?.selectedAttachments||[],pe=I?.localRecordedData||[],Se=m.uiState?.newCommentTextArea?.nativeElement;if(Se?.innerHTML&&(Z=Se.innerHTML),!h){this.loggingService.catch(`Cannot add comment: No annotation found for ${e}`,new Error("Annotation not found"));return}if(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SUBMIT_TRIGGERED,{annotationId:h.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(h),uiLocation:m.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),triggerType:"submitButton"}),G?.trim()||ae?.length||pe?.length){let oe=new qn;oe.attachments=ae,oe.recorders=pe?pe.slice():[],oe.commentText=G?.trim()||"";let he=this.domService.trimCommentHtml(Z||"");he=this.highlightLinks(he),he=this.highlightAtHere(he,m.uiState?.atHereLabel),oe.commentHtml=he,oe.lastUpdated=new Date,oe.createdAt=new Date,oe.from=m.appState?.user??this.authService.getUser(),oe.customList=m.data?.customList||[],oe.toOrganizationUserGroup=m.data?.toOrganizationUserGroup||[],oe.taggedUserContacts=m.data?.taggedUserContacts?.slice()||[],oe.isDraft=t,this.addToEmailsToComment(e,oe,a),h.status?.type==="terminal"&&c.update(Ze=>f(g({},Ze),{data:f(g({},Ze.data),{annotation:f(g({},Ze.data.annotation),{status:this.customFilterService.defaultStatus})})}));let _e=of(m.data?.assignTo,m.featureState?.assignToType,m.data?.isAssignedCheckbox),Re=_e;_e&&(c.update(Ze=>f(g({},Ze),{data:f(g({},Ze.data),{annotation:f(g({},Ze.data.annotation),{assignedTo:Ze.data?.assignTo})})})),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ASSIGNED,{annotationId:h.annotationId,commentThreadId:oe?.commentId,commentType:this.commentService.getCommentType(h),uiLocation:m.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}));let Ye=c().data?.annotation,lt=f(g({},Ye),{comments:[...Ye?.comments||[],oe]});this.commentActionsService.onCommentSaveTriggered(h.annotationId,lt);let Xe=this.coreService.isTempAnnotationId(h.annotationId),Ve=I?.inlineCommentSectionMode??m.featureState?.inlineCommentSectionMode;if(Ky(Ve,h.annotationId,Xe)){let Ze=Ye;if($)try{let Ue=this.authService.getUser()?.userId,Lt=An($,Ue);Ze=f(g({},Ye),{context:f(g({},Ye?.context),{_setAccessFields:Lt}),visibilityConfig:Pn($,Ue)})}catch(Ue){this.loggingService.catch("Error building accessFields from visibility:",Ue)}let Tt={annotation:Ze,updatedComment:oe,type:Ze?.comments?.length?Ke.ADDED:Ke.NEWLY_ADDED};c.update(Ue=>f(g({},Ue),{uiState:f(g({},Ue.uiState),{pendingSaveComment:Tt})}))}else this.commentActionsService.addComment({annotationId:h.annotationId,comment:oe,assignedTo:Ye?.assignedTo,assigned:Re,visibility:$??void 0});if(c.update(Ze=>f(g({},Ze),{uiState:f(g({},Ze.uiState),{showCommentButtons:!1,getAnnotationDraftAttribute:null,formatToolbarOpen:!1}),data:f(g({},Ze.data),{customList:[],toOrganizationUserGroup:[],taggedUserContacts:[],selectedUserContacts:[]})})),_&&_.update(Ze=>f(g({},Ze),{composerContent:"",composerContentHTML:"",composerInOpenState:!1,selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[]})),!t){let Ze=this.coreService.getOrCreateComposerDraft(e)();Kg(Ze)||this.coreService.clearComposerDraft(e)}let ht=c();ht.uiState?.newCommentTextArea?.nativeElement&&(ht.uiState.newCommentTextArea.nativeElement.innerText=""),this.scrollToBottom(e)}}catch(c){this.loggingService.catch("Error in CommentDialogActionService addComment:",c)}finally{try{i&&this.inFlightSubmits.delete(a)}catch(c){this.loggingService.catch("Error in CommentDialogActionService addComment:",c)}}})}updateComment(e,t,a){return Pe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot update comment: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation,h=a?this.coreService.getLocalUIState(a):void 0,_=h?.(),I=_?.editComment,S=_?.composerContentHTML,z=_?.composerContent,$=c.uiState?.editCommentTextArea?.nativeElement;if($?.innerHTML&&(S=$.innerHTML),!m||!I){this.loggingService.catch(`Cannot update comment: Missing annotation or editComment for ${e}`,new Error("Missing data"));return}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_SUBMIT_TRIGGERED,{annotationId:m.annotationId,commentThreadId:I.commentId,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),triggerType:"submitButton"});let G=g({},I);G.isDraft&&(G.isDraft=!1),G.commentText=z||"",G.lastUpdated=new Date;let Z=this.domService.trimCommentHtml(S||"");Z=this.highlightLinks(Z),Z=this.highlightAtHere(Z,c.uiState?.atHereLabel),G.commentHtml=Z;let ae=_?.selectedAttachments||[];ae.length&&(G.attachments||(G.attachments=[]),G.attachments=[...G.attachments,...ae]);let pe=_?.localRecordedData||[];pe.length&&(G.recorders||(G.recorders=[]),G.recorders.push(...pe)),c.data?.customList?.length&&(G.customList||(G.customList=[]),G.customList=[...G.customList,...c.data.customList]),c.data?.toOrganizationUserGroup?.length&&(G.toOrganizationUserGroup||(G.toOrganizationUserGroup=[]),G.toOrganizationUserGroup=[...G.toOrganizationUserGroup,...c.data.toOrganizationUserGroup]),c.data?.taggedUserContacts?.length&&(G.taggedUserContacts=c.data.taggedUserContacts||[]),this.addToEmailsToComment(e,G,a),m.status?.type==="terminal"&&i.update(lt=>f(g({},lt),{data:f(g({},lt.data),{annotation:f(g({},lt.data.annotation),{status:this.customFilterService.defaultStatus})})}));let Se=c.data?.assignTo,oe=of(Se,c.featureState?.assignToType,c.data?.isAssignedCheckbox);oe&&(i.update(lt=>f(g({},lt),{data:f(g({},lt.data),{annotation:f(g({},lt.data.annotation),{assignedTo:lt.data?.assignTo})})})),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ASSIGNED,{annotationId:m.annotationId,commentThreadId:G.commentId,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}));let he=i().data?.annotation,_e=f(g({},he),{comments:(he?.comments||[]).map(lt=>lt.commentId===G.commentId?G:lt)});this.commentActionsService.onCommentSaveTriggered(m.annotationId,_e),this.commentActionsService.updateComment({annotationId:m.annotationId,comment:G}),G.commentId&&this.clearEditDraftFromSession(m.annotationId,G.commentId),oe&&Se&&this.commentActionsService.assignUser({annotationId:m.annotationId,assignedTo:Se});let Re=_?.attachmentsToDelete||[];Re.length&&this.deleteAttachments(e,Re),h&&h.update(lt=>f(g({},lt),{editComment:null,editCommentIndex:null,composerContent:"",composerContentHTML:"",composerInOpenState:!1,selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[]})),i.update(lt=>f(g({},lt),{uiState:f(g({},lt.uiState),{getAnnotationDraftAttribute:null,formatToolbarOpen:!1}),data:f(g({},lt.data),{customList:[],toOrganizationUserGroup:[],taggedUserContacts:[],selectedUserContacts:[]})}));let Ye=i();Ye.uiState?.editCommentTextArea?.nativeElement&&(Ye.uiState.editCommentTextArea.nativeElement.innerText="")}catch(i){this.loggingService.catch("Error in CommentDialogActionService updateComment:",i)}})}deleteAnnotation(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: deleteAnnotation","color: green;");try{if(["keydownBackspace","keydownDelete","keyupBackspace","keyupDelete"].includes(t)&&!this.commentService.getDeleteOnBackspace())return;this.commentService.deleteCommentPinAnnotations(t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService deleteAnnotation:",a)}}cancelEdit(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: cancelEdit","color: green;");try{if(t){let i=this.coreService.getLocalUIState(t);i&&i.update(c=>f(g({},c),{editComment:null,editCommentIndex:null,composerContent:"",composerContentHTML:"",composerInOpenState:!1,selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],attachmentsToDelete:[],localRecordedData:[]}))}let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>{let c=f(g({},i),{data:f(g({},i.data),{taggedUserContacts:[],toOrganizationUserGroup:[],customList:[],assignTo:void 0,selectedUserContacts:[]}),uiState:f(g({},i.uiState),{getAnnotationDraftAttribute:null,formatToolbarOpen:!1})});return i.uiState?.editCommentTextArea?.nativeElement&&(i.uiState.editCommentTextArea.nativeElement.innerText=""),c})}catch(a){this.loggingService.catch("Error in CommentDialogActionService cancelEdit:",a)}}onAtClick(e,t,a){this.loggingService.log("%c[WB] Calling FUNCTION: onAtClick","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot handle onAtClick: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot handle onAtClick: No annotation found for ${e}`,new Error("Annotation not found"));return}let h=Yy(t,c.uiState),_=a?this.coreService.getLocalUIState(a):void 0;_&&h&&_.update(I=>f(g({},I),{composerContent:h.innerText,composerContentHTML:this.domService.sanitizeHtml(h.innerHTML)})),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_TAG_BUTTON_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()})}catch(i){this.loggingService.catch("Error in CommentDialogActionService onAtClick:",i)}}onAttachmentButtonClick(e){try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch(`Cannot handle onAttachmentButtonClick: No config found for annotation ${e}`,new Error("Config not found"));return}let a=t(),i=a.data?.annotation;if(!i){this.loggingService.catch(`Cannot handle onAttachmentButtonClick: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_BUTTON_CLICKED,{annotationId:i.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()})}catch(t){this.loggingService.catch("Error in CommentDialogActionService onAttachmentButtonClick:",t)}}userContactSelected(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;c().data?.taggedUserContacts||c.update($=>f(g({},$),{data:f(g({},$.data),{taggedUserContacts:[]})}));let h=!t?.contact?.userId,_=c()?.featureState?.anonymousEmail??this.commentService.getEnableAnonymousEmail();if(!(t?.isEmailValid===!1)&&(!h||_)&&((c().data?.taggedUserContacts||[]).find(G=>G.text===t.text)||(t?.contact?.email&&(t.contact.email=t.contact.email.replace(/[^a-zA-Z0-9]+$/,"")),c.update(G=>f(g({},G),{data:f(g({},G.data),{taggedUserContacts:[...G.data?.taggedUserContacts||[],t]})})))),a){let $=i?this.coreService.getLocalUIState(i):void 0;$&&$.update(G=>f(g({},G),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}let z=(i?this.coreService.getLocalUIState(i):void 0)?.()?.composerContent||"";this.extractContacts(e,z)}catch(c){this.loggingService.catch("Error in CommentDialogActionService userContactSelected:",c)}}customOptionSelected(e,t,a,i){try{if(!a)return;let c=i?this.coreService.getLocalUIState(i):void 0;c&&c.update(m=>f(g({},m),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}catch(c){this.loggingService.catch("Error in CommentDialogActionService customOptionSelected:",c)}}groupSelected(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;if(c().data?.taggedGroups||c.update(_=>f(g({},_),{data:f(g({},_.data),{taggedGroups:[]})})),(c().data?.taggedGroups||[]).find(_=>_.text===t.text)||c.update(_=>f(g({},_),{data:f(g({},_.data),{taggedGroups:[..._.data?.taggedGroups||[],t]})})),a){let _=i?this.coreService.getLocalUIState(i):void 0;_&&_.update(I=>f(g({},I),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}}catch(c){this.loggingService.catch("Error in CommentDialogActionService groupSelected:",c)}}atHereSelected(e,t,a,i){try{if(!a)return;let c=i?this.coreService.getLocalUIState(i):void 0;c&&c.update(m=>f(g({},m),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}catch(c){this.loggingService.catch("Error in CommentDialogActionService atHereSelected:",c)}}addSpaceAndPositionCursor(e){try{let t=e.querySelectorAll("span[data-recently-added]"),a=null,i=0;for(let m=0;m<t.length;m++){let h=t[m],_=h.getAttribute("data-recently-added");if(_){let I=parseInt(_.split("_")[0]);I>i&&(i=I,a=h)}}if(a){let m=a.getAttribute("data-recently-added"),h=e.innerHTML,_=a.outerHTML,I=h.indexOf(_);if(I!==-1){let S=h.substring(0,I),z=h.substring(I+_.length);e.innerHTML=S+_+"&nbsp;"+z;let $=e.querySelector(`span[data-recently-added="${m}"]`);if($&&$.removeAttribute("data-recently-added"),e.focus(),$&&$.nextSibling){let G=document.createRange();G.setStart($.nextSibling,1),G.collapse(!0);let Z=window.getSelection();Z?.removeAllRanges(),Z?.addRange(G)}return}}e.focus();let c=window.getSelection();if(c&&c.rangeCount>0){let m=c.getRangeAt(0),h=document.createTextNode(" ");m.insertNode(h),m.setStartAfter(h),m.collapse(!0),c.removeAllRanges(),c.addRange(m)}else e.innerHTML=e.innerHTML+" ",setTimeout(()=>{try{let m=document.createRange();m.selectNodeContents(e),m.collapse(!1);let h=window.getSelection();h?.removeAllRanges(),h?.addRange(m)}catch(m){this.loggingService.catch("Error positioning cursor at end:",m)}},0)}catch(t){this.loggingService.catch("Error in addSpaceAndPositionCursor:",t)}}enterEditMode(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;let m=c(),h=structuredClone(a),_=h?.commentId?this.restoreEditDraftFromSession(e,h.commentId):null,I=_?.composerContent??h?.commentText??"",S=_?.composerContentHTML??h?.commentHtml??"",z=i?this.coreService.getLocalUIState(i):void 0;z&&z.update($=>f(g({},$),{editComment:h,editCommentIndex:t,composerContent:I,composerContentHTML:S,composerInOpenState:!0})),c.update($=>f(g({},$),{data:f(g({},$.data),{taggedUserContacts:h?.taggedUserContacts||[]})})),this.extractContacts(e,h?.commentText||""),this.emailChipMigration(e,h?.commentHtml||""),setTimeout(()=>{let $=c();if($?.uiState?.editCommentTextArea?.nativeElement){let G=$.uiState.editCommentTextArea.nativeElement.closest(".velt-comment-dialog-composer");G&&G.scrollIntoView({behavior:"smooth",block:"nearest"}),$.uiState.editCommentTextArea.nativeElement.innerHTML=this.domService.sanitizeHtml(S),this.setCursorToEnd($.uiState.editCommentTextArea.nativeElement)}},300),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_EDIT_BUTTON_CLICKED,{annotationId:e,commentThreadId:a?.commentId,commentType:this.commentService.getCommentType(m.data?.annotation),uiLocation:m.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),setTimeout(()=>{this.checkGetAnnotationDraftAttribute(e,i)},100)}catch(c){this.loggingService.catch("Error in enterEditMode:",c)}}setCursorToEnd(e){try{if(!e||!e.isConnected)return;let t=document.createRange(),a=window.getSelection();t.selectNodeContents(e),t.collapse(!1),a?.removeAllRanges(),a?.addRange(t),e.focus()}catch(t){this.loggingService.catch("Error in setCursorToEnd:",t)}}findParentSpan(e){try{return e.parentNode&&e.parentNode.nodeName==="SPAN"?e.parentNode:null}catch(t){return this.loggingService.catch("Error in findParentSpan:",t),null}}isCursorInsideSpan(e,t){try{let a=e.textContent||"",i=t.startOffset;return i>=0&&i<=a.length}catch(a){return this.loggingService.catch("Error in isCursorInsideSpan:",a),!1}}getOffsetInsideContainer(e){try{let t=0,a=e.previousSibling;for(;a;)a.nodeType===Node.TEXT_NODE?t+=a.textContent?.length||0:a.nodeType===Node.ELEMENT_NODE&&(t+=a.innerText.length),a=a.previousSibling;return t}catch(t){return this.loggingService.catch("Error in getOffsetInsideContainer:",t),0}}setCursorPositionAfterSpan(e,t){try{let a=window.getSelection(),i=document.createRange();if(e&&a){let c=e.length,m=Math.min(t+c,c);i.setStart(e,m),i.setEnd(e,m),a.removeAllRanges(),a.addRange(i)}}catch(a){this.loggingService.catch("Error in setCursorPositionAfterSpan:",a)}}moveCursorToEnd(e){try{if(!e?.isConnected)return;e.focus(),setTimeout(()=>{let t=document.createRange(),a=window.getSelection();t.selectNodeContents(e),t.collapse(!1),a?.removeAllRanges(),a?.addRange(t),setTimeout(()=>{this.autoScrollToBottom(e)},50)},0)}catch(t){this.loggingService.catch("Error in moveCursorToEnd:",t)}}autoScrollToBottom(e){try{if(e&&e.isConnected){let t=e.closest(".velt-composer-input");t&&(t.scrollTop=t.scrollHeight)}}catch(t){this.loggingService.catch("Error in autoScrollToBottom:",t)}}handleBackspaceOnMentionSpan(e){try{if(e.inputType!=="deleteContentBackward"&&e.inputType!=="deleteContentForward")return!1;let t=window.getSelection(),a=t?.getRangeAt(0),i=t?.anchorNode;if(i&&a){let c=this.findParentSpan(i),m=c?.parentNode;if(c&&this.isCursorInsideSpan(c,a)){e.preventDefault();let h=this.getOffsetInsideContainer(c),_=c.textContent,I=document.createTextNode(_||"");return c.replaceWith(I),this.setCursorPositionAfterSpan(I,h),m?.normalize(),!0}}return!1}catch(t){return this.loggingService.catch("Error in handleBackspaceOnMentionSpan:",t),!1}}focusOnComposerInput(e,t=!1){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),c=i?.data?.annotation,m=i?.featureState?.sidebarMode,h=i?.uiState?.containerComponentId;this.commentActionsService.onComposerClick({commentAnnotation:c});let _=mb(),I=i?.uiState?.newCommentTextArea?.nativeElement,S=i?.uiState?.editCommentTextArea?.nativeElement;I&&(I.contains(_)||this.moveCursorToEnd(I)),S&&(S.contains(_)||this.moveCursorToEnd(S))}catch(a){this.loggingService.catch("Error in focusOnComposerInput:",a)}}exitEditMode(e,t){try{if(t){let i=this.coreService.getLocalUIState(t);i&&i.update(c=>f(g({},c),{editComment:null,editCommentIndex:null}))}let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>f(g({},i),{data:f(g({},i.data),{selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],attachmentsToDelete:[],taggedUserContacts:[],toOrganizationUserGroup:[],customList:[],assignTo:void 0,selectedUserContacts:[]})}))}catch(a){this.loggingService.catch("Error in exitEditMode:",a)}}deleteCommentAttachment(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),m=c.data?.annotation?.comments;if(!m||t<0||t>=m.length){this.loggingService.catch("Invalid comment index for deleteAttachment",new Error(`Index: ${t}`));return}let h=m[t],_=h?.attachments;if(!_||a<0||a>=_.length){this.loggingService.catch("Invalid attachment index for deleteAttachment",new Error(`Index: ${a}`));return}let I=_[a];this.commentActionsService.deleteAttachment({annotationId:e,commentId:h.commentId,attachmentId:I.attachmentId}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_DELETED,{annotationId:e,commentThreadId:h?.commentId,commentType:this.commentService.getCommentType(c.data?.annotation),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:I.attachmentId,attachmentSize:I.size,attachmentType:I.type})}catch(i){this.loggingService.catch("Error in deleteAttachment:",i)}}deleteAttachments(e,t){return Pe(this,null,function*(){try{if(!t?.length)return;let a=this.coreService.getContextConfig(e);if(!a)return;let i=a();for(let c=0;c<t.length;c++){let m=t[c];yield this.commentService.deleteAttachment({attachment:m}),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_DELETED,{annotationId:e,commentThreadId:void 0,commentType:this.commentService.getCommentType(i.data?.annotation),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:m.attachmentId,attachmentSize:m.size,attachmentType:m.type})}}catch(a){this.loggingService.catch("Error in deleteAttachments:",a)}})}insertAttachmentTag(e,t,a,i){try{if(!this.coreService.getContextConfig(e))return;let m=null;try{if(t.getRootNode()instanceof ShadowRoot){let z=t.getRootNode();z.getSelection&&(m=z.getSelection())}}catch{}if(m=m||window.getSelection(),!m||!m.rangeCount)return;let h=m.getRangeAt(0),_=document.createElement("a");_.contentEditable="false",_.classList.add("velt-attachment-tag"),_.setAttribute("data-attachment-id",a.attachmentId.toString()),_.textContent=a.name||"",_.href=a.url||"#",_.target="_blank",_.rel="noopener noreferrer",_.addEventListener("click",z=>{z.preventDefault(),a.url&&window.open(a.url,"_blank")});let I=document.createTextNode("\xA0");h.insertNode(I),h.insertNode(_),h.collapse(!1);let S=i?this.coreService.getLocalUIState(i):void 0;S&&S.update(z=>f(g({},z),{composerContent:t.innerText,composerContentHTML:this.domService.sanitizeHtml(t.innerHTML)}))}catch(c){this.loggingService.catch("Error in insertAttachmentTag:",c)}}removeAttachmentTag(e,t,a,i){try{a.querySelectorAll(`a.velt-attachment-tag[data-attachment-id="${t}"]`).forEach(h=>{h.remove()});let m=i?this.coreService.getLocalUIState(i):void 0;m&&m.update(h=>f(g({},h),{composerContent:a.innerText,composerContentHTML:this.domService.sanitizeHtml(a.innerHTML)}))}catch(c){this.loggingService.catch("Error in removeAttachmentTag:",c)}}downloadAttachment(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a();i.featureState?.enableAttachmentDownload!==!1&&this.commentService.downloadAttachment(t),i.data?.annotation&&this.commentActionsService.onAttachmentDownloadClick(i.data.annotation,t),this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_DOWNLOADED,{annotationId:e,commentThreadId:void 0,commentType:this.commentService.getCommentType(i.data?.annotation),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:t.attachmentId,attachmentSize:t.size,attachmentType:t.type})}catch(a){this.loggingService.catch("Error in downloadAttachment:",a)}}scrollToBottom(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();a?.scrollToBottom&&a.scrollToBottom.emit()}catch(t){this.loggingService.catch("Error in scrollToBottom:",t)}}updateCommentReaction(e,t,a){this.loggingService.log("%c[WB] Calling FUNCTION: updateCommentReaction","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i();if(c.uiState?.readOnly||c.uiState?.disabled)return;this.commentActionsService.toggleReaction({annotationId:e,commentId:a?.commentId,reaction:{reactionId:t}})}catch(i){this.loggingService.catch("Error in updateCommentReaction:",i)}}reactionToolOpen(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{reactionToolOpenIndex:a?t:-1})}))}catch(i){this.loggingService.catch("Error in reactionToolOpen:",i)}}threadCardDropdownOpen(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{openDropdownIndexValue:a?t:-1})}))}catch(i){this.loggingService.catch("Error in optionsDropdownOpen:",i)}}changeCommentPriority(e,t){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("changeCommentPriority: Config not found for annotation",null,{annotationId:e});return}if(!a()?.data?.annotation){this.loggingService.catch("changeCommentPriority: Annotation not found",null,{annotationId:e});return}this.commentActionsService.updatePriority({annotationId:e,priority:t.priority})}catch(a){this.loggingService.catch("Error in changeCommentPriority:",a,{annotationId:e})}}changePriorityLocally(e,t){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("changePriorityLocally: Config not found for annotation",null,{annotationId:e});return}let c=a()?.data?.annotation?.priority,m=t.priority;m!==void 0&&m?.id===c?.id&&(m=void 0),a.update(h=>f(g({},h),{data:f(g({},h.data),{annotation:f(g({},h.data?.annotation),{priority:m})})})),this.coreService.updateComputedProperties(a)}catch(a){this.loggingService.catch("Error in changePriorityLocally:",a,{annotationId:e})}}editComment(e,t=0,a){try{let i=this.coreService.getContextConfig(e);if(!i)return this.loggingService.catch("editComment: Config not found",null,{annotationId:e}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t};let c=i(),m=c?.data?.annotation,h=m?.comments;if(!h||!Array.isArray(h)||h.length===0)return this.loggingService.catch("editComment: No comments found",null,{annotationId:e}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t};let _=h[t];return _?c.featureState?.isFocusedThreadEnabled&&c.featureState?.openAnnotationInFocusMode&&m?{openFocusedThreadWithEditMode:!0,annotation:m,editCommentIndex:t}:(!this.domService.getSelectedAnnotationsMap()[e]&&m&&this.domService.toggleAnnotationSelection(m,c?.uiState?.containerComponentId),this.enterEditMode(e,t,_,a),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t}):(this.loggingService.catch("editComment: Comment not found at index",null,{annotationId:e,commentIndex:t}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t})}catch(i){return this.loggingService.catch("Error in editComment:",i,{annotationId:e,commentIndex:t}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t}}}toggleNotificationSubscription(e){try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch("toggleNotificationSubscription: Config not found",null,{annotationId:e});return}if(!t()?.data?.annotation){this.loggingService.catch("toggleNotificationSubscription: Annotation not found",null,{annotationId:e});return}this.commentActionsService.toggleNotificationSubscription({annotationId:e})}catch(t){this.loggingService.catch("Error in toggleNotificationSubscription:",t,{annotationId:e})}}openAssignToMenu(e,t){try{let a=t?this.coreService.getLocalUIState(t):void 0;a&&a.update(i=>f(g({},i),{assignToMenuOpened:!0}))}catch(a){this.loggingService.catch("Error in openAssignToMenu:",a,{annotationId:e})}}changeCommentAccessMode(e,t){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("changeCommentAccessMode: Config not found",null,{annotationId:e});return}if(!a()?.data?.annotation){this.loggingService.catch("changeCommentAccessMode: Annotation not found",null,{annotationId:e});return}a.update(m=>f(g({},m),{data:f(g({},m.data),{annotation:f(g({},m.data?.annotation),{iam:f(g({},m.data?.annotation?.iam),{accessMode:t})})})})),this.coreService.updateComputedProperties(a),this.commentActionsService.updateAccess({annotationId:e,accessMode:t})}catch(a){this.loggingService.catch("Error in changeCommentAccessMode:",a,{annotationId:e})}}toggleCustomChip(e,t){return Pe(this,null,function*(){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("toggleCustomChip: Config not found",null,{annotationId:e});return}let i=a(),c=i?.data?.annotation,m=i?.data?.customChipData;if(!c){this.loggingService.catch("toggleCustomChip: Annotation not found",null,{annotationId:e});return}if(!m){this.loggingService.catch("toggleCustomChip: CustomChipData not configured",null,{annotationId:e});return}if(!t||!t.id){this.loggingService.catch("toggleCustomChip: Invalid item",null,{annotationId:e,item:t});return}let h=c.customList||[],_=new Set(h.map($=>$.id)),I=h.find($=>$.id===t.id),S=[];m.type==="single"?I?S=[]:S=[t]:I?S=h.filter($=>$.id!==t.id):S=[...h,t];let z=new Set(S.map($=>$.id));if(a.update($=>f(g({},$),{data:f(g({},$.data),{annotation:f(g({},$.data.annotation),{customList:S}),selectedCustomChipSet:z})})),c.annotationId)try{let $=f(g({},c),{customList:S});yield this.commentService.saveComment($,{type:Ke.CUSTOM_LIST_CHANGED,annotation:$,updatedComment:null,oldCustomList:h,newCustomList:S})}catch($){this.loggingService.catch("Error saving custom list:",$,{annotationId:e}),a.update(G=>f(g({},G),{data:f(g({},G.data),{annotation:f(g({},G.data.annotation),{customList:h}),selectedCustomChipSet:_})}))}}catch(a){this.loggingService.catch("Error in toggleCustomChip:",a,{annotationId:e,item:t})}})}markAsRead(e){this.loggingService.log("%c[WB] Calling FUNCTION: markAsRead","color: green;");try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch("markAsRead: Config not found",null,{annotationId:e});return}let a=t();if(!a?.appState?.isKnownUser||a?.appState?.user?.isGuest){this.loggingService.log("markAsRead: User is not known or is guest, skipping");return}let i=a?.data?.annotation;if(!i){this.loggingService.catch("markAsRead: Annotation not found",null,{annotationId:e});return}this.viewsService?.setCommentAnnotationAsRead(i);let c=structuredClone(i);t.update(m=>f(g({},m),{data:f(g({},m.data),{annotation:c})})),this.coreService.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in markAsRead:",t,{annotationId:e})}}markAsUnread(e){this.loggingService.log("%c[WB] Calling FUNCTION: markAsUnread","color: green;");try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch("markAsUnread: Config not found",null,{annotationId:e});return}let a=t();if(!a?.appState?.isKnownUser||a?.appState?.user?.isGuest){this.loggingService.log("markAsUnread: User is not known or is guest, skipping");return}let i=a?.data?.annotation;if(!i){this.loggingService.catch("markAsUnread: Annotation not found",null,{annotationId:e});return}this.viewsService?.setCommentAnnotationAsUnread(i);let c=structuredClone(i);t.update(m=>f(g({},m),{data:f(g({},m.data),{annotation:c})})),this.coreService.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in markAsUnread:",t,{annotationId:e})}}onClick(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: onClick","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a();if(i?.featureState?.inlineCommentSectionMode&&e&&i?.uiState?.commentPinSelected&&i?.unreadCommentsMap?.[e]&&this.markAsRead(e),!i?.featureState?.dialogSelection)return;let m=(t?this.coreService.getLocalUIState(t):void 0)?.()?.composerContent;if(!(m&&m.trim().length>0)){let _=t?this.coreService.getLocalUIState(t):void 0;_&&_.update(S=>f(g({},S),{composerInOpenState:!1}));let I=this.coreService.getContextConfig(e);I&&I.update(S=>f(g({},S),{uiState:f(g({},S.uiState),{formatToolbarOpen:!1})}))}}catch(a){this.loggingService.catch("Error in onClick:",a,{annotationId:e})}}extractEmails(e){this.loggingService.log("%c[WB] Calling FUNCTION: extractEmails","color: green;");try{let t=Array.from(e.matchAll(new RegExp(X.REGEX_EMAIL))),a=[];for(let i of t)this.loggingService.log(i),this.loggingService.log(i.index),a.push(i[2]);return a}catch(t){return this.loggingService.catch("Error in CommentDialogActionService extractEmails:",t),[]}}checkTaggedUserContacts(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let c=a().data?.taggedUserContacts||[];if(t){let m=[];c?.forEach(h=>{t?.includes(h?.text)||m.push(h?.text)}),c=c?.filter(h=>!m.includes(h?.text))}else c=[];a.update(m=>f(g({},m),{data:f(g({},m.data),{taggedUserContacts:c})}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService checkTaggedUserContacts:",a)}}extractContacts(e,t,a=!1){this.loggingService.log("%c[WB] Calling FUNCTION: extractContacts","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i)return[];let c=i(),m=this.extractEmails(t)||[];this.loggingService.log(m);let h=Array.from(new Set(m)),_=[],I=this.contactService.getInternalUserContacts()||[],S=c?.featureState?.anonymousEmail??this.commentService.getEnableAnonymousEmail();h.forEach(G=>{let Z=G?.trim()?.toLowerCase(),ae=new Fc,pe=I.filter(Se=>Se.email===Z);if(pe&&pe.length>0)ae=pe[0];else{if(!S)return;ae.email=Z,ae.source="manual",a&&this.commentService.addUserContact(ae)}_.push(ae)}),c.data?.taggedUserContacts?.length&&c.data.taggedUserContacts.forEach(G=>{G?.contact&&!_.find(Z=>G?.contact?.email&&Z.email===G?.contact?.email)&&!_.find(Z=>G?.contact?.userId&&Z.userId===G?.contact?.userId)&&_.push(G.contact)}),i.update(G=>f(g({},G),{data:f(g({},G.data),{selectedUserContacts:_.slice()})}));let z=i();if(z.data?.selectedUserContacts?.find(G=>G.email===z.data?.assignTo?.email)||i.update(G=>G.featureState?.assignToType==="checkbox"&&_.length>0?f(g({},G),{data:f(g({},G.data),{assignTo:_[0],isAssignedCheckbox:!1})}):f(g({},G),{data:f(g({},G.data),{assignTo:void 0})})),this.extractAtHere(t,c.uiState?.atHereLabel)?.length)if(c.appState?.user?.organizationId){let Z=this.contactService.getUserDocumentContacts();Z?.length&&Z.forEach(ae=>{_.find(pe=>pe.email===ae.email)||_.push(ae)})}else{let Z=this.contactService.getUserGroupContacts();Z?.length&&Z.forEach(ae=>{_.find(pe=>pe.email===ae.email)||_.push(ae)})}return _}catch(i){return this.loggingService.catch("Error in CommentDialogActionService extractContacts:",i),[]}}extractAtHere(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: extractAtHere","color: green;");try{let a=new RegExp(`@${t||"here"}`,"gi"),i=Array.from(e.matchAll(a)),c=[];for(let m of i)this.loggingService.log(m),this.loggingService.log(m.index),c.push(m[0]);return c}catch(a){return this.loggingService.catch("Error in CommentDialogActionService extractAtHere:",a),[]}}highlightLinks(e){this.loggingService.log("%c[WB] Calling FUNCTION: highlightLinks","color: green;");try{if(typeof e=="string"){e&&(e=e?.replaceAll("&amp;","&"));let t=document.createElement("div");t.innerHTML=e,t.querySelectorAll("a").forEach(c=>{c.classList.contains("velt-comment-dialog--comment-link")||c.classList.add("velt-comment-dialog--comment-link"),c.hasAttribute("target")||c.setAttribute("target","_blank"),c.hasAttribute("rel")||c.setAttribute("rel","noopener noreferrer")});let i=c=>{if(c.nodeType===Node.TEXT_NODE){let m=c.textContent?.replaceAll(X.REGEX_URL,h=>new RegExp(X.REGEX_EMAIL).test("@"+h)?h:`<a class="velt-comment-dialog--comment-link" href="${h.match(/^[a-zA-Z][a-zA-Z\d+\-.]*:/)?h:`https://${h}`}" target="_blank" rel="noopener noreferrer">${h}</a>`)||"";if(m!==c.textContent){let h=document.createElement("span");h.innerHTML=m,c.parentNode?.replaceChild(h,c)}}else c.nodeType===Node.ELEMENT_NODE&&c.tagName!=="A"&&Array.from(c.childNodes).forEach(i)};return Array.from(t.childNodes).forEach(i),t.innerHTML}else return this.loggingService.catch("Error in CommentDialogActionService highlightLinks: text is not string",e),e}catch(t){return this.loggingService.catch("Error in CommentDialogActionService highlightLinks:",t),""}}highlightAtHere(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: highlightAtHere","color: green;");try{let a=t||"here",i=new RegExp(`@(${a})\\b`,"gi");return e.replaceAll(i,(m,h)=>`<mark class="velt-comment-dialog--here-chip">${h}</mark>`)}catch(a){return this.loggingService.catch("Error in CommentDialogActionService highlightAtHere:",a),""}}handleCommentLinkClick(e,t){try{this.loggingService.log("%c[WB] Calling FUNCTION: handleCommentLinkClick","color: green;");let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),c=t.target;if(i.uiState?.dialogShadowDOM&&t.composedPath&&(c=t.composedPath().find(h=>h.nodeType===Node.ELEMENT_NODE&&h.classList?.contains("velt-comment-dialog--comment-link"))||c),c&&c.classList.contains("velt-comment-dialog--comment-link")){t.preventDefault(),t.stopPropagation();let m=c.textContent||"",h=c.href||"",I=c.closest("[data-comment-id]")?.getAttribute("data-comment-id");if(I&&i.data?.annotation){let S=i.data.annotation.comments?.find(z=>z.commentId.toString()===I);if(S){let z={text:m,link:h,commentAnnotation:this.commentService.getCommentAnnotationForClient(i.data.annotation),commentId:S.commentId};i.featureState?.linkCallback?this.commentActionsService.triggerAction(dt.LINK_CLICKED,z):window.open(h,"_blank")?.focus()}}}}catch(a){this.loggingService.catch("Error in CommentDialogActionService handleCommentLinkClick:",a)}}addToEmailsToComment(e,t,a){this.loggingService.log("%c[WB] Calling FUNCTION: addToEmailsToComment","color: green;");try{if(!this.coreService.getContextConfig(e))return;let m=(a?this.coreService.getLocalUIState(a):void 0)?.()?.composerContent||"",h=this.extractContacts(e,m,!0);t.to=h}catch(i){this.loggingService.catch("Error in CommentDialogActionService addToEmailsToComment:",i)}}emailChipMigration(e,t){try{if(!t)return;let a=this.coreService.getContextConfig(e);if(!a)return;let{modifiedText:i,data:c}=this.replaceVeltAutocompleteChipAndExtractData(t);a().data?.taggedUserContacts||a.update(h=>f(g({},h),{data:f(g({},h.data),{taggedUserContacts:[]})})),c.forEach(h=>Pe(this,null,function*(){if(h.email){let _=this.contactService.getContactByEmail(h.email);_||(_=this.contactService.getUserByEmail(h.email)),_&&a.update(I=>f(g({},I),{data:f(g({},I.data),{taggedUserContacts:[...I.data?.taggedUserContacts||[],{text:h.text,userId:_.userId,contact:_}]})}))}}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService emailChipMigration:",a)}}replaceVeltAutocompleteChipAndExtractData(e){try{let t=/<velt-autocomplete-chip[^>]*email="([^"]*)"[^>]*text="([^"]*)"[^>]*>.*?<\/velt-autocomplete-chip>/gi,a=[];return{modifiedText:e.replace(t,(c,m,h)=>(a.push({email:m,text:h}),h)),data:a}}catch(t){return this.loggingService.catch("Error in CommentDialogActionService replaceVeltAutocompleteChipAndExtractData:",t),{modifiedText:e,data:[]}}}detectEmailAfterAt(e,t,a,i,c){try{if(t.inputType!=="insertText"||t.data!==" "||!this.coreService.getContextConfig(e))return;let h=a,_,I=i.getRootNode();if(I instanceof ShadowRoot?_=I?.getSelection():_=window.getSelection(),_?.rangeCount){let $=_.getRangeAt(0),G=$.endOffset,Z=$.endContainer;if(Z.nodeType===Node.TEXT_NODE){let pe=(Z.textContent||"").substring(0,G),Se="",oe=Z;for(;oe;)if(oe.previousSibling)oe=oe.previousSibling,Se=(oe.textContent||"")+Se;else if(oe.parentNode&&oe.parentNode!==i)oe=oe.parentNode;else break;h=Se+pe}}let S=h.split(/\s+/),z=S.length>=2?S[S.length-2]:S[S.length-1];if(z&&z.startsWith("@")){let $=z.substring(1);if($.includes("@")&&new RegExp(X.REGEX_EMAIL).test("@"+$)){let Z=this.contactService.getContactByEmail($);if(!Z){Z=new Fc;let oe=$?.toLowerCase()?.trim();Z.email=oe,this.contactService.addUserContact(Z)}let pe="@"+(Z.name||Z.email);Rc(i,pe,["@"]);let Se=pe;if(Se){let oe={text:Se,userId:Z.userId,contact:Z};this.userContactSelected(e,oe,i,c),this.closeAutocompletePanel(e)}}}}catch(m){this.loggingService.catch("Error in CommentDialogActionService detectEmailAfterAt:",m)}}closeAutocompletePanel(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();setTimeout(()=>{let i=new Event("blur"),c=a.uiState?.newCommentTextArea?.nativeElement,m=a.uiState?.editCommentTextArea?.nativeElement;c?(c.dispatchEvent(i),setTimeout(()=>{c?.focus()},10)):m&&(m.dispatchEvent(i),setTimeout(()=>{m?.focus()},10))},50)}catch(t){this.loggingService.catch("Error in CommentDialogActionService closeAutocompletePanel:",t)}}cancelComment(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let c=!!a().data?.annotation?.comments?.length;if(t){let h=this.coreService.getLocalUIState(t);h&&h.update(_=>f(g({},_),{composerContent:"",composerContentHTML:"",selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[]}))}a.update(h=>f(g({},h),{uiState:g(f(g({},h.uiState),{showCommentButtons:!1}),c?{}:{pendingDeleteCommentThread:!0})}));let m=a();m.uiState?.newCommentTextArea?.nativeElement&&(m.uiState.newCommentTextArea.nativeElement.innerText="",m.uiState.newCommentTextArea.nativeElement.innerHTML=""),this.checkGetAnnotationDraftAttribute(e,t)}catch(a){this.loggingService.catch("Error in cancelComment:",a)}}prePopulateCommentText(e,t){try{setTimeout(()=>{try{let a=sessionStorage.getItem(X.SESSION_STORAGE.SNIPPYLY_COMMENT_DIALOG_AUTO_POPULATE_TEXT);if(!a)return;let i=this.coreService.getContextConfig(e);if(!i)return;let m=i().uiState?.newCommentTextArea?.nativeElement;if(!m)return;sessionStorage.removeItem(X.SESSION_STORAGE.SNIPPYLY_COMMENT_DIALOG_AUTO_POPULATE_TEXT);let h=this.domService.sanitizeHtml(a+"&nbsp;<div><br></div>");m.innerHTML=h;let _=t?this.coreService.getLocalUIState(t):void 0;_&&_.update(I=>f(g({},I),{composerContent:m.innerText,composerContentHTML:this.domService.sanitizeHtml(m.innerHTML)})),this.setCursorToEnd(m),this.checkGetAnnotationDraftAttribute(e,t)}catch(a){this.loggingService.catch("Error in prePopulateCommentText setTimeout callback:",a)}},300)}catch(a){this.loggingService.catch("Error in prePopulateCommentText:",a)}}setCommentReadInAnalytics(e,t,a,i){try{if(t||i)return!1;let c=this.coreService.getContextConfig(e);if(!c)return!1;let h=c().data?.annotation;return h?.comments?.length?(this.analyticsService.trackEvent(ne.Events.Comments.COMMENT_READ,{annotationId:h.annotationId,commentType:this.commentService.getCommentType(h),uiLocation:t?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),readType:a?"open":"hover"}),!0):!1}catch(c){return this.loggingService.catch("Error in setCommentReadInAnalytics:",c),!1}}onVisibilityOptionClick(e,t,a,i){try{this.commentService.emitVisibilityOptionClicked({annotationId:e,visibility:t,users:a});let c=this.coreService.getContextConfig(e);if(!c)return;let m=c()?.data?.annotation;if(!m)return;this.commentActionsService.onVisibilityOptionClick(m,t,a),this.updateVisibility(e,t,a,i)}catch(c){this.loggingService.catch("Error in onVisibilityOptionClick:",c)}}updateVisibility(e,t,a,i){try{let c;switch(t){case"public":c={type:"public",annotationId:e};break;case it.RESTRICTED_SELF:let m=this.authService.getUser();if(!m?.userId){this.loggingService.warn("updateVisibility: Current user not found for restrictedSelf visibility");return}c={type:"restricted",annotationId:e,userIds:[m.userId]};break;case it.RESTRICTED_SELECTED_PEOPLE:let h=a?.map(_=>_.userId).filter(Boolean)||[];if(!h.length){this.loggingService.warn("updateVisibility: No users selected for restrictedSelectedPeople visibility");return}c={type:"restricted",annotationId:e,userIds:h};break;case it.ORGANIZATION_PRIVATE:c=g({type:"organizationPrivate",annotationId:e},i?.length?{organizationIds:i}:{});break;default:this.loggingService.warn("updateVisibility: Invalid visibility type: "+t);return}this.applyOptimisticVisibility(e,c),this.commentActionsService.updateVisibility(c)}catch(c){this.loggingService.catch("Error in updateVisibility:",c)}}applyOptimisticVisibility(e,t){try{let a=t;if(a.type==="restricted"){let I=this.authService.getUser();I?.userId&&(a=Mn(a,I.userId))}if(a.type==="organizationPrivate"&&!a.organizationId&&!a.organizationIds?.length){let I=this.authService.getUser()?.clientOrganizationId;I&&(a=f(g({},a),{organizationId:I}))}let i=this.coreService.getContextConfig(e);if(!i)return;let m=i()?.data?.annotation?.from?.userId??this.authService.getUser()?.userId,h=An(a,m),_=Pn(a,m);i.update(I=>{let S=I?.data?.annotation;return S?f(g({},I),{data:f(g({},I.data),{annotation:f(g({},S),{visibilityConfig:_,context:f(g({},S.context||{}),{accessFields:h})})})}):I})}catch(a){this.loggingService.catch("Error in applyOptimisticVisibility:",a)}}};o.\u0275fac=function(t){return new(t||o)(be(vt),be(ie),be(Ne),be(lo),be(Dt),be(N),be(vr),be(jv),be(fr),be(xh),be($t),be(ot),be(ut),be(Lg),be(Bg),be(to))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function of(r,o,n){return!!r&&(o!=="checkbox"||!!n)}function Yy(r,o){return r||o?.editCommentTextArea?.nativeElement||o?.newCommentTextArea?.nativeElement}function Ky(r,o,n){return!!r||!o||!!n}var Xg=class extends jb{constructor(o){super(o),this._submitComment=n=>{this.getService(N).log("%c[WB] Calling FUNCTION: submitComment","color: green;");try{this.trackEvent(ne.Events.Comments.SUBMIT_COMMENT_TRIGGERED,{payload:{referenceId:n.targetComposerElementId}}),this.getService(ie).submitComment(n)}catch(e){this.getService(N).catch("Error in _submitComment: ",e)}},this._clearComposer=n=>{this.getService(N).log("%c[WB] Calling FUNCTION: clearComposer","color: green;");try{this.trackEvent(ne.Events.Comments.CLEAR_COMPOSER_TRIGGERED),this.getService(ie).clearComposer(n)}catch(e){this.getService(N).catch("Error in _clearComposer: ",e)}},this._enableFormatOptions=()=>{this.getService(N).log("%c[WB] Calling FUNCTION: enableFormatOptions","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_FORMAT_OPTIONS_TRIGGERED),this.getService(ie).enableFormatOptions()}catch(n){this.getService(N).catch("Error in _enableFormatOptions: ",n)}},this._disableFormatOptions=()=>{this.getService(N).log("%c[WB] Calling FUNCTION: disableFormatOptions","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_FORMAT_OPTIONS_TRIGGERED),this.getService(ie).disableFormatOptions()}catch(n){this.getService(N).catch("Error in _disableFormatOptions: ",n)}},this._setFormatConfig=n=>{this.getService(N).log("%c[WB] Calling FUNCTION: setFormatConfig","color: green;");try{this.trackEvent(ne.Events.Comments.SET_FORMAT_CONFIG_TRIGGERED,{payload:{config:n}}),this.getService(ie).setFormatConfig(n)}catch(e){this.getService(N).catch("Error in _setFormatConfig: ",e)}},this._getComposerData=n=>{this.getService(N).log("%c[WB] Calling FUNCTION: getComposerData","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_COMPOSER_DATA_TRIGGERED),this.getService(ie).getComposerData(n)}catch(e){return this.getService(N).catch("Error in _getComposerData: ",e),null}},this.getService(N).log("%c[WB] Creating CLASS: CommentElement","color: blue;"),this.getAllCommentAnnotations=this._getAllCommentAnnotations,this.deleteSelectedComment=this._deleteSelectedComment,this.enableTextComments=this._enableTextComments,this.disableTextComments=this._disableTextComments,this.allowedElementIds=this._allowedElementIds,this.allowedElementClassNames=this._allowedElementClassNames,this.allowedElementQuerySelectors=this._allowedElementQuerySelectors,this.disableFloatingCommentDialog=this._disableFloatingComments,this.enableFloatingCommentDialog=this._enableFloatingComments,this.attachComment=this._attachComment,this.openCommentSidebar=this._openCommentSidebar,this.closeCommentSidebar=this._closeCommentSidebar,this.toggleCommentSidebar=this._toggleCommentSidebar,this.enableModeratorMode=this._enableModeratorMode,this.disableModeratorMode=this._disableModeratorMode,this.enableStreamMode=this._enableStreamMode,this.disableStreamMode=this._disableStreamMode,this.enableSignInButton=this._enableSignInButton,this.disableSignInButton=this._disableSignInButton,this.enableUpgradeButton=this._enableUpgradeButton,this.disableUpgradeButton=this._disableUpgradeButton,this.onCommentModeChange=this._onCommentModeChange,this.enableAttachments=this._enableAttachment,this.disableAttachments=this._disableAttachment,this.enableAttachmentDownload=this._enableAttachmentDownload,this.disableAttachmentDownload=this._disableAttachmentDownload,this.isUserGlobalContact=this._isUserGlobalContact,this.enableDeviceInfo=this._enableDeviceInfo,this.disableDeviceInfo=this._disableDeviceInfo,this.enableCommentMode=this._enableCommentMode,this.disableCommentMode=this._disableCommentMode,this.enablePersistentCommentMode=this._enablePersistentCommentMode,this.disablePersistentCommentMode=this._disablePersistentCommentMode,this.enableCommentIndex=this._enableCommentIndex,this.disableCommentIndex=this._disableCommentIndex,this.enablePopoverMode=this._enablePopoverMode,this.disablePopoverMode=this._disablePopoverMode,this.enableDialogOnHover=this._enableDialogOnHover,this.enablePopoverTriangleComponent=this._enablePopoverTriangleComponent,this.disablePopoverTriangleComponent=this._disablePopoverTriangleComponent,this.disableDialogOnHover=this._disableDialogOnHover,this.enableDialogOnTargetElementClick=this._enableDialogOnTargetElementClick,this.disableDialogOnTargetElementClick=this._disableDialogOnTargetElementClick,this.enablePriority=this._enablePriority,this.disablePriority=this._disablePriority,this.enableStatus=this._enableStatus,this.disableStatus=this._disableStatus,this.enableVisibilityOptions=this._enableVisibilityOptions,this.disableVisibilityOptions=this._disableVisibilityOptions,this.enableResolveButton=this._enableResolveButton,this.disableResolveButton=this._disableResolveButton,this.enableGhostComments=this._enableGhostComments,this.disableGhostComments=this._disableGhostComments,this.enableGhostCommentsIndicator=this._enableGhostCommentsIndicator,this.disableGhostCommentsIndicator=this._disableGhostCommentsIndicator,this.setCustomStatus=this._setCustomStatus,this.setCustomPriority=this._setCustomPriority,this.setCustomCategory=this._setCustomCategory,this.enableInboxMode=this._enableInboxMode,this.disableInboxMode=this._disableInboxMode,this.enableAutoCategorize=this._enableAutoCategorize,this.disableAutoCategorize=this._disableAutoCategorize,this.enableDarkMode=this._enableDarkMode,this.disableDarkMode=this._disableDarkMode,this.setContextProvider=this._setContextProvider,this.enableSuggestionMode=this._enableSuggestionMode,this.disableSuggestionMode=this._disableSuggestionMode,this.enableMobileMode=this._enableMobileMode,this.disableMobileMode=this._disableMobileMode,this.enableInlineCommentMode=this._enableInlineCommentMode,this.disableInlineCommentMode=this._disableInlineCommentMode,this.enableMinimap=this._enableMinimap,this.disableMinimap=this._disableMinimap,this.showCommentsOnDom=this._showCommentsOnDom,this.hideCommentsOnDom=this._hideCommentsOnDom,this.enableCommentTool=this._enableCommentTool,this.disableCommentTool=this._disableCommentTool,this.setTotalMediaLength=this._setTotalMediaLength,this.onCommentAdd=this._onCommentAdd,this.onCommentUpdate=this._onCommentUpdate,this.addCommentOnSelectedText=this._addCommentOnSelectedText,this.enableSidebarUrlNavigation=this._enableSidebarUrlNavigation,this.disableSidebarUrlNavigation=this._disableSidebarUrlNavigation,this.setDStrategy=this._setDStrategy,this.enableSidebarButtonOnCommentDialog=this._enableSidebarButtonOnCommentDialog,this.disableSidebarButtonOnCommentDialog=this._disableSidebarButtonOnCommentDialog,this.onSidebarButtonOnCommentDialogClick=this._onSidebarButtonOnCommentDialogClick,this.enableReactions=this._enableReactions,this.disableReactions=this._disableReactions,this.enableAnonymousEmail=this._enableAnonymousEmail,this.disableAnonymousEmail=this._disableAnonymousEmail,this.setRecordings=this._setRecordings,this.addCommentOnElement=this._addCommentOnElement,this.enablePrivateCommentMode=this._enablePrivateCommentMode,this.disablePrivateCommentMode=this._disablePrivateCommentMode,this.enablePrivateMode=this._enablePrivateMode,this.disablePrivateMode=this._disablePrivateMode,this.enableScrollToComment=this._enableScrollToComment,this.disableScrollToComment=this._disableScrollToComment,this.enableUserMentions=this._enableUserMentions,this.disableUserMentions=this._disableUserMentions,this.setCommentSidebarFilters=this._setCommentSidebarFilters,this.setSystemFiltersOperator=this._setSystemFiltersOperator,this.enableCommentPinHighlighter=this._enableCommentPinHighlighter,this.disableCommentPinHighlighter=this._disableCommentPinHighlighter,this.enableDeleteOnBackspace=this._enableDeleteOnBackspace,this.disableDeleteOnBackspace=this._disableDeleteOnBackspace,this.enableHotkey=this._enableHotkey,this.disableHotkey=this._disableHotkey,this.enableDeviceIndicatorOnCommentPins=this._enableDeviceIndicatorOnCommentPins,this.disableDeviceIndicatorOnCommentPins=this._disableDeviceIndicatorOnCommentPins,this.getElementRefByAnnotationId=this._getElementRefByAnnotationId,this.scrollToCommentByAnnotationId=this._scrollToCommentByAnnotationId,this.selectCommentByAnnotationId=this._selectCommentByAnnotationId,this.enableRecordingSummary=this._enableRecordingSummary,this.disableRecordingSummary=this._disableRecordingSummary,this.enableRecordingTranscription=this._enableRecordingTranscription,this.disableRecordingTranscription=this._disableRecordingTranscription,this.enableRecordingCountdown=this._enableRecordingCountdown,this.disableRecordingCountdown=this._disableRecordingCountdown,this.setUnreadIndicatorMode=this._setUnreadIndicatorMode,this.enableEnterKeyToSubmit=this._enableEnterKeyToSubmit,this.disableEnterKeyToSubmit=this._disableEnterKeyToSubmit,this.enablePinShadowDOM=this._enablePinShadowDOM,this.disablePinShadowDOM=this._disablePinShadowDOM,this.enableDialogShadowDOM=this._enableDialogShadowDOM,this.disableDialogShadowDOM=this._disableDialogShadowDOM,this.enableSidebarShadowDOM=this._enableSidebarShadowDOM,this.disableSidebarShadowDOM=this._disableSidebarShadowDOM,this.enableChangeDetectionInCommentMode=this._enableChangeDetectionInCommentMode,this.disableChangeDetectionInCommentMode=this._disableChangeDetectionInCommentMode,this.showResolvedCommentsOnDom=this._showResolvedCommentsOnDom,this.hideResolvedCommentsOnDom=this._hideResolvedCommentsOnDom,this.setCustomReactions=this._setCustomReactions,this.onCommentSelectionChange=this._onCommentSelectionChange,this.getUnreadCommentCountByAnnotationId=this._getUnreadCommentCountByAnnotationId,this.getUnreadCommentAnnotationCountOnCurrentDocument=this._getUnreadCommentAnnotationCountOnCurrentDocument,this.getUnreadCommentCountOnCurrentDocument=this._getUnreadCommentCountOnCurrentDocument,this.getUnreadCommentAnnotationCountByLocationId=this._getUnreadCommentAnnotationCountByLocationId,this.getUnreadCommentCountByLocationId=this._getUnreadCommentCountByLocationId,this.updateCommentDialogPosition=this._updateCommentDialogPosition,this.enableAreaComment=this._enableAreaComment,this.disableAreaComment=this._disableAreaComment,this.setPinCursorImage=this._setPinCursorImage,this.addManualComment=this._addManualComment,this.createCustomListDataOnAnnotation=this._createCustomListDataOnAnnotation,this.createCustomListDataOnComment=this._createCustomListDataOnComment,this.excludeLocationIdsFromSidebar=this._excludeLocationIdsFromSidebar,this.enableBubbleOnPin=this._enableBubbleOnPin,this.disableBubbleOnPin=this._disableBubbleOnPin,this.enableBubbleOnPinHover=this._enableBubbleOnPinHover,this.disableBubbleOnPinHover=this._disableBubbleOnPinHover,this.enablePinDrag=this._enablePinDrag,this.disablePinDrag=this._disablePinDrag,this.enableMultiThreadMode=this._enableMultiThread,this.disableMultiThreadMode=this._disableMultiThread,this.enableMultiThread=this._enableMultiThread,this.disableMultiThread=this._disableMultiThread,this.enableGroupMultipleMatch=this._enableGroupMatchedComments,this.disableGroupMultipleMatch=this._disableGroupMatchedComments,this.enableGroupMatchedComments=this._enableGroupMatchedComments,this.disableGroupMatchedComments=this._disableGroupMatchedComments,this.enableRestrictTextSearchToAnchor=this._enableRestrictTextSearchToAnchor,this.disableRestrictTextSearchToAnchor=this._disableRestrictTextSearchToAnchor,this.updateContext=this._updateContext,this.updateVisibility=this._updateVisibility,this.getSelectedComments=this._getSelectedComments,this.enableDeleteReplyConfirmation=this._enableDeleteReplyConfirmation,this.disableDeleteReplyConfirmation=this._disableDeleteReplyConfirmation,this.onCopyLink=this._onCopyLink,this.getCommentAnnotationById=this._getCommentAnnotationById,this.enableCollapsedComments=this._enableCollapsedComments,this.disableCollapsedComments=this._disableCollapsedComments,this.enableCollapsedRepliesPreview=this._enableCollapsedRepliesPreview,this.disableCollapsedRepliesPreview=this._disableCollapsedRepliesPreview,this.onCommentSidebarActionButtonClick=this._onCommentSidebarActionButtonClick,this.setCommentSidebarData=this._setCommentSidebarData,this.onCommentSidebarInit=this._onCommentSidebarInit,this.onCommentSidebarData=this._onCommentSidebarData,this.setCommentSidebarDefaultCustomActions=this._setCommentSidebarDefaultCustomActions,this.enableSidebarCustomActions=this._enableSidebarCustomActions,this.disableSidebarCustomActions=this._disableSidebarCustomActions,this.enableQueryParamsComments=this._enableQueryParamsComments,this.disableQueryParamsComments=this._disableQueryParamsComments,this.enableResolveStatusAccessAdminOnly=this._enableResolveStatusAccessAdminOnly,this.disableResolveStatusAccessAdminOnly=this._disableResolveStatusAccessAdminOnly,this.enableLinkCallback=this._enableLinkCallback,this.disableLinkCallback=this._disableLinkCallback,this.enableSeenByUsers=this._enableSeenByUsers,this.disableSeenByUsers=this._disableSeenByUsers,this.enableShortUserName=this._enableShortUserName,this.disableShortUserName=this._disableShortUserName,this.addCommentAnnotation=this._addCommentAnnotation,this.approveCommentAnnotation=this._approveCommentAnnotation,this.acceptCommentAnnotation=this._acceptCommentAnnotation,this.rejectCommentAnnotation=this._rejectCommentAnnotation,this.subscribeCommentAnnotation=this._subscribeCommentAnnotation,this.unsubscribeCommentAnnotation=this._unsubscribeCommentAnnotation,this.deleteCommentAnnotation=this._deleteCommentAnnotation,this.getCommentAnnotations=this._getCommentAnnotations,this.getCommentAnnotationsCount=this._getCommentAnnotationsCount,this.assignUser=this._assignUser,this.updatePriority=this._updatePriority,this.updateStatus=this._updateStatus,this.updateAccess=this._updateAccess,this.resolveCommentAnnotation=this._resolveCommentAnnotation,this.getLink=this._getLink,this.copyLink=this._copyLink,this.addComment=this._addComment,this.updateComment=this._updateComment,this.deleteComment=this._deleteComment,this.getComment=this._getComment,this.addAttachment=this._addAttachment,this.deleteAttachment=this._deleteAttachment,this.getAttachment=this._getAttachment,this.deleteRecording=this._deleteRecording,this.getRecording=this._getRecording,this.addReaction=this._addReaction,this.deleteReaction=this._deleteReaction,this.toggleReaction=this._toggleReaction,this.enableReadOnly=this._enableReadOnly,this.disableReadOnly=this._disableReadOnly,this.setAssignToType=this._setAssignToType,this.enableContextInPageModeComposer=this._enableContextInPageModeComposer,this.disableContextInPageModeComposer=this._disableContextInPageModeComposer,this.clearPageModeComposerContext=this._clearPageModeComposerContext,this.setContextInPageModeComposer=this._setContextInPageModeComposer,this.focusPageModeComposer=this._focusPageModeComposer,this.enableCustomAutocompleteSearch=this._enableCustomAutocompleteSearch,this.disableCustomAutocompleteSearch=this._disableCustomAutocompleteSearch,this.fetchCommentAnnotations=this._fetchCommentAnnotations,this.setTransformContext=this._setTransformContext,this.enableSvgAsImg=this._enableSvgAsImg,this.disableSvgAsImg=this._disableSvgAsImg,this.enableFullExpanded=this._enableFullExpanded,this.disableFullExpanded=this._disableFullExpanded,this.enableCommentToNearestAllowedElement=this._enableCommentToNearestAllowedElement,this.disableCommentToNearestAllowedElement=this._disableCommentToNearestAllowedElement,this.enableDraftMode=this._enableDraftMode,this.disableDraftMode=this._disableDraftMode,this.enableFilterCommentsOnDom=this._enableFilterCommentsOnDom,this.disableFilterCommentsOnDom=this._disableFilterCommentsOnDom,this.enableReplyAvatars=this._enableReplyAvatars,this.disableReplyAvatars=this._disableReplyAvatars,this.setMaxReplyAvatars=this._setMaxReplyAvatars,this.setSidebarButtonCountType=this._setSidebarButtonCountType,this.enableFilterGhostCommentsInSidebar=this._enableFilterGhostCommentsInSidebar,this.disableFilterGhostCommentsInSidebar=this._disableFilterGhostCommentsInSidebar,this.enableFullScreenInSidebar=this._enableFullScreenInSidebar,this.disableFullScreenInSidebar=this._disableFullScreenInSidebar,this.setComposerFileAttachments=this._setComposerFileAttachments,this.setAllowedFileTypes=this._setAllowedFileTypes,this.enableForceCloseAllOnEsc=this._enableForceCloseAllOnEsc,this.disableForceCloseAllOnEsc=this._disableForceCloseAllOnEsc,this.markAsRead=this._markAsRead,this.markAsUnread=this._markAsUnread,this.enableScreenshot=this._enableScreenshot,this.disableScreenshot=this._disableScreenshot,this.enablePaginatedContactList=this._enablePaginatedContactList,this.disablePaginatedContactList=this._disablePaginatedContactList,this.enableFormatOptions=this._enableFormatOptions,this.disableFormatOptions=this._disableFormatOptions,this.setFormatConfig=this._setFormatConfig,this.submitComment=this._submitComment,this.clearComposer=this._clearComposer,this.on=this._on,this.getComposerData=this._getComposerData}_getAllCommentAnnotations(o,n){this.getService(N).log("%c[WB] Calling FUNCTION: getOnlineUsers","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED,{payload:{documentId:o,location:n}}),this.getService(ie).getAllCommentAnnotations({customClientDocumentId:o,params:n,excludeDomChanges:!0,skipPositionCalculation:!0,addFilterCommentsOnDomCheck:!0}).pipe(Oe(e=>e?.length?e?.map(t=>this.getService(ie).getCommentAnnotationForClient(t)):e))}catch(e){return this.getService(N).catch("Error in _getLiveCommentsOnCurrentDocument: ",e),Ee(null)}}_deleteSelectedComment(){this.getService(N).log("%c[WB] Calling FUNCTION: deleteSelectedComment","color: green;");try{return this.trackEvent(ne.Events.Comments.DELETE_SELECTED_COMMENT_TRIGGERED),this.getService(ie).deleteCommentPinAnnotations("commentElement")}catch(o){return this.getService(N).catch("Error in _deleteSelectedComment: ",o),Promise.resolve(null)}}_enableTextComments(){this.getService(N).log("%c[WB] Calling FUNCTION: enableTextComments","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_TEXT_COMMENTS_TRIGGERED),this.getService(ie).enableTextComments()}catch(o){this.getService(N).catch("Error in _enableTextComments: ",o)}}_disableTextComments(){this.getService(N).log("%c[WB] Calling FUNCTION: disableTextComments","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_TEXT_COMMENTS_TRIGGERED),this.getService(ie).disableTextComments()}catch(o){this.getService(N).catch("Error in _disableTextComments: ",o)}}_allowedElementIds(o){this.getService(N).log("%c[WB] Calling FUNCTION: allowedElementIds","color: green;");try{this.trackEvent(ne.Events.Comments.ALLOWED_ELEMENT_IDS_TRIGGERED,{payload:{elementIds:o}}),this.getService(ie).setAllowedElementIds(o)}catch(n){this.getService(N).catch("Error in allowedElementIds: ",n)}}_allowedElementClassNames(o){this.getService(N).log("%c[WB] Calling FUNCTION: allowedElementClassNames","color: green;");try{this.trackEvent(ne.Events.Comments.ALLOWED_ELEMENT_CLASS_NAMES_TRIGGERED,{payload:{classNames:o}}),this.getService(ie).setAllowedElementClassNames(o)}catch(n){this.getService(N).catch("Error in allowedElementClassNames: ",n)}}_allowedElementQuerySelectors(o){this.getService(N).log("%c[WB] Calling FUNCTION: allowedElementQuerySelectors","color: green;");try{this.trackEvent(ne.Events.Comments.ALLOWED_ELEMENT_QUERY_SELECTORS_TRIGGERED,{payload:{querySelectors:o}}),this.getService(ie).setAllowedElementQuerySelectors(o)}catch(n){this.getService(N).catch("Error in allowedElementQuerySelectors: ",n)}}_disableFloatingComments(){this.getService(N).log("%c[WB] Calling FUNCTION: disableFloatingComments","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_FLOATING_COMMENT_DIALOG_TRIGGERED),this.getService(ie).disableFloatingComments(!0)}catch(o){this.getService(N).catch("Error in _disableFloatingComments: ",o)}}_enableFloatingComments(){this.getService(N).log("%c[WB] Calling FUNCTION: enableFloatingComments","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_FLOATING_COMMENT_DIALOG_TRIGGERED),this.getService(ie).disableFloatingComments(!1)}catch(o){this.getService(N).catch("Error in _enableFloatingComments: ",o)}}_attachComment(o){this.getService(N).log("%c[WB] Calling FUNCTION: attachComment","color: green;");try{this.trackEvent(ne.Events.Comments.ATTACH_COMMENT_TRIGGERED,{payload:{elementId:o}}),this.getService(ie).attachComment(o,["id","data-id"])}catch(n){this.getService(N).catch("Error in _attachComment: ",n)}}_openCommentSidebar(){this.getService(N).log("%c[WB] Calling FUNCTION: openCommentSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.OPEN_COMMENT_SIDEBAR_TRIGGERED),this.getService(ie).setSidebarVisibility(!0,!0)}catch(o){this.getService(N).catch("Error in _openCommentSidebar: ",o)}}_closeCommentSidebar(){this.getService(N).log("%c[WB] Calling FUNCTION: closeCommentSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.CLOSE_COMMENT_SIDEBAR_TRIGGERED),this.getService(ie).setSidebarVisibility(!1,!0)}catch(o){this.getService(N).catch("Error in _closeCommentSidebar: ",o)}}_toggleCommentSidebar(){this.getService(N).log("%c[WB] Calling FUNCTION: toggleCommentSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.TOGGLE_COMMENT_SIDEBAR_TRIGGERED),this.getService(ie).toggleSidebarVisibility(!0)}catch(o){this.getService(N).catch("Error in _toggleCommentSidebar: ",o)}}_enableModeratorMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableModeratorMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_MODERATOR_MODE_TRIGGERED),this.getService(ie).setModeratorMode(!0)}catch(o){this.getService(N).catch("Error in _enableModeratorMode: ",o)}}_disableModeratorMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableModeratorMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_MODERATOR_MODE_TRIGGERED),this.getService(ie).setModeratorMode(!1)}catch(o){this.getService(N).catch("Error in _disableModeratorMode: ",o)}}_enableStreamMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableStreamMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_STREAM_MODE_TRIGGERED),this.getService(ie).setStreamMode(!0)}catch(o){this.getService(N).catch("Error in _enableStreamMode: ",o)}}_disableStreamMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableStreamMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_STREAM_MODE_TRIGGERED),this.getService(ie).setStreamMode(!1)}catch(o){this.getService(N).catch("Error in _disableStreamMode: ",o)}}_enableSignInButton(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSignInButton","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SIGN_IN_BUTTON_TRIGGERED),this.getService(ie).enableSignInButton(!0)}catch(o){this.getService(N).catch("Error in _enableSignInButton: ",o)}}_disableSignInButton(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSignInButton","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SIGN_IN_BUTTON_TRIGGERED),this.getService(ie).enableSignInButton(!1)}catch(o){this.getService(N).catch("Error in _disableSignInButton: ",o)}}_enableUpgradeButton(){this.getService(N).log("%c[WB] Calling FUNCTION: enableUpgradeButton","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_UPGRADE_BUTTON_TRIGGERED),this.getService(ie).enableUpgradeButton(!0)}catch(o){this.getService(N).catch("Error in _enableUpgradeButton: ",o)}}_disableUpgradeButton(){this.getService(N).log("%c[WB] Calling FUNCTION: disableUpgradeButton","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_UPGRADE_BUTTON_TRIGGERED),this.getService(ie).enableUpgradeButton(!1)}catch(o){this.getService(N).catch("Error in _disableUpgradeButton: ",o)}}_onCommentModeChange(){this.getService(N).log("%c[WB] Calling FUNCTION: onCommentModeChange","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_COMMENT_MODE_CHANGE_TRIGGERED),this.getService(ie).addCommentModeChange()}catch(o){return this.getService(N).catch("Error in _onCommentModeChange: ",o),Ee(!1)}}_enableAttachment(){this.getService(N).log("%c[WB] Calling FUNCTION: enableAttachment","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_ATTACHMENTS_TRIGGERED),this.getService(ie).enableAttachment(!0)}catch(o){this.getService(N).catch("Error in _enableAttachment: ",o)}}_disableAttachment(){this.getService(N).log("%c[WB] Calling FUNCTION: disableAttachment","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_ATTACHMENTS_TRIGGERED),this.getService(ie).enableAttachment(!1)}catch(o){this.getService(N).catch("Error in _disableAttachment: ",o)}}_enableAttachmentDownload(){this.getService(N).log("%c[WB] Calling FUNCTION: enableAttachmentDownload","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_ATTACHMENT_DOWNLOAD_TRIGGERED),this.getService(ie).enableAttachmentDownload()}catch(o){this.getService(N).catch("Error in _enableAttachmentDownload: ",o)}}_disableAttachmentDownload(){this.getService(N).log("%c[WB] Calling FUNCTION: disableAttachmentDownload","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_ATTACHMENT_DOWNLOAD_TRIGGERED),this.getService(ie).disableAttachmentDownload()}catch(o){this.getService(N).catch("Error in _disableAttachmentDownload: ",o)}}_isUserGlobalContact(){this.getService(N).log("%c[WB] Calling FUNCTION: isUserGlobalContact","color: green;");try{return this.trackEvent(ne.Events.Comments.IS_USER_GLOBAL_CONTACT_TRIGGERED),this.getService(ie).isUserGlobalContact$()}catch(o){return this.getService(N).catch("Error in _isUserGlobalContact: ",o),Ee(!1)}}_enableDeviceInfo(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDeviceInfo","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DEVICE_INFO_TRIGGERED),this.getService(ie).showScreenSizeInfo(!0)}catch(o){this.getService(N).catch("Error in _enableDeviceInfo: ",o)}}_disableDeviceInfo(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDeviceInfo","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DEVICE_INFO_TRIGGERED),this.getService(ie).showScreenSizeInfo(!1)}catch(o){this.getService(N).catch("Error in _disableDeviceInfo: ",o)}}_enableCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_COMMENT_MODE_TRIGGERED),this.getService(ie).enableAddCommentMode()}catch(o){this.getService(N).catch("Error in _enableCommentMode: ",o)}}_disableCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_COMMENT_MODE_TRIGGERED),this.getService(ie).disableAddCommentMode()}catch(o){this.getService(N).catch("Error in _disableCommentMode: ",o)}}_enablePersistentCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePersistentCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_PERSISTENT_COMMENT_MODE_TRIGGERED),this.getService(ie).enablePersistentCommentMode()}catch(o){this.getService(N).catch("Error in _enablePersistentCommentMode: ",o)}}_disablePersistentCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePersistentCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_PERSISTENT_COMMENT_MODE_TRIGGERED),this.getService(ie).disablePersistentCommentMode()}catch(o){this.getService(N).catch("Error in _disablePersistentCommentMode: ",o)}}_showCommentIndex(o){this.getService(N).log("%c[WB] Calling FUNCTION: showCommentIndex","color: green;");try{this.trackEvent(ne.Events.Comments.SHOW_COMMENT_INDEX_TRIGGERED,{payload:{show:o}}),this.getService(ie).showCommentIndex(o)}catch(n){this.getService(N).catch("Error in _showCommentIndex: ",n)}}_enableCommentIndex(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCommentIndex","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_COMMENT_INDEX_TRIGGERED),this.getService(ie).showCommentIndex(!0)}catch(o){this.getService(N).catch("Error in _enableCommentIndex: ",o)}}_disableCommentIndex(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCommentIndex","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_COMMENT_INDEX_TRIGGERED),this.getService(ie).showCommentIndex(!1)}catch(o){this.getService(N).catch("Error in _disableCommentIndex: ",o)}}_enablePopoverMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePopoverMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_POPOVER_MODE_TRIGGERED),this.getService(ie).enablePopoverMode()}catch(o){this.getService(N).catch("Error in _enablePopoverMode: ",o)}}_disablePopoverMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePopoverMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_POPOVER_MODE_TRIGGERED),this.getService(ie).disablePopoverMode()}catch(o){this.getService(N).catch("Error in _disablePopoverMode: ",o)}}_enableDialogOnHover(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDialogOnHover","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DIALOG_ON_HOVER_TRIGGERED),this.getService(ie).setEnableDialogOnHover(!0)}catch(o){this.getService(N).catch("Error in _enableDialogOnHover: ",o)}}_disableDialogOnHover(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDialogOnHover","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DIALOG_ON_HOVER_TRIGGERED),this.getService(ie).setEnableDialogOnHover(!1)}catch(o){this.getService(N).catch("Error in _disableDialogOnHover: ",o)}}_enablePopoverTriangleComponent(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePopoverTriangleComponent","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED),this.getService(ie).enablePopoverTriangleComponent()}catch(o){this.getService(N).catch("Error in _enablePopoverTriangleComponent: ",o)}}_disablePopoverTriangleComponent(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePopoverTriangleComponent","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED),this.getService(ie).disablePopoverTriangleComponent()}catch(o){this.getService(N).catch("Error in _disablePopoverTriangleComponent: ",o)}}_enableDialogOnTargetElementClick(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDialogOnTargetElementClick","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED),this.getService(ie).setEnableDialogOnTargetElementClick(!0)}catch(o){this.getService(N).catch("Error in _enableDialogOnTargetElementClick: ",o)}}_disableDialogOnTargetElementClick(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDialogOnTargetElementClick","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED),this.getService(ie).setEnableDialogOnTargetElementClick(!1)}catch(o){this.getService(N).catch("Error in _disableDialogOnTargetElementClick: ",o)}}_enablePriority(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePriority","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_PRIORITY_TRIGGERED),this.getService(ie).setEnablePriority(!0)}catch(o){this.getService(N).catch("Error in _enablePriority: ",o)}}_disablePriority(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePriority","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_PRIORITY_TRIGGERED),this.getService(ie).setEnablePriority(!1)}catch(o){this.getService(N).catch("Error in _disablePriority: ",o)}}_enableStatus(){this.getService(N).log("%c[WB] Calling FUNCTION: enableStatus","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_STATUS_TRIGGERED),this.getService(ie).setEnableStatus(!0)}catch(o){this.getService(N).catch("Error in _enableStatus: ",o)}}_disableStatus(){this.getService(N).log("%c[WB] Calling FUNCTION: disableStatus","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_STATUS_TRIGGERED),this.getService(ie).setEnableStatus(!1)}catch(o){this.getService(N).catch("Error in _disableStatus: ",o)}}_enableVisibilityOptions(){this.getService(N).log("%c[WB] Calling FUNCTION: enableVisibilityOptions","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_VISIBILITY_OPTIONS_TRIGGERED),this.getService(ie).setEnableVisibilityOptions(!0)}catch(o){this.getService(N).catch("Error in _enableVisibilityOptions: ",o)}}_disableVisibilityOptions(){this.getService(N).log("%c[WB] Calling FUNCTION: disableVisibilityOptions","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_VISIBILITY_OPTIONS_TRIGGERED),this.getService(ie).setEnableVisibilityOptions(!1)}catch(o){this.getService(N).catch("Error in _disableVisibilityOptions: ",o)}}_enableResolveButton(){this.getService(N).log("%c[WB] Calling FUNCTION: enableResolveButton","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_RESOLVE_BUTTON_TRIGGERED),this.getService(ie).setEnableResolve(!0)}catch(o){this.getService(N).catch("Error in _enableResolveButton: ",o)}}_disableResolveButton(){this.getService(N).log("%c[WB] Calling FUNCTION: disableResolveButton","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_RESOLVE_BUTTON_TRIGGERED),this.getService(ie).setEnableResolve(!1)}catch(o){this.getService(N).catch("Error in _disableResolveButton: ",o)}}_enableGhostComments(){this.getService(N).log("%c[WB] Calling FUNCTION: enableGhostComments","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_GHOST_COMMENTS_TRIGGERED),this.getService(ie).enableGhostComments()}catch(o){this.getService(N).catch("Error in _enableGhostCommentsInDOM: ",o)}}_disableGhostComments(){this.getService(N).log("%c[WB] Calling FUNCTION: disableGhostComments","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_GHOST_COMMENTS_TRIGGERED),this.getService(ie).disableGhostComments()}catch(o){this.getService(N).catch("Error in _disableGhostComments: ",o)}}_enableGhostCommentsIndicator(){this.getService(N).log("%c[WB] Calling FUNCTION: enableGhostCommentsIndicator","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED),this.getService(ie).enableGhostCommentsMessage()}catch(o){this.getService(N).catch("Error in _enableGhostCommentsIndicator: ",o)}}_disableGhostCommentsIndicator(){this.getService(N).log("%c[WB] Calling FUNCTION: disableGhostCommentsIndicator","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED),this.getService(ie).disableGhostCommentsMessage()}catch(o){this.getService(N).catch("Error in _disableGhostCommentsIndicator: ",o)}}_setCustomStatus(o){this.getService(N).log("%c[WB] Calling FUNCTION: setCustomStatus","color: green;");try{this.trackEvent(ne.Events.Comments.SET_CUSTOM_STATUS_TRIGGERED,{payload:{customStatuses:o}}),this.getService(ie).setCustomStatuses(o)}catch(n){this.getService(N).catch("Error in _setCustomStatus: ",n)}}_enableInboxMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableInboxMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_INBOX_MODE_TRIGGERED),this.getService(ie).enableInboxMode()}catch(o){this.getService(N).catch("Error in _enableInboxMode: ",o)}}_setCustomPriority(o){this.getService(N).log("%c[WB] Calling FUNCTION: setCustomPriority","color: green;");try{this.trackEvent(ne.Events.Comments.SET_CUSTOM_PRIORITY_TRIGGERED,{payload:{customPriorities:o}}),this.getService(ie).setCustomPriorities(o)}catch(n){this.getService(N).catch("Error in _setCustomPriority: ",n)}}_setCustomCategory(o){this.getService(N).log("%c[WB] Calling FUNCTION: setCustomCategory","color: green;");try{this.trackEvent(ne.Events.Comments.SET_CUSTOM_CATEGORY_TRIGGERED,{payload:{customCategories:o}}),this.getService(ie).setCustomCategories(o)}catch(n){this.getService(N).catch("Error in _setCustomCategory: ",n)}}_disableInboxMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableInboxMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_INBOX_MODE_TRIGGERED),this.getService(ie).disableInboxMode()}catch(o){this.getService(N).catch("Error in _disableInboxMode: ",o)}}_enableAutoCategorize(){this.getService(N).log("%c[WB] Calling FUNCTION: enableAutoCategorize","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_AUTO_CATEGORIZE_TRIGGERED),this.getService(ie).setEnableAutoCategorize(!0)}catch(o){this.getService(N).catch("Error in _enableAutoCategorize: ",o)}}_disableAutoCategorize(){this.getService(N).log("%c[WB] Calling FUNCTION: disableAutoCategorize","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_AUTO_CATEGORIZE_TRIGGERED),this.getService(ie).setEnableAutoCategorize(!1)}catch(o){this.getService(N).catch("Error in _disableAutoCategorize: ",o)}}_enableDarkMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DARK_MODE_TRIGGERED),this.getService(ie).setCommentContainerDarkMode(!0)}catch(o){this.getService(N).catch("Error in _enableDarkMode: ",o)}}_disableDarkMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DARK_MODE_TRIGGERED),this.getService(ie).setCommentContainerDarkMode(!1)}catch(o){this.getService(N).catch("Error in _disableDarkMode: ",o)}}_setContextProvider(o){try{this.trackEvent(ne.Events.Comments.SET_CONTEXT_PROVIDER_TRIGGERED,{payload:{}}),this.getService(ie).setContextProvider(o)}catch(n){this.getService(N).catch("Error in _setContextProvider: ",n)}}_enableSuggestionMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSuggestionMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SUGGESTION_MODE_TRIGGERED),this.getService(ie).setSuggestionMode(!0)}catch(o){this.getService(N).catch("Error in _enableSuggestionMode: ",o)}}_disableSuggestionMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSuggestionMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SUGGESTION_MODE_TRIGGERED),this.getService(ie).setSuggestionMode(!1)}catch(o){this.getService(N).catch("Error in _disableSuggestionMode: ",o)}}_enableMobileMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableMobileMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_MOBILE_MODE_TRIGGERED),this.getService(ie).setMobileMode(!0)}catch(o){this.getService(N).catch("Error in _enableMobileMode: ",o)}}_disableMobileMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableMobileMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_MOBILE_MODE_TRIGGERED),this.getService(ie).setMobileMode(!1)}catch(o){this.getService(N).catch("Error in _disableMobileMode: ",o)}}_enableInlineCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableInlineCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_INLINE_COMMENT_MODE_TRIGGERED),this.getService(ie).enableInlineCommentMode()}catch(o){this.getService(N).catch("Error in _enableInlineCommentMode: ",o)}}_disableInlineCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableInlineCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_INLINE_COMMENT_MODE_TRIGGERED),this.getService(ie).disableInlineCommentMode()}catch(o){this.getService(N).catch("Error in _disableInlineCommentMode: ",o)}}_enableMinimap(){this.getService(N).log("%c[WB] Calling FUNCTION: enableMinimap","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_MINIMAP_TRIGGERED),this.getService(ie).enableMinimap()}catch(o){this.getService(N).catch("Error in _enableMinimap: ",o)}}_disableMinimap(){this.getService(N).log("%c[WB] Calling FUNCTION: disableMinimap","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_MINIMAP_TRIGGERED),this.getService(ie).disableMinimap()}catch(o){this.getService(N).catch("Error in _disableMinimap: ",o)}}_showCommentsOnDom(){this.getService(N).log("%c[WB] Calling FUNCTION: showCommentsOnDom","color: green;");try{this.trackEvent(ne.Events.Comments.SHOW_COMMENTS_ON_DOM_TRIGGERED),this.getService(ie).showCommentsOnDom()}catch(o){this.getService(N).catch("Error in _showCommentsOnDom: ",o)}}_hideCommentsOnDom(){this.getService(N).log("%c[WB] Calling FUNCTION: hideCommentsOnDom","color: green;");try{this.trackEvent(ne.Events.Comments.HIDE_COMMENTS_ON_DOM_TRIGGERED),this.getService(ie).hideCommentsOnDom()}catch(o){this.getService(N).catch("Error in _hideCommentsOnDom: ",o)}}_enableCommentTool(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCommentTool","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_COMMENT_TOOL_TRIGGERED),this.getService(ie).enableCommentTool()}catch(o){this.getService(N).catch("Error in _enableCommentTool: ",o)}}_disableCommentTool(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCommentTool","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_COMMENT_TOOL_TRIGGERED),this.getService(ie).disableCommentTool()}catch(o){this.getService(N).catch("Error in _disableCommentTool: ",o)}}_setTotalMediaLength(o){this.getService(N).log("%c[WB] Calling FUNCTION: setTotalMediaLength","color: green;");try{this.trackEvent(ne.Events.Comments.SET_TOTAL_MEDIA_LENGTH_TRIGGERED,{payload:{length:o}}),this.getService(ie).setTotalMediaLength(o)}catch(n){this.getService(N).catch("Error in _setTotalMediaLength: ",n)}}_onCommentAdd(){this.getService(N).log("%c[WB] Calling FUNCTION: onCommentAdd","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_COMMENT_ADD_TRIGGERED),this.getService(ie).onCommentAdd$()}catch(o){return this.getService(N).catch("Error in _onCommentAdd: ",o),Ee()}}_onCommentUpdate(){this.getService(N).log("%c[WB] Calling FUNCTION: onCommentUpdate","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_COMMENT_UPDATE_TRIGGERED),this.getService(ie).onCommentUpdate$()}catch(o){return this.getService(N).catch("Error in _onCommentUpdate: ",o),Ee()}}_addCommentOnSelectedText(){this.getService(N).log("%c[WB] Calling FUNCTION: addCommentOnSelectedText","color: green;");try{this.trackEvent(ne.Events.Comments.ADD_COMMENT_ON_SELECTED_TEXT_TRIGGERED),this.getService(ie).addCommentOnSelectedText()}catch(o){this.getService(N).catch("Error in _addCommentOnSelectedText: ",o)}}_enableSidebarUrlNavigation(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSidebarUrlNavigation","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED),this.getService(ie).enableSidebarUrlNavigation()}catch(o){this.getService(N).catch("Error in _enableSidebarUrlNavigation: ",o)}}_disableSidebarUrlNavigation(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSidebarUrlNavigation","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED),this.getService(ie).disableSidebarUrlNavigation()}catch(o){this.getService(N).catch("Error in _disableSidebarUrlNavigation: ",o)}}_setDStrategy(o){this.getService(N).log("%c[WB] Calling FUNCTION: setDStrategy","color: green;");try{this.trackEvent(ne.Events.Comments.SET_D_STRATEGY_TRIGGERED,{payload:{strategy:o}}),this.getService(ie).setDetectionStrategy(o)}catch(n){this.getService(N).catch("Error in _setDStrategy: ",n)}}_enableSidebarButtonOnCommentDialog(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSidebarButtonOnCommentDialog","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED),this.getService(ie).enableSidebarButtonOnCommentDialog()}catch(o){this.getService(N).catch("Error in _enableSidebarButtonOnCommentDialog: ",o)}}_disableSidebarButtonOnCommentDialog(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSidebarButtonOnCommentDialog","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED),this.getService(ie).disableSidebarButtonOnCommentDialog()}catch(o){this.getService(N).catch("Error in _disableSidebarButtonOnCommentDialog: ",o)}}_onSidebarButtonOnCommentDialogClick(){this.getService(N).log("%c[WB] Calling FUNCTION: onSidebarButtonOnCommentDialogClick","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_CLICK_TRIGGERED),this.getService(ie).getSidebarButtonOnCommentDialogClick$()}catch(o){return this.getService(N).catch("Error in _onSidebarButtonOnCommentDialogClick: ",o),Ee(null)}}_enableReactions(){this.getService(N).log("%c[WB] Calling FUNCTION: enableReactions","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_REACTIONS_TRIGGERED),this.getService(ie).enableReactions()}catch(o){this.getService(N).catch("Error in _enableReactions: ",o)}}_disableReactions(){this.getService(N).log("%c[WB] Calling FUNCTION: disableReactions","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_REACTIONS_TRIGGERED),this.getService(ie).disableReactions()}catch(o){this.getService(N).catch("Error in _disableReactions: ",o)}}_enableAnonymousEmail(){this.getService(N).log("%c[WB] Calling FUNCTION: enableAnonymousEmail","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_ANONYMOUS_EMAIL_TRIGGERED),this.getService(ie).enableAnonymousEmail()}catch(o){this.getService(N).catch("Error in _enableAnonymousEmail: ",o)}}_disableAnonymousEmail(){this.getService(N).log("%c[WB] Calling FUNCTION: disableAnonymousEmail","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_ANONYMOUS_EMAIL_TRIGGERED),this.getService(ie).disableAnonymousEmail()}catch(o){this.getService(N).catch("Error in _disableAnonymousEmail: ",o)}}_setRecordings(o){this.getService(N).log("%c[WB] Calling FUNCTION: setRecordings","color: green;");try{this.trackEvent(ne.Events.Comments.SET_RECORDINGS_TRIGGERED,{payload:{allowedRecordings:o}}),typeof o=="string"&&(o=o?.split(",")?.map(n=>n.trim())),this.getService(ie).setAllowedRecordings(o)}catch(n){this.getService(N).catch("Error in _setRecordings: ",n)}}_addCommentOnElement(o){this.getService(N).log("%c[WB] Calling FUNCTION: addCommentOnElement","color: green;");try{this.trackEvent(ne.Events.Comments.ADD_COMMENT_ON_ELEMENT_TRIGGERED,{payload:{data:o}}),this.getService(ie).addCommentOnElement(o)}catch(n){this.getService(N).catch("Error in _addCommentOnElement: ",n)}}_enablePrivateCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePrivateCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_PRIVATE_COMMENT_MODE_TRIGGERED),this.getService(ie).enablePrivateCommentMode()}catch(o){this.getService(N).catch("Error in _enablePrivateCommentMode: ",o)}}_disablePrivateCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePrivateCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_PRIVATE_COMMENT_MODE_TRIGGERED),this.getService(ie).disablePrivateCommentMode()}catch(o){this.getService(N).catch("Error in _disablePrivateCommentMode: ",o)}}_enablePrivateMode(o){this.getService(N).log("%c[WB] Calling FUNCTION: enablePrivateMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_PRIVATE_MODE_TRIGGERED,{payload:{config:o}}),this.getService(ie).enablePrivateMode(o)}catch(n){this.getService(N).catch("Error in _enablePrivateMode: ",n)}}_disablePrivateMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePrivateMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_PRIVATE_MODE_TRIGGERED),this.getService(ie).disablePrivateMode()}catch(o){this.getService(N).catch("Error in _disablePrivateMode: ",o)}}_enableScrollToComment(){this.getService(N).log("%c[WB] Calling FUNCTION: enableScrollToComment","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SCROLL_TO_COMMENT_TRIGGERED),this.getService(ie).enableScrollToComment()}catch(o){this.getService(N).catch("Error in _enableScrollToComment: ",o)}}_disableScrollToComment(){this.getService(N).log("%c[WB] Calling FUNCTION: disableScrollToComment","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SCROLL_TO_COMMENT_TRIGGERED),this.getService(ie).disableScrollToComment()}catch(o){this.getService(N).catch("Error in _disableScrollToComment: ",o)}}_enableUserMentions(){this.getService(N).log("%c[WB] Calling FUNCTION: enableUserMentions","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_USER_MENTIONS_TRIGGERED),this.getService(ie).enableUserMentions()}catch(o){this.getService(N).catch("Error in _enableUserMentions: ",o)}}_disableUserMentions(){this.getService(N).log("%c[WB] Calling FUNCTION: disableUserMentions","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_USER_MENTIONS_TRIGGERED),this.getService(ie).disableUserMentions()}catch(o){this.getService(N).catch("Error in _disableUserMentions: ",o)}}_setCommentSidebarFilters(o){this.getService(N).log("%c[WB] Calling FUNCTION: setCommentSidebarFilters","color: green;");try{this.trackEvent(ne.Events.Comments.SET_COMMENT_SIDEBAR_FILTERS_TRIGGERED,{payload:{filters:o}}),this.getService(ie).setCommentSidebarFilters(o)}catch(n){this.getService(N).catch("Error in _setCommentSidebarFilters: ",n)}}_setSystemFiltersOperator(o){this.getService(N).log("%c[WB] Calling FUNCTION: setSystemFiltersOperator","color: green;");try{this.trackEvent(ne.Events.Comments.SET_SYSTEM_FILTERS_OPERATOR_TRIGGERED,{payload:{operator:o}}),this.getService(ie).setCommentSidebarSystemFiltersOperator(o)}catch(n){this.getService(N).catch("Error in _setSystemFiltersOperator: ",n)}}_enableCommentPinHighlighter(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCommentPinHighlighter","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED),this.getService(ie).enableCommentPinHighlighter()}catch(o){this.getService(N).catch("Error in _enableCommentPinHighlighter: ",o)}}_disableCommentPinHighlighter(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCommentPinHighlighter","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED),this.getService(ie).disableCommentPinHighlighter()}catch(o){this.getService(N).catch("Error in _disableCommentPinHighlighter: ",o)}}_enableDeleteOnBackspace(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDeleteOnBackspace","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DELETE_ON_BACKSPACE_TRIGGERED),this.getService(ie).enableDeleteOnBackspace()}catch(o){this.getService(N).catch("Error in _enableDeleteOnBackspace: ",o)}}_disableDeleteOnBackspace(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDeleteOnBackspace","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DELETE_ON_BACKSPACE_TRIGGERED),this.getService(ie).disableDeleteOnBackspace()}catch(o){this.getService(N).catch("Error in _disableDeleteOnBackspace: ",o)}}_enableHotkey(){this.getService(N).log("%c[WB] Calling FUNCTION: enableHotkey","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_HOTKEY_TRIGGERED),this.getService(ie).enableHotkey()}catch(o){this.getService(N).catch("Error in _enableHotkey: ",o)}}_disableHotkey(){this.getService(N).log("%c[WB] Calling FUNCTION: disableHotkey","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_HOTKEY_TRIGGERED),this.getService(ie).disableHotkey()}catch(o){this.getService(N).catch("Error in _disableHotkey: ",o)}}_enableDeviceIndicatorOnCommentPins(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDeviceIndicatorOnCommentPins","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED),this.getService(ie).enableDeviceIndicatorOnCommentPins()}catch(o){this.getService(N).catch("Error in _enableDeviceIndicatorOnCommentPins: ",o)}}_disableDeviceIndicatorOnCommentPins(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDeviceIndicatorOnCommentPins","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED),this.getService(ie).disableDeviceIndicatorOnCommentPins()}catch(o){this.getService(N).catch("Error in _disableDeviceIndicatorOnCommentPins: ",o)}}_getElementRefByAnnotationId(o){this.getService(N).log("%c[WB] Calling FUNCTION: getElementRefByAnnotationId","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_ELEMENT_REF_BY_ANNOTATION_ID_TRIGGERED,{payload:{annotationId:o}}),this.getService(ie).getElementRefByAnnotationId(o)}catch(n){this.getService(N).catch("Error in _getElementRefByAnnotationId: ",n);return}}_scrollToCommentByAnnotationId(o){this.getService(N).log("%c[WB] Calling FUNCTION: scrollToCommentByAnnotationId","color: green;");try{this.trackEvent(ne.Events.Comments.SCROLL_TO_COMMENT_BY_ANNOTATION_ID_TRIGGERED,{payload:{annotationId:o}}),this.getService(ie).scrollToCommentByAnnotationId(o)}catch(n){this.getService(N).catch("Error in _scrollToCommentByAnnotationId: ",n)}}_selectCommentByAnnotationId(o){this.getService(N).log("%c[WB] Calling FUNCTION: selectCommentByAnnotationId","color: green;");try{this.trackEvent(ne.Events.Comments.SELECT_COMMENT_BY_ANNOTATION_ID_TRIGGERED,{payload:{annotationId:o}}),this.getService(ie).selectCommentByAnnotationId(o)}catch(n){this.getService(N).catch("Error in _selectCommentByAnnotationId: ",n)}}_enableRecordingSummary(){this.getService(N).log("%c[WB] Calling FUNCTION: enableRecordingSummary","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_RECORDING_SUMMARY_TRIGGERED),this.getService(ie).enableRecordingSummary()}catch(o){this.getService(N).catch("Error in _enableRecordingSummary: ",o)}}_disableRecordingSummary(){this.getService(N).log("%c[WB] Calling FUNCTION: disableRecordingSummary","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_RECORDING_SUMMARY_TRIGGERED),this.getService(ie).disableRecordingSummary()}catch(o){this.getService(N).catch("Error in _disableRecordingSummary: ",o)}}_enableRecordingTranscription(){this.getService(N).log("%c[WB] Calling FUNCTION: enableRecordingTranscription","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_RECORDING_TRANSCRIPTION_TRIGGERED),this.getService(Gu).enableRecordingTranscription()}catch(o){this.getService(N).catch("Error in _enableRecordingTranscription: ",o)}}_disableRecordingTranscription(){this.getService(N).log("%c[WB] Calling FUNCTION: disableRecordingTranscription","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_RECORDING_TRANSCRIPTION_TRIGGERED),this.getService(Gu).disableRecordingTranscription()}catch(o){this.getService(N).catch("Error in _disableRecordingTranscription: ",o)}}_enableRecordingCountdown(){this.getService(N).log("%c[WB] Calling FUNCTION: enableRecordingCountdown","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_RECORDING_COUNTDOWN_TRIGGERED),this.getService(ie).enableRecordingCountdown()}catch(o){this.getService(N).catch("Error in _enableRecordingCountdown: ",o)}}_disableRecordingCountdown(){this.getService(N).log("%c[WB] Calling FUNCTION: disableRecordingCountdown","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_RECORDING_COUNTDOWN_TRIGGERED),this.getService(ie).disableRecordingCountdown()}catch(o){this.getService(N).catch("Error in _disableRecordingCountdown: ",o)}}_setUnreadIndicatorMode(o){this.getService(N).log("%c[WB] Calling FUNCTION: setUnreadIndicatorMode","color: green;");try{this.trackEvent(ne.Events.Comments.SET_UNREAD_INDICATOR_MODE_TRIGGERED,{payload:{mode:o}}),this.getService(ie).setUnreadIndicatorMode(o)}catch(n){this.getService(N).catch("Error in _setUnreadIndicatorMode: ",n)}}_enableEnterKeyToSubmit(){this.getService(N).log("%c[WB] Calling FUNCTION: enableEnterKeyToSubmit","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED),this.getService(ie).enableEnterKeyToSubmit()}catch(o){this.getService(N).catch("Error in _enableEnterKeyToSubmit: ",o)}}_disableEnterKeyToSubmit(){this.getService(N).log("%c[WB] Calling FUNCTION: disableEnterKeyToSubmit","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED),this.getService(ie).disableEnterKeyToSubmit()}catch(o){this.getService(N).catch("Error in _disableEnterKeyToSubmit: ",o)}}_enablePinShadowDOM(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePinShadowDOM","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_PIN_SHADOW_DOM_TRIGGERED),this.getService(ie).enablePinShadowDOM()}catch(o){this.getService(N).catch("Error in _enablePinShadowDOM: ",o)}}_disablePinShadowDOM(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePinShadowDOM","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_PIN_SHADOW_DOM_TRIGGERED),this.getService(ie).disablePinShadowDOM()}catch(o){this.getService(N).catch("Error in _disablePinShadowDOM: ",o)}}_enableDialogShadowDOM(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDialogShadowDOM","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DIALOG_SHADOW_DOM_TRIGGERED),this.getService(ie).enableDialogShadowDOM()}catch(o){this.getService(N).catch("Error in _enableDialogShadowDOM: ",o)}}_disableDialogShadowDOM(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDialogShadowDOM","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DIALOG_SHADOW_DOM_TRIGGERED),this.getService(ie).disableDialogShadowDOM()}catch(o){this.getService(N).catch("Error in _disableDialogShadowDOM: ",o)}}_enableSidebarShadowDOM(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSidebarShadowDOM","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SIDEBAR_SHADOW_DOM_TRIGGERED),this.getService(ie).enableSidebarShadowDOM()}catch(o){this.getService(N).catch("Error in _enableSidebarShadowDOM: ",o)}}_disableSidebarShadowDOM(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSidebarShadowDOM","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SIDEBAR_SHADOW_DOM_TRIGGERED),this.getService(ie).disableSidebarShadowDOM()}catch(o){this.getService(N).catch("Error in _disableSidebarShadowDOM: ",o)}}_enableChangeDetectionInCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableChangeDetectionInCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED),this.getService(ie).enableChangeDetectionInCommentMode()}catch(o){this.getService(N).catch("Error in _enableChangeDetectionInCommentMode: ",o)}}_disableChangeDetectionInCommentMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableChangeDetectionInCommentMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED),this.getService(ie).disableChangeDetectionInCommentMode()}catch(o){this.getService(N).catch("Error in _disableChangeDetectionInCommentMode: ",o)}}_showResolvedCommentsOnDom(){this.getService(N).log("%c[WB] Calling FUNCTION: showResolvedCommentsOnDom","color: green;");try{this.trackEvent(ne.Events.Comments.SHOW_RESOLVED_COMMENTS_ON_DOM_TRIGGERED),this.getService(ie).showResolvedCommentsOnDom()}catch(o){this.getService(N).catch("Error in _showResolvedCommentsOnDom: ",o)}}_hideResolvedCommentsOnDom(){this.getService(N).log("%c[WB] Calling FUNCTION: hideResolvedCommentsOnDom","color: green;");try{this.trackEvent(ne.Events.Comments.HIDE_RESOLVED_COMMENTS_ON_DOM_TRIGGERED),this.getService(ie).hideResolvedCommentsOnDom()}catch(o){this.getService(N).catch("Error in _hideResolvedCommentsOnDom: ",o)}}_setCustomReactions(o){this.getService(N).log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;");try{this.trackEvent(ne.Events.Comments.SET_CUSTOM_REACTIONS_TRIGGERED,{payload:{reactions:o}}),this.getService(ie).setCustomReactions(o)}catch(n){this.getService(N).catch("Error in _setCustomReactions: ",n)}}_onCommentSelectionChange(){this.getService(N).log("%c[WB] Calling FUNCTION: onCommentSelectionChange","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_COMMENT_SELECTION_CHANGE_TRIGGERED),this.getService(ie).onCommentSelectionChange$()}catch(o){return this.getService(N).catch("Error in _onCommentSelectionChange: ",o),Ee(null)}}_getUnreadCommentCountByAnnotationId(o){this.getService(N).log("%c[WB] Calling FUNCTION: getUnreadCommentCountByAnnotationId","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_UNREAD_COMMENT_COUNT_BY_ANNOTATION_ID_TRIGGERED,{payload:{commentAnnotationId:o}}),this.getService(ie).getUnreadCommentCountByAnnotationId$(o)}catch(n){return this.getService(N).catch("Error in _getUnreadCommentCountByAnnotationId: ",n),Ee(null)}}_getUnreadCommentAnnotationCountOnCurrentDocument(){this.getService(N).log("%c[WB] Calling FUNCTION: getUnreadCommentAnnotationCountOnCurrentDocument","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_UNREAD_COMMENT_ANNOTATION_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED),this.getService(ie).getUnreadCommentAnnotationCountOnCurrentDocument$()}catch(o){return this.getService(N).catch("Error in _getUnreadCommentAnnotationCountOnCurrentDocument: ",o),Ee(null)}}_getUnreadCommentCountOnCurrentDocument(){this.getService(N).log("%c[WB] Calling FUNCTION: getUnreadCommentCountOnCurrentDocument","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_UNREAD_COMMENT_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED),this.getService(ie).getUnreadCommentCountOnCurrentDocument$()}catch(o){return this.getService(N).catch("Error in _getUnreadCommentCountOnCurrentDocument: ",o),Ee(null)}}_getUnreadCommentAnnotationCountByLocationId(o){this.getService(N).log("%c[WB] Calling FUNCTION: getUnreadCommentAnnotationCountByLocationId","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_UNREAD_COMMENT_ANNOTATION_COUNT_BY_LOCATION_ID_TRIGGERED,{payload:{locationId:o}}),this.getService(ie).getUnreadCommentAnnotationCountByLocationId$(o)}catch(n){return this.getService(N).catch("Error in _getUnreadCommentAnnotationCountByLocationId: ",n),Ee(null)}}_getUnreadCommentCountByLocationId(o){this.getService(N).log("%c[WB] Calling FUNCTION: getUnreadCommentCountByLocationId","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_UNREAD_COMMENT_COUNT_BY_LOCATION_ID_TRIGGERED,{payload:{locationId:o}}),this.getService(ie).getUnreadCommentCountByLocationId$(o)}catch(n){return this.getService(N).catch("Error in _getUnreadCommentCountByLocationId: ",n),Ee(null)}}_updateCommentDialogPosition(){this.getService(N).log("%c[WB] Calling FUNCTION: updateCommentDialogPosition","color: green;");try{this.trackEvent(ne.Events.Comments.UPDATE_COMMENT_DIALOG_POSITION_TRIGGERED),this.getService(ie).updateCommentDialogPosition()}catch(o){this.getService(N).catch("Error in _updateCommentDialogPosition: ",o)}}_enableAreaComment(){this.getService(N).log("%c[WB] Calling FUNCTION: enableAreaComment","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_AREA_COMMENT_TRIGGERED),this.getService(ie).enableAreaComment()}catch(o){this.getService(N).catch("Error in _enableAreaComment: ",o)}}_disableAreaComment(){this.getService(N).log("%c[WB] Calling FUNCTION: disableAreaComment","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_AREA_COMMENT_TRIGGERED),this.getService(ie).disableAreaComment()}catch(o){this.getService(N).catch("Error in _disableAreaComment: ",o)}}_setPinCursorImage(o){this.getService(N).log("%c[WB] Calling FUNCTION: setPinCursorImage","color: green;");try{this.trackEvent(ne.Events.Comments.SET_PIN_CURSOR_IMAGE_TRIGGERED,{payload:{image:o}}),this.getService(ie).setPinCursorImage(o)}catch(n){this.getService(N).catch("Error in _setPinCursorImage: ",n)}}_addManualComment(o){this.getService(N).log("%c[WB] Calling FUNCTION: addManualComment","color: green;");try{return this.trackEvent(ne.Events.Comments.ADD_MANUAL_COMMENT_TRIGGERED,{payload:{config:o}}),this.getService(ie).addManualComment(o)}catch(n){return this.getService(N).catch("Error in _addManualComment: ",n),Promise.resolve()}}_createCustomListDataOnAnnotation(o){this.getService(N).log("%c[WB] Calling FUNCTION: createCustomListDataOnAnnotation","color: green;");try{this.trackEvent(ne.Events.Comments.CREATE_CUSTOM_LIST_DATA_ON_ANNOTATION_TRIGGERED,{payload:{data:o}}),this.getService(ie).createCustomListDataOnAnnotation(o)}catch(n){this.getService(N).catch("Error in _createCustomListDataOnAnnotation: ",n)}}_createCustomListDataOnComment(o){this.getService(N).log("%c[WB] Calling FUNCTION: createCustomListDataOnComment","color: green;");try{return this.trackEvent(ne.Events.Comments.CREATE_CUSTOM_LIST_DATA_ON_COMMENT_TRIGGERED,{payload:{data:o}}),this.getService(Og).create(o)}catch(n){this.getService(N).catch("Error in _createCustomListDataOnComment: ",n)}}_excludeLocationIdsFromSidebar(o){this.getService(N).log("%c[WB] Calling FUNCTION: excludeLocationIdsFromSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.EXCLUDE_LOCATION_IDS_FROM_SIDEBAR_TRIGGERED,{payload:{locationIds:o}}),this.getService(ie).setExcludeLocationIdsFromSidebar(o)}catch(n){this.getService(N).catch("Error in _excludeLocationIdsFromSidebar: ",n)}}_enableBubbleOnPin(){this.getService(N).log("%c[WB] Calling FUNCTION: enableBubbleOnPin","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_BUBBLE_ON_PIN_TRIGGERED),this.getService(ie).enableBubbleOnPin()}catch(o){this.getService(N).catch("Error in _enableBubbleOnPin: ",o)}}_disableBubbleOnPin(){this.getService(N).log("%c[WB] Calling FUNCTION: disableBubbleOnPin","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_BUBBLE_ON_PIN_TRIGGERED),this.getService(ie).disableBubbleOnPin()}catch(o){this.getService(N).catch("Error in _disableBubbleOnPin: ",o)}}_enableBubbleOnPinHover(){this.getService(N).log("%c[WB] Calling FUNCTION: enableBubbleOnPinHover","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED),this.getService(ie).enableBubbleOnPinHover()}catch(o){this.getService(N).catch("Error in _enableBubbleOnPinHover: ",o)}}_disableBubbleOnPinHover(){this.getService(N).log("%c[WB] Calling FUNCTION: disableBubbleOnPinHover","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED),this.getService(ie).disableBubbleOnPinHover()}catch(o){this.getService(N).catch("Error in _disableBubbleOnPinHover: ",o)}}_enablePinDrag(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePinDrag","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_PIN_DRAG_TRIGGERED),this.getService(ie).enablePinDrag()}catch(o){this.getService(N).catch("Error in _enablePinDrag: ",o)}}_disablePinDrag(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePinDrag","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_PIN_DRAG_TRIGGERED),this.getService(ie).disablePinDrag()}catch(o){this.getService(N).catch("Error in _disablePinDrag: ",o)}}_enableMultiThread(){this.getService(N).log("%c[WB] Calling FUNCTION: enableMultiThread","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_MULTI_THREAD_TRIGGERED),this.getService(ie).enableMultiThread()}catch(o){this.getService(N).catch("Error in _enableMultiThread: ",o)}}_disableMultiThread(){this.getService(N).log("%c[WB] Calling FUNCTION: disableMultiThread","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_MULTI_THREAD_TRIGGERED),this.getService(ie).disableMultiThread()}catch(o){this.getService(N).catch("Error in _disableMultiThread: ",o)}}_enableGroupMatchedComments(){this.getService(N).log("%c[WB] Calling FUNCTION: enableGroupMatchedComments","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_GROUP_MATCHED_COMMENTS_TRIGGERED),this.getService(ie).enableGroupMatchedComments()}catch(o){this.getService(N).catch("Error in _enableGroupMatchedComments: ",o)}}_disableGroupMatchedComments(){this.getService(N).log("%c[WB] Calling FUNCTION: disableGroupMatchedComments","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_GROUP_MATCHED_COMMENTS_TRIGGERED),this.getService(ie).disableGroupMatchedComments()}catch(o){this.getService(N).catch("Error in _disableGroupMatchedComments: ",o)}}_enableRestrictTextSearchToAnchor(){this.getService(N).log("%c[WB] Calling FUNCTION: enableRestrictTextSearchToAnchor","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED),this.getService(ie).enableRestrictTextSearchToAnchor()}catch(o){this.getService(N).catch("Error in _enableRestrictTextSearchToAnchor: ",o)}}_disableRestrictTextSearchToAnchor(){this.getService(N).log("%c[WB] Calling FUNCTION: disableRestrictTextSearchToAnchor","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED),this.getService(ie).disableRestrictTextSearchToAnchor()}catch(o){this.getService(N).catch("Error in _disableRestrictTextSearchToAnchor: ",o)}}_updateContext(o,n,e){this.getService(N).log("%c[WB] Calling FUNCTION: updateContext","color: green;");try{return this.trackEvent(ne.Events.Comments.UPDATE_CONTEXT_TRIGGERED,{payload:{annotationId:o,context:n,config:e}}),this.getService(ie).updateCommentAnnotationContext(o,n,e)}catch(t){return this.getService(N).catch("Error in _updateContext: ",t),Promise.resolve()}}_updateVisibility(o){this.getService(N).log("%c[WB] Calling FUNCTION: updateVisibility","color: green;");try{return this.trackEvent(ne.Events.Comments.UPDATE_VISIBILITY_TRIGGERED,{payload:{visibility:o}}),this.getService(vt).updateVisibility(o)}catch(n){return this.getService(N).catch("Error in _updateVisibility: ",n),Promise.resolve()}}_getSelectedComments(){this.getService(N).log("%c[WB] Calling FUNCTION: getSelectedComments","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_SELECTED_COMMENTS_TRIGGERED),this.getService(Ne).getSelectedComments$()}catch(o){return this.getService(N).catch("Error in _getSelectedComments: ",o),Ee([])}}_enableDeleteReplyConfirmation(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDeleteReplyConfirmation","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED),this.getService(ie).enableDeleteReplyConfirmation()}catch(o){this.getService(N).catch("Error in _enableDeleteReplyConfirmation: ",o)}}_disableDeleteReplyConfirmation(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDeleteReplyConfirmation","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED),this.getService(ie).disableDeleteReplyConfirmation()}catch(o){this.getService(N).catch("Error in _disableDeleteReplyConfirmation: ",o)}}_onCopyLink(){this.getService(N).log("%c[WB] Calling FUNCTION: onCopyLink","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_COPY_LINK_TRIGGERED),this.getService(ie).getCopyLink$()}catch(o){return this.getService(N).catch("Error in _onCopyLink: ",o),Ee("")}}_getCommentAnnotationById(o){this.getService(N).log("%c[WB] Calling FUNCTION: getCommentAnnotationById","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_COMMENT_ANNOTATION_BY_ID_TRIGGERED,{payload:{config:o}}),this.getService(ie).getCommentAnnotationById(o)}catch(n){return this.getService(N).catch("Error in _getCommentAnnotationById: ",n),Ee(null)}}_enableCollapsedComments(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCollapsedComments","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_COLLAPSED_COMMENTS_TRIGGERED),this.getService(ie).enableCollapsedComments()}catch(o){this.getService(N).catch("Error in _enableCollapsedComments: ",o)}}_disableCollapsedComments(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCollapsedComments","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_COLLAPSED_COMMENTS_TRIGGERED),this.getService(ie).disableCollapsedComments()}catch(o){this.getService(N).catch("Error in _disableCollapsedComments: ",o)}}_enableCollapsedRepliesPreview(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCollapsedRepliesPreview","color: green;");try{this.getService(ie).enableCollapsedRepliesPreview()}catch(o){this.getService(N).catch("Error in _enableCollapsedRepliesPreview: ",o)}}_disableCollapsedRepliesPreview(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCollapsedRepliesPreview","color: green;");try{this.getService(ie).disableCollapsedRepliesPreview()}catch(o){this.getService(N).catch("Error in _disableCollapsedRepliesPreview: ",o)}}_onCommentSidebarActionButtonClick(){this.getService(N).log("%c[WB] Calling FUNCTION: onCommentSidebarActionButtonClick","color: green;");try{return this.getService(ie).getSidebarCustomActionEventData()}catch(o){return this.getService(N).catch("Error in _onCommentSidebarActionButtonClick: ",o),Ee(null)}}_setCommentSidebarData(o,n){this.getService(N).log("%c[WB] Calling FUNCTION: setCommentSidebarData","color: green;");try{this.trackEvent(ne.Events.Comments.SET_COMMENT_SIDEBAR_DATA_TRIGGERED,{payload:{data:o,options:n}}),this.getService(ie).setCommentSidebarData(o,n)}catch(e){this.getService(N).catch("Error in _setCommentSidebarData: ",e)}}_onCommentSidebarInit(){this.getService(N).log("%c[WB] Calling FUNCTION: onCommentSidebarInit","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_COMMENT_SIDEBAR_INIT_TRIGGERED),this.getService(ie).getSidebarCustomActionEventDataOnInit()}catch(o){return this.getService(N).catch("Error in _onCommentSidebarInit: ",o),Ee(null)}}_onCommentSidebarData(){this.getService(N).log("%c[WB] Calling FUNCTION: onCommentSidebarData","color: green;");try{return this.trackEvent(ne.Events.Comments.ON_COMMENT_SIDEBAR_DATA_TRIGGERED),this.getService(ie).getSidebarCustomActionEventDataAllChanges()}catch(o){return this.getService(N).catch("Error in _onCommentSidebarData: ",o),Ee(null)}}_setCommentSidebarDefaultCustomActions(o){this.getService(N).log("%c[WB] Calling FUNCTION: setCommentSidebarDefaultCustomActions","color: green;");try{this.trackEvent(ne.Events.Comments.SET_COMMENT_SIDEBAR_DEFAULT_CUSTOM_ACTIONS_TRIGGERED,{payload:{actions:o}}),this.getService(ie).setSidebarCustomActionEventData(o,[],{},[],{})}catch(n){this.getService(N).catch("Error in _setCommentSidebarDefaultCustomActions: ",n)}}_enableSidebarCustomActions(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSidebarCustomActions","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED),this.getService(ie).enableSidebarCustomActions()}catch(o){this.getService(N).catch("Error in _enableSidebarCustomActions: ",o)}}_disableSidebarCustomActions(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSidebarCustomActions","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED),this.getService(ie).disableSidebarCustomActions()}catch(o){this.getService(N).catch("Error in _disableSidebarCustomActions: ",o)}}_enableQueryParamsComments(){this.getService(N).log("%c[WB] Calling FUNCTION: enableQueryParamsComments","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_QUERY_PARAMS_COMMENTS_TRIGGERED),this.getService(ie).enableQueryParamsComments()}catch(o){this.getService(N).catch("Error in _enableQueryParamsComments: ",o)}}_disableQueryParamsComments(){this.getService(N).log("%c[WB] Calling FUNCTION: disableQueryParamsComments","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_QUERY_PARAMS_COMMENTS_TRIGGERED),this.getService(ie).disableQueryParamsComments()}catch(o){this.getService(N).catch("Error in _disableQueryParamsComments: ",o)}}_enableResolveStatusAccessAdminOnly(){this.getService(N).log("%c[WB] Calling FUNCTION: enableResolveStatusAccessAdminOnly","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED),this.getService(ie).enableResolveStatusAccessAdminOnly()}catch(o){this.getService(N).catch("Error in _enableResolveStatusAccessAdminOnly: ",o)}}_disableResolveStatusAccessAdminOnly(){this.getService(N).log("%c[WB] Calling FUNCTION: disableResolveStatusAccessAdminOnly","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED),this.getService(ie).disableResolveStatusAccessAdminOnly()}catch(o){this.getService(N).catch("Error in _disableResolveStatusAccessAdminOnly: ",o)}}_enableLinkCallback(){this.getService(N).log("%c[WB] Calling FUNCTION: enableLinkCallback","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_LINK_CALLBACK_TRIGGERED),this.getService(ie).enableLinkCallback()}catch(o){this.getService(N).catch("Error in _enableLinkCallback: ",o)}}_disableLinkCallback(){this.getService(N).log("%c[WB] Calling FUNCTION: disableLinkCallback","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_LINK_CALLBACK_TRIGGERED),this.getService(ie).disableLinkCallback()}catch(o){this.getService(N).catch("Error in _disableLinkCallback: ",o)}}_enableSeenByUsers(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSeenByUsers","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SEEN_BY_USERS_TRIGGERED),this.getService(ie).enableSeenByUsers()}catch(o){this.getService(N).catch("Error in _enableSeenByUsers: ",o)}}_disableSeenByUsers(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSeenByUsers","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SEEN_BY_USERS_TRIGGERED),this.getService(ie).disableSeenByUsers()}catch(o){this.getService(N).catch("Error in _disableSeenByUsers: ",o)}}_enableShortUserName(){this.getService(N).log("%c[WB] Calling FUNCTION: enableShortUserName","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SHORT_USER_NAME_TRIGGERED),this.getService(ie).enableShortUserName()}catch(o){this.getService(N).catch("Error in _enableShortUserName: ",o)}}_disableShortUserName(){this.getService(N).log("%c[WB] Calling FUNCTION: disableShortUserName","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SHORT_USER_NAME_TRIGGERED),this.getService(ie).disableShortUserName()}catch(o){this.getService(N).catch("Error in _disableShortUserName: ",o)}}_addCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: addCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.ADD_COMMENT_ANNOTATION_TRIGGERED,{payload:{addCommentAnnotationRequest:o}}),this.getService(vt).convert(o).addCommentAnnotation(o,"external")}catch(n){return this.getService(N).catch("Error in _addCommentAnnotation: ",n),null}})}_approveCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: approveCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.APPROVE_COMMENT_ANNOTATION_TRIGGERED,{payload:{approveCommentAnnotationRequest:o}}),this.getService(vt).convert(o).approveCommentAnnotation(o,"external")}catch(n){return this.getService(N).catch("Error in _approveCommentAnnotation: ",n),null}})}_acceptCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: acceptCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.ACCEPT_COMMENT_ANNOTATION_TRIGGERED,{payload:{acceptCommentAnnotationRequest:o}}),this.getService(vt).convert(o).acceptCommentAnnotation(o,"external")}catch(n){return this.getService(N).catch("Error in _acceptCommentAnnotation: ",n),null}})}_rejectCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: rejectCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.REJECT_COMMENT_ANNOTATION_TRIGGERED,{payload:{rejectCommentAnnotationRequest:o}}),this.getService(vt).convert(o).rejectCommentAnnotation(o,"external")}catch(n){return this.getService(N).catch("Error in _rejectCommentAnnotation: ",n),null}})}_subscribeCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: subscribeCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.SUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED,{payload:{subscribeCommentAnnotationRequest:o}}),this.getService(vt).convert(o).toggleNotificationSubscription(o,"subscribe")}catch(n){return this.getService(N).catch("Error in _subscribeCommentAnnotation: ",n),null}})}_unsubscribeCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: unsubscribeCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.UNSUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED,{payload:{unsubscribeCommentAnnotationRequest:o}}),this.getService(vt).convert(o).toggleNotificationSubscription(o,"unsubscribe")}catch(n){return this.getService(N).catch("Error in _unsubscribeCommentAnnotation: ",n),null}})}_deleteCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: deleteCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.DELETE_COMMENT_ANNOTATION_TRIGGERED,{payload:{deleteCommentAnnotationRequest:o}}),this.getService(vt).convert(o).deleteCommentAnnotation(o,"external")}catch(n){return this.getService(N).catch("Error in _deleteCommentAnnotation: ",n),null}})}_getCommentAnnotations(o){this.getService(N).log("%c[WB] Calling FUNCTION: getCommentAnnotations","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_COMMENT_ANNOTATIONS_TRIGGERED,{payload:{query:o}}),this.getService(vt).getCommentAnnotations(o).pipe(Oe(n=>(n.data&&Object.keys(n.data).forEach(e=>{if(n.data?.[e]?.length){let t=n.data[e];n.data[e]=t?.map(a=>this.getService(ie).getCommentAnnotationForClient(a))}}),n)))}catch(n){return this.getService(N).catch("Error in _getCommentAnnotations: ",n),Ee({data:null})}}_getCommentAnnotationsCount(o){this.getService(N).log("%c[WB] Calling FUNCTION: getCommentAnnotationsCount","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_COMMENT_ANNOTATIONS_COUNT_TRIGGERED,{payload:{query:o}}),this.getService(vt).getCommentAnnotationsCount$(o)}catch(n){return this.getService(N).catch("Error in _getCommentAnnotationsCount: ",n),Ee({data:null})}}_assignUser(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: assignUser","color: green;");try{return this.trackEvent(ne.Events.Comments.ASSIGN_USER_TRIGGERED,{payload:{assignUserRequest:o}}),this.getService(vt).convert(o).assignUser(o,"external")}catch(n){return this.getService(N).catch("Error in _assignUser: ",n),null}})}_updatePriority(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: updatePriority","color: green;");try{return this.trackEvent(ne.Events.Comments.UPDATE_PRIORITY_TRIGGERED,{payload:{updatePriorityRequest:o}}),this.getService(vt).convert(o).updatePriority(o,"external")}catch(n){return this.getService(N).catch("Error in _updatePriority: ",n),null}})}_updateStatus(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: updateStatus","color: green;");try{return this.trackEvent(ne.Events.Comments.UPDATE_STATUS_TRIGGERED,{payload:{updateStatusRequest:o}}),this.getService(vt).convert(o).updateStatus(o,"external")}catch(n){return this.getService(N).catch("Error in _updateStatus: ",n),null}})}_updateAccess(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: updateAccess","color: green;");try{return this.trackEvent(ne.Events.Comments.UPDATE_ACCESS_TRIGGERED,{payload:{updateAccessRequest:o}}),this.getService(vt).convert(o).updateAccess(o,"external")}catch(n){return this.getService(N).catch("Error in _updateAccess: ",n),null}})}_resolveCommentAnnotation(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: resolveCommentAnnotation","color: green;");try{return this.trackEvent(ne.Events.Comments.RESOLVE_COMMENT_ANNOTATION_TRIGGERED,{payload:{resolveCommentAnnotationRequest:o}}),this.getService(vt).convert(o).resolveCommentAnnotation(o)}catch(n){return this.getService(N).catch("Error in _resolveCommentAnnotation: ",n),null}})}_getLink(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: getLink","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_LINK_TRIGGERED,{payload:{getLinkRequest:o}}),this.getService(vt).convert(o).getLink(o,"external")}catch(n){return this.getService(N).catch("Error in _getLink: ",n),null}})}_copyLink(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: copyLink","color: green;");try{return this.trackEvent(ne.Events.Comments.COPY_LINK_TRIGGERED,{payload:{copyLinkRequest:o}}),this.getService(vt).convert(o).copyLink(o,"external")}catch(n){return this.getService(N).catch("Error in _copyLink: ",n),null}})}_addComment(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: addComment","color: green;");try{return this.trackEvent(ne.Events.Comments.ADD_COMMENT_TRIGGERED,{payload:{addCommentRequest:o}}),this.getService(vt).convert(o).addComment(o,"external")}catch(n){return this.getService(N).catch("Error in _addComment: ",n),null}})}_updateComment(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{return this.trackEvent(ne.Events.Comments.UPDATE_COMMENT_TRIGGERED,{payload:{updateCommentRequest:o}}),this.getService(vt).convert(o).updateComment(o,"external")}catch(n){return this.getService(N).catch("Error in _updateComment: ",n),null}})}_deleteComment(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: deleteComment","color: green;");try{return this.trackEvent(ne.Events.Comments.DELETE_COMMENT_TRIGGERED,{payload:{deleteCommentRequest:o}}),this.getService(vt).convert(o).deleteComment(o,"external")}catch(n){return this.getService(N).catch("Error in _deleteComment: ",n),null}})}_getComment(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: getComment","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_COMMENT_TRIGGERED,{payload:{getCommentRequest:o}}),this.getService(vt).convert(o).getComment(o)}catch(n){return this.getService(N).catch("Error in _getComment: ",n),[]}})}_addAttachment(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: addAttachment","color: green;");try{return this.trackEvent(ne.Events.Comments.ADD_ATTACHMENT_TRIGGERED,{payload:{addAttachmentRequest:o}}),this.getService(vt).convert(o).addAttachment(o)}catch(n){return this.getService(N).catch("Error in _addAttachment: ",n),Promise.resolve([])}})}_deleteAttachment(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: deleteAttachment","color: green;");try{return this.trackEvent(ne.Events.Comments.DELETE_ATTACHMENT_TRIGGERED,{payload:{deleteAttachmentRequest:o}}),this.getService(vt).convert(o).deleteAttachment(o)}catch(n){return this.getService(N).catch("Error in _deleteAttachment: ",n),null}})}_getAttachment(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: getAttachment","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_ATTACHMENT_TRIGGERED,{payload:{getAttachmentRequest:o}}),this.getService(vt).convert(o).getAttachment(o)}catch(n){return this.getService(N).catch("Error in _getAttachment: ",n),[]}})}_getRecording(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: getRecording","color: green;");try{return this.trackEvent(ne.Events.Comments.GET_RECORDING_TRIGGERED,{payload:{getRecordingRequest:o}}),this.getService(vt).convert(o).getRecording(o)}catch(n){return this.getService(N).catch("Error in _getRecording: ",n),[]}})}_deleteRecording(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: deleteRecording","color: green;");try{return this.trackEvent(ne.Events.Comments.DELETE_RECORDING_TRIGGERED,{payload:{deleteRecordingRequest:o}}),this.getService(vt).convert(o).deleteRecording(o)}catch(n){return this.getService(N).catch("Error in _deleteRecording: ",n),null}})}_fetchCommentAnnotations(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: fetchCommentAnnotations","color: green;");try{return this.trackEvent(ne.Events.Comments.FETCH_COMMENT_ANNOTATIONS_TRIGGERED,{payload:{fetchCommentAnnotationsRequest:o}}),this.getService(vt).fetchCommentAnnotations(o)}catch(n){return this.getService(N).catch("Error in _fetchCommentAnnotations: ",n),{data:null}}})}_addReaction(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{return this.trackEvent(ne.Events.Comments.ADD_REACTION_TRIGGERED,{payload:{addReactionRequest:o}}),this.getService(vt).convert(o).toggleReaction(o,"add")}catch(n){return this.getService(N).catch("Error in _addReaction: ",n),null}})}_deleteReaction(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: deleteReaction","color: green;");try{return this.trackEvent(ne.Events.Comments.DELETE_REACTION_TRIGGERED,{payload:{deleteReactionRequest:o}}),this.getService(vt).convert(o).toggleReaction(o,"delete")}catch(n){return this.getService(N).catch("Error in _deleteReaction: ",n),null}})}_toggleReaction(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: toggleReaction","color: green;");try{return this.trackEvent(ne.Events.Comments.TOGGLE_REACTION_TRIGGERED,{payload:{toggleReactionRequest:o}}),this.getService(vt).convert(o).toggleReaction(o)}catch(n){return this.getService(N).catch("Error in _toggleReaction: ",n),null}})}_on(o){this.getService(N).log("%c[WB] Calling FUNCTION: on","color: green;");try{return this.getService(vt).onAction(o)}catch(n){return this.getService(N).catch("Error in _on: ",n),Ee(null)}}_enableReadOnly(){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: enableReadOnly","color: green;");try{return this.trackEvent(ne.Events.Comments.ENABLE_READ_ONLY_TRIGGERED),this.getService(ie).enableReadOnly()}catch(o){this.getService(N).catch("Error in _toggleReaction: ",o);return}})}_disableReadOnly(){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: disableReadOnly","color: green;");try{return this.trackEvent(ne.Events.Comments.DISABLE_READ_ONLY_TRIGGERED),this.getService(ie).disableReadOnly()}catch(o){this.getService(N).catch("Error in _disableReadOnly: ",o);return}})}_setAssignToType(o){this.getService(N).log("%c[WB] Calling FUNCTION: setAssignToType","color: green;");try{this.trackEvent(ne.Events.Comments.SET_ASSIGN_TO_TYPE_TRIGGERED,{payload:{type:o.type}}),this.getService(ie).setAssignToType(o)}catch(n){this.getService(N).catch("Error in _setAssignToType: ",n)}}_enableContextInPageModeComposer(){this.getService(N).log("%c[WB] Calling FUNCTION: enableContextInPageModeComposer","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ie).enableContextInPageModeComposer()}catch(o){this.getService(N).catch("Error in _enableContextInPageModeComposer: ",o)}}_disableContextInPageModeComposer(){this.getService(N).log("%c[WB] Calling FUNCTION: disableContextInPageModeComposer","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ie).disableContextInPageModeComposer()}catch(o){this.getService(N).catch("Error in _disableContextInPageModeComposer: ",o)}}_clearPageModeComposerContext(){this.getService(N).log("%c[WB] Calling FUNCTION: clearPageModeComposerContext","color: green;");try{this.trackEvent(ne.Events.Comments.CLEAR_PAGE_MODE_COMPOSER_CONTEXT_TRIGGERED),this.getService(ie).clearPageModeComposerContext()}catch(o){this.getService(N).catch("Error in _clearPageModeComposerContext: ",o)}}_setContextInPageModeComposer(o){this.getService(N).log("%c[WB] Calling FUNCTION: setContextInPageModeComposer","color: green;");try{this.trackEvent(ne.Events.Comments.SET_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ie).setPageModeComposerContext(o)}catch(n){this.getService(N).catch("Error in _setContextInPageModeComposer: ",n)}}_focusPageModeComposer(){this.getService(N).log("%c[WB] Calling FUNCTION: focusPageModeComposer","color: green;");try{this.trackEvent(ne.Events.Comments.FOCUS_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ie).focusPageModeComposer()}catch(o){this.getService(N).catch("Error in _focusPageModeComposer: ",o)}}_enableCustomAutocompleteSearch(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCustomAutocompleteSearch","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED),this.getService(ie).enableCustomAutocompleteSearch()}catch(o){this.getService(N).catch("Error in _enableCustomAutocompleteSearch: ",o);return}}_disableCustomAutocompleteSearch(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCustomAutocompleteSearch","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED),this.getService(ie).disableCustomAutocompleteSearch()}catch(o){this.getService(N).catch("Error in _disableCustomAutocompleteSearch: ",o);return}}_setTransformContext(o){this.getService(N).log("%c[WB] Calling FUNCTION: setTransformContext","color: green;");try{this.trackEvent(ne.Events.Comments.SET_TRANSFORM_CONTEXT_TRIGGERED,{payload:{transformContext:o}}),this.getService(ie).setTransformContext(o)}catch(n){this.getService(N).catch("Error in _setTransformContext: ",n);return}}_enableSvgAsImg(){this.getService(N).log("%c[WB] Calling FUNCTION: enableSvgAsImg","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SVG_AS_IMG_TRIGGERED),this.getService(ie).enableSvgAsImg()}catch(o){this.getService(N).catch("Error in _enableSvgAsImg: ",o);return}}_disableSvgAsImg(){this.getService(N).log("%c[WB] Calling FUNCTION: disableSvgAsImg","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SVG_AS_IMG_TRIGGERED),this.getService(ie).disableSvgAsImg()}catch(o){this.getService(N).catch("Error in _disableSvgAsImg: ",o);return}}_enableFullExpanded(){this.getService(N).log("%c[WB] Calling FUNCTION: enableFullExpanded","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_FULL_EXPANDED_TRIGGERED),this.getService(ie).enableFullExpanded()}catch(o){this.getService(N).catch("Error in _enableFullExpanded: ",o);return}}_disableFullExpanded(){this.getService(N).log("%c[WB] Calling FUNCTION: disableFullExpanded","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_FULL_EXPANDED_TRIGGERED),this.getService(ie).disableFullExpanded()}catch(o){this.getService(N).catch("Error in _disableFullExpanded: ",o);return}}_enableCommentToNearestAllowedElement(){this.getService(N).log("%c[WB] Calling FUNCTION: enableCommentToNearestAllowedElement","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED),this.getService(ie).enableCommentToNearestAllowedElement()}catch(o){this.getService(N).catch("Error in _enableCommentToNearestAllowedElement: ",o);return}}_disableCommentToNearestAllowedElement(){this.getService(N).log("%c[WB] Calling FUNCTION: disableCommentToNearestAllowedElement","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED),this.getService(ie).disableCommentToNearestAllowedElement()}catch(o){this.getService(N).catch("Error in _disableCommentToNearestAllowedElement: ",o);return}}_enableDraftMode(){this.getService(N).log("%c[WB] Calling FUNCTION: enableDraftMode","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_DRAFT_MODE_TRIGGERED),this.getService(ie).enableDraftMode()}catch(o){this.getService(N).catch("Error in _enableDraftMode: ",o);return}}_disableDraftMode(){this.getService(N).log("%c[WB] Calling FUNCTION: disableDraftMode","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_DRAFT_MODE_TRIGGERED),this.getService(ie).disableDraftMode()}catch(o){this.getService(N).catch("Error in _disableDraftMode: ",o);return}}_enableFilterCommentsOnDom(){this.getService(N).log("%c[WB] Calling FUNCTION: enableFilterCommentsOnDom","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED),this.getService(ie).enableFilterCommentsOnDom()}catch(o){this.getService(N).catch("Error in _enableFilterCommentsOnDom: ",o);return}}_disableFilterCommentsOnDom(){this.getService(N).log("%c[WB] Calling FUNCTION: disableFilterCommentsOnDom","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED),this.getService(ie).disableFilterCommentsOnDom()}catch(o){this.getService(N).catch("Error in _disableFilterCommentsOnDom: ",o);return}}_enableReplyAvatars(){this.getService(N).log("%c[WB] Calling FUNCTION: enableReplyAvatars","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_REPLY_AVATARS_TRIGGERED),this.getService(ie).enableReplyAvatars()}catch(o){this.getService(N).catch("Error in _enableReplyAvatars: ",o);return}}_disableReplyAvatars(){this.getService(N).log("%c[WB] Calling FUNCTION: disableReplyAvatars","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_REPLY_AVATARS_TRIGGERED),this.getService(ie).disableReplyAvatars()}catch(o){this.getService(N).catch("Error in _disableReplyAvatars: ",o);return}}_setMaxReplyAvatars(o){this.getService(N).log("%c[WB] Calling FUNCTION: setMaxReplyAvatars","color: green;");try{this.trackEvent(ne.Events.Comments.SET_MAX_REPLY_AVATARS_TRIGGERED,{payload:{maxReplyAvatars:o}}),this.getService(ie).setMaxReplyAvatars(o)}catch(n){this.getService(N).catch("Error in _setMaxReplyAvatars: ",n);return}}_setSidebarButtonCountType(o){this.getService(N).log("%c[WB] Calling FUNCTION: setSidebarButtonCountType","color: green;");try{this.trackEvent(ne.Events.Comments.SET_SIDEBAR_BUTTON_COUNT_TYPE_TRIGGERED,{payload:{type:o}}),this.getService(ie).setSidebarButtonCountType(o)}catch(n){this.getService(N).catch("Error in _setSidebarButtonCountType: ",n);return}}_enableFilterGhostCommentsInSidebar(){this.getService(N).log("%c[WB] Calling FUNCTION: enableFilterGhostCommentsInSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED),this.getService(ie).enableFilterGhostCommentsInSidebar()}catch(o){this.getService(N).catch("Error in _enableFilterGhostCommentsInSidebar: ",o);return}}_disableFilterGhostCommentsInSidebar(){this.getService(N).log("%c[WB] Calling FUNCTION: disableFilterGhostCommentsInSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED),this.getService(ie).disableFilterGhostCommentsInSidebar()}catch(o){this.getService(N).catch("Error in _disableFilterGhostCommentsInSidebar: ",o);return}}_enableFullScreenInSidebar(){this.getService(N).log("%c[WB] Calling FUNCTION: enableFullScreenInSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED),this.getService(ie).enableFullScreenInSidebar()}catch(o){this.getService(N).catch("Error in _enableFullScreenInSidebar: ",o);return}}_disableFullScreenInSidebar(){this.getService(N).log("%c[WB] Calling FUNCTION: disableFullScreenInSidebar","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED),this.getService(ie).disableFullScreenInSidebar()}catch(o){this.getService(N).catch("Error in _disableFullScreenInSidebar: ",o);return}}_setComposerFileAttachments(o){this.getService(N).log("%c[WB] Calling FUNCTION: setComposerFileAttachments","color: green;");try{this.getService(ie).setComposerFileAttachments(o),this.trackEvent(ne.Events.Comments.SET_COMPOSER_FILE_ATTACHMENTS_TRIGGERED,{payload:{data:o}})}catch(n){this.getService(N).catch("Error in _setComposerFileAttachments: ",n);return}}_setAllowedFileTypes(o){this.getService(N).log("%c[WB] Calling FUNCTION: setAllowedFileTypes","color: green;");try{this.trackEvent(ne.Events.Comments.COMMENT_ATTACHMENT_SET_ALLOWED_FILE_TYPES_TRIGGERED,{payload:{allowedFileTypes:o}}),this.getService(ie).setAllowedFileTypes(o)}catch(n){this.getService(N).catch("Error in _setAllowedFileTypes: ",n);return}}_enableForceCloseAllOnEsc(){this.getService(N).log("%c[WB] Calling FUNCTION: enableForceCloseAllOnEsc","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED),this.getService(ie).enableForceCloseAllOnEsc()}catch(o){this.getService(N).catch("Error in _enableForceCloseAllOnEsc: ",o);return}}_disableForceCloseAllOnEsc(){this.getService(N).log("%c[WB] Calling FUNCTION: disableForceCloseAllOnEsc","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED),this.getService(ie).disableForceCloseAllOnEsc()}catch(o){this.getService(N).catch("Error in _disableForceCloseAllOnEsc: ",o);return}}_markAsRead(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: markAsRead","color: green;");try{this.trackEvent(ne.Events.Comments.MARK_AS_READ_TRIGGERED,{payload:{annotationId:o}}),yield this.getService(ie).markAsRead(o);return}catch(n){this.getService(N).catch("Error in _markAsRead: ",n);return}})}_markAsUnread(o){return Pe(this,null,function*(){this.getService(N).log("%c[WB] Calling FUNCTION: markAsUnread","color: green;");try{this.trackEvent(ne.Events.Comments.MARK_AS_UNREAD_TRIGGERED,{payload:{annotationId:o}}),yield this.getService(ie).markAsUnread(o)}catch(n){this.getService(N).catch("Error in _markAsUnread: ",n);return}})}_enableScreenshot(){this.getService(N).log("%c[WB] Calling FUNCTION: enableScreenshot","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_SCREENSHOT_TRIGGERED),this.getService(ie).enableScreenshot()}catch(o){this.getService(N).catch("Error in _enableScreenshot: ",o);return}}_disableScreenshot(){this.getService(N).log("%c[WB] Calling FUNCTION: disableScreenshot","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_SCREENSHOT_TRIGGERED),this.getService(ie).disableScreenshot()}catch(o){this.getService(N).catch("Error in _disableScreenshot: ",o);return}}_enablePaginatedContactList(){this.getService(N).log("%c[WB] Calling FUNCTION: enablePaginatedContactList","color: green;");try{this.trackEvent(ne.Events.Comments.ENABLE_PAGINATED_CONTACT_LIST_TRIGGERED),this.getService(ie).enablePaginatedContactList()}catch(o){this.getService(N).catch("Error in _enablePaginatedContactList: ",o);return}}_disablePaginatedContactList(){this.getService(N).log("%c[WB] Calling FUNCTION: disablePaginatedContactList","color: green;");try{this.trackEvent(ne.Events.Comments.DISABLE_PAGINATED_CONTACT_LIST_TRIGGERED),this.getService(ie).disablePaginatedContactList()}catch(o){this.getService(N).catch("Error in _disablePaginatedContactList: ",o);return}}};function Xy(r,o){r&1&&(de(),b(0,"svg",4),E(1,"rect",11),x())}function qy(r,o){r&1&&(de(),b(0,"svg",4),E(1,"rect",12)(2,"path",13),x())}function Qy(r,o){if(r&1){let n=J();b(0,"div",10),H("click",function(t){return B(n),l(2).onCheckboxToggle(),V(t.stopPropagation())})("keydown.space",function(t){return B(n),l(2).onCheckboxToggle(),t.preventDefault(),V(t.stopPropagation())})("keydown.enter",function(t){return B(n),l(2).onCheckboxToggle(),t.preventDefault(),V(t.stopPropagation())}),y(1,Xy,2,0,":svg:svg",4),y(2,qy,3,0,":svg:svg",4),x()}if(r&2){let n=l(2);ue("velt-assign-dropdown--checkbox-icon-selected",n.isAssignedCheckbox),k("data-testid",n.componentId+"-checkbox-icon")("aria-checked",n.isAssignedCheckbox),d(),w(n.isAssignedCheckbox?-1:1),d(),w(n.isAssignedCheckbox?2:-1)}}function e2(r,o){if(r&1&&(de(),b(0,"svg",4)(1,"g"),E(2,"path",14)(3,"path",15)(4,"path",16),x()()),r&2){let n=l(2);k("data-testid",n.componentId+"-icon")}}function t2(r,o){if(r&1){let n=J();u(0,9),b(1,"div",17),H("click",function(){let t=B(n).$implicit,a=l(2);return V(a.assignContact(t))}),b(2,"div",18),E(3,"snippyly-user-avatar",19),b(4,"span",20),le(5),A(6,"translate"),x()()(),p()}if(r&2){let n=o.$implicit,e=o.$index,t=l(2);d(),k("aria-selected",n.userId===(t.assignTo==null?null:t.assignTo.userId))("aria-label","Assign to "+((n==null?null:n.name)||(n==null?null:n.email)))("data-testid",t.componentId+"-option-"+e),d(),ue("s-dark",t.darkMode)("velt-assign-dropdown--item-dark",t.darkMode),d(),v("size",24)("user",n),k("data-testid",t.componentId+"-option-avatar-"+e),d(),k("data-testid",t.componentId+"-option-label-"+e),d(),je(R(6,12,(n==null?null:n.name)||(n==null?null:n.email)))}}function r2(r,o){if(r&1&&(b(0,"app-dropdown",1),u(1,2),y(2,Qy,3,6,"div",3),y(3,e2,5,1,":svg:svg",4),b(4,"div",5),le(5),A(6,"translate"),x(),b(7,"div",6),le(8),A(9,"translate"),x(),de(),b(10,"svg",7),E(11,"path",8),x(),p(),rt(12,t2,7,14,"ng-container",9,Gr().trackByUserContact,!0),x()),r&2){let n=l();ue("velt-assign-dropdown--checkbox",n.assignToType==="checkbox"),v("darkMode",n.darkMode),k("data-testid",n.componentId)("data-velt-assign-to-type",n.assignToType),d(2),w(n.assignToType==="checkbox"?2:-1),d(),w(n.assignToType==="dropdown"?3:-1),d(),k("data-testid",n.componentId+"-label"),d(),je(R(6,13,"Assign to")),d(2),k("aria-labelledby","velt-assign-label")("data-testid",n.componentId+"-selected"),d(),Ce(" ",R(9,15,(n.assignTo==null?null:n.assignTo.name)||(n.assignTo==null?null:n.assignTo.email))," "),d(2),k("data-testid",n.componentId+"-arrow"),d(2),nt(n.selectedUserContacts)}}var Ju=(()=>{let o=class o extends At{constructor(e,t,a){super(t,a),this.loggingService=e,this.elementRef=t,this.themeService=a,this.assignToType="dropdown",this.isAssignedCheckbox=!1,this.setAssignTo=new Le,this.toggleCheckbox=new Le,this.componentId="velt-assign-dropdown"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in AssignDropdownComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in AssignDropdownComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{n2(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in AssignDropdownComponent setupA11yAttributes:",e)}}trackByUserContact(e,t){try{return t?.userId||t?.email||e}catch(a){return this.loggingService.catch("Error in AssignDropdownComponent trackByUserContact:",a),e}}assignContact(e){try{this.setAssignTo.emit({assignTo:e})}catch(t){this.loggingService.catch("Error in AssignDropdownComponent assignContact err: ",t)}}onCheckboxToggle(){try{this.toggleCheckbox.emit()}catch(e){this.loggingService.catch("Error in AssignDropdownComponent onCheckboxToggle err: ",e)}}};o.\u0275fac=function(t){return new(t||o)(j(N),j(me),j(Et))},o.\u0275cmp=T({type:o,selectors:[["app-assign-dropdown"]],inputs:{assignTo:"assignTo",selectedUserContacts:"selectedUserContacts",assignToType:"assignToType",isAssignedCheckbox:"isAssignedCheckbox"},outputs:{setAssignTo:"setAssignTo",toggleCheckbox:"toggleCheckbox"},standalone:!1,features:[M],decls:1,vars:1,consts:[["dropdownClass","velt-assign-dropdown-container","dropdownType","assign",1,"velt-assign-dropdown","s-assign-to-container",3,"darkMode","velt-assign-dropdown--checkbox"],["dropdownClass","velt-assign-dropdown-container","dropdownType","assign",1,"velt-assign-dropdown","s-assign-to-container",3,"darkMode"],["trigger",""],["role","checkbox","tabindex","0",1,"velt-assign-dropdown--checkbox-icon",3,"velt-assign-dropdown--checkbox-icon-selected"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],[1,"velt-assign-dropdown--input-label","input__label"],[1,"velt-assign-dropdown--contact","s-assigned-contact"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false",1,"velt-assign-dropdown--arrow"],["fill-rule","evenodd","clip-rule","evenodd","d","M16.2071 9.79289C15.8166 9.40237 15.1834 9.40237 14.7929 9.79289L12 12.5858L9.20711 9.79289C8.81658 9.40237 8.18342 9.40237 7.79289 9.79289C7.40237 10.1834 7.40237 10.8166 7.79289 11.2071L11.2929 14.7071C11.6834 15.0976 12.3166 15.0976 12.7071 14.7071L16.2071 11.2071C16.5976 10.8166 16.5976 10.1834 16.2071 9.79289Z","fill","currentColor"],["content",""],["role","checkbox","tabindex","0",1,"velt-assign-dropdown--checkbox-icon",3,"click","keydown.space","keydown.enter"],["x","1","y","1","width","18","height","18","rx","3","stroke","currentColor","stroke-width","2","fill","none"],["x","1","y","1","width","18","height","18","rx","3","fill","currentColor"],["d","M5.5 10L8.5 13L14.5 7","stroke","white","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M13.3589 7.30469C11.3965 7.30469 9.65206 8.25585 8.56223 9.72128C8.12056 9.62865 7.66922 9.58074 7.21356 9.58074C3.6054 9.58074 0.669922 12.5162 0.669922 16.1244C0.669922 16.5957 1.05207 16.9779 1.52344 16.9779H8.67C9.76512 18.3633 11.4599 19.2539 13.3589 19.2539C16.6533 19.2539 19.3335 16.5737 19.3335 13.2793C19.3335 9.9849 16.6533 7.30469 13.3589 7.30469ZM2.45235 15.2709C2.85669 13.0097 4.83782 11.2878 7.21356 11.2878C7.38233 11.2878 7.55007 11.2972 7.71662 11.3143C7.50159 11.93 7.38426 12.5912 7.38426 13.2793C7.38426 13.9774 7.50501 14.6476 7.72601 15.2709H2.45235ZM13.3589 17.5469C11.0057 17.5469 9.0913 15.6325 9.0913 13.2793C9.0913 10.9262 11.0057 9.01172 13.3589 9.01172C15.712 9.01172 17.6265 10.9262 17.6265 13.2793C17.6265 15.6325 15.712 17.5469 13.3589 17.5469Z","fill","currentColor"],["d","M7.21319 7.87352C9.18202 7.87352 10.7837 6.27181 10.7837 4.30303C10.7837 2.33419 9.18202 0.732422 7.21319 0.732422C5.24435 0.732422 3.64258 2.33419 3.64258 4.30303C3.64258 6.27181 5.24435 7.87352 7.21319 7.87352ZM7.21319 2.43946C8.24076 2.43946 9.0767 3.27545 9.0767 4.30303C9.0767 5.33055 8.24076 6.16649 7.21319 6.16649C6.18561 6.16649 5.34961 5.33055 5.34961 4.30303C5.34961 3.27545 6.18561 2.43946 7.21319 2.43946Z","fill","currentColor"],["d","M15.0664 12.4258H14.2129V11.5723C14.2129 11.1009 13.8308 10.7188 13.3594 10.7188C12.888 10.7188 12.5059 11.1009 12.5059 11.5723V12.4258H11.6523C11.181 12.4258 10.7988 12.8079 10.7988 13.2793C10.7988 13.7507 11.181 14.1328 11.6523 14.1328H12.5059V14.9863C12.5059 15.4577 12.888 15.8399 13.3594 15.8399C13.8308 15.8399 14.2129 15.4577 14.2129 14.9863V14.1328H15.0664C15.5378 14.1328 15.9199 13.7507 15.9199 13.2793C15.9199 12.8079 15.5378 12.4258 15.0664 12.4258Z","fill","currentColor"],["mat-menu-item","","tabindex","0",3,"click"],[1,"velt-assign-dropdown--item","s-assign-to-menu-item"],["aria-hidden","true",3,"size","user"],[1,"velt-assign-dropdown--item-label","s-contact-label"]],template:function(t,a){t&1&&y(0,r2,14,17,"app-dropdown",0),t&2&&w(a.selectedUserContacts!=null&&a.selectedUserContacts.length?0:-1)},dependencies:[jh,Ut,Cr,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)}[_nghost-%COMP%]{width:100%}.velt-assign-dropdown[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:unset;border-radius:var(--velt-border-radius-md);cursor:pointer;margin-bottom:var(--velt-spacing-sm);color:var(--velt-accent-text)} .velt-assign-dropdown>div{width:100%;display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-md) var(--velt-spacing-lg);box-sizing:border-box}.velt-assign-dropdown[_ngcontent-%COMP%] .velt-assign-dropdown--contact[_ngcontent-%COMP%]{flex-grow:1;flex-basis:0%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.velt-assign-dropdown[_ngcontent-%COMP%] .velt-assign-dropdown--arrow[_ngcontent-%COMP%]{color:var(--velt-text-10)}.velt-assign-dropdown--item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);justify-content:flex-start;color:var(--velt-light-mode-text-1);text-decoration:none;font-size:var(--velt-font-size-sm)}.velt-assign-dropdown--item.velt-assign-dropdown--item-dark[_ngcontent-%COMP%]{color:var(--velt-dark-mode-text-1)}.velt-assign-dropdown--item[_ngcontent-%COMP%] snippyly-user-avatar[_ngcontent-%COMP%]{display:flex}.velt-assign-dropdown--checkbox-icon[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let r=o;return r})();function n2(r,o){try{r.setAttribute("role","combobox"),r.setAttribute("aria-label","Assign user dropdown"),r.setAttribute("data-testid",o+"-container")}catch{}}var i2=(r,o,n,e,t,a)=>({template:r,componentName:o,variant:n,suffix:e,setIfCondition:t,componentElementRef:a});function l2(r,o){r&1&&(u(0),de(),b(1,"svg",5),E(2,"path",6),x(),p())}var Yu=(()=>{let o=class o extends At{constructor(e,t,a,i){super(t,a,e),this.changeDetector=e,this.elementRef=t,this.themeService=a,this.loggingService=i,this.clicked=new Le,this.selectFiles=new Le,this.setIfConditionEvent=new Le,this.acceptAttribute=Fe(""),this.componentId="velt-attachment-button"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in AttachmentButtonComponent ngOnInit:",e)}}ngOnChanges(e){try{if(super.ngOnChanges(e),e.allowedFileTypes&&e.allowedFileTypes.previousValue!==e.allowedFileTypes.currentValue){let t=this.getAcceptAttribute(e.allowedFileTypes.currentValue);this.acceptAttribute.set(t)}}catch(t){this.loggingService.catch("Error in AttachmentButtonComponent ngOnChanges:",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in AttachmentButtonComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{d2(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in AttachmentButtonComponent setupA11yAttributes:",e)}}setIfConditionEventCalled(e){try{this.setIfConditionEvent.emit(e)}catch(t){this.loggingService.catch("Error in AttachmentButtonComponent setIfConditionEventCalled:",t)}}getAcceptAttribute(e){try{return e?.length?e.map(a=>{let i=a.toLowerCase().replace(".","");switch(i){case"png":case"jpg":case"jpeg":case"gif":case"webp":case"svg":return`image/${i==="jpg"?"jpeg":i==="svg"?"svg+xml":i}`;case"pdf":return"application/pdf";case"mp4":case"webm":case"ogg":return`video/${i}`;case"csv":return"text/csv";case"json":return"application/json";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"doc":return"application/msword";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"ppt":return"application/vnd.ms-powerpoint";case"pptx":return"application/vnd.openxmlformats-officedocument.presentationml.presentation";case"txt":return"text/plain";default:return`.${i}`}}).join(", "):"image/png, image/gif, image/jpeg, image/svg+xml, image/webp, application/pdf, video/*, text/csv, application/json, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.presentationml.presentation, text/plain"}catch(t){return this.loggingService.catch("Error in AttachmentButtonComponent getAcceptAttribute:",t),""}}};o.\u0275fac=function(t){return new(t||o)(j(ar),j(me),j(Et),j(N))},o.\u0275cmp=T({type:o,selectors:[["app-attachment-button"]],inputs:{template:"template",componentMeta:"componentMeta",allowedFileTypes:"allowedFileTypes"},outputs:{clicked:"clicked",selectFiles:"selectFiles",setIfConditionEvent:"setIfConditionEvent"},standalone:!1,features:[M,tt],decls:8,vars:22,consts:[["fileInputRef",""],[3,"clicked","darkMode","title","ariaLabel"],["icon","","aria-hidden","true",1,"velt-attachment-button--icon"],[4,"veltDynamicTemplate"],["extra","","type","file","multiple","","tabindex","-1",1,"velt-attachment-button--input","file-upload-input",3,"change","accept"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.9295 0.71123C12.3395 0.803913 11.6796 1.06532 11.2298 1.3845C11.0263 1.52893 2.52007 9.03742 2.04935 9.48817C1.00899 10.4844 0.506081 11.9146 0.711064 13.2941C0.851555 14.2395 1.27958 15.0628 2.01012 15.7928C2.43833 16.2207 2.80773 16.4885 3.33384 16.7523C5.03396 17.6049 7.15751 17.5119 8.75811 16.5147C9.15263 16.2689 9.26532 16.175 10.8619 14.7616C11.6227 14.0881 12.6557 13.1735 13.1576 12.7292C13.6595 12.2849 14.625 11.4304 15.3033 10.8303C15.9816 10.2302 16.5717 9.68614 16.6147 9.62127C16.8654 9.24269 16.7159 8.68509 16.3068 8.47273C16.0924 8.36142 15.8057 8.3495 15.6017 8.44345C15.5271 8.47788 13.9216 9.87541 11.8443 11.7142C9.84941 13.48 8.11611 14.992 7.99257 15.0741C7.60179 15.3337 7.13724 15.5224 6.60924 15.6361C6.28899 15.7051 5.40697 15.7125 5.10817 15.6487C3.9235 15.396 3.0364 14.7672 2.58094 13.8576C2.37358 13.4435 2.30765 13.1555 2.30765 12.6644C2.30765 12.3244 2.32193 12.1911 2.3802 11.9873C2.52372 11.4852 2.79821 11.0383 3.20713 10.6411C3.3386 10.5133 4.48087 9.49485 5.74557 8.37774C8.22821 6.18475 9.71094 4.87325 11.2002 3.55303C12.0417 2.80708 12.1801 2.6972 12.4406 2.56811C12.9245 2.32836 13.39 2.24958 13.8905 2.32269C14.4532 2.40492 14.8442 2.59357 15.2108 2.95974C15.8379 3.58622 15.885 4.44576 15.3305 5.14671C15.1737 5.34504 8.02444 11.6759 7.78908 11.8249C7.28914 12.1415 6.84228 12.0807 6.57896 11.6603C6.3994 11.3736 6.44062 11.0391 6.68556 10.7956C6.75071 10.7309 7.74228 9.84838 8.88908 8.83454C10.0359 7.82073 11.2376 6.75804 11.5595 6.47305C12.2694 5.84466 12.3362 5.75879 12.3535 5.4526C12.3691 5.17745 12.3222 5.02657 12.1678 4.85547C11.9214 4.58228 11.5505 4.50031 11.2349 4.64926C11.1217 4.70264 10.2696 5.43521 8.44851 7.04449C7.00565 8.31957 5.69952 9.49029 5.54603 9.64602C5.23559 9.96099 5.06326 10.237 4.93561 10.6236C4.86603 10.8343 4.85277 10.9368 4.85062 11.2803C4.84782 11.727 4.90641 11.9879 5.09213 12.3556C5.34043 12.8471 5.83894 13.2975 6.36283 13.5037C7.23344 13.8464 8.26299 13.6025 9.1321 12.8477C9.24815 12.7469 10.1867 11.9185 11.2178 11.0069C12.2488 10.0953 13.7743 8.74778 14.6078 8.01238C15.4412 7.27701 16.2303 6.56564 16.3612 6.43156C16.7849 5.99759 17.0791 5.48562 17.2389 4.90396C17.358 4.47067 17.3644 3.79519 17.2538 3.35054C17.0553 2.55319 16.4914 1.77933 15.7647 1.30696C14.9688 0.789649 13.8829 0.561492 12.9295 0.71123Z","fill","currentColor"]],template:function(t,a){if(t&1){let i=J();b(0,"app-action-button",1),A(1,"translate"),A(2,"translate"),H("clicked",function(){B(i);let m=we(6);return m==null||m.click(),V(a.clicked.emit())}),b(3,"div",2),s(4,l2,3,0,"ng-container",3),x(),b(5,"input",4,0),A(7,"translate"),H("change",function(m){return B(i),V(a.selectFiles.emit(m))}),x()()}t&2&&(v("darkMode",a.darkMode)("title",R(1,9,"Attach files"))("ariaLabel",R(2,11,"Attach files")),k("data-testid",a.componentId+"-trigger"),d(3),k("data-testid",a.componentId+"-icon"),d(),v("veltDynamicTemplate",St(15,i2,a.template,a.componentMeta==null?null:a.componentMeta.componentName,a.componentMeta==null?null:a.componentMeta.variant,a.componentMeta==null?null:a.componentMeta.suffix,a.setIfConditionEventCalled.bind(a),a.elementRef)),d(),v("accept",a.acceptAttribute()),k("aria-label",R(7,13,"Attach files input"))("data-testid",a.componentId+"-input"))},dependencies:[P,Fg,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}.velt-attachment-button--input[_ngcontent-%COMP%]{display:none}.velt-attachment-button--icon[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let r=o;return r})();function d2(r,o){try{r.setAttribute("role","presentation"),r.setAttribute("data-testid",o+"-container")}catch{}}function Ku(){return{appState:{user:null,deviceInfo:null},featureState:{showCommentIndex:!1,bubbleOnPin:!1,bubbleOnPinHover:!1,popoverMode:!1,popoverTriangleComponent:!1,isDeviceIndicatorOnCommentPinsEnabled:!1,customStatusesShown:!1,pinShadowDOM:!1,pinDarkMode:null,pinDrag:!0}}}function Zu(){return{data:{annotation:null,unreadCommentsMap:null,isGhostComment:!1,isPrivateComment:!1,isCommentAddedOnDifferentDeviceType:!1,commentBubbleElementAnnotationId:""},uiState:{commentPinSelected:!1,annotationDragging:!1,darkMode:!1,isOutsideViewport:!1,usingCustomCommentPin:!1}}}function af(){return{darkMode:!1,commentPinType:"pin",pinShadowDOM:!1}}var qg=(()=>{let o=class o{constructor(){this.authService=se(ot),this.commentService=se(ie),this.domService=se(Ne),this.loggingService=se(N),this.globalConfigSignal=Fe(Ku()),this.contextMap=new Map,this.currentUnreadCommentsMap=null,this.standaloneAnnotationSubscriptions=new Map,this.subscriptions=[],this.initialized=!1}initialize(){try{if(this.initialized)return;this.initialized=!0,this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{appState:f(g({},t.appState),{user:e??null})}))})),this.subscriptions.push(this.domService.getDeviceInfo$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{appState:f(g({},t.appState),{deviceInfo:e??null})}))})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{showCommentIndex:e})}))})),this.subscriptions.push(this.commentService.getBubbleOnPin$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{bubbleOnPin:e})}))})),this.subscriptions.push(this.commentService.getPinDrag$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{pinDrag:e})}))})),this.subscriptions.push(this.commentService.getBubbleOnPinHover$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{bubbleOnPinHover:e})}))})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{popoverMode:e})}))})),this.subscriptions.push(this.commentService.getPopoverTriangleComponent$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{popoverTriangleComponent:e})}))})),this.subscriptions.push(this.commentService.getDeviceIndicatorOnCommentPins$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{isDeviceIndicatorOnCommentPinsEnabled:e})}))})),this.subscriptions.push(this.commentService.getCustomStatusesShown$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{customStatusesShown:e})}))})),this.subscriptions.push(this.commentService.getPinShadowDOM$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{pinShadowDOM:e})}))})),this.subscriptions.push(this.commentService.getPinDarkMode$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{pinDarkMode:e})}))})),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(e=>{this.currentUnreadCommentsMap=e,this.contextMap.forEach((t,a)=>{try{t().data.unreadCommentsMap!==e&&t.update(c=>f(g({},c),{data:f(g({},c.data),{unreadCommentsMap:e})}))}catch(i){this.loggingService.catch("Error updating unreadCommentsMap for context "+a+":",i)}})})),this.subscriptions.push(this.commentService.getBubbleCommentAnnotationIds$().subscribe(e=>{this.contextMap.forEach((t,a)=>{try{let i=t(),c=i.data.annotation,m=c?.annotationId||"";if(m&&e?.includes(m)){let _=this.commentService.getCommentBubbleElement(c)?.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_ID)||"";i.data.commentBubbleElementAnnotationId!==_&&t.update(I=>f(g({},I),{data:f(g({},I.data),{commentBubbleElementAnnotationId:_})}))}else i.data.commentBubbleElementAnnotationId&&t.update(h=>f(g({},h),{data:f(g({},h.data),{commentBubbleElementAnnotationId:""})}))}catch(i){this.loggingService.catch("Error updating commentBubbleElementAnnotationId for context "+a+":",i)}})}))}catch(e){this.loggingService.catch("Error in CommentPinCoreService initialize:",e)}}getOrCreateContextConfig(e){try{let t=this.contextMap.get(e);if(!t){let a=Zu();this.currentUnreadCommentsMap&&(a.data.unreadCommentsMap=this.currentUnreadCommentsMap),t=Fe(a),this.contextMap.set(e,t)}return t}catch(t){return this.loggingService.catch("Error in CommentPinCoreService getOrCreateContextConfig:",t),Fe(Zu())}}getOrCreateContextConfigForAnnotation(e){try{let t=this.getOrCreateContextConfig(e);if(!this.standaloneAnnotationSubscriptions.has(e)){let a=this.commentService.getCommentAnnotationByAnnotationId(e).subscribe({next:i=>{try{if(!i)return;let c=f(g({},i),{annotationId:e});this.processAnnotationChange(e,c)}catch(c){this.loggingService.catch("Error in standalone pin annotation subscribe handler:",c)}},error:i=>{this.loggingService.catch("Error in standalone pin annotation subscription:",i)}});this.standaloneAnnotationSubscriptions.set(e,a)}return t}catch(t){return this.loggingService.catch("Error in CommentPinCoreService getOrCreateContextConfigForAnnotation:",t),this.getOrCreateContextConfig(e)}}getContextConfig(e){try{return this.contextMap.get(e)}catch(t){this.loggingService.catch("Error in CommentPinCoreService getContextConfig:",t);return}}processAnnotationChange(e,t){try{let a=this.contextMap.get(e);if(!a)return;let i=this.globalConfigSignal(),c=!!t?.ghostComment,m=sr(t),h=!!t?.pageInfo?.deviceInfo?.deviceType&&!!i.appState.deviceInfo?.deviceType&&t.pageInfo.deviceInfo.deviceType!==i.appState.deviceInfo.deviceType;a.update(_=>f(g({},_),{data:f(g({},_.data),{annotation:t,isGhostComment:c,isPrivateComment:m,isCommentAddedOnDifferentDeviceType:h})}))}catch(a){this.loggingService.catch("Error in CommentPinCoreService processAnnotationChange:",a)}}clearContext(e){try{this.contextMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentPinCoreService clearContext:",t)}}destroy(){try{this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[],this.standaloneAnnotationSubscriptions.forEach(e=>e.unsubscribe()),this.standaloneAnnotationSubscriptions.clear(),this.contextMap.clear(),this.currentUnreadCommentsMap=null,this.globalConfigSignal.set(Ku()),this.initialized=!1}catch(e){this.loggingService.catch("Error in CommentPinCoreService destroy:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var lf=(()=>{let o=class o{constructor(e,t){this.loggingService=e,this.coreService=t}onPointerUpOnDialog(e){try{return!this.coreService.getContextConfig(e)?.()?.uiState?.commentPinSelected}catch(t){return this.loggingService.catch("Error in CommentPinActionService onPointerUpOnDialog:",t),!1}}onPinBubblePointerUp(e,t){try{return!!(!this.coreService.getContextConfig(e)?.()?.uiState?.commentPinSelected||t)}catch(a){return this.loggingService.catch("Error in CommentPinActionService onPinBubblePointerUp:",a),!1}}updateOverlayPosition(e){try{e?.updateOverlayPosition()}catch(t){this.loggingService.catch("Error in CommentPinActionService updateOverlayPosition:",t)}}};o.\u0275fac=function(t){return new(t||o)(be(N),be(qg))},o.\u0275prov=et({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Fr=(()=>{let o=class o extends Yr{constructor(){super(...arguments),this.coreService=se(qg),this.actionService=se(lf),this.annotationId=q()}getDefaultLocalUIState(){return af()}getServiceComponentConfigSignal(){try{this.coreService.initialize();let e=this.annotationId();if(!e){let a=this.hostElementRef?.nativeElement?.getAttribute?.("annotation-id");a&&(e=a)}let t=e?.trim();return t?this.coreService.getOrCreateContextConfigForAnnotation(t):this.coreService.getOrCreateContextConfig("default")}catch{return}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["app-comment-pin-primitive-themed-base"]],inputs:{annotationId:[1,"annotationId"]},standalone:!1,features:[M],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();var df=(r,o)=>{try{if(r.hasAttribute(o))return r;if(r.children.length===0)return;for(let n=0;n<r.children.length;n++){let e=r.children[n],t=df(e,o);if(t!==void 0)return t}return}catch(n){Au.catch("Error in utils findInjectionPointByAttribute: ",n)}},Xu=(r,o,n)=>{try{let e=df(r,o);if(e===void 0)return;let t=e.getAttribute(o);if(t===null)return;if(Object.values(X.INJECTION_ATTRIBUTES).includes(o)){if(n===null){e.removeAttribute(t);return}if(t===""){switch(e.tagName.toLowerCase()){case"img":e.src=n;break;case"p":case"a":case"b":case"strong":case"i":case"span":e.innerText=n;break}return}e[t]=n}if(n===null){e.style.removeProperty(t);return}e.style.setProperty(t,n,"important")}catch(e){Au.catch("Error in utils injectAttributeData: ",e)}},qu=r=>{let o={};return r.from?.photoUrl?o[X.INJECTION_ATTRIBUTES.VELT_AVATAR_IMG]=r.from?.photoUrl:o[X.INJECTION_ATTRIBUTES.VELT_AVATAR_IMG]=null,r.priority?o[X.INJECTION_STYLE_PROPS.VELT_COMMENT_PRIORITY_COLOR]=r.priority.color:o[X.INJECTION_STYLE_PROPS.VELT_COMMENT_PRIORITY_COLOR]=null,r.from?.color?o[X.INJECTION_STYLE_PROPS.VELT_AVATAR_COLOR]=r.from?.color:o[X.INJECTION_STYLE_PROPS.VELT_AVATAR_COLOR]=null,o[X.INJECTION_ATTRIBUTES.VELT_COMMENT_LENGTH]=r.comments?.length||0,o};var vf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),m2=(r,o)=>({condition:r,data:o}),s2=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-suggestion-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function g2(r,o){if(r&1&&(b(0,"div",2),A(1,"translate"),E(2,"velt-comment-dialog-suggestion-banner-internal",3)(3,"velt-comment-dialog-suggestion-header-internal",3)(4,"velt-comment-dialog-suggestion-body-internal",3)(5,"velt-comment-dialog-suggestion-footer-internal",3),x()),r&2){let n=l(4);ue("velt-suggestion--sidebar",n.localUIStateSignal().sidebarMode),k("data-testid",n.componentId)("aria-label",R(1,16,"Suggestion")),d(2),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-banner"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-header"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-body"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-footer")}}function u2(r,o){if(r&1&&(u(0),s(1,g2,6,18,"div",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,s2,e.template,C(1,vf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function p2(r,o){if(r&1&&s(0,u2,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,m2,n.conditionSignal(),C(1,vf,n.componentConfigSignal,n.localUIStateSignal)))}}function h2(r,o){if(r&1&&y(0,p2,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var mo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-suggestion-internal",this.shouldShow=L(()=>{try{return Gc(this.defaultCondition(),this.componentConfigSignal())}catch(e){return this.loggingService.catch("Error in CommentDialogSuggestionComponent shouldShow:",e),!1}})}setupA11yAttributes(){try{b2(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogSuggestionComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-suggestion-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["class","velt-suggestion","role","region",3,"velt-suggestion--sidebar",4,"veltDynamicTemplate"],["role","region",1,"velt-suggestion"],[3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,h2,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},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)}[_nghost-%COMP%]:empty{display:none}.velt-suggestion[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-sm);color:var(--velt-text-2);max-height:var(--velt-suggestion-max-height, 320px)}.velt-suggestion[_ngcontent-%COMP%] > velt-comment-dialog-suggestion-header-internal[_ngcontent-%COMP%], .velt-suggestion[_ngcontent-%COMP%] > velt-comment-dialog-suggestion-footer-internal[_ngcontent-%COMP%]{flex:0 0 auto}.velt-suggestion[_ngcontent-%COMP%] > velt-comment-dialog-suggestion-body-internal[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto}.velt-suggestion__avatar[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 auto;border-radius:var(--velt-border-radius-sm);background:var(--velt-accent);color:var(--velt-accent-foreground);overflow:hidden}.velt-suggestion__avatar-img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.velt-suggestion__name[_ngcontent-%COMP%]{font-weight:600;color:var(--velt-text-0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.velt-suggestion__time[_ngcontent-%COMP%]{color:var(--velt-text-4);flex:0 0 auto}.velt-suggestion__menu[_ngcontent-%COMP%]{flex:0 0 auto;display:inline-flex}.velt-suggestion__menu-dots[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:var(--velt-border-radius-sm);color:var(--velt-text-4);cursor:pointer}.velt-suggestion__menu-dots[_ngcontent-%COMP%]:hover{background:var(--velt-background-2);color:var(--velt-text-2)}.velt-suggestion__menu-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:180px;padding:var(--velt-spacing-xs);background:var(--velt-background-0);border:1px solid var(--velt-border-4);border-radius:var(--velt-border-radius-md);box-shadow:0 8px 16px -8px #0f0f0f1a}.velt-suggestion__menu-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-sm);border-radius:var(--velt-border-radius-sm);color:var(--velt-text-2);cursor:pointer}.velt-suggestion__menu-item[_ngcontent-%COMP%]:hover{background:var(--velt-background-2)}.velt-suggestion__menu-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--velt-accent);outline-offset:-2px}.velt-suggestion__menu-item--danger[_ngcontent-%COMP%]{color:var(--velt-error)}.velt-suggestion__menu-label[_ngcontent-%COMP%]{font-weight:500}.velt-suggestion__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:var(--velt-spacing-sm);margin-top:var(--velt-spacing-xs)}.velt-suggestion__open-comment[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--velt-spacing-xs);margin-right:auto;padding:0;background:transparent;border:none;cursor:pointer;color:var(--velt-text-4);font:inherit;font-weight:500}.velt-suggestion__open-comment[_ngcontent-%COMP%]:hover{text-decoration:underline;color:var(--velt-text-2)}.velt-suggestion__open-comment[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--velt-accent);outline-offset:2px;border-radius:var(--velt-border-radius-sm)}"],changeDetection:0});let r=o;return r})();function Gc(r,o){try{if(!r)return!0;let n=o?.data?.annotation;return n?.type==="suggestion"||n?.commentType==="suggestion"}catch{return!1}}function Qg(r){try{return r?.data?.annotation?.sourceType==="agent"}catch{return!1}}function b2(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Suggestion")}catch{}}var cf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),C2=(r,o)=>({condition:r,data:o}),k2=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-all-comment-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function x2(r,o){if(r&1&&(b(0,"div",3),A(1,"translate"),de(),b(2,"svg",4),E(3,"path",5)(4,"path",6),x(),xt(),b(5,"div",7),le(6),A(7,"translate"),x()()),r&2){let n=l(4);k("aria-label",R(1,7,"View all comments"))("aria-haspopup",!0)("aria-expanded",!1)("data-testid",n.componentId+"-button"),d(2),k("data-testid",n.componentId+"-icon"),d(3),k("data-testid",n.componentId+"-label"),d(),Ce(" ",R(7,9,"All comments"))}}function _2(r,o){if(r&1){let n=J();u(0),b(1,"div",1),H("click",function(t){return B(n),l(3).onAllCommentClick(),V(t.stopPropagation())}),s(2,x2,8,11,"div",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId),d(),v("veltDynamicTemplate",O(5,k2,e.template,C(2,cf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function S2(r,o){if(r&1&&s(0,_2,3,11,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,C2,n.conditionSignal(),C(1,cf,n.componentConfigSignal,n.localUIStateSignal)))}}function y2(r,o){if(r&1&&y(0,S2,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Oo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-all-comment-internal",this.isDialogSelected=L(()=>I2(this.localUIStateSignal())),this.shouldShow=L(()=>D2(this.defaultCondition(),this.isDialogSelected(),this.componentConfigSignal()))}setupA11yAttributes(){try{w2(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAllCommentComponent setupA11yAttributes:",e)}}onAllCommentClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.openAllComments(e)}catch(e){this.loggingService.catch("Error in onAllCommentClick:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-all-comment-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"click"],["class","velt-all-comment","role","button","tabindex","0",4,"veltDynamicTemplate"],["role","button","tabindex","0",1,"velt-all-comment"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.83268 12.2505V14.8286L9.05119 12.3358L9.49212 12.3286C11.2454 12.2999 12.8232 12.1234 14.003 11.9439C14.7476 11.8306 15.2649 11.3109 15.3773 10.6585C15.5332 9.75341 15.666 8.60678 15.666 7.33268C15.666 6.05858 15.5332 4.91195 15.3773 4.0069C15.2649 3.35442 14.7476 2.83478 14.003 2.72149C12.7126 2.52515 10.948 2.33268 8.99935 2.33268C7.05074 2.33268 5.28608 2.52515 3.9957 2.72149C3.25113 2.83478 2.73377 3.35442 2.62138 4.00691C2.46548 4.91195 2.33268 6.05858 2.33268 7.33268C2.33268 8.60678 2.46548 9.75341 2.62138 10.6585C2.71897 11.2251 3.1148 11.6792 3.69192 11.8711L4.83268 12.2505ZM0.978897 3.72399C1.22072 2.32008 2.33662 1.28808 3.74499 1.07379C5.09444 0.86846 6.94567 0.666016 8.99935 0.666016C11.053 0.666016 12.9043 0.86846 14.2537 1.07379C15.6621 1.28808 16.778 2.32008 17.0198 3.72399C17.1883 4.70245 17.3327 5.94539 17.3327 7.33268C17.3327 8.71997 17.1883 9.96292 17.0198 10.9414C16.778 12.3453 15.6621 13.3773 14.2537 13.5916C13.0192 13.7794 11.3647 13.9648 9.51941 13.9951L4.42329 17.0064C3.86778 17.3347 3.16602 16.9342 3.16602 16.289V13.4526C2.03815 13.0776 1.18648 12.1465 0.978897 10.9414C0.810359 9.96292 0.666016 8.71997 0.666016 7.33268C0.666016 5.94539 0.810359 4.70245 0.978897 3.72399Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.83268 4.83268C4.37244 4.83268 3.99935 5.20578 3.99935 5.66602C3.99935 6.12625 4.37244 6.49935 4.83268 6.49935H13.166C13.6263 6.49935 13.9993 6.12625 13.9993 5.66602C13.9993 5.20578 13.6263 4.83268 13.166 4.83268H4.83268ZM4.83268 8.16602C4.37244 8.16602 3.99935 8.53911 3.99935 8.99935C3.99935 9.45959 4.37245 9.83268 4.83268 9.83268H8.16602C8.62625 9.83268 8.99935 9.45959 8.99935 8.99935C8.99935 8.53911 8.62625 8.16602 8.16602 8.16602H4.83268Z","fill","currentColor"],[1,"velt-all-comment--button"]],template:function(t,a){if(t&1&&y(0,y2,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]:empty{display:none}.velt-all-comment[_ngcontent-%COMP%]{gap:var(--velt-spacing-xs);display:flex;flex-direction:row;align-items:center;justify-content:center}.velt-all-comment[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{color:var(--velt-accent-text)}.velt-all-comment--button[_ngcontent-%COMP%]{position:relative;line-height:1.25em;font-weight:600;display:inline-block;cursor:pointer}"],changeDetection:0});let r=o;return r})();function w2(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function I2(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function D2(r,o,n){try{return r?o&&!!n?.data?.annotation?.comments?.length&&!!n?.featureState?.dialogMode&&!!n?.uiState?.sidebarButtonOnCommentDialogVisible:!0}catch{return!1}}var mf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),O2=(r,o)=>({condition:r,data:o}),E2=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-approve-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function M2(r,o){if(r&1&&(u(0),E(1,"div",3),b(2,"div",4),le(3),A(4,"translate"),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-fill"),d(),k("data-testid",n.componentId+"-label"),d(),Ce(" ",R(4,3,"Approve"))}}function A2(r,o){if(r&1){let n=J();u(0),b(1,"div",1),A(2,"translate"),H("click",function(t){return B(n),l(3).onApproveClick(),V(t.stopPropagation())}),s(3,M2,5,5,"ng-container",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("aria-label",R(2,4,"Approve comment"))("aria-pressed",!1)("data-testid",e.componentId+"-button"),d(2),v("veltDynamicTemplate",O(9,E2,e.template,C(6,mf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function P2(r,o){if(r&1&&s(0,A2,4,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,O2,n.conditionSignal(),C(1,mf,n.componentConfigSignal,n.localUIStateSignal)))}}function F2(r,o){if(r&1&&y(0,P2,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Eo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-approve-internal",this.isDialogSelected=L(()=>R2(this.localUIStateSignal())),this.shouldShow=L(()=>U2(this.defaultCondition(),this.isDialogSelected(),this.componentConfigSignal()))}setupA11yAttributes(){try{N2(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogApproveComponent setupA11yAttributes:",e)}}onApproveClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.approveComment(e)}catch(e){this.loggingService.catch("Error in onApproveClick:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-approve-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",3,"click"],[4,"veltDynamicTemplate"],["aria-hidden","true",1,"velt-fill"],[1,"velt-flat-button"]],template:function(t,a){if(t&1&&y(0,F2,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]:empty{display:none}.velt-fill[_ngcontent-%COMP%]{flex-grow:1}.velt-flat-button[_ngcontent-%COMP%]{padding:var(--velt-spacing-sm) var(--velt-spacing-md);background:var(--velt-accent);border-radius:var(--velt-border-radius-3xl);border:0;color:var(--velt-accent-foreground);font-weight:700;transition:.2s;font-size:var(--velt-font-size-sm);cursor:pointer}.velt-flat-button[_ngcontent-%COMP%]:hover{background:var(--velt-accent-hover)}"],changeDetection:0});let r=o;return r})();function N2(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function R2(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function U2(r,o,n){try{return r?o&&!!n?.data?.annotation?.comments?.length&&!!n?.featureState?.moderatorMode&&!n?.data?.annotation?.approved&&!!n?.appState?.isUserAdmin:!0}catch{return!1}}var B2=["*"],jc=(()=>{let o=class o extends At{constructor(e,t,a,i){super(a,i),this.loggingService=e,this.customFilterService=t,this.elementRef=a,this.themeService=i,this.headingMode=!1,this.changeStatus=new Le,this.componentId="velt-resolve-button"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ResolveButtonComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ResolveButtonComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{V2(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in ResolveButtonComponent setupA11yAttributes:",e)}}resolveComment(e){this.loggingService.log("%c[WB] Calling FUNCTION: resolveComment","color: green;");try{if(!this.annotation)return;this.changeStatus.emit({status:this.customFilterService.resolvedStatus,statusOptionType:e})}catch(t){this.catchError("Error in CommentDialogComponent resolveComment: ",t)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(j(N),j(Dt),j(me),j(Et))},o.\u0275cmp=T({type:o,selectors:[["app-resolve-button"]],inputs:{annotation:"annotation",sidebarMode:"sidebarMode",headingMode:"headingMode",zIndex:"zIndex"},outputs:{changeStatus:"changeStatus"},standalone:!1,features:[M],ngContentSelectors:B2,decls:3,vars:9,consts:[[3,"clicked","tooltip","darkMode","colorMode","zIndex"]],template:function(t,a){t&1&&(pr(),b(0,"app-tooltip-button",0),A(1,"translate"),H("clicked",function(){return a.resolveComment("button")}),hr(2),x()),t&2&&(at("color",(a.annotation==null||a.annotation.status==null?null:a.annotation.status.color)+" !important"),v("tooltip",R(1,7,"Resolve"))("darkMode",a.darkMode)("colorMode",a.headingMode)("zIndex",a.zIndex||1e3),k("data-testid",a.componentId))},dependencies:[pn,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}"],changeDetection:0});let r=o;return r})();function V2(r,o){try{r.setAttribute("role","presentation"),r.setAttribute("data-testid",o+"-container")}catch{}}var gf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),$2=(r,o)=>({condition:r,data:o}),G2=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-resolve-button-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function j2(r,o){if(r&1&&(u(0),de(),b(1,"svg",3),E(2,"path",4),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-icon")}}function H2(r,o){if(r&1){let n=J();u(0),b(1,"app-resolve-button",1),H("changeStatus",function(t){B(n);let a=l(3);return V(a.onResolveClick(t))}),s(2,j2,3,1,"ng-container",2),x(),p()}if(r&2){let n,e=l(2),t=l();d(),v("darkMode",!!(e.uiState!=null&&e.uiState.darkMode))("headingMode",!0)("annotation",e.data==null?null:e.data.annotation)("sidebarMode",(n=t.localUIStateSignal())==null?null:n.sidebarMode),k("data-testid",t.componentId),d(),v("veltDynamicTemplate",O(9,G2,t.template,C(6,gf,t.componentConfigSignal,t.localUIStateSignal),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.elementRef))}}function z2(r,o){if(r&1&&s(0,H2,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,$2,n.conditionSignal(),C(1,gf,n.componentConfigSignal,n.localUIStateSignal)))}}function W2(r,o){if(r&1&&y(0,z2,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Mo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-resolve-button-internal",this.shouldShow=L(()=>Y2(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{J2(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerResolveButtonComponent setupA11yAttributes:",e)}}onResolveClick(e){try{let t=this.getAnnotationId();if(!t)return;this.actionService.resolveComment(t,e.statusOptionType)}catch(t){this.loggingService.catch("Error in CommentDialogAssigneeBannerResolveButtonComponent onResolveClick:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-resolve-button-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"changeStatus","darkMode","headingMode","annotation","sidebarMode"],[4,"veltDynamicTemplate"],["width","12","height","10","viewBox","0 0 12 10","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M11.5886 1.07806C11.914 1.4035 11.914 1.93114 11.5886 2.25657L4.92194 8.92324C4.5965 9.24868 4.06886 9.24868 3.74343 8.92324L0.410093 5.58991C0.0846564 5.26447 0.0846564 4.73683 0.410093 4.4114C0.73553 4.08596 1.26317 4.08596 1.5886 4.4114L4.33268 7.15547L10.4101 1.07806C10.7355 0.752625 11.2632 0.752625 11.5886 1.07806Z","fill","currentColor"]],template:function(t,a){if(t&1&&y(0,W2,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,jc],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)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function J2(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Resolve comment")}catch{}}function Y2(r,o){try{return r?!!o?.featureState?.canResolveAnnotation:!0}catch{return!1}}var Z2=["*"],Hc=(()=>{let o=class o extends At{constructor(e,t,a,i){super(a,i),this.loggingService=e,this.customFilterService=t,this.elementRef=a,this.themeService=i,this.headingMode=!1,this.changeStatus=new Le,this.componentId="velt-unresolve-button"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in UnresolveButtonComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in UnresolveButtonComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{X2(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in UnresolveButtonComponent setupA11yAttributes: ",e)}}unresolveComment(e){this.loggingService.log("%c[WB] Calling FUNCTION: unresolveComment","color: green;");try{if(!this.annotation)return;this.changeStatus.emit({status:this.customFilterService.defaultStatus,statusOptionType:e})}catch(t){this.catchError("Error in UnresolveButtonComponent unresolveComment: ",t)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(j(N),j(Dt),j(me),j(Et))},o.\u0275cmp=T({type:o,selectors:[["app-unresolve-button"]],inputs:{annotation:"annotation",sidebarMode:"sidebarMode",headingMode:"headingMode",zIndex:"zIndex"},outputs:{changeStatus:"changeStatus"},standalone:!1,features:[M],ngContentSelectors:Z2,decls:3,vars:9,consts:[["type","unresolve",3,"clicked","tooltip","darkMode","colorMode","zIndex"]],template:function(t,a){t&1&&(pr(),b(0,"app-tooltip-button",0),A(1,"translate"),H("clicked",function(){return a.unresolveComment("button")}),hr(2),x()),t&2&&(at("color",(a.annotation==null||a.annotation.status==null?null:a.annotation.status.color)+" !important"),v("tooltip",R(1,7,"Unresolve"))("darkMode",a.darkMode)("colorMode",a.headingMode)("zIndex",a.zIndex||1e3),k("data-testid",a.componentId+"-tooltip-button"))},dependencies:[pn,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}"]});let r=o;return r})();function X2(r,o){try{r.setAttribute("role","button"),r.setAttribute("aria-label","Unresolve comment"),r.setAttribute("data-testid",o+"-container")}catch{}}var pf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),q2=(r,o)=>({condition:r,data:o}),Q2=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-unresolve-button-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function ew(r,o){if(r&1&&(u(0),de(),b(1,"svg",3),E(2,"path",4),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-icon")}}function tw(r,o){if(r&1){let n=J();u(0),b(1,"app-unresolve-button",1),H("changeStatus",function(t){B(n);let a=l(3);return V(a.onUnresolveClick(t))}),s(2,ew,3,1,"ng-container",2),x(),p()}if(r&2){let n,e=l(2),t=l();d(),v("darkMode",!!(e.uiState!=null&&e.uiState.darkMode))("headingMode",!0)("annotation",e.data==null?null:e.data.annotation)("sidebarMode",(n=t.localUIStateSignal())==null?null:n.sidebarMode),k("data-testid",t.componentId),d(),v("veltDynamicTemplate",O(9,Q2,t.template,C(6,pf,t.componentConfigSignal,t.localUIStateSignal),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.elementRef))}}function rw(r,o){if(r&1&&s(0,tw,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,q2,n.conditionSignal(),C(1,pf,n.componentConfigSignal,n.localUIStateSignal)))}}function nw(r,o){if(r&1&&y(0,rw,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Ao=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-unresolve-button-internal",this.shouldShow=L(()=>aw(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{ow(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerUnresolveButtonComponent setupA11yAttributes:",e)}}onUnresolveClick(e){try{let t=this.getAnnotationId();if(!t)return;this.actionService.unresolveComment(t,e.statusOptionType)}catch(t){this.loggingService.catch("Error in CommentDialogAssigneeBannerUnresolveButtonComponent onUnresolveClick:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-unresolve-button-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"changeStatus","darkMode","headingMode","annotation","sidebarMode"],[4,"veltDynamicTemplate"],["width","12","height","10","viewBox","0 0 12 10","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M11.5886 1.07806C11.914 1.4035 11.914 1.93114 11.5886 2.25657L4.92194 8.92324C4.5965 9.24868 4.06886 9.24868 3.74343 8.92324L0.410093 5.58991C0.0846564 5.26447 0.0846564 4.73683 0.410093 4.4114C0.73553 4.08596 1.26317 4.08596 1.5886 4.4114L4.33268 7.15547L10.4101 1.07806C10.7355 0.752625 11.2632 0.752625 11.5886 1.07806Z","fill","currentColor"]],template:function(t,a){if(t&1&&y(0,nw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Hc],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)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function ow(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Unresolve comment")}catch{}}function aw(r,o){try{return r?!!o?.featureState?.canUnresolveAnnotation:!0}catch{return!1}}var hf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),lw=(r,o)=>({condition:r,data:o}),dw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-user-avatar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function vw(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),A(2,"translate"),p()),r&2){let n=l(2),e=l();d(),v("size",28)("user",n.data==null||n.data.annotation==null?null:n.data.annotation.assignedTo),k("aria-label",R(2,4,"Avatar for assigned user"))("data-testid",e.componentId+"-avatar")}}function cw(r,o){if(r&1&&(u(0),s(1,vw,3,6,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,dw,e.template,C(1,hf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function mw(r,o){if(r&1&&s(0,cw,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,lw,n.conditionSignal(),C(1,hf,n.componentConfigSignal,n.localUIStateSignal)))}}var Po=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-user-avatar-internal"}setupA11yAttributes(){try{sw(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerUserAvatarComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-user-avatar-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-assignee-banner--user-avatar",3,"size","user"]],template:function(t,a){if(t&1&&y(0,mw,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Ut,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)}[_nghost-%COMP%]:empty{display:none}.velt-assignee-banner--user-avatar[_ngcontent-%COMP%]{align-self:center}"],changeDetection:0});let r=o;return r})();function sw(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var bf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),uw=(r,o)=>({condition:r,data:o}),pw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-user-name-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function hw(r,o){if(r&1&&(b(0,"div",2),A(1,"translate"),le(2),A(3,"translate"),x()),r&2){let n=l(4),e=l();k("data-testid",e.componentId)("aria-label",R(1,3,"Assigned to")+" "+((n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.name)||(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.email))),d(2),Ce(" ",R(3,5,(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.name)||(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.email))," ")}}function bw(r,o){r&1&&E(0,"velt-skeleton-loader-internal",3)}function fw(r,o){if(r&1&&(u(0),y(1,hw,4,7,"div",2)(2,bw,1,0,"velt-skeleton-loader-internal",3),p()),r&2){let n=l(3);d(),w(!(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null)&&n.data.annotation.assignedTo.name||!(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null)&&n.data.annotation.assignedTo.email?1:2)}}function Cw(r,o){if(r&1&&(u(0),s(1,fw,3,1,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,pw,e.template,C(1,bf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function kw(r,o){if(r&1&&s(0,Cw,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,uw,n.conditionSignal(),C(1,bf,n.componentConfigSignal,n.localUIStateSignal)))}}function xw(r,o){if(r&1&&y(0,kw,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Fo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-user-name-internal",this.shouldShow=L(()=>Sw(this.defaultCondition()))}setupA11yAttributes(){try{_w(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerUserNameComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-user-name-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","text",1,"velt-assignee-banner--user-name"],["height","16px","width","80px","borderRadius","8px"]],template:function(t,a){if(t&1&&y(0,xw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Jr,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)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-assignee-banner--user-name[_ngcontent-%COMP%]{color:var(--velt-accent-foreground);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}"],changeDetection:0});let r=o;return r})();function _w(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function Sw(r){try{return!0}catch{return!1}}var ff=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),ww=(r,o)=>({condition:r,data:o}),Iw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Dw(r,o){if(r&1&&E(0,"velt-comment-dialog-assignee-banner-resolve-button-internal",6)(1,"velt-comment-dialog-assignee-banner-unresolve-button-internal",7),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function Tw(r,o){if(r&1&&(b(0,"div",2),A(1,"translate"),E(2,"velt-comment-dialog-assignee-banner-user-avatar-internal",3),b(3,"div",4)(4,"div",5),le(5),A(6,"translate"),x(),E(7,"velt-comment-dialog-assignee-banner-user-name-internal",3),x(),y(8,Dw,2,4),x()),r&2){let n=l(3),e=l();at("background-color",n.data==null||n.data.annotation==null||n.data.annotation.status==null?null:n.data.annotation.status.color)("--legacy-velt-assignee-banner-color",(n.data==null||n.data.annotation==null||n.data.annotation.status==null?null:n.data.annotation.status.lightColor)||"white")("--legacy-velt-tooltip-button-color",(n.data==null||n.data.annotation==null||n.data.annotation.status==null?null:n.data.annotation.status.lightColor)||"white"),ue("velt-assignee-banner--private-comment-mode",n.uiState==null?null:n.uiState.isPrivateComment)("velt-assignee-banner--has-visibility-banner",e.hasVisibilityBanner())("private-comment",n.uiState==null?null:n.uiState.isPrivateComment),k("data-testid",e.componentId)("aria-label",R(1,21,"Comment assignment details")),d(2),v("componentConfigSignal",e.componentConfigSignal)("parentLocalUIState",e.localUIStateSignal),d(),k("data-testid",e.componentId+"-author"),d(2),je(R(6,23,"Assigned to:")),d(2),v("componentConfigSignal",e.componentConfigSignal)("parentLocalUIState",e.localUIStateSignal),d(),w(n.uiState!=null&&n.uiState.readOnly?-1:8)}}function Ow(r,o){if(r&1&&(u(0),s(1,Tw,9,25,"div",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,Iw,e.template,C(1,ff,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ew(r,o){if(r&1&&s(0,Ow,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,ww,n.conditionSignal(),C(1,ff,n.componentConfigSignal,n.localUIStateSignal)))}}function Mw(r,o){if(r&1&&y(0,Ew,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var No=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-internal",this.hasVisibilityBanner=L(()=>{let e=this.componentConfigSignal();return e?.featureState?.visibilityOptions===!0&&e?.featureState?.isPrivateCommentsEnabled===!0}),this.shouldShow=L(()=>Pw(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{Aw(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["class","velt-assignee-banner--heading","role","region",3,"velt-assignee-banner--private-comment-mode","velt-assignee-banner--has-visibility-banner","private-comment","backgroundColor","--legacy-velt-assignee-banner-color","--legacy-velt-tooltip-button-color",4,"veltDynamicTemplate"],["role","region",1,"velt-assignee-banner--heading"],[3,"componentConfigSignal","parentLocalUIState"],[1,"velt-assignee-banner--author"],[1,"velt-assignee-banner--text"],[1,"velt-assignee-banner--resolve-button",3,"componentConfigSignal","parentLocalUIState"],[1,"velt-assignee-banner--unresolve-button",3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,Mw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Mo,Ao,Po,Fo,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)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-assignee-banner--heading[_ngcontent-%COMP%]{background:var(--velt-green);margin:calc(var(--velt-spacing-lg) * -1);padding:var(--velt-spacing-lg);color:var(--velt-white);display:flex;align-items:center;justify-content:flex-start;grid-gap:var(--velt-spacing-sm);gap:var(--velt-spacing-sm);margin-bottom:0;border-radius:var(--velt-border-radius-md) var(--velt-border-radius-md) 0 0}.velt-assignee-banner--heading.velt-assignee-banner--private-comment-mode[_ngcontent-%COMP%], .velt-assignee-banner--heading.velt-assignee-banner--has-visibility-banner[_ngcontent-%COMP%]{border-radius:0}.velt-assignee-banner--heading.velt-assignee-banner--private-comment-mode[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--velt-purple) 32%,var(--velt-black) 100%)}.velt-assignee-banner--author[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;overflow:hidden}.velt-assignee-banner--text[_ngcontent-%COMP%]{font-style:normal;font-weight:400;font-size:var(--velt-font-size-xs);line-height:17px;color:var(--velt-accent-foreground)}.velt-assignee-banner--user-name[_ngcontent-%COMP%]{color:var(--velt-accent-foreground);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.velt-assignee-banner--resolve-button[_ngcontent-%COMP%], .velt-assignee-banner--unresolve-button[_ngcontent-%COMP%]{margin-left:auto}"],changeDetection:0});let r=o;return r})();function Aw(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Comment assignment details")}catch{}}function Pw(r,o){try{if(!r)return!0;if(o?.featureState?.inlineCommentMode)return!1;let n=!!o?.data?.annotation?.assignedTo;return o?.featureState?.assignToType==="checkbox"?n||!!o?.data?.isAssignedCheckbox:n}catch{return!1}}var Cf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),Nw=(r,o)=>({condition:r,data:o}),Rw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-hide-reply-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Uw(r,o){r&1&&(u(0),b(1,"div",3),le(2," Hide replies "),x(),p())}function Lw(r,o){if(r&1){let n=J();u(0),b(1,"div",1),A(2,"translate"),H("click",function(t){B(n);let a=l(3);return V(a.onToggleHideReply(t))}),s(3,Uw,3,0,"ng-container",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId)("aria-expanded",n==null||n.uiState==null?null:n.uiState.showReplies)("aria-label",R(2,4,"Hide reply")),d(2),v("veltDynamicTemplate",O(9,Rw,e.template,C(6,Cf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function Bw(r,o){if(r&1&&s(0,Lw,4,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,Nw,n.conditionSignal(),C(1,Cf,n.componentConfigSignal,n.localUIStateSignal)))}}function Vw(r,o){if(r&1&&y(0,Bw,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Ro=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-hide-reply-internal",this.isDialogSelected=L(()=>Gw(this.localUIStateSignal())),this.shouldShow=L(()=>jw(this.defaultCondition(),this.componentConfigSignal(),this.isDialogSelected()))}setupA11yAttributes(){try{$w(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogHideReplyComponent setupA11yAttributes:",e)}}onToggleHideReply(e){try{e?.stopPropagation();let t=this.getAnnotationId();if(!t)return;this.actionService.toggleHideReply(t)}catch(t){this.loggingService.catch("Error in onToggleHideReply:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-hide-reply-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",1,"velt-comment-dialog-hide-reply-container",3,"click"],[4,"veltDynamicTemplate"],[1,"velt-comment-dialog-hide-reply"]],template:function(t,a){if(t&1&&y(0,Vw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-hide-reply[_ngcontent-%COMP%]{color:var(--velt-text-8);font-size:var(--velt-font-size-xs);cursor:pointer;padding:var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-xs) 0px;display:inline-flex;align-items:center;margin-top:var(--velt-spacing-xs)}"],changeDetection:0});let r=o;return r})();function $w(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}function Gw(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function jw(r,o,n){try{return r?!o?.uiState?.collapsedComments&&n&&(o?.data?.annotation?.comments?.length??0)>1:!0}catch{return!1}}var kf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),zw=(r,o)=>({condition:r,data:o}),Ww=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-list-item-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Jw(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),p()),r&2){let n=l(4);d(),v("user",n.resolvedUser()),k("data-testid",n.componentId+"-avatar")}}function Yw(r,o){if(r&1&&(u(0),s(1,Jw,2,2,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,Ww,e.template,C(1,kf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function Kw(r,o){if(r&1&&s(0,Yw,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,zw,n.conditionSignal(),C(1,kf,n.componentConfigSignal,n.localUIStateSignal)))}}function Zw(r,o){if(r&1&&y(0,Kw,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Uo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-reply-avatars-list-item-internal",this.domService=se(Ne),this.user=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e??null}catch{return null}}}),this.index=q(0,{transform:e=>{try{if(e==null)return 0;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedUser=L(()=>{let e=this.user();if(e)return e;let t=this.componentConfigSignal(),a=t?.appState?.repliesUniqueUsers;return(Array.isArray(a)&&a.length>0?a:qw(t?.data?.annotation?.comments))[this.index()]??void 0}),this.shouldShow=L(()=>{try{return!!this.resolvedUser()}catch{return!1}})}get itemTemplate(){return this._itemTemplate}set itemTemplate(e){try{this._itemTemplate=e,e?this.template=this.domService.deepCloneElement(e):this.template=null}catch{}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,user:this.resolvedUser(),index:this.index()})}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListItemComponent ngOnInit:",e)}}setupA11yAttributes(){try{Xw(this.hostElementRef.nativeElement,this.componentId,this.index())}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListItemComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-list-item-internal"]],inputs:{user:[1,"user"],index:[1,"index"],itemTemplate:"itemTemplate"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"user"]],template:function(t,a){if(t&1&&y(0,Zw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Ut],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)}[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.3rem}"],changeDetection:0});let r=o;return r})();function Xw(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","listitem"),r.setAttribute("aria-label",`Reply avatar ${n+1}`)}catch{}}function qw(r){try{if(!Array.isArray(r))return[];let o=new Set,n=[];for(let e of r){let t=e?.from,a=t?.userId||t?.email;t&&a&&!o.has(a)&&(o.add(a),n.push(t))}return n}catch{return[]}}var xf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),eI=(r,o)=>({condition:r,data:o}),tI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-list-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1}),rI=()=>[],nI=(r,o)=>(o==null?null:o.userId)||r;function oI(r,o){if(r&1&&E(0,"velt-comment-dialog-reply-avatars-list-item-internal",3),r&2){let n=o.$implicit,e=o.$index,t=l(4);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("user",n)("index",e)("itemTemplate",t.itemTemplate)}}function aI(r,o){if(r&1&&(u(0),b(1,"div",2),rt(2,oI,1,5,"velt-comment-dialog-reply-avatars-list-item-internal",3,nI),x(),p()),r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId),d(),nt((n==null||n.appState==null||n.appState.repliesUniqueUsers==null?null:n.appState.repliesUniqueUsers.slice(0,n==null||n.uiState==null?null:n.uiState.maxReplyAvatars))||ct(1,rI))}}function iI(r,o){if(r&1&&(u(0),s(1,aI,4,2,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,tI,e.template,C(1,xf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function lI(r,o){if(r&1&&s(0,iI,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,eI,n.conditionSignal(),C(1,xf,n.componentConfigSignal,n.localUIStateSignal)))}}var Lo=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-reply-avatars-list-internal"}ngOnInit(){try{super.ngOnInit();let e=this.template?.querySelector("velt-comment-dialog-reply-avatars-list-item-wireframe");ye(e)||(this.itemTemplate=e)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListComponent ngOnInit:",e)}}setupA11yAttributes(){try{dI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-list-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-comment-dialog-reply-avatars-list"],[3,"componentConfigSignal","parentLocalUIState","user","index","itemTemplate"]],template:function(t,a){if(t&1&&y(0,lI,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Uo],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)}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-reply-avatars-list[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-start}velt-comment-dialog-reply-avatars-list-item-internal[_ngcontent-%COMP%]:not(:first-child){margin-left:calc(var(--velt-spacing-xs) * -1)}"],changeDetection:0});let r=o;return r})();function dI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","list"),r.setAttribute("aria-label","Reply avatars list")}catch{}}var _f=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),cI=(r,o)=>({condition:r,data:o}),mI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-remaining-count-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function sI(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),p()),r&2){let n=l(3),e=l();d(),v("initial","+"+(((n.appState==null||n.appState.repliesUniqueUsers==null?null:n.appState.repliesUniqueUsers.length)||0)-((n.uiState==null?null:n.uiState.maxReplyAvatars)||0)).toString()),k("data-testid",e.componentId+"-avatar")}}function gI(r,o){if(r&1&&(u(0),s(1,sI,2,2,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,mI,e.template,C(1,_f,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function uI(r,o){if(r&1&&s(0,gI,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,cI,n.conditionSignal(),C(1,_f,n.componentConfigSignal,n.localUIStateSignal)))}}function pI(r,o){if(r&1&&y(0,uI,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Bo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-reply-avatars-remaining-count-internal",this.shouldShow=L(()=>bI(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{hI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsRemainingCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-remaining-count-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"initial"]],template:function(t,a){if(t&1&&y(0,pI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Ut],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)}[_nghost-%COMP%]{display:block;margin-left:calc(var(--velt-spacing-xs) * -1)}[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.3rem}"],changeDetection:0});let r=o;return r})();function hI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation"),r.setAttribute("aria-label","Additional reply count")}catch{}}function bI(r,o){try{return r?!!o?.appState?.repliesUniqueUsers&&!!o?.uiState?.maxReplyAvatars&&(o?.appState?.repliesUniqueUsers?.length??0)>(o?.uiState?.maxReplyAvatars??0):!0}catch{return!1}}var Sf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),CI=(r,o)=>({condition:r,data:o}),kI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function xI(r,o){if(r&1&&(u(0),b(1,"div",2),E(2,"velt-comment-dialog-reply-avatars-list-internal",3)(3,"velt-comment-dialog-reply-avatars-remaining-count-internal",3),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-container"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function _I(r,o){if(r&1&&(u(0),s(1,xI,4,5,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,kI,e.template,C(1,Sf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function SI(r,o){if(r&1&&s(0,_I,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,CI,n.conditionSignal(),C(1,Sf,n.componentConfigSignal,n.localUIStateSignal)))}}function yI(r,o){if(r&1&&y(0,SI,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Vo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-reply-avatars-internal",this.shouldShow=L(()=>II(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{wI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-comment-dialog-reply-avatars"],[3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,yI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Lo,Bo],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)}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-reply-avatars[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-start}"],changeDetection:0});let r=o;return r})();function wI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","complementary"),r.setAttribute("aria-label","Reply avatars")}catch{}}function II(r,o){try{return r?!!o?.appState?.repliesUniqueUsers?.length:!0}catch{return!1}}var yf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),TI=(r,o)=>({condition:r,data:o}),OI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-more-reply-count-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function EI(r,o){if(r&1&&(u(0),le(1),p()),r&2){let n=l(4);d(),Ce(" ",n.hiddenCount()," ")}}function MI(r,o){if(r&1&&(u(0),s(1,EI,2,1,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,OI,e.template,C(1,yf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function AI(r,o){if(r&1&&s(0,MI,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,TI,n.conditionSignal(),C(1,yf,n.componentConfigSignal,n.localUIStateSignal)))}}function PI(r,o){if(r&1&&y(0,AI,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var $o=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-more-reply-count-internal",this.shouldShow=L(()=>NI(this.defaultCondition(),this.componentConfigSignal())),this.hiddenCount=L(()=>RI(this.componentConfigSignal()))}setupA11yAttributes(){try{FI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-more-reply-count-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,a){if(t&1&&y(0,PI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F],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)}[_nghost-%COMP%]{color:var(--velt-text-10)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function FI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("aria-label","Hidden reply count")}catch{}}function NI(r,o){try{return r?(o?.data?.annotation?.comments?.length??0)>2:!0}catch{return!1}}function RI(r){try{let o=r?.data?.annotation?.comments?.length??0;return Math.max(0,o-2)}catch{return 0}}var wf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),LI=(r,o)=>({condition:r,data:o}),BI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-more-reply-text-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function VI(r,o){if(r&1&&(u(0),le(1),A(2,"translate"),p()),r&2){let n=l(3);d(),Ce(" ",R(2,1,n.pluralKey())," ")}}function $I(r,o){if(r&1&&(u(0),s(1,VI,3,3,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,BI,e.template,C(1,wf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function GI(r,o){if(r&1&&s(0,$I,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,LI,n.conditionSignal(),C(1,wf,n.componentConfigSignal,n.localUIStateSignal)))}}var Go=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-more-reply-text-internal",this.pluralKey=L(()=>HI(this.componentConfigSignal()))}setupA11yAttributes(){try{jI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyTextComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-more-reply-text-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,a){if(t&1&&y(0,GI,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]{color:var(--velt-text-10)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function jI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","text"),r.setAttribute("aria-hidden","true")}catch{}}function HI(r){try{return(r?.data?.annotation?.comments?.length??0)===3?"reply":"replies"}catch{return"replies"}}var If=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),WI=(r,o)=>({condition:r,data:o}),JI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-more-reply-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function YI(r,o){if(r&1&&(b(0,"div",3),le(1),A(2,"translate"),E(3,"velt-comment-dialog-more-reply-count-internal",4)(4,"velt-comment-dialog-more-reply-text-internal",4),x()),r&2){let n=l(4);k("data-testid",n.componentId+"-count-"+n.index())("aria-live","polite"),d(),Ce(" ",R(2,7,"Show")," "),d(2),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function KI(r,o){if(r&1){let n=J();u(0),b(1,"div",1),A(2,"translate"),A(3,"translate"),H("click",function(t){return B(n),l(3).onMoreRepliesClick(),V(t.stopPropagation())}),s(4,YI,5,9,"div",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId+"-button-"+e.index())("aria-label",(n==null||n.data==null||n.data.annotation==null||n.data.annotation.comments==null?null:n.data.annotation.comments.length)===3?R(2,3,"Show 1 more reply"):R(3,5,"Show "+((n==null||n.data==null||n.data.annotation==null||n.data.annotation.comments==null?null:n.data.annotation.comments.length)-2)+" more replies")),d(3),v("veltDynamicTemplate",O(10,JI,e.template,C(7,If,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function ZI(r,o){if(r&1&&s(0,KI,5,16,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,WI,n.conditionSignal(),C(1,If,n.componentConfigSignal,n.localUIStateSignal)))}}function XI(r,o){if(r&1&&y(0,ZI,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var jo=(()=>{let o=class o extends te{constructor(){super(),this.index=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.moreReplyTemplate=q(),this.domService=se(Ne),this.componentId="velt-comment-dialog-more-reply-internal",this.isDialogSelected=L(()=>QI(this.localUIStateSignal())),this.shouldShow=L(()=>t3(this.defaultCondition(),this.componentConfigSignal(),this.isDialogSelected(),this.index())),yt(()=>{try{let e=this.moreReplyTemplate();e?this.template=this.domService.deepCloneElement(e):this.template=null}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyComponent moreReplyTemplate effect:",e)}})}setupA11yAttributes(){try{qI(this.hostElementRef.nativeElement,this.componentId,this.index())}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyComponent setupA11yAttributes:",e)}}onMoreRepliesClick(){try{let e=this.getAnnotationId();if(!e)return;let t=!!this.componentConfigSignal()?.uiState?.collapsedRepliesPreview;if(e3(t,this.isDialogSelected())){let a=this.actionService.toggleShowReplies(e,!0);if(a.openFocusedThread&&a.annotation){let i=this.coreService.getContextConfig(e);i&&i.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{pendingOpenFocusedThread:a.annotation})}))}return}this.actionService.onMoreRepliesClick(e)}catch(e){this.loggingService.catch("Error in onMoreRepliesClick:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-more-reply-internal"]],inputs:{index:[1,"index"],moreReplyTemplate:[1,"moreReplyTemplate"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",3,"click"],["class","velt-hidden-count","role","status",4,"veltDynamicTemplate"],["role","status",1,"velt-hidden-count"],[3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,XI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,$o,Go,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)}[_nghost-%COMP%]:empty{display:none}.velt-hidden-count[_ngcontent-%COMP%]{text-align:center;color:var(--velt-text-10);cursor:pointer}.velt-hidden-count[_ngcontent-%COMP%]:before, .velt-hidden-count[_ngcontent-%COMP%]:after{background-color:var(--velt-background-4);content:"";display:inline-block;height:1px;position:relative;vertical-align:middle;width:calc(50% - 50px - 1em)}.velt-hidden-count[_ngcontent-%COMP%]:before{right:.5em;margin-left:-50%}.velt-hidden-count[_ngcontent-%COMP%]:after{left:.5em;margin-right:-50%}'],changeDetection:0});let r=o;return r})();function qI(r,o,n){try{r.setAttribute("data-testid",`${o}-host-${n}`)}catch{}}function QI(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function e3(r,o){return r&&!o}function t3(r,o,n,e){try{return r?(n?!o?.uiState?.showAllComments:!!o?.uiState?.collapsedRepliesPreview&&!o?.uiState?.showReplies)&&(o?.data?.annotation?.comments?.length??0)>2&&e===1:!0}catch{return!1}}function Df(r,o){if(!(!Array.isArray(r)||r.length===0))return o!=null?r.find(n=>n?.commentId?.toString()===o.toString()):r[0]}function cr(r){let{attachment:o,commentObj:n,attachmentIndex:e,config:t,contextAttachmentId:a,contextCommentId:i}=r;if(o)return o;if(n?.attachments&&Array.isArray(n.attachments))return n.attachments[e];let c=t?.data?.annotation?.comments;if(a){let I=Df(c,i)?.attachments;if(Array.isArray(I)){let S=I.find(z=>z?.attachmentId?.toString()===a.toString());if(S)return S}return null}let h=Df(c,i)?.attachments;return Array.isArray(h)?h[e]??null:null}var Tf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),n3=(r,o)=>({condition:r,data:o}),o3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function a3(r,o){r&1&&(u(0),b(1,"div",3),de(),b(2,"svg",4),E(3,"path",5)(4,"path",6),x()(),p())}function i3(r,o){if(r&1){let n=J();b(0,"div",1),A(1,"translate"),A(2,"translate"),H("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(3,a3,5,0,"ng-container",2),x()}if(r&2){let n=l(2),e=l();k("title",R(1,4,"Delete Attachment"))("aria-label",R(2,6,"Delete attachment"))("data-testid",e.componentId),d(3),v("veltDynamicTemplate",O(14,o3,e.template,O(8,Tf,e.componentConfigSignal,e.localUIStateSignal,e.commentObj(),e.attachmentIndex(),e.resolvedAttachment()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function l3(r,o){if(r&1&&(u(0),y(1,i3,4,20,"div"),p()),r&2){let n=l(2);d(),w(n.shouldShowDeleteButton()?1:-1)}}function d3(r,o){if(r&1&&s(0,l3,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,n3,n.conditionSignal(),O(1,Tf,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var Ho=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-delete-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}}),this.shouldShowDeleteButton=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();if(!e)return!1;let t=e.uiState?.disabled,a=e.featureState?.isPlanExpired,i=e.appState?.user?.userId,c=this.resolveComment()?.from?.userId;return!t&&!a&&i===c}catch(e){return this.loggingService.catch("Error in shouldShowDeleteButton:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImageDeleteComponent ngOnInit:",e)}}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolveCommentIndex();if(t===void 0)return;let a=this.attachmentIndex();this.actionService.deleteCommentAttachment(e,t,a)}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}resolveComment(){try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch(e){this.loggingService.catch("Error in resolveComment:",e);return}}resolveCommentIndex(){try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch(e){this.loggingService.catch("Error in resolveCommentIndex:",e);return}}setupA11yAttributes(){try{v3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-delete-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"click"],[4,"veltDynamicTemplate"],[1,"icon-button","velt-comment-attachment--image-action-btn"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","focusable","false"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(t,a){if(t&1&&y(0,d3,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachment--image-action-btn[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;opacity:1;margin:var(--velt-spacing-xs);border:0;cursor:pointer;color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function v3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var m3=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),s3=(r,o)=>({condition:r,data:o}),g3=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,attachmentIndex:t}),u3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function p3(r,o){r&1&&(u(0),b(1,"div",4),de(),b(2,"svg",5)(3,"g"),E(4,"rect",6),x(),b(5,"g"),E(6,"path",7),x()()(),p())}function h3(r,o){if(r&1){let n=J();b(0,"div",2),A(1,"translate"),A(2,"translate"),H("click",function(t){return B(n),l(3).onDownloadClick(),V(t.stopPropagation())}),s(3,p3,7,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();k("title",R(1,4,"Download attachment"))("aria-label",R(2,6,"Download attachment"))("data-testid",e.componentId),d(3),v("veltDynamicTemplate",O(14,u3,e.template,O(8,g3,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.commentObj(),e.attachmentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function b3(r,o){if(r&1&&(u(0),y(1,h3,4,20,"div",1),p()),r&2){let n=l(2);d(),w(n.shouldShowDownloadButton()?1:-1)}}function f3(r,o){if(r&1&&s(0,b3,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,s3,n.conditionSignal(),O(1,m3,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var zo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-download-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.shouldShowDownloadButton=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();if(!e)return!1;let t=e.uiState?.disabled,a=e.featureState?.isPlanExpired,i=e.appState?.user;return!t&&!a&&!!i?.userId&&!i?.isAnonymous}catch(e){return this.loggingService.catch("Error in shouldShowDownloadButton:",e),!1}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImageDownloadComponent ngOnInit:",e)}}onDownloadClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolvedAttachment();if(!t)return;this.actionService.downloadAttachment(e,t)}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}setupA11yAttributes(){try{C3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-download-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-comment-attachment--image-download-wrapper"],[1,"velt-comment-attachment--image-download-wrapper",3,"click"],[4,"veltDynamicTemplate"],[1,"icon-button","velt-comment-attachment--image-action-btn"],["xmlns","http://www.w3.org/2000/svg","enable-background","new 0 0 24 24","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","focusable","false"],["fill","none","height","24","width","24"],["d","M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"]],template:function(t,a){if(t&1&&y(0,f3,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachment--image-action-btn[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;opacity:1;margin:var(--velt-spacing-xs);border:0;cursor:pointer;color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function C3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var Of=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),x3=(r,o)=>({condition:r,data:o}),_3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-preview-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function S3(r,o){if(r&1){let n=J();u(0),b(1,"snippyly-lightbox",3,0)(3,"img",4),A(4,"translate"),A(5,"translate"),H("click",function(t){B(n);let a=we(2);return a==null||a.openImageInFullScreen(),V(t.stopPropagation())}),x()(),p()}if(r&2){let n,e,t,a=l(3);d(),v("src",(n=a.resolvedAttachment())==null?null:n.url),k("data-testid",a.componentId+"-lightbox"),d(2),v("src",(e=a.resolvedAttachment())==null?null:e.url,ur),k("alt",R(4,5,"Attachment")+" "+R(5,7,((t=a.resolvedAttachment())==null?null:t.name)||"preview"))("data-testid","velt-attachment-preview-image")}}function y3(r,o){if(r&1&&(u(0),s(1,S3,6,9,"ng-container",2),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,_3,e.template,O(1,Of,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function w3(r,o){if(r&1&&s(0,y3,2,13,"ng-container",1),r&2){let n=l();v("veltIf",C(7,x3,n.conditionSignal(),O(1,Of,n.componentConfigSignal,n.localUIStateSignal,n.resolvedAttachment(),n.attachmentIndex(),n.commentObj())))}}var Wo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-preview-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImagePreviewComponent ngOnInit:",e)}}setupA11yAttributes(){try{I3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-preview-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[["lightboxRef",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"src"],[3,"click","src"]],template:function(t,a){if(t&1&&y(0,w3,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Rb,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)}[_nghost-%COMP%]:empty{display:none}img[_ngcontent-%COMP%]{width:100%;object-fit:cover}"],changeDetection:0});let r=o;return r})();function I3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img"),r.setAttribute("aria-label","Attachment image preview")}catch{}}var T3=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,attachmentIndex:t}),O3=(r,o)=>({condition:r,data:o}),E3=(r,o,n,e,t,a)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,commentIndex:t,attachmentIndex:a}),M3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function A3(r,o){if(r&1&&(b(0,"div",4),A(1,"translate"),E(2,"velt-comment-dialog-thread-card-attachments-image-download-internal",6)(3,"velt-comment-dialog-thread-card-attachments-image-delete-internal",7),x()),r&2){let n=l(5);k("aria-label",R(1,13,"Image attachment actions"))("data-testid",n.componentId+"-actions"),d(2),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)("attachment",n.resolvedAttachment())("commentObj",n.commentObj())("attachmentIndex",n.attachmentIndex()),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)("attachment",n.resolvedAttachment())("commentObj",n.resolvedComment())("commentIndex",n.resolvedCommentIndex())("attachmentIndex",n.attachmentIndex())}}function P3(r,o){if(r&1&&(b(0,"div",2),A(1,"translate"),y(2,A3,4,15,"div",4),E(3,"velt-comment-dialog-thread-card-attachments-image-preview-internal",5),x()),r&2){let n,e=l(3),t=l();k("aria-label",R(1,10,"Image attachment controls"))("data-testid",t.componentId),d(2),w(e.uiState!=null&&e.uiState.readOnly?-1:2),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("attachment",t.resolvedAttachment())("commentObj",t.commentObj())("attachmentIndex",t.attachmentIndex()),k("aria-label","Preview of image: "+(((n=t.resolvedAttachment())==null?null:n.name)||"unnamed image"))("data-testid",t.componentId+"-file-preview")}}function F3(r,o){r&1&&E(0,"velt-skeleton-loader-internal",3)}function N3(r,o){if(r&1&&(u(0),y(1,P3,4,12,"div",2)(2,F3,1,0,"velt-skeleton-loader-internal",3),p()),r&2){let n=l(3);d(),w(n.showLoadingTemplate()?2:1)}}function R3(r,o){if(r&1&&(u(0),s(1,N3,3,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(8,M3,e.template,St(1,E3,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.commentObj(),e.commentIndex(),e.attachmentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function U3(r,o){if(r&1&&s(0,R3,2,14,"ng-container",0),r&2){let n=l();v("veltIf",C(7,O3,n.conditionSignal(),O(1,T3,n.componentConfigSignal,n.localUIStateSignal,n.resolvedAttachment(),n.commentObj(),n.attachmentIndex())))}}var Jo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-internal",this.domService=se(Ne),this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}}),this.showLoadingTemplate=L(()=>{try{let e=this.resolvedAttachment();return e?.isAttachmentResolverUsed===!0&&!e?.url}catch(e){return this.loggingService.catch("Error in showLoadingTemplate:",e),!1}}),this.resolvedComment=L(()=>{try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return null;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch{return null}}),this.resolvedCommentIndex=L(()=>{try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.resolvedComment()?.commentId;if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch{return}})}get imageWireframe(){return this._imageWireframe}set imageWireframe(e){this._imageWireframe=e,ye(this.imageWireframe)?this.template=null:this.template=this.domService.deepCloneElement(this.imageWireframe)}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImageComponent ngOnInit:",e)}}setupA11yAttributes(){try{L3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-internal"]],inputs:{imageWireframe:"imageWireframe",attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","role","group",1,"comment-attachment","velt-comment-attachment--image"],["height","20px","width","200px","borderRadius","20px",1,"velt-thread-card--message"],["role","group",1,"comment-attachment-actions","velt-comment-attachment--image-actions"],["role","img",3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex"]],template:function(t,a){if(t&1&&y(0,U3,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Jr,Ho,zo,Wo,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)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachment--image[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-sm);overflow:hidden;line-height:0;position:relative;max-width:400px}.velt-comment-attachment--image[_ngcontent-%COMP%] .velt-comment-attachment--image-actions[_ngcontent-%COMP%]{position:absolute;bottom:8px;right:8px;display:flex;opacity:0}.velt-comment-attachment--image[_ngcontent-%COMP%]:hover .velt-comment-attachment--image-actions[_ngcontent-%COMP%]{opacity:1}.velt-comment-attachment--image[_ngcontent-%COMP%]:not(:last-child){margin-bottom:var(--velt-spacing-lg)}"],changeDetection:0});let r=o;return r})();function L3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","group")}catch{}}var Ef=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),V3=(r,o)=>({condition:r,data:o}),$3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function G3(r,o){if(r&1&&(u(0),b(1,"div",4),de(),b(2,"svg",5),E(3,"path",6),x()(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-icon")}}function j3(r,o){if(r&1){let n=J();b(0,"button",2),A(1,"translate"),H("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(2,G3,4,1,"ng-container",3),x()}if(r&2){let n=l(2),e=l();k("aria-label",R(1,3,"Delete attachment"))("data-testid",e.componentId),d(2),v("veltDynamicTemplate",O(11,$3,e.template,O(5,Ef,e.componentConfigSignal,e.localUIStateSignal,e.commentObj(),e.attachmentIndex(),e.resolvedAttachment()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function H3(r,o){if(r&1&&(u(0),y(1,j3,3,17,"button",1),p()),r&2){let n=l(2);d(),w(n.shouldShowDeleteButton()?1:-1)}}function z3(r,o){if(r&1&&s(0,H3,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,V3,n.conditionSignal(),O(1,Ef,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var Yo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-delete-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}}),this.shouldShowDeleteButton=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();if(!e)return!1;let t=e.uiState?.disabled,a=e.featureState?.isPlanExpired,i=e.appState?.user?.userId,c=this.resolveComment()?.from?.userId;return!t&&!a&&i===c}catch(e){return this.loggingService.catch("Error in shouldShowDeleteButton:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherDeleteComponent ngOnInit:",e)}}resolveComment(){try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch(e){this.loggingService.catch("Error in resolveComment:",e);return}}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolveCommentIndex();if(t===void 0)return;let a=this.attachmentIndex();this.actionService.deleteCommentAttachment(e,t,a)}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}resolveCommentIndex(){try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch(e){this.loggingService.catch("Error in resolveCommentIndex:",e);return}}setupA11yAttributes(){try{W3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-delete-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button"],["type","button",3,"click"],[4,"veltDynamicTemplate"],[1,"attachment-icon-btn","velt-comment-attachment--action-btn"],["width","18","height","19","viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["d","M3 5.75H15M7.5 8.75V13.25M10.5 8.75V13.25M3.75 5.75L4.5 14.75C4.5 15.1478 4.65804 15.5294 4.93934 15.8107C5.22064 16.092 5.60218 16.25 6 16.25H12C12.3978 16.25 12.7794 16.092 13.0607 15.8107C13.342 15.5294 13.5 15.1478 13.5 14.75L14.25 5.75M6.75 5.75V3.5C6.75 3.30109 6.82902 3.11032 6.96967 2.96967C7.11032 2.82902 7.30109 2.75 7.5 2.75H10.5C10.6989 2.75 10.8897 2.82902 11.0303 2.96967C11.171 3.11032 11.25 3.30109 11.25 3.5V5.75","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,z3,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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);display:flex;align-items:center}[_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)}button[_ngcontent-%COMP%]{background:transparent;border:0;display:flex;margin:0;padding:0}.velt-comment-attachment--action-btn[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm);cursor:pointer;align-items:center;color:var(--velt-error)}"],changeDetection:0});let r=o;return r})();function W3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var Mf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),Y3=(r,o)=>({condition:r,data:o}),K3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Z3(r,o){if(r&1&&(u(0),b(1,"div",3),de(),b(2,"svg",4),E(3,"path",5),x()(),p()),r&2){let n=l(3);d(),k("data-testid",n.componentId+"-icon")}}function X3(r,o){if(r&1){let n=J();u(0),b(1,"button",1),A(2,"translate"),A(3,"translate"),H("click",function(t){return B(n),l(2).onDownloadClick(),V(t.stopPropagation())}),s(4,Z3,4,1,"ng-container",2),x(),p()}if(r&2){let n=l(),e=l();d(),k("title",R(2,4,"Download attachment"))("aria-label",R(3,6,"Download attachment"))("data-testid",e.componentId),d(3),v("veltDynamicTemplate",O(14,K3,e.template,O(8,Mf,e.componentConfigSignal,e.localUIStateSignal,e.commentObj(),e.attachmentIndex(),e.resolvedAttachment()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function q3(r,o){if(r&1&&s(0,X3,5,20,"ng-container",0),r&2){let n=l();v("veltIf",C(7,Y3,n.conditionSignal(),O(1,Mf,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var Ko=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-download-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherDownloadComponent ngOnInit:",e)}}onDownloadClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolvedAttachment();if(!t){this.loggingService.catch("Cannot download: No attachment found",new Error("Missing attachment"));return}this.actionService.downloadAttachment(e,t)}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}setupA11yAttributes(){try{Q3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-download-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button",3,"click"],[4,"veltDynamicTemplate"],[1,"attachment-icon-btn","velt-comment-attachment--action-btn"],["width","18","height","19","viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["d","M3 13.25V14.75C3 15.1478 3.15804 15.5294 3.43934 15.8107C3.72064 16.092 4.10218 16.25 4.5 16.25H13.5C13.8978 16.25 14.2794 16.092 14.5607 15.8107C14.842 15.5294 15 15.1478 15 14.75V13.25M5.25 8.75L9 12.5M9 12.5L12.75 8.75M9 12.5V3.5","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,q3,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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);display:flex;align-items:center}[_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)}button[_ngcontent-%COMP%]{background:transparent;border:0;display:flex;margin:0;padding:0}.velt-comment-attachment--action-btn[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm);cursor:pointer;align-items:center;color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function Q3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var Af=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),rD=(r,o)=>({condition:r,data:o}),nD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-icon-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function oD(r,o){if(r&1&&(u(0),E(1,"velt-file-icon-internal",2),p()),r&2){let n,e=l(3);d(),v("type",(n=e.resolvedAttachment())==null?null:n.mimeType),k("data-testid",e.componentId)}}function aD(r,o){if(r&1&&(u(0),s(1,oD,2,2,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,nD,e.template,O(1,Af,e.componentConfigSignal,e.localUIStateSignal,e.attachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function iD(r,o){if(r&1&&s(0,aD,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,rD,n.conditionSignal(),O(1,Af,n.componentConfigSignal,n.localUIStateSignal,n.attachment(),n.attachmentIndex(),n.commentObj())))}}var Zo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-icon-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherIconComponent ngOnInit:",e)}}setupA11yAttributes(){try{lD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-icon-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"type"]],template:function(t,a){if(t&1&&y(0,iD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Pg],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)}[_nghost-%COMP%]{display:flex;color:var(--velt-accent)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function lD(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var Pf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),vD=(r,o)=>({condition:r,data:o}),cD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-name-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function mD(r,o){if(r&1&&(u(0),b(1,"span",2),A(2,"translate"),le(3),A(4,"translate"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label","File name: "+R(2,3,((n=t.resolvedAttachment())==null?null:n.name)||"")),d(2),Ce(" ",R(4,5,(e=t.resolvedAttachment())==null?null:e.name)," ")}}function sD(r,o){if(r&1&&(u(0),s(1,mD,5,7,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,cD,e.template,O(1,Pf,e.componentConfigSignal,e.localUIStateSignal,e.attachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function gD(r,o){if(r&1&&s(0,sD,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,vD,n.conditionSignal(),O(1,Pf,n.componentConfigSignal,n.localUIStateSignal,n.attachment(),n.attachmentIndex(),n.commentObj())))}}var Xo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-name-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherNameComponent ngOnInit:",e)}}setupA11yAttributes(){try{uD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-name-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"attachment-name","velt-comment-attachment--name"]],template:function(t,a){if(t&1&&y(0,gD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]{line-height:normal}.velt-comment-attachment--name[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-3);text-overflow:ellipsis;font-size:var(--velt-font-size-xs);font-style:normal;font-weight:600;line-height:normal;white-space:nowrap}"],changeDetection:0});let r=o;return r})();function uD(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var Ff=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),bD=(r,o)=>({condition:r,data:o}),fD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-size-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function CD(r,o){if(r&1&&(u(0),b(1,"span",2),A(2,"translate"),A(3,"fileSize"),le(4),A(5,"fileSize"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label",R(2,3,"File size:")+" "+R(3,5,(n=t.resolvedAttachment())==null?null:n.size)),d(3),Ce(" ",R(5,7,(e=t.resolvedAttachment())==null?null:e.size)," ")}}function kD(r,o){if(r&1&&(u(0),s(1,CD,6,9,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,fD,e.template,O(1,Ff,e.componentConfigSignal,e.localUIStateSignal,e.attachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function xD(r,o){if(r&1&&s(0,kD,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,bD,n.conditionSignal(),O(1,Ff,n.componentConfigSignal,n.localUIStateSignal,n.attachment(),n.attachmentIndex(),n.commentObj())))}}var qo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-size-internal",this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherSizeComponent ngOnInit:",e)}}setupA11yAttributes(){try{_D(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-size-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"attachment-size","velt-comment-attachment--size"]],template:function(t,a){if(t&1&&y(0,xD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,W,Rg],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)}[_nghost-%COMP%]:empty{display:none}[_nghost-%COMP%]{line-height:normal}.velt-comment-attachment--size[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-7);text-overflow:ellipsis;font-size:var(--velt-font-size-2xs);font-style:normal;font-weight:500;line-height:normal}"],changeDetection:0});let r=o;return r})();function _D(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var yD=(r,o,n,e,t,a)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t,commentIndex:a}),wD=(r,o)=>({condition:r,data:o}),ID=(r,o,n,e,t,a)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,commentIndex:t,attachmentIndex:a}),DD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function TD(r,o){if(r&1&&(b(0,"div",7),A(1,"translate"),A(2,"translate"),E(3,"velt-comment-dialog-thread-card-attachments-other-download-internal",8),A(4,"translate"),A(5,"translate"),E(6,"velt-comment-dialog-thread-card-attachments-other-delete-internal",9),A(7,"translate"),A(8,"translate"),x()),r&2){let n,e,t,a=l(5);k("aria-label",R(1,17,"Actions for file:")+" "+R(2,19,((n=a.resolvedAttachment())==null?null:n.name)||"unnamed file"))("data-testid",a.componentId+"-attachment-actions"),d(3),v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",a.resolvedAttachment())("commentObj",a.commentObj())("attachmentIndex",a.attachmentIndex()),k("aria-label",R(4,21,"Download file:")+" "+R(5,23,((e=a.resolvedAttachment())==null?null:e.name)||"unnamed file"))("data-testid",a.componentId+"-download-attachment"),d(3),v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",a.resolvedAttachment())("commentObj",a.resolvedComment())("commentIndex",a.resolvedCommentIndex())("attachmentIndex",a.attachmentIndex()),k("aria-label",R(7,25,"Remove file:")+" "+R(8,27,((t=a.resolvedAttachment())==null?null:t.name)||"unnamed file"))("data-testid",a.componentId+"-delete-attachment")}}function OD(r,o){if(r&1&&(b(0,"div",2),A(1,"translate"),A(2,"translate"),b(3,"div",4),A(4,"translate"),A(5,"translate"),E(6,"velt-comment-dialog-thread-card-attachments-other-icon-internal",5),x(),b(7,"div",6),A(8,"translate"),A(9,"translate"),E(10,"velt-comment-dialog-thread-card-attachments-other-name-internal",5),A(11,"translate"),A(12,"translate"),E(13,"velt-comment-dialog-thread-card-attachments-other-size-internal",5),A(14,"translate"),A(15,"translate"),x(),y(16,TD,9,29,"div",7),x()),r&2){let n,e,t,a,i,c=l(3),m=l();k("aria-label",R(1,26,"File attachment:")+" "+R(2,28,((n=m.resolvedAttachment())==null?null:n.name)||"unnamed file"))("data-testid",m.componentId+"-attachment"),d(3),k("aria-label",R(4,30,"File type icon for")+" "+R(5,32,((e=m.resolvedAttachment())==null?null:e.name)||"unnamed file"))("data-testid",m.componentId+"-attachment-icon"),d(3),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("attachment",m.resolvedAttachment())("commentObj",m.commentObj())("attachmentIndex",m.attachmentIndex()),d(),k("aria-label",R(8,34,"Details for file:")+" "+R(9,36,((t=m.resolvedAttachment())==null?null:t.name)||"unnamed file"))("data-testid",m.componentId+"-attachment-details"),d(3),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("attachment",m.resolvedAttachment())("commentObj",m.commentObj())("attachmentIndex",m.attachmentIndex()),k("aria-label",R(11,38,"Filename:")+" "+R(12,40,((a=m.resolvedAttachment())==null?null:a.name)||"unnamed file"))("data-testid",m.componentId+"-attachment-name"),d(3),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("attachment",m.resolvedAttachment())("commentObj",m.commentObj())("attachmentIndex",m.attachmentIndex()),k("aria-label",R(14,42,"File size:")+" "+R(15,44,((i=m.resolvedAttachment())==null?null:i.size)||"unknown size"))("data-testid",m.componentId+"-attachment-size"),d(3),w(c.uiState!=null&&c.uiState.readOnly?-1:16)}}function ED(r,o){r&1&&E(0,"velt-skeleton-loader-internal",3)}function MD(r,o){if(r&1&&(u(0),y(1,OD,17,46,"div",2)(2,ED,1,0,"velt-skeleton-loader-internal",3),p()),r&2){let n=l(3);d(),w(n.showLoadingTemplate()?2:1)}}function AD(r,o){if(r&1&&(u(0),s(1,MD,3,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(8,DD,e.template,St(1,ID,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.commentObj(),e.commentIndex(),e.attachmentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function PD(r,o){if(r&1&&s(0,AD,2,14,"ng-container",0),r&2){let n=l();v("veltIf",C(8,wD,n.conditionSignal(),St(1,yD,n.componentConfigSignal,n.localUIStateSignal,n.resolvedAttachment(),n.attachmentIndex(),n.commentObj(),n.commentIndex())))}}var Qo=(()=>{let o=class o extends te{get otherWireframe(){return this._otherWireframe}set otherWireframe(e){this._otherWireframe=e,ye(this.otherWireframe)?this.template=null:this.template=this.domService.deepCloneElement(this.otherWireframe)}constructor(){super(),this.componentId="velt-comment-dialog-thread-card-attachments-other-internal",this.domService=se(Ne),this.attachment=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return cr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch{return null}}),this.showLoadingTemplate=L(()=>{try{let e=this.resolvedAttachment();return e?.isAttachmentResolverUsed===!0&&!e?.url}catch{return!1}}),this.resolvedComment=L(()=>{try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return null;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch{return null}}),this.resolvedCommentIndex=L(()=>{try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.resolvedComment()?.commentId;if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch{return}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherComponent ngOnInit:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-internal"]],inputs:{otherWireframe:"otherWireframe",attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region",1,"comment-pdf-attachment","velt-comment-attachment"],["height","20px","width","200px","borderRadius","20px",1,"velt-thread-card--message"],["role","img",1,"attachment-icon","velt-comment-attachment--icon"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],["role","group",1,"attachment-details","velt-comment-attachment--details"],["role","group",1,"attachment-actions","velt-comment-attachment--actions"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex"]],template:function(t,a){if(t&1&&y(0,PD,1,11,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Jr,Yo,Ko,Zo,Xo,qo,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);width:100%}[_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-comment-attachment[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm) var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-md);justify-content:space-between;gap:var(--velt-spacing-sm);align-items:center;align-self:stretch;width:100%;border-radius:var(--velt-border-radius-sm);border:1px solid var(--velt-border-4);box-sizing:border-box}.velt-comment-attachment[_ngcontent-%COMP%] .velt-comment-attachment--icon[_ngcontent-%COMP%]{display:flex}.velt-comment-attachment[_ngcontent-%COMP%] .velt-comment-attachment--details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs);flex:1;overflow:hidden}.velt-comment-attachment[_ngcontent-%COMP%] .velt-comment-attachment--actions[_ngcontent-%COMP%]{display:flex;width:0;overflow:hidden}.velt-comment-attachment[_ngcontent-%COMP%]:not(:last-child){margin-bottom:var(--velt-spacing-lg)}.velt-comment-attachment[_ngcontent-%COMP%]:hover .velt-comment-attachment--actions[_ngcontent-%COMP%]{width:auto}"],changeDetection:0});let r=o;return r})();var Nf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),ND=(r,o)=>({condition:r,data:o}),RD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1}),UD=(r,o)=>o==null?null:o.attachmentId;function LD(r,o){if(r&1&&E(0,"velt-comment-dialog-thread-card-attachments-image-internal",3),r&2){let n=l(),e=n.$implicit,t=n.$index,a=l(5);v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",e)("commentObj",a.resolvedComment())("commentIndex",a.commentIndex())("attachmentIndex",t)("imageWireframe",a.imageWireframe)}}function BD(r,o){if(r&1&&E(0,"velt-comment-dialog-thread-card-attachments-other-internal",4),r&2){let n=l(),e=n.$implicit,t=n.$index,a=l(5);v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",e)("commentObj",a.resolvedComment())("commentIndex",a.commentIndex())("attachmentIndex",t)("otherWireframe",a.otherWireframe)}}function VD(r,o){if(r&1&&y(0,LD,1,7,"velt-comment-dialog-thread-card-attachments-image-internal",3)(1,BD,1,7,"velt-comment-dialog-thread-card-attachments-other-internal",4),r&2){let n=o.$implicit,e=l(5);w(e.isImageAttachment(n)?0:1)}}function $D(r,o){if(r&1&&(b(0,"div",2),A(1,"translate"),rt(2,VD,2,1,null,null,UD),x()),r&2){let n=l(4);k("data-testid",n.componentId)("aria-label",R(1,2,"Attachments")+"("+n.resolvedAttachments().length+")"),d(2),nt(n.resolvedAttachments())}}function GD(r,o){if(r&1&&(u(0),y(1,$D,4,4,"div",2),p()),r&2){let n=l(3);d(),w(n.resolvedAttachments().length?1:-1)}}function jD(r,o){if(r&1&&(u(0),s(1,GD,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,RD,e.template,O(1,Nf,e.componentConfigSignal,e.localUIStateSignal,e.resolvedComment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function HD(r,o){if(r&1&&s(0,jD,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,ND,n.conditionSignal(),O(1,Nf,n.componentConfigSignal,n.localUIStateSignal,n.resolvedComment(),n.commentIndex(),n.commentIndex())))}}var ea=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-thread-card-attachments-internal",this.domService=se(Ne),this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=q(""),this.attachmentId=q(""),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.resolvedComment=L(()=>{try{let e=this.commentObj();if(e)return e;let a=this.componentConfigSignal()?.data?.annotation?.comments,i=this.commentId();if(i&&a&&Array.isArray(a)){let h=a.find(_=>_.commentId?.toString()===i);if(h)return h}let c=this.getContextCommentId();if(c!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===c);if(h)return h}let m=this.commentIndex();return a&&Array.isArray(a)&&m!==void 0&&m>=0?a[m]:null}catch(e){return this.loggingService.catch("Error in resolvedComment:",e),null}}),this.resolvedAttachments=L(()=>{try{let e=this.resolvedComment(),t=this.attachmentId();return!e?.attachments||!Array.isArray(e.attachments)?[]:t?e.attachments.filter(i=>i.attachmentId?.toString()===t):e.attachments}catch(e){return this.loggingService.catch("Error in resolvedAttachments:",e),[]}})}ngOnInit(){try{if(super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.commentObj(),i:this.commentIndex()}),!this.imageWireframe){let e=this.template?.querySelector("velt-comment-dialog-thread-card-attachments-image-wireframe");ye(e)||(this.imageWireframe=e)}if(!this.otherWireframe){let e=this.template?.querySelector("velt-comment-dialog-thread-card-attachments-other-wireframe");ye(e)||(this.otherWireframe=e)}}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsComponent ngOnInit:",e)}}isImageAttachment(e){try{return e?.mimeType?.includes("image")||!1}catch{return!1}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],attachmentId:[1,"attachmentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","role","region",1,"comment-attachments","velt-comment-attachments"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex","imageWireframe"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex","otherWireframe"]],template:function(t,a){if(t&1&&y(0,HD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Jo,Qo,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)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachments[_ngcontent-%COMP%]{gap:var(--velt-spacing-sm);display:flex;flex-direction:column}.velt-comment-attachments[_ngcontent-%COMP%]:not(:empty){margin:var(--velt-spacing-lg) 0 var(--velt-spacing-sm);padding-left:calc((3rem + 0px) * var(--velt-base-rem-unit))}"],changeDetection:0});let r=o;return r})();var Rf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),WD=(r,o)=>({condition:r,data:o}),JD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-avatar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function YD(r,o){if(r&1&&(E(0,"snippyly-user-avatar",2),A(1,"translate"),A(2,"translate")),r&2){let n,e,t=l(4);v("size",32)("user",(n=t.comment())==null?null:n.from),k("data-testid",t.componentId)("aria-label",R(1,4,"Avatar for")+" "+R(2,6,((e=t.comment())==null||e.from==null?null:e.from.name)||((e=t.comment())==null||e.from==null?null:e.from.email)||"user"))}}function KD(r,o){if(r&1&&(u(0),y(1,YD,3,8,"snippyly-user-avatar",2),p()),r&2){let n=l(3);d(),w(n.comment()?1:-1)}}function ZD(r,o){if(r&1&&(u(0),s(1,KD,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,JD,e.template,O(1,Rf,e.componentConfigSignal,e.localUIStateSignal,e.comment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function XD(r,o){if(r&1&&s(0,ZD,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,WD,n.conditionSignal(),O(1,Rf,n.componentConfigSignal,n.localUIStateSignal,n.comment(),n.commentIndex(),n.commentIndex())))}}var ta=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-avatar-internal",this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.comment=L(()=>{try{let e=this.commentObj();if(e)return e;let a=this.componentConfigSignal()?.data?.annotation?.comments,i=this.commentId();if(i!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===i);if(h)return h}let c=this.getContextCommentId();if(c!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===c);if(h)return h}let m=this.commentIndex();return m!==void 0&&a&&Array.isArray(a)?a[m]:null}catch(e){return this.loggingService.catch("Error in comment computed:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.comment(),i:this.commentIndex()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAvatarComponent ngOnInit:",e)}}setupA11yAttributes(){try{qD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-avatar-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"comment-dialog-user-avatar",3,"size","user"]],template:function(t,a){if(t&1&&y(0,XD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Ut,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)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function qD(r,o){try{r.setAttribute("role","presentation"),r.setAttribute("data-testid",o+"-container")}catch{}}function e4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",2)(2,"g"),E(3,"path",3),x(),E(4,"path",4),x()()),r&2){let n=l();k("data-testid",n.componentId+"-mobile")}}function t4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",5)(2,"g"),E(3,"path",3)(4,"path",6),x(),E(5,"path",7),x()()),r&2){let n=l();k("data-testid",n.componentId+"-tablet")}}function r4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",8),E(2,"path",9)(3,"path",10)(4,"path",11),x()()),r&2){let n=l();k("data-testid",n.componentId+"-desktop")}}function n4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",12),E(2,"path",13)(3,"path",14)(4,"path",15),x()()),r&2){let n=l();k("data-testid",n.componentId+"-monitor")}}var Qu=(()=>{let o=class o{constructor(e,t){this.elementRef=e,this.loggingService=t,this.deviceType="",this.componentId="velt-device-type-icons"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in DeviceTypeIconsComponent ngOnInit:",e)}}setupA11yAttributes(){try{o4(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in DeviceTypeIconsComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(j(me),j(N))},o.\u0275cmp=T({type:o,selectors:[["app-device-type-icons"]],inputs:{deviceType:"deviceType"},standalone:!1,decls:5,vars:3,consts:[["role","status",1,"devide-type-container","velt-device-type-icons"],[1,"s-flex","velt-device-type-icons--flex"],["width","53","height","17","viewBox","0 0 53 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img",1,"skip-reset"],["fill-rule","evenodd","clip-rule","evenodd","d","M8.5 3.5H3.5C3.22386 3.5 3 3.72386 3 4V13C3 13.2761 3.22386 13.5 3.5 13.5H8.5C8.77614 13.5 9 13.2761 9 13V4C9 3.72386 8.77614 3.5 8.5 3.5ZM3.5 2.5C2.67157 2.5 2 3.17157 2 4V13C2 13.8284 2.67157 14.5 3.5 14.5H8.5C9.32843 14.5 10 13.8284 10 13V4C10 3.17157 9.32843 2.5 8.5 2.5H3.5Z","fill","currentColor"],["d","M24.624 4.388V12H23.623V6.324L21.093 12H20.389L17.848 6.313V12H16.847V4.388H17.925L20.741 10.68L23.557 4.388H24.624ZM29.0606 12.099C28.4959 12.099 27.9826 11.9707 27.5206 11.714C27.0659 11.4573 26.7066 11.0943 26.4426 10.625C26.1859 10.1483 26.0576 9.59833 26.0576 8.975C26.0576 8.359 26.1896 7.81633 26.4536 7.347C26.7249 6.87033 27.0916 6.50733 27.5536 6.258C28.0156 6.00133 28.5326 5.873 29.1046 5.873C29.6766 5.873 30.1936 6.00133 30.6556 6.258C31.1176 6.50733 31.4806 6.86667 31.7446 7.336C32.0159 7.80533 32.1516 8.35167 32.1516 8.975C32.1516 9.59833 32.0123 10.1483 31.7336 10.625C31.4623 11.0943 31.0919 11.4573 30.6226 11.714C30.1533 11.9707 29.6326 12.099 29.0606 12.099ZM29.0606 11.219C29.4199 11.219 29.7573 11.1347 30.0726 10.966C30.3879 10.7973 30.6409 10.5443 30.8316 10.207C31.0296 9.86967 31.1286 9.459 31.1286 8.975C31.1286 8.491 31.0333 8.08033 30.8426 7.743C30.6519 7.40567 30.4026 7.15633 30.0946 6.995C29.7866 6.82633 29.4529 6.742 29.0936 6.742C28.7269 6.742 28.3896 6.82633 28.0816 6.995C27.7809 7.15633 27.5389 7.40567 27.3556 7.743C27.1723 8.08033 27.0806 8.491 27.0806 8.975C27.0806 9.46633 27.1686 9.88067 27.3446 10.218C27.5279 10.5553 27.7699 10.8083 28.0706 10.977C28.3713 11.1383 28.7013 11.219 29.0606 11.219ZM34.5787 7.094C34.7841 6.73467 35.0847 6.44133 35.4807 6.214C35.8767 5.98667 36.3277 5.873 36.8337 5.873C37.3764 5.873 37.8641 6.00133 38.2967 6.258C38.7294 6.51467 39.0704 6.87767 39.3197 7.347C39.5691 7.809 39.6937 8.348 39.6937 8.964C39.6937 9.57267 39.5691 10.1153 39.3197 10.592C39.0704 11.0687 38.7257 11.439 38.2857 11.703C37.8531 11.967 37.3691 12.099 36.8337 12.099C36.3131 12.099 35.8547 11.9853 35.4587 11.758C35.0701 11.5307 34.7767 11.241 34.5787 10.889V12H33.5777V3.86H34.5787V7.094ZM38.6707 8.964C38.6707 8.50933 38.5791 8.11333 38.3957 7.776C38.2124 7.43867 37.9631 7.182 37.6477 7.006C37.3397 6.83 36.9987 6.742 36.6247 6.742C36.2581 6.742 35.9171 6.83367 35.6017 7.017C35.2937 7.193 35.0444 7.45333 34.8537 7.798C34.6704 8.13533 34.5787 8.52767 34.5787 8.975C34.5787 9.42967 34.6704 9.82933 34.8537 10.174C35.0444 10.5113 35.2937 10.7717 35.6017 10.955C35.9171 11.131 36.2581 11.219 36.6247 11.219C36.9987 11.219 37.3397 11.131 37.6477 10.955C37.9631 10.7717 38.2124 10.5113 38.3957 10.174C38.5791 9.82933 38.6707 9.426 38.6707 8.964ZM41.6383 4.993C41.4477 4.993 41.2863 4.927 41.1543 4.795C41.0223 4.663 40.9563 4.50167 40.9563 4.311C40.9563 4.12033 41.0223 3.959 41.1543 3.827C41.2863 3.695 41.4477 3.629 41.6383 3.629C41.8217 3.629 41.9757 3.695 42.1003 3.827C42.2323 3.959 42.2983 4.12033 42.2983 4.311C42.2983 4.50167 42.2323 4.663 42.1003 4.795C41.9757 4.927 41.8217 4.993 41.6383 4.993ZM42.1223 5.972V12H41.1213V5.972H42.1223ZM44.9394 3.86V12H43.9384V3.86H44.9394ZM52.2554 8.755C52.2554 8.94567 52.2444 9.14733 52.2224 9.36H47.4044C47.4411 9.954 47.6427 10.4197 48.0094 10.757C48.3834 11.087 48.8344 11.252 49.3624 11.252C49.7951 11.252 50.1544 11.153 50.4404 10.955C50.7337 10.7497 50.9391 10.4783 51.0564 10.141H52.1344C51.9731 10.7203 51.6504 11.1933 51.1664 11.56C50.6824 11.9193 50.0811 12.099 49.3624 12.099C48.7904 12.099 48.2771 11.9707 47.8224 11.714C47.3751 11.4573 47.0231 11.0943 46.7664 10.625C46.5097 10.1483 46.3814 9.59833 46.3814 8.975C46.3814 8.35167 46.5061 7.80533 46.7554 7.336C47.0047 6.86667 47.3531 6.50733 47.8004 6.258C48.2551 6.00133 48.7757 5.873 49.3624 5.873C49.9344 5.873 50.4404 5.99767 50.8804 6.247C51.3204 6.49633 51.6577 6.841 51.8924 7.281C52.1344 7.71367 52.2554 8.205 52.2554 8.755ZM51.2214 8.546C51.2214 8.16467 51.1371 7.83833 50.9684 7.567C50.7997 7.28833 50.5687 7.07933 50.2754 6.94C49.9894 6.79333 49.6704 6.72 49.3184 6.72C48.8124 6.72 48.3797 6.88133 48.0204 7.204C47.6684 7.52667 47.4667 7.974 47.4154 8.546H51.2214Z","fill","currentColor"],["width","51","height","17","viewBox","0 0 51 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M6.5 12C6.5 12.2761 6.27614 12.5 6 12.5C5.72386 12.5 5.5 12.2761 5.5 12C5.5 11.7239 5.72386 11.5 6 11.5C6.27614 11.5 6.5 11.7239 6.5 12Z","fill","currentColor"],["d","M21.566 4.333V5.147H19.476V12H18.475V5.147H16.374V4.333H21.566ZM22.5342 8.964C22.5342 8.348 22.6588 7.809 22.9082 7.347C23.1575 6.87767 23.4985 6.51467 23.9312 6.258C24.3712 6.00133 24.8588 5.873 25.3942 5.873C25.9222 5.873 26.3805 5.98667 26.7692 6.214C27.1578 6.44133 27.4475 6.72733 27.6382 7.072V5.972H28.6502V12H27.6382V10.878C27.4402 11.23 27.1432 11.5233 26.7472 11.758C26.3585 11.9853 25.9038 12.099 25.3832 12.099C24.8478 12.099 24.3638 11.967 23.9312 11.703C23.4985 11.439 23.1575 11.0687 22.9082 10.592C22.6588 10.1153 22.5342 9.57267 22.5342 8.964ZM27.6382 8.975C27.6382 8.52033 27.5465 8.12433 27.3632 7.787C27.1798 7.44967 26.9305 7.193 26.6152 7.017C26.3072 6.83367 25.9662 6.742 25.5922 6.742C25.2182 6.742 24.8772 6.83 24.5692 7.006C24.2612 7.182 24.0155 7.43867 23.8322 7.776C23.6488 8.11333 23.5572 8.50933 23.5572 8.964C23.5572 9.426 23.6488 9.82933 23.8322 10.174C24.0155 10.5113 24.2612 10.7717 24.5692 10.955C24.8772 11.131 25.2182 11.219 25.5922 11.219C25.9662 11.219 26.3072 11.131 26.6152 10.955C26.9305 10.7717 27.1798 10.5113 27.3632 10.174C27.5465 9.82933 27.6382 9.42967 27.6382 8.975ZM31.4528 7.094C31.6581 6.73467 31.9588 6.44133 32.3548 6.214C32.7508 5.98667 33.2018 5.873 33.7078 5.873C34.2504 5.873 34.7381 6.00133 35.1708 6.258C35.6034 6.51467 35.9444 6.87767 36.1938 7.347C36.4431 7.809 36.5678 8.348 36.5678 8.964C36.5678 9.57267 36.4431 10.1153 36.1938 10.592C35.9444 11.0687 35.5998 11.439 35.1598 11.703C34.7271 11.967 34.2431 12.099 33.7078 12.099C33.1871 12.099 32.7288 11.9853 32.3328 11.758C31.9441 11.5307 31.6508 11.241 31.4528 10.889V12H30.4518V3.86H31.4528V7.094ZM35.5448 8.964C35.5448 8.50933 35.4531 8.11333 35.2698 7.776C35.0864 7.43867 34.8371 7.182 34.5218 7.006C34.2138 6.83 33.8728 6.742 33.4988 6.742C33.1321 6.742 32.7911 6.83367 32.4758 7.017C32.1678 7.193 31.9184 7.45333 31.7278 7.798C31.5444 8.13533 31.4528 8.52767 31.4528 8.975C31.4528 9.42967 31.5444 9.82933 31.7278 10.174C31.9184 10.5113 32.1678 10.7717 32.4758 10.955C32.7911 11.131 33.1321 11.219 33.4988 11.219C33.8728 11.219 34.2138 11.131 34.5218 10.955C34.8371 10.7717 35.0864 10.5113 35.2698 10.174C35.4531 9.82933 35.5448 9.426 35.5448 8.964ZM38.9964 3.86V12H37.9954V3.86H38.9964ZM46.3124 8.755C46.3124 8.94567 46.3014 9.14733 46.2794 9.36H41.4614C41.4981 9.954 41.6997 10.4197 42.0664 10.757C42.4404 11.087 42.8914 11.252 43.4194 11.252C43.8521 11.252 44.2114 11.153 44.4974 10.955C44.7907 10.7497 44.9961 10.4783 45.1134 10.141H46.1914C46.0301 10.7203 45.7074 11.1933 45.2234 11.56C44.7394 11.9193 44.1381 12.099 43.4194 12.099C42.8474 12.099 42.3341 11.9707 41.8794 11.714C41.4321 11.4573 41.0801 11.0943 40.8234 10.625C40.5667 10.1483 40.4384 9.59833 40.4384 8.975C40.4384 8.35167 40.5631 7.80533 40.8124 7.336C41.0617 6.86667 41.4101 6.50733 41.8574 6.258C42.3121 6.00133 42.8327 5.873 43.4194 5.873C43.9914 5.873 44.4974 5.99767 44.9374 6.247C45.3774 6.49633 45.7147 6.841 45.9494 7.281C46.1914 7.71367 46.3124 8.205 46.3124 8.755ZM45.2784 8.546C45.2784 8.16467 45.1941 7.83833 45.0254 7.567C44.8567 7.28833 44.6257 7.07933 44.3324 6.94C44.0464 6.79333 43.7274 6.72 43.3754 6.72C42.8694 6.72 42.4367 6.88133 42.0774 7.204C41.7254 7.52667 41.5237 7.974 41.4724 8.546H45.2784ZM48.9647 6.797V10.35C48.9647 10.6433 49.027 10.8523 49.1517 10.977C49.2763 11.0943 49.4927 11.153 49.8007 11.153H50.5377V12H49.6357C49.0783 12 48.6603 11.8717 48.3817 11.615C48.103 11.3583 47.9637 10.9367 47.9637 10.35V6.797H47.1827V5.972H47.9637V4.454H48.9647V5.972H50.5377V6.797H48.9647Z","fill","currentColor"],["width","62","height","17","viewBox","0 0 62 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.5 5.5L2.5 10L9.5 10L9.5 5.5C9.5 5.22386 9.27614 5 9 5L3 5C2.72386 5 2.5 5.22386 2.5 5.5ZM1.5 11L10.5 11L10.5 5.5C10.5 4.67157 9.82843 4 9 4L3 4C2.17157 4 1.5 4.67157 1.5 5.5L1.5 11Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M1.5 11L1.5 11.5C1.5 11.7761 1.72386 12 2 12L10 12C10.2761 12 10.5 11.7761 10.5 11.5L10.5 11L1.5 11ZM0.5 11.5C0.5 12.3284 1.17157 13 2 13L10 13C10.8284 13 11.5 12.3284 11.5 11.5L11.5 10.5C11.5 10.2239 11.2761 10 11 10L1 10C0.723858 10 0.5 10.2239 0.5 10.5L0.5 11.5Z","fill","currentColor"],["d","M19.234 4.333C20.07 4.333 20.7923 4.49067 21.401 4.806C22.017 5.114 22.4863 5.55767 22.809 6.137C23.139 6.71633 23.304 7.39833 23.304 8.183C23.304 8.96767 23.139 9.64967 22.809 10.229C22.4863 10.801 22.017 11.241 21.401 11.549C20.7923 11.8497 20.07 12 19.234 12H16.847V4.333H19.234ZM19.234 11.175C20.224 11.175 20.9793 10.9147 21.5 10.394C22.0207 9.866 22.281 9.129 22.281 8.183C22.281 7.22967 22.017 6.48533 21.489 5.95C20.9683 5.41467 20.2167 5.147 19.234 5.147H17.848V11.175H19.234ZM30.2343 8.755C30.2343 8.94567 30.2233 9.14733 30.2013 9.36H25.3833C25.42 9.954 25.6217 10.4197 25.9883 10.757C26.3623 11.087 26.8133 11.252 27.3413 11.252C27.774 11.252 28.1333 11.153 28.4193 10.955C28.7127 10.7497 28.918 10.4783 29.0353 10.141H30.1133C29.952 10.7203 29.6293 11.1933 29.1453 11.56C28.6613 11.9193 28.06 12.099 27.3413 12.099C26.7693 12.099 26.256 11.9707 25.8013 11.714C25.354 11.4573 25.002 11.0943 24.7453 10.625C24.4887 10.1483 24.3603 9.59833 24.3603 8.975C24.3603 8.35167 24.485 7.80533 24.7343 7.336C24.9837 6.86667 25.332 6.50733 25.7793 6.258C26.234 6.00133 26.7547 5.873 27.3413 5.873C27.9133 5.873 28.4193 5.99767 28.8593 6.247C29.2993 6.49633 29.6367 6.841 29.8713 7.281C30.1133 7.71367 30.2343 8.205 30.2343 8.755ZM29.2003 8.546C29.2003 8.16467 29.116 7.83833 28.9473 7.567C28.7787 7.28833 28.5477 7.07933 28.2543 6.94C27.9683 6.79333 27.6493 6.72 27.2973 6.72C26.7913 6.72 26.3587 6.88133 25.9993 7.204C25.6473 7.52667 25.4457 7.974 25.3943 8.546H29.2003ZM33.7996 12.099C33.3376 12.099 32.9233 12.022 32.5566 11.868C32.19 11.7067 31.9003 11.4867 31.6876 11.208C31.475 10.922 31.3576 10.5957 31.3356 10.229H32.3696C32.399 10.5297 32.5383 10.7753 32.7876 10.966C33.0443 11.1567 33.378 11.252 33.7886 11.252C34.17 11.252 34.4706 11.1677 34.6906 10.999C34.9106 10.8303 35.0206 10.6177 35.0206 10.361C35.0206 10.097 34.9033 9.90267 34.6686 9.778C34.434 9.646 34.071 9.51767 33.5796 9.393C33.1323 9.27567 32.7656 9.15833 32.4796 9.041C32.201 8.91633 31.959 8.73667 31.7536 8.502C31.5556 8.26 31.4566 7.94467 31.4566 7.556C31.4566 7.248 31.5483 6.96567 31.7316 6.709C31.915 6.45233 32.1753 6.25067 32.5126 6.104C32.85 5.95 33.235 5.873 33.6676 5.873C34.335 5.873 34.874 6.04167 35.2846 6.379C35.6953 6.71633 35.9153 7.17833 35.9446 7.765H34.9436C34.9216 7.44967 34.7933 7.19667 34.5586 7.006C34.3313 6.81533 34.0233 6.72 33.6346 6.72C33.2753 6.72 32.9893 6.797 32.7766 6.951C32.564 7.105 32.4576 7.30667 32.4576 7.556C32.4576 7.754 32.52 7.919 32.6446 8.051C32.7766 8.17567 32.938 8.27833 33.1286 8.359C33.3266 8.43233 33.598 8.51667 33.9426 8.612C34.3753 8.72933 34.7273 8.84667 34.9986 8.964C35.27 9.074 35.501 9.24267 35.6916 9.47C35.8896 9.69733 35.9923 9.99433 35.9996 10.361C35.9996 10.691 35.908 10.988 35.7246 11.252C35.5413 11.516 35.281 11.725 34.9436 11.879C34.6136 12.0257 34.2323 12.099 33.7996 12.099ZM40.8887 12L38.5237 9.338V12H37.5227V3.86H38.5237V8.645L40.8447 5.972H42.2417L39.4037 8.975L42.2527 12H40.8887ZM44.5148 6.797V10.35C44.5148 10.6433 44.5772 10.8523 44.7018 10.977C44.8265 11.0943 45.0428 11.153 45.3508 11.153H46.0878V12H45.1858C44.6285 12 44.2105 11.8717 43.9318 11.615C43.6532 11.3583 43.5138 10.9367 43.5138 10.35V6.797H42.7328V5.972H43.5138V4.454H44.5148V5.972H46.0878V6.797H44.5148ZM50.0397 12.099C49.475 12.099 48.9617 11.9707 48.4997 11.714C48.045 11.4573 47.6857 11.0943 47.4217 10.625C47.165 10.1483 47.0367 9.59833 47.0367 8.975C47.0367 8.359 47.1687 7.81633 47.4327 7.347C47.704 6.87033 48.0707 6.50733 48.5327 6.258C48.9947 6.00133 49.5117 5.873 50.0837 5.873C50.6557 5.873 51.1727 6.00133 51.6347 6.258C52.0967 6.50733 52.4597 6.86667 52.7237 7.336C52.995 7.80533 53.1307 8.35167 53.1307 8.975C53.1307 9.59833 52.9913 10.1483 52.7127 10.625C52.4413 11.0943 52.071 11.4573 51.6017 11.714C51.1323 11.9707 50.6117 12.099 50.0397 12.099ZM50.0397 11.219C50.399 11.219 50.7363 11.1347 51.0517 10.966C51.367 10.7973 51.62 10.5443 51.8107 10.207C52.0087 9.86967 52.1077 9.459 52.1077 8.975C52.1077 8.491 52.0123 8.08033 51.8217 7.743C51.631 7.40567 51.3817 7.15633 51.0737 6.995C50.7657 6.82633 50.432 6.742 50.0727 6.742C49.706 6.742 49.3687 6.82633 49.0607 6.995C48.76 7.15633 48.518 7.40567 48.3347 7.743C48.1513 8.08033 48.0597 8.491 48.0597 8.975C48.0597 9.46633 48.1477 9.88067 48.3237 10.218C48.507 10.5553 48.749 10.8083 49.0497 10.977C49.3503 11.1383 49.6803 11.219 50.0397 11.219ZM55.5578 7.083C55.7558 6.73833 56.0491 6.45233 56.4378 6.225C56.8338 5.99033 57.2921 5.873 57.8128 5.873C58.3481 5.873 58.8321 6.00133 59.2648 6.258C59.7048 6.51467 60.0495 6.87767 60.2988 7.347C60.5481 7.809 60.6728 8.348 60.6728 8.964C60.6728 9.57267 60.5481 10.1153 60.2988 10.592C60.0495 11.0687 59.7048 11.439 59.2648 11.703C58.8321 11.967 58.3481 12.099 57.8128 12.099C57.2995 12.099 56.8448 11.9853 56.4488 11.758C56.0601 11.5233 55.7631 11.2337 55.5578 10.889V14.86H54.5568V5.972H55.5578V7.083ZM59.6498 8.964C59.6498 8.50933 59.5581 8.11333 59.3748 7.776C59.1915 7.43867 58.9421 7.182 58.6268 7.006C58.3188 6.83 57.9778 6.742 57.6038 6.742C57.2371 6.742 56.8961 6.83367 56.5808 7.017C56.2728 7.193 56.0235 7.45333 55.8328 7.798C55.6495 8.13533 55.5578 8.52767 55.5578 8.975C55.5578 9.42967 55.6495 9.82933 55.8328 10.174C56.0235 10.5113 56.2728 10.7717 56.5808 10.955C56.8961 11.131 57.2371 11.219 57.6038 11.219C57.9778 11.219 58.3188 11.131 58.6268 10.955C58.9421 10.7717 59.1915 10.5113 59.3748 10.174C59.5581 9.82933 59.6498 9.426 59.6498 8.964Z","fill","currentColor"],["width","59","height","17","viewBox","0 0 59 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M4.5 11.5H5.5V12.5H6.5V11.5H7.5V12.5H8C8.27614 12.5 8.5 12.7239 8.5 13C8.5 13.2761 8.27614 13.5 8 13.5H4C3.72386 13.5 3.5 13.2761 3.5 13C3.5 12.7239 3.72386 12.5 4 12.5H4.5V11.5Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M2 5.5L2 9.5C2 10.0523 2.44772 10.5 3 10.5L9 10.5C9.55229 10.5 10 10.0523 10 9.5L10 5.5C10 4.94772 9.55228 4.5 9 4.5L3 4.5C2.44771 4.5 2 4.94772 2 5.5ZM1 9.5C1 10.6046 1.89543 11.5 3 11.5L9 11.5C10.1046 11.5 11 10.6046 11 9.5L11 5.5C11 4.39543 10.1046 3.5 9 3.5L3 3.5C1.89543 3.5 1 4.39543 1 5.5L1 9.5Z","fill","currentColor"],["d","M24.624 4.388V12H23.623V6.324L21.093 12H20.389L17.848 6.313V12H16.847V4.388H17.925L20.741 10.68L23.557 4.388H24.624ZM29.0606 12.099C28.4959 12.099 27.9826 11.9707 27.5206 11.714C27.0659 11.4573 26.7066 11.0943 26.4426 10.625C26.1859 10.1483 26.0576 9.59833 26.0576 8.975C26.0576 8.359 26.1896 7.81633 26.4536 7.347C26.7249 6.87033 27.0916 6.50733 27.5536 6.258C28.0156 6.00133 28.5326 5.873 29.1046 5.873C29.6766 5.873 30.1936 6.00133 30.6556 6.258C31.1176 6.50733 31.4806 6.86667 31.7446 7.336C32.0159 7.80533 32.1516 8.35167 32.1516 8.975C32.1516 9.59833 32.0123 10.1483 31.7336 10.625C31.4623 11.0943 31.0919 11.4573 30.6226 11.714C30.1533 11.9707 29.6326 12.099 29.0606 12.099ZM29.0606 11.219C29.4199 11.219 29.7573 11.1347 30.0726 10.966C30.3879 10.7973 30.6409 10.5443 30.8316 10.207C31.0296 9.86967 31.1286 9.459 31.1286 8.975C31.1286 8.491 31.0333 8.08033 30.8426 7.743C30.6519 7.40567 30.4026 7.15633 30.0946 6.995C29.7866 6.82633 29.4529 6.742 29.0936 6.742C28.7269 6.742 28.3896 6.82633 28.0816 6.995C27.7809 7.15633 27.5389 7.40567 27.3556 7.743C27.1723 8.08033 27.0806 8.491 27.0806 8.975C27.0806 9.46633 27.1686 9.88067 27.3446 10.218C27.5279 10.5553 27.7699 10.8083 28.0706 10.977C28.3713 11.1383 28.7013 11.219 29.0606 11.219ZM36.5147 5.862C37.2481 5.862 37.8421 6.08567 38.2967 6.533C38.7514 6.973 38.9787 7.611 38.9787 8.447V12H37.9887V8.59C37.9887 7.98867 37.8384 7.53033 37.5377 7.215C37.2371 6.89233 36.8264 6.731 36.3057 6.731C35.7777 6.731 35.3561 6.896 35.0407 7.226C34.7327 7.556 34.5787 8.03633 34.5787 8.667V12H33.5777V5.972H34.5787V6.83C34.7767 6.522 35.0444 6.28367 35.3817 6.115C35.7264 5.94633 36.1041 5.862 36.5147 5.862ZM41.2409 4.993C41.0502 4.993 40.8889 4.927 40.7569 4.795C40.6249 4.663 40.5589 4.50167 40.5589 4.311C40.5589 4.12033 40.6249 3.959 40.7569 3.827C40.8889 3.695 41.0502 3.629 41.2409 3.629C41.4242 3.629 41.5782 3.695 41.7029 3.827C41.8349 3.959 41.9009 4.12033 41.9009 4.311C41.9009 4.50167 41.8349 4.663 41.7029 4.795C41.5782 4.927 41.4242 4.993 41.2409 4.993ZM41.7249 5.972V12H40.7239V5.972H41.7249ZM44.7619 6.797V10.35C44.7619 10.6433 44.8242 10.8523 44.9489 10.977C45.0736 11.0943 45.2899 11.153 45.5979 11.153H46.3349V12H45.4329C44.8756 12 44.4576 11.8717 44.1789 11.615C43.9002 11.3583 43.7609 10.9367 43.7609 10.35V6.797H42.9799V5.972H43.7609V4.454H44.7619V5.972H46.3349V6.797H44.7619ZM50.2867 12.099C49.7221 12.099 49.2087 11.9707 48.7467 11.714C48.2921 11.4573 47.9327 11.0943 47.6687 10.625C47.4121 10.1483 47.2837 9.59833 47.2837 8.975C47.2837 8.359 47.4157 7.81633 47.6797 7.347C47.9511 6.87033 48.3177 6.50733 48.7797 6.258C49.2417 6.00133 49.7587 5.873 50.3307 5.873C50.9027 5.873 51.4197 6.00133 51.8817 6.258C52.3437 6.50733 52.7067 6.86667 52.9707 7.336C53.2421 7.80533 53.3777 8.35167 53.3777 8.975C53.3777 9.59833 53.2384 10.1483 52.9597 10.625C52.6884 11.0943 52.3181 11.4573 51.8487 11.714C51.3794 11.9707 50.8587 12.099 50.2867 12.099ZM50.2867 11.219C50.6461 11.219 50.9834 11.1347 51.2987 10.966C51.6141 10.7973 51.8671 10.5443 52.0577 10.207C52.2557 9.86967 52.3547 9.459 52.3547 8.975C52.3547 8.491 52.2594 8.08033 52.0687 7.743C51.8781 7.40567 51.6287 7.15633 51.3207 6.995C51.0127 6.82633 50.6791 6.742 50.3197 6.742C49.9531 6.742 49.6157 6.82633 49.3077 6.995C49.0071 7.15633 48.7651 7.40567 48.5817 7.743C48.3984 8.08033 48.3067 8.491 48.3067 8.975C48.3067 9.46633 48.3947 9.88067 48.5707 10.218C48.7541 10.5553 48.9961 10.8083 49.2967 10.977C49.5974 11.1383 49.9274 11.219 50.2867 11.219ZM55.8049 6.951C55.9809 6.60633 56.2302 6.33867 56.5529 6.148C56.8829 5.95733 57.2825 5.862 57.7519 5.862V6.896H57.4879C56.3659 6.896 55.8049 7.50467 55.8049 8.722V12H54.8039V5.972H55.8049V6.951Z","fill","currentColor"]],template:function(t,a){if(t&1&&(b(0,"div",0),y(1,e4,5,1,"div",1)(2,t4,6,1,"div",1)(3,r4,5,1,"div",1)(4,n4,5,1,"div",1),x()),t&2){let i;k("data-testid",a.componentId)("aria-label","Viewing on"+a.deviceType),d(),w((i=a.deviceType)==="Mobile"?1:i==="Tablet"?2:i==="Desktop"?3:i==="Monitor"?4:-1)}},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-device-type-icons--flex[_ngcontent-%COMP%]{display:flex;cursor:pointer;color:var(--velt-text-4)}"],changeDetection:0});let r=o;return r})();function o4(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var Uf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),l4=(r,o)=>({condition:r,data:o}),d4=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-device-type-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function v4(r,o){if(r&1&&E(0,"app-device-type-icons",6),r&2){let n=l(5);v("deviceType",n.deviceType()),k("data-testid",n.componentId+"-icons")}}function c4(r,o){if(r&1&&(b(0,"div",7)(1,"div"),le(2),A(3,"translate"),x(),b(4,"div"),le(5),A(6,"translate"),x()()),r&2){let n=l(4),e=l();ue("dark",n==null||n.uiState==null?null:n.uiState.darkMode),k("data-testid",e.componentId+"-info"),d(2),hh(" ",R(3,7,n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.osName)," \u2022 ",n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.screenWidth,"x",n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.screenHeight," "),d(3),Ce(" Using ",R(6,9,n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.browserName)," ")}}function m4(r,o){if(r&1&&(u(0),b(1,"div",4)(2,"app-overlay-tooltip",5),s(3,v4,1,2,"ng-template",null,0,Ge)(5,c4,7,11,"ng-template",null,1,Ge),x()(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId),d(),v("positions",n.deviceInfoTooltipPositions),k("data-testid",n.componentId+"-tooltip")}}function s4(r,o){if(r&1&&s(0,m4,7,3,"ng-container",3),r&2){let n=l(2),e=l();v("veltDynamicTemplate",O(7,d4,e.template,O(1,Uf,e.componentConfigSignal,e.localUIStateSignal,e.comment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function g4(r,o){if(r&1&&(u(0),y(1,s4,1,13,"ng-container"),p()),r&2){let n=l(2);d(),w(n.shouldShow()?1:-1)}}function u4(r,o){if(r&1&&s(0,g4,2,1,"ng-container",2),r&2){let n=l();v("veltIf",C(7,l4,n.conditionSignal(),O(1,Uf,n.componentConfigSignal,n.localUIStateSignal,n.comment(),n.commentIndex(),n.commentIndex())))}}var ra=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-device-type-internal",this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.comment=L(()=>{try{let e=this.commentObj();if(e)return e;let a=this.componentConfigSignal()?.data?.annotation?.comments,i=this.commentId();if(i!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===i);if(h)return h}let c=this.getContextCommentId();if(c!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===c);if(h)return h}let m=this.commentIndex();return m!==void 0&&a&&Array.isArray(a)?a[m]:null}catch(e){return this.loggingService.catch("Error in comment computed:",e),null}}),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal(),t=this.commentIndex(),a=e?.uiState?.showScreenSizeInfo||!1;return t===0&&a}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}}),this.deviceType=L(()=>{try{let e=this.componentConfigSignal(),t=e?.data?.annotation;return e?.uiState?.deviceType||t?.pageInfo?.deviceInfo?.deviceType||(t?.screenWidth?ab(t.screenWidth):"")}catch(e){return this.loggingService.catch("Error in deviceType:",e),""}}),this.deviceInfoTooltipPositions=[{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"}]}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.comment(),i:this.commentIndex()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardDeviceTypeComponent ngOnInit:",e)}}setupA11yAttributes(){try{p4(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-device-type-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[["triggerTemplate",""],["tooltipTemplate",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"modal-device__type"],[3,"positions"],[3,"deviceType"],["role","tooltip",1,"v-device-info-tooltip-container"]],template:function(t,a){if(t&1&&y(0,u4,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Ng,Qu,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)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function p4(r,o){try{r.setAttribute("role","status"),r.setAttribute("data-testid",o+"-container")}catch{}}var Lf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),b4=(r,o)=>({condition:r,data:o}),f4=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-draft-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function C4(r,o){if(r&1&&(u(0),b(1,"span",2),A(2,"translate"),le(3),A(4,"translate"),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId)("aria-label",R(2,3,"Draft comment status")),d(2),Ce(" ",R(4,5,"Draft")," ")}}function k4(r,o){if(r&1&&s(0,C4,5,7,"ng-container",1),r&2){let n=l(2),e=l();v("veltDynamicTemplate",O(7,f4,e.template,O(1,Lf,e.componentConfigSignal,e.localUIStateSignal,e.comment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function x4(r,o){if(r&1&&(u(0),y(1,k4,1,13,"ng-container"),p()),r&2){let n=l(2);d(),w(n.shouldShow()?1:-1)}}function _4(r,o){if(r&1&&s(0,x4,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,b4,n.conditionSignal(),O(1,Lf,n.componentConfigSignal,n.localUIStateSignal,n.comment(),n.commentIndex(),n.commentIndex())))}}var na=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-draft-internal",this.commentObj=q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.comment=L(()=>{try{let e=this.commentObj();if(e)return e;let t=this.commentId();if(t!==void 0){let m=this.componentConfigSignal()?.data?.annotation?.comments;if(m&&Array.isArray(m)){let h=m.find(_=>_?.commentId===t);if(h)return h}}let a=this.commentIndex();if(a!==void 0){let m=this.componentConfigSignal()?.data?.annotation?.comments;if(m&&Array.isArray(m))return m[a]}let i=this.getContextValue("comment-id");if(i){let m=this.componentConfigSignal()?.data?.annotation?.comments;if(m&&Array.isArray(m)){let h=m.find(_=>_?.commentId?.toString()===i);if(h)return h}}return null}catch(e){return this.loggingService.catch("Error in comment computed:",e),null}}),this.shouldShow=L(()=>{try{return this.defaultCondition()?this.comment()?.isDraft===!0:!0}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.comment(),i:this.commentIndex()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardDraftComponent ngOnInit:",e)}}setupA11yAttributes(){try{S4(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-draft-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","status","aria-live","polite",1,"velt-thread-card--draft"]],template:function(t,a){if(t&1&&y(0,_4,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]{display:block}[_nghost-%COMP%]:empty{display:none}.velt-thread-card--draft[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-xs) 6px;justify-content:center;align-items:center;gap:var(--velt-spacing-xs);border-radius:var(--velt-border-radius-xl);background:var(--velt-background-2);margin-left:var(--velt-spacing-xs);color:var(--velt-text-9);font-size:var(--velt-font-size-xs);font-style:normal;font-weight:600;line-height:100%;text-transform:uppercase}"],changeDetection:0});let r=o;return r})();function S4(r,o){try{r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("data-testid",o+"-container")}catch{}}var oa=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),w4=(r,o)=>({condition:r,data:o}),zv=(r,o)=>({componentName:"velt-comment-dialog-composer-action-button-wireframe",variant:r,suffix:o}),Wv=(r,o,n,e,t,a)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-action-button-wireframe",variant:n,suffix:e,setIfCondition:t,componentElementRef:a});function I4(r,o){if(r&1){let n=J();b(0,"velt-autocomplete-tool-internal",3),A(1,"translate"),H("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.newCommentTextArea==null?null:t.uiState.newCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,zv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.newCommentTextArea==null?null:n.uiState.newCommentTextArea.nativeElement),k("aria-label",R(1,7,"Mention someone using @ symbol"))("data-testid",e.componentId+"-autocomplete-new")}}function D4(r,o){if(r&1){let n=J();b(0,"velt-autocomplete-tool-internal",3),A(1,"translate"),H("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.editCommentTextArea==null?null:t.uiState.editCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,zv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.editCommentTextArea==null?null:n.uiState.editCommentTextArea.nativeElement),k("aria-label",R(1,7,"Mention someone using @ symbol while editing"))("data-testid",e.componentId+"-autocomplete-edit")}}function T4(r,o){if(r&1&&(y(0,I4,2,12,"velt-autocomplete-tool-internal",2),y(1,D4,2,12,"velt-autocomplete-tool-internal",2)),r&2){let n=l(4);w(n.getEditModeValue()?-1:0),d(),w(n.getEditModeValue()?1:-1)}}function O4(r,o){if(r&1&&y(0,T4,2,2),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.userMentions?0:-1)}}function E4(r,o){if(r&1){let n=J();b(0,"velt-autocomplete-tool-internal",3),A(1,"translate"),H("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.newCommentTextArea==null?null:t.uiState.newCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,zv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.newCommentTextArea==null?null:n.uiState.newCommentTextArea.nativeElement),k("aria-label",R(1,7,"Type @ to mention someone"))("data-testid",e.componentId+"-autocomplete-tool-new")}}function M4(r,o){if(r&1){let n=J();b(0,"velt-autocomplete-tool-internal",3),A(1,"translate"),H("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.editCommentTextArea==null?null:t.uiState.editCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,zv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.editCommentTextArea==null?null:n.uiState.editCommentTextArea.nativeElement),k("aria-label",R(1,7,"Type @ to mention someone while editing"))("data-testid",e.componentId+"-autocomplete-tool-edit")}}function A4(r,o){if(r&1&&(y(0,E4,2,12,"velt-autocomplete-tool-internal",2),y(1,M4,2,12,"velt-autocomplete-tool-internal",2)),r&2){let n=l(4);w(n.getEditModeValue()?-1:0),d(),w(n.getEditModeValue()?1:-1)}}function P4(r,o){if(r&1&&y(0,A4,2,2),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.userMentions?0:-1)}}function F4(r,o){if(r&1){let n=J();b(0,"app-attachment-button",5),A(1,"translate"),H("clicked",function(){B(n);let t=l(3);return V(t.uiState==null||t.uiState.onAttachmentButtonClick==null?null:t.uiState.onAttachmentButtonClick())})("selectFiles",function(t){B(n);let a=l(4);return V(a.handleFilesSelected(t))})("setIfConditionEvent",function(t){B(n);let a=l(4);return V(a.setIfCondition(t))}),x()}if(r&2){let n=l(3),e=l();v("template",e.template)("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("componentMeta",C(8,zv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("allowedFileTypes",n.featureState==null?null:n.featureState.allowedFileTypes),k("aria-label",R(1,6,"Add file attachment to comment"))("data-testid",e.componentId+"-attachment-button")}}function N4(r,o){if(r&1&&y(0,F4,2,11,"app-attachment-button",4),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.enableAttachment?0:-1)}}function R4(r,o){if(r&1){let n=J();b(0,"app-attachment-button",5),A(1,"translate"),H("clicked",function(){B(n);let t=l(3);return V(t.uiState==null||t.uiState.onAttachmentButtonClick==null?null:t.uiState.onAttachmentButtonClick())})("selectFiles",function(t){B(n);let a=l(4);return V(a.handleFilesSelected(t))})("setIfConditionEvent",function(t){B(n);let a=l(4);return V(a.setIfCondition(t))}),x()}if(r&2){let n=l(3),e=l();v("template",e.template)("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("componentMeta",C(8,zv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("allowedFileTypes",n.featureState==null?null:n.featureState.allowedFileTypes),k("aria-label",R(1,6,"Add file attachment to comment"))("data-testid",e.componentId+"-attachment-button")}}function U4(r,o){if(r&1&&y(0,R4,2,11,"app-attachment-button",4),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.enableAttachment?0:-1)}}function L4(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),A(2,"translate"),A(3,"translate"),de(),b(4,"svg",10),E(5,"path",11)(6,"path",12),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Record voice"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Record voice message"))("data-testid",e.componentId+"-audio-record")}}function B4(r,o){if(r&1){let n=J();b(0,"app-device-permission-button",6),A(1,"translate"),b(2,"div",7),A(3,"translate"),H("click",function(){B(n);let t=l(3),a=l();return V(t.uiState!=null&&t.uiState.recorderInitConfig?null:a.handleRecordingStart("audio"))}),s(4,L4,7,8,"ng-container",8),x()()}if(r&2){let n=l(3),e=l();v("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(1,6,"Record voice message"))("data-testid",e.componentId+"-audio-button"),d(2),k("aria-label",R(3,8,"Click to start voice recording"))("data-testid",e.componentId+"-audio-record"),d(2),v("veltDynamicTemplate",St(13,Wv,e.template,C(10,oa,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function V4(r,o){if(r&1&&y(0,B4,5,20,"app-device-permission-button",6),r&2){let n=l(2);w(!(n.featureState==null||n.featureState.allowedRecordings==null)&&n.featureState.allowedRecordings.includes("audio")?0:-1)}}function $4(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),A(2,"translate"),A(3,"translate"),de(),b(4,"svg",14),E(5,"path",15),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Record video"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Record video message"))("data-testid",e.componentId+"-video-record")}}function G4(r,o){if(r&1){let n=J();b(0,"app-device-permission-button",13),A(1,"translate"),b(2,"div",7),A(3,"translate"),H("click",function(){B(n);let t=l(3),a=l();return V(t.uiState!=null&&t.uiState.recorderInitConfig?null:a.handleRecordingStart("video"))}),s(4,$4,6,8,"ng-container",8),x()()}if(r&2){let n=l(3),e=l();v("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(1,6,"Record video message"))("data-testid",e.componentId+"-video-button"),d(2),k("aria-label",R(3,8,"Click to start video recording"))("data-testid",e.componentId+"-video-record"),d(2),v("veltDynamicTemplate",St(13,Wv,e.template,C(10,oa,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function j4(r,o){if(r&1&&y(0,G4,5,20,"app-device-permission-button",13),r&2){let n=l(2);w(!(n.featureState==null||n.featureState.allowedRecordings==null)&&n.featureState.allowedRecordings.includes("video")?0:-1)}}function H4(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),A(2,"translate"),A(3,"translate"),de(),b(4,"svg",17),E(5,"path",18)(6,"path",19)(7,"path",20)(8,"path",21),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Record screen"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Record your screen"))("data-testid",e.componentId+"-screen-record")}}function z4(r,o){if(r&1){let n=J();b(0,"div",7),A(1,"translate"),H("click",function(){B(n);let t=l(3),a=l();return V(t.uiState!=null&&t.uiState.recorderInitConfig?null:a.handleRecordingStart("screen"))}),s(2,H4,9,8,"ng-container",8),x()}if(r&2){let n=l(3),e=l();k("aria-label",R(1,3,"Click to start screen recording"))("data-testid",e.componentId+"-screen-record"),d(2),v("veltDynamicTemplate",St(8,Wv,e.template,C(5,oa,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function W4(r,o){if(r&1&&y(0,z4,3,15,"div",16),r&2){let n=l(2);w(!(n.featureState==null||n.featureState.allowedRecordings==null)&&n.featureState.allowedRecordings.includes("screen")&&(n.featureState!=null&&n.featureState.screenSharingSupported)?0:-1)}}function J4(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),A(2,"translate"),A(3,"translate"),de(),b(4,"svg",24),E(5,"path",25),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Format text"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Format text options"))("data-testid",e.componentId+"-format")}}function Y4(r,o){if(r&1){let n=J();b(0,"div",23),A(1,"translate"),H("click",function(){B(n);let t=l(4);return V(t.handleFormatToggle())})("mousedown",function(t){return B(n),V(t.preventDefault())}),s(2,J4,6,8,"ng-container",8),x()}if(r&2){let n=l(3),e=l();ue("velt-composer-action-button--selected",n.uiState==null?null:n.uiState.formatToolbarOpen),k("aria-label",R(1,5,"Toggle format options"))("data-testid",e.componentId+"-format"),d(2),v("veltDynamicTemplate",St(10,Wv,e.template,C(7,oa,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function K4(r,o){if(r&1&&y(0,Y4,3,17,"div",22),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.enableFormatOptions?0:-1)}}function Z4(r,o){r&1&&(b(0,"div",29),de(),b(1,"svg",30),E(2,"path",31),x()())}function X4(r,o){if(r&1){let n=J();b(0,"button",27),A(1,"translate"),H("click",function(t){return B(n),l(4).handleSubmit(),V(t.stopPropagation())}),s(2,Z4,3,0,"div",28),x()}if(r&2){let n=l(3),e=l();v("disabled",!e.hasComposerText()&&!e.hasSelectedAttachments()&&!e.hasLocalRecordedData()||(n.uiState==null?null:n.uiState.uploadingAttachments)),k("aria-label",R(1,4,"Save new comment"))("data-testid",e.componentId+"-submit-new"),d(2),v("veltDynamicTemplate",St(9,Wv,e.template,C(6,oa,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function q4(r,o){r&1&&(b(0,"div",29),de(),b(1,"svg",30),E(2,"path",32),x()())}function Q4(r,o){if(r&1){let n=J();b(0,"button",27),A(1,"translate"),H("click",function(t){return B(n),l(4).handleSubmit(),V(t.stopPropagation())}),s(2,q4,3,0,"div",28),x()}if(r&2){let n=l(3),e=l();v("disabled",!e.hasComposerText()&&!e.hasSelectedAttachments()&&!e.hasAttachmentsToDelete()&&!e.hasLocalRecordedData()||(n.uiState==null?null:n.uiState.uploadingAttachments)),k("aria-label",R(1,4,"Save edited comment"))("data-testid",e.componentId+"-submit-edit"),d(2),v("veltDynamicTemplate",St(9,Wv,e.template,C(6,oa,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function eT(r,o){if(r&1&&(y(0,X4,3,16,"button",26),y(1,Q4,3,16,"button",26)),r&2){let n=l(3);w(n.getEditModeValue()?-1:0),d(),w(n.getEditModeValue()?1:-1)}}function tT(r,o){if(r&1){let n=J();u(0),b(1,"div",1),A(2,"translate"),H("click",function(t){return B(n),V(t.stopPropagation())}),y(3,O4,1,1)(4,P4,1,1)(5,N4,1,1)(6,U4,1,1)(7,V4,1,1)(8,j4,1,1)(9,W4,1,1)(10,K4,1,1)(11,eT,2,2),x(),p()}if(r&2){let n,e=l(2);d(),k("aria-label",R(2,3,"Comment tools and actions"))("data-testid",e.componentId),d(2),w((n=e.getTypeValue())==="userMentions"?3:n==="autocomplete"?4:n==="file"?5:n==="attachments"?6:n==="audio"?7:n==="video"?8:n==="screen"?9:n==="format"?10:n==="submit"?11:-1)}}function rT(r,o){if(r&1&&s(0,tT,12,5,"ng-container",0),r&2){let n=l();v("veltIf",C(4,w4,n.conditionSignal(),C(1,oa,n.componentConfigSignal,n.localUIStateSignal)))}}var aa=(()=>{let o=class o extends te{ngOnInit(){if(super.ngOnInit(),this.isLocalUIStateOwner){let e=this.localUIStateSignal()?.dialogInstanceId;e&&(this.coreService.registerLocalUIState(e,this.localUIStateSignal),this.coreService.markStandaloneComposerOwner(e))}}ngOnDestroy(){if(this.isLocalUIStateOwner){let e=this.localUIStateSignal()?.dialogInstanceId;e&&(this.coreService.unregisterLocalUIState(e),this.coreService.unmarkStandaloneComposerOwner(e))}super.ngOnDestroy()}constructor(){super(),this.componentId="velt-comment-dialog-composer-action-button-internal",this.hasComposerText=L(()=>{let e=this.localUIStateSignal()?.composerContent;if(e&&e.trim().length>0)return!0;if(this.isLocalUIStateOwner){let t=this.getAnnotationId();if(t){let a=this.coreService.getOrCreateComposerDraft(t)();return!!(a?.composerContent&&a.composerContent.trim().length>0)}}return!1}),this.hasSelectedAttachments=L(()=>{if(Bf(this.localUIStateSignal()))return!0;if(this.isLocalUIStateOwner){let e=this.getAnnotationId();if(e)return Bf(this.coreService.getOrCreateComposerDraft(e)())}return!1}),this.hasLocalRecordedData=L(()=>{if(this.localUIStateSignal()?.localRecordedData?.length)return!0;if(this.isLocalUIStateOwner){let e=this.getAnnotationId();if(e)return!!this.coreService.getOrCreateComposerDraft(e)()?.localRecordedData?.length}return!1}),this.hasAttachmentsToDelete=L(()=>!!this.localUIStateSignal()?.attachmentsToDelete?.length),this.type=q.required({transform:e=>{try{return e||""}catch{return""}}}),this.editMode=q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true"||e==="1":e}catch{return!1}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.hotkey=q("@",{transform:e=>{try{return e||"@"}catch{return"@"}}})}getTypeValue(){try{return typeof this.type=="function"?this.type():this.type||""}catch(e){return this.loggingService.catch("Error in CommentDialogComposerActionButtonComponent getTypeValue:",e),""}}getEditModeValue(){try{return typeof this.editMode=="function"?this.editMode():this.editMode||!1}catch(e){return this.loggingService.catch("Error in CommentDialogComposerActionButtonComponent getEditModeValue:",e),!1}}getHotkeyValue(){try{return typeof this.hotkey=="function"?this.hotkey():this.hotkey||"@"}catch(e){return this.loggingService.catch("Error in CommentDialogComposerActionButtonComponent getHotkeyValue:",e),"@"}}setupA11yAttributes(){try{oT(this.hostElementRef.nativeElement,this.componentId,this.getTypeValue())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}handleFilesSelected(e){try{let t=this.getAnnotationId();if(!t){this.loggingService.catch("No annotation ID for file selection",new Error("Missing annotationId"));return}let a=[];if(e?.target?.files?.length){for(let i=0;i<e.target.files.length;i++){let c=e.target.files[i];c&&a.push(c)}e.target.value=""}a.length>0&&this.actionService.addFiles(t,a,this.localUIStateSignal()?.dialogInstanceId)}catch(t){this.loggingService.catch("Error in handleFilesSelected:",t)}}handleFormatToggle(){try{let e=this.getAnnotationId();if(e)this.actionService.toggleFormatToolbar(e);else{let t=this.componentConfigSignal;t&&typeof t.update=="function"&&t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{formatToolbarOpen:!a.uiState?.formatToolbarOpen})}))}}catch(e){this.loggingService.catch("Error in handleFormatToggle:",e)}}handleRecordingStart(e){try{let t=this.getAnnotationId();if(!t){this.loggingService.catch("No annotation ID for recording start",new Error("Missing annotationId"));return}let a=this.isLocalUIStateOwner?this.coreService.getStandaloneRecorderPanelId(t):this.localUIStateSignal()?.dialogInstanceId;this.actionService.startRecording(t,e,a)}catch(t){this.loggingService.catch("Error in handleRecordingStart:",t)}}handleSubmit(){return Pe(this,null,function*(){try{let e=this.getAnnotationId();if(e)if(this.editMode()){let t=this.commentIndex();if(t===void 0){this.loggingService.catch("Edit mode requires commentIndex",new Error("Missing commentIndex"));return}this.actionService.updateComment(e,t,this.localUIStateSignal()?.dialogInstanceId)}else{if(this.isLocalUIStateOwner){let t=this.coreService.getOrCreateComposerDraft(e)();this.localUIStateSignal.update(a=>g(g({},a),nT(a,t)))}yield this.actionService.addComment(e,!1,this.localUIStateSignal()?.dialogInstanceId),this.isLocalUIStateOwner&&this.coreService.clearComposerDraft(e)}else{let t=this.componentConfigSignal();if(!t)return;let a=this.localUIStateSignal(),i=a?.composerContent||"",m=t.uiState?.newCommentTextArea?.nativeElement?.innerHTML||a?.composerContentHTML||"";if(!i.trim())return;let h={commentText:i.trim(),commentHtml:m,from:t.appState?.user,taggedUserContacts:t.data?.taggedUserContacts||[],attachments:a?.selectedAttachments||[],recorders:a?.localRecordedData||[],createdAt:new Date,lastUpdated:new Date},_={annotation:t.data?.annotation,updatedComment:h,type:"NEWLY_ADDED"},I=this.componentConfigSignal;I&&typeof I.update=="function"&&I.update(S=>f(g({},S),{uiState:f(g({},S.uiState),{pendingSaveComment:_,formatToolbarOpen:!1})})),this.localUIStateSignal.update(S=>f(g({},S),{composerContent:"",composerContentHTML:"",composerInOpenState:!1}))}}catch(e){this.loggingService.catch("Error in handleSubmit:",e)}})}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-action-button-internal"]],inputs:{type:[1,"type"],editMode:[1,"editMode"],commentIndex:[1,"commentIndex"],hotkey:[1,"hotkey"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","group",1,"velt-comment-dialog-composer-action-button",3,"click"],[3,"hotkey","template","componentMeta","darkMode","triggerElement"],[3,"buttonClick","hotkey","template","componentMeta","darkMode","triggerElement"],[3,"template","darkMode","componentMeta","allowedFileTypes"],[3,"clicked","selectFiles","setIfConditionEvent","template","darkMode","componentMeta","allowedFileTypes"],["type","audio","mode","thread",3,"darkMode"],["role","button","tabindex","0",3,"click"],[4,"veltDynamicTemplate"],[3,"title","darkMode"],["icon","","width","14","height","20","viewBox","0 0 14 20","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["fill-rule","evenodd","clip-rule","evenodd","d","M0.833333 7.5C1.29357 7.5 1.66667 7.8731 1.66667 8.33333V9.16667C1.66667 11.9281 3.90524 14.1667 6.66667 14.1667C9.42809 14.1667 11.6667 11.9281 11.6667 9.16667V8.33333C11.6667 7.8731 12.0398 7.5 12.5 7.5C12.9602 7.5 13.3333 7.8731 13.3333 8.33333V9.16667C13.3333 12.5663 10.7886 15.3717 7.5 15.7818V18.3333H10C10.4602 18.3333 10.8333 18.7064 10.8333 19.1667C10.8333 19.6269 10.4602 20 10 20H3.33333C2.8731 20 2.5 19.6269 2.5 19.1667C2.5 18.7064 2.8731 18.3333 3.33333 18.3333H5.83333V15.7818C2.54474 15.3717 0 12.5663 0 9.16667V8.33333C0 7.8731 0.373096 7.5 0.833333 7.5Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M8.33203 9.16667V3.33333C8.33203 2.41286 7.58584 1.66667 6.66536 1.66667C5.74489 1.66667 4.9987 2.41286 4.9987 3.33333V9.16667C4.9987 10.0871 5.74489 10.8333 6.66536 10.8333C7.58584 10.8333 8.33203 10.0871 8.33203 9.16667ZM6.66536 0C4.82442 0 3.33203 1.49238 3.33203 3.33333V9.16667C3.33203 11.0076 4.82442 12.5 6.66536 12.5C8.50631 12.5 9.9987 11.0076 9.9987 9.16667V3.33333C9.9987 1.49238 8.50631 0 6.66536 0Z","fill","currentColor"],["type","video","mode","thread",3,"darkMode"],["icon","","width","19","height","11","viewBox","0 0 19 11","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.55139 0.230077C1.68754 0.453772 1.06855 1.02195 0.766641 1.86822L0.666016 2.15026V5.58765V9.02505L0.766892 9.30709C1.0535 10.1083 1.64038 10.6731 2.43987 10.9173L2.70863 10.9993H7.1343H11.56L11.8467 10.9033C12.6234 10.6431 13.2099 10.0635 13.47 9.29927C13.56 9.03464 13.5637 8.99015 13.5769 8.02909C13.5844 7.48129 13.6004 7.03312 13.6125 7.03312C13.661 7.03312 15.0857 7.85517 15.8518 8.3252C16.7188 8.85713 16.9126 8.93691 17.338 8.93691C18.0692 8.93691 18.7509 8.40671 18.947 7.68535C19.0174 7.42654 19.0165 3.74584 18.946 3.48531C18.7883 2.90254 18.278 2.40649 17.7016 2.27577C17.4483 2.2183 17.0895 2.23195 16.8373 2.30859C16.6848 2.35492 16.3699 2.52421 15.9107 2.80671C15.3288 3.1648 13.6405 4.14219 13.6039 4.14219C13.5979 4.14219 13.5847 3.70988 13.5747 3.18148C13.5543 2.10348 13.5363 1.99704 13.2916 1.506C13.0166 0.954081 12.475 0.492835 11.8467 0.275239L11.56 0.17596L7.18806 0.168733C2.95948 0.161752 2.80747 0.163762 2.55139 0.230077ZM11.3211 1.83448C11.5404 1.89857 11.7306 2.05186 11.8398 2.25268L11.9183 2.39705V5.57098V8.74488L11.8268 8.91988C11.7122 9.13896 11.4929 9.30656 11.2552 9.35673C11.0123 9.40799 3.20786 9.40919 2.98224 9.35804C2.74243 9.30364 2.53297 9.14287 2.42553 8.93071L2.33236 8.74678V5.58765V2.42853L2.42553 2.2446C2.52985 2.03864 2.7435 1.8703 2.96604 1.81882C3.04208 1.80123 4.88581 1.78558 7.11882 1.7836C10.641 1.7805 11.1578 1.78678 11.3211 1.83448ZM17.3116 5.59171V7.28802L17.2309 7.23605C16.8358 6.98144 15.6936 6.30232 15.1359 5.99038C14.7573 5.77856 14.4468 5.59675 14.4461 5.58635C14.4453 5.57591 14.7874 5.37341 15.2062 5.13632C15.6251 4.89919 16.258 4.52439 16.6128 4.30341C16.9675 4.08243 17.2699 3.90019 17.2847 3.8985C17.2995 3.89681 17.3116 4.65875 17.3116 5.59171Z","fill","currentColor"],["role","button","tabindex","0"],["icon","","width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M7.4987 15H9.16536V16.6667H10.832V15H12.4987V16.6667H13.332C13.7923 16.6667 14.1654 17.0398 14.1654 17.5C14.1654 17.9602 13.7923 18.3333 13.332 18.3333H6.66536C6.20513 18.3333 5.83203 17.9602 5.83203 17.5C5.83203 17.0398 6.20513 16.6667 6.66536 16.6667H7.4987V15Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.33464 5L3.33464 11.6667C3.33464 12.5871 4.08083 13.3333 5.0013 13.3333L15.0013 13.3333C15.9218 13.3333 16.668 12.5871 16.668 11.6667L16.668 5C16.668 4.07953 15.9218 3.33333 15.0013 3.33333L5.0013 3.33333C4.08083 3.33333 3.33464 4.07953 3.33464 5ZM1.66797 11.6667C1.66797 13.5076 3.16035 15 5.0013 15L15.0013 15C16.8423 15 18.3346 13.5076 18.3346 11.6667L18.3346 5C18.3346 3.15905 16.8423 1.66667 15.0013 1.66667L5.0013 1.66667C3.16035 1.66667 1.66797 3.15905 1.66797 5L1.66797 11.6667Z","fill","currentColor"],["d","M5.83333 5C5.3731 5 5 5.3731 5 5.83333C5 6.29357 5.3731 6.66667 5.83333 6.66667H11.6667C12.1269 6.66667 12.5 6.29357 12.5 5.83333C12.5 5.3731 12.1269 5 11.6667 5H5.83333Z","fill","currentColor"],["d","M5.83333 8.33333C5.3731 8.33333 5 8.70643 5 9.16667C5 9.6269 5.3731 10 5.83333 10H7.5C7.96024 10 8.33333 9.6269 8.33333 9.16667C8.33333 8.70643 7.96024 8.33333 7.5 8.33333H5.83333Z","fill","currentColor"],["role","button","tabindex","0",3,"velt-composer-action-button--selected"],["role","button","tabindex","0",3,"click","mousedown"],["icon","","width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M9 15V8C9 7.20435 9.31607 6.44129 9.87868 5.87868C10.4413 5.31607 11.2044 5 12 5C12.7956 5 13.5587 5.31607 14.1213 5.87868C14.6839 6.44129 15 7.20435 15 8V15M9 11H15M5 19H19","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],[1,"velt-composer--submit-button",3,"disabled"],[1,"velt-composer--submit-button",3,"click","disabled"],["class","velt-composer--input-button",4,"veltDynamicTemplate"],[1,"velt-composer--input-button"],["width","14","height","14","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M20.8089 10.1394L4.6724 3.15546C3.9926 2.8612 3.22459 2.99065 2.66814 3.49311C2.1117 3.99565 1.87896 4.76995 2.06084 5.51382L3.49713 11.3888H10.5294C10.853 11.3888 11.1154 11.6625 11.1154 12C11.1154 12.3375 10.853 12.6112 10.5294 12.6112H3.49713L2.06084 18.4862C1.87896 19.2301 2.11166 20.0044 2.66814 20.5069C3.22572 21.0104 3.99381 21.1382 4.67244 20.8445L20.8089 13.8606C21.5436 13.5426 22 12.8297 22 12C22 11.1703 21.5436 10.4574 20.8089 10.1394Z","fill","currentColor"],["d","M20.8089 10.1394L4.6724 3.15546C3.9926 2.8612 3.22459 2.99065 2.66814 3.49311C2.1117 3.99565 1.87896 4.76995 2.06084 5.51382L3.49713 11.3888H10.5294C10.853 11.3888 11.1154 11.6625 11.1154 12C11.1154 12.3375 10.853 12.6112 10.5294 12.6112H3.49713L2.06084 18.4862C1.87896 19.2301 2.11166 20.0044 2.66814 20.5069C3.22572 21.0104 3.99381 21.1382 4.67244 20.8445L20.8089 13.8606C21.5436 13.5426 22 12.8297 22 12C22 11.1703 21.5436 10.4574 20.8089 10.1394Z","fill","white"]],template:function(t,a){if(t&1&&y(0,rT,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Fg,Ub,Fb,Yu,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)}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-composer-action-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.velt-composer-action-button--selected[_ngcontent-%COMP%] app-action-button button.action__button.velt-action-button{background:color-mix(in srgb,var(--velt-accent) 12%,transparent);color:var(--velt-accent)}.velt-composer-action-button--selected[_ngcontent-%COMP%] app-action-button button.action__button.velt-action-button:hover{background:color-mix(in srgb,var(--velt-accent) 18%,transparent);color:var(--velt-accent)}.velt-composer--submit-button[_ngcontent-%COMP%]{background:transparent;border:0;outline:0}.velt-composer--submit-button[_ngcontent-%COMP%] .velt-composer--input-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:2.4em;height:2.4em;border:0;border-radius:var(--velt-border-radius-3xl);background:var(--velt-accent);color:var(--velt-accent-foreground);cursor:pointer}.velt-composer--submit-button[_ngcontent-%COMP%]:disabled .velt-composer--input-button[_ngcontent-%COMP%]{opacity:.4;pointer-events:none;cursor:not-allowed}.velt-composer--submit-button[_ngcontent-%COMP%]:hover .velt-composer--input-button[_ngcontent-%COMP%]{background:var(--velt-accent-hover);color:var(--velt-accent-foreground)}.velt-composer--submit-button[_ngcontent-%COMP%]:focus .velt-composer--input-button[_ngcontent-%COMP%]{background:var(--velt-accent-hover);color:var(--velt-accent-foreground);outline:0}.velt-composer--submit-button[_ngcontent-%COMP%]:active .velt-composer--input-button[_ngcontent-%COMP%]{background:var(--velt-accent-hover);color:var(--velt-accent-foreground)}"],changeDetection:0});let r=o;return r})();function Bf(r){return!!r?.selectedAttachments?.length}function nT(r,o){return{composerContent:r?.composerContent||o?.composerContent||"",composerContentHTML:r?.composerContentHTML||o?.composerContentHTML||"",localRecordedData:o?.localRecordedData||[],selectedFiles:o?.selectedFiles||[],invalidSelectedFiles:o?.invalidSelectedFiles||[],selectedAttachments:o?.selectedAttachments||[]}}function oT(r,o,n){try{switch(r.setAttribute("data-testid",o+"-container"),n){case"attachment":r.setAttribute("role","button"),r.setAttribute("aria-label","Attach file");break;case"giphy":r.setAttribute("role","button"),r.setAttribute("aria-label","Search GIFs");break;case"emoji":r.setAttribute("role","button"),r.setAttribute("aria-label","Insert emoji");break;case"video":r.setAttribute("role","button"),r.setAttribute("aria-label","Record video message");break;case"screen":r.setAttribute("role","button"),r.setAttribute("aria-label","Record screen");break;case"userMentions":r.setAttribute("role","button"),r.setAttribute("aria-label","Mention user with @ symbol");break;case"format":r.setAttribute("role","button"),r.setAttribute("aria-label","Show format options");break;default:r.setAttribute("role","group"),r.setAttribute("aria-label","Composer action button")}}catch{}}var Vf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),iT=(r,o)=>({condition:r,data:o}),lT=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-assign-user-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function dT(r,o){if(r&1){let n=J();u(0),b(1,"app-assign-dropdown",2),A(2,"translate"),H("setAssignTo",function(t){B(n);let a=l(4);return V(a.onSetAssignTo(t))})("toggleCheckbox",function(){B(n);let t=l(4);return V(t.onToggleCheckbox())}),x(),p()}if(r&2){let n=l(3),e=l();d(),v("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("assignTo",n.data==null?null:n.data.assignTo)("selectedUserContacts",n.data==null?null:n.data.selectedUserContacts)("assignToType",(n.featureState==null?null:n.featureState.assignToType)||"dropdown")("isAssignedCheckbox",!!(n.data!=null&&n.data.isAssignedCheckbox)),k("data-testid",e.componentId+"-dropdown")("aria-label",R(2,7,"Assign user"))}}function vT(r,o){if(r&1&&(u(0),s(1,dT,3,9,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,lT,e.template,C(1,Vf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function cT(r,o){if(r&1&&s(0,vT,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,iT,n.conditionSignal(),C(1,Vf,n.componentConfigSignal,n.localUIStateSignal)))}}function mT(r,o){if(r&1&&y(0,cT,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var ia=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-assign-user-internal",this.shouldShow=L(()=>{try{return this.defaultCondition()?this.componentConfigSignal()?.featureState?.userMentions===!0:!0}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}})}onSetAssignTo(e){try{let t=this.getAnnotationId();if(!t)return;this.actionService.setAssignTo(t,e.assignTo)}catch(t){this.loggingService.catch("Error in onSetAssignTo:",t)}}onToggleCheckbox(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.toggleAssignToCheckbox(e)}catch(e){this.loggingService.catch("Error in onToggleCheckbox:",e)}}setupA11yAttributes(){try{sT(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-assign-user-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"setAssignTo","toggleCheckbox","darkMode","assignTo","selectedUserContacts","assignToType","isAssignedCheckbox"]],template:function(t,a){if(t&1&&y(0,mT,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Ju,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)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function sT(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Assign user")}catch{}}function uT(r){try{return typeof r=="string"?JSON.parse(r):r}catch{return null}}function pT(r){try{if(typeof r=="string"){let o=parseInt(r,10);return isNaN(o)?0:o}return r??0}catch{return 0}}function hT(r){try{if(r==null||r==="")return;if(typeof r=="string"){let o=parseInt(r,10);return isNaN(o)?void 0:o}return r}catch{return}}function $f(r){try{if(typeof r=="string"){let o=r.toLowerCase();return o==="true"||o===""}return!!r}catch{return!1}}function bT(r,o){return r??o??0}function fT(r){return!!(r&&(r.url||r.file||r.name||r.fileType||r.mimeType||r.errorMessage))}function CT(r,o,n){return fT(r)?r:Array.isArray(o)&&n!=null&&n>=0&&n<o.length?o[n]:r??null}function kT(r){return r?.url??r?.downloadUrl??r?.file?.url}var Ft=(()=>{let o=class o extends te{constructor(){super(...arguments),this.file=q(null,{transform:uT}),this.fileIndex=q(0,{transform:pT}),this.index=q(void 0,{transform:hT}),this.isEditMode=q(!1,{transform:$f}),this.loading=q(!1,{transform:$f}),this.resolvedIndex=L(()=>bT(this.index(),this.fileIndex())),this.composerDraftFileKey="selectedFiles",this.resolvedFile=L(()=>{try{return CT(this.file(),this.composerDraft()?.[this.composerDraftFileKey],this.resolvedIndex())}catch(e){return this.loggingService.catch("Error in ComposerAttachmentFileComponent resolvedFile:",e),null}})}openAttachmentInNewTab(e){try{e?.stopPropagation();let t=kT(this.resolvedFile());typeof t=="string"&&t&&window.open(t,"_blank","noopener,noreferrer")}catch(t){this.loggingService.catch("Error in openAttachmentInNewTab:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["app-composer-attachment-file-base"]],inputs:{file:[1,"file"],fileIndex:[1,"fileIndex"],index:[1,"index"],isEditMode:[1,"isEditMode"],loading:[1,"loading"]},standalone:!1,features:[M],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();var Gf=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),xT=(r,o)=>({condition:r,data:o}),_T=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function ST(r,o){r&1&&(u(0),de(),b(1,"svg",3),E(2,"path",4)(3,"path",5),x(),p())}function yT(r,o){if(r&1){let n=J();u(0),b(1,"button",1),H("click",function(){B(n);let t=l(2);return V(t.onDeleteClick())}),s(2,ST,4,0,"ng-container",2),x(),p()}if(r&2){let n,e=l(),t=l();d(),k("aria-label","Remove invalid file: "+(((n=t.resolvedFile())==null||n.file==null?null:n.file.name)||"unnamed file"))("data-testid",t.componentId+"-button"),d(),v("veltDynamicTemplate",O(8,_T,t.template,Je(3,Gf,t.componentConfigSignal,t.localUIStateSignal,t.resolvedFile(),t.resolvedIndex()),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.hostElementRef))}}function wT(r,o){if(r&1&&s(0,yT,3,14,"ng-container",0),r&2){let n=l();v("veltIf",C(6,xT,n.conditionSignal(),Je(1,Gf,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var la=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-delete-internal",this.composerDraftFileKey="invalidSelectedFiles",this.deleteClicked=or()}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemDeleteComponent ngOnInit:",e)}}onDeleteClick(){try{let e=this.resolvedIndex(),t=this.resolvedFile();this.deleteClicked.emit(e);let a=this.getAnnotationId();a&&this.actionService.removeInvalidFile(a,e,this.localUIStateSignal()?.dialogInstanceId),this.loggingService.log("Invalid file delete clicked:",{fileIndex:e,fileName:t?.file?.name||"unknown",mode:a?"context":"standalone"})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemDeleteComponent onDeleteClick:",e)}}setupA11yAttributes(){try{IT(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-delete-internal"]],outputs:{deleteClicked:"deleteClicked"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["title","Remove File",1,"velt-composer--icon-button",3,"click"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(t,a){if(t&1&&y(0,wT,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F],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)}[_nghost-%COMP%]:empty{display:none}.velt-composer--icon-button[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;margin:var(--velt-spacing-xs);color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function IT(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Remove invalid file")}catch{}}var TT=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),OT=(r,o)=>({condition:r,data:o}),ET=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e}),MT=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-message-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function AT(r,o){if(r&1&&(u(0),b(1,"span",2),le(2),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label","Error message: "+(((n=t.resolvedFile())==null?null:n.errorMessage)||"")),d(),Ce(" ",(e=t.resolvedFile())==null?null:e.errorMessage," ")}}function PT(r,o){if(r&1&&(u(0),s(1,AT,3,3,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(6,MT,e.template,Je(1,ET,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function FT(r,o){if(r&1&&s(0,PT,2,12,"ng-container",0),r&2){let n=l();v("veltIf",C(6,OT,n.conditionSignal(),Je(1,TT,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var da=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-message-internal",this.composerDraftFileKey="invalidSelectedFiles"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemMessageComponent ngOnInit:",e)}}setupA11yAttributes(){try{NT(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-message-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--error-message"]],template:function(t,a){if(t&1&&y(0,FT,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F],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)}[_nghost-%COMP%]:empty{display:none}.velt-composer--error-message[_ngcontent-%COMP%]{font-size:var(--velt-font-size-xs);text-align:center;margin-top:var(--velt-spacing-xs);color:var(--velt-text-primary)}"],changeDetection:0});let r=o;return r})();function NT(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var jf=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),UT=(r,o)=>({condition:r,data:o}),LT=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-preview-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function BT(r,o){if(r&1&&E(0,"img",2),r&2){let n,e=l(4);v("src",(n=e.resolvedFile())==null?null:n.url,ur)}}function VT(r,o){if(r&1&&(u(0),y(1,BT,1,1,"img",2),p()),r&2){let n,e=l(3);d(),w(!((n=e.resolvedFile())==null||n.file==null||n.file.type==null)&&n.file.type.includes("image")?1:-1)}}function $T(r,o){if(r&1&&(u(0),s(1,VT,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(6,LT,e.template,Je(1,jf,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function GT(r,o){if(r&1&&s(0,$T,2,12,"ng-container",0),r&2){let n=l();v("veltIf",C(6,UT,n.conditionSignal(),Je(1,jf,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var va=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-preview-internal",this.composerDraftFileKey="invalidSelectedFiles"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemPreviewComponent ngOnInit:",e)}}setupA11yAttributes(){try{jT(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-preview-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","aria-hidden","true","role","img",3,"src"]],template:function(t,a){if(t&1&&y(0,GT,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F],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)}[_nghost-%COMP%]:empty{display:none}img[_ngcontent-%COMP%]{width:100%;object-fit:cover;height:100%}.velt-composer--invalid-file-icon[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}"],changeDetection:0});let r=o;return r})();function jT(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var Hf=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),zT=(r,o)=>({condition:r,data:o}),WT=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function JT(r,o){if(r&1){let n=J();u(0),b(1,"div",2)(2,"div",3)(3,"velt-comment-dialog-composer-attachments-invalid-item-delete-internal",4),H("deleteClicked",function(t){B(n);let a=l(3);return V(a.handleDeleteClick(t))}),x()(),b(4,"div",5),de(),b(5,"svg",6),E(6,"path",7),x(),xt(),E(7,"velt-comment-dialog-composer-attachments-invalid-item-message-internal",8),x(),E(8,"velt-comment-dialog-composer-attachments-invalid-item-preview-internal",9),x(),p()}if(r&2){let n,e,t,a,i,c=l(3);d(),k("aria-label","Invalid file: "+(((n=c.resolvedFile())==null||n.file==null?null:n.file.name)||"unnamed file"))("data-testid",c.componentId),d(),k("aria-label","Actions for invalid file: "+(((e=c.resolvedFile())==null||e.file==null?null:e.file.name)||"unnamed file"))("data-testid",c.componentId+"-file-actions"),d(),v("componentConfigSignal",c.componentConfigSignal)("parentLocalUIState",c.localUIStateSignal)("file",c.resolvedFile())("fileIndex",c.resolvedIndex()),k("aria-label","Remove invalid file: "+(((t=c.resolvedFile())==null||t.file==null?null:t.file.name)||"unnamed file"))("data-testid",c.componentId+"-delete-file"),d(),k("aria-label","File error: "+(((a=c.resolvedFile())==null?null:a.errorMessage)||"File cannot be uploaded"))("data-testid",c.componentId+"-error-message"),d(3),v("componentConfigSignal",c.componentConfigSignal)("parentLocalUIState",c.localUIStateSignal)("file",c.resolvedFile())("fileIndex",c.resolvedIndex()),k("data-testid",c.componentId+"-error-message-text"),d(),v("componentConfigSignal",c.componentConfigSignal)("parentLocalUIState",c.localUIStateSignal)("file",c.resolvedFile())("fileIndex",c.resolvedIndex()),k("aria-label","Preview of invalid file: "+(((i=c.resolvedFile())==null||i.file==null?null:i.file.name)||"unnamed file"))("data-testid",c.componentId+"-preview-file")}}function YT(r,o){if(r&1&&(u(0),s(1,JT,9,23,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(6,WT,e.template,Je(1,Hf,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function KT(r,o){if(r&1&&s(0,YT,2,12,"ng-container",0),r&2){let n=l();v("veltIf",C(6,zT,n.conditionSignal(),Je(1,Hf,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var ca=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-internal",this.composerDraftFileKey="invalidSelectedFiles",this.deleteFile=or()}set itemWireframe(e){e&&(this.template=e.cloneNode(!0))}handleDeleteClick(e){try{this.deleteFile.emit(e),this.loggingService.log("Invalid item delete clicked for index:",e)}catch(t){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemComponent handleDeleteClick:",t)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemComponent ngOnInit:",e)}}setupA11yAttributes(){try{ZT(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-internal"]],inputs:{itemWireframe:"itemWireframe"},outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--invalid-selected-file"],["role","group",1,"velt-composer--selected-file-actions"],["role","button","tabindex","0",3,"deleteClicked","componentConfigSignal","parentLocalUIState","file","fileIndex"],["role","alert","aria-live","polite",1,"velt-composer--error-message"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img",1,"velt-composer--error-message-icon"],["d","M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex"],["role","img",3,"componentConfigSignal","parentLocalUIState","file","fileIndex"]],template:function(t,a){if(t&1&&y(0,KT,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,la,da,va],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)}[_nghost-%COMP%]:empty{display:none}.velt-composer--invalid-selected-file[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-sm);overflow:hidden;line-height:0;position:relative;height:72px;width:85px;flex:0 0 30%;border:4px solid var(--velt-error)}.velt-composer--invalid-selected-file[_ngcontent-%COMP%] .velt-composer--error-message[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;background:color-mix(in srgb,var(--velt-surface-0) 52%,transparent);display:flex;flex-direction:column;padding:var(--velt-spacing-xs);align-items:center;justify-content:center;color:var(--velt-white);box-sizing:border-box;gap:var(--velt-spacing-md)}.velt-composer--invalid-selected-file[_ngcontent-%COMP%] .velt-composer--error-message[_ngcontent-%COMP%] .velt-composer--error-message-icon[_ngcontent-%COMP%]{height:24px;color:var(--velt-white)}.velt-composer--invalid-selected-file[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;background:color-mix(in srgb,var(--velt-surface-0) 32%,transparent);align-items:center;justify-content:center;display:none}.velt-composer--invalid-selected-file[_ngcontent-%COMP%]:hover .velt-composer--selected-file-actions[_ngcontent-%COMP%], .velt-composer--invalid-selected-file.loading[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{display:flex}.velt-composer--invalid-selected-file[_ngcontent-%COMP%]:hover .velt-composer--error-message[_ngcontent-%COMP%]{display:none}"],changeDetection:0});let r=o;return r})();function ZT(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Composer invalid attachment actions")}catch{}}var zf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),qT=(r,o)=>({condition:r,data:o}),QT=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1}),eO=(r,o)=>(o==null||o.file==null?null:o.file.name)||r;function tO(r,o){if(r&1){let n=J();b(0,"div",2)(1,"velt-comment-dialog-composer-attachments-invalid-item-internal",3),H("deleteFile",function(t){B(n);let a=l(4);return V(a.handleDelete(t))}),x()()}if(r&2){let n=o.$implicit,e=o.$index,t=l(4);k("aria-label","Invalid file "+((n==null||n.file==null?null:n.file.name)||"unknown"))("data-testid",t.componentId+"-invalid-file-"+e),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("itemWireframe",t.itemTemplate)("file",n)("fileIndex",e)}}function rO(r,o){if(r&1&&(u(0),rt(1,tO,2,7,"div",2,eO),p()),r&2){let n=l(3);d(),nt(n.filesToDisplay())}}function nO(r,o){if(r&1&&(u(0),s(1,rO,3,0,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,QT,e.template,C(1,zf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function oO(r,o){if(r&1&&s(0,nO,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,qT,n.conditionSignal(),C(1,zf,n.componentConfigSignal,n.localUIStateSignal)))}}var ma=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-internal",this.filesChanged=or(),this.files=q([],{transform:e=>{try{return typeof e=="string"?JSON.parse(e):Array.isArray(e)?e:[]}catch{return[]}}}),this.filesToDisplay=L(()=>{try{let e=this.files();if(e&&e.length>0)return e;let t=this.composerDraft();return t?.invalidSelectedFiles?.length?t.invalidSelectedFiles:this.localUIStateSignal()?.invalidSelectedFiles||[]}catch(e){return this.loggingService.catch("Error in filesToDisplay:",e),[]}})}handleDelete(e){try{let t=this.files();if(t&&t.length>0){let a=t.filter((i,c)=>c!==e);this.filesChanged.emit(a),this.loggingService.log("Invalid file deleted at index:",e,"Remaining files:",a.length)}}catch(t){this.loggingService.catch("Error in ComposerAttachmentsInvalidComponent handleDelete:",t)}}ngOnInit(){try{if(super.ngOnInit(),!this.itemTemplate){let e=this.template?.querySelector("velt-comment-dialog-composer-attachments-invalid-item-wireframe");ye(e)||(this.itemTemplate=e)}}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidComponent ngOnInit:",e)}}setupA11yAttributes(){try{aO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-internal"]],inputs:{files:[1,"files"]},outputs:{filesChanged:"filesChanged"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","listitem"],[3,"deleteFile","componentConfigSignal","parentLocalUIState","itemWireframe","file","fileIndex"]],template:function(t,a){if(t&1&&y(0,oO,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,ca],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)}[_nghost-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-sm)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function aO(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","list"),r.setAttribute("aria-label","List of invalid files")}catch{}}var lO=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),dO=(r,o)=>({condition:r,data:o}),vO=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),cO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function mO(r,o){r&1&&(u(0),de(),b(1,"svg",4),E(2,"path",5)(3,"path",6),x(),p())}function sO(r,o){if(r&1){let n=J();b(0,"button",2),A(1,"translate"),A(2,"translate"),H("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(3,mO,4,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();v("title",R(1,4,"Remove File")),k("data-testid",e.componentId)("aria-label",R(2,6,"Remove file")),d(3),v("veltDynamicTemplate",O(14,cO,e.template,O(8,vO,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function gO(r,o){if(r&1&&(u(0),y(1,sO,4,20,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function uO(r,o){if(r&1&&s(0,gO,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,dO,n.conditionSignal(),O(1,lO,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var sa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-delete-internal",this.deleteFile=or()}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageDeleteComponent ngOnInit:",e)}}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.deleteAttachment(e,this.resolvedIndex(),this.isEditMode(),this.localUIStateSignal()?.dialogInstanceId),this.deleteFile.emit(this.resolvedIndex())}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}setupA11yAttributes(){try{pO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-delete-internal"]],outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer--icon-button",3,"title"],[1,"velt-composer--icon-button",3,"click","title"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(t,a){if(t&1&&y(0,uO,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]:empty{display:none}.velt-composer--icon-button[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;margin:var(--velt-spacing-xs);color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function pO(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Delete attachment")}catch{}}var bO=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),fO=(r,o)=>({condition:r,data:o}),CO=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),kO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function xO(r,o){r&1&&(u(0),de(),b(1,"svg",4)(2,"g"),E(3,"rect",5),x(),b(4,"g"),E(5,"path",6),x()(),p())}function _O(r,o){if(r&1){let n=J();b(0,"button",2),A(1,"translate"),A(2,"translate"),H("click",function(t){return B(n),l(3).onDownloadClick(),V(t.stopPropagation())}),s(3,xO,6,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();v("title",R(1,4,"Download attachment")),k("data-testid",e.componentId)("aria-label",R(2,6,"Download attachment")),d(3),v("veltDynamicTemplate",O(14,kO,e.template,O(8,CO,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function SO(r,o){if(r&1&&(u(0),y(1,_O,4,20,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function yO(r,o){if(r&1&&s(0,SO,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,fO,n.conditionSignal(),O(1,bO,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var ga=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-download-internal"}onDownloadClick(){try{let e=this.getAnnotationId();ep(this.actionService,e,this.resolvedFile())}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageDownloadComponent ngOnInit:",e)}}setupA11yAttributes(){try{wO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-download-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button",1,"velt-composer--icon-button",3,"title"],["type","button",1,"velt-composer--icon-button",3,"click","title"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img"],["fill","none","height","24","width","24"],["d","M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"]],template:function(t,a){if(t&1&&y(0,yO,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]:empty{display:none}.velt-composer--icon-button[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;margin:var(--velt-spacing-xs);color:var(--velt-black);border:0;cursor:pointer;padding:0}"],changeDetection:0});let r=o;return r})();function wO(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function ep(r,o,n){try{if(!r||typeof r.downloadAttachment!="function"||!o||!n)return!1;let e=n.name??n.file?.name??n.fileName,t=n.url??n.downloadUrl??n.file?.url,a=e||t?f(g({},n),{name:e,url:t}):n;return r.downloadAttachment(o,a),!0}catch{return!1}}var Wf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),DO=(r,o)=>({condition:r,data:o}),TO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-loading-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function OO(r,o){r&1&&(u(0),de(),b(1,"svg",2)(2,"circle",3),E(3,"animateTransform",4),x()(),p())}function EO(r,o){if(r&1&&(u(0),s(1,OO,4,0,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(7,TO,e.template,O(1,Wf,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function MO(r,o){if(r&1&&s(0,EO,2,13,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,DO,n.conditionSignal(),O(1,Wf,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function AO(r,o){if(r&1&&y(0,MO,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var ua=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-loading-internal",this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode();return(e?.uiState?.uploadingAttachments||this.loading())&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsImageLoadingComponent shouldShow:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageLoadingComponent ngOnInit:",e)}}setupA11yAttributes(){try{PO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-loading-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","width","48px","height","48px","viewBox","0 0 100 100","preserveAspectRatio","xMidYMid","aria-hidden","true","role","img",2,"margin","auto","display","block"],["cx","50","cy","50","fill","none","stroke","currentColor","stroke-width","7","r","34","stroke-dasharray","160.22122533307947 55.40707511102649"],["attributeName","transform","type","rotate","repeatCount","indefinite","dur","1s","values","0 50 50;360 50 50","keyTimes","0;1"]],template:function(t,a){if(t&1&&y(0,AO,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F],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)}[_nghost-%COMP%]:empty{display:none}svg[_ngcontent-%COMP%]{color:var(--velt-white)}"],changeDetection:0});let r=o;return r})();function PO(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","status"),r.setAttribute("aria-label","Uploading image")}catch{}}var NO=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),RO=(r,o)=>({condition:r,data:o}),UO=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),LO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-preview-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function BO(r,o){if(r&1&&(u(0),E(1,"img",2),p()),r&2){let n,e=l(3);d(),v("src",(n=e.resolvedFile())==null?null:n.url,ur)}}function VO(r,o){if(r&1&&(u(0),s(1,BO,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,LO,e.template,O(1,UO,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function $O(r,o){if(r&1&&s(0,VO,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,RO,n.conditionSignal(),O(1,NO,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var pa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-preview-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImagePreviewComponent ngOnInit:",e)}}setupA11yAttributes(){try{GO(this.hostElementRef.nativeElement,this.componentId,this.resolvedFile())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-preview-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","aria-hidden","true","role","img",3,"src"]],template:function(t,a){if(t&1&&y(0,$O,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F],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)}[_nghost-%COMP%]:empty{display:none}img[_ngcontent-%COMP%]{width:100%;object-fit:cover;height:100%}"],changeDetection:0});let r=o;return r})();function GO(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img");let e=n?.file?.name||n?.name||"Attachment image";r.setAttribute("aria-label",`Preview of ${e}`)}catch{}}var Jf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),HO=(r,o)=>({condition:r,data:o}),zO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function WO(r,o){if(r&1){let n=J();u(0),b(1,"div",3),H("click",function(t){B(n);let a=l(4);return V(a.openAttachmentInNewTab(t))}),b(2,"div",4),E(3,"velt-comment-dialog-composer-attachments-image-loading-internal",5)(4,"velt-comment-dialog-composer-attachments-image-download-internal",6),b(5,"velt-comment-dialog-composer-attachments-image-delete-internal",7),H("deleteFile",function(t){B(n);let a=l(4);return V(a.handleDelete(t))}),x()(),E(6,"velt-comment-dialog-composer-attachments-image-preview-internal",8),x(),p()}if(r&2){let n,e,t,a,i,c,m=l(4);d(),k("aria-label","Image attachment: "+(((n=m.resolvedFile())==null||n.file==null?null:n.file.name)||((n=m.resolvedFile())==null?null:n.name)||"unnamed image"))("data-testid",m.componentId+"-selected-file"),d(),k("aria-label","Actions for image: "+(((e=m.resolvedFile())==null||e.file==null?null:e.file.name)||((e=m.resolvedFile())==null?null:e.name)||"unnamed image"))("data-testid",m.componentId+"-file-actions"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode())("loading",m.loading()),k("aria-label","Uploading image: "+(((t=m.resolvedFile())==null||t.file==null?null:t.file.name)||((t=m.resolvedFile())==null?null:t.name)||"unnamed image"))("data-testid",m.componentId+"-file-loading"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode())("loading",m.loading()),k("aria-label","Download image: "+(((a=m.resolvedFile())==null||a.file==null?null:a.file.name)||((a=m.resolvedFile())==null?null:a.name)||"unnamed image"))("data-testid",m.componentId+"-file-download"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode())("loading",m.loading()),k("aria-label","Delete image: "+(((i=m.resolvedFile())==null||i.file==null?null:i.file.name)||((i=m.resolvedFile())==null?null:i.name)||"unnamed image"))("data-testid",m.componentId+"-file-delete"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode()),k("aria-label","Preview of image: "+(((c=m.resolvedFile())==null||c.file==null?null:c.file.name)||((c=m.resolvedFile())==null?null:c.name)||"unnamed image"))("data-testid",m.componentId+"-file-preview")}}function JO(r,o){if(r&1&&(u(0),b(1,"div",1),s(2,WO,7,35,"ng-container",2),x(),p()),r&2){let n=l(2),e=l();d(),ue("velt-composer-attachment--loading",e.isLoading()),d(),v("veltDynamicTemplate",O(9,zO,e.template,O(3,Jf,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function YO(r,o){if(r&1&&s(0,JO,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,HO,n.conditionSignal(),O(1,Jf,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function KO(r,o){if(r&1&&y(0,YO,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var ha=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-internal",this.domService=se(Ne),this.deleteFile=or(),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.resolvedFile();return this.isEditMode()?e?.mimeType?.includes("image")??!1:e?.fileType?.includes("image")??!1}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsImageComponent shouldShow:",e),!1}}),this.isLoading=L(()=>{try{let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode(),i=this.loading();return(e?.uiState?.uploadingAttachments||i)&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsImageComponent isLoading:",e),!1}})}get imageWireframe(){return this._imageWireframe}set imageWireframe(e){this._imageWireframe=e,this._imageWireframe?this.template=this.domService.deepCloneElement(this._imageWireframe):this.template=null}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageComponent ngOnInit:",e)}}handleDelete(e){try{this.deleteFile.emit(e)}catch(t){this.loggingService.catch("Error in ComposerAttachmentsImageComponent handleDelete:",t)}}setupA11yAttributes(){try{ZO(this.hostElementRef.nativeElement,this.componentId,this.resolvedFile())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-internal"]],inputs:{imageWireframe:"imageWireframe"},outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer-attachment-container"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--selected-file",3,"click"],["role","group",1,"velt-composer--selected-file-actions"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","button","tabindex","0",3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","img",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode"]],template:function(t,a){if(t&1&&y(0,KO,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,sa,ga,ua,pa],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)}[_nghost-%COMP%]:empty{display:none}.velt-composer--selected-file[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-sm);overflow:hidden;line-height:0;position:relative;height:80px;width:93px;flex:0 0 30%}.velt-composer--selected-file[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;background:color-mix(in srgb,var(--velt-surface-0) 32%,transparent);align-items:center;justify-content:center;display:none}.velt-composer--selected-file[_ngcontent-%COMP%]:hover .velt-composer--selected-file-actions[_ngcontent-%COMP%], .velt-composer-attachment--loading[_ngcontent-%COMP%] .velt-composer--selected-file[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let r=o;return r})();function ZO(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","group");let e=n?.file?.name||n?.name||"unnamed image";r.setAttribute("aria-label",`Image attachment: ${e}`)}catch{}}var qO=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),QO=(r,o)=>({condition:r,data:o}),eE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),tE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function rE(r,o){r&1&&(u(0),de(),b(1,"svg",4),E(2,"path",5),x(),p())}function nE(r,o){if(r&1){let n=J();b(0,"button",2),A(1,"translate"),A(2,"translate"),H("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(3,rE,3,0,"ng-container",3),x()}if(r&2){let n,e=l(2),t=l();k("data-testid",t.componentId+"-button")("aria-label",R(1,3,"Delete file")+" "+R(2,5,((n=t.resolvedFile())==null||n.file==null?null:n.file.name)||"unknown")),d(3),v("veltDynamicTemplate",O(13,tE,t.template,O(7,eE,t.componentConfigSignal,t.localUIStateSignal,t.resolvedIndex(),t.resolvedFile(),t.isEditMode()),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.elementRef))}}function oE(r,o){if(r&1&&(u(0),y(1,nE,4,19,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function aE(r,o){if(r&1&&s(0,oE,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,QO,n.conditionSignal(),O(1,qO,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var ba=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-delete-internal",this.deleteFile=or()}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.deleteAttachment(e,this.resolvedIndex(),this.isEditMode(),this.localUIStateSignal()?.dialogInstanceId),this.deleteFile.emit(this.resolvedIndex())}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherDeleteComponent ngOnInit:",e)}}setupA11yAttributes(){try{iE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-delete-internal"]],outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer--attachment-icon-btn"],[1,"velt-composer--attachment-icon-btn",3,"click"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","width","18","height","19","viewBox","0 0 18 19","fill","none","aria-hidden","true","role","img"],["d","M13.5 5L4.5 14M4.5 5L13.5 14","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,aE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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-composer--attachment-icon-btn[_ngcontent-%COMP%]{display:flex;background:transparent;border:0;padding:var(--velt-spacing-sm);cursor:pointer;color:var(--velt-error)}"],changeDetection:0});let r=o;return r})();function iE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Delete attachment")}catch{}}var dE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),vE=(r,o)=>({condition:r,data:o}),cE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),mE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function sE(r,o){r&1&&(u(0),de(),b(1,"svg",4),E(2,"path",5),x(),p())}function gE(r,o){if(r&1){let n=J();b(0,"button",2),A(1,"translate"),A(2,"translate"),H("click",function(t){return B(n),l(3).onDownloadClick(),V(t.stopPropagation())}),s(3,sE,3,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();k("title",R(1,4,"Download attachment"))("data-testid",e.componentId+"-button")("aria-label",R(2,6,"Download attachment")),d(3),v("veltDynamicTemplate",O(14,mE,e.template,O(8,cE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function uE(r,o){if(r&1&&(u(0),y(1,gE,4,20,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function pE(r,o){if(r&1&&s(0,uE,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,vE,n.conditionSignal(),O(1,dE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var fa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-download-internal"}onDownloadClick(){try{let e=this.getAnnotationId();ep(this.actionService,e,this.resolvedFile())}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherDownloadComponent ngOnInit:",e)}}setupA11yAttributes(){try{hE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-download-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button",1,"velt-composer--attachment-icon-btn"],["type","button",1,"velt-composer--attachment-icon-btn",3,"click"],[4,"veltDynamicTemplate"],["width","18","height","19","viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false","role","img"],["d","M3 13.25V14.75C3 15.1478 3.15804 15.5294 3.43934 15.8107C3.72064 16.092 4.10218 16.25 4.5 16.25H13.5C13.8978 16.25 14.2794 16.092 14.5607 15.8107C14.842 15.5294 15 15.1478 15 14.75V13.25M5.25 8.75L9 12.5M9 12.5L12.75 8.75M9 12.5V3.5","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,pE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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-composer--attachment-icon-btn[_ngcontent-%COMP%]{display:flex;background:transparent;border:0;padding:var(--velt-spacing-sm);cursor:pointer;color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function hE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var fE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),CE=(r,o)=>({condition:r,data:o}),kE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),xE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-icon-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function _E(r,o){if(r&1&&(u(0),b(1,"div",2),E(2,"velt-file-icon-internal",3),x(),p()),r&2){let n,e=l(3);d(),k("data-testid",e.componentId),d(),v("type",e.isEditMode()?(n=e.resolvedFile())==null?null:n.mimeType:(n=e.resolvedFile())==null?null:n.fileType),k("data-testid",e.componentId+"-file-icon-internal")}}function SE(r,o){if(r&1&&(u(0),s(1,_E,3,3,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,xE,e.template,O(1,kE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function yE(r,o){if(r&1&&s(0,SE,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,CE,n.conditionSignal(),O(1,fE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var Ca=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-icon-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherIconComponent ngOnInit:",e)}}setupA11yAttributes(){try{wE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-icon-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--attachment-icon"],[3,"type"]],template:function(t,a){if(t&1&&y(0,yE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Pg],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-composer--attachment-icon[_ngcontent-%COMP%]{display:flex;color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function wE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img"),r.setAttribute("aria-label","File type icon")}catch{}}var DE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),TE=(r,o)=>({condition:r,data:o}),OE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),EE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-loading-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function ME(r,o){if(r&1&&(u(0),de(),b(1,"svg",2)(2,"circle",3),E(3,"animateTransform",4),x()(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-svg")}}function AE(r,o){if(r&1&&(u(0),s(1,ME,4,1,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(7,EE,e.template,O(1,OE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function PE(r,o){if(r&1&&s(0,AE,2,13,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,TE,n.conditionSignal(),O(1,DE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function FE(r,o){if(r&1&&y(0,PE,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var ka=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-loading-internal",this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode();return(e?.uiState?.uploadingAttachments||this.loading())&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsOtherLoadingComponent shouldShow:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherLoadingComponent ngOnInit:",e)}}setupA11yAttributes(){try{NE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-loading-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","width","32px","height","32px","viewBox","0 0 100 100","preserveAspectRatio","xMidYMid","aria-hidden","true","role","img",2,"margin","auto","display","block"],["cx","50","cy","50","fill","none","stroke","currentColor","stroke-width","7","r","34","stroke-dasharray","160.22122533307947 55.40707511102649"],["attributeName","transform","type","rotate","repeatCount","indefinite","dur","1s","values","0 50 50;360 50 50","keyTimes","0;1"]],template:function(t,a){if(t&1&&y(0,FE,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F],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)}svg[_ngcontent-%COMP%]{color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function NE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","status"),r.setAttribute("aria-label","Uploading file")}catch{}}var UE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),LE=(r,o)=>({condition:r,data:o}),BE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),VE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-name-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function $E(r,o){if(r&1&&(u(0),b(1,"span",2),A(2,"translate"),le(3),A(4,"translate"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label",t.isEditMode()?(n=t.resolvedFile())==null?null:n.name:R(2,3,(n=t.resolvedFile())==null||n.file==null?null:n.file.name)),d(2),Ce(" ",t.isEditMode()?(e=t.resolvedFile())==null?null:e.name:R(4,5,(e=t.resolvedFile())==null||e.file==null?null:e.file.name)," ")}}function GE(r,o){if(r&1&&(u(0),s(1,$E,5,7,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,VE,e.template,O(1,BE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function jE(r,o){if(r&1&&s(0,GE,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,LE,n.conditionSignal(),O(1,UE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var xa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-name-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherNameComponent ngOnInit:",e)}}setupA11yAttributes(){try{HE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-name-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--attachment-name"]],template:function(t,a){if(t&1&&y(0,jE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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);line-height:normal}[_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-composer--attachment-name[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-3);text-overflow:ellipsis;font-size:var(--velt-font-size-xs);font-style:normal;font-weight:600;line-height:normal;white-space:nowrap}"],changeDetection:0});let r=o;return r})();function HE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var WE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),JE=(r,o)=>({condition:r,data:o}),YE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),KE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-size-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function ZE(r,o){if(r&1&&(u(0),b(1,"span",2),A(2,"fileSize"),le(3),A(4,"fileSize"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label",t.isEditMode()?(n=t.resolvedFile())==null?null:n.size:R(2,3,(n=t.resolvedFile())==null||n.file==null?null:n.file.size)),d(2),Ce(" ",t.isEditMode()?(e=t.resolvedFile())==null?null:e.size:R(4,5,(e=t.resolvedFile())==null||e.file==null?null:e.file.size)," ")}}function XE(r,o){if(r&1&&(u(0),s(1,ZE,5,7,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,KE,e.template,O(1,YE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function qE(r,o){if(r&1&&s(0,XE,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,JE,n.conditionSignal(),O(1,WE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var _a=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-size-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherSizeComponent ngOnInit:",e)}}setupA11yAttributes(){try{QE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-size-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--attachment-size"]],template:function(t,a){if(t&1&&y(0,qE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Rg],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);line-height:normal}[_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-composer--attachment-size[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-7);text-overflow:ellipsis;font-size:var(--velt-font-size-2xs);font-style:normal;font-weight:500;line-height:normal}"],changeDetection:0});let r=o;return r})();function QE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var Yf=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),t5=(r,o)=>({condition:r,data:o}),r5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function n5(r,o){if(r&1){let n=J();u(0),b(1,"div",3),A(2,"translate"),A(3,"translate"),H("click",function(t){B(n);let a=l(4);return V(a.openAttachmentInNewTab(t))}),E(4,"velt-comment-dialog-composer-attachments-other-icon-internal",4),A(5,"translate"),A(6,"translate"),b(7,"div",5),A(8,"translate"),A(9,"translate"),E(10,"velt-comment-dialog-composer-attachments-other-name-internal",6),A(11,"translate"),A(12,"translate"),E(13,"velt-comment-dialog-composer-attachments-other-size-internal",6),A(14,"translate"),A(15,"translate"),x(),E(16,"velt-comment-dialog-composer-attachments-other-loading-internal",7),A(17,"translate"),A(18,"translate"),b(19,"div",8),A(20,"translate"),A(21,"translate"),E(22,"velt-comment-dialog-composer-attachments-other-download-internal",9),A(23,"translate"),A(24,"translate"),b(25,"velt-comment-dialog-composer-attachments-other-delete-internal",10),A(26,"translate"),A(27,"translate"),H("deleteFile",function(t){B(n);let a=l(4);return V(a.handleDelete(t))}),x()()(),p()}if(r&2){let n,e,t,a,i,c,m,h,_,I=l(4);d(),k("aria-label",R(2,51,"File attachment:")+" "+R(3,53,((n=I.resolvedFile())==null?null:n.name)||((n=I.resolvedFile())==null||n.file==null?null:n.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode()),k("aria-label",R(5,55,"File type icon for")+" "+R(6,57,((e=I.resolvedFile())==null?null:e.name)||((e=I.resolvedFile())==null||e.file==null?null:e.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-icon"),d(3),k("aria-label",R(8,59,"Details for file:")+" "+R(9,61,((t=I.resolvedFile())==null?null:t.name)||((t=I.resolvedFile())==null||t.file==null?null:t.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-details"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode()),k("aria-label",R(11,63,"Filename:")+" "+R(12,65,((a=I.resolvedFile())==null?null:a.name)||((a=I.resolvedFile())==null||a.file==null?null:a.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-name"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode()),k("aria-label",R(14,67,"File size:")+" "+R(15,69,((i=I.resolvedFile())==null?null:i.size)||((i=I.resolvedFile())==null||i.file==null?null:i.file.size)||"unknown size"))("data-testid",I.componentId+"-attachment-size"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode())("loading",I.loading()),k("aria-label",R(17,71,"Uploading file:")+" "+R(18,73,((c=I.resolvedFile())==null?null:c.name)||((c=I.resolvedFile())==null||c.file==null?null:c.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-loading"),d(3),k("aria-label",R(20,75,"Actions for file:")+" "+R(21,77,((m=I.resolvedFile())==null?null:m.name)||((m=I.resolvedFile())==null||m.file==null?null:m.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-actions"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode())("loading",I.loading()),k("aria-label",R(23,79,"Download file:")+" "+R(24,81,((h=I.resolvedFile())==null?null:h.name)||((h=I.resolvedFile())==null||h.file==null?null:h.file.name)||"unnamed file"))("data-testid",I.componentId+"-download-attachment"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode())("loading",I.loading()),k("aria-label",R(26,83,"Remove file:")+" "+R(27,85,((_=I.resolvedFile())==null?null:_.name)||((_=I.resolvedFile())==null||_.file==null?null:_.file.name)||"unnamed file"))("data-testid",I.componentId+"-delete-attachment")}}function o5(r,o){if(r&1&&(u(0),b(1,"div",1),s(2,n5,28,87,"ng-container",2),x(),p()),r&2){let n=l(2),e=l();d(),ue("velt-composer-attachment--loading",e.isLoading()),d(),v("veltDynamicTemplate",O(9,r5,e.template,O(3,Yf,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function a5(r,o){if(r&1&&s(0,o5,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,t5,n.conditionSignal(),O(1,Yf,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function i5(r,o){if(r&1&&y(0,a5,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Sa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-internal",this.domService=se(Ne),this.deleteFile=or(),this.isLoading=L(()=>{try{let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode(),i=this.loading();return(e?.uiState?.uploadingAttachments||i)&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsOtherComponent isLoading:",e),!1}}),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.resolvedFile();return this.isEditMode()?!e?.mimeType?.includes("image"):!e?.fileType?.includes("image")}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsOtherComponent shouldShow:",e),!1}})}get otherWireframe(){return this._otherWireframe}set otherWireframe(e){this._otherWireframe=e,this._otherWireframe?this.template=this.domService.deepCloneElement(this._otherWireframe):this.template=null}handleDelete(e){try{this.deleteFile.emit(e)}catch(t){this.loggingService.catch("Error in ComposerAttachmentsOtherComponent handleDelete:",t)}}setupA11yAttributes(){try{l5(this.hostElementRef.nativeElement,this.componentId,this.resolvedFile())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-internal"]],inputs:{otherWireframe:"otherWireframe"},outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer-attachment-container"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--other-attachment",3,"click"],["role","img",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode"],["role","group",1,"velt-composer--attachment-details"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode"],["role","status","aria-live","polite",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","group",1,"velt-composer--attachment-actions"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","button","tabindex","0",3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"]],template:function(t,a){if(t&1&&y(0,i5,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,ba,fa,Ca,ka,xa,_a,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);width:100%}[_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-composer--other-attachment[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm) var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-md);justify-content:space-between;gap:var(--velt-spacing-sm);align-items:center;align-self:stretch;width:100%;border-radius:var(--velt-border-radius-sm);border:1px solid var(--velt-border-4);box-sizing:border-box}.velt-composer--other-attachment[_ngcontent-%COMP%] .velt-composer--attachment-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs);flex:1;overflow:hidden}.velt-composer--other-attachment[_ngcontent-%COMP%] .velt-composer--attachment-actions[_ngcontent-%COMP%]{display:flex;width:0;overflow:hidden}.velt-composer--other-attachment[_ngcontent-%COMP%]:not(:last-child){margin-bottom:var(--velt-spacing-lg)}.velt-composer--other-attachment[_ngcontent-%COMP%]:hover .velt-composer--attachment-actions[_ngcontent-%COMP%]{width:auto}"],changeDetection:0});let r=o;return r})();function l5(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region");let e=n?.file?.name||n?.name||"unnamed file";r.setAttribute("aria-label",`File attachment: ${e}`)}catch{}}var Kf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),v5=(r,o)=>({condition:r,data:o}),c5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-selected-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function m5(r,o){return(this.isEditMode()?o==null?null:o.attachmentId:o==null?null:o.url)||r}var s5=(r,o)=>(o==null?null:o.attachmentId)||r,g5=(r,o)=>(o==null?null:o.url)||r;function u5(r,o){if(r&1){let n=J();b(0,"velt-comment-dialog-composer-attachments-image-internal",3),H("deleteFile",function(t){B(n);let a=l(5);return V(a.handleDelete(t))}),x(),b(1,"velt-comment-dialog-composer-attachments-other-internal",4),H("deleteFile",function(t){B(n);let a=l(5);return V(a.handleDelete(t))}),x()}if(r&2){let n=o.$implicit,e=o.$index,t=l(5);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",t.isEditMode())("loading",t.loading())("imageWireframe",t.imageTemplate),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",t.isEditMode())("loading",t.loading())("otherWireframe",t.otherTemplate)}}function p5(r,o){if(r&1&&(b(0,"div",2),rt(1,u5,2,14,null,null,m5,!0),x()),r&2){let n=l(4);k("aria-label","Attached files - "+n.files().length+" total attachments")("data-testid",n.componentId+"-attachments-list"),d(),nt(n.files())}}function h5(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-attachments-image-internal",5)(1,"velt-comment-dialog-composer-attachments-other-internal",6),r&2){let n=o.$implicit,e=o.$index,t=l(6);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!0)("imageWireframe",t.imageTemplate),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!0)("otherWireframe",t.otherTemplate)}}function b5(r,o){if(r&1&&rt(0,h5,2,12,null,null,s5),r&2){let n,e=l(5);nt((n=e.editComment())==null?null:n.attachments)}}function f5(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-attachments-image-internal",5)(1,"velt-comment-dialog-composer-attachments-other-internal",6),r&2){let n=o.$implicit,e=o.$index,t=l(6);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!1)("imageWireframe",t.imageTemplate),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!1)("otherWireframe",t.otherTemplate)}}function C5(r,o){if(r&1&&rt(0,f5,2,12,null,null,g5),r&2){let n=l(5);nt(n.selectedFiles())}}function k5(r,o){if(r&1&&(b(0,"div",2),y(1,b5,2,0),y(2,C5,2,0),x()),r&2){let n,e,t,a=l(4);k("aria-label","Attached files - "+((((n=a.editComment())==null||n.attachments==null?null:n.attachments.length)||0)+(((n=a.selectedFiles())==null?null:n.length)||0))+" total attachments")("data-testid",a.componentId+"-attachments-list"),d(),w((e=a.editComment())!=null&&e.attachments?1:-1),d(),w((t=a.selectedFiles())!=null&&t.length?2:-1)}}function x5(r,o){if(r&1&&(u(0),y(1,p5,3,2,"div",2)(2,k5,3,4,"div",2),p()),r&2){let n,e=l(3);d(),w(e.files()&&e.files().length>0?1:!((n=e.editComment())==null||n.attachments==null)&&n.attachments.length||(n=e.selectedFiles())!=null&&n.length?2:-1)}}function _5(r,o){if(r&1&&(u(0),s(1,x5,3,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,c5,e.template,C(1,Kf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function S5(r,o){if(r&1&&s(0,_5,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,v5,n.conditionSignal(),C(1,Kf,n.componentConfigSignal,n.localUIStateSignal)))}}var ya=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-selected-internal",this.domService=se(Ne),this.editComment=L(()=>this.localUIStateSignal()?.editComment??null),this.selectedFiles=L(()=>this.composerDraft()?.selectedFiles??this.localUIStateSignal()?.selectedFiles??[]),this.filesChanged=or(),this.files=q([],{transform:e=>{try{return typeof e=="string"?JSON.parse(e):Array.isArray(e)?e:[]}catch{return[]}}}),this.isEditMode=q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true":e}catch{return!1}}}),this.loading=q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true":e}catch{return!1}}})}handleDelete(e){try{let t=this.files();if(t&&t.length>0){let a=t.filter((i,c)=>c!==e);this.filesChanged.emit(a),this.loggingService.log("File deleted at index:",e,"Remaining files:",a.length)}}catch(t){this.loggingService.catch("Error in ComposerAttachmentsSelectedComponent handleDelete:",t)}}ngOnInit(){try{if(super.ngOnInit(),!this.imageTemplate){let e=this.template?.querySelector("velt-comment-dialog-composer-attachments-image-wireframe");ye(e)||(this.imageTemplate=e)}if(!this.otherTemplate){let e=this.template?.querySelector("velt-comment-dialog-composer-attachments-other-wireframe");ye(e)||(this.otherTemplate=e)}}catch(e){this.loggingService.catch("Error in ComposerAttachmentsSelectedComponent ngOnInit:",e)}}setupA11yAttributes(){try{y5(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-selected-internal"]],inputs:{files:[1,"files"],isEditMode:[1,"isEditMode"],loading:[1,"loading"]},outputs:{filesChanged:"filesChanged"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-comment-dialog-composer-attachments--selected"],[3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading","imageWireframe"],[3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading","otherWireframe"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","imageWireframe"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","otherWireframe"]],template:function(t,a){if(t&1&&y(0,S5,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,ha,Sa],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)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-composer-attachments--selected[_ngcontent-%COMP%]{width:100%;display:flex;flex-wrap:wrap;gap:var(--velt-spacing-sm);flex-direction:row;padding:var(--velt-spacing-xs);box-sizing:border-box}"],changeDetection:0});let r=o;return r})();function y5(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","list"),r.setAttribute("aria-label","List of selected attachments")}catch{}}var Zf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),I5=(r,o)=>({condition:r,data:o}),D5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function T5(r,o){if(r&1&&(u(0),b(1,"div",2),A(2,"translate"),A(3,"translate"),A(4,"translate"),E(5,"velt-comment-dialog-composer-attachments-selected-internal",3)(6,"velt-comment-dialog-composer-attachments-invalid-internal",3),x(),p()),r&2){let n=l(4);d(),k("aria-label",R(2,6,"File attachments")+" - "+n.selectedFilesCount()+" "+R(3,8,"valid")+", "+n.invalidFilesCount()+" "+R(4,10,"invalid files"))("data-testid",n.componentId),d(4),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function O5(r,o){if(r&1&&(u(0),s(1,T5,7,12,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,D5,e.template,C(1,Zf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function E5(r,o){if(r&1&&s(0,O5,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,I5,n.conditionSignal(),C(1,Zf,n.componentConfigSignal,n.localUIStateSignal)))}}function M5(r,o){if(r&1&&y(0,E5,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var wa=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-internal",this.selectedFilesCount=L(()=>(this.composerDraft()?.selectedFiles??this.localUIStateSignal()?.selectedFiles)?.length||0),this.invalidFilesCount=L(()=>(this.composerDraft()?.invalidSelectedFiles??this.localUIStateSignal()?.invalidSelectedFiles)?.length||0),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.composerDraft(),t=this.localUIStateSignal();return!!(t?.editComment||(e?.selectedFiles??t?.selectedFiles)?.length||(e?.invalidSelectedFiles??t?.invalidSelectedFiles)?.length)}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}})}setupA11yAttributes(){try{A5(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--attachments"],[3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,M5,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,ma,ya,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)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-composer--attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;width:100%;gap:var(--velt-spacing-sm);flex-direction:row;max-height:200px;overflow:auto}"],changeDetection:0});let r=o;return r})();function A5(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Attachments section")}catch{}}var Xf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),F5=(r,o)=>({condition:r,data:o}),N5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-avatar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function R5(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),p()),r&2){let n=l(3),e=l();d(),v("size",32)("user",n.appState.user),k("aria-label","User avatar for "+((n.appState.user==null?null:n.appState.user.name)||"unknown user"))("data-testid",e.componentId)}}function U5(r,o){if(r&1&&(u(0),s(1,R5,2,4,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,N5,e.template,C(1,Xf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function L5(r,o){if(r&1&&s(0,U5,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,F5,n.conditionSignal(),C(1,Xf,n.componentConfigSignal,n.localUIStateSignal)))}}function B5(r,o){if(r&1&&y(0,L5,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Ia=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-avatar-internal",this.shouldShow=L(()=>!0)}setupA11yAttributes(){try{V5(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-avatar-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","img",1,"comment-dialog-user-avatar",3,"size","user"]],template:function(t,a){if(t&1&&y(0,B5,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Ut],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)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function V5(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img"),r.setAttribute("aria-label","User avatar")}catch{}}var qf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),G5=(r,o)=>({condition:r,data:o}),j5=(r,o,n,e,t,a)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-format-toolbar-button-wireframe",variant:n,suffix:e,setIfCondition:t,componentElementRef:a});function H5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",4),x())}function z5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",5),x())}function W5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",6),x())}function J5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",7),x())}function Y5(r,o){if(r&1&&(u(0),y(1,H5,2,0,":svg:svg",3)(2,z5,2,0,":svg:svg",3)(3,W5,2,0,":svg:svg",3)(4,J5,2,0,":svg:svg",3),p()),r&2){let n,e=l(3);d(),w((n=e.getTypeValue())==="bold"?1:n==="italic"?2:n==="underline"?3:n==="strikethrough"?4:-1)}}function K5(r,o){if(r&1){let n=J();u(0),b(1,"div",1),A(2,"translate"),H("click",function(t){return B(n),l(2).handleClick(),t.stopPropagation(),V(t.preventDefault())})("mousedown",function(t){return B(n),V(t.preventDefault())}),s(3,Y5,5,1,"ng-container",2),x(),p()}if(r&2){let n=l(),e=l();d(),k("data-testid",e.componentId+"-"+e.getTypeValue())("data-type",e.getTypeValue())("aria-label",R(2,5,e.getTypeValue()+" formatting"))("aria-pressed",e.hostElementRef.nativeElement.getAttribute("data-active")==="true"),d(2),v("veltDynamicTemplate",St(10,j5,e.template,C(7,qf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function Z5(r,o){if(r&1&&s(0,K5,4,17,"ng-container",0),r&2){let n=l();v("veltIf",C(4,G5,n.conditionSignal(),C(1,qf,n.componentConfigSignal,n.localUIStateSignal)))}}var Da=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-format-toolbar-button-internal",this.editMode=q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true"||e==="1":e}catch{return!1}}}),this.type=q.required({transform:e=>{try{return e||""}catch{return""}}})}ngOnInit(){super.ngOnInit(),this.selectionChangeHandler=()=>this.refreshActiveState(),document.addEventListener("selectionchange",this.selectionChangeHandler),this.refreshActiveState()}ngOnDestroy(){this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=void 0),super.ngOnDestroy()}commandForType(){return{bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"}[this.getTypeValue()]}refreshActiveState(){try{let e=this.commandForType();if(!e)return;let t=document.queryCommandState(e);this.hostElementRef.nativeElement.setAttribute("data-active",t?"true":"false")}catch{}}getTypeValue(){try{let e=this.type;return typeof e=="function"?e():e}catch{return""}}setupA11yAttributes(){try{X5(this.hostElementRef.nativeElement,this.componentId,this.getTypeValue())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}handleClick(){try{let e=this.getTypeValue(),a={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"}[e];if(a){document.execCommand(a,!1);let i=this.componentConfigSignal(),m=this.editMode()?i?.uiState?.editCommentTextArea?.nativeElement:i?.uiState?.newCommentTextArea?.nativeElement;m&&m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.hostElementRef.nativeElement.dispatchEvent(new CustomEvent("velt-format-applied",{bubbles:!0,composed:!0})),this.refreshActiveState()}}catch(e){this.loggingService.catch("Error in handleClick:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=Y(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-format-toolbar-button-internal"]],inputs:{editMode:[1,"editMode"],type:[1,"type"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",1,"velt-format-toolbar-button",3,"click","mousedown"],[4,"veltDynamicTemplate"],["width","16","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true"],["d","M8.66663 7.9987C9.28546 7.9987 9.87896 7.75286 10.3165 7.31528C10.7541 6.8777 11 6.2842 11 5.66536C11 5.04653 10.7541 4.45303 10.3165 4.01545C9.87896 3.57786 9.28546 3.33203 8.66663 3.33203H4.66663V7.9987M8.66663 7.9987H4.66663M8.66663 7.9987H9.33329C9.95213 7.9987 10.5456 8.24453 10.9832 8.68212C11.4208 9.1197 11.6666 9.71319 11.6666 10.332C11.6666 10.9509 11.4208 11.5444 10.9832 11.9819C10.5456 12.4195 9.95213 12.6654 9.33329 12.6654H4.66663V7.9987","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M7.33329 3.33203H11.3333M4.66663 12.6654H8.66663M9.33329 3.33203L6.66663 12.6654","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M4.66671 3.33203V6.66536C4.66671 7.54942 5.0179 8.39727 5.64302 9.02239C6.26814 9.64751 7.11599 9.9987 8.00004 9.9987C8.8841 9.9987 9.73194 9.64751 10.3571 9.02239C10.9822 8.39727 11.3334 7.54942 11.3334 6.66536V3.33203M3.33337 12.6654H12.6667","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M3.33337 7.9987H12.6667M10.6667 4.3327C10.5155 4.03934 10.1691 3.78046 9.68437 3.5987C9.19967 3.41693 8.60562 3.32312 8.00004 3.3327H7.33337C6.71454 3.3327 6.12104 3.57853 5.68346 4.01612C5.24587 4.4537 5.00004 5.04719 5.00004 5.66603C5.00004 6.28487 5.24587 6.87836 5.68346 7.31595C6.12104 7.75353 6.71454 7.99936 7.33337 7.99936H8.66671C9.28555 7.99936 9.87904 8.2452 10.3166 8.68278C10.7542 9.12037 11 9.71386 11 10.3327C11 10.9515 10.7542 11.545 10.3166 11.9826C9.87904 12.4202 9.28555 12.666 8.66671 12.666H7.66671C7.06113 12.6756 6.46708 12.5818 5.98237 12.4C5.49767 12.2183 5.15121 11.9594 5.00004 11.666","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,Z5,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,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)}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-format-toolbar-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:.3em;border-radius:var(--velt-border-radius-sm);cursor:pointer;color:var(--velt-text-2);transition:background .15s ease,color .15s ease}.velt-format-toolbar-button[_ngcontent-%COMP%]:hover{background:var(--velt-bg-3);color:var(--velt-text-1)}.velt-format-toolbar-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px;height:16px}[data-active=true][_nghost-%COMP%] .velt-format-toolbar-button[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--velt-accent) 12%,transparent);color:var(--velt-accent)}[data-active=true][_nghost-%COMP%] .velt-format-toolbar-button[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--velt-accent) 18%,transparent)}"],changeDetection:0});let r=o;return r})();function X5(r,o,n){try{r.setAttribute("data-testid",o+"-"+(n||"")),r.setAttribute("role","button"),r.setAttribute("aria-label",`Apply ${n||""} formatting`)}catch{}}var Qf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),Q5=(r,o)=>({condition:r,data:o}),eM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-format-toolbar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function tM(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",3),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.boldActive())}}function rM(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",4),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.italicActive())}}function nM(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",5),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.underlineActive())}}function oM(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",6),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.strikethroughActive())}}function aM(r,o){if(r&1&&(u(0),y(1,tM,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",3),y(2,rM,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",4),y(3,nM,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",5),y(4,oM,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",6),p()),r&2){let n=l(4);d(),w(n.boldEnabled()?1:-1),d(),w(n.italicEnabled()?2:-1),d(),w(n.underlineEnabled()?3:-1),d(),w(n.strikethroughEnabled()?4:-1)}}function iM(r,o){if(r&1){let n=J();u(0),b(1,"div",1),A(2,"translate"),H("mousedown",function(t){return B(n),V(t.preventDefault())})("click",function(t){B(n);let a=l(3);return V(a.handleToolbarClick(t))}),s(3,aM,5,4,"ng-container",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId)("aria-label",R(2,3,"Text formatting options")),d(2),v("veltDynamicTemplate",O(8,eM,e.template,C(5,Qf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function lM(r,o){if(r&1&&s(0,iM,4,14,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,Q5,n.conditionSignal(),C(1,Qf,n.componentConfigSignal,n.localUIStateSignal)))}}function dM(r,o){if(r&1&&y(0,lM,1,7,"ng-container"),r&2){let n=l();w(n.isVisible()?0:-1)}}var Ta=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-composer-format-toolbar-internal",this.editMode=q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true"||e==="1":e}catch{return!1}}}),this.selectionChangeHandler=null,this.formatAppliedHandler=null,this.isVisible=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();return e?.uiState?.formatToolbarOpen===!0&&e?.featureState?.enableFormatOptions===!0}catch(e){return this.loggingService.catch("Error in isVisible:",e),!1}}),this.formatConfig=L(()=>{try{return this.componentConfigSignal()?.featureState?.formatConfig||null}catch(e){return this.loggingService.catch("Error in formatConfig:",e),null}}),this.boldEnabled=L(()=>this.isFormatEnabledByConfig("bold")),this.italicEnabled=L(()=>this.isFormatEnabledByConfig("italic")),this.underlineEnabled=L(()=>this.isFormatEnabledByConfig("underline")),this.strikethroughEnabled=L(()=>this.isFormatEnabledByConfig("strikethrough")),this.boldActive=Fe(!1),this.italicActive=Fe(!1),this.underlineActive=Fe(!1),this.strikethroughActive=Fe(!1),this.ngZone=se(eg),yt(()=>{this.isVisible()?this.startSelectionChangeListener():this.stopSelectionChangeListener()})}ngOnInit(){super.ngOnInit(),this.setupFormatAppliedListener()}ngOnDestroy(){super.ngOnDestroy(),this.cleanupEventListeners()}startSelectionChangeListener(){try{if(this.selectionChangeHandler)return;this.selectionChangeHandler=()=>{this.ngZone.run(()=>{this.refreshActiveStates()})},document.addEventListener("selectionchange",this.selectionChangeHandler),this.refreshActiveStates()}catch(e){this.loggingService.catch("Error in startSelectionChangeListener:",e)}}stopSelectionChangeListener(){try{this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=null)}catch(e){this.loggingService.catch("Error in stopSelectionChangeListener:",e)}}setupFormatAppliedListener(){try{this.formatAppliedHandler=()=>{this.ngZone.run(()=>{this.refreshActiveStates()})},this.hostElementRef.nativeElement.addEventListener("velt-format-applied",this.formatAppliedHandler)}catch(e){this.loggingService.catch("Error in setupFormatAppliedListener:",e)}}cleanupEventListeners(){try{this.stopSelectionChangeListener(),this.formatAppliedHandler&&(this.hostElementRef.nativeElement.removeEventListener("velt-format-applied",this.formatAppliedHandler),this.formatAppliedHandler=null)}catch(e){this.loggingService.catch("Error in cleanupEventListeners:",e)}}setupA11yAttributes(){try{vM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}isFormatEnabledByConfig(e){try{let t=this.formatConfig();if(!t)return!0;let a=t[e];return!(a&&a.enable===!1)}catch(t){return this.loggingService.catch("Error in isFormatEnabledByConfig:",t),!0}}handleToolbarClick(e){try{let t=e.target,a=t.closest("velt-comment-dialog-composer-format-toolbar-button-wireframe"),i=a?null:t.closest("velt-comment-dialog-composer-format-toolbar-button-internal"),c=a||i;if(!c||i)return;let m=c.getAttribute("type");if(!m)return;let h=o.COMMAND_MAP[m];if(!h)return;document.execCommand(h,!1);let _=this.componentConfigSignal(),S=this.editMode()?_?.uiState?.editCommentTextArea?.nativeElement:_?.uiState?.newCommentTextArea?.nativeElement;S&&S.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.refreshActiveStates()}catch(t){this.loggingService.catch("Error in handleToolbarClick:",t)}}refreshActiveStates(){try{this.boldActive.set(document.queryCommandState("bold")),this.italicActive.set(document.queryCommandState("italic")),this.underlineActive.set(document.queryCommandState("underline")),this.strikethroughActive.set(document.queryCommandState("strikeThrough"))}catch{}}};o.COMMAND_MAP={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-format-toolbar-internal"]],inputs:{editMode:[1,"editMode"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","toolbar",1,"velt-format-toolbar",3,"mousedown","click"],[4,"veltDynamicTemplate"],["type","bold",3,"componentConfigSignal","editMode"],["type","italic",3,"componentConfigSignal","editMode"],["type","underline",3,"componentConfigSignal","editMode"],["type","strikethrough",3,"componentConfigSignal","editMode"]],template:function(t,a){if(t&1&&y(0,dM,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[P,F,Da,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);width:100%}[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%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-format-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.2em;padding:.3em .4em;border-radius:var(--velt-border-radius-md);background:var(--velt-bg-2);border:1px solid var(--velt-border);width:100%;box-sizing:border-box}"],changeDetection:0});let r=o;return r})();function vM(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","toolbar"),r.setAttribute("aria-label","Text formatting options")}catch{}}var mM=["newCommentTextArea"],sM=["editCommentTextArea"],gM=["userSelector"],eC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),uM=(r,o)=>({condition:r,data:o}),pM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-input-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function hM(r,o){if(r&1){let n=J();b(0,"velt-autocomplete-panel-internal",10,1),H("userContactOptionSelected",function(t){B(n);let a=l(5);return V(a.onUserContactSelected(t))})("customOptionSelected",function(t){B(n);let a=l(5);return V(a.onCustomOptionSelected(t))})("groupOptionSelected",function(t){B(n);let a=l(5);return V(a.onGroupSelected(t))})("atHereSelected",function(t){B(n);let a=l(5);return V(a.onAtHereSelected(t))})("enterPressed",function(){B(n);let t=l(5);return V(t.onEnterPressInAutocompletePanel())})("autocompleteStateChanged",function(t){B(n);let a=l(5);return V(a.onAutocompleteStateChanged(t))}),x()}if(r&2){l();let n=we(4),e=l(3);v("darkMode",!!(!(e==null||e.uiState==null)&&e.uiState.darkMode))("hideInput",!0)("showAtHere",!0)("metadata",e==null||e.data==null||e.data.annotation==null?null:e.data.annotation.metadata)("autocompletePanelTrigger",n)("type","generic")("autocompletePanelPosition",!(e==null||e.uiState==null)&&e.uiState.bottomSheetMode?"above":"auto")}}function bM(r,o){if(r&1){let n=J();b(0,"div",6),H("click",function(t){B(n);let a=l(3);return!(a==null||a.data==null)&&a.data.annotation,V(t.stopPropagation())}),b(1,"div",7)(2,"div",8,0),H("input",function(t){B(n);let a=l(4);return V(a.onInput(t))})("paste",function(t){B(n);let a=l(4);return V(a.onPaste(t))})("copy",function(t){B(n);let a=l(4);return V(a.stopPropagation(t))})("dragover",function(t){B(n);let a=l(4);return V(a.onDragOver(t))})("dragenter",function(t){B(n);let a=l(4);return V(a.onDragEnter(t))})("drop",function(t){B(n);let a=l(4);return V(a.onDrop(t))})("click",function(){B(n);let t=l(4);return V(t.onCombinedClick())}),x()(),y(5,hM,2,7,"velt-autocomplete-panel-internal",9),x()}if(r&2){let n=l(3),e=l();k("aria-label","New comment composer")("data-testid",e.componentId+"-section"),d(2),v("matAutocompleteDisabled",!(!(n==null||n.featureState==null)&&n.featureState.userMentions)),k("data-testid",e.componentId+"-new-textarea")("placeholder",e.newCommentPlaceholder()),d(3),w(!(n==null||n.featureState==null)&&n.featureState.userMentions?5:-1)}}function fM(r,o){if(r&1){let n=J();b(0,"velt-autocomplete-panel-internal",10,1),H("userContactOptionSelected",function(t){B(n);let a=l(5);return V(a.onUserContactSelected(t))})("customOptionSelected",function(t){B(n);let a=l(5);return V(a.onCustomOptionSelected(t))})("groupOptionSelected",function(t){B(n);let a=l(5);return V(a.onGroupSelected(t))})("atHereSelected",function(t){B(n);let a=l(5);return V(a.onAtHereSelected(t))})("enterPressed",function(){B(n);let t=l(5);return V(t.onEnterPressInAutocompletePanel())})("autocompleteStateChanged",function(t){B(n);let a=l(5);return V(a.onAutocompleteStateChanged(t))}),x()}if(r&2){l();let n=we(4),e=l(3);v("darkMode",!!(!(e==null||e.uiState==null)&&e.uiState.darkMode))("hideInput",!0)("showAtHere",!0)("metadata",e==null||e.data==null||e.data.annotation==null?null:e.data.annotation.metadata)("autocompletePanelTrigger",n)("type","generic")("autocompletePanelPosition",!(e==null||e.uiState==null)&&e.uiState.bottomSheetMode?"above":"auto")}}function CM(r,o){if(r&1){let n=J();b(0,"div",6),H("click",function(t){return B(n),V(t.stopPropagation())}),b(1,"div",7)(2,"div",8,2),H("input",function(t){B(n);let a=l(4);return V(a.onInput(t))})("paste",function(t){B(n);let a=l(4);return V(a.onPaste(t))})("copy",function(t){B(n);let a=l(4);return V(a.stopPropagation(t))})("dragover",function(t){B(n);let a=l(4);return V(a.onDragOver(t))})("dragenter",function(t){B(n);let a=l(4);return V(a.onDragEnter(t))})("drop",function(t){B(n);let a=l(4);return V(a.onDrop(t))})("click",function(){B(n);let t=l(4);return V(t.onInputClick())}),x(),y(5,fM,2,7,"velt-autocomplete-panel-internal",9),x()()}if(r&2){let n=l(3),e=l();k("aria-label","Edit comment composer")("data-testid",e.componentId+"-edit-section"),d(2),v("matAutocompleteDisabled",!(!(n==null||n.featureState==null)&&n.featureState.userMentions)),k("data-testid",e.componentId+"-edit-textarea")("placeholder",e.editCommentPlaceholder()),d(3),w(!(n==null||n.featureState==null)&&n.featureState.userMentions?5:-1)}}function kM(r,o){if(r&1&&(u(0),y(1,bM,6,6,"div",5),y(2,CM,6,6,"div",5),p()),r&2){let n=l(3);d(),w(!n.editMode()&&!n.isRecordingActive()?1:-1),d(),w(n.editMode()&&n.commentObj()&&!n.isRecordingActive()?2:-1)}}function xM(r,o){if(r&1&&(u(0),s(1,kM,3,2,"ng-container",4),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,pM,e.template,C(1,eC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function _M(r,o){if(r&1&&s(0,xM,2,10,"ng-container",3),r&2){let n=l();v("veltIf",C(4,uM,n.conditionSignal(),C(1,eC,n.componentConfigSignal,n.localUIStateSignal)))}}var Oa=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-composer-input-internal",this.isRecordingActive=L(()=>{try{let e=this.componentConfigSignal(),t=e?.uiState?.recorderInitConfig;if(!t)return!1;let a=this.localUIStateSignal()?.dialogInstanceId;return t.panelId===a||t.commentAnnotationId===e?.data?.annotation?.annotationId}catch(e){return this.loggingService.catch("Error in isRecordingActive:",e),!1}}),this.hasPrefilledEditTextarea=!1,this.lastEditCommentId=void 0,this.editMode=q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true":e}catch{return!1}}}),this.commentObj=q(void 0,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return}}}),this.commentIndex=q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.placeholder=q(void 0,{transform:e=>{try{return e}catch{return}}}),this.commentplaceholder=q(void 0,{transform:e=>{try{return e}catch{return}}}),this.replyplaceholder=q(void 0,{transform:e=>{try{return e}catch{return}}}),this.editplaceholder=q(void 0,{transform:e=>{try{return e}catch{return}}}),this.editcommentplaceholder=q(void 0,{transform:e=>{try{return e}catch{return}}}),this.editreplyplaceholder=q(void 0,{transform:e=>{try{return e}catch{return}}}),this.newCommentTextArea=Tn("newCommentTextArea"),this.editCommentTextArea=Tn("editCommentTextArea"),this.userSelector=Tn("userSelector"),this.activeTextArea=L(()=>{try{return this.editMode()?this.editCommentTextArea():this.newCommentTextArea()}catch(e){return this.loggingService.catch("Error in activeTextArea computed:",e),null}}),this.newCommentPlaceholder=L(()=>{try{return this.coreService.computeNewCommentPlaceholder(this.componentConfigSignal(),this.placeholder(),this.replyplaceholder(),this.commentplaceholder())}catch(e){return this.loggingService.catch("Error in newCommentPlaceholder computed:",e),"Write a comment..."}}),this.editCommentPlaceholder=L(()=>{try{return wM(this.coreService,this.componentConfigSignal(),this.placeholder(),this.editplaceholder(),this.editcommentplaceholder(),this.editreplyplaceholder(),this.commentIndex())}catch(e){return this.loggingService.catch("Error in editCommentPlaceholder computed:",e),"Edit comment..."}}),this.isAutocompleteOpen=L(()=>{try{let e=this.userSelector();return e?.trigger?.panelOpen||e?.matAutocompleteTrigger?.panelOpen||!1}catch(e){return this.loggingService.catch("Error in isAutocompleteOpen computed:",e),!1}}),this.allowKeydown=!0,this.domService=se(Ne),this.commentActionsService=se(vt),this.deviceInfo=new fg,this.lastValidAbsoluteOffset=-1,this.oldText="",this.newText="",this.wordIndex=-1,yt(()=>{let e=this.getAnnotationId(),t=this.newCommentTextArea(),a=this.editCommentTextArea();this.editMode(),e&&(t||a)&&(this.setupTextAreaTimeout&&clearTimeout(this.setupTextAreaTimeout),this.setupTextAreaTimeout=setTimeout(()=>{this.setupTextAreaReferences(e)}))}),yt(()=>{let e=this.editMode(),t=this.localUIStateSignal()?.editComment,a=this.editCommentTextArea();if(e&&t&&a?.nativeElement){let i=t.commentId;this.lastEditCommentId!==i&&(this.hasPrefilledEditTextarea=!1,this.lastEditCommentId=i),this.hasPrefilledEditTextarea||(this.prefillEditTimeout&&clearTimeout(this.prefillEditTimeout),this.prefillEditTimeout=setTimeout(()=>{let c=a.nativeElement;if(!c.innerHTML||c.innerHTML===""||c.innerText.trim()===""){let m=this.localUIStateSignal()?.composerContentHTML,h=this.localUIStateSignal()?.composerContent,_=yM(m,h,t.commentHtml,t.commentText);c.innerHTML=_,this.setCursorToEndOfContenteditable(c)}this.hasPrefilledEditTextarea=!0},50))}else e||(this.hasPrefilledEditTextarea=!1,this.lastEditCommentId=void 0)}),yt(()=>{if(this.localUIStateSignal()?.composerContent===""&&!this.editMode()){let t=this.newCommentTextArea();t?.nativeElement&&(t.nativeElement.innerText||"").trim()!==""&&(t.nativeElement.innerHTML="")}}),yt(()=>{if(!this.isLocalUIStateOwner||this.editMode())return;let e=this.getAnnotationId();if(!e)return;!this.coreService.getOrCreateComposerDraft(e)()?.composerContent&&(this.localUIStateSignal()?.composerContent??"")!==""&&this.localUIStateSignal.update(a=>f(g({},a),{composerContent:"",composerContentHTML:""}))})}setCursorToEndOfContenteditable(e){try{if(!e||!e.isConnected)return;let t=document.createRange(),a=window.getSelection();t.selectNodeContents(e),t.collapse(!1),a?.removeAllRanges(),a?.addRange(t),e.focus()}catch(t){this.loggingService.catch("Error in setCursorToEndOfContenteditable:",t)}}autoScrollToBottom(e){try{if(e&&e.isConnected){let t=e.closest(".velt-composer-input");if(t){let a=t.offsetHeight;t.scrollHeight>t.clientHeight&&(t.scrollTop=t.scrollHeight,requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight}))}}}catch(t){this.loggingService.catch("Error in autoScrollToBottom:",t)}}getSelectionFromContext(e){try{let t=null;try{if(e.getRootNode()instanceof ShadowRoot){let a=e.getRootNode();a.getSelection?t=a.getSelection():this.hostElementRef?.nativeElement?.shadowRoot?.getSelection&&(t=this.hostElementRef.nativeElement.shadowRoot.getSelection())}}catch{}return t||window.getSelection()}catch(t){return this.loggingService.catch("Error in getSelectionFromContext:",t),window.getSelection()}}ngOnInit(){try{super.ngOnInit()}catch(e){this.loggingService.catch("Error in CommentDialogComposerInputComponent ngOnInit:",e)}}ngOnDestroy(){try{this.setupTextAreaTimeout&&clearTimeout(this.setupTextAreaTimeout),this.prefillEditTimeout&&clearTimeout(this.prefillEditTimeout),this.overlayPositionTimeout&&clearTimeout(this.overlayPositionTimeout),super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentDialogComposerInputComponent ngOnDestroy:",e)}}setupTextAreaReferences(e){try{let t=this.newCommentTextArea(),a=this.editCommentTextArea();if(!IM(t,a))return;let i=this.coreService.getContextConfig(e);if(!i)return;i.update(c=>{let m=f(g({},c.uiState),{onAtClick:h=>this.actionService.onAtClick(e,h,this.localUIStateSignal()?.dialogInstanceId),onAttachmentButtonClick:()=>this.actionService.onAttachmentButtonClick(e)});return t&&(m.newCommentTextArea=t),a&&(m.editCommentTextArea=a),f(g({},c),{uiState:m})})}catch(t){this.loggingService.catch("Error in setupTextAreaReferences:",t)}}setupA11yAttributes(){try{SM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}handleKeyDown(e){try{if(this.isAutocompleteOpen())return;switch(e.code!=="Escape"&&e.stopPropagation(),e.key){case"Enter":this.handleEnterKey(e);break;case"Escape":this.handleEscapeKey(e);break;case"Backspace":case"Delete":this.handleDeleteKey(e);break}}catch(t){this.loggingService.catch("Error in handleKeyDown:",t)}}handleKeyUp(e){try{if(e.code!=="Escape"&&e.stopPropagation(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=this.activeTextArea()?.nativeElement;t&&this.updateCursorOffset(t)}}catch(t){this.loggingService.catch("Error in handleKeyUp:",t)}}handleEnterKey(e){try{if(!this.allowKeydown){this.allowKeydown=!0;return}let t=this.componentConfigSignal();if(!t)return;t.featureState?.enterKeyToSubmit?e.shiftKey||e.metaKey||(e.preventDefault(),this.submitComment(e)):(e.shiftKey||e.metaKey)&&(e.preventDefault(),this.submitComment(e))}catch(t){this.loggingService.catch("Error in handleEnterKey:",t)}}submitComment(e){try{let t=this.getAnnotationId(),a=e.target,i=a.innerText||"",c=a.innerHTML||"";if(t)if(this.editMode()){let m=this.commentIndex();m!==void 0&&(this.actionService.updateComment(t,m,this.localUIStateSignal()?.dialogInstanceId),a.innerHTML="")}else this.actionService.addComment(t,!1,this.localUIStateSignal()?.dialogInstanceId),a.innerHTML="";else{if(!i.trim())return;let m=this.componentConfigSignal();if(m){let h={commentText:i,commentHtml:c,user:m.appState?.user,taggedUserContacts:m.data?.taggedUserContacts||[],selectedFiles:this.localUIStateSignal()?.selectedFiles||[],localRecordedData:this.localUIStateSignal()?.localRecordedData||[]},_=this.componentConfigSignal;_&&typeof _.update=="function"&&_.update(I=>f(g({},I),{uiState:f(g({},I.uiState),{pendingSaveComment:h})})),this.localUIStateSignal.update(I=>f(g({},I),{composerContent:"",composerContentHTML:"",composerInOpenState:!1})),a.innerHTML=""}}}catch(t){this.loggingService.catch("Error in submitComment:",t)}}handleEscapeKey(e){try{let t=this.userSelector();if(t?.trigger?.panelOpen||t?.matAutocompleteTrigger?.panelOpen){t?.closePanel();let i=e.target;if(i&&i.hasAttribute("contenteditable")){let c=["@","#","$"];if(Io(i,c)){let h=window.getSelection();if(h&&h.rangeCount>0){let _=h.getRangeAt(0),I=_.startOffset,S=_.commonAncestorContainer?.textContent||"",z=-1;for(let $ of c){let G=S.lastIndexOf($,I);G>z&&(z=G)}z!==-1&&t&&t.disableAutocompleteAtPosition(z)}}}e.preventDefault(),e.stopPropagation();return}if(this.editMode()){let i=this.getAnnotationId();if(i){let c=this.localUIStateSignal()?.editComment?.commentId;c&&this.actionService.clearEditDraftFromSession(i,c),this.actionService.cancelEdit(i,this.localUIStateSignal()?.dialogInstanceId)}e.preventDefault(),e.stopPropagation();return}}catch(t){this.loggingService.catch("Error in handleEscapeKey:",t)}}handleDeleteKey(e){try{let t=this.activeTextArea()?.nativeElement;if(!t)return;if(!(t.innerText||"")&&this.componentConfigSignal()?.featureState?.deleteOnBackspace){let c=this.getAnnotationId();c&&this.actionService.deleteAnnotation(c,e.key==="Backspace"?"keydownBackspace":"keydownDelete")}}catch(t){this.loggingService.catch("Error in handleDeleteKey:",t)}}handleFocusIn(e){try{let t=this.newCommentTextArea(),a=this.editCommentTextArea();if(t&&t.nativeElement.contains(e.target)||a&&a.nativeElement.contains(e.target)){let i=this.getAnnotationId();if(i){let m=this.coreService.getContextConfig(i);if(m){m.update(h=>f(g({},h),{uiState:f(g({},h.uiState),{isInputFocused:!0})}));return}}let c=this.componentConfigSignal;c&&typeof c.update=="function"&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{isInputFocused:!0})}))}}catch(t){this.loggingService.catch("Error in handleFocusIn:",t)}}handleFocusOut(e){try{let t=this.newCommentTextArea(),a=this.editCommentTextArea();if(t&&t.nativeElement.contains(e.target)||a&&a.nativeElement.contains(e.target)){let i=this.getAnnotationId();if(i){let m=this.coreService.getContextConfig(i);if(m){m.update(h=>f(g({},h),{uiState:f(g({},h.uiState),{isInputFocused:!1})}));return}}let c=this.componentConfigSignal;c&&typeof c.update=="function"&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{isInputFocused:!1})}))}}catch(t){this.loggingService.catch("Error in handleFocusOut:",t)}}onInput(e){try{e instanceof InputEvent&&this.actionService.handleBackspaceOnMentionSpan(e);let t=e.target,a=t.innerHTML,i=t.innerText;(!i||!i.trim())&&(t.innerHTML="",a="",i="");let c=this.getAnnotationId();c?this.coreService.getContextConfig(c)?(this.localUIStateSignal.update(h=>f(g({},h),{composerContent:i,composerContentHTML:a,composerInOpenState:!0})),this.isLocalUIStateOwner&&!this.editMode()&&this.coreService.getOrCreateComposerDraft(c).update(h=>f(g({},h),{composerContent:i,composerContentHTML:a})),this.actionService.checkTaggedUserContacts(c,i),this.actionService.extractContacts(c,i),this.actionService.detectEmailAfterAt(c,e,i,t,this.localUIStateSignal()?.dialogInstanceId),this.actionService.checkGetAnnotationDraftAttribute(c,this.localUIStateSignal()?.dialogInstanceId),this.editMode()&&this.actionService.saveEditDraftToSession(c,this.localUIStateSignal()?.dialogInstanceId)):this.localUIStateSignal.update(h=>f(g({},h),{composerContent:i,composerContentHTML:a,composerInOpenState:!0})):this.localUIStateSignal.update(m=>f(g({},m),{composerContent:i,composerContentHTML:a,composerInOpenState:!0}))}catch(t){this.loggingService.catch("Error in onInput:",t)}try{this.componentConfigSignal()?.featureState?.userMentions&&this.handleAutocompleteInput(e)}catch(t){this.loggingService.catch("Error in onInput autocomplete handling:",t)}}onPaste(e){try{let t=this.getAnnotationId();if(t){let i=this.coreService.getContextConfig(t);if(i){let c=i(),m=this.localUIStateSignal()?.composerInOpenState;(!c.uiState?.showCommentButtons||!m)&&(i.update(h=>f(g({},h),{uiState:f(g({},h.uiState),{showCommentButtons:!0})})),this.localUIStateSignal.update(h=>f(g({},h),{composerInOpenState:!0})),this.overlayPositionTimeout&&clearTimeout(this.overlayPositionTimeout),this.overlayPositionTimeout=setTimeout(()=>{let h=this.coreService.getContextConfig(t);h&&h()?.uiState?.updateOverlayPositionEmit?.()},300))}}let a=e.clipboardData?.items;if(a){let i=[];for(let c=0;c<a.length;c++){let m=a[c];if(m.type.indexOf("image")===0){let h=m.getAsFile();if(h){let _=zt(),I=new File([h],`${_}.png`,{type:h.type});i.push(I)}}}if(i.length>0){t&&this.actionService.addFiles(t,i,this.localUIStateSignal()?.dialogInstanceId),e.preventDefault();return}}if(e?.clipboardData){let i=e.clipboardData.getData("text/plain"),c=e.clipboardData.getData("text/html");if(!i&&!c)return;e.preventDefault();let m=null;if(this.editMode()?m=this.editCommentTextArea()?.nativeElement||null:m=this.newCommentTextArea()?.nativeElement||null,m){let h=this.getSelectionFromContext(m);if(h&&h.rangeCount>0){let _=h.getRangeAt(0);m.contains(_.commonAncestorContainer)||(_=document.createRange(),_.selectNodeContents(m),_.collapse(!1));let I=i?X.REGEX_URL.test(i.trim()):!1,S=_.toString().trim();if(I&&S&&S.length>0){let z=document.createElement("a");z.className="velt-comment-dialog--comment-link",z.target="_blank",z.rel="noopener noreferrer";let $=i?.trim()||"",G=$.match(/^[a-zA-Z][a-zA-Z\d+\-.]*:/)?$:`https://${$}`;z.href=G,z.textContent=S,_.deleteContents(),_.insertNode(z),_.setStartAfter(z),_.setEndAfter(z)}else if(c){let z=this.domService.sanitizeHtmlForPaste(c);if(z){_.deleteContents();let $=document.createElement("div");$.innerHTML=z;let G=document.createDocumentFragment(),Z=null;for(;$.firstChild;)Z=G.appendChild($.firstChild);_.insertNode(G),Z&&(_.setStartAfter(Z),_.collapse(!0))}else this.insertPlainText(_,i||"")}else this.insertPlainText(_,i||"");h.removeAllRanges(),h.addRange(_),this.localUIStateSignal.update(z=>f(g({},z),{composerContent:m.innerText,composerContentHTML:this.domService.sanitizeHtml(m.innerHTML)})),setTimeout(()=>{this.autoScrollToBottom(m)},50)}t&&this.actionService.checkGetAnnotationDraftAttribute(t,this.localUIStateSignal()?.dialogInstanceId)}}}catch(t){this.loggingService.catch("Error in onPaste:",t)}}insertPlainText(e,t){try{let a=this.domService.sanitizeHtml(t).replace(/&#10;/g,`
4
4
  `).replace(/&nbsp;/g," ");e.deleteContents();let i=a.split(`