@veltdev/sdk 4.7.11 → 4.7.13
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/package.json +2 -2
- package/velt.js +2 -2
package/velt.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var SNIPPYLY_VERSION = '4.7.
|
|
1
|
+
var SNIPPYLY_VERSION = '4.7.13';
|
|
2
2
|
(function(c,E){"use strict";function U(){var e=X.splice(0,X.length);for(ue=0;e.length;)e.shift().call(null,e.shift())}function fe(e,t){for(var n=0,r=e.length;n<r;n++)Le(e[n],t)}function ot(e){for(var t,n=0,r=e.length;n<r;n++)t=e[n],_(t,B[pe(t)])}function de(e){return function(t){Lt(t)&&(Le(t,e),L.length&&fe(t.querySelectorAll(L),e))}}function pe(e){var t=ae.call(e,"is"),n=e.nodeName.toUpperCase(),r=H.call(D,t?J+t.toUpperCase():q+n);return t&&-1<r&&!Ie(n,t)?-1:r}function Ie(e,t){return-1<L.indexOf(e+'[is="'+t+'"]')}function Fe(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,o=e.target,l=e[Y]||2,a=e[ge]||3;!se||o&&o!==t||!t[C]||r==="style"||e.prevValue===e.newValue&&(e.newValue!==""||n!==l&&n!==a)||t[C](r,n===l?null:e.prevValue,n===a?null:e.newValue)}function Se(e){var t=de(e);return function(n){X.push(t,n.target),ue&&clearTimeout(ue),ue=setTimeout(U,1)}}function he(e){rt&&(rt=!1,e.currentTarget.removeEventListener(Ze,he)),L.length&&fe((e.target||u).querySelectorAll(L),e.detail===v?v:y),R&&at()}function lt(e,t){var n=this;Je.call(n,e,t),Ee.call(n,{target:n})}function Pe(e,t,n){var r=t.apply(e,n),o=pe(r);return-1<o&&_(r,B[o]),n.pop()&&L.length&&ot(r.querySelectorAll(L)),r}function Te(e,t){Tt(e,t),Q?Q.observe(e,gt):(ce&&(e.setAttribute=lt,e[g]=ve(e),e[b](st,Ee)),e[b](N,Fe)),e[x]&&se&&(e.created=!0,e[x](),e.created=!1)}function at(){for(var e,t=0,n=z.length;t<n;t++)e=z[t],P.contains(e)||(n--,z.splice(t--,1),Le(e,v))}function Ve(e){throw new Error("A "+e+" type is already registered")}function Le(e,t){var n,r,o=pe(e);-1<o&&!Mt.call(e,"TEMPLATE")&&(W(e,B[o]),o=0,t!==y||e[y]?t!==v||e[v]||(e[y]=!1,e[v]=!0,r="disconnected",o=1):(e[v]=!1,e[y]=!0,r="connected",o=1,R&&H.call(z,e)<0&&z.push(e)),o&&(n=e[t+O]||e[r+O])&&n.call(e))}function K(){}function Re(e,t,n){var r=n&&n[k]||"",o=t.prototype,l=we(o),a=t.observedAttributes||Ce,m={prototype:l};le(l,x,{value:function(){if(ne)ne=!1;else if(!this[j]){this[j]=!0,new t(this),o[x]&&o[x].call(this);var i=G[re.get(t)];(!Z||i.create.length>1)&&ke(this)}}}),le(l,C,{value:function(i){-1<H.call(a,i)&&o[C]&&o[C].apply(this,arguments)}}),o[Be]&&le(l,ut,{value:o[Be]}),o[je]&&le(l,ct,{value:o[je]}),r&&(m[k]=r),e=e.toUpperCase(),G[e]={constructor:t,create:r?[r,oe(e)]:[e]},re.set(t,e),u[S](e.toLowerCase(),m),Me(e),V[e].r()}function Ue(e){var t=G[e.toUpperCase()];return t&&t.constructor}function _e(e){return typeof e=="string"?e:e&&e.is||""}function ke(e){for(var t,n=e[C],r=n?e.attributes:Ce,o=r.length;o--;)t=r[o],n.call(e,t.name||t.nodeName,null,t.value||t.nodeValue)}function Me(e){return e=e.toUpperCase(),e in V||(V[e]={},V[e].p=new $e(function(t){V[e].r=t})),V[e].p}function xe(){w&&delete c.customElements,I(c,"customElements",{configurable:!0,value:new K}),I(c,"CustomElementRegistry",{configurable:!0,value:K});for(var e=it.get(/^HTML[A-Z]*[a-z]/),t=e.length;t--;(function(n){var r=c[n];if(r){c[n]=function(o){var l,a;return o||(o=this),o[j]||(ne=!0,l=G[re.get(o.constructor)],a=Z&&l.create.length===1,o=a?Reflect.construct(r,Ce,l.constructor):u.createElement.apply(u,l.create),o[j]=!0,ne=!1,a||ke(o)),o},c[n].prototype=r.prototype;try{r.prototype.constructor=c[n]}catch{pt=!0,I(r,j,{value:c[n]})}}})(e[t]));u.createElement=function(n,r){var o=_e(r);return o?Oe.call(this,n,oe(o)):Oe.call(this,n)},tt||(Ne=!0,u[S](""))}var u=c.document,T=c.Object,it=(function(e){var t,n,r,o,l=/^[A-Z]+[a-z]/,a=function(d){var f,h=[];for(f in i)d.test(f)&&h.push(f);return h},m=function(d,f){(f=f.toLowerCase())in i||(i[d]=(i[d]||[]).concat(f),i[f]=i[f.toUpperCase()]=d)},i=(T.create||T)(null),s={};for(n in e)for(o in e[n])for(r=e[n][o],i[o]=r,t=0;t<r.length;t++)i[r[t].toLowerCase()]=i[r[t].toUpperCase()]=o;return s.get=function(d){return typeof d=="string"?i[d]||(l.test(d)?[]:""):a(d)},s.set=function(d,f){return l.test(d)?m(d,f):m(f,d),s},s})({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}});typeof E!="object"&&(E={type:E||"auto"});var X,Ee,$,ve,Q,He,W,_,A,S="registerElement",qe=1e5*c.Math.random()>>0,g="__"+S+qe,b="addEventListener",y="attached",O="Callback",v="detached",k="extends",C="attributeChanged"+O,ut=y+O,Be="connected"+O,je="disconnected"+O,x="created"+O,ct=v+O,Y="ADDITION",ge="REMOVAL",N="DOMAttrModified",Ze="DOMContentLoaded",st="DOMSubtreeModified",q="<",J="=",mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ft=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],D=[],B=[],L="",P=u.documentElement,H=D.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},be=T.prototype,ye=be.hasOwnProperty,ee=be.isPrototypeOf,I=T.defineProperty,Ce=[],te=T.getOwnPropertyDescriptor,Ge=T.getOwnPropertyNames,dt=T.getPrototypeOf,ze=T.setPrototypeOf,Ke=!!T.__proto__,pt=!1,j="__dreCEv1",w=c.customElements,Z=!/^force/.test(E.type)&&!!(w&&w.define&&w.get&&w.whenDefined),Xe=T.create||T,ht=c.Map||function(){var e,t=[],n=[];return{get:function(r){return n[H.call(t,r)]},set:function(r,o){e=H.call(t,r),e<0?n[t.push(r)-1]=o:n[e]=o}}},$e=c.Promise||function(e){function t(l){for(r=!0;n.length;)n.shift()(l)}var n=[],r=!1,o={catch:function(){return o},then:function(l){return n.push(l),r&&setTimeout(t,1),o}};return e(t),o},ne=!1,G=Xe(null),V=Xe(null),re=new ht,oe=function(e){return e.toLowerCase()},we=T.create||function e(t){return t?(e.prototype=t,new e):this},Tt=ze||(Ke?function(e,t){return e.__proto__=t,e}:Ge&&te?(function(){function e(t,n){for(var r,o=Ge(n),l=0,a=o.length;l<a;l++)r=o[l],ye.call(t,r)||I(t,r,te(n,r))}return function(t,n){do e(t,n);while((n=dt(n))&&!ee.call(n,t));return t}})():function(e,t){for(var n in t)e[n]=t[n];return e}),F=c.MutationObserver||c.WebKitMutationObserver,Qe=c.HTMLAnchorElement,p=(c.HTMLElement||c.Element||c.Node).prototype,R=!ee.call(p,P),le=R?function(e,t,n){return e[t]=n.value,e}:I,Lt=R?function(e){return e.nodeType===1}:function(e){return ee.call(p,e)},z=R&&[],We=p.attachShadow,Ye=p.cloneNode,Mt=p.closest||function(e){for(var t=this;t&&t.nodeName!==e;)t=t.parentNode;return t},Ae=p.dispatchEvent,ae=p.getAttribute,Et=p.hasAttribute,vt=p.removeAttribute,Je=p.setAttribute,ie=u.createElement,Ht=u.importNode,Oe=ie,gt=F&&{attributes:!0,characterData:!0,attributeOldValue:!0},et=F||function(e){ce=!1,P.removeEventListener(N,et)},ue=0,tt=S in u&&!/^force-all/.test(E.type),nt=!0,Ne=!1,ce=!0,rt=!0,se=!0;if(F&&(A=u.createElement("div"),A.innerHTML="<div><div></div></div>",new F(function(e,t){if(e[0]&&e[0].type=="childList"&&!e[0].removedNodes[0].childNodes.length){A=te(p,"innerHTML");var n=A&&A.set;n&&I(p,"innerHTML",{set:function(r){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,r)}})}t.disconnect(),A=null}).observe(A,{childList:!0,subtree:!0}),A.innerHTML=""),tt||(ze||Ke?(W=function(e,t){ee.call(t,e)||Te(e,t)},_=Te):(W=function(e,t){e[g]||(e[g]=T(!0),Te(e,t))},_=W),R?(ce=!1,(function(){var e=te(p,b),t=e.value,n=function(l){var a=new CustomEvent(N,{bubbles:!0});a.attrName=l,a.prevValue=ae.call(this,l),a.newValue=null,a[ge]=a.attrChange=2,vt.call(this,l),Ae.call(this,a)},r=function(l,a){var m=Et.call(this,l),i=m&&ae.call(this,l),s=new CustomEvent(N,{bubbles:!0});Je.call(this,l,a),s.attrName=l,s.prevValue=m?i:null,s.newValue=a,m?s.MODIFICATION=s.attrChange=1:s[Y]=s.attrChange=0,Ae.call(this,s)},o=function(l){var a,m=l.currentTarget,i=m[g],s=l.propertyName;i.hasOwnProperty(s)&&(i=i[s],a=new CustomEvent(N,{bubbles:!0}),a.attrName=i.name,a.prevValue=i.value||null,a.newValue=i.value=m[s]||null,a.prevValue==null?a[Y]=a.attrChange=0:a.MODIFICATION=a.attrChange=1,Ae.call(m,a))};e.value=function(l,a,m){l===N&&this[C]&&this.setAttribute!==r&&(this[g]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,l,a,m)},I(p,b,e)})()):F||(P[b](N,et),P.setAttribute(g,1),P.removeAttribute(g),ce&&(Ee=function(e){var t,n,r,o=this;if(o===e.target){t=o[g],o[g]=n=ve(o);for(r in n){if(!(r in t))return $(0,o,r,t[r],n[r],Y);if(n[r]!==t[r])return $(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return $(2,o,r,t[r],n[r],ge)}},$=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,Fe(a)},ve=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l<a;l++)t=o[l],(n=t.name)!=="setAttribute"&&(r[n]=t.value);return r})),u[S]=function(e,t){if(n=e.toUpperCase(),nt&&(nt=!1,F?(Q=(function(i,s){function d(f,h){for(var M=0,me=f.length;M<me;h(f[M++]));}return new F(function(f){for(var h,M,me,De=0,bt=f.length;De<bt;De++)h=f[De],h.type==="childList"?(d(h.addedNodes,i),d(h.removedNodes,s)):(M=h.target,se&&M[C]&&h.attributeName!=="style"&&(me=ae.call(M,h.attributeName))!==h.oldValue&&M[C](h.attributeName,h.oldValue,me))})})(de(y),de(v)),He=function(i){return Q.observe(i,{childList:!0,subtree:!0}),i},He(u),We&&(p.attachShadow=function(){return He(We.apply(this,arguments))})):(X=[],u[b]("DOMNodeInserted",Se(y)),u[b]("DOMNodeRemoved",Se(v))),u[b](Ze,he),u[b]("readystatechange",he),u.importNode=function(i,s){switch(i.nodeType){case 1:return Pe(u,Ht,[i,!!s]);case 11:for(var d=u.createDocumentFragment(),f=i.childNodes,h=f.length,M=0;M<h;M++)d.appendChild(u.importNode(f[M],!!s));return d;default:return Ye.call(i,!!s)}},p.cloneNode=function(i){return Pe(this,Ye,[!!i])}),Ne)return Ne=!1;if(-2<H.call(D,J+n)+H.call(D,q+n)&&Ve(e),!mt.test(n)||-1<H.call(ft,n))throw new Error("The type "+e+" is invalid");var n,r,o=function(){return a?u.createElement(m,n):u.createElement(m)},l=t||be,a=ye.call(l,k),m=a?t[k].toUpperCase():n;return a&&-1<H.call(D,q+m)&&Ve(m),r=D.push((a?J:q)+n)-1,L=L.concat(L.length?",":"",a?m+'[is="'+e.toLowerCase()+'"]':m),o.prototype=B[r]=ye.call(l,"prototype")?l.prototype:we(p),L.length&&fe(u.querySelectorAll(L),y),o},u.createElement=Oe=function(e,t){var n=_e(t),r=n?ie.call(u,e,oe(n)):ie.call(u,e),o=""+e,l=H.call(D,(n?J:q)+(n||o).toUpperCase()),a=-1<l;return n&&(r.setAttribute("is",n=n.toLowerCase()),a&&(a=Ie(o.toUpperCase(),n))),se=!u.createElement.innerHTMLHelper,a&&_(r,B[l]),r}),addEventListener("beforeunload",function(){delete u.createElement,delete u.importNode,delete u[S]},!1),K.prototype={constructor:K,define:Z?function(e,t,n){if(n)Re(e,t,n);else{var r=e.toUpperCase();G[r]={constructor:t,create:[r]},re.set(t,r),w.define(e,t)}}:Re,get:Z?function(e){return w.get(e)||Ue(e)}:Ue,whenDefined:Z?function(e){return $e.race([w.whenDefined(e),Me(e)])}:Me},!w||/^force/.test(E.type))xe();else if(!E.noBuiltIn)try{(function(e,t,n){var r=new RegExp(`^<a\\s+is=('|")`+n+"\\1></a>$");if(t[k]="a",e.prototype=we(Qe.prototype),e.prototype.constructor=e,c.customElements.define(n,e,t),!r.test(u.createElement("a",{is:n}).outerHTML)||!r.test(new e().outerHTML))throw t})(function e(){return Reflect.construct(Qe,[],e)},{},"document-register-element-a"+qe)}catch{xe()}if(!E.noBuiltIn)try{if(ie.call(u,"a","a").outerHTML.indexOf("is")<0)throw{}}catch{oe=function(t){return{is:t.toLowerCase()}}}})(window);Promise.allSettled||(Promise.allSettled=function(c){return Promise.all(c.map(function(E){return Promise.resolve(E).then(function(U){return{status:"fulfilled",value:U}}).catch(function(U){return{status:"rejected",reason:U}})}))});
|
|
3
3
|
|
|
4
4
|
var abe=Object.create;var g4=Object.defineProperty,sbe=Object.defineProperties,lbe=Object.getOwnPropertyDescriptor,cbe=Object.getOwnPropertyDescriptors,dbe=Object.getOwnPropertyNames,p4=Object.getOwnPropertySymbols,fK=Object.getPrototypeOf,B8=Object.prototype.hasOwnProperty,vK=Object.prototype.propertyIsEnumerable,mbe=Reflect.get;var hK=(i,o,n)=>o in i?g4(i,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[o]=n,E=(i,o)=>{for(var n in o||={})B8.call(o,n)&&hK(i,n,o[n]);if(p4)for(var n of p4(o))vK.call(o,n)&&hK(i,n,o[n]);return i},D=(i,o)=>sbe(i,cbe(o));var zu=(i,o)=>{var n={};for(var e in i)B8.call(i,e)&&o.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&p4)for(var e of p4(i))o.indexOf(e)<0&&vK.call(i,e)&&(n[e]=i[e]);return n};var pbe=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),u4=(i,o)=>{for(var n in o)g4(i,n,{get:o[n],enumerable:!0})},gbe=(i,o,n,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of dbe(o))!B8.call(i,t)&&t!==n&&g4(i,t,{get:()=>o[t],enumerable:!(e=lbe(o,t))||e.enumerable});return i};var CK=(i,o,n)=>(n=i!=null?abe(fK(i)):{},gbe(o||!i||!i.__esModule?g4(n,"default",{value:i,enumerable:!0}):n,i));var zp=(i,o,n)=>mbe(fK(i),n,o);var Q=(i,o,n)=>new Promise((e,t)=>{var r=c=>{try{s(n.next(c))}catch(p){t(p)}},a=c=>{try{s(n.throw(c))}catch(p){t(p)}},s=c=>c.done?e(c.value):Promise.resolve(c.value).then(r,a);s((n=n.apply(i,o)).next())});var NY=pbe((x4o,RY)=>{"use strict";var Ot={};Ot.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)};Ot.localCName=Ot.generateIdentifier();Ot.splitLines=function(i){return i.trim().split(`
|
|
@@ -531,7 +531,7 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
531
531
|
`||e.editCommentTextArea?.nativeElement?.innerText&&e.editCommentTextArea.nativeElement.innerText!==`
|
|
532
532
|
`,r=e.selectedAttachments?.length>0||e.attachmentsToDelete?.length>0,a=e.localRecordedData?.length>0||e.recorderInitConfig&&e.recorderInitConfig?.panelId===e.commentDialogUniqueId;return t||r||a}catch(e){return this.catchError("Error in CommentDialogComponent hasComposerContent: ",e),!1}}onPointerOutCommentDialog(e){try{this.componentConfigSignal().commentsContainer?.nativeElement?.contains(e?.relatedTarget)||this.pointerOutFromCommentDialog.next(e)}catch(t){this.catchError("Error in CommentDialogComponent onPointerOutCommentDialog: ",t)}}onPointerUp(){try{this.pointerUp.next()}catch(e){this.catchError("Error in CommentDialogComponent onPointerUp: ",e)}}onMoreRepliesClick(){try{this.analyticsService.trackEvent(Y.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:this.componentConfigSignal().annotation?.annotationId,commentType:this.commentService.getCommentType(this.componentConfigSignal().annotation),uiLocation:this.componentConfigSignal().sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.componentConfigSignal.update(e=>(e=D(E({},e),{showAllComments:!e.showAllComments}),e))}catch(e){this.catchError("Error in CommentDialogComponent onMoreRepliesClick: ",e)}}checkCommentDialogSelected(){try{let e=this.componentConfigSignal().commentPinSelected,t=this.componentConfigSignal().fullExpanded,r=e||t;r!==this.componentConfigSignal().commentDialogSelected&&this.componentConfigSignal.update(a=>(a=D(E({},a),{commentDialogSelected:r}),a)),e||this.componentConfigSignal.update(a=>(a=D(E({},a),{showReplyComposer:!1}),a))}catch(e){this.catchError("Error in CommentDialogComponent checkCommentDialogSelected: ",e)}}checkIsKnownUser(){try{this.componentConfigSignal().user&&!this.componentConfigSignal().user?.isReadOnly&&!this.componentConfigSignal().user?.isAnonymous?this.componentConfigSignal.update(e=>(e=D(E({},e),{isKnownUser:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{isKnownUser:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkIsKnownUser: ",e)}}checkDialogSelectedByKnownUser(){try{this.componentConfigSignal().user&&this.componentConfigSignal().isKnownUser?this.componentConfigSignal.update(e=>(e=D(E({},e),{dialogSelectedByKnownUser:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{dialogSelectedByKnownUser:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkDialogSelectedByKnownUser: ",e)}}checkCanResolveAnnotation(){try{this.componentConfigSignal().annotation&&!this.componentConfigSignal().disabled&&this.componentConfigSignal().enableResolve&&this.componentConfigSignal().dialogSelectedByKnownUser&&this.componentConfigSignal().annotation?.status?.type!=="terminal"&&!this.componentConfigSignal().isPlanExpired?this.componentConfigSignal.update(e=>(e=D(E({},e),{canResolveAnnotation:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{canResolveAnnotation:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkCanResolveAnnotation: ",e)}}checkCanUnresolveAnnotation(){try{this.componentConfigSignal().annotation&&!this.componentConfigSignal().disabled&&this.componentConfigSignal().enableResolve&&this.componentConfigSignal().dialogSelectedByKnownUser&&this.componentConfigSignal().annotation?.status?.type==="terminal"&&!this.componentConfigSignal().isPlanExpired?this.componentConfigSignal.update(e=>(e=D(E({},e),{canUnresolveAnnotation:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{canUnresolveAnnotation:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkCanUnresolveAnnotation: ",e)}}checkGetAnnotationDraftAttribute(){try{this.componentConfigSignal().newCommentTextArea?.nativeElement?.innerText&&this.componentConfigSignal().newCommentTextArea?.nativeElement?.innerText!==`
|
|
533
533
|
`||this.componentConfigSignal().editCommentTextArea?.nativeElement?.innerText&&this.componentConfigSignal().editCommentTextArea?.nativeElement?.innerText!==`
|
|
534
|
-
`||this.componentConfigSignal().selectedAttachments?.length||this.componentConfigSignal().attachmentsToDelete?.length||this.componentConfigSignal().recorderInitConfig&&this.componentConfigSignal().recorderInitConfig?.panelId===this.componentConfigSignal().commentDialogUniqueId||this.componentConfigSignal().localRecordedData?.length?this.componentConfigSignal.update(e=>(e=D(E({},e),{getAnnotationDraftAttribute:e.annotation?.annotationId}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{getAnnotationDraftAttribute:null}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkGetAnnotationDraftAttribute: ",e)}}checkShowGhostCommentMessage(){try{this.componentConfigSignal().ghostComment&&this.componentConfigSignal().enableGhostCommentsMessage&&![this.componentConfigSignal().commentAcceptedStatus?.id,this.componentConfigSignal().commentRejectedStatus?.id].includes(this.componentConfigSignal().annotation?.status?.id)?this.componentConfigSignal.update(e=>(e=D(E({},e),{showGhostCommentMessage:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{showGhostCommentMessage:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkShowGhostCommentMessage: ",e)}}checkShowSuggestionModeActions(){try{this.componentConfigSignal().suggestionMode&&this.componentConfigSignal().dialogSelectedByKnownUser&&this.componentConfigSignal().annotation?.status?.type!=="terminal"&&this.componentConfigSignal().annotation?.comments?.length?this.componentConfigSignal.update(e=>(e=D(E({},e),{showSuggestionModeActions:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{showSuggestionModeActions:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkShowSuggestionModeActions: ",e)}}ngOnDestroy(){super.ngOnDestroy(),this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeLinkClickListeners(),this.veltDynamicComponents.forEach(e=>{e.destroy()}),this.subscriptions.map(e=>{e.unsubscribe()}),this.domService.setRecordingInProgress(this.componentConfigSignal().annotation?.annotationId,!1),this.subscriptions=[],this.componentConfigSignal().recorderInitConfig?.panelId===this.componentConfigSignal().commentDialogUniqueId&&this.recorderService.clearRecording(),this.resizeObserver&&this.componentConfigSignal().commentsContainer?.nativeElement&&this.resizeObserver.unobserve(this.componentConfigSignal().commentsContainer?.nativeElement),clearTimeout(this.escapePressTimeout),this.componentConfigSignal().getAnnotationDraftAttribute&&!this.componentConfigSignal().focusedThreadMode&&this.commentService.getDraftMode()&&!this.componentConfigSignal().editComment&&this.componentConfigSignal().getAnnotationDraftAttribute&&this.addComment(void 0,!0)}catch(e){this.catchError("Error in CommentDialogComponent unsubscribe: ",e)}}closeDialog(){try{this.domService.resetSelectedAnnotationsMap()}catch(e){this.catchError("Error in CommentDialogComponent closeDialog: ",e)}}openDropdownIndex(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{openDropdownIndexValue:e,assignToMenuOpened:!1}),t))}catch(t){this.catchError("Error in CommentDialogComponent openDropdownIndex: ",t)}}navigateToCommentEmit(){try{this.onCommentNavigationButtonClick.emit(this.componentConfigSignal().annotation)}catch(e){this.catchError("Error in CommentDialogComponent navigateToComment: ",e)}}moveCursorToEnd(e){try{if(!e?.isConnected)return;e.focus(),setTimeout(()=>{let t=document.createRange(),r=window.getSelection();t.selectNodeContents(e),t.collapse(!1),r?.removeAllRanges(),r?.addRange(t),setTimeout(()=>{this.autoScrollToBottom(e)},50)},0)}catch(t){this.catchError("Error in CommentDialogComponent moveCursorToEnd: ",t)}}focusOnComposerInput(){try{this.onComposerClick(),this.composerFocused.emit();let e=Ece();this.componentConfigSignal().newCommentTextArea?.nativeElement&&(this.componentConfigSignal().newCommentTextArea.nativeElement?.contains(e)||this.moveCursorToEnd(this.componentConfigSignal().newCommentTextArea.nativeElement)),this.componentConfigSignal().editCommentTextArea?.nativeElement&&(this.componentConfigSignal().editCommentTextArea.nativeElement?.contains(e)||this.moveCursorToEnd(this.componentConfigSignal().editCommentTextArea.nativeElement))}catch(e){this.catchError("Error in CommentDialogComponent focusOnComposerInput: ",e)}}onComposerClick(){try{this.composerFocused.emit(),this.commentActionsService?.onComposerClick({commentAnnotation:this.componentConfigSignal().annotation}),this.componentConfigSignal().commentPinSelected||(this.componentConfigSignal().sidebarMode?this.domService.toggleAnnotationSelection(this.componentConfigSignal().annotation,this.componentConfigSignal().containerComponentId,"sidebarShowReplies"):this.domService.toggleAnnotationSelection(this.componentConfigSignal().annotation,this.componentConfigSignal().containerComponentId))}catch(e){this.catchError("Error in CommentDialogComponent onComposerClick: ",e)}}getCurrentDialogView(){try{let e={};if(this.componentConfigSignal().annotation?.annotationId){let t=this.componentConfigSignal().commentViews?.[this.componentConfigSignal().annotation?.annotationId]?.comments;Object.keys(t||{}).forEach(r=>{let a=[],s=0;Object.keys(t[r]?.views||{}).forEach(c=>{let p={};p.user=this.componentConfigSignal().userContactsBySnippylyId?.[c],p.viewedAt=t[r]?.views?.[c]?.timestamp,p.user?.userId!==this.componentConfigSignal().user?.userId&&p.user?.userId!==this.componentConfigSignal().annotation?.from?.userId&&(a.push(p),(p.user?.email||p.user?.name)&&s++)}),e[r]={count:s,views:a}})}this.componentConfigSignal.update(t=>(t=D(E({},t),{currentDialogView:e}),t))}catch(e){this.catchError("Error in CommentDialogComponent getCurrentDialogView: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}showReplyComposerHandler(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{showReplyComposer:!0}),e)),setTimeout(()=>{this.focusOnComposerInput()},100)}catch(e){this.catchError("Error in CommentDialogComponent showReplyComposerHandler: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(we),h(Un),h(g7),h(Ii),h(Ve),h(In),h(vl),h(z1),h(_),h(Wo),h(xn),h(ur),h(Ps),h(Ke),h(R),h(Yi),h(Ge),h(ot),h(un),h(an),h(sd,8))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-dialog"]],viewQuery:function(t,r){if(t&1&&(it(Jen,5),it(etn,5),it(ttn,5),it(Z1e,7),it(Z1e,5,_i)),t&2){let a;et(a=tt())&&(r.commentsContainer=a.first),et(a=tt())&&(r.newCommentTextArea=a.first),et(a=tt())&&(r.editCommentTextArea=a.first),et(a=tt())&&(r.hostElement=a.first),et(a=tt())&&(r.hostViewContainer=a.first)}},hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{snippylyReadId:"snippylyReadId",screenshotDomain:"screenshotDomain",annotationIndex:"annotationIndex",userContacts:"userContacts",annotation:"annotation",multiThreadAnnotationId:"multiThreadAnnotationId",readOnly:"readOnly",dialogSelection:"dialogSelection",expandOnSelection:"expandOnSelection",user:"user",dialogMode:"dialogMode",sidebarMode:"sidebarMode",fullExpanded:"fullExpanded",inboxMode:"inboxMode",multiThread:"multiThread",inlineCommentMode:"inlineCommentMode",inlineCommentSectionMode:"inlineCommentSectionMode",commentComposerMode:"commentComposerMode",isInsidePdfViewer:"isInsidePdfViewer",locationDisplayName:"locationDisplayName",locationVersion:"locationVersion",commentPinSelected:"commentPinSelected",variant:"variant",shadowDom:"shadowDom",commentPinType:"commentPinType",composerMode:"composerMode",containerComponentId:"containerComponentId",focusedThreadMode:"focusedThreadMode",isFocusedThreadEnabled:"isFocusedThreadEnabled",openAnnotationInFocusMode:"openAnnotationInFocusMode",initialEditCommentIndex:"initialEditCommentIndex",pageModeComposer:"pageModeComposer",composerPosition:"composerPosition",sortBy:"sortBy",sortOrder:"sortOrder",targetElementId:"targetElementId",targetComposerElementId:"targetComposerElementId",context:"context",commentPlaceholder:"commentPlaceholder",replyPlaceholder:"replyPlaceholder",dialogTemplate:"dialogTemplate"},outputs:{deleteCommentThread:"deleteCommentThread",saveComment:"saveComment",addCommentEmitter:"addComment",afterViewInit:"afterViewInit",signInToAccessFeature:"signInToAccessFeature",pointerOutFromCommentDialog:"pointerOutFromCommentDialog",pointerUp:"pointerUp",updateOverlayPosition:"updateOverlayPosition",onCommentNavigationButtonClick:"onCommentNavigationButtonClick",onOpenFocusedThread:"onOpenFocusedThread",onOpenFocusedThreadWithEditMode:"onOpenFocusedThreadWithEditMode",composerFocused:"composerFocused"},standalone:!1,features:[L,Qe],decls:4,vars:68,consts:[["host","","commentsContainer",""],["defaultDialogRef",""],["commentsContainer",""],[1,"modal-div","velt-comment-dialog",3,"click","pointerout","pointerdown","pointerup"],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["part","container","class","modal-div velt-comment-dialog",3,"dialog","velt-comment-dialog--dialog-mode","bottom-sheet","velt-comment-dialog--bottom-sheet","inbox","velt-comment-dialog--inbox-mode","readonly","velt-comment-dialog--readonly","no-comments","velt-comment-dialog--no-comments","selected","velt-comment-dialog--selected","screen-recording","velt-comment-dialog--screen-recording","s-ghost-comment-annotation","velt-comment-dialog--ghost-comment-annotation","inline-comment-mode","velt-comment-dialog--inline-comment-mode","velt-comment-dialog--multi-thread-mode","velt-comment-dialog--page-comment","velt-comment-dialog--inline-comment-section-mode","velt-comment-dialog--comment-composer-mode","velt-comment-dialog--focused-thread-mode","velt-comment-dialog--page-mode-composer","velt-comment-dialog--read-only","private-comment","velt-comment-dialog--private-comment","click","pointerout","pointerdown","pointerup",4,"ngIf"],["part","container","class","modal-div velt-comment-dialog",3,"dialog","velt-comment-dialog--dialog-mode","sidebar","velt-comment-dialog--sidebar-mode","bottom-sheet","velt-comment-dialog--bottom-sheet","readonly","velt-comment-dialog--readonly","no-comments","velt-comment-dialog--no-comments","selected","velt-comment-dialog--selected","screen-recording","velt-comment-dialog--screen-recording","s-ghost-comment-annotation","velt-comment-dialog--focused-thread-mode","velt-comment-dialog--ghost-comment-annotation","velt-comment-dialog--page-mode-composer","velt-comment-dialog--read-only","private-comment","velt-comment-dialog--private-comment","id","click","pointerout","pointerdown","pointerup",4,"ngIf"],["part","container","class","modal-div velt-comment-dialog",3,"dialog","velt-comment-dialog--dialog-mode","bottom-sheet","velt-comment-dialog--bottom-sheet","inbox","velt-comment-dialog--inbox-mode","readonly","velt-comment-dialog--readonly","no-comments","velt-comment-dialog--no-comments","selected","velt-comment-dialog--selected","screen-recording","velt-comment-dialog--screen-recording","s-ghost-comment-annotation","velt-comment-dialog--ghost-comment-annotation","inline-comment-mode","velt-comment-dialog--inline-comment-mode","velt-comment-dialog--multi-thread-mode","velt-comment-dialog--page-comment","velt-comment-dialog--focused-thread-mode","velt-comment-dialog--inline-comment-section-mode","velt-comment-dialog--comment-composer-mode","velt-comment-dialog--page-mode-composer","velt-comment-dialog--read-only","private-comment","velt-comment-dialog--private-comment","click","pointerout","pointerdown","pointerup",4,"ngIf"],["part","container",1,"modal-div","velt-comment-dialog",3,"click","pointerout","pointerdown","pointerup"],[3,"componentConfigSignal"],["class","line-div velt-comment-dialog--line-div",4,"ngIf"],["class","velt-action-bar velt-comment-dialog--action-bar",4,"ngIf"],[1,"line-div","velt-comment-dialog--line-div"],[1,"velt-action-bar","velt-comment-dialog--action-bar"],[3,"componentConfigSignal",4,"ngIf"],["class","velt-comment-dialog--action-bar-group",4,"ngIf"],[1,"velt-comment-dialog--action-bar-group"],["part","container",1,"modal-div","velt-comment-dialog",3,"click","pointerout","pointerdown","pointerup","id"]],template:function(t,r){if(t&1){let a=K();y(0,"div",3,0),G("click",function(){return N(a),F(r.onClick())})("pointerout",function(c){return N(a),r.onPointerOutCommentDialog(c),F(c.stopPropagation())})("pointerdown",function(c){return N(a),F(c.stopPropagation())})("pointerup",function(c){return N(a),r.onPointerUp(),F(c.stopPropagation())}),b(),u(3,Ttn,4,1,"ng-container",4)}if(t&2){let a,s,c,p,g,f,I,x,B,z,W,J,ne,ve,_e,Fe,Be,Ie,be,Ae,ye,he,Oe,Re,Xi,bt,It,yt,Lt,Yt,zt,tn,xi,nn,ti,Ti;pe("sidebar",(a=r.componentConfigSignal())==null?null:a.sidebarMode)("velt-comment-dialog--sidebar-mode",(s=r.componentConfigSignal())==null?null:s.sidebarMode)("dialog",(c=r.componentConfigSignal())==null?null:c.dialogMode)("velt-comment-dialog--dialog-mode",(p=r.componentConfigSignal())==null?null:p.dialogMode)("hide",(g=r.componentConfigSignal())==null?null:g.showDefault)("velt-comment-dialog--hide",(f=r.componentConfigSignal())==null?null:f.showDefault)("bottom-sheet",(I=r.componentConfigSignal())==null?null:I.bottomSheetMode)("velt-comment-dialog--bottom-sheet",(x=r.componentConfigSignal())==null?null:x.bottomSheetMode)("inbox",(B=r.componentConfigSignal())==null?null:B.inboxMode)("velt-comment-dialog--inbox-mode",(z=r.componentConfigSignal())==null?null:z.inboxMode)("readonly",((W=r.componentConfigSignal())==null||W.user==null?null:W.user.isReadOnly)||((W=r.componentConfigSignal())==null||W.user==null?null:W.user.isAnonymous))("velt-comment-dialog--readonly",((J=r.componentConfigSignal())==null||J.user==null?null:J.user.isReadOnly)||((J=r.componentConfigSignal())==null||J.user==null?null:J.user.isAnonymous))("no-comments",!(!((ne=r.componentConfigSignal())==null||ne.annotation==null||ne.annotation.comments==null)&&ne.annotation.comments.length))("velt-comment-dialog--no-comments",!(!((ve=r.componentConfigSignal())==null||ve.annotation==null||ve.annotation.comments==null)&&ve.annotation.comments.length))("selected",(_e=r.componentConfigSignal())==null?null:_e.commentDialogSelected)("velt-comment-dialog--selected",(Fe=r.componentConfigSignal())==null?null:Fe.commentDialogSelected)("screen-recording",((Be=r.componentConfigSignal())==null||Be.recorderInitConfig==null?null:Be.recorderInitConfig.type)==="screen")("velt-comment-dialog--screen-recording",((Ie=r.componentConfigSignal())==null||Ie.recorderInitConfig==null?null:Ie.recorderInitConfig.type)==="screen")("s-ghost-comment-annotation",(be=r.componentConfigSignal())==null?null:be.showGhostCommentMessage)("velt-comment-dialog--ghost-comment-annotation",(Ae=r.componentConfigSignal())==null?null:Ae.showGhostCommentMessage)("velt-comment-dialog--focused-thread-mode",(ye=r.componentConfigSignal())==null?null:ye.focusedThreadMode)("inline-comment-mode",((he=r.componentConfigSignal())==null?null:he.inlineCommentMode)&&!((he=r.componentConfigSignal())!=null&&he.isInsidePdfViewer))("velt-comment-dialog--page-comment",(Oe=r.componentConfigSignal())==null||Oe.annotation==null?null:Oe.annotation.isPageAnnotation)("velt-comment-dialog--inline-comment-mode",((Re=r.componentConfigSignal())==null?null:Re.inlineCommentMode)&&!((Re=r.componentConfigSignal())!=null&&Re.isInsidePdfViewer))("velt-comment-dialog--multi-thread-mode",(Xi=r.componentConfigSignal())==null?null:Xi.multiThread)("velt-comment-dialog--comment-composer-mode",(bt=r.componentConfigSignal())==null?null:bt.commentComposerMode)("velt-comment-dialog--page-mode-composer",(It=r.componentConfigSignal())==null?null:It.pageModeComposer)("velt-comment-dialog--read-only",(yt=r.componentConfigSignal())==null?null:yt.readOnly)("private-comment",(Lt=r.componentConfigSignal())==null?null:Lt.isPrivateComment)("velt-comment-dialog--private-comment",(Yt=r.componentConfigSignal())==null?null:Yt.isPrivateComment),T("data-velt-annotation-draft",(zt=r.componentConfigSignal())==null?null:zt.getAnnotationDraftAttribute)("data-velt-annotation-edit-comment",(tn=r.componentConfigSignal())!=null&&tn.editComment?!0:void 0)("data-velt-comment-dialog-comments-count",((xi=r.componentConfigSignal())==null||xi.annotation==null||xi.annotation.comments==null?null:xi.annotation.comments.length)||"0")("data-velt-comment-dialog-comments-status",(nn=r.componentConfigSignal())==null||nn.annotation==null||nn.annotation.status==null?null:nn.annotation.status.id)("data-velt-comment-dialog-comments-status-type",(ti=r.componentConfigSignal())==null||ti.annotation==null||ti.annotation.status==null?null:ti.annotation.status.type)("data-velt-comment-dialog-comments-priority",(Ti=r.componentConfigSignal())==null||Ti.annotation==null||Ti.annotation.priority==null?null:Ti.annotation.priority.id)("data-testid",r.componentId+"-root"),m(3),d("ngIf",r.componentConfigSignal())}},dependencies:[X,Dt,x_,S_,T_,y_,E_,Nf,C_,w_,__,P_,O_,Sn,R1],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}[_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-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-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)}[type=button][_ngcontent-%COMP%]:not(:disabled), [type=reset][_ngcontent-%COMP%]:not(:disabled), [type=submit][_ngcontent-%COMP%]:not(:disabled), button[_ngcontent-%COMP%]:not(:disabled){cursor:pointer}[_ngcontent-%COMP%]::-webkit-scrollbar{display:none;width:0;height:0}[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}[_ngcontent-%COMP%]::-webkit-scrollbar-button{width:0;height:0} .velt-comment-dialog-thread-card-message--email-chip, .velt-autocomplete--contact-chip, .velt-autocomplete--group-chip{display:block;color:var(--velt-accent-text);background:var(--velt-accent-transparent);border-radius:var(--velt-border-radius-xs);padding:var(--velt-spacing-xs);word-break:break-word;font-size:var(--velt-font-size-sm);font-style:normal;font-weight:400;line-height:120%} .velt-comment-dialog-thread-card-message--email-chip.velt-autocomplete--contact-chip-current-user, .velt-autocomplete--contact-chip.velt-autocomplete--contact-chip-current-user, .velt-autocomplete--group-chip.velt-autocomplete--contact-chip-current-user{background-color:color-mix(in srgb,var(--velt-warning) 12%,transparent);color:color-mix(in srgb,var(--velt-warning) 32%,var(--velt-text-0))} velt-autocomplete-chip velt-skeleton-loader-internal{width:50px;border-radius:var(--velt-border-radius-xs);margin-block:6px} .velt-comment-dialog--here-chip{color:var(--velt-accent-text);background:var(--velt-accent-transparent);border-radius:var(--velt-border-radius-xs);padding:var(--velt-spacing-xs);word-break:break-word} .velt-attachment-tag{color:var(--velt-accent);word-break:break-word;display:inline-block;cursor:pointer} .velt-attachment-tag:hover{color:var(--velt-accent-hover)}.velt-comment-dialog--comment-link[_ngcontent-%COMP%]{color:var(--velt-accent);word-break:break-all;display:unset}.velt-comment-dialog-shake[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_shake .82s cubic-bezier(.36,.07,.19,.97) both}@keyframes _ngcontent-%COMP%_shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}.velt-comment-dialog[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:var(--velt-spacing-lg);border-radius:var(--velt-border-radius-md);box-shadow:0 8px 16px -8px #0f0f0f1a;box-sizing:border-box;width:361px;text-align:left;font-size:var(--velt-font-size-sm);padding:var(--velt-spacing-lg);background-color:var(--velt-background-0);border:1px solid var(--velt-border-4);color:var(--velt-text-3)}.velt-comment-dialog[_ngcontent-%COMP%] .velt-comment-dialog--line-div[_ngcontent-%COMP%]{border-top:1px solid var(--velt-border-4);width:100%}.velt-comment-dialog.velt-comment-dialog--no-comments[_ngcontent-%COMP%]{padding:0;gap:0}.velt-comment-dialog.velt-comment-dialog--multi-thread-mode[_ngcontent-%COMP%]{box-shadow:none;border:0;background-color:transparent}.velt-comment-dialog.velt-comment-dialog--sidebar-mode[_ngcontent-%COMP%]{width:100%;min-width:100%;box-shadow:none;background:transparent;border-color:transparent}.velt-comment-dialog.velt-comment-dialog--sidebar-mode[_ngcontent-%COMP%]:hover, .velt-comment-dialog.velt-comment-dialog--sidebar-mode.velt-comment-dialog--selected[_ngcontent-%COMP%]{background-color:var(--velt-background-0);border-color:var(--velt-border-4)}.velt-comment-dialog.velt-comment-dialog--page-mode-composer[_ngcontent-%COMP%]{width:100%;padding-inline:var(--velt-spacing-lg);box-shadow:none;background:transparent;border-color:transparent}.velt-comment-dialog.velt-comment-dialog--inline-comment-mode[_ngcontent-%COMP%]{padding:0;box-shadow:none;border-color:transparent;background:transparent;width:100%}.velt-comment-dialog.velt-comment-dialog--inline-comment-section-mode[_ngcontent-%COMP%]{width:100%;box-shadow:none}.velt-comment-dialog.velt-comment-dialog--inline-comment-section-mode.no-comments[_ngcontent-%COMP%]{padding:var(--velt-spacing-md) var(--velt-spacing-sm) var(--velt-spacing-md) var(--velt-spacing-lg)}.velt-comment-dialog.velt-comment-dialog--bottom-sheet[_ngcontent-%COMP%]{width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0} .snippyly-comment-rewriter-text{color:var(--velt-black);background-color:color-mix(in srgb,var(--velt-warning) 42%,var(--velt-white))}.velt-comment-dialog--hide[_ngcontent-%COMP%]{display:none}.velt-comment-dialog--action-bar[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-around;padding:var(--velt-spacing-lg);box-sizing:border-box;text-align:center;color:var(--velt-accent-text);gap:var(--velt-spacing-2xl)}.velt-comment-dialog--action-bar[_ngcontent-%COMP%]:empty{display:none}.velt-comment-dialog--action-bar[_ngcontent-%COMP%] .velt-comment-dialog--action-bar-group[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:space-around;width:100%;box-sizing:border-box}.velt-comment-dialog--focused-thread-mode[_ngcontent-%COMP%]{border:none;height:100%}.velt-comment-dialog--focused-thread-mode[_ngcontent-%COMP%] app-comment-dialog-body[_ngcontent-%COMP%]{display:flex;flex-grow:1;min-height:0;width:100%;overflow:scroll}"],changeDetection:0});let i=o;return i})();var a8=(()=>{let o=class o{constructor(e,t,r,a){this.bottomSheet=e,this.domService=t,this.loggingService=r,this.elementRef=a,this.user=new zo,this.isInsidePdfViewer=!1,this.bottomSheetData$=new Ce(null),this.saveComment=new Me,this.veltElement=!0,this.subscriptions=[],this.componentId="velt-comment-bottom-sheet"}ngOnInit(){this.setupA11yAttributes()}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","dialog"),e.setAttribute("aria-label","Comment bottom sheet")}catch(e){this.loggingService.catch("Error in CommentBottomSheetComponent setupA11yAttributes:",e)}}ngAfterViewInit(){this.openBottomSheet(),this.setBottomSheetData()}ngOnChanges(e){try{e?.annotation&&this.setBottomSheetData()}catch(t){this.catchError("Error in CommentBottomSheetComponent ngOnChanges: ",t)}}setBottomSheetData(){try{this.bottomSheetData$.next({annotation:this.annotation,user:this.user,commentPinSelected:!0,isInsidePdfViewer:this.isInsidePdfViewer,multiThreadAnnotationId:this.annotation?.type==="multiThread"?this.annotation.annotationId:null,saveComment:e=>{this.saveComment.emit(e)},dismiss:()=>{this.closeBottomSheet()}})}catch(e){this.catchError("Error in CommentBottomSheetComponent setBottomSheetData: ",e)}}openBottomSheet(){return Q(this,null,function*(){try{this.bottomSheetRef&&(this.bottomSheetRef.dismiss(),this.bottomSheetRef=void 0),this.annotation.type==="multiThread"?(this.bottomSheetRef=this.bottomSheet.open(Rs,{data:this.bottomSheetData$.asObservable(),panelClass:["snippyly-comment-bottom-sheet-container","velt-mat-bottom-sheet-container"]}),this.subscriptions.push(this.bottomSheetRef.backdropClick().subscribe(()=>{this.domService.resetSelectedAnnotationsMap()}))):(this.bottomSheetRef=this.bottomSheet.open(ar,{data:this.bottomSheetData$.asObservable(),panelClass:["snippyly-comment-bottom-sheet-container","velt-mat-bottom-sheet-container"]}),this.subscriptions.push(this.bottomSheetRef.backdropClick().subscribe(()=>{this.domService.resetSelectedAnnotationsMap()})))}catch(e){this.catchError("Error in CommentBottomSheetComponent openBottomSheet: ",e)}})}closeBottomSheet(){try{if(this.bottomSheetRef){let e=this.bottomSheetRef;this.bottomSheetRef=void 0,this.disposeBottomSheetWithoutAnimation(e)}}catch(e){this.catchError("Error in CommentBottomSheetComponent closeBottomSheet: ",e)}}disposeBottomSheetWithoutAnimation(e){try{let r=e._ref?.overlayRef,a=r?.hostElement,s=r?.backdropElement;r?(r.detach(),r.dispose(),a?.parentNode&&a.parentNode.removeChild(a),s?.parentNode&&s.parentNode.removeChild(s)):e.dismiss()}catch(t){this.catchError("Error in CommentBottomSheetComponent disposeBottomSheetWithoutAnimation: ",t);try{e.dismiss()}catch{}}}ngOnDestroy(){try{this.subscriptions.forEach(e=>{e?.unsubscribe()}),this.subscriptions=[],this.closeBottomSheet(),this.bottomSheetData$.complete()}catch(e){this.catchError("Error in CommentBottomSheetComponent ngOnDestroy: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(ld),h(Ve),h(_),h(R))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-bottom-sheet"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{annotation:"annotation",user:"user",isInsidePdfViewer:"isInsidePdfViewer"},outputs:{saveComment:"saveComment"},standalone:!1,features:[Qe],decls:0,vars:0,template:function(t,r){},styles:[".velt-mat-bottom-sheet-container.snippyly-comment-bottom-sheet-container{padding:0!important} .velt-mat-bottom-sheet-container.snippyly-comment-bottom-sheet-container .mat-bottom-sheet-container{padding:0!important}"],changeDetection:0});let i=o;return i})();function wtn(i,o){if(i&1){let n=K();y(0,"div",4),G("pointerup",function(t){return N(n),l(2).togglePinSelection(),F(t.stopPropagation())})("click",function(t){return N(n),F(t.stopPropagation())})("cdkDragStarted",function(){N(n);let t=l(2);return F(t.onPinDragStart())}),y(1,"snippyly-comment-pin",5),G("saveComment",function(t){N(n);let r=l(2);return F(r.saveComment(t))})("commentTargetElementClicked",function(){N(n);let t=l(2);return F(t.togglePinSelection())})("togglePinSelection",function(t){N(n);let r=l(2);return F(r.togglePinSelection(t))}),b()()}if(i&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"),d("id","comment-pin-container-"+(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationId)),T("data-testid",e.componentId+"-popover")("role","button")("aria-expanded",n.commentPinSelected),m(),d("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 Otn(i,o){if(i&1){let n=K();y(0,"div",7),G("pointerup",function(t){return N(n),l(3).togglePinSelection(),F(t.stopPropagation())})("touchend",function(t){return N(n),t.stopPropagation(),F(t.preventDefault())})("mousedown",function(t){return N(n),F(t.stopPropagation())})("touchstart",function(t){return N(n),F(t.stopPropagation())})("pointerdown",function(t){return N(n),F(t.stopPropagation())})("click",function(t){return N(n),F(t.stopPropagation())})("cdkDragStarted",function(){N(n);let t=l(3);return F(t.onPinDragStart())})("cdkDragMoved",function(t){N(n);let r=l(3);return F(r.onPinMove(t))})("cdkDragReleased",function(){N(n);let t=l(3);return F(t.onPinRelease())}),y(1,"snippyly-comment-pin",8,1),G("togglePinSelection",function(t){N(n);let r=l(3);return F(r.togglePinSelection(t))})("saveComment",function(t){N(n);let r=l(3);return F(r.saveComment(t))}),b()()}if(i&2){let n=me(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)+")":""),pe("pin-dragging",e.annotationDragging),d("id","comment-pin-container-"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationId))("cdkDragDisabled",(e.commentPinAnnotation==null||e.commentPinAnnotation.from==null?null:e.commentPinAnnotation.from.userId)!==(e.user==null?null:e.user.userId)),T("data-testid",t.componentId+"-default")("role","button")("aria-expanded",e.commentPinSelected)("aria-grabbed",e.annotationDragging)("data-transform-inside",e.transformContext?"true":"false"),m(),d("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 Atn(i,o){if(i&1&&u(0,Otn,3,24,"div",6),i&2){let n=l().ngIf;d("ngIf",n.commentPinAnnotation==null?null:n.commentPinAnnotation.position)}}function Ptn(i,o){if(i&1&&(v(0),u(1,wtn,2,14,"div",3)(2,Atn,1,1,"ng-template",null,0,Ee),C()),i&2){let n=o.ngIf,e=me(3);m(),d("ngIf",n.popoverMode)("ngIfElse",e)}}var s8=(()=>{let o=class o{constructor(e,t,r,a,s,c,p,g){this.analyticsService=e,this.authService=t,this.docService=r,this.domService=a,this.commentService=s,this.commentActionsService=c,this.loggingService=p,this.elementRef=g,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.objectKeys=Object.keys,this.selectedAnnotationsLocationMap={},this.subscriptions=[],this.componentConfigSignal=Te({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-${vt()}`}),this.veltElement=!0,this.componentId="velt-comment-pin-portal",this.subscriptions.push(this.authService.getUser$().subscribe(f=>{this.componentConfigSignal.update(I=>(I=D(E({},I),{user:f}),I))},f=>{this.catchError("Error in CommentPinPortalComponent getUser$ subscription: ",f)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(f=>{this.componentConfigSignal.update(I=>(I=D(E({},I),{selectedAnnotationsMap:f}),I)),this.checkCommentPinSelected()},f=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsMap$ subscription: ",f)})),this.subscriptions.push(this.domService.getSelectedAnnotationsLocationMap$().subscribe(f=>{this.selectedAnnotationsLocationMap=f||{},this.checkCommentPinSelected()},f=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsLocationMap$ subscription: ",f)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(f=>{this.componentConfigSignal.update(I=>(I=D(E({},I),{popoverMode:f}),I))},f=>{this.catchError("Error in CommentPinPortalComponent getPopoverMode subscription: ",f)}))}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getTransformContext$().subscribe(e=>{this.componentConfigSignal.update(t=>{if(t=D(E({},t),{transformContext:e}),e&&this.isElementInsideTransformContainer(this.elementRef?.nativeElement,e.containerSelector)){let r=e.transforms.scale?1/e.transforms.scale:1;t.pinTransform=`scale(${r})`}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(r){return this.loggingService.catch("Error in CommentPinPortalComponent isElementInsideTransformContainer:",r),!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=D(E({},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=D(E({},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,r=this.componentConfigSignal().sourceId;if(t){let a=!!e[t.annotationId];if(a)if(t?.isDraft)t?.sourceId&&(a=t?.sourceId===r,a&&this.domService.setSelectedAnnotationLocation(t.annotationId,this.componentConfigSignal().componentId));else{let s=this.selectedAnnotationsLocationMap?.[t.annotationId];s&&(a=s===this.componentConfigSignal().componentId)}a!==this.componentConfigSignal().commentPinSelected&&this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinSelected:a}),s))}}catch(e){this.catchError("Error in CommentPinPortalComponent checkCommentPinSelected: ",e)}}setTargetElement(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{targetElement:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setTargetElement: ",t)}}setOffsetLeft(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{offsetLeft:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetLeft: ",t)}}setOffsetTop(e){try{this.componentConfigSignal.update(t=>(t=D(E({},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(a=>{this.catchError("Error in CommentPinPortalComponent togglePinSelection onCommentPinClick: ",a)}),this.componentConfigSignal().selectedAnnotationsMap[t?.annotationId]&&this.selectedAnnotationsLocationMap?.[t?.annotationId]===this.componentConfigSignal().componentId)t?.ghostComment?.type!==Tl.DIFFERENT_DEVICE&&document.querySelector(`[${U.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)&&this.domService.resetSelectedAnnotationsMap(!0,"comments");else{let a=document.querySelector(`[${U.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(a||(a=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),a){let s=a.getAttribute(U.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(s){let c=document.getElementById(`comment-pin-container-${s}`)||document.querySelector(`[data-velt-id='${s}']`);c&&(c.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!==Tl.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,r=this.componentConfigSignal().transformContext,a=this.parentElement.getBoundingClientRect(),s=a.left+t.left,c=a.top+t.top,p=r&&this.isElementInsideTransformContainer(e,r.containerSelector);this.componentConfigSignal.update(g=>(g=D(E({},g),{elementInTransformedContainer:p}),g)),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=`${c}px`,e.style.left=`${s}px`,e.style.zIndex="10000",e.style.transform="none",e.offsetWidth,this.componentConfigSignal.update(g=>(g=D(E({},g),{annotationDragging:!0}),g))}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,r=t?.touches?.length?t.touches[0]?.clientX:t.clientX,a=t?.touches?.length?t.touches[0]?.clientY:t.clientY,s=this.componentConfigSignal().transformContext,c=this.domService.getBackgroundElement(r,a);c&&this.commentService.isElementInsideAllowedElements(c)&&(this.componentConfigSignal.update(p=>(p=D(E({},p),{targetElement:c}),p)),this.domService.highlightElement(this.componentConfigSignal().targetElement),this.pointerMoveEvent=e.event,this.componentConfigSignal.update(p=>(p=D(E({},p),{dragPosition:{top:a,left:r}}),p)))}catch(t){this.catchError("Error in CommentPinPortalComponent updateCurrentPinPosition: ",t)}}onPinRelease(){try{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),r=this.componentConfigSignal().commentPinAnnotation?.targetElement;if(this.pointerMoveEvent){let J=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent,!0,!0,!0,ne=>{if(this.commentService.getSvgAsImg()){let ve=ne?.closest(`[${U.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);ve&&ve instanceof HTMLElement&&(ne=ve)}return ne});J&&(r=J)}let a=this.domService.getElementFromXPath(r?.xpath),s=this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath,c=r?.xpath,p=s===c;if(!a)return;let g=this.componentConfigSignal().dragPosition,f=a.getBoundingClientRect(),I=50,x=50;if(g){let J=g.left-f.left,ne=g.top-f.top;I=J/f.width*100,x=ne/f.height*100,I=Math.max(0,Math.min(100,I)),x=Math.max(0,Math.min(100,x))}let B=E({},this.componentConfigSignal().commentPinAnnotation);B.targetElement=E({},r),B.targetElement.leftPercentage=I,B.targetElement.topPercentage=x,this.commentService.calculateCommentAnnotationPosition(B),this.componentConfigSignal.update(J=>(J=D(E({},J),{commentPinAnnotation:B,targetElement:a}),J));let z=this.domService.isElementInsideAdditionalLocationContainer(t)||this.domService.isElementInsideAdditionalLocationContainer(a),W=this.docService.getAdditionalDocumentIdFromElement(a)||this.docService.getDocumentPaths()?.clientDocumentId;if(!this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId||this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId==W?(this.componentConfigSignal.update(J=>(J=D(E({},J),{commentPinAnnotation:D(E({},J.commentPinAnnotation),{targetElement:r})}),J)),this.commentService.updateComment(this.componentConfigSignal().commentPinAnnotation,z)):this.componentConfigSignal.update(J=>(J=D(E({},J),{targetElement:t}),J)),p){let J=this.componentConfigSignal().transformContext,ne=this.componentConfigSignal().elementInTransformedContainer,ve=J&&this.isElementInsideTransformContainer(a,J.containerSelector);this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{elementInTransformedContainer:ve}),Fe));let _e=e.getBoundingClientRect();if(!ne&&ve){e.style.transition="none";let Fe=_e.top,Be=_e.left;this.parentElement.appendChild(e),e.style.position="fixed",e.style.top=`${Fe}px`,e.style.left=`${Be}px`,e.offsetWidth,requestAnimationFrame(()=>{e.style.position="absolute",ve&&B.position.transformContext?(e.style.top=`${B.position.top}px`,e.style.left=`${B.position.left}px`,B.position.transformContext.scale!==1&&(e.style.transform=`scale(${1/B.position.transformContext.scale})`)):(e.style.top=`${B.position.top}px`,e.style.left=`${B.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,ve&&B.position.transformContext?(e.style.top=`${B.position.top}px`,e.style.left=`${B.position.left}px`):(e.style.top=`${B.position.top}px`,e.style.left=`${B.position.left}px`);e.offsetWidth,this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{annotationDragging:!1,dragPosition:null}),Fe))}this.analyticsService.trackEvent(Y.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()}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,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(ot),h(Ve),h(we),h(Un),h(_),h(R))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-pin-portal"]],hostVars:2,hostBindings:function(t,r){t&2&&(yr("id",r.id),T("data-velt-element",r.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,r){t&1&&u(0,Ptn,4,2,"ng-container",2),t&2&&d("ngIf",r.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}[_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 i=o;return i})();var G1=(()=>{let o=class o{constructor(e,t,r,a,s,c){this.commentService=e,this.domService=t,this.componentFactoryResolver=r,this.injector=a,this.appRef=s,this.loggingService=c,this.commentsPinById={},this.commentPinTemplate$=new Ce(null),this.customPinEvents$=new Ze}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(r=>{let a=r.portalRef,s=r.userTargetElement,c=r.pinHostElement;if(document.body.contains(s)&&document.body.contains(c))a&&(a.instance.setCommentPinAnnotation(e),this.updateElementOffset(e));else{let p=r.pinHostDomPortalOutlet;p&&(this.removeCommentPinHostAttributes(e.annotationId,r.pinHostElement),this.removeCommentDisabledAttribute(c),p.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}});else{let r=this.commentsPinById[e.annotationId]?.[0]?.pinHostDomPortalOutlet;r&&(this.removeCommentPinHostAttributes(e.annotationId,this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),this.removeCommentDisabledAttribute(this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),r.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(r=>{if(r){let a=this.domService.getHostElement(r),s=new lr(s8),c=new cr(a,this.appRef,this.injector),p=c.attach(s);p.instance.setCommentPinAnnotation(e),p.instance.setTargetElement(r);let g=r?.getAttribute(U.ATTRIBUTES.VELT_SOURCE_ID);g&&p.instance.setSourceId(g),this.commentsPinById[e.annotationId].push({pinHostDomPortalOutlet:c,pinPortal:s,portalRef:p,annotation:JSON.parse(JSON.stringify(e)),userTargetElement:r,pinHostElement:a}),this.setCommentPinHostAttributes(e.annotationId,a),this.setCommentDisabledAttribute(a),this.updateElementOffset(e)}}))}catch(t){this.loggingService.catch("Error in CommentPinPortalService setPinPortal: ",t)}}setCommentPinHostAttributes(e,t){try{let r=t.getAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(r){let a=r.split(",");a.includes(e)||(a.push(e),t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST,a.join(",")))}else t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST,e);window.getComputedStyle(t).position==="static"&&t.offsetHeight>0&&(um(t)||t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC,"true"))}catch(r){this.loggingService.catch("Error in CommentPinPortalService setCommentPinHostAttributes: ",r)}}removeCommentPinHostAttributes(e,t){try{let r=t.getAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(r){let a=r.split(","),s=a.indexOf(e);s>-1&&(a.splice(s,1),a.length>0?t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST,a.join(",")):t.removeAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST))}t?.getAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST)||t.removeAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)}catch(r){this.loggingService.catch("Error in CommentPinPortalService removeCommentPinHostAttributes: ",r)}}setCommentDisabledAttribute(e){try{this.commentService.getPopoverMode()&&e.setAttribute(U.ATTRIBUTES.VELT_COMMENT_DISABLED,"auto")}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentDisabledAttribute: ",t)}}removeCommentDisabledAttribute(e){try{e?.getAttribute(U.ATTRIBUTES.VELT_COMMENT_DISABLED)==="auto"&&e.removeAttribute(U.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:r,userTargetElement:a,pinHostElement:s}=t,c=this.domService.getElementOffset(a,s);r.instance.setOffsetLeft(c.offsetLeft),r.instance.setOffsetTop(c.offsetTop)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateElementOffset: ",t)}}checkPinsToRemove(e){try{let t=e.map(r=>r.annotationId);Object.keys(this.commentsPinById).forEach(r=>{t.includes(r)||(this.commentService.customPinsById.has(r)&&this.commentService.customPinsById.delete(r),this.commentsPinById[r].forEach(s=>{s.pinHostDomPortalOutlet.detach(),this.removeCommentPinHostAttributes(r,s.pinHostElement),this.removeCommentDisabledAttribute(s.pinHostElement),this.domService.removeHighlightFromElement(s.pinHostElement),s.userTargetElement&&this.domService.removeHighlightFromElement(s.userTargetElement)}),delete this.commentsPinById[r])})}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkPinsToRemove: ",t)}}getAnnotationIdsByUserTargetElement(e){try{let t=[];return Object.keys(this.commentsPinById||{}).forEach(r=>{this.commentsPinById[r]?.forEach(s=>{s.userTargetElement===e&&t.push(r)})}),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:r}=e;r&&this.commentService.customPinsById.set(r.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)(ee(we),ee(Ve),ee(Ro),ee(St),ee(ii),ee(_))},o.\u0275prov=Pe({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var ie=(()=>{let o=class o{set veltDynamicTemplate({template:e,context:t,id:r,cloneTemplate:a,componentName:s,variant:c,suffix:p,setIfCondition:g,componentElementRef:f,replaceTemplate:I=!0}){try{if(p&&(s+=`--${p}`),c&&(s+=`---${c}`),s){let x=this.wireframeService.getConditionElement(s);if(!x&&e&&(x=e),x){let B=x?.getAttribute("velt-if");B&&g&&g(B),Array.from(x.attributes).forEach(z=>{f?.nativeElement.setAttribute(z.name,z.value)}),t?.componentConfigSignal?this.dynamicDataService.applyConditionalClasses(f?.nativeElement,t):this.dynamicDataService.applyConditionalClasses(f?.nativeElement)}}if(s&&!e){let x=this.wireframeService.getWireframe(s);if(x){let B=document.createElement(x.tagName);B.innerHTML=x.innerHTML,this.template=B}}else this.template=e;this.data=t,this.id=r,this.cloneTemplate=!!a,this.cloneTemplate&&e&&(this.template=this.domService.deepCloneElement(e)),this.checkToUpdateTemplate(I)}catch(x){this.loggingService.warn("Error in DynamicTemplateDirective veltDynamicTemplate: ",x)}}constructor(e,t,r,a,s,c,p,g){this.elementRef=e,this.templateRef=t,this.viewContainer=r,this.dynamicComponentService=a,this.loggingService=s,this.domService=c,this.wireframeService=p,this.dynamicDataService=g,this.directiveId=Math.random().toString(36).substring(7),this.isCustomTemplateMode=!1,this.isDefaultTemplateMode=!1,this.cloneTemplate=!1,this.injectedElements=[],this.componentRefs=[];try{this.loggingService.log("%c[WB] Creating CLASS: DynamicTemplateDirective","color: blue;")}catch(f){this.loggingService.catch("Error in DynamicTemplateDirective constructor: ",f)}}checkDataValue(e,t){let r=e.querySelectorAll("[data-velt]");function a(s,c){return c.split(".").reduce((p,g)=>p&&p[g],s)}r.forEach(s=>{let c=s.getAttribute("data-velt");if(c&&t){let p=a(t,c);s instanceof HTMLElement&&(s.innerText=JSON.stringify(p,null,2))}})}checkToUpdateTemplate(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: checkToUpdateTemplate","color: green;"),this.template&&e)if(this.isDefaultTemplateMode=!1,this.isCustomTemplateMode)this.updateDataOnComponentRefs(this.data);else{this.isCustomTemplateMode=!0,this.cleanUp();let t=document.createElement(this.template.tagName);t.innerHTML=this.template.innerHTML,this.injectElementNextToSibling(this.elementRef.nativeElement,t)}else this.isCustomTemplateMode=!1,this.isDefaultTemplateMode||(this.cleanUp(),this.viewContainer.createEmbeddedView(this.templateRef),this.isDefaultTemplateMode=!0)}catch(t){this.loggingService.catch("Error in DynamicTemplateDirective checkToUpdateTemplate: ",t)}}injectElementNextToSibling(e,t){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: injectElementNextToSibling","color: green;"),!t)return;this.cleanUp();let r=t;for(let s=0;s<r.children.length;s++){let c=r.children[s],p=this.dynamicComponentService.processAndReplaceVeltComponents(c,this.data,this.id?this.id:`from-directive-${this.directiveId}`,[],"from directive");p?.length&&this.componentRefs.push(...p)}r.setAttribute("data-velt-added-from-directive","true"),this.customTemplate=r;let a=Array.from(r.childNodes).reverse();e.nextSibling&&e.nextSibling&&e.nextSibling.getAttribute&&e.nextSibling.getAttribute("data-velt-added-from-directive")&&e.parentNode.removeChild(e.nextSibling),a.forEach(s=>{e.parentNode.insertBefore(s,e.nextSibling),s instanceof Element&&this.injectedElements.push(s)}),r.remove()}catch(r){this.loggingService.catch("Error in DynamicTemplateDirective injectElementNextToSibling: ",r)}}updateDataOnComponentRefs(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: updateDataOnComponentRefs","color: green;"),this.componentRefs.forEach(t=>{this.dynamicComponentService.setCommentRefData(e,t)})}catch(t){this.loggingService.catch("Error in DynamicTemplateDirective updateDataOnComponentRefs: ",t)}}ngOnDestroy(){try{this.cleanUp()}catch(e){this.loggingService.catch("Error in DynamicTemplateDirective ngOnDestroy: ",e)}}cleanUp(){try{this.componentRefs.forEach(e=>{e.destroy()}),this.injectedElements.forEach(e=>{e.remove()}),this.injectedElements=[],this.viewContainer.clear()}catch(e){this.loggingService.catch("Error in DynamicTemplateDirective cleanUp: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(R),h(xo),h(_i),h(z1),h(_),h(Ve),h(Ge),h(S))},o.\u0275dir=Gt({type:o,selectors:[["","veltDynamicTemplate",""]],inputs:{veltDynamicTemplate:"veltDynamicTemplate"},standalone:!1});let i=o;return i})();function Mtn(i,o){if(i&1&&w(0,"div",7),i&2){let n=l(2);T("data-testid",n.componentId+"-unread-indicator")("aria-hidden","true")}}function ktn(i,o){if(i&1&&(v(0),y(1,"div",1)(2,"div",2),ce(),y(3,"svg",3),P(4,"translate"),w(5,"path",4),b(),u(6,Mtn,1,2,"div",5),b(),ft(),y(7,"span",6),te(8),b()(),C()),i&2){let n=o.ngIf,e=l();m(),T("data-testid",e.componentId)("role","status"),m(),T("data-testid",e.componentId+"-unread-container")("aria-hidden",!(n!=null&&n.unreadAnnotationCount)),m(),T("role","img")("aria-label",M(4,11,"Comment icon"))("focusable","false"),m(3),d("ngIf",n==null?null:n.unreadAnnotationCount),m(),T("data-testid",e.componentId+"-count")("aria-hidden","true"),m(),ze(n==null?null:n.count)}}var X1e=(()=>{let o=class o extends nt{constructor(e,t,r,a,s){super(s,a,void 0,e),this.commentService=e,this.loggingService=t,this.customFilterService=r,this.themeService=a,this.elementRef=s,this.componentConfigSignal=Te({unreadCommentsMap:null,count:0}),this.subscription=[],this.componentId="velt-comment-pin-bubble";try{this.subscription.push(this.commentService.getUnreadCommentsMap$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=E({},p),p.unreadCommentsMap=c,p))}))}catch(c){this.catchError("Error in CommentPinBubbleComponent constructor: ",c)}}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentPinBubbleComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinBubbleComponent setupA11yAttributes:",e)}}ngOnChanges(e){super.ngOnChanges(e);try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>{if(r=D(E({},r),{[t]:e[t].currentValue}),t==="annotation")if(r?.annotation?.type==="multiThread"){let a=Object.keys(r.unreadCommentsMap||{});r?.annotation?.commentAnnotationsMap&&(r.count=0,Object.values(r?.annotation?.commentAnnotationsMap||{}).forEach(s=>{s?.status?.id!==this.customFilterService.resolvedStatus?.id&&(r.count=(r?.count||0)+1),a.includes(s.annotationId)&&(r.unreadAnnotationCount=(r.unreadAnnotationCount||0)+1)}))}else r.count=r?.annotation?.comments?.length;return r})})}catch{}}ngOnDestroy(){super.ngOnDestroy();try{this.subscription.forEach(e=>e.unsubscribe())}catch(e){this.catchError("Error in CommentPinBubbleComponent ngOnDestroy: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(we),h(_),h(Wo),h(Ke),h(R))},o.\u0275cmp=O({type:o,selectors:[["velt-comment-pin-bubble-internal"]],inputs:{annotation:"annotation"},standalone:!1,features:[L,Qe],decls:1,vars:1,consts:[[4,"ngIf"],[1,"velt-comment-pin-bubble-container"],[1,"velt-comment-pin-bubble--unread-indicator-container"],["width","16","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.6666 1.33325H3.33325C2.80282 1.33325 2.29411 1.54397 1.91904 1.91904C1.54397 2.29411 1.33325 2.80282 1.33325 3.33325V9.99992C1.33325 10.5304 1.54397 11.0391 1.91904 11.4141C2.29411 11.7892 2.80282 11.9999 3.33325 11.9999H11.0599L13.5266 14.4733C13.5889 14.535 13.6628 14.5839 13.744 14.6171C13.8252 14.6503 13.9122 14.6671 13.9999 14.6666C14.0874 14.6688 14.1741 14.6506 14.2533 14.6133C14.375 14.5632 14.4792 14.4783 14.5528 14.3692C14.6263 14.26 14.6659 14.1315 14.6666 13.9999V3.33325C14.6666 2.80282 14.4559 2.29411 14.0808 1.91904C13.7057 1.54397 13.197 1.33325 12.6666 1.33325ZM13.3333 12.3933L11.8066 10.8599C11.7443 10.7981 11.6704 10.7492 11.5892 10.7161C11.508 10.6829 11.421 10.6661 11.3333 10.6666H3.33325C3.15644 10.6666 2.98687 10.5963 2.86185 10.4713C2.73682 10.3463 2.66659 10.1767 2.66659 9.99992V3.33325C2.66659 3.15644 2.73682 2.98687 2.86185 2.86185C2.98687 2.73682 3.15644 2.66659 3.33325 2.66659H12.6666C12.8434 2.66659 13.013 2.73682 13.138 2.86185C13.263 2.98687 13.3333 3.15644 13.3333 3.33325V12.3933Z","fill","currentColor"],["class","velt-comment-pin-bubble--unread-indicator",4,"ngIf"],[1,"velt-comment-pin-bubble--count"],[1,"velt-comment-pin-bubble--unread-indicator"]],template:function(t,r){t&1&&u(0,ktn,9,13,"ng-container",0),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,ge],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}[_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-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;cursor:pointer}[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-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-pin-bubble-container[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-xs);align-items:center;border-radius:var(--velt-border-radius-sm);box-shadow:0 0 1px #4551613d,0 2px 4px #45516124;color:var(--velt-accent-text);gap:var(--velt-spacing-xs);background-color:var(--velt-background-0);font-family:var(--velt-default-font-family)}.velt-comment-pin-bubble--unread-indicator-container[_ngcontent-%COMP%]{position:relative;display:flex}.velt-comment-pin-bubble--unread-indicator[_ngcontent-%COMP%]{position:absolute;top:-2px;right:-2px;display:block;width:8px;height:8px;margin-left:var(--velt-spacing-xs);border-radius:var(--velt-border-radius-full);background-color:var(--velt-error);color:var(--velt-error-foreground)}"],changeDetection:0});let i=o;return i})();var Ntn=["commentDialogOverlay"],Ftn=["commentPinBubbleOverlay"],Ltn=["*"],Btn=()=>["snippyly-overlay-panel","velt-comment-pin-bubble-overlay-panel","velt-overlay-panel"],Q1e=i=>({trigger:i}),Vtn=()=>["snippyly-overlay-panel","velt-comment-dialog-overlay-panel","velt-overlay-panel"];function Utn(i,o){i&1&&He(0)}function jtn(i,o){if(i&1&&(v(0),u(1,Utn,1,0,"ng-container",13),C()),i&2){l();let n=me(1);l(2);let e=me(9);m(),d("ngTemplateOutlet",e)("ngTemplateOutletContext",A(2,Q1e,n))}}function $tn(i,o){if(i&1){let n=K();y(0,"div",11,4),P(2,"translate"),G("click",function(t){return N(n),F(t.preventDefault())})("pointerenter",function(t){return N(n),l(3).onBubblePointerOver(t),F(t.stopPropagation())})("pointerleave",function(){N(n);let t=l(3);return F(t.onBubblePointerOut())})("pointerup",function(){N(n);let t=l(3);return F(t.onPointerUpOnBubble())}),y(3,"velt-comment-pin-bubble-internal",12),G("afterViewInit",function(){N(n);let t=l(3);return F(t.onBubbleAfterViewInit())})("onDestroy",function(){N(n);let t=l(3);return F(t.onBubbleOnDestroy())}),b()(),u(4,jtn,2,4,"ng-container",6)}if(i&2){let n=l(2).ngIf;T("role","button")("aria-expanded",n.commentBubbleHover)("aria-label",M(2,5,"Comment bubble")),m(3),d("annotation",n.annotation),m(),d("ngIf",n.isBubbleInitialized)}}function Htn(i,o){if(i&1){let n=K();v(0),u(1,$tn,5,7,"ng-template",10,3,Ee),G("positionChange",function(t){N(n);let r=l(2);return F(r.onCommentPinBubblePositionChange(t))}),C()}if(i&2){let n=l().ngIf,e=me(2);m(),d("cdkConnectedOverlayOrigin",e)("cdkConnectedOverlayOpen",!n.annotationDragging&&!!(n!=null&&n.user)&&(n.bubbleOnPinHover&&n.commentPinHover||n.commentBubbleHover||n.commentPinSelected))("cdkConnectedOverlayPanelClass",gt(10,Btn))("cdkConnectedOverlayOffsetY",n.popoverMode?0:n.commentPinBubbleOverlayOriginY==="top"?-8:2)("cdkConnectedOverlayOffsetX",n.popoverMode?n.commentPinBubbleOverlayOriginX==="end"?4:0:n.showCommentIndex&&n.commentPinBubbleOverlayOriginX==="end"?8:0)("cdkConnectedOverlayBackdropClass","velt-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",n.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0)}}function ztn(i,o){i&1&&He(0)}function Gtn(i,o){if(i&1&&u(0,ztn,1,0,"ng-container",13),i&2){l();let n=me(2),e=me(9);d("ngTemplateOutlet",e)("ngTemplateOutletContext",A(2,Q1e,n))}}function Wtn(i,o){if(i&1){let n=K();v(0),y(1,"velt-multi-thread-comment-dialog-internal",14),P(2,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment.emit(t))})("updateOverlayPosition",function(){N(n);let t=l(4);return F(t.updateOverlayPosition())})("pointerOutFromCommentDialog",function(t){N(n);let r=l(4);return F(r.onPointerOutFromCommentDialog(t))})("pointerUp",function(t){N(n);let r=l(4);return F(r.onPointerUpOnDialog(t))}),b(),C()}if(i&2){let n=l(3).ngIf,e=l();m(),d("multiThreadAnnotationId",n.annotation==null?null:n.annotation.annotationId)("annotation",n.annotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("containerComponentId",n.containerComponentId)("context",e.context)("readOnly",n.readOnly)("commentPinType",n.commentPinType),T("role","dialog")("aria-label",M(2,10,"Multi-thread comment dialog"))}}function qtn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-dialog",15),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment.emit(t))})("updateOverlayPosition",function(){N(n);let t=l(4);return F(t.updateOverlayPosition())})("pointerOutFromCommentDialog",function(t){N(n);let r=l(4);return F(r.onPointerOutFromCommentDialog(t))})("addComment",function(t){N(n);let r=l(4);return F(r.addCommentEmitter.emit(t))})("pointerUp",function(){N(n);let t=l(4);return F(t.onPointerUpOnDialog())}),b()}if(i&2){let n=l(3).ngIf;d("annotation",n.annotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("containerComponentId",n.containerComponentId)("readOnly",n.readOnly)("commentPinType",n.commentPinType),T("role","dialog")("aria-label",M(1,8,"Comment dialog"))}}function Ytn(i,o){if(i&1&&u(0,Wtn,3,12,"ng-container",8)(1,qtn,2,10,"ng-template",null,2,Ee),i&2){let n=me(2),e=l(2).ngIf;d("ngIf",(e==null||e.annotation==null?null:e.annotation.type)==="multiThread")("ngIfElse",n)}}function Ktn(i,o){if(i&1){let n=K();u(0,Ytn,3,2,"ng-template",10,5,Ee),G("positionChange",function(t){N(n);let r=l(2);return F(r.onCommentDialogPositionChange(t))})}if(i&2){let n=o.trigger,e=l().ngIf;d("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",(!e.commentBubbleAvailable||e.commentPinType==="bubble")&&!!(e!=null&&e.user)&&!e.annotationDragging&&(!e.isPhone||!e.mobileMode)&&!e.dialogOpenedInSidebar&&!e.streamMode&&!e.inboxMode&&e.floatingCommentsEnabled&&(e.commentPinSelected&&(e.commentPinType!=="bubble"||e.openDialog)||e.dialogOnHover&&(e.bubbleOnPin?e.commentBubbleHover:e.commentPinHover)&&(e.commentPinType!=="bubble"||e.openDialog)||e.commentPinType==="bubble"&&e.commentBubbleTargetPinHover&&e.openDialog))("cdkConnectedOverlayPanelClass",gt(10,Vtn))("cdkConnectedOverlayOffsetY",e.popoverMode?0:e.commentDialogOverlayOriginY==="top"?-8:2)("cdkConnectedOverlayOffsetX",e.popoverMode?e.commentDialogOverlayOriginX==="end"?4:0:e.showCommentIndex&&e.commentDialogOverlayOriginX==="end"?8:0)("cdkConnectedOverlayBackdropClass","velt-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",e.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0)}}function Ztn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-bottom-sheet",16),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(2);return F(r.saveComment.emit(t))}),b()}if(i&2){let n=l().ngIf;d("annotation",n.annotation)("user",n.user),T("role","dialog")("aria-label",M(1,4,"Comment bottom sheet"))}}function Xtn(i,o){if(i&1){let n=K();v(0),y(1,"div",7,0),P(3,"translate"),G("click",function(t){return N(n),F(t.preventDefault())})("pointerenter",function(t){return N(n),l().onPointerOver(t),F(t.stopPropagation())})("pointerleave",function(){N(n);let t=l();return F(t.onPointerOut())}),jt(4),b(),u(5,Htn,3,11,"ng-container",8)(6,Gtn,1,4,"ng-template",null,1,Ee)(8,Ktn,2,11,"ng-template",null,2,Ee)(10,Ztn,2,6,"snippyly-comment-bottom-sheet",9),C()}if(i&2){let n=o.ngIf,e=me(7),t=l();m(),T("data-testid",t.componentId+"-trigger")("role","button")("aria-expanded",n.commentPinSelected)("aria-haspopup","dialog")("aria-label",M(3,8,"Comment pin")),m(4),d("ngIf",n.bubbleOnPin&&!n.commentBubbleAvailable&&!n.dialogOpenedInSidebar)("ngIfElse",e),m(5),d("ngIf",(n==null?null:n.user)&&n.mobileMode&&n.isPhone&&!n.sidebarVisible&&!n.dialogOpenedInSidebar&&!n.inboxMode&&!n.streamMode&&n.floatingCommentsEnabled&&n.commentPinSelected)}}var W1=(()=>{let o=class o{constructor(e,t,r,a,s,c){this.breakpointObserver=e,this.commentService=t,this.domService=r,this.loggingService=a,this.elementRef=s,this.commentPinPortalService=c,this.commentPinSelected=!1,this.annotationDragging=!1,this.commentPinType="pin",this.commentBubbleTargetPinHover=!1,this.showBubbleOnHover=!1,this.bubbleOnPin=!1,this.bubbleOnPinHover=!1,this.readOnly=!1,this.openDialog=!0,this.saveComment=new Me,this.togglePinSelection=new Me,this.commentTargetElementClicked=new Me,this.addCommentEmitter=new Me,this.isDialogOnHoverEnabled=!1,this.isDialogOnTargetElementClickEnabled=!1,this.previouslySelectedAnnotations={},this.eventListenersSubscriptions=[],this.customScrollableParentEventsListenersSubscriptions=[],this.componentConfigSignal=Te({bubbleOnPin:!1,bubbleOnPinHover:!1,dialogOnHover:!1,commentBubbleAvailable:!1,commentPinHover:!1,commentBubbleHover:!1,commentPinSelected:!1,popoverMode:!1,showCommentIndex:!1,commentBubbleTargetPinHover:!1,isBubbleInitialized:!1,annotationDragging:!1,commentPinBubbleOverlayOriginX:"start",commentPinBubbleOverlayOriginY:"top",positions:[],annotation:void 0,commentPinType:"pin",isPhone:!1,mobileMode:!1,streamMode:!1,inboxMode:!1,floatingCommentsEnabled:!1,sidebarVisible:!1,dialogOpenedInSidebar:!1,readOnly:!1,openDialog:!0,commentDialogOverlayOriginX:"start",commentDialogOverlayOriginY:"top",user:void 0}),this.subscriptions=[],this.componentId="velt-comment-dialog-portal";try{this.loggingService.log("%c[WB] Creating COMPONENT CommentDialogPortalComponent","color: blue;"),this.subscriptions.push(this.breakpointObserver.observe(zi.XSmall).subscribe(p=>{p.matches?this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!0}),g)):this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!1}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent breakpointObserver subscription: ",p)})),this.subscriptions.push(this.commentService.getReadOnly$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{readOnly:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getReadOnly$ subscription: ",p)})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{sidebarVisible:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getSidebarVisibility$ subscription: ",p)})),this.subscriptions.push(this.commentService.getMobileMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{mobileMode:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getMobileMode$ subscription: ",p)})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{showCommentIndex:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getShowCommentIndex subscription: ",p)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{streamMode:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getStreamMode$ subscription: ",p)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{inboxMode:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getInboxMode subscription: ",p)})),this.subscriptions.push(this.domService.getDialogOpenedInSidebar().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{dialogOpenedInSidebar:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getDialogOpenedInSidebar subscription: ",p)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{popoverMode:p}),g)),this.componentConfigSignal().popoverMode?this.componentConfigSignal.update(g=>(g=D(E({},g),{positions:U.OVERLAY_POSITIONS_FOR_POPOVER_MODE.map(f=>new mi({originX:f.originX,originY:f.originY},{overlayX:f.overlayX,overlayY:f.overlayY}))}),g)):this.componentConfigSignal.update(g=>(g=D(E({},g),{positions:U.OVERLAY_POSITIONS.map(f=>new mi({originX:f.originX,originY:f.originY},{overlayX:f.overlayX,overlayY:f.overlayY}))}),g)),this.addEventListeners()},p=>{this.catchError("Error in CommentDialogPortalComponent getPopoverMode subscription: ",p)})),this.subscriptions.push(this.commentService.showFloatingComments$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{floatingCommentsEnabled:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent showFloatingComments$ subscription: ",p)})),this.subscriptions.push(this.commentService.getEnableDialogOnHover$().subscribe(p=>{this.isDialogOnHoverEnabled=p,this.componentConfigSignal.update(g=>(g=D(E({},g),{dialogOnHover:p}),g)),this.addEventListeners()},p=>{this.catchError("Error in CommentDialogPortalComponent getEnableDialogOnHover subscription: ",p)})),this.subscriptions.push(this.commentService.getEnableDialogOnTargetElementClick$().subscribe(p=>{this.isDialogOnTargetElementClickEnabled=p,this.addEventListeners()},p=>{this.catchError("Error in CommentDialogPortalComponent getEnableDialogOnTargetElementClick subscription: ",p)})),this.subscriptions.push(this.commentService.getBubbleCommentAnnotationIds$().subscribe(p=>{if(p.includes(this.componentConfigSignal().annotation?.annotationId)){this.commentBubbleElement=this.commentService.getCommentBubbleElement(this.componentConfigSignal().annotation);let g=this.commentBubbleElement?.getAttribute(U.ATTRIBUTES.VELT_ANNOTATION_ID)||"";this.commentBubbleElementAnnotationId!==g&&(this.commentBubbleElementAnnotationId=g,this.componentConfigSignal.update(f=>(f=D(E({},f),{commentBubbleAvailable:!0}),f)))}else this.componentConfigSignal().commentBubbleAvailable&&(this.commentBubbleElement=null,this.commentBubbleElementAnnotationId="",this.componentConfigSignal.update(g=>(g=D(E({},g),{commentBubbleAvailable:!1}),g)))},p=>{this.catchError("Error in CommentDialogPortalComponent getBubbleCommentAnnotationIds$ subscription: ",p)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().pipe(Mi()).subscribe(([p,g])=>{this.previouslySelectedAnnotations=p||{},g&&!g[this.componentConfigSignal().annotation?.annotationId]&&this.componentConfigSignal().commentPinHover&&this.setCommentPinHover(!1)},p=>{this.catchError("Error in CommentDialogPortalComponent getSelectedAnnotationsMap$ subscription: ",p)}))}catch(p){this.catchError("Error in CommentDialogPortalComponent constructor: ",p)}}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentDialogPortalComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentDialogPortalComponent setupA11yAttributes:",e)}}ngAfterViewInit(){try{this.updateHighlightOnElement(),this.updateCommentActiveAttributeOnElement()}catch(e){this.catchError("Error in CommentDialogPortalComponent AfterViewInit: ",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))}),e?.commentPinSelected&&(this.componentConfigSignal().commentPinSelected&&this.setCommentPinHover(!1),this.updateHighlightOnElement(),this.updateCommentActiveAttributeOnElement()),e?.targetElement&&(this.addEventListeners(),this.targetElement?this.setCustomScrollableParents($g(this.targetElement)):this.setCustomScrollableParents([]))}catch(t){this.catchError("Error in CommentDialogPortalComponent ngOnChanges: ",t)}}onBubbleAfterViewInit(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{isBubbleInitialized:!0}),e))}catch(e){this.catchError("Error in CommentDialogPortalComponent onBubbleAfterViewInit: ",e)}}onBubbleOnDestroy(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{isBubbleInitialized:!1}),e))}catch(e){this.catchError("Error in CommentDialogPortalComponent onBubbleOnDestroy: ",e)}}onCommentPinBubblePositionChange(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{commentPinBubbleOverlayOriginX:e.connectionPair.originX,commentPinBubbleOverlayOriginY:e.connectionPair.originY}),t))}catch(t){this.catchError("Error in CommentDialogPortalComponent onCommentPinBubblePositionChange: ",t)}}onCommentDialogPositionChange(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{commentDialogOverlayOriginX:e.connectionPair.originX,commentDialogOverlayOriginY:e.connectionPair.originY}),t))}catch(t){this.catchError("Error in CommentDialogPortalComponent onCommentDialogPositionChange: ",t)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().annotation?.annotationId),this.commentPinBubbleOverlay&&this.commentPinBubbleOverlay?.overlayRef?.updatePosition(),this.commentDialogOverlay&&this.commentDialogOverlay?.overlayRef?.updatePosition()}catch{}}onPointerOutFromCommentDialog(e){try{!this.targetElement?.contains(e?.relatedTarget)&&!this.componentConfigSignal().commentPinSelected&&this.onPointerOut()}catch(t){this.catchError("Error in CommentDialogPortalComponent onPointerOutFromCommentDialog: ",t)}}onPointerOut(){try{this.componentConfigSignal().bubbleOnPin?setTimeout(()=>{this.setCommentPinHover(!1)},500):this.setCommentPinHover(!1)}catch(e){this.catchError("Error in CommentDialogPortalComponent onPointerOut: ",e)}}setCommentPinHover(e){try{e&&this.targetElement&&!this.domService.isElementVisibleOnScreen(this.targetElement)&&(e=!1),this.componentConfigSignal.update(r=>(r=D(E({},r),{commentPinHover:e}),r)),this.updateHighlightOnElement(),this.updateCommentActiveAttributeOnElement();let t=this.commentBubbleElementRef?.nativeElement||this.commentBubbleElement;t&&(this.componentConfigSignal().commentPinHover?t.setAttribute("comment-bubble-target-pin-hover","true"):t.removeAttribute("comment-bubble-target-pin-hover"))}catch(t){this.catchError("Error in CommentDialogPortalComponent setCommentPinHover: ",t)}}addEventListeners(){try{this.removeEventListeners(),this.componentConfigSignal().popoverMode&&this.targetElement&&this.isDialogOnTargetElementClickEnabled&&this.componentConfigSignal().commentPinType!=="bubble"&&(this.isDialogOnHoverEnabled&&(this.eventListenersSubscriptions.push(Ci(this.targetElement,"pointerover").subscribe(e=>{this.onPointerOver(e),e.stopPropagation()},e=>{this.catchError("Error in CommentDialogPortalComponent addEventListeners pointerover subscription: ",e)})),this.eventListenersSubscriptions.push(Ci(this.targetElement,"pointerout").subscribe(e=>{!this.targetElement?.contains(e?.relatedTarget)&&!e?.relatedTarget?.closest(U.TAGS.SNIPPYLY_COMMENT_DIALOG)&&this.onPointerOut()},e=>{this.catchError("Error in CommentDialogPortalComponent addEventListeners pointerout subscription: ",e)}))),this.eventListenersSubscriptions.push(Ci(this.targetElement,"click").subscribe(e=>{this.previouslySelectedAnnotations[this.componentConfigSignal().annotation?.annotationId]||(this.commentTargetElementClicked.emit(),e.stopPropagation())},e=>{this.catchError("Error in CommentDialogPortalComponent addEventListeners click subscription: ",e)})))}catch(e){this.catchError("Error in CommentDialogPortalComponent addEventListeners: ",e)}}removeEventListeners(){try{this.eventListenersSubscriptions.map(e=>{e.unsubscribe()}),this.eventListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentDialogPortalComponent removeEventListeners: ",e)}}updateHighlightOnElement(){try{this.targetElement&&(this.componentConfigSignal().commentPinSelected||this.componentConfigSignal().commentPinHover?this.domService.highlightElement(this.targetElement):this.domService.removeHighlightFromElement(this.targetElement))}catch(e){this.catchError("Error in CommentDialogPortalComponent updateHighlightOnElement: ",e)}}updateCommentActiveAttributeOnElement(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: updateCommentActiveAttributeOnElement","color: green;"),this.componentConfigSignal().commentPinSelected||this.componentConfigSignal().commentPinHover)this.targetElement&&(this.targetElement?.hasAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE)||this.targetElement?.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE,"true"));else if(this.targetElement&&this.targetElement?.hasAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE)){let e=this.commentPinPortalService.getAnnotationIdsByUserTargetElement(this.targetElement),t=!1;if(e&&e.length>0){let r=this.domService.getSelectedAnnotationsMap();e.forEach(a=>{if(r?.[a]){t=!0;return}})}t||this.targetElement?.removeAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE)}}catch(e){this.catchError("Error in CommentDialogPortalComponent onCommentFocusChange: ",e)}}onPointerUpOnDialog(e){try{(!this.componentConfigSignal().commentPinSelected||e)&&this.togglePinSelection.emit(e)}catch(t){this.catchError("Error in CommentDialogPortalComponent onPointerUpOnDialog: ",t)}}onPointerOver(e){try{if(this.componentConfigSignal().commentPinHover)return;e.buttons?this.componentConfigSignal().commentPinHover&&this.setCommentPinHover(!1):!this.componentConfigSignal().commentPinHover&&(this.componentConfigSignal().bubbleOnPin?this.componentConfigSignal().bubbleOnPinHover:this.isDialogOnHoverEnabled)&&this.setCommentPinHover(!0)}catch(t){this.catchError("Error in CommentDialogPortalComponent onPointerOver: ",t)}}setCustomScrollableParents(e){try{this.customScrollableParents=e,this.addCustomScrollableParentsEventListeners()}catch(t){this.catchError("Error in CommentDialogPortalComponent setCustomScrollableParents: ",t)}}addCustomScrollableParentsEventListeners(){try{this.removeCustomScrollableParentsEventListeners(),this.customScrollableParents?.length&&this.customScrollableParents?.forEach(e=>{this.customScrollableParentEventsListenersSubscriptions.push(Ci(e,"scroll",{passive:!0}).subscribe(t=>{this.updateOverlayPosition()},t=>{this.catchError("Error in CommentDialogPortalComponent addCustomScrollableParentsEventListeners scroll subscription: ",t)}))})}catch(e){this.catchError("Error in CommentDialogPortalComponent addCustomScrollableParentsEventListeners: ",e)}}removeCustomScrollableParentsEventListeners(){try{this.customScrollableParentEventsListenersSubscriptions.map(e=>{e.unsubscribe()}),this.customScrollableParentEventsListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentDialogPortalComponent removeCustomScrollableParentsEventListeners: ",e)}}onBubblePointerOver(e){try{if(this.componentConfigSignal().commentBubbleHover)return;e.buttons||this.componentConfigSignal.update(t=>(t=D(E({},t),{commentBubbleHover:!0}),t))}catch(t){this.catchError("Error in CommentDialogPortalComponent onBubblePointerOver: ",t)}}onBubblePointerOut(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{commentBubbleHover:!1}),e))}catch(e){this.catchError("Error in CommentDialogPortalComponent onBubblePointerOut: ",e)}}onPointerUpOnBubble(){try{this.componentConfigSignal().commentPinSelected||this.togglePinSelection.emit()}catch(e){this.catchError("Error in CommentDialogPortalComponent onPointerUpOnBubble: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(e){this.catchError("Error in CommentDialogPortalComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeEventListeners(),this.removeCustomScrollableParentsEventListeners(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentDialogPortalComponent unsubscribe: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(Oo),h(we),h(Ve),h(_),h(R),h(G1))},o.\u0275cmp=O({type:o,selectors:[["velt-comment-dialog-portal-internal"]],viewQuery:function(t,r){if(t&1&&(it(Ntn,5),it(Ftn,5)),t&2){let a;et(a=tt())&&(r.commentDialogOverlay=a.first),et(a=tt())&&(r.commentPinBubbleOverlay=a.first)}},inputs:{annotation:"annotation",context:"context",commentPinSelected:"commentPinSelected",annotationDragging:"annotationDragging",commentPinType:"commentPinType",commentBubbleTargetPinHover:"commentBubbleTargetPinHover",user:"user",targetElement:"targetElement",showBubbleOnHover:"showBubbleOnHover",bubbleOnPin:"bubbleOnPin",bubbleOnPinHover:"bubbleOnPinHover",containerComponentId:"containerComponentId",readOnly:"readOnly",openDialog:"openDialog",commentBubbleElementRef:"commentBubbleElementRef"},outputs:{saveComment:"saveComment",togglePinSelection:"togglePinSelection",commentTargetElementClicked:"commentTargetElementClicked",addCommentEmitter:"addComment"},standalone:!1,features:[Qe],ngContentSelectors:Ltn,decls:1,vars:1,consts:[["trigger","cdkOverlayOrigin"],["defaultDialogViewRef",""],["commentDialogRef",""],["commentPinBubbleOverlay","cdkConnectedOverlay"],["bubbleOnHoverTrigger","cdkOverlayOrigin"],["commentDialogOverlay","cdkConnectedOverlay"],[4,"ngIf"],["cdkOverlayOrigin","",3,"click","pointerenter","pointerleave"],[4,"ngIf","ngIfElse"],[3,"annotation","user","saveComment",4,"ngIf"],["cdkConnectedOverlay","",3,"positionChange","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPanelClass","cdkConnectedOverlayOffsetY","cdkConnectedOverlayOffsetX","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayDisableClose"],["cdkOverlayOrigin","",3,"click","pointerenter","pointerleave","pointerup"],["veltAfterViewInit","",3,"afterViewInit","onDestroy","annotation"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"saveComment","updateOverlayPosition","pointerOutFromCommentDialog","pointerUp","multiThreadAnnotationId","annotation","user","commentPinSelected","containerComponentId","context","readOnly","commentPinType"],[3,"saveComment","updateOverlayPosition","pointerOutFromCommentDialog","addComment","pointerUp","annotation","user","commentPinSelected","containerComponentId","readOnly","commentPinType"],[3,"saveComment","annotation","user"]],template:function(t,r){t&1&&(Ht(),u(0,Xtn,11,10,"ng-container",6)),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,dn,sn,ar,a8,Iu,X1e,Rs,ge],encapsulation:2,changeDetection:0});let i=o;return i})();var Qtn=["pinRef"],Jtn=["commentDialogPortalRef"],enn=["*"],tye=i=>({componentConfigSignal:i}),tnn=(i,o)=>({condition:i,data:o}),eye=()=>["bubble","chart"],nnn=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-comment-pin-wireframe",variant:n,setIfCondition:e,componentElementRef:t}),inn=(i,o,n)=>({"velt-comment-pin--status-default":i,"velt-comment-pin--status-ongoing":o,"velt-comment-pin--status-terminal":n});function onn(i,o){i&1&&He(0)}function rnn(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,onn,1,0,"ng-container",11),b()),i&2){l();let n=me(3),e=l(2);T("data-testid",e.componentId+"-shadow-dom"),m(),d("ngTemplateOutlet",n)}}function ann(i,o){if(i&1){let n=K();v(0),y(1,"div",14),G("click",function(t){return N(n),F(t.preventDefault())}),jt(2),b(),C()}i&2&&(m(),T("role","presentation"))}function snn(i,o){if(i&1&&(v(0),w(1,"app-comment-pin-triangle",15),C()),i&2){let n=l(5);m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.triangleTemplate)}}function lnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",21)(2,"path",22),b())}function cnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",23)(2,"path",24),b())}function dnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",25)(2,"path",26),b())}function mnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",27)(2,"path",28),b())}function pnn(i,o){if(i&1&&(v(0)(1,18),u(2,lnn,3,0,"svg",19)(3,cnn,3,0,"svg",19)(4,dnn,3,0,"svg",19)(5,mnn,3,0,"svg",19),C()()),i&2){let n=l(6).ngIf;m(),d("ngSwitch",n.annotation==null||n.annotation.pageInfo==null||n.annotation.pageInfo.deviceInfo==null?null:n.annotation.pageInfo.deviceInfo.deviceType),m(),d("ngSwitchCase","Mobile"),m(),d("ngSwitchCase","Tablet"),m(),d("ngSwitchCase","Desktop"),m(),d("ngSwitchCase","Monitor")}}function gnn(i,o){if(i&1&&w(0,"snippyly-user-avatar",29),i&2){let n=l(6).ngIf;d("user",n.annotation==null?null:n.annotation.from)}}function unn(i,o){if(i&1&&(v(0),w(1,"app-comment-pin-unread-comment-indicator",15),C()),i&2){let n=l(7);m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.unreadCommentIndicatorTemplate)}}function hnn(i,o){if(i&1&&w(0,"app-comment-pin-number",15)(1,"app-comment-pin-ghost-comment-indicator",15)(2,"app-comment-pin-private-comment-indicator",15),i&2){let n=l(7);d("componentConfigSignal",n.componentConfigSignal)("template",n.indexTemplate),m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.ghostCommentIndicatorTemplate),m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.privateCommentIndicatorTemplate)}}function fnn(i,o){if(i&1){let n=K();v(0),y(1,"div",17,5),G("click",function(t){return N(n),F(t.preventDefault())}),u(3,pnn,6,5,"ng-container",10)(4,gnn,1,1,"ng-template",null,6,Ee)(6,unn,2,2,"ng-container",10)(7,hnn,3,6,"ng-template",null,7,Ee),b(),C()}if(i&2){let n=me(5),e=me(8),t=l(5).ngIf,r=l();m(),at("--velt-internal-comment-pin-bg-color",(t.annotation==null||t.annotation.status==null?null:t.annotation.status.color)||null),pe("velt-comment-pin--marker-transparent",r.usingCustomCommentPin)("velt-comment-pin--marker-default",!r.usingCustomCommentPin),d("ngClass",$e(12,inn,!t.customStatusesShown&&(t.annotation==null||t.annotation.status==null?null:t.annotation.status.type)==="default",!t.customStatusesShown&&(t.annotation==null||t.annotation.status==null?null:t.annotation.status.type)==="ongoing",!t.customStatusesShown&&(t.annotation==null||t.annotation.status==null?null:t.annotation.status.type)==="terminal")),T("role","presentation"),m(2),d("ngIf",t.isDeviceIndicatorOnCommentPinsEnabled&&t.isCommentAddedOnDifferentDeviceType)("ngIfElse",n),m(3),d("ngIf",!(t.user!=null&&t.user.isGuest)&&!(t.user!=null&&t.user.isAnonymous)&&(t==null||t.unreadCommentsMap==null?null:t.unreadCommentsMap[t.annotation==null?null:t.annotation.annotationId]))("ngIfElse",e)}}function vnn(i,o){if(i&1){let n=K();y(0,"div",14),G("click",function(t){return N(n),F(t.preventDefault())}),u(1,fnn,9,16,"ng-container",16),b()}if(i&2){let n=l(4).ngIf,e=l();T("role","presentation"),m(),d("veltDynamicTemplate",$(4,nnn,e.template,A(2,tye,e.componentConfigSignal),n==null?null:n.variant,e.setIfCondition.bind(e),e.elementRef))}}function Cnn(i,o){if(i&1&&u(0,snn,2,2,"ng-container",10)(1,vnn,2,10,"ng-template",null,4,Ee),i&2){let n=me(2),e=l(3).ngIf;d("ngIf",e.popoverMode)("ngIfElse",n)}}function _nn(i,o){if(i&1){let n=K();y(0,"velt-comment-dialog-portal-internal",12,1),G("saveComment",function(t){N(n);let r=l(3);return F(r.saveComment.emit(t))})("togglePinSelection",function(t){N(n);let r=l(3);return F(r.onPinBubblePointerUp(t))})("pointerUp",function(){N(n);let t=l(3);return F(t.onPointerUpOnDialog())}),y(2,"div",13,2),u(4,ann,3,1,"ng-container",10)(5,Cnn,3,2,"ng-template",null,3,Ee),b()()}if(i&2){let n=me(6),e=l(2).ngIf,t=l();d("annotation",e.annotation)("user",e.user)("commentPinSelected",e.commentPinSelected)("annotationDragging",e.annotationDragging)("commentPinType",e.commentPinType)("targetElement",e.targetElement)("bubbleOnPin",e.bubbleOnPin)("bubbleOnPinHover",e.bubbleOnPinHover)("containerComponentId",e.containerComponentId),m(2),at("--velt-internal-comment-pin-max-width",t.pinMaxWidth),pe("velt-comment-pin--ghost",!!(e.annotation!=null&&e.annotation.ghostComment))("velt-comment-pin--different-device",e.isDeviceIndicatorOnCommentPinsEnabled&&e.isCommentAddedOnDifferentDeviceType)("velt-comment-pin--outside-viewport",!e.annotationDragging&&t.isOutsideViewport)("velt-comment-pin-open",e.commentPinSelected&&!e.annotationDragging)("velt-comment-pin-unread-comment",!(e.user!=null&&e.user.isGuest)&&!(e.user!=null&&e.user.isAnonymous)&&(e==null||e.unreadCommentsMap==null?null:e.unreadCommentsMap[e.annotation==null?null:e.annotation.annotationId]))("velt-display-none",e.commentPinType!=="bubble"&&e.commentBubbleElementAnnotationId&&e.commentBubbleElementAnnotationId!==(e.annotation==null?null:e.annotation.annotationId)),T("data-testid",t.componentId)("role","button")("aria-expanded",e.commentPinSelected),m(2),d("ngIf",e.commentPinType==="bubble"||e.commentPinType==="chart")("ngIfElse",n)}}function ynn(i,o){if(i&1&&(v(0),u(1,rnn,2,2,"velt-shadow-dom-internal",10)(2,_nn,7,28,"ng-template",null,0,Ee),C()),i&2){let n=me(3),e=l().ngIf,t=l();m(),d("ngIf",!t.template&&t.pinShadowDOM&&!(gt(2,eye)!=null&>(3,eye).includes(e.commentPinType)))("ngIfElse",n)}}function Snn(i,o){if(i&1&&(v(0),u(1,ynn,4,4,"ng-container",9),C()),i&2){let n=l();m(),d("veltIf",k(3,tnn,n.conditionSignal(),A(1,tye,n.componentConfigSignal)))}}var Tu=(()=>{let o=class o extends u7{constructor(e,t,r,a,s,c,p){super(c,p,r),this.commentService=e,this.domService=t,this.loggingService=r,this.commentPinPortalService=a,this.wireframeService=s,this.elementRef=c,this.dynamicDataService=p,this.commentPinSelected=!1,this.annotationDragging=!1,this.commentPinType="pin",this.usingCustomCommentPin=!1,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.saveComment=new Me,this.pinShadowDOM=!1,this.subscriptions=[],this.commentTargetElementClicked=new Me,this.togglePinSelection=new Me,this.commentBubbleAvailable=!1,this.commentPinPosition={top:0,left:0},this.isOutsideViewport=!1,this.pinMaxWidth="",this.previouslySelectedAnnotations={},this.deviceInfo=new Kn,this.COMMENT_PIN_SIZE=40,this.componentConfigSignal=Te({isGhostComment:!1,isPrivateComment:!1,showCommentIndex:!1,bubbleOnPin:!1,bubbleOnPinHover:!1,commentPinSelected:!1,annotationDragging:!1,popoverMode:!1,isDeviceIndicatorOnCommentPinsEnabled:!1,isCommentAddedOnDifferentDeviceType:!1,annotation:this.annotation,user:this.user,unreadCommentsMap:null,popoverTriangleComponent:!1}),this.veltElement=!0,this.componentId="velt-comment-pin",this.loggingService.log("%c[WB] Creating COMPONENT CommentPinComponent","color: blue;"),this.subscriptions.push(this.domService.getDeviceInfo$().subscribe(g=>{this.deviceInfo=g,this.checkIfCommentAddedOnDifferentDeviceType()})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{showCommentIndex:g}),f))},g=>{this.catchError("Error in CommentPinComponent getShowCommentIndex subscription: ",g)})),this.subscriptions.push(this.commentService.getBubbleOnPin$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{bubbleOnPin:g}),f))},g=>{this.catchError("Error in CommentPinComponent getBubbleOnPin subscription: ",g)})),this.subscriptions.push(this.commentService.getBubbleOnPinHover$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{bubbleOnPinHover:g}),f))},g=>{this.catchError("Error in CommentPinComponent getBubbleOnPinHover subscription: ",g)})),this.subscriptions.push(this.commentService.getPopoverTriangleComponent$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{popoverTriangleComponent:g}),f))},g=>{this.catchError("Error in CommentPinComponent getPopoverTriangleComponent$ subscription: ",g)})),this.subscriptions.push(this.commentService.getPinShadowDOM$().subscribe(g=>{this.pinShadowDOM=g},g=>{this.catchError("Error in CommentPinComponent getPinShadowDOM$ subscription: ",g)})),this.subscriptions.push(this.commentService.getPinDarkMode$().subscribe(g=>{g!==null&&(g?this.elementRef.nativeElement.setAttribute("dark",""):this.elementRef.nativeElement.removeAttribute("dark"))},g=>{this.catchError("Error in CommentPinComponent pinDarkMode$ subscription: ",g)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{popoverMode:g}),f))},g=>{this.catchError("Error in CommentPinComponent getPopoverMode subscription: ",g)})),this.subscriptions.push(this.commentService.getDeviceIndicatorOnCommentPins$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{isDeviceIndicatorOnCommentPinsEnabled:g}),f))},g=>{this.catchError("Error in CommentPinComponent getDeviceIndicatorOnCommentPins subscription: ",g)})),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{unreadCommentsMap:g}),f))})),this.subscriptions.push(this.commentService.getCustomStatusesShown$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{customStatusesShown:g}),f))}))}ngOnInit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit(),this.setupA11yAttributes(),!this.template){let e="velt-comment-pin-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.catchError("Error in CommentsToolComponent OnInit: ",e)}}getChildTemplate(){try{if(!this.ghostCommentIndicatorTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-ghost-comment-indicator-wireframe");We(e)||(this.ghostCommentIndicatorTemplate=e)}if(!this.indexTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-index-wireframe");We(e)||(this.indexTemplate=e)}if(!this.numberTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-number-wireframe");We(e)||(this.numberTemplate=e)}if(!this.privateCommentIndicatorTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-private-comment-indicator-wireframe");We(e)||(this.privateCommentIndicatorTemplate=e)}if(!this.triangleTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-triangle-wireframe");We(e)||(this.triangleTemplate=e)}if(!this.unreadCommentIndicatorTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-unread-comment-indicator-wireframe");We(e)||(this.unreadCommentIndicatorTemplate=e)}}catch(e){this.loggingService.catch("Error in CommentPinComponent getChildTemplate: ",e)}}ngAfterViewInit(){try{this.subscriptions.push(this.commentPinPortalService.getCommentPinTemplate$().subscribe(e=>{if(e!==null){let t=e?.cloneNode(!0);if(t.setAttribute("slot","comment-pin"),this.pinRef!==void 0){this.pinRef.nativeElement.appendChild(t);let r=f_(this.componentConfigSignal().annotation);this.injectAttributeData(t,r),this.usingCustomCommentPin=!0,this.commentPinPortalService.emitCustomPinEvent({annotation:this.componentConfigSignal().annotation,element:t}),this.pinRef.nativeElement.childNodes.forEach(a=>{a?.tagName?.toLowerCase()===U.TAGS.SNIPPYLY_USER_AVATAR&&a.remove()})}}else this.usingCustomCommentPin=!1})),this.subscriptions.push(this.commentService.getBubbleCommentAnnotationIds$().subscribe(e=>{if(e.includes(this.componentConfigSignal().annotation?.annotationId)){this.commentBubbleElement=this.commentService.getCommentBubbleElement(this.componentConfigSignal().annotation);let t=this.commentBubbleElement?.getAttribute(U.ATTRIBUTES.VELT_ANNOTATION_ID)||"";this.componentConfigSignal().commentBubbleElementAnnotationId!==t&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{commentBubbleElementAnnotationId:t}),r)),this.commentBubbleAvailable=!0)}else this.commentBubbleAvailable&&(this.commentBubbleElement=null,this.componentConfigSignal.update(t=>(t=D(E({},t),{commentBubbleElementAnnotationId:""}),t)),this.commentBubbleAvailable=!1)},e=>{this.catchError("Error in CommentPinComponent getBubbleCommentAnnotationIds$ subscription: ",e)}))}catch(e){this.catchError("Error in CommentPinComponent AfterViewInit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{if(e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))}),e?.annotation){if(this.commentService.customPinsById.has(this.componentConfigSignal().annotation.annotationId)){let r=this.commentService.getCustomPinById(this.componentConfigSignal().annotation.annotationId);if(r!==void 0){let a=f_(this.componentConfigSignal().annotation);this.injectAttributeData(r,a)}}this.setUserInitial(),this.componentConfigSignal.update(r=>(r=D(E({},r),{isPrivateComment:this.componentConfigSignal().annotation?.iam?.accessMode===ho.PRIVATE,isGhostComment:!!this.componentConfigSignal().annotation?.ghostComment}),r)),this.checkIfCommentAddedOnDifferentDeviceType();let t=JSON.parse(JSON.stringify(this.commentPinPosition||{}));this.commentPinPosition={top:this.componentConfigSignal().annotation?.position?.top||0,left:this.componentConfigSignal().annotation?.position?.left||0}}}catch(t){this.catchError("Error in CommentPinComponent ngOnChanges: ",t)}}detectCommentPinOutsideViewport(){try{this.loggingService.log("%c[WB] Calling FUNCTION: detectCommentPinOutsideViewport","color: green;");let e=this.pinRef?.nativeElement;if(e){let t=e?.getBoundingClientRect(),r=Math.max(document?.documentElement?.clientWidth||0,window?.innerWidth||0);if(t?.right>r){let a=r-t.left;a>0?(this.pinMaxWidth=`${a}px`,this.isOutsideViewport=!0):(this.isOutsideViewport=!1,this.pinMaxWidth="")}else this.isOutsideViewport=!1,this.pinMaxWidth=""}else this.isOutsideViewport=!1}catch(e){this.catchError("Error in CommentPinComponent detectCommentPinOutsideViewport: ",e)}}checkIfCommentAddedOnDifferentDeviceType(){try{this.componentConfigSignal().annotation?.pageInfo?.deviceInfo?.deviceType!==this.deviceInfo.deviceType?(this.componentConfigSignal.update(e=>(e=D(E({},e),{isCommentAddedOnDifferentDeviceType:!0}),e)),this.COMMENT_PIN_SIZE=34):(this.componentConfigSignal.update(e=>(e=D(E({},e),{isCommentAddedOnDifferentDeviceType:!1}),e)),this.COMMENT_PIN_SIZE=40)}catch(e){this.catchError("Error in CommentPinComponent checkIfCommentAddedOnDifferentDeviceType: ",e)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().annotation?.annotationId),this.commentDialogPortalRef?.updateOverlayPosition()}catch(e){this.catchError("Error in CommentPinComponent updateOverlayPosition: ",e)}}onPointerUpOnDialog(){try{this.componentConfigSignal().commentPinSelected||this.togglePinSelection.emit()}catch(e){this.catchError("Error in CommentPinComponent onPointerUpOnDialog: ",e)}}onPinBubblePointerUp(e){try{(!this.componentConfigSignal().commentPinSelected||e)&&this.togglePinSelection.emit(e)}catch(t){this.catchError("Error in CommentPinComponent onPointerUpOnDialog: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in CommentPinComponent 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 CommentPinComponent unsubscribe: ",e)}}setUserInitial(){try{this.userInitial=this.componentConfigSignal().annotation?.from?.initial||(this.componentConfigSignal().annotation?.from?.name?this.componentConfigSignal().annotation.from.name?.charAt(0).toUpperCase():this.componentConfigSignal().annotation?.from?.email?.charAt(0).toUpperCase()||"")}catch(e){this.catchError("Error in CommentPinComponent setUserInitial: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(we),h(Ve),h(_),h(G1),h(Ge),h(R),h(S))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-pin"]],viewQuery:function(t,r){if(t&1&&(it(Qtn,5),it(Jtn,5)),t&2){let a;et(a=tt())&&(r.pinRef=a.first),et(a=tt())&&(r.commentDialogPortalRef=a.first)}},hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{annotation:"annotation",commentPinSelected:"commentPinSelected",annotationDragging:"annotationDragging",commentPinType:"commentPinType",multipleCommentPinsSelected:"multipleCommentPinsSelected",avatarErrorImage:"avatarErrorImage",user:"user",variant:"variant",containerComponentId:"containerComponentId",targetElement:"targetElement"},outputs:{saveComment:"saveComment",commentTargetElementClicked:"commentTargetElementClicked",togglePinSelection:"togglePinSelection"},standalone:!1,features:[V([S]),L,Qe],ngContentSelectors:enn,decls:1,vars:1,consts:[["commentPinContainerRef",""],["commentDialogPortalRef",""],["trigger","cdkOverlayOrigin"],["normalPinRef",""],["defaultPinRef",""],["pinRef",""],["userAvatarRef",""],["readCommentIndicatorsRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[3,"saveComment","togglePinSelection","pointerUp","annotation","user","commentPinSelected","annotationDragging","commentPinType","targetElement","bubbleOnPin","bubbleOnPinHover","containerComponentId"],["id","comment-pin-block","cdkOverlayOrigin","",1,"velt-comment-pin"],[3,"click"],[3,"componentConfigSignal","template"],[4,"veltDynamicTemplate"],[1,"velt-comment-pin--marker",3,"click","ngClass"],[3,"ngSwitch"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngSwitchCase"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.0357 1.5H5.96429C5.29365 1.5 4.75 2.17157 4.75 3V15C4.75 15.8284 5.29365 16.5 5.96429 16.5H12.0357C12.7063 16.5 13.25 15.8284 13.25 15V3C13.25 2.17157 12.7063 1.5 12.0357 1.5Z","stroke","white","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["d","M9 13.5H9.0075","stroke","white","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.75 1.5H5.25C4.83579 1.5 4.5 1.83579 4.5 2.25V15.75C4.5 16.1642 4.83579 16.5 5.25 16.5H12.75C13.1642 16.5 13.5 16.1642 13.5 15.75V2.25C13.5 1.83579 13.1642 1.5 12.75 1.5ZM5.25 0C4.00736 0 3 1.00736 3 2.25V15.75C3 16.9926 4.00736 18 5.25 18H12.75C13.9926 18 15 16.9926 15 15.75V2.25C15 1.00736 13.9926 0 12.75 0H5.25Z","fill","white"],["d","M9.75 14.25C9.75 14.6642 9.41421 15 9 15C8.58579 15 8.25 14.6642 8.25 14.25C8.25 13.8358 8.58579 13.5 9 13.5C9.41421 13.5 9.75 13.8358 9.75 14.25Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.75 4.5L3.75 11.25L14.25 11.25L14.25 4.5C14.25 4.08579 13.9142 3.75 13.5 3.75L4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5ZM2.25 12.75L15.75 12.75L15.75 4.5C15.75 3.25736 14.7426 2.25 13.5 2.25L4.5 2.25C3.25736 2.25 2.25 3.25736 2.25 4.5L2.25 12.75Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.25 12.75L2.25 13.5C2.25 13.9142 2.58579 14.25 3 14.25L15 14.25C15.4142 14.25 15.75 13.9142 15.75 13.5L15.75 12.75L2.25 12.75ZM0.75 13.5C0.75 14.7426 1.75736 15.75 3 15.75L15 15.75C16.2426 15.75 17.25 14.7426 17.25 13.5L17.25 12C17.25 11.5858 16.9142 11.25 16.5 11.25L1.5 11.25C1.08579 11.25 0.75 11.5858 0.75 12L0.75 13.5Z","fill","white"],["d","M6.75 13.5H8.25V15H9.75V13.5H11.25V15H12C12.4142 15 12.75 15.3358 12.75 15.75C12.75 16.1642 12.4142 16.5 12 16.5H6C5.58579 16.5 5.25 16.1642 5.25 15.75C5.25 15.3358 5.58579 15 6 15H6.75V13.5Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M3 4.5L3 10.5C3 11.3284 3.67157 12 4.5 12L13.5 12C14.3284 12 15 11.3284 15 10.5L15 4.5C15 3.67157 14.3284 3 13.5 3L4.5 3C3.67157 3 3 3.67157 3 4.5ZM1.5 10.5C1.5 12.1569 2.84315 13.5 4.5 13.5L13.5 13.5C15.1569 13.5 16.5 12.1569 16.5 10.5L16.5 4.5C16.5 2.84315 15.1569 1.5 13.5 1.5L4.5 1.5C2.84315 1.5 1.5 2.84315 1.5 4.5L1.5 10.5Z","fill","white"],[3,"user"]],template:function(t,r){t&1&&(Ht(),u(0,Snn,2,6,"ng-container",8)),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Qr,X,Dt,eo,po,sn,Jn,ie,U_,V_,$_,j_,Sn,W1,se,H1],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}[_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-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);--velt-internal-comment-pin-bg-color: var(--velt-accent)}[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-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-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble{position:absolute;border-radius:100%;text-align:center;top:calc(var(--velt-spacing-sm) * -1);right:calc(var(--velt-spacing-sm) * -1);bottom:unset;left:unset;height:24px;width:24px;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--private-indicator{height:28px;width:28px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);left:unset;bottom:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--ghost-indicator{height:28px;width:28px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);left:unset;bottom:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--unread-indicator{background-color:var(--velt-error);color:var(--velt-error-foreground);height:16px;width:16px;top:calc(var(--velt-spacing-xs) * -1);right:calc(var(--velt-spacing-xs) * -1);left:unset;bottom:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--index-3-digit{border-radius:100%;height:30px;width:30px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);bottom:unset;left:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--number-3-digit{border-radius:100%;height:30px;width:30px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);bottom:unset;left:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--index{border:1px solid rgb(210,210,210);color:var(--velt-black);background:var(--velt-white)}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--index .comment-annotation-number{border-radius:100%;width:24px;height:24px;font-size:calc((.55rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;position:relative}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--index .comment-annotation-number:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--number{border:1px solid rgb(210,210,210);color:var(--velt-black);background:var(--velt-white)}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--number .comment-annotation-number{border-radius:100%;width:24px;height:24px;font-size:calc((.55rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;position:relative}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--number .comment-annotation-number:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--private-indicator{color:var(--velt-white);background:linear-gradient(0deg,#000000bf 0% 100%),var(--velt-accent);border-radius:100%;border:1px solid rgba(255,255,255,.24);padding:var(--velt-spacing-sm)}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--ghost-indicator{color:var(--velt-error-foreground);background:var(--velt-error);border-radius:100%;border:1px solid rgba(255,255,255,.24);padding:var(--velt-spacing-sm)}.velt-comment-pin--different-device[_ngcontent-%COMP%] .velt-comment-pin--private-indicator[_ngcontent-%COMP%], .velt-comment-pin--different-device[_ngcontent-%COMP%] .velt-comment-pin--ghost-indicator[_ngcontent-%COMP%]{padding:calc(var(--velt-spacing-md) / 2);width:24px;height:24px;top:calc(var(--velt-spacing-sm) * -1);right:calc(var(--velt-spacing-sm) * -1)}.velt-comment-pin--marker[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;position:relative;width:calc((2.5rem + 0px) * var(--velt-base-rem-unit));height:calc((2.5rem + 0px) * var(--velt-base-rem-unit));border:2px solid var(--velt-border-3);border-radius:100% 100% 100% 2px;box-shadow:0 8px 16px -8px #0f0f0f1a;z-index:1;cursor:pointer;background:var(--velt-internal-comment-pin-bg-color);box-sizing:border-box}.velt-comment-pin--marker.velt-comment-pin--status-default[_ngcontent-%COMP%]{background:var(--velt-accent, var(--velt-internal-comment-pin-bg-color))}.velt-comment-pin--marker.velt-comment-pin--status-ongoing[_ngcontent-%COMP%]{background:var(--velt-warning, var(--velt-internal-comment-pin-bg-color))}.velt-comment-pin--marker.velt-comment-pin--status-terminal[_ngcontent-%COMP%]{background:var(--velt-success, var(--velt-internal-comment-pin-bg-color))}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem;background-color:var(--velt-gray);background-size:cover;border-radius:100%;display:flex;align-items:center;justify-content:center;position:relative}.velt-comment-pin--popover[_ngcontent-%COMP%]{width:0;height:0;border-style:solid;border-width:0 10px 10px 0;border-color:transparent var(--velt-accent) transparent transparent}.velt-comment-pin.velt-comment-pin--different-device[_ngcontent-%COMP%], .velt-comment-pin.velt-comment-pin--different-device[_ngcontent-%COMP%] .velt-comment-pin--marker[_ngcontent-%COMP%]{width:calc((2.125rem + 0px) * var(--velt-base-rem-unit));height:calc((2.125rem + 0px) * var(--velt-base-rem-unit))}.velt-comment-pin.velt-comment-pin--ghost[_ngcontent-%COMP%] .velt-comment-pin--marker-default.velt-comment-pin--marker[_ngcontent-%COMP%]{background:var(--velt-gray)}.velt-comment-pin.velt-comment-pin--ghost[_ngcontent-%COMP%] .velt-comment-pin--popover[_ngcontent-%COMP%]{border-color:transparent var(--velt-gray) transparent transparent}.velt-comment-pin.velt-comment-pin--outside-viewport[_ngcontent-%COMP%]{max-width:var(--velt-internal-comment-pin-max-width);overflow:hidden} .velt-comment-dialog-overlay-panel{z-index:2147483567}.velt-comment-pin--marker-transparent[_ngcontent-%COMP%]{background:transparent;border:unset;border-radius:unset;box-shadow:unset}"],changeDetection:0});let i=o;return i})();function bnn(i,o){if(i&1){let n=K();v(0),y(1,"velt-multi-thread-comment-dialog-internal",6),G("afterViewInit",function(){N(n);let t=l().last,r=l(2);return F(t?r.calculatePosition():null)})("saveComment",function(t){N(n);let r=l().$implicit,a=l(2);return F(a.saveComment(r==null?null:r.annotation,t))}),b(),C()}if(i&2){let n=l().$implicit,e=l().ngIf,t=l();m(),d("multiThreadAnnotationId",n==null||n.annotation==null?null:n.annotation.annotationId)("annotation",n==null?null:n.annotation)("user",e.user)("commentPinSelected",!!e.selectedAnnotationsMap[n==null||n.annotation==null?null:n.annotation.annotationId]),T("data-testid",t.componentId+"-multi-thread-"+(n==null||n.annotation==null?null:n.annotation.annotationId))}}function Inn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-dialog",7),G("afterViewInit",function(){N(n);let t=l().last,r=l(2);return F(t?r.calculatePosition():null)})("saveComment",function(t){N(n);let r=l().$implicit,a=l(2);return F(a.saveComment(r==null?null:r.annotation,t))}),b()}if(i&2){let n=l().$implicit,e=l().ngIf,t=l();d("annotation",n==null?null:n.annotation)("user",e.user)("commentPinSelected",!!e.selectedAnnotationsMap[n==null||n.annotation==null?null:n.annotation.annotationId])("inlineCommentMode",e.inlineCommentMode)("isInsidePdfViewer",n==null?null:n.isInsidePdfViewer),T("data-testid",t.componentId+"-single-thread-"+(n==null||n.annotation==null?null:n.annotation.annotationId))}}function Enn(i,o){if(i&1){let n=K();v(0),y(1,"div",4),G("click",function(){let t=N(n).$implicit,r=l(2);return F(r.togglePinSelection(t==null?null:t.annotation))}),u(2,bnn,2,5,"ng-container",5)(3,Inn,1,6,"ng-template",null,0,Ee),b(),C()}if(i&2){let n=o.$implicit,e=me(4),t=l().ngIf,r=l();m(),at("top",n==null?null:n.top,"px"),pe("selected",t.selectedAnnotationsMap[n==null||n.annotation==null?null:n.annotation.annotationId]),d("id","snippyly-comments-on-right-block-"+(n==null||n.annotation==null?null:n.annotation.annotationId)),T("data-testid",r.componentId+"-block-"+(n==null||n.annotation==null?null:n.annotation.annotationId))("role","region")("tabindex",0),m(),d("ngIf",(n==null||n.annotation==null?null:n.annotation.type)==="multiThread")("ngIfElse",e)}}function xnn(i,o){if(i&1&&(v(0),y(1,"div",2),P(2,"translate"),u(3,Enn,5,10,"ng-container",3),b(),C()),i&2){let n=o.ngIf,e=l();m(),T("data-testid",e.componentId)("role","complementary")("aria-label",M(2,5,"Comments panel")),m(2),d("ngForOf",n.commentPinAnnotationsArray)("ngForTrackBy",e.trackById)}}var nye=(()=>{let o=class o{constructor(e,t,r,a,s){this.authService=e,this.commentService=t,this.domService=r,this.elementRef=a,this.loggingService=s,this.commentPinAnnotations=[],this.subscriptions=[],this.positionChangeDetectionSubscriptions=[],this.componentConfigSignal=Te({commentPinAnnotationsArray:[],selectedAnnotationsMap:{},user:void 0,inlineCommentMode:!1}),this.veltElement=!0,this.componentId="velt-comments-stream-view",this.subscriptions.push(this.authService.getUser$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=D(E({},p),{user:c}),p))},c=>{this.loggingService.catch("Error in CommentsStreamViewComponent getUser$ subscription: ",c)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=D(E({},p),{selectedAnnotationsMap:c}),p)),setTimeout(()=>{this.calculatePosition(),Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length===1&&this.goToAnnotation(this.componentConfigSignal().selectedAnnotationsMap[Object.keys(this.componentConfigSignal().selectedAnnotationsMap)[0]])},100)},c=>{this.loggingService.catch("Error in CommentsStreamViewComponent getSelectedAnnotationsMap$ subscription: ",c)})),this.subscriptions.push(this.commentService.getInlineCommentMode$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=D(E({},p),{inlineCommentMode:c}),p))}))}ngOnInit(){this.setupA11yAttributes()}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsStreamViewComponent setupA11yAttributes:",e)}}ngAfterViewInit(){this.streamViewContainerId&&(this.scrollableParentElement=document.getElementById(this.streamViewContainerId)),this.scrollableParentElement||(this.scrollableParentElement=iC(this.elementRef.nativeElement)),this.scrollableParentElement||(this.scrollableParentElement=document.documentElement),this.calculateTargetElementPositions()}ngOnChanges(e){try{e.commentPinAnnotations&&this.calculateTargetElementPositions()}catch(t){this.loggingService.catch("Error in CommentsStreamViewComponent ngOnChanges: ",t)}}goToAnnotation(e){let t=null;e.targetElement||e.areaAnnotationId?t=document.getElementById(`comment-pin-container-${e.annotationId}`):t=document.querySelector(`[data-velt-id='${e.annotationId}']`),t&&t.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}togglePinSelection(e){try{this.componentConfigSignal().selectedAnnotationsMap[e.annotationId]||(this.goToAnnotation(e),this.domService.toggleAnnotationSelection(e))}catch(t){this.loggingService.catch("Error in CommentsStreamViewComponent togglePinSelection: ",t)}}saveComment(e,t){try{this.commentService.saveComment(e,t)}catch(r){this.loggingService.catch("Error in CommentsStreamViewComponent saveComment: ",r)}}calculateTargetElementPositions(){try{this.positionChangeDetectionSubscriptions.forEach(t=>{t.unsubscribe()});let e=[];if(this.commentPinAnnotations.forEach(t=>{let r={},a=null;t.targetElement||t.areaAnnotationId?a=document.getElementById(`comment-pin-container-${t.annotationId}`):a=document.querySelector(`[data-velt-id='${t.annotationId}']`),a&&(r.annotation=t,r.targetElement=a,r.targetOffsetTop=uz(a,this.scrollableParentElement)?.top||0,r.isInsidePdfViewer=sC(a,U.ATTRIBUTES.VELT_PDF_VIEWER),e.push(r))}),e.sort((t,r)=>t.targetElement.getBoundingClientRect().top-r.targetElement.getBoundingClientRect().top),this.componentConfigSignal.update(t=>(t=D(E({},t),{commentPinAnnotationsArray:e}),t)),this.componentConfigSignal().commentPinAnnotationsArray?.length){let t=this.componentConfigSignal().commentPinAnnotationsArray[this.componentConfigSignal().commentPinAnnotationsArray.length-1]?.targetElement;this.detectPositionChange(t)}this.calculatePosition()}catch(e){this.loggingService.catch("Error in CommentsStreamViewComponent calculateTargetElementPositions: ",e)}}trackById(e,t){return t.annotation.annotationId}calculatePosition(){try{if(Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length===1){let e=Object.keys(this.componentConfigSignal().selectedAnnotationsMap)[0],t=this.componentConfigSignal().commentPinAnnotationsArray.findIndex(s=>s.annotation.annotationId===e),r=this.componentConfigSignal().commentPinAnnotationsArray.slice(0,t+1).reverse(),a=this.componentConfigSignal().commentPinAnnotationsArray.slice(t);this.calculateDialogPosition(r,!0),this.calculateDialogPosition(a),r.shift(),this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinAnnotationsArray:[...r.reverse().slice(),...a.slice()]}),s))}else this.calculateDialogPosition(this.componentConfigSignal().commentPinAnnotationsArray)}catch(e){this.loggingService.catch("Error in CommentsStreamViewComponent calculatePosition: ",e)}}calculateDialogPosition(e,t=!1){try{e.forEach((r,a,s)=>{if(!r.dialogElement){let c=this.elementRef?.nativeElement?.querySelector(`[id="snippyly-comments-on-right-block-${r.annotation.annotationId}"]`);c&&(r.dialogElement=c,r.dialogOffsetTop=uz(c,this.scrollableParentElement)?.top||0)}if(!a)r.top=r.targetOffsetTop;else if(t){let c=s[a-1];if(r.dialogElement){let p=c.top-r.dialogElement?.getBoundingClientRect()?.height-24,g=r.targetOffsetTop;p<r.top?r.top=p:g&&(g<=p?r.top=g:r.top=p)}}else{let c=s[a-1];if(c.dialogElement){let p=c.top+c.dialogElement?.getBoundingClientRect()?.height+24,g=r.targetOffsetTop;p>r.dialogOffsetTop&&p>g?r.top=p:g&&(g>=p?r.top=g:r.top=p)}}})}catch(r){this.loggingService.catch("Error in CommentsStreamViewComponent calculateDialogPosition: ",r)}}detectPositionChange(e){try{let t=Wm(0,zm).pipe(de(()=>{let r=e.getBoundingClientRect();return{top:r.top,left:r.left}}),Ct((r,a)=>r.top===a.top&&r.left===a.left),Mi());this.positionChangeDetectionSubscriptions.push(t.subscribe(()=>{this.calculateTargetElementPositions()},r=>{}))}catch(t){this.loggingService.catch("Error in CommentsStreamViewComponent detectPositionChange: ",t)}}ngOnDestroy(){try{this.subscriptions.forEach(e=>{e.unsubscribe()})}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(je),h(we),h(Ve),h(R),h(_))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comments-stream-view"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{commentPinAnnotations:"commentPinAnnotations",streamViewContainerId:"streamViewContainerId"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[["commentDialogRef",""],[4,"ngIf"],["velt-ignore-change-detection","true",1,"snippyly-comments-on-right-container"],[4,"ngFor","ngForOf","ngForTrackBy"],["velt-ignore-change-detection","true",1,"snippyly-comments-on-right-block",3,"click","id"],[4,"ngIf","ngIfElse"],[3,"afterViewInit","saveComment","multiThreadAnnotationId","annotation","user","commentPinSelected"],[3,"afterViewInit","saveComment","annotation","user","commentPinSelected","inlineCommentMode","isInsidePdfViewer"]],template:function(t,r){t&1&&u(0,xnn,4,7,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,ar,Rs,ge],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}.snippyly-comments-on-right-container[_ngcontent-%COMP%]{position:absolute;top:0;right:10vw;width:300px;background:#90ee90}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block[_ngcontent-%COMP%]{position:absolute;box-shadow:none;transition:top .5s ease,left .5s ease,box-shadow .5s ease;left:0}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block.selected[_ngcontent-%COMP%]{left:-36px;z-index:1}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block .comment-dialog-container{transition:box-shadow .5s ease;box-shadow:none!important}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block.selected .comment-dialog-container{box-shadow:0 calc((1rem + 0px) * var(--velt-base-rem-unit)) calc((3rem + 0px) * var(--velt-base-rem-unit)) #0000002d!important}"],changeDetection:0});let i=o;return i})();var Dnn=()=>["snippyly-inbox-panel","velt-overlay-panel"];function wnn(i,o){i&1&&He(0)}function Onn(i,o){if(i&1&&u(0,wnn,1,0,"ng-container",7),i&2){l();let n=me(6);d("ngTemplateOutlet",n)}}function Ann(i,o){if(i&1){let n=K();y(0,"velt-multi-thread-comment-dialog-internal",11),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment(t))}),b()}if(i&2){let n=l(3).ngIf,e=l();d("multiThreadAnnotationId",n.commentAnnotation==null?null:n.commentAnnotation.annotationId)("annotation",n.commentAnnotation)("user",n.user)("commentPinSelected",!0)("inboxMode",!0),T("data-testid",e.componentId+"-multi-thread-dialog")("role","dialog")("aria-label",M(1,8,"Multi-thread comment dialog"))}}function Pnn(i,o){if(i&1&&(v(0),u(1,Ann,2,10,"velt-multi-thread-comment-dialog-internal",10),C()),i&2){let n=l(2).ngIf;m(),d("ngIf",n.commentAnnotation&&n.user)}}function Mnn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-dialog",13),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment(t))}),b()}if(i&2){let n=l(3).ngIf,e=l();d("annotation",n.commentAnnotation)("user",n.user)("commentPinSelected",!0)("inboxMode",!0),T("data-testid",e.componentId+"-single-dialog")("role","dialog")("aria-label",M(1,7,"Single comment dialog"))}}function knn(i,o){if(i&1&&u(0,Mnn,2,9,"snippyly-comment-dialog",12),i&2){let n=l(2).ngIf;d("ngIf",n.commentAnnotation&&n.user)}}function Rnn(i,o){if(i&1&&(y(0,"div",8),P(1,"translate"),u(2,Pnn,2,1,"ng-container",9)(3,knn,1,1,"ng-template",null,3,Ee),b()),i&2){let n=me(4),e=l().ngIf,t=l();pe("mobile",e.isPhone)("visible",!!e.commentAnnotation),T("data-testid",t.componentId)("role","region")("aria-label",M(1,10,"Comment inbox container"))("aria-expanded",!!e.commentAnnotation),m(2),d("ngIf",(e==null||e.commentAnnotation==null?null:e.commentAnnotation.type)==="multiThread")("ngIfElse",n)}}function Nnn(i,o){if(i&1&&(v(0),w(1,"div",5,0),u(3,Onn,1,1,"ng-template",6,1,Ee)(5,Rnn,5,12,"ng-template",null,2,Ee),C()),i&2){let n=me(2),e=l();m(),T("data-testid",e.componentId+"-trigger")("aria-hidden",!0),m(2),d("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",!0)("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",gt(6,Dnn))}}var iye=(()=>{let o=class o extends nt{constructor(e,t,r,a,s,c){super(s,c),this.authService=e,this.breakpointObserver=t,this.commentService=r,this.loggingService=a,this.elementRef=s,this.themeService=c,this.componentConfigSignal=Te({isPhone:!1,sidebarVisible:!1}),this.subscriptions=[],this.componentId="velt-comment-inbox";try{this.subscriptions.push(this.breakpointObserver.observe(zi.XSmall).subscribe(p=>{p.matches?this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!0}),g)):this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!1}),g))},p=>{this.catchError("Error in CommentInboxComponent breakpointObserver subscription: ",p)}))}catch{}}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t))},e=>{this.catchError("Error in CommentInboxComponent getUser$ subscription: ",e)}))}catch(e){this.catchError("Error in CommentInboxComponent ngOnInit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentInboxComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e.commentAnnotation&&this.componentConfigSignal.update(t=>(t=D(E({},t),{commentAnnotation:e.commentAnnotation.currentValue}),t))}catch(t){this.catchError("Error in CommentInboxComponent ngOnChanges: ",t)}}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),super.ngOnDestroy()}saveComment(e){try{(this.commentAnnotation||e.annotation)&&this.commentService.saveComment(this.commentAnnotation||e.annotation,e)}catch(t){this.catchError("Error in CommentInboxComponent saveComment: ",t)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.commentAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(je),h(Oo),h(we),h(_),h(R),h(Ke))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-inbox"]],inputs:{commentAnnotation:"commentAnnotation"},standalone:!1,features:[L,Qe],decls:1,vars:1,consts:[["sidebarTrigger","cdkOverlayOrigin"],["sidebarOverlay","cdkConnectedOverlay"],["sidebarRef",""],["commentDialogRef",""],[4,"ngIf"],["cdkOverlayOrigin",""],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass"],[4,"ngTemplateOutlet"],["id","sCommentInboxContainer","data-velt-comment-disabled","true",1,"velt-comment-inbox--container","s-inbox-container"],[4,"ngIf","ngIfElse"],[3,"multiThreadAnnotationId","annotation","user","commentPinSelected","inboxMode","saveComment",4,"ngIf"],[3,"saveComment","multiThreadAnnotationId","annotation","user","commentPinSelected","inboxMode"],[3,"annotation","user","commentPinSelected","inboxMode","saveComment",4,"ngIf"],[3,"saveComment","annotation","user","commentPinSelected","inboxMode"]],template:function(t,r){t&1&&u(0,Nnn,7,7,"ng-container",4),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,dn,sn,ar,Rs,ge],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}[_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-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-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)}*[_ngcontent-%COMP%]{box-sizing:border-box} .snippyly-inbox-panel{top:0!important;left:0!important}.s-overflow-hidden[_ngcontent-%COMP%]{overflow:hidden!important} .velt-comment-inbox--container{height:100vh;width:calc((26rem + 0px) * var(--velt-base-rem-unit));position:fixed;top:0;right:-100%;padding:var(--velt-spacing-lg);box-sizing:border-box;z-index:999999997;transition:width .5s ease-in-out,right .5s ease-in-out} .velt-comment-inbox--container.mobile{width:100%;height:100%;box-sizing:border-box;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)} .velt-comment-inbox--container.visible{right:0}"],changeDetection:0});let i=o;return i})();function Lnn(i,o){if(i&1){let n=K();v(0),y(1,"div",3),G("click",function(){let t=N(n).$implicit,r=l(2);return F(r.scrollToAnnotation(t==null?null:t.key))}),y(2,"div",4),te(3),P(4,"translate"),b()(),C()}if(i&2){let n=o.$implicit,e=l().ngIf,t=l();m(),at("top",n.value.top,"%")("transform","translate(0, -"+n.value.top+"%)"),pe("v-unread-comment",!(e.user!=null&&e.user.isGuest)&&!(e.user!=null&&e.user.isAnonymous)&&(e.unreadCommentsMap==null?null:e.unreadCommentsMap[n==null||n.value==null||n.value.annotation==null?null:n.value.annotation.annotationId])),T("data-testid",t.componentId+"-pin-"+n.key)("role","button")("tabindex",0),m(),T("role","tooltip")("aria-hidden","true"),m(),Se(" ",M(4,12,"Go to comments here.")," ")}}function Bnn(i,o){if(i&1&&(v(0),y(1,"div",1),P(2,"translate"),u(3,Lnn,5,14,"ng-container",2),P(4,"keyvalue"),b(),C()),i&2){let n=o.ngIf,e=l();m(),pe("velt-comments-minimap-container--target-scrollable-element",!!n.targetScrollableElementId)("velt-comments-minimap-position--left",n.position==="left"),T("data-testid",e.componentId)("role","navigation")("aria-label",M(2,9,"Comments minimap")),m(2),d("ngForOf",M(4,11,n.commentAnnotationPositionMap))("ngForTrackBy",e.trackByAnnotationId)}}var l8=(()=>{let o=class o{constructor(e,t,r){this.commentService=e,this.loggingService=t,this.elementRef=r,this.commentAnnotations=[],this.targetScrollableElementId=null,this.position="right",this.commentCountsByPosition={},this.minimapHeatmapGradient="",this.componentConfigSignal=Te({targetScrollableElementId:null,position:"right",commentAnnotationPositionMap:{},user:null,unreadCommentsMap:null}),this.subscriptions=[],this.componentId="velt-comments-minimap",this.loggingService.log("%c[WB] Creating CLASS: CommentsMinimapComponent","color: blue;")}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{unreadCommentsMap:e}),t))}))}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent ngOnInit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))}),e?.commentAnnotations&&setTimeout(()=>{this.setCommentAnnotationPositionMap()},200)}catch(t){this.loggingService.catch("Error in CommentsMinimapComponent ngOnChanges: ",t)}}trackByAnnotationId(e,t){return t?.annotation?.annotationId||e}setCommentAnnotationPositionMap(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{commentAnnotationPositionMap:{}}),e)),this.commentAnnotations.forEach(e=>{let t=null;if(e.targetElement||e.areaAnnotationId?t=document.getElementById(`comment-pin-container-${e.annotationId}`):t=document.querySelector(`[data-velt-id='${e.annotationId}']`),t){let r=this.getElementPosition(t)?.percentageOfTotalHeight;r!=null&&this.componentConfigSignal.update(a=>(a=D(E({},a),{commentAnnotationPositionMap:D(E({},a.commentAnnotationPositionMap),{[e.annotationId]:{annotation:e,top:r,element:t}})}),a))}})}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent setCommentAnnotationPositionByCommentAnnotationIndex: ",e)}}scrollToAnnotation(e){try{let t=this.componentConfigSignal().commentAnnotationPositionMap[e];t&&t.element&&t.element.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}catch(t){this.loggingService.catch("Error in CommentsMinimapComponent scrollToAnnotation: ",t)}}getElementPosition(e){try{let t=0,r=e,a=this.componentConfigSignal().targetScrollableElementId&&document.getElementById(this.componentConfigSignal().targetScrollableElementId);for(;r&&(t+=r.offsetTop||0,r=r.offsetParent,!(a&&r===a)););let s=0;if(a)s=a.scrollHeight;else{let p=document.body,g=document.documentElement;s=Math.max(p.scrollHeight,p.offsetHeight,g.clientHeight,g.scrollHeight,g.offsetHeight)}let c=t/s*100;return{pixelsFromTop:t,percentageOfTotalHeight:c}}catch(t){return this.loggingService.catch("Error in CommentsMinimapComponent getElementPosition: ",t),null}}ngOnDestroy(){try{this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(we),h(_),h(R))},o.\u0275cmp=O({type:o,selectors:[["app-comments-minimap"]],inputs:{commentAnnotations:"commentAnnotations",user:"user",targetScrollableElementId:"targetScrollableElementId",position:"position"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[[4,"ngIf"],[1,"v-comments-minimap-container"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"v-comment-minimap-pin",3,"click"],[1,"v-comment-count"]],template:function(t,r){t&1&&u(0,Bnn,5,13,"ng-container",0),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,cp,ge],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}[_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-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)}.v-comments-minimap-container[_ngcontent-%COMP%]{display:block;position:fixed;height:100vh;top:0;right:0;background:#00000014;z-index:var(--velt-comments-minimap-z-index)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%]{position:absolute;right:0;width:12px;height:4px;flex-shrink:0;border-radius:var(--velt-border-radius-2xs);border:1px solid rgba(255,255,255,.16);background:color-mix(in srgb,var(--velt-accent) 80%,transparent);cursor:pointer}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]{position:absolute;top:50%;right:20px;z-index:1000;min-width:max-content;background:color-mix(in srgb,var(--velt-accent) 80%,transparent);font-size:var(--velt-font-size-xs);padding:var(--velt-spacing-xs) var(--velt-spacing-sm);border-radius:var(--velt-border-radius-xs);transform:translateY(-50%);color:var(--velt-accent-foreground);display:none}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]:after{content:"";position:absolute;border-style:solid;border-width:4px 0 4px 4px;border-color:transparent color-mix(in srgb,var(--velt-accent) 80%,transparent);display:block;width:0;z-index:1;right:calc(var(--velt-spacing-xs) * -1);top:50%;transform:translateY(-50%)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%]:hover .v-comment-count[_ngcontent-%COMP%]{display:block}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin.v-unread-comment[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--velt-error) 80%,transparent)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin.v-unread-comment[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--velt-error) 80%,transparent)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin.v-unread-comment[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]:after{border-color:transparent color-mix(in srgb,var(--velt-error) 80%,transparent)}.v-comments-minimap-container.velt-comments-minimap-container--target-scrollable-element[_ngcontent-%COMP%]{position:absolute;height:100%}.v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%], .v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%]{right:auto;left:0}.v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]{right:auto;left:20px}.v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]:after{right:auto;left:calc(var(--velt-spacing-xs) * -1);border-width:4px 4px 4px 0}'],changeDetection:0});let i=o;return i})();function Vnn(i,o){i&1&&He(0)}function Unn(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,Vnn,1,0,"ng-container",6),b()),i&2){l();let n=me(3);m(),d("ngTemplateOutlet",n)}}function jnn(i,o){if(i&1&&(w(0,"snippyly-comments-stream-view",10),P(1,"translate")),i&2){let n=l(3).ngIf,e=l();d("commentPinAnnotations",n.commentPinAnnotationsForStreamView)("streamViewContainerId",e.streamViewContainerId),T("data-testid",e.componentId+"-stream")("role","complementary")("aria-label",M(1,5,"Comments stream view"))}}function $nn(i,o){if(i&1&&(w(0,"snippyly-comment-inbox",11),P(1,"translate")),i&2){let n=l(3).ngIf,e=l();d("darkMode",n.darkMode)("commentAnnotation",n.selectedCommentAnnotation),T("data-testid",e.componentId+"-inbox")("role","complementary")("aria-label",M(1,5,"Comments inbox"))}}function Hnn(i,o){if(i&1&&(w(0,"app-comments-minimap",12),P(1,"translate")),i&2){let n=l(3).ngIf,e=l();d("commentAnnotations",n.commentPinAnnotations)("user",n.user)("position",n.minimapPosition),T("data-testid",e.componentId+"-minimap")("role","complementary")("aria-label",M(1,6,"Comments location overview"))}}function znn(i,o){if(i&1&&(w(0,"snippyly-comment-adder"),u(1,jnn,2,7,"snippyly-comments-stream-view",7)(2,$nn,2,7,"snippyly-comment-inbox",8)(3,Hnn,2,8,"app-comments-minimap",9)),i&2){let n=l(2).ngIf,e=l();T("data-testid",e.componentId+"-adder"),m(),d("ngIf",n.streamMode&&n.commentsOnDom),m(),d("ngIf",n.inboxMode&&n.commentsOnDom),m(),d("ngIf",n.minimapEnabled&&n.commentsOnDom)}}function Gnn(i,o){if(i&1&&(v(0),u(1,Unn,2,1,"velt-shadow-dom-internal",5)(2,znn,4,4,"ng-template",null,0,Ee),C()),i&2){let n=me(3),e=l().ngIf;m(),d("ngIf",e.shadowDOM)("ngIfElse",n)}}function Wnn(i,o){if(i&1){let n=K();v(0),u(1,Gnn,4,2,"ng-container",1),y(2,"div",2)(3,"slot",3),G("slotchange",function(t){N(n);let r=l();return F(r.handleCommentPinSlotChanged(t))}),b()(),w(4,"app-persistent-comment-mode",4),C()}if(i&2){let n=o.ngIf,e=l();m(),d("ngIf",n.isFirstComponent),m(),T("aria-hidden","true")("data-testid",e.componentId+"-slot-container"),m(2),d("componentConfigSignal",e.componentConfigSignal),T("data-testid",e.componentId+"-persistent-mode")}}var Nq=(()=>{let o=class o{set textMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextComments():this.commentService.disableTextComments()}set popoverMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePopoverMode():this.commentService.disablePopoverMode()}set popoverTriangleComponent(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePopoverTriangleComponent():this.commentService.disablePopoverTriangleComponent()}set forceCloseAllOnEsc(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableForceCloseAllOnEsc():this.commentService.disableForceCloseAllOnEsc()}set collapsedComments(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCollapsedComments():this.commentService.disableCollapsedComments()}set shortUserName(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableShortUserName():this.commentService.disableShortUserName()}catch{}}set readOnly(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableReadOnly():this.commentService.disableReadOnly()}catch{}}set deleteThreadWithFirstComment(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeleteThreadWithFirstComment():this.commentService.disableDeleteThreadWithFirstComment()}catch{}}set resolveStatusAccessAdminOnly(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableResolveStatusAccessAdminOnly():this.commentService.disableResolveStatusAccessAdminOnly()}set svgAsImg(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSvgAsImg():this.commentService.disableSvgAsImg()}catch{}}set commentToNearestAllowedElement(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCommentToNearestAllowedElement():this.commentService.disableCommentToNearestAllowedElement()}catch{}}set floatingCommentDialog(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.disableFloatingComments(!t)}set moderatorMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setModeratorMode(t)}set assignToType(e){try{this.commentService.setAssignToType({type:e})}catch{}}set _streamMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setStreamMode(t)}set atHereLabel(e){e&&this.contactService.setAtHereLabel(e)}set _atHereEnabled(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.contactService.enableAtHere():this.contactService.disableAtHere()}set _deleteReplyConfirmation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeleteReplyConfirmation():this.commentService.disableDeleteReplyConfirmation()}set _expandMentionGroups(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableExpandMentionGroups():this.commentService.disableExpandMentionGroups()}set _showMentionGroupsFirst(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableShowMentionGroupsFirst():this.commentService.disableShowMentionGroupsFirst()}set _linkCallback(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableLinkCallback():this.commentService.disableLinkCallback()}set _showMentionGroupsOnly(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableShowMentionGroupsOnly():this.commentService.disableShowMentionGroupsOnly()}set _fullExpanded(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFullExpanded():this.commentService.disableFullExpanded()}catch{}}set _draftMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDraftMode():this.commentService.disableDraftMode()}catch{}}set atHereDescription(e){e&&this.contactService.setAtHereDescription(e)}set _persistentCommentMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePersistentCommentMode():this.commentService.disablePersistentCommentMode()}set _seenByUsers(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSeenByUsers():this.commentService.disableSeenByUsers()}set signInButton(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableSignInButton(t)}set upgradeButton(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableUpgradeButton(t)}set attachments(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableAttachment(t)}set recordings(e){let t=e;typeof e=="string"&&(t=e?.split(",")?.map(r=>r.trim()),this.commentService.setAllowedRecordings(t))}set reactions(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableReactions():this.commentService.disableReactions()}set deviceInfo(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.showScreenSizeInfo(t)}set commentIndex(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.showCommentIndex(t)}set dialogOnHover(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableDialogOnHover(t)}set dialogOnTargetElementClick(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableDialogOnTargetElementClick(t)}set priority(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnablePriority(t)}set status(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableStatus(t)}set resolveButton(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableResolve(t)}set _inboxMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableInboxMode():this.commentService.disableInboxMode()}set _suggestionMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setSuggestionMode(t)}set _mobileMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setMobileMode(t)}set _inlineCommentMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableInlineCommentMode():this.commentService.disableInlineCommentMode()}set _privateCommentMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePrivateCommentMode():this.commentService.disablePrivateCommentMode()}set _minimap(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableMinimap():this.commentService.disableMinimap()}set _minimapPosition(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{minimapPosition:e}),t)),this.commentService.setAnalyticsFeatureConfig({config:{minimapPosition:e}})}catch{}}set _ghostComments(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGhostComments():this.commentService.disableGhostComments()}set _ghostCommentsIndicator(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGhostCommentsMessage():this.commentService.disableGhostCommentsMessage()}set _commentsOnDom(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.showCommentsOnDom():this.commentService.hideCommentsOnDom()}set _resolvedCommentsOnDom(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.showResolvedCommentsOnDom():this.commentService.hideResolvedCommentsOnDom()}set _filterCommentsOnDom(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFilterCommentsOnDom():this.commentService.disableFilterCommentsOnDom()}catch{}}set _bubbleOnPin(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableBubbleOnPin():this.commentService.disableBubbleOnPin()}catch{}}set _bubbleOnPinHover(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableBubbleOnPinHover():this.commentService.disableBubbleOnPinHover()}catch{}}set _multiThreadMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableMultiThread():this.commentService.disableMultiThread()}catch{}}set _multiThread(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableMultiThread():this.commentService.disableMultiThread()}catch{}}set _maxReplyAvatars(e){try{let t=e;typeof e=="string"&&(t=parseInt(e)),this.commentService.setMaxReplyAvatars(t)}catch{}}set _replyAvatars(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableReplyAvatars():this.commentService.disableReplyAvatars()}catch{}}set _groupMultipleMatch(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGroupMatchedComments():this.commentService.disableGroupMatchedComments()}catch{}}set _groupMatchedComments(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGroupMatchedComments():this.commentService.disableGroupMatchedComments()}catch{}}set _commentTool(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCommentTool():this.commentService.disableCommentTool()}set _sidebarButtonOnCommentDialog(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarButtonOnCommentDialog():this.commentService.disableSidebarButtonOnCommentDialog()}set _deviceIndicatorOnCommentPins(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeviceIndicatorOnCommentPins():this.commentService.disableDeviceIndicatorOnCommentPins()}catch{}}set _scrollToComment(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableScrollToComment():this.commentService.disableScrollToComment()}set _userMentions(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableUserMentions():this.commentService.disableUserMentions()}set _paginatedContactList(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePaginatedContactList():this.commentService.disablePaginatedContactList()}set _deleteOnBackspace(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeleteOnBackspace():this.commentService.disableDeleteOnBackspace()}catch{}}set _hotkey(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableHotkey():this.commentService.disableHotkey()}catch{}}set _recordingSummary(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableRecordingSummary():this.commentService.disableRecordingSummary()}catch{}}set _recordingTranscription(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.recorderAnnotationService.enableRecordingTranscription():this.recorderAnnotationService.disableRecordingTranscription()}catch{}}set _allowedFileTypes(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedFileTypes(t)}catch{}}set _recordingCountdown(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableRecordingCountdown():this.commentService.disableRecordingCountdown()}catch{}}set _unreadIndicatorMode(e){try{this.commentService.setUnreadIndicatorMode(e)}catch{}}set _enterKeyToSubmit(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableEnterKeyToSubmit():this.commentService.disableEnterKeyToSubmit()}catch{}}set _pinShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePinShadowDOM():this.commentService.disablePinShadowDOM()}catch{}}set _dialogShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDialogShadowDOM():this.commentService.disableDialogShadowDOM()}catch{}}set _persistentCommentShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{persistentCommentShadowDOM:!!t}),r)),this.commentService.setAnalyticsFeatureConfig({config:{persistentCommentShadowDOM:!!t}})}catch{}}set _shadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{shadowDOM:!!t,persistentCommentShadowDOM:!!t}),r)),this.componentConfigSignal().shadowDOM?(this.commentService.enableDialogShadowDOM(),this.commentService.enablePinShadowDOM(),this.commentService.enableTextCommentToolShadowDOM(),this.commentService.enableTextCommentToolbarShadowDOM()):(this.commentService.disableDialogShadowDOM(),this.commentService.disablePinShadowDOM(),this.commentService.disableTextCommentToolShadowDOM(),this.commentService.disableTextCommentToolbarShadowDOM()),this.commentService.setAnalyticsFeatureConfig({config:{shadowDom:!!t}})}catch{}}set _textCommentToolShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolShadowDOM():this.commentService.disableTextCommentToolShadowDOM()}catch{}}set _pinDarkMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePinDarkMode():this.commentService.disablePinDarkMode()}catch{}}set _textCommentToolDarkMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolDarkMode():this.commentService.disableTextCommentToolDarkMode()}catch{}}set _textCommentToolbarDarkMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolbarDarkMode():this.commentService.disableTextCommentToolbarDarkMode()}catch{}}set _textCommentToolbarShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolbarShadowDOM():this.commentService.disableTextCommentToolbarShadowDOM()}catch{}}set _changeDetectionInCommentMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableChangeDetectionInCommentMode():this.commentService.disableChangeDetectionInCommentMode()}catch{}}set _areaComment(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableAreaComment():this.commentService.disableAreaComment()}catch{}}set _screenshot(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableScreenshot():this.commentService.disableScreenshot()}catch{}}set _pinCursorImage(e){try{this.commentService.setPinCursorImage(e||"")}catch{}}set allowedElementIds(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedElementIds(t)}catch{}}set allowedElementClassNames(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedElementClassNames(t)}catch{}}set allowedElementQuerySelectors(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedElementQuerySelectors(t)}catch{}}set _commentPinHighlighter(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCommentPinHighlighter():this.commentService.disableCommentPinHighlighter()}catch{}}set _customReactions(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setCustomReactions(t)}catch{}}set customStatus(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setCustomStatuses(t)}set customListDataOnAnnotation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.createCustomListDataOnAnnotation(t)}set customListDataOnComment(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.autocompleteService.create(t)}set attachmentDownload(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableAttachmentDownload(t)}set attachmentNameInMessage(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableAttachmentNameInMessage():this.commentService.disableAttachmentNameInMessage()}set customPriority(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.customFilterService.setCustomPriorityFilters(t)}set _customAutocompleteSearch(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCustomAutocompleteSearch():this.commentService.disableCustomAutocompleteSearch()}catch{}}set _autoCompleteScrollConfig(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAutoCompleteScrollConfig(t)}catch{}}set customCategory(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.customFilterService.setCustomCategories(t)}set composerMode(e){this.commentService.setComposerMode(e)}set autoCategorize(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableAutoCategorize(!!t)}catch(t){this.loggingService.catch("Error in CommentsContainerComponent set autoCategorize: ",t)}}set commentplaceholder(e){try{let t=e;this.commentService.setCommentplaceholder(t)}catch(t){this.loggingService.catch("Error in CommentsContainerComponent set autoCategorize: ",t)}}set replyplaceholder(e){try{let t=e;this.commentService.setReplyplaceholder(t)}catch(t){this.loggingService.catch("Error in CommentsContainerComponent set autoCategorize: ",t)}}set isDarkMode(e){this._darkAttribute=e,this.checkDarkMode(),this.commentService.setCommentContainerDarkMode(e===""||e==="true")}constructor(e,t,r,a,s,c,p,g,f,I,x,B,z){this.analyticsService=e,this.authService=t,this.domService=r,this.commentService=a,this.commentPinPortalService=s,this.commentTextPortalService=c,this.customFilterService=p,this.loggingService=g,this.elementRef=f,this.autocompleteService=I,this.contactService=x,this.recorderAnnotationService=B,this.docService=z,this.onCommentAdd=new Me,this.onSignIn=new Me,this.onUpgrade=new Me,this.onCustomPinInject=new Me,this.onCommentUpdate=new Me,this.onCommentAccept=new Me,this.onCommentReject=new Me,this.onSidebarButtonOnCommentDialogClick=new Me,this.onCommentSelectionChange=new Me,this.onCopyLink=new Me,this.subscriptions=[],this.selectedAnnotationsMap={},this.commentAnnotationFocused=!1,this.enableGhostComments=!1,this.resolvedCommentsOnDom=!1,this.scrollToComment=!1,this.componentConfigSignal=Te({addCommentMode:!1,commentPinAnnotations:[],multiThreadCommentPinAnnotations:[],commentPinAnnotationsForStreamView:[],commentsOnDom:!1,inboxMode:!1,isFirstComponent:!0,minimapEnabled:!1,minimapPosition:"right",persistentCommentMode:!1,persistentModeBanner:!1,privateCommentModeEnabled:!1,selectedCommentAnnotation:void 0,shadowDOM:!0,streamMode:!1,user:null,darkMode:!1,disableCommentMode:this.disableCommentMode.bind(this),persistentCommentShadowDOM:!0,assignToType:"dropdown"}),this.veltId=vt(),this.veltElement=!0,this.componentId="velt-comments-container";try{this.loggingService.log("%c[WB] Creating CLASS: CommentsContainerComponent","color: blue;"),this._darkAttribute=this.elementRef.nativeElement.getAttribute("dark");let W=new URL(window.location.href);this.focusCommentAnnotationId=W.searchParams.get(U.URL_PARAMS.COMMENT_ID),this.commentService.setCommentAddedEmitter(this.onCommentAdd)}catch(W){this.loggingService.catch("Error in CommentsContainerComponent constructor: ",W)}}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentsContainerComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsContainerComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in SubtitlesComponent ngOnChanges: ",t)}}ngAfterViewInit(){try{let e=document.querySelector(U.TAGS.SNIPPYLY_COMMENTS),t=document.querySelector(U.TAGS.VELT_COMMENTS);document.querySelector(`${U.TAGS.VELT_COMMENTS}[${U.ATTRIBUTES.VELT_IS_FIRST_COMPONENT}]`)||(t?this.veltId===t?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(a=>(a=D(E({},a),{isFirstComponent:!0}),a)),t?.setAttribute(U.ATTRIBUTES.VELT_IS_FIRST_COMPONENT,"true"),this.initComponent()):this.veltId===e?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(a=>(a=D(E({},a),{isFirstComponent:!0}),a)),e?.setAttribute(U.ATTRIBUTES.VELT_IS_FIRST_COMPONENT,"true"),this.initComponent()))}catch(e){this.loggingService.catch("Error in CommentsContainerComponent AfterViewInit: ",e)}}initComponent(){try{this.commentService.addAreaContainerTag(),this.subscriptions.push(this.authService.getUser$().pipe(Le(e=>!!e)).subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t)),e&&this.setCommentInstalledInAnalytics()},e=>{this.loggingService.catch("Error in getUser: ",e)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{streamMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getStreamMode$ subscription: ",e)})),this.subscriptions.push(this.docService.getDocumentPaths$().subscribe(()=>{this.getAllCommentsOnCurrentDocument()},e=>{this.loggingService.catch("Error in CommentsContainerComponent getDocumentPaths$ subscription: ",e)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{inboxMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getInboxMode$ subscription: ",e)})),this.subscriptions.push(this.commentService.getMinimap$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{minimapEnabled:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getMinimap$ subscription: ",e)})),this.subscriptions.push(this.commentService.addCommentModeChange().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{addCommentMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent addCommentModeChange subscription: ",e)})),this.subscriptions.push(this.commentService.persistentCommentModeChange().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{persistentCommentMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent persistentCommentModeChange subscription: ",e)})),this.subscriptions.push(this.commentService.persistentModeBannerChange().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{persistentModeBanner:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent persistentModeBannerChange subscription: ",e)})),this.subscriptions.push(this.commentService.getPrivateCommentMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{privateCommentModeEnabled:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getPrivateCommentMode$ subscription: ",e)})),this.subscriptions.push(this.commentService.getScrollToComment$().subscribe(e=>{this.scrollToComment=e},e=>{this.loggingService.catch("Error in CommentsContainerComponent getScrollToComment$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSignInButtonClick$().subscribe(()=>{this.onSignIn.emit()},e=>{this.loggingService.catch("Error in CommentsContainerComponent getSignInButtonClick$ subscription: ",e)})),this.subscriptions.push(this.commentService.getUpgradeButtonClick$().subscribe(()=>{this.onUpgrade.emit()},e=>{this.loggingService.catch("Error in CommentsContainerComponent getUpgradeButtonClick$ subscription: ",e)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(e=>{this.selectedAnnotationsMap=e},e=>{this.loggingService.catch("Error in CommentsContainerComponent getSidebarVisibility$ subscription: ",e)})),this.subscriptions.push(this.commentPinPortalService.getCustomPinEvents$().subscribe(e=>{this.onCustomPinInject.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent getCustomPinEvents$ subscription: ",e)})),this.subscriptions.push(this.commentService.commentUpdated$.subscribe(e=>{this.onCommentUpdate.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent commentUpdated$ subscription: ",e)})),this.subscriptions.push(this.commentService.commentAccepted$.subscribe(e=>{this.onCommentAccept.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent commentAccepted$ subscription: ",e)})),this.subscriptions.push(this.commentService.commentRejected$.subscribe(e=>{this.onCommentReject.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent commentRejected$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSidebarButtonOnCommentDialogClick$().subscribe(e=>{this.onSidebarButtonOnCommentDialogClick.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent getSidebarButtonOnCommentDialogClick$ subscription: ",e)})),this.subscriptions.push(this.commentService.onCommentSelectionChange$().subscribe(e=>{this.onCommentSelectionChange.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent onCommentSelectionChange$ subscription: ",e)})),this.subscriptions.push(this.commentService.getCopyLink$().subscribe(e=>{this.onCopyLink.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent getCopyLink$ subscription: ",e)})),this.getAllCommentsOnCurrentDocument()}catch(e){this.loggingService.catch("Error in CommentsContainerComponent initComponent: ",e)}}getAllCommentsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentsOnCurrentDocument","color: green;");try{this.subscriptions.push(this.commentService.getCommentsOnDom$().pipe(fe(e=>(this.componentConfigSignal.update(t=>(t=D(E({},t),{commentsOnDom:e}),t)),this.componentConfigSignal().commentsOnDom?mn([this.commentService.getAllCommentAnnotations({detectGhostComments:!0,addFilterCommentsOnDomCheck:!0,analytics:{enabled:!0,properties:{source:"internal",sourceId:"commentsContainer"}}}),this.commentService.getAllMultiThreadCommentAnnotations(void 0,void 0,void 0,!0)]).pipe(de(([t,r])=>[...t||[],...r||[]]),fe(t=>this.commentService.getEnableGhostComments$().pipe(de(r=>(this.enableGhostComments=r,t)))),fe(t=>this.commentService.getCommentsOnDom$().pipe(de(r=>(this.componentConfigSignal.update(a=>(a=D(E({},a),{commentsOnDom:r}),a)),t)))),fe(t=>this.commentService.getResolvedCommentsOnDom$().pipe(de(r=>(this.resolvedCommentsOnDom=r,t)))),fe(t=>this.domService.getSelectedAnnotationsMap$().pipe(de(r=>({filteredAnnotations:t||[],selectedAnnotationsMap:r||{}}))))):le({filteredAnnotations:[],selectedAnnotationsMap:{}})))).subscribe(e=>{try{this.loggingService.log(e),this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinAnnotations:e?.filteredAnnotations}),s)),this.commentService.setCommentAnnotationsFromCommentsContainer(this.componentConfigSignal().commentPinAnnotations);let t;this.componentConfigSignal().commentPinAnnotations.forEach(s=>{this.selectedAnnotationsMap[s?.annotationId]&&(s?.multiThreadAnnotationId||(t=s))}),this.componentConfigSignal.update(s=>(s=D(E({},s),{selectedCommentAnnotation:t}),s));let r=this.componentConfigSignal().commentPinAnnotations.filter(s=>s.targetElement&&s?.position);r=r.filter(s=>{let c=!0;return s?.ghostComment?.type===Tl.DIFFERENT_DEVICE&&!s?.ghostComment?.isSameGroup&&(e.selectedAnnotationsMap[s.annotationId]||(c=!1)),s?.ghostComment&&!this.enableGhostComments&&(c=!1),!this.resolvedCommentsOnDom&&!(this.commentService.getFilterCommentsOnDom()&&this.commentService.getCommentsFromSidebarMap())&&s.status!==void 0&&s.status.type==="terminal"&&(e.selectedAnnotationsMap[s.annotationId]||(c=!1)),c}),this.commentPinPortalService.checkPinsToRemove(r),r.forEach(s=>{this.commentPinPortalService.setCommentPin(s)});let a=this.componentConfigSignal().commentPinAnnotations.filter(s=>s.targetTextRange);a=a.filter(s=>!(!this.resolvedCommentsOnDom&&!(this.commentService.getFilterCommentsOnDom()&&this.commentService.getCommentsFromSidebarMap())&&s.status!==void 0&&s.status.type==="terminal"&&!e.selectedAnnotationsMap[s.annotationId])),this.commentTextPortalService.updateTextCommentAnnotations(a),this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinAnnotationsForStreamView:this.componentConfigSignal().commentPinAnnotations.slice()}),s)),this.focusCommentAnnotation()}catch(t){this.loggingService.catch("Error in CommentsContainerComponent getAllCommentsOnCurrentDocument inside subscription: ",t)}},e=>{this.loggingService.catch("Error in CommentsContainerComponent getAllCommentsOnCurrentDocument subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CommentsContainerComponent getAllCommentsOnCurrentDocument: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),this.commentService.setContextProvider(null),this.commentService.setCommentAddedEmitter(null),this.componentConfigSignal().isFirstComponent&&this.commentService.setCommentAnnotationsFromCommentsContainer([])}catch(e){this.loggingService.catch("Error in CommentsContainerComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in CommentsContainerComponent unsubscribe: ",e)}}handleCommentPinSlotChanged(e){try{let t=e.target;if(t.assignedElements().length>0){let r=t.assignedElements()[0];this.commentPinPortalService.setCommentPinOverrideTemplate(r)}}catch(t){this.loggingService.catch("Error in CommentsContainerComponent handleCommentPinSlotChanged: ")}}focusCommentAnnotation(){if(this.focusCommentAnnotationId&&!this.commentAnnotationFocused){let e=this.componentConfigSignal().commentPinAnnotations.find(t=>t.annotationId===this.focusCommentAnnotationId);e&&(this.commentAnnotationFocused=!0,sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e.annotationId),this.selectedAnnotationsMap[e.annotationId]||this.domService.toggleAnnotationSelection(e),setTimeout(()=>{let t=null;e.targetElement||e.areaAnnotationId?t=document.getElementById(`comment-pin-container-${e.annotationId}`):(t=document.querySelector(`[data-velt-id='${e.annotationId}']`),sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e.annotationId)),t||(t=document.querySelector(`${U.TAGS.VELT_COMMENT_TEXT}[${U.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)),t&&this.scrollToComment&&t.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},100))}}setCommentInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(Ne.COMMENT)}catch(e){this.loggingService.catch("Error in CommentsContainerComponent setCommentInstalledInAnalytics: ",e)}}disableCommentMode(){try{this.commentService.disableAddCommentMode()}catch(e){this.loggingService.catch("Error in CommentsContainerComponent disableCommentMode: ",e)}}checkDarkMode(){try{this._darkAttribute===""?this.componentConfigSignal.update(e=>(e=D(E({},e),{darkMode:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{darkMode:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsContainerComponent checkDarkMode: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(Ve),h(we),h(G1),h(g7),h(Wo),h(_),h(R),h(Fl),h(Ii),h(Wi),h(ot))},o.\u0275cmp=O({type:o,selectors:[["app-comments-container"]],hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{textMode:"textMode",popoverMode:"popoverMode",popoverTriangleComponent:"popoverTriangleComponent",forceCloseAllOnEsc:"forceCloseAllOnEsc",collapsedComments:"collapsedComments",shortUserName:"shortUserName",readOnly:"readOnly",deleteThreadWithFirstComment:"deleteThreadWithFirstComment",resolveStatusAccessAdminOnly:"resolveStatusAccessAdminOnly",svgAsImg:"svgAsImg",commentToNearestAllowedElement:"commentToNearestAllowedElement",floatingCommentDialog:"floatingCommentDialog",moderatorMode:"moderatorMode",assignToType:"assignToType",_streamMode:[0,"streamMode","_streamMode"],atHereLabel:"atHereLabel",_atHereEnabled:[0,"atHereEnabled","_atHereEnabled"],_deleteReplyConfirmation:[0,"deleteReplyConfirmation","_deleteReplyConfirmation"],_expandMentionGroups:[0,"expandMentionGroups","_expandMentionGroups"],_showMentionGroupsFirst:[0,"showMentionGroupsFirst","_showMentionGroupsFirst"],_linkCallback:[0,"linkCallback","_linkCallback"],_showMentionGroupsOnly:[0,"showMentionGroupsOnly","_showMentionGroupsOnly"],_fullExpanded:[0,"fullExpanded","_fullExpanded"],_draftMode:[0,"draftMode","_draftMode"],atHereDescription:"atHereDescription",_persistentCommentMode:[0,"persistentCommentMode","_persistentCommentMode"],_seenByUsers:[0,"seenByUsers","_seenByUsers"],signInButton:"signInButton",upgradeButton:"upgradeButton",attachments:"attachments",recordings:"recordings",reactions:"reactions",deviceInfo:"deviceInfo",commentIndex:"commentIndex",dialogOnHover:"dialogOnHover",dialogOnTargetElementClick:"dialogOnTargetElementClick",priority:"priority",status:"status",resolveButton:"resolveButton",_inboxMode:[0,"inboxMode","_inboxMode"],_suggestionMode:[0,"suggestionMode","_suggestionMode"],_mobileMode:[0,"mobileMode","_mobileMode"],_inlineCommentMode:[0,"inlineCommentMode","_inlineCommentMode"],_privateCommentMode:[0,"privateCommentMode","_privateCommentMode"],_minimap:[0,"minimap","_minimap"],_minimapPosition:[0,"minimapPosition","_minimapPosition"],_ghostComments:[0,"ghostComments","_ghostComments"],_ghostCommentsIndicator:[0,"ghostCommentsIndicator","_ghostCommentsIndicator"],_commentsOnDom:[0,"commentsOnDom","_commentsOnDom"],_resolvedCommentsOnDom:[0,"resolvedCommentsOnDom","_resolvedCommentsOnDom"],_filterCommentsOnDom:[0,"filterCommentsOnDom","_filterCommentsOnDom"],_bubbleOnPin:[0,"bubbleOnPin","_bubbleOnPin"],_bubbleOnPinHover:[0,"bubbleOnPinHover","_bubbleOnPinHover"],_multiThreadMode:[0,"multiThreadMode","_multiThreadMode"],_multiThread:[0,"multiThread","_multiThread"],_maxReplyAvatars:[0,"maxReplyAvatars","_maxReplyAvatars"],_replyAvatars:[0,"replyAvatars","_replyAvatars"],_groupMultipleMatch:[0,"groupMultipleMatch","_groupMultipleMatch"],_groupMatchedComments:[0,"groupMatchedComments","_groupMatchedComments"],_commentTool:[0,"commentTool","_commentTool"],_sidebarButtonOnCommentDialog:[0,"sidebarButtonOnCommentDialog","_sidebarButtonOnCommentDialog"],_deviceIndicatorOnCommentPins:[0,"deviceIndicatorOnCommentPins","_deviceIndicatorOnCommentPins"],_scrollToComment:[0,"scrollToComment","_scrollToComment"],_userMentions:[0,"userMentions","_userMentions"],_paginatedContactList:[0,"paginatedContactList","_paginatedContactList"],_deleteOnBackspace:[0,"deleteOnBackspace","_deleteOnBackspace"],_hotkey:[0,"hotkey","_hotkey"],_recordingSummary:[0,"recordingSummary","_recordingSummary"],_recordingTranscription:[0,"recordingTranscription","_recordingTranscription"],_allowedFileTypes:[0,"allowedFileTypes","_allowedFileTypes"],_recordingCountdown:[0,"recordingCountdown","_recordingCountdown"],_unreadIndicatorMode:[0,"unreadIndicatorMode","_unreadIndicatorMode"],_enterKeyToSubmit:[0,"enterKeyToSubmit","_enterKeyToSubmit"],_pinShadowDOM:[0,"pinShadowDom","_pinShadowDOM"],_dialogShadowDOM:[0,"dialogShadowDom","_dialogShadowDOM"],_persistentCommentShadowDOM:[0,"persistentCommentShadowDom","_persistentCommentShadowDOM"],_shadowDOM:[0,"shadowDom","_shadowDOM"],_textCommentToolShadowDOM:[0,"textCommentToolShadowDom","_textCommentToolShadowDOM"],_pinDarkMode:[0,"pinDarkMode","_pinDarkMode"],_textCommentToolDarkMode:[0,"textCommentToolDarkMode","_textCommentToolDarkMode"],_textCommentToolbarDarkMode:[0,"textCommentToolbarDarkMode","_textCommentToolbarDarkMode"],_textCommentToolbarShadowDOM:[0,"textCommentToolbarShadowDom","_textCommentToolbarShadowDOM"],_changeDetectionInCommentMode:[0,"changeDetectionInCommentMode","_changeDetectionInCommentMode"],_areaComment:[0,"areaComment","_areaComment"],_screenshot:[0,"screenshot","_screenshot"],_pinCursorImage:[0,"pinCursorImage","_pinCursorImage"],allowedElementIds:"allowedElementIds",allowedElementClassNames:"allowedElementClassNames",allowedElementQuerySelectors:"allowedElementQuerySelectors",_commentPinHighlighter:[0,"commentPinHighlighter","_commentPinHighlighter"],_customReactions:[0,"customReactions","_customReactions"],customStatus:"customStatus",customListDataOnAnnotation:"customListDataOnAnnotation",customListDataOnComment:"customListDataOnComment",attachmentDownload:"attachmentDownload",attachmentNameInMessage:"attachmentNameInMessage",customPriority:"customPriority",_customAutocompleteSearch:[0,"customAutocompleteSearch","_customAutocompleteSearch"],_autoCompleteScrollConfig:[0,"autoCompleteScrollConfig","_autoCompleteScrollConfig"],customCategory:"customCategory",streamViewContainerId:"streamViewContainerId",composerMode:"composerMode",autoCategorize:"autoCategorize",commentplaceholder:[0,"commentPlaceholder","commentplaceholder"],replyplaceholder:[0,"replyPlaceholder","replyplaceholder"],isDarkMode:[0,"darkMode","isDarkMode"]},outputs:{onCommentAdd:"onCommentAdd",onSignIn:"onSignIn",onUpgrade:"onUpgrade",onCustomPinInject:"onCustomPinInject",onCommentUpdate:"onCommentUpdate",onCommentAccept:"onCommentAccept",onCommentReject:"onCommentReject",onSidebarButtonOnCommentDialogClick:"onSidebarButtonOnCommentDialogClick",onCommentSelectionChange:"onCommentSelectionChange",onCopyLink:"onCopyLink"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[["commentsDataRef",""],[4,"ngIf"],[2,"display","none"],["id","comment-pin-slot","name","comment-pin",3,"slotchange"],[3,"componentConfigSignal"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[3,"commentPinAnnotations","streamViewContainerId",4,"ngIf"],[3,"darkMode","commentAnnotation",4,"ngIf"],[3,"commentAnnotations","user","position",4,"ngIf"],[3,"commentPinAnnotations","streamViewContainerId"],[3,"darkMode","commentAnnotation"],[3,"commentAnnotations","user","position"]],template:function(t,r){t&1&&u(0,Wnn,5,5,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,Ege,nye,iye,l8,Sn,D1,ge],encapsulation:2,changeDetection:0});let i=o;return i})();var qnn=["sidebarRef"],Ynn=i=>({componentConfigSignal:i}),Knn=(i,o)=>({condition:i,data:o}),Znn=(i,o)=>({componentConfigSignal:i,sidebarRef:o}),Xnn=(i,o)=>({template:i,context:o});function Qnn(i,o){if(i&1&&(y(0,"div",5,0),w(2,"app-comment-sidebar-skeleton",6)(3,"app-comment-sidebar-panel",7)(4,"app-comment-sidebar-focused-thread",8),b()),i&2){let n=me(1),e=l(3).ngIf,t=l();pe("s-overflow-hidden",e.moreFiltersVisible)("velt-sidebar--more-filters-visible",e.moreFiltersVisible),T("aria-expanded",e.sidebarVisible),m(2),d("componentConfigSignal",t.componentConfigSignal),m(),d("sidebarRef",n)("componentConfigSignal",t.componentConfigSignal),m(),d("componentConfigSignal",t.componentConfigSignal)("sidebarRef",n)}}function Jnn(i,o){if(i&1){let n=K();v(0),y(1,"div",3),P(2,"translate"),G("click",function(t){N(n);let r=l(3);return F(r.onClick(t))}),u(3,Qnn,5,10,"div",4),b(),C()}if(i&2){let n=l(2).ngIf,e=l();m(),pe("mobile",n.isPhone)("velt-sidebar-container--fullscreen",n.fullScreen)("visible",n.sidebarVisible||n.embedMode||n.floatingMode)("floating",n.floatingMode)("embed",n.embedMode)("page",n.pageMode)("velt-comment-sidebar--read-only",n.readOnly),d("ngClass",n.position),T("data-testid",e.componentId)("aria-label",M(2,18,"Comments sidebar")),m(2),d("veltDynamicTemplate",k(23,Xnn,e.template,k(20,Znn,e.componentConfigSignal,e.sidebarRef)))}}function ein(i,o){if(i&1&&(v(0),u(1,Jnn,4,26,"ng-container",1),C()),i&2){let n=l().ngIf;m(),d("ngIf",n)}}function tin(i,o){if(i&1&&(v(0),u(1,ein,2,1,"ng-container",2),C()),i&2){let n=l();m(),d("veltIf",k(3,Knn,n.conditionSignal(),A(1,Ynn,n.componentConfigSignal)))}}var rye=(()=>{let o=class o extends nt{constructor(e,t,r,a){super(e,t,void 0,void 0,void 0,a,r),this.elementRef=e,this.themeService=t,this.loggingService=r,this.dynamicDataService=a,this.onWrapperClick=new Me,this.componentId="velt-comments-sidebar-wrapper",super.initializeComponentConfigSignal(new Ye)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentsSidebarWrapperComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentsSidebarWrapperComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}onClick(e){try{this.onWrapperClick.emit(e)}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(R),h(Ke),h(_),h(S))},o.\u0275cmp=O({type:o,selectors:[["velt-comments-sidebar-wrapper-internal"]],viewQuery:function(t,r){if(t&1&&it(qnn,7),t&2){let a;et(a=tt())&&(r.sidebarRef=a.first)}},outputs:{onWrapperClick:"onWrapperClick"},standalone:!1,features:[V([S]),L],decls:1,vars:1,consts:[["sidebarRef",""],[4,"ngIf"],[4,"veltIf"],["data-velt-element","true","data-velt-comment-disabled","true","role","complementary",1,"velt-sidebar-container",3,"click","ngClass"],["class","velt-sidebar","role","region",3,"s-overflow-hidden","velt-sidebar--more-filters-visible",4,"veltDynamicTemplate"],["role","region",1,"velt-sidebar"],[3,"componentConfigSignal"],[3,"sidebarRef","componentConfigSignal"],[3,"componentConfigSignal","sidebarRef"]],template:function(t,r){t&1&&u(0,tin,2,6,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Qr,X,ie,Lf,Ff,M1,se,ge],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}[_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-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-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-sidebar-container[_ngcontent-%COMP%]{height:100vh;width:calc((26rem + 0px) * var(--velt-base-rem-unit));position:fixed;top:0;padding:var(--velt-spacing-lg);box-sizing:border-box;z-index:999999997}.velt-sidebar-container.velt-sidebar-container--fullscreen[_ngcontent-%COMP%]{width:100vw;padding:0}.velt-sidebar-container.velt-sidebar-container--fullscreen[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]{border-radius:0;border:0}.velt-sidebar-container.velt-sidebar-container--fullscreen.left[_ngcontent-%COMP%], .velt-sidebar-container.velt-sidebar-container--fullscreen.right[_ngcontent-%COMP%]{transition:none}.velt-sidebar-container.left[_ngcontent-%COMP%]{left:-100%;transition:width .5s ease-in-out,left .5s ease-in-out}.velt-sidebar-container.left.visible[_ngcontent-%COMP%]{left:0}.velt-sidebar-container.right[_ngcontent-%COMP%]{right:-100%;transition:width .5s ease-in-out,right .5s ease-in-out}.velt-sidebar-container.right.visible[_ngcontent-%COMP%]{right:0}.velt-sidebar-container.mobile[_ngcontent-%COMP%]{width:100%;height:100%;box-sizing:border-box;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.velt-sidebar-container.embed[_ngcontent-%COMP%]{width:100%;height:100%;position:unset;border:0}.velt-sidebar-container.floating[_ngcontent-%COMP%]{height:90vh;position:unset;border:0;padding:0;width:calc((22.5rem + 0px) * var(--velt-base-rem-unit))}.velt-sidebar-container.floating.embed[_ngcontent-%COMP%]{width:100%;height:100%}.velt-sidebar-container.page[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]{padding-bottom:0}.velt-sidebar-container[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{box-sizing:border-box}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-lg);font-weight:400;font-size:var(--velt-font-size-sm);line-height:21px;align-items:center;background:var(--velt-background-0);border-radius:var(--velt-border-radius-lg);width:100%;overflow-x:hidden;position:relative;height:100%;border:1px solid var(--velt-border-5)}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%] app-comment-sidebar-filter[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-user-select:none;user-select:none;pointer-events:none}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar.velt-sidebar--more-filters-visible[_ngcontent-%COMP%] app-comment-sidebar-filter[_ngcontent-%COMP%]{pointer-events:initial;-webkit-user-select:initial;user-select:initial}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar{display:none;width:0;height:0}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]:not(.s-overflow-hidden){overflow-y:auto}[_nghost-%COMP%] velt-comments-sidebar-wireframe{width:100%;height:100%;display:flex;flex-direction:column;gap:var(--velt-spacing-lg)}"],changeDetection:0});let i=o;return i})();var iin=["sidebarOverlay"],oin=["host"],rin=i=>["snippyly-sidebar-panel","velt-overlay-panel",i];function ain(i,o){i&1&&He(0)}function sin(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,ain,1,0,"ng-container",7),b()),i&2){l(3);let n=me(3);m(),d("ngTemplateOutlet",n)}}function lin(i,o){if(i&1&&(v(0),u(1,sin,2,1,"velt-shadow-dom-internal",6),C()),i&2){l(2);let n=me(3),e=l();m(),d("ngIf",!e.template&&e.sidebarShadowDOM)("ngIfElse",n)}}function cin(i,o){i&1&&He(0)}function din(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,cin,1,0,"ng-container",7),b()),i&2){l(5);let n=me(3);m(),d("ngTemplateOutlet",n)}}function min(i,o){if(i&1&&(y(0,"div",11),u(1,din,2,1,"velt-shadow-dom-internal",6),b()),i&2){let n=l(4).ngIf,e=me(3),t=l();pe("dark",n.darkMode),m(),d("ngIf",!t.template&&t.sidebarShadowDOM)("ngIfElse",e)}}function pin(i,o){if(i&1&&u(0,min,2,4,"div",10),i&2){let n=l(3).ngIf;d("ngIf",n==null?null:n.sidebarVisible)}}function gin(i,o){if(i&1&&(w(0,"div",8,2),u(2,pin,1,1,"ng-template",9,3,Ee)),i&2){let n=me(1),e=l(2).ngIf;m(2),d("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",!0)("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",A(4,rin,e.darkMode?"dark":""))}}function uin(i,o){if(i&1&&u(0,lin,2,2,"ng-container",6)(1,gin,4,6,"ng-template",null,1,Ee),i&2){let n=me(2),e=l().ngIf;d("ngIf",e.embedMode||e.floatingMode)("ngIfElse",n)}}function hin(i,o){if(i&1){let n=K();y(0,"velt-comments-sidebar-wrapper-internal",12),P(1,"translate"),G("onWrapperClick",function(t){N(n);let r=l(2);return F(r.onClick(t))}),b()}if(i&2){let n=l().ngIf,e=l();d("componentConfigSignal",e.componentConfigSignal)("template",e.template)("darkMode",n.darkMode),T("data-testid",e.componentId)("aria-label",M(1,6,"Comments sidebar"))("aria-modal",!0)}}function fin(i,o){if(i&1&&(v(0),u(1,uin,3,2,"ng-template",5)(2,hin,2,8,"ng-template",null,0,Ee),C()),i&2){let n=o.ngIf;m(),d("ngIf",n.isFirstComponent||n.floatingMode||n.embedMode)}}var c8=(()=>{let o=class o extends nt{set _pageMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{pageMode:t}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _pageMode: ",t)}}set _filterCount(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{filterCount:t}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _filterCount: ",t)}}set _customActions(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarCustomActions():this.commentService.disableSidebarCustomActions()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _pageMode: ",t)}}set focusedThreadMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFocusedThreadMode():this.commentService.disableFocusedThreadMode()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _pageMode: ",t)}}set _openAnnotationInFocusMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableOpenAnnotationInFocusMode():this.commentService.disableOpenAnnotationInFocusMode()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _openAnnotationInFocusMode: ",t)}}set _readOnly(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this._localReadOnlyExplicitlySet=!0,this.componentConfigSignal.update(r=>(r=D(E({},r),{sidebarReadMode:!!t,readOnly:!!t}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _readOnly: ",t)}}set _selection(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{selection:t!==!1}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _selection: ",t)}}set _forceClose(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{forceClose:t!==!1}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _forceClose: ",t)}}set _expandOnSelection(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{expandOnSelection:t!==!1}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _expandOnSelection: ",t)}}set _sortData(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{sortData:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _sortData: ",t)}}set _sortOrder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{sortOrder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _sortOrder: ",t)}}set _sortBy(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{sortBy:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _sortBy: ",t)}}set enableUrlNavigation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarUrlNavigation():this.commentService.disableSidebarUrlNavigation()}set urlNavigation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarUrlNavigation():this.commentService.disableSidebarUrlNavigation()}set _queryParamsComments(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableQueryParamsComments():this.commentService.disableQueryParamsComments()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _queryParamsComments: ",t)}}set _fullScreen(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFullScreenInSidebar():this.commentService.disableFullScreenInSidebar()}catch{}}set _currentLocationSuffix(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{currentLocationSuffix:!!t}),r))}catch{}}set _filterOptionLayout(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{filterOptionLayout:e}),t))}catch{}}set _filterConfig(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.updateFilterConfig(t)}catch{}}set _groupConfig(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.componentConfigSignal.update(r=>(r=D(E({},r),{groupConfig:t}),r.groupConfig?.enable||(r.groupBy=null),r))}catch{}}set _filters(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.commentService.setCommentSidebarFilters(t)}catch{}}set _systemFiltersOperator(e){try{e&&this.commentService.setCommentSidebarSystemFiltersOperator(e)}catch{}}set _excludeLocationIds(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.commentService.setExcludeLocationIdsFromSidebar(t)}catch{}}set _fullExpanded(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{fullExpanded:!!t}),r))}catch{}}set _sidebarButtonCountType(e){try{this.commentService.setSidebarButtonCountType(e)}catch{}}set _filterGhostCommentsInSidebar(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFilterGhostCommentsInSidebar():this.commentService.disableFilterGhostCommentsInSidebar()}catch{}}set commentPlaceholder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{commentPlaceholder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent set commentPlaceholder: ",t)}}set replyPlaceholder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{replyPlaceholder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent set replyPlaceholder: ",t)}}set pageModePlaceholder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{pageModePlaceholder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent set pageModePlaceholder: ",t)}}set _sidebarShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{shadowDom:t}),r)),t?this.commentService.enableSidebarShadowDOM():this.commentService.disableSidebarShadowDOM()}catch{}}set _context(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.componentConfigSignal.update(r=>(r=D(E({},r),{context:t}),r))}catch{}}set _defaultMinimalFilter(e){try{let t=e;typeof e=="string"&&(e.startsWith('"')||e.startsWith("'"))&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{minimalFilter:t,selectedMinimalFilterDropdownOption:D(E({},r.selectedMinimalFilterDropdownOption),{filter:t})}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _defaultMinimalFilter: ",t)}}constructor(e,t,r,a,s,c,p,g,f,I,x,B,z,W,J,ne,ve){super(p,ve,void 0,r),this.analyticsService=e,this.authService=t,this.commentService=r,this.configService=a,this.domService=s,this.docService=c,this.elementRef=p,this.iamService=g,this.loggingService=f,this.breakpointObserver=I,this.customFilterService=x,this.translateService=B,this.cd=z,this.wireframeService=W,this.renderer=J,this.dynamicComponentService=ne,this.themeService=ve,this.embedMode=null,this.floatingMode=!1,this._localReadOnlyExplicitlySet=!1,this.dialogVariant="sidebar",this.focusedThreadDialogVariant="sidebar",this.filterPanelLayout="bottomSheet",this.pageModeComposerVariant="sidebar",this.searchPlaceholder="Search comments",this.openSidebar=new Me,this.onSidebarOpen=new Me,this.onSidebarCommentClick=new Me,this.onSidebarCommentClickEvent=new Me,this.onCommentClick=new Me,this.onSidebarClose=new Me,this.onCommentNavigationButtonClick=new Me,this.onFullscreen=new Me,this.subscriptions=[],this.locations={},this.commentAccessMode=ho,this.commentReadAnalyticsCalled=!0,this.peopleTypes={all:"All",other:"Other"},this.pageTypes={all:"All",other:"Other"},this.unsetType={id:"unset",name:"Not set"},this.objectKeys=Object.keys,this.filteredGroupedCommentAnnotationsObj={},this.filteredGroupedCommentAnnotations=[],this.veltId=vt(),this.veltElement=!0,this.defaultFilterConfig={location:{name:"Pages",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search pages",type:"system"},document:{name:"Documents",enable:!1,multiSelection:!0,enableGrouping:!1,placeholder:"Search documents",type:"system"},people:{name:"Author",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search authors",type:"system"},assigned:{name:"Assigned",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search assigned",type:"system"},tagged:{name:"Tagged",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search tagged",type:"system"},involved:{name:"Involved",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search involved",type:"system"},priority:{name:"Priority",enable:!0,multiSelection:!0,enableGrouping:!1,placeholder:"Search priority",type:"system"},status:{name:"Status",enable:!1,multiSelection:!0,enableGrouping:!1,placeholder:"Search status",type:"system"},category:{name:"Category",enable:!0,multiSelection:!0,enableGrouping:!1,placeholder:"Search category",type:"system"},commentType:{name:"Comment Type",enable:!0,multiSelection:!0,enableGrouping:!1,placeholder:"Search comment type",type:"system"},version:{name:"Versions",enable:!0,multiSelection:!1,enableGrouping:!1,placeholder:"Search versions",type:"system"}},this.defaultGroupConfig={enable:!0,name:"Group By"},this.isUserGlobalContact=!1,this.resolvedCommentsOnDom=!1,this.position="right",this.commentRefId="",this.showDefault=!0,this.componentConfigSignal=Te({fullScreen:!1,embedMode:this.embedMode,floatingMode:this.floatingMode,pageMode:!1,currentLocationSuffix:!1,queryParamsComments:!1,variant:this.variant,dialogVariant:this.dialogVariant,focusedThreadDialogVariant:this.focusedThreadDialogVariant,pageModeComposerVariant:this.pageModeComposerVariant,fullExpanded:!1,systemFiltersOperator:md.AND,annotations:[],filteredCommentPinAnnotations:[],filteredCommentAnnotationsCount:0,selectedAnnotationsMap:{},commentAnnotationsCountByFilters:{page:{},document:{},status:{},people:{},tagged:{},assigned:{},involved:{},version:{},priority:{},commentCategory:{},accessMode:{}},noCommentsFound:!1,noCommentsFoundForAppliedFilters:!1,pageCommentAnnotation:new Zo,commentCategoryMap:U.CommentCategoryMap,virtualScrollData:[],isFirstComponent:!1,searchPlaceholder:this.searchPlaceholder,enableAutoCategorize:!1,filterConfig:JSON.parse(JSON.stringify(this.defaultFilterConfig)),filters:{pages:[],documents:[],statuses:[],statusIds:[],people:[],assigned:[],tagged:[],involved:[],versions:[],versionIds:[],priorities:[],priorityIds:[],categories:[],categoryIds:[],accessModes:[],input:null},moreFiltersVisible:!1,groupByOptions:{},groupBy:null,peopleFilters:[],assignedFilters:[],taggedFilters:[],involvedFilters:[],enablePriority:!1,enableStatus:!0,appliedFiltersCount:0,priorities:[],statuses:[],accessModes:[{id:ho.PUBLIC,name:"Public"},{id:ho.PRIVATE,name:"Private"}],filterOptionLayout:"checkbox",filterCount:!0,sidebarVisible:!1,pages:{},documents:{},showAllPages:!1,showAllDocuments:!1,versions:[],groupConfig:JSON.parse(JSON.stringify(this.defaultGroupConfig)),user:null,currentPage:null,currentDocument:null,isUserAdmin:!1,isPrivateCommentAllowed:!1,isPhone:!1,darkMode:!1,skeletonLoading:!0,shadowDom:void 0,position:this.position,filterPanelLayout:this.filterPanelLayout,customActionsState:{},readOnly:!1,selection:!0,expandOnSelection:!0,sidebarReadMode:!1,filterRecentlyClosed:!1,location:null,fullscreenEnabled:!1,forceClose:!0,contextBeforePageModeComposerOverride:void 0,isContextFromPageModeComposerTool:!1,trackByCategoryId:this.trackByCategoryId.bind(this),trackByPriorityId:this.trackByPriorityId.bind(this),trackByCustomFilterId:this.trackByCustomFilterId.bind(this),trackByAccessModeId:this.trackByAccessModeId.bind(this),trackByPageKey:this.trackByPageKey.bind(this),trackByDocumentKey:this.trackByDocumentKey.bind(this),trackByPeople:this.trackByPeople.bind(this),trackByVersion:this.trackByVersion.bind(this),trackByGroupByOptionKey:this.trackByGroupByOptionKey.bind(this),onCommentAnnotationClick:this.onCommentAnnotationClick.bind(this),saveComment:this.saveComment.bind(this),trackCommentPinAnnotations:this.trackCommentPinAnnotations.bind(this),updateFilter:this.updateFilter.bind(this),toggleGroupedCommentAnnotations:this.toggleGroupedCommentAnnotations.bind(this),changeGroupBy:this.changeGroupBy.bind(this),closeSidebar:this.closeSidebar.bind(this),toggleMoreFilters:this.toggleMoreFilters.bind(this),openMoreFilters:this.openMoreFilters.bind(this),closeMoreFilters:this.closeMoreFilters.bind(this),savePageComment:this.savePageComment.bind(this),sortComments:this.sortComments.bind(this),goBackToAllComments:this.goBackToAllComments.bind(this),minimalFilterDropdownOpen:!1,minimalActionsDropdownOpen:!1,toggleMinimalFilterDropdown:this.toggleMinimalFilterDropdown.bind(this),unreadCommentsMap:null,minimalFilter:"all",filterCommentsByReadStatus:this.filterCommentsByReadStatus.bind(this),selectedMinimalFilterDropdownOption:{sorting:"date",filter:"all"},locationFilterDropdownOpen:!1,toggleLocationFilterDropdown:this.toggleLocationFilterDropdown.bind(this),documentFilterDropdownOpen:!1,toggleDocumentFilterDropdown:this.toggleDocumentFilterDropdown.bind(this),closeDocumentFilterDropdown:this.closeDocumentFilterDropdown.bind(this),markAllCommentAnnotationsAsRead:this.markAllCommentAnnotationsAsRead.bind(this),markAllCommentAnnotationsAsResolved:this.markAllCommentAnnotationsAsResolved.bind(this),toggleMinimalActionsDropdown:this.toggleMinimalActionsDropdown.bind(this),toggleCustomAction:this.toggleCustomAction.bind(this),focusedThreadMode:!1,openAnnotationInFocusMode:!1,focusedAnnotation:null,focusedAnnotationEditCommentIndex:null,navigateToComment:this.navigateToComment.bind(this),resetFilters:this.resetFilters.bind(this),filterSearch:this.filterSearch.bind(this),customFilters:{},onDialogExpanded:this.onDialogExpanded.bind(this),onFullscreenClick:this.onFullscreenClick.bind(this)}),this.sidebarShadowDOM=!1,this.dataAvailable=!1,this.componentId="velt-comments-sidebar";try{this.subscriptions.push(super.onDarkModeChange().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{darkMode:Fe}),Be))})),this.loggingService.log("%c[WB] Creating CLASS: CommentsSidebarComponent","color: blue;"),this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{groupBy:Fe.groupByOptions.page}),Fe.pageCommentAnnotation.isPageAnnotation=!0,Fe)),this.updateGroupByOptions(),this.subscriptions.push(this.commentService.getSidebarShadowDOM$().subscribe(Fe=>{this.sidebarShadowDOM=Fe})),this.subscriptions.push(this.commentService.getFocusedThreadMode$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{focusedThreadMode:Fe}),Be))})),this.subscriptions.push(this.commentService.getOpenAnnotationInFocusMode$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{openAnnotationInFocusMode:Fe}),Be))})),this.subscriptions.push(this.commentService.getReadOnly$().subscribe(Fe=>{this._localReadOnlyExplicitlySet||this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{readOnly:Fe}),Be))})),this.subscriptions.push(this.commentService.getQueryParamsComments$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{queryParamsComments:Fe}),Be)),this.setPages(),this.setDocuments()})),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{unreadCommentsMap:Fe}),Be))})),this.subscriptions.push(this.commentService.getFullScreenInSidebar$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{fullscreenEnabled:Fe}),Be))})),this.subscriptions.push(this.breakpointObserver.observe(zi.XSmall).subscribe(Fe=>{Fe.matches?this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{isPhone:!0}),Be)):this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{isPhone:!1}),Be))},Fe=>{this.loggingService.catch("Error in CommentsSidebarComponent breakpointObserver subscription: ",Fe)})),this.subscriptions.push(this.customFilterService.customStatusMap$.subscribe(Fe=>{this.statusMap=Fe,this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{statuses:Object.values(Fe)}),Be)),this.pruneStaleStatuses()})),this.subscriptions.push(this.customFilterService.customPriorityMap$.subscribe(Fe=>{this.priorityMap=Fe,this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{priorities:[...Object.values(Fe),{id:"unset",name:"Not set",color:"#FFFFFF"}]}),Be)),this.pruneStalePriorities()})),this.subscriptions.push(this.customFilterService.customCategoryMap$.subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{commentCategoryMap:D(E({},Fe),{other:{id:"other",name:"Other",color:"#00C48C"}})}),Be)),this.pruneStaleCategories()})),this.subscriptions.push(this.commentService.getPageModeComposerContext$().subscribe(Fe=>{Fe!==null?this.componentConfigSignal.update(Be=>(Be.isContextFromPageModeComposerTool||(Be=D(E({},Be),{contextBeforePageModeComposerOverride:Be.context})),Be=D(E({},Be),{pageMode:!0,context:Fe.context||void 0,targetElementIdFromPageModeComposer:Fe.targetElementId||void 0,isContextFromPageModeComposerTool:!0}),Be)):this.componentConfigSignal.update(Be=>(Be.isContextFromPageModeComposerTool&&(Be=D(E({},Be),{context:Be.contextBeforePageModeComposerOverride,contextBeforePageModeComposerOverride:void 0,targetElementIdFromPageModeComposer:void 0,isContextFromPageModeComposerTool:!1})),Be))}));let _e=sessionStorage.getItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE);_e&&this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{customActionsState:JSON.parse(_e)}),Fe))}catch(_e){this.loggingService.catch("Error in CommentsSidebarComponent constructor: ",_e)}}ngOnInit(){try{if(this.setupA11yAttributes(),sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)){let e=JSON.parse(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS));delete e?.input,e?.people?.length&&e.people.find(t=>typeof t=="string")&&(e.people=[]),e?.pages?.length&&e.pages?.forEach(t=>{t?.id||(t.id=t.displayName)}),sessionStorage.getItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_FILTERS_RESET)||(e.pages=[],sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_FILTERS_RESET,"true")),this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:e}),t)),this.pruneStaleStatuses(),this.pruneStalePriorities(),this.pruneStaleCategories()}if(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY)){let e=sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY);e&&this.componentConfigSignal.update(t=>(t=E({},t),Object.keys(t.groupByOptions).forEach(r=>{t.groupByOptions[r]===e&&(t.groupBy=e)}),t))}this.subscriptions.push(this.commentService.onCommentAdd$().subscribe(e=>{e?.annotation&&setTimeout(()=>{this.goToAnnotationInSidebar(e.annotation)},200)}))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent OnInit: ",e)}try{let e="velt-comments-sidebar-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){this.commentRefId="comment-sidebar";let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}}))}catch(e){this.loggingService.catch("Error in CommentDialogComponent OnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()}),this.getAllCommentAnnotationsSubscription&&this.getAllCommentAnnotationsSubscription.unsubscribe(),this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalFilterDropdownOpen:!1}),e)),this.commentService.setCommentsFromSidebarMap({comments:null,sidebarVisible:!1})}catch{}}ngAfterViewInit(){try{if(this.floatingMode||this.embedMode)this.initComponent();else{let e=document.querySelector(U.TAGS.SNIPPYLY_COMMENTS_SIDEBAR),t=document.querySelector(U.TAGS.VELT_COMMENTS_SIDEBAR);t?this.veltId===t?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),setTimeout(()=>{this.sidebarOverlay?.overlayRef?.hostElement&&(this.sidebarOverlay.overlayRef.hostElement.style.zIndex="1001")},100),this.initComponent()):this.veltId===e?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),setTimeout(()=>{this.sidebarOverlay?.overlayRef?.hostElement&&(this.sidebarOverlay.overlayRef.hostElement.style.zIndex="1001")},100),this.initComponent())}}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent AfterViewInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent ngOnChanges: ",t)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setupA11yAttributes:",e)}}onClick(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: onClick","color: green;");let t=e?.target?.tagName?.toLowerCase();t!==U.TAGS.VELT_COMMENT_DIALOG&&t!==U.TAGS.SNIPPYLY_COMMENT_DIALOG&&!e?.target?.closest(U.TAGS.VELT_COMMENT_DIALOG)&&!e?.target?.closest(U.TAGS.SNIPPYLY_COMMENT_DIALOG)&&this.domService.resetSelectedAnnotationsMap()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onClick: ",t)}}pruneStaleStatuses(){try{this.statusMap!==void 0&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.statuses=e.filters.statuses.filter(t=>t.id in this.statusMap),e.filters.statusIds=e.filters.statuses?.map(t=>t?.id),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterStaleStatuses: ",e)}}pruneStalePriorities(){try{this.priorityMap!==void 0&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.priorities=e.filters.priorities.filter(t=>t.id in this.priorityMap),e.filters.priorityIds=e.filters.priorities?.map(t=>t.id),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterStalePriorities: ",e)}}pruneStaleCategories(){try{this.componentConfigSignal().commentCategoryMap!==void 0&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.categories=e.filters.categories?.filter(t=>t.id in e.commentCategoryMap),e.filters.categoryIds=e.filters.categories?.map(t=>t.id),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterStaleCategories: ",e)}}trackByAnnotationGroup(e,t){return t?.displayName}trackByAnnotationId(e,t){return t?.annotationId}trackByCategoryId(e,t){return t?.value?.id||e}trackByPriorityId(e,t){return t?.id||e}trackByCustomFilterId(e,t){return t?.id||e}trackByAccessModeId(e,t){return t?.id||e}trackByPageKey(e,t){return t?.key||e}trackByDocumentKey(e,t){return t?.key||e}trackByPeople(e,t){return t?.id||e}trackByVersion(e,t){return t?.id||e}trackByGroupByOptionKey(e,t){return t?.key||e}initComponent(){try{this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t)),this.componentConfigSignal().user&&(this.setCommentSidebarInstalledInAnalytics(),this.setCommentSidebarEmbedModeInAnalytics(),this.setCommentSidebarFloatingModeInAnalytics())},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getUser$ subscription: ",e)})),this.subscriptions.push(this.docService.getDocumentPaths$().subscribe(e=>{this.documentPaths=e,this.getAllCommentsOnCurrentDocument()},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getDocumentPaths$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSidebarCustomActionEventData().subscribe(e=>{e&&(this.componentConfigSignal.update(t=>(t=D(E({},t),{customActionsState:e.actions}),t)),sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE,JSON.stringify(e.actions)))})),this.subscriptions.push(this.docService.getLocation$().subscribe(e=>{this.location=e,this.componentConfigSignal.update(a=>(a=D(E({},a),{location:e}),a));let t=this.commentService.getCommentSidebarFilters(),r=t?E({},t):{version:[]};this.location?.location?.version?r.version=[{id:this.location.location.version?.id,name:this.location.location.version?.name}]:r?.version||(r.version=[]),this.commentService.setCommentSidebarFilters(r),this.setPages(),this.filteredGroupedCommentAnnotationsObj={}},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getLocation$ subscription: ",e)})),this.subscriptions.push(this.docService.getLocations$().subscribe(e=>{this.locations=e,this.filteredGroupedCommentAnnotationsObj={}})),this.subscriptions.push(this.commentService.getEnableStatus$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{enableStatus:e}),t))})),this.subscriptions.push(this.commentService.getEnablePriority$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{enablePriority:e}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getEnablePriority$ subscription: ",e)})),this.subscriptions.push(this.commentService.getEnableAutoCategorize$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{enableAutoCategorize:e}),t))})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{sidebarVisible:e}),t)),this.componentConfigSignal().sidebarVisible&&(this.commentReadAnalyticsCalled=!1,setTimeout(()=>{Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length&&this.goToAnnotationInSidebar(this.componentConfigSignal().selectedAnnotationsMap[Object.keys(this.componentConfigSignal().selectedAnnotationsMap)[0]])},500)),this.componentConfigSignal().sidebarVisible?(this.getAllCommentsOnCurrentDocument(),this.commentService.setCommentsFromSidebarMap({comments:this.componentConfigSignal().skeletonLoading?void 0:this.componentConfigSignal().filteredCommentPinAnnotations,sidebarVisible:!0})):(this.commentService.getSidebarButtonCountType()==="default"&&this.getAllCommentAnnotationsSubscription&&this.getAllCommentAnnotationsSubscription.unsubscribe(),this.commentService.setCommentsFromSidebarMap({comments:this.componentConfigSignal().skeletonLoading?void 0:this.componentConfigSignal().filteredCommentPinAnnotations,sidebarVisible:!1}),this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal().focusedAnnotation&&this.goBackToAllComments())},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getSidebarVisibility$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSidebarButtonCountType$().subscribe(e=>{e==="filter"&&this.getAllCommentsOnCurrentDocument()})),this.subscriptions.push(this.commentService.getCommentSidebarFilters$().subscribe(e=>{this.mergeClientFilters(e)})),this.subscriptions.push(this.commentService.getCommentSidebarSystemFiltersOperator$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{systemFiltersOperator:e}),t)),this.filterCommentAnnotations()})),this.subscriptions.push(this.commentService.getOpenSidebar$().subscribe(e=>{this.openSidebar.emit(e),this.onSidebarOpen.emit(e)},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getOpenSidebar$ subscription: ",e)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(e=>{let t=this.componentConfigSignal().selectedAnnotationsMap;this.componentConfigSignal.update(c=>(c=D(E({},c),{selectedAnnotationsMap:e}),c)),Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length===1&&!this.commentService.showFloatingComments()&&this.commentService.setSidebarVisibility(!0);let r=Object.keys(e||{}),a=Object.keys(t||{}),s=r.find(c=>!a.includes(c));if(s){let c=this.componentConfigSignal().annotations.find(p=>p.annotationId===s);c&&(this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal().openAnnotationInFocusMode?this.componentConfigSignal.update(p=>(p=D(E({},p),{focusedAnnotation:c}),p)):setTimeout(()=>{this.goToAnnotationInSidebar(c)},100))}else{let c=this.componentConfigSignal().focusedAnnotation;this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal().openAnnotationInFocusMode&&c&&!r.includes(c?.annotationId)&&this.goBackToAllComments()}},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getSidebarVisibility$ subscription: ",e)})),this.subscriptions.push(this.domService.onDocumentClick$().subscribe(e=>{try{if(this.componentConfigSignal().sidebarVisible&&e&&!this.elementRef?.nativeElement?.contains(e?.target)){let t=document.querySelectorAll(".cdk-overlay-container");Array.from(t).some(a=>a?.contains(e?.target))||!this.embedMode&&(!this.commentService.isSidebarOpenedByCustomTrigger()||this.componentConfigSignal().forceClose)&&(e?.target?.hasAttribute(U.ATTRIBUTES.VELT_DOWNLOAD_BUTTON)||(this.closeSidebar(),e?.stopPropagation()))}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onDocumentClick: ",t)}},e=>{this.loggingService.catch("Error in CommentsSidebarComponent onDocumentClick$ subscription: ",e)})),this.subscriptions.push(this.iamService.isUserAdmin$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{isUserAdmin:e}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent isUserAdmin$ subscription: ",e)})),this.subscriptions.push(this.commentService.isPrivateCommentAllowed$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{isPrivateCommentAllowed:e}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent isPrivateCommentAllowed$ subscription: ",e)})),this.getAllCommentsOnCurrentDocument(),this.subscriptions.push(this.commentService.getSidebarCustomData().subscribe(e=>{this.updateVirtualScrollData(e)}))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent initComponent: ",e)}}updateVirtualScrollData(e){try{if(this.commentService.getSidebarCustomActionsValue()){let t=[];this.componentConfigSignal.update(s=>(s=E({},s),s.virtualScrollData=[],s)),e?.data?.forEach((s,c)=>{e?.options?.grouping!==!1&&this.componentConfigSignal.update(p=>(p=E({},p),p.virtualScrollData.push({type:"group",data:{displayName:s?.groupName,isExpanded:s?.isExpanded===void 0&&c===0||s?.isExpanded,annotations:s?.annotations}}),p)),(s?.isExpanded===void 0&&c===0||s?.isExpanded)&&s?.annotations?.forEach(p=>{this.componentConfigSignal.update(g=>(g=E({},g),g.virtualScrollData.push({type:"annotation",data:p}),g))}),t.push(...s?.annotations||[])}),this.componentConfigSignal.update(s=>(s=D(E({},s),{noCommentsFoundForAppliedFilters:!this.componentConfigSignal().virtualScrollData?.length}),s));let r=this.componentConfigSignal().embedMode||this.componentConfigSignal().sidebarVisible;this.commentService.setCommentsFromSidebarMap({comments:t,sidebarVisible:!!r}),this.componentConfigSignal.update(s=>(s=E({},s),s.filteredCommentAnnotationsCount=t?.length||0,s)),this.cd.markForCheck();let a=this.componentConfigSignal().virtualScrollViewportRef?.elementRef?.nativeElement;a&&(a.scrollTop=0)}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent updateVirtualScrollData: ",t)}}updateVirtualScrollDataGroupToggle(e){try{if(this.commentService.getSidebarCustomActionsValue()){this.componentConfigSignal.update(r=>(r=E({},r),r.virtualScrollData=[],r)),e?.forEach(r=>{r.type==="group"&&(this.componentConfigSignal.update(a=>(a=E({},a),a.virtualScrollData.push(r),a)),r?.data?.isExpanded&&r?.data?.annotations.forEach(a=>{this.componentConfigSignal.update(s=>(s=E({},s),s.virtualScrollData.push({type:"annotation",data:a}),s))}))}),this.componentConfigSignal.update(r=>(r=D(E({},r),{noCommentsFoundForAppliedFilters:!this.componentConfigSignal().virtualScrollData?.length}),r)),this.cd.markForCheck();let t=this.componentConfigSignal().virtualScrollViewportRef?.elementRef?.nativeElement;t&&(t.scrollTop=0)}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent updateVirtualScrollDataGroupToggle: ",t)}}getAllCommentsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentsOnCurrentDocument","color: green;");try{this.getAllCommentAnnotationsSubscription&&this.getAllCommentAnnotationsSubscription.unsubscribe(),this.componentConfigSignal.update(e=>(e=D(E({},e),{skeletonLoading:!0}),e)),this.getAllCommentAnnotationsSubscription=this.commentService.getAllCommentAnnotations({excludeDomChanges:!0,skipPositionCalculation:!0,fromCommentSidebar:!0,analytics:{enabled:!0,properties:{source:"internal",sourceId:"commentsSidebar"}}}).pipe(de(e=>(e||this.componentConfigSignal.update(t=>(t=D(E({},t),{skeletonLoading:!0}),t)),e)),Le(e=>!!e),de(e=>e?.filter(t=>t?.comments?.length)),fe(e=>this.commentService.getFilterGhostCommentsInSidebar$().pipe(fe(t=>t?this.commentService.getGhostCommentAnnotationMap$().pipe(de(r=>r?e?.filter(a=>!r?.[a?.annotationId]):e)):le(e)))),fe(e=>this.commentService.getExcludeLocationIdsFromSidebar$().pipe(de(t=>t?.length&&e?.length?e.filter(r=>r?.location?.id?!t.includes(r.location.id):!0):e))),fe(e=>this.commentService.getResolvedCommentsOnDom$().pipe(de(t=>(this.resolvedCommentsOnDom!==t&&(this.resolvedCommentsOnDom=t,t&&this.setResolvedStatusInFilter()),e))))).subscribe(e=>{if(this.dataAvailable=!0,this.componentConfigSignal.update(t=>{if(t=D(E({},t),{skeletonLoading:!1}),t.annotations=e?.filter(r=>!r?.isPageAnnotation||r?.comments?.length)||[],t.sortData==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.lastUpdated-a.lastUpdated):t.sortData==="none"?t.annotations=t.annotations?.sort((r,a)=>a.createdAt-r.createdAt):t.annotations=t.annotations?.sort((r,a)=>a.lastUpdated-r.lastUpdated),t.sortBy==="createdAt"?t.sortOrder==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.createdAt-a.createdAt):t.sortOrder==="desc"&&(t.annotations=t.annotations?.sort((r,a)=>a.createdAt-r.createdAt)):t.sortBy==="lastUpdated"?t.sortOrder==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.lastUpdated-a.lastUpdated):t.sortOrder==="desc"&&(t.annotations=t.annotations?.sort((r,a)=>a.lastUpdated-r.lastUpdated)):t.sortOrder==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.lastUpdated-a.lastUpdated):t.sortOrder==="desc"&&(t.annotations=t.annotations?.sort((r,a)=>a.lastUpdated-r.lastUpdated)),t?.focusedAnnotation?.annotationId){let r=e?.find(a=>a.annotationId===t?.focusedAnnotation?.annotationId);r&&(t.focusedAnnotation=r)}return t}),this.setPages(),this.setDocuments(),this.setVersions(),this.setPeople(),this.filterCommentAnnotations(),this.updateAnnotationCountsByFilter(),this.componentConfigSignal().annotations?.length){let t=sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_SELECTED_ANNOTATION_ID);if(t){sessionStorage.removeItem(U.SESSION_STORAGE.SNIPPYLY_SELECTED_ANNOTATION_ID),this.commentService.setSidebarVisibility(!0);let r=this.componentConfigSignal().annotations.find(a=>a.annotationId===t);r&&this.goToAnnotation(r)}this.componentConfigSignal().sidebarVisible&&!this.commentReadAnalyticsCalled&&this.setCommentReadInAnalytics()}this.componentConfigSignal.update(t=>(t=D(E({},t),{noCommentsFound:!this.componentConfigSignal().annotations?.length}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getAllCommentsOnCurrentDocument subscription: ",e),this.componentConfigSignal.update(t=>(t=D(E({},t),{skeletonLoading:!1}),t))})}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent getAllCommentsOnCurrentDocument: ",e)}}mergeClientFilters(e){try{if(Object.keys(e||{})?.length){if(e?.location&&(e?.location?.length?(this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{pages:[]})}),t)),e?.location?.forEach(t=>{if(t?.id&&(this.componentConfigSignal().filters?.pages||this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{pages:[]})}),a)),!this.componentConfigSignal().filters.pages.find(a=>a.id===t.id))){let a=this.docService.genarateLocationId(t);this.componentConfigSignal.update(s=>(s=D(E({},s),{filters:D(E({},s.filters),{pages:[...s.filters.pages,{id:t.id,displayName:t.displayName,locationIds:[a],selected:!0}]})}),s))}})):this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{pages:[]})}),t)),this.updatePageSelectedState()),e?.document&&(e?.document?.length?(this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{documents:[]})}),t)),e?.document?.forEach(t=>{(t?.id||t?.documentName)&&(this.componentConfigSignal().filters?.documents||this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{documents:[]})}),a)),this.componentConfigSignal().filters.documents.find(a=>a.id===t.id||a.documentName===t.documentName)||this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{documents:[...a.filters.documents,{id:t.id||t.documentName,documentName:t.documentName||t.id,selected:!0}]})}),a)))})):this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{documents:[]})}),t)),this.updateDocumentSelectedState()),e?.priority)if(e?.priority?.length){let t=e.priority;this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{priorities:r.priorities.filter(a=>t.includes(a.id)),priorityIds:t})}),r))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{priorities:[],priorityIds:[]})}),t));if(e?.category)if(e?.category?.length){if(this.componentConfigSignal().commentCategoryMap){let t=e.category;this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{categories:Object.values(r.commentCategoryMap).filter(a=>t.includes(a.id)),categoryIds:t})}),r))}}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{categories:[],categoryIds:[]})}),t));if(e?.status)if(e?.status?.length){let t=e.status;this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{statuses:r.statuses.filter(a=>t.includes(a.id)),statusIds:t})}),r))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{statuses:[],statusIds:[]})}),t));else sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)||this.setDefaultStatuses();if(e?.people){if(e?.people?.length){let t=[],r=this.componentConfigSignal().user;r&&e.people.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.people.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().peopleFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{people:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{people:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}if(e?.assigned){if(e?.assigned?.length){let t=[],r=this.componentConfigSignal().user;r&&e.assigned.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.assigned.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().assignedFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{assigned:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{assigned:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}if(e?.tagged){if(e?.tagged?.length){let t=[],r=this.componentConfigSignal().user;r&&e.tagged.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.tagged.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().taggedFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{tagged:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{tagged:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}if(e?.involved){if(e?.involved?.length){let t=[],r=this.componentConfigSignal().user;r&&e.involved.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.involved.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().involvedFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{involved:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{involved:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}e?.version&&(e?.version?.length?this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{versions:e.version?.map(r=>({id:r.id,name:r.name||r.id}))||[],versionIds:e.version?.map(r=>r.id)||[]})}),t)):this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{versions:[],versionIds:[]})}),t)),this.setVersions()),Object.keys(this.componentConfigSignal().filterConfig).forEach(t=>{this.componentConfigSignal().filterConfig[t]?.type==="custom"&&Object.keys(e).includes(t)&&e?.[t]&&(e?.[t]?.length?this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{[t]:e[t]?.map(a=>({id:a.id,name:a.name||a.id}))||[],[t+"Ids"]:e[t]?.map(a=>a.id)||[]})}),r)):this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{[t]:[],[t+"Ids"]:[]})}),r)))}),this.filterCommentAnnotations(),this.updateAnnotationCountsByFilter(),this.setFiltersToStorage()}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent mergeClientFilters: ",t)}}onCommentAnnotationClick(e,t=null){try{let r=this.commentService.getCommentAnnotationForClient(e);if(this.emitOnSidebarCommentClick(r),!this.componentConfigSignal().selection)return;this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal.update(a=>(a=D(E({},a),{focusedAnnotation:e,focusedAnnotationEditCommentIndex:t}),a)),this.navigateToComment(e,!1)}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent onCommentAnnotationClick: ",r)}}navigateToComment(e,t=!0){try{if(t){let r=this.commentService.getCommentAnnotationForClient(e);this.emitOnCommentNavigationButtonClick(r)}if(this.commentService.getSidebarUrlNavigation()&&t)if(e?.pageInfo?.url&&e.pageInfo?.url!==window.location.href){sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_SELECTED_ANNOTATION_ID,e.annotationId);let r=e.pageInfo.url;try{let a=window.location.origin,s=new URL(e.pageInfo.url).origin;a!==s&&(r=r.replace(s,a))}catch(a){this.loggingService.catch("Error in CommentsSidebarComponent onCommentAnnotationClick in comparing url domains: ",a)}window.location.href===r?this.goToAnnotation(e,t):window.location.href=r}else this.goToAnnotation(e,t);else this.goToAnnotation(e,t)}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent navigateToComment: ",r)}}goToAnnotation(e,t=!0){try{if(this.componentConfigSignal().selectedAnnotationsMap[e.annotationId]||e?.targetTextRange&&sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e?.annotationId),t)this.domService.toggleAnnotationSelection(e,void 0,void 0,!0);else{let r=this.componentConfigSignal().expandOnSelection?"sidebarShowReplies":void 0;this.domService.toggleAnnotationSelection(e,void 0,r,!0)}t&&setTimeout(()=>{let r=null;e.targetElement||e.areaAnnotationId?r=document.getElementById(`comment-pin-container-${e.annotationId}`):r=document.querySelector(`[data-velt-id='${e.annotationId}']`),r||(r=document.querySelector(`${U.TAGS.VELT_COMMENT_TEXT}[${U.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)),r&&r.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},100)}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent goToAnnotation: ",r)}}goToAnnotationInSidebar(e,t="smooth"){try{let s=document?.querySelector(".velt-comments-sidebar-container")?.querySelector("velt-shadow-dom-internal")?.shadowRoot?.getElementById(`sidebar-${e.annotationId}`);s||(s=document.getElementById(`sidebar-${e.annotationId}`)),s&&s.scrollIntoView({behavior:t,block:"center",inline:"center"})}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent goToAnnotationInSidebar: ",r)}}saveComment(e,t){this.commentService.saveComment(e,t)}getDisplayNameFromPageInfo(e){try{return this.componentConfigSignal().queryParamsComments&&e&&e?.queryParams?`${e?.path||""}${e?.queryParams||""}`:e?.path||""}catch{return""}}setPages(){try{this.componentConfigSignal.update(a=>D(E({},a),{pages:{},currentPage:void 0}));let e=new Map,t={};this.componentConfigSignal().annotations.forEach(a=>{let s=a.locationId||a.documentParamsId;if(!s){t.other||(t.other={locationIds:[],displayName:"Others",id:"other"});return}let c=a?.location?.locationName||a?.documentParams?.locationName||this.getDisplayNameFromPageInfo(a?.pageInfo)||"",p=a?.location?.id||c;e.has(s)||(t[p]||(t[p]={locationIds:[],displayName:c,id:p}),e.set(s,p),t[p].locationIds.push(s))}),this.componentConfigSignal.update(a=>{let s=this.location?.locationId,c;if(s){let p=e.get(s);p&&(c=t[p].displayName)}else t.other&&(c="Others");return D(E({},a),{pages:t,currentPage:c})}),this.updateLocationInStorage(),this.componentConfigSignal().annotations?.length&&!sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)&&(this.updateFilter({key:"pages",value:null},!0),this.setDefaultStatuses()),this.updatePageSelectedState()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setPages: ",e)}}setDocuments(){try{this.componentConfigSignal.update(a=>D(E({},a),{documents:{},currentDocument:void 0}));let e=new Map,t={};this.componentConfigSignal().annotations.forEach(a=>{let s=a?.metadata?.clientDocumentId?.toString(),c=a?.metadata?.documentId?.toString(),g=this.docService.getDocumentMetadata(c)?.documentName;if(!s){t.other||(t.other={id:"other",documentName:"Others"});return}if(e.has(s))return;let f=s;t[f]||(t[f]={id:s,documentName:g||s}),e.set(s,f)}),this.componentConfigSignal.update(a=>{let s=this.documentPaths?.clientDocumentId?.toString(),c;if(s){let p=e.get(s);p&&(c=t[p].id)}else t.other&&(c="other");return D(E({},a),{documents:t,currentDocument:c})}),this.componentConfigSignal().annotations?.length&&!sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)&&this.updateFilter({key:"documents",value:null},!0),this.updateDocumentSelectedState()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setDocuments: ",e)}}setDefaultStatuses(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDefaultStatuses","color: green;"),this.componentConfigSignal.update(e=>(e=D(E({},e),{filters:D(E({},e.filters),{statuses:[this.customFilterService.defaultStatus,...this.customFilterService.ongoingStatuses],statusIds:[this.customFilterService.defaultStatus?.id,...this.customFilterService.ongoingStatuses.map(t=>t?.id)]})}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setDefaultStatuses: ",e)}}setResolvedStatusInFilter(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setResolvedStatusInFilter","color: green;"),this.componentConfigSignal().filters.statuses?.length&&this.customFilterService.resolvedStatus&&(this.componentConfigSignal().filters.statuses.find(t=>t?.id===this.customFilterService.resolvedStatus.id)||this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{statuses:[...t.filters.statuses,this.customFilterService.resolvedStatus],statusIds:[...t.filters.statuses.map(r=>r?.id),this.customFilterService.resolvedStatus.id]})}),t)))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setResolvedStatusInFilter: ",e)}}trackCommentPinAnnotations(e,t){return t?.type==="group"?t?.data?.displayName:t?.type==="annotation"?t?.data?.annotationId:e}updateCurrentLocationIdInStorage(){try{this.location?.locationId&&this.componentConfigSignal().filters?.pages?.length&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.pages.forEach(t=>{t?.displayName===e.currentPage&&(t?.locationIds?.includes(this.location?.locationId)||t.locationIds.push(this.location?.locationId))}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateCurrentLocationIdInStorage: ",e)}}updateLocationInStorage(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.filters.pages.forEach(t=>{e.pages[t.displayName]&&(t.locationIds=e.pages[t.displayName].locationIds?.slice())}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateLocationInStorage: ",e)}}updatePageSelectedState(){try{this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.pages).forEach(t=>{let r=e.filters?.pages?.find(a=>a.id===t?.id);r?(t.selected=!0,r.displayName||(r.displayName=t.displayName)):t.selected=!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updatePageSelectedState: ",e)}}setVersions(){try{let e=[];this.componentConfigSignal().annotations&&this.componentConfigSignal.update(t=>(t=E({},t),t.annotations.forEach(r=>{r?.location?.version&&(e.find(a=>a.id===r?.location?.version?.id)||e.push(r?.location?.version))}),t)),this.componentConfigSignal().filters?.versions?.length&&this.componentConfigSignal.update(t=>(t=E({},t),t.filters.versions.forEach(r=>{e.find(a=>a.id===r?.id)||r?.id!=="unset"&&e.push(r)}),t)),this.componentConfigSignal.update(t=>(t=E({},t),t.versions=e?.sort((r,a)=>r?.id?.localeCompare(a?.id)),t.versions.push({id:"unset",name:"Not set"}),t)),this.componentConfigSignal().annotations?.length&&!this.componentConfigSignal().versions?.length&&this.updateFilter({key:"versions",value:null},!0)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setVersions: ",e)}}setPeople(){try{let e=[],t=[],r=[],a=[],s=this.componentConfigSignal().user;s?.userId&&(e.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s}),t.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s}),r.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s}),a.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s})),this.componentConfigSignal().annotations&&this.componentConfigSignal.update(c=>(c=E({},c),c.annotations.forEach(p=>{p?.from?.userId&&c.user?.userId!==p?.from?.userId&&!e.find(g=>g.id===p?.from?.userId)&&e.push({id:p?.from?.userId,name:`${p?.from?.name||p?.from?.email}`,user:p?.from}),p?.assignedTo?.userId&&c.user?.userId!==p?.assignedTo?.userId&&!t.find(g=>g.id===p?.assignedTo?.userId)&&t.push({id:p?.assignedTo?.userId,name:`${p?.assignedTo?.name||p?.assignedTo?.email}`,user:p?.assignedTo}),p?.comments?.forEach(g=>{g?.taggedUserContacts?.forEach(f=>{f?.contact?.userId&&c.user?.userId!==f?.contact?.userId&&!r.find(I=>I.id===f?.contact?.userId)&&r.push({id:f?.contact?.userId,name:`${f?.contact?.name||f?.contact?.email}`,user:f?.contact})})}),p?.from?.userId&&c.user?.userId!==p?.from?.userId&&!a.find(g=>g.id===p?.from?.userId)&&a.push({id:p?.from?.userId,name:`${p?.from?.name||p?.from?.email}`,user:p?.from}),p?.assignedTo?.userId&&c.user?.userId!==p?.assignedTo?.userId&&!a.find(g=>g.id===p?.assignedTo?.userId)&&a.push({id:p?.assignedTo?.userId,name:`${p?.assignedTo?.name||p?.assignedTo?.email}`,user:p?.assignedTo}),p?.comments?.forEach(g=>{g?.taggedUserContacts?.forEach(f=>{f?.contact?.userId&&c.user?.userId!==f?.contact?.userId&&!a.find(I=>I.id===f?.contact?.userId)&&a.push({id:f?.contact?.userId,name:`${f?.contact?.name||f?.contact?.email}`,user:f?.contact})})})}),c)),this.componentConfigSignal().filters?.people?.length&&this.componentConfigSignal.update(c=>(c=E({},c),c.filters.people.forEach(p=>{e.find(g=>g.id===p?.id)||p?.id!=="other"&&e.push(p)}),c.filters.assigned.forEach(p=>{t.find(g=>g.id===p?.id)||p?.id!=="other"&&t.push(p)}),c.filters.tagged.forEach(p=>{r.find(g=>g.id===p?.id)||p?.id!=="other"&&r.push(p)}),c.filters.involved.forEach(p=>{a.find(g=>g.id===p?.id)||p?.id!=="other"&&a.push(p)}),c)),this.componentConfigSignal.update(c=>(c=D(E({},c),{peopleFilters:e,assignedFilters:t,taggedFilters:r,involvedFilters:a}),c)),this.componentConfigSignal().annotations?.length&&(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)||(this.updateFilter({key:"people",value:null},!0),this.updateFilter({key:"assigned",value:null},!0),this.updateFilter({key:"tagged",value:null},!0),this.updateFilter({key:"involved",value:null},!0))),this.updatePeopleSelectedState()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setPeople: ",e)}}updatePeopleSelectedState(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.peopleFilters.forEach(t=>{let r=e.filters?.people?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e.assignedFilters.forEach(t=>{let r=e.filters?.assigned?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e.taggedFilters.forEach(t=>{let r=e.filters?.tagged?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e.involvedFilters.forEach(t=>{let r=e.filters?.involved?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updatePeopleSelectedState: ",e)}}updateFilterConfig(e){try{if(e){let t=this.componentConfigSignal().filters,r=JSON.parse(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS));r||(r={}),Object.keys(e).forEach(a=>{e[a]?.type==="custom"&&(r[a]?(t[a]=r[a],t[a+"Ids"]=r[a+"Ids"]):(t[a]=[],t[a+"Ids"]=[]))}),this.componentConfigSignal.update(a=>{let s=E(E({},this.defaultFilterConfig),e);return a=D(E({},a),{filterConfig:s,filters:t}),a}),this.setFiltersToStorage()}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filterConfig:JSON.parse(JSON.stringify(this.defaultFilterConfig))}),t));this.updateGroupByOptions(),this.filterCommentAnnotations()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent updateFilterConfig: ",t)}}updateGroupByOptions(){try{let e={};this.componentConfigSignal.update(r=>(r=E({},r),Object.keys(r.filterConfig).forEach(a=>{let s=r.filterConfig[a];s.enableGrouping&&(e[a]=s.name)}),r.groupByOptions=JSON.parse(JSON.stringify(e)),r));let t=!1;this.componentConfigSignal().groupBy&&Object.keys(this.componentConfigSignal().groupByOptions).forEach(r=>{this.componentConfigSignal().groupByOptions[r]===this.componentConfigSignal().groupBy&&(t=!0)}),(!this.componentConfigSignal().groupBy||!t)&&this.componentConfigSignal.update(r=>(r=D(E({},r),{groupBy:Object.values(r.groupByOptions)[0]}),r))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateGroupByOptions: ",e)}}updateFilter(e,t=!1){let{key:r,value:a}=e;try{if(r)switch(r){case"statuses":if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{statuses:[],statusIds:[]})}),g)),this.resolvedCommentsOnDom=!0;else{let g=this.componentConfigSignal().filters?.statuses||[];g.find(f=>f.id===a.id)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.statuses=g.filter(I=>I.id!==a.id),f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters.statuses=[...g,a],f)),this.componentConfigSignal.update(f=>(f=D(E({},f),{filters:D(E({},f.filters),{statusIds:f.filters.statuses.map(I=>I?.id)})}),f))}break;case"pages":let s=this.componentConfigSignal().filters.pages||[];if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{pages:[]})}),g));else{let g=a?.id||a?.displayName;s.find(f=>f?.id===g||f?.displayName===g)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.pages=s.filter(I=>I?.id!==g&&I?.displayName!==g),f)):this.componentConfigSignal().filterConfig?.location?.multiSelection?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.pages=[...s,a],f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters.pages=[a],f))}this.sortPageFilters(),this.updatePageSelectedState();break;case"documents":let c=this.componentConfigSignal().filters.documents||[];if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{documents:[]})}),g));else{let g=a?.id;c.find(f=>f?.id===g)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.documents=c.filter(I=>I?.id!==g),f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filterConfig?.document?.multiSelection?f.filters.documents=[...c,a]:f.filters.documents=[a],f))}this.updateDocumentSelectedState();break;case"people":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.people||[];return t?g.filters.people=[]:f.find(I=>I?.id===a?.id)?g.filters.people=f.filter(I=>I?.id!==a?.id):g.filterConfig?.people?.multiSelection?g.filters.people=[...f,a]:g.filters.people=[a],g}),this.updatePeopleSelectedState();break;case"tagged":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.tagged||[];return t?g.filters.tagged=[]:f.find(I=>I?.id===a?.id)?g.filters.tagged=f.filter(I=>I?.id!==a?.id):g.filterConfig?.tagged?.multiSelection?g.filters.tagged=[...f,a]:g.filters.tagged=[a],g}),this.updatePeopleSelectedState();break;case"assigned":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.assigned||[];return t?g.filters.assigned=[]:f.find(I=>I?.id===a?.id)?g.filters.assigned=f.filter(I=>I?.id!==a?.id):g.filterConfig?.assigned?.multiSelection?g.filters.assigned=[...f,a]:g.filters.assigned=[a],g}),this.updatePeopleSelectedState();break;case"involved":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.involved||[];return t?g.filters.involved=[]:f.find(I=>I?.id===a?.id)?g.filters.involved=f.filter(I=>I?.id!==a?.id):g.filterConfig?.involved?.multiSelection?g.filters.involved=[...f,a]:g.filters.involved=[a],g}),this.updatePeopleSelectedState();break;case"categories":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.categories||[];return t?g.filters.categories=[]:f.find(I=>I.id===a.id)?g.filters.categories=f.filter(I=>I!==a):g.filterConfig?.category?.multiSelection?g.filters.categories=[...f,a]:g.filters.categories=[a],g.filters.categoryIds=g.filters.categories?.map(I=>I.id),g});break;case"priorities":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.priorities||[];return t?g.filters.priorities=[]:f.find(I=>I.id===a.id)?g.filters.priorities=f.filter(I=>I.id!==a.id):g.filterConfig?.priority?.multiSelection?g.filters.priorities=[...f,a]:g.filters.priorities=[a],g.filters.priorityIds=g.filters.priorities?.map(I=>I.id),g});break;case"accessModes":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.accessModes||[];return t?g.filters.accessModes=[]:f.find(I=>I===a.id)?g.filters.accessModes=f.filter(I=>I!==a.id):g.filterConfig?.commentType?.multiSelection?g.filters.accessModes=[...f,a.id]:g.filters.accessModes=[a.id],g});break;case"versions":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.versions||[];return t?g.filters.versions=[]:f.find(I=>I.id===a.id)?g.filters.versions=f.filter(I=>I.id!==a.id):g.filterConfig?.version?.multiSelection?g.filters.versions=[...f,a]:g.filters.versions=[a],g.filters.versionIds=g.filters.versions?.map(I=>I?.id),g});break;default:let p=r+"Ids";if(this.componentConfigSignal().filterConfig[r]?.type==="custom")if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{[r]:[],[p]:[]})}),g)),this.resolvedCommentsOnDom=!0;else{let g=this.componentConfigSignal().filters?.[r]||[];this.componentConfigSignal().filterConfig[r]?.multiSelection?g.find(f=>f.id===a.id)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters[r]=g.filter(I=>I.id!==a.id),f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters[r]=[...g,a],f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters[r]=[a],f)),this.componentConfigSignal.update(f=>(f=D(E({},f),{filters:D(E({},f.filters),{[p]:f.filters[r].map(I=>I?.id)})}),f))}else this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{[r]:a})}),g));break}this.filterCommentAnnotations(),this.setFiltersToStorage()}catch(s){this.loggingService.catch("Error in CommentsSidebarComponent updateFilter: ",s)}}sortPageFilters(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.filters?.pages?.sort((t,r)=>t?.id===e.location?.location?.id?-1:r?.id===e.location?.location?.id?1:t?.displayName?.localeCompare(r?.displayName)),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent sortPageFilters: ",e)}}updateAnnotationCountsByFilter(){try{if(!this.componentConfigSignal().filterCount)return;this.setAnnotationsCountPerPage(),this.setAnnotationsCountPerDocument(),this.setAnnotationsCountPerStatus(),this.setAnnotationsCountPerPeople(),this.setAnnotationsCountPerVersion(),this.setAnnotationsCountPerPriority(),this.setAnnotationsCountPerCommentCategory(),this.setAnnotationsCountPerAccessMode()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateAnnotationCountsByFilter: ",e)}}setAnnotationsCountPerPage(){try{this.componentConfigSignal().pages&&this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.pages).forEach(t=>{e.commentAnnotationsCountByFilters.page[t.id]=this.filterAnnotationsByPage(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerPage: ",e)}}setAnnotationsCountPerDocument(){try{this.componentConfigSignal().documents&&this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.documents).forEach(t=>{e.commentAnnotationsCountByFilters.document[t.id]=this.filterAnnotationsByDocument(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerDocument: ",e)}}setAnnotationsCountPerStatus(){try{let e=this.componentConfigSignal();[this.customFilterService.defaultStatus,...this.customFilterService.ongoingStatuses,this.customFilterService.resolvedStatus].forEach(t=>{e.commentAnnotationsCountByFilters.status[t.id]=this.filterAnnotationsByStatus(t,e.annotations)?.length}),this.componentConfigSignal.update(t=>(t=D(E({},t),{commentAnnotationsCountByFilters:E({},t.commentAnnotationsCountByFilters)}),t))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerStatus: ",e)}}setAnnotationsCountPerPeople(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.peopleFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.people[t.id]=this.filterAnnotationsByPeople(t,e.annotations)?.length}),e.taggedFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.tagged[t.id]=this.filterAnnotationsByTagged(t,e.annotations)?.length}),e.assignedFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.assigned[t.id]=this.filterAnnotationsByAssigned(t,e.annotations)?.length}),e.involvedFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.involved[t.id]=this.filterAnnotationsByInvolved(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerPerson: ",e)}}setAnnotationsCountPerPriority(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.priorities.forEach(t=>{e.commentAnnotationsCountByFilters.priority[t.id]=this.filterAnnotationsByPriority(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerPriority: ",e)}}setAnnotationsCountPerCommentCategory(){try{this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.commentCategoryMap).forEach(t=>{e.commentAnnotationsCountByFilters.commentCategory[t.id]=this.filterAnnotationsByCommentCategory(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerCommentCategory: ",e)}}setAnnotationsCountPerAccessMode(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.accessModes.forEach(t=>{e.commentAnnotationsCountByFilters.accessMode[t.id]=this.filterAnnotationsByAccessMode(t.id,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerAccessMode: ",e)}}setAnnotationsCountPerVersion(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.versions.forEach(t=>{e.commentAnnotationsCountByFilters.version[t.id]=this.filterAnnotationsByVersion(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerVersion: ",e)}}filterCommentAnnotations(){try{let e=this.componentConfigSignal(),t=!1,r=e.annotations.slice(),a=[],s=e.systemFiltersOperator;s===md.AND?a=e.annotations.slice():a=[],e.appliedFiltersCount=0;let c=!1,p=new Set,g=I=>{try{s===md.AND?a=a.filter(x=>I.some(B=>B.annotationId===x.annotationId)):I.forEach(x=>{p.add(x.annotationId)}),c=!0}catch{}};if(e.enablePriority&&e.filterConfig?.priority?.enable&&e.filters.priorities?.length){let I=[];e.filters.priorities?.forEach(x=>{I=[...I,...this.filterAnnotationsByPriority(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.location?.enable&&e.filters.pages?.length){let I=[];e.filters.pages?.forEach(x=>{I=[...I,...this.filterAnnotationsByPage(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filters.documents?.length){let I=[];e.filters.documents?.forEach(x=>{I=[...I,...this.filterAnnotationsByDocument(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.people?.enable&&e.filters.people?.length){let I=[];e.filters.people?.forEach(x=>{I=[...I,...this.filterAnnotationsByPeople(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.tagged?.enable&&e.filters.tagged?.length){let I=[];e.filters.tagged?.forEach(x=>{I=[...I,...this.filterAnnotationsByTagged(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.assigned?.enable&&e.filters.assigned?.length){let I=[];e.filters.assigned?.forEach(x=>{I=[...I,...this.filterAnnotationsByAssigned(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.involved?.enable&&e.filters.involved?.length){let I=[];e.filters.involved?.forEach(x=>{I=[...I,...this.filterAnnotationsByInvolved(x,r)]}),g(I),e.appliedFiltersCount++}if(e.enableAutoCategorize&&e.filterConfig?.category?.enable&&e.filters.categories?.length){let I=[];e.filters.categories?.forEach(x=>{I=[...I,...this.filterAnnotationsByCommentCategory(x,r)]}),g(I),e.appliedFiltersCount++}if(e.isPrivateCommentAllowed&&e.filterConfig?.commentType?.enable&&e.filters.accessModes?.length){let I=[];e.filters.accessModes?.forEach(x=>{I=[...I,...this.filterAnnotationsByAccessMode(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.version?.enable&&e.filters.versions?.length){let I=[];e.filters.versions?.forEach(x=>{I=[...I,...this.filterAnnotationsByVersion(x,r)]}),g(I),e.appliedFiltersCount++}if(e.enableStatus&&e.filters.statuses?.length){let I=[];e.filters.statuses?.forEach(x=>{x.id===this.customFilterService.resolvedStatus.id&&(t=!0),I=[...I,...this.filterAnnotationsByStatus(x,r)]}),g(I),e?.filterConfig?.status?.enable&&e.appliedFiltersCount++}s!==md.AND&&(c?a=r.filter(I=>p.has(I.annotationId)):a=r),e.filters.input&&(a=this.filterAnnotationsByInput(e.filters.input,a));let f=a.slice();if(e.minimalFilter){!t&&e.minimalFilter==="resolved"||e.minimalFilter==="reset"?a=e.annotations.slice():a=f.slice();let I=a.length,x=0,B=0,z=0,W=0,J=0,ne=0;a=a.filter(ve=>{let _e=!1;switch(e.minimalFilter){case"all":!t&&!this.resolvedCommentsOnDom?_e=ve.status?.id!==this.customFilterService.resolvedStatus.id:_e=!0,_e&&z++;break;case"read":_e=!this.componentConfigSignal().unreadCommentsMap?.[ve.annotationId]&&ve.status?.id!==this.customFilterService.resolvedStatus.id,_e&&ne++;break;case"unread":let Fe=!!this.componentConfigSignal().unreadCommentsMap?.[ve.annotationId],Be=ve.status?.id!==this.customFilterService.resolvedStatus.id,Ie=!!this.componentConfigSignal().selectedAnnotationsMap[ve.annotationId];_e=Fe&&Be||Ie,_e&&B++;break;case"open":_e=ve.status?.type==="default",_e&&W++;break;case"resolved":_e=ve.status?.id===this.customFilterService.resolvedStatus.id,_e&&J++;break;case"assignedToMe":let be=e.user?.userId;_e=!!(be&&ve.assignedTo?.userId===be);break;case"reset":_e=!0,_e&&x++;break;default:_e=!0;break}return _e})}if(this.componentConfigSignal.update(I=>(I=D(E(E({},I),e),{filteredCommentPinAnnotations:a}),I)),!this.commentService.getSidebarCustomActionsValue()){let I=this.componentConfigSignal().embedMode||this.componentConfigSignal().sidebarVisible;this.commentService.setCommentsFromSidebarMap({comments:this.componentConfigSignal().skeletonLoading?void 0:a,sidebarVisible:!!I}),this.componentConfigSignal.update(x=>(x=E({},x),x.filteredCommentAnnotationsCount=a?.length||0,x))}this.groupFilteredCommentAnnotations(),!this.componentConfigSignal().sortData&&!this.componentConfigSignal().sortOrder&&this.sortComments(this.componentConfigSignal().selectedMinimalFilterDropdownOption.sorting)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterCommentAnnotations: ",e)}}toggleGroupedCommentAnnotations(e){try{e.isExpanded=!e.isExpanded,this.commentService.getSidebarCustomActionsValue()?(this.componentConfigSignal.update(t=>(t=E({},t),t)),this.updateVirtualScrollDataGroupToggle(this.componentConfigSignal().virtualScrollData)):this.setSidebarGroupedAnnotationsData()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent toggleGroupedCommentAnnotations: ",t)}}changeGroupBy(e){try{this.componentConfigSignal.update(t=>(t=E({},t),e?e===t.groupBy?t.groupBy=null:t.groupBy=e:t.groupBy=null,t)),sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY,this.componentConfigSignal().groupBy||""),this.groupFilteredCommentAnnotations()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent changeGroupBy: ",t)}}groupFilteredCommentAnnotations(){try{let e=this.filteredGroupedCommentAnnotationsObj,t=this.componentConfigSignal(),r=t.systemFiltersOperator===md.AND;switch(t.groupBy){case t.groupByOptions.people:let a=t.filters.people?.length&&r?t.filters.people:t.peopleFilters;this.filteredGroupedCommentAnnotationsObj={},a.forEach(W=>{let J=this.filterAnnotationsByPeople(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.peopleFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.assigned:let s=t.filters.assigned?.length&&r?t.filters.assigned:t.assignedFilters;this.filteredGroupedCommentAnnotationsObj={},s.forEach(W=>{let J=this.filterAnnotationsByAssigned(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.assignedFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.tagged:let c=t.filters.tagged?.length&&r?t.filters.tagged:t.taggedFilters;this.filteredGroupedCommentAnnotationsObj={},c.forEach(W=>{let J=this.filterAnnotationsByTagged(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.taggedFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.involved:let p=t.filters.involved?.length&&r?t.filters.involved:t.involvedFilters;this.filteredGroupedCommentAnnotationsObj={},p.forEach(W=>{let J=this.filterAnnotationsByInvolved(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.involvedFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.page:case t.groupByOptions.location:t=this.componentConfigSignal();let g=t.filters.pages?.length&&r?t.filters.pages:Object.values(t.pages||{});g?.sort((W,J)=>W?.id===t.location?.location?.id||!t.location?.location?.id&&W?.id==="other"?-1:J?.id===t.location?.location?.id||!t.location?.location?.id&&J?.id==="other"?1:0),this.filteredGroupedCommentAnnotationsObj={},g.forEach(W=>{let J=W?.id===t?.location?.location?.id||W?.id==="other"&&!t?.location?.location?.id;this.locations&&Object.keys(this.locations||{}).forEach(ve=>{let _e=this.locations[ve]?.location;_e?.id&&_e?.id===W?.id&&(J=!0)});let ne=this.filterAnnotationsByPage(W,this.componentConfigSignal().filteredCommentPinAnnotations);if((W.id||W?.displayName)&&ne?.length){let ve=W.id||W?.displayName||"";this.filteredGroupedCommentAnnotationsObj[ve]={displayName:W.displayName,annotations:ne,isExpanded:e[ve]?e[ve]?.isExpanded:!!J}}}),this.filteredGroupedCommentAnnotations=[];let f=t?.filterConfig?.location?.order||[];if(f?.length){let W=J=>{let ne=f.indexOf(J?.id);return ne===-1?1/0:ne};g.sort((J,ne)=>{let ve=W(J),_e=W(ne);return ve!==_e?ve-_e:g.indexOf(J)-g.indexOf(ne)})}g.forEach(W=>{let J=W.id||W?.displayName||"";J&&this.filteredGroupedCommentAnnotationsObj[J]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[J])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;case t.groupByOptions.priority:let I=t.filters.priorities?.length&&r?t.filters.priorities:t.priorities;this.filteredGroupedCommentAnnotationsObj={},I.forEach(W=>{let J=this.filterAnnotationsByPriority(W,this.componentConfigSignal().filteredCommentPinAnnotations);J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.priorities.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;case t.groupByOptions.category:let x=t.filters.categories?.length&&r?t.filters.categories:Object.values(t.commentCategoryMap||{});this.filteredGroupedCommentAnnotationsObj={},x.forEach(W=>{let J=this.filterAnnotationsByCommentCategory(W,this.componentConfigSignal().filteredCommentPinAnnotations);J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],x.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;case t.groupByOptions.document:t=this.componentConfigSignal();let B=t.filters.documents?.length&&r?t.filters.documents:Object.values(t.documents||{});B?.sort((W,J)=>W?.id===t.currentDocument?-1:J?.id===t.currentDocument?1:0),this.filteredGroupedCommentAnnotationsObj={},B.forEach(W=>{let J=W?.id===t?.currentDocument,ne=this.filterAnnotationsByDocument(W,this.componentConfigSignal().filteredCommentPinAnnotations);if(W.id&&ne?.length){let ve=W.id||"";this.filteredGroupedCommentAnnotationsObj[ve]={displayName:W.documentName||W.id||"",annotations:ne,isExpanded:e[ve]?e[ve]?.isExpanded:!!J}}}),this.filteredGroupedCommentAnnotations=[];let z=t?.filterConfig?.document?.order||[];if(z?.length){let W=J=>{let ne=z.indexOf(J?.id);return ne===-1?1/0:ne};B.sort((J,ne)=>{let ve=W(J),_e=W(ne);return ve!==_e?ve-_e:B.indexOf(J)-B.indexOf(ne)})}B.forEach(W=>{let J=W.id;J&&this.filteredGroupedCommentAnnotationsObj[J]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[J])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;default:this.filteredGroupedCommentAnnotationsObj={},this.filteredGroupedCommentAnnotationsObj={[this.pageTypes.all]:{displayName:this.pageTypes.all,annotations:this.componentConfigSignal().filteredCommentPinAnnotations,isExpanded:e[this.pageTypes.all]?e[this.pageTypes.all]?.isExpanded:!0}},this.filteredGroupedCommentAnnotations=[this.filteredGroupedCommentAnnotationsObj[this.pageTypes.all]];break}this.setSidebarGroupedAnnotationsData()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent groupFilteredCommentAnnotations: ",e)}}setSidebarGroupedAnnotationsData(){try{if(this.commentService.getSidebarCustomActionsValue()){if(this.commentService.getSidebarCustomActionsValue()&&this.dataAvailable){let e={};Object.keys(this.componentConfigSignal().filterConfig||{}).forEach(t=>{this.componentConfigSignal().filterConfig[t]?.type==="custom"&&(e[t]=this.componentConfigSignal().filterConfig[t]?.options?.map(r=>({id:r.id,name:r.name,selected:this.componentConfigSignal().filters[t+"Ids"]?.includes(r.id)})))}),this.componentConfigSignal.update(t=>(t=D(E({},t),{customFilters:e}),t)),this.commentService.getSidebarCustomActionEventDataOnInitValue()?this.commentService.setSidebarCustomActionEventDataAllChanges(this.componentConfigSignal().customActionsState,this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,e):this.commentService.setSidebarCustomActionEventDataOnInit(this.componentConfigSignal().customActionsState,this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,e)}}else{let e=this.filteredGroupedCommentAnnotations.length===1&&this.filteredGroupedCommentAnnotations[0].displayName==="Others";this.componentConfigSignal.update(r=>(r=E({},r),r.virtualScrollData=[],r)),this.filteredGroupedCommentAnnotations.forEach(r=>{!e&&r.annotations?.length&&this.componentConfigSignal.update(a=>(a=E({},a),a.virtualScrollData.push({type:"group",data:r}),a)),(r.isExpanded||e)&&r.annotations.forEach(a=>{this.componentConfigSignal.update(s=>(s=E({},s),s.virtualScrollData.push({type:"annotation",data:a}),s))})}),this.componentConfigSignal.update(r=>(r=D(E({},r),{noCommentsFoundForAppliedFilters:!this.componentConfigSignal().virtualScrollData?.length}),r)),this.cd.markForCheck();let t=this.componentConfigSignal().virtualScrollViewportRef?.elementRef?.nativeElement;t&&(t.scrollTop=0)}}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setSidebarGroupedAnnotationsData: ",e)}}filterAnnotationsByPage(e,t){try{return t?.filter(r=>e?.locationIds?.length?r?.locationId?r?.location?.id===e?.id||e?.locationIds?.includes(r?.locationId):r?.documentParams?.id===e?.id||e?.locationIds?.includes(r?.documentParamsId):!r?.locationId&&!r?.documentParamsId)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByPage: ",r),[]}}filterAnnotationsByStatus(e,t){try{return t.filter(r=>r?.status?.id===e.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByStatus: ",r),[]}}filterAnnotationsByPeople(e,t){try{return e.id?t.filter(r=>r?.from?.userId===e?.id||r?.from?.email===e?.id):t}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByPeople: ",r),[]}}filterAnnotationsByTagged(e,t){try{return e.id===this.componentConfigSignal().user?.userId?t.filter(r=>{let a=!1;return r.comments.forEach(s=>{s.taggedUserContacts?.forEach(c=>{c?.contact?.userId===this.componentConfigSignal().user?.userId&&(a=!0)})}),a}):t.filter(r=>r?.comments?.some(a=>a?.taggedUserContacts?.some(s=>s?.contact?.userId===e?.id)))}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByTagged: ",r),[]}}filterAnnotationsByAssigned(e,t){try{return e.id===this.componentConfigSignal().user?.userId?t.filter(r=>r?.assignedTo?.userId===this.componentConfigSignal().user?.userId):t.filter(r=>r?.assignedTo?.userId===e?.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByAssigned: ",r),[]}}filterAnnotationsByInvolved(e,t){try{return t.filter(r=>{let a=r?.from?.userId===e?.id||r?.from?.email===e?.id,s=r?.assignedTo?.userId===e?.id,c=r?.comments?.some(p=>p?.taggedUserContacts?.some(g=>g?.contact?.userId===e?.id));return a||s||c})}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByInvolved: ",r),[]}}filterAnnotationsByPriority(e,t){try{return e.id==="unset"?t.filter(r=>!r?.priority):t.filter(r=>r?.priority?.id===e.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByPriority: ",r),[]}}filterAnnotationsByCommentCategory(e,t){try{switch(e?.id){case"other":return t?.filter(r=>!r?.commentCategories?.length||r?.commentCategories?.find(a=>a?.id===e?.id))}return t?.filter(r=>(r?.commentCategories||[])?.find(a=>a?.id===e?.id))}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByCommentCategory: ",r),[]}}filterAnnotationsByAccessMode(e,t){try{return e===ho.PRIVATE?t.filter(r=>r?.iam?.accessMode===ho.PRIVATE):t.filter(r=>!r?.iam?.accessMode||r?.iam?.accessMode===ho.PUBLIC)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByAccessMode: ",r),[]}}filterAnnotationsByVersion(e,t){try{return e.id==="unset"?t.filter(r=>!r?.location?.version):t.filter(r=>r?.location?.version?.id===e.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByVersion: ",r),[]}}filterAnnotationsByInput(e,t){try{let r=e.match(/^#(\d+)$/);if(r){let a=parseInt(r[1]);return t.filter(s=>s.annotationNumber===a)}return t.filter(a=>{let s=!1;for(let c=0;c<a?.comments?.length;c++){let p=a?.comments[c];if(p?.commentText?.toLowerCase().includes(e.toLowerCase())){s=!0;break}else if(p?.from?.name?.toLowerCase().includes(e.toLowerCase())){s=!0;break}}return s})}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByInput: ",r),[]}}closeSidebar(){try{this.commentService.setSidebarVisibility(!1,!1,!0),this.onSidebarClose.emit()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent closeSidebar: ",e)}}emitOnSidebarCommentClick(e){try{let t=this.documentPaths?.clientDocumentId,r=e?.location;r||(r=e?.documentParams);let a={};e.context&&(a=e.context),this.onSidebarCommentClick.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e}),this.onSidebarCommentClickEvent.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e}),this.onCommentClick.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e}),this.commentService.onSidebarCommentClick({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onSidebarCommentClick: ",t)}}emitOnCommentNavigationButtonClick(e){try{let t=this.documentPaths?.clientDocumentId,r=e?.location;r||(r=e?.documentParams);let a={};e.context&&(a=e.context),this.onCommentNavigationButtonClick.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent emitOnCommentNavigationButtonClick: ",t)}}setFiltersToStorage(){try{let e=JSON.parse(JSON.stringify(this.componentConfigSignal().filters));delete e?.input;let t=JSON.stringify(e);sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS,t)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setFiltersToStorage: ",e)}}setCommentSidebarInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(df.COMMENT_SIDEBAR)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentSidebarInstalledInAnalytics: ",e)}}setCommentSidebarEmbedModeInAnalytics(){try{this.componentConfigSignal().embedMode&&this.analyticsService.trackEvent(Y.Events.Comments.COMMENT_SIDEBAR_EMBED_MODE_ENABLED,{commentMode:this.commentService.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentSidebarEmbedModeInAnalytics: ",e)}}setCommentSidebarFloatingModeInAnalytics(){try{this.componentConfigSignal().floatingMode&&this.analyticsService.trackEvent(Y.Events.Comments.COMMENT_SIDEBAR_FLOATING_MODE_ENABLED,{commentMode:this.commentService.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentSidebarFloatingModeInAnalytics: ",e)}}setCommentReadInAnalytics(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentReadInAnalytics","color: green;"),this.commentReadAnalyticsCalled||(this.commentReadAnalyticsCalled=!0,this.analyticsService.trackEvent(Y.Events.Comments.COMMENT_READ,{uiLocation:"sidebar",commentMode:this.commentService.getCommentMode(),readType:"hover"}))}catch(e){this.loggingService.catch("Error in CommentDialogComponent setCommentReadInAnalytics: ",e)}}toggleMoreFilters(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{moreFiltersVisible:!t.moreFiltersVisible}),t)),e&&e?.scrollTo({top:0})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent toggleMoreFilters: ",t)}}closeMoreFilters(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{moreFiltersVisible:!1,filterRecentlyClosed:!0}),t)),e&&e?.scrollTo({top:0}),setTimeout(()=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{filterRecentlyClosed:!1}),t))},100)}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent closeMoreFilters: ",t)}}openMoreFilters(e){try{if(this.componentConfigSignal().filterRecentlyClosed)return;this.componentConfigSignal.update(t=>(t=D(E({},t),{moreFiltersVisible:!0}),t)),e&&e?.scrollTo({top:0})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent openMoreFilters: ",t)}}savePageComment(e){try{let t=e?.updatedComment;if(t){let r=this.componentConfigSignal().targetElementIdFromPageModeComposer;this.commentService.addComment(void 0,void 0,void 0,void 0,!0,[t],void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,e?.annotation?.assignedTo,void 0,void 0,this.componentConfigSignal().context,void 0,void 0,r||void 0)}this.commentService.clearPageModeComposerContext(),this.componentConfigSignal.update(r=>(r=E({},r),r.pageCommentAnnotation=new Zo,r.pageCommentAnnotation.isPageAnnotation=!0,r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent savePageComment: ",t)}}sortComments(e){try{this.componentConfigSignal.update(t=>{let r=[...t.virtualScrollData];return r.sort((a,s)=>{if(a.type==="annotation"&&s.type==="annotation"){if(e==="date"){let c=new Date(a.data.lastUpdated).getTime();return new Date(s.data.lastUpdated).getTime()-c}else if(e==="unread"){let c=t.unreadCommentsMap?.[a.data.annotationId]||0,p=t.unreadCommentsMap?.[s.data.annotationId]||0;if(c>0&&p===0)return-1;if(c===0&&p>0)return 1;let g=new Date(a.data.lastUpdated).getTime();return new Date(s.data.lastUpdated).getTime()-g}}return 0}),t=D(E({},t),{virtualScrollData:r}),t}),this.componentConfigSignal.update(t=>(t=D(E({},t),{minimalFilterDropdownOpen:!1,selectedMinimalFilterDropdownOption:D(E({},t.selectedMinimalFilterDropdownOption),{sorting:e})}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent sortComments: ",t)}}toggleMinimalFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalFilterDropdownOpen:!e.minimalFilterDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleMinimalFilterDropdown: ",e)}}filterCommentsByReadStatus(e){try{this.componentConfigSignal.update(t=>{let a=t.selectedMinimalFilterDropdownOption?.filter===e?"reset":e;return t=D(E({},t),{minimalFilter:a,minimalFilterDropdownOpen:!1,selectedMinimalFilterDropdownOption:D(E({},t.selectedMinimalFilterDropdownOption),{filter:a})}),t}),this.filterCommentAnnotations()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent filterCommentsByReadStatus: ",t)}}resetFilters(){try{this.componentConfigSignal.update(e=>{let t=e.filters;return Object.keys(t).forEach(r=>{t[r]?.length&&(t[r]=[])}),e=D(E({},e),{minimalFilter:"all",customActionsState:{all:!0},filters:D(E({},t),{input:""}),selectedMinimalFilterDropdownOption:D(E({},e.selectedMinimalFilterDropdownOption),{filter:"all"})}),e}),this.resolvedCommentsOnDom=!1,this.filterCommentsByReadStatus("all"),this.updateFilter({key:"pages",value:null},!0),this.updateFilter({key:"documents",value:null},!0),this.updateFilter({key:"people",value:null},!0),this.updateFilter({key:"assigned",value:null},!0),this.updateFilter({key:"tagged",value:null},!0),this.updateFilter({key:"statuses",value:null},!0),this.updateFilter({key:"priorities",value:null},!0),this.updateFilter({key:"categories",value:null},!0),this.updateFilter({key:"versions",value:null},!0),sessionStorage.removeItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent resetFilters: ",e)}}toggleLocationFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{locationFilterDropdownOpen:!e.locationFilterDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleLocationFilterDropdown: ",e)}}toggleDocumentFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{documentFilterDropdownOpen:!e.documentFilterDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleDocumentFilterDropdown: ",e)}}closeDocumentFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{documentFilterDropdownOpen:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent closeDocumentFilterDropdown: ",e)}}toggleMinimalActionsDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalActionsDropdownOpen:!e.minimalActionsDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleMinimalActionsDropdown: ",e)}}markAllCommentAnnotationsAsRead(){try{this.commentService.setCommentAnnotationsAsRead(this.componentConfigSignal().filteredCommentPinAnnotations),this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalActionsDropdownOpen:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentAnnotationsAsRead: ",e)}}markAllCommentAnnotationsAsResolved(){try{this.commentService.setCommentAnnotationsAsResolved(this.componentConfigSignal().filteredCommentPinAnnotations),this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalActionsDropdownOpen:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent markAllCommentAnnotationsAsResolved: ",e)}}toggleCustomAction(e,t){try{t==="toggle"?(this.componentConfigSignal.update(r=>(r=D(E({},r),{customActionsState:{[e]:!r.customActionsState[e]}}),r)),sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE,JSON.stringify(this.componentConfigSignal().customActionsState)),this.commentService.setSidebarCustomActionEventData(this.componentConfigSignal().customActionsState,this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,this.componentConfigSignal().customFilters)):(this.commentService.setSidebarCustomActionEventData({[e]:!0},this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,this.componentConfigSignal().customFilters),sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE,JSON.stringify({[e]:!0})))}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent toggleCustomAction: ",r)}}goBackToAllComments(){try{let e=this.componentConfigSignal().focusedAnnotation;this.componentConfigSignal.update(t=>(t=D(E({},t),{focusedAnnotation:null,focusedAnnotationEditCommentIndex:null}),t)),e&&(this.domService.toggleAnnotationSelection(e),setTimeout(()=>{this.goToAnnotationInSidebar(e,"instant")},100))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent goBackToAllComments: ",e)}}filterSearch(e,t){try{let r=this.componentConfigSignal();if(!r?.peopleFilters)return;let a,s;switch(t){case"people":a=r.peopleFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"assigned":a=r.assignedFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"tagged":a=r.taggedFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"involved":a=r.involvedFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"pages":a=r.pages,!e||e===""?s=r.pages:(s={},Object.keys(a).filter(p=>p.toLowerCase().includes(e.toLowerCase())).forEach(p=>{s[p]=a[p]}));break;case"documents":a=r.documents,!e||e===""?s=r.documents:(s={},Object.keys(a).filter(p=>a[p]?.documentName?.toLowerCase().includes(e.toLowerCase())).forEach(p=>{s[p]=a[p]}));break;case"statuses":a=r.statuses,!e||e===""?s=a:s=a.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break;case"priorities":a=r.priorities,!e||e===""?s=a:s=a.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break;case"categories":a=r.commentCategoryMap,!e||e===""?s=r.commentCategoryMap:(s={},Object.keys(a).filter(p=>p.toLowerCase().includes(e.toLowerCase())).forEach(p=>{s[p]=a[p]}));break;case"versions":a=r.versions,!e||e===""?s=r.versions:s=a.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break;default:a=r.filterConfig[t]?.options,!e||e===""?s=r.filterConfig[t]?.options:s=a?.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break}return s}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterPeople: ",r),[]}}updateDocumentSelectedState(){try{this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.documents).forEach(t=>{let r=e.filters?.documents?.find(a=>a.id===t?.id);r?(t.selected=!0,r.documentName||(r.documentName=t.documentName)):t.selected=!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateDocumentSelectedState: ",e)}}filterAnnotationsByDocument(e,t){try{return t?.filter(r=>e?.id&&e.id!=="other"?r?.metadata?.clientDocumentId?.toString()===e.id:!r?.metadata?.clientDocumentId)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByDocument: ",r),[]}}onDialogExpanded(e){try{setTimeout(()=>{let t=this.componentConfigSignal().annotations.find(r=>r.annotationId===e);t&&this.goToAnnotationInSidebar(t)},200)}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onDialogExpanded: ",t)}}onFullscreenClick(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{fullScreen:!e.fullScreen}),e)),this.onFullscreen.emit(this.componentConfigSignal().fullScreen)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent onFullscreenClick: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(we),h(Ft),h(Ve),h(ot),h(R),h(xn),h(_),h(Oo),h(Wo),h(Ll),h(an),h(Ge),h(Yi),h(z1),h(Ke))},o.\u0275cmp=O({type:o,selectors:[["app-comments-sidebar"]],viewQuery:function(t,r){if(t&1&&(it(iin,5),it(oin,7)),t&2){let a;et(a=tt())&&(r.sidebarOverlay=a.first),et(a=tt())&&(r.hostElement=a.first)}},hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{embedMode:"embedMode",floatingMode:"floatingMode",_pageMode:[0,"pageMode","_pageMode"],_filterCount:[0,"filterCount","_filterCount"],_customActions:[0,"customActions","_customActions"],focusedThreadMode:"focusedThreadMode",_openAnnotationInFocusMode:[0,"openAnnotationInFocusMode","_openAnnotationInFocusMode"],_readOnly:[0,"readOnly","_readOnly"],_selection:[0,"dialogSelection","_selection"],_forceClose:[0,"forceClose","_forceClose"],_expandOnSelection:[0,"expandOnSelection","_expandOnSelection"],_sortData:[0,"sortData","_sortData"],_sortOrder:[0,"sortOrder","_sortOrder"],_sortBy:[0,"sortBy","_sortBy"],enableUrlNavigation:"enableUrlNavigation",urlNavigation:"urlNavigation",_queryParamsComments:[0,"queryParamsComments","_queryParamsComments"],_fullScreen:[0,"fullScreen","_fullScreen"],_currentLocationSuffix:[0,"currentLocationSuffix","_currentLocationSuffix"],_filterOptionLayout:[0,"filterOptionLayout","_filterOptionLayout"],_filterConfig:[0,"filterConfig","_filterConfig"],_groupConfig:[0,"groupConfig","_groupConfig"],_filters:[0,"filters","_filters"],_systemFiltersOperator:[0,"systemFiltersOperator","_systemFiltersOperator"],_excludeLocationIds:[0,"excludeLocationIds","_excludeLocationIds"],_fullExpanded:[0,"fullExpanded","_fullExpanded"],_sidebarButtonCountType:[0,"sidebarButtonCountType","_sidebarButtonCountType"],_filterGhostCommentsInSidebar:[0,"filterGhostCommentsInSidebar","_filterGhostCommentsInSidebar"],dialogVariant:"dialogVariant",focusedThreadDialogVariant:"focusedThreadDialogVariant",filterPanelLayout:"filterPanelLayout",pageModeComposerVariant:"pageModeComposerVariant",searchPlaceholder:"searchPlaceholder",commentPlaceholder:"commentPlaceholder",replyPlaceholder:"replyPlaceholder",pageModePlaceholder:"pageModePlaceholder",_sidebarShadowDOM:[0,"shadowDom","_sidebarShadowDOM"],_context:[0,"context","_context"],_defaultMinimalFilter:[0,"defaultMinimalFilter","_defaultMinimalFilter"],variant:"variant",position:"position"},outputs:{openSidebar:"openSidebar",onSidebarOpen:"onSidebarOpen",onSidebarCommentClick:"sidebarCommentClick",onSidebarCommentClickEvent:"onSidebarCommentClick",onCommentClick:"onCommentClick",onSidebarClose:"onSidebarClose",onCommentNavigationButtonClick:"onCommentNavigationButtonClick",onFullscreen:"onFullscreenClick"},standalone:!1,features:[L,Qe],decls:1,vars:1,consts:[["sidebarRef",""],["defaultSidebarMode",""],["sidebarTrigger","cdkOverlayOrigin"],["sidebarOverlay","cdkConnectedOverlay"],[4,"ngIf"],[3,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["cdkOverlayOrigin",""],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass"],["class","velt-comments-sidebar-container",3,"dark",4,"ngIf"],[1,"velt-comments-sidebar-container"],["role","dialog",3,"onWrapperClick","componentConfigSignal","template","darkMode"]],template:function(t,r){t&1&&u(0,fin,4,1,"ng-container",4),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,dn,sn,Sn,rye,ge],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}[_nghost-%COMP%]{width:100%} .snippyly-sidebar-panel .viewport .cdk-virtual-scroll-content-wrapper{max-width:100%}.s-overflow-hidden[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0});let i=o;return i})();function vin(i,o){if(i&1&&(y(0,"snippyly-cursor-pointer",5)(1,"slot",6),ce(),y(2,"svg",7)(3,"g",8),w(4,"path",9)(5,"path",10),b(),y(6,"defs")(7,"filter",11),w(8,"feFlood",12)(9,"feColorMatrix",13)(10,"feOffset",14)(11,"feGaussianBlur",15)(12,"feColorMatrix",16)(13,"feBlend",17)(14,"feBlend",18),b()()()()()),i&2){let n=l().$implicit,e=l(2).ngIf,t=l();d("cursorUser",n)("avatarMode",t.avatarMode)("huddleState",e.huddleOnCursorModeByAttendeeId[n==null?null:n.userSnippylyId]?e.attendeesByUserId[n==null?null:n.userSnippylyId]==null?null:e.attendeesByUserId[n==null?null:n.userSnippylyId].state:void 0)("stream",e.huddleOnCursorModeByAttendeeId[n==null?null:n.userSnippylyId]?e.remoteStreamsByUserId[n==null?null:n.userSnippylyId]==null?null:e.remoteStreamsByUserId[n==null?null:n.userSnippylyId].webcam:void 0),m(4),T("fill",n.color),m(),T("fill",n.color)}}function Cin(i,o){if(i&1&&(v(0),u(1,vin,15,6,"snippyly-cursor-pointer",4),C()),i&2){let n=o.$implicit;m(),d("ngIf",n==null?null:n.position)}}function _in(i,o){if(i&1&&(y(0,"snippyly-cursor-pointer",19)(1,"slot",6),ce(),y(2,"svg",7)(3,"g",8),w(4,"path",9)(5,"path",10),b(),y(6,"defs")(7,"filter",11),w(8,"feFlood",12)(9,"feColorMatrix",13)(10,"feOffset",14)(11,"feGaussianBlur",15)(12,"feColorMatrix",16)(13,"feBlend",17)(14,"feBlend",18),b()()()()()),i&2){let n=l(2).ngIf,e=l();d("cursorUser",n.currentCursorUser)("selfCursorPointer",!0)("avatarMode",e.avatarMode)("huddleState",n.huddleOnCursorMode?n.attendeesByUserId[n.currentCursorUser==null?null:n.currentCursorUser.userSnippylyId]==null?null:n.attendeesByUserId[n.currentCursorUser==null?null:n.currentCursorUser.userSnippylyId].state:void 0)("stream",n.localStream),m(4),T("fill",n.currentCursorUser.color),m(),T("fill",n.currentCursorUser.color)}}function yin(i,o){if(i&1&&u(0,Cin,2,1,"ng-container",2)(1,_in,15,7,"snippyly-cursor-pointer",3),i&2){let n=l().ngIf,e=l();d("ngForOf",n.cursorUsers)("ngForTrackBy",e.trackById),m(),d("ngIf",n.huddleJoined&&n.huddleOnCursorMode&&n.currentCursorUser)}}function Sin(i,o){if(i&1&&(v(0),u(1,yin,2,3,"ng-template",1),C()),i&2){let n=o.ngIf;m(),d("ngIf",n.isFirstComponent&&!(n.user!=null&&n.user.isAnonymous))}}var Fq=(()=>{let o=class o{get inactivityTime(){return this._inactivityTime}set inactivityTime(e){try{isNaN(e)?this.loggingService.catch("Error in Cursor set inactivityTime: ","inactivity-time value is not a number."):(this._inactivityTime=e,this.cursorService.setInactivityTime(this._inactivityTime))}catch(t){this.loggingService.catch("Error in Cursor set inactivityTime: ",t)}}get allowedElementIds(){return this._allowedElementIds}set allowedElementIds(e){try{this._allowedElementIds=typeof e=="string"?JSON.parse(e):e,this.cursorService.setAllowedElementIds(this._allowedElementIds)}catch(t){this.loggingService.catch("Error in Cursor set allowedElementIds: ",t)}}constructor(e,t,r,a,s,c){this.analyticsService=e,this.authService=t,this.cursorService=r,this.domService=a,this.huddleService=s,this.loggingService=c,this.avatarMode=!1,this.onCursorUsersChanged=new Me,this.onCursorUserChange=new Me,this.subscriptions=[],this.constants=U,this.showInitials={},this.componentConfigSignal=Te({isFirstComponent:!1,user:void 0,cursorUsers:[],huddleOnCursorModeByAttendeeId:{},attendeesByUserId:{},remoteStreamsByUserId:{},huddleOnCursorMode:!1,huddleJoined:!1,currentCursorUser:new LC,localStream:void 0}),this.veltId=vt(),this.veltElement=!0,this._inactivityTime=5,this._allowedElementIds=[],this.loggingService.log("%c[WB] Creating CLASS: CursorComponent","color: blue;")}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;")}ngAfterViewInit(){try{let e=document.querySelector(U.TAGS.SNIPPYLY_CURSOR),t=document.querySelector(U.TAGS.VELT_CURSOR);t?this.veltId===t?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),this.initComponent()):this.veltId===e?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),this.initComponent())}catch(e){this.loggingService.catch("Error in CursorComponent AfterViewInit: ",e)}}initComponent(){try{this.cursorService.checkCursorTagAvailable(),this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t)),this.componentConfigSignal().user&&this.setCursorInstalledInAnalytics()},e=>{this.loggingService.catch("Error in CursorComponent getUser$ subscription: ",e)})),this.subscriptions.push(this.huddleService.getHuddleJoined$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{huddleJoined:e}),t))})),this.subscriptions.push(this.huddleService.getHuddleOnCursorMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{huddleOnCursorMode:e}),t))},e=>{this.loggingService.catch("Error in CursorComponent getHuddleOnCursorMode$ subscription: ",e)})),this.subscriptions.push(this.huddleService.localStream$.subscribe(e=>{e?this.componentConfigSignal.update(t=>(t=D(E({},t),{localStream:e}),t)):this.componentConfigSignal.update(t=>(t=D(E({},t),{localStream:void 0}),t))})),this.subscriptions.push(this.huddleService.getRemoteStreamsByUserId$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{remoteStreamsByUserId:e}),t))},e=>{this.loggingService.catch("Error in CursorComponent getRemoteStreamsByUserId$ subscription: ",e)})),this.subscriptions.push(this.huddleService.getHuddleAttendees$().subscribe(e=>{let t={};e?t=e.reduce((r,a)=>(r[a.userSnippylyId]=a,r),{}):t={},this.componentConfigSignal.update(r=>(r=D(E({},r),{attendeesByUserId:t}),r))},e=>{this.loggingService.catch("Error in CursorComponent getAttendees$ subscription: ",e)})),this.subscriptions.push(this.huddleService.getHuddleOnCursorModeByAttendeeId$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{huddleOnCursorModeByAttendeeId:e}),t))})),this.subscriptions.push(this.domService.onWindowPointerMove$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{currentCursorUser:D(E({},t.currentCursorUser),{position:{left:(e?.clientX||0)-2,top:(e?.clientY||0)-2}})}),t))},e=>{this.loggingService.catch("Error in CursorComponent onWindowPointerMove$ subscription: ",e)})),this.getCurrentCursorUser(),this.getLiveCursorsOnCurrentDocument()}catch(e){this.loggingService.catch("Error in CursorComponent initComponent: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(e){this.loggingService.catch("Error in CursorComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in CursorComponent unsubscribe: ",e)}}getLiveCursorsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getLiveCursorsOnCurrentDocument","color: green;");try{this.subscriptions.push(this.cursorService.getLiveCursorsOnCurrentDocument().pipe(Le(e=>!!e)).subscribe(e=>{this.loggingService.log(e),e&&(this.componentConfigSignal.update(t=>(t=D(E({},t),{cursorUsers:e}),t)),this.onCursorUsersChanged.emit(e),this.onCursorUserChange.emit(e))},e=>{this.loggingService.catch("Error in CursorComponent getLiveCursorsOnCurrentDocument subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CursorComponent getLiveCursorsOnCurrentDocument: ",e)}}getCurrentCursorUser(){this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentCursorUser","color: green;");try{this.subscriptions.push(this.cursorService.getCursorUser().pipe(Le(e=>!!e)).subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{currentCursorUser:D(E({},e),{position:t.currentCursorUser?.position})}),t))},e=>{this.loggingService.catch("Error in CursorComponent getCurrentCursorUser subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CursorComponent getCurrentCursorUser: ",e)}}trackById(e,t){return t?.userId}onImageLoadError(e){this.loggingService.log("%c[WB] Calling FUNCTION: onImageLoadError","color: green;");try{this.showInitials[e.userId]=!0}catch(t){this.loggingService.catch("Error in CursorComponent onImageLoadError: ",t)}}setCursorInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(Ne.CURSOR)}catch(e){this.loggingService.catch("Error in CursorComponent setCursorInstalledInAnalytics: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(ZC),h(Ve),h(Or),h(_))},o.\u0275cmp=O({type:o,selectors:[["app-cursor"]],hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{avatarMode:"avatarMode",inactivityTime:"inactivityTime",allowedElementIds:"allowedElementIds"},outputs:{onCursorUsersChanged:"cursorUsersChanged",onCursorUserChange:"onCursorUserChange"},standalone:!1,decls:1,vars:1,consts:[[4,"ngIf"],[3,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"cursorUser","selfCursorPointer","avatarMode","huddleState","stream",4,"ngIf"],[3,"cursorUser","avatarMode","huddleState","stream",4,"ngIf"],[3,"cursorUser","avatarMode","huddleState","stream"],["name","cursor"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"cursor-icon"],["filter","url(#filter0_d_6047_31299)"],["d","M7.68749 16.5142L5.42791 5.15177C5.26065 4.31067 6.16027 3.66301 6.90484 4.08848L16.8788 9.78786C17.6558 10.2319 17.503 11.3948 16.6376 11.623L12.3849 12.7447C12.1377 12.8098 11.9249 12.9672 11.7902 13.1844L9.51802 16.8464C9.03968 17.6174 7.86445 17.4041 7.68749 16.5142Z","fill","#625DF5"],["d","M4.93751 5.24929L7.19709 16.6118C7.46253 17.9466 9.22538 18.2664 9.94288 17.11L12.215 13.448C12.2824 13.3394 12.3888 13.2607 12.5124 13.2281L16.7651 12.1065C18.0632 11.7642 18.2924 10.0198 17.1268 9.35374L7.15291 3.65436C6.03605 3.01615 4.68662 3.98765 4.93751 5.24929Z","stroke","white","stroke-linecap","square"],["id","filter0_d_6047_31299","x","0.588557","y","0.405717","width","21.6129","height","23.0055","filterUnits","userSpaceOnUse","color-interpolation-filters","sRGB"],["flood-opacity","0","result","BackgroundImageFix"],["in","SourceAlpha","type","matrix","values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0","result","hardAlpha"],["dy","1.1"],["stdDeviation","1.2"],["type","matrix","values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.17 0"],["mode","normal","in2","BackgroundImageFix","result","effect1_dropShadow_6047_31299"],["mode","normal","in","SourceGraphic","in2","effect1_dropShadow_6047_31299","result","shape"],[3,"cursorUser","selfCursorPointer","avatarMode","huddleState","stream"]],template:function(t,r){t&1&&u(0,Sin,2,1,"ng-container",0),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,$1],styles:[`html{--velt-base-rem-unit: 1}*[data-snippyly-element=true],*[data-velt-element=true]{font-family:var(--velt-default-font-family)}velt-wireframe{display:none!important}*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:rgba(255,255,255,0);outline:none;height:unset;width:unset;text-align:left;line-height:1.5;color:#000;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));pointer-events:none!important}*:empty{display:revert}.cursor-icon path{stroke:#fff;stroke-width:1px;stroke-linejoin:round}
|
|
534
|
+
`||this.componentConfigSignal().selectedAttachments?.length||this.componentConfigSignal().attachmentsToDelete?.length||this.componentConfigSignal().recorderInitConfig&&this.componentConfigSignal().recorderInitConfig?.panelId===this.componentConfigSignal().commentDialogUniqueId||this.componentConfigSignal().localRecordedData?.length?this.componentConfigSignal.update(e=>(e=D(E({},e),{getAnnotationDraftAttribute:e.annotation?.annotationId}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{getAnnotationDraftAttribute:null}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkGetAnnotationDraftAttribute: ",e)}}checkShowGhostCommentMessage(){try{this.componentConfigSignal().ghostComment&&this.componentConfigSignal().enableGhostCommentsMessage&&![this.componentConfigSignal().commentAcceptedStatus?.id,this.componentConfigSignal().commentRejectedStatus?.id].includes(this.componentConfigSignal().annotation?.status?.id)?this.componentConfigSignal.update(e=>(e=D(E({},e),{showGhostCommentMessage:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{showGhostCommentMessage:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkShowGhostCommentMessage: ",e)}}checkShowSuggestionModeActions(){try{this.componentConfigSignal().suggestionMode&&this.componentConfigSignal().dialogSelectedByKnownUser&&this.componentConfigSignal().annotation?.status?.type!=="terminal"&&this.componentConfigSignal().annotation?.comments?.length?this.componentConfigSignal.update(e=>(e=D(E({},e),{showSuggestionModeActions:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{showSuggestionModeActions:!1}),e))}catch(e){this.catchError("Error in CommentDialogComponent checkShowSuggestionModeActions: ",e)}}ngOnDestroy(){super.ngOnDestroy(),this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeLinkClickListeners(),this.veltDynamicComponents.forEach(e=>{e.destroy()}),this.subscriptions.map(e=>{e.unsubscribe()}),this.domService.setRecordingInProgress(this.componentConfigSignal().annotation?.annotationId,!1),this.subscriptions=[],this.componentConfigSignal().recorderInitConfig?.panelId===this.componentConfigSignal().commentDialogUniqueId&&this.recorderService.clearRecording(),this.resizeObserver&&this.componentConfigSignal().commentsContainer?.nativeElement&&this.resizeObserver.unobserve(this.componentConfigSignal().commentsContainer?.nativeElement),clearTimeout(this.escapePressTimeout),this.componentConfigSignal().getAnnotationDraftAttribute&&!this.componentConfigSignal().focusedThreadMode&&this.commentService.getDraftMode()&&!this.componentConfigSignal().editComment&&this.componentConfigSignal().getAnnotationDraftAttribute&&this.addComment(void 0,!0)}catch(e){this.catchError("Error in CommentDialogComponent unsubscribe: ",e)}}closeDialog(){try{this.domService.resetSelectedAnnotationsMap()}catch(e){this.catchError("Error in CommentDialogComponent closeDialog: ",e)}}openDropdownIndex(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{openDropdownIndexValue:e,assignToMenuOpened:!1}),t))}catch(t){this.catchError("Error in CommentDialogComponent openDropdownIndex: ",t)}}navigateToCommentEmit(){try{this.onCommentNavigationButtonClick.emit(this.componentConfigSignal().annotation)}catch(e){this.catchError("Error in CommentDialogComponent navigateToComment: ",e)}}moveCursorToEnd(e){try{if(!e?.isConnected)return;e.focus(),setTimeout(()=>{let t=document.createRange(),r=window.getSelection();t.selectNodeContents(e),t.collapse(!1),r?.removeAllRanges(),r?.addRange(t),setTimeout(()=>{this.autoScrollToBottom(e)},50)},0)}catch(t){this.catchError("Error in CommentDialogComponent moveCursorToEnd: ",t)}}focusOnComposerInput(){try{this.onComposerClick(),this.composerFocused.emit();let e=Ece();this.componentConfigSignal().newCommentTextArea?.nativeElement&&(this.componentConfigSignal().newCommentTextArea.nativeElement?.contains(e)||this.moveCursorToEnd(this.componentConfigSignal().newCommentTextArea.nativeElement)),this.componentConfigSignal().editCommentTextArea?.nativeElement&&(this.componentConfigSignal().editCommentTextArea.nativeElement?.contains(e)||this.moveCursorToEnd(this.componentConfigSignal().editCommentTextArea.nativeElement))}catch(e){this.catchError("Error in CommentDialogComponent focusOnComposerInput: ",e)}}onComposerClick(){try{this.composerFocused.emit(),this.commentActionsService?.onComposerClick({commentAnnotation:this.componentConfigSignal().annotation}),this.componentConfigSignal().commentPinSelected||(this.componentConfigSignal().sidebarMode?this.domService.toggleAnnotationSelection(this.componentConfigSignal().annotation,this.componentConfigSignal().containerComponentId,"sidebarShowReplies"):this.domService.toggleAnnotationSelection(this.componentConfigSignal().annotation,this.componentConfigSignal().containerComponentId))}catch(e){this.catchError("Error in CommentDialogComponent onComposerClick: ",e)}}getCurrentDialogView(){try{let e={};if(this.componentConfigSignal().annotation?.annotationId){let t=this.componentConfigSignal().commentViews?.[this.componentConfigSignal().annotation?.annotationId]?.comments;Object.keys(t||{}).forEach(r=>{let a=[],s=0;Object.keys(t[r]?.views||{}).forEach(c=>{let p={};p.user=this.componentConfigSignal().userContactsBySnippylyId?.[c],p.viewedAt=t[r]?.views?.[c]?.timestamp,p.user?.userId!==this.componentConfigSignal().user?.userId&&p.user?.userId!==this.componentConfigSignal().annotation?.from?.userId&&(a.push(p),(p.user?.email||p.user?.name)&&s++)}),e[r]={count:s,views:a}})}this.componentConfigSignal.update(t=>(t=D(E({},t),{currentDialogView:e}),t))}catch(e){this.catchError("Error in CommentDialogComponent getCurrentDialogView: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}showReplyComposerHandler(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{showReplyComposer:!0}),e)),setTimeout(()=>{this.focusOnComposerInput()},100)}catch(e){this.catchError("Error in CommentDialogComponent showReplyComposerHandler: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(we),h(Un),h(g7),h(Ii),h(Ve),h(In),h(vl),h(z1),h(_),h(Wo),h(xn),h(ur),h(Ps),h(Ke),h(R),h(Yi),h(Ge),h(ot),h(un),h(an),h(sd,8))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-dialog"]],viewQuery:function(t,r){if(t&1&&(it(Jen,5),it(etn,5),it(ttn,5),it(Z1e,7),it(Z1e,5,_i)),t&2){let a;et(a=tt())&&(r.commentsContainer=a.first),et(a=tt())&&(r.newCommentTextArea=a.first),et(a=tt())&&(r.editCommentTextArea=a.first),et(a=tt())&&(r.hostElement=a.first),et(a=tt())&&(r.hostViewContainer=a.first)}},hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{snippylyReadId:"snippylyReadId",screenshotDomain:"screenshotDomain",annotationIndex:"annotationIndex",userContacts:"userContacts",annotation:"annotation",multiThreadAnnotationId:"multiThreadAnnotationId",readOnly:"readOnly",dialogSelection:"dialogSelection",expandOnSelection:"expandOnSelection",user:"user",dialogMode:"dialogMode",sidebarMode:"sidebarMode",fullExpanded:"fullExpanded",inboxMode:"inboxMode",multiThread:"multiThread",inlineCommentMode:"inlineCommentMode",inlineCommentSectionMode:"inlineCommentSectionMode",commentComposerMode:"commentComposerMode",isInsidePdfViewer:"isInsidePdfViewer",locationDisplayName:"locationDisplayName",locationVersion:"locationVersion",commentPinSelected:"commentPinSelected",variant:"variant",shadowDom:"shadowDom",commentPinType:"commentPinType",composerMode:"composerMode",containerComponentId:"containerComponentId",focusedThreadMode:"focusedThreadMode",isFocusedThreadEnabled:"isFocusedThreadEnabled",openAnnotationInFocusMode:"openAnnotationInFocusMode",initialEditCommentIndex:"initialEditCommentIndex",pageModeComposer:"pageModeComposer",composerPosition:"composerPosition",sortBy:"sortBy",sortOrder:"sortOrder",targetElementId:"targetElementId",targetComposerElementId:"targetComposerElementId",context:"context",commentPlaceholder:"commentPlaceholder",replyPlaceholder:"replyPlaceholder",dialogTemplate:"dialogTemplate"},outputs:{deleteCommentThread:"deleteCommentThread",saveComment:"saveComment",addCommentEmitter:"addComment",afterViewInit:"afterViewInit",signInToAccessFeature:"signInToAccessFeature",pointerOutFromCommentDialog:"pointerOutFromCommentDialog",pointerUp:"pointerUp",updateOverlayPosition:"updateOverlayPosition",onCommentNavigationButtonClick:"onCommentNavigationButtonClick",onOpenFocusedThread:"onOpenFocusedThread",onOpenFocusedThreadWithEditMode:"onOpenFocusedThreadWithEditMode",composerFocused:"composerFocused"},standalone:!1,features:[L,Qe],decls:4,vars:68,consts:[["host","","commentsContainer",""],["defaultDialogRef",""],["commentsContainer",""],[1,"modal-div","velt-comment-dialog",3,"click","pointerout","pointerdown","pointerup"],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["part","container","class","modal-div velt-comment-dialog",3,"dialog","velt-comment-dialog--dialog-mode","bottom-sheet","velt-comment-dialog--bottom-sheet","inbox","velt-comment-dialog--inbox-mode","readonly","velt-comment-dialog--readonly","no-comments","velt-comment-dialog--no-comments","selected","velt-comment-dialog--selected","screen-recording","velt-comment-dialog--screen-recording","s-ghost-comment-annotation","velt-comment-dialog--ghost-comment-annotation","inline-comment-mode","velt-comment-dialog--inline-comment-mode","velt-comment-dialog--multi-thread-mode","velt-comment-dialog--page-comment","velt-comment-dialog--inline-comment-section-mode","velt-comment-dialog--comment-composer-mode","velt-comment-dialog--focused-thread-mode","velt-comment-dialog--page-mode-composer","velt-comment-dialog--read-only","private-comment","velt-comment-dialog--private-comment","click","pointerout","pointerdown","pointerup",4,"ngIf"],["part","container","class","modal-div velt-comment-dialog",3,"dialog","velt-comment-dialog--dialog-mode","sidebar","velt-comment-dialog--sidebar-mode","bottom-sheet","velt-comment-dialog--bottom-sheet","readonly","velt-comment-dialog--readonly","no-comments","velt-comment-dialog--no-comments","selected","velt-comment-dialog--selected","screen-recording","velt-comment-dialog--screen-recording","s-ghost-comment-annotation","velt-comment-dialog--focused-thread-mode","velt-comment-dialog--ghost-comment-annotation","velt-comment-dialog--page-mode-composer","velt-comment-dialog--read-only","private-comment","velt-comment-dialog--private-comment","id","click","pointerout","pointerdown","pointerup",4,"ngIf"],["part","container","class","modal-div velt-comment-dialog",3,"dialog","velt-comment-dialog--dialog-mode","bottom-sheet","velt-comment-dialog--bottom-sheet","inbox","velt-comment-dialog--inbox-mode","readonly","velt-comment-dialog--readonly","no-comments","velt-comment-dialog--no-comments","selected","velt-comment-dialog--selected","screen-recording","velt-comment-dialog--screen-recording","s-ghost-comment-annotation","velt-comment-dialog--ghost-comment-annotation","inline-comment-mode","velt-comment-dialog--inline-comment-mode","velt-comment-dialog--multi-thread-mode","velt-comment-dialog--page-comment","velt-comment-dialog--focused-thread-mode","velt-comment-dialog--inline-comment-section-mode","velt-comment-dialog--comment-composer-mode","velt-comment-dialog--page-mode-composer","velt-comment-dialog--read-only","private-comment","velt-comment-dialog--private-comment","click","pointerout","pointerdown","pointerup",4,"ngIf"],["part","container",1,"modal-div","velt-comment-dialog",3,"click","pointerout","pointerdown","pointerup"],[3,"componentConfigSignal"],["class","line-div velt-comment-dialog--line-div",4,"ngIf"],["class","velt-action-bar velt-comment-dialog--action-bar",4,"ngIf"],[1,"line-div","velt-comment-dialog--line-div"],[1,"velt-action-bar","velt-comment-dialog--action-bar"],[3,"componentConfigSignal",4,"ngIf"],["class","velt-comment-dialog--action-bar-group",4,"ngIf"],[1,"velt-comment-dialog--action-bar-group"],["part","container",1,"modal-div","velt-comment-dialog",3,"click","pointerout","pointerdown","pointerup","id"]],template:function(t,r){if(t&1){let a=K();y(0,"div",3,0),G("click",function(){return N(a),F(r.onClick())})("pointerout",function(c){return N(a),r.onPointerOutCommentDialog(c),F(c.stopPropagation())})("pointerdown",function(c){return N(a),F(c.stopPropagation())})("pointerup",function(c){return N(a),r.onPointerUp(),F(c.stopPropagation())}),b(),u(3,Ttn,4,1,"ng-container",4)}if(t&2){let a,s,c,p,g,f,I,x,B,z,W,J,ne,ve,_e,Fe,Be,Ie,be,Ae,ye,he,Oe,Re,Xi,bt,It,yt,Lt,Yt,zt,tn,xi,nn,ti,Ti;pe("sidebar",(a=r.componentConfigSignal())==null?null:a.sidebarMode)("velt-comment-dialog--sidebar-mode",(s=r.componentConfigSignal())==null?null:s.sidebarMode)("dialog",(c=r.componentConfigSignal())==null?null:c.dialogMode)("velt-comment-dialog--dialog-mode",(p=r.componentConfigSignal())==null?null:p.dialogMode)("hide",(g=r.componentConfigSignal())==null?null:g.showDefault)("velt-comment-dialog--hide",(f=r.componentConfigSignal())==null?null:f.showDefault)("bottom-sheet",(I=r.componentConfigSignal())==null?null:I.bottomSheetMode)("velt-comment-dialog--bottom-sheet",(x=r.componentConfigSignal())==null?null:x.bottomSheetMode)("inbox",(B=r.componentConfigSignal())==null?null:B.inboxMode)("velt-comment-dialog--inbox-mode",(z=r.componentConfigSignal())==null?null:z.inboxMode)("readonly",((W=r.componentConfigSignal())==null||W.user==null?null:W.user.isReadOnly)||((W=r.componentConfigSignal())==null||W.user==null?null:W.user.isAnonymous))("velt-comment-dialog--readonly",((J=r.componentConfigSignal())==null||J.user==null?null:J.user.isReadOnly)||((J=r.componentConfigSignal())==null||J.user==null?null:J.user.isAnonymous))("no-comments",!(!((ne=r.componentConfigSignal())==null||ne.annotation==null||ne.annotation.comments==null)&&ne.annotation.comments.length))("velt-comment-dialog--no-comments",!(!((ve=r.componentConfigSignal())==null||ve.annotation==null||ve.annotation.comments==null)&&ve.annotation.comments.length))("selected",(_e=r.componentConfigSignal())==null?null:_e.commentDialogSelected)("velt-comment-dialog--selected",(Fe=r.componentConfigSignal())==null?null:Fe.commentDialogSelected)("screen-recording",((Be=r.componentConfigSignal())==null||Be.recorderInitConfig==null?null:Be.recorderInitConfig.type)==="screen")("velt-comment-dialog--screen-recording",((Ie=r.componentConfigSignal())==null||Ie.recorderInitConfig==null?null:Ie.recorderInitConfig.type)==="screen")("s-ghost-comment-annotation",(be=r.componentConfigSignal())==null?null:be.showGhostCommentMessage)("velt-comment-dialog--ghost-comment-annotation",(Ae=r.componentConfigSignal())==null?null:Ae.showGhostCommentMessage)("velt-comment-dialog--focused-thread-mode",(ye=r.componentConfigSignal())==null?null:ye.focusedThreadMode)("inline-comment-mode",((he=r.componentConfigSignal())==null?null:he.inlineCommentMode)&&!((he=r.componentConfigSignal())!=null&&he.isInsidePdfViewer))("velt-comment-dialog--page-comment",(Oe=r.componentConfigSignal())==null||Oe.annotation==null?null:Oe.annotation.isPageAnnotation)("velt-comment-dialog--inline-comment-mode",((Re=r.componentConfigSignal())==null?null:Re.inlineCommentMode)&&!((Re=r.componentConfigSignal())!=null&&Re.isInsidePdfViewer))("velt-comment-dialog--multi-thread-mode",(Xi=r.componentConfigSignal())==null?null:Xi.multiThread)("velt-comment-dialog--comment-composer-mode",(bt=r.componentConfigSignal())==null?null:bt.commentComposerMode)("velt-comment-dialog--page-mode-composer",(It=r.componentConfigSignal())==null?null:It.pageModeComposer)("velt-comment-dialog--read-only",(yt=r.componentConfigSignal())==null?null:yt.readOnly)("private-comment",(Lt=r.componentConfigSignal())==null?null:Lt.isPrivateComment)("velt-comment-dialog--private-comment",(Yt=r.componentConfigSignal())==null?null:Yt.isPrivateComment),T("data-velt-annotation-draft",(zt=r.componentConfigSignal())==null?null:zt.getAnnotationDraftAttribute)("data-velt-annotation-edit-comment",(tn=r.componentConfigSignal())!=null&&tn.editComment?!0:void 0)("data-velt-comment-dialog-comments-count",((xi=r.componentConfigSignal())==null||xi.annotation==null||xi.annotation.comments==null?null:xi.annotation.comments.length)||"0")("data-velt-comment-dialog-comments-status",(nn=r.componentConfigSignal())==null||nn.annotation==null||nn.annotation.status==null?null:nn.annotation.status.id)("data-velt-comment-dialog-comments-status-type",(ti=r.componentConfigSignal())==null||ti.annotation==null||ti.annotation.status==null?null:ti.annotation.status.type)("data-velt-comment-dialog-comments-priority",(Ti=r.componentConfigSignal())==null||Ti.annotation==null||Ti.annotation.priority==null?null:Ti.annotation.priority.id)("data-testid",r.componentId+"-root"),m(3),d("ngIf",r.componentConfigSignal())}},dependencies:[X,Dt,x_,S_,T_,y_,E_,Nf,C_,w_,__,P_,O_,Sn,R1],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}[_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-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-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)}[type=button][_ngcontent-%COMP%]:not(:disabled), [type=reset][_ngcontent-%COMP%]:not(:disabled), [type=submit][_ngcontent-%COMP%]:not(:disabled), button[_ngcontent-%COMP%]:not(:disabled){cursor:pointer}[_ngcontent-%COMP%]::-webkit-scrollbar{display:none;width:0;height:0}[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}[_ngcontent-%COMP%]::-webkit-scrollbar-button{width:0;height:0} .velt-comment-dialog-thread-card-message--email-chip, .velt-autocomplete--contact-chip, .velt-autocomplete--group-chip{display:block;color:var(--velt-accent-text);background:var(--velt-accent-transparent);border-radius:var(--velt-border-radius-xs);padding:var(--velt-spacing-xs);word-break:break-word;font-size:var(--velt-font-size-sm);font-style:normal;font-weight:400;line-height:120%} .velt-comment-dialog-thread-card-message--email-chip.velt-autocomplete--contact-chip-current-user, .velt-autocomplete--contact-chip.velt-autocomplete--contact-chip-current-user, .velt-autocomplete--group-chip.velt-autocomplete--contact-chip-current-user{background-color:color-mix(in srgb,var(--velt-warning) 12%,transparent);color:color-mix(in srgb,var(--velt-warning) 32%,var(--velt-text-0))} velt-autocomplete-chip velt-skeleton-loader-internal{width:50px;border-radius:var(--velt-border-radius-xs);margin-block:6px} .velt-comment-dialog--here-chip{color:var(--velt-accent-text);background:var(--velt-accent-transparent);border-radius:var(--velt-border-radius-xs);padding:var(--velt-spacing-xs);word-break:break-word} .velt-attachment-tag{color:var(--velt-accent);word-break:break-word;display:inline-block;cursor:pointer} .velt-attachment-tag:hover{color:var(--velt-accent-hover)}.velt-comment-dialog--comment-link[_ngcontent-%COMP%]{color:var(--velt-accent);word-break:break-all;display:unset}.velt-comment-dialog-shake[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_shake .82s cubic-bezier(.36,.07,.19,.97) both}@keyframes _ngcontent-%COMP%_shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}.velt-comment-dialog[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:var(--velt-spacing-lg);border-radius:var(--velt-border-radius-md);box-shadow:0 8px 16px -8px #0f0f0f1a;box-sizing:border-box;width:361px;text-align:left;font-size:var(--velt-font-size-sm);padding:var(--velt-spacing-lg);background-color:var(--velt-background-0);border:1px solid var(--velt-border-4);color:var(--velt-text-3)}.velt-comment-dialog[_ngcontent-%COMP%] .velt-comment-dialog--line-div[_ngcontent-%COMP%]{border-top:1px solid var(--velt-border-4);width:100%}.velt-comment-dialog.velt-comment-dialog--no-comments[_ngcontent-%COMP%]{padding:0;gap:0}.velt-comment-dialog.velt-comment-dialog--multi-thread-mode[_ngcontent-%COMP%]{box-shadow:none;border:0;background-color:transparent}.velt-comment-dialog.velt-comment-dialog--sidebar-mode[_ngcontent-%COMP%]{width:100%;min-width:100%;box-shadow:none;background:transparent;border-color:transparent}.velt-comment-dialog.velt-comment-dialog--sidebar-mode[_ngcontent-%COMP%]:hover, .velt-comment-dialog.velt-comment-dialog--sidebar-mode.velt-comment-dialog--selected[_ngcontent-%COMP%]{background-color:var(--velt-background-0);border-color:var(--velt-border-4)}.velt-comment-dialog.velt-comment-dialog--page-mode-composer[_ngcontent-%COMP%]{width:100%;padding-inline:var(--velt-spacing-lg);box-shadow:none;background:transparent;border-color:transparent}.velt-comment-dialog.velt-comment-dialog--inline-comment-mode[_ngcontent-%COMP%]{padding:0;box-shadow:none;border-color:transparent;background:transparent;width:100%}.velt-comment-dialog.velt-comment-dialog--inline-comment-section-mode[_ngcontent-%COMP%]{width:100%;box-shadow:none}.velt-comment-dialog.velt-comment-dialog--inline-comment-section-mode.no-comments[_ngcontent-%COMP%]{padding:var(--velt-spacing-md) var(--velt-spacing-sm) var(--velt-spacing-md) var(--velt-spacing-lg)}.velt-comment-dialog.velt-comment-dialog--bottom-sheet[_ngcontent-%COMP%]{width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0} .snippyly-comment-rewriter-text{color:var(--velt-black);background-color:color-mix(in srgb,var(--velt-warning) 42%,var(--velt-white))}.velt-comment-dialog--hide[_ngcontent-%COMP%]{display:none}.velt-comment-dialog--action-bar[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-around;padding:var(--velt-spacing-lg);box-sizing:border-box;text-align:center;color:var(--velt-accent-text);gap:var(--velt-spacing-2xl)}.velt-comment-dialog--action-bar[_ngcontent-%COMP%]:empty{display:none}.velt-comment-dialog--action-bar[_ngcontent-%COMP%] .velt-comment-dialog--action-bar-group[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:space-around;width:100%;box-sizing:border-box}.velt-comment-dialog--focused-thread-mode[_ngcontent-%COMP%]{border:none;height:100%}.velt-comment-dialog--focused-thread-mode[_ngcontent-%COMP%] app-comment-dialog-body[_ngcontent-%COMP%]{display:flex;flex-grow:1;min-height:0;width:100%;overflow:scroll}"],changeDetection:0});let i=o;return i})();var a8=(()=>{let o=class o{constructor(e,t,r,a){this.bottomSheet=e,this.domService=t,this.loggingService=r,this.elementRef=a,this.user=new zo,this.isInsidePdfViewer=!1,this.bottomSheetData$=new Ce(null),this.saveComment=new Me,this.veltElement=!0,this.subscriptions=[],this.componentId="velt-comment-bottom-sheet"}ngOnInit(){this.setupA11yAttributes()}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","dialog"),e.setAttribute("aria-label","Comment bottom sheet")}catch(e){this.loggingService.catch("Error in CommentBottomSheetComponent setupA11yAttributes:",e)}}ngAfterViewInit(){this.openBottomSheet(),this.setBottomSheetData()}ngOnChanges(e){try{e?.annotation&&this.setBottomSheetData()}catch(t){this.catchError("Error in CommentBottomSheetComponent ngOnChanges: ",t)}}setBottomSheetData(){try{this.bottomSheetData$.next({annotation:this.annotation,user:this.user,commentPinSelected:!0,isInsidePdfViewer:this.isInsidePdfViewer,multiThreadAnnotationId:this.annotation?.type==="multiThread"?this.annotation.annotationId:null,saveComment:e=>{this.saveComment.emit(e)},dismiss:()=>{this.closeBottomSheet()}})}catch(e){this.catchError("Error in CommentBottomSheetComponent setBottomSheetData: ",e)}}openBottomSheet(){return Q(this,null,function*(){try{this.bottomSheetRef&&(this.bottomSheetRef.dismiss(),this.bottomSheetRef=void 0),this.annotation.type==="multiThread"?(this.bottomSheetRef=this.bottomSheet.open(Rs,{data:this.bottomSheetData$.asObservable(),panelClass:["snippyly-comment-bottom-sheet-container","velt-mat-bottom-sheet-container"]}),this.subscriptions.push(this.bottomSheetRef.backdropClick().subscribe(()=>{this.domService.resetSelectedAnnotationsMap()}))):(this.bottomSheetRef=this.bottomSheet.open(ar,{data:this.bottomSheetData$.asObservable(),panelClass:["snippyly-comment-bottom-sheet-container","velt-mat-bottom-sheet-container"]}),this.subscriptions.push(this.bottomSheetRef.backdropClick().subscribe(()=>{this.domService.resetSelectedAnnotationsMap()})))}catch(e){this.catchError("Error in CommentBottomSheetComponent openBottomSheet: ",e)}})}closeBottomSheet(){try{if(this.bottomSheetRef){let e=this.bottomSheetRef;this.bottomSheetRef=void 0,this.disposeBottomSheetWithoutAnimation(e)}}catch(e){this.catchError("Error in CommentBottomSheetComponent closeBottomSheet: ",e)}}disposeBottomSheetWithoutAnimation(e){try{let r=e._ref?.overlayRef,a=r?.hostElement,s=r?.backdropElement;r?(r.detach(),r.dispose(),a?.parentNode&&a.parentNode.removeChild(a),s?.parentNode&&s.parentNode.removeChild(s)):e.dismiss()}catch(t){this.catchError("Error in CommentBottomSheetComponent disposeBottomSheetWithoutAnimation: ",t);try{e.dismiss()}catch{}}}ngOnDestroy(){try{this.subscriptions.forEach(e=>{e?.unsubscribe()}),this.subscriptions=[],this.closeBottomSheet(),this.bottomSheetData$.complete()}catch(e){this.catchError("Error in CommentBottomSheetComponent ngOnDestroy: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(ld),h(Ve),h(_),h(R))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-bottom-sheet"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{annotation:"annotation",user:"user",isInsidePdfViewer:"isInsidePdfViewer"},outputs:{saveComment:"saveComment"},standalone:!1,features:[Qe],decls:0,vars:0,template:function(t,r){},styles:[".velt-mat-bottom-sheet-container.snippyly-comment-bottom-sheet-container{padding:0!important} .velt-mat-bottom-sheet-container.snippyly-comment-bottom-sheet-container .mat-bottom-sheet-container{padding:0!important}"],changeDetection:0});let i=o;return i})();function wtn(i,o){if(i&1){let n=K();y(0,"div",4),G("pointerup",function(t){return N(n),l(2).togglePinSelection(),F(t.stopPropagation())})("click",function(t){return N(n),F(t.stopPropagation())})("cdkDragStarted",function(){N(n);let t=l(2);return F(t.onPinDragStart())}),y(1,"snippyly-comment-pin",5),G("saveComment",function(t){N(n);let r=l(2);return F(r.saveComment(t))})("commentTargetElementClicked",function(){N(n);let t=l(2);return F(t.togglePinSelection())})("togglePinSelection",function(t){N(n);let r=l(2);return F(r.togglePinSelection(t))}),b()()}if(i&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"),d("id","comment-pin-container-"+(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationId)),T("data-testid",e.componentId+"-popover")("role","button")("aria-expanded",n.commentPinSelected),m(),d("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 Otn(i,o){if(i&1){let n=K();y(0,"div",7),G("pointerup",function(t){return N(n),l(3).togglePinSelection(),F(t.stopPropagation())})("touchend",function(t){return N(n),t.stopPropagation(),F(t.preventDefault())})("mousedown",function(t){return N(n),F(t.stopPropagation())})("touchstart",function(t){return N(n),F(t.stopPropagation())})("pointerdown",function(t){return N(n),F(t.stopPropagation())})("click",function(t){return N(n),F(t.stopPropagation())})("cdkDragStarted",function(){N(n);let t=l(3);return F(t.onPinDragStart())})("cdkDragMoved",function(t){N(n);let r=l(3);return F(r.onPinMove(t))})("cdkDragReleased",function(){N(n);let t=l(3);return F(t.onPinRelease())}),y(1,"snippyly-comment-pin",8,1),G("togglePinSelection",function(t){N(n);let r=l(3);return F(r.togglePinSelection(t))})("saveComment",function(t){N(n);let r=l(3);return F(r.saveComment(t))}),b()()}if(i&2){let n=me(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)+")":""),pe("pin-dragging",e.annotationDragging),d("id","comment-pin-container-"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationId))("cdkDragDisabled",(e.commentPinAnnotation==null||e.commentPinAnnotation.from==null?null:e.commentPinAnnotation.from.userId)!==(e.user==null?null:e.user.userId)),T("data-testid",t.componentId+"-default")("role","button")("aria-expanded",e.commentPinSelected)("aria-grabbed",e.annotationDragging)("data-transform-inside",e.transformContext?"true":"false"),m(),d("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 Atn(i,o){if(i&1&&u(0,Otn,3,24,"div",6),i&2){let n=l().ngIf;d("ngIf",n.commentPinAnnotation==null?null:n.commentPinAnnotation.position)}}function Ptn(i,o){if(i&1&&(v(0),u(1,wtn,2,14,"div",3)(2,Atn,1,1,"ng-template",null,0,Ee),C()),i&2){let n=o.ngIf,e=me(3);m(),d("ngIf",n.popoverMode)("ngIfElse",e)}}var s8=(()=>{let o=class o{constructor(e,t,r,a,s,c,p,g){this.analyticsService=e,this.authService=t,this.docService=r,this.domService=a,this.commentService=s,this.commentActionsService=c,this.loggingService=p,this.elementRef=g,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.objectKeys=Object.keys,this.selectedAnnotationsLocationMap={},this.subscriptions=[],this.componentConfigSignal=Te({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-${vt()}`}),this.veltElement=!0,this.componentId="velt-comment-pin-portal",this.subscriptions.push(this.authService.getUser$().subscribe(f=>{this.componentConfigSignal.update(I=>(I=D(E({},I),{user:f}),I))},f=>{this.catchError("Error in CommentPinPortalComponent getUser$ subscription: ",f)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(f=>{this.componentConfigSignal.update(I=>(I=D(E({},I),{selectedAnnotationsMap:f}),I)),this.checkCommentPinSelected()},f=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsMap$ subscription: ",f)})),this.subscriptions.push(this.domService.getSelectedAnnotationsLocationMap$().subscribe(f=>{this.selectedAnnotationsLocationMap=f||{},this.checkCommentPinSelected()},f=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsLocationMap$ subscription: ",f)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(f=>{this.componentConfigSignal.update(I=>(I=D(E({},I),{popoverMode:f}),I))},f=>{this.catchError("Error in CommentPinPortalComponent getPopoverMode subscription: ",f)}))}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getTransformContext$().subscribe(e=>{this.componentConfigSignal.update(t=>{if(t=D(E({},t),{transformContext:e}),e&&this.isElementInsideTransformContainer(this.elementRef?.nativeElement,e.containerSelector)){let r=e.transforms.scale?1/e.transforms.scale:1;t.pinTransform=`scale(${r})`}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(r){return this.loggingService.catch("Error in CommentPinPortalComponent isElementInsideTransformContainer:",r),!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=D(E({},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=D(E({},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,r=this.componentConfigSignal().sourceId;if(t){let a=!!e[t.annotationId];if(a)if(t?.isDraft)t?.sourceId&&(a=t?.sourceId===r,a&&this.domService.setSelectedAnnotationLocation(t.annotationId,this.componentConfigSignal().componentId));else{let s=this.selectedAnnotationsLocationMap?.[t.annotationId];s&&(a=s===this.componentConfigSignal().componentId)}a!==this.componentConfigSignal().commentPinSelected&&this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinSelected:a}),s))}}catch(e){this.catchError("Error in CommentPinPortalComponent checkCommentPinSelected: ",e)}}setTargetElement(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{targetElement:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setTargetElement: ",t)}}setOffsetLeft(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{offsetLeft:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetLeft: ",t)}}setOffsetTop(e){try{this.componentConfigSignal.update(t=>(t=D(E({},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(a=>{this.catchError("Error in CommentPinPortalComponent togglePinSelection onCommentPinClick: ",a)}),this.componentConfigSignal().selectedAnnotationsMap[t?.annotationId]&&this.selectedAnnotationsLocationMap?.[t?.annotationId]===this.componentConfigSignal().componentId)t?.ghostComment?.type!==Tl.DIFFERENT_DEVICE&&document.querySelector(`[${U.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)&&this.domService.resetSelectedAnnotationsMap(!0,"comments");else{let a=document.querySelector(`[${U.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(a||(a=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),a){let s=a.getAttribute(U.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(s){let c=document.getElementById(`comment-pin-container-${s}`)||document.querySelector(`[data-velt-id='${s}']`);c&&(c.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!==Tl.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,r=this.componentConfigSignal().transformContext,a=this.parentElement.getBoundingClientRect(),s=a.left+t.left,c=a.top+t.top,p=r&&this.isElementInsideTransformContainer(e,r.containerSelector);this.componentConfigSignal.update(g=>(g=D(E({},g),{elementInTransformedContainer:p}),g)),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=`${c}px`,e.style.left=`${s}px`,e.style.zIndex="10000",e.style.transform="none",e.offsetWidth,this.componentConfigSignal.update(g=>(g=D(E({},g),{annotationDragging:!0}),g))}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,r=t?.touches?.length?t.touches[0]?.clientX:t.clientX,a=t?.touches?.length?t.touches[0]?.clientY:t.clientY,s=this.componentConfigSignal().transformContext,c=this.domService.getBackgroundElement(r,a);c&&this.commentService.isElementInsideAllowedElements(c)&&(this.componentConfigSignal.update(p=>(p=D(E({},p),{targetElement:c}),p)),this.domService.highlightElement(this.componentConfigSignal().targetElement),this.pointerMoveEvent=e.event,this.componentConfigSignal.update(p=>(p=D(E({},p),{dragPosition:{top:a,left:r}}),p)))}catch(t){this.catchError("Error in CommentPinPortalComponent updateCurrentPinPosition: ",t)}}onPinRelease(){try{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),r=this.componentConfigSignal().commentPinAnnotation?.targetElement;if(this.pointerMoveEvent){let J=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent,!0,!0,!0,ne=>{if(this.commentService.getSvgAsImg()){let ve=ne?.closest(`[${U.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);ve&&ve instanceof HTMLElement&&(ne=ve)}return ne});J&&(r=J)}let a=this.domService.getElementFromXPath(r?.xpath),s=this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath,c=r?.xpath,p=s===c;if(!a)return;let g=this.componentConfigSignal().dragPosition,f=a.getBoundingClientRect(),I=50,x=50;if(g){let J=g.left-f.left,ne=g.top-f.top;I=J/f.width*100,x=ne/f.height*100,I=Math.max(0,Math.min(100,I)),x=Math.max(0,Math.min(100,x))}let B=E({},this.componentConfigSignal().commentPinAnnotation);B.targetElement=E({},r),B.targetElement.leftPercentage=I,B.targetElement.topPercentage=x,this.commentService.calculateCommentAnnotationPosition(B),this.componentConfigSignal.update(J=>(J=D(E({},J),{commentPinAnnotation:B,targetElement:a}),J));let z=this.domService.isElementInsideAdditionalLocationContainer(t)||this.domService.isElementInsideAdditionalLocationContainer(a),W=this.docService.getAdditionalDocumentIdFromElement(a)||this.docService.getDocumentPaths()?.clientDocumentId;if(!this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId||this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId==W?(this.componentConfigSignal.update(J=>(J=D(E({},J),{commentPinAnnotation:D(E({},J.commentPinAnnotation),{targetElement:r})}),J)),this.commentService.updateComment(this.componentConfigSignal().commentPinAnnotation,z)):this.componentConfigSignal.update(J=>(J=D(E({},J),{targetElement:t}),J)),p){let J=this.componentConfigSignal().transformContext,ne=this.componentConfigSignal().elementInTransformedContainer,ve=J&&this.isElementInsideTransformContainer(a,J.containerSelector);this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{elementInTransformedContainer:ve}),Fe));let _e=e.getBoundingClientRect();if(!ne&&ve){e.style.transition="none";let Fe=_e.top,Be=_e.left;this.parentElement.appendChild(e),e.style.position="fixed",e.style.top=`${Fe}px`,e.style.left=`${Be}px`,e.offsetWidth,requestAnimationFrame(()=>{e.style.position="absolute",ve&&B.position.transformContext?(e.style.top=`${B.position.top}px`,e.style.left=`${B.position.left}px`,B.position.transformContext.scale!==1&&(e.style.transform=`scale(${1/B.position.transformContext.scale})`)):(e.style.top=`${B.position.top}px`,e.style.left=`${B.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,ve&&B.position.transformContext?(e.style.top=`${B.position.top}px`,e.style.left=`${B.position.left}px`):(e.style.top=`${B.position.top}px`,e.style.left=`${B.position.left}px`);e.offsetWidth,this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{annotationDragging:!1,dragPosition:null}),Fe))}this.analyticsService.trackEvent(Y.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()}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,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(ot),h(Ve),h(we),h(Un),h(_),h(R))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-pin-portal"]],hostVars:2,hostBindings:function(t,r){t&2&&(yr("id",r.id),T("data-velt-element",r.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,r){t&1&&u(0,Ptn,4,2,"ng-container",2),t&2&&d("ngIf",r.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}[_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 i=o;return i})();var G1=(()=>{let o=class o{constructor(e,t,r,a,s,c){this.commentService=e,this.domService=t,this.componentFactoryResolver=r,this.injector=a,this.appRef=s,this.loggingService=c,this.commentsPinById={},this.commentPinTemplate$=new Ce(null),this.customPinEvents$=new Ze}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(r=>{let a=r.portalRef,s=r.userTargetElement,c=r.pinHostElement;if(document.body.contains(s)&&document.body.contains(c))a&&(a.instance.setCommentPinAnnotation(e),this.updateElementOffset(e));else{let p=r.pinHostDomPortalOutlet;p&&(this.removeCommentPinHostAttributes(e.annotationId,r.pinHostElement),this.removeCommentDisabledAttribute(c),p.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}});else{let r=this.commentsPinById[e.annotationId]?.[0]?.pinHostDomPortalOutlet;r&&(this.removeCommentPinHostAttributes(e.annotationId,this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),this.removeCommentDisabledAttribute(this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),r.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(r=>{if(r){let a=this.domService.getHostElement(r),s=new lr(s8),c=new cr(a,this.appRef,this.injector),p=c.attach(s);p.instance.setCommentPinAnnotation(e),p.instance.setTargetElement(r);let g=r?.getAttribute(U.ATTRIBUTES.VELT_SOURCE_ID);g&&p.instance.setSourceId(g),this.commentsPinById[e.annotationId].push({pinHostDomPortalOutlet:c,pinPortal:s,portalRef:p,annotation:JSON.parse(JSON.stringify(e)),userTargetElement:r,pinHostElement:a}),this.setCommentPinHostAttributes(e.annotationId,a),this.setCommentDisabledAttribute(a),this.updateElementOffset(e)}}))}catch(t){this.loggingService.catch("Error in CommentPinPortalService setPinPortal: ",t)}}setCommentPinHostAttributes(e,t){try{let r=t.getAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(r){let a=r.split(",");a.includes(e)||(a.push(e),t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST,a.join(",")))}else t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST,e);window.getComputedStyle(t).position==="static"&&t.offsetHeight>0&&(um(t)||t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC,"true"))}catch(r){this.loggingService.catch("Error in CommentPinPortalService setCommentPinHostAttributes: ",r)}}removeCommentPinHostAttributes(e,t){try{let r=t.getAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(r){let a=r.split(","),s=a.indexOf(e);s>-1&&(a.splice(s,1),a.length>0?t.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST,a.join(",")):t.removeAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST))}t?.getAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST)||t.removeAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)}catch(r){this.loggingService.catch("Error in CommentPinPortalService removeCommentPinHostAttributes: ",r)}}setCommentDisabledAttribute(e){try{this.commentService.getPopoverMode()&&e.setAttribute(U.ATTRIBUTES.VELT_COMMENT_DISABLED,"auto")}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentDisabledAttribute: ",t)}}removeCommentDisabledAttribute(e){try{e?.getAttribute(U.ATTRIBUTES.VELT_COMMENT_DISABLED)==="auto"&&e.removeAttribute(U.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:r,userTargetElement:a,pinHostElement:s}=t,c=this.domService.getElementOffset(a,s);r.instance.setOffsetLeft(c.offsetLeft),r.instance.setOffsetTop(c.offsetTop)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateElementOffset: ",t)}}checkPinsToRemove(e){try{let t=e.map(r=>r.annotationId);Object.keys(this.commentsPinById).forEach(r=>{t.includes(r)||(this.commentService.customPinsById.has(r)&&this.commentService.customPinsById.delete(r),this.commentsPinById[r].forEach(s=>{s.pinHostDomPortalOutlet.detach(),this.removeCommentPinHostAttributes(r,s.pinHostElement),this.removeCommentDisabledAttribute(s.pinHostElement),this.domService.removeHighlightFromElement(s.pinHostElement),s.userTargetElement&&this.domService.removeHighlightFromElement(s.userTargetElement)}),delete this.commentsPinById[r])})}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkPinsToRemove: ",t)}}getAnnotationIdsByUserTargetElement(e){try{let t=[];return Object.keys(this.commentsPinById||{}).forEach(r=>{this.commentsPinById[r]?.forEach(s=>{s.userTargetElement===e&&t.push(r)})}),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:r}=e;r&&this.commentService.customPinsById.set(r.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)(ee(we),ee(Ve),ee(Ro),ee(St),ee(ii),ee(_))},o.\u0275prov=Pe({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var ie=(()=>{let o=class o{set veltDynamicTemplate({template:e,context:t,id:r,cloneTemplate:a,componentName:s,variant:c,suffix:p,setIfCondition:g,componentElementRef:f,replaceTemplate:I=!0}){try{if(p&&(s+=`--${p}`),c&&(s+=`---${c}`),s){let x=this.wireframeService.getConditionElement(s);if(!x&&e&&(x=e),x){let B=x?.getAttribute("velt-if");B&&g&&g(B),Array.from(x.attributes).forEach(z=>{f?.nativeElement.setAttribute(z.name,z.value)}),t?.componentConfigSignal?this.dynamicDataService.applyConditionalClasses(f?.nativeElement,t):this.dynamicDataService.applyConditionalClasses(f?.nativeElement)}}if(s&&!e){let x=this.wireframeService.getWireframe(s);if(x){let B=document.createElement(x.tagName);B.innerHTML=x.innerHTML,this.template=B}}else this.template=e;this.data=t,this.id=r,this.cloneTemplate=!!a,this.cloneTemplate&&e&&(this.template=this.domService.deepCloneElement(e)),this.checkToUpdateTemplate(I)}catch(x){this.loggingService.warn("Error in DynamicTemplateDirective veltDynamicTemplate: ",x)}}constructor(e,t,r,a,s,c,p,g){this.elementRef=e,this.templateRef=t,this.viewContainer=r,this.dynamicComponentService=a,this.loggingService=s,this.domService=c,this.wireframeService=p,this.dynamicDataService=g,this.directiveId=Math.random().toString(36).substring(7),this.isCustomTemplateMode=!1,this.isDefaultTemplateMode=!1,this.cloneTemplate=!1,this.injectedElements=[],this.componentRefs=[];try{this.loggingService.log("%c[WB] Creating CLASS: DynamicTemplateDirective","color: blue;")}catch(f){this.loggingService.catch("Error in DynamicTemplateDirective constructor: ",f)}}checkDataValue(e,t){let r=e.querySelectorAll("[data-velt]");function a(s,c){return c.split(".").reduce((p,g)=>p&&p[g],s)}r.forEach(s=>{let c=s.getAttribute("data-velt");if(c&&t){let p=a(t,c);s instanceof HTMLElement&&(s.innerText=JSON.stringify(p,null,2))}})}checkToUpdateTemplate(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: checkToUpdateTemplate","color: green;"),this.template&&e)if(this.isDefaultTemplateMode=!1,this.isCustomTemplateMode)this.updateDataOnComponentRefs(this.data);else{this.isCustomTemplateMode=!0,this.cleanUp();let t=document.createElement(this.template.tagName);t.innerHTML=this.template.innerHTML,this.injectElementNextToSibling(this.elementRef.nativeElement,t)}else this.isCustomTemplateMode=!1,this.isDefaultTemplateMode||(this.cleanUp(),this.viewContainer.createEmbeddedView(this.templateRef),this.isDefaultTemplateMode=!0)}catch(t){this.loggingService.catch("Error in DynamicTemplateDirective checkToUpdateTemplate: ",t)}}injectElementNextToSibling(e,t){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: injectElementNextToSibling","color: green;"),!t)return;this.cleanUp();let r=t;for(let s=0;s<r.children.length;s++){let c=r.children[s],p=this.dynamicComponentService.processAndReplaceVeltComponents(c,this.data,this.id?this.id:`from-directive-${this.directiveId}`,[],"from directive");p?.length&&this.componentRefs.push(...p)}r.setAttribute("data-velt-added-from-directive","true"),this.customTemplate=r;let a=Array.from(r.childNodes).reverse();e.nextSibling&&e.nextSibling&&e.nextSibling.getAttribute&&e.nextSibling.getAttribute("data-velt-added-from-directive")&&e.parentNode.removeChild(e.nextSibling),a.forEach(s=>{e.parentNode.insertBefore(s,e.nextSibling),s instanceof Element&&this.injectedElements.push(s)}),r.remove()}catch(r){this.loggingService.catch("Error in DynamicTemplateDirective injectElementNextToSibling: ",r)}}updateDataOnComponentRefs(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: updateDataOnComponentRefs","color: green;"),this.componentRefs.forEach(t=>{this.dynamicComponentService.setCommentRefData(e,t)})}catch(t){this.loggingService.catch("Error in DynamicTemplateDirective updateDataOnComponentRefs: ",t)}}ngOnDestroy(){try{this.cleanUp()}catch(e){this.loggingService.catch("Error in DynamicTemplateDirective ngOnDestroy: ",e)}}cleanUp(){try{this.componentRefs.forEach(e=>{e.destroy()}),this.injectedElements.forEach(e=>{e.remove()}),this.injectedElements=[],this.viewContainer.clear()}catch(e){this.loggingService.catch("Error in DynamicTemplateDirective cleanUp: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(R),h(xo),h(_i),h(z1),h(_),h(Ve),h(Ge),h(S))},o.\u0275dir=Gt({type:o,selectors:[["","veltDynamicTemplate",""]],inputs:{veltDynamicTemplate:"veltDynamicTemplate"},standalone:!1});let i=o;return i})();function Mtn(i,o){if(i&1&&w(0,"div",7),i&2){let n=l(2);T("data-testid",n.componentId+"-unread-indicator")("aria-hidden","true")}}function ktn(i,o){if(i&1&&(v(0),y(1,"div",1)(2,"div",2),ce(),y(3,"svg",3),P(4,"translate"),w(5,"path",4),b(),u(6,Mtn,1,2,"div",5),b(),ft(),y(7,"span",6),te(8),b()(),C()),i&2){let n=o.ngIf,e=l();m(),T("data-testid",e.componentId)("role","status"),m(),T("data-testid",e.componentId+"-unread-container")("aria-hidden",!(n!=null&&n.unreadAnnotationCount)),m(),T("role","img")("aria-label",M(4,11,"Comment icon"))("focusable","false"),m(3),d("ngIf",n==null?null:n.unreadAnnotationCount),m(),T("data-testid",e.componentId+"-count")("aria-hidden","true"),m(),ze(n==null?null:n.count)}}var X1e=(()=>{let o=class o extends nt{constructor(e,t,r,a,s){super(s,a,void 0,e),this.commentService=e,this.loggingService=t,this.customFilterService=r,this.themeService=a,this.elementRef=s,this.componentConfigSignal=Te({unreadCommentsMap:null,count:0}),this.subscription=[],this.componentId="velt-comment-pin-bubble";try{this.subscription.push(this.commentService.getUnreadCommentsMap$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=E({},p),p.unreadCommentsMap=c,p))}))}catch(c){this.catchError("Error in CommentPinBubbleComponent constructor: ",c)}}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentPinBubbleComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinBubbleComponent setupA11yAttributes:",e)}}ngOnChanges(e){super.ngOnChanges(e);try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>{if(r=D(E({},r),{[t]:e[t].currentValue}),t==="annotation")if(r?.annotation?.type==="multiThread"){let a=Object.keys(r.unreadCommentsMap||{});r?.annotation?.commentAnnotationsMap&&(r.count=0,Object.values(r?.annotation?.commentAnnotationsMap||{}).forEach(s=>{s?.status?.id!==this.customFilterService.resolvedStatus?.id&&(r.count=(r?.count||0)+1),a.includes(s.annotationId)&&(r.unreadAnnotationCount=(r.unreadAnnotationCount||0)+1)}))}else r.count=r?.annotation?.comments?.length;return r})})}catch{}}ngOnDestroy(){super.ngOnDestroy();try{this.subscription.forEach(e=>e.unsubscribe())}catch(e){this.catchError("Error in CommentPinBubbleComponent ngOnDestroy: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(we),h(_),h(Wo),h(Ke),h(R))},o.\u0275cmp=O({type:o,selectors:[["velt-comment-pin-bubble-internal"]],inputs:{annotation:"annotation"},standalone:!1,features:[L,Qe],decls:1,vars:1,consts:[[4,"ngIf"],[1,"velt-comment-pin-bubble-container"],[1,"velt-comment-pin-bubble--unread-indicator-container"],["width","16","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.6666 1.33325H3.33325C2.80282 1.33325 2.29411 1.54397 1.91904 1.91904C1.54397 2.29411 1.33325 2.80282 1.33325 3.33325V9.99992C1.33325 10.5304 1.54397 11.0391 1.91904 11.4141C2.29411 11.7892 2.80282 11.9999 3.33325 11.9999H11.0599L13.5266 14.4733C13.5889 14.535 13.6628 14.5839 13.744 14.6171C13.8252 14.6503 13.9122 14.6671 13.9999 14.6666C14.0874 14.6688 14.1741 14.6506 14.2533 14.6133C14.375 14.5632 14.4792 14.4783 14.5528 14.3692C14.6263 14.26 14.6659 14.1315 14.6666 13.9999V3.33325C14.6666 2.80282 14.4559 2.29411 14.0808 1.91904C13.7057 1.54397 13.197 1.33325 12.6666 1.33325ZM13.3333 12.3933L11.8066 10.8599C11.7443 10.7981 11.6704 10.7492 11.5892 10.7161C11.508 10.6829 11.421 10.6661 11.3333 10.6666H3.33325C3.15644 10.6666 2.98687 10.5963 2.86185 10.4713C2.73682 10.3463 2.66659 10.1767 2.66659 9.99992V3.33325C2.66659 3.15644 2.73682 2.98687 2.86185 2.86185C2.98687 2.73682 3.15644 2.66659 3.33325 2.66659H12.6666C12.8434 2.66659 13.013 2.73682 13.138 2.86185C13.263 2.98687 13.3333 3.15644 13.3333 3.33325V12.3933Z","fill","currentColor"],["class","velt-comment-pin-bubble--unread-indicator",4,"ngIf"],[1,"velt-comment-pin-bubble--count"],[1,"velt-comment-pin-bubble--unread-indicator"]],template:function(t,r){t&1&&u(0,ktn,9,13,"ng-container",0),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,ge],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}[_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-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;cursor:pointer}[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-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-pin-bubble-container[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-xs);align-items:center;border-radius:var(--velt-border-radius-sm);box-shadow:0 0 1px #4551613d,0 2px 4px #45516124;color:var(--velt-accent-text);gap:var(--velt-spacing-xs);background-color:var(--velt-background-0);font-family:var(--velt-default-font-family)}.velt-comment-pin-bubble--unread-indicator-container[_ngcontent-%COMP%]{position:relative;display:flex}.velt-comment-pin-bubble--unread-indicator[_ngcontent-%COMP%]{position:absolute;top:-2px;right:-2px;display:block;width:8px;height:8px;margin-left:var(--velt-spacing-xs);border-radius:var(--velt-border-radius-full);background-color:var(--velt-error);color:var(--velt-error-foreground)}"],changeDetection:0});let i=o;return i})();var Ntn=["commentDialogOverlay"],Ftn=["commentPinBubbleOverlay"],Ltn=["*"],Btn=()=>["snippyly-overlay-panel","velt-comment-pin-bubble-overlay-panel","velt-overlay-panel"],Q1e=i=>({trigger:i}),Vtn=()=>["snippyly-overlay-panel","velt-comment-dialog-overlay-panel","velt-overlay-panel"];function Utn(i,o){i&1&&He(0)}function jtn(i,o){if(i&1&&(v(0),u(1,Utn,1,0,"ng-container",13),C()),i&2){l();let n=me(1);l(2);let e=me(9);m(),d("ngTemplateOutlet",e)("ngTemplateOutletContext",A(2,Q1e,n))}}function $tn(i,o){if(i&1){let n=K();y(0,"div",11,4),P(2,"translate"),G("click",function(t){return N(n),F(t.preventDefault())})("pointerenter",function(t){return N(n),l(3).onBubblePointerOver(t),F(t.stopPropagation())})("pointerleave",function(){N(n);let t=l(3);return F(t.onBubblePointerOut())})("pointerup",function(){N(n);let t=l(3);return F(t.onPointerUpOnBubble())}),y(3,"velt-comment-pin-bubble-internal",12),G("afterViewInit",function(){N(n);let t=l(3);return F(t.onBubbleAfterViewInit())})("onDestroy",function(){N(n);let t=l(3);return F(t.onBubbleOnDestroy())}),b()(),u(4,jtn,2,4,"ng-container",6)}if(i&2){let n=l(2).ngIf;T("role","button")("aria-expanded",n.commentBubbleHover)("aria-label",M(2,5,"Comment bubble")),m(3),d("annotation",n.annotation),m(),d("ngIf",n.isBubbleInitialized)}}function Htn(i,o){if(i&1){let n=K();v(0),u(1,$tn,5,7,"ng-template",10,3,Ee),G("positionChange",function(t){N(n);let r=l(2);return F(r.onCommentPinBubblePositionChange(t))}),C()}if(i&2){let n=l().ngIf,e=me(2);m(),d("cdkConnectedOverlayOrigin",e)("cdkConnectedOverlayOpen",!n.annotationDragging&&!!(n!=null&&n.user)&&(n.bubbleOnPinHover&&n.commentPinHover||n.commentBubbleHover||n.commentPinSelected))("cdkConnectedOverlayPanelClass",gt(10,Btn))("cdkConnectedOverlayOffsetY",n.popoverMode?0:n.commentPinBubbleOverlayOriginY==="top"?-8:2)("cdkConnectedOverlayOffsetX",n.popoverMode?n.commentPinBubbleOverlayOriginX==="end"?4:0:n.showCommentIndex&&n.commentPinBubbleOverlayOriginX==="end"?8:0)("cdkConnectedOverlayBackdropClass","velt-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",n.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0)}}function ztn(i,o){i&1&&He(0)}function Gtn(i,o){if(i&1&&u(0,ztn,1,0,"ng-container",13),i&2){l();let n=me(2),e=me(9);d("ngTemplateOutlet",e)("ngTemplateOutletContext",A(2,Q1e,n))}}function Wtn(i,o){if(i&1){let n=K();v(0),y(1,"velt-multi-thread-comment-dialog-internal",14),P(2,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment.emit(t))})("updateOverlayPosition",function(){N(n);let t=l(4);return F(t.updateOverlayPosition())})("pointerOutFromCommentDialog",function(t){N(n);let r=l(4);return F(r.onPointerOutFromCommentDialog(t))})("pointerUp",function(t){N(n);let r=l(4);return F(r.onPointerUpOnDialog(t))}),b(),C()}if(i&2){let n=l(3).ngIf,e=l();m(),d("multiThreadAnnotationId",n.annotation==null?null:n.annotation.annotationId)("annotation",n.annotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("containerComponentId",n.containerComponentId)("context",e.context)("readOnly",n.readOnly)("commentPinType",n.commentPinType),T("role","dialog")("aria-label",M(2,10,"Multi-thread comment dialog"))}}function qtn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-dialog",15),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment.emit(t))})("updateOverlayPosition",function(){N(n);let t=l(4);return F(t.updateOverlayPosition())})("pointerOutFromCommentDialog",function(t){N(n);let r=l(4);return F(r.onPointerOutFromCommentDialog(t))})("addComment",function(t){N(n);let r=l(4);return F(r.addCommentEmitter.emit(t))})("pointerUp",function(){N(n);let t=l(4);return F(t.onPointerUpOnDialog())}),b()}if(i&2){let n=l(3).ngIf;d("annotation",n.annotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("containerComponentId",n.containerComponentId)("readOnly",n.readOnly)("commentPinType",n.commentPinType),T("role","dialog")("aria-label",M(1,8,"Comment dialog"))}}function Ytn(i,o){if(i&1&&u(0,Wtn,3,12,"ng-container",8)(1,qtn,2,10,"ng-template",null,2,Ee),i&2){let n=me(2),e=l(2).ngIf;d("ngIf",(e==null||e.annotation==null?null:e.annotation.type)==="multiThread")("ngIfElse",n)}}function Ktn(i,o){if(i&1){let n=K();u(0,Ytn,3,2,"ng-template",10,5,Ee),G("positionChange",function(t){N(n);let r=l(2);return F(r.onCommentDialogPositionChange(t))})}if(i&2){let n=o.trigger,e=l().ngIf;d("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",(!e.commentBubbleAvailable||e.commentPinType==="bubble")&&!!(e!=null&&e.user)&&!e.annotationDragging&&(!e.isPhone||!e.mobileMode)&&!e.dialogOpenedInSidebar&&!e.streamMode&&!e.inboxMode&&e.floatingCommentsEnabled&&(e.commentPinSelected&&(e.commentPinType!=="bubble"||e.openDialog)||e.dialogOnHover&&(e.bubbleOnPin?e.commentBubbleHover:e.commentPinHover)&&(e.commentPinType!=="bubble"||e.openDialog)||e.commentPinType==="bubble"&&e.commentBubbleTargetPinHover&&e.openDialog))("cdkConnectedOverlayPanelClass",gt(10,Vtn))("cdkConnectedOverlayOffsetY",e.popoverMode?0:e.commentDialogOverlayOriginY==="top"?-8:2)("cdkConnectedOverlayOffsetX",e.popoverMode?e.commentDialogOverlayOriginX==="end"?4:0:e.showCommentIndex&&e.commentDialogOverlayOriginX==="end"?8:0)("cdkConnectedOverlayBackdropClass","velt-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",e.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0)}}function Ztn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-bottom-sheet",16),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(2);return F(r.saveComment.emit(t))}),b()}if(i&2){let n=l().ngIf;d("annotation",n.annotation)("user",n.user),T("role","dialog")("aria-label",M(1,4,"Comment bottom sheet"))}}function Xtn(i,o){if(i&1){let n=K();v(0),y(1,"div",7,0),P(3,"translate"),G("click",function(t){return N(n),F(t.preventDefault())})("pointerenter",function(t){return N(n),l().onPointerOver(t),F(t.stopPropagation())})("pointerleave",function(){N(n);let t=l();return F(t.onPointerOut())}),jt(4),b(),u(5,Htn,3,11,"ng-container",8)(6,Gtn,1,4,"ng-template",null,1,Ee)(8,Ktn,2,11,"ng-template",null,2,Ee)(10,Ztn,2,6,"snippyly-comment-bottom-sheet",9),C()}if(i&2){let n=o.ngIf,e=me(7),t=l();m(),T("data-testid",t.componentId+"-trigger")("role","button")("aria-expanded",n.commentPinSelected)("aria-haspopup","dialog")("aria-label",M(3,8,"Comment pin")),m(4),d("ngIf",n.bubbleOnPin&&!n.commentBubbleAvailable&&!n.dialogOpenedInSidebar)("ngIfElse",e),m(5),d("ngIf",(n==null?null:n.user)&&n.mobileMode&&n.isPhone&&!n.sidebarVisible&&!n.dialogOpenedInSidebar&&!n.inboxMode&&!n.streamMode&&n.floatingCommentsEnabled&&n.commentPinSelected)}}var W1=(()=>{let o=class o{constructor(e,t,r,a,s,c){this.breakpointObserver=e,this.commentService=t,this.domService=r,this.loggingService=a,this.elementRef=s,this.commentPinPortalService=c,this.commentPinSelected=!1,this.annotationDragging=!1,this.commentPinType="pin",this.commentBubbleTargetPinHover=!1,this.showBubbleOnHover=!1,this.bubbleOnPin=!1,this.bubbleOnPinHover=!1,this.readOnly=!1,this.openDialog=!0,this.saveComment=new Me,this.togglePinSelection=new Me,this.commentTargetElementClicked=new Me,this.addCommentEmitter=new Me,this.isDialogOnHoverEnabled=!1,this.isDialogOnTargetElementClickEnabled=!1,this.previouslySelectedAnnotations={},this.eventListenersSubscriptions=[],this.customScrollableParentEventsListenersSubscriptions=[],this.componentConfigSignal=Te({bubbleOnPin:!1,bubbleOnPinHover:!1,dialogOnHover:!1,commentBubbleAvailable:!1,commentPinHover:!1,commentBubbleHover:!1,commentPinSelected:!1,popoverMode:!1,showCommentIndex:!1,commentBubbleTargetPinHover:!1,isBubbleInitialized:!1,annotationDragging:!1,commentPinBubbleOverlayOriginX:"start",commentPinBubbleOverlayOriginY:"top",positions:[],annotation:void 0,commentPinType:"pin",isPhone:!1,mobileMode:!1,streamMode:!1,inboxMode:!1,floatingCommentsEnabled:!1,sidebarVisible:!1,dialogOpenedInSidebar:!1,readOnly:!1,openDialog:!0,commentDialogOverlayOriginX:"start",commentDialogOverlayOriginY:"top",user:void 0}),this.subscriptions=[],this.componentId="velt-comment-dialog-portal";try{this.loggingService.log("%c[WB] Creating COMPONENT CommentDialogPortalComponent","color: blue;"),this.subscriptions.push(this.breakpointObserver.observe(zi.XSmall).subscribe(p=>{p.matches?this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!0}),g)):this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!1}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent breakpointObserver subscription: ",p)})),this.subscriptions.push(this.commentService.getReadOnly$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{readOnly:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getReadOnly$ subscription: ",p)})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{sidebarVisible:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getSidebarVisibility$ subscription: ",p)})),this.subscriptions.push(this.commentService.getMobileMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{mobileMode:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getMobileMode$ subscription: ",p)})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{showCommentIndex:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getShowCommentIndex subscription: ",p)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{streamMode:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getStreamMode$ subscription: ",p)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{inboxMode:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getInboxMode subscription: ",p)})),this.subscriptions.push(this.domService.getDialogOpenedInSidebar().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{dialogOpenedInSidebar:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent getDialogOpenedInSidebar subscription: ",p)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{popoverMode:p}),g)),this.componentConfigSignal().popoverMode?this.componentConfigSignal.update(g=>(g=D(E({},g),{positions:U.OVERLAY_POSITIONS_FOR_POPOVER_MODE.map(f=>new mi({originX:f.originX,originY:f.originY},{overlayX:f.overlayX,overlayY:f.overlayY}))}),g)):this.componentConfigSignal.update(g=>(g=D(E({},g),{positions:U.OVERLAY_POSITIONS.map(f=>new mi({originX:f.originX,originY:f.originY},{overlayX:f.overlayX,overlayY:f.overlayY}))}),g)),this.addEventListeners()},p=>{this.catchError("Error in CommentDialogPortalComponent getPopoverMode subscription: ",p)})),this.subscriptions.push(this.commentService.showFloatingComments$().subscribe(p=>{this.componentConfigSignal.update(g=>(g=D(E({},g),{floatingCommentsEnabled:p}),g))},p=>{this.catchError("Error in CommentDialogPortalComponent showFloatingComments$ subscription: ",p)})),this.subscriptions.push(this.commentService.getEnableDialogOnHover$().subscribe(p=>{this.isDialogOnHoverEnabled=p,this.componentConfigSignal.update(g=>(g=D(E({},g),{dialogOnHover:p}),g)),this.addEventListeners()},p=>{this.catchError("Error in CommentDialogPortalComponent getEnableDialogOnHover subscription: ",p)})),this.subscriptions.push(this.commentService.getEnableDialogOnTargetElementClick$().subscribe(p=>{this.isDialogOnTargetElementClickEnabled=p,this.addEventListeners()},p=>{this.catchError("Error in CommentDialogPortalComponent getEnableDialogOnTargetElementClick subscription: ",p)})),this.subscriptions.push(this.commentService.getBubbleCommentAnnotationIds$().subscribe(p=>{if(p.includes(this.componentConfigSignal().annotation?.annotationId)){this.commentBubbleElement=this.commentService.getCommentBubbleElement(this.componentConfigSignal().annotation);let g=this.commentBubbleElement?.getAttribute(U.ATTRIBUTES.VELT_ANNOTATION_ID)||"";this.commentBubbleElementAnnotationId!==g&&(this.commentBubbleElementAnnotationId=g,this.componentConfigSignal.update(f=>(f=D(E({},f),{commentBubbleAvailable:!0}),f)))}else this.componentConfigSignal().commentBubbleAvailable&&(this.commentBubbleElement=null,this.commentBubbleElementAnnotationId="",this.componentConfigSignal.update(g=>(g=D(E({},g),{commentBubbleAvailable:!1}),g)))},p=>{this.catchError("Error in CommentDialogPortalComponent getBubbleCommentAnnotationIds$ subscription: ",p)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().pipe(Mi()).subscribe(([p,g])=>{this.previouslySelectedAnnotations=p||{},g&&!g[this.componentConfigSignal().annotation?.annotationId]&&this.componentConfigSignal().commentPinHover&&this.setCommentPinHover(!1)},p=>{this.catchError("Error in CommentDialogPortalComponent getSelectedAnnotationsMap$ subscription: ",p)}))}catch(p){this.catchError("Error in CommentDialogPortalComponent constructor: ",p)}}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentDialogPortalComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentDialogPortalComponent setupA11yAttributes:",e)}}ngAfterViewInit(){try{this.updateHighlightOnElement(),this.updateCommentActiveAttributeOnElement()}catch(e){this.catchError("Error in CommentDialogPortalComponent AfterViewInit: ",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))}),e?.commentPinSelected&&(this.componentConfigSignal().commentPinSelected&&this.setCommentPinHover(!1),this.updateHighlightOnElement(),this.updateCommentActiveAttributeOnElement()),e?.targetElement&&(this.addEventListeners(),this.targetElement?this.setCustomScrollableParents($g(this.targetElement)):this.setCustomScrollableParents([]))}catch(t){this.catchError("Error in CommentDialogPortalComponent ngOnChanges: ",t)}}onBubbleAfterViewInit(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{isBubbleInitialized:!0}),e))}catch(e){this.catchError("Error in CommentDialogPortalComponent onBubbleAfterViewInit: ",e)}}onBubbleOnDestroy(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{isBubbleInitialized:!1}),e))}catch(e){this.catchError("Error in CommentDialogPortalComponent onBubbleOnDestroy: ",e)}}onCommentPinBubblePositionChange(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{commentPinBubbleOverlayOriginX:e.connectionPair.originX,commentPinBubbleOverlayOriginY:e.connectionPair.originY}),t))}catch(t){this.catchError("Error in CommentDialogPortalComponent onCommentPinBubblePositionChange: ",t)}}onCommentDialogPositionChange(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{commentDialogOverlayOriginX:e.connectionPair.originX,commentDialogOverlayOriginY:e.connectionPair.originY}),t))}catch(t){this.catchError("Error in CommentDialogPortalComponent onCommentDialogPositionChange: ",t)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().annotation?.annotationId),this.commentPinBubbleOverlay&&this.commentPinBubbleOverlay?.overlayRef?.updatePosition(),this.commentDialogOverlay&&this.commentDialogOverlay?.overlayRef?.updatePosition()}catch{}}onPointerOutFromCommentDialog(e){try{!this.targetElement?.contains(e?.relatedTarget)&&!this.componentConfigSignal().commentPinSelected&&this.onPointerOut()}catch(t){this.catchError("Error in CommentDialogPortalComponent onPointerOutFromCommentDialog: ",t)}}onPointerOut(){try{this.componentConfigSignal().bubbleOnPin?setTimeout(()=>{this.setCommentPinHover(!1)},500):this.setCommentPinHover(!1)}catch(e){this.catchError("Error in CommentDialogPortalComponent onPointerOut: ",e)}}setCommentPinHover(e){try{e&&this.targetElement&&!this.domService.isElementVisibleOnScreen(this.targetElement)&&(e=!1),this.componentConfigSignal.update(r=>(r=D(E({},r),{commentPinHover:e}),r)),this.updateHighlightOnElement(),this.updateCommentActiveAttributeOnElement();let t=this.commentBubbleElementRef?.nativeElement||this.commentBubbleElement;t&&(this.componentConfigSignal().commentPinHover?t.setAttribute("comment-bubble-target-pin-hover","true"):t.removeAttribute("comment-bubble-target-pin-hover"))}catch(t){this.catchError("Error in CommentDialogPortalComponent setCommentPinHover: ",t)}}addEventListeners(){try{this.removeEventListeners(),this.componentConfigSignal().popoverMode&&this.targetElement&&this.isDialogOnTargetElementClickEnabled&&this.componentConfigSignal().commentPinType!=="bubble"&&(this.isDialogOnHoverEnabled&&(this.eventListenersSubscriptions.push(Ci(this.targetElement,"pointerover").subscribe(e=>{this.onPointerOver(e),e.stopPropagation()},e=>{this.catchError("Error in CommentDialogPortalComponent addEventListeners pointerover subscription: ",e)})),this.eventListenersSubscriptions.push(Ci(this.targetElement,"pointerout").subscribe(e=>{!this.targetElement?.contains(e?.relatedTarget)&&!e?.relatedTarget?.closest(U.TAGS.SNIPPYLY_COMMENT_DIALOG)&&this.onPointerOut()},e=>{this.catchError("Error in CommentDialogPortalComponent addEventListeners pointerout subscription: ",e)}))),this.eventListenersSubscriptions.push(Ci(this.targetElement,"click").subscribe(e=>{this.previouslySelectedAnnotations[this.componentConfigSignal().annotation?.annotationId]||(this.commentTargetElementClicked.emit(),e.stopPropagation())},e=>{this.catchError("Error in CommentDialogPortalComponent addEventListeners click subscription: ",e)})))}catch(e){this.catchError("Error in CommentDialogPortalComponent addEventListeners: ",e)}}removeEventListeners(){try{this.eventListenersSubscriptions.map(e=>{e.unsubscribe()}),this.eventListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentDialogPortalComponent removeEventListeners: ",e)}}updateHighlightOnElement(){try{this.targetElement&&(this.componentConfigSignal().commentPinSelected||this.componentConfigSignal().commentPinHover?this.domService.highlightElement(this.targetElement):this.domService.removeHighlightFromElement(this.targetElement))}catch(e){this.catchError("Error in CommentDialogPortalComponent updateHighlightOnElement: ",e)}}updateCommentActiveAttributeOnElement(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: updateCommentActiveAttributeOnElement","color: green;"),this.componentConfigSignal().commentPinSelected||this.componentConfigSignal().commentPinHover)this.targetElement&&(this.targetElement?.hasAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE)||this.targetElement?.setAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE,"true"));else if(this.targetElement&&this.targetElement?.hasAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE)){let e=this.commentPinPortalService.getAnnotationIdsByUserTargetElement(this.targetElement),t=!1;if(e&&e.length>0){let r=this.domService.getSelectedAnnotationsMap();e.forEach(a=>{if(r?.[a]){t=!0;return}})}t||this.targetElement?.removeAttribute(U.ATTRIBUTES.VELT_COMMENT_PIN_ACTIVE)}}catch(e){this.catchError("Error in CommentDialogPortalComponent onCommentFocusChange: ",e)}}onPointerUpOnDialog(e){try{(!this.componentConfigSignal().commentPinSelected||e)&&this.togglePinSelection.emit(e)}catch(t){this.catchError("Error in CommentDialogPortalComponent onPointerUpOnDialog: ",t)}}onPointerOver(e){try{if(this.componentConfigSignal().commentPinHover)return;e.buttons?this.componentConfigSignal().commentPinHover&&this.setCommentPinHover(!1):!this.componentConfigSignal().commentPinHover&&(this.componentConfigSignal().bubbleOnPin?this.componentConfigSignal().bubbleOnPinHover:this.isDialogOnHoverEnabled)&&this.setCommentPinHover(!0)}catch(t){this.catchError("Error in CommentDialogPortalComponent onPointerOver: ",t)}}setCustomScrollableParents(e){try{this.customScrollableParents=e,this.addCustomScrollableParentsEventListeners()}catch(t){this.catchError("Error in CommentDialogPortalComponent setCustomScrollableParents: ",t)}}addCustomScrollableParentsEventListeners(){try{this.removeCustomScrollableParentsEventListeners(),this.customScrollableParents?.length&&this.customScrollableParents?.forEach(e=>{this.customScrollableParentEventsListenersSubscriptions.push(Ci(e,"scroll",{passive:!0}).subscribe(t=>{this.updateOverlayPosition()},t=>{this.catchError("Error in CommentDialogPortalComponent addCustomScrollableParentsEventListeners scroll subscription: ",t)}))})}catch(e){this.catchError("Error in CommentDialogPortalComponent addCustomScrollableParentsEventListeners: ",e)}}removeCustomScrollableParentsEventListeners(){try{this.customScrollableParentEventsListenersSubscriptions.map(e=>{e.unsubscribe()}),this.customScrollableParentEventsListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentDialogPortalComponent removeCustomScrollableParentsEventListeners: ",e)}}onBubblePointerOver(e){try{if(this.componentConfigSignal().commentBubbleHover)return;e.buttons||this.componentConfigSignal.update(t=>(t=D(E({},t),{commentBubbleHover:!0}),t))}catch(t){this.catchError("Error in CommentDialogPortalComponent onBubblePointerOver: ",t)}}onBubblePointerOut(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{commentBubbleHover:!1}),e))}catch(e){this.catchError("Error in CommentDialogPortalComponent onBubblePointerOut: ",e)}}onPointerUpOnBubble(){try{this.componentConfigSignal().commentPinSelected||this.togglePinSelection.emit()}catch(e){this.catchError("Error in CommentDialogPortalComponent onPointerUpOnBubble: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(e){this.catchError("Error in CommentDialogPortalComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeEventListeners(),this.removeCustomScrollableParentsEventListeners(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentDialogPortalComponent unsubscribe: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(Oo),h(we),h(Ve),h(_),h(R),h(G1))},o.\u0275cmp=O({type:o,selectors:[["velt-comment-dialog-portal-internal"]],viewQuery:function(t,r){if(t&1&&(it(Ntn,5),it(Ftn,5)),t&2){let a;et(a=tt())&&(r.commentDialogOverlay=a.first),et(a=tt())&&(r.commentPinBubbleOverlay=a.first)}},inputs:{annotation:"annotation",context:"context",commentPinSelected:"commentPinSelected",annotationDragging:"annotationDragging",commentPinType:"commentPinType",commentBubbleTargetPinHover:"commentBubbleTargetPinHover",user:"user",targetElement:"targetElement",showBubbleOnHover:"showBubbleOnHover",bubbleOnPin:"bubbleOnPin",bubbleOnPinHover:"bubbleOnPinHover",containerComponentId:"containerComponentId",readOnly:"readOnly",openDialog:"openDialog",commentBubbleElementRef:"commentBubbleElementRef"},outputs:{saveComment:"saveComment",togglePinSelection:"togglePinSelection",commentTargetElementClicked:"commentTargetElementClicked",addCommentEmitter:"addComment"},standalone:!1,features:[Qe],ngContentSelectors:Ltn,decls:1,vars:1,consts:[["trigger","cdkOverlayOrigin"],["defaultDialogViewRef",""],["commentDialogRef",""],["commentPinBubbleOverlay","cdkConnectedOverlay"],["bubbleOnHoverTrigger","cdkOverlayOrigin"],["commentDialogOverlay","cdkConnectedOverlay"],[4,"ngIf"],["cdkOverlayOrigin","",3,"click","pointerenter","pointerleave"],[4,"ngIf","ngIfElse"],[3,"annotation","user","saveComment",4,"ngIf"],["cdkConnectedOverlay","",3,"positionChange","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPanelClass","cdkConnectedOverlayOffsetY","cdkConnectedOverlayOffsetX","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayDisableClose"],["cdkOverlayOrigin","",3,"click","pointerenter","pointerleave","pointerup"],["veltAfterViewInit","",3,"afterViewInit","onDestroy","annotation"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"saveComment","updateOverlayPosition","pointerOutFromCommentDialog","pointerUp","multiThreadAnnotationId","annotation","user","commentPinSelected","containerComponentId","context","readOnly","commentPinType"],[3,"saveComment","updateOverlayPosition","pointerOutFromCommentDialog","addComment","pointerUp","annotation","user","commentPinSelected","containerComponentId","readOnly","commentPinType"],[3,"saveComment","annotation","user"]],template:function(t,r){t&1&&(Ht(),u(0,Xtn,11,10,"ng-container",6)),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,dn,sn,ar,a8,Iu,X1e,Rs,ge],encapsulation:2,changeDetection:0});let i=o;return i})();var Qtn=["pinRef"],Jtn=["commentDialogPortalRef"],enn=["*"],tye=i=>({componentConfigSignal:i}),tnn=(i,o)=>({condition:i,data:o}),eye=()=>["bubble","chart"],nnn=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-comment-pin-wireframe",variant:n,setIfCondition:e,componentElementRef:t}),inn=(i,o,n)=>({"velt-comment-pin--status-default":i,"velt-comment-pin--status-ongoing":o,"velt-comment-pin--status-terminal":n});function onn(i,o){i&1&&He(0)}function rnn(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,onn,1,0,"ng-container",11),b()),i&2){l();let n=me(3),e=l(2);T("data-testid",e.componentId+"-shadow-dom"),m(),d("ngTemplateOutlet",n)}}function ann(i,o){if(i&1){let n=K();v(0),y(1,"div",14),G("click",function(t){return N(n),F(t.preventDefault())}),jt(2),b(),C()}i&2&&(m(),T("role","presentation"))}function snn(i,o){if(i&1&&(v(0),w(1,"app-comment-pin-triangle",15),C()),i&2){let n=l(5);m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.triangleTemplate)}}function lnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",21)(2,"path",22),b())}function cnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",23)(2,"path",24),b())}function dnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",25)(2,"path",26),b())}function mnn(i,o){i&1&&(ce(),y(0,"svg",20),w(1,"path",27)(2,"path",28),b())}function pnn(i,o){if(i&1&&(v(0)(1,18),u(2,lnn,3,0,"svg",19)(3,cnn,3,0,"svg",19)(4,dnn,3,0,"svg",19)(5,mnn,3,0,"svg",19),C()()),i&2){let n=l(6).ngIf;m(),d("ngSwitch",n.annotation==null||n.annotation.pageInfo==null||n.annotation.pageInfo.deviceInfo==null?null:n.annotation.pageInfo.deviceInfo.deviceType),m(),d("ngSwitchCase","Mobile"),m(),d("ngSwitchCase","Tablet"),m(),d("ngSwitchCase","Desktop"),m(),d("ngSwitchCase","Monitor")}}function gnn(i,o){if(i&1&&w(0,"snippyly-user-avatar",29),i&2){let n=l(6).ngIf;d("user",n.annotation==null?null:n.annotation.from)}}function unn(i,o){if(i&1&&(v(0),w(1,"app-comment-pin-unread-comment-indicator",15),C()),i&2){let n=l(7);m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.unreadCommentIndicatorTemplate)}}function hnn(i,o){if(i&1&&w(0,"app-comment-pin-number",15)(1,"app-comment-pin-ghost-comment-indicator",15)(2,"app-comment-pin-private-comment-indicator",15),i&2){let n=l(7);d("componentConfigSignal",n.componentConfigSignal)("template",n.indexTemplate),m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.ghostCommentIndicatorTemplate),m(),d("componentConfigSignal",n.componentConfigSignal)("template",n.privateCommentIndicatorTemplate)}}function fnn(i,o){if(i&1){let n=K();v(0),y(1,"div",17,5),G("click",function(t){return N(n),F(t.preventDefault())}),u(3,pnn,6,5,"ng-container",10)(4,gnn,1,1,"ng-template",null,6,Ee)(6,unn,2,2,"ng-container",10)(7,hnn,3,6,"ng-template",null,7,Ee),b(),C()}if(i&2){let n=me(5),e=me(8),t=l(5).ngIf,r=l();m(),at("--velt-internal-comment-pin-bg-color",(t.annotation==null||t.annotation.status==null?null:t.annotation.status.color)||null),pe("velt-comment-pin--marker-transparent",r.usingCustomCommentPin)("velt-comment-pin--marker-default",!r.usingCustomCommentPin),d("ngClass",$e(12,inn,!t.customStatusesShown&&(t.annotation==null||t.annotation.status==null?null:t.annotation.status.type)==="default",!t.customStatusesShown&&(t.annotation==null||t.annotation.status==null?null:t.annotation.status.type)==="ongoing",!t.customStatusesShown&&(t.annotation==null||t.annotation.status==null?null:t.annotation.status.type)==="terminal")),T("role","presentation"),m(2),d("ngIf",t.isDeviceIndicatorOnCommentPinsEnabled&&t.isCommentAddedOnDifferentDeviceType)("ngIfElse",n),m(3),d("ngIf",!(t.user!=null&&t.user.isGuest)&&!(t.user!=null&&t.user.isAnonymous)&&(t==null||t.unreadCommentsMap==null?null:t.unreadCommentsMap[t.annotation==null?null:t.annotation.annotationId]))("ngIfElse",e)}}function vnn(i,o){if(i&1){let n=K();y(0,"div",14),G("click",function(t){return N(n),F(t.preventDefault())}),u(1,fnn,9,16,"ng-container",16),b()}if(i&2){let n=l(4).ngIf,e=l();T("role","presentation"),m(),d("veltDynamicTemplate",$(4,nnn,e.template,A(2,tye,e.componentConfigSignal),n==null?null:n.variant,e.setIfCondition.bind(e),e.elementRef))}}function Cnn(i,o){if(i&1&&u(0,snn,2,2,"ng-container",10)(1,vnn,2,10,"ng-template",null,4,Ee),i&2){let n=me(2),e=l(3).ngIf;d("ngIf",e.popoverMode)("ngIfElse",n)}}function _nn(i,o){if(i&1){let n=K();y(0,"velt-comment-dialog-portal-internal",12,1),G("saveComment",function(t){N(n);let r=l(3);return F(r.saveComment.emit(t))})("togglePinSelection",function(t){N(n);let r=l(3);return F(r.onPinBubblePointerUp(t))})("pointerUp",function(){N(n);let t=l(3);return F(t.onPointerUpOnDialog())}),y(2,"div",13,2),u(4,ann,3,1,"ng-container",10)(5,Cnn,3,2,"ng-template",null,3,Ee),b()()}if(i&2){let n=me(6),e=l(2).ngIf,t=l();d("annotation",e.annotation)("user",e.user)("commentPinSelected",e.commentPinSelected)("annotationDragging",e.annotationDragging)("commentPinType",e.commentPinType)("targetElement",e.targetElement)("bubbleOnPin",e.bubbleOnPin)("bubbleOnPinHover",e.bubbleOnPinHover)("containerComponentId",e.containerComponentId),m(2),at("--velt-internal-comment-pin-max-width",t.pinMaxWidth),pe("velt-comment-pin--ghost",!!(e.annotation!=null&&e.annotation.ghostComment))("velt-comment-pin--different-device",e.isDeviceIndicatorOnCommentPinsEnabled&&e.isCommentAddedOnDifferentDeviceType)("velt-comment-pin--outside-viewport",!e.annotationDragging&&t.isOutsideViewport)("velt-comment-pin-open",e.commentPinSelected&&!e.annotationDragging)("velt-comment-pin-unread-comment",!(e.user!=null&&e.user.isGuest)&&!(e.user!=null&&e.user.isAnonymous)&&(e==null||e.unreadCommentsMap==null?null:e.unreadCommentsMap[e.annotation==null?null:e.annotation.annotationId]))("velt-display-none",e.commentPinType!=="bubble"&&e.commentBubbleElementAnnotationId&&e.commentBubbleElementAnnotationId!==(e.annotation==null?null:e.annotation.annotationId)),T("data-testid",t.componentId)("role","button")("aria-expanded",e.commentPinSelected),m(2),d("ngIf",e.commentPinType==="bubble"||e.commentPinType==="chart")("ngIfElse",n)}}function ynn(i,o){if(i&1&&(v(0),u(1,rnn,2,2,"velt-shadow-dom-internal",10)(2,_nn,7,28,"ng-template",null,0,Ee),C()),i&2){let n=me(3),e=l().ngIf,t=l();m(),d("ngIf",!t.template&&t.pinShadowDOM&&!(gt(2,eye)!=null&>(3,eye).includes(e.commentPinType)))("ngIfElse",n)}}function Snn(i,o){if(i&1&&(v(0),u(1,ynn,4,4,"ng-container",9),C()),i&2){let n=l();m(),d("veltIf",k(3,tnn,n.conditionSignal(),A(1,tye,n.componentConfigSignal)))}}var Tu=(()=>{let o=class o extends u7{constructor(e,t,r,a,s,c,p){super(c,p,r),this.commentService=e,this.domService=t,this.loggingService=r,this.commentPinPortalService=a,this.wireframeService=s,this.elementRef=c,this.dynamicDataService=p,this.commentPinSelected=!1,this.annotationDragging=!1,this.commentPinType="pin",this.usingCustomCommentPin=!1,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.saveComment=new Me,this.pinShadowDOM=!1,this.subscriptions=[],this.commentTargetElementClicked=new Me,this.togglePinSelection=new Me,this.commentBubbleAvailable=!1,this.commentPinPosition={top:0,left:0},this.isOutsideViewport=!1,this.pinMaxWidth="",this.previouslySelectedAnnotations={},this.deviceInfo=new Kn,this.COMMENT_PIN_SIZE=40,this.componentConfigSignal=Te({isGhostComment:!1,isPrivateComment:!1,showCommentIndex:!1,bubbleOnPin:!1,bubbleOnPinHover:!1,commentPinSelected:!1,annotationDragging:!1,popoverMode:!1,isDeviceIndicatorOnCommentPinsEnabled:!1,isCommentAddedOnDifferentDeviceType:!1,annotation:this.annotation,user:this.user,unreadCommentsMap:null,popoverTriangleComponent:!1}),this.veltElement=!0,this.componentId="velt-comment-pin",this.loggingService.log("%c[WB] Creating COMPONENT CommentPinComponent","color: blue;"),this.subscriptions.push(this.domService.getDeviceInfo$().subscribe(g=>{this.deviceInfo=g,this.checkIfCommentAddedOnDifferentDeviceType()})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{showCommentIndex:g}),f))},g=>{this.catchError("Error in CommentPinComponent getShowCommentIndex subscription: ",g)})),this.subscriptions.push(this.commentService.getBubbleOnPin$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{bubbleOnPin:g}),f))},g=>{this.catchError("Error in CommentPinComponent getBubbleOnPin subscription: ",g)})),this.subscriptions.push(this.commentService.getBubbleOnPinHover$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{bubbleOnPinHover:g}),f))},g=>{this.catchError("Error in CommentPinComponent getBubbleOnPinHover subscription: ",g)})),this.subscriptions.push(this.commentService.getPopoverTriangleComponent$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{popoverTriangleComponent:g}),f))},g=>{this.catchError("Error in CommentPinComponent getPopoverTriangleComponent$ subscription: ",g)})),this.subscriptions.push(this.commentService.getPinShadowDOM$().subscribe(g=>{this.pinShadowDOM=g},g=>{this.catchError("Error in CommentPinComponent getPinShadowDOM$ subscription: ",g)})),this.subscriptions.push(this.commentService.getPinDarkMode$().subscribe(g=>{g!==null&&(g?this.elementRef.nativeElement.setAttribute("dark",""):this.elementRef.nativeElement.removeAttribute("dark"))},g=>{this.catchError("Error in CommentPinComponent pinDarkMode$ subscription: ",g)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{popoverMode:g}),f))},g=>{this.catchError("Error in CommentPinComponent getPopoverMode subscription: ",g)})),this.subscriptions.push(this.commentService.getDeviceIndicatorOnCommentPins$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{isDeviceIndicatorOnCommentPinsEnabled:g}),f))},g=>{this.catchError("Error in CommentPinComponent getDeviceIndicatorOnCommentPins subscription: ",g)})),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{unreadCommentsMap:g}),f))})),this.subscriptions.push(this.commentService.getCustomStatusesShown$().subscribe(g=>{this.componentConfigSignal.update(f=>(f=D(E({},f),{customStatusesShown:g}),f))}))}ngOnInit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit(),this.setupA11yAttributes(),!this.template){let e="velt-comment-pin-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.catchError("Error in CommentsToolComponent OnInit: ",e)}}getChildTemplate(){try{if(!this.ghostCommentIndicatorTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-ghost-comment-indicator-wireframe");We(e)||(this.ghostCommentIndicatorTemplate=e)}if(!this.indexTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-index-wireframe");We(e)||(this.indexTemplate=e)}if(!this.numberTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-number-wireframe");We(e)||(this.numberTemplate=e)}if(!this.privateCommentIndicatorTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-private-comment-indicator-wireframe");We(e)||(this.privateCommentIndicatorTemplate=e)}if(!this.triangleTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-triangle-wireframe");We(e)||(this.triangleTemplate=e)}if(!this.unreadCommentIndicatorTemplate&&this.template){let e=this.template.querySelector("velt-comment-pin-unread-comment-indicator-wireframe");We(e)||(this.unreadCommentIndicatorTemplate=e)}}catch(e){this.loggingService.catch("Error in CommentPinComponent getChildTemplate: ",e)}}ngAfterViewInit(){try{this.subscriptions.push(this.commentPinPortalService.getCommentPinTemplate$().subscribe(e=>{if(e!==null){let t=e?.cloneNode(!0);if(t.setAttribute("slot","comment-pin"),this.pinRef!==void 0){this.pinRef.nativeElement.appendChild(t);let r=f_(this.componentConfigSignal().annotation);this.injectAttributeData(t,r),this.usingCustomCommentPin=!0,this.commentPinPortalService.emitCustomPinEvent({annotation:this.componentConfigSignal().annotation,element:t}),this.pinRef.nativeElement.childNodes.forEach(a=>{a?.tagName?.toLowerCase()===U.TAGS.SNIPPYLY_USER_AVATAR&&a.remove()})}}else this.usingCustomCommentPin=!1})),this.subscriptions.push(this.commentService.getBubbleCommentAnnotationIds$().subscribe(e=>{if(e.includes(this.componentConfigSignal().annotation?.annotationId)){this.commentBubbleElement=this.commentService.getCommentBubbleElement(this.componentConfigSignal().annotation);let t=this.commentBubbleElement?.getAttribute(U.ATTRIBUTES.VELT_ANNOTATION_ID)||"";this.componentConfigSignal().commentBubbleElementAnnotationId!==t&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{commentBubbleElementAnnotationId:t}),r)),this.commentBubbleAvailable=!0)}else this.commentBubbleAvailable&&(this.commentBubbleElement=null,this.componentConfigSignal.update(t=>(t=D(E({},t),{commentBubbleElementAnnotationId:""}),t)),this.commentBubbleAvailable=!1)},e=>{this.catchError("Error in CommentPinComponent getBubbleCommentAnnotationIds$ subscription: ",e)}))}catch(e){this.catchError("Error in CommentPinComponent AfterViewInit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{if(e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))}),e?.annotation){if(this.commentService.customPinsById.has(this.componentConfigSignal().annotation.annotationId)){let r=this.commentService.getCustomPinById(this.componentConfigSignal().annotation.annotationId);if(r!==void 0){let a=f_(this.componentConfigSignal().annotation);this.injectAttributeData(r,a)}}this.setUserInitial(),this.componentConfigSignal.update(r=>(r=D(E({},r),{isPrivateComment:this.componentConfigSignal().annotation?.iam?.accessMode===ho.PRIVATE,isGhostComment:!!this.componentConfigSignal().annotation?.ghostComment}),r)),this.checkIfCommentAddedOnDifferentDeviceType();let t=JSON.parse(JSON.stringify(this.commentPinPosition||{}));this.commentPinPosition={top:this.componentConfigSignal().annotation?.position?.top||0,left:this.componentConfigSignal().annotation?.position?.left||0}}}catch(t){this.catchError("Error in CommentPinComponent ngOnChanges: ",t)}}detectCommentPinOutsideViewport(){try{this.loggingService.log("%c[WB] Calling FUNCTION: detectCommentPinOutsideViewport","color: green;");let e=this.pinRef?.nativeElement;if(e){let t=e?.getBoundingClientRect(),r=Math.max(document?.documentElement?.clientWidth||0,window?.innerWidth||0);if(t?.right>r){let a=r-t.left;a>0?(this.pinMaxWidth=`${a}px`,this.isOutsideViewport=!0):(this.isOutsideViewport=!1,this.pinMaxWidth="")}else this.isOutsideViewport=!1,this.pinMaxWidth=""}else this.isOutsideViewport=!1}catch(e){this.catchError("Error in CommentPinComponent detectCommentPinOutsideViewport: ",e)}}checkIfCommentAddedOnDifferentDeviceType(){try{this.componentConfigSignal().annotation?.pageInfo?.deviceInfo?.deviceType!==this.deviceInfo.deviceType?(this.componentConfigSignal.update(e=>(e=D(E({},e),{isCommentAddedOnDifferentDeviceType:!0}),e)),this.COMMENT_PIN_SIZE=34):(this.componentConfigSignal.update(e=>(e=D(E({},e),{isCommentAddedOnDifferentDeviceType:!1}),e)),this.COMMENT_PIN_SIZE=40)}catch(e){this.catchError("Error in CommentPinComponent checkIfCommentAddedOnDifferentDeviceType: ",e)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().annotation?.annotationId),this.commentDialogPortalRef?.updateOverlayPosition()}catch(e){this.catchError("Error in CommentPinComponent updateOverlayPosition: ",e)}}onPointerUpOnDialog(){try{this.componentConfigSignal().commentPinSelected||this.togglePinSelection.emit()}catch(e){this.catchError("Error in CommentPinComponent onPointerUpOnDialog: ",e)}}onPinBubblePointerUp(e){try{(!this.componentConfigSignal().commentPinSelected||e)&&this.togglePinSelection.emit(e)}catch(t){this.catchError("Error in CommentPinComponent onPointerUpOnDialog: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in CommentPinComponent 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 CommentPinComponent unsubscribe: ",e)}}setUserInitial(){try{this.userInitial=this.componentConfigSignal().annotation?.from?.initial||(this.componentConfigSignal().annotation?.from?.name?this.componentConfigSignal().annotation.from.name?.charAt(0).toUpperCase():this.componentConfigSignal().annotation?.from?.email?.charAt(0).toUpperCase()||"")}catch(e){this.catchError("Error in CommentPinComponent setUserInitial: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(we),h(Ve),h(_),h(G1),h(Ge),h(R),h(S))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-pin"]],viewQuery:function(t,r){if(t&1&&(it(Qtn,5),it(Jtn,5)),t&2){let a;et(a=tt())&&(r.pinRef=a.first),et(a=tt())&&(r.commentDialogPortalRef=a.first)}},hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{annotation:"annotation",commentPinSelected:"commentPinSelected",annotationDragging:"annotationDragging",commentPinType:"commentPinType",multipleCommentPinsSelected:"multipleCommentPinsSelected",avatarErrorImage:"avatarErrorImage",user:"user",variant:"variant",containerComponentId:"containerComponentId",targetElement:"targetElement"},outputs:{saveComment:"saveComment",commentTargetElementClicked:"commentTargetElementClicked",togglePinSelection:"togglePinSelection"},standalone:!1,features:[V([S]),L,Qe],ngContentSelectors:enn,decls:1,vars:1,consts:[["commentPinContainerRef",""],["commentDialogPortalRef",""],["trigger","cdkOverlayOrigin"],["normalPinRef",""],["defaultPinRef",""],["pinRef",""],["userAvatarRef",""],["readCommentIndicatorsRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[3,"saveComment","togglePinSelection","pointerUp","annotation","user","commentPinSelected","annotationDragging","commentPinType","targetElement","bubbleOnPin","bubbleOnPinHover","containerComponentId"],["id","comment-pin-block","cdkOverlayOrigin","",1,"velt-comment-pin"],[3,"click"],[3,"componentConfigSignal","template"],[4,"veltDynamicTemplate"],[1,"velt-comment-pin--marker",3,"click","ngClass"],[3,"ngSwitch"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngSwitchCase"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.0357 1.5H5.96429C5.29365 1.5 4.75 2.17157 4.75 3V15C4.75 15.8284 5.29365 16.5 5.96429 16.5H12.0357C12.7063 16.5 13.25 15.8284 13.25 15V3C13.25 2.17157 12.7063 1.5 12.0357 1.5Z","stroke","white","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["d","M9 13.5H9.0075","stroke","white","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.75 1.5H5.25C4.83579 1.5 4.5 1.83579 4.5 2.25V15.75C4.5 16.1642 4.83579 16.5 5.25 16.5H12.75C13.1642 16.5 13.5 16.1642 13.5 15.75V2.25C13.5 1.83579 13.1642 1.5 12.75 1.5ZM5.25 0C4.00736 0 3 1.00736 3 2.25V15.75C3 16.9926 4.00736 18 5.25 18H12.75C13.9926 18 15 16.9926 15 15.75V2.25C15 1.00736 13.9926 0 12.75 0H5.25Z","fill","white"],["d","M9.75 14.25C9.75 14.6642 9.41421 15 9 15C8.58579 15 8.25 14.6642 8.25 14.25C8.25 13.8358 8.58579 13.5 9 13.5C9.41421 13.5 9.75 13.8358 9.75 14.25Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.75 4.5L3.75 11.25L14.25 11.25L14.25 4.5C14.25 4.08579 13.9142 3.75 13.5 3.75L4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5ZM2.25 12.75L15.75 12.75L15.75 4.5C15.75 3.25736 14.7426 2.25 13.5 2.25L4.5 2.25C3.25736 2.25 2.25 3.25736 2.25 4.5L2.25 12.75Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.25 12.75L2.25 13.5C2.25 13.9142 2.58579 14.25 3 14.25L15 14.25C15.4142 14.25 15.75 13.9142 15.75 13.5L15.75 12.75L2.25 12.75ZM0.75 13.5C0.75 14.7426 1.75736 15.75 3 15.75L15 15.75C16.2426 15.75 17.25 14.7426 17.25 13.5L17.25 12C17.25 11.5858 16.9142 11.25 16.5 11.25L1.5 11.25C1.08579 11.25 0.75 11.5858 0.75 12L0.75 13.5Z","fill","white"],["d","M6.75 13.5H8.25V15H9.75V13.5H11.25V15H12C12.4142 15 12.75 15.3358 12.75 15.75C12.75 16.1642 12.4142 16.5 12 16.5H6C5.58579 16.5 5.25 16.1642 5.25 15.75C5.25 15.3358 5.58579 15 6 15H6.75V13.5Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M3 4.5L3 10.5C3 11.3284 3.67157 12 4.5 12L13.5 12C14.3284 12 15 11.3284 15 10.5L15 4.5C15 3.67157 14.3284 3 13.5 3L4.5 3C3.67157 3 3 3.67157 3 4.5ZM1.5 10.5C1.5 12.1569 2.84315 13.5 4.5 13.5L13.5 13.5C15.1569 13.5 16.5 12.1569 16.5 10.5L16.5 4.5C16.5 2.84315 15.1569 1.5 13.5 1.5L4.5 1.5C2.84315 1.5 1.5 2.84315 1.5 4.5L1.5 10.5Z","fill","white"],[3,"user"]],template:function(t,r){t&1&&(Ht(),u(0,Snn,2,6,"ng-container",8)),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Qr,X,Dt,eo,po,sn,Jn,ie,U_,V_,$_,j_,Sn,W1,se,H1],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}[_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-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);--velt-internal-comment-pin-bg-color: var(--velt-accent)}[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-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-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble{position:absolute;border-radius:100%;text-align:center;top:calc(var(--velt-spacing-sm) * -1);right:calc(var(--velt-spacing-sm) * -1);bottom:unset;left:unset;height:24px;width:24px;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--private-indicator{height:28px;width:28px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);left:unset;bottom:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--ghost-indicator{height:28px;width:28px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);left:unset;bottom:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--unread-indicator{background-color:var(--velt-error);color:var(--velt-error-foreground);height:16px;width:16px;top:calc(var(--velt-spacing-xs) * -1);right:calc(var(--velt-spacing-xs) * -1);left:unset;bottom:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--index-3-digit{border-radius:100%;height:30px;width:30px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);bottom:unset;left:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--indicator-bubble.velt-comment-pin--number-3-digit{border-radius:100%;height:30px;width:30px;top:calc(var(--velt-spacing-md) * -1);right:calc(var(--velt-spacing-md) * -1);bottom:unset;left:unset}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--index{border:1px solid rgb(210,210,210);color:var(--velt-black);background:var(--velt-white)}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--index .comment-annotation-number{border-radius:100%;width:24px;height:24px;font-size:calc((.55rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;position:relative}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--index .comment-annotation-number:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--number{border:1px solid rgb(210,210,210);color:var(--velt-black);background:var(--velt-white)}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--number .comment-annotation-number{border-radius:100%;width:24px;height:24px;font-size:calc((.55rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;position:relative}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--number .comment-annotation-number:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--private-indicator{color:var(--velt-white);background:linear-gradient(0deg,#000000bf 0% 100%),var(--velt-accent);border-radius:100%;border:1px solid rgba(255,255,255,.24);padding:var(--velt-spacing-sm)}.velt-comment-pin[_ngcontent-%COMP%] .velt-comment-pin--ghost-indicator{color:var(--velt-error-foreground);background:var(--velt-error);border-radius:100%;border:1px solid rgba(255,255,255,.24);padding:var(--velt-spacing-sm)}.velt-comment-pin--different-device[_ngcontent-%COMP%] .velt-comment-pin--private-indicator[_ngcontent-%COMP%], .velt-comment-pin--different-device[_ngcontent-%COMP%] .velt-comment-pin--ghost-indicator[_ngcontent-%COMP%]{padding:calc(var(--velt-spacing-md) / 2);width:24px;height:24px;top:calc(var(--velt-spacing-sm) * -1);right:calc(var(--velt-spacing-sm) * -1)}.velt-comment-pin--marker[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;position:relative;width:calc((2.5rem + 0px) * var(--velt-base-rem-unit));height:calc((2.5rem + 0px) * var(--velt-base-rem-unit));border:2px solid var(--velt-border-3);border-radius:100% 100% 100% 2px;box-shadow:0 8px 16px -8px #0f0f0f1a;z-index:1;cursor:pointer;background:var(--velt-internal-comment-pin-bg-color);box-sizing:border-box}.velt-comment-pin--marker.velt-comment-pin--status-default[_ngcontent-%COMP%]{background:var(--velt-accent, var(--velt-internal-comment-pin-bg-color))}.velt-comment-pin--marker.velt-comment-pin--status-ongoing[_ngcontent-%COMP%]{background:var(--velt-warning, var(--velt-internal-comment-pin-bg-color))}.velt-comment-pin--marker.velt-comment-pin--status-terminal[_ngcontent-%COMP%]{background:var(--velt-success, var(--velt-internal-comment-pin-bg-color))}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem;background-color:var(--velt-gray);background-size:cover;border-radius:100%;display:flex;align-items:center;justify-content:center;position:relative}.velt-comment-pin--popover[_ngcontent-%COMP%]{width:0;height:0;border-style:solid;border-width:0 10px 10px 0;border-color:transparent var(--velt-accent) transparent transparent}.velt-comment-pin.velt-comment-pin--different-device[_ngcontent-%COMP%], .velt-comment-pin.velt-comment-pin--different-device[_ngcontent-%COMP%] .velt-comment-pin--marker[_ngcontent-%COMP%]{width:calc((2.125rem + 0px) * var(--velt-base-rem-unit));height:calc((2.125rem + 0px) * var(--velt-base-rem-unit))}.velt-comment-pin.velt-comment-pin--ghost[_ngcontent-%COMP%] .velt-comment-pin--marker-default.velt-comment-pin--marker[_ngcontent-%COMP%]{background:var(--velt-gray)}.velt-comment-pin.velt-comment-pin--ghost[_ngcontent-%COMP%] .velt-comment-pin--popover[_ngcontent-%COMP%]{border-color:transparent var(--velt-gray) transparent transparent}.velt-comment-pin.velt-comment-pin--outside-viewport[_ngcontent-%COMP%]{max-width:var(--velt-internal-comment-pin-max-width);overflow:hidden} .velt-comment-dialog-overlay-panel{z-index:2147483567}.velt-comment-pin--marker-transparent[_ngcontent-%COMP%]{background:transparent;border:unset;border-radius:unset;box-shadow:unset}"],changeDetection:0});let i=o;return i})();function bnn(i,o){if(i&1){let n=K();v(0),y(1,"velt-multi-thread-comment-dialog-internal",6),G("afterViewInit",function(){N(n);let t=l().last,r=l(2);return F(t?r.calculatePosition():null)})("saveComment",function(t){N(n);let r=l().$implicit,a=l(2);return F(a.saveComment(r==null?null:r.annotation,t))}),b(),C()}if(i&2){let n=l().$implicit,e=l().ngIf,t=l();m(),d("multiThreadAnnotationId",n==null||n.annotation==null?null:n.annotation.annotationId)("annotation",n==null?null:n.annotation)("user",e.user)("commentPinSelected",!!e.selectedAnnotationsMap[n==null||n.annotation==null?null:n.annotation.annotationId]),T("data-testid",t.componentId+"-multi-thread-"+(n==null||n.annotation==null?null:n.annotation.annotationId))}}function Inn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-dialog",7),G("afterViewInit",function(){N(n);let t=l().last,r=l(2);return F(t?r.calculatePosition():null)})("saveComment",function(t){N(n);let r=l().$implicit,a=l(2);return F(a.saveComment(r==null?null:r.annotation,t))}),b()}if(i&2){let n=l().$implicit,e=l().ngIf,t=l();d("annotation",n==null?null:n.annotation)("user",e.user)("commentPinSelected",!!e.selectedAnnotationsMap[n==null||n.annotation==null?null:n.annotation.annotationId])("inlineCommentMode",e.inlineCommentMode)("isInsidePdfViewer",n==null?null:n.isInsidePdfViewer),T("data-testid",t.componentId+"-single-thread-"+(n==null||n.annotation==null?null:n.annotation.annotationId))}}function Enn(i,o){if(i&1){let n=K();v(0),y(1,"div",4),G("click",function(){let t=N(n).$implicit,r=l(2);return F(r.togglePinSelection(t==null?null:t.annotation))}),u(2,bnn,2,5,"ng-container",5)(3,Inn,1,6,"ng-template",null,0,Ee),b(),C()}if(i&2){let n=o.$implicit,e=me(4),t=l().ngIf,r=l();m(),at("top",n==null?null:n.top,"px"),pe("selected",t.selectedAnnotationsMap[n==null||n.annotation==null?null:n.annotation.annotationId]),d("id","snippyly-comments-on-right-block-"+(n==null||n.annotation==null?null:n.annotation.annotationId)),T("data-testid",r.componentId+"-block-"+(n==null||n.annotation==null?null:n.annotation.annotationId))("role","region")("tabindex",0),m(),d("ngIf",(n==null||n.annotation==null?null:n.annotation.type)==="multiThread")("ngIfElse",e)}}function xnn(i,o){if(i&1&&(v(0),y(1,"div",2),P(2,"translate"),u(3,Enn,5,10,"ng-container",3),b(),C()),i&2){let n=o.ngIf,e=l();m(),T("data-testid",e.componentId)("role","complementary")("aria-label",M(2,5,"Comments panel")),m(2),d("ngForOf",n.commentPinAnnotationsArray)("ngForTrackBy",e.trackById)}}var nye=(()=>{let o=class o{constructor(e,t,r,a,s){this.authService=e,this.commentService=t,this.domService=r,this.elementRef=a,this.loggingService=s,this.commentPinAnnotations=[],this.subscriptions=[],this.positionChangeDetectionSubscriptions=[],this.componentConfigSignal=Te({commentPinAnnotationsArray:[],selectedAnnotationsMap:{},user:void 0,inlineCommentMode:!1}),this.veltElement=!0,this.componentId="velt-comments-stream-view",this.subscriptions.push(this.authService.getUser$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=D(E({},p),{user:c}),p))},c=>{this.loggingService.catch("Error in CommentsStreamViewComponent getUser$ subscription: ",c)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=D(E({},p),{selectedAnnotationsMap:c}),p)),setTimeout(()=>{this.calculatePosition(),Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length===1&&this.goToAnnotation(this.componentConfigSignal().selectedAnnotationsMap[Object.keys(this.componentConfigSignal().selectedAnnotationsMap)[0]])},100)},c=>{this.loggingService.catch("Error in CommentsStreamViewComponent getSelectedAnnotationsMap$ subscription: ",c)})),this.subscriptions.push(this.commentService.getInlineCommentMode$().subscribe(c=>{this.componentConfigSignal.update(p=>(p=D(E({},p),{inlineCommentMode:c}),p))}))}ngOnInit(){this.setupA11yAttributes()}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsStreamViewComponent setupA11yAttributes:",e)}}ngAfterViewInit(){this.streamViewContainerId&&(this.scrollableParentElement=document.getElementById(this.streamViewContainerId)),this.scrollableParentElement||(this.scrollableParentElement=iC(this.elementRef.nativeElement)),this.scrollableParentElement||(this.scrollableParentElement=document.documentElement),this.calculateTargetElementPositions()}ngOnChanges(e){try{e.commentPinAnnotations&&this.calculateTargetElementPositions()}catch(t){this.loggingService.catch("Error in CommentsStreamViewComponent ngOnChanges: ",t)}}goToAnnotation(e){let t=null;e.targetElement||e.areaAnnotationId?t=document.getElementById(`comment-pin-container-${e.annotationId}`):t=document.querySelector(`[data-velt-id='${e.annotationId}']`),t&&t.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}togglePinSelection(e){try{this.componentConfigSignal().selectedAnnotationsMap[e.annotationId]||(this.goToAnnotation(e),this.domService.toggleAnnotationSelection(e))}catch(t){this.loggingService.catch("Error in CommentsStreamViewComponent togglePinSelection: ",t)}}saveComment(e,t){try{this.commentService.saveComment(e,t)}catch(r){this.loggingService.catch("Error in CommentsStreamViewComponent saveComment: ",r)}}calculateTargetElementPositions(){try{this.positionChangeDetectionSubscriptions.forEach(t=>{t.unsubscribe()});let e=[];if(this.commentPinAnnotations.forEach(t=>{let r={},a=null;t.targetElement||t.areaAnnotationId?a=document.getElementById(`comment-pin-container-${t.annotationId}`):a=document.querySelector(`[data-velt-id='${t.annotationId}']`),a&&(r.annotation=t,r.targetElement=a,r.targetOffsetTop=uz(a,this.scrollableParentElement)?.top||0,r.isInsidePdfViewer=sC(a,U.ATTRIBUTES.VELT_PDF_VIEWER),e.push(r))}),e.sort((t,r)=>t.targetElement.getBoundingClientRect().top-r.targetElement.getBoundingClientRect().top),this.componentConfigSignal.update(t=>(t=D(E({},t),{commentPinAnnotationsArray:e}),t)),this.componentConfigSignal().commentPinAnnotationsArray?.length){let t=this.componentConfigSignal().commentPinAnnotationsArray[this.componentConfigSignal().commentPinAnnotationsArray.length-1]?.targetElement;this.detectPositionChange(t)}this.calculatePosition()}catch(e){this.loggingService.catch("Error in CommentsStreamViewComponent calculateTargetElementPositions: ",e)}}trackById(e,t){return t.annotation.annotationId}calculatePosition(){try{if(Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length===1){let e=Object.keys(this.componentConfigSignal().selectedAnnotationsMap)[0],t=this.componentConfigSignal().commentPinAnnotationsArray.findIndex(s=>s.annotation.annotationId===e),r=this.componentConfigSignal().commentPinAnnotationsArray.slice(0,t+1).reverse(),a=this.componentConfigSignal().commentPinAnnotationsArray.slice(t);this.calculateDialogPosition(r,!0),this.calculateDialogPosition(a),r.shift(),this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinAnnotationsArray:[...r.reverse().slice(),...a.slice()]}),s))}else this.calculateDialogPosition(this.componentConfigSignal().commentPinAnnotationsArray)}catch(e){this.loggingService.catch("Error in CommentsStreamViewComponent calculatePosition: ",e)}}calculateDialogPosition(e,t=!1){try{e.forEach((r,a,s)=>{if(!r.dialogElement){let c=this.elementRef?.nativeElement?.querySelector(`[id="snippyly-comments-on-right-block-${r.annotation.annotationId}"]`);c&&(r.dialogElement=c,r.dialogOffsetTop=uz(c,this.scrollableParentElement)?.top||0)}if(!a)r.top=r.targetOffsetTop;else if(t){let c=s[a-1];if(r.dialogElement){let p=c.top-r.dialogElement?.getBoundingClientRect()?.height-24,g=r.targetOffsetTop;p<r.top?r.top=p:g&&(g<=p?r.top=g:r.top=p)}}else{let c=s[a-1];if(c.dialogElement){let p=c.top+c.dialogElement?.getBoundingClientRect()?.height+24,g=r.targetOffsetTop;p>r.dialogOffsetTop&&p>g?r.top=p:g&&(g>=p?r.top=g:r.top=p)}}})}catch(r){this.loggingService.catch("Error in CommentsStreamViewComponent calculateDialogPosition: ",r)}}detectPositionChange(e){try{let t=Wm(0,zm).pipe(de(()=>{let r=e.getBoundingClientRect();return{top:r.top,left:r.left}}),Ct((r,a)=>r.top===a.top&&r.left===a.left),Mi());this.positionChangeDetectionSubscriptions.push(t.subscribe(()=>{this.calculateTargetElementPositions()},r=>{}))}catch(t){this.loggingService.catch("Error in CommentsStreamViewComponent detectPositionChange: ",t)}}ngOnDestroy(){try{this.subscriptions.forEach(e=>{e.unsubscribe()})}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(je),h(we),h(Ve),h(R),h(_))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comments-stream-view"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{commentPinAnnotations:"commentPinAnnotations",streamViewContainerId:"streamViewContainerId"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[["commentDialogRef",""],[4,"ngIf"],["velt-ignore-change-detection","true",1,"snippyly-comments-on-right-container"],[4,"ngFor","ngForOf","ngForTrackBy"],["velt-ignore-change-detection","true",1,"snippyly-comments-on-right-block",3,"click","id"],[4,"ngIf","ngIfElse"],[3,"afterViewInit","saveComment","multiThreadAnnotationId","annotation","user","commentPinSelected"],[3,"afterViewInit","saveComment","annotation","user","commentPinSelected","inlineCommentMode","isInsidePdfViewer"]],template:function(t,r){t&1&&u(0,xnn,4,7,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,ar,Rs,ge],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}.snippyly-comments-on-right-container[_ngcontent-%COMP%]{position:absolute;top:0;right:10vw;width:300px;background:#90ee90}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block[_ngcontent-%COMP%]{position:absolute;box-shadow:none;transition:top .5s ease,left .5s ease,box-shadow .5s ease;left:0}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block.selected[_ngcontent-%COMP%]{left:-36px;z-index:1}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block .comment-dialog-container{transition:box-shadow .5s ease;box-shadow:none!important}.snippyly-comments-on-right-container[_ngcontent-%COMP%] .snippyly-comments-on-right-block.selected .comment-dialog-container{box-shadow:0 calc((1rem + 0px) * var(--velt-base-rem-unit)) calc((3rem + 0px) * var(--velt-base-rem-unit)) #0000002d!important}"],changeDetection:0});let i=o;return i})();var Dnn=()=>["snippyly-inbox-panel","velt-overlay-panel"];function wnn(i,o){i&1&&He(0)}function Onn(i,o){if(i&1&&u(0,wnn,1,0,"ng-container",7),i&2){l();let n=me(6);d("ngTemplateOutlet",n)}}function Ann(i,o){if(i&1){let n=K();y(0,"velt-multi-thread-comment-dialog-internal",11),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment(t))}),b()}if(i&2){let n=l(3).ngIf,e=l();d("multiThreadAnnotationId",n.commentAnnotation==null?null:n.commentAnnotation.annotationId)("annotation",n.commentAnnotation)("user",n.user)("commentPinSelected",!0)("inboxMode",!0),T("data-testid",e.componentId+"-multi-thread-dialog")("role","dialog")("aria-label",M(1,8,"Multi-thread comment dialog"))}}function Pnn(i,o){if(i&1&&(v(0),u(1,Ann,2,10,"velt-multi-thread-comment-dialog-internal",10),C()),i&2){let n=l(2).ngIf;m(),d("ngIf",n.commentAnnotation&&n.user)}}function Mnn(i,o){if(i&1){let n=K();y(0,"snippyly-comment-dialog",13),P(1,"translate"),G("saveComment",function(t){N(n);let r=l(4);return F(r.saveComment(t))}),b()}if(i&2){let n=l(3).ngIf,e=l();d("annotation",n.commentAnnotation)("user",n.user)("commentPinSelected",!0)("inboxMode",!0),T("data-testid",e.componentId+"-single-dialog")("role","dialog")("aria-label",M(1,7,"Single comment dialog"))}}function knn(i,o){if(i&1&&u(0,Mnn,2,9,"snippyly-comment-dialog",12),i&2){let n=l(2).ngIf;d("ngIf",n.commentAnnotation&&n.user)}}function Rnn(i,o){if(i&1&&(y(0,"div",8),P(1,"translate"),u(2,Pnn,2,1,"ng-container",9)(3,knn,1,1,"ng-template",null,3,Ee),b()),i&2){let n=me(4),e=l().ngIf,t=l();pe("mobile",e.isPhone)("visible",!!e.commentAnnotation),T("data-testid",t.componentId)("role","region")("aria-label",M(1,10,"Comment inbox container"))("aria-expanded",!!e.commentAnnotation),m(2),d("ngIf",(e==null||e.commentAnnotation==null?null:e.commentAnnotation.type)==="multiThread")("ngIfElse",n)}}function Nnn(i,o){if(i&1&&(v(0),w(1,"div",5,0),u(3,Onn,1,1,"ng-template",6,1,Ee)(5,Rnn,5,12,"ng-template",null,2,Ee),C()),i&2){let n=me(2),e=l();m(),T("data-testid",e.componentId+"-trigger")("aria-hidden",!0),m(2),d("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",!0)("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",gt(6,Dnn))}}var iye=(()=>{let o=class o extends nt{constructor(e,t,r,a,s,c){super(s,c),this.authService=e,this.breakpointObserver=t,this.commentService=r,this.loggingService=a,this.elementRef=s,this.themeService=c,this.componentConfigSignal=Te({isPhone:!1,sidebarVisible:!1}),this.subscriptions=[],this.componentId="velt-comment-inbox";try{this.subscriptions.push(this.breakpointObserver.observe(zi.XSmall).subscribe(p=>{p.matches?this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!0}),g)):this.componentConfigSignal.update(g=>(g=D(E({},g),{isPhone:!1}),g))},p=>{this.catchError("Error in CommentInboxComponent breakpointObserver subscription: ",p)}))}catch{}}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t))},e=>{this.catchError("Error in CommentInboxComponent getUser$ subscription: ",e)}))}catch(e){this.catchError("Error in CommentInboxComponent ngOnInit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentInboxComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e.commentAnnotation&&this.componentConfigSignal.update(t=>(t=D(E({},t),{commentAnnotation:e.commentAnnotation.currentValue}),t))}catch(t){this.catchError("Error in CommentInboxComponent ngOnChanges: ",t)}}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),super.ngOnDestroy()}saveComment(e){try{(this.commentAnnotation||e.annotation)&&this.commentService.saveComment(this.commentAnnotation||e.annotation,e)}catch(t){this.catchError("Error in CommentInboxComponent saveComment: ",t)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(E({},r||{}),{annotationId:this.componentConfigSignal()?.commentAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(je),h(Oo),h(we),h(_),h(R),h(Ke))},o.\u0275cmp=O({type:o,selectors:[["snippyly-comment-inbox"]],inputs:{commentAnnotation:"commentAnnotation"},standalone:!1,features:[L,Qe],decls:1,vars:1,consts:[["sidebarTrigger","cdkOverlayOrigin"],["sidebarOverlay","cdkConnectedOverlay"],["sidebarRef",""],["commentDialogRef",""],[4,"ngIf"],["cdkOverlayOrigin",""],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass"],[4,"ngTemplateOutlet"],["id","sCommentInboxContainer","data-velt-comment-disabled","true",1,"velt-comment-inbox--container","s-inbox-container"],[4,"ngIf","ngIfElse"],[3,"multiThreadAnnotationId","annotation","user","commentPinSelected","inboxMode","saveComment",4,"ngIf"],[3,"saveComment","multiThreadAnnotationId","annotation","user","commentPinSelected","inboxMode"],[3,"annotation","user","commentPinSelected","inboxMode","saveComment",4,"ngIf"],[3,"saveComment","annotation","user","commentPinSelected","inboxMode"]],template:function(t,r){t&1&&u(0,Nnn,7,7,"ng-container",4),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,dn,sn,ar,Rs,ge],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}[_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-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-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)}*[_ngcontent-%COMP%]{box-sizing:border-box} .snippyly-inbox-panel{top:0!important;left:0!important}.s-overflow-hidden[_ngcontent-%COMP%]{overflow:hidden!important} .velt-comment-inbox--container{height:100vh;width:calc((26rem + 0px) * var(--velt-base-rem-unit));position:fixed;top:0;right:-100%;padding:var(--velt-spacing-lg);box-sizing:border-box;z-index:999999997;transition:width .5s ease-in-out,right .5s ease-in-out} .velt-comment-inbox--container.mobile{width:100%;height:100%;box-sizing:border-box;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)} .velt-comment-inbox--container.visible{right:0}"],changeDetection:0});let i=o;return i})();function Lnn(i,o){if(i&1){let n=K();v(0),y(1,"div",3),G("click",function(){let t=N(n).$implicit,r=l(2);return F(r.scrollToAnnotation(t==null?null:t.key))}),y(2,"div",4),te(3),P(4,"translate"),b()(),C()}if(i&2){let n=o.$implicit,e=l().ngIf,t=l();m(),at("top",n.value.top,"%")("transform","translate(0, -"+n.value.top+"%)"),pe("v-unread-comment",!(e.user!=null&&e.user.isGuest)&&!(e.user!=null&&e.user.isAnonymous)&&(e.unreadCommentsMap==null?null:e.unreadCommentsMap[n==null||n.value==null||n.value.annotation==null?null:n.value.annotation.annotationId])),T("data-testid",t.componentId+"-pin-"+n.key)("role","button")("tabindex",0),m(),T("role","tooltip")("aria-hidden","true"),m(),Se(" ",M(4,12,"Go to comments here.")," ")}}function Bnn(i,o){if(i&1&&(v(0),y(1,"div",1),P(2,"translate"),u(3,Lnn,5,14,"ng-container",2),P(4,"keyvalue"),b(),C()),i&2){let n=o.ngIf,e=l();m(),pe("velt-comments-minimap-container--target-scrollable-element",!!n.targetScrollableElementId)("velt-comments-minimap-position--left",n.position==="left"),T("data-testid",e.componentId)("role","navigation")("aria-label",M(2,9,"Comments minimap")),m(2),d("ngForOf",M(4,11,n.commentAnnotationPositionMap))("ngForTrackBy",e.trackByAnnotationId)}}var l8=(()=>{let o=class o{constructor(e,t,r){this.commentService=e,this.loggingService=t,this.elementRef=r,this.commentAnnotations=[],this.targetScrollableElementId=null,this.position="right",this.commentCountsByPosition={},this.minimapHeatmapGradient="",this.componentConfigSignal=Te({targetScrollableElementId:null,position:"right",commentAnnotationPositionMap:{},user:null,unreadCommentsMap:null}),this.subscriptions=[],this.componentId="velt-comments-minimap",this.loggingService.log("%c[WB] Creating CLASS: CommentsMinimapComponent","color: blue;")}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{unreadCommentsMap:e}),t))}))}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent ngOnInit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))}),e?.commentAnnotations&&setTimeout(()=>{this.setCommentAnnotationPositionMap()},200)}catch(t){this.loggingService.catch("Error in CommentsMinimapComponent ngOnChanges: ",t)}}trackByAnnotationId(e,t){return t?.annotation?.annotationId||e}setCommentAnnotationPositionMap(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{commentAnnotationPositionMap:{}}),e)),this.commentAnnotations.forEach(e=>{let t=null;if(e.targetElement||e.areaAnnotationId?t=document.getElementById(`comment-pin-container-${e.annotationId}`):t=document.querySelector(`[data-velt-id='${e.annotationId}']`),t){let r=this.getElementPosition(t)?.percentageOfTotalHeight;r!=null&&this.componentConfigSignal.update(a=>(a=D(E({},a),{commentAnnotationPositionMap:D(E({},a.commentAnnotationPositionMap),{[e.annotationId]:{annotation:e,top:r,element:t}})}),a))}})}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent setCommentAnnotationPositionByCommentAnnotationIndex: ",e)}}scrollToAnnotation(e){try{let t=this.componentConfigSignal().commentAnnotationPositionMap[e];t&&t.element&&t.element.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}catch(t){this.loggingService.catch("Error in CommentsMinimapComponent scrollToAnnotation: ",t)}}getElementPosition(e){try{let t=0,r=e,a=this.componentConfigSignal().targetScrollableElementId&&document.getElementById(this.componentConfigSignal().targetScrollableElementId);for(;r&&(t+=r.offsetTop||0,r=r.offsetParent,!(a&&r===a)););let s=0;if(a)s=a.scrollHeight;else{let p=document.body,g=document.documentElement;s=Math.max(p.scrollHeight,p.offsetHeight,g.clientHeight,g.scrollHeight,g.offsetHeight)}let c=t/s*100;return{pixelsFromTop:t,percentageOfTotalHeight:c}}catch(t){return this.loggingService.catch("Error in CommentsMinimapComponent getElementPosition: ",t),null}}ngOnDestroy(){try{this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in CommentsMinimapComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(we),h(_),h(R))},o.\u0275cmp=O({type:o,selectors:[["app-comments-minimap"]],inputs:{commentAnnotations:"commentAnnotations",user:"user",targetScrollableElementId:"targetScrollableElementId",position:"position"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[[4,"ngIf"],[1,"v-comments-minimap-container"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"v-comment-minimap-pin",3,"click"],[1,"v-comment-count"]],template:function(t,r){t&1&&u(0,Bnn,5,13,"ng-container",0),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,cp,ge],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}[_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-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)}.v-comments-minimap-container[_ngcontent-%COMP%]{display:block;position:fixed;height:100vh;top:0;right:0;background:#00000014;z-index:var(--velt-comments-minimap-z-index)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%]{position:absolute;right:0;width:12px;height:4px;flex-shrink:0;border-radius:var(--velt-border-radius-2xs);border:1px solid rgba(255,255,255,.16);background:color-mix(in srgb,var(--velt-accent) 80%,transparent);cursor:pointer}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]{position:absolute;top:50%;right:20px;z-index:1000;min-width:max-content;background:color-mix(in srgb,var(--velt-accent) 80%,transparent);font-size:var(--velt-font-size-xs);padding:var(--velt-spacing-xs) var(--velt-spacing-sm);border-radius:var(--velt-border-radius-xs);transform:translateY(-50%);color:var(--velt-accent-foreground);display:none}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]:after{content:"";position:absolute;border-style:solid;border-width:4px 0 4px 4px;border-color:transparent color-mix(in srgb,var(--velt-accent) 80%,transparent);display:block;width:0;z-index:1;right:calc(var(--velt-spacing-xs) * -1);top:50%;transform:translateY(-50%)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%]:hover .v-comment-count[_ngcontent-%COMP%]{display:block}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin.v-unread-comment[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--velt-error) 80%,transparent)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin.v-unread-comment[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--velt-error) 80%,transparent)}.v-comments-minimap-container[_ngcontent-%COMP%] .v-comment-minimap-pin.v-unread-comment[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]:after{border-color:transparent color-mix(in srgb,var(--velt-error) 80%,transparent)}.v-comments-minimap-container.velt-comments-minimap-container--target-scrollable-element[_ngcontent-%COMP%]{position:absolute;height:100%}.v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%], .v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%]{right:auto;left:0}.v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]{right:auto;left:20px}.v-comments-minimap-container.velt-comments-minimap-position--left[_ngcontent-%COMP%] .v-comment-minimap-pin[_ngcontent-%COMP%] .v-comment-count[_ngcontent-%COMP%]:after{right:auto;left:calc(var(--velt-spacing-xs) * -1);border-width:4px 4px 4px 0}'],changeDetection:0});let i=o;return i})();function Vnn(i,o){i&1&&He(0)}function Unn(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,Vnn,1,0,"ng-container",6),b()),i&2){l();let n=me(3);m(),d("ngTemplateOutlet",n)}}function jnn(i,o){if(i&1&&(w(0,"snippyly-comments-stream-view",10),P(1,"translate")),i&2){let n=l(3).ngIf,e=l();d("commentPinAnnotations",n.commentPinAnnotationsForStreamView)("streamViewContainerId",e.streamViewContainerId),T("data-testid",e.componentId+"-stream")("role","complementary")("aria-label",M(1,5,"Comments stream view"))}}function $nn(i,o){if(i&1&&(w(0,"snippyly-comment-inbox",11),P(1,"translate")),i&2){let n=l(3).ngIf,e=l();d("darkMode",n.darkMode)("commentAnnotation",n.selectedCommentAnnotation),T("data-testid",e.componentId+"-inbox")("role","complementary")("aria-label",M(1,5,"Comments inbox"))}}function Hnn(i,o){if(i&1&&(w(0,"app-comments-minimap",12),P(1,"translate")),i&2){let n=l(3).ngIf,e=l();d("commentAnnotations",n.commentPinAnnotations)("user",n.user)("position",n.minimapPosition),T("data-testid",e.componentId+"-minimap")("role","complementary")("aria-label",M(1,6,"Comments location overview"))}}function znn(i,o){if(i&1&&(w(0,"snippyly-comment-adder"),u(1,jnn,2,7,"snippyly-comments-stream-view",7)(2,$nn,2,7,"snippyly-comment-inbox",8)(3,Hnn,2,8,"app-comments-minimap",9)),i&2){let n=l(2).ngIf,e=l();T("data-testid",e.componentId+"-adder"),m(),d("ngIf",n.streamMode&&n.commentsOnDom),m(),d("ngIf",n.inboxMode&&n.commentsOnDom),m(),d("ngIf",n.minimapEnabled&&n.commentsOnDom)}}function Gnn(i,o){if(i&1&&(v(0),u(1,Unn,2,1,"velt-shadow-dom-internal",5)(2,znn,4,4,"ng-template",null,0,Ee),C()),i&2){let n=me(3),e=l().ngIf;m(),d("ngIf",e.shadowDOM)("ngIfElse",n)}}function Wnn(i,o){if(i&1){let n=K();v(0),u(1,Gnn,4,2,"ng-container",1),y(2,"div",2)(3,"slot",3),G("slotchange",function(t){N(n);let r=l();return F(r.handleCommentPinSlotChanged(t))}),b()(),w(4,"app-persistent-comment-mode",4),C()}if(i&2){let n=o.ngIf,e=l();m(),d("ngIf",n.isFirstComponent),m(),T("aria-hidden","true")("data-testid",e.componentId+"-slot-container"),m(2),d("componentConfigSignal",e.componentConfigSignal),T("data-testid",e.componentId+"-persistent-mode")}}var Nq=(()=>{let o=class o{set textMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextComments():this.commentService.disableTextComments()}set popoverMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePopoverMode():this.commentService.disablePopoverMode()}set popoverTriangleComponent(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePopoverTriangleComponent():this.commentService.disablePopoverTriangleComponent()}set forceCloseAllOnEsc(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableForceCloseAllOnEsc():this.commentService.disableForceCloseAllOnEsc()}set collapsedComments(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCollapsedComments():this.commentService.disableCollapsedComments()}set shortUserName(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableShortUserName():this.commentService.disableShortUserName()}catch{}}set readOnly(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableReadOnly():this.commentService.disableReadOnly()}catch{}}set deleteThreadWithFirstComment(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeleteThreadWithFirstComment():this.commentService.disableDeleteThreadWithFirstComment()}catch{}}set resolveStatusAccessAdminOnly(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableResolveStatusAccessAdminOnly():this.commentService.disableResolveStatusAccessAdminOnly()}set svgAsImg(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSvgAsImg():this.commentService.disableSvgAsImg()}catch{}}set commentToNearestAllowedElement(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCommentToNearestAllowedElement():this.commentService.disableCommentToNearestAllowedElement()}catch{}}set floatingCommentDialog(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.disableFloatingComments(!t)}set moderatorMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setModeratorMode(t)}set assignToType(e){try{this.commentService.setAssignToType({type:e})}catch{}}set _streamMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setStreamMode(t)}set atHereLabel(e){e&&this.contactService.setAtHereLabel(e)}set _atHereEnabled(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.contactService.enableAtHere():this.contactService.disableAtHere()}set _deleteReplyConfirmation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeleteReplyConfirmation():this.commentService.disableDeleteReplyConfirmation()}set _expandMentionGroups(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableExpandMentionGroups():this.commentService.disableExpandMentionGroups()}set _showMentionGroupsFirst(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableShowMentionGroupsFirst():this.commentService.disableShowMentionGroupsFirst()}set _linkCallback(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableLinkCallback():this.commentService.disableLinkCallback()}set _showMentionGroupsOnly(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableShowMentionGroupsOnly():this.commentService.disableShowMentionGroupsOnly()}set _fullExpanded(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFullExpanded():this.commentService.disableFullExpanded()}catch{}}set _draftMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDraftMode():this.commentService.disableDraftMode()}catch{}}set atHereDescription(e){e&&this.contactService.setAtHereDescription(e)}set _persistentCommentMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePersistentCommentMode():this.commentService.disablePersistentCommentMode()}set _seenByUsers(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSeenByUsers():this.commentService.disableSeenByUsers()}set signInButton(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableSignInButton(t)}set upgradeButton(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableUpgradeButton(t)}set attachments(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableAttachment(t)}set recordings(e){let t=e;typeof e=="string"&&(t=e?.split(",")?.map(r=>r.trim()),this.commentService.setAllowedRecordings(t))}set reactions(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableReactions():this.commentService.disableReactions()}set deviceInfo(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.showScreenSizeInfo(t)}set commentIndex(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.showCommentIndex(t)}set dialogOnHover(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableDialogOnHover(t)}set dialogOnTargetElementClick(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableDialogOnTargetElementClick(t)}set priority(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnablePriority(t)}set status(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableStatus(t)}set resolveButton(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableResolve(t)}set _inboxMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableInboxMode():this.commentService.disableInboxMode()}set _suggestionMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setSuggestionMode(t)}set _mobileMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setMobileMode(t)}set _inlineCommentMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableInlineCommentMode():this.commentService.disableInlineCommentMode()}set _privateCommentMode(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePrivateCommentMode():this.commentService.disablePrivateCommentMode()}set _minimap(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableMinimap():this.commentService.disableMinimap()}set _minimapPosition(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{minimapPosition:e}),t)),this.commentService.setAnalyticsFeatureConfig({config:{minimapPosition:e}})}catch{}}set _ghostComments(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGhostComments():this.commentService.disableGhostComments()}set _ghostCommentsIndicator(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGhostCommentsMessage():this.commentService.disableGhostCommentsMessage()}set _commentsOnDom(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.showCommentsOnDom():this.commentService.hideCommentsOnDom()}set _resolvedCommentsOnDom(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.showResolvedCommentsOnDom():this.commentService.hideResolvedCommentsOnDom()}set _filterCommentsOnDom(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFilterCommentsOnDom():this.commentService.disableFilterCommentsOnDom()}catch{}}set _bubbleOnPin(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableBubbleOnPin():this.commentService.disableBubbleOnPin()}catch{}}set _bubbleOnPinHover(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableBubbleOnPinHover():this.commentService.disableBubbleOnPinHover()}catch{}}set _multiThreadMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableMultiThread():this.commentService.disableMultiThread()}catch{}}set _multiThread(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableMultiThread():this.commentService.disableMultiThread()}catch{}}set _maxReplyAvatars(e){try{let t=e;typeof e=="string"&&(t=parseInt(e)),this.commentService.setMaxReplyAvatars(t)}catch{}}set _replyAvatars(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableReplyAvatars():this.commentService.disableReplyAvatars()}catch{}}set _groupMultipleMatch(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGroupMatchedComments():this.commentService.disableGroupMatchedComments()}catch{}}set _groupMatchedComments(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableGroupMatchedComments():this.commentService.disableGroupMatchedComments()}catch{}}set _commentTool(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCommentTool():this.commentService.disableCommentTool()}set _sidebarButtonOnCommentDialog(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarButtonOnCommentDialog():this.commentService.disableSidebarButtonOnCommentDialog()}set _deviceIndicatorOnCommentPins(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeviceIndicatorOnCommentPins():this.commentService.disableDeviceIndicatorOnCommentPins()}catch{}}set _scrollToComment(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableScrollToComment():this.commentService.disableScrollToComment()}set _userMentions(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableUserMentions():this.commentService.disableUserMentions()}set _paginatedContactList(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePaginatedContactList():this.commentService.disablePaginatedContactList()}set _deleteOnBackspace(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDeleteOnBackspace():this.commentService.disableDeleteOnBackspace()}catch{}}set _hotkey(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableHotkey():this.commentService.disableHotkey()}catch{}}set _recordingSummary(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableRecordingSummary():this.commentService.disableRecordingSummary()}catch{}}set _recordingTranscription(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.recorderAnnotationService.enableRecordingTranscription():this.recorderAnnotationService.disableRecordingTranscription()}catch{}}set _allowedFileTypes(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedFileTypes(t)}catch{}}set _recordingCountdown(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableRecordingCountdown():this.commentService.disableRecordingCountdown()}catch{}}set _unreadIndicatorMode(e){try{this.commentService.setUnreadIndicatorMode(e)}catch{}}set _enterKeyToSubmit(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableEnterKeyToSubmit():this.commentService.disableEnterKeyToSubmit()}catch{}}set _pinShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePinShadowDOM():this.commentService.disablePinShadowDOM()}catch{}}set _dialogShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableDialogShadowDOM():this.commentService.disableDialogShadowDOM()}catch{}}set _persistentCommentShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{persistentCommentShadowDOM:!!t}),r)),this.commentService.setAnalyticsFeatureConfig({config:{persistentCommentShadowDOM:!!t}})}catch{}}set _shadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{shadowDOM:!!t,persistentCommentShadowDOM:!!t}),r)),this.componentConfigSignal().shadowDOM?(this.commentService.enableDialogShadowDOM(),this.commentService.enablePinShadowDOM(),this.commentService.enableTextCommentToolShadowDOM(),this.commentService.enableTextCommentToolbarShadowDOM()):(this.commentService.disableDialogShadowDOM(),this.commentService.disablePinShadowDOM(),this.commentService.disableTextCommentToolShadowDOM(),this.commentService.disableTextCommentToolbarShadowDOM()),this.commentService.setAnalyticsFeatureConfig({config:{shadowDom:!!t}})}catch{}}set _textCommentToolShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolShadowDOM():this.commentService.disableTextCommentToolShadowDOM()}catch{}}set _pinDarkMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enablePinDarkMode():this.commentService.disablePinDarkMode()}catch{}}set _textCommentToolDarkMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolDarkMode():this.commentService.disableTextCommentToolDarkMode()}catch{}}set _textCommentToolbarDarkMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolbarDarkMode():this.commentService.disableTextCommentToolbarDarkMode()}catch{}}set _textCommentToolbarShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableTextCommentToolbarShadowDOM():this.commentService.disableTextCommentToolbarShadowDOM()}catch{}}set _changeDetectionInCommentMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableChangeDetectionInCommentMode():this.commentService.disableChangeDetectionInCommentMode()}catch{}}set _areaComment(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableAreaComment():this.commentService.disableAreaComment()}catch{}}set _screenshot(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableScreenshot():this.commentService.disableScreenshot()}catch{}}set _pinCursorImage(e){try{this.commentService.setPinCursorImage(e||"")}catch{}}set allowedElementIds(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedElementIds(t)}catch{}}set allowedElementClassNames(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedElementClassNames(t)}catch{}}set allowedElementQuerySelectors(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAllowedElementQuerySelectors(t)}catch{}}set _commentPinHighlighter(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCommentPinHighlighter():this.commentService.disableCommentPinHighlighter()}catch{}}set _customReactions(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setCustomReactions(t)}catch{}}set customStatus(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setCustomStatuses(t)}set customListDataOnAnnotation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.createCustomListDataOnAnnotation(t)}set customListDataOnComment(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.autocompleteService.create(t)}set attachmentDownload(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.enableAttachmentDownload(t)}set attachmentNameInMessage(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableAttachmentNameInMessage():this.commentService.disableAttachmentNameInMessage()}set customPriority(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.customFilterService.setCustomPriorityFilters(t)}set _customAutocompleteSearch(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableCustomAutocompleteSearch():this.commentService.disableCustomAutocompleteSearch()}catch{}}set _autoCompleteScrollConfig(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setAutoCompleteScrollConfig(t)}catch{}}set customCategory(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.customFilterService.setCustomCategories(t)}set composerMode(e){this.commentService.setComposerMode(e)}set autoCategorize(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.commentService.setEnableAutoCategorize(!!t)}catch(t){this.loggingService.catch("Error in CommentsContainerComponent set autoCategorize: ",t)}}set commentplaceholder(e){try{let t=e;this.commentService.setCommentplaceholder(t)}catch(t){this.loggingService.catch("Error in CommentsContainerComponent set autoCategorize: ",t)}}set replyplaceholder(e){try{let t=e;this.commentService.setReplyplaceholder(t)}catch(t){this.loggingService.catch("Error in CommentsContainerComponent set autoCategorize: ",t)}}set isDarkMode(e){this._darkAttribute=e,this.checkDarkMode(),this.commentService.setCommentContainerDarkMode(e===""||e==="true")}constructor(e,t,r,a,s,c,p,g,f,I,x,B,z){this.analyticsService=e,this.authService=t,this.domService=r,this.commentService=a,this.commentPinPortalService=s,this.commentTextPortalService=c,this.customFilterService=p,this.loggingService=g,this.elementRef=f,this.autocompleteService=I,this.contactService=x,this.recorderAnnotationService=B,this.docService=z,this.onCommentAdd=new Me,this.onSignIn=new Me,this.onUpgrade=new Me,this.onCustomPinInject=new Me,this.onCommentUpdate=new Me,this.onCommentAccept=new Me,this.onCommentReject=new Me,this.onSidebarButtonOnCommentDialogClick=new Me,this.onCommentSelectionChange=new Me,this.onCopyLink=new Me,this.subscriptions=[],this.selectedAnnotationsMap={},this.commentAnnotationFocused=!1,this.enableGhostComments=!1,this.resolvedCommentsOnDom=!1,this.scrollToComment=!1,this.componentConfigSignal=Te({addCommentMode:!1,commentPinAnnotations:[],multiThreadCommentPinAnnotations:[],commentPinAnnotationsForStreamView:[],commentsOnDom:!1,inboxMode:!1,isFirstComponent:!0,minimapEnabled:!1,minimapPosition:"right",persistentCommentMode:!1,persistentModeBanner:!1,privateCommentModeEnabled:!1,selectedCommentAnnotation:void 0,shadowDOM:!0,streamMode:!1,user:null,darkMode:!1,disableCommentMode:this.disableCommentMode.bind(this),persistentCommentShadowDOM:!0,assignToType:"dropdown"}),this.veltId=vt(),this.veltElement=!0,this.componentId="velt-comments-container";try{this.loggingService.log("%c[WB] Creating CLASS: CommentsContainerComponent","color: blue;"),this._darkAttribute=this.elementRef.nativeElement.getAttribute("dark");let W=new URL(window.location.href);this.focusCommentAnnotationId=W.searchParams.get(U.URL_PARAMS.COMMENT_ID),this.commentService.setCommentAddedEmitter(this.onCommentAdd)}catch(W){this.loggingService.catch("Error in CommentsContainerComponent constructor: ",W)}}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentsContainerComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsContainerComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in SubtitlesComponent ngOnChanges: ",t)}}ngAfterViewInit(){try{let e=document.querySelector(U.TAGS.SNIPPYLY_COMMENTS),t=document.querySelector(U.TAGS.VELT_COMMENTS);document.querySelector(`${U.TAGS.VELT_COMMENTS}[${U.ATTRIBUTES.VELT_IS_FIRST_COMPONENT}]`)||(t?this.veltId===t?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(a=>(a=D(E({},a),{isFirstComponent:!0}),a)),t?.setAttribute(U.ATTRIBUTES.VELT_IS_FIRST_COMPONENT,"true"),this.initComponent()):this.veltId===e?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(a=>(a=D(E({},a),{isFirstComponent:!0}),a)),e?.setAttribute(U.ATTRIBUTES.VELT_IS_FIRST_COMPONENT,"true"),this.initComponent()))}catch(e){this.loggingService.catch("Error in CommentsContainerComponent AfterViewInit: ",e)}}initComponent(){try{this.commentService.addAreaContainerTag(),this.subscriptions.push(this.authService.getUser$().pipe(Le(e=>!!e)).subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t)),e&&this.setCommentInstalledInAnalytics()},e=>{this.loggingService.catch("Error in getUser: ",e)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{streamMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getStreamMode$ subscription: ",e)})),this.subscriptions.push(this.docService.getDocumentPaths$().subscribe(()=>{this.getAllCommentsOnCurrentDocument()},e=>{this.loggingService.catch("Error in CommentsContainerComponent getDocumentPaths$ subscription: ",e)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{inboxMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getInboxMode$ subscription: ",e)})),this.subscriptions.push(this.commentService.getMinimap$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{minimapEnabled:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getMinimap$ subscription: ",e)})),this.subscriptions.push(this.commentService.addCommentModeChange().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{addCommentMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent addCommentModeChange subscription: ",e)})),this.subscriptions.push(this.commentService.persistentCommentModeChange().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{persistentCommentMode:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent persistentCommentModeChange subscription: ",e)})),this.subscriptions.push(this.commentService.persistentModeBannerChange().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{persistentModeBanner:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent persistentModeBannerChange subscription: ",e)})),this.subscriptions.push(this.commentService.getPrivateCommentMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{privateCommentModeEnabled:e}),t))},e=>{this.loggingService.catch("Error in CommentsContainerComponent getPrivateCommentMode$ subscription: ",e)})),this.subscriptions.push(this.commentService.getScrollToComment$().subscribe(e=>{this.scrollToComment=e},e=>{this.loggingService.catch("Error in CommentsContainerComponent getScrollToComment$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSignInButtonClick$().subscribe(()=>{this.onSignIn.emit()},e=>{this.loggingService.catch("Error in CommentsContainerComponent getSignInButtonClick$ subscription: ",e)})),this.subscriptions.push(this.commentService.getUpgradeButtonClick$().subscribe(()=>{this.onUpgrade.emit()},e=>{this.loggingService.catch("Error in CommentsContainerComponent getUpgradeButtonClick$ subscription: ",e)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(e=>{this.selectedAnnotationsMap=e},e=>{this.loggingService.catch("Error in CommentsContainerComponent getSidebarVisibility$ subscription: ",e)})),this.subscriptions.push(this.commentPinPortalService.getCustomPinEvents$().subscribe(e=>{this.onCustomPinInject.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent getCustomPinEvents$ subscription: ",e)})),this.subscriptions.push(this.commentService.commentUpdated$.subscribe(e=>{this.onCommentUpdate.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent commentUpdated$ subscription: ",e)})),this.subscriptions.push(this.commentService.commentAccepted$.subscribe(e=>{this.onCommentAccept.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent commentAccepted$ subscription: ",e)})),this.subscriptions.push(this.commentService.commentRejected$.subscribe(e=>{this.onCommentReject.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent commentRejected$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSidebarButtonOnCommentDialogClick$().subscribe(e=>{this.onSidebarButtonOnCommentDialogClick.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent getSidebarButtonOnCommentDialogClick$ subscription: ",e)})),this.subscriptions.push(this.commentService.onCommentSelectionChange$().subscribe(e=>{this.onCommentSelectionChange.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent onCommentSelectionChange$ subscription: ",e)})),this.subscriptions.push(this.commentService.getCopyLink$().subscribe(e=>{this.onCopyLink.emit(e)},e=>{this.loggingService.catch("Error in CommentsContainerComponent getCopyLink$ subscription: ",e)})),this.getAllCommentsOnCurrentDocument()}catch(e){this.loggingService.catch("Error in CommentsContainerComponent initComponent: ",e)}}getAllCommentsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentsOnCurrentDocument","color: green;");try{this.subscriptions.push(this.commentService.getCommentsOnDom$().pipe(fe(e=>(this.componentConfigSignal.update(t=>(t=D(E({},t),{commentsOnDom:e}),t)),this.componentConfigSignal().commentsOnDom?mn([this.commentService.getAllCommentAnnotations({detectGhostComments:!0,addFilterCommentsOnDomCheck:!0,analytics:{enabled:!0,properties:{source:"internal",sourceId:"commentsContainer"}}}),this.commentService.getAllMultiThreadCommentAnnotations(void 0,void 0,void 0,!0)]).pipe(de(([t,r])=>[...t||[],...r||[]]),fe(t=>this.commentService.getEnableGhostComments$().pipe(de(r=>(this.enableGhostComments=r,t)))),fe(t=>this.commentService.getCommentsOnDom$().pipe(de(r=>(this.componentConfigSignal.update(a=>(a=D(E({},a),{commentsOnDom:r}),a)),t)))),fe(t=>this.commentService.getResolvedCommentsOnDom$().pipe(de(r=>(this.resolvedCommentsOnDom=r,t)))),fe(t=>this.domService.getSelectedAnnotationsMap$().pipe(de(r=>({filteredAnnotations:t||[],selectedAnnotationsMap:r||{}}))))):le({filteredAnnotations:[],selectedAnnotationsMap:{}})))).subscribe(e=>{try{this.loggingService.log(e),this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinAnnotations:e?.filteredAnnotations}),s)),this.commentService.setCommentAnnotationsFromCommentsContainer(this.componentConfigSignal().commentPinAnnotations);let t;this.componentConfigSignal().commentPinAnnotations.forEach(s=>{this.selectedAnnotationsMap[s?.annotationId]&&(s?.multiThreadAnnotationId||(t=s))}),this.componentConfigSignal.update(s=>(s=D(E({},s),{selectedCommentAnnotation:t}),s));let r=this.componentConfigSignal().commentPinAnnotations.filter(s=>s.targetElement&&s?.position);r=r.filter(s=>{let c=!0;return s?.ghostComment?.type===Tl.DIFFERENT_DEVICE&&!s?.ghostComment?.isSameGroup&&(e.selectedAnnotationsMap[s.annotationId]||(c=!1)),s?.ghostComment&&!this.enableGhostComments&&(c=!1),!this.resolvedCommentsOnDom&&!(this.commentService.getFilterCommentsOnDom()&&this.commentService.getCommentsFromSidebarMap())&&s.status!==void 0&&s.status.type==="terminal"&&(e.selectedAnnotationsMap[s.annotationId]||(c=!1)),c}),this.commentPinPortalService.checkPinsToRemove(r),r.forEach(s=>{this.commentPinPortalService.setCommentPin(s)});let a=this.componentConfigSignal().commentPinAnnotations.filter(s=>s.targetTextRange);a=a.filter(s=>!(!this.resolvedCommentsOnDom&&!(this.commentService.getFilterCommentsOnDom()&&this.commentService.getCommentsFromSidebarMap())&&s.status!==void 0&&s.status.type==="terminal"&&!e.selectedAnnotationsMap[s.annotationId])),this.commentTextPortalService.updateTextCommentAnnotations(a),this.componentConfigSignal.update(s=>(s=D(E({},s),{commentPinAnnotationsForStreamView:this.componentConfigSignal().commentPinAnnotations.slice()}),s)),this.focusCommentAnnotation()}catch(t){this.loggingService.catch("Error in CommentsContainerComponent getAllCommentsOnCurrentDocument inside subscription: ",t)}},e=>{this.loggingService.catch("Error in CommentsContainerComponent getAllCommentsOnCurrentDocument subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CommentsContainerComponent getAllCommentsOnCurrentDocument: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),this.commentService.setContextProvider(null),this.commentService.setCommentAddedEmitter(null),this.componentConfigSignal().isFirstComponent&&this.commentService.setCommentAnnotationsFromCommentsContainer([])}catch(e){this.loggingService.catch("Error in CommentsContainerComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in CommentsContainerComponent unsubscribe: ",e)}}handleCommentPinSlotChanged(e){try{let t=e.target;if(t.assignedElements().length>0){let r=t.assignedElements()[0];this.commentPinPortalService.setCommentPinOverrideTemplate(r)}}catch(t){this.loggingService.catch("Error in CommentsContainerComponent handleCommentPinSlotChanged: ")}}focusCommentAnnotation(){if(this.focusCommentAnnotationId&&!this.commentAnnotationFocused){let e=this.componentConfigSignal().commentPinAnnotations.find(t=>t.annotationId===this.focusCommentAnnotationId);e&&(this.commentAnnotationFocused=!0,sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e.annotationId),this.selectedAnnotationsMap[e.annotationId]||this.domService.toggleAnnotationSelection(e),setTimeout(()=>{let t=null;e.targetElement||e.areaAnnotationId?t=document.getElementById(`comment-pin-container-${e.annotationId}`):(t=document.querySelector(`[data-velt-id='${e.annotationId}']`),sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e.annotationId)),t||(t=document.querySelector(`${U.TAGS.VELT_COMMENT_TEXT}[${U.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)),t&&this.scrollToComment&&t.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},100))}}setCommentInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(Ne.COMMENT)}catch(e){this.loggingService.catch("Error in CommentsContainerComponent setCommentInstalledInAnalytics: ",e)}}disableCommentMode(){try{this.commentService.disableAddCommentMode()}catch(e){this.loggingService.catch("Error in CommentsContainerComponent disableCommentMode: ",e)}}checkDarkMode(){try{this._darkAttribute===""?this.componentConfigSignal.update(e=>(e=D(E({},e),{darkMode:!0}),e)):this.componentConfigSignal.update(e=>(e=D(E({},e),{darkMode:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsContainerComponent checkDarkMode: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(Ve),h(we),h(G1),h(g7),h(Wo),h(_),h(R),h(Fl),h(Ii),h(Wi),h(ot))},o.\u0275cmp=O({type:o,selectors:[["app-comments-container"]],hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{textMode:"textMode",popoverMode:"popoverMode",popoverTriangleComponent:"popoverTriangleComponent",forceCloseAllOnEsc:"forceCloseAllOnEsc",collapsedComments:"collapsedComments",shortUserName:"shortUserName",readOnly:"readOnly",deleteThreadWithFirstComment:"deleteThreadWithFirstComment",resolveStatusAccessAdminOnly:"resolveStatusAccessAdminOnly",svgAsImg:"svgAsImg",commentToNearestAllowedElement:"commentToNearestAllowedElement",floatingCommentDialog:"floatingCommentDialog",moderatorMode:"moderatorMode",assignToType:"assignToType",_streamMode:[0,"streamMode","_streamMode"],atHereLabel:"atHereLabel",_atHereEnabled:[0,"atHereEnabled","_atHereEnabled"],_deleteReplyConfirmation:[0,"deleteReplyConfirmation","_deleteReplyConfirmation"],_expandMentionGroups:[0,"expandMentionGroups","_expandMentionGroups"],_showMentionGroupsFirst:[0,"showMentionGroupsFirst","_showMentionGroupsFirst"],_linkCallback:[0,"linkCallback","_linkCallback"],_showMentionGroupsOnly:[0,"showMentionGroupsOnly","_showMentionGroupsOnly"],_fullExpanded:[0,"fullExpanded","_fullExpanded"],_draftMode:[0,"draftMode","_draftMode"],atHereDescription:"atHereDescription",_persistentCommentMode:[0,"persistentCommentMode","_persistentCommentMode"],_seenByUsers:[0,"seenByUsers","_seenByUsers"],signInButton:"signInButton",upgradeButton:"upgradeButton",attachments:"attachments",recordings:"recordings",reactions:"reactions",deviceInfo:"deviceInfo",commentIndex:"commentIndex",dialogOnHover:"dialogOnHover",dialogOnTargetElementClick:"dialogOnTargetElementClick",priority:"priority",status:"status",resolveButton:"resolveButton",_inboxMode:[0,"inboxMode","_inboxMode"],_suggestionMode:[0,"suggestionMode","_suggestionMode"],_mobileMode:[0,"mobileMode","_mobileMode"],_inlineCommentMode:[0,"inlineCommentMode","_inlineCommentMode"],_privateCommentMode:[0,"privateCommentMode","_privateCommentMode"],_minimap:[0,"minimap","_minimap"],_minimapPosition:[0,"minimapPosition","_minimapPosition"],_ghostComments:[0,"ghostComments","_ghostComments"],_ghostCommentsIndicator:[0,"ghostCommentsIndicator","_ghostCommentsIndicator"],_commentsOnDom:[0,"commentsOnDom","_commentsOnDom"],_resolvedCommentsOnDom:[0,"resolvedCommentsOnDom","_resolvedCommentsOnDom"],_filterCommentsOnDom:[0,"filterCommentsOnDom","_filterCommentsOnDom"],_bubbleOnPin:[0,"bubbleOnPin","_bubbleOnPin"],_bubbleOnPinHover:[0,"bubbleOnPinHover","_bubbleOnPinHover"],_multiThreadMode:[0,"multiThreadMode","_multiThreadMode"],_multiThread:[0,"multiThread","_multiThread"],_maxReplyAvatars:[0,"maxReplyAvatars","_maxReplyAvatars"],_replyAvatars:[0,"replyAvatars","_replyAvatars"],_groupMultipleMatch:[0,"groupMultipleMatch","_groupMultipleMatch"],_groupMatchedComments:[0,"groupMatchedComments","_groupMatchedComments"],_commentTool:[0,"commentTool","_commentTool"],_sidebarButtonOnCommentDialog:[0,"sidebarButtonOnCommentDialog","_sidebarButtonOnCommentDialog"],_deviceIndicatorOnCommentPins:[0,"deviceIndicatorOnCommentPins","_deviceIndicatorOnCommentPins"],_scrollToComment:[0,"scrollToComment","_scrollToComment"],_userMentions:[0,"userMentions","_userMentions"],_paginatedContactList:[0,"paginatedContactList","_paginatedContactList"],_deleteOnBackspace:[0,"deleteOnBackspace","_deleteOnBackspace"],_hotkey:[0,"hotkey","_hotkey"],_recordingSummary:[0,"recordingSummary","_recordingSummary"],_recordingTranscription:[0,"recordingTranscription","_recordingTranscription"],_allowedFileTypes:[0,"allowedFileTypes","_allowedFileTypes"],_recordingCountdown:[0,"recordingCountdown","_recordingCountdown"],_unreadIndicatorMode:[0,"unreadIndicatorMode","_unreadIndicatorMode"],_enterKeyToSubmit:[0,"enterKeyToSubmit","_enterKeyToSubmit"],_pinShadowDOM:[0,"pinShadowDom","_pinShadowDOM"],_dialogShadowDOM:[0,"dialogShadowDom","_dialogShadowDOM"],_persistentCommentShadowDOM:[0,"persistentCommentShadowDom","_persistentCommentShadowDOM"],_shadowDOM:[0,"shadowDom","_shadowDOM"],_textCommentToolShadowDOM:[0,"textCommentToolShadowDom","_textCommentToolShadowDOM"],_pinDarkMode:[0,"pinDarkMode","_pinDarkMode"],_textCommentToolDarkMode:[0,"textCommentToolDarkMode","_textCommentToolDarkMode"],_textCommentToolbarDarkMode:[0,"textCommentToolbarDarkMode","_textCommentToolbarDarkMode"],_textCommentToolbarShadowDOM:[0,"textCommentToolbarShadowDom","_textCommentToolbarShadowDOM"],_changeDetectionInCommentMode:[0,"changeDetectionInCommentMode","_changeDetectionInCommentMode"],_areaComment:[0,"areaComment","_areaComment"],_screenshot:[0,"screenshot","_screenshot"],_pinCursorImage:[0,"pinCursorImage","_pinCursorImage"],allowedElementIds:"allowedElementIds",allowedElementClassNames:"allowedElementClassNames",allowedElementQuerySelectors:"allowedElementQuerySelectors",_commentPinHighlighter:[0,"commentPinHighlighter","_commentPinHighlighter"],_customReactions:[0,"customReactions","_customReactions"],customStatus:"customStatus",customListDataOnAnnotation:"customListDataOnAnnotation",customListDataOnComment:"customListDataOnComment",attachmentDownload:"attachmentDownload",attachmentNameInMessage:"attachmentNameInMessage",customPriority:"customPriority",_customAutocompleteSearch:[0,"customAutocompleteSearch","_customAutocompleteSearch"],_autoCompleteScrollConfig:[0,"autoCompleteScrollConfig","_autoCompleteScrollConfig"],customCategory:"customCategory",streamViewContainerId:"streamViewContainerId",composerMode:"composerMode",autoCategorize:"autoCategorize",commentplaceholder:[0,"commentPlaceholder","commentplaceholder"],replyplaceholder:[0,"replyPlaceholder","replyplaceholder"],isDarkMode:[0,"darkMode","isDarkMode"]},outputs:{onCommentAdd:"onCommentAdd",onSignIn:"onSignIn",onUpgrade:"onUpgrade",onCustomPinInject:"onCustomPinInject",onCommentUpdate:"onCommentUpdate",onCommentAccept:"onCommentAccept",onCommentReject:"onCommentReject",onSidebarButtonOnCommentDialogClick:"onSidebarButtonOnCommentDialogClick",onCommentSelectionChange:"onCommentSelectionChange",onCopyLink:"onCopyLink"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[["commentsDataRef",""],[4,"ngIf"],[2,"display","none"],["id","comment-pin-slot","name","comment-pin",3,"slotchange"],[3,"componentConfigSignal"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[3,"commentPinAnnotations","streamViewContainerId",4,"ngIf"],[3,"darkMode","commentAnnotation",4,"ngIf"],[3,"commentAnnotations","user","position",4,"ngIf"],[3,"commentPinAnnotations","streamViewContainerId"],[3,"darkMode","commentAnnotation"],[3,"commentAnnotations","user","position"]],template:function(t,r){t&1&&u(0,Wnn,5,5,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,Ege,nye,iye,l8,Sn,D1,ge],encapsulation:2,changeDetection:0});let i=o;return i})();var qnn=["sidebarRef"],Ynn=i=>({componentConfigSignal:i}),Knn=(i,o)=>({condition:i,data:o}),Znn=(i,o)=>({componentConfigSignal:i,sidebarRef:o}),Xnn=(i,o)=>({template:i,context:o});function Qnn(i,o){if(i&1&&(y(0,"div",5,0),w(2,"app-comment-sidebar-skeleton",6)(3,"app-comment-sidebar-panel",7)(4,"app-comment-sidebar-focused-thread",8),b()),i&2){let n=me(1),e=l(3).ngIf,t=l();pe("s-overflow-hidden",e.moreFiltersVisible)("velt-sidebar--more-filters-visible",e.moreFiltersVisible),T("aria-expanded",e.sidebarVisible),m(2),d("componentConfigSignal",t.componentConfigSignal),m(),d("sidebarRef",n)("componentConfigSignal",t.componentConfigSignal),m(),d("componentConfigSignal",t.componentConfigSignal)("sidebarRef",n)}}function Jnn(i,o){if(i&1){let n=K();v(0),y(1,"div",3),P(2,"translate"),G("click",function(t){N(n);let r=l(3);return F(r.onClick(t))}),u(3,Qnn,5,10,"div",4),b(),C()}if(i&2){let n=l(2).ngIf,e=l();m(),pe("mobile",n.isPhone)("velt-sidebar-container--fullscreen",n.fullScreen)("visible",n.sidebarVisible||n.embedMode||n.floatingMode)("floating",n.floatingMode)("embed",n.embedMode)("page",n.pageMode)("velt-comment-sidebar--read-only",n.readOnly),d("ngClass",n.position),T("data-testid",e.componentId)("aria-label",M(2,18,"Comments sidebar")),m(2),d("veltDynamicTemplate",k(23,Xnn,e.template,k(20,Znn,e.componentConfigSignal,e.sidebarRef)))}}function ein(i,o){if(i&1&&(v(0),u(1,Jnn,4,26,"ng-container",1),C()),i&2){let n=l().ngIf;m(),d("ngIf",n)}}function tin(i,o){if(i&1&&(v(0),u(1,ein,2,1,"ng-container",2),C()),i&2){let n=l();m(),d("veltIf",k(3,Knn,n.conditionSignal(),A(1,Ynn,n.componentConfigSignal)))}}var rye=(()=>{let o=class o extends nt{constructor(e,t,r,a){super(e,t,void 0,void 0,void 0,a,r),this.elementRef=e,this.themeService=t,this.loggingService=r,this.dynamicDataService=a,this.onWrapperClick=new Me,this.componentId="velt-comments-sidebar-wrapper",super.initializeComponentConfigSignal(new Ye)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentsSidebarWrapperComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentsSidebarWrapperComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}onClick(e){try{this.onWrapperClick.emit(e)}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(R),h(Ke),h(_),h(S))},o.\u0275cmp=O({type:o,selectors:[["velt-comments-sidebar-wrapper-internal"]],viewQuery:function(t,r){if(t&1&&it(qnn,7),t&2){let a;et(a=tt())&&(r.sidebarRef=a.first)}},outputs:{onWrapperClick:"onWrapperClick"},standalone:!1,features:[V([S]),L],decls:1,vars:1,consts:[["sidebarRef",""],[4,"ngIf"],[4,"veltIf"],["data-velt-element","true","data-velt-comment-disabled","true","role","complementary",1,"velt-sidebar-container",3,"click","ngClass"],["class","velt-sidebar","role","region",3,"s-overflow-hidden","velt-sidebar--more-filters-visible",4,"veltDynamicTemplate"],["role","region",1,"velt-sidebar"],[3,"componentConfigSignal"],[3,"sidebarRef","componentConfigSignal"],[3,"componentConfigSignal","sidebarRef"]],template:function(t,r){t&1&&u(0,tin,2,6,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Qr,X,ie,Lf,Ff,M1,se,ge],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}[_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-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-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-sidebar-container[_ngcontent-%COMP%]{height:100vh;width:calc((26rem + 0px) * var(--velt-base-rem-unit));position:fixed;top:0;padding:var(--velt-spacing-lg);box-sizing:border-box;z-index:999999997}.velt-sidebar-container.velt-sidebar-container--fullscreen[_ngcontent-%COMP%]{width:100vw;padding:0}.velt-sidebar-container.velt-sidebar-container--fullscreen[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]{border-radius:0;border:0}.velt-sidebar-container.velt-sidebar-container--fullscreen.left[_ngcontent-%COMP%], .velt-sidebar-container.velt-sidebar-container--fullscreen.right[_ngcontent-%COMP%]{transition:none}.velt-sidebar-container.left[_ngcontent-%COMP%]{left:-100%;transition:width .5s ease-in-out,left .5s ease-in-out}.velt-sidebar-container.left.visible[_ngcontent-%COMP%]{left:0}.velt-sidebar-container.right[_ngcontent-%COMP%]{right:-100%;transition:width .5s ease-in-out,right .5s ease-in-out}.velt-sidebar-container.right.visible[_ngcontent-%COMP%]{right:0}.velt-sidebar-container.mobile[_ngcontent-%COMP%]{width:100%;height:100%;box-sizing:border-box;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.velt-sidebar-container.embed[_ngcontent-%COMP%]{width:100%;height:100%;position:unset;border:0}.velt-sidebar-container.floating[_ngcontent-%COMP%]{height:90vh;position:unset;border:0;padding:0;width:calc((22.5rem + 0px) * var(--velt-base-rem-unit))}.velt-sidebar-container.floating.embed[_ngcontent-%COMP%]{width:100%;height:100%}.velt-sidebar-container.page[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]{padding-bottom:0}.velt-sidebar-container[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{box-sizing:border-box}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-lg);font-weight:400;font-size:var(--velt-font-size-sm);line-height:21px;align-items:center;background:var(--velt-background-0);border-radius:var(--velt-border-radius-lg);width:100%;overflow-x:hidden;position:relative;height:100%;border:1px solid var(--velt-border-5)}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%] app-comment-sidebar-filter[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-user-select:none;user-select:none;pointer-events:none}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar.velt-sidebar--more-filters-visible[_ngcontent-%COMP%] app-comment-sidebar-filter[_ngcontent-%COMP%]{pointer-events:initial;-webkit-user-select:initial;user-select:initial}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar{display:none;width:0;height:0}.velt-sidebar-container[_ngcontent-%COMP%] .velt-sidebar[_ngcontent-%COMP%]:not(.s-overflow-hidden){overflow-y:auto}[_nghost-%COMP%] velt-comments-sidebar-wireframe{width:100%;height:100%;display:flex;flex-direction:column;gap:var(--velt-spacing-lg)}"],changeDetection:0});let i=o;return i})();var iin=["sidebarOverlay"],oin=["host"],rin=i=>["snippyly-sidebar-panel","velt-overlay-panel",i];function ain(i,o){i&1&&He(0)}function sin(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,ain,1,0,"ng-container",7),b()),i&2){l(3);let n=me(3);m(),d("ngTemplateOutlet",n)}}function lin(i,o){if(i&1&&(v(0),u(1,sin,2,1,"velt-shadow-dom-internal",6),C()),i&2){l(2);let n=me(3),e=l();m(),d("ngIf",!e.template&&e.sidebarShadowDOM)("ngIfElse",n)}}function cin(i,o){i&1&&He(0)}function din(i,o){if(i&1&&(y(0,"velt-shadow-dom-internal"),u(1,cin,1,0,"ng-container",7),b()),i&2){l(5);let n=me(3);m(),d("ngTemplateOutlet",n)}}function min(i,o){if(i&1&&(y(0,"div",11),u(1,din,2,1,"velt-shadow-dom-internal",6),b()),i&2){let n=l(4).ngIf,e=me(3),t=l();pe("dark",n.darkMode),m(),d("ngIf",!t.template&&t.sidebarShadowDOM)("ngIfElse",e)}}function pin(i,o){if(i&1&&u(0,min,2,4,"div",10),i&2){let n=l(3).ngIf;d("ngIf",n==null?null:n.sidebarVisible)}}function gin(i,o){if(i&1&&(w(0,"div",8,2),u(2,pin,1,1,"ng-template",9,3,Ee)),i&2){let n=me(1),e=l(2).ngIf;m(2),d("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",!0)("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",A(4,rin,e.darkMode?"dark":""))}}function uin(i,o){if(i&1&&u(0,lin,2,2,"ng-container",6)(1,gin,4,6,"ng-template",null,1,Ee),i&2){let n=me(2),e=l().ngIf;d("ngIf",e.embedMode||e.floatingMode)("ngIfElse",n)}}function hin(i,o){if(i&1){let n=K();y(0,"velt-comments-sidebar-wrapper-internal",12),P(1,"translate"),G("onWrapperClick",function(t){N(n);let r=l(2);return F(r.onClick(t))}),b()}if(i&2){let n=l().ngIf,e=l();d("componentConfigSignal",e.componentConfigSignal)("template",e.template)("darkMode",n.darkMode),T("data-testid",e.componentId)("aria-label",M(1,6,"Comments sidebar"))("aria-modal",!0)}}function fin(i,o){if(i&1&&(v(0),u(1,uin,3,2,"ng-template",5)(2,hin,2,8,"ng-template",null,0,Ee),C()),i&2){let n=o.ngIf;m(),d("ngIf",n.isFirstComponent||n.floatingMode||n.embedMode)}}var c8=(()=>{let o=class o extends nt{set _pageMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{pageMode:t}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _pageMode: ",t)}}set _filterCount(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{filterCount:t}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _filterCount: ",t)}}set _customActions(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarCustomActions():this.commentService.disableSidebarCustomActions()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _pageMode: ",t)}}set focusedThreadMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFocusedThreadMode():this.commentService.disableFocusedThreadMode()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _pageMode: ",t)}}set _openAnnotationInFocusMode(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableOpenAnnotationInFocusMode():this.commentService.disableOpenAnnotationInFocusMode()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _openAnnotationInFocusMode: ",t)}}set _readOnly(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this._localReadOnlyExplicitlySet=!0,this.componentConfigSignal.update(r=>(r=D(E({},r),{sidebarReadMode:!!t,readOnly:!!t}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _readOnly: ",t)}}set _selection(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{selection:t!==!1}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _selection: ",t)}}set _forceClose(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{forceClose:t!==!1}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _forceClose: ",t)}}set _expandOnSelection(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{expandOnSelection:t!==!1}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _expandOnSelection: ",t)}}set _sortData(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{sortData:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _sortData: ",t)}}set _sortOrder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{sortOrder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _sortOrder: ",t)}}set _sortBy(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{sortBy:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _sortBy: ",t)}}set enableUrlNavigation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarUrlNavigation():this.commentService.disableSidebarUrlNavigation()}set urlNavigation(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableSidebarUrlNavigation():this.commentService.disableSidebarUrlNavigation()}set _queryParamsComments(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableQueryParamsComments():this.commentService.disableQueryParamsComments()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _queryParamsComments: ",t)}}set _fullScreen(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFullScreenInSidebar():this.commentService.disableFullScreenInSidebar()}catch{}}set _currentLocationSuffix(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{currentLocationSuffix:!!t}),r))}catch{}}set _filterOptionLayout(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{filterOptionLayout:e}),t))}catch{}}set _filterConfig(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.updateFilterConfig(t)}catch{}}set _groupConfig(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.componentConfigSignal.update(r=>(r=D(E({},r),{groupConfig:t}),r.groupConfig?.enable||(r.groupBy=null),r))}catch{}}set _filters(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.commentService.setCommentSidebarFilters(t)}catch{}}set _systemFiltersOperator(e){try{e&&this.commentService.setCommentSidebarSystemFiltersOperator(e)}catch{}}set _excludeLocationIds(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.commentService.setExcludeLocationIdsFromSidebar(t)}catch{}}set _fullExpanded(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{fullExpanded:!!t}),r))}catch{}}set _sidebarButtonCountType(e){try{this.commentService.setSidebarButtonCountType(e)}catch{}}set _filterGhostCommentsInSidebar(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.commentService.enableFilterGhostCommentsInSidebar():this.commentService.disableFilterGhostCommentsInSidebar()}catch{}}set commentPlaceholder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{commentPlaceholder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent set commentPlaceholder: ",t)}}set replyPlaceholder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{replyPlaceholder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent set replyPlaceholder: ",t)}}set pageModePlaceholder(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{pageModePlaceholder:e}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent set pageModePlaceholder: ",t)}}set _sidebarShadowDOM(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{shadowDom:t}),r)),t?this.commentService.enableSidebarShadowDOM():this.commentService.disableSidebarShadowDOM()}catch{}}set _context(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t&&typeof t=="object"&&this.componentConfigSignal.update(r=>(r=D(E({},r),{context:t}),r))}catch{}}set _defaultMinimalFilter(e){try{let t=e;typeof e=="string"&&(e.startsWith('"')||e.startsWith("'"))&&(t=JSON.parse(e)),this.componentConfigSignal.update(r=>(r=D(E({},r),{minimalFilter:t,selectedMinimalFilterDropdownOption:D(E({},r.selectedMinimalFilterDropdownOption),{filter:t})}),r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent _defaultMinimalFilter: ",t)}}constructor(e,t,r,a,s,c,p,g,f,I,x,B,z,W,J,ne,ve){super(p,ve,void 0,r),this.analyticsService=e,this.authService=t,this.commentService=r,this.configService=a,this.domService=s,this.docService=c,this.elementRef=p,this.iamService=g,this.loggingService=f,this.breakpointObserver=I,this.customFilterService=x,this.translateService=B,this.cd=z,this.wireframeService=W,this.renderer=J,this.dynamicComponentService=ne,this.themeService=ve,this.embedMode=null,this.floatingMode=!1,this._localReadOnlyExplicitlySet=!1,this.dialogVariant="sidebar",this.focusedThreadDialogVariant="sidebar",this.filterPanelLayout="bottomSheet",this.pageModeComposerVariant="sidebar",this.searchPlaceholder="Search comments",this.openSidebar=new Me,this.onSidebarOpen=new Me,this.onSidebarCommentClick=new Me,this.onSidebarCommentClickEvent=new Me,this.onCommentClick=new Me,this.onSidebarClose=new Me,this.onCommentNavigationButtonClick=new Me,this.onFullscreen=new Me,this.subscriptions=[],this.locations={},this.commentAccessMode=ho,this.commentReadAnalyticsCalled=!0,this.peopleTypes={all:"All",other:"Other"},this.pageTypes={all:"All",other:"Other"},this.unsetType={id:"unset",name:"Not set"},this.objectKeys=Object.keys,this.filteredGroupedCommentAnnotationsObj={},this.filteredGroupedCommentAnnotations=[],this.veltId=vt(),this.veltElement=!0,this.defaultFilterConfig={location:{name:"Pages",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search pages",type:"system"},document:{name:"Documents",enable:!1,multiSelection:!0,enableGrouping:!1,placeholder:"Search documents",type:"system"},people:{name:"Author",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search authors",type:"system"},assigned:{name:"Assigned",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search assigned",type:"system"},tagged:{name:"Tagged",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search tagged",type:"system"},involved:{name:"Involved",enable:!0,multiSelection:!0,enableGrouping:!0,placeholder:"Search involved",type:"system"},priority:{name:"Priority",enable:!0,multiSelection:!0,enableGrouping:!1,placeholder:"Search priority",type:"system"},status:{name:"Status",enable:!1,multiSelection:!0,enableGrouping:!1,placeholder:"Search status",type:"system"},category:{name:"Category",enable:!0,multiSelection:!0,enableGrouping:!1,placeholder:"Search category",type:"system"},commentType:{name:"Comment Type",enable:!0,multiSelection:!0,enableGrouping:!1,placeholder:"Search comment type",type:"system"},version:{name:"Versions",enable:!0,multiSelection:!1,enableGrouping:!1,placeholder:"Search versions",type:"system"}},this.defaultGroupConfig={enable:!0,name:"Group By"},this.isUserGlobalContact=!1,this.resolvedCommentsOnDom=!1,this.position="right",this.commentRefId="",this.showDefault=!0,this.componentConfigSignal=Te({fullScreen:!1,embedMode:this.embedMode,floatingMode:this.floatingMode,pageMode:!1,currentLocationSuffix:!1,queryParamsComments:!1,variant:this.variant,dialogVariant:this.dialogVariant,focusedThreadDialogVariant:this.focusedThreadDialogVariant,pageModeComposerVariant:this.pageModeComposerVariant,fullExpanded:!1,systemFiltersOperator:md.AND,annotations:[],filteredCommentPinAnnotations:[],filteredCommentAnnotationsCount:0,selectedAnnotationsMap:{},commentAnnotationsCountByFilters:{page:{},document:{},status:{},people:{},tagged:{},assigned:{},involved:{},version:{},priority:{},commentCategory:{},accessMode:{}},noCommentsFound:!1,noCommentsFoundForAppliedFilters:!1,pageCommentAnnotation:new Zo,commentCategoryMap:U.CommentCategoryMap,virtualScrollData:[],isFirstComponent:!1,searchPlaceholder:this.searchPlaceholder,enableAutoCategorize:!1,filterConfig:JSON.parse(JSON.stringify(this.defaultFilterConfig)),filters:{pages:[],documents:[],statuses:[],statusIds:[],people:[],assigned:[],tagged:[],involved:[],versions:[],versionIds:[],priorities:[],priorityIds:[],categories:[],categoryIds:[],accessModes:[],input:null},moreFiltersVisible:!1,groupByOptions:{},groupBy:null,peopleFilters:[],assignedFilters:[],taggedFilters:[],involvedFilters:[],enablePriority:!1,enableStatus:!0,appliedFiltersCount:0,priorities:[],statuses:[],accessModes:[{id:ho.PUBLIC,name:"Public"},{id:ho.PRIVATE,name:"Private"}],filterOptionLayout:"checkbox",filterCount:!0,sidebarVisible:!1,pages:{},documents:{},showAllPages:!1,showAllDocuments:!1,versions:[],groupConfig:JSON.parse(JSON.stringify(this.defaultGroupConfig)),user:null,currentPage:null,currentDocument:null,isUserAdmin:!1,isPrivateCommentAllowed:!1,isPhone:!1,darkMode:!1,skeletonLoading:!0,shadowDom:void 0,position:this.position,filterPanelLayout:this.filterPanelLayout,customActionsState:{},readOnly:!1,selection:!0,expandOnSelection:!0,sidebarReadMode:!1,filterRecentlyClosed:!1,location:null,fullscreenEnabled:!1,forceClose:!0,contextBeforePageModeComposerOverride:void 0,isContextFromPageModeComposerTool:!1,trackByCategoryId:this.trackByCategoryId.bind(this),trackByPriorityId:this.trackByPriorityId.bind(this),trackByCustomFilterId:this.trackByCustomFilterId.bind(this),trackByAccessModeId:this.trackByAccessModeId.bind(this),trackByPageKey:this.trackByPageKey.bind(this),trackByDocumentKey:this.trackByDocumentKey.bind(this),trackByPeople:this.trackByPeople.bind(this),trackByVersion:this.trackByVersion.bind(this),trackByGroupByOptionKey:this.trackByGroupByOptionKey.bind(this),onCommentAnnotationClick:this.onCommentAnnotationClick.bind(this),saveComment:this.saveComment.bind(this),trackCommentPinAnnotations:this.trackCommentPinAnnotations.bind(this),updateFilter:this.updateFilter.bind(this),toggleGroupedCommentAnnotations:this.toggleGroupedCommentAnnotations.bind(this),changeGroupBy:this.changeGroupBy.bind(this),closeSidebar:this.closeSidebar.bind(this),toggleMoreFilters:this.toggleMoreFilters.bind(this),openMoreFilters:this.openMoreFilters.bind(this),closeMoreFilters:this.closeMoreFilters.bind(this),savePageComment:this.savePageComment.bind(this),sortComments:this.sortComments.bind(this),goBackToAllComments:this.goBackToAllComments.bind(this),minimalFilterDropdownOpen:!1,minimalActionsDropdownOpen:!1,toggleMinimalFilterDropdown:this.toggleMinimalFilterDropdown.bind(this),unreadCommentsMap:null,minimalFilter:"all",filterCommentsByReadStatus:this.filterCommentsByReadStatus.bind(this),selectedMinimalFilterDropdownOption:{sorting:"date",filter:"all"},locationFilterDropdownOpen:!1,toggleLocationFilterDropdown:this.toggleLocationFilterDropdown.bind(this),documentFilterDropdownOpen:!1,toggleDocumentFilterDropdown:this.toggleDocumentFilterDropdown.bind(this),closeDocumentFilterDropdown:this.closeDocumentFilterDropdown.bind(this),markAllCommentAnnotationsAsRead:this.markAllCommentAnnotationsAsRead.bind(this),markAllCommentAnnotationsAsResolved:this.markAllCommentAnnotationsAsResolved.bind(this),toggleMinimalActionsDropdown:this.toggleMinimalActionsDropdown.bind(this),toggleCustomAction:this.toggleCustomAction.bind(this),focusedThreadMode:!1,openAnnotationInFocusMode:!1,focusedAnnotation:null,focusedAnnotationEditCommentIndex:null,navigateToComment:this.navigateToComment.bind(this),resetFilters:this.resetFilters.bind(this),filterSearch:this.filterSearch.bind(this),customFilters:{},onDialogExpanded:this.onDialogExpanded.bind(this),onFullscreenClick:this.onFullscreenClick.bind(this)}),this.sidebarShadowDOM=!1,this.dataAvailable=!1,this.componentId="velt-comments-sidebar";try{this.subscriptions.push(super.onDarkModeChange().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{darkMode:Fe}),Be))})),this.loggingService.log("%c[WB] Creating CLASS: CommentsSidebarComponent","color: blue;"),this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{groupBy:Fe.groupByOptions.page}),Fe.pageCommentAnnotation.isPageAnnotation=!0,Fe)),this.updateGroupByOptions(),this.subscriptions.push(this.commentService.getSidebarShadowDOM$().subscribe(Fe=>{this.sidebarShadowDOM=Fe})),this.subscriptions.push(this.commentService.getFocusedThreadMode$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{focusedThreadMode:Fe}),Be))})),this.subscriptions.push(this.commentService.getOpenAnnotationInFocusMode$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{openAnnotationInFocusMode:Fe}),Be))})),this.subscriptions.push(this.commentService.getReadOnly$().subscribe(Fe=>{this._localReadOnlyExplicitlySet||this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{readOnly:Fe}),Be))})),this.subscriptions.push(this.commentService.getQueryParamsComments$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{queryParamsComments:Fe}),Be)),this.setPages(),this.setDocuments()})),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{unreadCommentsMap:Fe}),Be))})),this.subscriptions.push(this.commentService.getFullScreenInSidebar$().subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{fullscreenEnabled:Fe}),Be))})),this.subscriptions.push(this.breakpointObserver.observe(zi.XSmall).subscribe(Fe=>{Fe.matches?this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{isPhone:!0}),Be)):this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{isPhone:!1}),Be))},Fe=>{this.loggingService.catch("Error in CommentsSidebarComponent breakpointObserver subscription: ",Fe)})),this.subscriptions.push(this.customFilterService.customStatusMap$.subscribe(Fe=>{this.statusMap=Fe,this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{statuses:Object.values(Fe)}),Be)),this.pruneStaleStatuses()})),this.subscriptions.push(this.customFilterService.customPriorityMap$.subscribe(Fe=>{this.priorityMap=Fe,this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{priorities:[...Object.values(Fe),{id:"unset",name:"Not set",color:"#FFFFFF"}]}),Be)),this.pruneStalePriorities()})),this.subscriptions.push(this.customFilterService.customCategoryMap$.subscribe(Fe=>{this.componentConfigSignal.update(Be=>(Be=D(E({},Be),{commentCategoryMap:D(E({},Fe),{other:{id:"other",name:"Other",color:"#00C48C"}})}),Be)),this.pruneStaleCategories()})),this.subscriptions.push(this.commentService.getPageModeComposerContext$().subscribe(Fe=>{Fe!==null?this.componentConfigSignal.update(Be=>(Be.isContextFromPageModeComposerTool||(Be=D(E({},Be),{contextBeforePageModeComposerOverride:Be.context})),Be=D(E({},Be),{pageMode:!0,context:Fe.context||void 0,targetElementIdFromPageModeComposer:Fe.targetElementId||void 0,isContextFromPageModeComposerTool:!0}),Be)):this.componentConfigSignal.update(Be=>(Be.isContextFromPageModeComposerTool&&(Be=D(E({},Be),{context:Be.contextBeforePageModeComposerOverride,contextBeforePageModeComposerOverride:void 0,targetElementIdFromPageModeComposer:void 0,isContextFromPageModeComposerTool:!1})),Be))}));let _e=sessionStorage.getItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE);_e&&this.componentConfigSignal.update(Fe=>(Fe=D(E({},Fe),{customActionsState:JSON.parse(_e)}),Fe))}catch(_e){this.loggingService.catch("Error in CommentsSidebarComponent constructor: ",_e)}}ngOnInit(){try{if(this.setupA11yAttributes(),sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)){let e=JSON.parse(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS));delete e?.input,e?.people?.length&&e.people.find(t=>typeof t=="string")&&(e.people=[]),e?.pages?.length&&e.pages?.forEach(t=>{t?.id||(t.id=t.displayName)}),sessionStorage.getItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_FILTERS_RESET)||(e.pages=[],sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_FILTERS_RESET,"true")),this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:e}),t)),this.pruneStaleStatuses(),this.pruneStalePriorities(),this.pruneStaleCategories()}if(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY)){let e=sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY);e&&this.componentConfigSignal.update(t=>(t=E({},t),Object.keys(t.groupByOptions).forEach(r=>{t.groupByOptions[r]===e&&(t.groupBy=e)}),t))}this.subscriptions.push(this.commentService.onCommentAdd$().subscribe(e=>{e?.annotation&&setTimeout(()=>{this.goToAnnotationInSidebar(e.annotation)},200)}))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent OnInit: ",e)}try{let e="velt-comments-sidebar-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){this.commentRefId="comment-sidebar";let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}}))}catch(e){this.loggingService.catch("Error in CommentDialogComponent OnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()}),this.getAllCommentAnnotationsSubscription&&this.getAllCommentAnnotationsSubscription.unsubscribe(),this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalFilterDropdownOpen:!1}),e)),this.commentService.setCommentsFromSidebarMap({comments:null,sidebarVisible:!1})}catch{}}ngAfterViewInit(){try{if(this.floatingMode||this.embedMode)this.initComponent();else{let e=document.querySelector(U.TAGS.SNIPPYLY_COMMENTS_SIDEBAR),t=document.querySelector(U.TAGS.VELT_COMMENTS_SIDEBAR);t?this.veltId===t?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),setTimeout(()=>{this.sidebarOverlay?.overlayRef?.hostElement&&(this.sidebarOverlay.overlayRef.hostElement.style.zIndex="1001")},100),this.initComponent()):this.veltId===e?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),setTimeout(()=>{this.sidebarOverlay?.overlayRef?.hostElement&&(this.sidebarOverlay.overlayRef.hostElement.style.zIndex="1001")},100),this.initComponent())}}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent AfterViewInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent ngOnChanges: ",t)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setupA11yAttributes:",e)}}onClick(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: onClick","color: green;");let t=e?.target?.tagName?.toLowerCase();t!==U.TAGS.VELT_COMMENT_DIALOG&&t!==U.TAGS.SNIPPYLY_COMMENT_DIALOG&&!e?.target?.closest(U.TAGS.VELT_COMMENT_DIALOG)&&!e?.target?.closest(U.TAGS.SNIPPYLY_COMMENT_DIALOG)&&this.domService.resetSelectedAnnotationsMap()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onClick: ",t)}}pruneStaleStatuses(){try{this.statusMap!==void 0&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.statuses=e.filters.statuses.filter(t=>t.id in this.statusMap),e.filters.statusIds=e.filters.statuses?.map(t=>t?.id),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterStaleStatuses: ",e)}}pruneStalePriorities(){try{this.priorityMap!==void 0&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.priorities=e.filters.priorities.filter(t=>t.id in this.priorityMap),e.filters.priorityIds=e.filters.priorities?.map(t=>t.id),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterStalePriorities: ",e)}}pruneStaleCategories(){try{this.componentConfigSignal().commentCategoryMap!==void 0&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.categories=e.filters.categories?.filter(t=>t.id in e.commentCategoryMap),e.filters.categoryIds=e.filters.categories?.map(t=>t.id),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterStaleCategories: ",e)}}trackByAnnotationGroup(e,t){return t?.displayName}trackByAnnotationId(e,t){return t?.annotationId}trackByCategoryId(e,t){return t?.value?.id||e}trackByPriorityId(e,t){return t?.id||e}trackByCustomFilterId(e,t){return t?.id||e}trackByAccessModeId(e,t){return t?.id||e}trackByPageKey(e,t){return t?.key||e}trackByDocumentKey(e,t){return t?.key||e}trackByPeople(e,t){return t?.id||e}trackByVersion(e,t){return t?.id||e}trackByGroupByOptionKey(e,t){return t?.key||e}initComponent(){try{this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t)),this.componentConfigSignal().user&&(this.setCommentSidebarInstalledInAnalytics(),this.setCommentSidebarEmbedModeInAnalytics(),this.setCommentSidebarFloatingModeInAnalytics())},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getUser$ subscription: ",e)})),this.subscriptions.push(this.docService.getDocumentPaths$().subscribe(e=>{this.documentPaths=e,this.getAllCommentsOnCurrentDocument()},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getDocumentPaths$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSidebarCustomActionEventData().subscribe(e=>{e&&(this.componentConfigSignal.update(t=>(t=D(E({},t),{customActionsState:e.actions}),t)),sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE,JSON.stringify(e.actions)))})),this.subscriptions.push(this.docService.getLocation$().subscribe(e=>{this.location=e,this.componentConfigSignal.update(a=>(a=D(E({},a),{location:e}),a));let t=this.commentService.getCommentSidebarFilters(),r=t?E({},t):{version:[]};this.location?.location?.version?r.version=[{id:this.location.location.version?.id,name:this.location.location.version?.name}]:r?.version||(r.version=[]),this.commentService.setCommentSidebarFilters(r),this.setPages(),this.filteredGroupedCommentAnnotationsObj={}},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getLocation$ subscription: ",e)})),this.subscriptions.push(this.docService.getLocations$().subscribe(e=>{this.locations=e,this.filteredGroupedCommentAnnotationsObj={}})),this.subscriptions.push(this.commentService.getEnableStatus$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{enableStatus:e}),t))})),this.subscriptions.push(this.commentService.getEnablePriority$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{enablePriority:e}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getEnablePriority$ subscription: ",e)})),this.subscriptions.push(this.commentService.getEnableAutoCategorize$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{enableAutoCategorize:e}),t))})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{sidebarVisible:e}),t)),this.componentConfigSignal().sidebarVisible&&(this.commentReadAnalyticsCalled=!1,setTimeout(()=>{Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length&&this.goToAnnotationInSidebar(this.componentConfigSignal().selectedAnnotationsMap[Object.keys(this.componentConfigSignal().selectedAnnotationsMap)[0]])},500)),this.componentConfigSignal().sidebarVisible?(this.getAllCommentsOnCurrentDocument(),this.commentService.setCommentsFromSidebarMap({comments:this.componentConfigSignal().skeletonLoading?void 0:this.componentConfigSignal().filteredCommentPinAnnotations,sidebarVisible:!0})):(this.commentService.getSidebarButtonCountType()==="default"&&this.getAllCommentAnnotationsSubscription&&this.getAllCommentAnnotationsSubscription.unsubscribe(),this.commentService.setCommentsFromSidebarMap({comments:this.componentConfigSignal().skeletonLoading?void 0:this.componentConfigSignal().filteredCommentPinAnnotations,sidebarVisible:!1}),this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal().focusedAnnotation&&this.goBackToAllComments())},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getSidebarVisibility$ subscription: ",e)})),this.subscriptions.push(this.commentService.getSidebarButtonCountType$().subscribe(e=>{e==="filter"&&this.getAllCommentsOnCurrentDocument()})),this.subscriptions.push(this.commentService.getCommentSidebarFilters$().subscribe(e=>{this.mergeClientFilters(e)})),this.subscriptions.push(this.commentService.getCommentSidebarSystemFiltersOperator$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{systemFiltersOperator:e}),t)),this.filterCommentAnnotations()})),this.subscriptions.push(this.commentService.getOpenSidebar$().subscribe(e=>{this.openSidebar.emit(e),this.onSidebarOpen.emit(e)},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getOpenSidebar$ subscription: ",e)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(e=>{let t=this.componentConfigSignal().selectedAnnotationsMap;this.componentConfigSignal.update(c=>(c=D(E({},c),{selectedAnnotationsMap:e}),c)),Object.keys(this.componentConfigSignal().selectedAnnotationsMap).length===1&&!this.commentService.showFloatingComments()&&this.commentService.setSidebarVisibility(!0);let r=Object.keys(e||{}),a=Object.keys(t||{});this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal().focusedAnnotation&&r.length===0&&this.goBackToAllComments();let s=r.find(c=>!a.includes(c));if(s){let c=this.componentConfigSignal().annotations.find(p=>p.annotationId===s);c&&(this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal().openAnnotationInFocusMode?this.componentConfigSignal.update(p=>(p=D(E({},p),{focusedAnnotation:c}),p)):setTimeout(()=>{this.goToAnnotationInSidebar(c)},100))}else{let c=this.componentConfigSignal().focusedAnnotation;this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal().openAnnotationInFocusMode&&c&&!r.includes(c?.annotationId)&&this.goBackToAllComments()}},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getSidebarVisibility$ subscription: ",e)})),this.subscriptions.push(this.domService.onDocumentClick$().subscribe(e=>{try{if(this.componentConfigSignal().sidebarVisible&&e&&!this.elementRef?.nativeElement?.contains(e?.target)){let t=document.querySelectorAll(".cdk-overlay-container");Array.from(t).some(a=>a?.contains(e?.target))||!this.embedMode&&(!this.commentService.isSidebarOpenedByCustomTrigger()||this.componentConfigSignal().forceClose)&&(e?.target?.hasAttribute(U.ATTRIBUTES.VELT_DOWNLOAD_BUTTON)||(this.closeSidebar(),e?.stopPropagation()))}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onDocumentClick: ",t)}},e=>{this.loggingService.catch("Error in CommentsSidebarComponent onDocumentClick$ subscription: ",e)})),this.subscriptions.push(this.iamService.isUserAdmin$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{isUserAdmin:e}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent isUserAdmin$ subscription: ",e)})),this.subscriptions.push(this.commentService.isPrivateCommentAllowed$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{isPrivateCommentAllowed:e}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent isPrivateCommentAllowed$ subscription: ",e)})),this.getAllCommentsOnCurrentDocument(),this.subscriptions.push(this.commentService.getSidebarCustomData().subscribe(e=>{this.updateVirtualScrollData(e)}))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent initComponent: ",e)}}updateVirtualScrollData(e){try{if(this.commentService.getSidebarCustomActionsValue()){let t=[];this.componentConfigSignal.update(s=>(s=E({},s),s.virtualScrollData=[],s)),e?.data?.forEach((s,c)=>{e?.options?.grouping!==!1&&this.componentConfigSignal.update(p=>(p=E({},p),p.virtualScrollData.push({type:"group",data:{displayName:s?.groupName,isExpanded:s?.isExpanded===void 0&&c===0||s?.isExpanded,annotations:s?.annotations}}),p)),(s?.isExpanded===void 0&&c===0||s?.isExpanded)&&s?.annotations?.forEach(p=>{this.componentConfigSignal.update(g=>(g=E({},g),g.virtualScrollData.push({type:"annotation",data:p}),g))}),t.push(...s?.annotations||[])}),this.componentConfigSignal.update(s=>(s=D(E({},s),{noCommentsFoundForAppliedFilters:!this.componentConfigSignal().virtualScrollData?.length}),s));let r=this.componentConfigSignal().embedMode||this.componentConfigSignal().sidebarVisible;this.commentService.setCommentsFromSidebarMap({comments:t,sidebarVisible:!!r}),this.componentConfigSignal.update(s=>(s=E({},s),s.filteredCommentAnnotationsCount=t?.length||0,s)),this.cd.markForCheck();let a=this.componentConfigSignal().virtualScrollViewportRef?.elementRef?.nativeElement;a&&(a.scrollTop=0)}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent updateVirtualScrollData: ",t)}}updateVirtualScrollDataGroupToggle(e){try{if(this.commentService.getSidebarCustomActionsValue()){this.componentConfigSignal.update(r=>(r=E({},r),r.virtualScrollData=[],r)),e?.forEach(r=>{r.type==="group"&&(this.componentConfigSignal.update(a=>(a=E({},a),a.virtualScrollData.push(r),a)),r?.data?.isExpanded&&r?.data?.annotations.forEach(a=>{this.componentConfigSignal.update(s=>(s=E({},s),s.virtualScrollData.push({type:"annotation",data:a}),s))}))}),this.componentConfigSignal.update(r=>(r=D(E({},r),{noCommentsFoundForAppliedFilters:!this.componentConfigSignal().virtualScrollData?.length}),r)),this.cd.markForCheck();let t=this.componentConfigSignal().virtualScrollViewportRef?.elementRef?.nativeElement;t&&(t.scrollTop=0)}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent updateVirtualScrollDataGroupToggle: ",t)}}getAllCommentsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentsOnCurrentDocument","color: green;");try{this.getAllCommentAnnotationsSubscription&&this.getAllCommentAnnotationsSubscription.unsubscribe(),this.componentConfigSignal.update(e=>(e=D(E({},e),{skeletonLoading:!0}),e)),this.getAllCommentAnnotationsSubscription=this.commentService.getAllCommentAnnotations({excludeDomChanges:!0,skipPositionCalculation:!0,fromCommentSidebar:!0,analytics:{enabled:!0,properties:{source:"internal",sourceId:"commentsSidebar"}}}).pipe(de(e=>(e||this.componentConfigSignal.update(t=>(t=D(E({},t),{skeletonLoading:!0}),t)),e)),Le(e=>!!e),de(e=>e?.filter(t=>t?.comments?.length)),fe(e=>this.commentService.getFilterGhostCommentsInSidebar$().pipe(fe(t=>t?this.commentService.getGhostCommentAnnotationMap$().pipe(de(r=>r?e?.filter(a=>!r?.[a?.annotationId]):e)):le(e)))),fe(e=>this.commentService.getExcludeLocationIdsFromSidebar$().pipe(de(t=>t?.length&&e?.length?e.filter(r=>r?.location?.id?!t.includes(r.location.id):!0):e))),fe(e=>this.commentService.getResolvedCommentsOnDom$().pipe(de(t=>(this.resolvedCommentsOnDom!==t&&(this.resolvedCommentsOnDom=t,t&&this.setResolvedStatusInFilter()),e))))).subscribe(e=>{if(this.dataAvailable=!0,this.componentConfigSignal.update(t=>{if(t=D(E({},t),{skeletonLoading:!1}),t.annotations=e?.filter(r=>!r?.isPageAnnotation||r?.comments?.length)||[],t.sortData==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.lastUpdated-a.lastUpdated):t.sortData==="none"?t.annotations=t.annotations?.sort((r,a)=>a.createdAt-r.createdAt):t.annotations=t.annotations?.sort((r,a)=>a.lastUpdated-r.lastUpdated),t.sortBy==="createdAt"?t.sortOrder==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.createdAt-a.createdAt):t.sortOrder==="desc"&&(t.annotations=t.annotations?.sort((r,a)=>a.createdAt-r.createdAt)):t.sortBy==="lastUpdated"?t.sortOrder==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.lastUpdated-a.lastUpdated):t.sortOrder==="desc"&&(t.annotations=t.annotations?.sort((r,a)=>a.lastUpdated-r.lastUpdated)):t.sortOrder==="asc"?t.annotations=t.annotations?.sort((r,a)=>r.lastUpdated-a.lastUpdated):t.sortOrder==="desc"&&(t.annotations=t.annotations?.sort((r,a)=>a.lastUpdated-r.lastUpdated)),t?.focusedAnnotation?.annotationId){let r=e?.find(a=>a.annotationId===t?.focusedAnnotation?.annotationId);r&&(t.focusedAnnotation=r)}return t}),this.setPages(),this.setDocuments(),this.setVersions(),this.setPeople(),this.filterCommentAnnotations(),this.updateAnnotationCountsByFilter(),this.componentConfigSignal().annotations?.length){let t=sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_SELECTED_ANNOTATION_ID);if(t){sessionStorage.removeItem(U.SESSION_STORAGE.SNIPPYLY_SELECTED_ANNOTATION_ID),this.commentService.setSidebarVisibility(!0);let r=this.componentConfigSignal().annotations.find(a=>a.annotationId===t);r&&this.goToAnnotation(r)}this.componentConfigSignal().sidebarVisible&&!this.commentReadAnalyticsCalled&&this.setCommentReadInAnalytics()}this.componentConfigSignal.update(t=>(t=D(E({},t),{noCommentsFound:!this.componentConfigSignal().annotations?.length}),t))},e=>{this.loggingService.catch("Error in CommentsSidebarComponent getAllCommentsOnCurrentDocument subscription: ",e),this.componentConfigSignal.update(t=>(t=D(E({},t),{skeletonLoading:!1}),t))})}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent getAllCommentsOnCurrentDocument: ",e)}}mergeClientFilters(e){try{if(Object.keys(e||{})?.length){if(e?.location&&(e?.location?.length?(this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{pages:[]})}),t)),e?.location?.forEach(t=>{if(t?.id&&(this.componentConfigSignal().filters?.pages||this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{pages:[]})}),a)),!this.componentConfigSignal().filters.pages.find(a=>a.id===t.id))){let a=this.docService.genarateLocationId(t);this.componentConfigSignal.update(s=>(s=D(E({},s),{filters:D(E({},s.filters),{pages:[...s.filters.pages,{id:t.id,displayName:t.displayName,locationIds:[a],selected:!0}]})}),s))}})):this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{pages:[]})}),t)),this.updatePageSelectedState()),e?.document&&(e?.document?.length?(this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{documents:[]})}),t)),e?.document?.forEach(t=>{(t?.id||t?.documentName)&&(this.componentConfigSignal().filters?.documents||this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{documents:[]})}),a)),this.componentConfigSignal().filters.documents.find(a=>a.id===t.id||a.documentName===t.documentName)||this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{documents:[...a.filters.documents,{id:t.id||t.documentName,documentName:t.documentName||t.id,selected:!0}]})}),a)))})):this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{documents:[]})}),t)),this.updateDocumentSelectedState()),e?.priority)if(e?.priority?.length){let t=e.priority;this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{priorities:r.priorities.filter(a=>t.includes(a.id)),priorityIds:t})}),r))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{priorities:[],priorityIds:[]})}),t));if(e?.category)if(e?.category?.length){if(this.componentConfigSignal().commentCategoryMap){let t=e.category;this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{categories:Object.values(r.commentCategoryMap).filter(a=>t.includes(a.id)),categoryIds:t})}),r))}}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{categories:[],categoryIds:[]})}),t));if(e?.status)if(e?.status?.length){let t=e.status;this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{statuses:r.statuses.filter(a=>t.includes(a.id)),statusIds:t})}),r))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{statuses:[],statusIds:[]})}),t));else sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)||this.setDefaultStatuses();if(e?.people){if(e?.people?.length){let t=[],r=this.componentConfigSignal().user;r&&e.people.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.people.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().peopleFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{people:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{people:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}if(e?.assigned){if(e?.assigned?.length){let t=[],r=this.componentConfigSignal().user;r&&e.assigned.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.assigned.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().assignedFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{assigned:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{assigned:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}if(e?.tagged){if(e?.tagged?.length){let t=[],r=this.componentConfigSignal().user;r&&e.tagged.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.tagged.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().taggedFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{tagged:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{tagged:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}if(e?.involved){if(e?.involved?.length){let t=[],r=this.componentConfigSignal().user;r&&e.involved.find(s=>s.userId&&s.userId===r?.userId||s.email&&s.email===r?.email)&&t.push({id:r.userId,name:r.name||r.email||r.userId||"",userId:r.userId,email:r.email}),e.involved.forEach(a=>{if(a?.userId||a?.email){let s=this.componentConfigSignal().involvedFilters.find(c=>a.userId&&c?.user?.userId===a.userId||a.email&&c?.user?.email===a.email);if(s&&s?.user?.userId!==r?.userId)t.push({id:s?.user?.userId,name:s?.user?.name,userId:s?.user?.userId,email:s?.user?.email});else{let c=a.userId;c&&c!==r?.userId&&t.push({id:c,name:a.name||a.email||a.userId,userId:a.userId,email:a.email})}}}),this.componentConfigSignal.update(a=>(a=D(E({},a),{filters:D(E({},a.filters),{involved:t})}),a))}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{involved:[]})}),t));this.setPeople(),this.updatePeopleSelectedState()}e?.version&&(e?.version?.length?this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{versions:e.version?.map(r=>({id:r.id,name:r.name||r.id}))||[],versionIds:e.version?.map(r=>r.id)||[]})}),t)):this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{versions:[],versionIds:[]})}),t)),this.setVersions()),Object.keys(this.componentConfigSignal().filterConfig).forEach(t=>{this.componentConfigSignal().filterConfig[t]?.type==="custom"&&Object.keys(e).includes(t)&&e?.[t]&&(e?.[t]?.length?this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{[t]:e[t]?.map(a=>({id:a.id,name:a.name||a.id}))||[],[t+"Ids"]:e[t]?.map(a=>a.id)||[]})}),r)):this.componentConfigSignal.update(r=>(r=D(E({},r),{filters:D(E({},r.filters),{[t]:[],[t+"Ids"]:[]})}),r)))}),this.filterCommentAnnotations(),this.updateAnnotationCountsByFilter(),this.setFiltersToStorage()}}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent mergeClientFilters: ",t)}}onCommentAnnotationClick(e,t=null){try{let r=this.commentService.getCommentAnnotationForClient(e);if(this.emitOnSidebarCommentClick(r),!this.componentConfigSignal().selection)return;this.componentConfigSignal().focusedThreadMode&&this.componentConfigSignal.update(a=>(a=D(E({},a),{focusedAnnotation:e,focusedAnnotationEditCommentIndex:t}),a)),this.navigateToComment(e,!1)}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent onCommentAnnotationClick: ",r)}}navigateToComment(e,t=!0){try{if(t){let r=this.commentService.getCommentAnnotationForClient(e);this.emitOnCommentNavigationButtonClick(r)}if(this.commentService.getSidebarUrlNavigation()&&t)if(e?.pageInfo?.url&&e.pageInfo?.url!==window.location.href){sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_SELECTED_ANNOTATION_ID,e.annotationId);let r=e.pageInfo.url;try{let a=window.location.origin,s=new URL(e.pageInfo.url).origin;a!==s&&(r=r.replace(s,a))}catch(a){this.loggingService.catch("Error in CommentsSidebarComponent onCommentAnnotationClick in comparing url domains: ",a)}window.location.href===r?this.goToAnnotation(e,t):window.location.href=r}else this.goToAnnotation(e,t);else this.goToAnnotation(e,t)}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent navigateToComment: ",r)}}goToAnnotation(e,t=!0){try{if(this.componentConfigSignal().selectedAnnotationsMap[e.annotationId]||e?.targetTextRange&&sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e?.annotationId),t)this.domService.toggleAnnotationSelection(e,void 0,void 0,!0);else{let r=this.componentConfigSignal().expandOnSelection?"sidebarShowReplies":void 0;this.domService.toggleAnnotationSelection(e,void 0,r,!0)}t&&setTimeout(()=>{let r=null;e.targetElement||e.areaAnnotationId?r=document.getElementById(`comment-pin-container-${e.annotationId}`):r=document.querySelector(`[data-velt-id='${e.annotationId}']`),r||(r=document.querySelector(`${U.TAGS.VELT_COMMENT_TEXT}[${U.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)),r&&r.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},100)}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent goToAnnotation: ",r)}}goToAnnotationInSidebar(e,t="smooth"){try{let s=document?.querySelector(".velt-comments-sidebar-container")?.querySelector("velt-shadow-dom-internal")?.shadowRoot?.getElementById(`sidebar-${e.annotationId}`);if(s||(s=document.getElementById(`sidebar-${e.annotationId}`)),s){let c=window.scrollX,p=window.scrollY;s.scrollIntoView({behavior:t,block:"center",inline:"center"}),window.scrollTo(c,p)}}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent goToAnnotationInSidebar: ",r)}}saveComment(e,t){this.commentService.saveComment(e,t)}getDisplayNameFromPageInfo(e){try{return this.componentConfigSignal().queryParamsComments&&e&&e?.queryParams?`${e?.path||""}${e?.queryParams||""}`:e?.path||""}catch{return""}}setPages(){try{this.componentConfigSignal.update(a=>D(E({},a),{pages:{},currentPage:void 0}));let e=new Map,t={};this.componentConfigSignal().annotations.forEach(a=>{let s=a.locationId||a.documentParamsId;if(!s){t.other||(t.other={locationIds:[],displayName:"Others",id:"other"});return}let c=a?.location?.locationName||a?.documentParams?.locationName||this.getDisplayNameFromPageInfo(a?.pageInfo)||"",p=a?.location?.id||c;e.has(s)||(t[p]||(t[p]={locationIds:[],displayName:c,id:p}),e.set(s,p),t[p].locationIds.push(s))}),this.componentConfigSignal.update(a=>{let s=this.location?.locationId,c;if(s){let p=e.get(s);p&&(c=t[p].displayName)}else t.other&&(c="Others");return D(E({},a),{pages:t,currentPage:c})}),this.updateLocationInStorage(),this.componentConfigSignal().annotations?.length&&!sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)&&(this.updateFilter({key:"pages",value:null},!0),this.setDefaultStatuses()),this.updatePageSelectedState()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setPages: ",e)}}setDocuments(){try{this.componentConfigSignal.update(a=>D(E({},a),{documents:{},currentDocument:void 0}));let e=new Map,t={};this.componentConfigSignal().annotations.forEach(a=>{let s=a?.metadata?.clientDocumentId?.toString(),c=a?.metadata?.documentId?.toString(),g=this.docService.getDocumentMetadata(c)?.documentName;if(!s){t.other||(t.other={id:"other",documentName:"Others"});return}if(e.has(s))return;let f=s;t[f]||(t[f]={id:s,documentName:g||s}),e.set(s,f)}),this.componentConfigSignal.update(a=>{let s=this.documentPaths?.clientDocumentId?.toString(),c;if(s){let p=e.get(s);p&&(c=t[p].id)}else t.other&&(c="other");return D(E({},a),{documents:t,currentDocument:c})}),this.componentConfigSignal().annotations?.length&&!sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)&&this.updateFilter({key:"documents",value:null},!0),this.updateDocumentSelectedState()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setDocuments: ",e)}}setDefaultStatuses(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDefaultStatuses","color: green;"),this.componentConfigSignal.update(e=>(e=D(E({},e),{filters:D(E({},e.filters),{statuses:[this.customFilterService.defaultStatus,...this.customFilterService.ongoingStatuses],statusIds:[this.customFilterService.defaultStatus?.id,...this.customFilterService.ongoingStatuses.map(t=>t?.id)]})}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setDefaultStatuses: ",e)}}setResolvedStatusInFilter(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setResolvedStatusInFilter","color: green;"),this.componentConfigSignal().filters.statuses?.length&&this.customFilterService.resolvedStatus&&(this.componentConfigSignal().filters.statuses.find(t=>t?.id===this.customFilterService.resolvedStatus.id)||this.componentConfigSignal.update(t=>(t=D(E({},t),{filters:D(E({},t.filters),{statuses:[...t.filters.statuses,this.customFilterService.resolvedStatus],statusIds:[...t.filters.statuses.map(r=>r?.id),this.customFilterService.resolvedStatus.id]})}),t)))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setResolvedStatusInFilter: ",e)}}trackCommentPinAnnotations(e,t){return t?.type==="group"?t?.data?.displayName:t?.type==="annotation"?t?.data?.annotationId:e}updateCurrentLocationIdInStorage(){try{this.location?.locationId&&this.componentConfigSignal().filters?.pages?.length&&this.componentConfigSignal.update(e=>(e=E({},e),e.filters.pages.forEach(t=>{t?.displayName===e.currentPage&&(t?.locationIds?.includes(this.location?.locationId)||t.locationIds.push(this.location?.locationId))}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateCurrentLocationIdInStorage: ",e)}}updateLocationInStorage(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.filters.pages.forEach(t=>{e.pages[t.displayName]&&(t.locationIds=e.pages[t.displayName].locationIds?.slice())}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateLocationInStorage: ",e)}}updatePageSelectedState(){try{this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.pages).forEach(t=>{let r=e.filters?.pages?.find(a=>a.id===t?.id);r?(t.selected=!0,r.displayName||(r.displayName=t.displayName)):t.selected=!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updatePageSelectedState: ",e)}}setVersions(){try{let e=[];this.componentConfigSignal().annotations&&this.componentConfigSignal.update(t=>(t=E({},t),t.annotations.forEach(r=>{r?.location?.version&&(e.find(a=>a.id===r?.location?.version?.id)||e.push(r?.location?.version))}),t)),this.componentConfigSignal().filters?.versions?.length&&this.componentConfigSignal.update(t=>(t=E({},t),t.filters.versions.forEach(r=>{e.find(a=>a.id===r?.id)||r?.id!=="unset"&&e.push(r)}),t)),this.componentConfigSignal.update(t=>(t=E({},t),t.versions=e?.sort((r,a)=>r?.id?.localeCompare(a?.id)),t.versions.push({id:"unset",name:"Not set"}),t)),this.componentConfigSignal().annotations?.length&&!this.componentConfigSignal().versions?.length&&this.updateFilter({key:"versions",value:null},!0)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setVersions: ",e)}}setPeople(){try{let e=[],t=[],r=[],a=[],s=this.componentConfigSignal().user;s?.userId&&(e.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s}),t.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s}),r.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s}),a.push({id:s.userId,name:s.name||s.email||s.userId||"",user:s})),this.componentConfigSignal().annotations&&this.componentConfigSignal.update(c=>(c=E({},c),c.annotations.forEach(p=>{p?.from?.userId&&c.user?.userId!==p?.from?.userId&&!e.find(g=>g.id===p?.from?.userId)&&e.push({id:p?.from?.userId,name:`${p?.from?.name||p?.from?.email}`,user:p?.from}),p?.assignedTo?.userId&&c.user?.userId!==p?.assignedTo?.userId&&!t.find(g=>g.id===p?.assignedTo?.userId)&&t.push({id:p?.assignedTo?.userId,name:`${p?.assignedTo?.name||p?.assignedTo?.email}`,user:p?.assignedTo}),p?.comments?.forEach(g=>{g?.taggedUserContacts?.forEach(f=>{f?.contact?.userId&&c.user?.userId!==f?.contact?.userId&&!r.find(I=>I.id===f?.contact?.userId)&&r.push({id:f?.contact?.userId,name:`${f?.contact?.name||f?.contact?.email}`,user:f?.contact})})}),p?.from?.userId&&c.user?.userId!==p?.from?.userId&&!a.find(g=>g.id===p?.from?.userId)&&a.push({id:p?.from?.userId,name:`${p?.from?.name||p?.from?.email}`,user:p?.from}),p?.assignedTo?.userId&&c.user?.userId!==p?.assignedTo?.userId&&!a.find(g=>g.id===p?.assignedTo?.userId)&&a.push({id:p?.assignedTo?.userId,name:`${p?.assignedTo?.name||p?.assignedTo?.email}`,user:p?.assignedTo}),p?.comments?.forEach(g=>{g?.taggedUserContacts?.forEach(f=>{f?.contact?.userId&&c.user?.userId!==f?.contact?.userId&&!a.find(I=>I.id===f?.contact?.userId)&&a.push({id:f?.contact?.userId,name:`${f?.contact?.name||f?.contact?.email}`,user:f?.contact})})})}),c)),this.componentConfigSignal().filters?.people?.length&&this.componentConfigSignal.update(c=>(c=E({},c),c.filters.people.forEach(p=>{e.find(g=>g.id===p?.id)||p?.id!=="other"&&e.push(p)}),c.filters.assigned.forEach(p=>{t.find(g=>g.id===p?.id)||p?.id!=="other"&&t.push(p)}),c.filters.tagged.forEach(p=>{r.find(g=>g.id===p?.id)||p?.id!=="other"&&r.push(p)}),c.filters.involved.forEach(p=>{a.find(g=>g.id===p?.id)||p?.id!=="other"&&a.push(p)}),c)),this.componentConfigSignal.update(c=>(c=D(E({},c),{peopleFilters:e,assignedFilters:t,taggedFilters:r,involvedFilters:a}),c)),this.componentConfigSignal().annotations?.length&&(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS)||(this.updateFilter({key:"people",value:null},!0),this.updateFilter({key:"assigned",value:null},!0),this.updateFilter({key:"tagged",value:null},!0),this.updateFilter({key:"involved",value:null},!0))),this.updatePeopleSelectedState()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setPeople: ",e)}}updatePeopleSelectedState(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.peopleFilters.forEach(t=>{let r=e.filters?.people?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e.assignedFilters.forEach(t=>{let r=e.filters?.assigned?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e.taggedFilters.forEach(t=>{let r=e.filters?.tagged?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e.involvedFilters.forEach(t=>{let r=e.filters?.involved?.find(a=>a.id===t?.id||a?.userId&&a?.userId===t?.user?.userId||a?.email&&a?.email===t?.user?.email);r?(t.selected=!0,r?.id||(r.id=t?.user?.userId)):t.selected=!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updatePeopleSelectedState: ",e)}}updateFilterConfig(e){try{if(e){let t=this.componentConfigSignal().filters,r=JSON.parse(sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS));r||(r={}),Object.keys(e).forEach(a=>{e[a]?.type==="custom"&&(r[a]?(t[a]=r[a],t[a+"Ids"]=r[a+"Ids"]):(t[a]=[],t[a+"Ids"]=[]))}),this.componentConfigSignal.update(a=>{let s=E(E({},this.defaultFilterConfig),e);return a=D(E({},a),{filterConfig:s,filters:t}),a}),this.setFiltersToStorage()}else this.componentConfigSignal.update(t=>(t=D(E({},t),{filterConfig:JSON.parse(JSON.stringify(this.defaultFilterConfig))}),t));this.updateGroupByOptions(),this.filterCommentAnnotations()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent updateFilterConfig: ",t)}}updateGroupByOptions(){try{let e={};this.componentConfigSignal.update(r=>(r=E({},r),Object.keys(r.filterConfig).forEach(a=>{let s=r.filterConfig[a];s.enableGrouping&&(e[a]=s.name)}),r.groupByOptions=JSON.parse(JSON.stringify(e)),r));let t=!1;this.componentConfigSignal().groupBy&&Object.keys(this.componentConfigSignal().groupByOptions).forEach(r=>{this.componentConfigSignal().groupByOptions[r]===this.componentConfigSignal().groupBy&&(t=!0)}),(!this.componentConfigSignal().groupBy||!t)&&this.componentConfigSignal.update(r=>(r=D(E({},r),{groupBy:Object.values(r.groupByOptions)[0]}),r))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateGroupByOptions: ",e)}}updateFilter(e,t=!1){let{key:r,value:a}=e;try{if(r)switch(r){case"statuses":if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{statuses:[],statusIds:[]})}),g)),this.resolvedCommentsOnDom=!0;else{let g=this.componentConfigSignal().filters?.statuses||[];g.find(f=>f.id===a.id)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.statuses=g.filter(I=>I.id!==a.id),f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters.statuses=[...g,a],f)),this.componentConfigSignal.update(f=>(f=D(E({},f),{filters:D(E({},f.filters),{statusIds:f.filters.statuses.map(I=>I?.id)})}),f))}break;case"pages":let s=this.componentConfigSignal().filters.pages||[];if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{pages:[]})}),g));else{let g=a?.id||a?.displayName;s.find(f=>f?.id===g||f?.displayName===g)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.pages=s.filter(I=>I?.id!==g&&I?.displayName!==g),f)):this.componentConfigSignal().filterConfig?.location?.multiSelection?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.pages=[...s,a],f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters.pages=[a],f))}this.sortPageFilters(),this.updatePageSelectedState();break;case"documents":let c=this.componentConfigSignal().filters.documents||[];if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{documents:[]})}),g));else{let g=a?.id;c.find(f=>f?.id===g)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters.documents=c.filter(I=>I?.id!==g),f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filterConfig?.document?.multiSelection?f.filters.documents=[...c,a]:f.filters.documents=[a],f))}this.updateDocumentSelectedState();break;case"people":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.people||[];return t?g.filters.people=[]:f.find(I=>I?.id===a?.id)?g.filters.people=f.filter(I=>I?.id!==a?.id):g.filterConfig?.people?.multiSelection?g.filters.people=[...f,a]:g.filters.people=[a],g}),this.updatePeopleSelectedState();break;case"tagged":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.tagged||[];return t?g.filters.tagged=[]:f.find(I=>I?.id===a?.id)?g.filters.tagged=f.filter(I=>I?.id!==a?.id):g.filterConfig?.tagged?.multiSelection?g.filters.tagged=[...f,a]:g.filters.tagged=[a],g}),this.updatePeopleSelectedState();break;case"assigned":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.assigned||[];return t?g.filters.assigned=[]:f.find(I=>I?.id===a?.id)?g.filters.assigned=f.filter(I=>I?.id!==a?.id):g.filterConfig?.assigned?.multiSelection?g.filters.assigned=[...f,a]:g.filters.assigned=[a],g}),this.updatePeopleSelectedState();break;case"involved":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.involved||[];return t?g.filters.involved=[]:f.find(I=>I?.id===a?.id)?g.filters.involved=f.filter(I=>I?.id!==a?.id):g.filterConfig?.involved?.multiSelection?g.filters.involved=[...f,a]:g.filters.involved=[a],g}),this.updatePeopleSelectedState();break;case"categories":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.categories||[];return t?g.filters.categories=[]:f.find(I=>I.id===a.id)?g.filters.categories=f.filter(I=>I!==a):g.filterConfig?.category?.multiSelection?g.filters.categories=[...f,a]:g.filters.categories=[a],g.filters.categoryIds=g.filters.categories?.map(I=>I.id),g});break;case"priorities":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.priorities||[];return t?g.filters.priorities=[]:f.find(I=>I.id===a.id)?g.filters.priorities=f.filter(I=>I.id!==a.id):g.filterConfig?.priority?.multiSelection?g.filters.priorities=[...f,a]:g.filters.priorities=[a],g.filters.priorityIds=g.filters.priorities?.map(I=>I.id),g});break;case"accessModes":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.accessModes||[];return t?g.filters.accessModes=[]:f.find(I=>I===a.id)?g.filters.accessModes=f.filter(I=>I!==a.id):g.filterConfig?.commentType?.multiSelection?g.filters.accessModes=[...f,a.id]:g.filters.accessModes=[a.id],g});break;case"versions":this.componentConfigSignal.update(g=>{g=E({},g);let f=g.filters.versions||[];return t?g.filters.versions=[]:f.find(I=>I.id===a.id)?g.filters.versions=f.filter(I=>I.id!==a.id):g.filterConfig?.version?.multiSelection?g.filters.versions=[...f,a]:g.filters.versions=[a],g.filters.versionIds=g.filters.versions?.map(I=>I?.id),g});break;default:let p=r+"Ids";if(this.componentConfigSignal().filterConfig[r]?.type==="custom")if(t)this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{[r]:[],[p]:[]})}),g)),this.resolvedCommentsOnDom=!0;else{let g=this.componentConfigSignal().filters?.[r]||[];this.componentConfigSignal().filterConfig[r]?.multiSelection?g.find(f=>f.id===a.id)?this.componentConfigSignal.update(f=>(f=E({},f),f.filters[r]=g.filter(I=>I.id!==a.id),f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters[r]=[...g,a],f)):this.componentConfigSignal.update(f=>(f=E({},f),f.filters[r]=[a],f)),this.componentConfigSignal.update(f=>(f=D(E({},f),{filters:D(E({},f.filters),{[p]:f.filters[r].map(I=>I?.id)})}),f))}else this.componentConfigSignal.update(g=>(g=D(E({},g),{filters:D(E({},g.filters),{[r]:a})}),g));break}this.filterCommentAnnotations(),this.setFiltersToStorage()}catch(s){this.loggingService.catch("Error in CommentsSidebarComponent updateFilter: ",s)}}sortPageFilters(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.filters?.pages?.sort((t,r)=>t?.id===e.location?.location?.id?-1:r?.id===e.location?.location?.id?1:t?.displayName?.localeCompare(r?.displayName)),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent sortPageFilters: ",e)}}updateAnnotationCountsByFilter(){try{if(!this.componentConfigSignal().filterCount)return;this.setAnnotationsCountPerPage(),this.setAnnotationsCountPerDocument(),this.setAnnotationsCountPerStatus(),this.setAnnotationsCountPerPeople(),this.setAnnotationsCountPerVersion(),this.setAnnotationsCountPerPriority(),this.setAnnotationsCountPerCommentCategory(),this.setAnnotationsCountPerAccessMode()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateAnnotationCountsByFilter: ",e)}}setAnnotationsCountPerPage(){try{this.componentConfigSignal().pages&&this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.pages).forEach(t=>{e.commentAnnotationsCountByFilters.page[t.id]=this.filterAnnotationsByPage(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerPage: ",e)}}setAnnotationsCountPerDocument(){try{this.componentConfigSignal().documents&&this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.documents).forEach(t=>{e.commentAnnotationsCountByFilters.document[t.id]=this.filterAnnotationsByDocument(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerDocument: ",e)}}setAnnotationsCountPerStatus(){try{let e=this.componentConfigSignal();[this.customFilterService.defaultStatus,...this.customFilterService.ongoingStatuses,this.customFilterService.resolvedStatus].forEach(t=>{e.commentAnnotationsCountByFilters.status[t.id]=this.filterAnnotationsByStatus(t,e.annotations)?.length}),this.componentConfigSignal.update(t=>(t=D(E({},t),{commentAnnotationsCountByFilters:E({},t.commentAnnotationsCountByFilters)}),t))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerStatus: ",e)}}setAnnotationsCountPerPeople(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.peopleFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.people[t.id]=this.filterAnnotationsByPeople(t,e.annotations)?.length}),e.taggedFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.tagged[t.id]=this.filterAnnotationsByTagged(t,e.annotations)?.length}),e.assignedFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.assigned[t.id]=this.filterAnnotationsByAssigned(t,e.annotations)?.length}),e.involvedFilters?.forEach(t=>{e.commentAnnotationsCountByFilters.involved[t.id]=this.filterAnnotationsByInvolved(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerPerson: ",e)}}setAnnotationsCountPerPriority(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.priorities.forEach(t=>{e.commentAnnotationsCountByFilters.priority[t.id]=this.filterAnnotationsByPriority(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerPriority: ",e)}}setAnnotationsCountPerCommentCategory(){try{this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.commentCategoryMap).forEach(t=>{e.commentAnnotationsCountByFilters.commentCategory[t.id]=this.filterAnnotationsByCommentCategory(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerCommentCategory: ",e)}}setAnnotationsCountPerAccessMode(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.accessModes.forEach(t=>{e.commentAnnotationsCountByFilters.accessMode[t.id]=this.filterAnnotationsByAccessMode(t.id,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerAccessMode: ",e)}}setAnnotationsCountPerVersion(){try{this.componentConfigSignal.update(e=>(e=E({},e),e.versions.forEach(t=>{e.commentAnnotationsCountByFilters.version[t.id]=this.filterAnnotationsByVersion(t,e.annotations)?.length}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setAnnotationsCountPerVersion: ",e)}}filterCommentAnnotations(){try{let e=this.componentConfigSignal(),t=!1,r=e.annotations.slice(),a=[],s=e.systemFiltersOperator;s===md.AND?a=e.annotations.slice():a=[],e.appliedFiltersCount=0;let c=!1,p=new Set,g=I=>{try{s===md.AND?a=a.filter(x=>I.some(B=>B.annotationId===x.annotationId)):I.forEach(x=>{p.add(x.annotationId)}),c=!0}catch{}};if(e.enablePriority&&e.filterConfig?.priority?.enable&&e.filters.priorities?.length){let I=[];e.filters.priorities?.forEach(x=>{I=[...I,...this.filterAnnotationsByPriority(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.location?.enable&&e.filters.pages?.length){let I=[];e.filters.pages?.forEach(x=>{I=[...I,...this.filterAnnotationsByPage(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filters.documents?.length){let I=[];e.filters.documents?.forEach(x=>{I=[...I,...this.filterAnnotationsByDocument(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.people?.enable&&e.filters.people?.length){let I=[];e.filters.people?.forEach(x=>{I=[...I,...this.filterAnnotationsByPeople(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.tagged?.enable&&e.filters.tagged?.length){let I=[];e.filters.tagged?.forEach(x=>{I=[...I,...this.filterAnnotationsByTagged(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.assigned?.enable&&e.filters.assigned?.length){let I=[];e.filters.assigned?.forEach(x=>{I=[...I,...this.filterAnnotationsByAssigned(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.involved?.enable&&e.filters.involved?.length){let I=[];e.filters.involved?.forEach(x=>{I=[...I,...this.filterAnnotationsByInvolved(x,r)]}),g(I),e.appliedFiltersCount++}if(e.enableAutoCategorize&&e.filterConfig?.category?.enable&&e.filters.categories?.length){let I=[];e.filters.categories?.forEach(x=>{I=[...I,...this.filterAnnotationsByCommentCategory(x,r)]}),g(I),e.appliedFiltersCount++}if(e.isPrivateCommentAllowed&&e.filterConfig?.commentType?.enable&&e.filters.accessModes?.length){let I=[];e.filters.accessModes?.forEach(x=>{I=[...I,...this.filterAnnotationsByAccessMode(x,r)]}),g(I),e.appliedFiltersCount++}if(e.filterConfig?.version?.enable&&e.filters.versions?.length){let I=[];e.filters.versions?.forEach(x=>{I=[...I,...this.filterAnnotationsByVersion(x,r)]}),g(I),e.appliedFiltersCount++}if(e.enableStatus&&e.filters.statuses?.length){let I=[];e.filters.statuses?.forEach(x=>{x.id===this.customFilterService.resolvedStatus.id&&(t=!0),I=[...I,...this.filterAnnotationsByStatus(x,r)]}),g(I),e?.filterConfig?.status?.enable&&e.appliedFiltersCount++}s!==md.AND&&(c?a=r.filter(I=>p.has(I.annotationId)):a=r),e.filters.input&&(a=this.filterAnnotationsByInput(e.filters.input,a));let f=a.slice();if(e.minimalFilter){!t&&e.minimalFilter==="resolved"||e.minimalFilter==="reset"?a=e.annotations.slice():a=f.slice();let I=a.length,x=0,B=0,z=0,W=0,J=0,ne=0;a=a.filter(ve=>{let _e=!1;switch(e.minimalFilter){case"all":!t&&!this.resolvedCommentsOnDom?_e=ve.status?.id!==this.customFilterService.resolvedStatus.id:_e=!0,_e&&z++;break;case"read":_e=!this.componentConfigSignal().unreadCommentsMap?.[ve.annotationId]&&ve.status?.id!==this.customFilterService.resolvedStatus.id,_e&&ne++;break;case"unread":let Fe=!!this.componentConfigSignal().unreadCommentsMap?.[ve.annotationId],Be=ve.status?.id!==this.customFilterService.resolvedStatus.id,Ie=!!this.componentConfigSignal().selectedAnnotationsMap[ve.annotationId];_e=Fe&&Be||Ie,_e&&B++;break;case"open":_e=ve.status?.type==="default",_e&&W++;break;case"resolved":_e=ve.status?.id===this.customFilterService.resolvedStatus.id,_e&&J++;break;case"assignedToMe":let be=e.user?.userId;_e=!!(be&&ve.assignedTo?.userId===be);break;case"reset":_e=!0,_e&&x++;break;default:_e=!0;break}return _e})}if(this.componentConfigSignal.update(I=>(I=D(E(E({},I),e),{filteredCommentPinAnnotations:a}),I)),!this.commentService.getSidebarCustomActionsValue()){let I=this.componentConfigSignal().embedMode||this.componentConfigSignal().sidebarVisible;this.commentService.setCommentsFromSidebarMap({comments:this.componentConfigSignal().skeletonLoading?void 0:a,sidebarVisible:!!I}),this.componentConfigSignal.update(x=>(x=E({},x),x.filteredCommentAnnotationsCount=a?.length||0,x))}this.groupFilteredCommentAnnotations(),!this.componentConfigSignal().sortData&&!this.componentConfigSignal().sortOrder&&this.sortComments(this.componentConfigSignal().selectedMinimalFilterDropdownOption.sorting)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent filterCommentAnnotations: ",e)}}toggleGroupedCommentAnnotations(e){try{e.isExpanded=!e.isExpanded,this.commentService.getSidebarCustomActionsValue()?(this.componentConfigSignal.update(t=>(t=E({},t),t)),this.updateVirtualScrollDataGroupToggle(this.componentConfigSignal().virtualScrollData)):this.setSidebarGroupedAnnotationsData()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent toggleGroupedCommentAnnotations: ",t)}}changeGroupBy(e){try{this.componentConfigSignal.update(t=>(t=E({},t),e?e===t.groupBy?t.groupBy=null:t.groupBy=e:t.groupBy=null,t)),sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY,this.componentConfigSignal().groupBy||""),this.groupFilteredCommentAnnotations()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent changeGroupBy: ",t)}}groupFilteredCommentAnnotations(){try{let e=this.filteredGroupedCommentAnnotationsObj,t=this.componentConfigSignal(),r=t.systemFiltersOperator===md.AND;switch(t.groupBy){case t.groupByOptions.people:let a=t.filters.people?.length&&r?t.filters.people:t.peopleFilters;this.filteredGroupedCommentAnnotationsObj={},a.forEach(W=>{let J=this.filterAnnotationsByPeople(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.peopleFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.assigned:let s=t.filters.assigned?.length&&r?t.filters.assigned:t.assignedFilters;this.filteredGroupedCommentAnnotationsObj={},s.forEach(W=>{let J=this.filterAnnotationsByAssigned(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.assignedFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.tagged:let c=t.filters.tagged?.length&&r?t.filters.tagged:t.taggedFilters;this.filteredGroupedCommentAnnotationsObj={},c.forEach(W=>{let J=this.filterAnnotationsByTagged(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.taggedFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.involved:let p=t.filters.involved?.length&&r?t.filters.involved:t.involvedFilters;this.filteredGroupedCommentAnnotationsObj={},p.forEach(W=>{let J=this.filterAnnotationsByInvolved(W,this.componentConfigSignal().filteredCommentPinAnnotations),ne=t.user?.userId===W.id;J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:ne?"Me":W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.involvedFilters.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])});break;case t.groupByOptions.page:case t.groupByOptions.location:t=this.componentConfigSignal();let g=t.filters.pages?.length&&r?t.filters.pages:Object.values(t.pages||{});g?.sort((W,J)=>W?.id===t.location?.location?.id||!t.location?.location?.id&&W?.id==="other"?-1:J?.id===t.location?.location?.id||!t.location?.location?.id&&J?.id==="other"?1:0),this.filteredGroupedCommentAnnotationsObj={},g.forEach(W=>{let J=W?.id===t?.location?.location?.id||W?.id==="other"&&!t?.location?.location?.id;this.locations&&Object.keys(this.locations||{}).forEach(ve=>{let _e=this.locations[ve]?.location;_e?.id&&_e?.id===W?.id&&(J=!0)});let ne=this.filterAnnotationsByPage(W,this.componentConfigSignal().filteredCommentPinAnnotations);if((W.id||W?.displayName)&&ne?.length){let ve=W.id||W?.displayName||"";this.filteredGroupedCommentAnnotationsObj[ve]={displayName:W.displayName,annotations:ne,isExpanded:e[ve]?e[ve]?.isExpanded:!!J}}}),this.filteredGroupedCommentAnnotations=[];let f=t?.filterConfig?.location?.order||[];if(f?.length){let W=J=>{let ne=f.indexOf(J?.id);return ne===-1?1/0:ne};g.sort((J,ne)=>{let ve=W(J),_e=W(ne);return ve!==_e?ve-_e:g.indexOf(J)-g.indexOf(ne)})}g.forEach(W=>{let J=W.id||W?.displayName||"";J&&this.filteredGroupedCommentAnnotationsObj[J]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[J])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;case t.groupByOptions.priority:let I=t.filters.priorities?.length&&r?t.filters.priorities:t.priorities;this.filteredGroupedCommentAnnotationsObj={},I.forEach(W=>{let J=this.filterAnnotationsByPriority(W,this.componentConfigSignal().filteredCommentPinAnnotations);J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],t.priorities.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;case t.groupByOptions.category:let x=t.filters.categories?.length&&r?t.filters.categories:Object.values(t.commentCategoryMap||{});this.filteredGroupedCommentAnnotationsObj={},x.forEach(W=>{let J=this.filterAnnotationsByCommentCategory(W,this.componentConfigSignal().filteredCommentPinAnnotations);J?.length&&(this.filteredGroupedCommentAnnotationsObj[W.id]={displayName:W.name,annotations:J,isExpanded:e[W.id]?e[W.id]?.isExpanded:!0})}),this.filteredGroupedCommentAnnotations=[],x.forEach(W=>{this.filteredGroupedCommentAnnotationsObj[W.id]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[W.id])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;case t.groupByOptions.document:t=this.componentConfigSignal();let B=t.filters.documents?.length&&r?t.filters.documents:Object.values(t.documents||{});B?.sort((W,J)=>W?.id===t.currentDocument?-1:J?.id===t.currentDocument?1:0),this.filteredGroupedCommentAnnotationsObj={},B.forEach(W=>{let J=W?.id===t?.currentDocument,ne=this.filterAnnotationsByDocument(W,this.componentConfigSignal().filteredCommentPinAnnotations);if(W.id&&ne?.length){let ve=W.id||"";this.filteredGroupedCommentAnnotationsObj[ve]={displayName:W.documentName||W.id||"",annotations:ne,isExpanded:e[ve]?e[ve]?.isExpanded:!!J}}}),this.filteredGroupedCommentAnnotations=[];let z=t?.filterConfig?.document?.order||[];if(z?.length){let W=J=>{let ne=z.indexOf(J?.id);return ne===-1?1/0:ne};B.sort((J,ne)=>{let ve=W(J),_e=W(ne);return ve!==_e?ve-_e:B.indexOf(J)-B.indexOf(ne)})}B.forEach(W=>{let J=W.id;J&&this.filteredGroupedCommentAnnotationsObj[J]&&this.filteredGroupedCommentAnnotations.push(this.filteredGroupedCommentAnnotationsObj[J])}),this.componentConfigSignal.update(W=>(W=E(E({},W),t),W));break;default:this.filteredGroupedCommentAnnotationsObj={},this.filteredGroupedCommentAnnotationsObj={[this.pageTypes.all]:{displayName:this.pageTypes.all,annotations:this.componentConfigSignal().filteredCommentPinAnnotations,isExpanded:e[this.pageTypes.all]?e[this.pageTypes.all]?.isExpanded:!0}},this.filteredGroupedCommentAnnotations=[this.filteredGroupedCommentAnnotationsObj[this.pageTypes.all]];break}this.setSidebarGroupedAnnotationsData()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent groupFilteredCommentAnnotations: ",e)}}setSidebarGroupedAnnotationsData(){try{if(this.commentService.getSidebarCustomActionsValue()){if(this.commentService.getSidebarCustomActionsValue()&&this.dataAvailable){let e={};Object.keys(this.componentConfigSignal().filterConfig||{}).forEach(t=>{this.componentConfigSignal().filterConfig[t]?.type==="custom"&&(e[t]=this.componentConfigSignal().filterConfig[t]?.options?.map(r=>({id:r.id,name:r.name,selected:this.componentConfigSignal().filters[t+"Ids"]?.includes(r.id)})))}),this.componentConfigSignal.update(t=>(t=D(E({},t),{customFilters:e}),t)),this.commentService.getSidebarCustomActionEventDataOnInitValue()?this.commentService.setSidebarCustomActionEventDataAllChanges(this.componentConfigSignal().customActionsState,this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,e):this.commentService.setSidebarCustomActionEventDataOnInit(this.componentConfigSignal().customActionsState,this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,e)}}else{let e=this.filteredGroupedCommentAnnotations.length===1&&this.filteredGroupedCommentAnnotations[0].displayName==="Others";this.componentConfigSignal.update(r=>(r=E({},r),r.virtualScrollData=[],r)),this.filteredGroupedCommentAnnotations.forEach(r=>{!e&&r.annotations?.length&&this.componentConfigSignal.update(a=>(a=E({},a),a.virtualScrollData.push({type:"group",data:r}),a)),(r.isExpanded||e)&&r.annotations.forEach(a=>{this.componentConfigSignal.update(s=>(s=E({},s),s.virtualScrollData.push({type:"annotation",data:a}),s))})}),this.componentConfigSignal.update(r=>(r=D(E({},r),{noCommentsFoundForAppliedFilters:!this.componentConfigSignal().virtualScrollData?.length}),r)),this.cd.markForCheck();let t=this.componentConfigSignal().virtualScrollViewportRef?.elementRef?.nativeElement;t&&(t.scrollTop=0)}}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setSidebarGroupedAnnotationsData: ",e)}}filterAnnotationsByPage(e,t){try{return t?.filter(r=>e?.locationIds?.length?r?.locationId?r?.location?.id===e?.id||e?.locationIds?.includes(r?.locationId):r?.documentParams?.id===e?.id||e?.locationIds?.includes(r?.documentParamsId):!r?.locationId&&!r?.documentParamsId)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByPage: ",r),[]}}filterAnnotationsByStatus(e,t){try{return t.filter(r=>r?.status?.id===e.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByStatus: ",r),[]}}filterAnnotationsByPeople(e,t){try{return e.id?t.filter(r=>r?.from?.userId===e?.id||r?.from?.email===e?.id):t}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByPeople: ",r),[]}}filterAnnotationsByTagged(e,t){try{return e.id===this.componentConfigSignal().user?.userId?t.filter(r=>{let a=!1;return r.comments.forEach(s=>{s.taggedUserContacts?.forEach(c=>{c?.contact?.userId===this.componentConfigSignal().user?.userId&&(a=!0)})}),a}):t.filter(r=>r?.comments?.some(a=>a?.taggedUserContacts?.some(s=>s?.contact?.userId===e?.id)))}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByTagged: ",r),[]}}filterAnnotationsByAssigned(e,t){try{return e.id===this.componentConfigSignal().user?.userId?t.filter(r=>r?.assignedTo?.userId===this.componentConfigSignal().user?.userId):t.filter(r=>r?.assignedTo?.userId===e?.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByAssigned: ",r),[]}}filterAnnotationsByInvolved(e,t){try{return t.filter(r=>{let a=r?.from?.userId===e?.id||r?.from?.email===e?.id,s=r?.assignedTo?.userId===e?.id,c=r?.comments?.some(p=>p?.taggedUserContacts?.some(g=>g?.contact?.userId===e?.id));return a||s||c})}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByInvolved: ",r),[]}}filterAnnotationsByPriority(e,t){try{return e.id==="unset"?t.filter(r=>!r?.priority):t.filter(r=>r?.priority?.id===e.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByPriority: ",r),[]}}filterAnnotationsByCommentCategory(e,t){try{switch(e?.id){case"other":return t?.filter(r=>!r?.commentCategories?.length||r?.commentCategories?.find(a=>a?.id===e?.id))}return t?.filter(r=>(r?.commentCategories||[])?.find(a=>a?.id===e?.id))}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByCommentCategory: ",r),[]}}filterAnnotationsByAccessMode(e,t){try{return e===ho.PRIVATE?t.filter(r=>r?.iam?.accessMode===ho.PRIVATE):t.filter(r=>!r?.iam?.accessMode||r?.iam?.accessMode===ho.PUBLIC)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByAccessMode: ",r),[]}}filterAnnotationsByVersion(e,t){try{return e.id==="unset"?t.filter(r=>!r?.location?.version):t.filter(r=>r?.location?.version?.id===e.id)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByVersion: ",r),[]}}filterAnnotationsByInput(e,t){try{let r=e.match(/^#(\d+)$/);if(r){let a=parseInt(r[1]);return t.filter(s=>s.annotationNumber===a)}return t.filter(a=>{let s=!1;for(let c=0;c<a?.comments?.length;c++){let p=a?.comments[c];if(p?.commentText?.toLowerCase().includes(e.toLowerCase())){s=!0;break}else if(p?.from?.name?.toLowerCase().includes(e.toLowerCase())){s=!0;break}}return s})}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByInput: ",r),[]}}closeSidebar(){try{this.commentService.setSidebarVisibility(!1,!1,!0),this.onSidebarClose.emit()}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent closeSidebar: ",e)}}emitOnSidebarCommentClick(e){try{let t=this.documentPaths?.clientDocumentId,r=e?.location;r||(r=e?.documentParams);let a={};e.context&&(a=e.context),this.onSidebarCommentClick.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e}),this.onSidebarCommentClickEvent.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e}),this.onCommentClick.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e}),this.commentService.onSidebarCommentClick({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onSidebarCommentClick: ",t)}}emitOnCommentNavigationButtonClick(e){try{let t=this.documentPaths?.clientDocumentId,r=e?.location;r||(r=e?.documentParams);let a={};e.context&&(a=e.context),this.onCommentNavigationButtonClick.emit({documentId:t,location:r,targetElementId:e?.targetElementId,context:a,annotation:e})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent emitOnCommentNavigationButtonClick: ",t)}}setFiltersToStorage(){try{let e=JSON.parse(JSON.stringify(this.componentConfigSignal().filters));delete e?.input;let t=JSON.stringify(e);sessionStorage.setItem(U.SESSION_STORAGE.SNIPPYLY_COMMENT_SIDEBAR_FILTERS,t)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setFiltersToStorage: ",e)}}setCommentSidebarInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(df.COMMENT_SIDEBAR)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentSidebarInstalledInAnalytics: ",e)}}setCommentSidebarEmbedModeInAnalytics(){try{this.componentConfigSignal().embedMode&&this.analyticsService.trackEvent(Y.Events.Comments.COMMENT_SIDEBAR_EMBED_MODE_ENABLED,{commentMode:this.commentService.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentSidebarEmbedModeInAnalytics: ",e)}}setCommentSidebarFloatingModeInAnalytics(){try{this.componentConfigSignal().floatingMode&&this.analyticsService.trackEvent(Y.Events.Comments.COMMENT_SIDEBAR_FLOATING_MODE_ENABLED,{commentMode:this.commentService.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentSidebarFloatingModeInAnalytics: ",e)}}setCommentReadInAnalytics(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentReadInAnalytics","color: green;"),this.commentReadAnalyticsCalled||(this.commentReadAnalyticsCalled=!0,this.analyticsService.trackEvent(Y.Events.Comments.COMMENT_READ,{uiLocation:"sidebar",commentMode:this.commentService.getCommentMode(),readType:"hover"}))}catch(e){this.loggingService.catch("Error in CommentDialogComponent setCommentReadInAnalytics: ",e)}}toggleMoreFilters(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{moreFiltersVisible:!t.moreFiltersVisible}),t)),e&&e?.scrollTo({top:0})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent toggleMoreFilters: ",t)}}closeMoreFilters(e){try{this.componentConfigSignal.update(t=>(t=D(E({},t),{moreFiltersVisible:!1,filterRecentlyClosed:!0}),t)),e&&e?.scrollTo({top:0}),setTimeout(()=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{filterRecentlyClosed:!1}),t))},100)}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent closeMoreFilters: ",t)}}openMoreFilters(e){try{if(this.componentConfigSignal().filterRecentlyClosed)return;this.componentConfigSignal.update(t=>(t=D(E({},t),{moreFiltersVisible:!0}),t)),e&&e?.scrollTo({top:0})}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent openMoreFilters: ",t)}}savePageComment(e){try{let t=e?.updatedComment;if(t){let r=this.componentConfigSignal().targetElementIdFromPageModeComposer;this.commentService.addComment(void 0,void 0,void 0,void 0,!0,[t],void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,e?.annotation?.assignedTo,void 0,void 0,this.componentConfigSignal().context,void 0,void 0,r||void 0)}this.commentService.clearPageModeComposerContext(),this.componentConfigSignal.update(r=>(r=E({},r),r.pageCommentAnnotation=new Zo,r.pageCommentAnnotation.isPageAnnotation=!0,r))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent savePageComment: ",t)}}sortComments(e){try{this.componentConfigSignal.update(t=>{let r=[...t.virtualScrollData];return r.sort((a,s)=>{if(a.type==="annotation"&&s.type==="annotation"){if(e==="date"){let c=new Date(a.data.lastUpdated).getTime();return new Date(s.data.lastUpdated).getTime()-c}else if(e==="unread"){let c=t.unreadCommentsMap?.[a.data.annotationId]||0,p=t.unreadCommentsMap?.[s.data.annotationId]||0;if(c>0&&p===0)return-1;if(c===0&&p>0)return 1;let g=new Date(a.data.lastUpdated).getTime();return new Date(s.data.lastUpdated).getTime()-g}}return 0}),t=D(E({},t),{virtualScrollData:r}),t}),this.componentConfigSignal.update(t=>(t=D(E({},t),{minimalFilterDropdownOpen:!1,selectedMinimalFilterDropdownOption:D(E({},t.selectedMinimalFilterDropdownOption),{sorting:e})}),t))}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent sortComments: ",t)}}toggleMinimalFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalFilterDropdownOpen:!e.minimalFilterDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleMinimalFilterDropdown: ",e)}}filterCommentsByReadStatus(e){try{this.componentConfigSignal.update(t=>{let a=t.selectedMinimalFilterDropdownOption?.filter===e?"reset":e;return t=D(E({},t),{minimalFilter:a,minimalFilterDropdownOpen:!1,selectedMinimalFilterDropdownOption:D(E({},t.selectedMinimalFilterDropdownOption),{filter:a})}),t}),this.filterCommentAnnotations()}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent filterCommentsByReadStatus: ",t)}}resetFilters(){try{this.componentConfigSignal.update(e=>{let t=e.filters;return Object.keys(t).forEach(r=>{t[r]?.length&&(t[r]=[])}),e=D(E({},e),{minimalFilter:"all",customActionsState:{all:!0},filters:D(E({},t),{input:""}),selectedMinimalFilterDropdownOption:D(E({},e.selectedMinimalFilterDropdownOption),{filter:"all"})}),e}),this.resolvedCommentsOnDom=!1,this.filterCommentsByReadStatus("all"),this.updateFilter({key:"pages",value:null},!0),this.updateFilter({key:"documents",value:null},!0),this.updateFilter({key:"people",value:null},!0),this.updateFilter({key:"assigned",value:null},!0),this.updateFilter({key:"tagged",value:null},!0),this.updateFilter({key:"statuses",value:null},!0),this.updateFilter({key:"priorities",value:null},!0),this.updateFilter({key:"categories",value:null},!0),this.updateFilter({key:"versions",value:null},!0),sessionStorage.removeItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent resetFilters: ",e)}}toggleLocationFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{locationFilterDropdownOpen:!e.locationFilterDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleLocationFilterDropdown: ",e)}}toggleDocumentFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{documentFilterDropdownOpen:!e.documentFilterDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleDocumentFilterDropdown: ",e)}}closeDocumentFilterDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{documentFilterDropdownOpen:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent closeDocumentFilterDropdown: ",e)}}toggleMinimalActionsDropdown(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalActionsDropdownOpen:!e.minimalActionsDropdownOpen}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent toggleMinimalActionsDropdown: ",e)}}markAllCommentAnnotationsAsRead(){try{this.commentService.setCommentAnnotationsAsRead(this.componentConfigSignal().filteredCommentPinAnnotations),this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalActionsDropdownOpen:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent setCommentAnnotationsAsRead: ",e)}}markAllCommentAnnotationsAsResolved(){try{this.commentService.setCommentAnnotationsAsResolved(this.componentConfigSignal().filteredCommentPinAnnotations),this.componentConfigSignal.update(e=>(e=D(E({},e),{minimalActionsDropdownOpen:!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent markAllCommentAnnotationsAsResolved: ",e)}}toggleCustomAction(e,t){try{t==="toggle"?(this.componentConfigSignal.update(r=>(r=D(E({},r),{customActionsState:{[e]:!r.customActionsState[e]}}),r)),sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE,JSON.stringify(this.componentConfigSignal().customActionsState)),this.commentService.setSidebarCustomActionEventData(this.componentConfigSignal().customActionsState,this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,this.componentConfigSignal().customFilters)):(this.commentService.setSidebarCustomActionEventData({[e]:!0},this.componentConfigSignal().annotations,this.componentConfigSignal().unreadCommentsMap,this.componentConfigSignal().filteredCommentPinAnnotations,this.componentConfigSignal().customFilters),sessionStorage.setItem(U.SESSION_STORAGE.VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE,JSON.stringify({[e]:!0})))}catch(r){this.loggingService.catch("Error in CommentsSidebarComponent toggleCustomAction: ",r)}}goBackToAllComments(){try{let e=this.componentConfigSignal().focusedAnnotation;this.componentConfigSignal.update(t=>(t=D(E({},t),{focusedAnnotation:null,focusedAnnotationEditCommentIndex:null}),t)),e&&(this.domService.toggleAnnotationSelection(e),setTimeout(()=>{this.goToAnnotationInSidebar(e,"instant")},100))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent goBackToAllComments: ",e)}}filterSearch(e,t){try{let r=this.componentConfigSignal();if(!r?.peopleFilters)return;let a,s;switch(t){case"people":a=r.peopleFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"assigned":a=r.assignedFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"tagged":a=r.taggedFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"involved":a=r.involvedFilters,!e||e===""?s=a:s=a.filter(c=>c?.name?.toLowerCase().includes(e.toLowerCase()));break;case"pages":a=r.pages,!e||e===""?s=r.pages:(s={},Object.keys(a).filter(p=>p.toLowerCase().includes(e.toLowerCase())).forEach(p=>{s[p]=a[p]}));break;case"documents":a=r.documents,!e||e===""?s=r.documents:(s={},Object.keys(a).filter(p=>a[p]?.documentName?.toLowerCase().includes(e.toLowerCase())).forEach(p=>{s[p]=a[p]}));break;case"statuses":a=r.statuses,!e||e===""?s=a:s=a.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break;case"priorities":a=r.priorities,!e||e===""?s=a:s=a.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break;case"categories":a=r.commentCategoryMap,!e||e===""?s=r.commentCategoryMap:(s={},Object.keys(a).filter(p=>p.toLowerCase().includes(e.toLowerCase())).forEach(p=>{s[p]=a[p]}));break;case"versions":a=r.versions,!e||e===""?s=r.versions:s=a.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break;default:a=r.filterConfig[t]?.options,!e||e===""?s=r.filterConfig[t]?.options:s=a?.filter(c=>c.name.toLowerCase().includes(e.toLowerCase()));break}return s}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterPeople: ",r),[]}}updateDocumentSelectedState(){try{this.componentConfigSignal.update(e=>(e=E({},e),Object.values(e.documents).forEach(t=>{let r=e.filters?.documents?.find(a=>a.id===t?.id);r?(t.selected=!0,r.documentName||(r.documentName=t.documentName)):t.selected=!1}),e))}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent updateDocumentSelectedState: ",e)}}filterAnnotationsByDocument(e,t){try{return t?.filter(r=>e?.id&&e.id!=="other"?r?.metadata?.clientDocumentId?.toString()===e.id:!r?.metadata?.clientDocumentId)}catch(r){return this.loggingService.catch("Error in CommentsSidebarComponent filterAnnotationsByDocument: ",r),[]}}onDialogExpanded(e){try{setTimeout(()=>{let t=this.componentConfigSignal().annotations.find(r=>r.annotationId===e);t&&this.goToAnnotationInSidebar(t)},200)}catch(t){this.loggingService.catch("Error in CommentsSidebarComponent onDialogExpanded: ",t)}}onFullscreenClick(){try{this.componentConfigSignal.update(e=>(e=D(E({},e),{fullScreen:!e.fullScreen}),e)),this.onFullscreen.emit(this.componentConfigSignal().fullScreen)}catch(e){this.loggingService.catch("Error in CommentsSidebarComponent onFullscreenClick: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(we),h(Ft),h(Ve),h(ot),h(R),h(xn),h(_),h(Oo),h(Wo),h(Ll),h(an),h(Ge),h(Yi),h(z1),h(Ke))},o.\u0275cmp=O({type:o,selectors:[["app-comments-sidebar"]],viewQuery:function(t,r){if(t&1&&(it(iin,5),it(oin,7)),t&2){let a;et(a=tt())&&(r.sidebarOverlay=a.first),et(a=tt())&&(r.hostElement=a.first)}},hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{embedMode:"embedMode",floatingMode:"floatingMode",_pageMode:[0,"pageMode","_pageMode"],_filterCount:[0,"filterCount","_filterCount"],_customActions:[0,"customActions","_customActions"],focusedThreadMode:"focusedThreadMode",_openAnnotationInFocusMode:[0,"openAnnotationInFocusMode","_openAnnotationInFocusMode"],_readOnly:[0,"readOnly","_readOnly"],_selection:[0,"dialogSelection","_selection"],_forceClose:[0,"forceClose","_forceClose"],_expandOnSelection:[0,"expandOnSelection","_expandOnSelection"],_sortData:[0,"sortData","_sortData"],_sortOrder:[0,"sortOrder","_sortOrder"],_sortBy:[0,"sortBy","_sortBy"],enableUrlNavigation:"enableUrlNavigation",urlNavigation:"urlNavigation",_queryParamsComments:[0,"queryParamsComments","_queryParamsComments"],_fullScreen:[0,"fullScreen","_fullScreen"],_currentLocationSuffix:[0,"currentLocationSuffix","_currentLocationSuffix"],_filterOptionLayout:[0,"filterOptionLayout","_filterOptionLayout"],_filterConfig:[0,"filterConfig","_filterConfig"],_groupConfig:[0,"groupConfig","_groupConfig"],_filters:[0,"filters","_filters"],_systemFiltersOperator:[0,"systemFiltersOperator","_systemFiltersOperator"],_excludeLocationIds:[0,"excludeLocationIds","_excludeLocationIds"],_fullExpanded:[0,"fullExpanded","_fullExpanded"],_sidebarButtonCountType:[0,"sidebarButtonCountType","_sidebarButtonCountType"],_filterGhostCommentsInSidebar:[0,"filterGhostCommentsInSidebar","_filterGhostCommentsInSidebar"],dialogVariant:"dialogVariant",focusedThreadDialogVariant:"focusedThreadDialogVariant",filterPanelLayout:"filterPanelLayout",pageModeComposerVariant:"pageModeComposerVariant",searchPlaceholder:"searchPlaceholder",commentPlaceholder:"commentPlaceholder",replyPlaceholder:"replyPlaceholder",pageModePlaceholder:"pageModePlaceholder",_sidebarShadowDOM:[0,"shadowDom","_sidebarShadowDOM"],_context:[0,"context","_context"],_defaultMinimalFilter:[0,"defaultMinimalFilter","_defaultMinimalFilter"],variant:"variant",position:"position"},outputs:{openSidebar:"openSidebar",onSidebarOpen:"onSidebarOpen",onSidebarCommentClick:"sidebarCommentClick",onSidebarCommentClickEvent:"onSidebarCommentClick",onCommentClick:"onCommentClick",onSidebarClose:"onSidebarClose",onCommentNavigationButtonClick:"onCommentNavigationButtonClick",onFullscreen:"onFullscreenClick"},standalone:!1,features:[L,Qe],decls:1,vars:1,consts:[["sidebarRef",""],["defaultSidebarMode",""],["sidebarTrigger","cdkOverlayOrigin"],["sidebarOverlay","cdkConnectedOverlay"],[4,"ngIf"],[3,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["cdkOverlayOrigin",""],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass"],["class","velt-comments-sidebar-container",3,"dark",4,"ngIf"],[1,"velt-comments-sidebar-container"],["role","dialog",3,"onWrapperClick","componentConfigSignal","template","darkMode"]],template:function(t,r){t&1&&u(0,fin,4,1,"ng-container",4),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,Dt,dn,sn,Sn,rye,ge],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}[_nghost-%COMP%]{width:100%} .snippyly-sidebar-panel .viewport .cdk-virtual-scroll-content-wrapper{max-width:100%}.s-overflow-hidden[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0});let i=o;return i})();function vin(i,o){if(i&1&&(y(0,"snippyly-cursor-pointer",5)(1,"slot",6),ce(),y(2,"svg",7)(3,"g",8),w(4,"path",9)(5,"path",10),b(),y(6,"defs")(7,"filter",11),w(8,"feFlood",12)(9,"feColorMatrix",13)(10,"feOffset",14)(11,"feGaussianBlur",15)(12,"feColorMatrix",16)(13,"feBlend",17)(14,"feBlend",18),b()()()()()),i&2){let n=l().$implicit,e=l(2).ngIf,t=l();d("cursorUser",n)("avatarMode",t.avatarMode)("huddleState",e.huddleOnCursorModeByAttendeeId[n==null?null:n.userSnippylyId]?e.attendeesByUserId[n==null?null:n.userSnippylyId]==null?null:e.attendeesByUserId[n==null?null:n.userSnippylyId].state:void 0)("stream",e.huddleOnCursorModeByAttendeeId[n==null?null:n.userSnippylyId]?e.remoteStreamsByUserId[n==null?null:n.userSnippylyId]==null?null:e.remoteStreamsByUserId[n==null?null:n.userSnippylyId].webcam:void 0),m(4),T("fill",n.color),m(),T("fill",n.color)}}function Cin(i,o){if(i&1&&(v(0),u(1,vin,15,6,"snippyly-cursor-pointer",4),C()),i&2){let n=o.$implicit;m(),d("ngIf",n==null?null:n.position)}}function _in(i,o){if(i&1&&(y(0,"snippyly-cursor-pointer",19)(1,"slot",6),ce(),y(2,"svg",7)(3,"g",8),w(4,"path",9)(5,"path",10),b(),y(6,"defs")(7,"filter",11),w(8,"feFlood",12)(9,"feColorMatrix",13)(10,"feOffset",14)(11,"feGaussianBlur",15)(12,"feColorMatrix",16)(13,"feBlend",17)(14,"feBlend",18),b()()()()()),i&2){let n=l(2).ngIf,e=l();d("cursorUser",n.currentCursorUser)("selfCursorPointer",!0)("avatarMode",e.avatarMode)("huddleState",n.huddleOnCursorMode?n.attendeesByUserId[n.currentCursorUser==null?null:n.currentCursorUser.userSnippylyId]==null?null:n.attendeesByUserId[n.currentCursorUser==null?null:n.currentCursorUser.userSnippylyId].state:void 0)("stream",n.localStream),m(4),T("fill",n.currentCursorUser.color),m(),T("fill",n.currentCursorUser.color)}}function yin(i,o){if(i&1&&u(0,Cin,2,1,"ng-container",2)(1,_in,15,7,"snippyly-cursor-pointer",3),i&2){let n=l().ngIf,e=l();d("ngForOf",n.cursorUsers)("ngForTrackBy",e.trackById),m(),d("ngIf",n.huddleJoined&&n.huddleOnCursorMode&&n.currentCursorUser)}}function Sin(i,o){if(i&1&&(v(0),u(1,yin,2,3,"ng-template",1),C()),i&2){let n=o.ngIf;m(),d("ngIf",n.isFirstComponent&&!(n.user!=null&&n.user.isAnonymous))}}var Fq=(()=>{let o=class o{get inactivityTime(){return this._inactivityTime}set inactivityTime(e){try{isNaN(e)?this.loggingService.catch("Error in Cursor set inactivityTime: ","inactivity-time value is not a number."):(this._inactivityTime=e,this.cursorService.setInactivityTime(this._inactivityTime))}catch(t){this.loggingService.catch("Error in Cursor set inactivityTime: ",t)}}get allowedElementIds(){return this._allowedElementIds}set allowedElementIds(e){try{this._allowedElementIds=typeof e=="string"?JSON.parse(e):e,this.cursorService.setAllowedElementIds(this._allowedElementIds)}catch(t){this.loggingService.catch("Error in Cursor set allowedElementIds: ",t)}}constructor(e,t,r,a,s,c){this.analyticsService=e,this.authService=t,this.cursorService=r,this.domService=a,this.huddleService=s,this.loggingService=c,this.avatarMode=!1,this.onCursorUsersChanged=new Me,this.onCursorUserChange=new Me,this.subscriptions=[],this.constants=U,this.showInitials={},this.componentConfigSignal=Te({isFirstComponent:!1,user:void 0,cursorUsers:[],huddleOnCursorModeByAttendeeId:{},attendeesByUserId:{},remoteStreamsByUserId:{},huddleOnCursorMode:!1,huddleJoined:!1,currentCursorUser:new LC,localStream:void 0}),this.veltId=vt(),this.veltElement=!0,this._inactivityTime=5,this._allowedElementIds=[],this.loggingService.log("%c[WB] Creating CLASS: CursorComponent","color: blue;")}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;")}ngAfterViewInit(){try{let e=document.querySelector(U.TAGS.SNIPPYLY_CURSOR),t=document.querySelector(U.TAGS.VELT_CURSOR);t?this.veltId===t?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),this.initComponent()):this.veltId===e?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>(r=D(E({},r),{isFirstComponent:!0}),r)),this.initComponent())}catch(e){this.loggingService.catch("Error in CursorComponent AfterViewInit: ",e)}}initComponent(){try{this.cursorService.checkCursorTagAvailable(),this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{user:e}),t)),this.componentConfigSignal().user&&this.setCursorInstalledInAnalytics()},e=>{this.loggingService.catch("Error in CursorComponent getUser$ subscription: ",e)})),this.subscriptions.push(this.huddleService.getHuddleJoined$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{huddleJoined:e}),t))})),this.subscriptions.push(this.huddleService.getHuddleOnCursorMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{huddleOnCursorMode:e}),t))},e=>{this.loggingService.catch("Error in CursorComponent getHuddleOnCursorMode$ subscription: ",e)})),this.subscriptions.push(this.huddleService.localStream$.subscribe(e=>{e?this.componentConfigSignal.update(t=>(t=D(E({},t),{localStream:e}),t)):this.componentConfigSignal.update(t=>(t=D(E({},t),{localStream:void 0}),t))})),this.subscriptions.push(this.huddleService.getRemoteStreamsByUserId$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{remoteStreamsByUserId:e}),t))},e=>{this.loggingService.catch("Error in CursorComponent getRemoteStreamsByUserId$ subscription: ",e)})),this.subscriptions.push(this.huddleService.getHuddleAttendees$().subscribe(e=>{let t={};e?t=e.reduce((r,a)=>(r[a.userSnippylyId]=a,r),{}):t={},this.componentConfigSignal.update(r=>(r=D(E({},r),{attendeesByUserId:t}),r))},e=>{this.loggingService.catch("Error in CursorComponent getAttendees$ subscription: ",e)})),this.subscriptions.push(this.huddleService.getHuddleOnCursorModeByAttendeeId$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{huddleOnCursorModeByAttendeeId:e}),t))})),this.subscriptions.push(this.domService.onWindowPointerMove$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{currentCursorUser:D(E({},t.currentCursorUser),{position:{left:(e?.clientX||0)-2,top:(e?.clientY||0)-2}})}),t))},e=>{this.loggingService.catch("Error in CursorComponent onWindowPointerMove$ subscription: ",e)})),this.getCurrentCursorUser(),this.getLiveCursorsOnCurrentDocument()}catch(e){this.loggingService.catch("Error in CursorComponent initComponent: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(e){this.loggingService.catch("Error in CursorComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in CursorComponent unsubscribe: ",e)}}getLiveCursorsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getLiveCursorsOnCurrentDocument","color: green;");try{this.subscriptions.push(this.cursorService.getLiveCursorsOnCurrentDocument().pipe(Le(e=>!!e)).subscribe(e=>{this.loggingService.log(e),e&&(this.componentConfigSignal.update(t=>(t=D(E({},t),{cursorUsers:e}),t)),this.onCursorUsersChanged.emit(e),this.onCursorUserChange.emit(e))},e=>{this.loggingService.catch("Error in CursorComponent getLiveCursorsOnCurrentDocument subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CursorComponent getLiveCursorsOnCurrentDocument: ",e)}}getCurrentCursorUser(){this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentCursorUser","color: green;");try{this.subscriptions.push(this.cursorService.getCursorUser().pipe(Le(e=>!!e)).subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{currentCursorUser:D(E({},e),{position:t.currentCursorUser?.position})}),t))},e=>{this.loggingService.catch("Error in CursorComponent getCurrentCursorUser subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CursorComponent getCurrentCursorUser: ",e)}}trackById(e,t){return t?.userId}onImageLoadError(e){this.loggingService.log("%c[WB] Calling FUNCTION: onImageLoadError","color: green;");try{this.showInitials[e.userId]=!0}catch(t){this.loggingService.catch("Error in CursorComponent onImageLoadError: ",t)}}setCursorInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(Ne.CURSOR)}catch(e){this.loggingService.catch("Error in CursorComponent setCursorInstalledInAnalytics: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(ZC),h(Ve),h(Or),h(_))},o.\u0275cmp=O({type:o,selectors:[["app-cursor"]],hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{avatarMode:"avatarMode",inactivityTime:"inactivityTime",allowedElementIds:"allowedElementIds"},outputs:{onCursorUsersChanged:"cursorUsersChanged",onCursorUserChange:"onCursorUserChange"},standalone:!1,decls:1,vars:1,consts:[[4,"ngIf"],[3,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"cursorUser","selfCursorPointer","avatarMode","huddleState","stream",4,"ngIf"],[3,"cursorUser","avatarMode","huddleState","stream",4,"ngIf"],[3,"cursorUser","avatarMode","huddleState","stream"],["name","cursor"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"cursor-icon"],["filter","url(#filter0_d_6047_31299)"],["d","M7.68749 16.5142L5.42791 5.15177C5.26065 4.31067 6.16027 3.66301 6.90484 4.08848L16.8788 9.78786C17.6558 10.2319 17.503 11.3948 16.6376 11.623L12.3849 12.7447C12.1377 12.8098 11.9249 12.9672 11.7902 13.1844L9.51802 16.8464C9.03968 17.6174 7.86445 17.4041 7.68749 16.5142Z","fill","#625DF5"],["d","M4.93751 5.24929L7.19709 16.6118C7.46253 17.9466 9.22538 18.2664 9.94288 17.11L12.215 13.448C12.2824 13.3394 12.3888 13.2607 12.5124 13.2281L16.7651 12.1065C18.0632 11.7642 18.2924 10.0198 17.1268 9.35374L7.15291 3.65436C6.03605 3.01615 4.68662 3.98765 4.93751 5.24929Z","stroke","white","stroke-linecap","square"],["id","filter0_d_6047_31299","x","0.588557","y","0.405717","width","21.6129","height","23.0055","filterUnits","userSpaceOnUse","color-interpolation-filters","sRGB"],["flood-opacity","0","result","BackgroundImageFix"],["in","SourceAlpha","type","matrix","values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0","result","hardAlpha"],["dy","1.1"],["stdDeviation","1.2"],["type","matrix","values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.17 0"],["mode","normal","in2","BackgroundImageFix","result","effect1_dropShadow_6047_31299"],["mode","normal","in","SourceGraphic","in2","effect1_dropShadow_6047_31299","result","shape"],[3,"cursorUser","selfCursorPointer","avatarMode","huddleState","stream"]],template:function(t,r){t&1&&u(0,Sin,2,1,"ng-container",0),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,$1],styles:[`html{--velt-base-rem-unit: 1}*[data-snippyly-element=true],*[data-velt-element=true]{font-family:var(--velt-default-font-family)}velt-wireframe{display:none!important}*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:rgba(255,255,255,0);outline:none;height:unset;width:unset;text-align:left;line-height:1.5;color:#000;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));pointer-events:none!important}*:empty{display:revert}.cursor-icon path{stroke:#fff;stroke-width:1px;stroke-linejoin:round}
|
|
535
535
|
`],encapsulation:3,changeDetection:0});let i=o;return i})();function bin(i,o){if(i&1&&(y(0,"span",7),te(1),P(2,"translate"),b()),i&2){let n=l(2).ngIf;m(),Se(" ",n.user!=null&&n.user.name?n.user==null||n.user.name==null?null:n.user.name.charAt(0):M(2,1,n.user==null||n.user.email==null?null:n.user.email.charAt(0)))}}function Iin(i,o){if(i&1){let n=K();y(0,"img",8),G("error",function(){N(n);let t=l(3);return F(t.onImageLoadError())}),b()}if(i&2){let n=l(2).ngIf;d("src",n.user.photoUrl,vn)}}function Ein(i,o){if(i&1&&(y(0,"div",3)(1,"span",4),P(2,"translate"),u(3,bin,3,3,"span",5)(4,Iin,1,1,"ng-template",null,0,Ee),b(),w(6,"audio",6),b()),i&2){let n=me(5),e=l().ngIf;m(),at("color",e.user.color+" !important")("background-color",e.user.color+" !important"),d("title",M(2,8,(e.user==null?null:e.user.name)||(e.user==null?null:e.user.email))),m(2),d("ngIf",e.showInitial)("ngIfElse",n),m(3),d("srcObject",e.remoteAudioStream)}}function xin(i,o){if(i&1&&(v(0),u(1,Ein,7,10,"div",2),C()),i&2){let n=o.ngIf;m(),d("ngIf",n.user)}}var aye=(()=>{let o=class o{constructor(e){this.loggingService=e,this.veltElement=!0,this.componentConfigSignal=Te({user:this.user,showInitial:!1,remoteAudioStream:this.remoteAudioStream})}ngOnInit(){}ngOnChanges(e){try{this.loggingService.log("%c[WB] Calling AudioHuddleUserComponent FUNCTION: ngOnChanges","color: green;"),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in AudioHuddleUserComponent ngOnChanges: ",t)}}onImageLoadError(){this.loggingService.log("%c[WB] Calling FUNCTION: onImageLoadError","color: green;");try{this.componentConfigSignal.update(e=>(e=D(E({},e),{showInitial:!0}),e))}catch(e){this.loggingService.catch("Error in AudioHuddleUserComponent onImageLoadError: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(_))},o.\u0275cmp=O({type:o,selectors:[["snippyly-audio-huddle-user"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{user:"user",remoteAudioStream:"remoteAudioStream"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[["showAvatarImgRef",""],[4,"ngIf"],["class","audio-huddle-user photo-container",4,"ngIf"],[1,"audio-huddle-user","photo-container"],["velt-ignore-change-detection","true",1,"audio-huddle-user",3,"title"],["class","audio-huddle-user-initial",4,"ngIf","ngIfElse"],["autoplay","true",3,"srcObject"],[1,"audio-huddle-user-initial"],["referrerpolicy","no-referrer","loading","lazy",1,"audio-huddle-user-image",3,"error","src"]],template:function(t,r){t&1&&u(0,xin,2,1,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,ge],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}.audio-huddle-user[_ngcontent-%COMP%]{display:none!important}.photo-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:40px;height:40px;box-sizing:border-box;background-clip:padding-box;border-radius:50%;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;transition:top .12s ease-in-out,width .12s ease-in-out,height .12s ease-in-out}.photo-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:50%;object-fit:cover}*[_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))}*[_ngcontent-%COMP%]:empty{display:revert!important}.s-presence-container[_ngcontent-%COMP%]{display:inline-flex;flex-direction:row-reverse;align-items:center}.audio-huddle-user[_ngcontent-%COMP%]{position:relative;box-shadow:0 0 0 3px;border-radius:50%;overflow:hidden;width:calc((2rem + 0px) * var(--velt-base-rem-unit));height:calc((2rem + 0px) * var(--velt-base-rem-unit));min-width:calc((2rem + 0px) * var(--velt-base-rem-unit));min-height:calc((2rem + 0px) * var(--velt-base-rem-unit));display:flex;align-items:center;justify-content:center}.audio-huddle-user.more-users[_ngcontent-%COMP%]{background:#4578a7;box-shadow:0 0 0 3px #4578a7}.audio-huddle-user[_ngcontent-%COMP%]:not(:last-child):not(.more-users){margin-left:calc((-.5rem + 0px) * var(--velt-base-rem-unit))!important}.audio-huddle-user-image[_ngcontent-%COMP%]{width:100%;height:100%;display:block;object-fit:cover}.audio-huddle-user-image-small[_ngcontent-%COMP%]{width:calc((1.6rem + 0px) * var(--velt-base-rem-unit));height:100%;display:block;object-fit:cover}.audio-huddle-user-initial[_ngcontent-%COMP%]{color:#fff}.away[_ngcontent-%COMP%]{filter:grayscale(1)}"],changeDetection:0});let i=o;return i})();function Din(i,o){if(i&1){let n=K();y(0,"div",18),G("click",function(){let t=N(n).$implicit,r=l(2);return F(r.selectAudioDevice(t))}),te(1),P(2,"translate"),b()}if(i&2){let n=o.$implicit,e=l(2);pe("selected",n.deviceId===(e.selectedAudioDevice==null?null:e.selectedAudioDevice.deviceId)),m(),Se(" ",M(2,3,n.label)," ")}}function win(i,o){if(i&1&&(y(0,"div",12)(1,"div",13),te(2),P(3,"translate"),b(),te(4),P(5,"translate"),y(6,"div",14)(7,"div",15),u(8,Din,3,5,"div",16),b(),te(9),P(10,"translate"),ce(),y(11,"svg",4),w(12,"path",17),b()()()),i&2){let n=l();m(2),ze(M(3,4,"Audio")),m(2),Se(" ",M(5,6,"Microphone")," "),m(4),d("ngForOf",n.audioDevices),m(),Se(" ",M(10,8,n.selectedAudioDevice==null?null:n.selectedAudioDevice.label)," ")}}function Oin(i,o){if(i&1){let n=K();y(0,"div",18),G("click",function(){let t=N(n).$implicit,r=l(2);return F(r.selectVideoDevice(t))}),te(1),P(2,"translate"),b()}if(i&2){let n=o.$implicit,e=l(2);pe("selected",n.deviceId===(e.selectedVideoDevice==null?null:e.selectedVideoDevice.deviceId)),m(),Se(" ",M(2,3,n.label)," ")}}function Ain(i,o){if(i&1&&(y(0,"div",12)(1,"div",13),te(2),P(3,"translate"),b(),te(4),P(5,"translate"),y(6,"div",14)(7,"div",15),u(8,Oin,3,5,"div",16),b(),te(9),P(10,"translate"),ce(),y(11,"svg",4),w(12,"path",17),b()()()),i&2){let n=l();m(2),ze(M(3,4,"Video")),m(2),Se(" ",M(5,6,"Camera")," "),m(4),d("ngForOf",n.videoDevices),m(),Se(" ",M(10,8,n.selectedVideoDevice==null?null:n.selectedVideoDevice.label)," ")}}var sye=(()=>{let o=class o{constructor(e,t,r){this.loggingService=e,this.dialogRef=t,this.devices=[],this.audioDevices=[],this.videoDevices=[],this.settingsVisible={audio:!0,video:!0},this.defaultMediaSourceOptions=ud(),this.veltElement=!0;try{r&&(this.selectedAudioDevice=r.selectedAudioDevice,this.selectedVideoDevice=r.selectedVideoDevice,r.settingsVisible&&(this.settingsVisible=r.settingsVisible)),this.getDevices()}catch(a){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent constructor: ",a)}}ngOnInit(){try{this.dialogRef.addPanelClass("snippyly-media-source-options-dialog")}catch(e){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent ngOnInit: ",e)}}getDevices(){return Q(this,null,function*(){try{let e=new Kn;if(e.getBrowserName()?.toLowerCase()==="safari"||e.getBrowserName()?.toLowerCase()==="firefox")try{let t=yield navigator.mediaDevices.getUserMedia({audio:!0,video:!0});t&&t.getTracks().forEach(r=>r.stop())}catch(t){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent getDevices getUserMedia catch: ",t)}navigator.mediaDevices.enumerateDevices().then(t=>{if(this.devices=t.filter(r=>r.kind==="audioinput"||r.kind==="videoinput"),this.audioDevices=this.devices.filter(r=>r.kind==="audioinput"),this.videoDevices=this.devices.filter(r=>r.kind==="videoinput"),this.audioDevices.length>0&&!this.selectedAudioDevice){if(this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId){let r=this.audioDevices.find(a=>a.deviceId===this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId);r&&(this.selectedAudioDevice=r)}this.selectedAudioDevice||(this.selectedAudioDevice=this.audioDevices[0])}if(this.videoDevices.length>0&&!this.selectedVideoDevice){if(this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId){let r=this.videoDevices.find(a=>a.deviceId===this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId);r&&(this.selectedVideoDevice=r)}this.selectedVideoDevice||(this.selectedVideoDevice=this.videoDevices[0])}}).catch(t=>{this.loggingService.catch("Error in MediaSourceOptionsDialogComponent getDevices enumerateDevices catch: ",t)})}catch(e){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent getDevices: ",e)}})}selectAudioDevice(e){try{this.selectedAudioDevice=e}catch(t){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent selectAudioDevice: ",t)}}selectVideoDevice(e){try{this.selectedVideoDevice=e}catch(t){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent selectVideoDevice: ",t)}}saveChanges(){try{let e={};this.settingsVisible.audio&&(e.selectedAudioDevice=this.selectedAudioDevice),this.settingsVisible.video&&(e.selectedVideoDevice=this.selectedVideoDevice),localStorage.setItem(U.LOCAL_STORAGE.SNIPPYLY_DEFAULT_MEDIA_SOURCE_OPTIONS,JSON.stringify(e||{})),this.closeDialog(e)}catch(e){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent saveChanges: ",e)}}closeDialog(e){try{this.dialogRef.close(e)}catch(t){this.loggingService.catch("Error in MediaSourceOptionsDialogComponent closeDialog: ",t)}}};o.\u0275fac=function(t){return new(t||o)(h(_),h(dr),h(ac,8))},o.\u0275cmp=O({type:o,selectors:[["snippyly-media-source-options-dialog"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},standalone:!1,decls:17,vars:10,consts:[["mediaSourceOptionsDialogRef",""],[1,"s-video-settings-modal",3,"pointerdown","pointerup","click","snippylyOverlay","snippylyOverlayZIndex"],[1,"s-video-header"],[1,"s-video-header-name"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M19.5 12C19.5 11.77 19.49 11.55 19.47 11.32L21.33 9.91C21.73 9.61 21.84 9.05 21.59 8.61L19.72 5.38C19.47 4.94 18.93 4.76 18.47 4.96L16.32 5.87C15.95 5.61 15.56 5.38 15.15 5.19L14.86 2.88C14.8 2.38 14.37 2 13.87 2H10.14C9.63 2 9.2 2.38 9.14 2.88L8.85 5.19C8.44 5.38 8.05 5.61 7.68 5.87L5.53 4.96C5.07 4.76 4.53 4.94 4.28 5.38L2.41 8.62C2.16 9.06 2.27 9.61 2.67 9.92L4.53 11.33C4.51 11.55 4.5 11.77 4.5 12C4.5 12.23 4.51 12.45 4.53 12.68L2.67 14.09C2.27 14.39 2.16 14.95 2.41 15.39L4.28 18.62C4.53 19.06 5.07 19.24 5.53 19.04L7.68 18.13C8.05 18.39 8.44 18.62 8.85 18.81L9.14 21.12C9.2 21.62 9.63 22 10.13 22H13.86C14.36 22 14.79 21.62 14.85 21.12L15.14 18.81C15.55 18.62 15.94 18.39 16.31 18.13L18.46 19.04C18.92 19.24 19.46 19.06 19.71 18.62L21.58 15.39C21.83 14.95 21.72 14.4 21.32 14.09L19.46 12.68C19.49 12.45 19.5 12.23 19.5 12ZM12.04 15.5C10.11 15.5 8.54 13.93 8.54 12C8.54 10.07 10.11 8.5 12.04 8.5C13.97 8.5 15.54 10.07 15.54 12C15.54 13.93 13.97 15.5 12.04 15.5Z","fill","white"],[1,"s-icon-button",3,"click"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.41076 4.41058C4.7362 4.08514 5.26384 4.08514 5.58928 4.41058L10 8.82133L14.4108 4.41058C14.7362 4.08514 15.2638 4.08514 15.5893 4.41058C15.9147 4.73602 15.9147 5.26366 15.5893 5.58909L11.1785 9.99984L15.5893 14.4106C15.9147 14.736 15.9147 15.2637 15.5893 15.5891C15.2638 15.9145 14.7362 15.9145 14.4108 15.5891L10 11.1783L5.58928 15.5891C5.26384 15.9145 4.7362 15.9145 4.41076 15.5891C4.08533 15.2637 4.08533 14.736 4.41076 14.4106L8.82151 9.99984L4.41076 5.58909C4.08533 5.26366 4.08533 4.73602 4.41076 4.41058Z","fill","white"],["class","s-video-settings-modal-item",4,"ngIf"],[1,"s-flex-fill"],[1,"s-button","s-primary","s-save-button",3,"click"],[1,"s-video-settings-modal-item"],[1,"s-heading"],[1,"s-input","dropdown"],[1,"dropdown-content"],["class","dropdown-item",3,"selected","click",4,"ngFor","ngForOf"],["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","#80808A"],[1,"dropdown-item",3,"click"]],template:function(t,r){if(t&1){let a=K();y(0,"div",1,0),G("pointerdown",function(c){return N(a),F(c.stopPropagation())})("pointerup",function(c){return N(a),F(c.stopPropagation())})("click",function(c){return N(a),F(c.stopPropagation())}),y(2,"div",2)(3,"div",3),ce(),y(4,"svg",4),w(5,"path",5),b(),te(6),P(7,"translate"),b(),ft(),y(8,"div",6),G("click",function(){return N(a),F(r.closeDialog())}),ce(),y(9,"svg",7),w(10,"path",8),b()()(),u(11,win,13,10,"div",9)(12,Ain,13,10,"div",9),ft(),w(13,"div",10),y(14,"div",11),G("click",function(){return N(a),F(r.saveChanges())}),te(15),P(16,"translate"),b()()}if(t&2){let a=me(1);d("snippylyOverlay",a)("snippylyOverlayZIndex",3e3),m(6),Se(" ",M(7,6,"Settings")," "),m(5),d("ngIf",r.settingsVisible==null?null:r.settingsVisible.audio),m(),d("ngIf",r.settingsVisible==null?null:r.settingsVisible.video),m(3),ze(M(16,8,"Save changes"))}},dependencies:[Et,X,di,ge],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}*[_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;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){height:unset;width:unset}*[_ngcontent-%COMP%]:empty:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){display:revert!important}.s-video-settings-modal[_ngcontent-%COMP%], .s-video-header[_ngcontent-%COMP%], .s-video-header-name[_ngcontent-%COMP%], .s-video-settings-modal-item[_ngcontent-%COMP%], .s-input[_ngcontent-%COMP%]{display:flex!important;color:#fff!important}.s-video-settings-modal-item[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;width:100%!important;color:#91919c!important;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit))!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.s-video-settings-modal[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-end!important;padding:calc((2rem + 0px) * var(--velt-base-rem-unit))!important;gap:calc((2rem + 0px) * var(--velt-base-rem-unit))!important;background:#141416!important;border-radius:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;width:calc((40rem + 0px) * var(--velt-base-rem-unit))!important;border:2px solid #303034!important}.s-video-header[_ngcontent-%COMP%]{justify-content:space-between!important;width:100%!important;align-items:center!important}.s-video-header-name[_ngcontent-%COMP%]{gap:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;font-weight:600!important;font-size:calc((1.2rem + 0px) * var(--velt-base-rem-unit))!important;display:flex!important;align-items:center!important}.s-button[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;padding:calc((1rem + 0px) * var(--velt-base-rem-unit)) calc((2rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((4rem + 0px) * var(--velt-base-rem-unit))!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;transition:.1s ease!important;cursor:pointer!important}.s-primary[_ngcontent-%COMP%]{background:#625df5!important;color:#fff!important}.s-primary[_ngcontent-%COMP%]:hover{background:#4f4bbf!important}.s-video-settings-modal-item[_ngcontent-%COMP%] .s-heading[_ngcontent-%COMP%]{font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;color:#fff!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) 0!important}.s-input[_ngcontent-%COMP%]{position:relative!important;padding:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;color:#91919c!important;width:100%!important;justify-content:space-between!important;border-radius:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;border:2px solid #303034!important;align-items:center!important;cursor:pointer!important;transition:.2s ease!important}.s-input[_ngcontent-%COMP%]:hover{background:#303034!important}.dropdown[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{position:absolute!important;top:0!important;right:0!important;z-index:1!important}.dropdown-content[_ngcontent-%COMP%]{width:100%!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important;align-items:flex-start!important;border-radius:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important;border:2px solid #303034!important;color:#91919c!important;background:#141416!important;cursor:pointer!important;visibility:hidden!important;opacity:0!important;transition:all .1s ease!important}.dropdown[_ngcontent-%COMP%]:hover .dropdown-content[_ngcontent-%COMP%]{visibility:visible!important;opacity:1!important}.dropdown-item[_ngcontent-%COMP%]{padding:calc((1.2rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;width:100%!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;gap:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;transition:all .1s ease!important;color:#91919c!important}.dropdown-item.selected[_ngcontent-%COMP%]{color:#fff!important}.dropdown-item[_ngcontent-%COMP%]:hover{background:#303034!important;color:#fff!important}.s-icon-button[_ngcontent-%COMP%]{padding:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;display:flex!important;align-items:center!important;justify-content:center!important;border-radius:100px!important;cursor:pointer!important}.s-icon-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:#777e91!important}.s-icon-button[_ngcontent-%COMP%]:hover{background:#222226!important}.s-icon-button[_ngcontent-%COMP%]:hover svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:#fff!important}.s-flex-fill[_ngcontent-%COMP%]{flex-grow:1!important} .velt-mat-dialog-container.snippyly-media-source-options-dialog{max-width:unset} .velt-mat-dialog-container.snippyly-media-source-options-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{background-color:transparent!important;padding:0!important;margin:0!important;border-radius:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}@media screen and (max-width: 768px){.s-video-settings-modal[_ngcontent-%COMP%]{width:calc(.8 * var(--legacy-velt-viewport-width))!important}}@media screen and (max-width: 425px){ .velt-mat-dialog-container.snippyly-media-source-options-dialog{width:calc(1 * var(--legacy-velt-viewport-width))!important;max-width:calc(1 * var(--legacy-velt-viewport-width))!important} .velt-mat-dialog-container.snippyly-media-source-options-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{width:calc(1 * var(--legacy-velt-viewport-width))!important;height:calc(1 * var(--legacy-velt-viewport-height))!important;border-radius:calc((0rem + 0px) * var(--velt-base-rem-unit))!important} .velt-mat-dialog-container.snippyly-media-source-options-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface .s-video-settings-modal{width:calc(1 * var(--legacy-velt-viewport-width))!important;height:calc(1 * var(--legacy-velt-viewport-height))!important;border-radius:0!important} .velt-mat-dialog-container.snippyly-media-source-options-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface .s-save-button{width:100%!important}}"],changeDetection:0});let i=o;return i})();var lye=(()=>{let o=class o{constructor(e,t,r,a,s,c,p,g){this.authService=e,this.configService=t,this.contactService=r,this.docService=a,this.commonDbService=s,this.databaseService=c,this.loggingService=p,this.notificationService=g,this.documentUsers$=new Ce([]);try{this.databaseService.getDb().pipe(Le(f=>!!f),rt(1)).subscribe(f=>{f&&this.subscribeUsersFromDocument()}),this.authService.getUser$().subscribe(f=>{if(f?.email){this.subscribeUsersFromDocument();let I=Tt(f.email);f?.organizationId&&(I=Tt(f.userId)),this.getDocumentUserByIdFromDb(I).then(x=>{x&&(x.user.name=f.name,x.user.photoUrl=f.photoUrl,this.updateDocumentUser(x))}).catch(x=>{this.loggingService.catch("Error in DocumentUserAccessService getDocumentUserByIdFromDb:",x)})}},f=>{this.loggingService.catch("Error in DocumentUserAccessService getUser$:",f)})}catch(f){this.loggingService.catch("Error in DocService constructor:",f)}}getDocumentUserByIdFromDb(e){return Q(this,null,function*(){try{let t=this.docService.getDocumentPaths();return t?(yield this.commonDbService.dbListener({feature:"documentUser",properties:{documentId:t?.documentId,organizationId:t?.organizationId,isCollection:!1,id:e}}).pipe(rt(1)).toPromise())?.data:void 0}catch(t){this.loggingService.catch("Error in DocService getDocumentUserById:",t);return}})}subscribeUsersFromDocument(){try{this.documentUsersSubscription&&this.documentUsersSubscription.unsubscribe(),this.documentUsersSubscription=this.authService.getUser$().pipe(fe(e=>e?this.docService.getDocumentPaths$().pipe(Le(t=>!!t),fe(t=>this.commonDbService.dbListener({feature:"allDocumentUsers",properties:{documentId:t?.documentId,organizationId:t?.organizationId,isCollection:!0}}).pipe(de(r=>r?.data?Object.values(r?.data):[])))):le([]))).subscribe(e=>{this.documentUsers$.next(e)},e=>{this.loggingService.catch("Error in DocService subscribeUsersFromDocument subscription:",e)})}catch(e){this.loggingService.catch("Error in DocService subscribeUsersFromDocument:",e)}}getDocumentUsers$(){return this.documentUsers$.asObservable()}addDocumentUser(e){try{let t=this.authService.getUser();if(t){if(this.configService.getSF()){if(e?.role?.name===uo.ADMIN)this.contactService.addGlobalContact(e.user);else if(e?.role?.name===uo.COMMENTER){let a=t.groupId;if(a){let s=JSON.parse(JSON.stringify(e.user));s.visibility="group",this.contactService.setLoggedInUserGroupContacts(a,[s])}}}e.id=Tt(e?.user?.email),e.invitedBy=t,e.invitedDate=this.timestamp;let r=this.docService.getDocumentPaths();r&&this.commonDbService.updateData({feature:"documentUserAccess",properties:{id:e.id,documentId:r?.documentId??"",organizationId:r?.organizationId??""},data:JSON.parse(JSON.stringify(e))}),this.updateNotificationsDatabase(e)}else this.loggingService.error("Error in DocService addDocumentUser: User not found")}catch(t){this.loggingService.catch("Error in DocService addDocumentUser:",t)}}updateDocumentUser(e,t={}){try{let r=this.authService.getUser();if(r){e.updatedBy=r,e.updatedDate=this.timestamp;let a=this.docService.getDocumentPaths();this.commonDbService.updateData({feature:"documentUserAccess",properties:{id:e.id,documentId:a?.documentId??"",organizationId:a?.organizationId??""},data:JSON.parse(JSON.stringify(e))}),this.updateNotificationsDatabase(e)}}catch(r){this.loggingService.catch("Error in DocumentUserAccessService updateDocumentUser:",r)}}removeDocumentUser(e){try{let t=this.docService.getDocumentPaths();this.commonDbService.deleteData({feature:"documentUserAccess",properties:{id:e.id,documentId:t?.documentId??"",organizationId:t?.organizationId??""}})}catch(t){this.loggingService.catch("Error in DocumentUserAccessService removeDocumentUser:",t)}}updateNotificationsDatabase(e={}){try{let t=E({notificationSource:"user"},e);this.notificationService.updateNotificationDatabase(t)}catch(t){this.loggingService.catch("Error in DocumentUserAccessService updateNotificationsDatabase: ",t)}}get timestamp(){return this.commonDbService.getServerTimestamp()}};o.\u0275fac=function(t){return new(t||o)(ee(je),ee(Ft),ee(Ii),ee(ot),ee(un),ee(En),ee(_),ee(hn))},o.\u0275prov=Pe({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Min=["triggerTemplate"],kin=["tooltipTemplate"],Rin=["trigger"],Nin=["overlay"],Fin=()=>["snippyly-overlay-panel","snippyly-reaction-dialog-overlay-panel","velt-overlay-panel"];function Lin(i,o){i&1&&He(0)}function Bin(i,o){i&1&&He(0)}function Vin(i,o){if(i&1){let n=K();y(0,"div",6,2),G("pointerenter",function(){N(n);let t=l();return F(t.showTooltip())})("pointerleave",function(){N(n);let t=l();return F(t.hideTooltip())}),u(2,Bin,1,0,"ng-container",4),b()}if(i&2){let n=me(1),e=l();d("snippylyOverlay",n)("snippylyOverlayZIndex",2e3),T("data-velt-element",!0),m(2),d("ngTemplateOutlet",e.tooltipTemplate)}}var wd=(()=>{let o=class o{constructor(e){this.loggingService=e,this.positions=[],this.disableClose=!0,this.disabled=!1,this.componentConfigSignal=Te({disabled:!1,tooltipVisible:!1,overlayPositions:[]}),this.veltElement=!0}ngOnInit(){}ngOnChanges(e){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnChanges","color: green;");try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))}),e.positions&&this.componentConfigSignal.update(t=>(t=D(E({},t),{overlayPositions:this.positions.map(r=>new mi({originX:r.originX,originY:r.originY},{overlayX:r.overlayX,overlayY:r.overlayY}))}),t))}catch(t){this.loggingService.catch("Error in OverlayTooltipComponent ngOnChanges: ",t)}}showTooltip(){this.loggingService.log("%c[WB] Calling FUNCTION: showTooltip","color: green;");try{this.hideTooltipTimeout&&clearTimeout(this.hideTooltipTimeout),this.componentConfigSignal.update(e=>(e=D(E({},e),{tooltipVisible:!0}),e))}catch(e){this.loggingService.catch("Error in OverlayTooltipComponent showTooltip: ",e)}}hideTooltip(){this.loggingService.log("%c[WB] Calling FUNCTION: hideTooltip","color: green;");try{this.hideTooltipTimeout&&clearTimeout(this.hideTooltipTimeout),this.hideTooltipTimeout=setTimeout(()=>{this.componentConfigSignal.update(e=>(e=D(E({},e),{tooltipVisible:!1}),e))},200)}catch(e){this.loggingService.catch("Error in OverlayTooltipComponent hideTooltip: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.hideTooltip()}catch(e){this.loggingService.catch("Error in OverlayTooltipComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(_))},o.\u0275cmp=O({type:o,selectors:[["app-overlay-tooltip"]],contentQueries:function(t,r,a){if(t&1&&($s(a,Min,7),$s(a,kin,7)),t&2){let s;et(s=tt())&&(r.triggerTemplate=s.first),et(s=tt())&&(r.tooltipTemplate=s.first)}},viewQuery:function(t,r){if(t&1&&(it(Rin,5),it(Nin,5)),t&2){let a;et(a=tt())&&(r.trigger=a.first),et(a=tt())&&(r.overlay=a.first)}},hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{positions:"positions",disableClose:"disableClose",disabled:"disabled"},standalone:!1,features:[Qe],decls:5,vars:8,consts:[["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],["overlayContent",""],["cdkOverlayOrigin","",3,"pointerenter","pointerleave"],[4,"ngTemplateOutlet"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayPanelClass","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayDisableClose"],["data-velt-comment-disabled","true",3,"pointerenter","pointerleave","snippylyOverlay","snippylyOverlayZIndex"]],template:function(t,r){if(t&1){let a=K();y(0,"div",3,0),G("pointerenter",function(){return N(a),F(r.showTooltip())})("pointerleave",function(){return N(a),F(r.hideTooltip())}),u(2,Lin,1,0,"ng-container",4),b(),u(3,Vin,3,4,"ng-template",5,1,Ee)}if(t&2){let a=me(1);m(2),d("ngTemplateOutlet",r.triggerTemplate),m(),d("cdkConnectedOverlayOrigin",a)("cdkConnectedOverlayPanelClass",gt(7,Fin))("cdkConnectedOverlayOpen",!r.componentConfigSignal().disabled&&r.componentConfigSignal().tooltipVisible)("cdkConnectedOverlayPositions",r.componentConfigSignal().overlayPositions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",r.disableClose)}},dependencies:[Dt,dn,sn,di],encapsulation:2,changeDetection:0});let i=o;return i})();var Uin=["matAutocomplete"],jin=["matAutocompleteTrigger"],$in=["autocompletePanelInput"],Hin=["viewport"],zin=i=>({componentConfigSignal:i}),Gin=(i,o)=>({condition:i,data:o}),cye=i=>({$implicit:i}),dye=(i,o)=>({$implicit:i,isNewContact:o});function Win(i,o){if(i&1){let n=K();y(0,"input",9,2),G("click",function(t){return N(n),F(t.stopPropagation())})("keyup",function(t){return N(n),F(t.stopPropagation())})("keydown",function(t){return N(n),F(t.stopPropagation())})("keyup.escape",function(t){return N(n),l().closePanel(),F(t.stopPropagation())})("input",function(t){return N(n),l().handleInput(t),F(t.stopPropagation())}),b()}if(i&2){let n=l(),e=me(4);d("placeholder",n.placeholder||"")("matAutocomplete",e)("matAutocompleteDisabled",!n.enableOnFocus)("matAutocompletePosition",n.position),T("aria-label",n.placeholder||"Search")("aria-autocomplete","list")("aria-controls",n.componentId+"-input")("data-testid",n.componentId+"-input")}}function qin(i,o){if(i&1&&(v(0),w(1,"velt-autocomplete-group-option-internal",17),C()),i&2){let n=l().$implicit,e=l(3);m(),d("componentConfigSignal",e.componentConfigSignal)("group",n.group)("groupName",n.groupName)}}function Yin(i,o){i&1&&He(0)}function Kin(i,o){if(i&1&&(v(0),y(1,"div",18),u(2,Yin,1,0,"ng-container",19),b(),C()),i&2){let n=l().$implicit;l(3);let e=me(7);m(2),d("ngTemplateOutlet",e)("ngTemplateOutletContext",A(2,cye,n.originalItem))}}function Zin(i,o){i&1&&He(0)}function Xin(i,o){if(i&1&&(v(0),u(1,Zin,1,0,"ng-container",19),C()),i&2){let n=l().$implicit;l(3);let e=me(7);m(),d("ngTemplateOutlet",e)("ngTemplateOutletContext",k(2,dye,n.originalItem,n.isNewContact))}}function Qin(i,o){if(i&1){let n=K();y(0,"mat-option",15),G("pointerdown",function(t){return N(n),t.stopPropagation(),F(t.preventDefault())})("pointerup",function(t){let r=N(n).$implicit,a=l(3);return t.stopPropagation(),r.isGroupHeader?t.preventDefault():a.onOptionClick(r.originalItem),F(t.preventDefault())}),u(1,qin,2,3,"ng-container",16)(2,Kin,3,4,"ng-container",16)(3,Xin,2,5,"ng-container",16),b()}if(i&2){let n=o.$implicit;pe("velt-group-option",n.isGroupHeader)("velt-group-member-option",n.isGroupMember),d("disabled",n==null?null:n.disabled)("value",n.originalItem),T("id",n.id)("aria-disabled",n==null?null:n.disabled)("data-testid",n.testId),m(),d("ngIf",n.isGroupHeader),m(),d("ngIf",n.isGroupMember),m(),d("ngIf",!n.isGroupHeader&&!n.isGroupMember)}}function Jin(i,o){if(i&1&&(y(0,"cdk-virtual-scroll-viewport",13,3),u(2,Qin,4,12,"mat-option",14),P(3,"async"),b()),i&2){let n=l(2);d("itemSize",n.componentConfigSignal().autoCompleteScrollConfig.itemSize||55)("minBufferPx",n.componentConfigSignal().autoCompleteScrollConfig.minBufferPx||350)("maxBufferPx",n.componentConfigSignal().autoCompleteScrollConfig.maxBufferPx||600)("templateCacheSize",n.componentConfigSignal().autoCompleteScrollConfig.templateCacheSize||350),m(2),d("cdkVirtualForOf",M(3,6,n.componentConfigSignal().flattenedItems$))("cdkVirtualForTrackBy",n.trackByFlattenedItem)}}function eon(i,o){if(i&1&&(v(0),w(1,"velt-autocomplete-group-option-internal",17),C()),i&2){let n=l().$implicit,e=l(3);m(),d("componentConfigSignal",e.componentConfigSignal)("group",n.group)("groupName",n.groupName)}}function ton(i,o){i&1&&He(0)}function non(i,o){if(i&1&&(v(0),y(1,"div",18),u(2,ton,1,0,"ng-container",19),b(),C()),i&2){let n=l().$implicit;l(3);let e=me(7);m(2),d("ngTemplateOutlet",e)("ngTemplateOutletContext",A(2,cye,n.originalItem))}}function ion(i,o){i&1&&He(0)}function oon(i,o){if(i&1&&(v(0),u(1,ion,1,0,"ng-container",19),C()),i&2){let n=l().$implicit;l(3);let e=me(7);m(),d("ngTemplateOutlet",e)("ngTemplateOutletContext",k(2,dye,n.originalItem,n.isNewContact))}}function ron(i,o){if(i&1){let n=K();y(0,"mat-option",15),G("pointerdown",function(t){return N(n),t.stopPropagation(),F(t.preventDefault())})("pointerup",function(t){let r=N(n).$implicit,a=l(3);return t.stopPropagation(),r.isGroupHeader?t.preventDefault():a.onOptionClick(r.originalItem),F(t.preventDefault())}),u(1,eon,2,3,"ng-container",16)(2,non,3,4,"ng-container",16)(3,oon,2,5,"ng-container",16),b()}if(i&2){let n=o.$implicit;pe("velt-group-option",n.isGroupHeader)("velt-group-member-option",n.isGroupMember),d("disabled",n==null?null:n.disabled)("value",n.originalItem),T("id",n.id)("aria-disabled",n==null?null:n.disabled)("data-testid",n.testId),m(),d("ngIf",n.isGroupHeader),m(),d("ngIf",n.isGroupMember),m(),d("ngIf",!n.isGroupHeader&&!n.isGroupMember)}}function aon(i,o){if(i&1&&(y(0,"div",20),u(1,ron,4,12,"mat-option",21),P(2,"async"),b()),i&2){let n=l(2);m(),d("ngForOf",M(2,2,n.componentConfigSignal().flattenedItems$))("ngForTrackBy",n.trackByFlattenedItem)}}function son(i,o){if(i&1&&(y(0,"div",10),u(1,Jin,4,8,"cdk-virtual-scroll-viewport",11),P(2,"async"),u(3,aon,3,4,"div",12),P(4,"async"),b()),i&2){let n,e,t=l();pe("s-comment-autocomplete-panel-dark",t.darkMode),T("data-testid",t.componentId+"-options-container"),m(),d("ngIf",(((n=M(2,5,t.componentConfigSignal().flattenedItems$))==null?null:n.length)||0)>6),m(2),d("ngIf",(((e=M(4,7,t.componentConfigSignal().flattenedItems$))==null?null:e.length)||0)<=6)}}function lon(i,o){if(i&1&&w(0,"velt-autocomplete-option-internal",22),i&2){let n=o.$implicit,e=o.isNewContact,t=l();d("componentConfigSignal",t.componentConfigSignal)("selectorItem",n)("isNewContact",e)}}var Du=(()=>{let o=class o extends nt{get trigger(){return this._trigger}set trigger(e){this._trigger=e,this.setTriggerToMatAutocomplete(),this.trigger&&(this.trigger.autocompleteDisabled=!this.enableOnFocus,this.trigger._handleInput=this.handleInput.bind(this))}get triggerElement(){return this._triggerElement}set triggerElement(e){if(this._triggerElement=e,this.triggerElement){let t=new R(this.triggerElement);this.trigger=new r2(t,this.overlay,this.viewContainerRef,{run:r=>r(),runOutsideAngular:r=>r()},this.cd,null,this.directionality,null,document,this.viewportRuler)}}get enableOnFocus(){return this._enableOnFocus}set enableOnFocus(e){this._enableOnFocus=e,this.trigger&&(this.trigger.autocompleteDisabled=!this.enableOnFocus)}get excludeContacts(){return this._excludeContacts}set excludeContacts(e){this._excludeContacts=e,this.filterOptions()}constructor(e,t,r,a,s,c,p,g,f,I,x,B,z,W,J){super(s,x,void 0,void 0,void 0,B,a),this.authService=e,this.autocompleteService=t,this.contactService=r,this.loggingService=a,this.elementRef=s,this.overlay=c,this.viewContainerRef=p,this.cd=g,this.directionality=f,this.viewportRuler=I,this.themeService=x,this.dynamicDataService=B,this.commentActionsService=z,this.commentService=W,this.metadataService=J,this.type="contact",this._enableOnFocus=!1,this.position="auto",this._excludeContacts=[],this.showAtHere=!1,this.optionSelected=new Me,this.atHereSelected=new Me,this.userContactOptionSelected=new Me,this.customOptionSelected=new Me,this.groupOptionSelected=new Me,this.enterPressed=new Me,this.autocompleteStateChanged=new Me,this.userContacts=[],this.paginatedContactList=!1,this.user=null,this.inputFilterFormControl=new Xae,this.oldText="",this.newText="",this.wordIndex=-1,this.deviceInfo=new Kn,this.userDocumentContacts=[],this.organizationGroups=[],this.subscriptions=[],this.autocompleteDisabledPositions=new Set,this.veltId=vt(),this.veltElement=!0,this.componentConfigSignal=Te({flattenedItems$:le([]),trackByFlattenedItem:this.trackByFlattenedItem.bind(this),onOptionClick:this.onOptionClick.bind(this),newUserContactError:void 0,newUserContact:void 0,customAutocompleteSearch:!1,expandMentionGroups:!1,showMentionGroupsFirst:!1,showMentionGroupsOnly:!1,customGroupsEnabled:!1,autoCompleteScrollConfig:{itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350}}),this.hereUserContact={name:"here",email:"",userId:"here",visibility:"here"},this.atHereDescription=null,this.dataList=[],this.autocompleteDataMap={},this.atHereEnabled=!1,this.componentId="velt-autocomplete-panel",this.MAX_VISIBLE_ITEMS=10,this.ITEM_SIZE=55;try{this.subscriptions.push(this.commentService.getCustomAutocompleteSearch$().subscribe(ne=>{this.componentConfigSignal.update(ve=>(ve=D(E({},ve),{customAutocompleteSearch:ne}),ve))})),this.subscriptions.push(this.authService.getUser$().subscribe(ne=>{this.user=ne,this.filterOptions()})),this.subscriptions.push(this.autocompleteService.getAutocompleteDataMap$().subscribe(ne=>{this.autocompleteDataMap=ne,this.filterOptions()})),this.subscriptions.push(this.inputFilterFormControl.valueChanges.pipe(Pi(150),Ct()).subscribe(()=>{this.filterOptions()})),this.subscriptions.push(this.commentService.getAutoCompleteScrollConfig$().subscribe(ne=>{this.componentConfigSignal.update(ve=>(ve=D(E({},ve),{autoCompleteScrollConfig:ne}),ve))}))}catch(ne){this.loggingService.catch("Error in AutocompletePanelComponent ngOnInit:",ne)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes(),this.type==="contact"?this.selectedAutocompleteData={hotkey:"",type:"contact",data:[]}:this.selectedAutocompleteData=void 0,this.subscriptions.push(this.contactService.getAtHereLabel().subscribe(e=>{this.hereUserContact.name=e})),this.subscriptions.push(this.contactService.getAtHereDescription().subscribe(e=>{this.atHereDescription=e})),this.subscriptions.push(this.contactService.getUserContacts$(this.metadata).subscribe(e=>{this.userContacts=e?.slice(),this.atHereEnabled&&(this.userContacts?.find(t=>t?.visibility=="here")||this.userContacts.unshift(this.hereUserContact)),this.filterOptions()})),this.subscriptions.push(this.contactService.getAtHereEnabled$().subscribe(e=>{this.atHereEnabled=e,e?this.userContacts?.find(t=>t?.visibility=="here")||this.userContacts.unshift(this.hereUserContact):this.userContacts=this.userContacts.filter(t=>t?.visibility!=="here"),this.filterOptions()})),this.subscriptions.push(this.contactService.getOrganizationGroups$().subscribe(e=>{this.organizationGroups=e,this.filterOptions()})),this.subscriptions.push(this.commentService.getExpandMentionGroups$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{expandMentionGroups:e}),t))})),this.subscriptions.push(this.commentService.getShowMentionGroupsFirst$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{showMentionGroupsFirst:e}),t))})),this.subscriptions.push(this.commentService.getShowMentionGroupsOnly$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{showMentionGroupsOnly:e}),t))})),this.subscriptions.push(this.commentService.getPaginatedContactList$().subscribe(e=>{this.paginatedContactList=e})),this.subscriptions.push(this.contactService.getUserDocumentContacts$().subscribe(e=>{this.userDocumentContacts=e,this.filterOptions()}))}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent ngOnInit: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","listbox"),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent setupA11yAttributes:",e)}}ngAfterViewInit(){try{this.setTriggerToMatAutocomplete(),requestAnimationFrame(()=>{if(this.autocompletePanelInput?.nativeElement){this.autocompletePanelInput.nativeElement.focus();let e=this.getViewport();if(e){let r=(this.componentConfigSignal().autoCompleteScrollConfig?.itemSize||this.ITEM_SIZE)*this.MAX_VISIBLE_ITEMS;e.style.height=`${r}px`,e.style.maxHeight=`${r}px`}this.openPanelOptimized()}this.triggerElement?this.subscriptions.push(Ci(this.triggerElement,"blur").subscribe(()=>{requestAnimationFrame(()=>this.closePanel())})):this.autocompletePanelInput&&this.subscriptions.push(Ci(this.autocompletePanelInput.nativeElement,"blur").subscribe(()=>{requestAnimationFrame(()=>this.closePanel())}))})}catch(e){this.loggingService.catch("Error in ngAfterViewInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>e.unsubscribe())}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent ngOnDestroy:",e)}}filterOptions(){return Q(this,null,function*(){try{if(this.selectedAutocompleteData)if(this.selectedAutocompleteData.type==="contact"){let e=this.inputFilterFormControl.value,t=new Rp,r=e?.toLowerCase()?.trim();t.email=r;let a=new RegExp(U.REGEX_EMAIL).test("@"+t?.email),s=this.userContacts.slice();this.componentConfigSignal().customAutocompleteSearch||(e?(s=this._filter(t),this.paginatedContactList&&s.length<3&&(yield this.fetchFilteredUsersFromDb(e),s=this.userContacts.slice(),s=this._filter(t))):s=this.userContacts.slice()),this.atHereEnabled&&this.hereUserContact?.name?.includes(r)&&!s?.find(x=>x?.userId=="here")&&(s=[this.hereUserContact,...s]),s=s.filter(x=>!this.excludeContacts?.find(B=>B?.email===x?.email));let c=e?this._filterGroup(e):this.organizationGroups,p=s.map(x=>{let B=!1;return x.visibility==="here"&&(this.atHereDescription?(x.email=`${this.atHereDescription}`,x.description=this.atHereDescription):this.user?.organizationId&&(x.email=`${this.userDocumentContacts?.length||0} members`,x.description=`${this.userDocumentContacts?.length||0} members`)),{type:"contact",contact:x,disabled:B}}),g=c.map(x=>({type:"group",group:x})),f=[...p,...g];if(this.componentConfigSignal().expandMentionGroups){let x=[],B={},z=new Map;f.forEach(_e=>{if(_e.contact?.userId){let Fe=Tt(_e.contact?.userId);z.set(Fe,_e),B[_e.contact?.userId]=!1}});let W=new Map;this.organizationGroups.forEach(_e=>{W.set(_e.metadata.clientGroupId,{id:_e.metadata.clientGroupId,name:_e.metadata.groupName,members:[],userIds:Object.keys(_e.users||{})})}),W.forEach(_e=>{_e.userIds.forEach(Fe=>{let Be=z.get(Fe);Be&&(_e.members.push(Be),Be.contact?.userId&&(B[Be.contact.userId]=!0))})}),f.forEach(_e=>{_e.type==="contact"&&_e.contact?.userId&&!B[_e.contact?.userId]&&x.push(_e)});let J=Array.from(W.values()),ne=f.length?void 0:{type:"contact",contact:t},ve=this.createFlattenedItems({allItems:f,contactsWithoutGroup:x,groups:J,newUserContact:ne,isExpandedGroups:!0,isCustomGroups:!1});this.componentConfigSignal.update(_e=>D(E({},_e),{flattenedItems$:le(ve),newUserContactError:a?void 0:"Invalid email",newUserContact:ne,contactsWithoutGroup:x,groups:J}))}else{let x=f.length?void 0:{type:"contact",contact:t},B=this.createFlattenedItems({allItems:f,newUserContact:x,isExpandedGroups:!1,isCustomGroups:!1});this.componentConfigSignal.update(z=>D(E({},z),{flattenedItems$:le(B),newUserContactError:a?void 0:"Invalid email",newUserContact:x}))}let I=this.getViewport();if(I){let B=(this.componentConfigSignal().autoCompleteScrollConfig?.itemSize||this.ITEM_SIZE)*this.MAX_VISIBLE_ITEMS;I.style.height=`${B}px`,I.style.maxHeight=`${B}px`}this.openPanelOptimized(),this.cd.markForCheck()}else{let e=this.inputFilterFormControl.value,t=this.autocompleteDataMap?.[this.selectedAutocompleteData?.hotkey],r=t?.data?.slice()||[];if(this.componentConfigSignal().customAutocompleteSearch||(e?r=this._filterCustom(e):r=this.selectedAutocompleteData?.data?.slice()||[]),t?.groups&&t.groups.length>0){let c=[],p=new Map;t.groups?.forEach(I=>{p.set(I.id,{id:I.id,name:I.name,members:[]})}),r.forEach(I=>{let x={type:"custom",custom:I};I.groupId&&p.has(I.groupId)?p.get(I.groupId)?.members.push(x):c.push(x)});let g=Array.from(p.values()).filter(I=>I.members.length>0),f=this.createFlattenedItems({allItems:[],contactsWithoutGroup:c,groups:g,isExpandedGroups:!1,isCustomGroups:!0});this.componentConfigSignal.update(I=>D(E({},I),{customGroupsEnabled:!0,flattenedItems$:le(f),contactsWithoutGroup:c,groups:g}))}else{let c=r.map(g=>({type:"custom",custom:g})),p=this.createFlattenedItems({allItems:c,isExpandedGroups:!1,isCustomGroups:!1});this.componentConfigSignal.update(g=>D(E({},g),{customGroupsEnabled:!1,flattenedItems$:le(p)}))}let s=this.getViewport();if(s){let p=(this.componentConfigSignal().autoCompleteScrollConfig?.itemSize||this.ITEM_SIZE)*this.MAX_VISIBLE_ITEMS;s.style.height=`${p}px`,s.style.maxHeight=`${p}px`}this.openPanelOptimized(),this.cd.markForCheck()}}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent filterOptions: ",e)}})}displayFn(e){try{return e?.name||e?.email||""}catch(t){return this.loggingService.catch("Error in AutocompletePanelComponent displayFn: ",t),""}}trackByFlattenedItem(e,t){try{return t.id||e.toString()}catch(r){return this.loggingService.catch("Error in AutocompletePanelComponent trackByFlattenedItem: ",r),e.toString()}}createFlattenedItems(e){try{let{allItems:t,contactsWithoutGroup:r,groups:a,newUserContact:s,isExpandedGroups:c=!1,isCustomGroups:p=!1}=e,g=[];if(c||p){if(!this.componentConfigSignal().showMentionGroupsOnly&&!this.componentConfigSignal().showMentionGroupsFirst&&r?.forEach((f,I)=>{let x=new Om;x.originalItem=f,x.disabled=!!f.disabled,x.id=p?`velt-option-custom-ungrouped-${I}`:`velt-option-user-${I}`,x.testId=p?`${this.componentId}-custom-ungrouped-${I}`:`${this.componentId}-user-${I}`,g.push(x)}),a?.forEach((f,I)=>{if(f?.members?.length){let x=new Om;x.originalItem={type:"group",group:f},x.isGroupHeader=!0,x.disabled=!0,x.group=f,x.id=p?`velt-option-custom-group-${I}`:`velt-option-group-${I}`,x.testId=p?`${this.componentId}-custom-group-${I}`:`${this.componentId}-group-${I}`,g.push(x),f.members.forEach((B,z)=>{let W=new Om;W.originalItem=B,W.isGroupMember=!0,W.disabled=B.disabled||!1,W.id=p?`velt-option-custom-group-${I}-member-${z}`:`velt-option-group-${I}-member-${z}`,W.testId=p?`${this.componentId}-custom-group-${I}-member-${z}`:`${this.componentId}-group-${I}-member-${z}`,g.push(W)})}}),!this.componentConfigSignal().showMentionGroupsOnly&&this.componentConfigSignal().showMentionGroupsFirst&&r?.length){let f=new Om;f.originalItem={type:"group"},f.isGroupHeader=!0,f.disabled=!0,f.groupName="Ungrouped",f.id="velt-option-ungrouped",f.testId=`${this.componentId}-ungrouped`,g.push(f),r.forEach((I,x)=>{let B=new Om;B.originalItem=I,B.isGroupMember=!0,B.disabled=I.disabled||!1,B.id=`velt-option-user-${x}`,B.testId=`${this.componentId}-user-${x}`,g.push(B)})}}else t.forEach((f,I)=>{let x=new Om;x.originalItem=f,x.disabled=f.disabled||!1,x.id=`velt-option-${I}`,x.testId=`${this.componentId}-${I}`,g.push(x)});if(s?.contact?.email){let f=new Om;f.originalItem=s,f.isNewContact=!0,f.id="velt-new-contact-option",f.testId=`${this.componentId}-new-contact`,g.push(f)}return g}catch(t){return this.loggingService.catch("Error in AutocompletePanelComponent createFlattenedItems: ",t),[]}}setTriggerToMatAutocomplete(){try{this.matAutocomplete&&this.trigger&&(this.trigger.autocomplete=this.matAutocomplete)}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent setTriggerToMatAutocomplete: ",e)}}handleInput(e){try{if(e?.target?.hasAttribute("contenteditable")){let t="",r=this.autocompleteDataMap?Object.keys(this.autocompleteDataMap):["@"];if(e?.data===" "&&(t=rC(e?.target,r),t&&r.includes(t.trim()))){this.closePanel();return}if(["safari","firefox"].includes(this.deviceInfo?.browserName?.toLowerCase())?(!this.trigger?.panelOpen&&!this.autocompleteDataMap[e?.data||""]&&(this.oldText=e.target.innerText),this.newText=e.target.innerText,t=this.getWordAtCursorForSafari()):t=rC(e?.target,r),e?.target?.innerHTML.length===1&&(this.selectedAutocompleteData=void 0),t){let a=t.charAt(0),s=window.getSelection(),c=!1;if(s&&s.rangeCount>0){let p=s.getRangeAt(0),g=p.startOffset,f=p.commonAncestorContainer?.textContent||"";c=this.isAutocompleteDisabledAtPosition(f,g,r)}if(!c&&(!this.selectedAutocompleteData||this.autocompleteDataMap[a])&&(this.selectedAutocompleteData=this.autocompleteDataMap[a]),!c&&this.selectedAutocompleteData){this.trigger?.panelOpen||(this.openPanelOptimized(),this.filterOptions());let p=t.substring(1);this.inputFilterFormControl.setValue(p);let g=!1;if(this.componentConfigSignal().customAutocompleteSearch&&(this.trigger?.panelOpen?a===this.selectedAutocompleteData.hotkey&&(g=!0):g=!0,g)){let f={event:e,searchText:p,type:this.selectedAutocompleteData?.type};this.commentActionsService.autocompleteSearch(f)}}else this.inputFilterFormControl.setValue(t),c&&this.trigger?.panelOpen&&(this.trigger.closePanel(),this.selectedAutocompleteData=void 0)}else this.inputFilterFormControl.setValue(""),this.trigger?.panelOpen&&(this.trigger.closePanel(),this.selectedAutocompleteData=void 0)}else{let t=e?.target?.value;if(this.inputFilterFormControl.setValue(t),!this.matAutocompleteTrigger?.panelOpen&&(this.openPanelOptimized(),this.componentConfigSignal().customAutocompleteSearch)){let r={event:e,searchText:t,type:this.selectedAutocompleteData?.type};this.commentActionsService.autocompleteSearch(r)}}e.stopPropagation()}catch(t){this.loggingService.catch("Error in AutocompletePanelComponent handleInput: ",t)}}getWordAtCursorForSafari(){try{let e=this.oldText?.split(/\s+/)?.filter(a=>a),t=this.newText?.split(/\s+/)?.filter(a=>a);this.wordIndex=-1;let r="";return t?.forEach((a,s)=>{e[s]!==a&&(r=a,this.wordIndex=s)}),r}catch(e){return this.loggingService.catch("Error in AutocompletePanelComponent getWordAtCursorForSafari: ",e),""}}onOptionSelected(e){try{if(this.enterPressed.emit(),this.selectedAutocompleteData)if(e.option.value?.type==="group"){let t=e.option.value.group;this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let r=this.trigger?this.trigger._element?.nativeElement:null,a=this.replaceWordAtCursor(r,t?.metadata?.groupName);a&&this.groupOptionSelected.emit({text:a,groupId:t?.metadata?.groupId,clientGroupId:t?.metadata?.clientGroupId})}else if(this.selectedAutocompleteData.type==="contact"){let t=e.option.value.contact;if(t?.visibility=="here"){this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let r=this.trigger?this.trigger._element?.nativeElement:null;this.replaceWordAtCursor(r,t?.name),this.atHereSelected.emit(t)}else if(!t?.email||new RegExp(U.REGEX_EMAIL).test("@"+t?.email)){this.addContact(),this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let a=this.trigger?this.trigger._element?.nativeElement:null,s=t?.name||t?.email,c=this.replaceWordAtCursor(a,s);this.optionSelected.emit(t),this.userContactOptionSelected.emit({text:c,userId:t.userId,contact:t}),this.callbackOnOptionSelected(t)}}else{let t=e.option.value.custom;this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let r=this.trigger?this.trigger._element?.nativeElement:null,a=this.replaceWordAtCursor(r,t.name);a&&this.customOptionSelected.emit({text:a,custom:t})}this.closePanel()}catch(t){this.loggingService.catch("Error in AutocompletePanelComponent onOptionSelected: ",t)}}onOptionClick(e){try{if(this.selectedAutocompleteData)if(this.selectedAutocompleteData.type==="custom"){let t=e.custom;if(t){this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let r=this.trigger?this.trigger._element?.nativeElement:null,a=this.replaceWordAtCursor(r,t.name);a&&this.customOptionSelected.emit({text:a,custom:t}),this.closePanel()}}else if(e?.type==="group"){let t=e.group;if(t){this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let r=this.trigger?this.trigger._element?.nativeElement:null,a=this.replaceWordAtCursor(r,t?.metadata?.groupName);a&&this.groupOptionSelected.emit({text:a,groupId:t?.metadata?.groupId,clientGroupId:t?.metadata?.clientGroupId}),this.closePanel()}}else{let t=e.contact;if(t)if(t?.visibility==="here"){this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let r=this.trigger?this.trigger._element?.nativeElement:null;this.replaceWordAtCursor(r,t.name),this.atHereSelected.emit(t),this.closePanel()}else{if(!t?.email||new RegExp(U.REGEX_EMAIL).test("@"+t?.email)){this.addContact(),this.autocompletePanelInput?.nativeElement&&(this.autocompletePanelInput.nativeElement.value=""),this.inputFilterFormControl.setValue(null);let a=this.trigger?this.trigger._element?.nativeElement:null,s=t?.name||t?.email,c=this.replaceWordAtCursor(a,s);this.optionSelected.emit(t),this.userContactOptionSelected.emit({text:c,userId:t.userId,contact:t}),this.callbackOnOptionSelected(t)}this.closePanel()}}}catch(t){this.loggingService.catch("Error in AutocompletePanelComponent onOptionClick: ",t)}}addContact(){try{this.componentConfigSignal().newUserContact?.contact&&(this.contactService.addUserContact(this.componentConfigSignal().newUserContact?.contact),this.componentConfigSignal.update(e=>(e=D(E({},e),{newUserContact:void 0}),e)))}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent addContact: ",e)}}replaceWordAtCursor(e,t){try{let r="";if(e){let a=s=>{let c=s.charAt(0);return this.selectedAutocompleteData?.hotkey===c?c:""};if(["safari","firefox"].includes(this.deviceInfo?.browserName?.toLowerCase())){let s=this.newText?.split(/\s+/)?.filter(f=>f),c=s[this.wordIndex];r=(a(c||"")||"")+t,s[this.wordIndex]=r;let g=s.join(" ");e.innerText=g}else{let s=this.autocompleteDataMap?Object.keys(this.autocompleteDataMap):["@"],c=rC(e,s);r=(a(c||"")||"")+t,Xk(e,r,s)}}return r}catch(r){return this.loggingService.catch("Error in AutocompletePanelComponent replaceWordAtCursor: ",r),""}}_filter(e){try{let t=e.email?.toLowerCase();return this.userContacts?.filter(r=>r?.email?.includes(t)||r?.name?.toLowerCase()?.includes(t)||r?.organizationName?.toLowerCase()?.includes(t))}catch(t){return this.loggingService.catch("Error in AutocompletePanelComponent _filter: ",t),[]}}_filterCustom(e){try{return this.selectedAutocompleteData?.data?.filter(t=>t.name?.toLowerCase()?.includes(e?.toLowerCase()))||[]}catch(t){return this.loggingService.catch("Error in AutocompletePanelComponent _filterCustom: ",t),[]}}_filterGroup(e){try{return this.organizationGroups?.filter(t=>t?.metadata?.groupName?.toLowerCase()?.includes(e?.toLowerCase()))}catch(t){return this.loggingService.catch("Error in AutocompletePanelComponent _filterGroup: ",t),[]}}fetchFilteredUsersFromDb(e){return Q(this,null,function*(){try{yield this.contactService.searchUsers(e)}catch(t){this.loggingService.catch("Error in AutocompletePanelComponent fetchFilteredUsersFromDb: ",t)}})}setAutocompletePosition(){try{this.matAutocompleteTrigger&&(this.matAutocompleteTrigger.position=this.position)}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent setAutocompletePosition: ",e)}}callbackOnOptionSelected(e){try{this.contactService.onContactSelected(e)}catch(t){this.loggingService.catch("Error in AutocompletePanelComponent callbackOnOptionSelected: ",t)}}getViewport(){try{return this.matAutocompleteTrigger?._overlayRef?.overlayElement?.querySelector("cdk-virtual-scroll-viewport")||null}catch(e){return this.loggingService.catch("Error in AutocompletePanelComponent getViewport: ",e),null}}openPanelOptimized(){try{this.trigger?requestAnimationFrame(()=>{this.trigger?.openPanel(),this.trigger?.updatePosition(),setTimeout(()=>{this.autocompleteStateChanged.emit(!0)},10)}):this.matAutocompleteTrigger&&(this.matAutocompleteTrigger?.panelOpen||requestAnimationFrame(()=>{this.matAutocompleteTrigger?.openPanel(),this.matAutocompleteTrigger?.updatePosition(),setTimeout(()=>{this.autocompleteStateChanged.emit(!0)},10)})),setTimeout(()=>{this.viewport?.scrollToIndex(1),this.viewport?.scrollToIndex(0)},50)}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent openPanelOptimized: ",e)}}closePanel(){try{this.trigger?(this.trigger.closePanel(),this.inputFilterFormControl.setValue("")):this.matAutocompleteTrigger&&this.matAutocompleteTrigger.closePanel(),this.type!=="contact"&&(this.selectedAutocompleteData=void 0),setTimeout(()=>{this.autocompleteStateChanged.emit(!1)},300)}catch(e){this.loggingService.catch("Error in AutocompletePanelComponent closePanel: ",e)}}disableAutocompleteAtPosition(e){try{this.autocompleteDisabledPositions.add(e),setTimeout(()=>{this.autocompleteDisabledPositions.delete(e)},3e4)}catch(t){this.loggingService.catch("Error in AutocompletePanelComponent disableAutocompleteAtPosition: ",t)}}isAutocompleteDisabledAtPosition(e,t,r){try{let a=-1;for(let s of r){let c=e.lastIndexOf(s,t);c>a&&(a=c)}return a!==-1&&this.autocompleteDisabledPositions.has(a)}catch(a){return this.loggingService.catch("Error in AutocompletePanelComponent isAutocompleteDisabledAtPosition: ",a),!1}}};o.\u0275fac=function(t){return new(t||o)(h(je),h(Fl),h(Ii),h(_),h(R),h(Zd),h(_i),h(an),h(ea),h(Ja),h(Ke),h(S),h(Un),h(we),h(ol))},o.\u0275cmp=O({type:o,selectors:[["velt-autocomplete-panel-internal"]],viewQuery:function(t,r){if(t&1&&(it(Uin,5),it(jin,5),it($in,5),it(Hin,5)),t&2){let a;et(a=tt())&&(r.matAutocomplete=a.first),et(a=tt())&&(r.matAutocompleteTrigger=a.first),et(a=tt())&&(r.autocompletePanelInput=a.first),et(a=tt())&&(r.viewport=a.first)}},hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{type:"type",trigger:[0,"autocompletePanelTrigger","trigger"],triggerElement:[0,"autocompletePanelTriggerElement","triggerElement"],hideInput:"hideInput",placeholder:"placeholder",metadata:"metadata",enableOnFocus:"enableOnFocus",position:[0,"autocompletePanelPosition","position"],excludeContacts:"excludeContacts",showAtHere:"showAtHere"},outputs:{optionSelected:"optionSelected",atHereSelected:"atHereSelected",userContactOptionSelected:"userContactOptionSelected",customOptionSelected:"customOptionSelected",groupOptionSelected:"groupOptionSelected",enterPressed:"enterPressed",autocompleteStateChanged:"autocompleteStateChanged"},standalone:!1,features:[V([S]),L],decls:8,vars:17,consts:[["matAutocomplete","matAutocomplete"],["userContactRef",""],["autocompletePanelInput","","matAutocompleteTrigger","matAutocompleteTrigger"],["viewport",""],["role","combobox",1,"velt-autocomplete-panel"],[1,"velt-autocomplete-panel--input"],["type","text","autofocus","","autofocus","",3,"placeholder","matAutocomplete","matAutocompleteDisabled","matAutocompletePosition","click","keyup","keydown","keyup.escape","input",4,"ngIf"],["role","listbox",1,"velt-autocomplete-panel--autocomplete",3,"optionSelected","autoActiveFirstOption","hideSingleSelectionIndicator","snippylyOverlay","snippylyOverlayZIndex","displayWith"],["class","velt-autocomplete-panel--container",3,"s-comment-autocomplete-panel-dark",4,"veltIf"],["type","text","autofocus","","autofocus","",3,"click","keyup","keydown","keyup.escape","input","placeholder","matAutocomplete","matAutocompleteDisabled","matAutocompletePosition"],[1,"velt-autocomplete-panel--container"],["class","velt-autocomplete-panel--viewport",3,"itemSize","minBufferPx","maxBufferPx","templateCacheSize",4,"ngIf"],["class","velt-autocomplete-panel--normal-viewport",4,"ngIf"],[1,"velt-autocomplete-panel--viewport",3,"itemSize","minBufferPx","maxBufferPx","templateCacheSize"],[3,"disabled","value","velt-group-option","velt-group-member-option","pointerdown","pointerup",4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTrackBy"],[3,"pointerdown","pointerup","disabled","value"],[4,"ngIf"],[3,"componentConfigSignal","group","groupName"],[1,"velt-group-member"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"velt-autocomplete-panel--normal-viewport"],[3,"disabled","value","velt-group-option","velt-group-member-option","pointerdown","pointerup",4,"ngFor","ngForOf","ngForTrackBy"],[3,"componentConfigSignal","selectorItem","isNewContact"]],template:function(t,r){if(t&1){let a=K();y(0,"div",4)(1,"div",5),u(2,Win,3,8,"input",6),b()(),y(3,"mat-autocomplete",7,0),G("optionSelected",function(c){return N(a),F(r.onOptionSelected(c))}),u(5,son,5,9,"div",8),b(),u(6,lon,1,3,"ng-template",null,1,Ee)}if(t&2){let a=me(4);T("data-testid",r.componentId)("aria-expanded",r.trigger==null?null:r.trigger.panelOpen)("aria-haspopup",!0)("aria-controls",r.componentId),m(),T("data-testid",r.componentId+"-input-container"),m(),d("ngIf",!r.hideInput),m(),d("autoActiveFirstOption",!0)("hideSingleSelectionIndicator",!0)("snippylyOverlay",a)("snippylyOverlayZIndex",2147483627)("displayWith",r.displayFn),m(2),d("veltIf",k(14,Gin,r.conditionSignal(),A(12,zin,r.componentConfigSignal)))}},dependencies:[Et,X,Dt,nV,ES,Xv,Yb,z0,Kb,di,n_,N1,se,kB],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}[_nghost-%COMP%], .velt-autocomplete-panel--autocomplete{--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-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-autocomplete-panel--autocomplete:has(>.s-comment-autocomplete-panel-dark){--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-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%] *[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0);outline:none;margin:0;padding:0;line-height:1.5;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));font-family:var(--velt-default-font-family)}[_nghost-%COMP%] *[_ngcontent-%COMP%]:empty:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){display:revert}.velt-autocomplete-panel[_ngcontent-%COMP%]{position:relative;width:100%}.velt-autocomplete-panel--input[_ngcontent-%COMP%]{width:100%}.velt-autocomplete-panel--input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%;padding:8px;border-radius:var(--velt-border-radius-sm);background:var(--velt-background-0);color:var(--velt-text-1);font-size:14px;line-height:1.5;outline:none}.velt-autocomplete-panel--input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{border-color:var(--velt-border-4)} .velt-autocomplete-panel--autocomplete{background:var(--velt-background-0);border:1px solid var(--velt-border-2);box-shadow:0 2px 4px #0000001a;max-height:256px;overflow:auto} .velt-autocomplete-panel--autocomplete::-webkit-scrollbar{display:none;width:0;height:0} .velt-autocomplete-panel--autocomplete::-webkit-scrollbar{width:0;height:0} .velt-autocomplete-panel--autocomplete::-webkit-scrollbar-button{width:0;height:0} .velt-autocomplete-panel--autocomplete.mat-mdc-autocomplete-panel{padding:0;border-radius:var(--velt-border-radius-md)!important} .velt-autocomplete-panel--autocomplete.mat-mdc-autocomplete-panel .mat-mdc-option.mdc-list-item{font-size:14px;line-height:1.5;height:auto;padding:8px 16px;background:var(--velt-background-0)} .velt-autocomplete-panel--autocomplete.mat-mdc-autocomplete-panel .mat-mdc-option.mdc-list-item:hover:not(.mdc-list-item--disabled){background:var(--velt-background-2)} .velt-autocomplete-panel--autocomplete.mat-mdc-autocomplete-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active{background:var(--velt-background-3)} .velt-autocomplete-panel--autocomplete.mat-mdc-autocomplete-panel .mat-mdc-option.mdc-list-item .mdc-list-item__primary-text{color:var(--velt-text-1);width:100%} .velt-autocomplete-panel--autocomplete .cdk-virtual-scroll-viewport{height:100%;width:100%;max-height:256px;background:var(--velt-background-0)} .velt-autocomplete-panel--autocomplete .cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper{max-width:100%;width:100%;box-sizing:border-box} .velt-autocomplete-panel--autocomplete .velt-autocomplete-panel--container{background:var(--velt-background-0)}.velt-autocomplete-panel--viewport[_ngcontent-%COMP%]{height:256px;width:100%;background:var(--velt-background-0);scrollbar-width:none}.velt-autocomplete-panel--expanded-groups[_ngcontent-%COMP%]{max-height:256px;width:100%;overflow-y:auto;background:var(--velt-background-0);scrollbar-width:none}.velt-autocomplete-panel--expanded-groups[_ngcontent-%COMP%] .velt-group-option[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-6, #666);text-overflow:ellipsis;font-size:12px;font-style:normal;font-weight:400;line-height:normal;text-transform:uppercase;padding:4px 12px;border-top:1px solid var(--velt-border-2);margin-top:12px}.velt-autocomplete-panel--expanded-groups[_ngcontent-%COMP%] .velt-group-option[_ngcontent-%COMP%]:first-child{border-top:none;margin-top:0}.velt-autocomplete-panel--expanded-groups[_ngcontent-%COMP%] .velt-group-toggle[_ngcontent-%COMP%]{font-size:10px;color:var(--velt-text-2)}.velt-autocomplete-panel--expanded-groups[_ngcontent-%COMP%] .velt-group-member-option[_ngcontent-%COMP%]{padding-left:28px;background-color:var(--velt-background-0)}.velt-autocomplete-panel--expanded-groups[_ngcontent-%COMP%] .velt-group-member[_ngcontent-%COMP%]{width:100%}"],changeDetection:0});let i=o;return i})();function con(i,o){if(i&1){let n=K();v(0),y(1,"div",23)(2,"div",24),te(3),b(),y(4,"div",25),G("click",function(){let t=N(n).$implicit,r=l();return F(r.removeSelectedUserToInvite(t))}),ce(),y(5,"svg",26),w(6,"path",7),b()()(),C()}if(i&2){let n=o.$implicit;m(3),ze((n==null||n.user==null?null:n.user.name)||(n==null||n.user==null?null:n.user.email))}}function don(i,o){if(i&1){let n=K();v(0),y(1,"div",31),G("click",function(){let t=N(n).$implicit,r=l(2);return F(r.selectRole(t))}),ce(),y(2,"svg",32),w(3,"path",33),b(),ft(),y(4,"div")(5,"h4"),te(6),P(7,"translate"),b(),y(8,"p"),te(9),P(10,"translate"),b()()(),C()}if(i&2){let n=o.$implicit,e=o.first,t=l(2);m(),pe("border-top",!e),m(),at("visibility",(t.selectedUserRole==null?null:t.selectedUserRole.id)===(n==null?null:n.id)?"visible":"hidden"),m(4),ze(M(7,6,n==null?null:n.name)),m(3),ze(M(10,8,n==null?null:n.description))}}function mon(i,o){if(i&1&&(y(0,"div",27)(1,"div",28),u(2,don,11,10,"ng-container",12),b(),te(3),P(4,"translate"),ce(),y(5,"svg",29),w(6,"path",30),b()()),i&2){let n=l();pe("disabled",!n.isUserAdmin),m(2),d("ngForOf",n.userRoles),m(),Se(" ",M(4,4,n.selectedUserRole==null?null:n.selectedUserRole.name)," ")}}function pon(i,o){i&1&&(ce(),y(0,"svg",32),w(1,"path",44),b())}function gon(i,o){if(i&1&&(y(0,"div",41),te(1),P(2,"translate"),u(3,pon,2,0,"svg",43),b()),i&2){let n=l().$implicit,e=l(2);m(),Se(" ",M(2,2,n==null||n.role==null?null:n.role.name)," "),m(2),d("ngIf",e.isUserAdmin&&(n==null||n.user==null?null:n.user.email)!==(e.user==null?null:e.user.email))}}function uon(i,o){if(i&1){let n=K();y(0,"div",28)(1,"div",45),G("click",function(){N(n);let t=l().$implicit,r=l(2);return F(r.removeUser(t))}),te(2),P(3,"translate"),b()()}i&2&&(m(2),Se(" ",M(3,1,"Remove")," "))}function hon(i,o){if(i&1&&(v(0),y(1,"div",38)(2,"div",39),w(3,"snippyly-user-avatar",40),te(4),b(),y(5,"div",41)(6,"app-overlay-tooltip",42),u(7,gon,4,4,"ng-template",null,1,Ee)(9,uon,4,3,"ng-template",null,2,Ee),b()()(),C()),i&2){let n=o.$implicit,e=l(2);m(3),d("user",n==null?null:n.user)("background","#625DF5"),m(),Se(" ",(n==null||n.user==null?null:n.user.name)||(n==null||n.user==null?null:n.user.email)," "),m(2),d("disabled",!(e.isUserAdmin&&(n==null||n.user==null?null:n.user.email)!==(e.user==null?null:e.user.email)))}}function fon(i,o){i&1&&(v(0),y(1,"div"),te(2),P(3,"translate"),b(),C()),i&2&&(m(2),ze(M(3,1,"No users are added.")))}function von(i,o){if(i&1&&(y(0,"div",34)(1,"div",35),te(2),P(3,"translate"),b(),u(4,hon,11,4,"ng-container",36)(5,fon,4,3,"ng-container",37),b()),i&2){let n=l();m(2),ze(M(3,4,"People on this project")),m(2),d("ngForOf",n.documentUsers)("ngForTrackBy",n.trackByDocumentUserId),m(),d("ngIf",!(n.documentUsers!=null&&n.documentUsers.length))}}function Con(i,o){if(i&1&&(v(0),y(1,"div",38)(2,"div",39),w(3,"snippyly-user-avatar",40),te(4),P(5,"translate"),b()(),C()),i&2){let n=o.$implicit;m(3),d("user",n)("background","#625DF5"),m(),Se(" ",M(5,3,(n==null?null:n.name)||(n==null?null:n.email))," ")}}function _on(i,o){if(i&1&&(y(0,"div",38)(1,"div",39),w(2,"snippyly-user-avatar",40),te(3),P(4,"translate"),b(),y(5,"div",27),te(6),P(7,"translate"),b()()),i&2){let n=l().$implicit;m(2),d("user",n)("background","#625DF5"),m(),Se(" ",M(4,4,(n==null?null:n.name)||(n==null?null:n.email))," "),m(3),Se(" ",M(7,6,"Invited")," ")}}function yon(i,o){if(i&1&&(v(0),u(1,_on,8,8,"div",46),C()),i&2){let n=o.$implicit,e=l(2);m(),d("ngIf",!e.huddleUsersByEmailMap[n==null?null:n.email])}}function Son(i,o){if(i&1&&(y(0,"div",34)(1,"div",35),te(2),P(3,"translate"),b(),u(4,Con,6,5,"ng-container",36)(5,yon,2,1,"ng-container",36),b()),i&2){let n=l();m(2),ze(M(3,5,"People on this huddle")),m(2),d("ngForOf",n.huddleUsers)("ngForTrackBy",n.trackByHuddleUserId),m(),d("ngForOf",n.huddleInvitees)("ngForTrackBy",n.trackByHuddleInviteeId)}}function bon(i,o){if(i&1){let n=K();y(0,"div",47)(1,"div",48),te(2),P(3,"translate"),b(),y(4,"div",49)(5,"div",28)(6,"div",31),G("click",function(){N(n);let t=l();return F(t.changeDocumentAccessType(t.DocumentAccessTypes.PUBLIC))}),ce(),y(7,"svg",32),w(8,"path",33),b(),ft(),y(9,"div")(10,"h3"),te(11),P(12,"translate"),P(13,"titlecase"),b(),y(14,"p"),te(15),P(16,"translate"),b()()(),y(17,"div",45),G("click",function(){N(n);let t=l();return F(t.changeDocumentAccessType(t.DocumentAccessTypes.RESTRICTED))}),ce(),y(18,"svg",32),w(19,"path",33),b(),ft(),y(20,"div")(21,"h3"),te(22),P(23,"translate"),P(24,"titlecase"),b(),y(25,"p"),te(26),P(27,"translate"),b()()()(),ce(),y(28,"svg",32),w(29,"path",50)(30,"path",51)(31,"path",52),b(),ft(),y(32,"div",53)(33,"h3"),te(34),P(35,"translate"),P(36,"titlecase"),b(),y(37,"p"),te(38),P(39,"translate"),b()()()()}if(i&2){let n=l();m(2),ze(M(3,11,"General access")),m(5),at("visibility",!n.documentAccessType||n.documentAccessType===n.DocumentAccessTypes.PUBLIC?"visible":"hidden"),m(4),ze(M(13,15,M(12,13,n.DocumentAccessTypes.PUBLIC))),m(4),ze(M(16,17,n.documentAccessTypeMap[n.DocumentAccessTypes.PUBLIC]==null?null:n.documentAccessTypeMap[n.DocumentAccessTypes.PUBLIC].description)),m(3),at("visibility",n.documentAccessType===n.DocumentAccessTypes.RESTRICTED?"visible":"hidden"),m(4),ze(M(24,21,M(23,19,n.DocumentAccessTypes.RESTRICTED))),m(4),ze(M(27,23,n.documentAccessTypeMap[n.DocumentAccessTypes.RESTRICTED]==null?null:n.documentAccessTypeMap[n.DocumentAccessTypes.RESTRICTED].description)),m(8),ze(M(36,27,M(35,25,n.documentAccessType||n.DocumentAccessTypes.PUBLIC))),m(4),Se("",M(39,29,n.documentAccessTypeMap[n.documentAccessType?n.documentAccessType:n.DocumentAccessTypes.PUBLIC]==null?null:n.documentAccessTypeMap[n.documentAccessType?n.documentAccessType:n.DocumentAccessTypes.PUBLIC].description)," ")}}function Ion(i,o){i&1&&(ce(),y(0,"svg",54),w(1,"path",55),b())}function Eon(i,o){i&1&&(ce(),y(0,"svg",56),w(1,"path",57),b())}var pye=(()=>{let o=class o{constructor(e,t,r,a,s,c,p,g,f,I,x){this.analyticsService=e,this.authService=t,this.configService=r,this.docService=a,this.documentUserAccessService=s,this.huddleService=c,this.loggingService=p,this.iamService=g,this.toastService=f,this.dialogRef=I,this.usersToInvite=[],this.documentUsers=[],this.huddleInvitees=[],this.huddleUsers=[],this.huddleUsersByEmailMap={},this.userRoles=[],this.excludeContacts=[],this.linkCopied=!1,this.hideAccessControlDropdown=!1,this.subscriptions=[],this.title="Share project",this.placeholder="Add email address",this.documentAccessType="",this.DocumentAccessTypes=Oi,this.isUserAdmin=!1,this.documentAccessTypeMap=U.DocumentAccessTypeMap,this.documentUserAccessList=!0,this.veltElement=!0;try{x&&(this.hideAccessControlDropdown=!!x.hideAccessControlDropdown,this.type=x.type,this.source=x.source,x.title&&(this.title=x.title),x.placeholder&&(this.placeholder=x.placeholder),this.documentUserAccessList=!!x.documentUserAccessList,this.inviteUrl=x.inviteUrl),this.subscriptions.push(this.authService.getUser$().subscribe(B=>{this.user=B})),this.subscriptions.push(this.iamService.isUserAdmin$().subscribe(B=>{this.isUserAdmin=B})),this.subscriptions.push(this.configService.getSF$().subscribe(B=>{B?this.documentAccessTypeMap=U.DocumentAccessTypeMapSF:this.documentAccessTypeMap=U.DocumentAccessTypeMap})),this.type!=="invite"&&this.subscriptions.push(this.documentUserAccessService.getDocumentUsers$().subscribe(B=>{this.documentUsers=B,this.updateExcludeContacts()})),this.type!=="invite"&&this.subscriptions.push(this.iamService.getRoles$().subscribe(B=>{this.userRoles=B,this.userRoles?.length&&(this.selectedUserRole=this.userRoles?.find(z=>z.name===uo.COMMENTER))})),this.type!=="invite"&&this.subscriptions.push(this.iamService.getDocumentIAM$().subscribe(B=>{this.documentAccessType=this.docService.getDocumentAccessType(B)})),this.type==="invite"&&(this.subscriptions.push(this.huddleService.getHuddleAttendees$().subscribe(B=>{this.huddleUsers=B,this.huddleUsersByEmailMap={},B.forEach(z=>{z.email&&(this.huddleUsersByEmailMap[z.email]=z)})})),this.subscriptions.push(this.huddleService.getHuddleInvitees$().subscribe(B=>{this.huddleInvitees=B})))}catch(B){this.loggingService.catch("Error in UserInviteDialogComponent constructor: ",B)}}ngOnInit(){try{this.dialogRef.addPanelClass("snippyly-user-invite-dialog"),this.userRoles?.length&&(this.selectedUserRole=this.userRoles?.find(e=>e.name===uo.COMMENTER))}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent ngOnInit: ",e)}}updateExcludeContacts(){try{this.excludeContacts=[],this.excludeContacts.push(...this.documentUsers.map(e=>e.user)),this.excludeContacts.push(...this.usersToInvite.map(e=>e.user))}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent updateExcludeContacts: ",e)}}trackByDocumentUserId(e,t){return t.id}trackByHuddleUserId(e,t){return t.userSnippylyId||t.userId}trackByHuddleInviteeId(e,t){return t.userId||t.email}selectRole(e){try{this.selectedUserRole=e}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent selectRole: ",t)}}onUserSelected(e){try{let t=new d9;t.id=e.email?Tt(e.email):Tt(e.userId),t.user=e,this.usersToInvite.find(r=>r.id===t.id)||this.usersToInvite.push(t),this.updateExcludeContacts()}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent onUserSelected: ",t)}}inviteSelectedUsers(){try{if(this.usersToInvite?.length)if(this.type==="invite"){let e=this.usersToInvite.map(t=>t.user);this.analyticsService.trackEvent(Y.Events.InviteDialog.USER_INVITED,{source:this.source}),this.huddleService.inviteUsers(e),this.toastService.setToast({message:"Invitation sent!",type:"success",duration:2e3})}else{this.usersToInvite.forEach(a=>{this.selectedUserRole&&(a.role=this.selectedUserRole)});let e=this.usersToInvite.filter(a=>a.role?.name===uo.ADMIN).map(a=>a.user.email),t=this.usersToInvite.filter(a=>a.role?.name===uo.COMMENTER).map(a=>a.user.email),r={actionType:sz.INVITE,userInvite:{admin:e?.length?{emails:e,emailProperties:{url:this.getInviteUrl()}}:void 0,commenter:t?.length?{emails:t,clientDocumentId:this.docService.getDocumentPaths()?.clientDocumentId,documentId:this.docService.getDocumentPaths()?.documentId,clientOrganizationId:this.user?.clientOrganizationId,organizationId:this.user?.organizationId,emailProperties:{url:this.getInviteUrl()}}:void 0}};this.documentUserAccessService.updateNotificationsDatabase(r),this.toastService.setToast({message:"Invitation sent!",type:"success",duration:2e3})}this.usersToInvite=[]}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent inviteSelectedUsers: ",e)}}removeSelectedUserToInvite(e){try{this.usersToInvite=this.usersToInvite.filter(t=>t.id!==e.id),this.updateExcludeContacts()}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent removeSelectedUserToInvite: ",t)}}updateUserRole(e,t){try{let r=e?.role?.name,a=t?.name;e.role=t,this.documentUserAccessService.updateDocumentUser(e,{oldAccess:r,newAccess:a})}catch(r){this.loggingService.catch("Error in UserInviteDialogComponent updateUserRole: ",r)}}removeUser(e){try{this.analyticsService.trackEvent(Y.Events.ShareDialog.DOCUMENT_USER_ACCESS_REMOVED,{targetUserId:e?.user?.userId,targetUserEmail:e?.user?.email,roleType:e?.role?.name}),this.documentUserAccessService.removeDocumentUser(e),this.toastService.setToast({message:"User removed!",type:"success",duration:2e3})}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent removeUser: ",t)}}getInviteUrl(){try{return this.inviteUrl||window.location.href}catch(e){return this.loggingService.catch("Error in UserInviteDialogComponent getInviteUrl: ",e),""}}copyLink(){try{let e=this.getInviteUrl();this.linkCopied=!0,Js(e),setTimeout(()=>{this.linkCopied=!1},2e3),this.type==="invite"?this.analyticsService.trackEvent(Y.Events.InviteDialog.INVITE_LINK_COPIED,{source:this.source}):this.type==="share"&&this.analyticsService.trackEvent(Y.Events.ShareDialog.SHARE_LINK_COPIED)}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent copyLink: ",e)}}changeDocumentAccessType(e){try{this.documentAccessType!==e&&(this.analyticsService.trackEvent(Y.Events.ShareDialog.DOCUMENT_ACCESS_CHANGED,{oldAccessType:this.documentAccessType,newAccessType:e}),this.docService.changeDocumentAccessType(e),this.toastService.setToast({message:"Access changed to '"+e+"'.",type:"success",duration:2e3}))}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent changeDocumentAccessType: ",t)}}closeDialog(){try{this.dialogRef.close()}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent closeDialog: ",e)}}ngOnDestroy(){try{this.subscriptions.forEach(e=>e.unsubscribe())}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(Ft),h(ot),h(lye),h(Or),h(_),h(xn),h(Dm),h(dr),h(ac,8))},o.\u0275cmp=O({type:o,selectors:[["snippyly-user-invite-dialog"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},standalone:!1,decls:32,vars:27,consts:[["userSelectorRef",""],["triggerTemplate",""],["tooltipTemplate",""],[1,"s-video-settings-modal",3,"click","pointerdown","pointerup"],[1,"s-video-header"],[1,"s-video-header-name"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",1,"s-cursor-pointer",3,"click"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.41076 4.41058C4.7362 4.08514 5.26384 4.08514 5.58928 4.41058L10 8.82133L14.4108 4.41058C14.7362 4.08514 15.2638 4.08514 15.5893 4.41058C15.9147 4.73602 15.9147 5.26366 15.5893 5.58909L11.1785 9.99984L15.5893 14.4106C15.9147 14.736 15.9147 15.2637 15.5893 15.5891C15.2638 15.9145 14.7362 15.9145 14.4108 15.5891L10 11.1783L5.58928 15.5891C5.26384 15.9145 4.7362 15.9145 4.41076 15.5891C4.08533 15.2637 4.08533 14.736 4.41076 14.4106L8.82151 9.99984L4.41076 5.58909C4.08533 5.26366 4.08533 4.73602 4.41076 4.41058Z","fill","#80808A"],[1,"s-video-settings-modal-item"],[1,"s-input"],[1,"s-input-chip-list-container"],[1,"s-chip-list"],[4,"ngFor","ngForOf"],[1,"s-input-user-selector",3,"optionSelected","placeholder","enableOnFocus"],["class","s-role dropdown",3,"disabled",4,"ngIf"],["class","s-video-settings-modal-item s-people-list-container",4,"ngIf"],["class","s-general-access-container",4,"ngIf"],[1,"s-buttons-wrap"],[1,"s-button","s-secondary",3,"click"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["width","20","height","20","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],[1,"s-flex-fill"],[1,"s-button","s-primary",3,"click"],[1,"s-chip"],[1,"s-chip-user"],[1,"s-chip-remove",3,"click"],["width","14","height","14","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],[1,"s-role","dropdown"],[1,"dropdown-content"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"dropdown-icon"],["fill-rule","evenodd","clip-rule","evenodd","d","M7.79289 9.79289C8.18342 9.40237 8.81658 9.40237 9.20711 9.79289L12 12.5858L14.7929 9.79289C15.1834 9.40237 15.8166 9.40237 16.2071 9.79289C16.5976 10.1834 16.5976 10.8166 16.2071 11.2071L12.7071 14.7071C12.3166 15.0976 11.6834 15.0976 11.2929 14.7071L7.79289 11.2071C7.40237 10.8166 7.40237 10.1834 7.79289 9.79289Z","fill","#D4D6DF"],[1,"dropdown-item",3,"click"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M18.7071 7.29289C19.0976 7.68342 19.0976 8.31658 18.7071 8.70711L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071L5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929C5.68342 10.9024 6.31658 10.9024 6.70711 11.2929L10 14.5858L17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289Z","fill","#80808A"],[1,"s-video-settings-modal-item","s-people-list-container"],[1,"s-people-list-title"],[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],[1,"s-user"],[1,"s-user-info"],[1,"s-flex",3,"user","background"],[1,"s-role"],[3,"disabled"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["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","#404044"],[1,"dropdown-item","border-top",3,"click"],["class","s-user",4,"ngIf"],[1,"s-general-access-container"],[1,"s-general-access-title"],[1,"s-button","s-secondary","s-document-access-btn","dropdown"],["fill-rule","evenodd","clip-rule","evenodd","d","M12 11C10.2274 11 8.64844 11.0646 7.35838 11.1466C6.13471 11.2243 5.19379 12.158 5.10597 13.373C5.0435 14.2373 5 15.1481 5 16C5 16.8519 5.0435 17.7627 5.10597 18.627C5.19379 19.842 6.13471 20.7757 7.35838 20.8534C8.64844 20.9354 10.2274 21 12 21C13.7726 21 15.3516 20.9354 16.6416 20.8534C17.8653 20.7757 18.8062 19.842 18.894 18.627C18.9565 17.7627 19 16.8519 19 16C19 15.1481 18.9565 14.2373 18.894 13.373C18.8062 12.158 17.8653 11.2243 16.6416 11.1466C15.3516 11.0646 13.7726 11 12 11ZM7.2315 9.15059C5.01376 9.29156 3.27137 11.0124 3.11117 13.2288C3.04652 14.1234 3 15.085 3 16C3 16.915 3.04652 17.8766 3.11118 18.7712C3.27137 20.9876 5.01376 22.7084 7.23151 22.8494C8.55778 22.9337 10.1795 23 12 23C13.8205 23 15.4422 22.9337 16.7685 22.8494C18.9862 22.7084 20.7286 20.9876 20.8888 18.7712C20.9535 17.8766 21 16.915 21 16C21 15.085 20.9535 14.1234 20.8888 13.2288C20.7286 11.0124 18.9862 9.29156 16.7685 9.15059C15.4422 9.06629 13.8205 9 12 9C10.1795 9 8.55778 9.06629 7.2315 9.15059Z","fill","#777E91"],["fill-rule","evenodd","clip-rule","evenodd","d","M13 16.7324C13.5978 16.3866 14 15.7403 14 15C14 13.8954 13.1046 13 12 13C10.8954 13 10 13.8954 10 15C10 15.7403 10.4022 16.3866 11 16.7324V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V16.7324Z","fill","#777E91"],["fill-rule","evenodd","clip-rule","evenodd","d","M7 6C7 3.23858 9.23858 1 12 1C14.7614 1 17 3.23858 17 6V10C17 10.5523 16.5523 11 16 11C15.4477 11 15 10.5523 15 10V6C15 4.34315 13.6569 3 12 3C10.3431 3 9 4.34315 9 6V10C9 10.5523 8.55228 11 8 11C7.44772 11 7 10.5523 7 10V6Z","fill","#777E91"],[1,"s-document-access-btn-content"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.49027 2.50491C6.46607 2.50996 6.34731 2.53007 6.22635 2.54966C5.17052 2.72053 4.19457 3.45245 3.69214 4.45019C3.56689 4.69886 3.43711 5.08311 3.37864 5.3784C3.31829 5.68302 3.31829 14.3108 3.37864 14.6154C3.52088 15.3336 3.85013 15.9526 4.36233 16.4647C4.76978 16.8722 5.22723 17.1555 5.75266 17.3256C6.23219 17.4809 6.32453 17.4891 7.59205 17.4891H8.76711L8.88599 17.4104C9.06906 17.2893 9.14407 17.146 9.14407 16.9173C9.14407 16.6887 9.06909 16.5453 8.88611 16.4242L8.76728 16.3455L7.6068 16.3286C6.3852 16.3109 6.35854 16.3081 5.96566 16.1588C5.43291 15.9564 4.86723 15.3934 4.67143 14.8707C4.49992 14.4129 4.51091 14.747 4.51091 9.9969C4.51091 5.24677 4.49992 5.58091 4.67143 5.12308C4.88025 4.56564 5.45367 4.01728 6.0476 3.80712C6.46364 3.65989 6.4966 3.65865 9.67189 3.66895C12.8862 3.67939 12.6707 3.6688 13.1239 3.83838C13.3521 3.92374 13.6919 4.15074 13.8939 4.35272C14.0958 4.5547 14.3228 4.89447 14.4082 5.12264C14.5641 5.53916 14.5639 5.53763 14.5816 6.87392L14.5983 8.13484L14.6679 8.24677C14.7061 8.30835 14.791 8.39412 14.8563 8.43737C14.9554 8.50291 15.0078 8.51605 15.1701 8.51605C15.3324 8.51605 15.3848 8.50291 15.4839 8.43737C15.5492 8.39412 15.6341 8.30835 15.6723 8.24677L15.7419 8.13484V6.85925C15.7419 5.89002 15.7321 5.53438 15.7012 5.3784C15.4231 3.97403 14.4078 2.9182 13.0001 2.56948C12.7554 2.50887 12.6941 2.50764 9.64257 2.50177C7.93299 2.49849 6.51446 2.4999 6.49027 2.50491ZM10.1326 4.86732C10.0008 4.90764 9.81429 5.10144 9.77661 5.23721C9.75922 5.29976 9.74547 5.6244 9.74538 5.97344C9.74517 6.73161 9.7789 6.93488 9.97026 7.32843C10.0835 7.56132 10.1471 7.64839 10.358 7.85928C10.5687 8.06997 10.6561 8.13387 10.8888 8.24715C11.3004 8.44752 11.4993 8.4781 12.3174 8.46675L12.9899 8.4574L13.1087 8.37872C13.2923 8.25712 13.3667 8.11437 13.3667 7.88344C13.3667 7.72342 13.3533 7.6705 13.288 7.57182C13.2448 7.50646 13.159 7.42162 13.0974 7.38336C12.9898 7.31647 12.9581 7.31319 12.2817 7.29876C11.6484 7.28524 11.5646 7.27759 11.4445 7.22234C11.2497 7.13276 11.1074 6.99491 11.0146 6.80594C10.9336 6.64091 10.9327 6.63267 10.9182 5.93556C10.904 5.25876 10.9008 5.2275 10.8339 5.11986C10.6956 4.89741 10.3918 4.788 10.1326 4.86732ZM15.7049 9.14973C15.3168 9.21439 14.8688 9.42637 14.5091 9.71547C14.1903 9.97168 12.9551 11.227 12.785 11.4677C12.6151 11.708 12.4379 12.0846 12.3662 12.3575C12.2934 12.6347 12.2934 13.2178 12.3662 13.4864C12.4763 13.8923 12.7739 14.3816 12.9941 14.5185C13.1571 14.6198 13.4451 14.6146 13.6071 14.5074C13.7916 14.3853 13.8652 14.2433 13.8652 14.0094C13.8652 13.8346 13.8552 13.8007 13.7698 13.6869C13.7174 13.6169 13.6316 13.474 13.5792 13.3691C13.4922 13.1949 13.4842 13.1559 13.4861 12.9146C13.4901 12.4126 13.6018 12.2459 14.588 11.2695C15.3768 10.4885 15.479 10.4117 15.8541 10.3176C16.4471 10.1688 17.0959 10.642 17.1542 11.2659C17.1867 11.6138 17.0539 11.95 16.7418 12.3102C16.554 12.527 16.5067 12.6446 16.5261 12.8468C16.5522 13.1185 16.7716 13.3292 17.0627 13.362C17.163 13.3733 17.2272 13.3595 17.3476 13.3006C17.6751 13.1404 18.1188 12.4832 18.2617 11.9469C18.4137 11.3768 18.3213 10.7383 18.0102 10.209C17.8837 9.99361 17.4606 9.57059 17.2452 9.444C16.7724 9.16618 16.2292 9.06241 15.7049 9.14973ZM14.7568 12.1471C14.6858 12.1846 14.588 12.2715 14.5396 12.3402C14.4628 12.4494 14.4517 12.4903 14.4517 12.6643C14.4517 12.846 14.4612 12.8773 14.5601 13.021C14.869 13.4698 14.893 13.8775 14.6373 14.3344C14.5091 14.5636 13.051 16.0217 12.8218 16.15C12.3282 16.4261 11.818 16.3718 11.4502 16.0041C11.1691 15.723 11.0679 15.3616 11.1645 14.9843C11.2245 14.75 11.3364 14.5523 11.5457 14.3107C11.7336 14.0939 11.7808 13.9764 11.7614 13.7742C11.7353 13.5024 11.5159 13.2917 11.2249 13.259C11.1245 13.2476 11.0603 13.2615 10.9399 13.3204C10.6125 13.4806 10.1687 14.1377 10.0258 14.674C9.87388 15.2442 9.96627 15.8826 10.2773 16.4119C10.4039 16.6273 10.8269 17.0504 11.0423 17.177C11.5716 17.488 12.2101 17.5804 12.7802 17.4284C13.0265 17.3628 13.41 17.1783 13.6407 17.0145C13.8608 16.858 14.9432 15.8056 15.2867 15.4139C15.9653 14.64 16.1624 13.7239 15.8293 12.8919C15.562 12.2242 15.1512 11.9389 14.7568 12.1471Z","fill","#80808A"],["width","20","height","20","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M18.7071 7.29289C19.0976 7.68342 19.0976 8.31658 18.7071 8.70711L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071L5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929C5.68342 10.9024 6.31658 10.9024 6.70711 11.2929L10 14.5858L17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289Z","fill","#ABABB5"]],template:function(t,r){if(t&1){let a=K();y(0,"div",3),G("click",function(c){return N(a),F(c.stopPropagation())})("pointerdown",function(c){return N(a),F(c.stopPropagation())})("pointerup",function(c){return N(a),F(c.stopPropagation())}),y(1,"div",4)(2,"div",5),te(3),P(4,"translate"),b(),ce(),y(5,"svg",6),G("click",function(){return N(a),F(r.closeDialog())}),w(6,"path",7),b()(),ft(),y(7,"div",8),te(8),P(9,"translate"),y(10,"div",9)(11,"div",10)(12,"div",11),u(13,con,7,1,"ng-container",12),b(),y(14,"velt-autocomplete-panel-internal",13,0),P(16,"translate"),G("optionSelected",function(c){return N(a),F(r.onUserSelected(c))}),b()(),u(17,mon,7,6,"div",14),b()(),u(18,von,6,6,"div",15)(19,Son,6,7,"div",15)(20,bon,40,31,"div",16),y(21,"div",17)(22,"div",18),G("click",function(){return N(a),F(r.copyLink())}),u(23,Ion,2,0,"svg",19)(24,Eon,2,0,"svg",20),te(25),P(26,"translate"),P(27,"translate"),b(),w(28,"div",21),y(29,"div",22),G("click",function(){return N(a),F(r.inviteSelectedUsers())}),te(30),P(31,"translate"),b()()()}t&2&&(m(3),Se(" ",M(4,15,r.title)," "),m(5),Se(" ",M(9,17,"Invite users")," "),m(5),d("ngForOf",r.usersToInvite),m(),d("placeholder",M(16,19,r.placeholder))("enableOnFocus",!1),m(3),d("ngIf",!r.hideAccessControlDropdown),m(),d("ngIf",r.documentUserAccessList&&(r.documentUsers==null?null:r.documentUsers.length)),m(),d("ngIf",(r.huddleInvitees==null?null:r.huddleInvitees.length)||(r.huddleUsers==null?null:r.huddleUsers.length)),m(),d("ngIf",r.isUserAdmin&&!r.hideAccessControlDropdown),m(3),d("ngIf",!r.linkCopied),m(),d("ngIf",r.linkCopied),m(),Se(" ",r.linkCopied?M(26,21,"Link Copied!"):M(27,23,"Copy Link")," "),m(4),pe("s-disabled",!(r.usersToInvite!=null&&r.usersToInvite.length)),m(),ze(M(31,25,"Send invite")))},dependencies:[Et,X,Jn,wd,Du,RB,ge],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}*[_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;line-height:1.5!important;color:#dcdde0!important;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){height:unset;width:unset}*[_ngcontent-%COMP%]:empty:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){display:revert!important}*[_ngcontent-%COMP%]{box-sizing:border-box}.s-video-settings-modal[_ngcontent-%COMP%], .s-video-header[_ngcontent-%COMP%], .s-video-header-name[_ngcontent-%COMP%], .s-video-settings-modal-item[_ngcontent-%COMP%], .s-input[_ngcontent-%COMP%], .s-buttons-wrap[_ngcontent-%COMP%], .s-role[_ngcontent-%COMP%], .s-user[_ngcontent-%COMP%], .s-user-info[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;color:#fff!important}.s-video-settings-modal-item[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;width:100%!important;color:#ababb5!important;font-size:.8rem!important;gap:1rem!important}.s-people-list-container[_ngcontent-%COMP%]{overflow:auto!important}.s-people-list-container[_ngcontent-%COMP%] .s-people-list-title[_ngcontent-%COMP%]{position:sticky!important;top:0!important;background:#141416!important;width:100%!important;z-index:1!important}.s-video-settings-modal[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-end!important;padding:2rem!important;gap:2rem!important;background:#141416!important;border-radius:1rem!important;max-width:42rem!important;width:80vw!important;border:2px solid #303034!important;overflow:auto!important;max-height:80vh!important}.s-video-header[_ngcontent-%COMP%]{justify-content:space-between!important;width:100%!important}.s-video-header-name[_ngcontent-%COMP%]{gap:.5rem!important;font-weight:600!important;font-size:1.2rem!important}.s-button[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((2rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((4rem + 0px) * var(--velt-base-rem-unit))!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;transition:.1s ease!important;cursor:pointer!important}.s-primary[_ngcontent-%COMP%]{background:#625df5!important;color:#fff!important}.s-primary[_ngcontent-%COMP%]:not(.s-disabled):hover{background:#4f4bbf!important}.s-disabled[_ngcontent-%COMP%]{background:#939393!important;cursor:not-allowed!important}.s-secondary[_ngcontent-%COMP%]{border:2px solid #303034!important;border-radius:.5rem!important;color:#ababb5!important;gap:.5rem!important}.s-secondary[_ngcontent-%COMP%]:hover{background:#303034!important;color:#fff!important}.s-video-settings-modal-item[_ngcontent-%COMP%] .s-heading[_ngcontent-%COMP%]{font-size:1rem!important;color:#fff!important;padding:.5rem 0!important}.s-input[_ngcontent-%COMP%]{padding:1rem!important;color:#ababb5!important;width:100%!important;justify-content:space-between!important;border-radius:1rem!important;border:2px solid #303034!important;align-items:center!important;cursor:pointer!important;transition:.2s ease!important}.s-input[_ngcontent-%COMP%]:hover{background:#303034!important}.s-buttons-wrap[_ngcontent-%COMP%]{width:100%!important;justify-content:space-between!important;align-items:stretch!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.s-user[_ngcontent-%COMP%]{width:100%!important;justify-content:space-between!important}.s-user-info[_ngcontent-%COMP%]{color:#ababb5!important;gap:.75rem!important}.s-user[_ngcontent-%COMP%] .s-role[_ngcontent-%COMP%]{color:#404044!important}.s-role[_ngcontent-%COMP%]{position:relative!important;cursor:pointer!important}.dropdown[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{position:absolute!important;top:100%!important;right:0!important;z-index:10!important}.dropdown[_ngcontent-%COMP%] .dropdown-content.top[_ngcontent-%COMP%]{top:auto!important;bottom:2rem!important}.dropdown-content[_ngcontent-%COMP%]{min-width:max-content!important;overflow:hidden!important;flex-direction:column!important;justify-content:flex-start!important;align-items:flex-start!important;border-radius:.5rem!important;border:1px solid #303034!important;font-style:normal!important;font-weight:400!important;font-size:1em!important;line-height:1em!important;color:#ababb5!important;background:#141416!important;cursor:pointer!important;transition:.2s ease!important}.dropdown-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#ababb5!important}.dropdown[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{display:none!important;visibility:hidden!important;opacity:0!important}.dropdown[_ngcontent-%COMP%] .dropdown-icon[_ngcontent-%COMP%]{width:24px!important;min-width:24px!important}.dropdown.disabled[_ngcontent-%COMP%] .dropdown-icon[_ngcontent-%COMP%]{display:none!important}.dropdown[_ngcontent-%COMP%]:not(.disabled):hover .dropdown-content[_ngcontent-%COMP%]{display:flex!important;visibility:visible!important;opacity:1!important}.dropdown-item[_ngcontent-%COMP%]{padding:1em 2rem 1rem 1rem!important;width:100%!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;gap:1em!important;line-height:1rem!important;border-radius:0!important}.dropdown-item[_ngcontent-%COMP%]:hover{background:#303034!important}.dropdown-item[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:#fff!important;margin:0!important}.dropdown-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0!important}.border-top[_ngcontent-%COMP%]{outline:solid 1px #303034!important}.s-flex-fill[_ngcontent-%COMP%]{flex-grow:1!important}.s-input-chip-list-container[_ngcontent-%COMP%]{display:flex;width:100%!important;gap:8px!important;flex-wrap:wrap!important;align-items:center!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%]{display:flex!important;gap:8px!important;flex-wrap:wrap!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%] .s-chip[_ngcontent-%COMP%]{padding:8px 16px!important;background:#222226!important;color:#dcdde0!important;border-radius:100px!important;display:flex!important;align-items:center!important;gap:8px!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%] .s-chip[_ngcontent-%COMP%] .s-chip-remove[_ngcontent-%COMP%]{display:flex!important;cursor:pointer!important}.s-input-chip-list-container[_ngcontent-%COMP%] velt-autocomplete-panel-internal.s-input-user-selector[_ngcontent-%COMP%]{flex-basis:250px!important}.s-general-access-container[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;width:100%!important;gap:8px!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn-content[_ngcontent-%COMP%]{position:relative!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%]{position:relative!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;width:100%!important;justify-content:flex-start!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{left:0!important;top:auto!important;bottom:100%!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{color:#ababb5!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{background-color:transparent!important;padding:0!important;margin:0!important;border-radius:20px!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container velt-autocomplete-panel-internal.s-input-user-selector{flex-grow:1!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container velt-autocomplete-panel-internal.s-input-user-selector input{background:transparent!important;border:0!important;outline:0!important;color:#fff!important}@media screen and (max-width: 425px){ .velt-mat-dialog-container.snippyly-user-invite-dialog{width:100vw!important;max-width:100vw!important;height:100vh!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{border-radius:0!important} .velt-mat-dialog-container.snippyly-user-invite-dialog .s-video-settings-modal{width:100vw!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important} .velt-mat-dialog-container.snippyly-user-invite-dialog .s-chip-user{word-break:break-all!important}}"],changeDetection:0});let i=o;return i})();function xon(i,o){i&1&&(y(0,"div",4),ce(),y(1,"svg",5)(2,"g"),w(3,"path",6)(4,"path",7)(5,"path",8),b()()())}function Ton(i,o){if(i&1){let n=K();y(0,"div")(1,"slot",9),G("slotchange",function(){N(n);let t=l();return F(t.onButtonSlotChange())}),y(2,"div",10),ce(),y(3,"svg",11),w(4,"path",12),b()()()()}}var $A=(()=>{let o=class o extends nt{set _disabled(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.disabled=t}set _documentUserAccessList(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.documentUserAccessList=t}constructor(e,t,r,a,s,c){super(s,r,void 0,void 0,void 0,c,t),this.analyticsService=e,this.loggingService=t,this.themeService=r,this.dialog=a,this.elementRef=s,this.dynamicDataService=c,this.type="share",this.disabled=!1,this.documentUserAccessList=!0,this.hideAccessControlDropdown=!1,this.accessControlDropdown=!0,this.veltElement=!0,this.customButtonAdded=!1}ngOnDestroy(){try{super.ngOnDestroy()}catch{}}onButtonSlotChange(){this.customButtonAdded=!0}openInviteDialog(){try{this.disabled||(this.type==="share"&&this.analyticsService.trackEvent(Y.Events.ShareDialog.SHARE_BUTTON_CLICKED),this.dialog.open(pye,{panelClass:"velt-mat-dialog-container",backdropClass:"s-background-blur-1",data:{title:this.title,placeholder:this.placeholder,hideAccessControlDropdown:this.hideAccessControlDropdown||!this.accessControlDropdown,type:this.type,source:this.source,documentUserAccessList:this.documentUserAccessList,inviteUrl:this.inviteUrl}}))}catch(e){this.loggingService.catch("Error in UserInviteToolComponent openInviteDialog: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(_),h(Ke),h(go),h(R),h(S))},o.\u0275cmp=O({type:o,selectors:[["snippyly-user-invite-tool-internal"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{type:"type",source:"source",title:"title",placeholder:"placeholder",inviteUrl:"inviteUrl",_disabled:[0,"disabled","_disabled"],_documentUserAccessList:[0,"documentUserAccessList","_documentUserAccessList"],hideAccessControlDropdown:"hideAccessControlDropdown",accessControlDropdown:"accessControlDropdown"},standalone:!1,features:[V([S]),L],decls:4,vars:3,consts:[["part","container",1,"s-user-invite-tool-container","s-cursor-pointer",3,"click"],[1,"s-user-invite-tool-default",3,"ngSwitch"],["class","s-user-invite-tool-button",4,"ngSwitchCase"],[4,"ngSwitchCase"],[1,"s-user-invite-tool-button"],["width","32","height","32","viewBox","0 0 32 32","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M19.3589 13.3008C17.3965 13.3008 15.6521 14.2519 14.5622 15.7174C14.1206 15.6247 13.6692 15.5768 13.2136 15.5768C9.6054 15.5768 6.66992 18.5123 6.66992 22.1205C6.66992 22.5918 7.05207 22.974 7.52344 22.974H14.67C15.7651 24.3594 17.4599 25.25 19.3589 25.25C22.6533 25.25 25.3335 22.5698 25.3335 19.2754C25.3335 15.981 22.6533 13.3008 19.3589 13.3008ZM8.45235 21.2669C8.85669 19.0058 10.8378 17.2839 13.2136 17.2839C13.3823 17.2839 13.5501 17.2933 13.7166 17.3104C13.5016 17.9261 13.3843 18.5873 13.3843 19.2754C13.3843 19.9735 13.505 20.6437 13.726 21.2669H8.45235ZM19.3589 23.543C17.0057 23.543 15.0913 21.6286 15.0913 19.2754C15.0913 16.9223 17.0057 15.0078 19.3589 15.0078C21.712 15.0078 23.6265 16.9223 23.6265 19.2754C23.6265 21.6286 21.712 23.543 19.3589 23.543Z","fill","white"],["d","M13.2132 13.8716C15.182 13.8716 16.7837 12.2699 16.7837 10.3011C16.7837 8.33224 15.182 6.73047 13.2132 6.73047C11.2443 6.73047 9.64258 8.33224 9.64258 10.3011C9.64258 12.2699 11.2443 13.8716 13.2132 13.8716ZM13.2132 8.4375C14.2408 8.4375 15.0767 9.2735 15.0767 10.3011C15.0767 11.3286 14.2408 12.1645 13.2132 12.1645C12.1856 12.1645 11.3496 11.3286 11.3496 10.3011C11.3496 9.2735 12.1856 8.4375 13.2132 8.4375Z","fill","white"],["d","M21.0664 18.4219H20.2129V17.5684C20.2129 17.097 19.8308 16.7148 19.3594 16.7148C18.888 16.7148 18.5059 17.097 18.5059 17.5684V18.4219H17.6523C17.181 18.4219 16.7988 18.804 16.7988 19.2754C16.7988 19.7468 17.181 20.1289 17.6523 20.1289H18.5059V20.9824C18.5059 21.4538 18.888 21.836 19.3594 21.836C19.8308 21.836 20.2129 21.4538 20.2129 20.9824V20.1289H21.0664C21.5378 20.1289 21.9199 19.7468 21.9199 19.2754C21.9199 18.804 21.5378 18.4219 21.0664 18.4219Z","fill","white"],["name","button",3,"slotchange"],["part","button-container",1,"action-btn"],["part","button-icon","width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"action-btn-icon"],["d","M8.57143 9.42858H7.71429C7.25963 9.42858 6.82359 9.60919 6.5021 9.93068C6.18061 10.2522 6 10.6882 6 11.1429V18C6 18.4547 6.18061 18.8907 6.5021 19.2122C6.82359 19.5337 7.25963 19.7143 7.71429 19.7143H16.2857C16.7404 19.7143 17.1764 19.5337 17.4979 19.2122C17.8194 18.8907 18 18.4547 18 18V11.1429C18 10.6882 17.8194 10.2522 17.4979 9.93068C17.1764 9.60919 16.7404 9.42858 16.2857 9.42858H15.4286M12 13.7143V4.28572M12 4.28572L9.42857 6.85715M12 4.28572L14.5714 6.85715","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&(y(0,"div",0),G("click",function(){return r.openInviteDialog()}),y(1,"div",1),u(2,xon,6,0,"div",2)(3,Ton,5,0,"div",3),b()()),t&2&&(m(),d("ngSwitch",r.type),m(),d("ngSwitchCase","invite"),m(),d("ngSwitchCase","share"))},dependencies:[eo,po],styles:[`html{--velt-base-rem-unit: 1}*[data-snippyly-element=true],*[data-velt-element=true]{font-family:var(--velt-default-font-family)}velt-wireframe{display:none!important}:host{display:inline-flex!important}.s-user-invite-tool-container{display:inline-block!important}.s-user-invite-tool-button{display:flex!important}.action-btn{display:inline-flex;justify-content:center;align-items:center;padding:6px!important;border-radius:var(--legacy-velt-tool-border-radius);border:var(--legacy-velt-tool-border);background-color:var(--legacy-velt-tool-bg-color);color:var(--legacy-velt-tool-icon-color);cursor:pointer}.action-btn .action-btn-label{font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important;padding-right:4px!important;font-weight:700!important;color:currentColor!important}.action-btn .action-btn-icon{width:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));color:currentColor}.action-btn .toolbar-icon-dropdown-arrow{width:16px;height:16px;color:currentColor}.action-btn:focus{border-radius:var(--legacy-velt-tool-focus-border-radius);border:var(--legacy-velt-tool-focus-border);background-color:var(--legacy-velt-tool-focus-bg-color);color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:focus .action-btn-icon{width:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:focus .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:hover{border-radius:var(--legacy-velt-tool-hover-border-radius);border:var(--legacy-velt-tool-hover-border);background-color:var(--legacy-velt-tool-hover-bg-color);color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:hover .action-btn-icon{width:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:hover .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:active,.action-btn.active{border-radius:var(--legacy-velt-tool-active-border-radius);border:var(--legacy-velt-tool-active-border);background-color:var(--legacy-velt-tool-active-bg-color);color:var(--legacy-velt-tool-active-icon-color)}.action-btn:active .action-btn-icon,.action-btn.active .action-btn-icon{width:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:active .toolbar-icon-dropdown-arrow,.action-btn.active .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-active-icon-color)}
|
|
536
536
|
`],encapsulation:3,changeDetection:0});let i=o;return i})();var won=["*"];function Oon(i,o){if(i&1&&(v(0),ce(),y(1,"svg",7),w(2,"path",8)(3,"path",9),b(),C()),i&2){let n=l(2);m(),T("data-testid",n.componentId+"-video-icon")}}function Aon(i,o){if(i&1&&(v(0),ce(),y(1,"svg",7),w(2,"path",10)(3,"path",9),b(),C()),i&2){let n=l(2);m(),T("data-testid",n.componentId+"-audio-icon")}}function Pon(i,o){if(i&1){let n=K();v(0),y(1,"div",3),G("click",function(){N(n);let t=l();return F(t.openPermissionDeniedDialog())}),ce(),y(2,"svg",4),w(3,"rect",5)(4,"path",6),b(),ft(),v(5,0),u(6,Oon,4,1,"ng-container",1)(7,Aon,4,1,"ng-container",1),C(),b(),C()}if(i&2){let n=l();m(),pe("thread-mode",n.mode==="thread"),T("aria-expanded",!1)("data-testid",n.componentId+"-denied"),m(),T("data-testid",n.componentId+"-info-icon"),m(3),d("ngSwitch",n.type),m(),d("ngSwitchCase","video"),m(),d("ngSwitchCase","audio")}}function Mon(i,o){i&1&&(v(0),jt(1),C())}var q1=(()=>{let o=class o extends nt{constructor(e,t,r,a){super(a,r),this.devicePermissionService=e,this.loggingService=t,this.themeService=r,this.elementRef=a,this.type="audio",this.state=null,this.mode=null,this.veltElement=!0,this.subscriptions=[],this.componentId="velt-device-permission-button",this.loggingService.log("%c[WB] Creating CLASS: DevicePermissionButtonComponent","color: blue;")}ngOnInit(){try{this.loggingService.log("%c[WB] Calling DevicePermissionButtonComponent FUNCTION: ngOnInit","color: green;"),this.subscriptions.push(this.devicePermissionService.getPermissionState$(this.type).subscribe(e=>{this.state=e})),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in DevicePermissionButtonComponent onInit: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","button"),e.setAttribute("aria-label",`Device permission button for ${this.type}`)}catch(e){this.loggingService.catch("Error in DevicePermissionButtonComponent setupA11yAttributes:",e)}}openPermissionDeniedDialog(){try{this.loggingService.log("%c[WB] Calling DevicePermissionButtonComponent FUNCTION: openPermissionDeniedDialog","color: green;"),this.devicePermissionService.openDevicePermissionDeniedDialog(this.type,{darkMode:this.darkMode})}catch(e){this.loggingService.catch("Error in DevicePermissionButtonComponent openPermissionDeniedDialog: ",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch{}}};o.\u0275fac=function(t){return new(t||o)(h(xm),h(_),h(Ke),h(R))},o.\u0275cmp=O({type:o,selectors:[["app-device-permission-button"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{type:"type",state:"state",mode:"mode"},standalone:!1,features:[L],ngContentSelectors:won,decls:3,vars:2,consts:[[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["role","button","tabindex","0","aria-label","Camera or microphone access is blocked. Click to learn how to enable it",1,"velt-device-permission-button--denied",3,"click"],["width","12","height","12","viewBox","0 0 12 12","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img",1,"velt-device-permission-button--info-icon"],["width","12","height","12","rx","6","fill","currentColor"],["d","M6 9.495V9.5M6 7V2.5","stroke","white","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["width","28","height","28","viewBox","0 0 28 28","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M20.9375 17.6068C21.1017 17.5503 21.2442 17.444 21.345 17.3027C21.4459 17.1614 21.5 16.9921 21.5 16.8184V11.1818C21.4999 11.0398 21.4636 10.9002 21.3944 10.7762C21.3252 10.6522 21.2255 10.5479 21.1047 10.4733C20.9839 10.3986 20.846 10.3561 20.7042 10.3497C20.5623 10.3433 20.4212 10.3733 20.2942 10.4368L16.5 12.3334V13.1668V10.6667C16.5 10.2246 16.3244 9.80072 16.0118 9.48816C15.6993 9.17559 15.2754 9 14.8333 9H12.3333M16.5 16.5V17.3333C16.5 17.7754 16.3244 18.1993 16.0118 18.5118C15.6993 18.8244 15.2754 19 14.8333 19H8.16667C7.72464 19 7.30072 18.8244 6.98816 18.5118C6.67559 18.1993 6.5 17.7754 6.5 17.3333V10.6667C6.5 10.2246 6.67559 9.80072 6.98816 9.48816C7.30072 9.17559 7.72464 9 8.16667 9H9","stroke","currentColor","stroke-opacity","0.52","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 6.5L21.5 21.5","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M11.5013 8.1665C11.5013 7.50346 11.7647 6.86758 12.2335 6.39874C12.7024 5.9299 13.3383 5.6665 14.0013 5.6665C14.6643 5.6665 15.3002 5.9299 15.7691 6.39874C16.2379 6.86758 16.5013 7.50346 16.5013 8.1665V12.3332C16.5013 12.58 16.4648 12.8254 16.393 13.0615M14.7263 14.7282C14.3527 14.8414 13.9578 14.8655 13.5732 14.7987C13.1885 14.7318 12.8249 14.5758 12.5114 14.3432C12.198 14.1105 11.9433 13.8077 11.7679 13.459C11.5925 13.1102 11.5012 12.7252 11.5013 12.3348V11.5015M8.16797 12.3332C8.16779 13.386 8.45252 14.4192 8.99198 15.3232C9.53144 16.2273 10.3055 16.9685 11.2321 17.4683C12.1587 17.9681 13.2033 18.2078 14.2551 18.162C15.3069 18.1162 16.3267 17.7866 17.2063 17.2082M18.873 15.5415C19.5012 14.5896 19.835 13.4737 19.833 12.3332M10.668 21.4998H17.3346M14.0013 18.1665V21.4998","stroke","currentColor","stroke-opacity","0.52","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&(Ht(),v(0,0),u(1,Pon,8,8,"ng-container",1)(2,Mon,2,0,"ng-container",2),C()),t&2&&(d("ngSwitch",r.state),m(),d("ngSwitchCase","denied"))},dependencies:[eo,po,sp],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}[_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-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-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-permission-button--denied[_ngcontent-%COMP%]{padding:var(--velt-spacing-md);display:flex;align-items:center;justify-content:center;border-radius:var(--velt-border-radius-full);cursor:pointer;background:var(--velt-error-transparent);position:relative;color:var(--velt-error)}.velt-device-permission-button--denied.thread-mode[_ngcontent-%COMP%]{background:none;padding:var(--velt-spacing-2xs)}.velt-device-permission-button--info-icon[_ngcontent-%COMP%]{position:absolute;top:1px;right:1px}"],changeDetection:0});let i=o;return i})();function Ron(i,o){if(i&1){let n=K();y(0,"div",22),G("click",function(){N(n);let t=l().$implicit,r=l(2);return F(r.followUser(t))}),w(1,"snippyly-user-avatar",23),b()}if(i&2){let n=l().$implicit,e=l().ngIf;pe("s-current-user",(e.user==null?null:e.user.userSnippylyId)===(n==null?null:n.userSnippylyId)),m(),d("user",n)}}function Non(i,o){if(i&1&&(v(0),u(1,Ron,2,3,"div",21),C()),i&2){let n=o.index,e=l().ngIf;m(),d("ngIf",n<e.maxAttendees)}}function Fon(i,o){if(i&1&&(y(0,"button"),te(1),b()),i&2){let n=l().ngIf;m(),ze("+"+((n.attendees==null?null:n.attendees.length)-n.maxAttendees))}}function Lon(i,o){i&1&&(ce(),y(0,"svg",24),w(1,"path",25),b())}function Bon(i,o){i&1&&(ce(),y(0,"svg",26),w(1,"path",27)(2,"path",28),b())}function Von(i,o){i&1&&(ce(),y(0,"svg",29),w(1,"path",30),b())}function Uon(i,o){i&1&&(ce(),y(0,"svg",26)(1,"g"),w(2,"path",31)(3,"path",28),b(),y(4,"defs")(5,"clipPath",32),w(6,"rect",33),b()()())}function jon(i,o){i&1&&(v(0),ce(),y(1,"svg",26)(2,"g"),w(3,"path",35)(4,"path",36)(5,"path",37)(6,"path",38)(7,"path",28),b(),y(8,"defs")(9,"clipPath",39),w(10,"rect",33),b()()(),C())}function $on(i,o){i&1&&(ce(),y(0,"svg",26)(1,"g"),w(2,"path",40)(3,"path",41)(4,"path",37)(5,"path",38)(6,"path",28),b(),y(7,"defs")(8,"clipPath",42),w(9,"rect",33),b()()())}function Hon(i,o){i&1&&(ce(),y(0,"svg",26),w(1,"path",43)(2,"path",44)(3,"path",45)(4,"path",46),b())}function zon(i,o){if(i&1&&u(0,$on,10,0,"svg",11)(1,Hon,5,0,"svg",11),i&2){let n=l(2).ngIf;d("ngIf",!n.screenSharingState),m(),d("ngIf",n.screenSharingState)}}function Gon(i,o){if(i&1){let n=K();y(0,"button",8),G("click",function(){N(n);let t=l(2);return F(t.onToggleScreenSharingClick())}),y(1,"div",9),te(2),P(3,"translate"),P(4,"translate"),b(),u(5,jon,11,0,"ng-container",34)(6,zon,2,2,"ng-template",null,0,Ee),b()}if(i&2){let n=me(7),e=l().ngIf;m(2),Se("",e.screenSharingState?M(3,3,"Stop sharing"):M(4,5,"Share screen")," "),m(3),d("ngIf",e.screenSharingDisabled)("ngIfElse",n)}}function Won(i,o){i&1&&(ce(),y(0,"svg",26),w(1,"path",47),b())}function qon(i,o){i&1&&(ce(),y(0,"svg",26),w(1,"path",48),b())}function Yon(i,o){if(i&1){let n=K();y(0,"button",8),G("click",function(){N(n);let t=l(2);return F(t.onToggleHuddleCursorModeClick())}),u(1,Won,2,0,"svg",11)(2,qon,2,0,"svg",11),b()}if(i&2){let n=l().ngIf;m(),d("ngIf",!n.huddleOnCursorMode),m(),d("ngIf",n.huddleOnCursorMode)}}function Kon(i,o){if(i&1){let n=K();y(0,"button",8),G("click",function(){N(n);let t=l(2);return F(t.toggleMessagesPanel())}),y(1,"div",9),te(2),P(3,"translate"),b(),ce(),y(4,"svg",17),w(5,"path",49),b()()}i&2&&(m(2),ze(M(3,1,"Chat with everyone")))}function Zon(i,o){if(i&1){let n=K();v(0),y(1,"div",2)(2,"div",3)(3,"div",4),u(4,Non,2,1,"ng-container",5)(5,Fon,2,1,"button",1),b(),y(6,"div",6)(7,"app-device-permission-button",7)(8,"button",8),G("click",function(){N(n);let t=l();return F(t.onToggleAudioClick())}),y(9,"div",9),te(10),P(11,"translate"),P(12,"translate"),b(),u(13,Lon,2,0,"svg",10)(14,Bon,3,0,"svg",11),b()(),y(15,"app-device-permission-button",12)(16,"button",8),G("click",function(){N(n);let t=l();return F(t.onToggleVideoClick())}),y(17,"div",9),te(18),P(19,"translate"),P(20,"translate"),b(),u(21,Von,2,0,"svg",13)(22,Uon,7,0,"svg",11),b()(),u(23,Gon,8,7,"button",14)(24,Yon,3,2,"button",14),w(25,"snippyly-user-invite-tool-internal",15),P(26,"translate"),P(27,"translate"),u(28,Kon,6,3,"button",14),y(29,"button",16),G("click",function(){N(n);let t=l();return F(t.openMediaSourceOptionsDialog())}),y(30,"div",9),te(31),P(32,"translate"),P(33,"translate"),b(),ce(),y(34,"svg",17),w(35,"path",18),b()()(),ft(),y(36,"div",19)(37,"button",20),G("click",function(){N(n);let t=l();return F(t.onLeaveClick())}),te(38),P(39,"translate"),b()()()(),C()}if(i&2){let n=o.ngIf,e=l();m(4),d("ngForOf",n.attendees)("ngForTrackBy",e.trackByAttendeeId),m(),d("ngIf",(n.attendees==null?null:n.attendees.length)>n.maxAttendees),m(2),d("darkMode",!0),m(3),Se("",n.audioState?M(11,20,"Click to mute"):M(12,22,"Click to unmute")," "),m(3),d("ngIf",n.audioState),m(),d("ngIf",!n.audioState),m(),d("darkMode",!0),m(3),Se("",n.videoState?M(19,24,"Turn off video"):M(20,26,"Turn on video")," "),m(3),d("ngIf",n.videoState),m(),d("ngIf",!n.videoState),m(),d("ngIf",n.screenSharingSupported),m(),d("ngIf",!n.hideHuddleOnCursor),m(),d("title",M(26,28,"Invite users to join this huddle"))("placeholder",M(27,30,"Please select a contact to invite"))("hideAccessControlDropdown",!0),m(3),d("ngIf",n.chatEnabled),m(),d("disabled",!n.audioState&&!n.videoState),m(2),ze(!n.audioState&&!n.videoState?M(32,32,"Enable audio or video to change the settings"):M(33,34,"Change audio/video settings")),m(7),ze(M(39,36,"Leave"))}}var gye=(()=>{let o=class o{constructor(e,t,r,a,s,c){this.analyticsService=e,this.configService=t,this.flockService=r,this.huddleService=a,this.loggingService=s,this.dialog=c,this.attendees=[],this.toggleAudio=new Me,this.toggleVideo=new Me,this.toggleScreenSharing=new Me,this.leave=new Me,this.subscriptions=[],this.veltElement=!0,this.componentConfigSignal=Te({attendees:this.attendees,maxAttendees:4,audioState:this.audioState,videoState:this.videoState,chatEnabled:!1,huddleOnCursorMode:!1,hideHuddleOnCursor:!1,screenSharingState:this.screenSharingState,screenSharingDisabled:this.screenSharingDisabled,screenSharingSupported:!!navigator?.mediaDevices?.getDisplayMedia,user:this.user})}ngOnInit(){try{this.subscriptions.push(this.configService.getConfig$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{hideHuddleOnCursor:!e?.featureAllowList?.find(r=>r===Ne.CURSOR)}),t))},e=>{this.loggingService.catch("Error in HuddleMenuPanelComponent getConfig$: ",e)})),this.subscriptions.push(this.huddleService.getHuddleOnCursorMode$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{huddleOnCursorMode:e}),t))},e=>{this.loggingService.catch("Error in HuddleMenuPanelComponent getHuddleOnCursorMode$: ",e)})),this.subscriptions.push(this.huddleService.getChatEnabled$().subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(E({},t),{chatEnabled:e}),t))},e=>{this.loggingService.catch("Error in HuddleMenuPanelComponent getChatEnabled$: ",e)}))}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent ngOnInit: ",e)}}ngOnChanges(e){try{this.loggingService.log("%c[WB] Calling HuddleMenuPanelComponent FUNCTION: ngOnChanges","color: green;"),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in HuddleMenuPanelComponent ngOnChanges: ",t)}}trackByAttendeeId(e,t){return t?.userId}onToggleAudioClick(){try{this.analyticsService.trackEvent(Y.Events.Huddle.HUDDLE_AUDIO_BUTTON_CLICKED,{huddleType:this.huddleService.getInitialHuddleType(),totalUsers:this.huddleService.getHuddleAttendees()?.length||0,totalUserHuddleDuration:this.huddleService.getTotalUserHuddleDuration(),huddleSnippylyUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userSnippylyId),huddleClientUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userId)}),this.toggleAudio.emit()}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent onToggleAudioClick: ",e)}}onToggleVideoClick(){try{this.analyticsService.trackEvent(Y.Events.Huddle.HUDDLE_VIDEO_BUTTON_CLICKED,{huddleType:this.huddleService.getInitialHuddleType(),totalUsers:this.huddleService.getHuddleAttendees()?.length||0,totalUserHuddleDuration:this.huddleService.getTotalUserHuddleDuration(),huddleSnippylyUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userSnippylyId),huddleClientUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userId)}),this.toggleVideo.emit()}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent onToggleVideoClick: ",e)}}onToggleScreenSharingClick(){try{this.analyticsService.trackEvent(Y.Events.Huddle.HUDDLE_SCREENSHARING_BUTTON_CLICKED,{huddleType:this.huddleService.getInitialHuddleType(),totalUsers:this.huddleService.getHuddleAttendees()?.length||0,totalUserHuddleDuration:this.huddleService.getTotalUserHuddleDuration(),huddleSnippylyUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userSnippylyId),huddleClientUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userId)}),this.toggleScreenSharing.emit()}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent onToggleScreenSharingClick: ",e)}}onToggleHuddleCursorModeClick(){try{this.componentConfigSignal().huddleOnCursorMode?this.huddleService.disableHuddleOnCursorMode():this.huddleService.enableHuddleOnCursorMode()}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent onToggleHuddleCursorModeClick: ",e)}}openMediaSourceOptionsDialog(){try{this.subscriptions.push(this.dialog.open(sye,{panelClass:"velt-mat-dialog-container",data:{settingsVisible:{audio:this.componentConfigSignal().audioState,video:this.componentConfigSignal().videoState}}}).afterClosed().pipe(rt(1)).subscribe(e=>{e&&(this.componentConfigSignal().audioState&&this.huddleService.toggleLocalStreamAudio(!0),this.componentConfigSignal().videoState&&this.huddleService.toggleLocalStreamVideo(!0))}))}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent mediaSourceOptionsDialog: ",e)}}onLeaveClick(){this.leave.emit()}toggleMessagesPanel(){try{this.loggingService.log("%c[WB] Calling FUNCTION: toggleMessagesPanel","color: green;"),this.huddleService.toggleMessagesPanel()}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent toggleMessagesPanel: ",e)}}followUser(e){try{this.huddleService.getFlockModeOnAvatarClick()&&this.flockService.getFlockMode()&&this.componentConfigSignal().user?.userSnippylyId!==e.userSnippylyId&&this.flockService.setFlockLeader(e.userSnippylyId,e.name)}catch(t){this.loggingService.catch("Error in HuddleMenuPanelComponent followUser: ",t)}}ngOnDestroy(){try{this.subscriptions.forEach(e=>e?.unsubscribe())}catch(e){this.loggingService.catch("Error in HuddleMenuPanelComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(Ft),h(xd),h(Or),h(_),h(go))},o.\u0275cmp=O({type:o,selectors:[["snippyly-huddle-menu-panel"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{stream:"stream",selected:"selected",isRemoteStream:"isRemoteStream",user:"user",audioState:"audioState",videoState:"videoState",screenSharingState:"screenSharingState",screenSharingDisabled:"screenSharingDisabled",attendees:"attendees"},outputs:{toggleAudio:"toggleAudio",toggleVideo:"toggleVideo",toggleScreenSharing:"toggleScreenSharing",leave:"leave"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[["screenSharingToggleBtnRef",""],[4,"ngIf"],[1,"reply-div","input-text-wrap"],[1,"action-menu"],[1,"pins-wrap"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"actions-wrap"],["type","audio",3,"darkMode"],[1,"action__button","tooltip",3,"click"],[1,"tooltiptext"],["width","20","height","20","viewBox","0 0 13 19","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["type","video",3,"darkMode"],["width","20","height","20","viewBox","0 0 19 11","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["class","action__button tooltip",3,"click",4,"ngIf"],["type","invite","source","Huddle",3,"title","placeholder","hideAccessControlDropdown"],[1,"action__button","tooltip",3,"click","disabled"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M19.5 12C19.5 11.77 19.49 11.55 19.47 11.32L21.33 9.91C21.73 9.61 21.84 9.05 21.59 8.61L19.72 5.38C19.47 4.94 18.93 4.76 18.47 4.96L16.32 5.87C15.95 5.61 15.56 5.38 15.15 5.19L14.86 2.88C14.8 2.38 14.37 2 13.87 2H10.14C9.63003 2 9.20003 2.38 9.14003 2.88L8.85003 5.19C8.44003 5.38 8.05003 5.61 7.68003 5.87L5.53003 4.96C5.07003 4.76 4.53003 4.94 4.28003 5.38L2.41003 8.62C2.16003 9.06 2.27003 9.61 2.67003 9.92L4.53003 11.33C4.51003 11.55 4.50003 11.77 4.50003 12C4.50003 12.23 4.51003 12.45 4.53003 12.68L2.67003 14.09C2.27003 14.39 2.16003 14.95 2.41003 15.39L4.28003 18.62C4.53003 19.06 5.07003 19.24 5.53003 19.04L7.68003 18.13C8.05003 18.39 8.44003 18.62 8.85003 18.81L9.14003 21.12C9.20003 21.62 9.63003 22 10.13 22H13.86C14.36 22 14.79 21.62 14.85 21.12L15.14 18.81C15.55 18.62 15.94 18.39 16.31 18.13L18.46 19.04C18.92 19.24 19.46 19.06 19.71 18.62L21.58 15.39C21.83 14.95 21.72 14.4 21.32 14.09L19.46 12.68C19.49 12.45 19.5 12.23 19.5 12ZM12.04 15.5C10.11 15.5 8.54003 13.93 8.54003 12C8.54003 10.07 10.11 8.5 12.04 8.5C13.97 8.5 15.54 10.07 15.54 12C15.54 13.93 13.97 15.5 12.04 15.5Z","fill","#fff"],[1,"buttons-wrap"],[1,"secondary",3,"click"],["class","pin2",3,"s-current-user","click",4,"ngIf"],[1,"pin2",3,"click"],[1,"huddle-menu-panel-user-avatar",3,"user"],["width","20","height","20","viewBox","0 0 13 19","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M5.77526 0.888917C4.98766 1.03653 4.34477 1.39041 3.76525 1.99544C3.26289 2.51988 2.94255 3.10884 2.75974 3.84431C2.69679 4.09753 2.6908 4.39635 2.6908 7.29276C2.6908 10.7979 2.68044 10.6352 2.94799 11.327C3.299 12.2346 4.07584 13.0561 4.94368 13.4374C5.82412 13.8243 6.82444 13.8531 7.71552 13.5173C8.69181 13.1494 9.53872 12.2934 9.92297 11.2862C10.1713 10.6354 10.1631 10.7714 10.1631 7.29276C10.1631 3.78764 10.1735 3.95032 9.90592 3.25855C9.62932 2.54335 9.02923 1.81042 8.38767 1.40419C7.61998 0.918084 6.64549 0.725873 5.77526 0.888917ZM6.9551 2.18212C7.80033 2.36379 8.55484 3.08137 8.82443 3.95997C8.91085 4.24162 8.9112 4.25479 8.9112 7.29276C8.9112 10.3307 8.91085 10.3439 8.82443 10.6256C8.578 11.4287 7.92854 12.0994 7.15071 12.3538C6.92897 12.4264 6.7875 12.4431 6.40739 12.4415C6.00213 12.4398 5.89869 12.425 5.65097 12.3333C5.00401 12.0936 4.49038 11.6376 4.2051 11.0497C3.92221 10.4667 3.92452 10.4977 3.92452 7.29276C3.92452 4.09736 3.92315 4.11587 4.19825 3.55135C4.71228 2.49645 5.83136 1.94067 6.9551 2.18212ZM0.537139 8.64006C0.373453 8.71677 0.215048 8.92183 0.182929 9.09861C0.133831 9.36895 0.199086 10.6794 0.283042 11.1082C0.737953 13.4317 2.32631 15.2803 4.50075 16.017C4.75328 16.1025 5.14915 16.2055 5.38044 16.2458L5.801 16.3192V16.9744V17.6296L5.06042 17.6421C4.38416 17.6536 4.31046 17.6619 4.21195 17.738C4.00671 17.8964 3.94271 18.0255 3.94271 18.2809C3.94271 18.5363 4.00679 18.6655 4.21206 18.8237C4.31804 18.9055 4.36006 18.907 6.42696 18.907C8.49385 18.907 8.53586 18.9055 8.64185 18.8237C8.84712 18.6655 8.9112 18.5363 8.9112 18.2809C8.9112 18.0255 8.8472 17.8964 8.64196 17.738C8.54346 17.6619 8.46975 17.6536 7.79349 17.6421L7.05291 17.6296V16.9744V16.3192L7.47347 16.2469C9.74567 15.8564 11.6474 14.1569 12.3699 11.8711C12.6066 11.1222 12.6648 10.7131 12.6659 9.79054C12.6668 9.05017 12.6614 8.98828 12.5862 8.8841C12.4332 8.67197 12.3081 8.60568 12.0605 8.60568C11.8131 8.60568 11.6881 8.67181 11.5348 8.88378C11.4622 8.9842 11.4515 9.07453 11.4282 9.79025C11.4001 10.6516 11.3449 11.0079 11.1515 11.5749C10.8931 12.3325 10.527 12.9264 9.95298 13.5192C9.22696 14.2689 8.41181 14.7274 7.405 14.9524C6.91168 15.0626 5.87256 15.0542 5.38588 14.936C4.37192 14.6897 3.6185 14.2601 2.90093 13.5192C2.32689 12.9264 1.96079 12.3325 1.70239 11.5749C1.50901 11.0079 1.45377 10.6516 1.42568 9.79025C1.39755 8.92635 1.3871 8.88689 1.13621 8.69342C1.00672 8.5936 0.695505 8.56589 0.537139 8.64006Z","fill","#FF7162"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M9.77526 0.888917C8.98766 1.03653 8.34477 1.39041 7.76525 1.99544C7.26289 2.51988 6.94255 3.10884 6.75974 3.84431C6.69679 4.09753 6.6908 4.39635 6.6908 7.29276C6.6908 10.7979 6.68044 10.6352 6.94799 11.327C7.299 12.2346 8.07584 13.0561 8.94368 13.4374C9.82412 13.8243 10.8244 13.8531 11.7155 13.5173C12.6918 13.1494 13.5387 12.2934 13.923 11.2862C14.1713 10.6354 14.1631 10.7714 14.1631 7.29276C14.1631 3.78764 14.1735 3.95032 13.9059 3.25855C13.6293 2.54335 13.0292 1.81042 12.3877 1.40419C11.62 0.918084 10.6455 0.725873 9.77526 0.888917ZM10.9551 2.18212C11.8003 2.36379 12.5548 3.08137 12.8244 3.95997C12.9108 4.24162 12.9112 4.25479 12.9112 7.29276C12.9112 10.3307 12.9108 10.3439 12.8244 10.6256C12.578 11.4287 11.9285 12.0994 11.1507 12.3538C10.929 12.4264 10.7875 12.4431 10.4074 12.4415C10.0021 12.4398 9.89869 12.425 9.65097 12.3333C9.00401 12.0936 8.49038 11.6376 8.2051 11.0497C7.92221 10.4667 7.92452 10.4977 7.92452 7.29276C7.92452 4.09736 7.92315 4.11587 8.19825 3.55135C8.71228 2.49645 9.83136 1.94067 10.9551 2.18212ZM4.53714 8.64006C4.37345 8.71677 4.21505 8.92183 4.18293 9.09861C4.13383 9.36895 4.19909 10.6794 4.28304 11.1082C4.73795 13.4317 6.32631 15.2803 8.50075 16.017C8.75328 16.1025 9.14915 16.2055 9.38044 16.2458L9.801 16.3192V16.9744V17.6296L9.06042 17.6421C8.38416 17.6536 8.31046 17.6619 8.21195 17.738C8.00671 17.8964 7.94271 18.0255 7.94271 18.2809C7.94271 18.5363 8.00679 18.6655 8.21206 18.8237C8.31804 18.9055 8.36006 18.907 10.427 18.907C12.4938 18.907 12.5359 18.9055 12.6418 18.8237C12.8471 18.6655 12.9112 18.5363 12.9112 18.2809C12.9112 18.0255 12.8472 17.8964 12.642 17.738C12.5435 17.6619 12.4697 17.6536 11.7935 17.6421L11.0529 17.6296V16.9744V16.3192L11.4735 16.2469C13.7457 15.8564 15.6474 14.1569 16.3699 11.8711C16.6066 11.1222 16.6648 10.7131 16.6659 9.79054C16.6668 9.05017 16.6614 8.98828 16.5862 8.8841C16.4332 8.67197 16.3081 8.60568 16.0605 8.60568C15.8131 8.60568 15.6881 8.67181 15.5348 8.88378C15.4622 8.9842 15.4515 9.07453 15.4282 9.79025C15.4001 10.6516 15.3449 11.0079 15.1515 11.5749C14.8931 12.3325 14.527 12.9264 13.953 13.5192C13.227 14.2689 12.4118 14.7274 11.405 14.9524C10.9117 15.0626 9.87256 15.0542 9.38588 14.936C8.37192 14.6897 7.6185 14.2601 6.90093 13.5192C6.32689 12.9264 5.96079 12.3325 5.70239 11.5749C5.50901 11.0079 5.45377 10.6516 5.42568 9.79025C5.39755 8.92636 5.3871 8.88689 5.13621 8.69342C5.00672 8.5936 4.69551 8.56589 4.53714 8.64006Z","fill","white"],["d","M19 1L1 19","stroke","#FF7162","stroke-width","1.4","stroke-linecap","round"],["width","20","height","20","viewBox","0 0 19 11","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.55139 0.23203C1.68754 0.455725 1.06855 1.0239 0.766641 1.87017L0.666016 2.15221V5.58961V9.027L0.766892 9.30905C1.0535 10.1102 1.64038 10.6751 2.43987 10.9192L2.70863 11.0013H7.1343H11.56L11.8467 10.9053C12.6234 10.645 13.2099 10.0654 13.47 9.30122C13.56 9.03659 13.5637 8.9921 13.5769 8.03104C13.5844 7.48324 13.6004 7.03508 13.6125 7.03508C13.661 7.03508 15.0857 7.85713 15.8518 8.32715C16.7188 8.85908 16.9126 8.93887 17.338 8.93887C18.0692 8.93887 18.7509 8.40866 18.947 7.6873C19.0174 7.42849 19.0165 3.7478 18.946 3.48726C18.7883 2.90449 18.278 2.40845 17.7016 2.27772C17.4483 2.22025 17.0895 2.2339 16.8373 2.31054C16.6848 2.35687 16.3699 2.52617 15.9107 2.80867C15.3288 3.16675 13.6405 4.14414 13.6039 4.14414C13.5979 4.14414 13.5847 3.71184 13.5747 3.18343C13.5543 2.10543 13.5363 1.99899 13.2916 1.50796C13.0166 0.956034 12.475 0.494788 11.8467 0.277192L11.56 0.177913L7.18806 0.170686C2.95948 0.163705 2.80747 0.165715 2.55139 0.23203ZM11.3211 1.83643C11.5404 1.90052 11.7306 2.05381 11.8398 2.25463L11.9183 2.399V5.57293V8.74683L11.8268 8.92184C11.7122 9.14091 11.4929 9.30852 11.2552 9.35869C11.0123 9.40995 3.20786 9.41115 2.98224 9.35999C2.74243 9.30559 2.53297 9.14483 2.42553 8.93266L2.33236 8.74873V5.58961V2.43048L2.42553 2.24656C2.52985 2.04059 2.7435 1.87225 2.96604 1.82078C3.04208 1.80318 4.88581 1.78753 7.11882 1.78556C10.641 1.78245 11.1578 1.78873 11.3211 1.83643ZM17.3116 5.59366V7.28997L17.2309 7.23801C16.8358 6.98339 15.6936 6.30427 15.1359 5.99233C14.7573 5.78052 14.4468 5.5987 14.4461 5.5883C14.4453 5.57787 14.7874 5.37536 15.2062 5.13827C15.6251 4.90114 16.258 4.52634 16.6128 4.30536C16.9675 4.08438 17.2699 3.90215 17.2847 3.90045C17.2995 3.89876 17.3116 4.6607 17.3116 5.59366Z","fill","#FF7162"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.55139 4.23203C2.68754 4.45573 2.06855 5.0239 1.76664 5.87017L1.66602 6.15221V9.58961V13.027L1.76689 13.309C2.0535 14.1102 2.64038 14.6751 3.43987 14.9192L3.70863 15.0013H8.1343H12.56L12.8467 14.9053C13.6234 14.645 14.2099 14.0654 14.47 13.3012C14.56 13.0366 14.5637 12.9921 14.5769 12.031C14.5844 11.4832 14.6004 11.0351 14.6125 11.0351C14.661 11.0351 16.0857 11.8571 16.8518 12.3271C17.7188 12.8591 17.9126 12.9389 18.338 12.9389C19.0692 12.9389 19.7509 12.4087 19.947 11.6873C20.0174 11.4285 20.0165 7.7478 19.946 7.48726C19.7883 6.90449 19.278 6.40845 18.7016 6.27772C18.4483 6.22025 18.0895 6.2339 17.8373 6.31054C17.6848 6.35687 17.3699 6.52617 16.9107 6.80867C16.3288 7.16675 14.6405 8.14414 14.6039 8.14414C14.5979 8.14414 14.5847 7.71184 14.5747 7.18343C14.5543 6.10543 14.5363 5.99899 14.2916 5.50796C14.0166 4.95603 13.475 4.49479 12.8467 4.27719L12.56 4.17791L8.18806 4.17069C3.95948 4.16371 3.80747 4.16571 3.55139 4.23203ZM12.3211 5.83643C12.5404 5.90052 12.7306 6.05381 12.8398 6.25463L12.9183 6.399V9.57293V12.7468L12.8268 12.9218C12.7122 13.1409 12.4929 13.3085 12.2552 13.3587C12.0123 13.4099 4.20786 13.4111 3.98224 13.36C3.74243 13.3056 3.53297 13.1448 3.42553 12.9327L3.33236 12.7487V9.58961V6.43048L3.42553 6.24656C3.52985 6.04059 3.7435 5.87225 3.96604 5.82078C4.04208 5.80318 5.88581 5.78753 8.11882 5.78556C11.641 5.78245 12.1578 5.78873 12.3211 5.83643ZM18.3116 9.59366V11.29L18.2309 11.238C17.8358 10.9834 16.6936 10.3043 16.1359 9.99233C15.7573 9.78052 15.4468 9.5987 15.4461 9.5883C15.4453 9.57787 15.7874 9.37536 16.2062 9.13827C16.6251 8.90114 17.258 8.52634 17.6128 8.30536C17.9675 8.08438 18.2699 7.90215 18.2847 7.90045C18.2995 7.89876 18.3116 8.6607 18.3116 9.59366Z","fill","white"],["id","clip0_2334_10689"],["width","20","height","20","fill","white"],[4,"ngIf","ngIfElse"],["d","M7.50016 15H9.16683V16.6667H10.8335V15H12.5002V16.6667H13.3335C13.7937 16.6667 14.1668 17.0398 14.1668 17.5C14.1668 17.9602 13.7937 18.3333 13.3335 18.3333H6.66683C6.20659 18.3333 5.8335 17.9602 5.8335 17.5C5.8335 17.0398 6.20659 16.6667 6.66683 16.6667H7.50016V15Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.33317 5L3.33317 11.6667C3.33317 12.5871 4.07936 13.3333 4.99984 13.3333L14.9998 13.3333C15.9203 13.3333 16.6665 12.5871 16.6665 11.6667L16.6665 5C16.6665 4.07953 15.9203 3.33333 14.9998 3.33333L4.99984 3.33333C4.07936 3.33333 3.33317 4.07953 3.33317 5ZM1.6665 11.6667C1.6665 13.5076 3.15889 15 4.99984 15L14.9998 15C16.8408 15 18.3332 13.5076 18.3332 11.6667L18.3332 5C18.3332 3.15905 16.8408 1.66667 14.9998 1.66667L4.99984 1.66667C3.15889 1.66667 1.6665 3.15905 1.6665 5L1.6665 11.6667Z","fill","white"],["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","white"],["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","white"],["id","clip0_2260_32847"],["d","M7.50065 15H9.16732V16.6667H10.834V15H12.5007V16.6667H13.334C13.7942 16.6667 14.1673 17.0398 14.1673 17.5C14.1673 17.9602 13.7942 18.3333 13.334 18.3333H6.66732C6.20708 18.3333 5.83398 17.9602 5.83398 17.5C5.83398 17.0398 6.20708 16.6667 6.66732 16.6667H7.50065V15Z","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.33268 5L3.33268 11.6667C3.33268 12.5871 4.07887 13.3333 4.99935 13.3333L14.9993 13.3333C15.9198 13.3333 16.666 12.5871 16.666 11.6667L16.666 5C16.666 4.07953 15.9198 3.33333 14.9993 3.33333L4.99935 3.33333C4.07887 3.33333 3.33268 4.07953 3.33268 5ZM1.66602 11.6667C1.66602 13.5076 3.1584 15 4.99935 15L14.9993 15C16.8403 15 18.3327 13.5076 18.3327 11.6667L18.3327 5C18.3327 3.15905 16.8403 1.66667 14.9993 1.66667L4.99935 1.66667C3.1584 1.66667 1.66602 3.15905 1.66602 5L1.66602 11.6667Z","fill","white"],["id","clip0_2305_6167"],["d","M7.50016 15H9.16683V16.6667H10.8335V15H12.5002V16.6667H13.3335C13.7937 16.6667 14.1668 17.0398 14.1668 17.5C14.1668 17.9602 13.7937 18.3333 13.3335 18.3333H6.66683C6.20659 18.3333 5.8335 17.9602 5.8335 17.5C5.8335 17.0398 6.20659 16.6667 6.66683 16.6667H7.50016V15Z","fill","#FF7162"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.33317 5L3.33317 11.6667C3.33317 12.5871 4.07936 13.3333 4.99984 13.3333L14.9998 13.3333C15.9203 13.3333 16.6665 12.5871 16.6665 11.6667L16.6665 5C16.6665 4.07953 15.9203 3.33333 14.9998 3.33333L4.99984 3.33333C4.07936 3.33333 3.33317 4.07953 3.33317 5ZM1.6665 11.6667C1.6665 13.5076 3.15889 15 4.99984 15L14.9998 15C16.8408 15 18.3332 13.5076 18.3332 11.6667L18.3332 5C18.3332 3.15905 16.8408 1.66667 14.9998 1.66667L4.99984 1.66667C3.15889 1.66667 1.6665 3.15905 1.6665 5L1.6665 11.6667Z","fill","#FF7162"],["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","#FF7162"],["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","#FF7162"],["d","M4.69231 5.29805L6.9519 16.6605C7.26158 18.2178 9.31823 18.591 10.1553 17.2418L12.4275 13.5798C12.4611 13.5255 12.5143 13.4861 12.5761 13.4699L16.8289 12.3482C18.3433 11.9488 18.6107 9.91372 17.2509 9.13668L7.27695 3.4373C5.97394 2.69272 4.3996 3.82614 4.69231 5.29805Z","stroke","#E5E5E9","stroke-width","1.5","stroke-linecap","square"],["d","M4.69231 5.29805L6.9519 16.6605C7.26158 18.2178 9.31823 18.591 10.1553 17.2418L12.4275 13.5798C12.4611 13.5255 12.5143 13.4861 12.5761 13.4699L16.8289 12.3482C18.3433 11.9488 18.6107 9.91372 17.2509 9.13668L7.27695 3.4373C5.97394 2.69272 4.3996 3.82614 4.69231 5.29805Z","stroke","#FF7162","stroke-width","1.5","stroke-linecap","square"],["fill-rule","evenodd","clip-rule","evenodd","d","M13.8325 2.04946C17.7809 2.65969 20.8233 5.37592 21.8636 9.21997C22.1983 10.457 22.1983 12.6637 21.8636 13.9007C20.922 17.3797 18.4001 19.9016 14.921 20.8432C14.2284 21.0307 13.7495 21.0787 12.5807 21.0777C10.9937 21.0764 10.2354 20.9338 8.89576 20.3847L8.17885 20.0909L5.96793 20.6411C3.89884 21.156 3.73807 21.1807 3.46234 21.0259C2.91579 20.7191 2.9196 20.4879 3.50969 18.1292L4.05124 15.965L3.75679 15.2466C3.20719 13.9056 3.06459 13.1477 3.06328 11.5603C3.06231 10.3914 3.11031 9.9126 3.29775 9.21997C4.23324 5.76343 6.77214 3.21049 10.1836 2.29591C10.9867 2.08059 13.1072 1.93745 13.8325 2.04946ZM10.2766 4.07773C8.99188 4.49235 8.06085 5.06677 7.07399 6.05364C5.60817 7.51946 4.87896 9.14649 4.77653 11.1793C4.71394 12.4216 4.88419 13.4239 5.34355 14.5187C5.50236 14.8972 5.68807 15.3419 5.7561 15.5069C5.85962 15.7577 5.81488 16.0697 5.48277 17.4105C5.26419 18.2927 5.09471 19.0236 5.10603 19.035C5.11735 19.0463 5.8483 18.8768 6.73045 18.6582C8.0713 18.3261 8.38328 18.2814 8.63408 18.3849C8.7991 18.4529 9.24377 18.6386 9.62225 18.7974C10.7171 19.2568 11.7194 19.427 12.9617 19.3645C14.9945 19.262 16.6215 18.5328 18.0873 17.067C19.0668 16.0875 19.6379 15.1663 20.0725 13.8644C20.3166 13.1336 20.3512 12.8471 20.3512 11.5603C20.3512 10.2736 20.3166 9.98706 20.0725 9.25621C19.6379 7.95433 19.0668 7.0331 18.0873 6.05364C16.4266 4.39297 14.6419 3.68684 12.3085 3.76717C11.4187 3.79787 10.8968 3.87755 10.2766 4.07773Z","fill","#fff"]],template:function(t,r){t&1&&u(0,Zon,40,38,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,Jn,$A,q1,ge],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}*[_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;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}*[_ngcontent-%COMP%]:not(svg *){height:unset;width:unset}.s-presence-avatar-initial[_ngcontent-%COMP%]{color:#fff!important}.pin2[_ngcontent-%COMP%]{position:relative!important;display:flex!important;justify-content:center!important;align-items:center!important;width:2.25em!important;height:2.25em!important;background:linear-gradient(145deg,#6941ff,#ff5f7a,#ffa113)!important;border-radius:2em!important;overflow:hidden!important;margin-left:-.5em!important;transition:transform .2s ease}.pin2[_ngcontent-%COMP%]:not(.s-current-user){cursor:pointer!important}.pin2[_ngcontent-%COMP%]:hover{z-index:2!important;transform:scale(1.1)!important}.modal-author__image[_ngcontent-%COMP%]{width:2em!important;height:2em!important;background-size:cover!important;border-radius:50%!important;border:1px solid!important}.pins-wrap[_ngcontent-%COMP%]{position:relative!important;display:flex!important;width:max-content!important;justify-content:center!important;align-items:center!important;margin-left:.5em!important}button[_ngcontent-%COMP%]{background:#e6e8ec00!important;transition:.5s!important;font-style:normal!important;font-weight:600!important;font-size:14px!important;line-height:1em!important;outline:0!important;border:0!important;color:#fff!important}button[_ngcontent-%COMP%]:hover{background:#23262f!important;cursor:pointer!important}.action-menu[_ngcontent-%COMP%]{position:relative!important;display:flex!important;width:max-content!important;justify-content:center!important;gap:1em!important}.buttons-wrap[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:.25em!important}.primary[_ngcontent-%COMP%]{color:#fff!important;padding:.5em .75em!important;background:#625df580!important;border-radius:5.6em!important}.secondary[_ngcontent-%COMP%]:hover{background:#625df5!important;border:2px solid rgb(98,93,245)!important}.secondary[_ngcontent-%COMP%]:focus{background:#625df5!important;outline:0!important}.secondary[_ngcontent-%COMP%]:active{background:#3b3893!important}.secondary[_ngcontent-%COMP%]{padding:.5em .75em!important;border-radius:5.6em!important;border:2px solid #E6E8EC!important}.line-div[_ngcontent-%COMP%]{border-top:1px solid #e6e8ec!important;width:100%!important}.reply-div[_ngcontent-%COMP%], .single-comment-disable-div[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important}.value-div[_ngcontent-%COMP%]{gap:.25em!important}.modal-div[_ngcontent-%COMP%]{position:relative!important;display:flex!important;flex-direction:column!important;gap:1em!important;border-radius:.75em!important;background-color:#fff!important;box-sizing:border-box!important;width:max-content!important;text-align:left!important;font-size:14px!important;color:#141416!important}.modal-header[_ngcontent-%COMP%]{display:flex!important;justify-content:flex-end!important;gap:.75em!important}.modal-header__button[_ngcontent-%COMP%]{border:0!important;border-radius:50%!important;width:2em!important;height:2em!important;flex-shrink:0!important;display:flex!important;align-items:center!important;justify-content:center!important}.modal-messages[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;gap:1em!important}.modal-author[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;gap:.25em!important}.modal-author__image[_ngcontent-%COMP%]{width:2em!important;height:2em!important;background-color:#d3d3d3!important;background-size:cover!important;border-radius:50%!important}.modal-author__name[_ngcontent-%COMP%]{flex-grow:1!important;font-style:normal!important;font-weight:600!important;font-size:16px!important;line-height:1.5!important;color:#141416!important}.modal-author__last-message[_ngcontent-%COMP%]{font-style:normal!important;font-weight:400!important;font-size:12px!important;line-height:1.5!important;display:flex!important;align-items:center!important;text-align:right!important;color:#777e91!important}.modal-author__text[_ngcontent-%COMP%]{flex-grow:1!important;padding-left:2.6em!important}.action__button[_ngcontent-%COMP%]{border:0!important;border-radius:50%!important;width:2.4em!important;height:2.4em!important;flex-shrink:0!important;display:flex!important;align-items:center!important;justify-content:center!important}.action__button[_ngcontent-%COMP%]:disabled{cursor:not-allowed!important}.action__button[_ngcontent-%COMP%]:disabled svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:#777e91!important}.actions-wrap[_ngcontent-%COMP%]{position:relative!important;height:2.4em!important;display:flex!important;flex-direction:line!important;align-items:center!important;justify-content:flex-start!important;gap:.25em!important}.input-text-wrap[_ngcontent-%COMP%]{width:max-content!important;height:100%!important;border-radius:.5em!important;background-color:#141416!important;border:0!important;box-sizing:border-box!important;position:relative!important;box-shadow:0 0 24px -2px #ffffff61;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((25rem + 0px) * var(--velt-base-rem-unit))!important}.input-text[_ngcontent-%COMP%]{font-style:normal!important;font-weight:400!important;font-size:14px!important;line-height:1.5em!important;padding:.25em!important;width:100%!important;height:100%!important;background-color:#fcfcfd!important;box-sizing:border-box!important;outline:0!important;overflow:hidden!important}.tooltip[_ngcontent-%COMP%]{position:relative!important;display:flex!important;flex-direction:column!important}.tooltip-link[_ngcontent-%COMP%]{font-style:normal!important;font-weight:400!important;font-size:12px!important;line-height:1.5em!important}.tooltip[_ngcontent-%COMP%] .tooltiptext[_ngcontent-%COMP%]{visibility:hidden!important;block-size:auto!important;width:max-content!important;top:135%!important;background-color:#000!important;color:#fff!important;text-align:left!important;padding:6px 12px!important;border-radius:6px!important;font-style:normal!important;font-weight:400!important;font-size:14px!important;line-height:2em!important;position:absolute!important;z-index:1!important;opacity:0!important;transition:opacity .5s!important}.tooltip[_ngcontent-%COMP%]:hover .tooltiptext[_ngcontent-%COMP%]{visibility:visible!important;opacity:1!important}.tooltip[_ngcontent-%COMP%] .tooltiptext[_ngcontent-%COMP%]:after{content:" "!important;position:absolute!important;top:0!important;left:50%!important;width:12px!important;height:12px!important;background-color:#000!important;border-radius:4px!important;transform:translate(-50%,-41%) rotate(45deg)!important;transform-origin:center!important} snippyly-user-avatar.huddle-menu-panel-user-avatar{display:flex} snippyly-user-avatar.huddle-menu-panel-user-avatar .s-user-avatar-initial{font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important} snippyly-user-avatar.huddle-menu-panel-user-avatar .s-user-avatar-image{border:1px solid black!important;border-radius:50%!important}'],changeDetection:0});let i=o;return i})();var uye=(()=>{let o=class o{constructor(e,t){this.loggingService=e,this.dragDrop=t,this.currentX=0,this.currentY=0,this.destroy$=new Ze,this.subscriptions=[],this.loggingService.log("%c[WB] Creating CLASS: DraggableOverlayDirective","color: blue;")}ngOnInit(){try{this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: ngOnInit","color: green;"),this.setupDraggableOverlay()}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective ngOnInit: ",e)}}setupDraggableOverlay(){try{if(this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: setupDraggableOverlay","color: green;"),this.connectedOverlay&&this.connectedOverlay.overlayRef){let e=this.connectedOverlay.overlayRef.overlayElement;this.dragRef=this.dragDrop.createDrag(e),this.subscriptions.push(this.dragRef.moved.pipe(So(this.destroy$)).subscribe(t=>{let r=this.connectedOverlay?.overlayRef.getConfig().positionStrategy;this.updatePosition(r,t.distance.x,t.distance.y)},t=>{this.loggingService.catch("Error in DraggableOverlayDirective dragRef.moved subscription: ",t)})),this.dragRef.ended.pipe(So(this.destroy$)).subscribe(t=>{this.currentX+=t.distance.x,this.currentY+=t.distance.y},t=>{this.loggingService.catch("Error in DraggableOverlayDirective dragRef.ended subscription: ",t)})}}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective setupDraggableOverlay: ",e)}}updatePosition(e,t,r){try{if(e){let a=this.currentX+t,s=this.currentY+r;e.withDefaultOffsetX(a).withDefaultOffsetY(s),this.connectedOverlay?.overlayRef?.updatePosition()}}catch{}}cleanupDraggableOverlay(){try{this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: cleanupDraggableOverlay","color: green;"),this.dragRef&&this.dragRef.dispose()}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective cleanupDraggableOverlay: ",e)}}ngOnDestroy(){try{this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: ngOnDestroy","color: green;"),this.cleanupDraggableOverlay(),this.destroy$.next(),this.destroy$.complete(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(_),h(i6))},o.\u0275dir=Gt({type:o,selectors:[["","veltDraggableOverlay",""]],inputs:{connectedOverlay:[0,"veltDraggableOverlay","connectedOverlay"]},standalone:!1});let i=o;return i})();var Jon=()=>["snippyly-overlay-panel","snippyly-huddle-menu-panel-overlay-panel","velt-overlay-panel"],ern=()=>["snippyly-overlay-panel","snippyly-huddle-banner-panel","velt-overlay-panel"];function trn(i,o){if(i&1){let n=K();y(0,"div",20),G("click",function(){N(n);let t=l(2);return F(t.onHuddleToolClick("audio"))}),y(1,"slot",21),G("slotchange",function(){N(n);let t=l(2);return F(t.onButtonSlotChange())}),y(2,"div",22),ce(),y(3,"svg",23),w(4,"path",24),b()()()()}}function nrn(i,o){if(i&1){let n=K();y(0,"div",20),G("click",function(){N(n);let t=l(2);return F(t.onHuddleToolClick("video"))}),y(1,"slot",21),G("slotchange",function(){N(n);let t=l(2);return F(t.onButtonSlotChange())}),y(2,"div",22),ce(),y(3,"svg",25),w(4,"path",26)(5,"path",27),b()()()()}}function irn(i,o){if(i&1){let n=K();y(0,"div",20),G("click",function(){N(n);let t=l(3);return F(t.onHuddleToolClick("presentation"))}),y(1,"slot",21),G("slotchange",function(){N(n);let t=l(3);return F(t.onButtonSlotChange())}),y(2,"div",22),ce(),y(3,"svg",23),w(4,"path",28),b()()()()}}function orn(i,o){i&1&&u(0,irn,5,0,"div",7),i&2&&d("ngSwitchCase","presentation")}function rrn(i,o){if(i&1){let n=K();y(0,"div",29,4)(2,"slot",21),G("slotchange",function(){N(n);let t=l(2);return F(t.onButtonSlotChange())}),y(3,"div",30),ce(),y(4,"svg",31),w(5,"path",24),b(),y(6,"svg",32),w(7,"path",33),b()()()()}if(i&2){let n=me(1);l();let e=me(8);d("matMenuTriggerFor",e),m(3),pe("active",n==null?null:n.menuOpen)}}function arn(i,o){if(i&1){let n=K();y(0,"div",11),G("click",function(){N(n);let t=l(2);return F(t.onHuddleToolClick("presentation"))}),ce(),y(1,"svg",12),w(2,"path",34),b(),ft(),y(3,"span"),te(4),P(5,"translate"),b()()}if(i&2){let n=l().ngIf;d("disabled",n.disabled),m(4),ze(M(5,2,"Screen Huddle"))}}function srn(i,o){if(i&1){let n=K();y(0,"snippyly-huddle-menu-panel",36),G("toggleAudio",function(){N(n);let t=l(3);return F(t.toggleAudio())})("toggleVideo",function(){N(n);let t=l(3);return F(t.toggleVideo())})("toggleScreenSharing",function(){N(n);let t=l(3);return F(t.toggleScreenSharing())})("leave",function(){N(n);let t=l(3);return F(t.dropCall())}),b()}if(i&2){let n=l(2).ngIf,e=me(24);d("veltDraggableOverlay",e)("attendees",n.huddleAttendees)("user",n.user)("audioState",n.localStreamState==null?null:n.localStreamState.audioState)("videoState",n.localStreamState==null?null:n.localStreamState.videoState)("screenSharingState",n.localStreamState==null?null:n.localStreamState.screenSharingState)}}function lrn(i,o){if(i&1&&u(0,srn,1,6,"snippyly-huddle-menu-panel",35),i&2){let n=l().ngIf;d("ngIf",n.meetingJoined)}}function crn(i,o){if(i&1){let n=K();y(0,"div",38)(1,"div")(2,"div"),ce(),y(3,"svg",39),w(4,"path",40),b()(),ft(),y(5,"div")(6,"h3",41),te(7),P(8,"translate"),P(9,"translate"),P(10,"translate"),b(),y(11,"p",42),te(12),P(13,"translate"),b(),y(14,"div",43)(15,"button",44),G("click",function(){N(n);let t=l(3);return F(t.onJoinButtonClick())}),te(16,"Join"),b(),y(17,"button",45),G("click",function(){N(n);let t=l(3);return F(t.removeBanner())}),te(18,"Cancel"),b()()(),y(19,"div"),ce(),y(20,"svg",46),G("click",function(){N(n);let t=l(3);return F(t.removeBanner())}),w(21,"path",47),b()()()()}if(i&2){let n=l(2).ngIf;m(7),br("",(n.huddleAttendees==null?null:n.huddleAttendees.length)===1?M(8,3,"1 person is"):(n.huddleAttendees==null?null:n.huddleAttendees.length)+" "+M(9,5,"people are")," ",M(10,7,"on a call now")),m(5),ze(M(13,9,"You can join the call"))}}function drn(i,o){if(i&1&&u(0,crn,22,11,"div",37),i&2){let n=l().ngIf;d("ngIf",n.isFirstComponent&&!n.meetingJoined&&!n.bannerRemoved&&(n.huddleAttendees==null?null:n.huddleAttendees.length))}}function mrn(i,o){if(i&1){let n=K();v(0),y(1,"div",6,0),u(3,trn,5,0,"div",7)(4,nrn,6,0,"div",7)(5,orn,1,1,"ng-template",8)(6,rrn,8,3,"div",9),b(),y(7,"mat-menu",10,1)(9,"div",11),G("click",function(){N(n);let t=l();return F(t.onHuddleToolClick("audio"))}),ce(),y(10,"svg",12),w(11,"path",13),b(),ft(),y(12,"span"),te(13),P(14,"translate"),b()(),y(15,"div",11),G("click",function(){N(n);let t=l();return F(t.onHuddleToolClick("video"))}),ce(),y(16,"svg",12),w(17,"path",14)(18,"path",15),b(),ft(),y(19,"span"),te(20),P(21,"translate"),b()(),u(22,arn,6,4,"div",16),b(),u(23,lrn,1,1,"ng-template",17,2,Ee),w(25,"div",18,3),u(27,drn,1,1,"ng-template",19,2,Ee),C()}if(i&2){let n=o.ngIf,e=me(2),t=me(26),r=l();m(),d("ngSwitch",n.type),m(2),d("ngSwitchCase","audio"),m(),d("ngSwitchCase","video"),m(),d("ngIf",n.screenSharingSupported),m(),d("ngSwitchCase","all"),m(3),d("disabled",n.disabled),m(4),ze(M(14,21,"Audio Huddle")),m(2),d("disabled",n.disabled),m(5),ze(M(21,23,"Video Huddle")),m(2),d("ngIf",n.screenSharingSupported),m(),d("cdkConnectedOverlayOrigin",e)("cdkConnectedOverlayOpen",n.meetingJoined&&n.joinedHuddleToolComponentId===r.veltId)("cdkConnectedOverlayPanelClass",gt(25,Jon))("cdkConnectedOverlayBackdropClass","snippyly-overlay-backdrop")("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayPositions",n.positions)("cdkConnectedOverlayDisableClose",!0),m(4),d("cdkConnectedOverlayOrigin",t)("cdkConnectedOverlayOpen",n.isFirstComponent&&!n.meetingJoined&&!n.bannerRemoved&&!!(n.huddleAttendees!=null&&n.huddleAttendees.length))("cdkConnectedOverlayPanelClass",gt(26,ern))("cdkConnectedOverlayPositions",n.positions)}}var Lq=(()=>{let o=class o extends nt{constructor(e,t,r,a,s,c,p){super(p,c),this.analyticsService=e,this.authService=t,this.huddleService=r,this.iamService=a,this.loggingService=s,this.themeService=c,this.elementRef=p,this.type="audio",this.remoteStreams=[],this.huddleStarted=!1,this.initialHuddleType="audio",this.customButtonAdded=!1,this.subscriptions=[],this.veltId=vt(),this.veltElement=!0,this.componentConfigSignal=Te({type:this.type,screenSharingSupported:!!navigator?.mediaDevices?.getDisplayMedia,disabled:!1,meetingJoined:!1,joinedHuddleToolComponentId:null,positions:U.OVERLAY_POSITIONS.map(g=>new mi({originX:g.originX,originY:g.originY},{overlayX:g.overlayX,overlayY:g.overlayY})),user:null,localStreamState:{},huddleAttendees:[],isFirstComponent:!1,bannerRemoved:!1}),this.subscriptions.push(this.authService.getUser$().pipe(Le(g=>!!g)).subscribe(g=>{g&&(this.componentConfigSignal.update(f=>D(E({},f),{user:g})),this.checkToAutoJoinHuddle())},g=>{this.loggingService.catch("Error in getUser: ",g)})),this.subscriptions.push(this.huddleService.getRemoteStream().subscribe(g=>{try{g||(this.remoteStreams=[])}catch(f){this.loggingService.catch("Error in HuddleToolComponent getRemoteStream:",f)}},g=>{this.loggingService.catch("Error in getRemoteStream: ",g)})),this.subscriptions.push(this.huddleService.getLocalStreamState().subscribe(g=>{this.componentConfigSignal.update(f=>D(E({},f),{localStreamState:g}))},g=>{this.loggingService.catch("Error in getLocalStreamState: ",g)})),this.subscriptions.push(this.huddleService.getHuddleToolComponentId().subscribe(g=>{this.componentConfigSignal.update(f=>D(E({},f),{joinedHuddleToolComponentId:g}))},g=>{this.loggingService.catch("Error in getHuddleToolComponentId: ",g)})),this.subscriptions.push(this.iamService.getFeaturesAccessLevel$().subscribe(g=>{this.componentConfigSignal.update(f=>D(E({},f),{disabled:!!g?.all?.disabled}))})),this.getHuddleAttendees()}ngOnInit(){}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in HuddleToolComponent ngOnChanges: ",t)}}ngAfterViewInit(){try{let e=document.querySelector(U.TAGS.SNIPPYLY_HUDDLE_TOOL),t=document.querySelector(U.TAGS.VELT_HUDDLE_TOOL);t||e?t?this.veltId===t?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>D(E({},r),{isFirstComponent:!0})),this.checkToAutoJoinHuddle()):this.veltId===e?.getAttribute(U.ATTRIBUTES.VELT_ID)&&(this.componentConfigSignal.update(r=>D(E({},r),{isFirstComponent:!0})),this.checkToAutoJoinHuddle()):(document.querySelector(U.TAGS.SNIPPYLY_PLUGIN)||document.querySelector(U.TAGS.SUPERFLOW_TOOLBAR))&&(this.componentConfigSignal.update(r=>D(E({},r),{isFirstComponent:!0})),this.checkToAutoJoinHuddle())}catch(e){this.loggingService.catch("Error in HuddleToolComponent AfterViewInit: ",e)}}onButtonSlotChange(){this.customButtonAdded=!0}checkToAutoJoinHuddle(){try{if(this.componentConfigSignal().user&&this.componentConfigSignal().isFirstComponent){let e=sessionStorage.getItem(U.SESSION_STORAGE.SNIPPYLY_HUDDLE_DATA);if(e&&!this.huddleStarted){let t=JSON.parse(e).type;this.joinHuddle(t)}}}catch(e){this.loggingService.catch("Error in checkToAutoJoinHuddle: ",e)}}getHuddleAttendees(){this.subscriptions.push(this.huddleService.getHuddleAttendees$().subscribe(e=>{try{e?(this.componentConfigSignal.update(t=>D(E({},t),{huddleAttendees:e.slice()})),this.huddleStarted=!!e?.length,(this.componentConfigSignal().meetingJoined||!this.componentConfigSignal().huddleAttendees?.length)&&this.componentConfigSignal.update(t=>D(E({},t),{bannerRemoved:!1})),this.componentConfigSignal.update(t=>D(E({},t),{meetingJoined:!!e.find(r=>r?.userSnippylyId===this.componentConfigSignal().user?.userSnippylyId)})),this.componentConfigSignal().huddleAttendees?.length&&(this.initialHuddleType=this.componentConfigSignal().huddleAttendees[0].initialHuddleType)):(this.huddleStarted=!1,this.componentConfigSignal.update(t=>D(E({},t),{meetingJoined:!1})),this.componentConfigSignal.update(t=>D(E({},t),{bannerRemoved:!1})),this.componentConfigSignal.update(t=>D(E({},t),{huddleAttendees:[]})),this.initialHuddleType="audio")}catch(t){this.loggingService.catch("Error in HuddleToolComponent getHuddleAttendees:",t)}}))}onHuddleToolClick(e){try{if(this.analyticsService.trackEvent(Y.Events.Huddle.HUDDLE_TOOL_CLICKED,{huddleType:e,toolType:this.customButtonAdded?`custom - ${this.componentConfigSignal().type}`:`default - ${this.componentConfigSignal().type}`}),this.componentConfigSignal().disabled){this.loggingService.catch("Huddle feature is disabled.");return}this.joinHuddle(e)}catch(t){this.loggingService.catch("Error in HuddleToolComponent onHuddleToolClick:",t)}}onJoinButtonClick(){try{this.analyticsService.trackEvent(Y.Events.Huddle.HUDDLE_JOIN_BUTTON_CLICKED,{huddleType:this.initialHuddleType,huddleSnippylyUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userSnippylyId),huddleClientUserIds:this.huddleService.getHuddleAttendees()?.map(e=>e?.userId)}),this.joinHuddle(void 0)}catch(e){this.loggingService.catch("Error in HuddleToolComponent onJoinButtonClick:",e)}}joinHuddle(e){return Q(this,null,function*(){try{e?this.huddleStarted||(this.initialHuddleType=e||"audio"):e=this.initialHuddleType||"audio";let t=this.huddleService.getHuddleSessionData();if(this.componentConfigSignal().meetingJoined&&(yield this.dropCall(),yield gm(1e3)),!this.componentConfigSignal().meetingJoined)if(this.componentConfigSignal().user&&!this.componentConfigSignal().meetingJoined){this.huddleService.setHuddleToolComponentId(this.veltId);let r=U.HUDDLE_TYPE_CONFIGS[e],a=JSON.parse(JSON.stringify(r));r&&(a.audio=t?!!t.audio:r.audio,a.video=t?!!t.video:r.video,a.presentation=t?!!t.presentation:r.presentation,yield this.huddleService.setLocalStream(E({},a)),(t?t?.presentation:r.presentation)&&!this.huddleStarted?yield this.huddleService.setScreenSharingStream():a.presentation=!1,this.huddleService.updateHuddleSessionData("","",E({type:e},a)),this.componentConfigSignal.update(s=>D(E({},s),{meetingJoined:!0})),this.huddleService.joinHuddle(this.initialHuddleType),this.componentConfigSignal().huddleAttendees?.length?(this.analyticsService.trackEvent(Y.Events.Huddle.HUDDLE_JOINED,{huddleType:this.initialHuddleType,totalUsers:this.huddleService.getHuddleAttendees()?.length||0,totalUserHuddleDuration:this.huddleService.getTotalUserHuddleDuration(),huddleSnippylyUserIds:this.huddleService.getHuddleAttendees()?.map(s=>s?.userSnippylyId),huddleClientUserIds:this.huddleService.getHuddleAttendees()?.map(s=>s?.userId)}),this.huddleService.updateNotificationsDatabase({actionType:Fk.JOINED})):(this.huddleService.clearHuddleInvitees(),this.analyticsService.trackEvent(Y.Events.Huddle.HUDDLE_CREATED,{huddleType:this.initialHuddleType,totalUsers:this.huddleService.getHuddleAttendees()?.length||0,totalUserHuddleDuration:this.huddleService.getTotalUserHuddleDuration(),huddleSnippylyUserIds:this.huddleService.getHuddleAttendees()?.map(s=>s?.userSnippylyId),huddleClientUserIds:this.huddleService.getHuddleAttendees()?.map(s=>s?.userId)}),this.huddleService.updateNotificationsDatabase({actionType:Fk.CREATED})))}else this.componentConfigSignal().user||this.loggingService.catch("Velt sdk not authenticated.")}catch(t){this.loggingService.catch("Error in HuddleToolComponent joinHuddle:",t)}})}toggleAudio(){try{this.huddleService.updateHuddleSessionData("audio",!this.componentConfigSignal().localStreamState?.audioState),this.huddleService.toggleLocalStreamAudio()}catch(e){this.loggingService.catch("Error in HuddleToolComponent toggleAudio:",e)}}toggleVideo(){try{this.huddleService.updateHuddleSessionData("video",!this.componentConfigSignal().localStreamState?.videoState),this.huddleService.toggleLocalStreamVideo()}catch(e){this.loggingService.catch("Error in HuddleToolComponent toggleVideo:",e)}}toggleScreenSharing(){return Q(this,null,function*(){try{this.huddleService.updateHuddleSessionData("presentation",!this.componentConfigSignal().localStreamState?.screenSharingState),yield this.huddleService.toggleLocalScreenSharing()}catch(e){this.loggingService.catch("Error in HuddleToolComponent toggleScreenSharing:",e)}})}dropCall(){return Q(this,null,function*(){try{this.componentConfigSignal.update(e=>D(E({},e),{huddleAttendees:[]})),yield this.huddleService.dropCall(),yield this.huddleService.removeLocalStream(),yield this.huddleService.removeAttendee()}catch(e){this.loggingService.catch("Error in HuddleToolComponent dropCall:",e)}})}copyUrl(){Js(window.location.href)}removeBanner(){try{this.componentConfigSignal.update(e=>D(E({},e),{bannerRemoved:!0}))}catch(e){this.loggingService.catch("Error in HuddleToolComponent removeBanner:",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.loggingService.catch("Error in HuddleToolComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in HuddleToolComponent unsubscribe: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(Je),h(je),h(Or),h(xn),h(_),h(Ke),h(R))},o.\u0275cmp=O({type:o,selectors:[["snippyly-huddle-tool"]],hostVars:2,hostBindings:function(t,r){t&2&&T("data-velt-id",r.veltId)("data-velt-element",r.veltElement)},inputs:{type:"type"},standalone:!1,features:[L,Qe],decls:1,vars:1,consts:[["trigger","cdkOverlayOrigin"],["allMenu","matMenu"],["overlay","cdkConnectedOverlay"],["huddleBannerTrigger","cdkOverlayOrigin"],["allMenuTrigger","matMenuTrigger"],[4,"ngIf"],["part","container","cdkOverlayOrigin","",1,"huddle-tool-container",3,"ngSwitch"],[3,"click",4,"ngSwitchCase"],[3,"ngIf"],[3,"matMenuTriggerFor",4,"ngSwitchCase"],[1,"velt-menu","huddle-all-menu-panel"],["mat-menu-item","",3,"click","disabled"],["width","25","height","24","viewBox","0 0 25 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M5.5 14.625C5.5 14.1609 5.68437 13.7158 6.01256 13.3876C6.34075 13.0594 6.78587 12.875 7.25 12.875H8.125C8.58913 12.875 9.03425 13.0594 9.36244 13.3876C9.69063 13.7158 9.875 14.1609 9.875 14.625V17.25C9.875 17.7141 9.69063 18.1592 9.36244 18.4874C9.03425 18.8156 8.58913 19 8.125 19H7.25C6.78587 19 6.34075 18.8156 6.01256 18.4874C5.68437 18.1592 5.5 17.7141 5.5 17.25V14.625ZM5.5 14.625V12C5.5 10.1435 6.2375 8.36301 7.55025 7.05025C8.86301 5.7375 10.6435 5 12.5 5C14.3565 5 16.137 5.7375 17.4497 7.05025C18.7625 8.36301 19.5 10.1435 19.5 12V14.625M19.5 14.625C19.5 14.1609 19.3156 13.7158 18.9874 13.3876C18.6592 13.0594 18.2141 12.875 17.75 12.875H16.875C16.4109 12.875 15.9658 13.0594 15.6376 13.3876C15.3094 13.7158 15.125 14.1609 15.125 14.625V17.25C15.125 17.7141 15.3094 18.1592 15.6376 18.4874C15.9658 18.8156 16.4109 19 16.875 19H17.75C18.2141 19 18.6592 18.8156 18.9874 18.4874C19.3156 18.1592 19.5 17.7141 19.5 17.25V14.625Z","stroke","#8F95B2","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M15.1667 10.2228L19.2138 8.19966C19.3493 8.13195 19.4998 8.09999 19.6511 8.10681C19.8024 8.11362 19.9495 8.15899 20.0783 8.23859C20.2072 8.3182 20.3135 8.42941 20.3873 8.56167C20.4611 8.69394 20.4999 8.84286 20.5 8.99432V15.0068C20.4999 15.1582 20.4611 15.3072 20.3873 15.4394C20.3135 15.5717 20.2072 15.6829 20.0783 15.7625C19.9495 15.8421 19.8024 15.8875 19.6511 15.8943C19.4998 15.9011 19.3493 15.8691 19.2138 15.8014L15.1667 13.7783V10.2228Z","stroke","#8F95B2","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M4.5 8.44445C4.5 7.97295 4.6873 7.52077 5.0207 7.18737C5.3541 6.85397 5.80628 6.66667 6.27778 6.66667H13.3889C13.8604 6.66667 14.3126 6.85397 14.646 7.18737C14.9794 7.52077 15.1667 7.97295 15.1667 8.44445V15.5556C15.1667 16.0271 14.9794 16.4792 14.646 16.8126C14.3126 17.146 13.8604 17.3333 13.3889 17.3333H6.27778C5.80628 17.3333 5.3541 17.146 5.0207 16.8126C4.6873 16.4792 4.5 16.0271 4.5 15.5556V8.44445Z","stroke","#8F95B2","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["mat-menu-item","",3,"disabled","click",4,"ngIf"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPanelClass","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayDisableClose"],["cdkOverlayOrigin",""],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPanelClass","cdkConnectedOverlayPositions"],[3,"click"],["name","button",3,"slotchange"],["part","button-container",1,"action-btn"],["part","button-icon","viewBox","0 0 25 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"action-btn-icon"],["d","M5.5 14.625C5.5 14.1609 5.68437 13.7158 6.01256 13.3876C6.34075 13.0594 6.78587 12.875 7.25 12.875H8.125C8.58913 12.875 9.03425 13.0594 9.36244 13.3876C9.69063 13.7158 9.875 14.1609 9.875 14.625V17.25C9.875 17.7141 9.69063 18.1592 9.36244 18.4874C9.03425 18.8156 8.58913 19 8.125 19H7.25C6.78587 19 6.34075 18.8156 6.01256 18.4874C5.68437 18.1592 5.5 17.7141 5.5 17.25V14.625ZM5.5 14.625V12C5.5 10.1435 6.2375 8.36301 7.55025 7.05025C8.86301 5.7375 10.6435 5 12.5 5C14.3565 5 16.137 5.7375 17.4497 7.05025C18.7625 8.36301 19.5 10.1435 19.5 12V14.625M19.5 14.625C19.5 14.1609 19.3156 13.7158 18.9874 13.3876C18.6592 13.0594 18.2141 12.875 17.75 12.875H16.875C16.4109 12.875 15.9658 13.0594 15.6376 13.3876C15.3094 13.7158 15.125 14.1609 15.125 14.625V17.25C15.125 17.7141 15.3094 18.1592 15.6376 18.4874C15.9658 18.8156 16.4109 19 16.875 19H17.75C18.2141 19 18.6592 18.8156 18.9874 18.4874C19.3156 18.1592 19.5 17.7141 19.5 17.25V14.625Z","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["part","button-icon","width","25","height","24","viewBox","0 0 25 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"action-btn-icon"],["d","M15.1667 10.2228L19.2138 8.19966C19.3493 8.13195 19.4998 8.09999 19.6511 8.10681C19.8024 8.11362 19.9495 8.15899 20.0783 8.23859C20.2072 8.3182 20.3135 8.42941 20.3873 8.56167C20.4611 8.69394 20.4999 8.84286 20.5 8.99432V15.0068C20.4999 15.1582 20.4611 15.3072 20.3873 15.4394C20.3135 15.5717 20.2072 15.6829 20.0783 15.7625C19.9495 15.8421 19.8024 15.8875 19.6511 15.8943C19.4998 15.9011 19.3493 15.8691 19.2138 15.8014L15.1667 13.7783V10.2228Z","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M4.5 8.44445C4.5 7.97295 4.6873 7.52077 5.0207 7.18737C5.3541 6.85397 5.80628 6.66667 6.27778 6.66667H13.3889C13.8604 6.66667 14.3126 6.85397 14.646 7.18737C14.9794 7.52077 15.1667 7.97295 15.1667 8.44445V15.5556C15.1667 16.0271 14.9794 16.4792 14.646 16.8126C14.3126 17.146 13.8604 17.3333 13.3889 17.3333H6.27778C5.80628 17.3333 5.3541 17.146 5.0207 16.8126C4.6873 16.4792 4.5 16.0271 4.5 15.5556V8.44445Z","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M19 12V14.1667C19 14.3582 18.9239 14.5419 18.7885 14.6773C18.653 14.8128 18.4693 14.8889 18.2778 14.8889H6.72222C6.53068 14.8889 6.34698 14.8128 6.21153 14.6773C6.07609 14.5419 6 14.3582 6 14.1667V6.94444C6 6.75289 6.07609 6.56919 6.21153 6.43375C6.34698 6.2983 6.53068 6.22221 6.72222 6.22221H13.2222M8.88889 17.7778H16.1111M10.3333 14.8889V17.7778M14.6667 14.8889V17.7778M16.1111 6.22221H19M19 6.22221V9.1111M19 6.22221L15.3889 9.83333","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],[3,"matMenuTriggerFor"],["part","button-container",1,"action-btn","action-dropdown"],["part","button-icon","viewBox","0 0 25 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"action-btn-icon","action-dropdown-icon"],["width","16","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg",1,"toolbar-icon-dropdown-arrow"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.2071 5.79289C11.8166 5.40237 11.1834 5.40237 10.7929 5.79289L8 8.58579L5.20711 5.79289C4.81658 5.40237 4.18342 5.40237 3.79289 5.79289C3.40237 6.18342 3.40237 6.81658 3.79289 7.20711L7.29289 10.7071C7.68342 11.0976 8.31658 11.0976 8.70711 10.7071L12.2071 7.20711C12.5976 6.81658 12.5976 6.18342 12.2071 5.79289Z","fill","currentColor"],["d","M19 12V14.1667C19 14.3582 18.9239 14.5419 18.7885 14.6773C18.653 14.8128 18.4693 14.8889 18.2778 14.8889H6.72222C6.53068 14.8889 6.34698 14.8128 6.21153 14.6773C6.07609 14.5419 6 14.3582 6 14.1667V6.94444C6 6.75289 6.07609 6.56919 6.21153 6.43375C6.34698 6.2983 6.53068 6.22221 6.72222 6.22221H13.2222M8.88889 17.7778H16.1111M10.3333 14.8889V17.7778M14.6667 14.8889V17.7778M16.1111 6.22221H19M19 6.22221V9.1111M19 6.22221L15.3889 9.83333","stroke","#8F95B2","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],[3,"veltDraggableOverlay","attendees","user","audioState","videoState","screenSharingState","toggleAudio","toggleVideo","toggleScreenSharing","leave",4,"ngIf"],[3,"toggleAudio","toggleVideo","toggleScreenSharing","leave","veltDraggableOverlay","attendees","user","audioState","videoState","screenSharingState"],["class","huddle-banner",4,"ngIf"],[1,"huddle-banner"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 17C11.45 17 11 16.55 11 16V12C11 11.45 11.45 11 12 11C12.55 11 13 11.45 13 12V16C13 16.55 12.55 17 12 17ZM13 9H11V7H13V9Z","fill","#625DF5"],[1,"title"],[1,"subtitle"],[1,"action-btn-container"],[1,"join-btn",3,"click"],[1,"cancel-btn",3,"click"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"close-btn",3,"click"],["fill-rule","evenodd","clip-rule","evenodd","d","M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z","fill","#777E91"]],template:function(t,r){t&1&&u(0,mrn,29,27,"ng-container",5),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,eo,po,dn,sn,sc,xl,Vg,gye,uye,ge],styles:[`html{--velt-base-rem-unit: 1}*[data-snippyly-element=true],*[data-velt-element=true]{font-family:var(--velt-default-font-family)}velt-wireframe{display:none!important}*{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;text-align:left!important;line-height:1.5!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*:empty{display:revert!important}.huddle-tool-container{width:max-content}.icon-btn{border:1px solid #2d2d2d;border-radius:100%;width:40px!important;height:40px!important;display:flex;align-items:center;justify-content:center;color:#2d2d2d!important;fill:#2d2d2d!important;cursor:pointer}.icon-btn:hover{background:#fff5}.icon-btn.background-red{background:red!important;border-color:red!important;color:#fff!important;fill:#fff!important}.icon-btn.background-royalblue{background:#4169e1!important;border-color:#4169e1!important}.icon-btn:before{content:""}.drop-call-btn{transform:rotate(135deg)!important}.action-btn{display:inline-flex;justify-content:center;align-items:center;padding:6px!important;border-radius:var(--legacy-velt-tool-border-radius);border:var(--legacy-velt-tool-border);background-color:var(--legacy-velt-tool-bg-color);color:var(--legacy-velt-tool-icon-color);cursor:pointer}.action-btn .action-btn-label{font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important;padding-right:4px!important;font-weight:700!important;color:currentColor!important}.action-btn .action-btn-icon{width:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));color:currentColor}.action-btn .toolbar-icon-dropdown-arrow{width:16px;height:16px;color:currentColor}.action-btn:focus{border-radius:var(--legacy-velt-tool-focus-border-radius);border:var(--legacy-velt-tool-focus-border);background-color:var(--legacy-velt-tool-focus-bg-color);color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:focus .action-btn-icon{width:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:focus .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:hover{border-radius:var(--legacy-velt-tool-hover-border-radius);border:var(--legacy-velt-tool-hover-border);background-color:var(--legacy-velt-tool-hover-bg-color);color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:hover .action-btn-icon{width:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:hover .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:active,.action-btn.active{border-radius:var(--legacy-velt-tool-active-border-radius);border:var(--legacy-velt-tool-active-border);background-color:var(--legacy-velt-tool-active-bg-color);color:var(--legacy-velt-tool-active-icon-color)}.action-btn:active .action-btn-icon,.action-btn.active .action-btn-icon{width:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:active .toolbar-icon-dropdown-arrow,.action-btn.active .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-active-icon-color)}
|
|
537
537
|
`],encapsulation:3,changeDetection:0});let i=o;return i})();function prn(i,o){if(i&1&&(y(0,"span",11),te(1),P(2,"translate"),b()),i&2){let n=l(2).ngIf;m(),Se(" ",n.user!=null&&n.user.name?n.user==null||n.user.name==null?null:n.user.name.charAt(0):M(2,1,n.user==null||n.user.email==null?null:n.user.email.charAt(0)))}}function grn(i,o){if(i&1){let n=K();y(0,"img",12),G("error",function(){N(n);let t=l(3);return F(t.onImageLoadError())}),b()}if(i&2){let n=l(2).ngIf;d("src",n.user==null?null:n.user.photoUrl,vn)}}function urn(i,o){if(i&1&&(y(0,"span"),te(1),P(2,"translate"),b()),i&2){let n=l(2).ngIf;m(),ze(n.isRemoteStream?n.user==null||n.user.name==null?null:n.user.name.split(" ")[0]:M(2,1,"You"))}}function hrn(i,o){i&1&&(ce(),y(0,"svg",15),w(1,"path",16),b())}function frn(i,o){i&1&&(ce(),y(0,"svg",17),w(1,"path",18)(2,"path",19),b())}function vrn(i,o){if(i&1&&(v(0),u(1,hrn,2,0,"svg",13)(2,frn,3,0,"svg",14),C()),i&2){let n=l(2).ngIf;m(),d("ngIf",n.audioState),m(),d("ngIf",!n.audioState)}}function Crn(i,o){i&1&&(ce(),y(0,"svg",15),w(1,"path",16),b())}function _rn(i,o){i&1&&(ce(),y(0,"svg",17),w(1,"path",18)(2,"path",19),b())}function yrn(i,o){i&1&&(ce(),y(0,"svg",23),w(1,"path",24),b())}function Srn(i,o){i&1&&(ce(),y(0,"svg",17)(1,"g"),w(2,"path",25)(3,"path",19),b()())}function brn(i,o){if(i&1){let n=K();y(0,"div",20),G("click",function(t){return N(n),F(t.stopPropagation())}),y(1,"div",21),G("click",function(){N(n);let t=l(3);return F(t.onToggleAudioClick())}),u(2,Crn,2,0,"svg",13)(3,_rn,3,0,"svg",14),b(),y(4,"div",21),G("click",function(){N(n);let t=l(3);return F(t.onToggleVideoClick())}),u(5,yrn,2,0,"svg",22)(6,Srn,4,0,"svg",14),b()()}if(i&2){let n=l(2).ngIf;m(2),d("ngIf",n.audioState),m(),d("ngIf",!n.audioState),m(2),d("ngIf",n.videoState),m(),d("ngIf",!n.videoState)}}function Irn(i,o){if(i&1){let n=K();y(0,"div",20),G("click",function(t){return N(n),F(t.stopPropagation())}),y(1,"div",21),G("click",function(){N(n);let t=l(3);return F(t.onToggleHuddleOnCursor())}),ce(),y(2,"svg",17),w(3,"path",26),b()()()}}function Ern(i,o){if(i&1){let n=K();y(0,"div",3),G("click",function(){N(n);let t=l(2);return F(t.toggleSelection())}),y(1,"div",4),w(2,"video",5),y(3,"div",6)(4,"span",7),P(5,"translate"),u(6,prn,3,3,"span",8)(7,grn,1,1,"ng-template",null,0,Ee),b()(),y(9,"div",9),u(10,urn,3,3,"span",1)(11,vrn,3,2,"ng-container",1),b()(),u(12,brn,7,4,"div",10)(13,Irn,4,0,"div",10),b()}if(i&2){let n=me(8),e=l().ngIf,t=l();pe("local-stream",!e.isRemoteStream)("video-off",!e.videoState)("speaking",e.audioState)("selected",t.selected),m(2),pe("flip",!e.isRemoteStream),d("srcObject",e.isRemoteStream?e.remoteVideoStream:e.stream)("muted",e.isRemoteStream?null:"muted")("volume",e.isRemoteStream?1:0),m(2),at("color",(e.user==null?null:e.user.color)+" !important")("background-color",(e.user==null?null:e.user.color)+" !important"),d("title",M(5,24,(e.user==null?null:e.user.name)||(e.user==null?null:e.user.email))),m(2),d("ngIf",e.showInitials)("ngIfElse",n),m(4),d("ngIf",e.user==null?null:e.user.name),m(),d("ngIf",e.isRemoteStream),m(),d("ngIf",!e.isRemoteStream),m(),d("ngIf",e.isRemoteStream)}}function xrn(i,o){if(i&1&&(v(0),u(1,Ern,14,26,"div",2),C()),i&2){let n=o.ngIf;m(),d("ngIf",n.isRemoteStream?n.remoteVideoStream:n.stream)}}var hye=(()=>{let o=class o{get remoteStream(){return this._remoteStream}set remoteStream(e){this._remoteStream=e}constructor(e){this.loggingService=e,this.toggleAudio=new Me,this.toggleVideo=new Me,this.toggleHuddleOnCursor=new Me,this.veltElement=!0,this.componentConfigSignal=Te({isRemoteStream:this.isRemoteStream,remoteVideoStream:this.remoteVideoStream,stream:this.stream,videoState:this.videoState,audioState:this.audioState,user:this.user,selected:this.selected,showInitials:!1})}ngOnChanges(e){try{this.loggingService.log("%c[WB] Calling VideoHuddleUserComponent FUNCTION: ngOnChanges","color: green;"),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in VideoHuddleUserComponent ngOnChanges: ",t)}}onToggleAudioClick(){this.toggleAudio.emit()}onToggleVideoClick(){this.toggleVideo.emit()}toggleSelection(){this.componentConfigSignal.update(e=>(e.selected=!e.selected,e))}onImageLoadError(){this.loggingService.log("%c[WB] Calling FUNCTION: onImageLoadError","color: green;");try{this.componentConfigSignal.update(e=>(e=D(E({},e),{showInitials:!0}),e))}catch(e){this.loggingService.catch("Error in VideoHuddleUserComponent onImageLoadError: ",e)}}onToggleHuddleOnCursor(){this.loggingService.log("%c[WB] Calling FUNCTION: onToggleHuddleOnCursor","color: green;");try{this.toggleHuddleOnCursor.emit()}catch(e){this.loggingService.catch("Error in VideoHuddleUserComponent onToggleHuddleOnCursor: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(_))},o.\u0275cmp=O({type:o,selectors:[["snippyly-video-huddle-user"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{stream:"stream",selected:"selected",isRemoteStream:"isRemoteStream",user:"user",audioState:"audioState",videoState:"videoState",remoteStream:"remoteStream",remoteVideoStream:"remoteVideoStream"},outputs:{toggleAudio:"toggleAudio",toggleVideo:"toggleVideo",toggleHuddleOnCursor:"toggleHuddleOnCursor"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[["showAvatarImgRef",""],[4,"ngIf"],["class","video-huddle-block",3,"local-stream","video-off","speaking","selected","click",4,"ngIf"],[1,"video-huddle-block",3,"click"],[1,"video-player-container"],["playsinline","","autoplay","true",3,"srcObject","muted","volume"],[1,"user-profile-container"],["velt-ignore-change-detection","true",1,"s-presence-avatar",3,"title"],["class","s-presence-avatar-initial",4,"ngIf","ngIfElse"],[1,"video-player-overlay"],["class","video-huddle-actions-panel",3,"click",4,"ngIf"],[1,"s-presence-avatar-initial"],["referrerpolicy","no-referrer","loading","lazy",1,"s-presence-avatar-image",3,"error","src"],["width","13","height","19","viewBox","0 0 13 19","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["width","13","height","19","viewBox","0 0 13 19","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M5.77526 0.888917C4.98766 1.03653 4.34477 1.39041 3.76525 1.99544C3.26289 2.51988 2.94255 3.10884 2.75974 3.84431C2.69679 4.09753 2.6908 4.39635 2.6908 7.29276C2.6908 10.7979 2.68044 10.6352 2.94799 11.327C3.299 12.2346 4.07584 13.0561 4.94368 13.4374C5.82412 13.8243 6.82444 13.8531 7.71552 13.5173C8.69181 13.1494 9.53872 12.2934 9.92297 11.2862C10.1713 10.6354 10.1631 10.7714 10.1631 7.29276C10.1631 3.78764 10.1735 3.95032 9.90592 3.25855C9.62932 2.54335 9.02923 1.81042 8.38767 1.40419C7.61998 0.918084 6.64549 0.725873 5.77526 0.888917ZM6.9551 2.18212C7.80033 2.36379 8.55484 3.08137 8.82443 3.95997C8.91085 4.24162 8.9112 4.25479 8.9112 7.29276C8.9112 10.3307 8.91085 10.3439 8.82443 10.6256C8.578 11.4287 7.92854 12.0994 7.15071 12.3538C6.92897 12.4264 6.7875 12.4431 6.40739 12.4415C6.00213 12.4398 5.89869 12.425 5.65097 12.3333C5.00401 12.0936 4.49038 11.6376 4.2051 11.0497C3.92221 10.4667 3.92452 10.4977 3.92452 7.29276C3.92452 4.09736 3.92315 4.11587 4.19825 3.55135C4.71228 2.49645 5.83136 1.94067 6.9551 2.18212ZM0.537139 8.64006C0.373453 8.71677 0.215048 8.92183 0.182929 9.09861C0.133831 9.36895 0.199086 10.6794 0.283042 11.1082C0.737953 13.4317 2.32631 15.2803 4.50075 16.017C4.75328 16.1025 5.14915 16.2055 5.38044 16.2458L5.801 16.3192V16.9744V17.6296L5.06042 17.6421C4.38416 17.6536 4.31046 17.6619 4.21195 17.738C4.00671 17.8964 3.94271 18.0255 3.94271 18.2809C3.94271 18.5363 4.00679 18.6655 4.21206 18.8237C4.31804 18.9055 4.36006 18.907 6.42696 18.907C8.49385 18.907 8.53586 18.9055 8.64185 18.8237C8.84712 18.6655 8.9112 18.5363 8.9112 18.2809C8.9112 18.0255 8.8472 17.8964 8.64196 17.738C8.54346 17.6619 8.46975 17.6536 7.79349 17.6421L7.05291 17.6296V16.9744V16.3192L7.47347 16.2469C9.74567 15.8564 11.6474 14.1569 12.3699 11.8711C12.6066 11.1222 12.6648 10.7131 12.6659 9.79054C12.6668 9.05017 12.6614 8.98828 12.5862 8.8841C12.4332 8.67197 12.3081 8.60568 12.0605 8.60568C11.8131 8.60568 11.6881 8.67181 11.5348 8.88378C11.4622 8.9842 11.4515 9.07453 11.4282 9.79025C11.4001 10.6516 11.3449 11.0079 11.1515 11.5749C10.8931 12.3325 10.527 12.9264 9.95298 13.5192C9.22696 14.2689 8.41181 14.7274 7.405 14.9524C6.91168 15.0626 5.87256 15.0542 5.38588 14.936C4.37192 14.6897 3.6185 14.2601 2.90093 13.5192C2.32689 12.9264 1.96079 12.3325 1.70239 11.5749C1.50901 11.0079 1.45377 10.6516 1.42568 9.79025C1.39755 8.92635 1.3871 8.88689 1.13621 8.69342C1.00672 8.5936 0.695505 8.56589 0.537139 8.64006Z","fill","#FF7162"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M9.77526 0.888917C8.98766 1.03653 8.34477 1.39041 7.76525 1.99544C7.26289 2.51988 6.94255 3.10884 6.75974 3.84431C6.69679 4.09753 6.6908 4.39635 6.6908 7.29276C6.6908 10.7979 6.68044 10.6352 6.94799 11.327C7.299 12.2346 8.07584 13.0561 8.94368 13.4374C9.82412 13.8243 10.8244 13.8531 11.7155 13.5173C12.6918 13.1494 13.5387 12.2934 13.923 11.2862C14.1713 10.6354 14.1631 10.7714 14.1631 7.29276C14.1631 3.78764 14.1735 3.95032 13.9059 3.25855C13.6293 2.54335 13.0292 1.81042 12.3877 1.40419C11.62 0.918084 10.6455 0.725873 9.77526 0.888917ZM10.9551 2.18212C11.8003 2.36379 12.5548 3.08137 12.8244 3.95997C12.9108 4.24162 12.9112 4.25479 12.9112 7.29276C12.9112 10.3307 12.9108 10.3439 12.8244 10.6256C12.578 11.4287 11.9285 12.0994 11.1507 12.3538C10.929 12.4264 10.7875 12.4431 10.4074 12.4415C10.0021 12.4398 9.89869 12.425 9.65097 12.3333C9.00401 12.0936 8.49038 11.6376 8.2051 11.0497C7.92221 10.4667 7.92452 10.4977 7.92452 7.29276C7.92452 4.09736 7.92315 4.11587 8.19825 3.55135C8.71228 2.49645 9.83136 1.94067 10.9551 2.18212ZM4.53714 8.64006C4.37345 8.71677 4.21505 8.92183 4.18293 9.09861C4.13383 9.36895 4.19909 10.6794 4.28304 11.1082C4.73795 13.4317 6.32631 15.2803 8.50075 16.017C8.75328 16.1025 9.14915 16.2055 9.38044 16.2458L9.801 16.3192V16.9744V17.6296L9.06042 17.6421C8.38416 17.6536 8.31046 17.6619 8.21195 17.738C8.00671 17.8964 7.94271 18.0255 7.94271 18.2809C7.94271 18.5363 8.00679 18.6655 8.21206 18.8237C8.31804 18.9055 8.36006 18.907 10.427 18.907C12.4938 18.907 12.5359 18.9055 12.6418 18.8237C12.8471 18.6655 12.9112 18.5363 12.9112 18.2809C12.9112 18.0255 12.8472 17.8964 12.642 17.738C12.5435 17.6619 12.4697 17.6536 11.7935 17.6421L11.0529 17.6296V16.9744V16.3192L11.4735 16.2469C13.7457 15.8564 15.6474 14.1569 16.3699 11.8711C16.6066 11.1222 16.6648 10.7131 16.6659 9.79054C16.6668 9.05017 16.6614 8.98828 16.5862 8.8841C16.4332 8.67197 16.3081 8.60568 16.0605 8.60568C15.8131 8.60568 15.6881 8.67181 15.5348 8.88378C15.4622 8.9842 15.4515 9.07453 15.4282 9.79025C15.4001 10.6516 15.3449 11.0079 15.1515 11.5749C14.8931 12.3325 14.527 12.9264 13.953 13.5192C13.227 14.2689 12.4118 14.7274 11.405 14.9524C10.9117 15.0626 9.87256 15.0542 9.38588 14.936C8.37192 14.6897 7.6185 14.2601 6.90093 13.5192C6.32689 12.9264 5.96079 12.3325 5.70239 11.5749C5.50901 11.0079 5.45377 10.6516 5.42568 9.79025C5.39755 8.92636 5.3871 8.88689 5.13621 8.69342C5.00672 8.5936 4.69551 8.56589 4.53714 8.64006Z","fill","white"],["d","M19 1L1 19","stroke","#FF7162","stroke-width","1.4","stroke-linecap","round"],[1,"video-huddle-actions-panel",3,"click"],[1,"video-huddle-action-button",3,"click"],["width","19","height","11","viewBox","0 0 19 11","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["width","19","height","11","viewBox","0 0 19 11","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.55139 0.23203C1.68754 0.455725 1.06855 1.0239 0.766641 1.87017L0.666016 2.15221V5.58961V9.027L0.766892 9.30905C1.0535 10.1102 1.64038 10.6751 2.43987 10.9192L2.70863 11.0013H7.1343H11.56L11.8467 10.9053C12.6234 10.645 13.2099 10.0654 13.47 9.30122C13.56 9.03659 13.5637 8.9921 13.5769 8.03104C13.5844 7.48324 13.6004 7.03508 13.6125 7.03508C13.661 7.03508 15.0857 7.85713 15.8518 8.32715C16.7188 8.85908 16.9126 8.93887 17.338 8.93887C18.0692 8.93887 18.7509 8.40866 18.947 7.6873C19.0174 7.42849 19.0165 3.7478 18.946 3.48726C18.7883 2.90449 18.278 2.40845 17.7016 2.27772C17.4483 2.22025 17.0895 2.2339 16.8373 2.31054C16.6848 2.35687 16.3699 2.52617 15.9107 2.80867C15.3288 3.16675 13.6405 4.14414 13.6039 4.14414C13.5979 4.14414 13.5847 3.71184 13.5747 3.18343C13.5543 2.10543 13.5363 1.99899 13.2916 1.50796C13.0166 0.956034 12.475 0.494788 11.8467 0.277192L11.56 0.177913L7.18806 0.170686C2.95948 0.163705 2.80747 0.165715 2.55139 0.23203ZM11.3211 1.83643C11.5404 1.90052 11.7306 2.05381 11.8398 2.25463L11.9183 2.399V5.57293V8.74683L11.8268 8.92184C11.7122 9.14091 11.4929 9.30852 11.2552 9.35869C11.0123 9.40995 3.20786 9.41115 2.98224 9.35999C2.74243 9.30559 2.53297 9.14483 2.42553 8.93266L2.33236 8.74873V5.58961V2.43048L2.42553 2.24656C2.52985 2.04059 2.7435 1.87225 2.96604 1.82078C3.04208 1.80318 4.88581 1.78753 7.11882 1.78556C10.641 1.78245 11.1578 1.78873 11.3211 1.83643ZM17.3116 5.59366V7.28997L17.2309 7.23801C16.8358 6.98339 15.6936 6.30427 15.1359 5.99233C14.7573 5.78052 14.4468 5.5987 14.4461 5.5883C14.4453 5.57787 14.7874 5.37536 15.2062 5.13827C15.6251 4.90114 16.258 4.52634 16.6128 4.30536C16.9675 4.08438 17.2699 3.90215 17.2847 3.90045C17.2995 3.89876 17.3116 4.6607 17.3116 5.59366Z","fill","#FF7162"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.55139 4.23203C2.68754 4.45573 2.06855 5.0239 1.76664 5.87017L1.66602 6.15221V9.58961V13.027L1.76689 13.309C2.0535 14.1102 2.64038 14.6751 3.43987 14.9192L3.70863 15.0013H8.1343H12.56L12.8467 14.9053C13.6234 14.645 14.2099 14.0654 14.47 13.3012C14.56 13.0366 14.5637 12.9921 14.5769 12.031C14.5844 11.4832 14.6004 11.0351 14.6125 11.0351C14.661 11.0351 16.0857 11.8571 16.8518 12.3271C17.7188 12.8591 17.9126 12.9389 18.338 12.9389C19.0692 12.9389 19.7509 12.4087 19.947 11.6873C20.0174 11.4285 20.0165 7.7478 19.946 7.48726C19.7883 6.90449 19.278 6.40845 18.7016 6.27772C18.4483 6.22025 18.0895 6.2339 17.8373 6.31054C17.6848 6.35687 17.3699 6.52617 16.9107 6.80867C16.3288 7.16675 14.6405 8.14414 14.6039 8.14414C14.5979 8.14414 14.5847 7.71184 14.5747 7.18343C14.5543 6.10543 14.5363 5.99899 14.2916 5.50796C14.0166 4.95603 13.475 4.49479 12.8467 4.27719L12.56 4.17791L8.18806 4.17069C3.95948 4.16371 3.80747 4.16571 3.55139 4.23203ZM12.3211 5.83643C12.5404 5.90052 12.7306 6.05381 12.8398 6.25463L12.9183 6.399V9.57293V12.7468L12.8268 12.9218C12.7122 13.1409 12.4929 13.3085 12.2552 13.3587C12.0123 13.4099 4.20786 13.4111 3.98224 13.36C3.74243 13.3056 3.53297 13.1448 3.42553 12.9327L3.33236 12.7487V9.58961V6.43048L3.42553 6.24656C3.52985 6.04059 3.7435 5.87225 3.96604 5.82078C4.04208 5.80318 5.88581 5.78753 8.11882 5.78556C11.641 5.78245 12.1578 5.78873 12.3211 5.83643ZM18.3116 9.59366V11.29L18.2309 11.238C17.8358 10.9834 16.6936 10.3043 16.1359 9.99233C15.7573 9.78052 15.4468 9.5987 15.4461 9.5883C15.4453 9.57787 15.7874 9.37536 16.2062 9.13827C16.6251 8.90114 17.258 8.52634 17.6128 8.30536C17.9675 8.08438 18.2699 7.90215 18.2847 7.90045C18.2995 7.89876 18.3116 8.6607 18.3116 9.59366Z","fill","white"],["d","M4.69231 5.29805L6.9519 16.6605C7.26158 18.2178 9.31823 18.591 10.1553 17.2418L12.4275 13.5798C12.4611 13.5255 12.5143 13.4861 12.5761 13.4699L16.8289 12.3482C18.3433 11.9488 18.6107 9.91372 17.2509 9.13668L7.27695 3.4373C5.97394 2.69272 4.3996 3.82614 4.69231 5.29805Z","stroke","#E5E5E9","stroke-width","1.5","stroke-linecap","square"]],template:function(t,r){t&1&&u(0,xrn,2,1,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[X,ge],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}*[_ngcontent-%COMP%]{-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}*[_ngcontent-%COMP%]:not(svg *){height:unset;width:unset}.video-huddle-block[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%!important;height:100%!important;pointer-events:none!important}.video-huddle-block[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:20px!important;height:20px!important}.video-huddle-block[_ngcontent-%COMP%] .video-player-container[_ngcontent-%COMP%]{position:relative!important}.video-huddle-block[_ngcontent-%COMP%] .video-player-container[_ngcontent-%COMP%] .video-player-overlay[_ngcontent-%COMP%]{width:100%!important;height:100%!important;position:absolute!important;top:0!important;background:#56565670!important;border-radius:100%!important;display:none!important;flex-direction:column;justify-content:center;align-items:center}.video-huddle-block[_ngcontent-%COMP%] .video-player-container[_ngcontent-%COMP%] .video-player-overlay[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;color:#fff!important}.video-huddle-block[_ngcontent-%COMP%] .video-player-container[_ngcontent-%COMP%]:hover .video-player-overlay[_ngcontent-%COMP%], .video-huddle-block.video-off[_ngcontent-%COMP%] .user-profile-container[_ngcontent-%COMP%]{display:flex!important}.video-huddle-block.video-off[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{display:none!important}.video-huddle-block[_ngcontent-%COMP%] .user-profile-container[_ngcontent-%COMP%]{width:100%!important;height:100%!important;display:none!important;align-items:center!important;justify-content:center!important;background:#232323!important;border-radius:50%!important}.s-presence-avatar[_ngcontent-%COMP%]{position:relative!important;box-shadow:0 0 0 3px!important;border-radius:50%!important;overflow:hidden!important;width:100%!important;height:100%!important;min-width:100%!important;min-height:100%!important;display:flex!important;align-items:center!important;justify-content:center!important}.s-presence-avatar.more-users[_ngcontent-%COMP%]{background:#4578a7!important;box-shadow:0 0 0 3px #4578a7!important}.attendees-container[_ngcontent-%COMP%]{display:inline-flex!important;flex-direction:row-reverse!important;align-items:center!important;margin:0 16px 0 8px!important}.s-presence-avatar[_ngcontent-%COMP%]:not(:last-child):not(.more-users){margin-left:calc((-.5rem + 0px) * var(--velt-base-rem-unit))!important}.s-presence-avatar-image[_ngcontent-%COMP%]{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important}.s-presence-avatar-image-small[_ngcontent-%COMP%]{width:calc((1.6rem + 0px) * var(--velt-base-rem-unit))!important;height:100%!important;display:block!important;object-fit:cover!important}.s-presence-avatar-initial[_ngcontent-%COMP%]{color:#fff!important;font-size:calc((3rem + 0px) * var(--velt-base-rem-unit))!important}"],changeDetection:0});let i=o;return i})();var Drn=(i,o,n)=>({large:i,medium:o,small:n});function wrn(i,o){if(i&1){let n=K();y(0,"div",3),w(1,"video",4),y(2,"div",5)(3,"div",6),G("click",function(){N(n);let t=l(2);return F(t.onToggleScreenSharing())}),te(4),P(5,"translate"),b()()()}if(i&2){let n=l().ngIf;m(),d("srcObject",n.stream)("volume",0),m(3),ze(M(5,3,"Stop Sharing"))}}function Orn(i,o){if(i&1){let n=K();y(0,"div",7),w(1,"video",4),y(2,"div",5)(3,"div"),te(4),P(5,"translate"),b(),y(6,"div",8),ce(),y(7,"svg",9),G("click",function(){N(n);let t=l(2);return F(t.changeViewportSize("large"))}),w(8,"path",10)(9,"path",11),b(),y(10,"svg",12),G("click",function(){N(n);let t=l(2);return F(t.changeViewportSize("medium"))}),w(11,"path",13)(12,"path",14),b(),y(13,"svg",15),G("click",function(){N(n);let t=l(2);return F(t.changeViewportSize("small"))}),w(14,"path",16)(15,"path",17),b()()()()}if(i&2){let n=l().ngIf;d("ngClass",$e(13,Drn,n.viewportSize==="large",n.viewportSize==="medium",n.viewportSize==="small")),m(),d("srcObject",n.stream)("volume",0),m(3),br("",(n.user==null?null:n.user.name)||(n.user==null?null:n.user.email)," ",M(5,11,"is sharing now.")),m(3),pe("selected",n.viewportSize==="large"),m(3),pe("selected",n.viewportSize==="medium"),m(3),pe("selected",n.viewportSize==="small")}}function Arn(i,o){if(i&1&&(v(0),u(1,wrn,6,5,"div",1)(2,Orn,16,17,"div",2),C()),i&2){let n=o.ngIf;m(),d("ngIf",n.stream&&!n.isRemoteStream),m(),d("ngIf",n.stream&&n.isRemoteStream)}}var fye=(()=>{let o=class o{constructor(e){this.loggingService=e,this.isRemoteStream=!1,this.toggleScreenSharing=new Me,this.viewportSizeChange=new Me,this.veltElement=!0,this.componentConfigSignal=Te({stream:this.stream,isRemoteStream:this.isRemoteStream,viewportSize:"small",user:this.user})}ngOnChanges(e){try{this.loggingService.log("%c[WB] Calling ScreenSharingHuddleComponent FUNCTION: ngOnChanges","color: green;"),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(E({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in ScreenSharingHuddleComponent ngOnChanges: ",t)}}changeViewportSize(e){this.componentConfigSignal.update(t=>D(E({},t),{viewportSize:e})),this.viewportSizeChange.emit(this.componentConfigSignal().viewportSize)}onToggleScreenSharing(){this.toggleScreenSharing.emit()}};o.\u0275fac=function(t){return new(t||o)(h(_))},o.\u0275cmp=O({type:o,selectors:[["snippyly-screen-sharing-huddle"]],hostVars:1,hostBindings:function(t,r){t&2&&T("data-velt-element",r.veltElement)},inputs:{user:"user",stream:"stream",isRemoteStream:"isRemoteStream"},outputs:{toggleScreenSharing:"toggleScreenSharing",viewportSizeChange:"viewportSizeChange"},standalone:!1,features:[Qe],decls:1,vars:1,consts:[[4,"ngIf"],["class","screen-sharing-container local-screen-sharing-container",4,"ngIf"],["class","screen-sharing-container remote-screen-sharing-container",3,"ngClass",4,"ngIf"],[1,"screen-sharing-container","local-screen-sharing-container"],["autoplay","","muted","true","playsinline","",3,"srcObject","volume"],[1,"screen-sharing-overlay"],[1,"stop-sharing-btn",3,"click"],[1,"screen-sharing-container","remote-screen-sharing-container",3,"ngClass"],[1,"screen-sharing-resize-container"],["width","21","height","20","viewBox","0 0 21 20","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M18.0006 2.5H3.00065C2.08018 2.5 1.33398 3.24619 1.33398 4.16667V13.3333C1.33398 14.2538 2.08018 15 3.00065 15H5.06885C5.33962 15 5.59351 14.8684 5.74966 14.6472L8.45823 10.8101C9.45427 9.39904 11.547 9.39904 12.5431 10.8101L15.2516 14.6472C15.4078 14.8684 15.6617 15 15.9324 15H18.0006C18.9211 15 19.6673 14.2538 19.6673 13.3333V4.16667C19.6673 3.24619 18.9211 2.5 18.0006 2.5Z"],["d","M6.50021 16.1684L9.83354 11.724C10.1669 11.2795 10.8335 11.2795 11.1669 11.724L14.5002 16.1684C14.9122 16.7178 14.5202 17.5017 13.8335 17.5017H7.16688C6.48017 17.5017 6.08819 16.7178 6.50021 16.1684Z"],["width","15","height","12","viewBox","0 0 15 12","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M13.6364 0.167969H1.36364C0.610521 0.167969 0 0.748339 0 1.46426V8.59387C0 9.3098 0.610521 9.89017 1.36364 9.89017H3.0558C3.27734 9.89017 3.48507 9.78785 3.61283 9.61579L5.82893 6.63136C6.64387 5.53387 8.35613 5.53387 9.17107 6.63136L11.3872 9.61579C11.5149 9.78785 11.7227 9.89017 11.9442 9.89017H13.6364C14.3895 9.89017 15 9.3098 15 8.59387V1.46426C15 0.748339 14.3895 0.167969 13.6364 0.167969Z"],["d","M4.22745 10.7981L6.95472 7.34129C7.22745 6.99561 7.7729 6.99561 8.04563 7.34129L10.7729 10.7981C11.11 11.2254 10.7893 11.8351 10.2274 11.8351H4.7729C4.21105 11.8351 3.89034 11.2254 4.22745 10.7981Z"],["width","11","height","10","viewBox","0 0 11 10","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M9.59091 0.832031H1.40909C0.907014 0.832031 0.5 1.24658 0.5 1.75795V6.85053C0.5 7.36191 0.907014 7.77646 1.40909 7.77646H2.5372C2.68489 7.77646 2.82338 7.70337 2.90855 7.58048L4.38595 5.44874C4.92925 4.66482 6.07075 4.66482 6.61405 5.44874L8.09145 7.58048C8.17662 7.70337 8.31511 7.77646 8.4628 7.77646H9.59091C10.093 7.77646 10.5 7.36191 10.5 6.85053V1.75795C10.5 1.24658 10.093 0.832031 9.59091 0.832031Z"],["d","M3.3183 8.42384L5.13648 5.95472C5.3183 5.7078 5.68193 5.7078 5.86375 5.95472L7.68193 8.42384C7.90667 8.72905 7.69286 9.16458 7.3183 9.16458H3.68193C3.30737 9.16458 3.09356 8.72905 3.3183 8.42384Z"]],template:function(t,r){t&1&&u(0,Arn,3,2,"ng-container",0),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Qr,X,ge],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}*[_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;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}*[_ngcontent-%COMP%]:not(svg *){height:unset;width:unset}[_nghost-%COMP%]{position:fixed;bottom:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;right:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;z-index:2147483607!important}.screen-sharing-container.local-screen-sharing-container[_ngcontent-%COMP%]{width:326px!important;height:216px!important;padding:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;background:#fff!important;box-shadow:0 1px 4px #00000029!important;border-radius:20px!important;position:relative!important;overflow:hidden!important}.screen-sharing-container.local-screen-sharing-container[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{color:#fff!important}.screen-sharing-container.local-screen-sharing-container[_ngcontent-%COMP%] .screen-sharing-overlay[_ngcontent-%COMP%]{position:absolute!important;width:100%!important;height:100%!important;top:0!important;background:#fff!important;display:none!important;align-items:center;justify-content:center;color:#fff!important;background:#000000b3!important;left:0!important;font-size:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important}.screen-sharing-container.local-screen-sharing-container[_ngcontent-%COMP%]:hover .screen-sharing-overlay[_ngcontent-%COMP%]{display:flex!important}.screen-sharing-container.local-screen-sharing-container[_ngcontent-%COMP%] .stop-sharing-btn[_ngcontent-%COMP%]{cursor:pointer!important}.screen-sharing-container.remote-screen-sharing-container[_ngcontent-%COMP%]{width:30vw!important;height:20vh!important;padding:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;background:#fff!important;box-shadow:0 1px 4px #00000029!important;border-radius:20px!important;position:relative!important;overflow:hidden!important;transition:width .2s ease-in-out,height .2s ease-in-out}.screen-sharing-container.remote-screen-sharing-container[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{color:#fff!important;text-align:center!important}.screen-sharing-container.remote-screen-sharing-container[_ngcontent-%COMP%] .screen-sharing-overlay[_ngcontent-%COMP%]{position:absolute!important;width:100%!important;height:100%!important;top:0!important;background:#fff!important;display:none!important;align-items:center;justify-content:center;color:#fff!important;background:#000000b3!important;left:0!important;font-size:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;flex-direction:column}.screen-sharing-container.remote-screen-sharing-container[_ngcontent-%COMP%] .screen-sharing-overlay[_ngcontent-%COMP%] .screen-sharing-resize-container[_ngcontent-%COMP%]{margin-top:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;background:#000;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;display:flex!important;align-items:center;justify-content:center}.screen-sharing-container.remote-screen-sharing-container[_ngcontent-%COMP%] .screen-sharing-overlay[_ngcontent-%COMP%] .screen-sharing-resize-container[_ngcontent-%COMP%] > svg[_ngcontent-%COMP%]{margin:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;cursor:pointer!important;fill:#b1b5c4!important}.screen-sharing-container.remote-screen-sharing-container[_ngcontent-%COMP%] .screen-sharing-overlay[_ngcontent-%COMP%] .screen-sharing-resize-container[_ngcontent-%COMP%] > svg.selected[_ngcontent-%COMP%]{fill:#fff!important}.screen-sharing-container.remote-screen-sharing-container[_ngcontent-%COMP%]:hover .screen-sharing-overlay[_ngcontent-%COMP%]{display:flex!important}.screen-sharing-container.remote-screen-sharing-container.medium[_ngcontent-%COMP%]{width:60vw!important;height:60vh!important}.screen-sharing-container.remote-screen-sharing-container.large[_ngcontent-%COMP%]{width:calc(100vw - 5rem)!important;height:calc(100vh - 5rem)!important}video[_ngcontent-%COMP%]{width:100%!important;height:100%!important;border-radius:8px!important}"],changeDetection:0});let i=o;return i})();var wu=(()=>{let o=class o{constructor(e){this.translateService=e}transform(e,...t){try{let a=(new Date().getTime()-new Date(e).getTime())/1e3;if(a<1)return this.translateService.translate("now");let s={y:31536e3,mo:2592e3,w:604800,d:86400,h:3600,m:60,s:1};for(let c in s){let p=Math.floor(a/s[c]);if(p>0)return`${p}${this.translateService.translate(c)}`}return e}catch{return e}}};o.\u0275fac=function(t){return new(t||o)(h(Ll,16))},o.\u0275pipe=ji({name:"timeAgo",type:o,pure:!0,standalone:!1});let i=o;return i})();var Ou=(()=>{let o=class o{constructor(e,t){this.domService=e,this.sanitizer=t}transform(e,t=!0){try{let r=t?this.domService.sanitizeHtml(e):e;return this.sanitizer.bypassSecurityTrustHtml(r)}catch{return e}}};o.\u0275fac=function(t){return new(t||o)(h(Ve,16),h(vl,16))},o.\u0275pipe=ji({name:"safeHtml",type:o,pure:!0,standalone:!1});let i=o;return i})();function Mrn(i,o){if(i&1&&(y(0,"div",21),te(1),P(2,"translate"),P(3,"translate"),b()),i&2){let n=l().$implicit,e=l().ngIf;m(),Se(" ",(n==null||n.from==null?null:n.from.userId)===(e.user==null?null:e.user.userId)?M(2,1,"Me"):M(3,3,(n==null||n.from==null?null:n.from.name)||(n==null||n.from==null?null:n.from.email))," ")}}function krn(i,o){i&1&&w(0,"velt-skeleton-loader-internal",22)}function Rrn(i,o){if(i&1&&(v(0),y(1,"div",15),w(2,"snippyly-user-avatar",16),y(3,"div",17),u(4,Mrn,4,5,"div",18)(5,krn,1,0,"ng-template",null,1,Ee),y(7,"div",19),te(8),P(9,"timeAgo"),b(),w(10,"div",20),P(11,"translate"),P(12,"safeHtml"),b()(),C()),i&2){let n=o.$implicit,e=me(6),t=l().ngIf;m(2),d("user",n==null?null:n.from),m(2),d("ngIf",(n==null||n.from==null?null:n.from.userId)===(t.user==null?null:t.user.userId)||(n==null||n.from==null?null:n.from.name)||(n==null||n.from==null?null:n.from.email))("ngIfElse",e),m(4),ze(M(9,5,n==null?null:n.timestamp)),m(2),d("innerHTML",M(12,9,M(11,7,(n==null?null:n.message)||"")),Ji)}}function Nrn(i,o){if(i&1){let n=K();v(0),y(1,"div",3)(2,"div",4,0)(4,"div",5)(5,"div"),te(6),P(7,"translate"),b(),y(8,"div"),ce(),y(9,"svg",6),G("click",function(){N(n);let t=l();return F(t.toggleMessagesPanel())}),w(10,"path",7),b()()(),ft(),y(11,"div",8),u(12,Rrn,13,11,"ng-container",9),b(),y(13,"div",10)(14,"textarea",11),P(15,"translate"),Rr("ngModelChange",function(t){let r=N(n).ngIf;return Xr(r.message,t)||(r.message=t),F(t)}),G("keydown.enter",function(t){N(n);let r=l();return t.preventDefault(),F(r.sendMessage())}),b(),y(16,"button",12),G("click",function(){N(n);let t=l();return F(t.sendMessage())}),ce(),y(17,"svg",13),w(18,"path",14),b()()()()(),C()}if(i&2){let n=o.ngIf,e=l();m(),pe("visible",n.messagesPanelVisible)("mobile",n.isPhone),m(5),ze(M(7,11,"In-call messages")),m(6),d("ngForOf",n.messages)("ngForTrackBy",e.trackByMessageId),m(2),d("placeholder",nS(M(15,13,"Type here..."))),kr("ngModel",n.message),m(2),d("disabled",!(n.message!=null&&n.message.trim()))}}var _ye=(()=>{let o=class o{constructor(e,t,r,a){this.authService=e,this.huddleService=t,this.loggingService=r,this.breakpointObserver=a,this.subscriptions=[],this.componentConfigSignal=Te({isPhone:!1,user:null,messages:[],message:"",messagesPanelVisible:!1});try{this.loggingService.log("%c[WB] Creating CLASS: HuddleMessagesPanelComponent","color: blue;"),this.subscriptions.push(this.huddleService.getMessages$().subscribe(s=>{s.sort((c,p)=>c?.timestamp-p?.timestamp),this.componentConfigSignal.update(c=>D(E({},c),{messages:s}))})),this.subscriptions.push(this.huddleService.getMessagesPanelVisible$().subscribe(s=>{this.componentConfigSignal.update(c=>D(E({},c),{messagesPanelVisible:s}))})),this.subscriptions.push(this.authService.getUser$().subscribe(s=>{this.componentConfigSignal.update(c=>D(E({},c),{user:s}))})),this.subscriptions.push(this.breakpointObserver.observe(zi.XSmall).subscribe(s=>{s.matches?this.componentConfigSignal.update(c=>D(E({},c),{isPhone:!0})):this.componentConfigSignal.update(c=>D(E({},c),{isPhone:!1}))},s=>{this.loggingService.catch("Error in HuddleMessagesPanelComponent breakpointObserver subscription: ",s)}))}catch(s){this.loggingService.catch("Error in HuddleMessagesPanelComponent constructor: ",s)}}ngOnInit(){}trackByMessageId(e,t){return t.id||e}highlightLinks(e){this.loggingService.log("%c[WB] Calling FUNCTION: highlightLinks","color: green;");try{return e&&(e=e?.replaceAll("&","&")),e.replaceAll(U.REGEX_URL,r=>new RegExp(U.REGEX_EMAIL).test("@"+r)?r:`<a class="message-link" href="${r}" target="_blank">${r}</a>`)}catch(t){return this.loggingService.catch("Error in HuddleMessagesPanelComponent highlightLinks: ",t),""}}sendMessage(){this.loggingService.log("%c[WB] Calling FUNCTION: sendMessage","color: green;");try{let e=this.componentConfigSignal().message?.trim();if(!e)return;e=this.highlightLinks(e),this.huddleService.sendMessage(e),this.componentConfigSignal.update(t=>D(E({},t),{message:""}))}catch(e){this.loggingService.catch("Error in HuddleMessagesPanelComponent sendMessage: ",e)}}toggleMessagesPanel(){try{this.loggingService.log("%c[WB] Calling FUNCTION: toggleMessagesPanel","color: green;"),this.huddleService.toggleMessagesPanel()}catch(e){this.loggingService.catch("Error in HuddleMessagesPanelComponent toggleMessagesPanel: ",e)}}ngOnDestroy(){try{this.loggingService.log("%c[WB] Calling FUNCTION: onDestroy","color: green;"),this.subscriptions.forEach(e=>e.unsubscribe())}catch(e){this.loggingService.catch("Error in HuddleMessagesPanelComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(je),h(Or),h(_),h(Oo))},o.\u0275cmp=O({type:o,selectors:[["velt-huddle-messages-panel-internal"]],standalone:!1,decls:1,vars:1,consts:[["sidebarRef",""],["loadingTemplateRef",""],[4,"ngIf"],["part","container","data-velt-element","true","data-velt-comment-disabled","true",1,"s-sidebar-container"],[1,"s-sidebar"],[1,"v-huddle-messages-header"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"v-huddle-message-panel-close-btn",3,"click"],["fill-rule","evenodd","clip-rule","evenodd","d","M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z","fill","#777E91"],[1,"v-huddle-messages-container"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"v-huddle-message-box-container"],["name","message","rows","1",1,"v-huddle-message-box-input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],[1,"v-huddle-message-box-send-btn",3,"click","disabled"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["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","#777E90"],[1,"v-huddle-message-block"],[3,"user"],[1,"v-huddle-message-block-right"],["class","v-huddle-message-block-user",4,"ngIf","ngIfElse"],[1,"v-huddle-message-block-time"],[1,"v-huddle-message-block-message",3,"innerHTML"],[1,"v-huddle-message-block-user"],["height","20px","width","80px","borderRadius","20px"]],template:function(t,r){t&1&&u(0,Nrn,19,15,"ng-container",2),t&2&&d("ngIf",r.componentConfigSignal())},dependencies:[Et,X,Ra,xs,ns,Jn,Xo,wu,Ou,ge],styles:[`html{--velt-base-rem-unit: 1}*[data-snippyly-element=true],*[data-velt-element=true]{font-family:var(--velt-default-font-family)}velt-wireframe{display:none!important}:host{--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-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)}:host[dark]{--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-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)}.s-sidebar-container{height:100vh;width:calc((22rem + 0px) * var(--velt-base-rem-unit));position:fixed;top:0;right:-100%;padding:calc((1rem + 0px) * var(--velt-base-rem-unit));box-sizing:border-box;z-index:999999997;transition:width .5s ease-in-out,right .5s ease-in-out}.s-sidebar-container.mobile{width:100%!important;height:100%!important;box-sizing:border-box!important;-webkit-backdrop-filter:blur(2px)!important;backdrop-filter:blur(2px)!important}.s-sidebar-container.visible{right:0}.s-sidebar-container .s-sidebar{background:var(--velt-background-0);padding:calc((1rem + 0px) * var(--velt-base-rem-unit));border-radius:var(--velt-border-radius-lg);width:100%;overflow-x:hidden;box-sizing:border-box;position:relative;height:100%;border:1px solid var(--velt-border-5);display:flex;flex-direction:column;justify-content:space-between;gap:calc((.5rem + 0px) * var(--velt-base-rem-unit))}.s-sidebar-container .s-sidebar::-webkit-scrollbar{display:none;width:0;height:0}.s-sidebar-container .s-sidebar:not(.s-overflow-hidden){overflow-y:auto}.s-sidebar-container .v-huddle-message-panel-close-btn{cursor:pointer}.s-sidebar-container .v-huddle-messages-header{display:flex;justify-content:space-between}.s-sidebar-container .v-huddle-messages-container{overflow:auto;flex-grow:1}.s-sidebar-container .v-huddle-messages-container::-webkit-scrollbar{display:none;width:0;height:0}.s-sidebar-container .v-huddle-message-block{display:flex;gap:calc((1rem + 0px) * var(--velt-base-rem-unit));margin-bottom:calc((1rem + 0px) * var(--velt-base-rem-unit))}.s-sidebar-container .v-huddle-message-block .v-huddle-message-block-time{font-size:calc((.5rem + 0px) * var(--velt-base-rem-unit));color:gray;margin-bottom:calc((.25rem + 0px) * var(--velt-base-rem-unit))}.s-sidebar-container .v-huddle-message-block .v-huddle-message-block-message{font-size:calc((.75rem + 0px) * var(--velt-base-rem-unit));word-break:break-word;white-space:pre-wrap}.s-sidebar-container .v-huddle-message-box-container{display:flex;gap:calc((1rem + 0px) * var(--velt-base-rem-unit));align-items:center}.s-sidebar-container .v-huddle-message-box-container .v-huddle-message-box-input{padding:calc((.75rem + 0px) * var(--velt-base-rem-unit));border-radius:8px;border:0;outline:0;background:#f7f7f7;flex-grow:1;font-family:var(--velt-default-font-family);resize:none}.s-sidebar-container .v-huddle-message-box-container .v-huddle-message-box-send-btn{background:transparent;border:0;outline:0;border-radius:100%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer;opacity:1}.s-sidebar-container .v-huddle-message-box-container .v-huddle-message-box-send-btn[disabled]{opacity:.5;cursor:not-allowed}
|