@veltdev/sdk-staging 6.0.12 → 6.0.14-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/app/models/data/config.data.model.d.ts +18 -0
  2. package/app/models/data/user.data.model.d.ts +13 -0
  3. package/app/models/element/activity-element.model.d.ts +9 -0
  4. package/app/models/element/autocomplete-element.model.d.ts +10 -0
  5. package/app/models/element/comment-element.model.d.ts +72 -0
  6. package/app/models/element/notification-element.model.d.ts +17 -0
  7. package/app/utils/constants.d.ts +1 -0
  8. package/{chunk-4RMON7GG.js → chunk-2HGCWC7B.js} +1 -1
  9. package/chunk-2KTYC2AG.js +1 -0
  10. package/chunk-3AL5S762.js +1 -0
  11. package/chunk-45X5JRZ6.js +2 -0
  12. package/chunk-6NWFM6PC.js +1 -0
  13. package/chunk-77FADRSO.js +1 -0
  14. package/chunk-7TFVNMHJ.js +2 -0
  15. package/{chunk-BVT5OSMI.js → chunk-C5JOX4MX.js} +1 -1
  16. package/{chunk-KTSX5UPA.js → chunk-DFEL6HM7.js} +1 -1
  17. package/{chunk-MUYDAXFY.js → chunk-DZYXTTOX.js} +1 -1
  18. package/chunk-FZSZ6AV3.js +1 -0
  19. package/chunk-GULBDPIM.js +2 -0
  20. package/{chunk-FDTMKWPR.js → chunk-HRCWTVRH.js} +2 -2
  21. package/chunk-HWS7Y4LE.js +1 -0
  22. package/chunk-I63T4QWP.js +6 -0
  23. package/{chunk-UI5F5IQU.js → chunk-IMH5OESK.js} +1 -1
  24. package/chunk-IQ22I2I3.js +1 -0
  25. package/{chunk-UW45SPLT.js → chunk-KNQJBBQA.js} +1 -1
  26. package/chunk-KQPNTB77.js +1 -0
  27. package/chunk-KWLMOL5X.js +193 -0
  28. package/chunk-L4QMAEKA.js +1 -0
  29. package/chunk-MRY4A7N6.js +1 -0
  30. package/{chunk-7WO33FST.js → chunk-NMPXJFDX.js} +1 -1
  31. package/chunk-O3FUWWWQ.js +1 -0
  32. package/{chunk-2TTZAEAX.js → chunk-PWTBCAPJ.js} +1 -1
  33. package/chunk-TQNLXTQA.js +2 -0
  34. package/chunk-UI2CRSTN.js +1 -0
  35. package/{chunk-S5R4NUEK.js → chunk-UVKIGEOH.js} +1 -1
  36. package/{chunk-JNSX6ALY.js → chunk-VJLHHQ2Z.js} +1 -1
  37. package/chunk-VW5ND7U4.js +93 -0
  38. package/{chunk-5QRNDPMH.js → chunk-WMDZMDJS.js} +1 -1
  39. package/chunk-YFBAHLK6.js +174 -0
  40. package/chunk-YO4HNOAN.js +1 -0
  41. package/chunk-ZHXLO4CC.js +1 -0
  42. package/package.json +1 -1
  43. package/velt-activity-log.js +1 -1
  44. package/velt-area.js +1 -1
  45. package/velt-arrow.js +2 -2
  46. package/velt-comment.js +7 -7
  47. package/velt-crdt.js +1 -1
  48. package/velt-cursor.js +2 -2
  49. package/velt-huddle.js +2 -2
  50. package/velt-live-state-sync.js +2 -2
  51. package/velt-notification.js +1 -1
  52. package/velt-portable.js +1 -0
  53. package/velt-presence.js +1 -1
  54. package/velt-reaction.js +1 -1
  55. package/velt-recorder.js +1 -1
  56. package/velt-rewriter.js +2 -2
  57. package/velt-selection.js +1 -1
  58. package/velt-tag.js +1 -1
  59. package/velt-user-invite.js +2 -2
  60. package/velt-user-request.js +1 -1
  61. package/velt-video-player.js +1 -1
  62. package/velt-views.js +3 -3
  63. package/velt.js +6 -6
  64. package/chunk-3KTIE7HV.js +0 -2
  65. package/chunk-3T4C47NJ.js +0 -1
  66. package/chunk-6IT34HSZ.js +0 -1
  67. package/chunk-6YWJCXYF.js +0 -1
  68. package/chunk-A4JS2VN5.js +0 -1
  69. package/chunk-BONBMEV3.js +0 -1
  70. package/chunk-ELF6PPR2.js +0 -2
  71. package/chunk-FC5NQAL4.js +0 -2
  72. package/chunk-JWWUK2VE.js +0 -1
  73. package/chunk-KQMIVRAC.js +0 -1
  74. package/chunk-L7ZARA4D.js +0 -193
  75. package/chunk-LAPY2IGZ.js +0 -1
  76. package/chunk-MJ2UHGNE.js +0 -1
  77. package/chunk-NSNHSRHX.js +0 -1
  78. package/chunk-O7XCI74W.js +0 -1
  79. package/chunk-ORPUXE2Y.js +0 -93
  80. package/chunk-QT7Z7KCA.js +0 -1
  81. package/chunk-SGVDVSBF.js +0 -1
  82. package/chunk-UKSG7LZP.js +0 -2
  83. package/chunk-WASG3GA7.js +0 -6
  84. package/chunk-Z3CHFM5M.js +0 -167
@@ -1 +1 @@
1
- import{Ee as h,Wd as c}from"./chunk-Z3CHFM5M.js";var d=(t,r)=>{try{let e=l(t),i=[],n=[];return e.forEach(o=>{o?.parentElement?.closest(h.TAGS.SNIPPYLY_TEXT_HIGHLIGHT)?o?.parentElement?.normalize():n.push(o)}),n.forEach(o=>{let s=a(o,r);s&&i.push(s)}),i}catch(e){return c.catch("Error in highlighter highlightRange: ",e),[]}},l=t=>{try{if(t.collapsed)return[];let r=t.commonAncestorContainer;if(t.commonAncestorContainer.nodeType!==Node.ELEMENT_NODE&&(r=t.commonAncestorContainer.parentElement),!r)return[];let e=[],i=r.ownerDocument.createNodeIterator(r,NodeFilter.SHOW_TEXT),n,o=!1;for(;n=i.nextNode();)if(t.intersectsNode(n)){let s=n?.length;t.startContainer===n&&t.startOffset>0&&(n.splitText(t.startOffset),o=!0),t.endContainer===n&&t.endOffset<s&&n.splitText(t.endOffset),e.push(n)}return o&&e.shift(),e}catch(r){return c.catch("Error in highlighter getTextNodesInRange: ",r),[]}},a=(t,r)=>{try{let e=document.createElement(r||h.TAGS.SNIPPYLY_TEXT_HIGHLIGHT);return t.parentElement?.replaceChild(e,t),e.appendChild(t),e}catch(e){return c.catch("Error in highlighter highlightNode: ",e),null}};export{d as a};
1
+ import{He as h,Yd as c}from"./chunk-YFBAHLK6.js";var d=(t,r)=>{try{let e=l(t),i=[],n=[];return e.forEach(o=>{o?.parentElement?.closest(h.TAGS.SNIPPYLY_TEXT_HIGHLIGHT)?o?.parentElement?.normalize():n.push(o)}),n.forEach(o=>{let s=a(o,r);s&&i.push(s)}),i}catch(e){return c.catch("Error in highlighter highlightRange: ",e),[]}},l=t=>{try{if(t.collapsed)return[];let r=t.commonAncestorContainer;if(t.commonAncestorContainer.nodeType!==Node.ELEMENT_NODE&&(r=t.commonAncestorContainer.parentElement),!r)return[];let e=[],i=r.ownerDocument.createNodeIterator(r,NodeFilter.SHOW_TEXT),n,o=!1;for(;n=i.nextNode();)if(t.intersectsNode(n)){let s=n?.length;t.startContainer===n&&t.startOffset>0&&(n.splitText(t.startOffset),o=!0),t.endContainer===n&&t.endOffset<s&&n.splitText(t.endOffset),e.push(n)}return o&&e.shift(),e}catch(r){return c.catch("Error in highlighter getTextNodesInRange: ",r),[]}},a=(t,r)=>{try{let e=document.createElement(r||h.TAGS.SNIPPYLY_TEXT_HIGHLIGHT);return t.parentElement?.replaceChild(e,t),e.appendChild(t),e}catch(e){return c.catch("Error in highlighter highlightNode: ",e),null}};export{d as a};
@@ -0,0 +1 @@
1
+ import{a as Ft,b as Qe}from"./chunk-YO4HNOAN.js";import{b as qe}from"./chunk-GULBDPIM.js";import{Fa as xt,Ga as b,Ha as Zt,Ia as ct,Ja as Ze,L as Ee,M as Tt,N as Te,O as Ae,P as Me,R as Xt,S as Pe,T as Fe,U as Re,V as At,W as je,Z as Ue,fa as Ne,ha as Ve,ia as ae,ja as Le}from"./chunk-I63T4QWP.js";import{e as Xe}from"./chunk-MRY4A7N6.js";import{Bb as l,Bi as ht,Ca as Gt,Ci as We,Dc as we,Ea as Ht,Ha as u,He as ze,Kb as W,M as $t,Mb as Et,Mf as Be,N as _e,Na as Wt,Pb as U,Q as be,Qb as _t,Ra as I,Rb as X,Rh as lt,Ri as Mt,Sb as Yt,Ta as Jt,Ti as N,Uh as Ge,Ui as Je,V as ut,W as xe,Wa as P,Ya as Kt,Yf as $e,_a as j,a as m,ab as v,ac as F,b as f,ba as nt,c as ue,cc as Nt,ci as He,da as Se,db as ke,dc as R,ea as H,ec as O,ee as le,fa as Q,fb as M,fc as rt,g as gt,gc as bt,ha as ye,hb as w,hc as z,i as he,ib as E,ic as Ie,ja as yt,jc as Oe,k as It,ka as kt,l as zt,la as mt,m as fe,mc as V,na as it,nb as p,nc as L,ob as x,p as St,pb as k,qb as Y,r as Ot,ra as ot,rc as J,sa as A,tc as re,ub as S,uc as at,uj as Ke,v as Ce,vb as y,vc as pt,w as Bt,wb as B,wj as Ye,xb as Dt,xc as ie,xj as Pt,ya as tt,zb as wt,zc as De}from"./chunk-YFBAHLK6.js";var tn=(()=>{let r=class r{constructor(t){this.loggingService=t,this.autocompleteDataMap$=new zt({}),this.onAutocompleteChipClick$=new It;try{this.loggingService.log("%c[WB] Creating CLASS: AutocompleteService","color: blue;"),this.create({hotkey:"@",type:"contact",data:[]})}catch(e){this.loggingService.catch("Error in AutocompleteService constructor: ",e)}}create(t){try{if(this.loggingService.log("%c[WB] Calling AutocompleteService FUNCTION: create","color: green;"),t?.hotkey){let e=this.autocompleteDataMap$.value;e[t.hotkey]=t,this.autocompleteDataMap$.next(e)}}catch(e){this.loggingService.catch("Error in AutocompleteService create: ",e)}}remove(t){try{this.loggingService.log("%c[WB] Calling AutocompleteService FUNCTION: remove","color: green;");let e=this.autocompleteDataMap$.value;delete e[t],this.autocompleteDataMap$.next(e)}catch(e){this.loggingService.catch("Error in AutocompleteService remove: ",e)}}getAutocompleteDataMap$(){return this.autocompleteDataMap$.asObservable()}getAutocompleteDataMap(){return this.autocompleteDataMap$.value}setOnAutocompleteChipClick(t){this.onAutocompleteChipClick$.next(t)}getOnAutocompleteChipClick$(){return this.onAutocompleteChipClick$.asObservable()}};r.\u0275fac=function(e){return new(e||r)(H(N))},r.\u0275prov=nt({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var en=(()=>{let r=class r{constructor(t,e,i,a){this.docService=t,this.loggingService=e,this.authService=i,this.configService=a;try{this.loggingService.log("%c[WB] Creating CLASS: MetadataService","color: blue;")}catch(c){this.loggingService.catch("Error in MetadataService constructor: ",c)}}getGlobalMetadata(){return gt(this,null,function*(){try{let t=this.authService.getUser();if(!t)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),{};let e=this.docService.getOrganizationMetadata(t?.organizationId),i=this.docService.getDocumentMetadataOfAvailableDocuments(),a=this.docService.getLocation();e&&(e=JSON.parse(JSON.stringify(e)),delete e?.organizationId,e.organizationId=e?.clientOrganizationId,delete e?.clientOrganizationId,delete e?.pageInfo),i&&(i=JSON.parse(JSON.stringify(i)),i.forEach(g=>{delete g?.locations,delete g?.location,delete g?.locationId,delete g?.pageInfo,delete g?.documentId,g.documentId=g?.clientDocumentId,delete g?.clientDocumentId,delete g?.veltFolderId,g?.clientOrganizationId&&(g.organizationId=g?.clientOrganizationId,delete g?.clientOrganizationId)}));let c=[];a&&(a=JSON.parse(JSON.stringify(a)),a?.location&&c.push(a?.location));let d=this.docService.getLocations();d&&Object.values(d).forEach(g=>{g?.location&&c.push(g?.location)});let s=this.docService.getDocumentPaths()?.folderId;return{organization:e,documents:i,locations:c,folderId:s}}catch(t){return this.loggingService.catch("Error in MetadataService getGlobalMetadata: ",t),{}}})}getDebugInfo(){return gt(this,null,function*(){try{let t=this.authService.getUser();if(!t)return null;let e,i;t&&(e=He(t)??void 0,i=JSON.parse(JSON.stringify(t)),delete i?.contacts);let a=this.configService.getApiKey(),c=window?.Velt?.version,d=this.docService.getOrganizationMetadata(t?.organizationId),s,h;d&&(s=JSON.parse(JSON.stringify(d)),delete s?.organizationId,s.organizationId=s?.clientOrganizationId,delete s?.clientOrganizationId,delete s?.pageInfo,delete s?.apiKey,h=JSON.parse(JSON.stringify(d)),delete h?.clientOrganizationId,delete h?.pageInfo,delete h?.apiKey);let g=this.docService.getDocumentMetadataOfAvailableDocuments(),T=this.docService.getLocation(),D=[],_=[];T&&(D.push(T),T?.location&&_.push(T?.location));let C=this.docService.getLocations();C&&Object.values(C).forEach(G=>{D.push(G),G?.location&&_.push(G?.location)});let $=[],Z=[];g&&($=JSON.parse(JSON.stringify(g)),$.forEach(G=>{delete G?.apiKey,delete G?.locations,delete G?.location,delete G?.locationId,delete G?.pageInfo,delete G?.documentId,G.documentId=G?.clientDocumentId,delete G?.clientDocumentId,delete G?.veltFolderId,G?.clientOrganizationId&&(G.organizationId=G?.clientOrganizationId,delete G?.clientOrganizationId)}),Z=JSON.parse(JSON.stringify(g)),Z.forEach(G=>{delete G?.apiKey,delete G?.locations,delete G?.location,delete G?.locationId,delete G?.pageInfo,delete G?.clientDocumentId,G.folderId=G?.veltFolderId,delete G?.veltFolderId,delete G?.clientOrganizationId}));let dt,Lt=this.docService.getDocumentPaths();Lt?.folderId&&Lt?.veltFolderId&&(dt={folderId:Lt?.folderId,veltFolderId:Lt?.veltFolderId});let oe,jt;dt&&(oe=JSON.parse(JSON.stringify(dt)),delete oe?.veltFolderId,jt=JSON.parse(JSON.stringify(dt)),jt.folderId=jt.veltFolderId,delete jt?.veltFolderId);let Ut={};return Ut.veltVersion=c,Ut.apiKey=a,Ut.serverMap={organization:h??void 0,documents:Z,locations:D??void 0,folder:jt??void 0,user:i??void 0,accessFields:this.docService.getProcessedDocContext()??void 0},Ut.clientMap={organization:s??void 0,documents:$,locations:_??void 0,folder:oe??void 0,user:e??void 0,context:this.docService.getDocContext()??void 0},Ut}catch(t){return this.loggingService.catch("Error in MetadataService getDebugInfo: ",t),null}})}getDebugInfo$(){return Bt([this.authService.getUser$(),this.docService.getOrganizationConfig$(),this.docService.getOrganizationMetadataMap$(),this.docService.getAllDocumentMetadataMap$(),this.docService.getDocContext$()]).pipe(ut(()=>gt(this,null,function*(){return yield this.getDebugInfo()})),$t(Ge))}};r.\u0275fac=function(e){return new(e||r)(H(Xe),H(N),H(Pt),H(Je))},r.\u0275prov=nt({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var qt=class n{static forContextMap(r,o){return new n(r,t=>Ln(o,t))}constructor(r,o){this.injector=r,this.readSignal=o,this.cache=new Map,this.structureVersion=A(0)}bumpStructureVersion(){try{this.structureVersion.update(r=>r+1)}catch{}}get(r,o){try{if(!r||!this.injector)return Ot(null);let t=this.cache.get(r);if(t)return t;let e=this.buildStream(r,o);return this.cache.set(r,e),e}catch{return Ot(null)}}getForContext(r,o,t){try{let e=r?.trim();return!e||e===Qt&&!t?.sentinelIdIsAKey?this.get(Qt):this.get(e,()=>o(e))}catch{return Ot(null)}}buildStream(r,o){let t=new he(i=>{let a;try{o?.(),a=pt(()=>{this.structureVersion();let c=this.readSignal(r);try{i.next(c?c():null)}catch{}},{injector:this.injector,manualCleanup:!0})}catch{i.next(null)}return()=>{try{a?.destroy()}catch{}}}),e;return e=t.pipe($t(),Ce(i=>Vn(i)),_e(()=>{try{this.cache.get(r)===e&&this.cache.delete(r)}catch{}}),be({connector:()=>new fe(1),resetOnRefCountZero:!0})),e}};function Vn(n){try{if(!n||typeof n!="object"||Object.isFrozen(n))return n;if(Array.isArray(n))return Object.freeze(n.slice());let r=Object.assign(Object.create(Object.getPrototypeOf(n)),n);return Object.freeze(r)}catch{return n}}var Qt="default";function Ln(n,r){try{if(r!==Qt)return n.get(r);let o=n.get(Qt);return o||(n.size===1?n.values().next().value:void 0)}catch{return}}function nn(){try{return Q(it)}catch{return null}}var vt=class{constructor(){this.isGroupHeader=!1,this.isGroupMember=!1,this.isNewContact=!1,this.disabled=!1}},Vt=class{constructor(){this.appState={user:null,darkMode:!1},this.featureState={customAutocompleteSearch:!1,expandMentionGroups:!1,showMentionGroupsFirst:!1,showMentionGroupsOnly:!1,customGroupsEnabled:!1,paginatedContactList:!1,atHereEnabled:!1,showAtHere:!1},this.data={userContacts:[],organizationGroups:[],userDocumentContacts:[],flattenedItems:[],hereUserContact:{name:"here",email:"",userId:"here",visibility:"here"},atHereDescription:null,autocompleteDataMap:{},selectedAutocompleteData:void 0,newUserContact:void 0,newUserContactError:void 0},this.uiState={variant:void 0,autoCompleteScrollConfig:{itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350}},this.trackByFlattenedItem=(r,o)=>{try{return o?.id||r.toString()}catch{return r.toString()}},this.onOptionClick=()=>{}}};function ce(){return{panelOpen:!1,filterText:"",highlightedIndex:-1,autocompleteDisabledPositions:new Set,darkMode:!1,variant:void 0}}var on=new Se("AutocompleteLocalUIStateSignal");var te=(()=>{let r=class r{bumpContextConfigStructureVersion(){this.configBridge.bumpStructureVersion()}constructor(t,e,i,a,c,d){this.authService=t,this.contactService=e,this.autocompleteService=i,this.serviceBook=a,this.themeService=c,this.loggingService=d,this.contextMap=new Map,this.registryMap=new Map,this.serviceSubscriptions=[],this.injector=nn(),this.configBridge=new qt(this.injector,s=>this.contextMap.get(s)),this.currentUser=null,this.currentDarkMode=!1,this.currentUserContacts=[],this.currentOrganizationGroups=[],this.currentUserDocumentContacts=[],this.currentAutocompleteDataMap={},this.currentAtHereEnabled=!1,this.currentAtHereLabel="here",this.currentAtHereDescription=null,this.currentCustomAutocompleteSearch=!1,this.currentExpandMentionGroups=!1,this.currentShowMentionGroupsFirst=!1,this.currentShowMentionGroupsOnly=!1,this.currentPaginatedContactList=!1,this.currentAutoCompleteScrollConfig={itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350},this.setupSubscriptions()}setupSubscriptions(){try{this.serviceSubscriptions.push(this.authService.getUser$().subscribe(t=>{t&&(this.currentUser=t,this.updateAllContexts(e=>f(m({},e),{appState:f(m({},e.appState),{user:t})})))})),this.serviceSubscriptions.push(this.themeService.getDarkMode$().subscribe(t=>{this.currentDarkMode=t,this.updateAllContexts(e=>f(m({},e),{appState:f(m({},e.appState),{darkMode:t})}))})),this.serviceSubscriptions.push(this.contactService.getUserContacts$().subscribe(t=>{this.currentUserContacts=t?.slice()||[],this.updateAllContexts(e=>f(m({},e),{data:f(m({},e.data),{userContacts:this.buildUserContactsWithHere(this.currentUserContacts)})}))})),this.serviceSubscriptions.push(this.contactService.getOrganizationGroups$().subscribe(t=>{this.currentOrganizationGroups=t||[],this.updateAllContexts(e=>f(m({},e),{data:f(m({},e.data),{organizationGroups:this.currentOrganizationGroups})}))})),this.serviceSubscriptions.push(this.contactService.getUserDocumentContacts$().subscribe(t=>{this.currentUserDocumentContacts=t||[],this.updateAllContexts(e=>f(m({},e),{data:f(m({},e.data),{userDocumentContacts:this.currentUserDocumentContacts})}))})),this.serviceSubscriptions.push(this.autocompleteService.getAutocompleteDataMap$().subscribe(t=>{this.currentAutocompleteDataMap=t||{},this.updateAllContexts(e=>f(m({},e),{data:f(m({},e.data),{autocompleteDataMap:this.currentAutocompleteDataMap})}))})),this.serviceSubscriptions.push(this.contactService.getAtHereEnabled$().subscribe(t=>{this.currentAtHereEnabled=t,this.updateAllContexts(e=>f(m({},e),{featureState:f(m({},e.featureState),{atHereEnabled:t}),data:f(m({},e.data),{userContacts:this.buildUserContactsWithHere(this.currentUserContacts)})}))})),this.serviceSubscriptions.push(this.contactService.getAtHereLabel().subscribe(t=>{this.currentAtHereLabel=t,this.updateAllContexts(e=>f(m({},e),{data:f(m({},e.data),{hereUserContact:f(m({},e.data.hereUserContact),{name:t})})}))})),this.serviceSubscriptions.push(this.contactService.getAtHereDescription().subscribe(t=>{this.currentAtHereDescription=t,this.updateAllContexts(e=>f(m({},e),{data:f(m({},e.data),{atHereDescription:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ht).pipe(ut(t=>t?t.getCustomAutocompleteSearch$():St)).subscribe(t=>{this.currentCustomAutocompleteSearch=t,this.updateAllContexts(e=>f(m({},e),{featureState:f(m({},e.featureState),{customAutocompleteSearch:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ht).pipe(ut(t=>t?t.getExpandMentionGroups$():St)).subscribe(t=>{this.currentExpandMentionGroups=t,this.updateAllContexts(e=>f(m({},e),{featureState:f(m({},e.featureState),{expandMentionGroups:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ht).pipe(ut(t=>t?t.getShowMentionGroupsFirst$():St)).subscribe(t=>{this.currentShowMentionGroupsFirst=t,this.updateAllContexts(e=>f(m({},e),{featureState:f(m({},e.featureState),{showMentionGroupsFirst:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ht).pipe(ut(t=>t?t.getShowMentionGroupsOnly$():St)).subscribe(t=>{this.currentShowMentionGroupsOnly=t,this.updateAllContexts(e=>f(m({},e),{featureState:f(m({},e.featureState),{showMentionGroupsOnly:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ht).pipe(ut(t=>t?t.getPaginatedContactList$():St)).subscribe(t=>{this.currentPaginatedContactList=t,this.updateAllContexts(e=>f(m({},e),{featureState:f(m({},e.featureState),{paginatedContactList:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ht).pipe(ut(t=>t?t.getAutoCompleteScrollConfig$():St)).subscribe(t=>{this.currentAutoCompleteScrollConfig=t,this.updateAllContexts(e=>f(m({},e),{uiState:f(m({},e.uiState),{autoCompleteScrollConfig:t})}))}))}catch(t){this.loggingService.catch("Error in AutocompleteCoreService setupSubscriptions:",t)}}buildUserContactsWithHere(t){try{let e=t?.slice()||[];if(this.currentAtHereEnabled){let i={name:this.currentAtHereLabel,email:"",userId:"here",visibility:"here"};e.find(a=>a?.visibility==="here")||e.unshift(i)}return e}catch(e){return this.loggingService.catch("Error in AutocompleteCoreService buildUserContactsWithHere:",e),t||[]}}getOrCreateContextConfig(t){try{let e=this.contextMap.get(t);if(!e){let i=new Vt;i.appState.user=this.currentUser,i.appState.darkMode=this.currentDarkMode,i.data.userContacts=this.buildUserContactsWithHere(this.currentUserContacts),i.data.organizationGroups=this.currentOrganizationGroups,i.data.userDocumentContacts=this.currentUserDocumentContacts,i.data.autocompleteDataMap=this.currentAutocompleteDataMap,i.data.hereUserContact.name=this.currentAtHereLabel,i.data.atHereDescription=this.currentAtHereDescription,i.featureState.customAutocompleteSearch=this.currentCustomAutocompleteSearch,i.featureState.expandMentionGroups=this.currentExpandMentionGroups,i.featureState.showMentionGroupsFirst=this.currentShowMentionGroupsFirst,i.featureState.showMentionGroupsOnly=this.currentShowMentionGroupsOnly,i.featureState.paginatedContactList=this.currentPaginatedContactList,i.featureState.atHereEnabled=this.currentAtHereEnabled,i.uiState.autoCompleteScrollConfig=this.currentAutoCompleteScrollConfig,e=A(i),this.contextMap.set(t,e),this.bumpContextConfigStructureVersion()}return e}catch(e){return this.loggingService.catch("Error in AutocompleteCoreService getOrCreateContextConfig:",e),A(new Vt)}}getContextConfig(t){try{return this.contextMap.get(t)}catch(e){this.loggingService.catch("Error in AutocompleteCoreService getContextConfig:",e);return}}setContextConfig(t,e){try{this.contextMap.set(t,e),this.bumpContextConfigStructureVersion()}catch(i){this.loggingService.catch("Error in AutocompleteCoreService setContextConfig:",i)}}clearContextConfig(t){try{this.contextMap.delete(t),this.registryMap.delete(t),this.bumpContextConfigStructureVersion()}catch(e){this.loggingService.catch("Error in AutocompleteCoreService clearContextConfig:",e)}}getAutocompleteConfig$(t){try{return this.configBridge.get(t,()=>this.getOrCreateContextConfig(t))}catch(e){return this.loggingService.catch("Error in AutocompleteCoreService getAutocompleteConfig$:",e),Ot(null)}}setRegistry(t,e){try{this.registryMap.set(t,e)}catch(i){this.loggingService.catch("Error in AutocompleteCoreService setRegistry:",i)}}getRegistry(t){try{return this.registryMap.get(t)}catch(e){this.loggingService.catch("Error in AutocompleteCoreService getRegistry:",e);return}}findParentAutocompleteId(t){try{let e=t?.nativeElement;if(!e)return;let i=e.parentElement;for(;i;){let a=i.getAttribute?.("autocomplete-id");if(a)return a;if(i.tagName?.toLowerCase()==="velt-autocomplete-context-wrapper"){let c=i.getAttribute?.("autocomplete-id");if(c)return c}i=i.parentElement}return}catch(e){this.loggingService.catch("Error in AutocompleteCoreService findParentAutocompleteId:",e);return}}updateAllContexts(t){try{this.contextMap.forEach(e=>{let i=e();e.set(t(i))})}catch(e){this.loggingService.catch("Error in AutocompleteCoreService updateAllContexts:",e)}}};r.\u0275fac=function(e){return new(e||r)(H(Pt),H(xt),H(tn),H(Mt),H(Zt),H(N))},r.\u0275prov=nt({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var rn=(()=>{let r=class r{constructor(t,e,i,a){this.coreService=t,this.contactService=e,this.loggingService=i,this.serviceBook=a,this.componentId="velt-autocomplete-panel",this.commentActionsService=null,this.serviceBook.observe(We).subscribe(c=>this.commentActionsService=c)}filterOptions(t,e,i){try{let c=t().data.selectedAutocompleteData;c&&(c.type==="contact"?this.filterContactOptions(t,e,i):this.filterCustomOptions(t,e))}catch(a){this.loggingService.catch("Error in AutocompleteActionService filterOptions:",a)}}filterContactOptions(t,e,i){try{let a=t(),c=e?.toLowerCase()?.trim()||"",d=new Be;d.email=c;let s=new RegExp(ze.REGEX_EMAIL).test("@"+d?.email),h=a.data.userContacts.slice();a.featureState.customAutocompleteSearch||e&&(h=this.filterContacts(h,d),a.featureState.paginatedContactList&&h.length<3&&this.fetchFilteredUsersFromDb(e).then(()=>{})),a.featureState.atHereEnabled&&a.data.hereUserContact?.name?.includes(c)&&(h?.find(C=>C?.userId==="here")||(h=[a.data.hereUserContact,...h])),i?.length&&(h=h.filter(C=>!i.find($=>$?.email===C?.email)));let g=e?this.filterGroups(a.data.organizationGroups,e):a.data.organizationGroups,T=h.map(C=>{if(C.visibility==="here"){if(a.data.atHereDescription)C=f(m({},C),{email:a.data.atHereDescription}),C.description=a.data.atHereDescription;else if(a.appState.user&&a.appState.user?.organizationId){let $=a.data.userDocumentContacts?.length||0;C=f(m({},C),{email:`${$} members`}),C.description=`${$} members`}}return{type:"contact",contact:C,disabled:!1}}),D=g.map(C=>({type:"group",group:C})),_=[...T,...D];if(a.featureState.expandMentionGroups)this.buildExpandedGroupItems(t,_,a,d,s);else{let C=_.length?void 0:{type:"contact",contact:d},$=this.createFlattenedItems({allItems:_,newUserContact:C,isExpandedGroups:!1,isCustomGroups:!1,showMentionGroupsOnly:a.featureState.showMentionGroupsOnly,showMentionGroupsFirst:a.featureState.showMentionGroupsFirst});t.update(Z=>f(m({},Z),{data:f(m({},Z.data),{flattenedItems:$,newUserContactError:s?void 0:"Invalid email",newUserContact:C})}))}}catch(a){this.loggingService.catch("Error in AutocompleteActionService filterContactOptions:",a)}}buildExpandedGroupItems(t,e,i,a,c){try{let d=[],s={},h=new Map;e.forEach(C=>{if(C.contact?.userId){let $=$e(C.contact.userId);h.set($,C),s[C.contact.userId]=!1}});let g=new Map;i.data.organizationGroups.forEach(C=>{g.set(C.metadata.clientGroupId,{id:C.metadata.clientGroupId,name:C.metadata.groupName,members:[],userIds:Object.keys(C.users||{})})}),g.forEach(C=>{C.userIds.forEach($=>{let Z=h.get($);Z&&(C.members.push(Z),Z.contact?.userId&&(s[Z.contact.userId]=!0))})}),e.forEach(C=>{C.type==="contact"&&C.contact?.userId&&!s[C.contact.userId]&&d.push(C)});let T=Array.from(g.values()),D=e.length?void 0:{type:"contact",contact:a},_=this.createFlattenedItems({allItems:e,contactsWithoutGroup:d,groups:T,newUserContact:D,isExpandedGroups:!0,isCustomGroups:!1,showMentionGroupsOnly:i.featureState.showMentionGroupsOnly,showMentionGroupsFirst:i.featureState.showMentionGroupsFirst});t.update(C=>f(m({},C),{data:f(m({},C.data),{flattenedItems:_,newUserContactError:c?void 0:"Invalid email",newUserContact:D,contactsWithoutGroup:d,groups:T})}))}catch(d){this.loggingService.catch("Error in AutocompleteActionService buildExpandedGroupItems:",d)}}filterCustomOptions(t,e){try{let i=t(),a=i.data.selectedAutocompleteData,c=i.data.autocompleteDataMap?.[a?.hotkey],d=c?.data?.slice()||[];if(i.featureState.customAutocompleteSearch||(e?d=d.filter(h=>h.name?.toLowerCase()?.includes(e?.toLowerCase())):d=a?.data?.slice()||[]),c?.groups&&c.groups.length>0){let h=[],g=new Map;c.groups?.forEach(_=>{g.set(_.id,{id:_.id,name:_.name,members:[]})}),d.forEach(_=>{let C={type:"custom",custom:_};_.groupId&&g.has(_.groupId)?g.get(_.groupId)?.members.push(C):h.push(C)});let T=Array.from(g.values()).filter(_=>_.members.length>0),D=this.createFlattenedItems({allItems:[],contactsWithoutGroup:h,groups:T,isExpandedGroups:!1,isCustomGroups:!0,showMentionGroupsOnly:i.featureState.showMentionGroupsOnly,showMentionGroupsFirst:i.featureState.showMentionGroupsFirst});t.update(_=>f(m({},_),{featureState:f(m({},_.featureState),{customGroupsEnabled:!0}),data:f(m({},_.data),{flattenedItems:D,contactsWithoutGroup:h,groups:T})}))}else{let h=d.map(T=>({type:"custom",custom:T})),g=this.createFlattenedItems({allItems:h,isExpandedGroups:!1,isCustomGroups:!1,showMentionGroupsOnly:i.featureState.showMentionGroupsOnly,showMentionGroupsFirst:i.featureState.showMentionGroupsFirst});t.update(T=>f(m({},T),{featureState:f(m({},T.featureState),{customGroupsEnabled:!1}),data:f(m({},T.data),{flattenedItems:g})}))}}catch(i){this.loggingService.catch("Error in AutocompleteActionService filterCustomOptions:",i)}}createFlattenedItems(t){try{let{allItems:e,contactsWithoutGroup:i,groups:a,newUserContact:c,isExpandedGroups:d=!1,isCustomGroups:s=!1,showMentionGroupsOnly:h=!1,showMentionGroupsFirst:g=!1}=t,T=[];if(d||s){if(!h&&!g&&i?.forEach((D,_)=>{let C=new vt;C.originalItem=D,C.disabled=!!D.disabled,C.id=s?`velt-option-custom-ungrouped-${_}`:`velt-option-user-${_}`,C.testId=s?`${this.componentId}-custom-ungrouped-${_}`:`${this.componentId}-user-${_}`,T.push(C)}),a?.forEach((D,_)=>{if(D?.members?.length){let C=new vt;C.originalItem={type:"group",group:D},C.isGroupHeader=!0,C.disabled=!0,C.group=D,C.id=s?`velt-option-custom-group-${_}`:`velt-option-group-${_}`,C.testId=s?`${this.componentId}-custom-group-${_}`:`${this.componentId}-group-${_}`,T.push(C),D.members.forEach(($,Z)=>{let dt=new vt;dt.originalItem=$,dt.isGroupMember=!0,dt.disabled=$.disabled||!1,dt.id=s?`velt-option-custom-group-${_}-member-${Z}`:`velt-option-group-${_}-member-${Z}`,dt.testId=s?`${this.componentId}-custom-group-${_}-member-${Z}`:`${this.componentId}-group-${_}-member-${Z}`,T.push(dt)})}}),!h&&g&&i?.length){let D=new vt;D.originalItem={type:"group"},D.isGroupHeader=!0,D.disabled=!0,D.groupName="Ungrouped",D.id="velt-option-ungrouped",D.testId=`${this.componentId}-ungrouped`,T.push(D),i.forEach((_,C)=>{let $=new vt;$.originalItem=_,$.isGroupMember=!0,$.disabled=_.disabled||!1,$.id=`velt-option-user-${C}`,$.testId=`${this.componentId}-user-${C}`,T.push($)})}}else e.forEach((D,_)=>{let C=new vt;C.originalItem=D,C.disabled=D.disabled||!1,C.id=`velt-option-${_}`,C.testId=`${this.componentId}-${_}`,T.push(C)});if(c?.contact?.email){let D=new vt;D.originalItem=c,D.isNewContact=!0,D.id="velt-new-contact-option",D.testId=`${this.componentId}-new-contact`,T.push(D)}return T}catch(e){return this.loggingService.catch("Error in AutocompleteActionService createFlattenedItems:",e),[]}}addContact(t){try{let e=t();e.data.newUserContact?.contact&&(this.contactService.addUserContact(e.data.newUserContact.contact),t.update(i=>f(m({},i),{data:f(m({},i.data),{newUserContact:void 0})})))}catch(e){this.loggingService.catch("Error in AutocompleteActionService addContact:",e)}}callbackOnOptionSelected(t){try{this.contactService.onContactSelected(t)}catch(e){this.loggingService.catch("Error in AutocompleteActionService callbackOnOptionSelected:",e)}}triggerAutocompleteSearch(t,e,i){try{let a={event:t,searchText:e,type:i};this.commentActionsService?.autocompleteSearch(a)}catch(a){this.loggingService.catch("Error in AutocompleteActionService triggerAutocompleteSearch:",a)}}toggleSelection(t,e){try{let a=t().data.multiSelectItems||[],c=a.findIndex(s=>this.isSameItem(s,e)),d;return c>=0?d=[...a.slice(0,c),...a.slice(c+1)]:d=[...a,e],t.update(s=>f(m({},s),{data:f(m({},s.data),{multiSelectItems:d})})),d}catch(i){return this.loggingService.catch("Error in AutocompleteActionService toggleSelection:",i),[]}}confirmSelection(t){try{let i=t().data.multiSelectItems||[];return t.update(a=>f(m({},a),{data:f(m({},a.data),{multiSelectItems:[]})})),[...i]}catch(e){return this.loggingService.catch("Error in AutocompleteActionService confirmSelection:",e),[]}}isSameItem(t,e){try{return t.type!==e.type?!1:t.type==="contact"&&e.type==="contact"?t.contact?.userId&&e.contact?.userId?t.contact.userId===e.contact.userId:t.contact?.email&&e.contact?.email?t.contact.email===e.contact.email:!1:t.type==="custom"&&e.type==="custom"?t.custom?.id&&e.custom?.id?t.custom.id===e.custom.id:!1:t.type==="group"&&e.type==="group"&&t.group?.metadata?.groupId&&e.group?.metadata?.groupId?t.group.metadata.groupId===e.group.metadata.groupId:!1}catch{return!1}}filterContacts(t,e){try{let i=e.email?.toLowerCase();return t?.filter(a=>a?.email?.includes(i)||a?.name?.toLowerCase()?.includes(i)||a?.organizationName?.toLowerCase()?.includes(i))}catch(i){return this.loggingService.catch("Error in AutocompleteActionService _filterContacts:",i),[]}}filterGroups(t,e){try{return t?.filter(i=>i?.metadata?.groupName?.toLowerCase()?.includes(e?.toLowerCase()))}catch(i){return this.loggingService.catch("Error in AutocompleteActionService _filterGroups:",i),[]}}filterCustomItems(t,e){try{return t?.filter(i=>i.name?.toLowerCase()?.includes(e?.toLowerCase()))||[]}catch(i){return this.loggingService.catch("Error in AutocompleteActionService filterCustomItems:",i),[]}}fetchFilteredUsersFromDb(t){return gt(this,null,function*(){try{yield this.contactService.searchUsers(t)}catch(e){this.loggingService.catch("Error in AutocompleteActionService fetchFilteredUsersFromDb:",e)}})}};r.\u0275fac=function(e){return new(e||r)(H(te),H(xt),H(N),H(Mt))},r.\u0275prov=nt({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var ee=(()=>{let r=class r{constructor(t){this.loggingService=t,this.subscribers=new Set}register(t){try{if(this.subscribers.add(t),this.lastPayload)try{t(this.lastPayload)}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error initializing subscriber:",e)}}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in register:",e)}}unregister(t){try{this.subscribers.delete(t)}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in unregister:",e)}}broadcast(t){try{this.lastPayload=t,this.subscribers.forEach(e=>{try{e(t)}catch(i){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in subscriber:",i)}})}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in broadcast:",e)}}getLastPayload(){try{return this.lastPayload}catch(t){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in getLastPayload:",t);return}}};r.\u0275fac=function(e){return new(e||r)(H(N))},r.\u0275prov=nt({token:r,factory:r.\u0275fac});let n=r;return n})();function se(n,r){try{let o=r?.trim();return o?(n||[]).find(t=>t?.userId===o):void 0}catch{return}}function an(n,r,o){try{let t=o?.trim();return t?n||(r?.userId===t?r:void 0):void 0}catch{return}}var ne=class{constructor(r){this.options=r,this.published=!1}finalize(){try{let r=this.options.getHost();if(!r)return;let o=Ee(r);this.publish(r,o?o.payload:Tt(r)?.payload),Fe(r,this.options.ownerRef,()=>this.refreshFromPlacement())}catch{}}refreshFromPlacement(){try{let r=this.options.getHost();if(!r)return;let o=Tt(r)?.payload,t=o?.contextData||{},e=!Gn(this.lastContextData,t)||this.lastAnnotationId!==o?.annotationId,i=this.lastEntity!==this.readOwnEntity(),a=this.lastLocalUIState!==this.readOwnLocalUIState(),c=this.lastInheritedEntity!==o?.data;if(this.published&&!e&&!i&&!a&&!c)return;this.options.onContextChanged?.(),this.publish(r,o),this.options.markForCheck?.()}catch{}}destroy(){try{let r=this.options.getHost();Ae(r,this.options.ownerRef),Re(r,this.options.ownerRef),this.published=!1}catch{}}getInheritedLocalUIState(){try{return Tt(this.options.getHost())?.payload?.localUIState}catch{return}}adoptInheritedLocalUIState(r){return Xt(f(m({},r),{host:this.options.getHost()}))}publish(r,o){let t=this.readOwnEntity(),e=this.readOwnLocalUIState();Te(r,Me({host:r,inherited:o,ownData:t,ownLocalUIState:e,ownerRef:this.options.ownerRef})),this.lastContextData=o?.contextData||{},this.lastAnnotationId=o?.annotationId,this.lastEntity=t,this.lastLocalUIState=e,this.lastInheritedEntity=o?.data,this.published=!0}readOwnEntity(){if(this.options.getEntity)try{return re(()=>this.options.getEntity())}catch{return}}readOwnLocalUIState(){if(this.options.getLocalUIState)try{return re(()=>this.options.getLocalUIState())}catch{return}}};function Gn(n,r){try{if(n===r)return!0;if(!n||!r)return!1;let o=Object.keys(n);return o.length!==Object.keys(r).length?!1:o.every(t=>n[t]===r[t])}catch{return!1}}var q=(()=>{let r=class r extends Ze{set parentLocalUIState(t){t&&(this.localUIStateSignal=t,this.isLocalUIStateOwner=!1)}get elementRef(){return this.hostElementRef}constructor(){let t=Q(tt),e=Q(Zt),i=Q(De),a=Q(Mt).get(ht),c=Q(b),d=Q(N);super(t,e,i,a??void 0,void 0,c,d),this.autocompleteId=ie(),this.defaultCondition=ie(!0,{transform:s=>{try{return typeof s=="string"?s==="true"||s==="":s}catch{return!0}}}),this._contextData={},this.isLocalUIStateOwner=!1,this.isContextInitialized=!1,this.registryCheckAttempts=0,this.MAX_REGISTRY_CHECK_ATTEMPTS=50,this.veltContextHost=new ne({getHost:()=>this.hostElementRef?.nativeElement,ownerRef:this,getLocalUIState:()=>this.isLocalUIStateOwner?this.localUIStateSignal:void 0,getEntity:()=>this.getPublishedVeltEntity(),onContextChanged:()=>this.handleVeltContextChanged(),markForCheck:()=>this.cd?.markForCheck?.()}),this._placementFlushScheduled=!1,this.onContextPayload=s=>{try{this.isContextInitialized||(this.isContextInitialized=!0),this._autocompleteId=s.autocompleteId,this._contextData=s.contextData||{};let h=this.coreService.getContextConfig(s.autocompleteId);h&&(this.componentConfigSignal.update(g=>m({},g)),this.componentConfigSignal=h,this.cd.markForCheck())}catch(h){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent onContextPayload:",h)}},this.isLocalUIStateRoot=!1,this.hostElementRef=t,this.themeService=e,this.dynamicDataService=c,this.loggingService=d,this.coreService=Q(te),this.actionService=Q(rn),this.cd=i,this.commentService=a??void 0,this.registry=Q(ee,{optional:!0})??void 0,this._userIdContactService=Q(xt),this._userIdAuthService=Q(Pt),this.initializeLocalUIState()}resolveUserIdToContact(t,e){try{this._userIdValue=t,this._userIdApply=e,this._userIdSub?.unsubscribe(),this._userIdSub=void 0;let i=t?.trim();if(!i){e(void 0),this.flushChangeDetection();return}let a=this._userIdContactService.getInternalUserContacts()??[],c=se(a,i);if(c){e(c),this.publishResolvedEntityToDescendants(),this.flushChangeDetection();return}this._userIdSub=Bt([this._userIdContactService.getUserByUserId$(i),this._userIdAuthService.getUser$(),this._userIdContactService.getInternalUserContacts$()]).subscribe(([d,s,h])=>{try{let g=se(h??[],i)??an(d,s,i);e(g),this.publishResolvedEntityToDescendants(),this.flushChangeDetection()}catch(g){this.loggingService.catch("Error resolving userId user:",g)}})}catch(i){this.loggingService.catch("Error looking up userId:",i)}}flushChangeDetection(){try{this.cd?.detectChanges?.()}catch{try{this.cd?.markForCheck?.()}catch{}}}cancelUserIdResolution(){this._userIdSub?.unsubscribe(),this._userIdSub=void 0}resolveUserObjectToContact(t,e){try{if(!t){this._userIdValue?.trim()?this.resolveUserIdToContact(this._userIdValue,this._userIdApply??e):(e(void 0),this.flushChangeDetection());return}this.cancelUserIdResolution();let i=typeof t=="string"?JSON.parse(t):t;e(i),this.flushChangeDetection()}catch(i){this.loggingService.catch("Error parsing userObject:",i)}}initializeLocalUIState(){try{let t=Q(on,{optional:!0,skipSelf:!0});t?(this.localUIStateSignal=t,this.isLocalUIStateOwner=!1):(this.localUIStateSignal=A(ce()),this.isLocalUIStateOwner=!0)}catch{this.localUIStateSignal=A(ce()),this.isLocalUIStateOwner=!0}}ngOnInit(){try{super.ngOnInit();let t=this.autocompleteId();if(!t){let i=this.hostElementRef?.nativeElement?.getAttribute?.("autocomplete-id");i&&(t=i)}if(this.componentConfigSignal&&this.componentConfigSignal()&&Object.keys(this.componentConfigSignal()).length>0){this.initializeFromConfigSignal(this.componentConfigSignal),this.setupA11yAttributes(),this.setupDarkModeSync(),this.finalizeVeltContext();return}if(t){this._autocompleteId=t,this.initializeFromAutocompleteId(t),this.setupA11yAttributes(),this.setupDarkModeSync(),this.finalizeVeltContext();return}let e=this.findNearestParentWrapperRegistry();if(e){this.registry=e,this.registry.register(this.onContextPayload);let i=this.registry.getLastPayload?.();i&&this.onContextPayload(i),this.setupA11yAttributes(),this.setupDarkModeSync(),this.finalizeVeltContext();return}if(this.registry){this.registry.register(this.onContextPayload);let i=this.registry.getLastPayload?.();i&&this.onContextPayload(i),this.setupA11yAttributes(),this.setupDarkModeSync(),this.finalizeVeltContext();return}this.tryRegisterWithContext(),this.setupA11yAttributes(),this.setupDarkModeSync(),this.finalizeVeltContext()}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent ngOnInit:",t)}}handleVeltContextChanged(){this.adoptInheritedLocalUIState(),this.inheritSelectorItemFromContext(!0),this.onVeltContextChanged()}finalizeVeltContext(){try{this.adoptInheritedLocalUIState(),this.inheritSelectorItemFromContext(),this.veltContextHost.finalize()}catch(t){this.loggingService?.catch?.("Error in AutocompletePrimitiveThemedComponent finalizeVeltContext:",t)}}refreshVeltContextFromPlacement(){this.veltContextHost.refreshFromPlacement()}onVeltContextChanged(){}getPublishedVeltEntity(){}getInheritedVeltContextData(){try{return Tt(this.hostElementRef?.nativeElement)?.payload?.contextData||{}}catch{return{}}}getInheritedVeltEntity(){try{return Pe(this.hostElementRef?.nativeElement)}catch{return}}inheritSelectorItemFromContext(t=!1){try{let e=this.getInheritedVeltEntity(),i=this.selectorItem;if(i&&i!==this._lastInheritedSelectorItem)return;e&&e!==i&&(this.selectorItem=e,this._lastInheritedSelectorItem=e,t?(this.cd?.markForCheck?.(),this.schedulePlacementFlush()):this.flushChangeDetection())}catch(e){this.loggingService?.catch?.("Error in AutocompletePrimitiveThemedComponent inheritSelectorItemFromContext:",e)}}schedulePlacementFlush(){try{if(this._placementFlushScheduled)return;this._placementFlushScheduled=!0,queueMicrotask(()=>{this._placementFlushScheduled=!1,this.flushChangeDetection()})}catch{}}publishResolvedEntityToDescendants(){try{let t=this.hostElementRef?.nativeElement;if(!t)return;this.veltContextHost.refreshFromPlacement(),At(t)}catch{}}ngOnDestroy(){try{this.veltContextHost.destroy(),this.registryCheckTimer&&(clearTimeout(this.registryCheckTimer),this.registryCheckTimer=void 0),this.registry&&this.registry.unregister(this.onContextPayload),this.darkModeConfigSyncSubscription&&this.darkModeConfigSyncSubscription.unsubscribe(),this._userIdSub?.unsubscribe(),this._userIdSub=void 0,super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent ngOnDestroy:",t)}}setupA11yAttributes(){}setupDarkModeSync(){try{this.darkModeConfigSyncSubscription=this.onDarkModeChange().subscribe(t=>{try{if(this.componentConfigSignal&&typeof this.componentConfigSignal=="function"){let e=this.componentConfigSignal();e&&e.appState&&e.appState.darkMode!==t&&this.componentConfigSignal.update(i=>f(m({},i),{appState:f(m({},i.appState),{darkMode:t})}))}}catch(e){this.loggingService.catch("Error in darkMode sync subscription:",e)}})}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent setupDarkModeSync:",t)}}findNearestParentWrapperRegistry(){try{let t=this.hostElementRef?.nativeElement;if(!t)return;let e=t.parentElement;for(;e;){if(e.tagName?.toLowerCase()==="velt-autocomplete-context-wrapper"){let i=e.__veltContext;if(i?.registry instanceof ee)return i.contextData&&(this._contextData=i.contextData),i.registry;let a=window.ng;if(a?.getComponent){let d=a.getComponent(e);if(d?.registry)return d.registry}let c=e.__ngContext__;if(c&&Array.isArray(c))for(let d=0;d<c.length;d++){let s=c[d];if(s&&typeof s=="object"&&s.registry instanceof ee)return s.registry}}e=e.parentElement}}catch(t){this.loggingService.catch("[AUTOCOMPLETE PRIMITIVE BASE] Error finding parent wrapper registry:",t)}}tryRegisterWithContext(){try{let t=this.coreService.findParentAutocompleteId(this.hostElementRef);if(!t){this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS&&(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10));return}this.registry=this.coreService.getRegistry(t),this.registry?this.registry.register(this.onContextPayload):this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS?(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10)):this.initializeFromDOM(t)}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent tryRegisterWithContext:",t)}}initializeFromDOM(t){try{this._autocompleteId=t;let e=this.coreService.getContextConfig(t);e&&(this.componentConfigSignal.update(i=>m({},i)),this.componentConfigSignal=e,this.isContextInitialized=!0,this.cd.markForCheck())}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent initializeFromDOM:",e)}}initializeFromAutocompleteId(t){try{this._autocompleteId=t;let e=this.coreService.getOrCreateContextConfig(t);this.componentConfigSignal.update(i=>m({},i)),this.componentConfigSignal=e,this.isContextInitialized=!0,this.cd.markForCheck()}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent initializeFromAutocompleteId:",e)}}initializeFromConfigSignal(t){try{this.isContextInitialized=!0,this.cd.markForCheck()}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent initializeFromConfigSignal:",e)}}getContextValue(t){try{let e=this._contextData[t];if(e!=null)return e;let i=this.hostElementRef?.nativeElement?.getAttribute(t);return i!==null?i:void 0}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent getContextValue:",e);return}}adoptInheritedLocalUIState(){try{Xt({host:this.hostElementRef?.nativeElement,current:this.localUIStateSignal,isOwner:this.isLocalUIStateOwner,isRoot:this.isLocalUIStateRoot,adopt:t=>{this.localUIStateSignal=t,this.isLocalUIStateOwner=!1}})}catch(t){this.loggingService?.catch?.("Error in AutocompletePrimitiveThemedComponent adoptInheritedLocalUIState:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["app-autocomplete-primitive-themed-base"]],inputs:{autocompleteId:[1,"autocompleteId"],defaultCondition:[1,"defaultCondition"],parentLocalUIState:"parentLocalUIState"},standalone:!1,features:[j],decls:0,vars:0,template:function(e,i){},encapsulation:2});let n=r;return n})();var Hn=(n,r)=>({componentConfigSignal:n,parentLocalUIState:r}),Wn=(n,r)=>({condition:n,data:r}),Jn=n=>({componentConfigSignal:n}),Kn=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-chip-tooltip-description-wireframe",variant:o,setIfCondition:t,componentElementRef:e}),Yn=()=>({});function Xn(n,r){n&1&&B(0)}function Zn(n,r){if(n&1&&v(0,Xn,1,0,"ng-container",5),n&2){l(2);let o=W(3);p("ngTemplateOutlet",o)}}function qn(n,r){n&1&&B(0)}function Qn(n,r){if(n&1&&v(0,qn,1,0,"ng-container",5),n&2){l(2);let o=W(5);p("ngTemplateOutlet",o)}}function to(n,r){n&1&&B(0)}function eo(n,r){if(n&1&&v(0,to,1,0,"ng-container",5),n&2){l(2);let o=W(7);p("ngTemplateOutlet",o)}}function no(n,r){if(n&1&&(S(0),w(1,Zn,1,1,"ng-container")(2,Qn,1,1,"ng-container")(3,eo,1,1,"ng-container"),y()),n&2){let o=l(2);u(),E((o==null?null:o.type)==="contact"?1:(o==null?null:o.type)==="custom"?2:(o==null?null:o.type)==="group"?3:-1)}}function oo(n,r){if(n&1&&(U(0),V(1,"translate")),n&2){let o=l(2);X(" ",L(1,1,(o==null||o.contact==null?null:o.contact.email)||(o==null?null:o.email))," ")}}function ro(n,r){if(n&1&&(U(0),V(1,"translate")),n&2){let o=l(2);X(" ",L(1,1,o==null||o.custom==null||o.custom.custom==null?null:o.custom.custom.description)," ")}}function io(n,r){if(n&1&&(U(0),V(1,"translate")),n&2){let o,t=l(3),e=l();Yt(" ",(o=e.objectKeys((t==null||t.group==null||t.group.group==null?null:t.group.group.users)||Nt(4,Yn)))==null?null:o.length," ",L(1,2,"members")," ")}}function ao(n,r){if(n&1&&w(0,io,2,5),n&2){let o=l(2);E(!(o==null||o.group==null)&&o.group.group?0:-1)}}function lo(n,r){if(n&1&&(S(0),v(1,no,4,1,"ng-container",4)(2,oo,2,3,"ng-template",null,0,J)(4,ro,2,3,"ng-template",null,1,J)(6,ao,1,1,"ng-template",null,2,J),y()),n&2){let o=l(),t=l();u(),p("veltDynamicTemplate",z(3,Kn,t.template,R(1,Jn,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function co(n,r){if(n&1&&v(0,lo,8,9,"ng-container",3),n&2){let o=l();p("veltIf",O(4,Wn,o.conditionSignal(),O(1,Hn,o.componentConfigSignal,o.localUIStateSignal)))}}var ln=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}set userId(t){this.resolveUserIdToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}constructor(){super(),this.componentId="velt-autocomplete-chip-tooltip-description",this.objectKeys=Object.keys,this.componentConfigSignal=A({})}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipDescriptionComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipDescriptionComponent ngOnDestroy:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-chip-tooltip-description-internal"]],inputs:{userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["contacEmailRef",""],["customDescriptionRef",""],["groupDescriptionRef",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngTemplateOutlet"]],template:function(e,i){if(e&1&&w(0,co,1,7,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=r;return n})();function ft(n,r){n&&(n.setAttribute("role","presentation"),n.setAttribute("data-testid",r+"-container"))}var so=(n,r)=>({componentConfigSignal:n,parentLocalUIState:r}),mo=(n,r)=>({condition:n,data:r}),po=n=>({componentConfigSignal:n}),vo=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-chip-tooltip-icon-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function go(n,r){n&1&&B(0)}function uo(n,r){if(n&1&&v(0,go,1,0,"ng-container",5),n&2){l(2);let o=W(3);p("ngTemplateOutlet",o)}}function ho(n,r){n&1&&B(0)}function fo(n,r){if(n&1&&v(0,ho,1,0,"ng-container",5),n&2){l(2);let o=W(5);p("ngTemplateOutlet",o)}}function Co(n,r){n&1&&B(0)}function _o(n,r){if(n&1&&v(0,Co,1,0,"ng-container",5),n&2){l(2);let o=W(7);p("ngTemplateOutlet",o)}}function bo(n,r){if(n&1&&(S(0),w(1,uo,1,1,"ng-container")(2,fo,1,1,"ng-container")(3,_o,1,1,"ng-container"),y()),n&2){let o=l(2);u(),E((o==null?null:o.type)==="contact"?1:(o==null?null:o.type)==="custom"?2:(o==null?null:o.type)==="group"?3:-1)}}function xo(n,r){if(n&1&&Y(0,"snippyly-user-avatar",6),n&2){let o=l(2);p("size",32)("user",o==null?null:o.contact)}}function So(n,r){if(n&1&&(Y(0,"div",7),V(1,"safeSvg")),n&2){let o=l(3);p("innerHtml",L(1,1,o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null?null:o.custom.custom.icon.svg),Gt)}}function yo(n,r){if(n&1&&(x(0,"div",8),Y(1,"img",9),k()),n&2){let o=l(3);u(),p("src",o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null?null:o.custom.custom.icon.url,Ht)}}function ko(n,r){if(n&1&&(w(0,So,2,3,"div",7),w(1,yo,2,1,"div",8)),n&2){let o=l(2);E(!(o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null)&&o.custom.custom.icon.svg?0:-1),u(),E(!(o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null)&&o.custom.custom.icon.url?1:-1)}}function Io(n,r){n&1&&(x(0,"div",10),mt(),x(1,"svg",11),Y(2,"path",12),k()())}function Oo(n,r){if(n&1&&(S(0),v(1,bo,4,1,"ng-container",4)(2,xo,1,2,"ng-template",null,0,J)(4,ko,2,2,"ng-template",null,1,J)(6,Io,3,0,"ng-template",null,2,J),y()),n&2){let o=l(),t=l();u(),p("veltDynamicTemplate",z(3,vo,t.template,R(1,po,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function Do(n,r){if(n&1&&v(0,Oo,8,9,"ng-container",3),n&2){let o=l();p("veltIf",O(4,mo,o.conditionSignal(),O(1,so,o.componentConfigSignal,o.localUIStateSignal)))}}var sn=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}set userId(t){this.resolveUserIdToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}constructor(){super(),this.componentId="velt-autocomplete-chip-tooltip-icon",this.componentConfigSignal=A({})}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipIconComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipIconComponent ngOnDestroy:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-chip-tooltip-icon-internal"]],inputs:{userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["contactAvatarRef",""],["customIconRef",""],["groupIconRef",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngTemplateOutlet"],[1,"comment-dialog-user-avatar",3,"size","user"],[1,"velt-autocomplete-chip-tooltip--icon-svg",3,"innerHtml"],[1,"velt-autocomplete-chip-tooltip--icon-img"],[3,"src"],[1,"velt-autocomplete-chip-tooltip--group-icon","velt-autocomplete-chip-tooltip--icon-svg"],["xmlns","http://www.w3.org/2000/svg","fill","rgb(233, 242, 255)","width","16","height","16","viewBox","0 0 16 16",1,"bi","bi-people-fill"],["d","M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5.784 6A2.24 2.24 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.3 6.3 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5"]],template:function(e,i){if(e&1&&w(0,Do,1,7,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-autocomplete-chip-tooltip--group-icon[_ngcontent-%COMP%]{width:100%;height:100%;padding:var(--velt-spacing-xs);display:flex;align-items:center;justify-content:center;background:linear-gradient(0deg,#ffffff0a,#ffffff0a),linear-gradient(0deg,#3772ff14,#3772ff14);box-sizing:border-box}.velt-autocomplete-chip-tooltip--icon-svg[_ngcontent-%COMP%]{display:flex;width:100%;height:100%;align-items:center;justify-content:center;color:var(--velt-text-0)}.velt-autocomplete-chip-tooltip--icon-img[_ngcontent-%COMP%]{display:flex;width:100%;height:100%;align-items:center;justify-content:center}.velt-autocomplete-chip-tooltip--icon-img[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:16px;height:16px;object-fit:cover}"],changeDetection:0});let n=r;return n})();var wo=(n,r)=>({componentConfigSignal:n,parentLocalUIState:r}),Eo=(n,r)=>({condition:n,data:r}),To=n=>({componentConfigSignal:n}),Ao=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-chip-tooltip-name-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function Mo(n,r){n&1&&B(0)}function Po(n,r){if(n&1&&v(0,Mo,1,0,"ng-container",5),n&2){l(2);let o=W(3);p("ngTemplateOutlet",o)}}function Fo(n,r){n&1&&B(0)}function Ro(n,r){if(n&1&&v(0,Fo,1,0,"ng-container",5),n&2){l(2);let o=W(5);p("ngTemplateOutlet",o)}}function jo(n,r){n&1&&B(0)}function Uo(n,r){if(n&1&&v(0,jo,1,0,"ng-container",5),n&2){l(2);let o=W(7);p("ngTemplateOutlet",o)}}function No(n,r){if(n&1&&(S(0),w(1,Po,1,1,"ng-container")(2,Ro,1,1,"ng-container")(3,Uo,1,1,"ng-container"),y()),n&2){let o=l(2);u(),E((o==null?null:o.type)==="contact"?1:(o==null?null:o.type)==="custom"?2:(o==null?null:o.type)==="group"?3:-1)}}function Vo(n,r){if(n&1&&(U(0),V(1,"translate")),n&2){let o=l(2);X(" ",L(1,1,o==null||o.contact==null?null:o.contact.name)," ")}}function Lo(n,r){if(n&1&&(U(0),V(1,"translate")),n&2){let o=l(2);X(" ",L(1,1,o==null||o.custom==null||o.custom.custom==null?null:o.custom.custom.name)," ")}}function zo(n,r){if(n&1&&(U(0),V(1,"translate")),n&2){let o=l(2);X(" ",L(1,1,(o==null||o.group==null||o.group.group==null||o.group.group.metadata==null?null:o.group.group.metadata.groupName)||(o==null||o.group==null?null:o.group.text))," ")}}function Bo(n,r){if(n&1&&(S(0),v(1,No,4,1,"ng-container",4)(2,Vo,2,3,"ng-template",null,0,J)(4,Lo,2,3,"ng-template",null,1,J)(6,zo,2,3,"ng-template",null,2,J),y()),n&2){let o=l(),t=l();u(),p("veltDynamicTemplate",z(3,Ao,t.template,R(1,To,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function $o(n,r){if(n&1&&v(0,Bo,8,9,"ng-container",3),n&2){let o=l();p("veltIf",O(4,Eo,o.conditionSignal(),O(1,wo,o.componentConfigSignal,o.localUIStateSignal)))}}var dn=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}set userId(t){this.resolveUserIdToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}constructor(){super(),this.componentId="velt-autocomplete-chip-tooltip-name",this.componentConfigSignal=A({})}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipNameComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipNameComponent ngOnDestroy:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-chip-tooltip-name-internal"]],inputs:{userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["contactNameRef",""],["customNameRef",""],["groupNameRef",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngTemplateOutlet"]],template:function(e,i){if(e&1&&w(0,$o,1,7,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=r;return n})();var Go=(n,r)=>({componentConfigSignal:n,parentLocalUIState:r}),Ho=(n,r)=>({condition:n,data:r}),Wo=n=>({componentConfigSignal:n}),Jo=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-chip-tooltip-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function Ko(n,r){n&1&&B(0)}function Yo(n,r){if(n&1&&(x(0,"velt-shadow-dom-internal"),v(1,Ko,1,0,"ng-container",2),k()),n&2){l();let o=W(4);u(),p("ngTemplateOutlet",o)}}function Xo(n,r){n&1&&B(0)}function Zo(n,r){if(n&1&&v(0,Xo,1,0,"ng-container",2),n&2){l();let o=W(4);p("ngTemplateOutlet",o)}}function qo(n,r){if(n&1&&(x(0,"div",4)(1,"div",5),Y(2,"velt-autocomplete-chip-tooltip-icon-internal",6),k(),x(3,"div",7)(4,"div",8),Y(5,"velt-autocomplete-chip-tooltip-name-internal",6),k(),x(6,"div",9),Y(7,"velt-autocomplete-chip-tooltip-description-internal",6),k()()()),n&2){let o=l(4);u(2),p("componentConfigSignal",o.componentConfigSignal),u(3),p("componentConfigSignal",o.componentConfigSignal),u(2),p("componentConfigSignal",o.componentConfigSignal)}}function Qo(n,r){if(n&1&&v(0,qo,8,3,"div",3),n&2){let o=l(2),t=l();p("veltDynamicTemplate",z(3,Jo,t.template,R(1,Wo,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function tr(n,r){if(n&1&&(S(0),w(1,Yo,2,1,"velt-shadow-dom-internal")(2,Zo,1,1,"ng-container"),v(3,Qo,1,9,"ng-template",null,0,J),y()),n&2){let o=l(2);u(),E(o.shadowDom&&!o.template||o.template&&o.isExplicitShadowDom?1:2)}}function er(n,r){if(n&1&&v(0,tr,5,1,"ng-container",1),n&2){let o=l();p("veltIf",O(4,Ho,o.conditionSignal(),O(1,Go,o.componentConfigSignal,o.localUIStateSignal)))}}var mn=(()=>{let r=class r extends q{set shadowDom(t){this._shadowDom=t}get shadowDom(){return this._shadowDom}set userObject(t){this.resolveUserObjectToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}set userId(t){this.resolveUserIdToContact(t,e=>{this.componentConfigSignal.update(i=>f(m({},i),{type:"contact",contact:e}))})}constructor(){super(),this.componentId="velt-autocomplete-chip-tooltip",this._shadowDom=!1,this.isExplicitShadowDom=!1,this.componentConfigSignal=A({}),this.subscriptions=[],this.wireframeService=Q(Ft)}ngOnInit(){try{super.ngOnInit();let t=this.elementRef.nativeElement,e=t.getAttribute("shadow-dom")??t.getAttribute("shadowdom");this.isExplicitShadowDom=e!==null&&e!=="false",this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),this.subscriptions.push(this.wireframeService.getWireframe$("velt-autocomplete-chip-tooltip-wireframe").subscribe(a=>{if(a){let c=document.createElement(a.tagName);c.innerHTML=a.innerHTML,this.template=c}}))}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipComponent OnInit: ",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy(),this.subscriptions.forEach(t=>{t.unsubscribe()})}catch{}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-chip-tooltip-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant",userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["tooltipContainerRef",""],[4,"veltIf"],[4,"ngTemplateOutlet"],["class","velt-autocomplete-chip-tooltip",4,"veltDynamicTemplate"],[1,"velt-autocomplete-chip-tooltip"],[1,"velt-autocomplete-chip-tooltip--icon"],[3,"componentConfigSignal"],[1,"velt-autocomplete-chip-tooltip--content"],[1,"velt-autocomplete-chip-tooltip--name"],[1,"velt-autocomplete-chip-tooltip--description"]],template:function(e,i){if(e&1&&w(0,er,1,7,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%]{display:flex;background:var(--velt-background-0);border-radius:var(--velt-border-radius-sm);padding:var(--velt-spacing-md);margin:var(--velt-spacing-xs) 0;box-shadow:0 4px 21px #00000014;gap:var(--velt-spacing-md);max-width:256px;line-height:1.3;align-items:center}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--icon[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:var(--velt-border-radius-full);overflow:hidden;flex-shrink:0}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--icon[_ngcontent-%COMP%] snippyly-user-avatar[_ngcontent-%COMP%]{display:flex}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--icon[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--icon-svg[_ngcontent-%COMP%]{width:100%;height:100%;padding:var(--velt-spacing-xs);display:flex;align-items:center;justify-content:center;background:linear-gradient(0deg,#ffffff0a,#ffffff0a),linear-gradient(0deg,#3772ff14,#3772ff14);box-sizing:border-box}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--icon[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--icon-svg[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:100%;height:100%}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--content[_ngcontent-%COMP%]{display:flex;flex-direction:column}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--content[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--name[_ngcontent-%COMP%]{font-size:var(--velt-font-size-sm);font-weight:400;line-height:21px;text-align:left;word-break:break-word;color:var(--velt-text-0)}.velt-autocomplete-chip-tooltip[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--content[_ngcontent-%COMP%] .velt-autocomplete-chip-tooltip--description[_ngcontent-%COMP%]{font-size:var(--velt-font-size-xs);font-weight:400;line-height:17px;letter-spacing:.01em;text-align:left;color:var(--velt-text-5);word-break:break-word}"],changeDetection:0});let n=r;return n})();var or=(n,r,o)=>({componentConfigSignal:n,parentLocalUIState:r,selectorItem:o}),rr=(n,r)=>({condition:n,data:r}),de=n=>({$implicit:n}),ir=(n,r)=>({componentConfigSignal:n,userContact:r}),me=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-option-description-wireframe",variant:o,setIfCondition:t,componentElementRef:e}),ar=(n,r)=>({componentConfigSignal:n,custom:r}),lr=(n,r)=>({componentConfigSignal:n,group:r}),pn=()=>({});function cr(n,r){n&1&&B(0)}function sr(n,r){if(n&1&&v(0,cr,1,0,"ng-container",4),n&2){l();let o=W(5),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,de,t.selectorItem==null?null:t.selectorItem.contact))}}function dr(n,r){n&1&&B(0)}function mr(n,r){if(n&1&&v(0,dr,1,0,"ng-container",4),n&2){l();let o=W(7),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,de,t.selectorItem==null?null:t.selectorItem.custom))}}function pr(n,r){n&1&&B(0)}function vr(n,r){if(n&1&&v(0,pr,1,0,"ng-container",4),n&2){l();let o=W(9),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,de,t.selectorItem==null?null:t.selectorItem.group))}}function gr(n,r){if(n&1&&(x(0,"p",7),U(1),V(2,"translate"),k()),n&2){let o=l(2).$implicit,t=l(3);Et("velt-autocomplete-option-description--secondary",(o.name==null?null:o.name.length)>0),M("aria-label",t.field?o[t.field]:o.email),u(),X(" ",t.field?o[t.field]:L(2,4,o.email)," ")}}function ur(n,r){if(n&1&&v(0,gr,3,6,"p",6),n&2){let o=l().$implicit,t=l(2),e=l();p("veltDynamicTemplate",z(4,me,e.template,O(1,ir,e.componentConfigSignal,o),t==null?null:t.variant,e.setIfCondition.bind(e),e.elementRef))}}function hr(n,r){if(n&1&&w(0,ur,1,10,"p",5),n&2){let o=r.$implicit,t=l(3);E((t.field?o!=null&&o[t.field]:(o.email==null?null:o.email.length)>0&&(o.name==null?null:o.name.length)>0)?0:-1)}}function fr(n,r){if(n&1&&(x(0,"p",7),U(1),V(2,"translate"),k()),n&2){let o=l(2).$implicit;M("aria-label",o.description),u(),X(" ",L(2,2,o.description)," ")}}function Cr(n,r){if(n&1&&v(0,fr,3,4,"p",8),n&2){let o=l().$implicit,t=l(2),e=l();p("veltDynamicTemplate",z(4,me,e.template,O(1,ar,e.componentConfigSignal,o),t==null?null:t.variant,e.setIfCondition.bind(e),e.elementRef))}}function _r(n,r){if(n&1&&w(0,Cr,1,10,"p",7),n&2){let o=r.$implicit;E((o.description==null?null:o.description.length)>0?0:-1)}}function br(n,r){if(n&1&&(x(0,"p",7),U(1),V(2,"translate"),k()),n&2){let o,t,e=l().$implicit,i=l(3);M("aria-label",((o=i.objectKeys((e==null?null:e.users)||Nt(5,pn)))==null?null:o.length)+" members"),u(),Yt(" ",(t=i.objectKeys((e==null?null:e.users)||Nt(6,pn)))==null?null:t.length," ",L(2,3,"members")," ")}}function xr(n,r){if(n&1&&v(0,br,3,7,"p",8),n&2){let o=r.$implicit,t=l(2),e=l();p("veltDynamicTemplate",z(4,me,e.template,O(1,lr,e.componentConfigSignal,o),t==null?null:t.variant,e.setIfCondition.bind(e),e.elementRef))}}function Sr(n,r){if(n&1&&(S(0),w(1,sr,1,4,"ng-container")(2,mr,1,4,"ng-container")(3,vr,1,4,"ng-container"),v(4,hr,1,1,"ng-template",null,0,J)(6,_r,1,1,"ng-template",null,1,J)(8,xr,1,10,"ng-template",null,2,J),y()),n&2){let o=l(2);u(),E((o.selectorItem==null?null:o.selectorItem.type)==="contact"?1:(o.selectorItem==null?null:o.selectorItem.type)==="custom"?2:(o.selectorItem==null?null:o.selectorItem.type)==="group"?3:-1)}}function yr(n,r){if(n&1&&v(0,Sr,10,1,"ng-container",3),n&2){let o=l();p("veltIf",O(5,rr,o.conditionSignal(),rt(1,or,o.componentConfigSignal,o.localUIStateSignal,o.selectorItem)))}}var vn=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}set userId(t){this.resolveUserIdToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}constructor(){super(),this.objectKeys=Object.keys,this.componentConfigSignal=A({}),this.componentId="velt-autocomplete-option-description"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal,selectorItem:this.selectorItem})}catch(t){this.loggingService.catch("Error in AutocompleteOptionDescriptionComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteOptionDescriptionComponent ngOnDestroy:",t)}}setupA11yAttributes(){try{ft(this.hostElementRef.nativeElement,this.componentId)}catch(t){this.loggingService.catch("Error in AutocompleteOptionDescriptionComponent setupA11yAttributes:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-option-description-internal"]],inputs:{selectorItem:"selectorItem",field:"field",userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["contactEmailRef",""],["customDescriptionRef",""],["groupDescriptionRef",""],[4,"veltIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"line-height-1","velt-autocomplete-option-description",3,"velt-autocomplete-option-description--secondary"],["class","line-height-1 velt-autocomplete-option-description",3,"velt-autocomplete-option-description--secondary",4,"veltDynamicTemplate"],[1,"line-height-1","velt-autocomplete-option-description"],["class","line-height-1 velt-autocomplete-option-description",4,"veltDynamicTemplate"]],template:function(e,i){if(e&1&&w(0,yr,1,8,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);display:block}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-autocomplete-option-description[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--velt-text-8);font-size:var(--velt-font-size-xs);margin:0;line-height:18px}"],changeDetection:0});let n=r;return n})();var kr=(n,r,o)=>({componentConfigSignal:n,parentLocalUIState:r,selectorItem:o}),Ir=(n,r)=>({condition:n,data:r}),Or=n=>({componentConfigSignal:n}),gn=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-option-error-icon-wireframe",variant:o,setIfCondition:t,componentElementRef:e}),Dr=n=>({$implicit:n}),wr=(n,r,o)=>({componentConfigSignal:n,isNewContact:r,userContact:o});function Er(n,r){if(n&1&&(x(0,"div",4)(1,"div",5),mt(),x(2,"svg",6),Y(3,"path",7)(4,"path",8),k()()()),n&2){let o=l(4);u(),M("data-testid",o.componentId+"-icon"),u(),M("data-testid",o.componentId+"-svg")}}function Tr(n,r){if(n&1&&(x(0,"div",2),V(1,"translate"),v(2,Er,5,2,"div",3),k()),n&2){let o=l(2),t=l();M("aria-label",L(1,3,"Invalid contact"))("data-testid",t.componentId),u(2),p("veltDynamicTemplate",z(7,gn,t.template,R(5,Or,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function Ar(n,r){n&1&&B(0)}function Mr(n,r){if(n&1&&v(0,Ar,1,0,"ng-container",9),n&2){l();let o=W(4),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,Dr,t.selectorItem==null?null:t.selectorItem.contact))}}function Pr(n,r){if(n&1&&(x(0,"div",4)(1,"div",10),mt(),x(2,"svg",6),Y(3,"path",7)(4,"path",8),k()()()),n&2){let o=l(4),t=l();u(),p("title",o.newUserContactError),M("title",o.newUserContactError)("data-testid",t.componentId+"-icon"),u(),M("data-testid",t.componentId+"-svg")}}function Fr(n,r){if(n&1&&(x(0,"div",2),V(1,"translate"),v(2,Pr,5,4,"div",3),k()),n&2){let o=l().$implicit,t=l(2),e=l();M("aria-label",L(1,3,(t==null?null:t.newUserContactError)||"Invalid contact"))("data-testid",e.componentId),u(2),p("veltDynamicTemplate",z(9,gn,e.template,rt(5,wr,e.componentConfigSignal,e.isNewContact,o),t==null?null:t.variant,e.setIfCondition.bind(e),e.elementRef))}}function Rr(n,r){if(n&1&&w(0,Fr,3,15,"div",2),n&2){let o=l(2),t=l();E(t.isNewContact&&o.newUserContactError?0:-1)}}function jr(n,r){if(n&1&&(S(0),w(1,Tr,3,13,"div",2)(2,Mr,1,4,"ng-container"),v(3,Rr,1,1,"ng-template",null,0,J),y()),n&2){let o=l(2);u(),E(o.defaultCondition()?(o.selectorItem==null?null:o.selectorItem.type)==="contact"?2:-1:1)}}function Ur(n,r){if(n&1&&v(0,jr,5,1,"ng-container",1),n&2){let o=l();p("veltIf",O(5,Ir,o.conditionSignal(),rt(1,kr,o.componentConfigSignal,o.localUIStateSignal,o.selectorItem)))}}var un=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}set userId(t){this.resolveUserIdToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}constructor(){super(),this.componentConfigSignal=A({}),this.componentId="velt-autocomplete-error-icon"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal,selectorItem:this.selectorItem,isNewContact:this.isNewContact})}catch(t){this.loggingService.catch("Error in AutocompleteOptionErrorIconComponent ngOnInit:",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteOptionErrorIconComponent ngOnDestroy:",t)}}setupA11yAttributes(){try{ft(this.hostElementRef.nativeElement,this.componentId)}catch(t){this.loggingService.catch("Error in AutocompleteOptionErrorIconComponent setupA11yAttributes:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-option-error-icon-internal"]],inputs:{selectorItem:"selectorItem",isNewContact:"isNewContact",userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["errorIconRef",""],[4,"veltIf"],["role","alert"],["class","velt-autocomplete-option-error-icon",4,"veltDynamicTemplate"],[1,"velt-autocomplete-option-error-icon"],[1,"s-flex"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16","aria-hidden","true","focusable","false",1,"bi","bi-exclamation-triangle"],["fill","red","d","M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z"],["fill","red","d","M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995z"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"s-flex",3,"title"]],template:function(e,i){if(e&1&&w(0,Ur,1,8,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-autocomplete-option-error-icon[_ngcontent-%COMP%]{margin-inline:var(--velt-spacing-lg)}.velt-autocomplete-option-error-icon[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:transparent;border:none;padding:0;margin:0;cursor:pointer;outline:none;color:var(--velt-text-1)}"],changeDetection:0});let n=r;return n})();var Nr=(n,r,o)=>({componentConfigSignal:n,parentLocalUIState:r,selectorItem:o}),Vr=(n,r)=>({condition:n,data:r}),Lr=(n,r)=>({componentConfigSignal:n,selectorItem:r}),zr=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-option-icon-wireframe",variant:o,setIfCondition:t,componentElementRef:e}),pe=n=>({$implicit:n});function Br(n,r){n&1&&B(0)}function $r(n,r){if(n&1&&v(0,Br,1,0,"ng-container",6),n&2){l(2);let o=W(3),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,pe,t.selectorItem==null?null:t.selectorItem.contact))}}function Gr(n,r){n&1&&B(0)}function Hr(n,r){if(n&1&&v(0,Gr,1,0,"ng-container",6),n&2){l(2);let o=W(5),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,pe,t.selectorItem==null?null:t.selectorItem.custom))}}function Wr(n,r){n&1&&B(0)}function Jr(n,r){if(n&1&&v(0,Wr,1,0,"ng-container",6),n&2){l(2);let o=W(7),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,pe,t.selectorItem==null?null:t.selectorItem.group))}}function Kr(n,r){if(n&1&&(x(0,"div",5),w(1,$r,1,4,"ng-container")(2,Hr,1,4,"ng-container")(3,Jr,1,4,"ng-container"),k()),n&2){let o=l(3);M("data-testid",o.componentId)("aria-label","Option icon"),u(),E((o.selectorItem==null?null:o.selectorItem.type)==="contact"?1:(o.selectorItem==null?null:o.selectorItem.type)==="custom"?2:(o.selectorItem==null?null:o.selectorItem.type)==="group"?3:-1)}}function Yr(n,r){if(n&1&&(mt(),x(0,"svg",7),Y(1,"path",9),k()),n&2){let o=l(4);M("data-testid",o.componentId+"-contact-at")}}function Xr(n,r){if(n&1&&Y(0,"snippyly-user-avatar",8),n&2){let o=l().$implicit,t=l(3);p("size",32)("user",o),M("data-testid",t.componentId+"-contact-avatar")}}function Zr(n,r){if(n&1&&w(0,Yr,2,1,":svg:svg",7)(1,Xr,1,3,"snippyly-user-avatar",8),n&2){let o=r.$implicit;E((o==null?null:o.visibility)==="here"?0:1)}}function qr(n,r){if(n&1&&(Y(0,"div",10),V(1,"safeSvg")),n&2){let o=l().$implicit,t=l(3);p("innerHTML",L(1,2,o.icon.svg),Gt),M("data-testid",t.componentId+"-custom-svg")}}function Qr(n,r){if(n&1&&Y(0,"img",11),n&2){let o=l().$implicit,t=l(3);p("src",o.icon.url,Ht),M("alt",(o==null?null:o.description)||"Custom icon")("data-testid",t.componentId+"-custom-img")}}function ti(n,r){if(n&1&&(w(0,qr,2,4,"div",10),w(1,Qr,1,3,"img",11)),n&2){let o=r.$implicit;E(!(o==null||o.icon==null)&&o.icon.svg?0:-1),u(),E(!(o==null||o.icon==null)&&o.icon.url?1:-1)}}function ei(n,r){if(n&1&&(mt(),x(0,"svg",12),Y(1,"path",13),k()),n&2){let o=l(3);M("data-testid",o.componentId+"-group-icon")}}function ni(n,r){if(n&1&&(S(0),v(1,Kr,4,3,"div",4)(2,Zr,2,1,"ng-template",null,0,J)(4,ti,2,2,"ng-template",null,1,J)(6,ei,2,1,"ng-template",null,2,J),y()),n&2){let o=l(),t=l();u(),p("veltDynamicTemplate",z(4,zr,t.template,O(1,Lr,t.componentConfigSignal,t.selectorItem),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function oi(n,r){if(n&1&&v(0,ni,8,10,"ng-container",3),n&2){let o=l();p("veltIf",O(5,Vr,o.conditionSignal(),rt(1,Nr,o.componentConfigSignal,o.localUIStateSignal,o.selectorItem)))}}var hn=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}set userId(t){this.resolveUserIdToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}constructor(){super(),this.componentConfigSignal=A({}),this.componentId="velt-autocomplete-icon"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal,selectorItem:this.selectorItem})}catch(t){this.loggingService.catch("Error in AutocompleteOptionIconComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteOptionIconComponent ngOnDestroy:",t)}}setupA11yAttributes(){try{let t=this.hostElementRef.nativeElement;t.setAttribute("role","presentation"),t.setAttribute("data-testid",this.componentId+"-container")}catch(t){this.loggingService.catch("Error in AutocompleteOptionIconComponent setupA11yAttributes:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-option-icon-internal"]],inputs:{selectorItem:"selectorItem",userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["contactAvatarRef",""],["customAvatarRef",""],["groupAvatarRef",""],[4,"veltIf"],["class","velt-autocomplete-option-icon","role","img",4,"veltDynamicTemplate"],["role","img",1,"velt-autocomplete-option-icon"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","fill","none","viewBox","0 0 16 16","aria-hidden","true","focusable","false",1,"bi","bi-at"],[3,"size","user"],["fill","currentColor","d","M13.106 7.222c0-2.967-2.249-5.032-5.482-5.032-3.35 0-5.646 2.318-5.646 5.702 0 3.493 2.235 5.708 5.762 5.708.862 0 1.689-.123 2.304-.335v-.862c-.43.199-1.354.328-2.29.328-2.926 0-4.813-1.88-4.813-4.798 0-2.844 1.921-4.881 4.594-4.881 2.735 0 4.608 1.688 4.608 4.156 0 1.682-.554 2.769-1.416 2.769-.492 0-.772-.28-.772-.76V5.206H8.923v.834h-.11c-.266-.595-.881-.964-1.6-.964-1.4 0-2.378 1.162-2.378 2.823 0 1.737.957 2.906 2.379 2.906.8 0 1.415-.39 1.709-1.087h.11c.081.67.703 1.148 1.503 1.148 1.572 0 2.57-1.415 2.57-3.643zm-7.177.704c0-1.197.54-1.907 1.456-1.907.93 0 1.524.738 1.524 1.907S8.308 9.84 7.371 9.84c-.895 0-1.442-.725-1.442-1.914z"],[1,"velt-autocomplete-option-icon--custom-svg",3,"innerHTML"],[1,"velt-autocomplete-option-icon--custom-img",3,"src"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16","aria-hidden","true","focusable","false",1,"bi","bi-people-fill"],["d","M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5.784 6A2.24 2.24 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.3 6.3 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5"]],template:function(e,i){if(e&1&&w(0,oi,1,8,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:['html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-autocomplete-option-icon--placeholder[_ngcontent-%COMP%]{z-index:2;opacity:.8}.velt-autocomplete-option-icon[_ngcontent-%COMP%]{min-width:calc((2.25rem + 0px) * var(--velt-base-rem-unit));width:calc((2.25rem + 0px) * var(--velt-base-rem-unit));min-height:calc((2.25rem + 0px) * var(--velt-base-rem-unit));height:calc((2.25rem + 0px) * var(--velt-base-rem-unit));box-sizing:border-box;background-clip:padding-box;border:solid 2px transparent;display:flex;align-items:center;justify-content:center;position:relative;margin-right:var(--velt-spacing-md)}.velt-autocomplete-option-icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:var(--velt-border-radius-full);z-index:2;object-fit:cover}.velt-autocomplete-option-icon[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit;background:inherit}.velt-autocomplete-option-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:var(--velt-text-1)}'],changeDetection:0});let n=r;return n})();var ri=(n,r,o)=>({componentConfigSignal:n,parentLocalUIState:r,selectorItem:o}),ii=(n,r)=>({condition:n,data:r}),ve=n=>({$implicit:n}),ai=(n,r)=>({componentConfigSignal:n,userContact:r}),ge=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-option-name-wireframe",variant:o,setIfCondition:t,componentElementRef:e}),li=(n,r)=>({componentConfigSignal:n,custom:r}),ci=(n,r)=>({componentConfigSignal:n,group:r});function si(n,r){n&1&&B(0)}function di(n,r){if(n&1&&v(0,si,1,0,"ng-container",4),n&2){l();let o=W(5),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,ve,t.selectorItem==null?null:t.selectorItem.contact))}}function mi(n,r){n&1&&B(0)}function pi(n,r){if(n&1&&v(0,mi,1,0,"ng-container",4),n&2){l();let o=W(7),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,ve,t.selectorItem==null?null:t.selectorItem.custom))}}function vi(n,r){n&1&&B(0)}function gi(n,r){if(n&1&&v(0,vi,1,0,"ng-container",4),n&2){l();let o=W(9),t=l(2);p("ngTemplateOutlet",o)("ngTemplateOutletContext",R(2,ve,t.selectorItem==null?null:t.selectorItem.group))}}function ui(n,r){if(n&1&&(x(0,"p",5),U(1),V(2,"translate"),k()),n&2){let o=l(2).$implicit,t=l(3);M("data-testid",t.componentId+"-contact-text")("aria-label",o.name||o.email),u(),X(" ",L(2,3,o.name||o.email)," ")}}function hi(n,r){if(n&1&&v(0,ui,3,5,"p",7),n&2){let o=l().$implicit,t=l(2),e=l();p("veltDynamicTemplate",z(4,ge,e.template,O(1,ai,e.componentConfigSignal,o),t==null?null:t.variant,e.setIfCondition.bind(e),e.elementRef))}}function fi(n,r){n&1&&Y(0,"velt-skeleton-loader-internal",6)}function Ci(n,r){if(n&1&&w(0,hi,1,10,"p",5)(1,fi,1,0,"velt-skeleton-loader-internal",6),n&2){let o=r.$implicit;E((o.name==null?null:o.name.length)>0||(o==null||o.email==null?null:o.email.length)>0?0:1)}}function _i(n,r){if(n&1&&(x(0,"p",5),U(1),V(2,"translate"),k()),n&2){let o=l(2).$implicit,t=l(3);M("data-testid",t.componentId+"-custom-text")("aria-label",o.name),u(),X(" ",L(2,3,o.name)," ")}}function bi(n,r){if(n&1&&v(0,_i,3,5,"p",7),n&2){let o=l().$implicit,t=l(2),e=l();p("veltDynamicTemplate",z(4,ge,e.template,O(1,li,e.componentConfigSignal,o),t==null?null:t.variant,e.setIfCondition.bind(e),e.elementRef))}}function xi(n,r){if(n&1&&w(0,bi,1,10,"p",5),n&2){let o=r.$implicit;E((o.name==null?null:o.name.length)>0?0:-1)}}function Si(n,r){if(n&1&&(x(0,"p",5),U(1),V(2,"translate"),k()),n&2){let o=l(2).$implicit,t=l(3);M("data-testid",t.componentId+"-group-text")("aria-label",o==null||o.metadata==null?null:o.metadata.groupName),u(),X(" ",L(2,3,o==null||o.metadata==null?null:o.metadata.groupName)," ")}}function yi(n,r){if(n&1&&v(0,Si,3,5,"p",7),n&2){let o=l().$implicit,t=l(2),e=l();p("veltDynamicTemplate",z(4,ge,e.template,O(1,ci,e.componentConfigSignal,o),t==null?null:t.variant,e.setIfCondition.bind(e),e.elementRef))}}function ki(n,r){if(n&1&&w(0,yi,1,10,"p",5),n&2){let o=r.$implicit;E((o==null||o.metadata==null||o.metadata.groupName==null?null:o.metadata.groupName.length)>0?0:-1)}}function Ii(n,r){if(n&1&&(S(0),w(1,di,1,4,"ng-container")(2,pi,1,4,"ng-container")(3,gi,1,4,"ng-container"),v(4,Ci,2,1,"ng-template",null,0,J)(6,xi,1,1,"ng-template",null,1,J)(8,ki,1,1,"ng-template",null,2,J),y()),n&2){let o=l(2);u(),E((o.selectorItem==null?null:o.selectorItem.type)==="contact"?1:(o.selectorItem==null?null:o.selectorItem.type)==="custom"?2:(o.selectorItem==null?null:o.selectorItem.type)==="group"?3:-1)}}function Oi(n,r){if(n&1&&v(0,Ii,10,1,"ng-container",3),n&2){let o=l();p("veltIf",O(5,ii,o.conditionSignal(),rt(1,ri,o.componentConfigSignal,o.localUIStateSignal,o.selectorItem)))}}var fn=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}set userId(t){this.resolveUserIdToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}constructor(){super(),this.componentConfigSignal=A({}),this.componentId="velt-autocomplete-name"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal,selectorItem:this.selectorItem})}catch(t){this.loggingService.catch("Error in AutocompleteOptionNameComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteOptionNameComponent ngOnDestroy:",t)}}setupA11yAttributes(){try{let t=this.hostElementRef.nativeElement;t.setAttribute("role","presentation"),t.setAttribute("data-testid",this.componentId+"-container")}catch(t){this.loggingService.catch("Error in AutocompleteOptionNameComponent setupA11yAttributes:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-option-name-internal"]],inputs:{selectorItem:"selectorItem",userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[["contactNameRef",""],["customNameRef",""],["groupNameRef",""],[4,"veltIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["role","option",1,"line-height-1","velt-autocomplete-option-name"],["height","21px","width","80px","borderRadius","20px"],["class","line-height-1 velt-autocomplete-option-name","role","option",4,"veltDynamicTemplate"]],template:function(e,i){if(e&1&&w(0,Oi,1,8,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-autocomplete-option-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;color:var(--velt-text-1);font-size:var(--velt-font-size-sm);margin:0;line-height:21px;white-space:nowrap}"],changeDetection:0});let n=r;return n})();var Di=(n,r,o,t,e,i,a)=>({componentConfigSignal:n,parentLocalUIState:r,selectorItem:o,isNewContact:t,multiSelect:e,isSelected:i,readOnly:a}),wi=(n,r)=>({condition:n,data:r}),Ei=(n,r,o,t,e,i)=>({componentConfigSignal:n,isNewContact:r,selectorItem:o,multiSelect:t,isSelected:e,readOnly:i}),Ti=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-option-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function Ai(n,r){if(n&1&&(x(0,"div",3),Y(1,"velt-autocomplete-option-icon-internal",4),x(2,"div",5),Y(3,"velt-autocomplete-option-name-internal",4)(4,"velt-autocomplete-option-description-internal",4),k(),Y(5,"velt-autocomplete-option-error-icon-internal",6),k()),n&2){let o=l(2),t=l();Et("velt-autocomplete-option--multi-select",t.multiSelect)("velt-autocomplete-option--selected",t.isSelected),M("data-testid",t.componentId)("aria-selected",t.isSelected)("aria-disabled",!!(o!=null&&o.newUserContactError)),u(),p("selectorItem",t.selectorItem)("componentConfigSignal",t.componentConfigSignal),u(),M("data-testid",t.componentId+"-details"),u(),p("selectorItem",t.selectorItem)("componentConfigSignal",t.componentConfigSignal),u(),p("selectorItem",t.selectorItem)("componentConfigSignal",t.componentConfigSignal),u(),p("selectorItem",t.selectorItem)("isNewContact",t.isNewContact)("componentConfigSignal",t.componentConfigSignal)}}function Mi(n,r){n&1&&(x(0,"div",2),mt(),x(1,"svg",7),Y(2,"path",8),k()())}function Pi(n,r){if(n&1&&(S(0),v(1,Ai,6,17,"div",1),w(2,Mi,3,0,"div",2),y()),n&2){let o=l(),t=l();u(),p("veltDynamicTemplate",z(9,Ti,t.template,Ie(2,Ei,t.componentConfigSignal,t.isNewContact,t.selectorItem,t.multiSelect,t.isSelected,t.readOnly),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef)),u(),E(t.multiSelect&&!t.readOnly&&t.isSelected?2:-1)}}function Fi(n,r){if(n&1&&v(0,Pi,3,15,"ng-container",0),n&2){let o=l();p("veltIf",O(9,wi,o.conditionSignal(),Oe(1,Di,o.componentConfigSignal,o.localUIStateSignal,o.selectorItem,o.isNewContact,o.multiSelect,o.isSelected,o.readOnly)))}}var Cn=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}set userId(t){this.resolveUserIdToContact(t,e=>{this.selectorItem=e?{type:"contact",contact:e}:void 0})}constructor(){super(),this.multiSelect=!1,this.isSelected=!1,this.readOnly=!1,this.componentConfigSignal=A({}),this.subscriptions=[],this.wireframeService=Q(Ft),this.componentId="velt-autocomplete-option"}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let t="velt-autocomplete-option-wireframe";this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal,selectorItem:this.selectorItem,isNewContact:this.isNewContact}),this.variant&&(t+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(t).subscribe(e=>{if(e){let i=document.createElement(e.tagName);i.innerHTML=e.innerHTML,this.template=i}}))}catch(t){this.loggingService.catch("Error in AutocompleteOptionComponent OnInit: ",t)}}getPublishedVeltEntity(){return this.selectorItem}setupA11yAttributes(){try{let t=this.hostElementRef.nativeElement;t.setAttribute("role","option"),t.setAttribute("data-testid",this.componentId+"-container"),t.setAttribute("aria-label",this.getOptionLabel())}catch(t){this.loggingService.catch("Error in AutocompleteOptionComponent setupA11yAttributes:",t)}}ngOnDestroy(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: red;"),super.ngOnDestroy(),this._userIdSub?.unsubscribe(),this.subscriptions.forEach(t=>t?.unsubscribe())}catch(t){this.loggingService.catch("Error in AutocompleteOptionComponent OnDestroy: ",t)}}getOptionLabel(){try{switch(this.selectorItem?.type){case"contact":return this.getContactLabel();case"custom":return this.selectorItem.custom?.name||"Custom option";case"group":return this.selectorItem.group?.metadata?.groupName||"Group option";default:return"Option"}}catch(t){return this.loggingService.catch("Error in AutocompleteOptionComponent getOptionLabel:",t),"Option"}}getContactLabel(){try{let t=this.selectorItem?.contact,e=t?.name||t?.email||"Contact";return this.isNewContact?`New contact: ${e}`:e}catch(t){return this.loggingService.catch("Error in AutocompleteOptionComponent getContactLabel:",t),"Contact"}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-option-internal"]],inputs:{selectorItem:"selectorItem",isNewContact:"isNewContact",variant:"variant",multiSelect:"multiSelect",isSelected:"isSelected",readOnly:"readOnly",userObject:"userObject",userId:"userId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"veltIf"],["class","velt-autocomplete-option--container","role","option",3,"velt-autocomplete-option--multi-select","velt-autocomplete-option--selected",4,"veltDynamicTemplate"],[1,"velt-autocomplete-option--check"],["role","option",1,"velt-autocomplete-option--container"],[3,"selectorItem","componentConfigSignal"],[1,"velt-autocomplete-option--details"],[3,"selectorItem","isNewContact","componentConfigSignal"],["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M11.6667 3.5L5.25 9.91667L2.33333 7","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"]],template:function(e,i){if(e&1&&w(0,Fi,1,12,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);width:100%;display:flex;align-items:center;min-width:0;overflow:hidden;box-sizing:border-box}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-autocomplete-option--container[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;min-width:0}.velt-autocomplete-option--details[_ngcontent-%COMP%]{overflow:hidden;flex-grow:1}.velt-autocomplete-option--check[_ngcontent-%COMP%]{flex-shrink:0;width:24px;height:24px;border-radius:50%;background:var(--velt-accent-transparent, rgba(0, 168, 112, .15));display:flex;align-items:center;justify-content:center;color:var(--velt-accent, #00a870);margin-left:8px}"],changeDetection:0});let n=r;return n})();var _n=(()=>{let r=class r{constructor(t,e,i){this.loggingService=t,this.dynamicDataService=e,this.injector=i,this.path="",this.field="",this.extractedProps={},this.valueSignal=A(void 0),this.dataComponentConfigSignal=A({}),this.subscription=[];try{this.subscription.push(this.dynamicDataService.getCommonData().subscribe(a=>{this.dataComponentConfigSignal.update(c=>(c=m(m({},c),a),c)),this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps)}))}catch(a){this.loggingService.catch("Error in DataComponent constructor: ",a)}}ngOnInit(){try{(this.path||this.field)&&(this.extractProps(),this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps))}catch(t){this.loggingService.catch("Error in DataComponent ngOnInit: ",t)}}ngOnDestroy(){try{this.subscription.forEach(t=>t.unsubscribe())}catch(t){this.loggingService.catch("Error in DataComponent ngOnDestroy: ",t)}}updateDataComponentConfigSignal(t,e){try{t==="dataComponentConfigSignal"?this.dataComponentConfigSignal.set(e):this.dataComponentConfigSignal.update(i=>f(m({},i),{[t]:e})),(this.path||this.field)&&(this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps))}catch(i){this.loggingService.catch("Error in DataComponent updateDataComponentConfigSignal: ",i)}}extractProps(){try{let t=this.field||this.path;this.extractedProps[t]={value:null,path:null,isDynamicPath:this.hasDynamicParts(t)}}catch(t){this.loggingService.catch("Error in DataComponent extractProps: ",t)}}hasDynamicParts(t){try{let e=/\[[^\]'"]*[^\]'"]\]/.test(t),i=/\[[^[\]]*[\.\[][^[\]]*\]/.test(t);return e||i}catch(e){return this.loggingService.catch("Error checking for dynamic path: ",e),!1}}evaluateCondition(){try{let t=this.field||this.path,e=this.extractedProps[t].value;this.valueSignal.set(e)}catch(t){this.loggingService.catch("Error in DataComponent evaluateCondition: ",t)}}getComputedValues(t,e,i,a,c,d){try{Object.keys(i).forEach(s=>{let h;if(ot(t)?h=at(()=>lt(t(),i[s].path)):h=at(()=>lt(t,i[s].path)),ot(h()))pt(()=>{try{let g=h()();i[s].value=g,this.extractedProps=i,this.evaluateCondition()}catch{}},{injector:this.injector});else{let g=h();i[s].value=g,this.extractedProps=i,this.evaluateCondition()}})}catch(s){this.loggingService.catch("Error in DynamicDataService getComputedValues: ",s)}}};r.\u0275fac=function(e){return new(e||r)(I(N),I(b),I(it))},r.\u0275cmp=P({type:r,selectors:[["app-data"]],inputs:{path:"path",field:"field"},standalone:!1,features:[F([b])],decls:2,vars:3,template:function(e,i){e&1&&(U(0),V(1,"translate")),e&2&&_t(L(1,1,i.valueSignal()))},dependencies:[qe],encapsulation:2,changeDetection:0});let n=r;return n})();var Ri=(n,r)=>({template:n,context:r,cloneTemplate:!0});function ji(n,r){n&1&&B(0)}function Ui(n,r){if(n&1&&(S(0),v(1,ji,1,0,"ng-container",1),y()),n&2){let o=l();u(),p("veltDynamicTemplate",O(1,Ri,o.template,o.dataComponentConfigSignal()))}}var bn=(()=>{let r=class r{constructor(t,e,i){this.loggingService=t,this.dynamicDataService=e,this.injector=i,this.condition="",this.showContent=A(!1),this.conditionRegex=/\{(.*?)\}/g,this.extractedProps={},this.dataComponentConfigSignal=A({}),this.subscription=[],this.cleanupEffects=[];try{this.subscription.push(this.dynamicDataService.getCommonData().subscribe(a=>{this.dataComponentConfigSignal.update(c=>(c=m(m({},c),a),c)),this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps)}))}catch(a){this.loggingService.catch("Error in IfComponent constructor: ",a)}}ngOnInit(){try{this.condition&&(this.extractProps(),this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps))}catch(t){this.loggingService.catch("Error in IfComponent ngOnInit: ",t)}}ngOnDestroy(){try{this.cleanupEffects.forEach(t=>t.destroy()),this.cleanupEffects.length=0,this.subscription.forEach(t=>t.unsubscribe())}catch(t){this.loggingService.catch("Error in IfComponent ngOnDestroy: ",t)}}updateDataComponentConfigSignal(t,e){try{t==="dataComponentConfigSignal"?this.dataComponentConfigSignal.set(e):this.dataComponentConfigSignal.update(i=>f(m({},i),{[t]:e})),this.condition&&(this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps))}catch(i){this.loggingService.catch("Error in IfComponent updateDataComponentConfigSignal: ",i)}}extractProps(){try{this.extractedProps={},this.conditionRegex.lastIndex=0;let t;for(;(t=this.conditionRegex.exec(this.condition))!==null;){let e=t[1];this.extractedProps[e]={value:null,path:null,isDynamicPath:this.hasDynamicParts(e)}}}catch(t){this.loggingService.catch("Error in IfComponent extractProps: ",t)}}hasDynamicParts(t){try{let e=/\[[^\]'"]*[^\]'"]\]/.test(t),i=/\[[^[\]]*[\.\[][^[\]]*\]/.test(t);return e||i}catch(e){return this.loggingService.catch("Error checking for dynamic path: ",e),!1}}evaluateCondition(){try{let t=this.condition,e=this.extractedProps,i=t.replace(this.conditionRegex,(d,s)=>{let h=e[s];if(h&&h.value!==void 0){let g=h.value;return typeof g=="string"?`'${g}'`:typeof g=="boolean"||typeof g=="number"?String(g):g===null?"null":typeof g=="object"?g?"true":"false":String(g)}return"false"}),a=this.sanitizeCondition(i),c=this.dynamicDataService.safeEval(a);return this.showContent.set(c),c}catch(t){return this.loggingService.catch("Error in IfComponent evaluateCondition: ",t),this.showContent.set(!1),!1}}sanitizeCondition(t){try{return t.replace(/[^a-zA-Z0-9\s\+\-\*\/\%\(\)\!\=\<\>\|\&\.\[\]\{\},'"]/g,"")}catch(e){return this.loggingService.catch("Error in IfComponent sanitizeCondition: ",e),""}}getComputedValues(t,e,i,a,c,d){try{this.cleanupEffects.forEach(s=>s.destroy()),this.cleanupEffects.length=0,Object.keys(i).forEach(s=>{let h;if(ot(t)?h=at(()=>lt(t(),i[s].path)):h=at(()=>lt(t,i[s].path)),ot(h())){let g=pt(()=>{try{let T=h()();i[s].value=T,this.extractedProps=i,this.evaluateCondition()}catch{i[s].value="",this.extractedProps=i,this.evaluateCondition()}},{injector:this.injector});this.cleanupEffects.push(g)}else{let g=h();i[s].value=g,this.extractedProps=i,this.evaluateCondition()}})}catch(s){this.loggingService.catch("Error in DynamicDataService getComputedValues: ",s)}}};r.\u0275fac=function(e){return new(e||r)(I(N),I(b),I(it))},r.\u0275cmp=P({type:r,selectors:[["app-if"]],inputs:{template:"template",condition:"condition"},standalone:!1,features:[F([b])],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltDynamicTemplate"]],template:function(e,i){e&1&&v(0,Ui,2,4,"ng-container",0),e&2&&p("ngIf",i.showContent())},styles:["[_nghost-%COMP%]{display:flex;align-items:center}"],changeDetection:0});let n=r;return n})();var xn=(()=>{let r=class r{constructor(t,e,i){this.coreActionsService=t,this.loggingService=e,this.metadataService=i,this.buttonClickSubject$=new It,this.buttonToggleMap$=new zt({}),this.contextDataMapping={commentAnnotation:{source:["componentConfigSignal","data","annotation"],target:"commentAnnotation"},unreadCommentsMap:{source:["componentConfigSignal","unreadCommentsMap"],target:"unreadCommentAnnotationsMap"},comment:{source:["commentObj"],target:"comment"},index:{source:["i"],target:"index"},allAnnotations:{source:["componentConfigSignal","annotations"],target:"commentAnnotations"},systemFilteredAnnotations:{source:["componentConfigSignal","filteredCommentPinAnnotations"],target:"systemFilteredAnnotations"},notification:{source:["notification"],target:"notification"},allNotifications:{source:["componentConfigSignal","notificationsInSession"],target:"notifications"}}}buttonClick(d){return gt(this,arguments,function*({id:t,type:e,groupId:i,contextData:a,data:c}){try{this.buttonToggle(t,void 0,e,i);let h=this.extractButtonData(a),g=this.createButtonContext(t,e,i),T=yield this.metadataService.getGlobalMetadata(),D={};if(c){let s=c,{componentConfigSignal:C}=s,$=ue(s,["componentConfigSignal"]);if(D=m({},$),C&&typeof C=="function")try{let Z=C();Z&&typeof Z=="object"&&(D=m(m({},D),Z))}catch(Z){this.loggingService.catch("Error accessing componentConfigSignal: ",Z)}}let _=f(m({buttonContext:g},h),{metadata:T,data:D});this.buttonClickSubject$.next(_),this.coreActionsService.triggerAction(le.VELT_BUTTON_CLICK,_)}catch(h){this.loggingService.catch("Error in ButtonService buttonClick: ",h)}})}buttonActive({id:t,type:e,groupId:i,contextData:a}){try{let c=this.buttonToggleMap$.value?.[i||"ungrouped"]?.[t]||!0;this.buttonToggle(t,c,e,i)}catch(c){this.loggingService.catch("Error in ButtonService buttonClick: ",c)}}buttonToggle(t,e,i,a){try{let c=this.buttonToggleMap$.value,d=this.createNewToggleMap(c,t,e,i,a);this.buttonToggleMap$.next(d)}catch(c){this.loggingService.catch("Error in ButtonService buttonToggle: ",c)}}extractButtonData(t){try{let e={};return Object.entries(this.contextDataMapping).forEach(([i,a])=>{let c=this.getNestedValue(t,a.source);c!==void 0&&(e[a.target]=c)}),e}catch(e){return this.loggingService.catch("Error in ButtonService extractContextData: ",e),{}}}getNestedValue(t,e){try{let i=t;for(let a of e){if(i?.[a]===void 0)return;ot(i[a])?i=i[a]():i=i[a]}return i}catch(i){this.loggingService.catch("Error in ButtonService getNestedValue: ",i);return}}createButtonContext(t,e,i){try{let a={type:e,selections:this.buttonToggleMap$.value,clickedButtonId:t};return(e==="single-select"||e==="multi-select")&&i?f(m({},a),{groupId:i}):a}catch(a){return this.loggingService.catch("Error in ButtonService createButtonMetadata: ",a),{}}}createNewToggleMap(t,e,i,a,c){try{let d=m({},t);return a==="button-toggle"?f(m({},d),{ungrouped:f(m({},d.ungrouped),{[e]:i??!d.ungrouped?.[e]})}):a==="single-select"&&c?f(m({},d),{[c]:{[e]:i??!0}}):a==="multi-select"&&c?f(m({},d),{[c]:f(m({},d[c]),{[e]:i??!d[c]?.[e]})}):d}catch(d){return this.loggingService.catch("Error in ButtonService createNewToggleMap: ",d),{}}}buttonClickSubject(){return this.buttonClickSubject$.asObservable()}buttonToggleMap(){return this.buttonToggleMap$.asObservable()}resetVeltButtonState(t){return gt(this,null,function*(){try{if(t){let{id:c,group:d}=t,s=JSON.parse(JSON.stringify(this.buttonToggleMap$.value||{}));d&&c?delete s?.[d]?.[c]:d?delete s?.[d]:c&&Object.keys(s).forEach(h=>{Object.keys(s[h]).forEach(g=>{g===c&&delete s?.[h]?.[g]})}),this.buttonToggleMap$.next(s)}else this.buttonToggleMap$.next({});let e={selections:this.buttonToggleMap$.value},i=yield this.metadataService.getGlobalMetadata(),a={buttonContext:e,metadata:i};this.coreActionsService.triggerAction(le.VELT_BUTTON_CLICK,a)}catch(e){this.loggingService.catch("Error in ButtonService resetVeltButtonState: ",e)}})}buttonToggleMapValue(){return this.buttonToggleMap$.value}};r.\u0275fac=function(e){return new(e||r)(H(Ke),H(N),H(en))},r.\u0275prov=nt({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var Vi=n=>({componentConfigSignal:n}),Li=(n,r)=>({condition:n,data:r}),zi=(n,r)=>({componentConfigSignal:n,buttonComponentConfig:r}),Bi=(n,r,o,t)=>({template:n,context:r,cloneTemplate:!0,setIfCondition:o,componentElementRef:t});function $i(n,r){if(n&1&&(S(0),U(1),V(2,"translate"),y()),n&2){let o=l(5);u(),X(" ",L(2,1,o.id)," ")}}function Gi(n,r){if(n&1){let o=Dt();x(0,"div",3),wt("click",function(){yt(o);let e=l(4);return kt(e.onClick())}),v(1,$i,3,3,"ng-container",4),k()}if(n&2){let o=l().ngIf,t=l(3);Et("velt-button--disabled",o.disabled)("velt-button--active",t.group?o.buttonToggleMap==null||o.buttonToggleMap[t.group]==null?null:o.buttonToggleMap[t.group][t.id]:o.buttonToggleMap==null||o.buttonToggleMap.ungrouped==null?null:o.buttonToggleMap.ungrouped[t.id]),M("data-testid",t.componentId+"-"+t.id)("data-group",t.group?t.group:"ungrouped")("data-value",t.valueSignal()),u(),p("veltDynamicTemplate",bt(11,Bi,t.template,O(8,zi,t.dataComponentConfigSignal().componentConfigSignal,o),t.setIfCondition.bind(t),t.elementRef))}}function Hi(n,r){if(n&1&&(S(0),v(1,Gi,2,16,"div",2),y()),n&2){let o=l(3);u(),p("ngIf",o.id)}}function Wi(n,r){if(n&1&&(S(0),v(1,Hi,2,1,"ng-container",0),y()),n&2){let o=l(2);u(),p("ngIf",o.buttonComponentConfigSignal())}}function Ji(n,r){if(n&1&&(S(0),v(1,Wi,2,1,"ng-container",1),y()),n&2){let o=l();u(),p("veltIf",O(3,Li,o.conditionSignal(),R(1,Vi,o.dataComponentConfigSignal().componentConfigSignal)))}}var Sn=(()=>{let r=class r extends ct{set disabled(t){try{let e=t;typeof t=="string"&&(e=JSON.parse(t)),this.buttonComponentConfigSignal.update(i=>(i=f(m({},i),{disabled:e}),i))}catch{}}set active(t){try{let e=t;typeof t=="string"&&(e=JSON.parse(t)),this.buttonComponentConfigSignal.update(i=>(i=f(m({},i),{active:e}),i))}catch{}}constructor(t,e,i,a,c){super(a,i,e),this.buttonService=t,this.loggingService=e,this.dynamicDataService=i,this.elementRef=a,this.injector=c,this.type="button",this.componentId="velt-button",this.subscription=[],this.extractedProps={},this.valueSignal=A(void 0),this.dataComponentConfigSignal=A({}),this.buttonComponentConfigSignal=A({buttonToggleMap:{},active:!1,disabled:!1,contextData:{},internalId:null});try{this.subscription.push(this.dynamicDataService.getCommonData().subscribe(d=>{this.dataComponentConfigSignal.update(s=>(s=m(m({},s),d),s)),this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps)}))}catch(d){this.loggingService.catch("Error in ButtonComponent data functionality: ",d)}}ngOnInit(){try{super.ngOnInit(),this.subscription.push(this.buttonService.buttonToggleMap().subscribe(t=>{this.buttonComponentConfigSignal.update(e=>(e=f(m({},e),{buttonToggleMap:t}),e))})),this.buttonComponentConfigSignal.update(t=>(t=f(m({},t),{internalId:this.id?.includes("{")&&this.id?.includes("}")?this.id?.split("{")[1].split("}")[0]:this.id}),t)),this.buttonComponentConfigSignal().internalId&&(this.extractProps(),this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps)),setTimeout(()=>{this.buttonComponentConfigSignal().active&&this.buttonService.buttonActive({id:this.valueSignal(),type:this.type,groupId:this.group,contextData:this.buttonComponentConfigSignal().contextData})},100)}catch(t){this.loggingService.catch("Error in ButtonComponent ngOnInit: ",t)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscription.forEach(t=>{t.unsubscribe()})}catch(t){this.loggingService.catch("Error in ButtonComponent ngOnDestroy: ",t)}}onClick(){try{if(this.buttonComponentConfigSignal().disabled)return;this.buttonService.buttonClick({id:this.valueSignal(),type:this.type,groupId:this.group,contextData:this.buttonComponentConfigSignal().contextData,data:this.dataComponentConfigSignal()})}catch(t){this.loggingService.catch("Error in ButtonComponent onClick: ",t)}}updateDataComponentConfigSignal(t,e){try{t==="dataComponentConfigSignal"?this.dataComponentConfigSignal.set(e):this.dataComponentConfigSignal.update(i=>f(m({},i),{[t]:e})),this.buttonComponentConfigSignal.update(i=>(i=m({},i),i.contextData[t]=e,i))}catch(i){this.loggingService.catch("Error in ButtonComponent updateDataComponentConfigSignal: ",i)}}extractProps(){try{this.extractedProps[this.buttonComponentConfigSignal().internalId]={value:null,path:null}}catch(t){this.loggingService.catch("Error in ButtonComponent extractProps: ",t)}}evaluateCondition(){try{this.id?.includes("{")&&this.id?.includes("}")?(this.valueSignal.set(this.extractedProps[this.buttonComponentConfigSignal().internalId].value),this.elementRef.nativeElement.id=this.valueSignal()):(this.valueSignal.set(this.id),this.elementRef.nativeElement.id=this.id)}catch{}}getComputedValues(t,e,i,a,c,d){try{Object.keys(i).forEach(s=>{let h;ot(t)?h=at(()=>lt(t(),i[s].path)):h=at(()=>lt(t,i[s].path)),ot(h())?pt(()=>{try{i[s].value=h()(),this.extractedProps=i,this.evaluateCondition()}catch{}},{injector:this.injector}):(i[s].value=h(),this.extractedProps=i,this.evaluateCondition())})}catch(s){this.loggingService.catch("Error in ButtonComponent getComputedValues: ",s)}}};r.\u0275fac=function(e){return new(e||r)(I(xn),I(N),I(b),I(tt),I(it))},r.\u0275cmp=P({type:r,selectors:[["app-button"]],inputs:{id:"id",type:"type",group:"group",disabled:"disabled",active:"active"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","velt-button",3,"velt-button--disabled","velt-button--active","click",4,"ngIf"],[1,"velt-button",3,"click"],[4,"veltDynamicTemplate"]],template:function(e,i){e&1&&v(0,Ji,2,6,"ng-container",0),e&2&&p("ngIf",i.componentConfigSignal())},styles:[".velt-button--disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed;opacity:.5}"],changeDetection:0});let n=r;return n})();var Ki=(n,r,o)=>({componentConfigSignal:n,parentLocalUIState:r,group:o}),Yi=(n,r)=>({condition:n,data:r}),Xi=(n,r)=>({componentConfigSignal:n,group:r}),Zi=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-group-option-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function qi(n,r){if(n&1&&(S(0),x(1,"div",2)(2,"span",3),U(3),k()(),y()),n&2){let o=l(3);u(3),_t((o.group==null?null:o.group.name)||o.groupName)}}function Qi(n,r){if(n&1&&(S(0),v(1,qi,4,1,"ng-container",1),y()),n&2){let o=l(),t=l();u(),p("veltDynamicTemplate",z(4,Zi,t.template,O(1,Xi,t.componentConfigSignal,t.group),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function ta(n,r){if(n&1&&v(0,Qi,2,10,"ng-container",0),n&2){let o=l();p("veltIf",O(5,Yi,o.conditionSignal(),rt(1,Ki,o.componentConfigSignal,o.localUIStateSignal,o.group)))}}var yn=(()=>{let r=class r extends q{set group(t){this._group=t;let e=this._groupSetByParent;this._groupSetByParent=!!t,t?(this._groupIdSub?.unsubscribe(),this._groupIdSub=void 0):e&&this.resolveGroupId()}get group(){return this._group}set groupObject(t){try{if(this._groupSetByParent)return;if(!t){this._group=void 0,this.flushChangeDetection();return}let e=typeof t=="string"?JSON.parse(t):t;e&&typeof e=="object"&&(this._group=e,this.flushChangeDetection())}catch(e){this.loggingService.catch("Error parsing groupObject:",e)}}set groupId(t){this._groupId=t,this.resolveGroupId()}resolveGroupId(){try{if(this._groupSetByParent)return;this._groupIdSub?.unsubscribe(),this._groupIdSub=void 0;let t=this._groupId?.trim();if(!t){this._group=void 0,this.flushChangeDetection();return}this._groupIdSub=this.contactService.getOrganizationGroups$().subscribe(e=>{try{this._group=ea(e,t),this.flushChangeDetection()}catch(i){this.loggingService.catch("Error resolving groupId:",i)}})}catch(t){this.loggingService.catch("Error in groupId resolution:",t)}}constructor(){super(),this.componentId="velt-autocomplete-group-option",this._groupSetByParent=!1,this.contactService=Q(xt),this.componentConfigSignal=A({})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal,group:this.group})}catch(t){this.loggingService.catch("Error in AutocompleteGroupOptionComponent ngOnInit:",t)}}ngOnDestroy(){try{this._groupIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteGroupOptionComponent ngOnDestroy:",t)}}setupA11yAttributes(){try{ft(this.hostElementRef.nativeElement,this.componentId)}catch(t){this.loggingService.catch("Error in AutocompleteGroupOptionComponent setupA11yAttributes:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-group-option-internal"]],inputs:{group:"group",groupName:"groupName",groupObject:"groupObject",groupId:"groupId"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-autocomplete-group-option"],[1,"velt-autocomplete-group-option-name"]],template:function(e,i){if(e&1&&w(0,ta,1,8,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-autocomplete-group-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.velt-autocomplete-group-option-name[_ngcontent-%COMP%]{font-weight:500}"],changeDetection:0});let n=r;return n})();function ea(n,r){try{let o=r?.trim();if(!o)return;let t=(n||[]).find(e=>e?.metadata?.clientGroupId===o||e?.metadata?.groupId===o);return t?{id:t.metadata.clientGroupId||t.metadata.groupId,name:t.metadata.groupName,members:[]}:void 0}catch{return}}var na=(n,r,o,t)=>({componentConfigSignal:n,parentLocalUIState:r,newUserContact:o,newUserContactError:t}),oa=(n,r)=>({condition:n,data:r}),ra=(n,r,o)=>({componentConfigSignal:n,newUserContact:r,newUserContactError:o}),ia=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-empty-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function aa(n,r){if(n&1&&(x(0,"span",3),U(1),k()),n&2){let o=l(4);M("data-testid",o.componentId+"-add-contact"),u(),X(' Add "',o.newUserContact==null||o.newUserContact.contact==null?null:o.newUserContact.contact.email,'" ')}}function la(n,r){if(n&1&&(x(0,"span",4),U(1),k()),n&2){let o=l(4);M("data-testid",o.componentId+"-error"),u(),X(" ",o.newUserContactError," ")}}function ca(n,r){if(n&1&&(x(0,"span",5),U(1," No results found "),k()),n&2){let o=l(4);M("data-testid",o.componentId+"-no-results")}}function sa(n,r){if(n&1&&(S(0),x(1,"div",2),w(2,aa,2,2,"span",3)(3,la,2,2,"span",4)(4,ca,2,1,"span",5),k(),y()),n&2){let o=l(3);u(),M("data-testid",o.componentId),u(),E(!(o.newUserContact==null||o.newUserContact.contact==null)&&o.newUserContact.contact.email&&!o.newUserContactError?2:o.newUserContactError?3:4)}}function da(n,r){if(n&1&&(S(0),v(1,sa,5,2,"ng-container",1),y()),n&2){let o=l(),t=l();u(),p("veltDynamicTemplate",z(5,ia,t.template,rt(1,ra,t.componentConfigSignal,t.newUserContact,t.newUserContactError),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function ma(n,r){if(n&1&&v(0,da,2,11,"ng-container",0),n&2){let o=l();p("veltIf",O(6,oa,o.conditionSignal(),bt(1,na,o.componentConfigSignal,o.localUIStateSignal,o.newUserContact,o.newUserContactError)))}}var kn=(()=>{let r=class r extends q{constructor(){super(),this.componentId="velt-autocomplete-empty",this.componentConfigSignal=A({})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal,newUserContact:this.newUserContact,newUserContactError:this.newUserContactError})}catch(t){this.loggingService.catch("Error in AutocompleteEmptyComponent ngOnInit:",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteEmptyComponent ngOnDestroy:",t)}}setupA11yAttributes(){try{let t=this.hostElementRef.nativeElement;t.setAttribute("role","status"),t.setAttribute("data-testid",this.componentId+"-container"),t.setAttribute("aria-live","polite")}catch(t){this.loggingService.catch("Error in AutocompleteEmptyComponent setupA11yAttributes:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-empty-internal"]],inputs:{newUserContact:"newUserContact",newUserContactError:"newUserContactError"},standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-autocomplete-empty"],[1,"velt-autocomplete-empty--add-contact"],[1,"velt-autocomplete-empty--error"],[1,"velt-autocomplete-empty--no-results"]],template:function(e,i){if(e&1&&w(0,ma,1,9,"ng-container"),e&2){let a;E((a=i.componentConfigSignal())?0:-1,a)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-autocomplete-empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:8px 16px;color:var(--velt-text-6, #666);font-size:14px;line-height:1.5}.velt-autocomplete-empty--add-contact[_ngcontent-%COMP%]{color:var(--velt-text-1);cursor:pointer}.velt-autocomplete-empty--error[_ngcontent-%COMP%]{color:var(--velt-error-color, #dc3545)}.velt-autocomplete-empty--no-results[_ngcontent-%COMP%]{color:var(--velt-text-6, #666);font-style:italic}"],changeDetection:0});let n=r;return n})();var st=class{constructor(){this.closeDialog=()=>{},this.darkMode=!1,this.variant="",this.type=""}};var In=n=>({componentConfigSignal:n}),pa=(n,r)=>({condition:n,data:r}),va=(n,r,o,t)=>({template:n,context:r,componentName:"velt-confirm-dialog-reject-button-wireframe",setIfCondition:o,componentElementRef:t});function ga(n,r){if(n&1&&(S(0),x(1,"button",4),U(2),V(3,"translate"),k(),y()),n&2){let o=l(2).ngIf;u(2),X(" ",L(3,1,(o==null?null:o.noButton)||"No")," ")}}function ua(n,r){if(n&1){let o=Dt();S(0),x(1,"div",2),wt("pointerdown",function(e){return yt(o),kt(e.stopPropagation())}),v(2,ga,4,3,"ng-container",3),k(),y()}if(n&2){let o=l(2);u(),M("data-testid",o.componentId+"-button"),u(),p("veltDynamicTemplate",bt(4,va,o.template,R(2,In,o.componentConfigSignal),o.setIfCondition.bind(o),o.elementRef))}}function ha(n,r){if(n&1&&(S(0),v(1,ua,3,9,"ng-container",1),y()),n&2){let o=l();u(),p("veltIf",O(3,pa,o.conditionSignal(),R(1,In,o.componentConfigSignal)))}}var On=(()=>{let r=class r extends ct{constructor(t,e,i){super(t,e,i),this.elementRef=t,this.dynamicDataService=e,this.loggingService=i,this.componentId="velt-confirm-dialog-reject",super.initializeComponentConfigSignal(new st)}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in ConfirmDialogRejectComponent ngOnInit: ",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in ConfirmDialogRejectComponent ngOnDestroy: ",t)}}};r.\u0275fac=function(e){return new(e||r)(I(tt),I(b),I(N))},r.\u0275cmp=P({type:r,selectors:[["app-confirm-dialog-reject"]],standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["mat-button","","mat-dialog-close","",3,"pointerdown"],[4,"veltDynamicTemplate"],[1,"velt-confirm-dialog--reject"]],template:function(e,i){e&1&&v(0,ha,2,6,"ng-container",0),e&2&&p("ngIf",i.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{flex:1}.velt-confirm-dialog--reject[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--velt-spacing-md) var(--velt-spacing-lg);border-radius:var(--velt-border-radius-3xl);border:0;transition:.2s;cursor:pointer;color:var(--velt-text-0);background-color:var(--velt-background-2);font-size:var(--velt-font-size-md);font-style:normal;font-weight:600;line-height:normal}.velt-confirm-dialog--reject[_ngcontent-%COMP%]:hover{background-color:var(--velt-background-4)}"],changeDetection:0});let n=r;return n})();var Dn=n=>({componentConfigSignal:n}),fa=(n,r)=>({condition:n,data:r}),Ca=(n,r,o,t)=>({template:n,context:r,componentName:"velt-confirm-dialog-approve-button-wireframe",setIfCondition:o,componentElementRef:t});function _a(n,r){if(n&1&&(S(0),x(1,"button",4),U(2),V(3,"translate"),k(),y()),n&2){let o=l(2).ngIf;u(2),X(" ",L(3,1,(o==null?null:o.yesButton)||"Yes")," ")}}function ba(n,r){if(n&1){let o=Dt();S(0),x(1,"div",2),wt("pointerdown",function(e){return yt(o),kt(e.stopPropagation())})("click",function(){yt(o);let e=l().ngIf;return kt(e==null?null:e.closeDialog(!0))}),v(2,_a,4,3,"ng-container",3),k(),y()}if(n&2){let o=l(2);u(),M("data-testid",o.componentId+"-button"),u(),p("veltDynamicTemplate",bt(4,Ca,o.template,R(2,Dn,o.componentConfigSignal),o.setIfCondition.bind(o),o.elementRef))}}function xa(n,r){if(n&1&&(S(0),v(1,ba,3,9,"ng-container",1),y()),n&2){let o=l();u(),p("veltIf",O(3,fa,o.conditionSignal(),R(1,Dn,o.componentConfigSignal)))}}var wn=(()=>{let r=class r extends ct{constructor(t,e,i){super(t,e,i),this.elementRef=t,this.dynamicDataService=e,this.loggingService=i,this.componentId="velt-confirm-dialog-approve",super.initializeComponentConfigSignal(new st)}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in ConfirmDialogApproveComponent ngOnInit: ",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in ConfirmDialogApproveComponent ngOnDestroy: ",t)}}};r.\u0275fac=function(e){return new(e||r)(I(tt),I(b),I(N))},r.\u0275cmp=P({type:r,selectors:[["app-confirm-dialog-approve"]],standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["mat-button","","cdkFocusInitial","",3,"pointerdown","click"],[4,"veltDynamicTemplate"],[1,"velt-confirm-dialog--approve"]],template:function(e,i){e&1&&v(0,xa,2,6,"ng-container",0),e&2&&p("ngIf",i.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{flex:1}.velt-confirm-dialog--approve[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--velt-spacing-md) var(--velt-spacing-lg);border-radius:var(--velt-border-radius-3xl);border:0;transition:.2s;cursor:pointer;background-color:var(--velt-error);color:var(--velt-error-foreground);font-size:var(--velt-font-size-md);font-style:normal;font-weight:500;line-height:normal}.velt-confirm-dialog--approve[_ngcontent-%COMP%]:hover{background-color:var(--velt-error-hover)}"],changeDetection:0});let n=r;return n})();var En=n=>({componentConfigSignal:n}),Sa=(n,r)=>({condition:n,data:r}),ya=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-confirm-dialog-title-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function ka(n,r){if(n&1&&(x(0,"h2",4),U(1),V(2,"translate"),k()),n&2){let o=l(3).ngIf,t=l();M("data-testid",t.componentId),u(),_t(L(2,2,o==null?null:o.title))}}function Ia(n,r){if(n&1&&(S(0),v(1,ka,3,4,"h2",3),y()),n&2){let o=l(2).ngIf;u(),p("ngIf",o==null?null:o.title)}}function Oa(n,r){if(n&1&&(S(0),v(1,Ia,2,1,"ng-container",2),y()),n&2){let o=l().ngIf,t=l();u(),p("veltDynamicTemplate",z(3,ya,t.template,R(1,En,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function Da(n,r){if(n&1&&(S(0),v(1,Oa,2,9,"ng-container",1),y()),n&2){let o=l();u(),p("veltIf",O(3,Sa,o.conditionSignal(),R(1,En,o.componentConfigSignal)))}}var Tn=(()=>{let r=class r extends ct{constructor(t,e,i){super(t,e,i),this.elementRef=t,this.dynamicDataService=e,this.loggingService=i,this.componentId="velt-confirm-dialog-title",super.initializeComponentConfigSignal(new st)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(t){this.loggingService.catch("Error in ConfirmDialogTitleComponent ngOnInit: ",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in ConfirmDialogTitleComponent ngOnDestroy: ",t)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(t){this.loggingService.catch("Error in ConfirmDialogTitleComponent setupA11yAttributes:",t)}}};r.\u0275fac=function(e){return new(e||r)(I(tt),I(b),I(N))},r.\u0275cmp=P({type:r,selectors:[["app-confirm-dialog-title"]],standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["mat-dialog-title","","class","velt-confirm-dialog-title",4,"ngIf"],["mat-dialog-title","",1,"velt-confirm-dialog-title"]],template:function(e,i){e&1&&v(0,Da,2,6,"ng-container",0),e&2&&p("ngIf",i.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}.velt-confirm-dialog-title[_ngcontent-%COMP%]{color:var(--velt-text-0);font-size:var(--velt-font-size-xl);font-style:normal;font-weight:600;line-height:1.5;padding:0 24px 9px}"],changeDetection:0});let n=r;return n})();var An=n=>({componentConfigSignal:n}),wa=(n,r)=>({condition:n,data:r}),Ea=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-confirm-dialog-message-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function Ta(n,r){if(n&1&&(x(0,"div"),U(1),V(2,"translate"),k()),n&2){let o=l(3).ngIf;u(),X(" ",L(2,1,o==null?null:o.message)," ")}}function Aa(n,r){if(n&1&&(S(0),v(1,Ta,3,3,"div",0),y()),n&2){let o=l(2).ngIf;u(),p("ngIf",o==null?null:o.message)}}function Ma(n,r){if(n&1&&(S(0),x(1,"div",2),v(2,Aa,2,1,"ng-container",3),k(),y()),n&2){let o=l().ngIf,t=l();u(),M("data-testid",t.componentId),u(),p("veltDynamicTemplate",z(4,Ea,t.template,R(2,An,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function Pa(n,r){if(n&1&&(S(0),v(1,Ma,3,10,"ng-container",1),y()),n&2){let o=l();u(),p("veltIf",O(3,wa,o.conditionSignal(),R(1,An,o.componentConfigSignal)))}}var Mn=(()=>{let r=class r extends ct{constructor(t,e,i){super(t,e,i),this.elementRef=t,this.dynamicDataService=e,this.loggingService=i,this.componentId="velt-confirm-dialog-message",super.initializeComponentConfigSignal(new st)}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in ConfirmDialogMessageComponent ngOnInit: ",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in ConfirmDialogMessageComponent ngOnDestroy: ",t)}}};r.\u0275fac=function(e){return new(e||r)(I(tt),I(b),I(N))},r.\u0275cmp=P({type:r,selectors:[["app-confirm-dialog-message"]],standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["mat-dialog-content","",1,"velt-confirm-dialog-message"],[4,"veltDynamicTemplate"]],template:function(e,i){e&1&&v(0,Pa,2,6,"ng-container",0),e&2&&p("ngIf",i.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}.velt-confirm-dialog-message[_ngcontent-%COMP%]{margin:var(--velt-spacing-sm) 0;font-size:var(--velt-font-size-md);font-style:normal;font-weight:400;line-height:normal;color:var(--velt-text-0);padding:20px 24px}"],changeDetection:0});let n=r;return n})();var Pn=n=>({componentConfigSignal:n}),Fa=(n,r)=>({condition:n,data:r}),Ra=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-confirm-dialog-preview-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function ja(n,r){if(n&1&&(x(0,"div",5),U(1),k()),n&2){let o=l(3).ngIf;u(),_t(o==null?null:o.previewText)}}function Ua(n,r){if(n&1&&(S(0),v(1,ja,2,1,"div",4),y()),n&2){let o=l(2).ngIf;u(),p("ngIf",o==null?null:o.previewText)}}function Na(n,r){if(n&1&&(S(0),x(1,"div",2),v(2,Ua,2,1,"ng-container",3),k(),y()),n&2){let o=l().ngIf,t=l();u(),M("id",t.componentId)("data-testid",t.componentId),u(),p("veltDynamicTemplate",z(5,Ra,t.template,R(3,Pn,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function Va(n,r){if(n&1&&(S(0),v(1,Na,3,11,"ng-container",1),y()),n&2){let o=l();u(),p("veltIf",O(3,Fa,o.conditionSignal(),R(1,Pn,o.componentConfigSignal)))}}var Fn=(()=>{let r=class r extends ct{constructor(t,e,i){super(t,e,i),this.elementRef=t,this.dynamicDataService=e,this.loggingService=i,this.componentId="velt-confirm-dialog-preview",super.initializeComponentConfigSignal(new st)}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in ConfirmDialogPreviewComponent ngOnInit: ",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in ConfirmDialogPreviewComponent ngOnDestroy: ",t)}}};r.\u0275fac=function(e){return new(e||r)(I(tt),I(b),I(N))},r.\u0275cmp=P({type:r,selectors:[["app-confirm-dialog-preview"]],standalone:!1,features:[F([b]),j],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[1,"velt-confirm-dialog-preview"],[4,"veltDynamicTemplate"],["class","velt-confirm-dialog-preview-text",4,"ngIf"],[1,"velt-confirm-dialog-preview-text"]],template:function(e,i){e&1&&v(0,Va,2,6,"ng-container",0),e&2&&p("ngIf",i.componentConfigSignal())},styles:['@charset "UTF-8";html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}.velt-confirm-dialog-preview[_ngcontent-%COMP%]{padding:0}.velt-confirm-dialog-preview-text[_ngcontent-%COMP%]{background-color:var(--velt-background-2);color:var(--velt-text-0);border-radius:var(--velt-border-radius-lg);padding:var(--velt-spacing-md);font-size:var(--velt-font-size-md);font-style:italic;font-weight:400;line-height:1.5;color:var(--velt-text-1);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}.velt-confirm-dialog-preview-text[_ngcontent-%COMP%]:before{content:"\\201c"}.velt-confirm-dialog-preview-text[_ngcontent-%COMP%]:after{content:"\\201d"}'],changeDetection:0});let n=r;return n})();var Rt={"velt-autocomplete-option-wireframe":Cn,"velt-autocomplete-group-option-wireframe":yn,"velt-autocomplete-empty-wireframe":kn,"velt-autocomplete-option-icon-wireframe":hn,"velt-autocomplete-option-name-wireframe":fn,"velt-autocomplete-option-description-wireframe":vn,"velt-autocomplete-option-error-icon-wireframe":un,"velt-autocomplete-chip-tooltip-wireframe":mn,"velt-autocomplete-chip-tooltip-icon-wireframe":sn,"velt-autocomplete-chip-tooltip-name-wireframe":dn,"velt-autocomplete-chip-tooltip-description-wireframe":ln,"velt-data":_n,"velt-if":bn,"velt-button-wireframe":Sn,"velt-confirm-dialog-wireframe":Qe,"velt-confirm-dialog-reject-button-wireframe":On,"velt-confirm-dialog-approve-button-wireframe":wn,"velt-confirm-dialog-title-wireframe":Tn,"velt-confirm-dialog-message-wireframe":Mn,"velt-confirm-dialog-preview-wireframe":Fn};var Rn=(()=>{let r=class r{constructor(t,e,i){this.injector=t,this.appRef=e,this.loggingService=i,this.componentRefs=new Map,this.veltFunctionComponents=["velt-if","velt-data","velt-button-wireframe"];try{this.loggingService.log("%c[WB] Creating CLASS: DynamicComponentService","color: blue;")}catch(a){this.loggingService.catch("Error in DynamicComponentService constructor: ",a)}}isSignalInput(t,e){try{let i=t[e];if(i&&typeof i=="function"){let a=i.toString();if(a.length<200&&!a.includes("native code"))return!0}return!1}catch{return!1}}setPropertyOnComponent(t,e,i){try{if(this.isSignalInput(t.instance,e))t.setInput(e,i);else{let a=e.replace(/-([a-z])/g,(c,d)=>d.toUpperCase());a!==e&&this.isSignalInput(t.instance,a)?t.setInput(a,i):t.instance[e]=i}}catch{try{t.instance[e]=i}catch(c){this.loggingService.warn(`Failed to set property '${e}' on component:`,c)}}}createComponentRef(t,e,i=!0){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: createComponentRef","color: green;"),e&&this.componentRefs.has(e)){let a=this.componentRefs.get(e);return a||null}else{let a=we(t,{environmentInjector:this.injector.get(ye)});return i&&this.appRef.attachView(a.hostView),a}}catch(a){return this.loggingService.catch("Error in DynamicComponentService createComponentRef: ",a),null}}injectComponentIntoAndMoveChildren(t,e,i,a){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: injectComponentIntoAndMoveChildren","color: green;"),!Rt[t])return null;let c=a?`${a}__${t}`:"",d=e?.getAttribute("velt-wireframe-id");d&&(c=`${a}__${d}__${t}`);let s=this.createComponentRef(Rt[t],c,!1);if(!s||!e)return null;let h=s.location.nativeElement;if((e?.children?.length>0||e?.innerHTML?.trim()?.length>0)&&(s.instance.template=e),e.attributes.length>0)for(let g=0;g<e.attributes.length;g++){let T=e.attributes[g],D=T.name,_=T.value;D==="class"?h.classList.add(_):D==="style"?h.setAttribute("style",_):D==="velt-if"?s.instance.veltIf=_:(h.setAttribute(D,_),this.setPropertyOnComponent(s,D,_))}i&&typeof i=="object"&&Object.keys(i).forEach(g=>{this.veltFunctionComponents.includes(t)?s.instance.updateDataComponentConfigSignal(g,i[g]):this.setPropertyOnComponent(s,g,i[g])}),this.appRef.attachView(s.hostView),e.parentNode?e.parentNode.replaceChild(h,e):e.appendChild(h);try{At(h)}catch{}return s}catch(c){return this.loggingService.catch("Error in DynamicComponentService injectComponentIntoAndMoveChildren: ",c),null}}processAndReplaceVeltComponents(t,e,i,a=[],c){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: processAndReplaceVeltComponents","color: green;"),!t)return[];let d=[],s=t.tagName.toLowerCase();if(Rt[s]&&!a?.includes(s)){let g=this.injectComponentIntoAndMoveChildren(s,t,e,i);return g&&d.push(g),d}return Array.from(t.children).forEach(g=>{let T=this.processAndReplaceVeltComponents(g,e,i,a,c);d.push(...T)}),d}catch(d){return this.loggingService.catch("Error in DynamicComponentService processAndReplaceVeltComponents: ",d),[]}}getComponentRef(t){return this.componentRefs.get(t)||null}getAllComponentRefs(){return this.componentRefs}attachComponentToView(t){try{this.loggingService.log("%cc[WB] Calling FUNCTION: attachComponentToView","color: green;"),t&&this.appRef.attachView(t.hostView)}catch(e){this.loggingService.catch("Error in DynamicComponentService attachComponentToView: ",e)}}detachComponentFromView(t){try{this.loggingService.log("%c[WB] Calling FUNCTION: detachComponentFromView","color: green;"),t&&this.appRef.detachView(t.hostView)}catch(e){this.loggingService.catch("Error in DynamicComponentService detachComponentFromView: ",e)}}setCommentRefData(t,e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentRefData","color: green;"),e&&t&&typeof t=="object"&&(Object.keys(t).forEach(i=>{let a=e.instance?.template?.nodeName?.toLowerCase();this.veltFunctionComponents.includes(a)?e.instance.updateDataComponentConfigSignal(i,t[i]):this.setPropertyOnComponent(e,i,t[i])}),typeof e.instance?.refreshAnnotationContextFromSignal=="function"&&e.instance.refreshAnnotationContextFromSignal())}catch(i){this.loggingService.catch("Error in DynamicComponentService setCommentRefData: ",i)}}destroyComponentRefsByIdStartsWith(t){try{this.loggingService.log("%c[WB] Calling FUNCTION: destroyComponentRefsByIdStartsWith","color: green;"),this.componentRefs.forEach((e,i)=>{i.startsWith(t)&&(e.destroy(),this.componentRefs.delete(i))})}catch(e){this.loggingService.catch("Error in DynamicComponentService destroyComponentRefsByIdStartsWith: ",e)}}};r.\u0275fac=function(e){return new(e||r)(H(it),H(ke),H(N))},r.\u0275prov=nt({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var lm=(()=>{let r=class r{set veltDynamicTemplate({template:t,context:e,id:i,cloneTemplate:a,componentName:c,variant:d,suffix:s,setIfCondition:h,componentElementRef:g,replaceTemplate:T=!0,childrenSlot:D=!0}){try{if(this.childrenSlot=D&&Ue(c)?Ne(g?.nativeElement,this):void 0,this.childrenSlot&&!T&&this.warnAugmentingAnchorReplaced(c),s&&(c+=`--${s}`),d&&(c+=`---${d}`),c){let _=this.wireframeService.getConditionElement(c);if(!_&&t&&(_=t),_){let C=_?.getAttribute("velt-if");C&&h&&h(C),Array.from(_.attributes).forEach($=>{g?.nativeElement.setAttribute($.name,$.value)}),e?.componentConfigSignal?(this.dynamicDataService.applyConditionalClasses(g?.nativeElement,e),this.dynamicDataService.executeConditionalClasses()):this.dynamicDataService.applyConditionalClasses(g?.nativeElement)}}if(c&&!t){let _=this.wireframeService.getWireframe(c);if(_){let C=document.createElement(_.tagName);C.innerHTML=_.innerHTML,this.template=C}}else this.template=t;this.data=e,this.id=i,this.cloneTemplate=!!a,this.cloneTemplate&&t&&(this.template=this.domService.deepCloneElement(t)),this.checkToUpdateTemplate(T)}catch(_){this.loggingService.warn("Error in DynamicTemplateDirective veltDynamicTemplate: ",_)}}constructor(t,e,i,a,c,d,s,h){this.elementRef=t,this.templateRef=e,this.viewContainer=i,this.dynamicComponentService=a,this.loggingService=c,this.domService=d,this.wireframeService=s,this.dynamicDataService=h,this.directiveId=Math.random().toString(36).substring(7),this.isCustomTemplateMode=!1,this.isDefaultTemplateMode=!1,this.cloneTemplate=!1,this.injectedElements=[],this.isChildrenMode=!1,this.componentRefs=[],this.warnedAugmentingAnchor=!1;try{this.loggingService.log("%c[WB] Creating CLASS: DynamicTemplateDirective","color: blue;")}catch(g){this.loggingService.catch("Error in DynamicTemplateDirective constructor: ",g)}}checkDataValue(t,e){let i=t.querySelectorAll("[data-velt]");function a(c,d){return d.split(".").reduce((s,h)=>s&&s[h],c)}i.forEach(c=>{let d=c.getAttribute("data-velt");if(d&&e){let s=a(e,d);c instanceof HTMLElement&&(c.innerText=JSON.stringify(s,null,2))}})}checkToUpdateTemplate(t){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: checkToUpdateTemplate","color: green;"),this.childrenSlot)this.isDefaultTemplateMode=!1,this.isCustomTemplateMode=!1,this.isChildrenMode?this.updateDataOnComponentRefs(this.data):(this.cleanUp(),this.isChildrenMode=this.injectChildrenSlot());else if(this.template&&t)if(this.isDefaultTemplateMode=!1,this.isCustomTemplateMode)this.updateDataOnComponentRefs(this.data);else{this.isCustomTemplateMode=!0,this.cleanUp();let e=document.createElement(this.template.tagName);e.innerHTML=this.template.innerHTML,this.injectElementNextToSibling(this.elementRef.nativeElement,e)}else this.isCustomTemplateMode=!1,this.isDefaultTemplateMode||(this.cleanUp(),this.viewContainer.createEmbeddedView(this.templateRef),this.isDefaultTemplateMode=!0)}catch(e){this.loggingService.catch("Error in DynamicTemplateDirective checkToUpdateTemplate: ",e)}}warnAugmentingAnchorReplaced(t){try{if(this.warnedAugmentingAnchor)return;this.warnedAugmentingAnchor=!0,console.warn(`[Velt] Children passed to <${(t||"").replace(/-wireframe$/,"")}> replace its default content. This primitive normally renders SDK children of its own (and may repeat them per item), so your markup will render once, not once per item. To render per item, loop in your own code and place one primitive per item.`)}catch{}}injectChildrenSlot(){try{let t=Ve(this.childrenSlot,this);if(!t.length)return!1;let e=this.elementRef.nativeElement,i=e.parentNode;if(!i)return ae(this.childrenSlot,this),!1;t.forEach(c=>{if(Le(c,d=>!!Rt[d])){let d=this.dynamicComponentService.processAndReplaceVeltComponents(c,this.data,this.id?this.id:`from-children-${this.directiveId}`,[],"from children slot");d?.length&&this.componentRefs.push(...d)}});let a=e.nextSibling;return t.forEach(c=>{i.insertBefore(c,a),a=c.nextSibling,je(c)}),t.forEach(c=>At(c)),!0}catch(t){return this.loggingService.catch("Error in DynamicTemplateDirective injectChildrenSlot: ",t),!1}}injectElementNextToSibling(t,e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: injectElementNextToSibling","color: green;"),!e)return;this.cleanUp();let i=e;for(let c=0;c<i.children.length;c++){let d=i.children[c],s=this.dynamicComponentService.processAndReplaceVeltComponents(d,this.data,this.id?this.id:`from-directive-${this.directiveId}`,[],"from directive");s?.length&&this.componentRefs.push(...s)}i.setAttribute("data-velt-added-from-directive","true"),this.customTemplate=i;let a=Array.from(i.childNodes).reverse();t.nextSibling&&t.nextSibling&&t.nextSibling.getAttribute&&t.nextSibling.getAttribute("data-velt-added-from-directive")&&t.parentNode.removeChild(t.nextSibling),a.forEach(c=>{t.parentNode.insertBefore(c,t.nextSibling),c instanceof Element&&this.injectedElements.push(c)}),i.remove()}catch(i){this.loggingService.catch("Error in DynamicTemplateDirective injectElementNextToSibling: ",i)}}updateDataOnComponentRefs(t){try{this.loggingService.log("%c[WB] Calling FUNCTION: updateDataOnComponentRefs","color: green;"),this.componentRefs.forEach(e=>{this.dynamicComponentService.setCommentRefData(t,e)})}catch(e){this.loggingService.catch("Error in DynamicTemplateDirective updateDataOnComponentRefs: ",e)}}ngOnDestroy(){try{this.cleanUp()}catch(t){this.loggingService.catch("Error in DynamicTemplateDirective ngOnDestroy: ",t)}}cleanUp(){try{this.componentRefs.forEach(t=>{t.destroy()}),this.componentRefs=[],this.isChildrenMode&&(ae(this.childrenSlot,this),this.isChildrenMode=!1),this.injectedElements.forEach(t=>{t.remove()}),this.injectedElements=[],this.viewContainer.clear()}catch(t){this.loggingService.catch("Error in DynamicTemplateDirective cleanUp: ",t)}}};r.\u0275fac=function(e){return new(e||r)(I(tt),I(Wt),I(Jt),I(Rn),I(N),I(Ye),I(Ft),I(b))},r.\u0275dir=Kt({type:r,selectors:[["","veltDynamicTemplate",""]],inputs:{veltDynamicTemplate:"veltDynamicTemplate"}});let n=r;return n})();var um=(()=>{let r=class r{set veltIf(t){this.handleVeltIfChange(t)}constructor(t,e,i,a,c){this.templateRef=t,this.viewContainer=e,this.dynamicDataService=i,this.loggingService=a,this.injector=c,this.destroy$=new It,this.conditionRegex=/\{(.*?)\}/g,this.dataComponentConfig=A({}),this.extractedProps={},this.hasView=!1,this.cleanupEffects=[];try{this.dynamicDataService.getCommonData().pipe(xe(this.destroy$)).subscribe(d=>{this.processCondition(d)})}catch(d){this.loggingService.catch("Error in IfDirective constructor:",d)}}ngOnInit(){try{if(!this.context?.data)return;Object.entries(this.context.data).forEach(([t,e])=>{this.updateConfig(t,e)}),this.context.condition&&this.processCondition()}catch(t){this.loggingService.catch("Error in IfDirective ngOnInit:",t)}}ngOnDestroy(){try{this.cleanupEffects.forEach(t=>t.destroy()),this.cleanupEffects.length=0,this.destroy$.next(),this.destroy$.complete()}catch(t){this.loggingService.catch("Error in IfDirective ngOnDestroy:",t)}}handleVeltIfChange(t){try{if(this.context=t,!t.condition){this.hasView||(this.viewContainer.createEmbeddedView(this.templateRef),this.hasView=!0);return}this.processCondition()}catch(e){this.loggingService.warn("Error in IfDirective input setter:",e)}}processCondition(t){try{this.extractProps(),t&&this.dataComponentConfig.update(e=>(e=m(m({},e),t),e)),this.extractedProps=this.dynamicDataService.getModifiedPathBasedOnCondition(this.dataComponentConfig,this.extractedProps),this.getComputedValues(this.dataComponentConfig,this.evaluateCondition.bind(this),this.extractedProps)}catch(e){this.loggingService.catch("Error in IfDirective processCondition:",e)}}getComputedValues(t,e,i,a,c,d){try{this.cleanupEffects.forEach(s=>s.destroy()),this.cleanupEffects.length=0,Object.keys(i).forEach(s=>{let h;if(ot(t)?h=at(()=>lt(t(),i[s].path)):h=at(()=>lt(t,i[s].path)),ot(h())){let g=pt(()=>{try{let T=h()();i[s].value=T,this.extractedProps=i,this.evaluateCondition()}catch{}},{injector:this.injector,allowSignalWrites:!0});this.cleanupEffects.push(g)}else{let g=h();i[s].value=g,this.extractedProps=i,this.evaluateCondition()}})}catch(s){this.loggingService.catch("Error in DynamicDataService getComputedValues: ",s)}}extractProps(){try{this.extractedProps={},this.conditionRegex.lastIndex=0;let t;for(;(t=this.conditionRegex.exec(this.context?.condition??""))!==null;){let e=t[1];this.extractedProps[e]={value:null,path:null,isDynamicPath:this.hasDynamicParts(e)}}}catch(t){this.loggingService.catch("Error in IfDirective extractProps:",t)}}hasDynamicParts(t){try{let e=/\[[^\]'"]*[^\]'"]\]/.test(t),i=/\[[^[\]]*[\.\[][^[\]]*\]/.test(t);return e||i}catch(e){return this.loggingService.catch("Error checking for dynamic path: ",e),!1}}evaluateCondition(){try{if(!this.context?.condition)return!1;let t=this.buildConditionString(),e=this.sanitizeCondition(t),i=this.dynamicDataService.safeEval(e);return this.updateView(i),i}catch(t){return this.loggingService.catch("Error in IfDirective evaluateCondition:",t),this.clearView(),!1}}buildConditionString(){try{return this.context.condition.replace(this.conditionRegex,(t,e)=>{let i=this.extractedProps[e];if(i?.value!==void 0){let a=i.value;return typeof a=="string"?`'${a}'`:typeof a=="boolean"||typeof a=="number"?String(a):a===null?"null":typeof a=="object"?a?"true":"false":String(a)}return"false"})}catch(t){return this.loggingService.catch("Error in IfDirective buildConditionString:",t),""}}sanitizeCondition(t){try{return t.replace(/[^a-zA-Z0-9\s\+\-\*\/\%\(\)\!\=\<\>\|\&\.\[\]\{\},'"]/g,"")}catch(e){return this.loggingService.catch("Error sanitizing condition:",e),""}}updateView(t){try{t&&!this.hasView?(this.viewContainer.createEmbeddedView(this.templateRef),this.hasView=!0):!t&&this.hasView&&this.clearView()}catch(e){this.loggingService.catch("Error in IfDirective updateView:",e)}}clearView(){try{this.viewContainer.clear(),this.hasView=!1}catch(t){this.loggingService.catch("Error in IfDirective clearView:",t)}}updateConfig(t,e){try{this.dataComponentConfig.update(i=>f(m({},i),{[t]:e}))}catch(i){this.loggingService.catch("Error in IfDirective updateConfig:",i)}}};r.\u0275fac=function(e){return new(e||r)(I(Wt),I(Jt),I(b),I(N),I(it))},r.\u0275dir=Kt({type:r,selectors:[["","veltIf",""]],inputs:{veltIf:"veltIf"},features:[F([b])]});let n=r;return n})();export{tn as a,en as b,qt as c,Qt as d,nn as e,te as f,ee as g,ne as h,q as i,ln as j,sn as k,dn as l,mn as m,vn as n,un as o,hn as p,fn as q,Cn as r,st as s,On as t,wn as u,Tn as v,Mn as w,Fn as x,bn as y,xn as z,Sn as A,yn as B,kn as C,Rt as D,Rn as E,lm as F,um as G};
@@ -1 +1 @@
1
- import{Pa as c,Xa as o,vi as s}from"./chunk-Z3CHFM5M.js";var n=(()=>{let r=class r{constructor(t){this.domService=t}transform(t){try{return this.domService.sanitizeHtml(t)}catch{return t}}};r.\u0275fac=function(i){return new(i||r)(c(s,16))},r.\u0275pipe=o({name:"sanitizeHtml",type:r,pure:!0});let e=r;return e})();export{n as a};
1
+ import{Ra as c,Za as o,wj as s}from"./chunk-YFBAHLK6.js";var n=(()=>{let r=class r{constructor(t){this.domService=t}transform(t){try{return this.domService.sanitizeHtml(t)}catch{return t}}};r.\u0275fac=function(i){return new(i||r)(c(s,16))},r.\u0275pipe=o({name:"sanitizeHtml",type:r,pure:!0});let e=r;return e})();export{n as a};
@@ -0,0 +1,2 @@
1
+ import{f as B,j as Z}from"./chunk-I63T4QWP.js";import{t as ne}from"./chunk-MRY4A7N6.js";import{Bi as k,Gg as O,He as p,M as w,Ri as ie,Ti as E,Uh as j,V as q,Xa as Y,Xe as te,Ya as X,Ze as re,a as _,aa as H,ac as Q,b as C,ba as y,ca as W,de as d,ea as h,g as V,i as v,k as N,qd as ee,r as $,sa as J,tg as T,v as L,wa as K}from"./chunk-YFBAHLK6.js";var P=class{_totalWeight=0;_averageItemSize;_defaultItemSize;constructor(i=50){this._defaultItemSize=i,this._averageItemSize=i}getAverageItemSize(){return this._averageItemSize}addSample(i,o){let e=this._totalWeight+i.end-i.start;if(e){let t=(o+this._averageItemSize*this._totalWeight)/e;t&&(this._averageItemSize=t,this._totalWeight=e)}}reset(){this._averageItemSize=this._defaultItemSize,this._totalWeight=0}},z=class{scrolledIndexChange=new v(()=>{});_viewport=null;_minBufferPx;_maxBufferPx;_averager;_lastScrollOffset;_lastRenderedContentSize;_lastRenderedContentOffset;_removalFailures=0;constructor(i,o,e=new P){this._minBufferPx=i,this._maxBufferPx=o,this._averager=e}attach(i){this._averager.reset(),this._viewport=i,this._renderContentForCurrentOffset()}detach(){this._viewport=null}onContentScrolled(){this._viewport&&this._updateRenderedContentAfterScroll()}onDataLengthChanged(){this._viewport&&(this._renderContentForCurrentOffset(),this._checkRenderedContentSize())}onContentRendered(){this._viewport&&this._checkRenderedContentSize()}onRenderedOffsetChanged(){this._viewport&&this._checkRenderedContentOffset()}scrollToIndex(){}updateBufferSize(i,o){if(o<i)throw Error("CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx");this._minBufferPx=i,this._maxBufferPx=o}_updateRenderedContentAfterScroll(){let i=this._viewport,o=i.measureScrollOffset(),e=o-this._lastScrollOffset,t=Math.abs(e),r=i.getRenderedRange(),s=0;if(e<0){let g=r.start*this._averager.getAverageItemSize()-this._lastRenderedContentOffset;s=Math.round(g*Math.max(0,Math.min(1,t/(o+t)))),e=e-s,t=Math.abs(e)}let a=this._lastScrollOffset-this._lastRenderedContentOffset,c=this._lastRenderedContentOffset+this._lastRenderedContentSize-(this._lastScrollOffset+i.getViewportSize()),u=t+this._minBufferPx-(e<0?a:c);if(u>0)if(t>=i.getViewportSize())this._renderContentForCurrentOffset();else{let f=Math.max(0,Math.ceil((u-this._minBufferPx+this._maxBufferPx)/this._averager.getAverageItemSize())),g=(e<0?c:a)-this._minBufferPx+t,b=Math.floor(g/this._averager.getAverageItemSize()/(this._removalFailures+1)),A=Math.min(r.end-r.start,Math.max(0,b)),l=this._expandRange(r,e<0?f:0,e>0?f:0);e<0?l.end=Math.max(l.start+1,l.end-A):l.start=Math.min(l.end-1,l.start+A);let S,G;if(e<0){let R=i.measureRangeSize({start:l.end,end:r.end});R<=g?(S=this._lastRenderedContentOffset+this._lastRenderedContentSize-R,this._removalFailures=0):(l.end=r.end,S=this._lastRenderedContentOffset+this._lastRenderedContentSize,this._removalFailures++),G="to-end"}else{let R=i.measureRangeSize({start:r.start,end:l.start});R<=g?(S=this._lastRenderedContentOffset+R,this._removalFailures=0):(l.start=r.start,S=this._lastRenderedContentOffset,this._removalFailures++),G="to-start"}i.setRenderedRange(l),i.setRenderedContentOffset(S+s,G)}else s&&i.setRenderedContentOffset(this._lastRenderedContentOffset+s);this._lastScrollOffset=o}_checkRenderedContentSize(){let i=this._viewport;this._lastRenderedContentSize=i.measureRenderedContentSize(),this._averager.addSample(i.getRenderedRange(),this._lastRenderedContentSize),this._updateTotalContentSize(this._lastRenderedContentSize)}_checkRenderedContentOffset(){let i=this._viewport;this._lastRenderedContentOffset=i.getOffsetToRenderedContentStart()}_renderContentForCurrentOffset(){let i=this._viewport,o=i.measureScrollOffset();this._lastScrollOffset=o,this._removalFailures=0;let e=this._averager.getAverageItemSize(),t=Math.min(i.getDataLength()-1,Math.floor(o/e)),r=Math.ceil(this._maxBufferPx/e),s=this._expandRange(this._getVisibleRangeForIndex(t),r,r);i.setRenderedRange(s),i.setRenderedContentOffset(e*s.start)}_getVisibleRangeForIndex(i){let o=this._viewport,e={start:i,end:i+Math.ceil(o.getViewportSize()/this._averager.getAverageItemSize())},t=e.end-o.getDataLength();return t>0&&(e.start=Math.max(0,e.start-t)),e}_expandRange(i,o,e){let t=this._viewport,r=Math.max(0,i.start-o),s=Math.min(t.getDataLength(),i.end+e);return{start:r,end:s}}_updateTotalContentSize(i){let o=this._viewport,e=o.getRenderedRange(),t=i+(o.getDataLength()-(e.end-e.start))*this._averager.getAverageItemSize();o.setTotalContentSize(t)}};function le(n){return n._scrollStrategy}var Ae=(()=>{class n{get minBufferPx(){return this._minBufferPx}set minBufferPx(o){this._minBufferPx=B(o)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(o){this._maxBufferPx=B(o)}_maxBufferPx=200;_scrollStrategy=new z(this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateBufferSize(this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(e){return new(e||n)};static \u0275dir=X({type:n,selectors:[["cdk-virtual-scroll-viewport","autosize",""]],inputs:{minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[Q([{provide:Z,useFactory:le,deps:[H(()=>n)]}]),K]})}return n})(),Re=(()=>{class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=Y({type:n});static \u0275inj=W({})}return n})();var I=(()=>{let i=class i{constructor(e){this.loggingService=e,this.enabledSignal=J(!1),this.onTargetEditStart=null,this.onTargetEditCommit=null,this.autoCommit=!0;try{this.enabled$=ee(this.enabledSignal).pipe(w())}catch(t){this.loggingService.catch("Error in SuggestionModeService constructor: ",t),this.enabled$=new v}}enable(e){try{this.onTargetEditStart=e?.onTargetEditStart??null,this.onTargetEditCommit=e?.onTargetEditCommit??null,this.autoCommit=e?.autoCommit!==!1,this.enabledSignal.set(!0)}catch(t){this.loggingService.catch("Error in SuggestionModeService enable: ",t)}}disable(){try{this.onTargetEditStart=null,this.onTargetEditCommit=null,this.autoCommit=!0,this.enabledSignal.set(!1)}catch(e){this.loggingService.catch("Error in SuggestionModeService disable: ",e)}}isEnabled(){try{return this.enabledSignal()}catch(e){return this.loggingService.catch("Error in SuggestionModeService isEnabled: ",e),!1}}getOnTargetEditStart(){try{return this.onTargetEditStart}catch(e){return this.loggingService.catch("Error in SuggestionModeService getOnTargetEditStart: ",e),null}}getOnTargetEditCommit(){try{return this.onTargetEditCommit}catch(e){return this.loggingService.catch("Error in SuggestionModeService getOnTargetEditCommit: ",e),null}}isAutoCommitEnabled(){try{return this.autoCommit}catch(e){return this.loggingService.catch("Error in SuggestionModeService isAutoCommitEnabled: ",e),!1}}};i.\u0275fac=function(t){return new(t||i)(h(E))},i.\u0275prov=y({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var D=(()=>{let i=class i{constructor(e){this.loggingService=e,this.snapshots=new Map}captureFromGetter(e,t){try{if(!e||typeof t!="function")return!1;let r;try{r=t()}catch(s){return T()&&this.loggingService.catch(`[velt] Suggestion target "${e}" getter threw: `,s),!1}return this.captureValue(e,r)}catch(r){return this.loggingService.catch("Error in SuggestionSnapshotService captureFromGetter: ",r),!1}}captureValue(e,t){try{if(!e)return!1;let r;try{r=structuredClone(t)}catch(s){return T()&&this.loggingService.catch(`[velt] Suggestion target "${e}" snapshot failed (value not cloneable). Cause: structuredClone rejected the value (cyclic refs, DOM nodes, or functions are common culprits). Fix: ensure your getter returns plain JSON-serializable data.`,s),!1}return this.snapshots.set(e,r),!0}catch(r){return this.loggingService.catch("Error in SuggestionSnapshotService captureValue: ",r),!1}}getSnapshot(e){try{return this.snapshots.has(e)?this.snapshots.get(e):void 0}catch(t){this.loggingService.catch("Error in SuggestionSnapshotService getSnapshot: ",t);return}}hasSnapshot(e){try{return this.snapshots.has(e)}catch(t){return this.loggingService.catch("Error in SuggestionSnapshotService hasSnapshot: ",t),!1}}clearSnapshot(e){try{this.snapshots.delete(e)}catch(t){this.loggingService.catch("Error in SuggestionSnapshotService clearSnapshot: ",t)}}clearAllSnapshots(){try{this.snapshots.clear()}catch(e){this.loggingService.catch("Error in SuggestionSnapshotService clearAllSnapshots: ",e)}}};i.\u0275fac=function(t){return new(t||i)(h(E))},i.\u0275prov=y({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var ae=(()=>{let i=class i{constructor(e,t,r){this.loggingService=e,this.modeService=t,this.snapshotService=r,this.registry=new Map,this.warnedUnstableIds=new Set,this.actionsService=null}registerTarget(e,t){try{if(!e||typeof t!="function")return;this.warnIfUnstableId(e);let r=this.registry.get(e)??{};r.getter=t,this.registry.set(e,r)}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService registerTarget: ",r)}}unregisterTarget(e){try{let t=this.registry.get(e);if(!t)return;delete t.getter,t.node||this.registry.delete(e)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService unregisterTarget: ",t)}}getGetter(e){try{return this.registry.get(e)?.getter}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService getGetter: ",t);return}}setActionsService(e){try{this.actionsService=e}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService setActionsService: ",t)}}getNode(e){try{if(!e)return;let t=this.registry.get(e)?.node;if(t&&t.isConnected)return t;let r=this.queryAll(e);if(r.length===0)return;r.length>1&&this.warnDuplicateId(e,r.length);let s=r[0],a=this.registry.get(e)??{};return a.node=s,this.registry.set(e,a),s}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService getNode: ",t);return}}getFallbackValue(e){try{let t=this.getNode(e);if(!t)return{hasValue:!1};let r=t.textContent??"";return r.length>0?{hasValue:!0,value:r}:{hasValue:!1}}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService getFallbackValue: ",t),{hasValue:!1}}}isRegistered(e){try{return this.registry.get(e)?.getter?!0:!!this.getNode(e)}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService isRegistered: ",t),!1}}countTaggedElements(e){try{let t=e??this.rootEl??document.body;return t?t.querySelectorAll(`[${p.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`).length:0}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService countTaggedElements: ",t),0}}startObserving(e=document.body){try{if(this.observer)return;this.rootEl=e,this.scanAndRefresh(e),this.observer=new MutationObserver(()=>{try{this.scanAndRefresh(this.rootEl??document.body)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService observer callback: ",t)}}),this.observer.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[p.ATTRIBUTES.VELT_SUGGESTION_TARGET]}),this.installDelegatedListeners(e)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService startObserving: ",t)}}stopObserving(){try{this.observer?.disconnect(),this.observer=void 0,this.rootEl&&this.removeDelegatedListeners(this.rootEl),this.rootEl=void 0}catch(e){this.loggingService.catch("Error in SuggestionTargetRegistryService stopObserving: ",e)}}clear(){try{this.registry.clear(),this.warnedUnstableIds.clear()}catch(e){this.loggingService.catch("Error in SuggestionTargetRegistryService clear: ",e)}}installDelegatedListeners(e){try{this.boundFocusIn=t=>this.handleFocusIn(t),this.boundChange=t=>this.handleChange(t),this.boundFocusOut=t=>this.handleFocusOut(t),e.addEventListener("focusin",this.boundFocusIn,!0),e.addEventListener("change",this.boundChange,!0),e.addEventListener("focusout",this.boundFocusOut,!0)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService installDelegatedListeners: ",t)}}removeDelegatedListeners(e){try{this.boundFocusIn&&e.removeEventListener("focusin",this.boundFocusIn,!0),this.boundChange&&e.removeEventListener("change",this.boundChange,!0),this.boundFocusOut&&e.removeEventListener("focusout",this.boundFocusOut,!0),this.boundFocusIn=void 0,this.boundChange=void 0,this.boundFocusOut=void 0}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService removeDelegatedListeners: ",t)}}handleFocusIn(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t)return;this.captureSnapshotForTarget(t.targetId,t.element);let r=this.snapshotService.getSnapshot(t.targetId),s={targetId:t.targetId,oldValue:r,newValue:r,element:t.element},a=this.modeService.getOnTargetEditStart();if(a)try{a(s)}catch(c){this.loggingService.catch("Error in SuggestionTargetRegistryService onTargetEditStart customer callback threw: ",c)}this.actionsService?.triggerAction(d.TARGET_EDIT_START,{details:s,timestamp:Date.now()})}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleFocusIn: ",t)}}handleChange(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t||!this.isAtomicCommitTarget(e.target))return;this.processCommit(t.targetId,t.element)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleChange: ",t)}}handleFocusOut(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t||this.isAtomicCommitTarget(e.target))return;this.processCommit(t.targetId,t.element)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleFocusOut: ",t)}}isAtomicCommitTarget(e){try{if(e instanceof HTMLSelectElement)return!0;if(e instanceof HTMLInputElement){let t=(e.type||"").toLowerCase();return t==="checkbox"||t==="radio"}return!1}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService isAtomicCommitTarget: ",t),!1}}processCommit(e,t){try{let r=this.snapshotService.getSnapshot(e),s=this.readElementValue(e,t);if(O(r,s))return;let a={targetId:e,oldValue:r,newValue:s,element:t},c=this.modeService.getOnTargetEditCommit(),u=null;if(c){let g=null;try{g=c(a)}catch(b){this.loggingService.catch("Error in SuggestionTargetRegistryService onTargetEditCommit customer callback threw: ",b)}g&&(u=this.invokeAutoCommit({targetId:e,newValue:s,summary:g.summary,summaryHtml:g.summaryHtml,metadata:g.metadata}))}else this.modeService.isAutoCommitEnabled()&&(u=this.invokeAutoCommit({targetId:e,newValue:s}));let f=g=>V(this,null,function*(){return u&&(yield u)?null:this.invokeAutoCommit({targetId:e,newValue:s,summary:g?.summary,summaryHtml:g?.summaryHtml,metadata:g?.metadata})});this.actionsService?.triggerAction(d.TARGET_EDIT_COMMIT,{details:a,commitSuggestion:f,timestamp:Date.now()})}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService processCommit: ",r)}}invokeAutoCommit(e){try{return this.actionsService?this.actionsService.commitSuggestion(e).catch(t=>(T()&&this.loggingService.catch(`[velt] auto-commit for "${e.targetId}" rejected: `,t),null)):(T()&&this.loggingService.log("[velt] auto-commit skipped: actions service not wired. SuggestionActionsService constructor should call registry.setActionsService(this)."),Promise.resolve(null))}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService invokeAutoCommit: ",t),Promise.resolve(null)}}captureSnapshotForTarget(e,t){try{let r=this.registry.get(e);if(r?.getter){this.snapshotService.captureFromGetter(e,r.getter);return}let s=this.readElementValue(e,t);this.snapshotService.captureValue(e,s)}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService captureSnapshotForTarget: ",r)}}readElementValue(e,t){try{let r=this.registry.get(e);if(r?.getter)try{return r.getter()}catch{return}if(t instanceof HTMLInputElement){let s=(t.type||"").toLowerCase();return s==="checkbox"||s==="radio"?t.checked:s==="number"||s==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}return t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement?t.value:(t instanceof HTMLElement&&t.isContentEditable,t.textContent??"")}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService readElementValue: ",r);return}}findTaggedAncestor(e){try{if(!(e instanceof Element))return null;let t=e.closest(`[${p.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`);if(!t)return null;let r=t.getAttribute(p.ATTRIBUTES.VELT_SUGGESTION_TARGET);return r?{element:t,targetId:r}:null}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService findTaggedAncestor: ",t),null}}queryAll(e){try{let t=window.CSS?.escape?window.CSS.escape(e):e.replace(/"/g,'\\"');return Array.from(document.querySelectorAll(`[${p.ATTRIBUTES.VELT_SUGGESTION_TARGET}="${t}"]`))}catch{return[]}}scanAndRefresh(e){try{e.querySelectorAll(`[${p.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`).forEach(r=>{let s=r.getAttribute(p.ATTRIBUTES.VELT_SUGGESTION_TARGET);if(!s)return;let a=this.registry.get(s)??{};(!a.node||!a.node.isConnected)&&(a.node=r,this.registry.set(s,a))})}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService scanAndRefresh: ",t)}}warnIfUnstableId(e){try{if(!T()||this.warnedUnstableIds.has(e))return;let t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i.test(e),r=/\d{10,}/.test(e);(t||r)&&(this.warnedUnstableIds.add(e),this.loggingService.catch(`[velt] Target id "${e}" appears unstable. Cause: contains a UUID or timestamp shape \u2014 these typically change across re-renders. Fix: use a stable customer-owned id (the same one you use in your state). Docs: velt.dev/docs/suggestions/target-ids`,new Error("UNSTABLE_TARGET_ID")))}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService warnIfUnstableId: ",t)}}warnDuplicateId(e,t){try{if(!T())return;this.loggingService.catch(`[velt] Duplicate target id "${e}" \u2014 ${t} elements share this id. Cause: the same ${p.ATTRIBUTES.VELT_SUGGESTION_TARGET} appears on multiple DOM nodes. Fix: ensure each suggestable element has a unique id. Velt is using the first registered element. Docs: velt.dev/docs/suggestions/target-ids`,new Error("DUPLICATE_TARGET_ID"))}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService warnDuplicateId: ",r)}}};i.\u0275fac=function(t){return new(t||i)(h(E),h(I),h(D))},i.\u0275prov=y({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var Ve=(()=>{let i=class i{constructor(e,t,r,s,a,c){this.loggingService=e,this.modeService=t,this.snapshotService=r,this.targetRegistry=s,this.serviceBook=a,this.commonDbService=c,this.actionSubjects=new Map,this.observingActive=!1,this.commentService=null;try{this.targetRegistry.setActionsService(this),this.serviceBook.observe(k).subscribe(u=>{this.commentService=u})}catch(u){this.loggingService.catch("Error in SuggestionActionsService constructor: ",u)}}enableSuggestionMode(e){try{this.modeService.enable(e),this.startObservingIfNeeded(),this.warnIfNoTaggedElements()}catch(t){this.loggingService.catch("Error in SuggestionActionsService enableSuggestionMode: ",t)}}disableSuggestionMode(){try{this.modeService.disable(),this.stopObservingIfNeeded()}catch(e){this.loggingService.catch("Error in SuggestionActionsService disableSuggestionMode: ",e)}}isSuggestionModeEnabled(){try{return this.modeService.isEnabled()}catch(e){return this.loggingService.catch("Error in SuggestionActionsService isSuggestionModeEnabled: ",e),!1}}isSuggestionModeEnabled$(){try{return this.modeService.enabled$}catch(e){return this.loggingService.catch("Error in SuggestionActionsService isSuggestionModeEnabled$: ",e),new v}}registerTarget(e){try{if(!e?.targetId||typeof e?.getter!="function")return;this.targetRegistry.registerTarget(e.targetId,e.getter)}catch(t){this.loggingService.catch("Error in SuggestionActionsService registerTarget: ",t)}}unregisterTarget(e){try{this.targetRegistry.unregisterTarget(e)}catch(t){this.loggingService.catch("Error in SuggestionActionsService unregisterTarget: ",t)}}startSuggestion(e){try{let t=this.targetRegistry.getGetter(e);if(t){this.snapshotService.captureFromGetter(e,t);return}let r=this.targetRegistry.getFallbackValue(e);r.hasValue?this.snapshotService.captureValue(e,r.value):this.loggingService.warn(`[velt] startSuggestion: target "${e}" not registered. Cause: no getter via registerTarget() and no textContent fallback. Fix: tag the element with data-velt-suggestion-target and register a getter via registerTarget(). Docs: velt.dev/docs/suggestions/targets`)}catch(t){this.loggingService.catch("Error in SuggestionActionsService startSuggestion: ",t)}}commitSuggestion(e){return new Promise((t,r)=>{try{if(!e?.targetId){r(new Error("INVALID_CONFIG"));return}if(!this.modeService.isEnabled()){this.loggingService.warn("[velt] commitSuggestion called while suggestion mode is disabled. Cause: enableSuggestionMode() has not been called (or disableSuggestionMode() was called). Fix: call enableSuggestionMode() before commit, or branch on isSuggestionModeEnabled() in your onSave handler. Docs: velt.dev/docs/suggestions/mode"),r(new Error("MODE_NOT_SUGGESTING"));return}if(!this.targetRegistry.isRegistered(e.targetId)){this.loggingService.warn(`[velt] commitSuggestion: target "${e.targetId}" not registered. Cause: no element has data-velt-suggestion-target="${e.targetId}" and no registerTarget() call provided a getter. Fix: tag the element or register a getter at app boot. Docs: velt.dev/docs/suggestions/targets`),r(new Error("TARGET_NOT_REGISTERED"));return}if(!this.snapshotService.hasSnapshot(e.targetId)){let l=this.targetRegistry.getGetter(e.targetId);if(l){if(!this.snapshotService.captureFromGetter(e.targetId,l)){r(new Error("SNAPSHOT_FAILED"));return}}else{let S=this.targetRegistry.getFallbackValue(e.targetId);if(S.hasValue)this.snapshotService.captureValue(e.targetId,S.value);else{this.loggingService.warn(`[velt] commitSuggestion: target "${e.targetId}" requires registerTarget() for complex values. Cause: complex objects need a getter so the SDK can deep-clone the snapshot. Fix: call velt.getSuggestionElement().registerTarget("${e.targetId}", () => yourState.${e.targetId}) at app boot. Docs: velt.dev/docs/suggestions/getter`),r(new Error("NO_GETTER_FOR_COMPLEX"));return}}}let u=this.snapshotService.getSnapshot(e.targetId),f=e.newValue;if(O(u,f)){this.loggingService.warn(`[velt] commitSuggestion: no change detected for target "${e.targetId}". Cause: oldValue and newValue are deeply equal. Fix: only call commitSuggestion when the customer actually changed the value. Docs: velt.dev/docs/suggestions/edge-cases`),r(new Error("NO_CHANGE_TO_SUGGEST"));return}let g=new te;g.type="suggestion",g.suggestion={status:"pending",targetId:e.targetId,targetType:"custom",oldValue:u,newValue:f,summary:e.summary??null,driftDetected:!1,rejectReason:null,resolvedBy:null,resolvedAt:null},g.metadata=e.metadata??{};let b=fe(e.summary,e.summaryHtml,u,f),A=new re;if(A.commentText=b.commentText,A.commentHtml=b.commentHtml,g.comments=[A],!this.commentService){this.loggingService.catch('SuggestionActionsService.commitSuggestion: comment chunk not loaded \u2014 call Snippyly.preloadComment() first or include "comment" in featureAllowList.',new Error("comment chunk unavailable")),r(new Error("comment chunk not loaded"));return}this.commentService.addComment(void 0,void 0,void 0,void 0,!1,[],void 0,void 0,void 0,void 0,void 0,void 0,void 0,l=>{try{this.snapshotService.clearSnapshot(e.targetId),this.projectAndTrigger(d.SUGGESTION_CREATED,l.annotation),t({id:l.annotation.annotationId})}catch(S){this.loggingService.catch("Error in SuggestionActionsService commitSuggestion callback: ",S),r(S)}},void 0,void 0,g,void 0,void 0,!0,void 0,void 0,"internal",void 0)}catch(s){this.loggingService.catch("Error in SuggestionActionsService commitSuggestion: ",s),r(s)}})}getSuggestions(e){try{let t=this.commentService?.getCommentAnnotationsOnCurrentOrganizationAndDocument()??[],r=[];for(let s of t){if(!s.suggestion)continue;let a=this.projectAnnotationToSuggestion(s);a&&this.matchesFilter(a,e)&&r.push(a)}return r}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getSuggestions: ",t),[]}}getSuggestions$(e){try{return this.serviceBook.observe(k).pipe(q(t=>t?t.getCommentAnnotationsOnCurrentOrganizationAndDocument$():$([]))).pipe(L(t=>{let r=[];for(let s of t??[]){if(!s.suggestion)continue;let a=this.projectAnnotationToSuggestion(s);a&&this.matchesFilter(a,e)&&r.push(a)}return r}),w(j))}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getSuggestions$: ",t),new v}}getPendingSuggestion(e){try{if(!e)return null;let t=this.getSuggestions({targetId:e,status:"pending"});return t.length===0?null:t.sort((r,s)=>(s.createdAt??0)-(r.createdAt??0))[0]}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getPendingSuggestion: ",t),null}}getPendingSuggestion$(e){try{return e?this.getSuggestions$({targetId:e,status:"pending"}).pipe(L(t=>t.length===0?null:t.sort((r,s)=>(s.createdAt??0)-(r.createdAt??0))[0]),w(j)):new v}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getPendingSuggestion$: ",t),new v}}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new N),this.actionSubjects.get(e)?.next(t)}catch(r){this.loggingService.catch("Error in SuggestionActionsService triggerAction: ",r)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new N),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in SuggestionActionsService onAction: ",t),$(null)}}projectAndTrigger(e,t){try{if(!t||!t.suggestion)return;let r=this.projectAnnotationToSuggestion(t);if(!r)return;let s=this.timestamp;switch(e){case d.SUGGESTION_CREATED:{let a={suggestion:r,timestamp:s};this.triggerAction(d.SUGGESTION_CREATED,a);break}case d.SUGGESTION_APPROVED:{let a={suggestion:r,timestamp:s};this.triggerAction(d.SUGGESTION_APPROVED,a);break}case d.SUGGESTION_REJECTED:{let a={suggestion:r,timestamp:s};this.triggerAction(d.SUGGESTION_REJECTED,a);break}case d.SUGGESTION_STALE:{let a={suggestion:r,timestamp:s};this.triggerAction(d.SUGGESTION_STALE,a);break}}}catch(r){this.loggingService.catch("Error in SuggestionActionsService projectAndTrigger: ",r)}}projectAnnotationToSuggestion(e){try{let t=e.suggestion;if(!t)return;let r={annotationId:e.annotationId,targetId:t.targetId,targetType:t.targetType,oldValue:t.oldValue,newValue:t.newValue,summary:t.summary,metadata:e.metadata??{},driftDetected:!!t.driftDetected,createdBy:e.from,createdAt:e.createdAt??0};switch(t.status){case"pending":return C(_({},r),{status:"pending",rejectReason:null,resolvedBy:null,resolvedAt:null});case"accepted":case"apply_failed":return C(_({},r),{status:t.status,rejectReason:null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt??this.timestamp});case"rejected":return C(_({},r),{status:"rejected",rejectReason:t.rejectReason??null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt??this.timestamp});case"stale":return C(_({},r),{status:"stale",rejectReason:null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt});default:return}}catch(t){this.loggingService.catch("Error in SuggestionActionsService projectAnnotationToSuggestion: ",t);return}}startObservingIfNeeded(){try{if(this.observingActive)return;this.observingActive=!0,this.targetRegistry.startObserving()}catch(e){this.loggingService.catch("Error in SuggestionActionsService startObservingIfNeeded: ",e)}}stopObservingIfNeeded(){try{if(!this.observingActive)return;this.observingActive=!1,this.targetRegistry.stopObserving()}catch(e){this.loggingService.catch("Error in SuggestionActionsService stopObservingIfNeeded: ",e)}}warnIfNoTaggedElements(){try{this.targetRegistry.countTaggedElements()===0&&this.loggingService.warn('[velt] No suggestable elements found on this page. Cause: no DOM elements have a data-velt-suggestion-target attribute. Fix: tag at least one element with data-velt-suggestion-target="your.id" before enabling suggestion mode. Docs: velt.dev/docs/suggestions/getting-started')}catch(e){this.loggingService.catch("Error in SuggestionActionsService warnIfNoTaggedElements: ",e)}}get timestamp(){return this.commonDbService.getServerTimestamp()}matchesFilter(e,t){try{return t?!(t.targetId&&e.targetId!==t.targetId||t.status&&!(Array.isArray(t.status)?t.status:[t.status]).includes(e.status)):!0}catch(r){return this.loggingService.catch("Error in SuggestionActionsService matchesFilter: ",r),!1}}};i.\u0275fac=function(t){return new(t||i)(h(E),h(I),h(D),h(ae),h(ie),h(ne))},i.\u0275prov=y({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();function ge(n){try{return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch{return""}}function m(n){try{if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object")try{return JSON.stringify(n)}catch{return String(n)}return String(n)}catch{return""}}function ce(n){try{if(n===null||typeof n!="object"||Array.isArray(n))return!1;let i=Object.getPrototypeOf(n);return i===Object.prototype||i===null}catch{return!1}}function ue(n,i){try{let o=n==null,e=i==null;if(o&&!e)return[{op:"add",newText:m(i)}];if(!o&&e)return[{op:"remove",oldText:m(n)}];if(ce(n)&&ce(i)){let t=n,r=i,s=[...Object.keys(t),...Object.keys(r).filter(c=>!(c in t))],a=[];for(let c of s){let u=c in t,f=c in r;u&&f?O(t[c],r[c])||a.push({op:"replace",oldText:`${c}: ${m(t[c])}`,newText:`${c}: ${m(r[c])}`}):u?a.push({op:"remove",oldText:`${c}: ${m(t[c])}`}):a.push({op:"add",newText:`${c}: ${m(r[c])}`})}if(a.length>0)return a}return[{op:"replace",oldText:m(n),newText:m(i)}]}catch{return[{op:"replace",oldText:m(n),newText:m(i)}]}}function de(n,i){try{return ue(n,i).map(o=>o.op==="add"?`Add: "${o.newText??""}"`:o.op==="remove"?`Remove: "${o.oldText??""}"`:`Replace: "${o.oldText??""}" with "${o.newText??""}"`).join(`
2
+ `)}catch{return'Replace: "" with ""'}}var F="color:#e0492b;font-style:italic;",M="color:#0f8a4d;font-style:italic;";function Se(n,i){try{let o=ue(n,i),e=t=>ge(t??"");if(o.length===1){let t=o[0];return t.op==="add"?`<div>Add:</div><div style="${M}">&ldquo;${e(t.newText)}&rdquo;</div>`:t.op==="remove"?`<div>Remove:</div><div style="${F}">&ldquo;${e(t.oldText)}&rdquo;</div>`:`<div>Replace:</div><div style="${F}">&ldquo;${e(t.oldText)}&rdquo;</div><div>with</div><div style="${M}">&ldquo;${e(t.newText)}&rdquo;</div>`}return o.map(t=>t.op==="add"?`<div>Add: <span style="${M}">&ldquo;${e(t.newText)}&rdquo;</span></div>`:t.op==="remove"?`<div>Remove: <span style="${F}">&ldquo;${e(t.oldText)}&rdquo;</span></div>`:`<div>Replace: <span style="${F}">&ldquo;${e(t.oldText)}&rdquo;</span> with <span style="${M}">&ldquo;${e(t.newText)}&rdquo;</span></div>`).join("")}catch{return"<div>Replace:</div><div>with</div>"}}function fe(n,i,o,e){try{let t=n||de(o,e),r;return i?r=i:n?r=`<p>${ge(n)}</p>`:r=Se(o,e),{commentText:t,commentHtml:r}}catch{return{commentText:"",commentHtml:""}}}export{Ae as a,Re as b,ae as c,Ve as d};