1"use strict";(self.webpackChunkwebclient_webpack=self.webpackChunkwebclient_webpack||[]).push([[3775],{53775(_,L,t){t.d(L,{fy:()=>Y,Ou:()=>it,_H:()=>st});var y=t(85802),R=t(17705),X=t(13961),k=t(39974),A=t(54360),d=t(57908),K=t(43236),Q=t(9326),U=t(45225),T=t(5964),S=t(25558),f=t(96354),O=t(31943),I=t(99437),W=t(44668),$=t(23386),j=t(99172),N=t(63489),F=t(96697),H=t(84412),g=t(84572),G=t(57786),e=t(983),r=t(7673),s=t(1211),p=t(46062),q=t(16444),J=t(59882),B=t(96049),tt=t(44652),et=t(73042),nt=t(576),ot=t(95),rt=t(19630),V=t(96106);const Y=20;function st(l,M=!1){return l.mask===s.CTt.CO_3CX.toString()?l.id===p.eE.PersonalPhonebook.toString()?B.o.personalPhonebook():l.id===p.eE.CompanyPhonebook.toString()?B.o.companyPhonebook():B.o.allPhonebook(M):l.mask===s.CTt.CO_CRM.toString()?B.o.crmPhonebook():l.mask===s.CTt.CO_M365.toString()?B.o.office365Phonebook():l.mask===s.CTt.CO_GOOGLE.toString()?B.o.googlePhonebook():B.o.allPhonebook(M)}const Z=l=>l.contactDeleted$.pipe(function z(l,...M){var n,c;const P=null!==(n=(0,Q.lI)(M))&&void 0!==n?n:K.E,o=null!==(c=M[0])&&void 0!==c?c:null,h=M[1]||1/0;return(0,k.N)((m,a)=>{let i=[],v=!1;const C=E=>{const{buffer:x,subs:b}=E;b.unsubscribe(),(0,d.o)(i,E),a.next(x),v&&u()},u=()=>{if(i){const E=new X.yU;a.add(E);const b={buffer:[],subs:E};i.push(b),(0,U.N)(E,P,()=>C(b),l)}};null!==o&&o>=0?(0,U.N)(a,P,u,o,!0):v=!0,u();const D=(0,A._)(a,E=>{const x=i.slice();for(const b of x){const{buffer:w}=b;w.push(E),h<=w.length&&C(b)}},()=>{for(;i?.length;)a.next(i.shift().buffer);D?.unsubscribe(),a.complete(),a.unsubscribe()},void 0,()=>i=null);m.subscribe(D)})}(V.tN),(0,T.p)(M=>M.length>0));let it=(()=>{class l{router=(0,y.WQX)(J.Ix);contactService=(0,y.WQX)(tt.D);route=(0,y.WQX)(J.nX);phonebookService=(0,y.WQX)(nt.P);smsChatService=(0,y.WQX)(ot.V);integrationService=(0,y.WQX)(rt.a);myPhone=(0,y.WQX)(q.gx);limit$=new H.t(this.limit);showActionsButtons$;showActionsButtonsDropdown$;showAddButton$;shelf$;pagingDisabled=!1;get limit(){return(0,R.naY)()?40:100}constructor(){const n=this.route,c=this.phonebookService;this.shelf$=this.myPhone.myPhoneSession.pipe((0,S.n)(o=>o.systemParameters$),(0,f.T)(o=>[o.HideCrmContacts,o.MultiCompanyMode]),(0,f.T)(([o,h])=>{const m={name:"_i18n.CompanyPhonebook",id:p.eE.CompanyPhonebook.toString(),mask:s.CTt.CO_3CX.toString()},a={name:"_i18n.PersonalPhonebook",id:p.eE.PersonalPhonebook.toString(),mask:s.CTt.CO_3CX.toString()},i={name:"_i18n.Office365",mask:s.CTt.CO_M365.toString()},v={name:"_i18n.Google",mask:s.CTt.CO_GOOGLE.toString()},C={name:"_i18n.CrmPhonebook",mask:s.CTt.CO_CRM.toString()};if(h)return[m,a];const u=[m,a,i,v];return o?u:u.concat(C)}));const P=this.myPhone.myPhoneSession.pipe((0,S.n)(o=>o.systemParameters$),(0,f.T)(o=>o.MultiCompanyMode));this.showActionsButtons$=n.queryParams.pipe((0,f.T)(o=>o.groupId===p.eE.PersonalPhonebook.toString()||o.groupId===p.eE.CompanyPhonebook.toString())),this.showActionsButtonsDropdown$=(0,g.z)([n.queryParams,this.showActionsButtons$,P,c.canModifyCompanyPhonebook$]).pipe((0,f.T)(o=>{const[h,m,a,i]=o;return m&&!a&&i&&h.groupId===p.eE.CompanyPhonebook.toString()})),this.showAddButton$=(0,g.z)([n.queryParams,this.showActionsButtons$,P,c.isCrmCreationEnabled$,c.isMicrosoft365CreationEnabled$]).pipe((0,f.T)(([o,h,m,a,i])=>{const v=o.groupId===p.eE.CompanyPhonebook.toString()&&o.mask===s.CTt.CO_3CX.toString(),C=o.mask===s.CTt.CO_CRM.toString()&&a,u=o.mask===s.CTt.CO_M365.toString()&&i;return!!(h||m||v||C||u)||0===Object.keys(o).length}))}getSinglePageContacts(n,c,P,o){return(0,g.z)([this.myPhone.myPhoneSession,P]).pipe((0,S.n)(([h,m])=>(0,G.h)(h.get(this.contactService.requestFactory({Offset:0,SortBy:m,Count:Y,Input:n},c)),Z(h)).pipe((0,O.S)((a,i)=>i instanceof Array?(i.forEach(v=>{a.Entries.find(C=>C.Id===v.Id)&&(a.TotalCount--,a.Entries=a.Entries.filter(C=>C.Id!==v.Id))}),a):i,new s.OeX))),(0,f.T)(h=>new s.OeX({...h,TotalCount:h.Entries.length})),(0,I.W)(h=>(console.log(h),o&&this.router.navigate([o]),e.w)),(0,W.t)({refCount:!0,bufferSize:1}))}getContactBulk(n,c,P,o){return this.myPhone.myPhoneSession.pipe((0,S.n)(h=>(0,g.z)([c,P,h.contactUpdated$.pipe((0,$.c)(V.tN),(0,j.Z)(new s.Bve))]).pipe((0,S.n)(([m,a])=>(0,G.h)(this.limit$,Z(h)).pipe((0,N.i)((i,v)=>{let C;if(v instanceof Array){if(C=v.reduce((u,D)=>(i.Entries.find(E=>E.Id===D.Id)&&(i.TotalCount--,i.Entries=i.Entries.filter(E=>E.Id!==D.Id),u+=1),u),0),0===C)return(0,r.of)(i)}else C=v;return this.pagingDisabled=!0,h.get(this.contactService.requestFactory({Offset:i.Entries.length,SortBy:a,Count:C,Input:n},m)).pipe((0,f.T)(u=>(this.pagingDisabled=u.Entries.length<C,u.Entries=i.Entries.concat(u.Entries),u)))},new s.OeX,1))),(0,I.W)(m=>(console.log(m),o&&this.router.navigate([o]),e.w)))),(0,W.t)({refCount:!0,bufferSize:1}))}showMore(){this.limit$.next(this.limit)}fromPersonalPhoneBook(n){return n.type===p.eE.PersonalPhonebook}fromDepartmentPhoneBook(n){return n.type===p.eE.DepartmentPhonebook}hasMoreActions(n){let c=!1,P=!1,o=!1;return(0,g.z)([this.canEditContact$(n),this.smsChatService.isSmsAvailable$,this.integrationService.hasClientCrmIntegration$]).pipe((0,F.s)(1)).subscribe(([h,m,a])=>{c=h,P=m,o=a}),this.phonebookService.canWebmeet(n)||c||P||this.phonebookService.hasCrmUrl(n)||o&&this.integrationService.canOpenContactClientSideCrmUrl(n)}canEditContact$(n){return n&&n.isEditable?this.fromPersonalPhoneBook(n)||this.fromDepartmentPhoneBook(n)?(0,r.of)(!0):this.phonebookService.canModifyCompanyPhonebook$:(0,r.of)(!1)}isEditBeforeCallEnabled(n){return!!n.contact.bestPhone}canEdit(n){return n.canEdit}
1hasBestSmsMobile(n){return!!n.contact.bestSmsMobile}hasCrmUrl(n){return n.contact.addedBy===s.xBw.AB_Crm&&!!n.contact.crmUrl}canOpenClientCrmUrl(n){return this.integrationService.canOpenContactClientSideCrmUrl(n.contact)}canWebmeet(n){return!et.Q.isNullOrEmpty(n.contact.emailAddress)}static \u0275fac=function(c){return new(c||l)};static \u0275prov=y.jDH({token:l,factory:l.\u0275fac})}return l})()},576(_,L,t){t.d(L,{P:()=>H});var y=t(91473),R=t(38601),X=t(65656),k=t(20284),A=t(59882),d=t(85802),K=t(73042),Q=t(65676),U=t(33971),z=t(77498),T=t(23294),S=t(96354),f=t(44668),O=t(25558),I=t(96697),W=t(46062),$=t(1211),j=t(16444),N=t(12094),F=t(13499);let H=(()=>{class g{router=(0,d.WQX)(A.Ix);phoneService=(0,d.WQX)(k.u);route=(0,d.WQX)(A.nX);meetingService=(0,d.WQX)(Q.g);modalService=(0,d.WQX)(R.B);myPhone=(0,d.WQX)(j.gx);navigationHistoryService=(0,d.WQX)(N.s);phonebookEditorService=(0,d.WQX)(y.m);dialerService=(0,d.WQX)(F.$);canModifyCompanyPhonebook$;isCrmCreationEnabled$;isMicrosoft365CreationEnabled$;hasExchangeLicense$;isMcmMode$;currentContact=(0,d.vPA)(void 0);constructor(){this.canModifyCompanyPhonebook$=this.myPhone.myPhoneSession.pipe((0,O.n)(r=>r.canEditCompanyPhonebook$),(0,f.t)({refCount:!0,bufferSize:1})),this.isCrmCreationEnabled$=this.myPhone.myPhoneSession.pipe((0,O.n)(r=>r.isCrmCreationAllowed$),(0,T.F)(),(0,f.t)({refCount:!0,bufferSize:1})),this.isMcmMode$=this.myPhone.myPhoneSession.pipe((0,O.n)(r=>r.isMcmMode$),(0,T.F)(),(0,f.t)({refCount:!0,bufferSize:1})),this.isMicrosoft365CreationEnabled$=this.myPhone.myPhoneSession.pipe((0,O.n)(r=>r.myInfo$),(0,S.T)(r=>r.Office365Enabled),(0,T.F)(),(0,f.t)({refCount:!0,bufferSize:1})),this.hasExchangeLicense$=this.myPhone.myPhoneSession.pipe((0,O.n)(r=>r.myInfo$),(0,S.T)(r=>r.HasExchangeLicense),(0,T.F)(),(0,f.t)({refCount:!0,bufferSize:1}))}get extras(){return{queryParams:{groupId:this.route.snapshot.queryParams.groupId,mask:this.route.snapshot.queryParams.mask}}}navigateContacts(){this.router.navigate(["contacts"],this.extras).then(()=>{this.resetCurrentContact()})}
1navigatePreviousUrl(){this.navigationHistoryService.navigatePreviousUrl$(["contacts"],this.extras).pipe((0,I.s)(1)).subscribe(()=>{this.resetCurrentContact()})}addNewContact(){this.router.navigate(["contacts/new",this.route.snapshot.queryParams.groupId||""],this.extras).then(()=>{this.resetCurrentContact()})}viewContact(e){this.currentContact.set(e),this.router.navigate(["contacts/view",e.type,e.id],this.extras)}viewSelectedContactCard(e){this.currentContact.set(e)}resetCurrentContact(){this.currentContact.set(void 0)}editContact(e){this.currentContact.set(e),this.router.navigate(["contacts/edit",e.type,e.id],this.extras)}makeCall(e){this.phoneService.call(e.bestPhone)}editBeforeCall(e){e&&e.bestPhone&&this.dialerService.editBeforeCall(e.bestPhone)}meetingWithContact(e){return this.meetingService.createWebmeetingWithContact(e).pipe((0,z.c)(X.j)).subscribe({next:s=>{(0,U.Pe)(s.myJoinLink,this.modalService,"_i18n.PopupBlockedWebmeeting","_i18n.OpenWebmeeting")},error:s=>this.modalService.error(s)})}deleteContact(e,r){this.modalService.confirmDeletion("_i18n.Contact_Delete_Confirm_Message").subscribe(()=>{this.doDeleteContract(e,r)})}doDeleteContract(e,r){this.phonebookEditorService.deleteContact(e).pipe((0,I.s)(1)).subscribe({next:()=>{r?this.router.navigateByUrl(r).then(()=>{this.resetCurrentContact()}
1):this.navigatePreviousUrl()},error:s=>this.modalService.error(s)})}openCrmContactUrl(e){e.addedBy===$.xBw.AB_Crm&&e.crmUrl&&window.open(e.crmUrl,"_blank")}canEdit(e,r){if(!e||e.addedBy!==$.xBw.AB_Tcx)return!1;const s=e.type;return e.isEditable&&(s===W.eE.PersonalPhonebook||s===W.eE.DepartmentPhonebook)||s===W.eE.CompanyPhonebook&&r}canWebmeet(e){return!K.Q.isNullOrEmpty(e.emailAddress)}hasCrmUrl(e){return e.addedBy===$.xBw.AB_Crm&&!!e.crmUrl}static \u0275fac=function(r){return new(r||g)};static \u0275prov=d.jDH({token:g,factory:g.\u0275fac})}return g})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.