PageSourceSearch

https://badboys-handball.com/5453.5b819ccd53edb79c.js

js badboys-handball.com collected 2026-10-06 01:07:03 UTC 279,581 bytes, 1 lines download raw bytes

1(self.webpackChunkwebclient_webpack=self.webpackChunkwebclient_webpack||[]).push([[5453],{81783(J,F,l){"use strict";l.d(F,{IU:()=>R,Pw:()=>g,oF:()=>m});var r=l(85802),f=l(99437),N=l(96354),p=l(67469),w=l(19037);function R(S){return S.listGroup({$select:["Id","IsDefault","Number","OfficeRoute","Name","TranscriptionMode"],$orderby:["Name"],$filter:"not startsWith(Name, '___FAVORITES___')"}).pipe((0,N.T)(({value:y})=>y?.map(_=>_)||[]))}const m={trunksGroups:()=>{const S=(0,r.WQX)(p.G),y=(0,r.WQX)(w.s);return R(S).pipe((0,f.W)(_=>y.handleError(_)))}};function g(S){return S.snapshot.data?.trunksGroups||[]}},2275(J,F,l){"use strict";l.d(F,{T:()=>_});var r=l(534),f=l(68018),N=l(8516),p=l(35547),w=l(85802);const R=["pop"],a=["*"];function m(I,T){if(1&I&&p.nrm(0,"lucide-icon",3),2&I){const b=p.XpG(2);p.Y8G("img",b.Copy)}}function g(I,T){if(1&I&&p.nrm(0,"lucide-icon",3),2&I){const b=p.XpG(2);p.Y8G("img",b.Copy)}}function S(I,T){if(1&I&&(p.j41(0,"span",5),p.EFF(1),p.nI1(2,"translate"),p.k0s()),2&I){const b=p.XpG(2);p.R7$(),p.JRh(p.bMT(2,1,b.actionText))}}function y(I,T){if(1&I){const b=p.RV6();p.j41(0,"div",2,0),p.nI1(2,"translate"),p.nI1(3,"translate"),p.bIt("click",function(C){w.eBV(b);const u=p.XpG();return w.Njj(u.copy(C))}),p.nVh(4,m,1,1,"lucide-icon",3),p.j41(5,"div",4),p.SdG(6),p.k0s(),p.nVh(7,g,1,1,"lucide-icon",3),p.nVh(8,S,3,3,"span",5),p.k0s()}if(2&I){const b=p.XpG();p.Y8G("tooltip",p.bMT(2,6,"_i18n.Copied"))("container",b.tooltipContainer)("title",p.bMT(3,8,"_i18n.DisplayCopy")),p.R7$(4),p.vxM(b.showIcon&&b.iconFirst?4:-1),p.R7$(3),p.vxM(b.showIcon&&!b.iconFirst?7:-1),p.R7$(),p.vxM(b.showActionText?8:-1)}}let _=(()=>{class I{source;showIcon=!0;actionText="_i18n.DisplayCopy";showActionText;iconFirst;tooltipContainer;timeoutId;Copy=N.QRo;popComponent;copy(b){b.stopPropagation(),this.source&&navigator.clipboard&&navigator.clipboard.writeText(this.source).then(()=>{this.popComponent.show(),"number"==typeof this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>this.close(),1e3)})}close(){this.popComponent.hide()}static \u0275fac=function(h){return new(h||I)};static \u0275cmp=p.VBU({type:I,selectors:[["app-simple-copy"]],viewQuery:function(h,C){if(1&h&&p.GBs(R,5),2&h){let u;p.mGM(u=p.lsd())&&(C.popComponent=u.first)}},hostAttrs:[1,"hide-empty"],inputs:{source:"source",showIcon:"showIcon",actionText:"actionText",showActionText:"showActionText",iconFirst:"iconFirst",tooltipContainer:"tooltipContainer"},ngContentSelectors:a,decls:1,vars:1,consts:[["pop","bs-tooltip"],["triggers","","role","button","data-qa","simple-copy",1,"d-inline-flex","align-items-center","gap-2","mw-0","maxw-100",3,"tooltip","container","title"],["triggers","","role","button","data-qa","simple-copy",1,"d-inline-flex","align-items-center","gap-2","mw-0","maxw-100",3,"click","tooltip","container","title"],[1,"fillIconBlue","svg-sm",3,"img"],[1,"line-clamp-1"],[1,"link","dashed","text-nowrap"]],template:function(h,C){1&h&&(p.NAR(),p.nVh(0,y,9,10,"div",1)),2&h&&p.vxM(C.source?0:-1)},dependencies:[r.dg,N.flO,N.WGl,f.D9],encapsulation:2,changeDetection:0})}return I})()},56771(J,F,l){"use strict";l.d(F,{numbersAndMessagingRoutes:()=>Fd});var r=l(85802),f=l(17705),N=l(32271),p=l(23994),w=l(13961),R=l(25558),a=l(89417),m=l(59882),g=l(43683),S=l(83762),y=l(87840),_=l(77611),I=l(78291),T=l(99558),b=l(59053),h=l(53909),C=l(56998),u=l(9625),x=l.n(u),k=l(34187),K=l.n(k);const{parse:H}=x();function De(n){if(void 0===n)return!0;const s=parseInt(n,10);return!Number.isNaN(s)&&n===s.toString()&&s>=0&&s<=65535}function se(n,s={}){if((0,b.qu)(n))return!!(!s.bracketsIpV6Required||"ipv6"!==H(n).kind()||n.startsWith("[")&&n.endsWith("]"))&&!(s.disallowIp||s.disallowIpv6&&"ipv4"!==H(n).kind());const t=/^\[(.+)](:(\d+))?$/.exec(n);if(t)return!(s.disallowIp||s.disallowIpv6||!De(t[3]))&&(0,b.qu)(t[1])&&"ipv6"===H(t[1]).kind();const i=n.lastIndexOf(":");let o;if(i>=0){if(!De(n.substring(i+1,n.length)))return!1;o=n.substring(0,i)}else o=n;return(0,b.qu)(o)&&"ipv4"===H(o).kind()?!s.disallowIp:!s.disallowHostName&&K()(o)}const $n=n=>{const s=n.value;return s&&!se(s,{disallowIp:!0})?{domainWithPort:!0}:null},On=({value:n})=>n&&!se(n,{disallowHostName:!0,bracketsIpV6Required:!0})?{ipWithPort:!0}:null,Vn=({value:n})=>n&&!se(n,{disallowHostName:!0,disallowIpv6:!0})?{ipV4WithPort:!0}:null;var G=l(96354);const Bn=n=>[a.k0.required,a.k0.minLength(4),a.k0.maxLength(30),b.BY,...n?[b.J3]:[]];function Gt(n,s){const t=n.Gateway?.RequireRegistrationFor!==y.m.Nothing,i=s?.Editors?.includes(_.Q.Voip
1);return!(!t||!i)||(0,g.WA)(s)}function At(n,s){return{authValidators:Gt(n,s)?[a.k0.required]:[],registrarValidators:(0,g.vd)(s)?[a.k0.required]:[],codecsRequired:(0,g.e8)(s)?[a.k0.required]:[],registrarPortValidators:(0,g.JP)(s)&&(0,g.vd)(s)?[a.k0.required]:[],proxyPortValidators:(0,g.JP)(s)&&(0,g.Qb)(s)?[a.k0.required]:[]}}function jn(n,s){const t=At(n,s);return new a.gE({matchingStrategy:new a.MJ(n.Gateway?.MatchingStrategy??null,{nonNullable:!0}),type:new a.MJ(n.Gateway?.Type??I.Z.Provider,{nonNullable:!0}),codecs:Xn(n,s),name:new a.MJ(n.Gateway?.Name??"",{nonNullable:!0,validators:a.k0.required}),host:new a.MJ(n.Gateway?.Host??"",{nonNullable:!0,validators:[...t.registrarValidators]}),port:new a.MJ(n.Gateway?.Port??null,{validators:[...t.registrarPortValidators]}),useIpInContact:new a.MJ(n.Gateway?.UseIPInContact,{nonNullable:!0}),portAutoDiscovery:new a.MJ(0===n.Gateway?.Port,{nonNullable:!0}),srtpMode:new a.MJ(n.Gateway?.SRTPMode||null,{nonNullable:!0}),timeBetweenReg:new a.MJ({value:n.Gateway?.TimeBetweenReg??null,disabled:(0,g.WA)(s)},{nonNullable:!0,validators:[a.k0.min(0),a.k0.max(7200)]}),requireRegistrationFor:new a.MJ(n.Gateway?.RequireRegistrationFor??y.m.InOutCalls,{nonNullable:!0}),proxyHost:new a.MJ(n.Gateway?.ProxyHost??"",{nonNullable:!0}),proxyPort:new a.MJ(n.Gateway?.ProxyPort??null,{nonNullable:!0,validators:[...t.proxyPortValidators]}),proxyPortAutoDiscovery:new a.MJ(0===n.Gateway?.ProxyPort,{nonNullable:!0}),iPInRegistrationContact:new a.MJ(n.Gateway?.IPInRegistrationContact??T.e.External,{nonNullable:!0}),specifiedIPForRegistrationContact:new a.MJ({value:n.Gateway?.SpecifiedIPForRegistrationContact??"",disabled:n.Gateway?.IPInRegistrationContact!==T.e.Specified},{nonNullable:!0,validators:[a.k0.required,On]}),inboundParams:new a.MJ(n.Gateway?.InboundParams??null),outboundParams:new a.MJ(n.Gateway?.OutboundParams??null),sourceIdentification:Ln(n.Gateway?.SourceIdentification),deliverAudio:new a.MJ(n.Gateway?.DeliverAudio??null),supportReinvite:new a.MJ(n.Gateway?.SupportReinvite??null),supportReplaces:new a.MJ(n.Gateway?.SupportReplaces??null)})}function Xn(n,s){const t=At(n,s);return new a.Yp(n.Gateway?.Codecs?.map(i=>new a.MJ(i,{nonNullable:!0}))??[],{validators:[...t.codecsRequired]})}function Ln(n){return new a.Yp(n?.map(s=>new a.MJ(s,{nonNullable:!0}))??[])}function Yn(n,s){const t=n.Messaging||{};return new a.Yp((s.MessagingTemplate?.MessagingVariables||[]).filter(Boolean).map(o=>function Wn(n,s){const t=[...s.Required?[a.k0.required]:[],...s.MinLength?[a.k0.minLength(s.MinLength)]:[],...s.MaxLength?[a.k0.maxLength(s.MaxLength)]:[]];return new a.gE({value:new a.MJ({value:n[s.Name||""]||s.DefaultValue||"",disabled:!n.Enabled},t),Pattern:new a.MJ(s.Pattern||""),Name:new a.MJ(s.Name||""),Required:new a.MJ(s.Required||!1),MinLength:new a.MJ(s.MinLength||null),MaxLength:new a.MJ(s.MaxLength||null),Option:new a.MJ(s.Option||""),Title:new a.MJ(s.Title||""),OptionType:new a.MJ(s.OptionType||null),Prompt:new a.MJ(s.Prompt||""),Validation:new a.MJ(s.Validation||"")})}(t,o)))}function Un(n,s){const t=n.Messaging||{};return new a.gE({enabled:new a.MJ(t.Enabled??!1,{nonNullable:!0}),provider:new a.MJ(t.Provider??"",{nonNullable:!0}),webhook:new a.MJ(t.Webhook??"",{nonNullable:!0}),numberLengthEnabled:new a.MJ({value:t.NumberLengthEnabled??!1,disabled:!(0,g.vc)(s)},{nonNullable:!0}),numberLength:new a.MJ({value:t.NumberLength??3,disabled:!(0,g.vc)(s)},{nonNullable:!0,validators:[a.k0.required]}),messagingVariables:Yn(n,s)})}function Jn(n){const s=new Map((n.RoutingRules??[]).filter(t=>"BasedOnDID"===t.Condition).map(t=>[t.Data,t]));return(n.DidNumbers?.filter(t=>t!==n.ExternalNumber)??[]).map(t=>({didNumber:t,inboundRule:s?.get(t)}))}function Dt(n,s,t,i,o,d){const c=Gt(n,s)?a.k0.required:void 0;let v=d?{To:"Extension",Type:"Extension",Number:d.Number,Name:d.Name}:{To:"None"};if(n.RoutingRules&&n.RoutingRules.length>0){const z=n.RoutingRules[n.RoutingRules.length-1];"ForwardAll"===z.Condition&&(v=z.OfficeHoursDestination)}const M=new a.gE({defaultRoute:new a.MJ(v,{nonNullable:!0}),group:new a.MJ(i),gateway:jn(n,s),externalNumber:new a.MJ(n.ExternalNumber??"",{nonNullable:!0,validators:Bn(o)}),authId:new a.MJ(n.AuthID??"",{nonNullable:!0,validators:c}),authPassword:new a.MJ(n.AuthPassword?.Value??"",{nonNullable:!0,validators:c}),useSeparateAuthId:new a.MJ(n.UseSeparateAuthId??!1,{nonNullable:!0}),separateAuthId:new a.MJ({value:n.SeparateAuthId??"",disabled:!n.UseSeparateAuthId},{nonNullable:!0,validators:a.k0.required}),secondaryRegistrar:new a.MJ(n.SecondaryRegistrar??"",{nonNullable:!0}),publicIPinSIP:new a.MJ(n.PublicIPinSIP??"",{nonNullable:!0,validators:Vn}),messaging:Un(n,s),didNumbers:new a.MJ(Jn(n),{nonNullable:!0}),simultaneousCalls:new a.MJ(n.SimultaneousCalls??null,[a.k0.required,a.k0.min(0),a.k0.max(1e9)]),outboundCallerId:new a.MJ(n.OutboundCallerID??"",{nonNullable:!0,validators:[b.CO,b.J3]}),enableInboundRules:new a.MJ(n.EnableInboundCalls??!0,{nonNullable:!0}),enableOutboundRules:new a.MJ(n.EnableOutboundCalls??!0,{nonNullable:!0}),e164ProcessIncomingNumber:new a.MJ(n.E164ProcessIncomingNumber||!1,{nonNullable:!0}),inCIDFormatting:new a.MJ(n.InCIDFormatting||[],{nonNullable:!0}),outCIDFormatting:new a.MJ(n.OutCIDFormatting||[],{nonNullable:!0}),e164CountryCode:new a.MJ({value:n.E164CountryCode||"",disabled:!n.E164ProcessIncomingNumber},{nonNullable:!0,validators:[a.k0.required]}),ipRestriction:new a.MJ({value:n.IPRestriction||"Any",disabled:(0,g.WA)(s)},{nonNullable:!0}),transportRestriction:new a.MJ({value:n.TransportRestriction||"Any",disabled:(0,g.WA)(s)},{nonNullable:!0}),certificate:new a.MJ(n.CertificateName?{content:"",name:n.CertificateName}:null,[b.PD]),certificateExpirationDate:new a.MJ(n.CertificateExpirationDate??null),disableVideo:new a.MJ(n.DisableVideo??null),allowSipRefer:new a.MJ(!n.DisableCallTransfer,{nonNullable:!0}),createOutboundRule:new a.MJ(!0),emergencyGeoLocations:new a.MJ(n.EmergencyGeoLocations??[],{nonNullable:!0}),diversionHeader:new a.MJ(n.DiversionHeader??!0,{nonNullable:!0})},[z=>{const Ae=z.value,Dn=z.controls.externalNumber;return Ae.didNumbers.some(Gd=>Gd.didNumber===Ae.externalNumber)?Dn.setErrors({externalNumberInDID:!0}
1):Dn.updateValueAndValidity({onlySelf:!0}),null}]),E=M.controls;return t.add((0,C.jA)((0,C.XP)(E.e164ProcessIncomingNumber),[E.e164CountryCode])),t.add((0,C.jA)((0,C.XP)(E.gateway.controls.iPInRegistrationContact).pipe((0,G.T)(z=>z===T.e.Specified)),[E.gateway.controls.specifiedIPForRegistrationContact])),s.Tags?.includes(h.lW.cert)?(t.add((0,C.jA)((0,C.XP)(E.transportRestriction).pipe((0,G.T)(z=>"TLS"===z)),[E.certificate])),t.add(E.certificate.valueChanges.subscribe(()=>{E.certificateExpirationDate.setValue(null,{emitEvent:!1})}))):(0,C.TZ)(E.certificate,!1),M}function Hn(n){return new a.Yp(n.Codecs?.map(s=>new a.MJ(s,{nonNullable:!0}))??[],a.k0.required)}function Qn(n){return new a.gE({name:new a.MJ(n.Name??"",{nonNullable:!0,validators:a.k0.required}),type:new a.MJ(n.Type??I.Z.BridgeMaster,{nonNullable:!0}),outboundParams:new a.MJ(n.OutboundParams??null),codecs:Hn(n),SRTPMode:new a.MJ(n.SRTPMode??"SRTPDisabled",{nonNullable:!0}),deliverAudio:new a.MJ(n.DeliverAudio??!1,{nonNullable:!0}),supportReinvite:new a.MJ(n.SupportReinvite??!1,{nonNullable:!0}),supportReplaces:new a.MJ(n.SupportReplaces??!1,{nonNullable:!0})})}var L=l(13816),$=l(11242),Te=l(81753),ke=l(79177),zn=l(24144),$e=l(1716),le=l(45054),P=l(68018),Q=l(84460),A=l(24708),Oe=l(317),Kn=l(24112),Re=l(19781),$t=l(6581),Zn=l(81815),e=l(35547);let Ie=(()=>{class n{lang=(0,r.WQX)($t.m);transform(t,i="link_to_provider_doc"){return(0,Zn.zr)(this.lang).pipe((0,G.T)(o=>o[i][t??""]??o[i].default))}static \u0275fac=function(i){return new(i||n)};static \u0275pipe=e.EJ8({name:"trunkGuideLink",type:n,pure:!0})}return n})();var V=l(49769);const ei=["*"],ti=n=>({p0:n});function ni(n,s){if(1&n&&(e.rj2(0,"p",0)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.eux(),e.rj2(4,"a",1),e.nI1(5,"trunkGuideLink"),e.nI1(6,"async"),e.EFF(7),e.nI1(8,"translate"),e.eux(),e.EFF(9,". "),e.SdG(10),e.eux()),2&n){const t=e.XpG();e.R7$(2),e.SpI("",e.i5U(3,3,"_i18n.SaveTimeFollowThe",e.eq3(12,ti,(null==t.trunkTemplate?null:t.trunkTemplate.Name)??""))," "),e.R7$(2),e.Avn("href",e.bMT(6,8,e.bMT(5,6,t.trunkTemplate.Name)),e.B4B),e.R7$(3),e.JRh(e.bMT(8,10,"_i18n.ConfigurationGuide"))}}let rt=(()=>{class n{trunkTemplate;get isDIDProvider(){return(0,g.vc)(this.trunkTemplate)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-guide-link"]],inputs:{trunkTemplate:"trunkTemplate"},ngContentSelectors:ei,decls:1,vars:1,consts:[["data-qa","guide-link"],["target","_blank","rel","noopener",1,"fw-bold","link",3,"href"]],template:function(i,o){1&i&&(e.NAR(),e.nVh(0,ni,11,14,"p",0)),2&i&&e.vxM(null!=o.trunkTemplate&&o.trunkTemplate.Url?0:-1)},dependencies:[V.Jj,P.D9,Ie],encapsulation:2,changeDetection:0})}return n})();var Ot=l(2275),ii=l(83975),Ve=l(10079),st=l(49764),me=l(95604),ee=l(72510),he=l(72788);const oi=[[["","provider-params",""]]],ai=["[provider-params]"];function ri(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.TrunkNameInUse"))}function si(n,s){if(1&n&&e.nrm(0,"app-group-select",6),2&n){const t=e.XpG();e.Y8G("formControl",t.f.group)("showChangeWarning",t.isEditMode)("changeWarningLabel",t.changeDepartmentWarning)}}function li(n,s){if(1&n&&(e.j41(0,"div",1)(1,"div",7),e.nrm(2,"field-checkbox",17),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.Y8G("formControl",t.f.createOutboundRule)}}function di(n,s){if(1&n&&(e.j41(0,"span",18),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"app-simple-copy",19),e.EFF(4),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.bMT(2,3,"_i18n.ProviderWhitelistingNote")," "),e.R7$(2),e.Y8G("source",t.systemIp),e.R7$(),e.JRh(t.systemIp)}}function ci(n,s){if(1&n&&(e.j41(0,"fieldset")(1,"legend"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.SdG(4),e.j41(5,"app-trunk-guide-link",9),e.nVh(6,di,5,5,"span",18),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,3,"_i18n.VoipProvider")),e.R7$(3),e.Y8G("trunkTemplate",t.trunkTemplate),e.R7$(),e.vxM(t.systemIp&&t.isDIDProvider&&!t.isPSTNGateway?6:-1)}}function ui(n,s){if(1&n&&e.nrm(0,"app-trunk-guide-link",9),2&n){const t=e.XpG();e.Y8G("trunkTemplate",t.trunkTemplate)}}function pi(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.SpI(" ",e.bMT(1,1,"_i18n.ErrorMainTrunkDID")," ")}function mi(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.SpI(" ",e.bMT(1,1,"_i18n.AsteriskIsNotAllowedForDid")," ")}function hi(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.SpI(" ",e.bMT(1,1,"_i18n.AsteriskIsAllowedOnlyAtTheBeginningOrEnd")," ")}function bi(n,s){1&n&&(e.j41(0,"p",15),e.nrm(1,"span",20),e.j41(2,"span",21),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&n&&(e.R7$(3),e.JRh(e.bMT(4,1,"_i18n.e164CapableWarning")))}function fi(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.SpI(" ",e.bMT(1,1,"_i18n.AuthenticationIDInUse"))}function gi(n,s){if(1&n&&(e.nrm(0,"field-checkbox",27),e.j41(1,"field-input-password",28),e.nrm(2,"val-errors",29),e.k0s()),2&n){const t=e.XpG(2);e.Y8G("formControl",t.f.useSeparateAuthId),e.R7$(),e.Y8G("formControl",t.f.separateAuthId),e.R7$(),e.Y8G("control",t.f.separateAuthId)}}function _i(n,s){if(1&n&&(e.j41(0,"field-wrapper",26),e.nrm(1,"ng-select",30),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("items",t.requireRegistrationForOptions)("clearable",!1)}}function Ci(n,s){if(1&n&&(e.j41(0,"div",1)(1,"div",7)(2,"field-input",22)(3,"val-errors",23),e.DNE(4,fi,2,3,"ng-template",5),e.k0s()()(),e.j41(5,"div",7)(6,"field-input-password",24),e.nrm(7,"val-errors",25),e.k0s()()(),e.nVh(8,gi,3,3),e.nVh(9,_i,2,2,"field-wrapper",26)),2&n){const t=e.XpG();e.R7$(2),e.Y8G("formControl",t.f.authId),e.R7$(),e.Y8G("control",t.f.authId),e.R7$(3),e.Y8G("formControl",t.f.authPassword),e.R7$(),e.Y8G("control",t.f.authPassword),e.R7$(),e.vxM(t.isThreeWayAuthEnabled?8:-1),e.R7$(),e.vxM(t.isMcmMode&&t.isHosted3CX||!t.hasVoipEditor&&!t.isPSTNGateway||!t.isAuthTypeEnabled?-1:9)}}function vi(n,s){1&n&&(e.j41(0,"div",7)(1,"div",33)(2,"field-input-number",34),e.nrm(3,"val-errors",35),e.k0s(),e.j41(4,"div",36),e.nrm(5,"field-checkbox",37),e.k0s()()()),2&n&&(e.R7$(2),e.Y8G("min",0)("max",65535))}function Ti(n,s){if(1&n&&(e.j41(0,"legend"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"div",16)(4,"div",7)(5,"field-input",31),e.nrm(6,"val-errors",32),e.k0s()(),e.nVh(7,vi,6,2,"div",7),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.JRh(e.bMT(2,3,"_i18n.ServerDetails")),e.R7$(4),e.Y8G("maxlength",255),e.R7$(2),e.vxM(t.isPortEnabled?7:-1)}}function ki(n,s){1&n&&(e.j41(0,"div",7)(1,"div",33)(2,"field-input-number",40),e.nrm(3,"val-errors",41),e.k0s(),e.j41(4,"div",36),e.nrm(5,"field-checkbox",42),e.k0s()()()),2&n&&(e.R7$(2),e.Y8G("min",0)("max",65535))}function Ri(n,s){if(1&n&&(e.j41(0,"div",16)(1,"div",7)(2,"field-input",38),e.nrm(3,"val-errors",39),e.k0s()(),e.nVh(4,ki,6,2,"div",7),e.k0s()),2&n){const t=e.XpG();e.R7$(2),e.Y8G("maxlength",255),e.R7$(2),e.vxM(t.isPortEnabled?4:-1)}}let Vt=(()=>{class n{translateService=(0,r.WQX)(P.c$);GatewayNameMaxLength=50;formSub;form;showValidation;trunk;trunkTemplate;systemIp="";isMcmMode;isHosted3CX;requireRegistrationForOptions=[];constructor(){this.requireRegistrationForOptions=Object.entries(y.m).map(([t,i])=>({label:this.translateService.instant(`_i18n.RequireRegistrationFor.${t}`),value:i}))}ngOnDestroy(){this.formSub?.unsubscribe()}get changeDepartmentWarning(){return this.isDIDProvider?"_i18n.ChangeDepartmentWarningTrunks":"_i18n.ChangeDepartmentWarning"}get f(){return this.form.controls}get isEditMode(){return!!this.trunk?.Id}get isE164Capable(){return(0,g.xp)(this.trunkTemplate)}get isRegistrarEnabled(){return(0,g.vd)(this.trunkTemplate)}get isPortEnabled(){return(0,g.JP)(this.trunkTemplate)}get isProxyEnabled(){return(0,g.Qb)(this.trunkTemplate)}get isThreeWayAuthEnabled(){return(0,g.vv)(this.trunkTemplate)}get isAuthTypeEnabled(){return(0,g._O)(this.trunkTemplate)}get isWhatsAppProvider(){return this.form.value?.messaging?.provider===h.AC.provider}get isFacebookProvider(){return this.form.value?.messaging?.provider===h.G6.provider}get isDIDProvider(){return(0,g.vc)(this.trunkTemplate)}get isPSTNGateway(){return(0,g.WA)(this.trunkTemplate)}get externalNumberLabel(){return this.isFacebookProvider?"_i18n.PageId":this.isWhatsAppProvider?"_i18n.Number":"_i18n.MainTrunkNo"}get hasVoipEditor(){return(0,g.e8)(this.trunkTemplate)}toggleAuthForm(t){t===y.m.Nothing?(this.form.controls.authId.removeValidators(a.k0.required),this.form.controls.authPassword.removeValidators(a.k0.required)):(this.form.controls.authId.addValidators(a.k0.required),this.form.controls.authPassword.addValidators(a.k0.required)),this.form.controls.authId.updateV
1alueAndValidity(),this.form.controls.authPassword.updateValueAndValidity()}ngOnChanges(t){if(t.form){this.formSub?.unsubscribe(),this.formSub=new w.yU,this.toggleAuthForm(this.form.controls.gateway.controls.requireRegistrationFor.value),this.formSub.add(this.form.controls.gateway.controls.requireRegistrationFor.valueChanges.subscribe(v=>{v&&this.toggleAuthForm(v)})),this.formSub.add(this.form.controls.useSeparateAuthId.valueChanges.subscribe(v=>{v?this.form.controls.separateAuthId.enable():this.form.controls.separateAuthId.disable()}));const{port:i,portAutoDiscovery:o,proxyPort:d,proxyPortAutoDiscovery:c}=this.f.gateway.controls;this.formSub.add(o.valueChanges.subscribe(v=>{(0,C.TZ)(i,!v,!0),!v&&0===i.value&&this.trunkTemplate?.DefaultRegistrarPort&&i.setValue(this.trunkTemplate?.DefaultRegistrarPort)})),(0,C.TZ)(i,!o.value),this.formSub.add(c.valueChanges.subscribe(v=>{(0,C.TZ)(d,!v,!0),!v&&0===d.value&&this.trunkTemplate?.DefaultProxyPort&&d.setValue(this.trunkTemplate?.DefaultProxyPort)})),(0,C.TZ)(d,!c.value)}(0,C.TZ)(this.f.authId,!(0,g.WA)(this.trunkTemplate))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-main-fields-edit"]],inputs:{form:"form",showValidation:"showValidation",trunk:"trunk",trunkTemplate:"trunkTemplate",systemIp:"systemIp",isMcmMode:"isMcmMode",isHosted3CX:"isHosted3CX"},features:[e.OA$],ngContentSelectors:ai,decls:29,vars:18,consts:[[3,"formGroup"],[1,"row"],["formGroupName","gateway",1,"col-md-6"],["data-qa","gateway-name","label","_i18n.Name","formControlName","name",3,"maxlength"],["controlName","name","label","_i18n.Name"],["valError","unique"],["data-qa","trunk-group","label","_i18n.LimitTo","description","true",3,"formControl","showChangeWarning","changeWarningLabel"],[1,"col-md-6"],["data-qa","default-route","label","_i18n.DefaultRoute",3,"formControl","departmentEnabled","externalNumberEnabled"],["data-qa","trunk-guide-link",3,"trunkTemplate"],["data-qa","external-number","formControlName","externalNumber",3,"label"],["controlName","externalNumber",3,"label"],["valError","externalNumberInDID"],["valError","starCodeError"],["valError","invalidStarPositionInDid"],[1,"d-flex","gap-2"],["formGroupName","gateway",1,"row"],["data-qa","create-outbound-rule","label","_i18n.CreateOutboundRuleForThisTrunk",3,"formControl"],["data-qa","system-ip"],["data-qa","system-ip",1,"fw-bold",3,"source"],["app-exclamation-triangle-solid-icon","",1,"customSVGIcons","svg-md"],["data-qa","e164-capable-warning"],["data-qa","auth-id","label","_i18n.AuthenticationIDSIP","autocomplete","new-name",3,"formControl"],["label","_i18n.AuthenticationIDSIP",3,"control"],["data-qa","auth-password","label","_i18n.AuthenticationPassword",3,"formControl"],["label","_i18n.AuthenticationPassword",3,"control"],["label","_i18n.TypeOfAuthentication","formGroupName","gateway","data-qa","type-of-authentication"],["data-qa","separate-auth-id","label","_i18n.Optional3WayAuthenticationID",3,"formControl"],["data-qa","three-way-authentication-password","label","_i18n.ThreeWayAuthenticationPassword",3,"formControl"],[3,"control"],["data-qa","select","formControlName","requireRegistrationFor","bindValue","value","bindLabel","label",3,"items","clearable"],["data-qa","gateway-host","formControlName","host","label","_i18n.TrunkRegistrar",3,"maxlength"],["controlName","host"],[1,"d-flex","flex-row","gap-3"],["data-qa","gateway-port","formControlName","port","label","_i18n.Port",1,"max-length-5",3,"min","max"],["controlName","port"],[1,"pt-5"],["label","_i18n.AutoDiscovery","formControlName","portAutoDiscovery"],["data-qa","gateway-proxy-host","formControlName","proxyHost","label","_i18n.TrunkProxy",3,"maxlength"],["controlName","proxyHost"],["label","_i18n.Port","data-qa","gateway-proxy-port","formControlName","proxyPort",1,"max-length-5",3,"min","max"],["controlName","proxyPort"],["label","_i18n.AutoDiscovery","formControlName","proxyPortAutoDiscovery"]],template:function(i,o){1&i&&(e.NAR(oi),e.qex(0,0),e.j41(1,"fieldset")(2,"div",1)(3,"div",2)(4,"field-input",3)(5,"val-errors",4),e.DNE(6,ri,2,3,"ng-template",5),e.k0s()(),e.nVh(7,si,1,3,"app-group-select",6),e.k0s(),e.j41(8,"div",7),e.nrm(9,"app-call-forwarding",8),e.k0s()(),e.nVh(10,li,3,1,"div",1),e.k0s(),e.nVh(11,ci,7,5,"fieldset"),e.j41(12,"fieldset")(13,"legend"),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.j41(16,"div",1),e.nVh(17,ui,1,1,"app-trunk-guide-link",9),e.j41(18,"div",7)(19,"field-input-phone",10)(20,"val-errors",11),e.DNE(21,pi,2,3,"ng-template",12)(22,mi,2,3,"ng-template",13)(23,hi,2,3,"ng-template",14),e.k0s()()()(),e.nVh(24,bi,5,3,"p",15),e.nVh(25,Ci,10,6),e.k0s(),e.j41(26,"fieldset"),e.nVh(27,Ti,8,5),e.nVh(28,Ri,5,2,"div",16),e.k0s(),e.bVm()),2&i&&(e.Y8G("formGroup",o.form),e.R7$(4),e.Y8G("maxlength",o.GatewayNameMaxLength),e.R7$(3),e.vxM(o.isDIDProvider?-1:7),e.R7$(2),e.Y8G("formControl",o.f.defaultRoute)("departmentEnabled",!0)("externalNumberEnabled",!o.isMcmMode),e.R7$(),e.vxM(!o.isEditMode&&o.isDIDProvider?10:-1),e.R7$(),e.vxM(o.isDIDProvider&&!o.isPSTNGateway?11:-1),e.R7$(3),e.JRh(e.bMT(15,16,"_i18n.AccountDetails")),e.R7$(3),e.vxM(!o.isDIDProvider||o.isPSTNGateway?17:-1),e.R7$(2),e.Y8G("label",o.externalNumberLabel),e.R7$(),e.Y8G("label",o.externalNumberLabel),e.R7$(4),e.vxM(o.isE164Capable?24:-1),e.R7$(),e.vxM(o.hasVoipEditor||o.isPSTNGateway?25:-1),e.R7$(2),e.vxM(o.isPSTNGateway||o.isRegistrarEnabled?27:-1),e.R7$(),e.vxM(o.isProxyEnabled?28:-1))},dependencies:[a.X1,a.BC,a.cb,a.tU,a.l_,a.j4,a.JD,a.$R,Q.m,A.IH,A.VI,Oe.x,Kn.R,Re.t,rt,Ot.T,ii.e,Ve.f,st.$,me.z,ee.vr,he.B,P.D9],encapsulation:2,changeDetection:0})}return n})();var Bt=l(19692),ye=l(12678),yi=l(92771),Y=l(7673),j=l(38601),Ni=l(50942),q=l(71747),be=l(52808),Si=l(4801),Mi=l(26229);class Ei{data;existingInboundRules;constructor(s,t){this.data=s,this.existingInboundRules=t}resolveData(s=1,t=Mi.I,i=""){const o=i.toLowerCase(),d=this.data.map((M,E)=>({id:E,didNumber:M.didNumber,inboundRule:M.inboundRule??this.existingInboundRules?.get(M.didNumber)})).filter(M=>!o||M.didNumber.includes(o)||M.inboundRule?.RuleName?.toLowerCase().includes(o)),v=d.slice((s-1)*t,s*t);return(0,Y.of)({totalItems:d.length,value:v})}}var jt=l(43636),lt=l(62049),O=l(89079),U=l(99437),dt=l(25843),Pi=l(422),xi=l(90262),wi=l.n(xi),ct=l(35606),Fi=l(85968),Wt=l(64106),ut=l(49371),Gi=l(56197),Xt=l(38969),Ai=l(47305),Be=l(68845),pt=l(7707),Lt=l(3817),de=l(87019);const Di=(n,s)=>s.id;function $i(n,s){}function Oi(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.AsteriskIsNotAllowedForDid"))}function Vi(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",14),e.nrm(1,"field-input",15),e.j41(2,"button",16),e.bIt("click",function(){r.eBV(t);const o=e.XpG();
1return r.Njj(o.save())}),e.nrm(3,"app-save-solid-icon"),e.k0s(),e.j41(4,"button",17),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.cancel())}),e.nrm(5,"app-times-light-icon"),e.k0s(),e.j41(6,"val-errors",18),e.DNE(7,$i,0,0,"ng-template",19)(8,Oi,2,3,"ng-template",20),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("placeholder","_i18n.EnterDid")("formControl",t.phoneControl)("wcAutofocus",10)("maxlength",50),e.R7$(),e.Y8G("disabled",t.phoneControl.invalid),e.R7$(4),e.Y8G("control",t.phoneControl)}}function Bi(n,s){1&n&&(e.j41(0,"p",2),e.nrm(1,"span",21),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&n&&(e.R7$(3),e.JRh(e.bMT(4,1,"_i18n.e164CapableWarning")))}function ji(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",22),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.addDid())}),e.nrm(1,"span",23),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"app-select-file-button",24),e.bIt("files",function(o){r.eBV(t);const d=e.XpG();return r.Njj(d.importDids(o))}),e.nrm(6,"span",25),e.j41(7,"span"),e.EFF(8),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"button",26),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.deleteSelected())}),e.nrm(11,"app-trash-alt-solid-icon"),e.j41(12,"span"),e.EFF(13),e.nI1(14,"translate"),e.k0s()()}if(2&n){const t=e.XpG();e.Y8G("disabled",t.maxDidsPerTrunkReached),e.R7$(3),e.JRh(e.bMT(4,7,"_i18n.Add")),e.R7$(2),e.Y8G("disabled",t.maxDidsPerTrunkReached),e.R7$(3),e.JRh(e.bMT(9,9,"_i18n.Import")),e.R7$(2),e.Y8G("disabled",!t.selector.isAnySelected),e.R7$(3),e.Lme("",e.bMT(14,11,"_i18n.Delete"),"",t.selector.selectedCountLabel)}}function Wi(n,s){if(1&n&&(e.j41(0,"td",29),e.eu8(1,4),e.k0s()),2&n){e.XpG(2);const t=e.sdS(1);e.R7$(),e.Y8G("ngTemplateOutlet",t)}}function Xi(n,s){1&n&&e.nrm(0,"app-route-dest",35),2&n&&e.Y8G("dest",s)}function Li(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.SpI(" ",e.bMT(1,1,"_i18n.Unassigned")," ")}function Yi(n,s){if(1&n){const t=e.RV6();e.j41(0,"td",30),e.bIt("click",function(o){r.eBV(t);const d=e.XpG().$implicit,c=e.XpG();return r.Njj(c.onEntityClick(o,d))}),e.j41(1,"span",31),e.EFF(2),e.k0s()(),e.j41(3,"td",32),e.bIt("click",function(o){r.eBV(t);const d=e.XpG().$implicit,c=e.XpG();return r.Njj(c.onEntityClick(o,d))}),e.j41(4,"span",33),e.EFF(5),e.k0s()(),e.j41(6,"td",34),e.bIt("click",function(o){r.eBV(t);const d=e.XpG().$implicit,c=e.XpG();return r.Njj(c.onEntityClick(o,d))}),e.nVh(7,Xi,1,1,"app-route-dest",35)(8,Li,2,3),e.k0s(),e.j41(9,"td",10)(10,"button",36),e.nI1(11,"translate"),e.bIt("click",function(){r.eBV(t);const o=e.XpG().$implicit,d=e.XpG();return r.Njj(d.removeDid(o))}),e.k0s()()}if(2&n){let t;const i=e.XpG().$implicit,o=e.XpG();e.R7$(2),e.JRh(i.didNumber),e.R7$(3),e.JRh(null==i.inboundRule?null:i.inboundRule.RuleName),e.R7$(2),e.vxM((t=o.didRuleDestination(i.inboundRule))?7:8,t),e.R7$(3),e.Y8G("title",e.mNQ(e.bMT(11,5,"_i18n.Delete")))}}function Ui(n,s){if(1&n){const t=e.RV6();e.j41(0,"tr",27)(1,"td",7)(2,"app-checker",28),e.bIt("ngModelChange",function(o){const d=r.eBV(t).$implicit,c=e.XpG();return r.Njj(c.selector.setSelected(d,o))})("checkerClick",function(o){const d=r.eBV(t).$implicit,c=e.XpG();return r.Njj(c.selector.handleCheckerClick(d,o))}),e.k0s()(),e.nVh(3,Wi,2,1,"td",29)(4,Yi,12,7),e.k0s()}if(2&n){const t=s.$implicit,i=e.XpG();e.AVh("mhover",t.id!==i.editedIndex),e.R7$(2),e.Y8G("ngModel",i.selector.isRowSelected(t)),e.R7$(),e.vxM(t.id===i.editedIndex?3:4)}}let Yt=(()=>{class n extends jt.s{destroy$=(0,r.WQX)(r.abz);modalService=(0,r.WQX)(j.B);peersApiService=(0,r.WQX)(Ni.L);AddMode=-1;pager;resolver$=new yi.m(1);items=[];didNumbersWithRule=[];uniqueDidNumbers=new Set;selector;editedIndex;editedValue;phoneControl=new a.MJ("",[a.k0.required,b.CO,b.BY,t=>this.isMcmMode?(0,b.J3)(t):null,t=>t.value&&(t.value!==this.editedValue||-1===this.editedIndex)&&this.uniqueDidNumbers.has(t.value)?{didIsDuplicate:!0}:null,t=>t.value===this.mainTrunkNumber?{didIsDuplicate:!0}:null]);maxDidPerTrunk;inboundRules;mainTrunkNumber;groupsRouteData;isE164Capable;isMcmMode;constructor(){const t=(0,r.WQX)(f.gRc);super(t);const i=this.destroy$,o=this.modalService;this.selector=new lt.a({cd:t,keySelector:d=>d.id}),this.pager=new Si.f(i,this.resolver$,void 0,25),this.pager.pagedItems$.pipe((0,O.pQ)(this.destroy$)).subscribe({next:d=>{this.items=d.value||[],this.selector.onDataChanged(this.items),t.markForCheck()},error:d=>o.error(d)})}ngOnChanges(t){t.inboundRules&&this.updateDidResolver()}onEnter(t){t.preventDefault(),t.stopPropagation(),this.save()}get maxDidsPerTrunkReached(){return this.didNumbersWithRule.length>=this.maxDidPerTrunk-1}didRuleDestination(t){const i=t?.OfficeHoursDestination;return i?(0,be.bx)(i,this.groupsRouteData):void 0}writeValue(t){this.editedIndex=void 0,this.selector.resetAll(),this.didNumbersWithRule=t,this.uniqueDidNumbers=new Set(this.didNumbersWithRule.map(i=>i.didNumber)),this.updateDidResolver()}onEntityClick(t,i){t.stopPropagation(),t.preventDefault(),this.editedIndex!==i.id&&(this.finishEdit(!0),this.startEdit(i))}replaceInVisual(t,i){const o=this.items.findIndex(d=>d.id===t);o>-1&&(this.items[o].didNumber=i)}finishEdit(t,i=!0){this.phoneControl.valid&&(-1===this.editedIndex?(this.didNumbersWithRule.push({didNumber:this.phoneControl.value}),t&&this.markChanged()):void 0!==this.editedIndex&&this.didNumbersWithRule[this.editedIndex].didNumber!==this.phoneControl.value&&(this.didNumbersWithRule[this.editedIndex].didNumber=this.phoneControl.value,this.didNumbersWithRule[this.editedIndex].inboundRule=void 0,this.replaceInVisual(this.editedIndex,this.phoneControl.value),t&&this.markChanged())),(i||this.phoneControl.valid)&&(this.editedIndex=void 0)}startEdit(t){this.phoneControl.setValue(t.didNumber),this.phoneControl.markAsTouched(),this.editedIndex=t.id,this.editedValue=t.didNumber}save(){this.finishEdit(!0,!1)}cancel(){this.editedIndex=void 0}
1addDid(){this.finishEdit(!0),this.phoneControl.setValue(""),this.phoneControl.markAsTouched(),this.editedIndex=-1,this.editedValue=void 0}addMultipleDids(t){const i=new Set(this.didNumbersWithRule.map(c=>c.didNumber)),o=this.maxDidPerTrunk-1-i.size,d=new Map;for(const c of t){const v=c.did,M=!(0,b.ZG)(v,this.isMcmMode)&&!(0,b.PN)(v)&&v!==this.mainTrunkNumber&&!i.has(v)&&v.length<=50&&!d.has(v),E=!c.ruleName||!!c.ruleName&&c.ruleName.length<=50&&!(0,b.md)(c.ruleName)&&!(0,b.n$)(c.ruleName);M&&E&&d.set(v,{dnNumber:c.dnNumber,ruleName:c.ruleName})}d.size?d.size>o?this.modalService.error("_i18n.MaximumDidNumbersImportAllowed",{p0:o}):this.insertDidNumbersWithRules(d):t.length&&this.modalService.error("_i18n.NoNewValidDidNumbers")}insertDidNumbersWithRules(t){const i=[q.J.Extension,q.J.RingGroup,q.J.Queue,q.J.Ivr,q.J.RoutePoint,q.J.Group,q.J.Fax,q.J.Conference],o=[...new Set([...t.values()].filter(({dnNumber:c})=>!!c).map(({dnNumber:c})=>c))];(o.length?this.peersApiService.retreivePeersByNumbers({peersRetreivePeersByNumbersRequestBody:{peersRequest:{DnNumbers:o}}}).pipe((0,G.T)(c=>(c.value||[]).filter(v=>i.includes(v.Type??q.J.None)&&!!v.Number&&"HOL"!==v.Number&&!v.Number.startsWith("HD"))),(0,U.W)(()=>(0,Y.of)([]))):(0,Y.of)([])).subscribe(c=>{const v=new Map(c.map(E=>[E.Number,E])),M=Array.from(t.entries()).reduce((E,[X,{dnNumber:z,ruleName:Ft}])=>{if(z){if(v.has(z)){const Ae=(0,$e.Rz)(v.get(z));E.push({didNumber:X,inboundRule:Ae?(0,$e.dL)(X,Ae,Ft):void 0})}}else E.push({didNumber:X});return E},[]);this.didNumbersWithRule.push(...M),this.markChanged()})}removeDid(t){this.finishEdit(!1),this.didNumbersWithRule.splice(t.id,1),this.markChanged()}deleteSelected(){this.finishEdit(!1);const t=this.selector.selectedKeys.sort((i,o)=>o-i);for(const i of t)this.didNumbersWithRule.splice(i,1);this.markChanged()}importDids(t){const i=t.item(0);if(i){if(!i.name.endsWith(".csv"))return void this.modalService.error("_i18n.IncorrectFileFormatCsv");if(i.size>dt.uS*dt.MB)return void this.modalService.error((0,Pi.cQ)(dt.uS));const o=new FileReader;o.onload=()=>{const d=o.result??"",c=[];wi().parse(d,{delimiter:",",skipEmptyLines:!0}).data.forEach(M=>{const E=M[0]?.trim()??"";E&&c.push({did:E,dnNumber:M[1]?.trim()??"",ruleName:M[2]?.trim()??""})}),this.addMultipleDids(c)},o.readAsText(i)}}markChanged(){super.markAsTouched(),this.onChange(this.didNumbersWithRule),this.uniqueDidNumbers=new Set(this.didNumbersWithRule.map(t=>t.didNumber)),this.selector.resetAll(),this.updateDidResolver()}updateDidResolver(){this.resolver$.next(new Ei(this.didNumbersWithRule,this.inboundRules))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-did-edit"]],hostBindings:function(i,o){1&i&&e.bIt("keydown.enter",function(c){return o.onEnter(c)},e.EBC)},inputs:{maxDidPerTrunk:"maxDidPerTrunk",inboundRules:"inboundRules",mainTrunkNumber:"mainTrunkNumber",groupsRouteData:"groupsRouteData",isE164Capable:"isE164Capable",isMcmMode:"isMcmMode"},features:[e.Jv_([{provide:a.kq,multi:!0,useExisting:n}]),e.Vt3,e.OA$],decls:35,vars:23,consts:[["editor",""],["buttons",""],[1,"d-flex","gap-1"],[1,"button-group"],[3,"ngTemplateOutlet"],[3,"formControl"],[1,"scrollable-table"],[1,"checker"],["data-qa","checkbox-all",3,"ngModelChange","ngModel"],[1,"edited"],[1,"actions"],["data-qa","did-row",3,"mhover"],["colspan","5"],[3,"pageChanged","currentPage","itemsPerPage","totalItems","showBoundaryLinks"],["data-qa","new-did",1,"d-flex"],["data-qa","number",1,"editDid",3,"placeholder","formControl","wcAutofocus","maxlength"],["data-qa","save","type","button",1,"btn","btn-border",3,"click","disabled"],["data-qa","cancel","type","button",1,"btn","btn-border",3,"click"],["data-qa","validation",1,"ms-2","align-self-center",3,"control"],["valError","required"],["valError","starCodeError"],["app-exclamation-triangle-solid-icon","",1,"customSVGIcons","svg-md"],["data-qa","btn-add-did","type","button",1,"btn","btn-border",3,"click","disabled"],["app-plus-solid-icon",""],["id","btnImportDids","data-qa","import-did","accept",".csv","buttonClass","btn-border",3,"files","disabled"],["app-up-to-line-solid-icon",""],["data-qa","btn-delete-selected","type","button",1,"btn","btn-border",3,"click","disabled"],["data-qa","did-row"],["data-qa","checker",3,"ngModelChange","checkerClick","ngModel"],["colspan","4"],["data-qa","did-number",1,"pointer",3,"click"],[1,"dashed","edited"],["data-qa","rule-name",1,"pointer",3,"click"],[1,"line-clamp-1"],["data-qa","route-destination",1,"pointer",3,"click"],[3,"de
1st"],["id","btnDeleteDid","data-qa","delete-did","type","button","app-trash-alt-solid-icon","",1,"btn","btn-sm","btn-plain",3,"click","title"]],template:function(i,o){if(1&i&&(e.DNE(0,Vi,9,6,"ng-template",null,0,e.C5r),e.j41(2,"fieldset"),e.nVh(3,Bi,5,3,"p",2),e.j41(4,"div",3),e.eu8(5,4),e.DNE(6,ji,15,13,"ng-template",null,1,e.C5r),e.k0s(),e.nrm(8,"search-bar",5),e.j41(9,"table",6)(10,"thead")(11,"tr")(12,"th",7)(13,"app-checker",8),e.bIt("ngModelChange",function(c){return o.selector.setSelectAll(c)}),e.k0s()(),e.j41(14,"th")(15,"span",9),e.EFF(16),e.nI1(17,"translate"),e.k0s()(),e.j41(18,"th"),e.EFF(19),e.nI1(20,"translate"),e.k0s(),e.j41(21,"th"),e.EFF(22),e.nI1(23,"translate"),e.k0s(),e.nrm(24,"th",10),e.k0s()(),e.j41(25,"tbody"),e.Z7z(26,Ui,5,4,"tr",11,Di),e.k0s(),e.j41(28,"tfoot")(29,"tr")(30,"td",12)(31,"app-paging",13),e.nI1(32,"async"),e.nI1(33,"async"),e.nI1(34,"async"),e.bIt("pageChanged",function(c){return o.pager.pageChanged(c)}),e.k0s()()()()()()),2&i){const d=e.sdS(1),c=e.sdS(7);e.R7$(3),e.vxM(o.isE164Capable?3:-1),e.R7$(2),e.Y8G("ngTemplateOutlet",o.AddMode===o.editedIndex?d:c),e.R7$(3),e.Y8G("formControl",o.pager.search),e.R7$(5),e.Y8G("ngModel",o.selector.isAnySelected),e.R7$(3),e.JRh(e.bMT(17,11,"_i18n.DidNumber")),e.R7$(3),e.JRh(e.bMT(20,13,"_i18n.Name")),e.R7$(3),e.JRh(e.bMT(23,15,"_i18n.AssignedTo")),e.R7$(4),e.Dyx(o.items),e.R7$(5),e.Y8G("currentPage",e.bMT(32,17,o.pager.currentPage$))("itemsPerPage",e.bMT(33,19,o.pager.pageSize$))("totalItems",e.bMT(34,21,o.pager.totalCount$))("showBoundaryLinks",!0)}},dependencies:[Q.m,ct.J,a.X1,a.BC,a.tU,a.l_,Fi.x,Wt.D,A.IH,A.VI,Ve.f,V.T3,ut.K,Ai.O,Gi.s,Xt.d,Be.L,pt.$,a.YN,a.vS,Lt.F,de.u4,P.D9,V.Jj],styles:[".edited[_ngcontent-%COMP%]{padding-left:12px}.editDid[_ngcontent-%COMP%]{width:200px;margin:0}"],changeDetection:0})}return n})();var Ut=l(84412),te=l(84572),mt=l(5964),Ji=l(16444),ht=l(4187);function Hi(n,s){if(1&n&&(e.j41(0,"field-input",1),e.nrm(1,"val-errors",3),e.k0s()),2&n){const t=e.XpG();e.Y8G("label",t.title)("description",t.description)("minlength",t.minLength)("maxlength",t.maxLength),e.R7$(),e.Y8G("label",t.title)}}function Qi(n,s){if(1&n&&(e.j41(0,"field-input-password",2),e.nrm(1,"val-errors",3),e.k0s()),2&n){const t=e.XpG();e.Y8G("label",t.title)("description",t.description)("minlength",t.minLength)("maxlength",t.maxLength),e.R7$(),e.Y8G("label",t.title)}}let qi=(()=>{class n{form;showValidation;variableDescriptions={SMS_PREFIX:"_i18n.SMS_PREFIX_Description"};get title(){return"_i18n.MessagingVariables."+this.form.value.Title}get description(){return this.variableDescriptions[this.form.value.Title??""]??""}get isPassword(){return"Password"===this.form.value.OptionType}get isText(){return"Text"===this.form.value.OptionType}get minLength(){return this.form.value.MinLength}get maxLength(){return this.form.value.MaxLength}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-variable"]],inputs:{form:"form",showValidation:"showValidation"},decls:3,vars:3,consts:[[3,"formGroup"],["data-qa","text-variable","formControlName","value",3,"label","description","minlength","maxlength"],["data-qa","password-variable","formControlName","value",3,"label","description","minlength","maxlength"],["controlName","value",3,"label"]],template:function(i,o){1&i&&(e.qex(0,0),e.nVh(1,Hi,2,5,"field-input",1),e.nVh(2,Qi,2,5,"field-input-password",2),e.bVm()),2&i&&(e.Y8G("formGroup",o.form),e.R7$(),e.vxM(o.isText?1:-1),e.R7$(),e.vxM(o.isPassword?2:-1))},dependencies:[a.X1,a.BC,a.cb,a.xh,a.tU,a.j4,a.JD,Q.m,A.IH,st.$],encapsulation:2,changeDetection:0})}return n})();function zi(n,s){if(1&n&&(e.j41(0,"legend"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.JRh(e.bMT(2,1,t.sectionHeaderLabel))}}function Ki(n,s){1&n&&(e.j41(0,"p",6),e.nrm(1,"span",7),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&n&&(e.R7$(3),e.JRh(e.bMT(4,1,"_i18n.e164WarningSMS")))}function Zi(n,s){if(1&n&&(e.nrm(0,"field-checkbox",4)(1,"app-trunk-guide-link",5),e.nVh(2,Ki,5,3,"p",6)),2&n){const t=e.XpG(2);e.Y8G("label","_i18n.EnableSMS"),e.R7$(),e.Y8G("trunkTemplate",t.trunkTemplate),e.R7$(),e.vxM(t.isE164Capable?2:-1)}}function eo(n,s){if(1&n&&e.nrm(0,"app-trunk-variable",2),2&n){const t=s.$implicit,i=e.XpG(2);e.Y8G("form",t)("showValidation",i.showValidation)}}function to(n,s){1&n&&(e.j41(0,"div",3)(1,"div",8),e.nrm(2,"field-checkbox",9)(3,"field-input-number",10),e.k0s(),e.nrm(4,"val-errors",11),e.k0s()),2&n&&(e.R7$(3),e.Y8G("integer",!0)("min",3)("max",20)("hideAsterisk",!0))}function no(n,s){if(1&n&&(e.j41(0,"fieldset",0),e.nVh(1,zi,3,3,"legend")(2,Zi,3,3),e.nrm(3,"app-copy-url",1),e.nI1(4,"async"),e.Z7z(5,eo,1,2,"app-trunk-variable",2,e.fX1),e.nVh(7,to,5,4,"div",3),e.k0s()),2&n){const t=e.XpG();e.Y8G("formGroup",t.form),e.R7$(),e.vxM(t.isMessagingOptional?2:1),e.R7$(2),e.Y8G("url",e.bMT(4,5,t.webhookUrl$))("showActionText",!0),e.R7$(2),e.Dyx(t.messagingVariableForms),e.R7$(2),e.vxM(t.isDIDProvider?7:-1)}}let Ht=(()=>{class n{myPhone=(0,r.WQX)(Ji.gx);destroy$=(0,r.WQX)(r.abz);form;showValidation;trunkTemplate;webhookUrl$;form$=new Ut.t(null);get messagingVariableForms(){return this.form.controls.messagingVariables.controls}get isMessagingOptional(){return!!this.trunkTemplate?.MessagingTemplate?.Optional}get hasMessagingEditor(){return(0,g.a4)(this.trunkTemplate)}get isE164Capable(){return(0,g.xp)(this.trunkTemplate)}
1get isDIDProvider(){return(0,g.vc)(this.trunkTemplate)}ngOnInit(){this.webhookUrl$=this.form$.pipe((0,mt.p)(Boolean),(0,R.n)(t=>(0,te.z)([this.myPhone.myPhoneSession.pipe((0,G.T)(i=>i.systemParameters.PbxExternalHost)),(0,C.XP)(t.controls.provider),(0,C.XP)(t.controls.webhook)])),(0,G.T)(([t,i,o])=>(0,g.X1)(t,i,o))),this.form$.pipe((0,mt.p)(Boolean),(0,R.n)(t=>(0,C.XP)(t.controls.enabled)),(0,O.pQ)(this.destroy$)).subscribe(t=>{this.setMessagingVariablesEnabled(t)}),this.isDIDProvider&&this.form$.pipe((0,mt.p)(Boolean),(0,R.n)(t=>(0,te.z)([(0,C.XP)(t.controls.enabled),(0,C.XP)(t.controls.numberLengthEnabled)])),(0,O.pQ)(this.destroy$)).subscribe(([t,i])=>{(0,C.TZ)(this.form.controls.numberLengthEnabled,t),(0,C.TZ)(this.form.controls.numberLength,t&&i)})}ngOnChanges(t){t.form&&this.form$.next(this.form??null)}get sectionHeaderLabel(){return this.trunkTemplate?.MessagingTemplate?.Optional||this.trunkTemplate?.MessagingTemplate?.Outbound?"_i18n.ComposeSmsHeader":"_i18n.Configure"}setMessagingVariablesEnabled(t){this.messagingVariableForms.forEach(i=>(0,C.TZ)(i,t))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-messaging-edit"]],inputs:{form:"form",showValidation:"showValidation",trunkTemplate:"trunkTemplate"},features:[e.OA$],decls:1,vars:1,consts:[["data-qa","messaging-editor",3,"formGroup"],["label","_i18n.Webhook","data-qa","webhook",3,"url","showActionText"],["data-qa","trunk-variable",3,"form","showValidation"],[1,"d-flex","flex-column","gap-2","mb-3"],["data-qa","enabled","formControlName","enabled",3,"label"],[3,"trunkTemplate"],[1,"d-flex","gap-1"],["app-exclamation-triangle-solid-icon","",1,"customSVGIcons","svg-md"],[1,"d-flex","align-items-center","gap-2"],["formControlName","numberLengthEnabled","data-qa","enable-caller-id-number-matching","label","_i18n.EnableCallerIDNumberMatching","hint","_i18n.CallerIDNumberMatchingHint",1,"mb-0"],["formControlName","numberLength","data-qa","caller-id-number-matching=-length","units","_i18n.Digits",1,"mb-0","flex-basis-150",3,"integer","min","max","hideAsterisk"],["controlName","numberLength"]],template:function(i,o){1&i&&e.nVh(0,no,8,7,"fieldset",0),2&i&&e.vxM(o.hasMessagingEditor?0:-1)},dependencies:[a.X1,a.BC,a.cb,a.j4,a.JD,Re.t,rt,Ve.f,ht.c,qi,he.B,A.IH,P.D9,V.Jj],encapsulation:2,changeDetection:0})}return n})();var We=l(31321),bt=l(97525),io=l(36392),Xe=l(94304),fe=l(66300),oo=l(43218),Ne=l(18530),B=l(54999),ne=l(22972),ie=l(40953);function ao(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.Duplicate"))}let Qt=(()=>{class n extends ne.m{cd=(0,r.WQX)(f.gRc);buttons=B.P.OkCancel;data;list=[];duplicateSourcePatternValidator=t=>this.list.find(o=>o.SourcePattern===t.value&&o.ReplacePattern!==this.data?.ReplacePattern)?{duplicateSource:!0}:null;form=new a.gE({ReplacePattern:new a.MJ("",{validators:[a.k0.required],nonNullable:!0}),SourcePattern:new a.MJ("",{validators:[a.k0.required,this.duplicateSourcePatternValidator],nonNullable:!0})});validateBeforeSubmit=this.createDialogValidate(this.form,this.cd);ngOnInit(){this.data&&this.form.patchValue(this.data)}getPayload(){return this.form.value}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],hostVars:2,hostBindings:function(i,o){2&i&&e.AVh("modal-lg",!0)},inputs:{data:"data",list:"list"},features:[e.Vt3],decls:7,vars:5,consts:[["header","_i18n.EditFormatting",3,"submitted","formGroup","validateBeforeSubmit","buttons"],["data-qa","source-pattern","formControlName","SourcePattern","label","_i18n.SourcePattern",3,"maxlength"],["controlName","SourcePattern"],["valError","duplicateSource"],["data-qa","replace-pattern","formControlName","ReplacePattern","label","_i18n.ReplacePattern",3,"maxlength"],["controlName","ReplacePattern"]],template:function(i,o){1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("submitted",function(){return o.onSubmit()}),e.j41(1,"fieldset")(2,"field-input",1)(3,"val-errors",2),e.DNE(4,ao,2,3,"ng-template",3),e.k0s()(),e.j41(5,"field-input",4),e.nrm(6,"val-errors",5),e.k0s()()()),2&i&&(e.Y8G("formGroup",o.form)("validateBeforeSubmit",o.validateBeforeSubmit)("buttons",o.buttons),e.R7$(2),e.Y8G("maxlength",50),e.R7$(3),e.Y8G("maxlength",50))},dependencies:[ie.p,a.X1,a.BC,a.cb,a.tU,a.j4,a.JD,Q.m,A.IH,A.VI,P.D9],encapsulation:2})}return n})();var qt=l(98505),zt=l(49562),Z=l(82233);const ro=(n,s)=>s.Id;function so(n,s){if(1&n){const t=e.RV6();e.j41(0,"tr",15),e.bIt("click",function(){const o=r.eBV(t).$implicit,d=e.XpG();
1return r.Njj(d.edit(o))}),e.j41(1,"td",9)(2,"app-checker",16),e.bIt("ngModelChange",function(o){const d=r.eBV(t).$implicit,c=e.XpG();return r.Njj(c.selector.setSelected(d,o))})("checkerClick",function(o){const d=r.eBV(t).$implicit,c=e.XpG();return r.Njj(c.selector.handleCheckerClick(d,o))}),e.k0s()(),e.j41(3,"td",17),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s(),e.j41(7,"td"),e.EFF(8),e.k0s(),e.j41(9,"td",11)(10,"button",18),e.nI1(11,"translate"),e.bIt("click",function(o){const d=r.eBV(t).$implicit;return e.XpG().deleteSingle(d),r.Njj(o.stopPropagation())}),e.k0s()()()}if(2&n){const t=s.$implicit,i=e.XpG();e.AVh("active",i.selector.isRowSelected(t)),e.R7$(2),e.Y8G("ngModel",i.selector.isRowSelected(t)),e.R7$(2),e.JRh(t.Id+1),e.R7$(2),e.JRh(t.SourcePattern),e.R7$(2),e.JRh(t.ReplacePattern),e.R7$(2),e.Y8G("title",e.mNQ(e.bMT(11,8,"_i18n.Delete")))}}function Le(n){return n.map((s,t)=>({...s,Id:t}))}let uo=(()=>{class n extends jt.s{modalService=(0,r.WQX)(j.B);destroy$=(0,r.WQX)(r.abz);displayedItems=[];cidRowsChanged$=new Ne.B;selector;search=new a.MJ("");itemsPerPage=25;currentPage=1;cidRows=[];constructor(){const t=(0,r.WQX)(f.gRc);super(t),this.selector=new lt.a({cd:t,keySelector:i=>i.Id??0})}updateItems(t){this.cidRows=t,this.setDisplayedItems(),this.currentPage=(0,Z.o)(this.currentPage,this.displayedItems.length,this.itemsPerPage),this.cd.markForCheck()}setDisplayedItems(){const t=this.search.value?.toLowerCase();this.displayedItems=this.cidRows.filter(i=>!t||i.SourcePattern&&i.SourcePattern.toLowerCase().includes(t)||i.ReplacePattern&&i.ReplacePattern.toLowerCase().includes(t)),this.selector.onDataChanged(this.displayedItems)}pageChanged(t){this.currentPage=t.page,this.cd.markForCheck()}ngOnInit(){(0,C.XP)(this.search).pipe((0,O.pQ)(this.destroy$)).subscribe(()=>{this.currentPage=1,this.setDisplayedItems(),this.cd.markForCheck()}),this.cidRowsChanged$.pipe((0,O.pQ)(this.destroy$)).subscribe({next:t=>{this.markAsTouched(),this.onChange(function lo(n){return n.map(s=>{const{Id:t,...i}=s;return i})}(t)),this.updateItems(t)}})}add(){this.modalService.showComponent(Qt,{initialState:{data:{SourcePattern:"",ReplacePattern:""},list:this.cidRows}}).subscribe({next:t=>{t.decision===B.R.Ok&&t.payload&&(this.cidRows.push({...t.payload,Id:this.cidRows.length}),this.cidRowsChanged$.next(this.cidRows))}})}edit(t){this.modalService.showComponent(Qt,{initialState:{data:t,list:this.cidRows}}).subscribe({next:i=>{i.decision===B.R.Ok&&i.payload&&(this.cidRows[t.Id]={...i.payload,Id:t.Id},this.cidRowsChanged$.next(this.cidRows))}})}deleteSingle(t){this.cidRows=this.cidRows.filter(i=>i!==t),this.cidRows=Le(this.cidRows),this.cidRowsChanged$.next(this.cidRows)}deleteSelected(){this.cidRows=this.cidRows.filter((t,i)=>!this.selector.selectedKeys.includes(i)),this.cidRows=Le(this.cidRows),this.cidRowsChanged$.next(this.cidRows),this.selector.resetAll()}deleteAll(){this.modalService.confirmDeletion("_i18n.DeleteAllCidFormattingConfirmationMessage").subscribe({next:()=>{this.cidRows=[],this.cidRows=Le(this.cidRows),this.cidRowsChanged$.next(this.cidRows)}})}onPageSizeChange(t){this.itemsPerPage=t,this.currentPage=1}writeValue(t){this.cidRows=Le(t??[]),this.selector.onDataChanged(this.cidRows),this.updateItems(this.cidRows)}moveUpMoveDown(t){if(t&&this.disableMoveUp||!t&&this.disableMoveDown)return;const i=this.selector.selectedValues[0],o=this.cidRows.findIndex(d=>d.Id===this.selector.selectedKeys[0]);if(o>-1){const d=t?o-1:o+1;(function co(n,s,t){const i=t[s];t[s]=t[n],t[s].Id=s,t[n]=i,t[n].Id=n})(o,d,this.cidRows),this.cidRowsChanged$.next(this.cidRows),this.selector.resetSingle(o),this.selector.setSelected(i,!0),this.currentPage=Math.floor(d/this.itemsPerPage)+1}}selectAllPageItems(t){t?this.currentPageItems.forEach(i=>this.selector.setSelected(i,!0)):this.selector.resetAll()}get currentPageItems(){return this.displayedItems.slice((this.currentPage-1)*this.itemsPerPage,this.currentPage*this.itemsPerPage)}get isSearch(){return(this.search.value?.length??0)>0}get disableMoveUp(){return!this.selector.isOneSelected||this.isSearch||this.selector.selectedKeys[0]===this.cidRows[0]?.Id}get disableMoveDown(){return!this.selector.isOneSelected||this.isSearch||this.selector.selectedKeys[0]===this.cidRows[this.cidRows.length-1]?.Id}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-cid-formatting"]],features:[e.Jv_([{provide:a.kq,useExisting:n,multi:!0}]),e.Vt3],decls:49,vars:36,consts:[[1,"button-group"],["data-qa","btn-add","type","button",1,"btn","btn-border",3,"click"],["app-plus-solid-icon",""],["data-qa","delete-formatting-cid","type","button",1,"btn","btn-border",3,"click","disabled"],["data-qa","delete-all-formatting-cid","type","button",1,"btn","btn-border",3,"click","disabled"],["data-qa","move-up-formatting-cid","type","button",1,"btn","btn-border",3,"click","disabled"],["data-qa","move-down-formatting-cid","type","button",1,"btn","btn-border",3,"click","disabled"],[3,"formControl"],[1,"scrollable-table","cids-table"],[1,"checker"],["data-qa","checkbox-all",3,"ngModelChange","ngModel"],[1,"actions"],["data-qa","cid-formatting",1,"clickable",3,"active"],["colspan","5"],[3,"pageChanged","itemsPerPageChanged","currentPage","itemsPerPage","totalItems","showBoundaryLinks","showPageSizes"],["data-qa","cid-formatting",1,"clickable",3,"click"],[3,"ngModelChange","checkerClick","ngModel"],[1,"fw-bold"],["data-qa","delete","type","button","app-trash-alt-solid-icon","",1,"btn","btn-plain-sm",3,"click","title"]],template:function(i,o){1&i&&(e.j41(0,"div",0)(1,"button",1),e.bIt("click",function(){return o.add()}),e.nrm(2,"span",2),e.j41(3,"span"),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"button",3),e.bIt("click",function(){return o.deleteSelected()}),e.nrm(7,"app-trash-alt-solid-icon"),e.j41(8,"span"),e.EFF(9),e.nI1(10,"translate"),e.k0s()(),e.j41(11,"button",4),e.bIt("click",function(){return o.deleteAll()}),e.nrm(12,"app-trash-alt-solid-icon"),e.j41(13,"span"),e.EFF(14),e.nI1(15,"translate"),e.k0s()(),e.j41(16,"button",5),e.bIt("click",function(){return o.moveUpMoveDown(!0)}),e.nrm(17,"app-arrow-alt-up-solid-icon"),e.j41(18,"span"),e.EFF(19),e.nI1(20,"translate"),e.k0s()(),e.j41(21,"button",6),e.bIt("click",function(){return o.moveUpMoveDown(!1)}),e.nrm(22,"app-arrow-alt-down-solid-icon"),e.j41(23,"span"),e.EFF(24),e.nI1(25,"translate"),e.k0s()()(),e.nrm(26,"search-bar",7),e.j41(27,"table",8)(28,"thead")(29,"tr")(30,"th",9)(31,"app-checker",10),e.bIt("ngModelChange",function(c){return o.selectAllPageItems(c)}),e.k0s()(),e.j41(32,"th"),e.EFF(33),e.nI1(34,"translate"),e.k0s(),e.j41(35,"th"),e.EFF(36),e.nI1(37,"translate"),e.k0s(),e.j41(38,"th"),e.EFF(39),e.nI1(40,"translate"),e.k0s(),e.nrm(41,"th",11),e.k0s()(),e.j41(42,"tbody"),e.Z7z(43,so,12,10,"tr",12,ro),e.k0s(),e.j41(45,"tfoot")(46,"tr")(47,"td",13)(48,"app-paging",14),e.bIt("pageChanged",function(c){return o.pageChanged(c)})("itemsPerPageChanged",function(c){return o.onPageSizeChange(c)}),e.k0s()()()()()),2&i&&(e.R7$(4),e.JRh(e.bMT(5,20,"_i18n.Add")),e.R7$(2),e.Y8G("disabled",!o.selector.isAnySelected),e.R7$(3),e.Lme("",e.bMT(10,22,"_i18n.Delete"),"",o.selector.selectedCountLabel),e.R7$(2),e.Y8G("disabled",!o.cidRows.length),e.R7$(3),e.JRh(e.bMT(15,24,"_i18n.DeleteAll")),e.R7$(2),e.Y8G("disabled",o.disableMoveUp),e.R7$(3),e.JRh(e.bMT(20,26,"_i18n.MoveUp")),e.R7$(2),e.Y8G("disabled",o.disableMoveDown),e.R7$(3),e.JRh(e.bMT(25,28,"_i18n.MoveDown")),e.R7$(2),e.Y8G("formControl",o.search),e.R7$(5),e.Y8G("ngModel",o.selector.isAnySelected),e.R7$(2),e.JRh(e.bMT(34,30,"_i18n.Priority")),e.R7$(3),e.JRh(e.bMT(37,32,"_i18n.SourcePattern")),e.R7$(3),e.JRh(e.bMT(40,34,"_i18n.ReplacePattern")),e.R7$(4),e.Dyx(o.currentPageItems),e.R7$(5),e.Y8G("currentPage",o.currentPage)("itemsPerPage",o.itemsPerPage)("totalItems",o.displayedItems.length)("showBoundaryLinks",!0)("showPageSizes",!0))},dependencies:[Xt.d,qt.C,zt.B,Be.L,a.X1,a.BC,a.l_,ut.K,de.u4,pt.$,a.YN,a.vS,P.D9],styles:[".cids-table[_ngcontent-%COMP%]{tr:nth-child(2n):not(:hover):not(:active){background:var(--bg-primary-darken)}}"]})}return n})();var Ye=l(98352);function po(n,s){if(1&n&&(e.j41(0,"ng-option",4),e.EFF(1),e.k0s()),2&n){const t=s.$implicit;e.Y8G("value",t.Id),e.R7$(),e.JRh(t.Description)}}function mo(n,s){1&n&&e.nrm(0,"field-input",5)}function ho(n,s){if(1&n&&(e.j41(0,"div",1)(1,"div",2),e.EFF(2),e.k0s(),e.j41(3,"ng-select",3)(4,"ng-option",4),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.Z7z(7,po,2,2,"ng-option",4,e.fX1),e.k0s(),e.nVh(9,mo,1,0,"field-input",5),e.k0s()),2&n){const t=s.$implicit,i=e.XpG();e.Y8G("formGroupName",i.getId(t)),e.R7$(2),e.JRh(t.parameter.Description),e.R7$(),e.AVh("span2Columns",!i.isCustomFieldSelected(t)),e.Y8G("clearable",!1),e.R7$(),e.Y8G("value",i.DEFAULT_GATEWAY_PARAMETER_VALUE.Id),e.R7$(),e.SpI(" ",e.bMT(6,8,i.DEFAULT_GATEWAY_PARAMETER_VALUE.Description)," "),e.R7$(2),e.Dyx(t[i.possibleValuesProperty]),e.R7$(2),e.vxM(i.showCustomFieldColumn&&i.isCustomFieldSelected(t)?9:-1)}}const Ue={Id:-1,Description:"_i18n.Default"};let Kt=(()=>{class n extends Ye.z{destroy$=(0,r.WQX)(r.abz);gatewayParams;possibleValuesProperty;showOnlyWithNames;showCustomFieldColumn;DEFAULT_GATEWAY_PARAMETER_VALUE=Ue;form=new a.gE({});editableParams;availableParams;constructor(){super(),this.touchOnChange=!0}isCustomFieldSelected(t){const i=this.form.value[this.getId(t)]?.valueId;return t.outboundParamPossibleValues.find(d=>d.Id===i)?.Name?.startsWith("$Custom")}getId(t){return String(t.parameter.Id)}ngOnInit(){this.editableParams=Array.from(this.gatewayParams.entr
1ies()).sort(([t],[i])=>t-i).map(([t,i])=>i).filter(t=>t[this.possibleValuesProperty].length>0),this.availableParams=this.showOnlyWithNames?.length?this.editableParams.filter(t=>this.showOnlyWithNames.includes(t.parameter.Name||"")):this.editableParams,this.editableParams.forEach(t=>{this.form.addControl(this.getId(t),new a.gE({valueId:new a.MJ(Ue.Id,{nonNullable:!0}),custom:new a.MJ("",{nonNullable:!0})}),{emitEvent:!1})}),this.form.valueChanges.pipe((0,O.pQ)(this.destroy$)).subscribe(t=>{const i=Object.entries(t).reduce((o,[d,c])=>(c&&c.valueId!==Ue.Id&&o.push({ParamId:+d,ValueId:c.valueId,Custom:c.custom}),o),[]);this.valueChanged(i)})}writeValue(t){super.writeValue(t??[]);const i=new Map;this.value.forEach(d=>i.set(String(d.ParamId),d));const o=this.editableParams.reduce((d,c)=>{const v=this.getId(c),M=i.get(v),E=M?.ValueId??Ue.Id,X=M?.Custom??"";return Object.assign(d,{[v]:{valueId:E,custom:X}})},{});this.form.setValue(o,{emitEvent:!1}),this.form.markAsPristine(),this.form.markAsUntouched()}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-gateway-parameters"]],inputs:{gatewayParams:"gatewayParams",possibleValuesProperty:"possibleValuesProperty",showOnlyWithNames:"showOnlyWithNames",showCustomFieldColumn:"showCustomFieldColumn"},features:[e.Jv_([{provide:a.kq,useExisting:n,multi:!0}]),e.Vt3],decls:3,vars:3,consts:[[1,"d-flex","flex-column","gap-3","mb-3",3,"formGroup"],[1,"parameter",3,"formGroupName"],[1,"pt-2"],["formControlName","valueId",3,"clearable"],[3,"value"],["formControlName","custom",1,"mb-0"]],template:function(i,o){1&i&&(e.j41(0,"div",0),e.Z7z(1,ho,10,10,"div",1,e.fX1),e.k0s()),2&i&&(e.AVh("without-custom",!o.showCustomFieldColumn),e.Y8G("formGroup",o.form),e.R7$(),e.Dyx(o.availableParams))},dependencies:[a.X1,a.BC,a.cb,a.j4,a.JD,a.$R,ee.vr,ee.xt,Q.m,P.D9],styles:[".parameter[_ngcontent-%COMP%]{display:grid;gap:1rem;grid-template-columns:calc(30% - 1rem) 40% calc(30% - 1rem)}.without-custom[_ngcontent-%COMP%]   .parameter[_ngcontent-%COMP%]{grid-template-columns:calc(40% - 1rem) 60%}.parameter[_ngcontent-%COMP%]   .span2Columns[_ngcontent-%COMP%]{grid-column:span 2}"],changeDetection:0})}return n})();var Zt=l(80939),ft=l(27859),Je=l(88141),D=l(96106),gt=l(23294);const He="ADD_NEW_LOCATION";let bo=(()=>{class n extends ne.m{cd=(0,r.WQX)(f.gRc);emergencyLocationsApi=(0,r.WQX)(ft.w);destroy$=(0,r.WQX)(r.abz);locations;trunkLocation;trunkLocations;locationOptions;buttons=B.P.OkCancel;form=new a.gE({id:new a.MJ(null,{nonNullable:!0}),locationId:new a.MJ(null,[a.k0.required,({value:t})=>t&&this.trunkLocations?.some(o=>o!==this.trunkLocation&&o.Location?.Id===t)?{duplicate:!0}:null]),newFriendlyName:new a.MJ({value:"",disabled:!0},[a.k0.required,b.QO,a.k0.maxLength(50)]),providerUri:new a.MJ("",{nonNullable:!0,validators:[a.k0.required,b.QO]})});validateBeforeSubmit=this.createDialogValidate(this.form,this.cd);ngOnInit(){this.trunkLocation&&this.form.setValue({id:this.trunkLocation.Id??null,locationId:this.trunkLocation.Location?.Id??null,newFriendlyName:"",providerUri:this.trunkLocation.ProviderUri??""}),this.locationOptions=[{label:"_i18n.NewLocationFriendlyName",value:He}].concat(this.locations.map(t=>({value:t.Id,label:t.FriendlyName}))),this.f.locationId.valueChanges.pipe((0,G.T)(t=>t===He),(0,gt.F)(),(0,O.pQ)(this.destroy$)).subscribe(t=>{(0,C.TZ)(this.f.newFriendlyName,t),this.f.newFriendlyName.setValue(""),this.f.newFriendlyName.markAsUntouched()})}get f(){return this.form.controls}submit$=()=>{const{locationId:t,newFriendlyName:i}=this.form.value;return t!==He?(0,Y.of)(void 0):this.emergencyLocationsApi.update({emergencyGeoLocationsUpdateRequestBody:{locations:this.locations.concat([{FriendlyName:i}])}}).pipe((0,R.n)(()=>this.emergencyLocationsApi.listEmergencyGeoLocation({})),D.yh,(0,Je.M)(o=>{this.locations=o}))};getPayload(){const{id:t,locationId:i,providerUri:o,newFriendlyName:d}=this.form.value;return{Id:t??void 0,Location:this.locations.find(i===He?v=>v.FriendlyName===d:v=>v.Id===i),ProviderUri:o}}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-emergency-trunk-geolocation-dialog"]],inputs:{locations:"locations",trunkLocation:"trunkLocation",trunkLocations:"trunkLocations"},features:[e.Vt3],decls:7,vars:13,consts:[["header","_i18n.AddE911GeoLocation",3,"submitted","buttons","validateBeforeSubmit","submit$"],["label","_i18n.LocationFriendlyName",3,"formControl","options"],[3,"control"],["data-qa","friendly-name","placeholder","_i18n.LocationFriendlyNamePlaceholder",1,"flex-1",3,"formControl","maxlength"],["label","_i18n.LocationProviderURI",3,"formControl"]],template:function(i,o){1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("submitted",function(){return o.onSubmit()}),e.j41(1,"field-select",1),e.nrm(2,"val-errors",2),e.k0s(),e.j41(3,"field-input",3),e.nrm(4,"val-errors",2),e.k0s(),e.j41(5,"field-input",4),e.nrm(6,"val-errors",2),e.k0s()()),2&i&&(e.Y8G("buttons",o.buttons)("validateBeforeSubmit",o.validateBeforeSubmit)("submit$",o.submit$),e.R7$(),e.Y8G("formControl",o.f.locationId)("options",o.locationOptions),e.R7$(),e.Y8G("control",o.f.locationId),e.R7$(),e.AVh("d-none",o.f.newFriendlyName.disabled),e.Y8G("formControl",o.f.newFriendlyName)("maxlength",50),e.R7$(),e.Y8G("control",o.f.newFriendlyName),e.R7$(),e.Y8G("formControl",o.f.providerUri),e.R7$(),e.Y8G("control",o.f.providerUri))},dependencies:[Q.m,fe.q,ie.p,a.X1,a.BC,a.tU,a.l_,A.N4,A.IH],encapsulation:2,changeDetection:0})}return n})();var Qe=l(90776),ce=l(29325),_t=l(57786),fo=l(52478);function go(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",0)(1,"field-input",2),e.nrm(2,"val-errors",3),e.k0s(),e.j41(3,"app-button-delete",5),e.nI1(4,"translate"),e.bIt("click",function(){const o=r.eBV(t).$index,d=e.XpG();
1return r.Njj(d.locations.removeAt(o))}),e.k0s()()}2&n&&(e.Y8G("formGroup",s.$implicit),e.R7$(),e.Y8G("maxlength",50),e.R7$(2),e.Y8G("title",e.bMT(4,3,"_i18n.Delete")))}let _o=(()=>{class n extends Ye.z{locations=new a.Yp([]);duplicateValidator=t=>{const{value:i}=t;return i&&"string"==typeof i&&this.locations.controls.some(({controls:{FriendlyName:d}})=>d!==t&&d.value===i)?{duplicate:!0}:null};newLocation=this.createControl({FriendlyName:""});constructor(){const t=(0,r.WQX)(r.abz);super(),(0,_t.h)(this.locations.valueChanges,this.newLocation.valueChanges).pipe((0,O.pQ)(t)).subscribe(()=>{this.valueChanged([...this.locations.value,...this.newLocation.valid?[this.newLocation.value]:[]].map(i=>({...i,Id:i.Id??void 0})))})}ngOnInit(){this.syncControlState(this.locations)}setDisabledState(t){super.setDisabledState(t),(0,C.TZ)(this.locations,!t)}writeValue(t){super.writeValue(t),this.locations.clear({emitEvent:!1}),this.value.forEach(i=>{this.locations.push(this.createControl(i),{emitEvent:!1})}),this.touched&&this.locations.markAllAsTouched(),this.newLocation.reset()}validate=this.createAsyncComponentValidator(this.locations);createControl(t){return new a.gE({Id:new a.MJ(t.Id,{nonNullable:!0}),FriendlyName:new a.MJ(t.FriendlyName,{nonNullable:!0,validators:[a.k0.required,b.QO,a.k0.maxLength(50),this.duplicateValidator]})})}add(){this.newLocation.invalid?this.newLocation.markAllAsTouched():(this.locations.push(this.createControl(this.newLocation.value),{emitEvent:!1}),this.newLocation.reset())}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-emergency-geolocations"]],features:[e.Jv_([{provide:a.kq,multi:!0,useExisting:n},{provide:a.pg,multi:!0,useExisting:n}]),e.Vt3],decls:6,vars:2,consts:[["data-qa","geolocation",1,"d-flex","gap-2",3,"formGroup"],["data-qa","geolocation-draft",1,"d-flex","gap-2",3,"formGroup"],["data-qa","friendly-name","formControlName","FriendlyName","placeholder","_i18n.LocationFriendlyNamePlaceholder",1,"flex-1",3,"maxlength"],["controlName","FriendlyName"],["theme","plain","text","",3,"click"],["theme","plain","text","",1,"svg-semi-sm",3,"click","title"]],template:function(i,o){1&i&&(e.Z7z(0,go,5,5,"div",0,e.fX1),e.j41(2,"div",1)(3,"field-input",2),e.nrm(4,"val-errors",3),e.k0s(),e.j41(5,"app-button-add",4),e.bIt("click",function(){return o.add()}),e.k0s()()),2&i&&(e.Dyx(o.locations.controls),e.R7$(2),e.Y8G("formGroup",o.newLocation),e.R7$(),e.Y8G("maxlength",50))},dependencies:[a.X1,a.BC,a.cb,a.tU,a.j4,a.JD,Q.m,A.N4,A.IH,fo.L,Qe.j,P.D9],encapsulation:2,changeDetection:0})}return n})(),Co=(()=>{class n extends ne.m{cd=(0,r.WQX)(f.gRc);emergencyLocationsApi=(0,r.WQX)(ft.w);buttons=B.P.OkCancel;locations;formControl=new a.MJ([],{nonNullable:!0});validateBeforeSubmit=this.createDialogValidate(this.formControl,this.cd);ngOnInit(){this.formControl.setValue(this.locations)}submit$=()=>this.emergencyLocationsApi.update({emergencyGeoLocationsUpdateRequestBody:{locations:this.formControl.value}});static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-emergency-geolocations-dialog"]],inputs:{locations:"locations"},features:[e.Vt3],decls:2,vars:6,consts:[["header","_i18n.EditE911GeolocationsNames",3,"submitted","buttons","scrollable","waitRecalculationsBeforeSave","validateBeforeSubmit","submit$"],[3,"formControl"]],template:function(i,o){1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("submitted",function(){return o.onSubmit()}),e.nrm(1,"app-emergency-geolocations",1),e.k0s()),2&i&&(e.Y8G("buttons",o.buttons)("scrollable",!0)("waitRecalculationsBeforeSave",!0)("validateBeforeSubmit",o.validateBeforeSubmit)("submit$",o.submit$),e.R7$(),e.Y8G("formControl",o.formControl))},dependencies:[ie.p,_o,a.X1,a.BC,a.l_],encapsulation:2,changeDetection:0})}return n})();var Ct=l(4115);function vo(n,s){if(1&n){const t=e.RV6();e.j41(0,"tr")(1,"td",8),e.EFF(2),e.k0s(),e.j41(3,"td")(4,"span",9),e.EFF(5),e.k0s()(),e.j41(6,"td",10)(7,"row-action-button")(8,"li",11)(9,"button",12),e.bIt("click",function(){const o=r.eBV(t).$implicit,d=e.XpG();
1return r.Njj(d.edit(o))}),e.EFF(10),e.nI1(11,"translate"),e.k0s()(),e.j41(12,"li",11)(13,"button",13),e.bIt("click",function(){const o=r.eBV(t).$implicit,d=e.XpG();return r.Njj(d.remove(o))}),e.EFF(14),e.nI1(15,"translate"),e.k0s()()()()()}if(2&n){const t=s.$implicit;e.R7$(2),e.JRh(null==t.Location?null:t.Location.FriendlyName),e.R7$(3),e.JRh(t.ProviderUri),e.R7$(5),e.SpI(" ",e.bMT(11,4,"_i18n.Edit")," "),e.R7$(4),e.SpI(" ",e.bMT(15,6,"_i18n.Delete")," ")}}let To=(()=>{class n extends Ye.z{modalService=(0,r.WQX)(j.B);emergencyLocationsApi=(0,r.WQX)(ft.w);destroy$=(0,r.WQX)(r.abz);add(){this.edit()}edit(t){this.getLocations$().pipe((0,R.n)(i=>this.modalService.showDialog(bo,{locations:i,trunkLocation:t??{ProviderUri:"",Location:i[0]},trunkLocations:this.value})),(0,D.Sf)(),(0,D.Tg)(this.modalService),(0,O.pQ)(this.destroy$)).subscribe(i=>{const o=t?this.value.indexOf(t):-1;o>=0?this.value[o]=i:this.value.push(i),this.valueChanged(this.value.slice())})}remove(t){this.valueChanged(this.value.filter(i=>i!==t))}editFriendlyNames(){this.getLocations$().pipe((0,R.n)(t=>this.modalService.showDialog(Co,{locations:t})),D.nx,(0,R.n)(()=>this.getLocations$()),(0,D.Tg)(this.modalService),(0,O.pQ)(this.destroy$)).subscribe(t=>{const i=t.reduce((c,v)=>Object.assign(c,{[v.Id]:v}),{}),o=[];let d=!1;this.value.forEach(c=>{const v=c.Location?i[c.Location.Id]:null;v?v.FriendlyName!==c.Location.FriendlyName?(d=!0,o.push({...c,Location:v})):o.push(c):d=!0}),d&&this.valueChanged(o)})}getLocations$(){return this.emergencyLocationsApi.listEmergencyGeoLocation({}).pipe(D.yh,(0,D.Tg)(this.modalService))}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-trunks-emergency-geo"]],features:[e.Jv_([{provide:a.kq,multi:!0,useExisting:n}]),e.Vt3],decls:28,vars:21,consts:[[3,"href"],["theme","border","data-qa","btn-add",1,"mb-3",3,"click"],[1,"scrollable-table","mb-3"],[1,"table-header"],[1,"ps-0","col-size-200"],[1,"col-size-300"],[1,"actions"],["type","button",1,"dashed","link",3,"click"],[1,"ps-0"],[1,"line-clamp-1"],[1,"p-0"],["role","menuitem"],["type","button","data-qa","edit",1,"dropdown-item",3,"click"],["type","button","data-qa","delete",1,"dropdown-item",3,"click"]],template:function(i,o){1&i&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"app-external-link",0),e.nI1(4,"translate"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.EFF(7,".\n"),e.k0s(),e.j41(8,"app-button-add",1),e.bIt("click",function(){return o.add()}),e.k0s(),e.j41(9,"table",2)(10,"thead")(11,"tr",3)(12,"th",4),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"th",5),e.EFF(16),e.nI1(17,"translate"),e.k0s(),e.nrm(18,"th",6),e.k0s()(),e.j41(19,"tbody"),e.Z7z(20,vo,16,8,"tr",null,e.fX1),e.k0s()(),e.j41(22,"p"),e.EFF(23),e.nI1(24,"translate"),e.j41(25,"a",7),e.bIt("click",function(c){return o.editFriendlyNames(),c.stopPropagation()}),e.EFF(26),e.nI1(27,"translate"),e.k0s()()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,7,"_i18n.E911GeolocationSetupGuide")," "),e.R7$(2),e.Y8G("href",e.bMT(4,9,"_i18n.E911GeolocationGuideLink")),e.R7$(2),e.JRh(e.bMT(6,11,"_i18n.Here")),e.R7$(8),e.JRh(e.bMT(14,13,"_i18n.LocationFriendlyName")),e.R7$(3),e.JRh(e.bMT(17,15,"_i18n.LocationProviderURI")),e.R7$(4),e.Dyx(o.value),e.R7$(3),e.SpI(" ",e.bMT(24,17,"_i18n.SeeAndManageYourAddresses")," "),e.R7$(3),e.JRh(e.bMT(27,19,"_i18n.Here")))},dependencies:[Qe.j,ce.I,Ct.P,P.D9],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}return n})();var en=l(91483),ko=l(57631),vt=l(62382),tn=l(64631),Ro=l(67374),Se=l.n(Ro),Io=l(8419);const yo=()=>["P-AssertedIdentityDisplayName","RemotePartyIDCallingPartyDisplayName","FromDisplayName"];function No(n,s){if(1&n&&(e.j41(0,"field-input-number",6),e.nrm(1,"val-errors",26),e.k0s()),2&n){const t=e.XpG();e.Y8G("formControl",t.f.simultaneousCalls)("integer",!0)("min",0)("max",1e9),e.R7$(),e.Y8G("control",t.f.simultaneousCalls)}}function So(n,s){if(1&n&&(e.j41(0,"show-note",36),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"amLocal"),e.nI1(4,"amDateFormat"),e.k0s()),2&n){const t=s;e.Y8G("theme",t.passed?"error":t.soon?"warning":"info"),e.R7$(),e.Lme(" ",e.bMT(2,3,t.passed?"_i18n.ExpiredOn":"_i18n.ValidUntil")," ",e.i5U(4,7,e.bMT(3,5,t.date),"L LTS")," ")}}function Mo(n,s){if(1&n&&(e.j41(0,"field-input-file",33),e.nVh(1,So,5,10,"show-note",36),e.nrm(2,"val-errors",37),e.k0s()),2&n){let t;const i=e.XpG(3);e.Y8G("incorrectExtensionText","_i18n.InvalidCertificateFileFormat")("readContent",!0),e.R7$(),e.vxM((t=i.certificateExpiration)?1:-1,t)}}function Eo(n,s){if(1&n&&(e.j41(0,"div",7)(1,"field-select",31),e.nrm(2,"val-errors",32),e.k0s(),e.nVh(3,Mo,3,3,"field-input-file",33),e.k0s(),e.j41(4,"field-select",34),e.nrm(5,"val-errors",35),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("options",t.transportRestrictionOptions)("clearable",!1)("searchable",!1),e.R7$(2),e.vxM(t.f.certificate.enabled?3:-1),e.R7$(),e.Y8G("options",t.typeOfIPRestrictionOptions)("clearable",!1)("searchable",!1)}}function Po(n,s){1&n&&(e.j41(0,"field-input-number",30),e.nrm(1,"val-errors",38),e.k0s()),2&n&&e.Y8G("min",0)("max",7200)}function xo(n,s){if(1&n&&(e.j41(0,"div",7),e.nrm(1,"field-checkbox",39)(2,"field-checkbox",39),e.k0s(),e.j41(3,"div",7),e.nrm(4,"field-checkbox",39)(5,"field-checkbox",39),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("label","_i18n.DeliverAudio")("formControl",t.f.gateway.controls.deliverAudio),e.R7$(),e.Y8G("label","_i18n.DisableVideo")("formControl",t.f.disableVideo),e.R7$(2),e.Y8G("label","_i18n.SupportReinvite")("formControl",t.f.gateway.controls.supportReinvite),e.R7$(),e.Y8G("label","_i18n.SupportReplaces")("formControl",t.f.gateway.controls.supportReplaces)}}function wo(n,s){if(1&n&&(e.nVh(0,Eo,6,7),e.qex(1,10),e.j41(2,"field-select",28),e.nrm(3,"val-errors",29),e.k0s(),e.nVh(4,Po,2,2,"field-input-number",30),e.bVm(),e.nVh(5,xo,6,8)),2&n){const t=e.XpG();e.vxM(t.isPSTNGateway?-1:0),e.R7$(2),e.Y8G("options",t.srtpOptions)("clearable",!1)("searchable",!1),e.R7$(2),e.vxM(t.isPSTNGateway?-1:4),e.R7$(),e.vxM(t.isPSTNGateway?-1:5)}}function Fo(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.IsNotValidIpWithPort"))}function Go(n,s){if(1&n&&(e.qex(0,10),e.j41(1,"field-select",40),e.nrm(2,"val-errors",41),e.k0s(),e.j41(3,"field-input",42)(4,"val-errors",43),e.DNE(
15,Fo,2,3,"ng-template",44),e.k0s()(),e.bVm()),2&n){const t=e.XpG();e.R7$(),e.Y8G("options",t.iPInRegistrationContactOptions)("clearable",!1)("searchable",!1)}}function Ao(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.IsNotValidDomainOrIpWithPort"))}function Do(n,s){1&n&&(e.j41(0,"field-input",11)(1,"val-errors",45),e.DNE(2,Ao,2,3,"ng-template",46),e.k0s()()),2&n&&e.Y8G("maxlength",255)}function $o(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.IsNotValidIpV4WithPort"))}function Oo(n,s){1&n&&(e.j41(0,"field-input",12)(1,"val-errors",47),e.DNE(2,$o,2,3,"ng-template",48),e.k0s()())}function Vo(n,s){if(1&n&&(e.j41(0,"div",7),e.nrm(1,"field-checkbox",49),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("formControl",t.f.diversionHeader)}}function Bo(n,s){if(1&n&&(e.j41(0,"div",7),e.nrm(1,"field-checkbox",50),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("formControl",t.f.allowSipRefer)}}function jo(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.OutboundCallerIdInvalid"))}function Wo(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.NumberContainsStarCode"))}function Xo(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.SpecifyCodec"))}function Lo(n,s){if(1&n&&(e.j41(0,"accordion-group")(1,"accordion-toggle",51),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"app-trunks-emergency-geo",17),e.k0s()),2&n){const t=e.XpG();e.R7$(2),e.SpI(" ",e.bMT(3,2,"_i18n.E911GeoLocation")," "),e.R7$(2),e.Y8G("formControl",t.f.emergencyGeoLocations)}}let nn=(()=>{class n{countries=(0,r.WQX)(io.C);destroy$=(0,r.WQX)(r.abz);modalService=(0,r.WQX)(j.B);form;trunkTemplate;isNew=!1;gatewayParams;isHosted3CX;isMcm;showValidation;ngOnInit(){this.f.allowSipRefer.valueChanges.pipe((0,gt.F)(),(0,O.pQ)(this.destroy$)).subscribe(t=>{t&&this.modalService.messageBox("_i18n.AllowSipReferWarning","_i18n.WarningHeaderOfDialog",void 0,B.P.Ok,"_i18n.OK","btn-danger")})}countryCodeOptions$=this.countries.countries$.pipe((0,G.T)(t=>t.filter(i=>i.ErpCode).map(i=>({value:i.ErpCode,label:i.Name}))));iPInRegistrationContactOptions=[{value:T.e.External,label:"_i18n.UseDefaultSettings"},{value:T.e.Internal,label:"_i18n.LocalIpAddressOsDefaultRoute"},{value:T.e.Specified,label:"_i18n.UseThisIpAddress"}];srtpOptions=en.b;transportRestrictionOptions=[{value:We.j.Tcp,label:"_i18n.Tcp"},{value:We.j.Tls,label:"_i18n.Tls"},{value:We.j.Udp,label:"_i18n.Udp"},{value:We.j.Any,label:"_i18n.Any"}];typeOfIPRestrictionOptions=[{value:bt.$.Any,label:"_i18n.Any"},{value:bt.$.Ipv6,label:"_i18n.Ipv6"},{value:bt.$.Ipv4,label:"_i18n.Ipv4"}];get f(){return this.form.controls}get gatewayControls(){return this.f.gateway.controls}get configurationInvalid$(){return(0,$.S)([this.f.enableInboundRules,this.f.enableInboundRules,this.f.transportRestriction,this.f.ipRestriction,this.gatewayControls.srtpMode,this.gatewayControls.timeBetweenReg,this.gatewayControls.iPInRegistrationContact,this.gatewayControls.specifiedIPForRegistrationContact,this.f.secondaryRegistrar,this.f.publicIPinSIP])}get e164ProcessingInvalid$(){return(0,$.S)([this.f.e164ProcessIncomingNumber,this.f.e164CountryCode])}get cidFormattingInvalid$(){return(0,$.S)([this.f.inCIDFormatting,this.f.outCIDFormatting])}get changeDepartmentWarning(){return this.isDIDProvider?"_i18n.ChangeDepartmentWarningTrunks":"_i18n.ChangeDepartmentWarning"}get isDIDProvider(){return(0,g.vc)(this.trunkTemplate)}get callerIdControlInvalid$(){return(0,$.S)([this.f.outboundCallerId,this.gatewayControls.outboundParams])}get codecsInvalid$(){return(0,$.S)([this.gatewayControls.codecs])}get isGeo911Enabled(){return(0,g.YP)(this.trunkTemplate)&&(!this.isHosted3CX||!this.isMcm)}get hasVoipEditor(){return(0,g.e8)(this.trunkTemplate)}get isPSTNGateway(){return(0,g.WA)(this.trunkTemplate)}get isSecondaryRegistrarEnabled(){return(0,g.H3)(this.trunkTemplate)}get isPublicIPViaEnabled(){return(0,g.YV)(this.trunkTemplate)}get isIpInContactRegEnabled(){return(0,g.qN)(this.trunkTemplate)}get isAdvancedEnabled(){return(0,g.yS)(this.trunkTemplate)}get certificateExpiration(){const t=this.f.certificateExpirationDate.value;if(!t)return null;const i=Se()(t);if(!i.isValid())return null;const o=Se()(),d=o.isAfter(i),c=!d&&o.isAfter(i.subtract(1,"month"));return{date:i,passed:d,soon:c}}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-additional-option"]],inputs:{form:"form",trunkTemplate:"trunkTemplate",isNew:"isNew",gatewayParams:"gatewayParams",isH
1osted3CX:"isHosted3CX",isMcm:"isMcm",showValidation:"showValidation"},decls:60,vars:63,consts:[[3,"formGroup"],[1,"accordion-options",3,"isAnimated"],[3,"isOpen"],["accordion-heading","",3,"redMark"],[1,"row"],["data-qa","trunk-group","label","_i18n.LimitTo","description","true",1,"col-lg-6",3,"formControl","showChangeWarning","changeWarningLabel"],["label","_i18n.NumberOfSimCallsPerTrunk","data-qa","number-of-sim-calls-per-trunk",1,"col-lg-6",3,"formControl","integer","min","max"],[1,"col-lg-6"],["label","_i18n.AllowInboundRules","data-qa","allow-inbound-rules",3,"formControl"],["label","_i18n.AllowOutboundRules","data-qa","allow-outbound-rules",1,"col-lg-6",3,"formControl"],["formGroupName","gateway"],["data-qa","secondary-registrar","formControlName","secondaryRegistrar","label","_i18n.AlternativeProxy",1,"col-lg-6",3,"maxlength"],["data-qa","public-ip-in-sip","formControlName","publicIPinSIP","label","_i18n.PublicIpInSipViaHeader",1,"col-lg-6"],["data-qa","e164-process-incoming-number","label","_i18n.SwitchOnCallerIdToE164Conversion",3,"formControl"],["label","_i18n.CountryCode","data-qa","e154-country-code",1,"col-lg-6",3,"formControl","options","searchable"],["controlName","e164CountryCode"],["label","_i18n.Inbound","data-qa","in-cid-formatting"],[3,"formControl"],["label","_i18n.Outbound","data-qa","out-cid-formatting"],["label","_i18n.DefaultOutboundCallerID","data-qa","outbound-caller-id",3,"formControl","maxlength"],["controlName","outboundCallerID"],["valError","didIsInvalid"],["valError","starCodeError"],["possibleValuesProperty","outboundParamPossibleValues",3,"formControl","gatewayParams","showOnlyWithNames","showCustomFieldColumn"],["data-qa","trunk-codecs"],[3,"codecs"],[3,"control"],["valError","required"],["formControlName","srtpMode","label","_i18n.SrtpMode","data-qa","srtp-mode",1,"col-lg-6",3,"options","clearable","searchable"],["controlName","srtpMode"],["data-qa","time-between-reg","formControlName","timeBetweenReg","label","_i18n.TimeBetweenReg",1,"col-lg-6",3,"min","max"],["formControlName","transportRestriction","label","_i18n.TransportRestriction","data-qa","transport-restriction",3,"options","clearable","searchable"],["controlName","transportRestriction"],["accept",".pem","formControlName","certificate","label","_i18n.Certificate","description","true",3,"incorrectExtensionText","readContent"],["formControlName","ipRestriction","label","_i18n.IpRestriction","data-qa","ip-restriction",1,"col-lg-6",3,"options","clearable","searchable"],["controlName","ipRestriction"],["description","",3,"theme"],["controlName","certificate"],["controlName","timeBetweenReg"],[3,"label","formControl"],["formControlName","iPInRegistrationContact","label","_i18n.SelectIpToUseInContactAndConnectionFields","data-qa","ip-in-registration-contact",1,"col-lg-6",3,"options","clearable","searchable"],["controlName","iPInRegistrationContact"],["data-qa","specified-ip-for-reg-contact","formControlName","specifiedIPForRegistrationContact","label","_i18n.IpAddress","placeholder","_i18n.IpAddress",1,"col-lg-6"],["controlName","specifiedIPForRegistrationContact"],["valError","ipWithPort"],["controlName","secondaryRegistrar"],["valError","invalid"],["controlName","publicIPinSIP"],["valError","ipV4WithPort"],["data-qa","include-diversion-header","label","_i18n.IncludeDiversionHeaderSupport",3,"formControl"],["data-qa","allow-sip-refer","hint","_i18n.AllowSipReferHint","label","_i18n.AllowSipRefer",3,"formControl"],["accordion-heading",""]],template:function(i,o){1&i&&(e.qex(0,0),e.j41(1,"accordion",1)(2,"accordion-group",2)(3,"accordion-toggle",3),e.nI1(4,"async"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"div",4),e.nrm(8,"app-group-select",5),e.nVh(9,No,2,5,"field-input-number",6),e.k0s(),e.j41(10,"div",4)(11,"div",7),e.nrm(12,"field-checkbox",8),e.k0s(),e.j41(13,"div",7),e.nrm(14,"field-checkbox",9),e.k0s(),e.nVh(15,wo,6,6),e.nVh(16,Go,6,3,"ng-container",10),e.nVh(17,Do,3,1,"field-input",11),e.nVh(18,Oo,3,0,"field-input",12),e.nVh(19,Vo,2,1,"div",7),e.nVh(20,Bo,2,1,"div",7),e.k0s()(),e.j41(21,"accordion-group")(22,"accordion-toggle",3),e.nI1(23,"async"),e.EFF(24),e.nI1(25,"translate"),e.k0s(),e.nrm(26,"field-checkbox",13),e.j41(27,"div",4)(28,"field-select",14),e.nI1(29,"async"),e.nrm(30,"val-errors",15),e.k0s()()(),e.j41(31,"accordion-group")(32,"accordion-toggle",3),e.nI1(33,"async"),e.EFF(34),e.nI1(35,"translate"),e.k0s(),e.j41(36,"field-wrapper",16),e.nrm(37,"app-trunk-cid-formatting",17),e.k0s(),e.j41(38,"field-wrapper",18),e.nrm(39,"app-trunk-cid-formatting",17),e.k0s()(),e.j41(40,"accordion-group")(41,"accordion-toggle",3),e.nI1(42,"async"),e.EFF(43),e.nI1(44,"translate"),e.k0s(),e.j41(45,"field-input",19)(46,"val-errors",20),e.DNE(47,jo,2,3,"ng-template",21)(48,Wo,2,3,"ng-template",22),e.k0s()(),e.nrm(49,"app-gateway-parameters",23),e.k0s(),e.j41(50,"accordion-group")(51,"accordion-toggle",3),e.nI1(52,"async"),e.EFF(53),e.nI1(54,"translate"),e.k0s(),e.j41(55,"field-wrapper",24),e.nrm(56,"app-codecs",25),e.j41(57,"val-errors",26),e.DNE(58,Xo,2,3,"ng-template",27),e.k0s()()(),e.nVh(59,Lo,5,4,"accordion-group"),e.k0s(),e.bVm()),2&i&&(e.Y8G("formGroup",o.form),e.R7$(),e.Y8G("isAnimated",!0),e.R7$(),e.Y8G("isOpen",!0),e.R7$(),e.Y8G("redMark",e.bMT(4,40,o.configurationInvalid$)),e.R7$(2),e.SpI(" ",e.bMT(6,42,"_i18n.Configuration")," "),e.R7$(3),e.Y8G("formControl",o.f.group)("showChangeWarning",!o.isNew)("changeWarningLabel",o.changeDepartmentWarning),e.R7$(),e.vxM(o.hasVoipEditor||o.isPSTNGateway?9:-1),e.R7$(3),e.Y8G("formControl",o.form.controls.enableInboundRules),e.R7$(2),e.Y8G("formControl",o.form.controls.enableOutboundRules),e.R7$(),e.vxM(o.isAdvancedEnabled?15:-1),e.R7$(),e.vxM(o.isIpInContactRegEnabled?16:-1),e.R7$(),e.vxM(o.isSecondaryRegistrarEnabled?17:-1),e.R7$(),e.vxM(o.isPublicIPViaEnabled?18:-1),e.R7$(),e.vxM(o.hasVoipEditor?19:-1),e.R7$(),e.vxM(o.hasVoipEditor&&!o.isPSTNGateway?20:-1),e.R7$(2),e.Y8G("redMark",e.bMT(23,44,o.e164ProcessingInvalid$)),e.R7$(2),e.SpI(" ",e.bMT(25,46,"_i18n.e164ProcessIncomingNumber")," "),e.R7$(2),e.Y8G("formControl",o.form.controls.e164ProcessIncomingNumber),e.R7$(2),e.Y8G("formControl",o.f.e164CountryCode)("options",e.bMT(29,48,o.countryCodeOptions$))("searchable",!0),e.R7$(4),e.Y8G("redMark",e.bMT(33,50,o.cidFormattingInvalid$)),e.R7$(2),e.SpI(" ",e.bMT(35,52,"_i18n.ReformatInOutCaller")," "),e.R7$(3),e.Y8G("formControl",o.form.controls.inCIDFormatting),e.R7$(2),e.Y8G("formControl",o.form.controls.outCIDFormatting),e.R7$(2),e.Y8G("redMark",e.bMT(42,54,o.callerIdControlInvalid$)),e.R7$(2),e.SpI(" ",e.bMT(44,56,"_i18n.CallerIdControl")," "),e.R7$(2),e.Y8G("formControl",o.form.controls.outboundCallerId)("maxlength",50),e.R7$(4),e.Y8G("formControl",o.form.controls.gateway.controls.outboundParams)("gatewayParams",o.gatewayParams)("showOnlyWithNames",e.lJ4(62,yo))("showCustomFieldColumn",!0),e.R7$(2),e.Y8G("redMark",e.bMT(52,58,o.codecsInvalid$)),e.R7$(2),e.SpI(" ",e.bMT(54,60,"_i18n.CodecsPriority")," "),e.R7$(3),e.Y8G("codecs",o.gatewayControls.codecs),e.R7$(),e.Y8G("control",o.gatewayControls.codecs),e.R7$(2),e.vxM(o.isGeo911Enabled?59:-1))},dependencies:[a.X1,a.BC,a.cb,a.tU,a.l_,a.j4,a.JD,a.$R,Xe.Mj,Xe.kt,Oe.x,he.B,A.IH,Re.t,fe.q,oo.y,Q.m,A.VI,me.z,uo,Kt,Zt.V,To,ko.K,Io.d,P.D9,V.Jj,vt.a,tn.h],encapsulation:2,changeDetection:0})}return n})();const Yo=["tabset"];function Uo(n,s){if(1&n&&e.nrm(0,"app-trunk-main-fields-edit",4),2&n){const t=e.XpG(2);e.Y8G("form",t.form)("showValidation",t.showValidation)("trunk",t.trunk)("trunkTemplate",t.trunkTemplate)("systemIp",t.systemIp())("isHosted3CX",t.isHosted3CX())("isMcmMode",t.isMcmMode())}}function Jo(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",13),e.nI1(1,"async")),2&n){const t=e.XpG(3);e.Y8G("invalid",e.bMT(1,1,t.tabGeneral))}}function Ho(n,s){1&n&&e.eu8(0)}function Qo(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",14),e.nI1(1,"async")),2&n){const t=e.XpG(3);e.Y8G("invalid",e.bMT(1,1,t.tabDidNumbers))}}function qo(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",16),e.nI1(1,"async")),2&n){const t=e.XpG(4);e.Y8G("invalid",e.bMT(1,1,t.tabMessaging))}}function zo(n,s){if(1&n&&(e.j41(0,"tab",10),e.DNE(1,qo,2,3,"ng-template",6),e.nrm(2,"app-trunk-messaging-edit",15),e.k0s()),2&n){const t=e.XpG(3);e.Y8G("tabOrder",3),e.R7$(2),e.Y8G("form",t.form.controls.messaging)("trunkTemplate",t.trunkTemplate)("showValidation",t.showValidation)}}function Ko(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",17),e.nI1(1,"async")),2&n){const t=e.XpG(3);e.Y8G("invalid",e.bMT(1,1,t.tabOptions))}}function Zo(n,s){if(1&n&&(e.j41(0,"tabset",null,1)(2,"tab",5),e.DNE(3,Jo,2,3,"ng-template",6)(4,Ho,1,0,"ng-container",7),e.k0s(),e.j41(5,"tab",8),e.DNE(6,Qo,2,3,"ng-template",6),e.nrm(7,"app-trunk-did-edit",9),e.k0s(),e.nVh(8,zo,3,4,"tab",10),e.j41(9,"tab",11),e.DNE(10,Ko,2,3,"ng-template",6),e.nrm(11,"app-trunk-additional-option",12),e.k0s()()),2&n){e.XpG();const t=e.sdS(4),i=e.XpG();e.R7$(2),e.Y8G("tabOrder",1),e.R7$(2),e.Y8G("ngTemplateOutlet",t),e.R7$(),e.Y8G("tabOrder",2),e.R7$(2),e.Y8G("maxDidPerTrunk",i.maxDidPerTrunk())("isE164Capable",i.isE164Capable)("mainTrunkNumber",i.f.externalNumber.value)("isMcmMode",i.isMcmMode()),e.R7$(),e.vxM(i.hasMessagingEditor?8:-1),e.R7$(),e.Y8G("tabOrder",4),e.R7$(2),e.Y8G("gatewayParams",i.gatewayParams())("form",i.form)("showValidation",i.showValidation)("trunkTemplate",i.trunkTemplate)("isNew",!0)("isHosted3CX",i.isHosted3CX())("isMcm",i.isMcmMode())}}function ea(n,s){1&n&&e.eu8(0)}function ta(n,s){if(1&n&&(e.DNE(0,ea,1,0,"ng-container",7),e.nrm(1,"app-trunk-messaging-edit",15)),2&n){e.XpG();const t=e.sdS(4),i=e.XpG();e.Y8G("ngTemplateOutlet",t),e.R7$(),e.Y8G("form",i.form.controls.messaging)("trunkTemplate",i.trunkTemplate)("showValidation",i.showValidation)}}function na(n,s){if(1&n){const t=e.RV6();e.j41(0,"edit-panel",3),e.nI1(1,"trunkGuideLink"),e.nI1(2,"async"),e.bIt("back",function(){r.eBV(t);const o=e.XpG();
1return r.Njj(o.navigateBack())})("showValidation",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.onValidation())}),e.DNE(3,Uo,1,7,"ng-template",null,0,e.C5r),e.nVh(5,Zo,12,16,"tabset")(6,ta,2,4),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("helpUrl",e.bMT(2,9,e.bMT(1,7,t.getTrunkTemplateFilename)))("isNewEntity",!0)("formGroup",t.form)("save$",t.save$)("saveDisabledByReasonView","header")("saveDisabledByReason",t.saveDisabledByReason()),e.R7$(5),e.vxM(t.isDIDProvider?5:6)}}let ia=(()=>{class n{trunksApiService=(0,r.WQX)(p.T);router=(0,r.WQX)(m.Ix);cd=(0,r.WQX)(f.gRc);route=(0,r.WQX)(m.nX);tabset;form;formExtrasSub=new w.yU;trunk;trunkTemplate;get f(){return this.form.controls}get selectableDidsArray(){return this.f.didNumbers}get tabGeneral(){return(0,$.S)([this.f.externalNumber,this.f.authId,this.f.authPassword,this.f.gateway.controls.name,this.f.separateAuthId,this.f.gateway.controls.host,this.f.gateway.controls.proxyHost,this.f.gateway.controls.proxyHost])}get tabDidNumbers(){return(0,$.S)([this.selectableDidsArray])}get tabMessaging(){return(0,$.S)([this.f.messaging])}get tabOptions(){return(0,$.S)([this.f.simultaneousCalls,this.f.certificate,this.f.secondaryRegistrar,this.f.publicIPinSIP,this.f.gateway.controls.specifiedIPForRegistrationContact,this.f.e164CountryCode,this.f.gateway.controls.timeBetweenReg,this.f.gateway.controls.codecs])}get hasMessagingEditor(){return(0,g.a4)(this.trunkTemplate)}get isE164Capable(){return this.trunkTemplate&&(0,g.xp)(this.trunkTemplate)}get isDIDProvider(){return(0,g.vc)(this.trunkTemplate)}get getTrunkTemplateFilename(){return this.trunkTemplate?.Name||"default"}onValidation(){this.tabset&&this.isDIDProvider&&(0,$.q)(this.tabset,[this.tabGeneral,this.tabDidNumbers,...this.hasMessagingEditor?[this.tabMessaging]:[],this.tabOptions]),this.showValidation=!0}showValidation;groupAccess=(0,f.hFB)();trunksGroups=(0,f.hFB)();params=(0,f.hFB)();restrictions=(0,f.hFB)();provider=(0,f.hFB)();systemInfo=(0,f.hFB)();gatewayParams=(0,f.hFB)();currentUser=(0,f.hFB)();maxDidPerTrunk=(0,N.EW)(()=>this.systemInfo()?.MaxDIDPerTrunk);systemIp=(0,N.EW)(()=>{const t=this.systemInfo();return(t?.IsStaticIp?t?.StaticIp:t?.StunIp)??""});isHosted3CX=(0,N.EW)(()=>!!this.systemInfo()?.IsHosted3CX);isMcmMode=(0,N.EW)(()=>!!this.systemInfo()?.IsMulticompanyMode);trunkCreator=(0,N.EW)(()=>{const t=this.params();return!t||t.isMcm&&t.isAdmin?null:this.currentUser()});saveDisabledByReason=(0,N.EW)(()=>{if(!(0,Te.AS)(this.restrictions()?.Trunks))return"_i18n.MaxAmountOfTrunksReached";const t=this.provider(),i=this.params();return t&&i&&!i.isPaid&&[h.AC.providerId,h.G6.providerId].includes(t.trunkTemplate.Id)?"_i18n.AvailableProEnt":""});constructor(){const t=this.router.currentNavigation()?.extras.state?.importProviderTemplate;(0,r.QZP)(()=>{const i=this.provider();i&&i&&(t&&(0,zn.Hj)(i.trunk,t),this.initializeTrunkForm(i.trunk,i.trunkTemplate))})}ngOnDestroy(){this.formExtrasSub.unsubscribe()}initializeTrunkForm(t,i){this.trunk=t,this.trunkTemplate=i,this.formExtrasSub.unsubscribe(),this.formExtrasSub=new w.yU,t.Gateway&&(t.Gateway.Name=""),this.form=Dt(t,i,this.formExtrasSub,(0,ke.Qz)(this.route),this.isMcmMode(),this.trunkCreator()),this.form.controls.createOutboundRule.patchValue(!t.Id&&(0,g.vc)(i)),this.cd.markForCheck()}navigateToNewOutboundRule(t,i){return this.router.navigate(["office","outbound-rules","new"],{state:{rule:{Name:"Outbound rule for "+t.Gateway.Name,...i?{GroupIds:[i]}:{},Routes:[{Trunk:t,TrunkId:t.Id,TrunkName:t.Gateway.Name}]}}})}save$=()=>{const t=this.form.value,i={...(0,g.NK)(this.form,!0,this.trunkTemplate),DidNumbers:(0,g.mC)(t.externalNumber,(t.didNumbers??[]).map(o=>o.didNumber)),RoutingRules:[...(t.didNumbers??[]).map(o=>o.inboundRule).filter(S.z2),(0,$e.Vt)(t.defaultRoute)]};return this.trunksApiService.createTrunk({pbxTrunk:i}).pipe((0,R.n)(o=>t.createOutboundRule?this.navigateToNewOutboundRule(o,t.group?.Id):this.navigateBack()))};navigateBack(){return this.router.navigate(["office","voice-and-ch
1at"])}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-add-trunk"]],viewQuery:function(i,o){if(1&i&&e.GBs(Yo,5),2&i){let d;e.mGM(d=e.lsd())&&(o.tabset=d.first)}},inputs:{groupAccess:[1,"groupAccess"],trunksGroups:[1,"trunksGroups"],params:[1,"params"],restrictions:[1,"restrictions"],provider:[1,"provider"],systemInfo:[1,"systemInfo"],gatewayParams:[1,"gatewayParams"],currentUser:[1,"currentUser"]},decls:1,vars:1,consts:[["generalFields",""],["tabset",""],["header","_i18n.AddTrunk",3,"helpUrl","isNewEntity","formGroup","save$","saveDisabledByReasonView","saveDisabledByReason"],["header","_i18n.AddTrunk",3,"back","showValidation","helpUrl","isNewEntity","formGroup","save$","saveDisabledByReasonView","saveDisabledByReason"],[3,"form","showValidation","trunk","trunkTemplate","systemIp","isHosted3CX","isMcmMode"],["id","general",3,"tabOrder"],["tabHeading",""],[4,"ngTemplateOutlet"],["id","didnumbers",3,"tabOrder"],["data-qa","did-numbers","formControlName","didNumbers",3,"maxDidPerTrunk","isE164Capable","mainTrunkNumber","isMcmMode"],["id","messaging",3,"tabOrder"],["id","options",3,"tabOrder"],[3,"gatewayParams","form","showValidation","trunkTemplate","isNew","isHosted3CX","isMcm"],["label","_i18n.General",3,"invalid"],["label","_i18n.DidNumbers",3,"invalid"],[3,"form","trunkTemplate","showValidation"],["label","_i18n.ComposeSmsHeader",3,"invalid"],["label","_i18n.Options",3,"invalid"]],template:function(i,o){1&i&&e.nVh(0,na,7,11,"edit-panel",2),2&i&&e.vxM(o.form?0:-1)},dependencies:[le.Q,a.X1,a.BC,a.cb,a.j4,a.JD,Vt,L.fw,L.V6,Bt.Z,L.Bh,ye.b,V.T3,Yt,Ht,nn,V.Jj,Ie],encapsulation:2,changeDetection:0})}return n})();var ue=l(61461),oa=l(90836);function on(n){const s=structuredClone(n);return s.Gateway?.InboundParams&&(s.Gateway.InboundParams="<From Template>"),s.Gateway?.OutboundParams&&(s.Gateway.OutboundParams="<From Template>"),s.Gateway?.SourceIdentification&&(s.Gateway.SourceIdentification="<From Template>"),s}let an=(()=>{class n extends ne.m{diff;header="_i18n.SyncTemplate";buttons=B.P.OkCancel;static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],features:[e.Vt3],decls:5,vars:8,consts:[[3,"submitted","header","buttons","scrollable"],["data-qa","modal-text"],[3,"json","expanded"]],template:function(i,o){1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("submitted",function(){return o.onSubmit()}),e.j41(1,"p",1),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"app-json-viewer",2),e.k0s()),2&i&&(e.Y8G("header",o.header)("buttons",o.buttons)("scrollable",!0),e.R7$(2),e.JRh(e.bMT(3,6,"_i18n.SyncTemplateConfirmation")),e.R7$(2),e.Y8G("json",o.diff)("expanded",!1))},dependencies:[ie.p,oa.g,P.D9],encapsulation:2})}return n})();function aa(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",9),e.bIt("click",function(){r.eBV(t);const o=e.XpG(4);return r.Njj(o.syncTemplate(o.templateDiff))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&n&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"_i18n.SyncTemplate")," "))}function ra(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",10),e.bIt("click",function(){r.eBV(t);const o=e.XpG(4);return r.Njj(o.routeToViewTemplate())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&n&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"_i18n.ViewTemplate")," "))}function sa(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",6),e.bIt("click",function(){r.eBV(t);const o=e.XpG(3);return r.Njj(o.routeToTest())}),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.nVh(3,aa,3,3,"button",7),e.nVh(4,ra,3,3,"button",8)}if(2&n){const t=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,3,"_i18n.TestTrunk")," "),e.R7$(2),e.vxM(t.templateDiff?3:-1),e.R7$(),e.vxM(t.isAdmin()?4:-1)}}function la(n,s){if(1&n&&e.nVh(0,sa,5,5),2&n){const t=e.XpG(2);e.vxM(t.isDIDProvider&&!t.isPSTNGateway?0:-1)}}function da(n,s){if(1&n&&(e.j41(0,"div",4),e.eu8(1,11),e.k0s()),2&n){e.XpG();const t=e.sdS(4);e.R7$(),e.Y8G("ngTemplateOutlet",t)}}function ca(n,s){if(1&n&&(e.j41(0,"div",5),e.eu8(1,11),e.k0s()),2&n){e.XpG();const t=e.sdS(4);e.R7$(),e.Y8G("ngTemplateOutlet",t)}}function ua(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",20),e.nI1(1,"async")),2&n){const t=e.XpG(3);e.Y8G("invalid",e.bMT(1,1,t.tabGeneral))}}function pa(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",21),e.nI1(1,"async")),2&n){const t=e.XpG(3);e.Y8G("invalid",e.bMT(1,1,t.tabDidNumbers))}}function ma(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",23),e.nI1(1,"async")),2&n){const t=e.XpG(4);e.Y8G("invalid",e.bMT(1,1,t.tabMessaging))}}function ha(n,s){if(1&n&&(e.j41(0,"tab",17),e.DNE(1,ma,2,3,"ng-template",13),e.nrm(2,"app-trunk-messaging-edit",22),e.k0s()),2&n){const t=e.XpG(3);e.R7$(2),e.Y8G("form",t.f.messaging)("trunkTemplate",t.trunkTemplate)("showValidation",t.showValidation)}}function ba(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",24),e.nI1(1,"async")),2&n){const t=e.XpG(4);e.Y8G("invalid",e.bMT(1,1,t.tabOptions))}}function fa(n,s){1&n&&e.DNE(0,ba,2,3,"ng-template",13)}function ga(n,s){if(1&n&&(e.j41(0,"tabset",null,1)(2,"tab",12),e.DNE(3,ua,2,3,"ng-template",13),e.nrm(4,"app-trunk-main-fields-edit",14),e.k0s(),e.j41(5,"tab",15),e.DNE(6,pa,2,3,"ng-template",13),e.nrm(7,"app-trunk-did-edit",16),e.k0s(),e.nVh(8,ha,3,3,"tab",17),e.j41(9,"tab",18),e.DNE(10,fa,1,0,"ng-template",13),e.nrm(11,"app-trunk-additional-option",19),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(4),e.Y8G("form",t.form)("showValidation",t.showValidation)("trunk",t.trunk)("trunkTemplate",t.trunkTemplate)("systemIp",t.systemIp)("isHosted3CX",t.isHosted3CX)("isMcmMode",t.isMcmMode),e.R7$(3),e.Y8G("formControl",t.f.didNumbers)("maxDidPerTrunk",t.maxDidPerTrunk)("inboundRules",t.inboundRules)("mainTrunkNumber",t.f.externalNumber.value)("groupsRouteData",t.trunksGroups())("isE164Capable",t.isE164Capable)("isMcmMode",t.isMcmMode),e.R7$(),e.vxM(t.hasMessagingEditor?8:-1),e.R7$(3),e.Y8G("gatewayParams",t.gatewayParams())("form",t.form)("showValidation",t.showValidation)("trunkTemplate",t.trunkTemplate)("isMcm",t.isMcmMode)("isHosted3CX",t.isHosted3CX)}}function _a(n,s){if(1&n&&e.nrm(0,"app-trunk-main-fields-edit",14)(1,"app-trunk-messaging-edit",22),2&n){const t=e.XpG(2);e.Y8G("form",t.form)("showValidation",t.showValidation)("trunk",t.trunk)("trunkTemplate",t.trunkTemplate)("systemIp",t.systemIp)("isHosted3CX",t.isHosted3CX)("isMcmMode",t.isMcmMode),e.R7$(),e.Y8G("form",t.f.messaging)("trunkTemplate",t.trunkTemplate)("showValidation",t.showValidation)}}function Ca(n,s){if(1&n){const t=e.RV6();e.j41(0,"edit-panel",3),e.nI1(1,"trunkGuideLink"),e.nI1(2,"async"),e.bIt("back",function(){r.eBV(t);const o=e.XpG();
1return r.Njj(o.navigateBack())})("showValidation",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.onValidation())}),e.DNE(3,la,1,1,"ng-template",null,0,e.C5r),e.nVh(5,da,2,1,"div",4)(6,ca,2,1,"div",5),e.nVh(7,ga,12,21,"tabset")(8,_a,2,10),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("header",t.header)("formGroup",t.form)("save$",t.save$)("isNewEntity",t.isNewTemplate)("helpUrl",e.bMT(2,9,e.bMT(1,7,t.getTrunkTemplateFilename)));const i=t.isDIDProvider&&!t.isPSTNGateway&&(t.templateDiff||t.isAdmin());e.R7$(5),e.vxM(i?5:6),e.R7$(2),e.vxM(t.isDIDProvider?7:8)}}let va=(()=>{class n{cd=(0,r.WQX)(f.gRc);route=(0,r.WQX)(m.nX);router=(0,r.WQX)(m.Ix);trunksApiService=(0,r.WQX)(p.T);modalService=(0,r.WQX)(j.B);editPanel=(0,f.ebz)(le.Q);tabset=(0,f.ebz)(L.fw);templateDiff;isAdmin=f.hFB.required();trunkData=f.hFB.required();systemInfo=f.hFB.required();trunksGroups=f.hFB.required();gatewayParams=f.hFB.required();formExtrasSub=new w.yU;maxDidPerTrunk;form;trunk;trunkTemplate;systemIp;inboundRules;isMcmMode;isHosted3CX;backToTest;get header(){return this.trunk.Gateway?.Name||""}get f(){return this.form.controls}get isE164Capable(){return(0,g.xp)(this.trunkTemplate)}get tabGeneral(){return(0,$.S)([this.f.externalNumber,this.f.authId,this.f.authPassword,this.f.gateway.controls.name,this.f.separateAuthId,this.f.gateway.controls.host,this.f.gateway.controls.proxyHost])}get tabDidNumbers(){return(0,$.S)([this.f.didNumbers])}get tabMessaging(){return(0,$.S)([this.f.messaging])}get tabOptions(){return(0,$.S)([this.f.simultaneousCalls,this.f.certificate,this.f.secondaryRegistrar,this.f.publicIPinSIP,this.f.gateway.controls.specifiedIPForRegistrationContact,this.f.e164CountryCode,this.f.gateway.controls.timeBetweenReg,this.f.gateway.controls.codecs])}get isNewTemplate(){return!!this.route.snapshot.queryParams.newTemplate}get isDIDProvider(){return(0,g.vc)(this.trunkTemplate)}get isPSTNGateway(){return(0,g.WA)(this.trunkTemplate)}get hasMessagingEditor(){return(0,g.a4)(this.trunkTemplate)}get getTrunkTemplateFilename(){return this.trunkTemplate?.Name||"default"}onValidation(){this.backToTest=!1;const t=this.tabset();t&&this.isDIDProvider&&(0,$.q)(t,[this.tabGeneral,this.tabDidNumbers,this.tabOptions,...this.hasMessagingEditor?[this.tabMessaging]:[]]),this.showValidation=!0}showValidation;constructor(){(0,r.QZP)(()=>{this.updateData(this.trunkData(),this.systemInfo(),this.trunksGroups())})}ngOnDestroy(){this.formExtrasSub.unsubscribe()}updateData(t,i,o){const{trunk:d,trunkTemplate:c,templateDiff:v}=t;this.templateDiff=v;const M=d.Groups?.[0]?.GroupId,E=o.find(X=>X.Id===M)||null;this.maxDidPerTrunk=i.MaxDIDPerTrunk,this.systemIp=(i.IsStaticIp?i.StaticIp:i.StunIp)??"",this.isMcmMode=!!i.IsMulticompanyMode,this.isHosted3CX=!!i.IsHosted3CX,this.trunkTemplate=c,this.trunk=d,this.inboundRules=new Map(d.RoutingRules.filter(X=>"BasedOnDID"===X.Condition).map(X=>[X.Data,X])),this.formExtrasSub.unsubscribe(),this.formExtrasSub=new w.yU,this.form=Dt(d,c,this.formExtrasSub,E,this.isMcmMode),this.form.markAllAsTouched(),this.cd.markForCheck()}routeToTest(){this.form.pristine?this.navigateTest():(this.backToTest=!0,this.editPanel()?.submitForm(void 0,!0))}routeToViewTemplate(){return this.router.navigate((0,ue.Vj)(this.trunk.Gateway.TemplateFilename))}save$=()=>{const t=this.trunk.Id,i=this.form.value,o=(0,g.mC)(i.externalNumber,(i.didNumbers??[]).map(c=>c.didNumber)),d={...(0,g.NK)(this.form,!1,this.trunkTemplate),DidNumbers:o,RoutingRules:(0,g.j1)(this.trunk.RoutingRules,i.externalNumber,i.defaultRoute,i.didNumbers??[])};return this.trunksApiService.updateTrunk({id:t,pbxTrunk:d}).pipe((0,D.Pr)("_i18n.VoiceAndChatNotFoundErrorMessage",this.trunk.Gateway?.Name),(0,R.n)(()=>this.navigateBack()),(0,Je.M)({error:()=>{this.backToTest=!1}}))};navigateBack(){return this.backToTest?(this.backToTest=!1,this.navigateTest()):this.router.navigate(["office","voice-and-ch
1at"])}navigateTest(){return this.router.navigate(["office","voice-and-chat","test",this.trunk.Id])}syncTemplate(t){this.modalService.showDialog(an,{diff:on(t)}).pipe(D.nx,(0,R.n)(()=>this.trunksApiService.updateTrunk({id:this.trunk.Id,pbxTrunk:t})),(0,R.n)(()=>this.navigateBack())).subscribe({error:i=>this.modalService.error(i)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-edit-trunk"]],viewQuery:function(i,o){1&i&&e.wEZ(o.editPanel,le.Q,5)(o.tabset,L.fw,5),2&i&&e.NyB(2)},inputs:{isAdmin:[1,"isAdmin"],trunkData:[1,"trunkData"],systemInfo:[1,"systemInfo"],trunksGroups:[1,"trunksGroups"],gatewayParams:[1,"gatewayParams"]},decls:1,vars:1,consts:[["buttonGroup",""],["tabset",""],[3,"header","formGroup","save$","isNewEntity","helpUrl"],[3,"back","showValidation","header","formGroup","save$","isNewEntity","helpUrl"],["top-bar","",1,"button-group"],["buttons",""],["type","button","data-qa","test",1,"btn","btn-primary",3,"click"],["type","button","data-qa","sync-template",1,"btn","btn-primary"],["type","button","data-qa","view-template",1,"btn","btn-primary"],["type","button","data-qa","sync-template",1,"btn","btn-primary",3,"click"],["type","button","data-qa","view-template",1,"btn","btn-primary",3,"click"],[3,"ngTemplateOutlet"],["id","general"],["tabHeading",""],[3,"form","showValidation","trunk","trunkTemplate","systemIp","isHosted3CX","isMcmMode"],["id","didnumbers"],[3,"formControl","maxDidPerTrunk","inboundRules","mainTrunkNumber","groupsRouteData","isE164Capable","isMcmMode"],["id","messaging"],["id","options"],[3,"gatewayParams","form","showValidation","trunkTemplate","isMcm","isHosted3CX"],["label","_i18n.General",3,"invalid"],["label","_i18n.DidNumbers",3,"invalid"],[3,"form","trunkTemplate","showValidation"],["label","_i18n.ComposeSmsHeader",3,"invalid"],["label","_i18n.Options",3,"invalid"]],template:function(i,o){1&i&&e.nVh(0,Ca,9,11,"edit-panel",2),2&i&&e.vxM(o.trunk?0:-1)},dependencies:[le.Q,a.X1,a.BC,a.cb,a.l_,a.j4,L.fw,L.V6,L.Bh,ye.b,Vt,Yt,Ht,nn,V.T3,V.Jj,Ie,P.D9],encapsulation:2,changeDetection:0})}return n})();var re=l(85343),ge=l(983),Ta=l(93049),W=function(n){return n[n.Trunk=1]="Trunk",n[n.Gateway=2]="Gateway",n[n.Messaging=3]="Messaging",n[n.SBC=4]="SBC",n[n.DectFxs=5]="DectFxs",n[n.Bridge=6]="Bridge",n}(W||{}),Tt=l(9867),oe=l(19037),rn=l(78662),kt=l(54381);let ka=(()=>{class n{router=(0,r.WQX)(m.Ix);route=(0,r.WQX)(m.nX);listControl=(0,r.WQX)(Z.b);links=(0,r.WQX)(rn.m);record=f.hFB.required();params=(0,f.hFB)();routeToForWeblinks(t,i){if("delete"===i)this.confirmDeleteLink();else if("edit"===i){const o=this.record().edit;o&&this.router.navigate(o,{relativeTo:this.route})}else"info"===i&&this.router.navigate(["messaging","info",this.record().id],{relativeTo:this.route})}confirmDeleteLink(){this.listControl.confirmAndDelete("_i18n.ConfirmDeleteForLiveChat",this.links.deleteWeblink({link:this.record().id}))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],inputs:{record:[1,"record"],params:[1,"params"]},decls:13,vars:12,consts:[["role","menuitem"],["type","button","data-qa","info",1,"dropdown-item",3,"click"],["type","button","data-qa","edit",1,"dropdown-item",3,"click"],["type","button","data-qa","delete",1,"dropdown-item",3,"click","disabled"]],template:function(i,o){1&i&&(e.j41(0,"row-action-button")(1,"li",0)(2,"button",1),e.bIt("click",function(c){return o.routeToForWeblinks(c,"info")}),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"li",0)(6,"button",2),e.bIt("click",function(c){return o.routeToForWeblinks(c,"edit")}),e.EFF(7),e.nI1(8,"translate"),e.k0s()(),e.j41(9,"li",0)(10,"button",3),e.bIt("click",function(c){return o.routeToForWeblinks(c,"delete")}),e.EFF(11),e.nI1(12,"translate"),e.k0s()()()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,6,"_i18n.InfoWeblink")," "),e.R7$(4),e.SpI(" ",e.bMT(8,8,"_i18n.EditWeblink")," "),e.R7$(2),e.AVh("disabled",!o.record().isDeletable),e.R7$(),e.Y8G("disabled",!o.record().isDeletable),e.R7$(),e.SpI(" ",e.bMT(12,10,"_i18n.DeleteWeblink")," "))},dependencies:[ce.I,P.D9],encapsulation:2,changeDetection:0})}return n})();const Ia=new r.nKC("resolveWebsiteLinks",{providedIn:"root",factory:()=>{const n=(0,r.WQX)(P.c$),s=(0,r.WQX)(rn.m),t=(0,r.WQX)(kt.G);return(i,o)=>(0,te.z)([n.get("_i18n.3CXLiveChat"),s.listWeblink({$select:["Website","Link","DN","DefaultRecord","Group"],$f
1ilter:"Hidden eq false",$expand:["DN"]}),t.getSystemParameters().pipe((0,G.T)(d=>d.PbxExternalHost))]).pipe((0,G.T)(([d,c,v])=>c.value?.map(M=>function Ra(n,s,t,i,o){return{edit:["messaging","edit",n.Link],component:ka,isOnline:!!(n.Website&&n.Website.length>0&&n.DN?.Number),id:n.Link??"",name:s,destination:(0,be.JG)(t,n.DN),groups:(0,be.$B)(t,n.Group)?.Name??"",link:new URL(`/${n.Link}`,`https://${i}`).toString(),type:"WebLinks",isDeletable:o||null==n.DefaultRecord||!n.DefaultRecord}}(M,d,i,v,o))??[]))}});var _e=l(15622);let ya=(()=>{class n{listControl=(0,r.WQX)(Z.b);router=(0,r.WQX)(m.Ix);sbcService=(0,r.WQX)(_e.N);route=(0,r.WQX)(m.nX);modalService=(0,r.WQX)(j.B);record=f.hFB.required();params=(0,f.hFB)();edit(){const t=this.record().edit;t&&this.router.navigate(t,{relativeTo:this.route})}deleteSbc(){this.listControl.confirmAndDelete("_i18n.ConfirmDeleteForSBC",this.sbcService.deleteSbc({name:this.record().id}))}get canPushConfig(){return this.record().isDeletable&&this.record().isOnline}pushConfig(){this.canPushConfig&&this.modalService.confirmation("_i18n.SbcPushConfigConfirmation").pipe((0,R.n)(()=>this.sbcService.pushConfig({name:this.record().id}).pipe((0,D.Pr)("_i18n.SBCNotFoundConfigErrorMessage",this.record().name))),(0,D.Tg)(this.modalService)).subscribe()}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],inputs:{record:[1,"record"],params:[1,"params"]},decls:13,vars:15,consts:[["role","menuitem"],["type","button","data-qa","edit",1,"dropdown-item",3,"click"],["type","button","data-qa","push-config",1,"dropdown-item",3,"click","disabled"],["type","button","data-qa","delete",1,"dropdown-item",3,"click","disabled"]],template:function(i,o){1&i&&(e.j41(0,"row-action-button")(1,"li",0)(2,"button",1),e.bIt("click",function(){return o.edit()}),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"li",0)(6,"button",2),e.bIt("click",function(){return o.pushConfig()}),e.EFF(7),e.nI1(8,"translate"),e.k0s()(),e.j41(9,"li",0)(10,"button",3),e.bIt("click",function(){return o.deleteSbc()}),e.EFF(11),e.nI1(12,"translate"),e.k0s()()()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,9,"_i18n.EditSBC")," "),e.R7$(2),e.AVh("disabled",!o.canPushConfig),e.R7$(),e.Y8G("disabled",!o.canPushConfig),e.R7$(),e.SpI(" ",e.bMT(8,11,"_i18n.SbcPushConfig")," "),e.R7$(2),e.AVh("disabled",!o.record().isDeletable),e.R7$(),e.Y8G("disabled",!o.record().isDeletable),e.R7$(),e.SpI(" ",e.bMT(12,13,"_i18n.DeleteSBC")," "))},dependencies:[ce.I,P.D9],encapsulation:2,changeDetection:0})}return n})();const Sa=new r.nKC("resolveSbc",{providedIn:"root",factory:()=>{const n=(0,r.WQX)(P.c$),s=(0,r.WQX)(_e.N);return t=>(0,te.z)([n.get("_i18n.RouterPhone"),s.listSbc({$select:["Name","DisplayName","HasConnection","ProvisionLink","PhoneMAC","PhoneUserId","Group"]})]).pipe((0,G.T)(([i,o])=>o.value?.map(d=>function Na(n,s,t){return{edit:["sbc",n.Name],component:ya,isOnline:n.HasConnection??!1,id:n.Name??"",name:n.DisplayName??"",groups:(0,be.$B)(s,n.Group)?.Name??"",type:"Sbc",isDeletable:!n.PhoneMAC,text:n.PhoneUserId?t:"SBC"}}(d,t,i))??[]))}});var Me=l(61220);let Ma=(()=>{class n{listControl=(0,r.WQX)(Z.b);router=(0,r.WQX)(m.Ix);fxsService=(0,r.WQX)(Me.V);route=(0,r.WQX)(m.nX);record=f.hFB.required();params=(0,f.hFB)();isDect=(0,N.EW)(()=>"Dect"===this.record().type);edit(){const t=this.record().edit;t&&this.router.navigate(t,{relativeTo:this.route})}confirmDeleteFxs(){this.listControl.confirmAndDelete(this.isDect()?"_i18n.ConfirmDeleteForDect":"_i18n.ConfirmDeleteForFxs",this.fxsService.deleteFxs({macAddress:this.record().id}))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],inputs:{record:[1,"record"],params:[1,"params"]},decls:9,vars:9,consts:[["role","menuitem"],["type","button","data-qa","edit",1,"dropdown-item",3,"click"],["type","button","data-qa","delete",1,"dropdown-item",3,"click","disabled"]],template:function(i,o){1&i&&(e.j41(0,"row-action-button")(1,"li",0)(2,"button",1),e.bIt("click",function(){return o.edit()}),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"li",0)(6,"button",2),e.bIt("click",function(){return o.confirmDeleteFxs()}),e.EFF(7),e.nI1(8,"translate"),e.k0s()()()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,5,o.isDect()?"_i18n.EditDect":"_i18n.EditFxs")," "),e.R7$(2),e.AVh("disabled",!o.record().isDeletable),e.R7$(),e.Y8G("disabled",!o.record().isDeletable),e.R7$(),e.SpI(" ",e.bMT(8,7,o.isDect()?"_i18n.DeleteDect":"_i18n.DeleteFxs")," "))},dependencies:[ce.I,P.D9],encapsulation:2,changeDetection:0})}return n})();var qe=l(83185);const Pa=new r.nKC("resolveFxs",{providedIn:"root",factory:()=>{const n=(0,r.WQX)(Me.V);return s=>n.listFxs({$select:["Name","MacAddress","Group","FxsLines","Registered"],$expand:["Template($select=DeviceType),Registered"]}).pipe((0,G.T)(t=>t.value?.map(i=>function Ea(n,s){return{edit:["fxs",n.MacAddress],component:Ma,isOnline:!!n.Registered,id:n.MacAddress??"",name:n.Name??"",groups:(0,be.$B)(s,n.Group)?.Name??"",type:"Fxs"===n.Template?.DeviceType?"Fxs":"Dect",isDeletable:!0,text:(0,qe.XT)([...new Set(n.FxsLines.filter(t=>!!t.Name).map(t=>t.Name))],5)}}(i,s))??[]))}});var ve=l(94943),ze=l(27468),Ke=l(67469);var Ee=l(92996),xa=l(81783),sn=l(29279),Ze=l(14176);function wa(n,s){if(1&n&&(e.j41(0,"span",9),e.EFF(1),e.nI1(2,"appTemplateType"),e.nI1(3,"translate"),e.k0s()),2&n){const t=s.item;e.R7$(),e.JRh(e.bMT(3,4,e.i5U(2,1,t,"provider")))}}function Fa(n,s){if(1&n&&(e.j41(0,"div",1)(1,"div",2)(2,"field-wrapper",3),e.nrm(3,"ng-select",4),e.k0s()(),e.j41(4,"div",2)(5,"f
1ield-wrapper",5)(6,"ng-select",6),e.DNE(7,wa,4,6,"ng-template",7),e.k0s()()(),e.nrm(8,"app-trunk-guide-link",8),e.k0s()),2&n){const t=e.XpG();e.Y8G("formGroup",t.params),e.R7$(3),e.Y8G("items",t.countries)("clearable",!1),e.R7$(3),e.Y8G("items",t.trunkTemplates)("clearable",!1)("groupBy",t.groupByFn)("groupValue",t.groupValueFn),e.R7$(2),e.Y8G("trunkTemplate",t.params.value.trunkTemplate)}}let Ga=(()=>{class n extends ne.m{langService=(0,r.WQX)($t.m);destroy$=(0,r.WQX)(r.abz);cd=(0,r.WQX)(f.gRc);groupByFn=Ze.E;providers;systemInfo;buttons=B.P.OkCancel;trunkTemplates=[];countries=[];params;validateBeforeSubmit;ngOnInit(){const t=this.langService.getSelectedLanguage(this.langService.localStorageLang()),i=new a.gE({country:new a.MJ(null,a.k0.required),trunkTemplate:new a.MJ(null,a.k0.required)}),o=(0,sn.D)(this.providers);this.countries=(0,g.ev)(t.id,o),i.controls.country.valueChanges.pipe((0,O.pQ)(this.destroy$)).subscribe(v=>{const M=this.countries.find(E=>E.id===v);this.trunkTemplates=M?.providers??[],i.patchValue({trunkTemplate:this.trunkTemplates[0]||null})});let d=this.systemInfo?.License?.CountryCode;"GB"===d&&(d="UK");const c=!(!d||!this.countries.some(v=>v.id===d));i.patchValue({country:c?d:h.n6}),this.params=i,this.validateBeforeSubmit=this.createDialogValidate(this.params,this.cd)}groupValueFn(t,i){return(0,Ze.E)(i[0])}getPayload(){return this.params?.value.trunkTemplate?.Id}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-add-trunk-modal"]],inputs:{providers:"providers",systemInfo:"systemInfo"},features:[e.Vt3],decls:2,vars:5,consts:[[3,"submitted","header","buttons","validateBeforeSubmit","disableSubmitOnEnter"],[1,"row",3,"formGroup"],[1,"col-md-12"],["data-qa","country","label","_i18n.Country"],["formControlName","country","wcAutofocus","","bindValue","id","bindLabel","name","data-qa","select",3,"items","clearable"],["data-qa","provider","label","_i18n.Provider"],["formControlName","trunkTemplate","bindLabel","Name","data-qa","select",3,"items","clearable","groupBy","groupValue"],["ng-optgroup-tmp",""],[3,"trunkTemplate"],[1,"ng-option"]],template:function(i,o){1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("submitted",function(){return o.onSubmit()}),e.nVh(1,Fa,9,8,"div",1),e.k0s()),2&i&&(e.Y8G("header","_i18n.TrunkSelectProvider")("buttons",o.buttons)("validateBeforeSubmit",o.validateBeforeSubmit)("disableSubmitOnEnter",!0),e.R7$(),e.vxM(o.params?1:-1))},dependencies:[ie.p,a.X1,a.BC,a.cb,a.j4,a.JD,me.z,ee.vr,ct.J,ee.bh,rt,P.D9,Ze.n],encapsulation:2,changeDetection:0})}return n})();const Aa=[{type:"final",header:"_i18n.TrunkAddedHeader",backIsAllowed:!1},{type:"addTrunk",header:"_i18n.CreateTrunkHeader",backIsAllowed:!1}],Da=[{type:"final",header:"_i18n.TrunkAddedHeader",backIsAllowed:!1},{type:"addTrunk",header:"_i18n.CreateTrunkHeader",backIsAllowed:!1},{type:"selectNumbers",header:"_i18n.SelectPhoneNumbersHeader",backIsAllowed:!0}
1,{type:"auth",header:"_i18n.TwilioAccountCredentialsHeader",backIsAllowed:!0}];var et=l(41029),$a=l(7881),Oa=l(91968),Va=l(73042),Pe=l(74743),ln=l(12426),Rt=l(42610);function Ba(n,s){if(1&n){const t=e.RV6();e.j41(0,"tr",9)(1,"td",5)(2,"app-checker",11),e.bIt("ngModelChange",function(o){const d=r.eBV(t).$implicit,c=e.XpG();return r.Njj(c.onChange(d,o))}),e.k0s()(),e.j41(3,"td",12),e.EFF(4),e.k0s(),e.j41(5,"td",13),e.EFF(6),e.k0s(),e.j41(7,"td",14),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"td",5)(11,"app-checker",15),e.mxI("ngModelChange",function(o){const d=r.eBV(t).$implicit;return e.DH7(d.IsMessagingEnabled,o)||(d.IsMessagingEnabled=o),r.Njj(o)}),e.k0s()()()}if(2&n){const t=s.$implicit,i=e.XpG();e.R7$(2),e.Y8G("ngModel",i.selector.isRowSelected(t)),e.R7$(2),e.JRh(t.PhoneNumber),e.R7$(2),e.JRh(t.FriendlyName),e.R7$(2),e.SpI(" ",e.bMT(9,6,t.IsInTrunk?"_i18n.TrunkProviderNumberStatusBusy":"_i18n.TrunkProviderNumberStatusAvailable")," "),e.R7$(3),e.Y8G("disabled",!i.selector.isRowSelected(t)),e.R50("ngModel",t.IsMessagingEnabled)}}function ja(n,s){if(1&n){const t=e.RV6();e.j41(0,"tr")(1,"td",16)(2,"div",17)(3,"button",18),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.onLoadMore())}),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nrm(6,"ng-select",19),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(4),e.SpI(" ",e.bMT(5,5,"_i18n.LoadMore")," "),e.R7$(2),e.Y8G("formControl",t.pageSizeControl)("clearable",!1)("searchable",!1)("items",t.PAGE_SIZES)}}function Wa(n,s){1&n&&(e.j41(0,"tr")(1,"td",16)(2,"div",17),e.nrm(3,"span",20),e.k0s()()())}function Xa(n,s){1&n&&(e.j41(0,"p",10),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"_i18n.TrunkPleaseSelectAtLest1Number")," "))}let dn=(()=>{class n{selector;search=(0,r.vPA)("");allNumbers=(0,r.vPA)([]);isLoadingMore=(0,r.vPA)(!1);visibleNumbers=(0,N.EW)(()=>{const t=this.search().trim();return Va.Q.isNullOrEmpty(t)?this.allNumbers():this.allNumbers().filter(i=>i.FriendlyName?.toLowerCase().includes(t.toLowerCase())||i.PhoneNumber?.includes(t))});set AvailableNumbers(t){this.allNumbers.set(t??[]),this.isLoadingMore.set(!1)}SelectedNumbers;description;error;hasMorePages=!1;loadMore=(0,f.CGW)();pageSizeChange=(0,f.CGW)();localStorageService=(0,r.WQX)(ln.sj);destroy$=(0,r.WQX)(r.abz);pageSizeControl=new a.MJ(this.localStorageService.retrieve(Rt.Ct)??de.z9,{nonNullable:!0});PAGE_SIZES=de.tn;constructor(){const t=(0,r.WQX)(f.gRc);this.selector=new lt.a({cd:t,keySelector:i=>i.Sid,notKeepSelectedOnDataChange:!0}),this.pageSizeControl.valueChanges.pipe((0,O.pQ)(this.destroy$)).subscribe({next:i=>{this.localStorageService.store(Rt.Ct,i),this.pageSizeChange.emit(i)}})}ngOnInit(){this.SelectedNumbers.value?.forEach(t=>this.selector.setSelected(t,!0))}updateSearch(t){this.search.set(t)}onChange(t,i){this.selector.setSelected(t,i),this.SelectedNumbers.setValue(this.selector.selectedValues),this.SelectedNumbers.markAsDirty()}onLoadMore(){this.isLoadingMore.set(!0),this.loadMore.emit()}resetLoading(){this.isLoadingMore.set(!1)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-select-provider-numbers"]],inputs:{AvailableNumbers:"AvailableNumbers",SelectedNumbers:"SelectedNumbers",description:"description",error:"error",hasMorePages:"hasMorePages"},outputs:{loadMore:"loadMore",pageSizeChange:"pageSizeChange"},decls:27,vars:19,consts:[[1,"mb-2"],[3,"ngModelChange","ngModel"],[1,"compact","scrollable-table","phones-table"],[3,"cellSpacing"],[1,"position-sticky"],[1,"checker"],[1,"col-size-300","xs-visible"],[1,"col-size-300","lg-visible"],[1,"col-size-300","md-visible"],["data-qa","select-provider-number-row"],["data-qa","modal-error",1,"text-error","hidden-overflow","my-2"],["data-qa","checker",3,"ngModelChange","ngModel"],["data-qa","phone-number",1,"xs-visible"],["data-qa","friendly-name",1,"lg-visible"],["data-qa","status",1,"md-visible"],["data-qa","messaging-enabled",3,"ngModelChange","disabled","ngModel"],["colspan","5"],[1,"d-flex","align-items-center","justify-content-center",2,"height","50px"],["type","button","data-qa","load-more-button",1,"btn","btn-primary",3,"click"],[3,"formControl","clearable","searchable","items"],["app-spinner-regular-icon","",1,"customSVGIcons","svg-lg"]],template:function(i,o){1&i&&(e.j41(0,"div",0),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"search-bar",1),e.bIt("ngModelChange",function(c){return o.updateSearch(c)}),e.k0s(),e.j41(4,"div",2)(5,"table",3)(6,"thead",4)(7,"tr"),e.nrm(8,"th",5),e.j41(9,"th",6),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.j41(12,"th",7),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"th",8),e.EFF(16),e.nI1(17,"translate"),e.k0s(),e.j41(18,"th",5),e.EFF(19),e.nI1(20,"translate"),e.k0s()()(),e.j41(21,"tbody"),e.Z7z(22,Ba,12,8,"tr",9,e.fX1),e.nVh(24,ja,7,7,"tr")(25,Wa,4,0,"tr"),e.k0s()()(),e.nVh(26,Xa,3,3,"p",10)),2&i&&(e.R7$(),e.JRh(e.bMT(2,9,o.description)),e.R7$(2),e.Y8G("ngModel",o.search()),e.R7$(2),e.Y8G("cellSpacing",0),e.R7$(5),e.JRh(e.bMT(11,11,"_i18n.TrunkProviderPhoneNumber")),e.R7$(3),e.JRh(e.bMT(14,13,"_i18n.TrunkProviderNumberFriendlyName")),e.R7$(3),e.JRh(e.bMT(17,15,"_i18n.TrunkProviderNumberStatus")),e.R7$(3),e.JRh(e.bMT(20,17,"_i18n.TrunkNumberMessaging")),e.R7$(3),e.Dyx(o.visibleNumbers()),e.R7$(2),e.vxM(o.hasMorePages&&!o.isLoadingMore()?24:o.isLoadingMore()?25:-1),e.R7$(2),e.vxM(o.error?26:-1))},dependencies:[Be.L,a.X1,a.BC,a.l_,a.YN,a.vS,pt.$,Pe.a,ee.vr,P.D9],styles:[".phones-table[_ngcontent-%COMP%]{max-height:300px}"],changeDetection:0})}return n})();var La=l(81546),Ya=l(61594),Ua=l(44668);function Ja(n,s){1&n&&(e.j41(0,"p",1),e.nrm(1,"app-server-error",2),e.k0s()),2&n&&(e.R7$(),e.Y8G("message",s))}
1function Ha(n,s){if(1&n&&(e.j41(0,"p",3),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"field-input",4),e.nrm(4,"val-errors",5),e.k0s(),e.nrm(5,"app-group-select",6)),2&n){const t=e.XpG();e.R7$(),e.JRh(e.bMT(2,7,"_i18n.CreateTrunkDescription")),e.R7$(2),e.Y8G("formControl",t.f.Name)("maxlength",50),e.R7$(),e.Y8G("control",t.f.Name),e.R7$(),e.Y8G("formControl",t.f.Group)("groups",t.groups)("systemAccess",t.systemAccess)}}function Qa(n,s){if(1&n&&(e.j41(0,"div",3)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.EFF(4),e.j41(5,"app-external-link",7),e.nI1(6,"translate"),e.EFF(7),e.nI1(8,"translate"),e.k0s()(),e.j41(9,"field-input-password",8),e.nrm(10,"val-errors",5),e.k0s(),e.j41(11,"field-input-password",9),e.nrm(12,"val-errors",5),e.k0s(),e.j41(13,"span"),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.EFF(16),e.j41(17,"app-external-link",7),e.nI1(18,"translate"),e.EFF(19),e.nI1(20,"translate"),e.k0s()),2&n){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,14,"_i18n.TrunkTwilioCreateText")),e.R7$(2),e.SpI(""," "," "),e.R7$(),e.Y8G("href",e.bMT(6,16,t.providerConsoleUrl)),e.R7$(2),e.JRh(e.bMT(8,18,"_i18n.TrunksProviderConsole")),e.R7$(2),e.Y8G("formControl",t.f.AccountSid)("maxlength",50),e.R7$(),e.Y8G("control",t.f.AccountSid),e.R7$(),e.Y8G("formControl",t.f.ApiKey)("maxlength",50),e.R7$(),e.Y8G("control",t.f.ApiKey),e.R7$(2),e.JRh(e.bMT(15,20,"_i18n.DontHaveTwilioAccount")),e.R7$(2),e.SpI(""," "," "),e.R7$(),e.Y8G("href",e.bMT(18,22,t.registrationUrl)),e.R7$(2),e.JRh(e.bMT(20,24,"_i18n.SignUpTwilio"))}}function qa(n,s){if(1&n){const t=e.RV6();e.j41(0,"app-select-provider-numbers",12),e.bIt("loadMore",function(){const o=r.eBV(t),d=e.XpG(2);return r.Njj(d.loadMore(o))})("pageSizeChange",function(o){r.eBV(t);const d=e.XpG(2);return r.Njj(d.onPageSizeChange(o))}),e.k0s()}if(2&n){const t=s,i=e.XpG(2);e.Y8G("SelectedNumbers",i.f.SelectedNumbers)("AvailableNumbers",t.numbers)("description","_i18n.TrunkSelectNumbersDescription")("error",i.errorSelection)("hasMorePages",t.hasMorePages)}}function za(n,s){1&n&&(e.j41(0,"div",11),e.nrm(1,"span",13),e.k0s())}function Ka(n,s){if(1&n&&(e.nVh(0,qa,1,5,"app-select-provider-numbers",10),e.nI1(1,"async"),e.vZN(2,za,2,0,"div",11)),2&n){let t;const i=e.XpG();e.vxM((t=e.bMT(1,1,i.availableNumbers$))?0:2,t)}}function Za(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.EFF(3),e.j41(4,"app-external-link",7),e.nI1(5,"translate"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.EFF(8),e.j41(9,"span"),e.EFF(10),e.nI1(11,"translate"),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.JRh(e.bMT(2,6,"_i18n.NoAvailableNumbersMessage")),e.R7$(2),e.SpI(" "," "," "),e.R7$(),e.Y8G("href",e.bMT(5,8,t.providerConsoleUrl)),e.R7$(2),e.JRh(e.bMT(7,10,"_i18n.TrunksProviderConsole")),e.R7$(2),e.SpI(" "," "," "),e.R7$(2),e.JRh(e.bMT(11,12,"_i18n.TrunkAndTryAgain"))}}function er(n,s){1&n&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"p"),e.EFF(4),e.nI1(5,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,2,"_i18n.TrunkSuccesfullyAddedMessage")),e.R7$(3),e.JRh(e.bMT(5,4,"_i18n.TrunkSuccesfullyAddedMessage2")))}let tr=(()=>{class n extends ne.m{cd=(0,r.WQX)(f.gRc);trunkService=(0,r.WQX)(p.T);xapiErrorSvc=(0,r.WQX)(et.Ko);fb=(0,r.WQX)(a.Qk);destroy$=(0,r.WQX)(r.abz);localStorageService=(0,r.WQX)(ln.sj);creator;isAdmin;isMcm;TrunkType;groups;systemAccess;nonXapiError=(0,r.vPA)(null);selectProviderNumbers;state;stepStack=[];backStepStack=[];isLoading=!1;trunk;nextPageLink$=new Ne.B;isInitialLoad=!0;availableNumbersSubscription;availableNumbers$;pageSize=this.localStorageService.retrieve(Rt.Ct)??de.z9;trunkTypeOptions=[{value:"Voxtelesys",label:"Voxtelesys"},{value:"Twilio",label:"Twilio"}];get errorSelection(){return!this.f.SelectedNumbers.valid&&this.showValidation}form=new a.gE({Name:new a.MJ("",{validators:[a.k0.required,b.HD],nonNullable:!0}),ApiKey:new a.MJ("",{validators:a.k0.required,nonNullable:!0}),AccountSid:new a.MJ("",{validators:a.k0.required,nonNullable:!0}),SelectedNumbers:this.fb.control([],a.k0.required),Group:new a.MJ(null)});ngOnInit(){if(!this.systemAccess&&this.groups){const i=this.groups.find(o=>o.IsDefault)??this.groups[0]??null;i&&this.form.controls.Group.patchValue(i)}this.initializeIntegration(this.TrunkType);const t=this.stepStack.pop();this.setState(t)}get header(){return this.state.header}get providerConsoleUrl(){return"Twilio"===this.TrunkType?"https://console.twilio.com":""}get registrationUrl(){return"Twilio"===this.TrunkType?"https://www.twilio.com/try-twilio":""}get f(){return this.form.controls}isStepValid(t){switch(t){case"addTrunk":return this.f.Name.valid;case"auth":return this.f.ApiKey.valid&&this.f.AccountSid.valid;case"selectNumbers":return this.f.SelectedNumbers.valid;default:return!0}}setNextState(){const t=this.stepStack.pop();this.state.backIsAllowed&&this.backStepStack.push(this.state),t?this.setState(t):this.onSubmit()}setPrevState(){const t=this.backStepStack.pop();t&&("auth"===t.type&&(this.form.controls.SelectedNumbers.patchValue([]),this.availableNumbersSubscription?.unsubscribe(),this.availableNumbersSubscription=void 0,this.availableNumbers$=void 0),this.stepStack.push(this.state),this.setState(t))}pushNoAvailableNumbersState(){this.stepStack.push({type:"noAvailableNumbers",header:"_i18n.TrunkNoAvailableNumbersHeader",backIsAllowed:!1})}
1changeStep(t){if(this.nonXapiError.set(null),1===t&&!this.isStepValid(this.state.type))return Object.values(this.form.controls).forEach(i=>i.markAsTouched()),this.cd.markForCheck(),void(this.showValidation=!0);if(this.showValidation=!1,-1!==t)switch(this.state.type){case"auth":case"noAvailableNumbers":this.availableNumbers$||(this.availableNumbers$=this.requestAvailableNumbers$(),this.availableNumbersSubscription=this.availableNumbers$?.pipe((0,O.pQ)(this.destroy$)).subscribe({next:i=>{this.isInitialLoad?(this.isInitialLoad=!1,i.numbers.length?(this.finalize(),this.setNextState()):(this.finalize(),this.pushNoAvailableNumbersState(),this.setNextState())):this.finalize()},error:i=>this.onError(i)}));break;case"addTrunk":this.addTrunk$()?.subscribe({next:i=>{this.finalize(),this.trunk=i,this.setNextState()},error:i=>this.onError(i)});break;default:this.setNextState()}else this.setPrevState()}initializeIntegration(t){switch(t){case"Voxtelesys":this.stepStack.push(...Aa);break;case"Twilio":this.stepStack.push(...Da);break;default:console.error("Invalid Integration Type")}}setState(t){this.state=t,this.buttons="final"!==this.state.type?this.backStepStack.length?B.P.BackNext:B.P.Next:B.P.OkCancel,this.cd.markForCheck()}onError(t){this.finalize(),this.selectProviderNumbers?.resetLoading(),this.xapiErrorSvc.error(this.cd,t,this.form,!1,!1)||this.nonXapiError.set((0,$a.PE)(t))}finalize(){this.cd.markForCheck(),this.isLoading=!1}requestAvailableNumbers$(){if(this.isLoading)return;this.isLoading=!0,this.isInitialLoad=!0,this.cd.markForCheck();const t=i=>this.trunkService.getProviderPhones({trunksGetProviderPhonesRequestBody:{model:{Type:this.TrunkType,AccountSid:this.form.value.AccountSid,ApiKey:this.form.value.ApiKey,NextPageToken:i,PhonesPageSize:this.pageSize}}});return t(null).pipe((0,La.f)(i=>{const o=i.NextPageToken;return o?this.nextPageLink$.pipe((0,Ya.$)(),(0,R.n)(()=>t(o).pipe((0,G.T)(d=>({...d,Phones:[...i.Phones??[],...d.Phones??[]]})),(0,U.W)(d=>(this.selectProviderNumbers?.resetLoading(),this.onError(d),(0,Y.of)(i)))))):ge.w}),(0,G.T)(i=>({numbers:i.Phones??[],nextPageToken:i.NextPageToken??null,hasMorePages:!!i.NextPageToken})),(0,U.W)(i=>(this.finalize(),this.onError(i),this.availableNumbers$=void 0,this.availableNumbersSubscription?.unsubscribe(),this.availableNumbersSubscription=void 0,ge.w)),(0,Ua.t)({refCount:!0,bufferSize:1}))}loadMore(t){t.hasMorePages&&this.nextPageLink$.next()}onPageSizeChange(t){this.pageSize=t,this.nextPageLink$=new Ne.B,this.isInitialLoad=!0,this.availableNumbers$=this.requestAvailableNumbers$(),this.availableNumbers$?.pipe((0,O.pQ)(this.destroy$)).subscribe({next:i=>{this.isInitialLoad?(this.isInitialLoad=!1,i.numbers.length?(this.finalize(),this.cd.markForCheck()):(this.finalize(),this.pushNoAvailableNumbersState(),this.setNextState())):this.finalize()},error:i=>this.onError(i)})}getPayload(){return[this.trunk,this.form.value.Group?.Id]}addTrunk$(){if(this.isLoading)return;this.isLoading=!0,this.cd.markForCheck();const i=(0,$e.Vt)(!this.creator||this.isMcm&&this.isAdmin?{To:"None"}:{To:"Extension",Type:"Extension",Number:this.creator.Number,Name:this.creator.Name});return this.trunkService.finalizeTrunkProvisioning({trunksFinalizeTrunkProvisioningRequestBody:{model:{Name:this.form.value.Name,Type:this.TrunkType,PhoneNumbers:this.form.value.SelectedNumbers,ApiKey:this.form.value.ApiKey,AccountSid:this.form.value.AccountSid,DefaultRule:i,Groups:(0,g.ru)(this.form.controls.Group,!0)}}})}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-trunk-wizard"]],viewQuery:function(i,o){if(1&i&&e.GBs(dn,5),2&i){let d;e.mGM(d=e.lsd())&&(o.selectProviderNumbers=d.first)}},hostVars:2,hostBindings:function(i,o){2&i&&e.AVh("modal-lg",!0)},inputs:{creator:"creator",isAdmin:"isAdmin",isMcm:"isMcm",TrunkType:"TrunkType",groups:"groups",systemAccess:"systemAccess"},features:[e.Vt3],decls:7,vars:8,consts:[["okText","_i18n.TrunkFinalOkText","cancelText","_i18n.TrunkFinalCancelText",3,"backClicked","nextClicked","submitted","header","buttons","
1nextText","disableSubmitOnEnter","showValidation","nextIsLoading"],["data-qa","modal-error",1,"text-error",2,"max-height","2.8em","overflow","hidden"],[3,"message"],[1,"mb-3"],["label","_i18n.Name","data-qa","name",3,"formControl","maxlength"],[3,"control"],["data-qa","trunk-group","label","_i18n.LimitTo","description","true",3,"formControl","groups","systemAccess"],[3,"href"],["label","_i18n.AccountSID","data-qa","account-sid",3,"formControl","maxlength"],["label","_i18n.AuthToken","data-qa","auth-token",3,"formControl","maxlength"],["data-qa","select-provider-numbers",3,"SelectedNumbers","AvailableNumbers","description","error","hasMorePages"],[1,"text-center","d-flex","align-items-center","justify-content-center",2,"height","100px"],["data-qa","select-provider-numbers",3,"loadMore","pageSizeChange","SelectedNumbers","AvailableNumbers","description","error","hasMorePages"],["app-spinner-regular-icon","",1,"customSVGIcons","svg-xl"]],template:function(i,o){if(1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("backClicked",function(){return o.changeStep(-1)})("nextClicked",function(){return o.changeStep(1)})("submitted",function(){return o.onSubmit()}),e.nVh(1,Ja,2,1,"p",1),e.nVh(2,Ha,6,9)(3,Qa,21,26)(4,Ka,3,3)(5,Za,12,14)(6,er,6,6),e.k0s()),2&i){let d,c;e.Y8G("header",o.header)("buttons",o.buttons)("nextText","_i18n.Next")("disableSubmitOnEnter",!0)("showValidation",o.showValidation)("nextIsLoading",o.isLoading),e.R7$(),e.vxM((d=o.nonXapiError())?1:-1,d),e.R7$(),e.vxM("addTrunk"===(c=o.state.type)?2:"auth"===c?3:"selectNumbers"===c?4:"noAvailableNumbers"===c?5:"final"===c?6:-1)}},dependencies:[ie.p,Q.m,a.X1,a.BC,a.tU,a.l_,Pe.a,A.IH,Oe.x,Ct.P,st.$,dn,Oa.J,P.D9,V.Jj],encapsulation:2,changeDetection:0})}return n})(),cn=(()=>{class n{modalService=(0,r.WQX)(j.B);groupsApiSvc=(0,r.WQX)(Ke.G);tokenInfoSvc=(0,r.WQX)(Ee.Z);trunkTemplatesApiSvc=(0,r.WQX)(ve.L);defsApiSvc=(0,r.WQX)(kt.G);setupTwilioAuto(t,i){return(0,ze.p)([(0,xa.IU)(this.groupsApiSvc),this.tokenInfoSvc.getMyToken$().pipe((0,G.T)(o=>o.groups))]).pipe((0,R.n)(([o,d])=>this.modalService.showComponent(tr,{initialState:{creator:i,isAdmin:t.isAdmin,isMcm:t.isMcm,TrunkType:"Twilio",groups:o,systemAccess:d??!1}})))}selectTrunkTemplate(){return(0,ze.p)([(0,sn.y)(this.trunkTemplatesApiSvc),this.defsApiSvc.getSystemParameters()]).pipe((0,R.n)(([t,i])=>this.modalService.showComponent(Ga,{initialState:{providers:t,systemInfo:i}})))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=r.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var It=l(21310);function nr(n,s){if(1&n){const t=e.RV6();e.j41(0,"li",0)(1,"button",1),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.edit())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()(),e.j41(4,"li",0)(5,"button",2),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.delete())}),e.EFF(6),e.nI1(7,"translate"),e.k0s()()}2&n&&(e.R7$(2),e.SpI(" ",e.bMT(3,2,"_i18n.EditTrunk")," "),e.R7$(4),e.SpI(" ",e.bMT(7,4,"_i18n.DeleteTrunk")," "))}function ir(n,s){if(1&n){const t=e.RV6();e.j41(0,"li",0)(1,"button",3),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.refreshRegistration())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}2&n&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"_i18n.RefreshRegistration")," "))}
1function or(n,s){if(1&n){const t=e.RV6();e.j41(0,"li",0)(1,"button",6),e.bIt("click",function(){r.eBV(t);const o=e.XpG(3);return r.Njj(o.viewTemplate())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}2&n&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"_i18n.ViewTemplate")," "))}function ar(n,s){if(1&n){const t=e.RV6();e.j41(0,"li",0)(1,"button",4),e.bIt("click",function(){r.eBV(t);const o=e.XpG(2);return r.Njj(o.testTrunk())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()(),e.j41(4,"li",0)(5,"button",5),e.bIt("click",function(){r.eBV(t);const o=e.XpG(2);return r.Njj(o.setTemplate())}),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.j41(8,"li",0)(9,"button",5),e.bIt("click",function(){r.eBV(t);const o=e.XpG(2);return r.Njj(o.syncTemplate())}),e.EFF(10),e.nI1(11,"translate"),e.k0s()(),e.nVh(12,or,4,3,"li",0)}if(2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",e.bMT(3,4,"_i18n.TestTrunk")," "),e.R7$(4),e.SpI(" ",e.bMT(7,6,"_i18n.SetTemplate")," "),e.R7$(4),e.SpI(" ",e.bMT(11,8,"_i18n.SyncTemplate")," "),e.R7$(2),e.vxM(t.params().isAdmin?12:-1)}}function rr(n,s){if(1&n&&e.nVh(0,ar,13,10),2&n){const t=e.XpG();e.vxM(t.isSIPTrunk()?0:-1)}}let un=(()=>{class n{gatewayParamsService=(0,r.WQX)(It.o);listControl=(0,r.WQX)(Z.b);router=(0,r.WQX)(m.Ix);trunkCreateService=(0,r.WQX)(cn);route=(0,r.WQX)(m.nX);trunkTemplatesApiService=(0,r.WQX)(ve.L);trunksApiService=(0,r.WQX)(p.T);modalService=(0,r.WQX)(j.B);record=f.hFB.required();params=f.hFB.required();id=(0,N.EW)(()=>+this.record().id);canRefreshRegistration=(0,N.EW)(()=>{const t=this.record();return"other"===t.provider&&("Provider"===t.type||"BridgeSlaveOverTunnel"===t.type||"BridgeSlave"===t.type)});isSIPTrunk=(0,N.EW)(()=>{const t=this.record();return"other"===t.provider&&"Provider"===t.type});canManage=(0,N.EW)(()=>"Analog"!==this.record().type||this.params().isAdmin);edit(){if(!this.canManage())return;const t=this.record().edit;t&&this.router.navigate(t,{relativeTo:this.route})}testTrunk(){this.router.navigate(["test",this.id()],{relativeTo:this.route}).catch(re.l)}applyTemplate(t,i){return(0,ze.p)([this.trunksApiService.getTrunk({id:this.id()}),this.trunkTemplatesApiService.getTrunkTemplate({id:i}).pipe((0,R.n)(o=>(0,ue.vY)(o,this.gatewayParamsService)))]).pipe((0,R.n)(([o,d])=>{const c=(0,ue.IS)(d,o);return c?this.modalService.showDialog(an,{header:t,diff:on(c)}).pipe(D.nx,(0,R.n)(()=>this.trunksApiService.updateTrunk({id:this.id(),pbxTrunk:c}))):(this.modalService.information("_i18n.NoTrunkChangesFound"),(0,Y.of)(!0))}))}setTemplate(){const t=this.record().edit;t&&this.trunkCreateService.selectTrunkTemplate().pipe((0,D.Sf)(),(0,R.n)(i=>this.router.navigate(t,{relativeTo:this.route,queryParams:{newTemplate:i}}))).subscribe({error:i=>this.modalService.error(i)})}syncTemplate(){const t=this.record().templateName;t&&this.applyTemplate("_i18n.SyncTemplate",t).subscribe({error:i=>this.modalService.error(i)})}viewTemplate(){const t=this.record().templateName;t&&this.router.navigate((0,ue.Vj)(t)).catch(re.l)}delete(){this.listControl.confirmAndDelete("_i18n.ConfirmDeleteForTrunk",this.trunksApiService.deleteTrunk({id:this.id()}))}refreshRegistration(){this.trunksApiService.refreshRegistration({trunksRefreshRegistrationRequestBody:{id:this.id()}}).pipe((0,D.AI)(400,"_i18n.TrunkNotFoundRefreshErrorMessage",this.record().name)).subscribe({error:t=>this.modalService.error(t)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],inputs:{record:[1,"record"],params:[1,"params"]},decls:4,vars:3,consts:[["role","menuitem"],["type","button","data-qa","edit",1,"dropdown-item",3,"click"],["type","button","data-qa","delete",1,"dropdown-item",3,"click"],["type","button","data-qa","refresh-registration",1,"dropdown-item",3,"click"],["type","button","data-qa","test-trunk",1,"dropdown-item",3,"click"],["type","button","data-qa","set-template",1,"dropdown-item",3,"click"],["type","button","data-qa","view-template",1,"dropdown-item",3,"click"]],template:function(i,o){1&i&&(e.j41(0,"row-action-button"),e.nVh(1,nr,8,6),e.nVh(2,ir,4,3,"li",0),e.nVh(3,rr,1,1),e.k0s()),2&i&&(e.R7$(),e.vxM(o.canManage()?1:-1),e.R7$(),e.vxM(o.canRefreshRegistration()?2:-1),e.R7$(),e.vxM(o.canManage()?3:-1))},dependencies:[ce.I,P.D9],encapsulation:2,changeDetection:0})}return n})();
1function sr(n,s){if(1&n){const t=e.RV6();e.j41(0,"li",0)(1,"button",3),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.refreshRegistration())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}2&n&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"_i18n.RefreshRegistration")," "))}let lr=(()=>{class n{listControl=(0,r.WQX)(Z.b);modalService=(0,r.WQX)(j.B);router=(0,r.WQX)(m.Ix);route=(0,r.WQX)(m.nX);trunks=(0,r.WQX)(p.T);record=f.hFB.required();params=(0,f.hFB)();id=(0,N.EW)(()=>+this.record().id);isSlaveBridge=(0,N.EW)(()=>"BridgeSlave"===this.record().type||"BridgeSlaveOverTunnel"===this.record().type);edit(){const t=this.record().edit;t&&this.router.navigate(t,{relativeTo:this.route})}delete(){this.listControl.confirmAndDelete("_i18n.ConfirmDeleteForTrunk",this.trunks.deleteTrunk({id:this.id()}))}refreshRegistration(){this.trunks.refreshRegistration({trunksRefreshRegistrationRequestBody:{id:this.id()}}).pipe((0,D.AI)(400,"_i18n.BridgeNotFoundRefreshErrorMessage",this.record().name)).subscribe({error:t=>this.modalService.error(t)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],inputs:{record:[1,"record"],params:[1,"params"]},decls:10,vars:10,consts:[["role","menuitem"],["type","button","data-qa","edit",1,"dropdown-item",3,"click"],["type","button","data-qa","delete",1,"dropdown-item",3,"click","disabled"],["type","button","data-qa","refresh-registration",1,"dropdown-item",3,"click"]],template:function(i,o){1&i&&(e.j41(0,"row-action-button")(1,"li",0)(2,"button",1),e.bIt("click",function(){return o.edit()}),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"li",0)(6,"button",2),e.bIt("click",function(){return o.delete()}),e.EFF(7),e.nI1(8,"translate"),e.k0s()(),e.nVh(9,sr,4,3,"li",0),e.k0s()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,6,"_i18n.EditTrunk")," "),e.R7$(2),e.AVh("disabled",!o.record().isDeletable),e.R7$(),e.Y8G("disabled",!o.record().isDeletable),e.R7$(),e.SpI(" ",e.bMT(8,8,"_i18n.DeleteTrunk")," "),e.R7$(2),e.vxM(o.isSlaveBridge()?9:-1))},dependencies:[ce.I,P.D9],encapsulation:2,changeDetection:0})}return n})();
1function dr(n,s){if(1&n){const t=e.RV6();e.j41(0,"li",0)(1,"button",1),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.delete())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}2&n&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"_i18n.DeleteTrunk")," "))}let cr=(()=>{class n{listControl=(0,r.WQX)(Z.b);trunks=(0,r.WQX)(p.T);record=f.hFB.required();params=f.hFB.required();id=(0,N.EW)(()=>+this.record().id);delete(){this.listControl.confirmAndDelete("_i18n.ConfirmDeleteForTrunk",this.trunks.deleteTrunk({id:this.id()}))}canManage=(0,N.EW)(()=>this.params().isAdmin);static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],inputs:{record:[1,"record"],params:[1,"params"]},decls:2,vars:1,consts:[["role","menuitem"],["type","button","data-qa","delete",1,"dropdown-item",3,"click"]],template:function(i,o){1&i&&(e.j41(0,"row-action-button"),e.nVh(1,dr,4,3,"li",0),e.k0s()),2&i&&(e.R7$(),e.vxM(o.canManage()?1:-1))},dependencies:[ce.I,P.D9],encapsulation:2,changeDetection:0})}return n})();var pn=l(97273);function ur(n,s){const t=n.Gateway.TemplateFilename;return t?n.Gateway.IsCustom?t:`${s}: ${t}`:""}function pr(n){return"whatsapp"===n||"facebook"===n?n:"other"}function mr(n){return(0,qe.XT)(n.DidNumbers,3)}function hr(n=null){const s="(Messaging/Provider eq 'facebook' or Messaging/Provider eq 'whatsapp' or Tags/any(t: t eq 'WM'))",t=" and not ";switch(n){case W.Trunk:return"(Gateway/Type eq 'Provider')"+t+s;case W.Gateway:return"(Gateway/Type eq 'Analog')"+t+s;case W.Messaging:return"(Gateway/Type eq 'Provider') and "+s;case W.Bridge:return"(Gateway/Type eq 'BridgeMaster' or Gateway/Type eq 'BridgeSlave' or Gateway/Type eq 'BridgeSlaveOverTunnel')";default:return}}function br(n,s,t){switch(t){case"Provider":return{component:un,edit:["trunk","edit",n]};case"Analog":return{component:un,edit:s?["trunk","edit",n]:void 0};case"BridgeMaster":case"BridgeSlave":case"BridgeSlaveOverTunnel":return{component:lr,edit:["bridge","edit",n]};default:return{component:cr}}}const gr=new r.nKC("resolveTrunks",{providedIn:"root",factory:()=>{const n=(0,r.WQX)(Ee.Z),s=(0,r.WQX)(P.c$),t=(0,r.WQX)(p.T);return(i,o=null)=>(0,te.z)([n.getMyToken$(),s.get("_i18n.Certified"),t.listTrunk({$select:["Id","Gateway","ExternalNumber","IsOnline","Messaging","Tags","ConfigurationIssue","DidNumbers($top=4)","Groups"],$expand:[`RoutingRules($top=1;$filter=Condition eq 'ForwardAll';$select=Id,Data,RuleName,Condition,CallType,OfficeHoursDestination),Groups($select=GroupId,Name;${pn.n0})`],$filter:hr(o)})]).pipe((0,G.T)(([d,c,v])=>v.value?.map(M=>function fr(n,s,t,i){return{...br(n.Id,t,n.Gateway?.Type),id:""+n.Id,type:n.Gateway?.Type,isOnline:!!n.IsOnline,configurationIssue:n.ConfigurationIssue,name:n.Gateway?.Name||"",templateName:n.Gateway?.TemplateFilename,groups:(0,qe.XT)(n.Groups?.map(o=>o?.Name||"").filter(Boolean)??[],4),text:ur(n,s),did:mr(n),destination:(0,be.XF)(n,i),provider:pr(n.Messaging?.Provider),isDeletable:!(0,g.sb)(n)}}(M,c,d.admin,i))??[]))}});let mn=(()=>{class n{myGroups$=function _r(){return(0,r.WQX)(Ke.G).listGroup({$select:["Id","Name","Number","OfficeRoute"],$filter:"not startsWith(Name, '___FAVORITES___')"}).pipe((0,G.T)(s=>s.value??[]))}();sbc$=(0,r.WQX)(Sa);fxs$=(0,r.WQX)(Pa);trunks$=(0,r.WQX)(gr);websiteLinks$=(0,r.WQX)(Ia);getRecords$(t=null){const i=t===W.Trunk||t===W.Gateway||t===W.Messaging||t===W.Bridge;return this.myGroups$.pipe((0,R.n)(o=>(0,te.z)([t&&t!==W.Messaging?(0,Y.of)([]):this.websiteLinks$(o,!1),!t||i?this.trunks$(o,t):(0,Y.of)([]),t&&t!==W.SBC?(0,Y.of)([]):this.sbc$(o),t&&t!==W.DectFxs?(0,Y.of)([]):this.fxs$(o)]).pipe((0,G.T)(([d,c,v,M])=>[...c,...d,...v,...M]))))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=r.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var hn=l(70980),tt=l(44447),pe=function(n){return n[n.UnknownMachine=0]="UnknownMachine",n[n.Windows=1]="Windows",n[n.Debian=2]="Debian",n[n.RaspberryPI=3]="RaspberryPI",n}(pe||{});function bn(n){return n.reduce((s,t,i)=>(t?.Number&&s.push({Key:i+1,Number:t.Number}),s),[])}function fn(n,s){return n.getMyToken$().pipe((0,G.T)(t=>t.admin),(0,R.n)(t=>t?(0,Y.of)(void 0):s.listGroup({$top:1}).pipe((0,G.T)(i=>
1i.value[0]?.Number))))}const gn=n=>({link:n,label:"_i18n.EnterTheProvisioningURL",qaCopyId:"sbc-provision-url"}),yt=n=>({link:n,label:"_i18n.EnterTheAuthenticationKeyId",qaCopyId:"sbc-name"}),vr=n=>({link:n,label:"_i18n.EnterTheProvisioningURLForYour3CX",qaCopyId:"sbc-provision-url"});function Tr(n,s){1&n&&e.eu8(0)}function kr(n,s){1&n&&e.eu8(0)}function Rr(n,s){if(1&n&&(e.j41(0,"ul",5)(1,"li",6),e.EFF(2," 1. "),e.nrm(3,"span",7)(4,"a",8),e.k0s(),e.j41(5,"li",6),e.EFF(6," 2. "),e.nrm(7,"span",7),e.k0s(),e.j41(8,"li",9)(9,"span",10),e.EFF(10,"3. "),e.k0s(),e.DNE(11,Tr,1,0,"ng-container",11),e.k0s(),e.j41(12,"li",9)(13,"span",10),e.EFF(14,"4. "),e.k0s(),e.DNE(15,kr,1,0,"ng-container",11),e.k0s()()),2&n){const t=e.XpG(),i=e.sdS(12);e.R7$(3),e.Y8G("translate","_i18n.DownloadThe"),e.R7$(),e.Y8G("translate","_i18n.3CXSBCForWindows"),e.R7$(3),e.Y8G("translate","_i18n.SelectTheSBCInstallLocation"),e.R7$(4),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(7,gn,t.sbcProvisioningUrl)),e.R7$(4),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(9,yt,t.sbc.Name))}}function Ir(n,s){1&n&&e.eu8(0)}function yr(n,s){1&n&&e.eu8(0)}function Nr(n,s){if(1&n&&(e.j41(0,"ul",5)(1,"li",6),e.EFF(2," 1. "),e.nrm(3,"span",7),e.j41(4,"a",12),e.EFF(5,"3CX SBC ISO"),e.k0s()(),e.j41(6,"li",6),e.EFF(7," 2. "),e.nrm(8,"span",7),e.k0s(),e.j41(9,"li",6),e.EFF(10," 3. "),e.nrm(11,"span",7),e.k0s(),e.j41(12,"li",9)(13,"span",10),e.EFF(14,"4. "),e.k0s(),e.DNE(15,Ir,1,0,"ng-container",11),e.k0s(),e.j41(16,"li",9)(17,"span",10),e.EFF(18,"5. "),e.k0s(),e.DNE(19,yr,1,0,"ng-container",11),e.k0s(),e.j41(20,"li",6),e.EFF(21," 6. "),e.nrm(22,"span",7),e.k0s()()),2&n){const t=e.XpG(),i=e.sdS(12);e.R7$(3),e.Y8G("translate","_i18n.DownloadThe"),e.R7$(5),e.Y8G("translate","_i18n.Select3CXSBCVersionWhenPrompted"),e.R7$(3),e.Y8G("translate","_i18n.SelectOKToVerifyThe3CXPrerequisites"),e.R7$(4),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(8,gn,t.sbcProvisioningUrl)),e.R7$(4),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(10,yt,t.sbc.Name)),e.R7$(3),e.Y8G("translate","_i18n.ProceedToInstallAndRestart")}}function Sr(n,s){1&n&&e.eu8(0)}function Mr(n,s){1&n&&e.eu8(0)}function Er(n,s){if(1&n&&(e.j41(0,"ul",5)(1,"li",6),e.EFF(2," 1. "),e.nrm(3,"span",7),e.k0s(),e.j41(4,"li",9)(5,"span",10),e.EFF(6,"2. "),e.k0s(),e.j41(7,"div",13),e.nrm(8,"span",14),e.j41(9,"code",15),e.EFF(10),e.k0s()()(),e.j41(11,"li",6),e.EFF(12," 3. "),e.nrm(13,"span",7),e.k0s(),e.j41(14,"li",9)(15,"span",10),e.EFF(16,"4. "),e.k0s(),e.DNE(17,Sr,1,0,"ng-container",11),e.k0s(),e.j41(18,"li",9)(19,"span",10),e.EFF(20,"5. "),e.k0s(),e.DNE(21,Mr,1,0,"ng-container",11),e.k0s(),e.j41(22,"li",6),e.EFF(23," 6. "),e.nrm(24,"span",7),e.k0s()()),2&n){const t=e.XpG(),i=e.sdS(12);e.R7$(3),e.Y8G("translate","_i18n.LoginAsUserPiViaTheCLIOrSSH"),e.R7$(5),e.Y8G("translate","_i18n.RunThe3CXInstallScript"),e.R7$(2),e.SpI(" ",t.raspberryPiScript," "),e.R7$(3),e.Y8G("translate","_i18n.SelectOKToVerifyThe3CXPrerequisites"),e.R7$(4),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(9,vr,t.sbcProvisioningUrl)),e.R7$(4),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(11,yt,t.sbc.Name)),e.R7$(3),e.Y8G("translate","_i18n.ProceedToInstallAndRestart")}}function Pr(n,s){if(1&n&&(e.j41(0,"div",16)(1,"span",10),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"app-simple-copy",17)(5,"strong",18),e.EFF(6),e.k0s()()()),2&n){const t=s.link,i=s.label,o=s.qaCopyId;e.R7$(2),e.JRh(e.bMT(3,7,i)),e.R7$(2),e.Y8G("source",t)("showIcon",!0)("showActionText",!0),e.BMQ("data-qa",o+"-copy-link"),e.R7$(),e.BMQ("data-qa",o+"-label"),e.R7$(),e.JRh(t)}}let xr=(()=>{class n{sbc={};sbcMachineType=pe.UnknownMachine;SbcMachineType=pe;get sbcProvisioningUrl(){return this.sbc.ProvisionLink?(0,tt.lZ)(this.sbc).link:""}raspberryPiScript='sudo bash -c "$(wget -qO- http://downloads-global.3cx.com/downloads/sbc/3cxsbc.zip)"';static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["sbc-guide"]],inputs:{sbc:"sbc",sbcMachineType:"sbcMachineType"},decls:13,vars:10,consts:[["copyLinkTemplate",""],[3,"translate"],[1,"mb-2","d-flex"],[1,"mb-0","me-1",3,"translate"],["target","_blank",1,"link",3,"href"],[1,"list-group"],[1,"list-group-item","p-2","border-0"],[1,"me-1",3,"translate"],["href","https://downloads-global.3cx.com/downloads/3CXSBC20.msi","target","_blank",1,"link",3,"translate"],[1,"list-group-item","p-2","border-0","d-flex"],[1,"me-1"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["href","https://downloads-global.3cx.com/downloads/debian12iso/debian-amd64-netinst-3cx.iso","target","_blank",1,"link"],[1,"d-flex","flex-column","w-100","pe-2"],[1,"me-1","mb-1",3,"translate"],[1,"p-1"],[1,"w-100","pe-2"],[3,"source","showIcon","showActionText"],[1,"text-truncate"]],template:function(i,o){if(1&i&&(e.j41(0,"div"),e.nrm(1,"strong",1),e.k0s(),e.j41(2,"div",2),e.nrm(3,"p",3),e.j41(4,"a",4),e.nI1(5,"translate"),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.nVh(8,Rr,16,11,"ul",5)(9,Nr,23,12,"ul",5)(10,Er,25,13,"ul",5),e.DNE(11,Pr,7,9,"ng-template",null,0,e.C5r)),2&i){let d;e.R7$(),e.Y8G("translate","_i18n.HowToInstall"),e.R7$(2),e.Y8G("translate","_i18n.ReadFullInstruction"),e.R7$(),e.Y8G("href",e.mNQ(e.bMT(5,6,"_i18n.SbcGuideLink")),e.B4B),e.R7$(2),e.JRh(e.bMT(7,8,"_i18n.Here")),e.R7$(2),e.vxM((d=o.sbcMachineType)===o.SbcMachineType.Windows?8:d===o.SbcMachineType.Debian?9:d===o.SbcMachineType.RaspberryPI?10:-1)}},dependencies:[P.Mm,V.T3,Ot.T,P.D9],styles:["code[_ngcontent-%COMP%]{color:var(--text-primary);background:var(--bg-primary-active)}
1"]})}return n})();var wr=l(60240),xe=l(13220),Fr=l(80320);function Gr(n,s){if(1&n&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.nrm(3,"sbc-guide",2)),2&n){const t=e.XpG();e.R7$(),e.JRh(e.bMT(2,3,"_i18n.SBCWasAddedSuccessfully")),e.R7$(2),e.Y8G("sbcMachineType",t.sbcMachineType)("sbc",t.createdSbc)}}function Ar(n,s){if(1&n&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.nrm(3,"br"),e.EFF(4),e.nI1(5,"translate"),e.j41(6,"app-external-link",3),e.nI1(7,"translate"),e.EFF(8),e.nI1(9,"translate"),e.k0s()(),e.nrm(10,"field-radio-group",4)),2&n){const t=e.XpG();e.R7$(),e.SpI(" ",e.bMT(2,6,"_i18n.WhatMachineWillYouUseForTheSBC")),e.R7$(3),e.SpI(" ",e.bMT(5,8,"_i18n.ReadMoreAboutThis")," "),e.R7$(2),e.Y8G("href",e.bMT(7,10,"_i18n.SbcGuideLink")),e.R7$(2),e.JRh(e.bMT(9,12,"_i18n.Here")),e.R7$(2),e.Y8G("formControl",t.f.MachineType)("options",t.sbcMachineTypeOptions)}}let Dr=(()=>{class n extends ne.m{sbcService=(0,r.WQX)(_e.N);tokenInfoService=(0,r.WQX)(Ee.Z);groupsService=(0,r.WQX)(Ke.G);xapiErrorService=(0,r.WQX)(et.Ko);cd=(0,r.WQX)(f.gRc);fb=(0,r.WQX)(a.ok);saving$=new Ne.B;createdSbc;form=this.fb.nonNullable.group({Name:[(0,Fr.Z)(12)],DisplayName:[(0,tt.vB)()],Password:[(0,tt.n1)()],MachineType:[pe.Windows]});buttons=B.P.Ok;get f(){return this.form.controls}get sbcMachineType(){return this.f.MachineType.value}sbcMachineTypeOptions=[{label:"_i18n.SbcMachineTypeWindows",value:pe.Windows},{label:"_i18n.SbcMachineTypeDebian",value:pe.Debian},{label:"_i18n.SbcMachineTypeRaspberryPI",value:pe.RaspberryPI}];submit$=()=>{const{Name:t,DisplayName:i,Password:o}=this.form.value;return this.saving$.next(!0),fn(this.tokenInfoService,this.groupsService).pipe((0,R.n)(d=>this.sbcService.createSbc({pbxSbc:{Group:d,Name:t,DisplayName:i,Password:o}})),(0,R.n)(d=>(this.createdSbc=d,this.cd.markForCheck(),this.output={decision:B.R.Ok,payload:this.createdSbc},this.buttons=B.P.Cancel,ge.w)),this.handleError(this.xapiErrorService,this.cd,this.form),(0,hn.j)(()=>{this.saving$.next(!1)}))};static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],features:[e.Vt3],decls:5,vars:6,consts:[["okText","_i18n.YesContinue","cancelText","_i18n.Close","header","_i18n.AddSessionBorderController",3,"buttons","submit$"],[3,"show"],[3,"sbcMachineType","sbc"],[3,"href"],["data-qa","sbc-machine-type",3,"formControl","options"]],template:function(i,o){1&i&&(e.j41(0,"app-modal-dialog",0),e.nVh(1,Gr,4,5)(2,Ar,11,14),e.nrm(3,"ngx-loading",1),e.nI1(4,"async"),e.k0s()),2&i&&(e.Y8G("buttons",o.buttons)("submit$",o.submit$),e.R7$(),e.vxM(o.createdSbc?1:2),e.R7$(2),e.Y8G("show",!0===e.bMT(4,4,o.saving$)))},dependencies:[ie.p,xr,Ct.P,wr.u,a.X1,a.BC,a.l_,xe.kq,xe.bt,P.D9,V.Jj],encapsulation:2})}return n})();var $r=l(65245),_n=l(96697),Or=l(11860),Vr=l(32338),Cn=l(59549),Nt=l(63674),we=l(88334),vn=l(60967),Wr=l(29120),Xr=l(15792);const Lr=n=>({p1:n});function Yr(n,s){if(1&n&&(e.j41(0,"span",12),e.EFF(1),e.nI1(2,"appTemplateType"),e.nI1(3,"translate"),e.k0s()),2&n){const t=s.item;e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,t.templateType)))}}function Ur(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.SBCRequired"))}function Jr(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.MacAddressAlreadyInUse"))}function Hr(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.MacAddressAlreadyInUse"))}let Qr=(()=>{class n{formGroup;templates;showValidation;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-dect-wizard-select-phone"]],inputs:{formGroup:"formGroup",templates:"templates",showValidation:"showValidation"},decls:18,vars:20,consts:[[3,"formGroup"],["data-qa","config-guide"],[3,"innerHTML"],["label","_i18n.MultiaccountModels","data-qa","phone-model"],["formControlName","phoneModel","bindLabel","displayName","groupBy","templateType","data-qa","select",3,"items","clearable"],["ng-optgroup-tmp",""],["controlName","phoneModel"],["valError","sbcRequired"],["formControlName","macAddress","data-qa","mac-address","hint","_i18n.MacAddressHintDect","placeholder","000000000ABC",3,"hideAsterisk"],["controlName","macAddress"],["valError","duplicate"],["valError","unique"],[1,"ng-option"]],template:function(i,o){1&i&&(e.qex(0,0),e.j41(1,"p",1),e.EFF(2),e.nI1(3,"translate"),e.nrm(4,"span",2),e.nI1(5,"translate"),e.nI1(6,"translate"),e.nI1(7,"appLinkify"),e.nI1(8,"translate"),e.k0s(),e.j41(9,"field-wrapper",3)(10,"ng-select",4),e.DNE(11,Yr,4,5,"ng-template",5),e.k0s(),e.j41(12,"val-errors",6),e.DNE(13,Ur,2,3,"ng-template",7),e.k0s()(),e.j41(14,"app-input-mac-address",8)(15,"val-errors",9),e.DNE(16,Jr,2,3,"ng-template",10)(17,Hr,2,3,"ng-template",11),e.k0s()(),e.bVm()),2&i&&(e.Y8G("formGroup",o.formGroup),e.R7$(2),e.SpI(" ",e.bMT(3,6,"_i18n.SelectDectConfigureGuide")," "),e.R7$(2),e.Y8G("innerHTML",e.i5U(8,15,"_i18n.OnMultiAccountProvisioning",e.eq3(18,Lr,e.i5U(7,12,e.bMT(5,8,"_i18n.IPPhonesUri"),e.bMT(6,10,"_i18n.ReadOurGuide")))),e.npT),e.R7$(6),e.Y8G("items",o.templates)("clearable",!1),e.R7$(4),e.Y8G("hideAsterisk",!0))},dependencies:[a.X1,a.BC,a.cb,a.j4,a.JD,me.z,ee.vr,ee.bh,A.IH,A.VI,Wr.p,P.D9,Ze.n,Xr.F],encapsulation:2,changeDetection:0})}return n})();var qr=l(11944);
1function zr(n,s){if(1&n&&(e.j41(0,"field-select",2),e.nrm(1,"val-errors",5),e.k0s()),2&n){const t=e.XpG().$implicit,i=e.XpG();e.Y8G("hideAsterisk",!0)("label",i.labels[t])("options",i.selectOptions[t])("formControlName",t),e.R7$(),e.Y8G("controlName",t)}}function Kr(n,s){if(1&n&&(e.j41(0,"field-input-number",3),e.nrm(1,"val-errors",5),e.k0s()),2&n){const t=e.XpG().$implicit,i=e.XpG();e.Y8G("min",(null==i.ranges[t]?null:i.ranges[t].min)??void 0)("max",(null==i.ranges[t]?null:i.ranges[t].max)??void 0)("label",i.labels[t])("formControlName",t),e.R7$(),e.Y8G("controlName",t)}}function Zr(n,s){if(1&n&&(e.j41(0,"field-input",4),e.nrm(1,"val-errors",5),e.k0s()),2&n){const t=e.XpG().$implicit,i=e.XpG();e.Y8G("label",i.labels[t])("formControlName",t),e.R7$(),e.Y8G("controlName",t)}}function es(n,s){if(1&n&&(e.j41(0,"div",1),e.nVh(1,zr,2,5,"field-select",2)(2,Kr,2,5,"field-input-number",3)(3,Zr,2,3,"field-input",4),e.k0s()),2&n){let t;const i=s.$implicit,o=e.XpG();e.BMQ("data-qa","fxs-var-"+i),e.R7$(),e.vxM("select"===(t=o.fieldTypes[i])?1:"number"===t?2:3)}}const ts={email:[b.Bj],ip_address:[b.Ct],mac_address:[b.YG],port:[a.k0.min(0),a.k0.max(65535)],subnet_mask:[a.k0.pattern(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)]};let Tn=(()=>{class n extends Ye.z{variables;form=new a.gE({});selectOptions;labels;ranges;fieldTypes;get fieldNames(){return Object.keys(this.form.controls)}setDisabledState(t){super.setDisabledState(t),(0,C.TZ)(this.form,!t)}writeValue(t){super.writeValue(t),this.form.setValue(this.value,{emitEvent:!1})}parse(t){return(this.variables||[]).reduce((i,o)=>{const d=t?.find(c=>c.Name===o.Name)?.Value||o.Choices?.[0]?.Name||"";return Object.assign(i,{[o.Name]:d})},{})}format(t){return(this.variables||[]).map(i=>({Name:i.Name,Value:String(t[i.Name]??"")}))}ngOnInit(){this.setupForm(),this.form.valueChanges.pipe((0,O.pQ)(this.destroyRef)).subscribe(t=>{this.valueChanged(t)}),this.syncControlState(this.form)}validate=this.createComponentValidator(this.form);setupForm(){this.selectOptions={},this.labels={},this.fieldTypes={},this.ranges={},this.variables?.forEach(t=>{const i=t.Name;if(!i)return;let o;const d=[a.k0.required,...ts[t.ValidationType??""]??[]];t.Choices?.length?(this.fieldTypes[i]="select",this.selectOptions[i]=t.Choices.map(c=>({value:c.Name,label:c.DisplayName})),o=new a.MJ(this.selectOptions[i][0].value,d)):"port"===t.ValidationType?(this.fieldTypes[i]="number",this.ranges[i]={min:0,max:65535},o=new a.MJ(null,d)):(this.fieldTypes[i]="text",o=new a.MJ("",d)),this.labels[i]=t.Title,this.form.addControl(i,o,{emitEvent:!1})})}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-fxs-template-variables"]],inputs:{variables:"variables"},features:[e.Jv_([{provide:a.kq,multi:!0,useExisting:n},{provide:a.cz,multi:!0,useExisting:n}]),e.Vt3],decls:3,vars:1,consts:[[3,"formGroup"],[1,"mb-3"],[1,"mb-0",3,"hideAsterisk","label","options","formControlName"],[1,"mb-0",3,"min","max","label","formControlName"],[1,"mb-0",3,"label","formControlName"],[3,"controlName"]],template:function(i,o){1&i&&(e.qex(0,0),e.Z7z(1,es,4,2,"div",1,e.fX1),e.bVm()),2&i&&(e.Y8G("formGroup",o.form),e.R7$(),e.Dyx(o.fieldNames))},dependencies:[a.X1,a.BC,a.cb,a.j4,a.JD,fe.q,A.IH,he.B,Q.m],encapsulation:2,changeDetection:0})}return n})();var ns=l(13652),is=l(61851);function os(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.FxsLineUserNotFound"))}function as(n,s){if(1&n&&(e.j41(0,"li"),e.nrm(1,"app-dn-select",2),e.j41(2,"val-errors",3),e.DNE(3,os,2,3,"ng-template",4),e.k0s()()),2&n){const t=s.$implicit,i=e.XpG();e.R7$(),e.Y8G("formControl",t)("searchDnTypes",i.searchDnTypes)("clearable",!0)("peerFilter",i.peerFilter),e.R7$(),e.Y8G("control",t)}}function rs(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",5),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.addNewField())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&n&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"_i18n.AddMoreLines")," "))}let kn=(()=>{class n{usersFormArray;numberOfExtensions;allowFaxExtensions;
1get searchDnTypes(){return this.allowFaxExtensions?[q.J.Extension,q.J.Fax]:[q.J.Extension]}get peerFilter(){return this.allowFaxExtensions?`not Tags/any(t: t eq '${ns.I.FaxServer}')`:void 0}get isLimitReached(){return this.usersFormArray.controls.length>=this.numberOfExtensions}addNewField(){this.usersFormArray.push(new a.MJ(null))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-select-users"]],inputs:{usersFormArray:"usersFormArray",numberOfExtensions:"numberOfExtensions",allowFaxExtensions:"allowFaxExtensions"},decls:4,vars:1,consts:[[1,"dect-users"],["data-qa","add-new","type","button",1,"btn","btn-border"],["data-qa","dect-user",3,"formControl","searchDnTypes","clearable","peerFilter"],[3,"control"],["valError","notFound"],["data-qa","add-new","type","button",1,"btn","btn-border",3,"click"]],template:function(i,o){1&i&&(e.j41(0,"ol",0),e.Z7z(1,as,4,5,"li",null,e.fX1),e.k0s(),e.nVh(3,rs,3,3,"button",1)),2&i&&(e.R7$(),e.Dyx(o.usersFormArray.controls),e.R7$(2),e.vxM(o.isLimitReached?-1:3))},dependencies:[is.A,a.X1,a.BC,a.l_,A.IH,A.VI,P.D9],styles:["ol.dect-users[_ngcontent-%COMP%]{list-style-type:none;padding-left:0}ol.dect-users[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{counter-increment:step-counter;margin-bottom:16px;display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:8px}ol.dect-users[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:before{content:counter(step-counter);font-weight:700;text-align:left;width:22px}ol.dect-users[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   val-errors[_ngcontent-%COMP%]{grid-column:1/-1}"]})}return n})();const ss=n=>({device:n}),ls=n=>({data:n});function ds(n,s){if(1&n&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,"_i18n.DectFxsRpsRebootInstructions",e.eq3(4,ss,t.isFxs?"FXS":"DECT"))," ")}}function cs(n,s){if(1&n&&(e.j41(0,"li",3),e.nrm(1,"span",5),e.nI1(2,"trunkGuideLink"),e.nI1(3,"async"),e.nI1(4,"translate"),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("innerHTML",e.i5U(4,6,t.isFxs?"_i18n.SeeFXSConfigGuide":"_i18n.SeeDectConfigGuide",e.eq3(9,ls,e.bMT(3,4,e.i5U(2,1,s,"link_to_phone_doc")))),e.npT)}}function us(n,s){if(1&n&&(e.j41(0,"li"),e.nrm(1,"app-copy-url",6),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("label",t.isFxs?"_i18n.DownloadAndSaveConifguration":"_i18n.SpecifyUrlProvisioningTitle")("url",s)("showActionText",!0)}}function ps(n,s){if(1&n&&(e.j41(0,"div")(1,"p",0),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"ol",1)(5,"li",2),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.nVh(8,cs,5,11,"li",3),e.nVh(9,us,2,3,"li"),e.j41(10,"li",4),e.EFF(11),e.nI1(12,"translate"),e.k0s()()()),2&n){let t,i;const o=e.XpG();e.R7$(2),e.JRh(e.bMT(3,5,o.isFxs?"_i18n.FinalFXSInstruction":"_i18n.FinalDectInstruction")),e.R7$(4),e.SpI(" ",e.bMT(7,7,o.isFxs?"_i18n.LoginFXS":"_i18n.LoginDect")," "),e.R7$(2),e.vxM((t=o.createdFxs.ModelName)?8:-1,t),e.R7$(),e.vxM((i=null==o.createdFxs.Provisioning?null:o.createdFxs.Provisioning.ProvLink)?9:-1,i),e.R7$(2),e.SpI(" ",e.bMT(12,9,o.isFxs?"_i18n.SaveAndRebootFXS":"_i18n.SaveAndReboot")," ")}}let ms=(()=>{class n{createdFxs;type;rpsEnabled;get isFxs(){return"Fxs"===this.type}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-dect-wizard-final-step"]],inputs:{createdFxs:"createdFxs",type:"type",rpsEnabled:"rpsEnabled"},decls:2,vars:1,consts:[["data-qa","final-instruction"],[1,"circle-numbers","primary"],["data-qa","login-step"],["data-qa","dect-configuration-guide"],["data-qa","save-and-reboot-step"],[3,"innerHTML"],["data-qa","prov-link",1,"mb-0",3,"label","url","showActionText"]],template:function(i,o){1&i&&e.nVh(0,ds,3,6,"div")(1,ps,13,11,"div"),2&i&&e.vxM(o.rpsEnabled?0:1)},dependencies:[ht.c,V.Jj,P.D9,Ie],encapsulation:2,changeDetection:0})}return n})();function hs(n,s){if(1&n&&e.nrm(0,"app-dect-wizard-select-phone",1),2&n){const t=e.XpG();e.Y8G("formGroup",t.form)("templates",t.templates)("showValidation",t.showValidation)}}function bs(n,s){if(1&n&&e.nrm(0,"app-phone-connection",2),2&n){const t=e.XpG();e.Y8G("formControl",t.f.phoneConnection)("connectOptions",t.connectOptions)("networkInterfaces",t.networkInterfaces)("sbcs",t.sbcs)}}function fs(n,s){if(1&n&&e.nrm(0,"app-fxs-template-variables",3),2&n){const t=e.XpG();e.Y8G("formControl",t.f.variables)("variables",t.phoneModel.variables)}}function gs(n,s){if(1&n&&e.nrm(0,"app-select-users",4),2&n){const t=e.XpG();e.Y8G("usersFormArray",t.f.users)("numberOfExtensions",t.availableNumberOfExtension)("allowFaxExtensions","Fxs"===t.deviceType)}}function _s(n,s){if(1&n&&e.nrm(0,"app-dect-wizard-final-step",5),2&n){const t=e.XpG();e.Y8G("type",t.deviceType)("createdFxs",t.createdFxs)("rpsEnabled",t.rpsRequired)}}let Cs=(()=>{class n extends ne.m{destroy=(0,r.WQX)(r.abz);cd=(0,r.WQX)(f.gRc);groupsService=(0,r.WQX)(Ke.G);fxsService=(0,r.WQX)(Me.V);tokenInfoService=(0,r.WQX)(Ee.Z);xapiErrorService=(0,r.WQX)(et.Ko);fb=(0,r.WQX)(a.Qk);dectTemplates;networkInterfaces=[];sbcs;onlyRemoteProv;isMultiCompanyMode;isHosted3CX;rpsEnabled;allowFxs=!0;dectWizardStates;connectOptions=[];isLoading=!1;state;templates;createdFxs;form=new a.gE({phoneModel:new a.MJ(null,[a.k0.required,this.validatePhoneModel()]),macAddress:new a.MJ("",{nonNullable:!0,validators:a.k0.required}),phoneConnection:new a.MJ({sbcName:"",connectionType:we.Xt.Local,networkInterface:""},{nonNullable:!0}),variables:new a.MJ([],{nonNullable:!0}),users:this.fb.array([])});ngOnInit(){this.dectWizardStates=(n=>[{type:"selectPhone",header:n?"_i18n.ConfigureYourDectOrFxs":"_i18n.ConfigureYourDect"},{type:"addPhone",header:s=>"Fxs"===s?"_i18n.ConfigureYourFxs":"_i18n.ConfigureYourDect"},...n?[{type:"variables",header:s=>"Fxs"===s?"_i18n.ConfigureYourFxs":"_i18n.ConfigureYourDect"}]:[],{type:"users",header:"_i18n.ConfigureDectUsersHeader"},{type:"final",header:s=>"Fxs"===s?"_i18n.FxsAddFinalStepHeader":"_i18n.DectAddFinalStepHeader"}])(this.allowFxs),this.templates=function jr(n){const s=n.reduce((t,i)=>
1{const o=i.IsCustom?"Custom":i.TemplateType??Cn.V.Unknown;if(o!==Cn.V.Deleted&&i.Models){const d=t[o]||[],c=i.Id;for(const v of i.Models)d.push({model:v.UserAgent,displayName:v.DisplayName,allowedNetConfigs:i.AllowedNetConfigs,numberOfExtensions:i.NumberOfExtensions,brand:i.Brand,variables:i.Variables,languages:i.Languages,timezones:i.TimeZones,url:i.URL,templateType:o,templateName:c,deviceType:i.DeviceType,rpsEnabled:i.RpsEnabled});return t[o]=d,t}return t},{});return Object.keys(s).forEach(t=>{s[t].sort((i,o)=>i.displayName.localeCompare(o.displayName))}),Object.values(s).flat()}(this.dectTemplates),this.f.phoneModel.valueChanges.pipe((0,O.pQ)(this.destroy)).subscribe(t=>{t&&this.f.phoneModel.enabled&&this.onPhoneModelChange(t)}),this.f.phoneModel.setValue(this.templates[0]),this.setState(this.dectWizardStates[0])}onPhoneModelChange(t){const i=this.sbcs.length>0&&t.allowedNetConfigs.includes("SBC"),d=!this.onlyRemoteProv&&t.allowedNetConfigs.includes("LOCALLAN")&&!(this.isMultiCompanyMode&&this.isHosted3CX),c=t.variables.map(v=>({Name:v.Name,Value:v.Choices?.[0]?.Name||""}));this.connectOptions=[{label:"_i18n.ConnectViaSBC",value:we.Xt.ViaSBC,disabled:!i},{label:"_i18n.ConnectSelfDECT",value:we.Xt.Self,disabled:!0},{label:"_i18n.ConnectLocal",value:we.Xt.Local,disabled:!d}],this.form.patchValue({phoneConnection:{sbcName:i&&this.sbcs[0]?.Name||"",networkInterface:d&&this.networkInterfaces[0]||"",connectionType:this.connectOptions.find(v=>!v.disabled)?.value??null},variables:c}),this.resetUsers(Math.min(t.numberOfExtensions,10)),this.cd.markForCheck()}resetUsers(t){this.f.users.clear({emitEvent:!1});for(let i=0;i<t;i++)this.f.users.push(new a.MJ(null),{emitEvent:!1})}validatePhoneModel(){return t=>this.onlyRemoteProv&&0===this.sbcs.length?{sbcRequired:!0}:null}get rpsRequired(){return this.rpsEnabled&&this.phoneModel?.rpsEnabled}get isSubmittingStep(){return"users"===this.state.type}get nextText(){return this.isSubmittingStep?"Fxs"===this.deviceType?"_i18n.AddFxsModalConfirmation":"_i18n.AddDectModalConfirmation":"_i18n.Next"}get phoneModel(){return this.f.phoneModel.value}get availableNumberOfExtension(){return this.phoneModel?.numberOfExtensions??0}setStep(t){this.setState(this.dectWizardStates.find(i=>i.type===t))}setState(t){this.state=t,this.buttons=this.state===this.dectWizardStates[0]?B.P.Next:this.state===this.dectWizardStates[this.dectWizardStates.length-1]?B.P.Ok:B.P.BackNext,this.cd.markForCheck()}get deviceType(){return this.phoneModel?.deviceType}get header(){return"string"==typeof this.state.header?this.state.header:this.state.header(this.deviceType)}isStepValid(t){switch(t){case"selectPhone":return this.f.phoneModel.valid&&this.f.macAddress.valid;case"addPhone":return this.f.phoneConnection.valid;case"variables":return this.f.variables.valid;case"users":return this.form.valid;default:return!0}}finalizeAddDect(){this.cd.markForCheck(),this.isLoading=!1}onError(t){this.finalizeAddDect(),this.xapiErrorService.error(this.cd,t,this.form,!0,!0,i=>i.replace(/^FxsLines/,"users")),this.switchToErrorState()}switchToErrorState(){this.f.macAddress.invalid&&this.setStep("selectPhone")}isStepSkipped(t){switch(t){case"addPhone":return(0,vn.h)(this.phoneModel);case"variables":return!this.allowFxs||!this.phoneModel?.variables.length;default:return!1}}changeStep(t){if(1===t&&!this.isStepValid(this.state.type))return this.form.markAllAsTouched(),this.cd.markForCheck(),void(this.showValidation=!0);this.showValidation=!1;let o,i=this.dectWizardStates.indexOf(this.state);do{if(i+=t,o=this.dectWizardStates[i],!o)return void console.error(`Dect wizard invalid state: can not go from ${this.state.type} in direction ${t}, state on index ${i} is empty.`)}while(this.isStepSkipped(o.type));1===t&&this.isSubmittingStep?this.addDect():this.setState(o)}addDect(){if(this.isLoading)return;this.isLoading=!0,this.cd.markForCheck();const{value:t}=this.form,{phoneConnection:i,macAddress:o,users:d}=t,c=t.phoneModel,v=bn(d),M=(0,vn.h)(c)?Nt.Y.RemoteExt:i.connectionType===we.Xt.ViaSBC?Nt.Y.Sbc:Nt.Y.LocalLan;fn(this.tokenInfoService,this.groupsService).pipe((0,R.n)(E=>this.fxsService.createFxs({pbxFxs:{Group:E,Brand:c.brand,Model:c.model,MacAddress:o.toUpperCase(),Variables:t.variables,FxsLines:v,Language:c.languages[0]??null,Provisioning:{LocalInterface:i.networkInterface,Method:M,SbcName:i.sbcName}}}))).subscribe({next:E=>{this.finalizeAddDect(),this.createdFxs=E,this.onSubmit(),this.setStep("final")},error:E=>{this.onError(E)}})}get f(){return this.form.controls}getPayload(){return!!this.createdFxs||void 0}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-dect-wizard-dialog"]],inputs:{dectTemplates:"dectTemplates",networkInterfaces:"networkInterfaces",sbcs:"sbcs",onlyRemoteProv:"onlyRemoteProv",isMultiCompanyMode:"isMultiCompanyMode",isHosted3CX:"isHosted3CX",rpsEnabled:"rpsEnabled"},features:[e.Vt3],decls:7,vars:7,consts:[["okText","_i18n.Close",3,"backCl
1icked","nextClicked","submitted","header","buttons","nextText","disableSubmitOnEnter","showValidation"],[3,"formGroup","templates","showValidation"],[3,"formControl","connectOptions","networkInterfaces","sbcs"],[3,"formControl","variables"],[3,"usersFormArray","numberOfExtensions","allowFaxExtensions"],[3,"type","createdFxs","rpsEnabled"],[3,"show"]],template:function(i,o){if(1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("backClicked",function(){return o.changeStep(-1)})("nextClicked",function(){return o.changeStep(1)})("submitted",function(){return o.onSubmit()}),e.nVh(1,hs,1,3,"app-dect-wizard-select-phone",1)(2,bs,1,4,"app-phone-connection",2)(3,fs,1,2,"app-fxs-template-variables",3)(4,gs,1,3,"app-select-users",4)(5,_s,1,3,"app-dect-wizard-final-step",5),e.nrm(6,"ngx-loading",6),e.k0s()),2&i){let d;e.Y8G("header",o.header)("buttons",o.buttons)("nextText",o.nextText)("disableSubmitOnEnter",!0)("showValidation",o.showValidation),e.R7$(),e.vxM("selectPhone"===(d=o.state.type)?1:"addPhone"===d?2:"variables"===d?3:"users"===d?4:"final"===d?5:-1),e.R7$(5),e.Y8G("show",o.isLoading)}},dependencies:[ie.p,Qr,a.X1,a.BC,a.cb,a.l_,a.j4,qr.g,Tn,kn,ms,xe.kq,xe.bt],encapsulation:2,changeDetection:0})}return n})(),Rn=(()=>{class n{sbc=(0,r.WQX)(_e.N);modalService=(0,r.WQX)(j.B);defsApiService=(0,r.WQX)(kt.G);networkIntefacesService=(0,r.WQX)(Or.U);fxsTemplateService=(0,r.WQX)(Vr.Q);addDect(t){return(0,ze.p)([this.networkIntefacesService.listNetworkInterface({}),this.sbc.listSbc({$select:["Name","DisplayName"],$orderby:["DisplayName"]}),this.fxsTemplateService.listFxsTemplate({$select:["Id","Brand","Models","NumberOfExtensions","AllowedNetConfigs","TemplateType","Variables","Languages","TimeZones","URL","IsCustom","DeviceType","RpsEnabled"],...t?{}:{$filter:"DeviceType eq 'Dect'"},$orderby:["IsCustom, TemplateType"]}),this.defsApiService.getSystemParameters()]).pipe((0,D.Tg)(this.modalService),(0,R.n)(([i,o,d,c])=>this.addDectModal({sbcs:o.value,networkInterfaces:i.value?.map(v=>v.Id)??[],dectTemplates:d.value,isMultiCompanyMode:!!c.IsMulticompanyMode,isHosted3CX:!!c.IsHosted3CX,rpsEnabled:!!c.RpsEnabled})))}addDectModal(t){return this.modalService.showComponent(Cs,{keyboard:!1,ignoreBackdropClick:!0,initialState:t}).pipe((0,D.Sf)())}static \u0275fac=function(i){return new(i||n)};static \u0275prov=r.jDH({token:n,factory:n.\u0275fac})}return n})();var In=l(83188),St=l(68580),vs=l(534),Ts=l(81789),ks=l(44051),Mt=l(81004);const Rs=()=>["bridge/master/new"],Is=()=>["bridge/slave/new"],ys=(n,s)=>({record:n,params:s});function Ns(n,s){if(1&n){const t=e.RV6();e.j41(0,"app-button-add",21),e.bIt("click",function(o){r.eBV(t);const d=e.XpG();return r.Njj(d.routeToForPSTNGateway(o))}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("disabled",!t.isTrunkAllowed())}}function Ss(n,s){if(1&n){const t=e.RV6();e.j41(0,"ul",22)(1,"li",23),e.nI1(2,"translate"),e.j41(3,"button",24),e.bIt("click",function(o){r.eBV(t);const d=e.XpG();return r.Njj(d.routeToForWhatsApp(o))}),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"li",23),e.nI1(7,"translate"),e.j41(8,"button",25),e.bIt("click",function(o){r.eBV(t);const d=e.XpG();return r.Njj(d.routeToForFacebookApp(o))}),e.EFF(9),e.nI1(10,"translate"),e.k0s()(),e.j41(11,"li",23),e.nI1(12,"translate"),e.j41(13,"button",26),e.EFF(14),e.nI1(15,"translate"),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(),e.AVh("disabled",!t.isTrunkAllowed()),e.Y8G("tooltip",t.isTrunkAllowed()?"":e.bMT(2,18,"_i18n.MaxAmountOfTrunksReached"))("adaptivePosition",!1),e.R7$(2),e.Y8G("disabled",!t.isTrunkAllowed()),e.R7$(),e.SpI(" ",e.bMT(5,20,"_i18n.AddWhatsApp")," "),e.R7$(2),e.AVh("disabled",!t.isTrunkAllowed()),e.Y8G("tooltip",t.isTrunkAllowed()?"":e.bMT(7,22,"_i18n.MaxAmountOfTrunksReached"))("adaptivePosition",!1),e.R7$(2),e.Y8G("disabled",!t.isTrunkAllowed()),e.R7$(),e.SpI(" ",e.bMT(10,24,"_i18n.AddFacebook")," "),e.R7$(2),e.AVh("disabled",!t.isLiveChatAllowed()),e.Y8G("tooltip",t.isLiveChatAllowed()?"":e.bMT(12,26,"_i18n.MaxLiveChatsReached"))("adaptivePosition",!1),e.R7$(2),e.Y8G("disabled",!t.isLiveChatAllowed()),e.R7$(),e.SpI(" ",e.bMT(15,28,"_i18n.AddLiveChat")," ")}}function Ms(n,s){1&n&&(e.j41(0,"ul",30)(1,"li",31)(2,"a",32),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"li",31)(6,"a",33),e.EFF(7),e.nI1(8,"translate"),e.k0s()()()),2&n&&(e.R7$(2),e.Y8G("routerLink",e.lJ4(8,Rs)),e.R7$(),e.JRh(e.bMT(4,4,"_i18n.BridgeMaster")),e.R7$(3),e.Y8G("routerLink",e.lJ4(9,Is)),e.R7$(),e.JRh(e.bMT(8,6,"_i18n.BridgeSlave")))}function Es(n,s){1&n&&(e.j41(0,"div",8)(1,"button",27),e.nrm(2,"span",28),e.j41(3,"span"),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.DNE(6,Ms,9,10,"ul",29),e.k0s()),2&n&&(e.R7$(4),e.JRh(e.bMT(5,1,"_i18n.AddBridge")))}function Ps(n,s){1&n&&(e.nrm(0,"i",36),e.nI1(1,"translate")),2&n&&e.Y8G("tooltip",e.bMT(1,1,"_i18n.TrunkConfigurationIssue"))}function xs(n,s){1&n&&(e.j41(0,"app-copy-url",47),e.bIt("click",function(i){return i.stopPropagation()}),e.k0s()),2&n&&e.Y8G("url",s)}function ws(n,s){1&n&&(e.j41(0,"div",40),e.EFF(1),e.k0s()),2&n&&(e.R7$(),e.JRh(s))}function Fs(n,s){1&n&&e.eu8(0)}function Gs(n,s){if(1&n){const t=e.RV6();e.j41(0,"tr",34),e.bIt("click",function(){const o=r.eBV(t).$implicit,d=e.XpG();
1return r.Njj(d.edit(o.edit))}),e.j41(1,"td",35),e.nVh(2,Ps,2,3,"i",36),e.nrm(3,"app-indicator-name-type",37),e.nI1(4,"translate"),e.nI1(5,"translate"),e.k0s(),e.j41(6,"td",38),e.nVh(7,xs,1,1,"app-copy-url",39)(8,ws,2,1,"div",40),e.k0s(),e.j41(9,"td",41)(10,"span",40),e.EFF(11),e.k0s()(),e.j41(12,"td",42)(13,"span",40),e.EFF(14),e.k0s()(),e.j41(15,"td",43),e.nrm(16,"app-route-dest",44),e.k0s(),e.j41(17,"td",45),e.DNE(18,Fs,1,0,"ng-container",46),e.k0s()()}if(2&n){let t;const i=s.$implicit,o=e.XpG();e.AVh("clickable",i.edit),e.BMQ("data-qa",i.type),e.R7$(2),e.vxM(i.configurationIssue?2:-1),e.R7$(),e.Y8G("indicator",i.configurationIssue?null:i.isOnline?"available":"out_of_office")("name",i.name)("type",e.bMT(4,14,o.recordType(i.type)))("title",e.bMT(5,16,i.isOnline?"_i18n.ExtensionIsRegistered":"_i18n.ExtensionIsNotRegistered")),e.R7$(4),e.vxM((t=i.link)?7:(t=i.text)?8:-1,t),e.R7$(4),e.JRh(i.groups),e.R7$(3),e.JRh(i.did),e.R7$(2),e.Y8G("dest",i.destination),e.R7$(2),e.Y8G("ngComponentOutlet",i.component)("ngComponentOutletInputs",e.l_i(18,ys,i,o.params))}}let As=(()=>{class n{modalService=(0,r.WQX)(j.B);route=(0,r.WQX)(m.nX);listControl=(0,r.WQX)(Z.b);cd=(0,r.WQX)(f.gRc);tokenInfoService=(0,r.WQX)(Ee.Z);router=(0,r.WQX)(m.Ix);addDectService=(0,r.WQX)(Rn);trunkViaApiSvc=(0,r.WQX)(cn);currentPage=1;itemsPerPage=de.z9;items=[];displayedItems=[];sub=new w.yU;restr;params;search=new a.MJ("");get isAdmin(){return this.params.isAdmin}voiceAndChatTypeFilter$=new Ut.t(null);voiceAndChatTypeFilterOptions=[{value:null,label:"_i18n.All"},{value:W.Trunk,label:"_i18n.Trunk"},{value:W.Gateway,label:"_i18n.Gateway"},{value:W.Messaging,label:"_i18n.MessagingFilter"},{value:W.Bridge,label:"_i18n.BridgeFilter"},{value:W.SBC,label:"_i18n.SBCFilter"},{value:W.DectFxs,label:"_i18n.DectFxsFilter"}];constructor(){const t=this.route,i=(0,r.WQX)(Tt.LT),o=(0,r.WQX)(mn),d=(0,r.WQX)(P.c$);this.params=t.snapshot.data.params,this.updateItems([t.snapshot.data.websiteAndTrunk,t.snapshot.data.restrictions]),this.sub.add((0,_t.h)(this.listControl.refresh$,this.voiceAndChatTypeFilter$.pipe((0,$r.i)(1),(0,gt.F)())).pipe((0,R.n)(()=>(0,te.z)([o.getRecords$(this.voiceAndChatTypeFilter$.value),i.restrictions$]))).subscribe({next:c=>{this.updateItems(c)},error:c=>this.modalService.error(c)})),this.sub.add(this.search.valueChanges.subscribe(c=>{this.currentPage=1,this.setDiplayedItems(),this.cd.markForCheck()})),this.sub.add(d.stream("_i18n.3CXLiveChat").pipe((0,_n.s)(1)).subscribe(c=>{this.liveChatName=c}))}liveChatName;setDiplayedItems(){const t=this.search.value?.toLowerCase();this.displayedItems=this.items.filter(i=>!t||("WebLinks"===i.type?this.liveChatName:i.name)?.toLowerCase().includes(t)||i.text?.toLowerCase().includes(t)||i.link?.toLowerCase().includes(t)||i.did?.toLowerCase().includes(t)||i.destination?.description?.toLowerCase().includes(t)||i.groups.toLowerCase().includes(t))}routeToForWhatsApp(t){t.stopPropagation(),this.router.navigate(["trunk","new",h.AC.providerId],{relativeTo:this.route}).catch(re.l)}routeToForFacebookApp(t){t.stopPropagation(),this.router.navigate(["trunk","new",h.G6.providerId],{relativeTo:this.route}).catch(re.l)}addTrunk(t){t.stopPropagation(),this.trunkViaApiSvc.selectTrunkTemplate().pipe((0,R.n)(i=>i.decision!==B.R.Ok?ge.w:"twilioauto.pv.xml"===i.payload?this.trunkViaApiSvc.setupTwilioAuto(this.params,(0,Mt.a)(this.route)):(0,Y.of)(i))).subscribe({next:i=>{i.decision===B.R.Ok&&i.payload&&(Array.isArray(i.payload)?this.navigateToNewOutboundRule(i.payload[0],i.payload[1]).catch(re.l):this.router.navigate(["trunk","new",i.payload],{relativeTo:this.route}).catch(re.l))},error:i=>this.modalService.error(i)})}navigateToNewOutboundRule(t,i){return this.router.navigate(["office","outbound-rules","new"],{state:{rule:{Name:"Outbound rule for "+t.Gateway.Name,...i?{GroupIds:[i]}:{},Routes:[{Trunk:t,TrunkId:t.Id,TrunkName:t.Gateway.Name}]}}})}routeToForPSTNGateway(t){t.stopPropagation(),this.router.navigate(["trunk","new",h.MR.providerId],{relativeTo:this.route}).catch(re.l)}isSbcAllowed(){return(0,Te.AS)(this.restr.Sbcs)}isLiveChatAllowed(){return(0,Te.AS)(this.restr.LiveChats)}isDectAllowed(){return(0,Te.AS)(this.restr.Dects)}isTrunkAllowed(){return(0,Te.AS)(this.restr.Trunks)}isBridgeAllowed(){return this.isAdmin}ngOnDestroy(){this.sub.unsubscribe()}pageChanged(t){this.currentPage=t.page,this.cd.markForCheck()}
1updateItems([t,i]){this.restr=i,this.items=t,this.setDiplayedItems(),this.currentPage=(0,Z.o)(this.currentPage,this.displayedItems.length,this.itemsPerPage),this.cd.markForCheck()}addSbc(){this.modalService.showDialog(Dr).pipe((0,D.Sf)()).subscribe(t=>{this.router.navigate(["sbc",t.Name],{relativeTo:this.route}).catch(re.l)})}addDect(){this.addDectService.addDect(!0).subscribe(()=>{this.listControl.refresh$.next()})}edit(t){t&&this.router.navigate(t,{relativeTo:this.route})}recordType(t){switch(t){case"Sbc":return"3CX SBC";case"BridgeMaster":return"_i18n.BridgeMaster";case"BridgeSlave":return"_i18n.BridgeSlave";case"BridgeSlaveOverTunnel":return"_i18n.BridgeSlaveOverTunnel";case"Dect":return"DECT";case"Fxs":return"FXS";case"Provider":return"_i18n.Trunk";case"Analog":return"_i18n.Gateway";default:return""}}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],features:[e.Jv_([Z.b,Rn])],decls:45,vars:38,consts:[["header","_i18n.NumbersAndMessaging",3,"helpUrl"],["top-bar","",1,"button-group"],["left-section",""],["tooltipWhenDisabled","_i18n.MaxAmountOfTrunksReached","data-qa","add-trunk","text","_i18n.AddTrunk",3,"click","disabled"],["tooltipWhenDisabled","_i18n.MaxAmountOfTrunksReached","data-qa","add-trunk-gateway","text","_i18n.AddPSTNTrunkGateway",3,"disabled"],["container","body","dropdown","",1,"dropdown"],["dropdownToggle","","type","button","data-qa","add-messaging",1,"btn","btn-primary","dropdown-toggle"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["dropdown","",1,"btn-group"],["data-qa","add-sbc","text","_i18n.AddSBC",3,"click","disabled"],["data-qa","add-dect",3,"click","text","disabled"],["right-section","",3,"selectedChange","options","selected"],["top-bar","",3,"formControl"],["full-width","",1,"scrollable-table"],[1,"xl-visible"],[1,"lg-visible","membership"],[1,"xl-visible","col-size-200","w-xl-20"],[1,"actions"],[3,"clickable"],["colspan","6"],[3,"pageChanged","currentPage","itemsPerPage","totalItems","showBoundaryLinks"],["tooltipWhenDisabled","_i18n.MaxAmountOfTrunksReached","data-qa","add-trunk-gateway","text","_i18n.AddPSTNTrunkGateway",3,"click","disabled"],["role","menu",1,"dropdown-menu"],["role","menuitem","container","body",3,"tooltip","adaptivePosition"],["type","button","data-qa","add-whatsapp",1,"dropdown-item",3,"click","disabled"],["type","button","data-qa","add-facebook",1,"dropdown-item",3,"click","disabled"],["type","button","routerLink","messaging/new","data-qa","add-live-chat",1,"dropdown-item",3,"disabled"],["dropdownToggle","","type","button","aria-controls","dropdown-basic","data-qa","add-bridge",1,"btn","btn-primary","dropdown-toggle"],["app-plus-solid-icon",""],["class","dropdown-menu","role","menu","aria-labelledby","button-basic",4,"dropdownMenu"],["role","menu","aria-labelledby","button-basic",1,"dropdown-menu"],["role","menuitem"],["data-qa","add-bridge-master","href","#",1,"dropdown-item",3,"routerLink"],["data-qa","add-slave-master","href","#",1,"dropdown-item",3,"routerLink"],[3,"click"],["data-qa","indicator",1,"d-flex","gap-2","align-items-center"],["app-exclamation-triangle-solid-icon","","placement","right",1,"customSVGIcons","svg-sm","fillIconRed",3,"tooltip"],[3,"indicator","name","type","title"],["data-qa","text",1,"xl-visible"],[1,"mb-0",3,"url"],[1,"line-clamp-1"],["data-qa","groups",1,"lg-visible","membership"],["data-qa","dids",1,"xl-visible"],["data-qa","destination",1,"xl-visible"],[3,"dest"],["data-qa","actions",1,"actions"],[4,"ngComponentOutlet","ngComponentOutletInputs"],[1,"mb-0",3,"click","url"]],template:function(i,o){1&i&&(e.j41(0,"app-page",0)(1,"div",1)(2,"div",2)(3,"app-button-add",3),e.bIt("click",function(c){return o.addTrunk(c)}),e.k0s(),e.nVh(4,Ns,1,1,"app-button-add",4),e.j41(5,"div",5)(6,"button",6),e.nrm(7,"app-plus-solid-icon"),e.j41(8,"span"),e.EFF(9),e.nI1(10,"translate"),e.k0s()(),e.DNE(11,Ss,16,30,"ul",7),e.k0s(),e.nVh(12,Es,7,3,"div",8),e.j41(13,"app-button-add",9),e.bIt("click",function(){return o.addSbc()}),e.k0s(),e.j41(14,"app-button-add",10),e.bIt("click",function(){return o.addDect()}),e.k0s()(),e.j41(15,"app-button-with-dropdown",11),e.nI1(16,"async"),e.bIt("selectedChange",function(c){return o.voiceAndChatTypeFilter$.next(c)}),e.k0s()(),e.nrm(17,"search-bar",12),e.j41(18,"table",13)(19,"thead")(20,"tr")(21,"th"),e.EFF(22),e.nI1(23,"translate"),e.k0s(),e.j41(24,"th",14),e.EFF(25),e.nI1(26,"translate"),e.k0s(),e.j41(27,"th",15),e.EFF(28),e.nI1(29,"translate"),e.k0s(),e.j41(30,"th",16),e.EFF(31),e.nI1(32,"translate"),e.k0s(),e.j41(33,"th",14),e.EFF(34),e.nI1(35,"translate"),e.k0s(),e.nrm(36,"th",17),e.k0s()(),e.j41(37,"tbody"),e.Z7z(38,Gs,19,21,"tr",18,e.Vm6),e.nI1(40,"slice"),e.k0s(),e.j41(41,"tfoot")(42,"tr")(43,"td",19)(44,"app-paging",20),e.bIt("pageChanged",function(c){return o.pageChanged(c)}),e.k0s()()()()()()),2&i&&(e.Y8G("helpUrl","_i18n.TrunkEditorUri"),e.R7$(3),e.Y8G("disabled",!o.isTrunkAllowed()),e.R7$(),e.vxM(o.isAdmin?4:-1),e.R7$(5),e.JRh(e.bMT(10,20,"_i18n.AddMessaging")),e.R7$(3),e.vxM(o.isBridgeAllowed()?12:-1),e.R7$(),e.Y8G("disabled",!o.isSbcAllowed()),e.R7$(),e.Y8G("text","_i18n.AddDectOrFXS")("disabled",!o.isDectAllowed()),e.R7$(),e.Y8G("options",o.voiceAndChatTypeFilterOptions)("selected",e.bMT(16,22,o.voiceAndChatTypeFilter$)),e.R7$(2),e.Y8G("formControl",o.search),e.R7$(5),e.JRh(e.bMT(23,24,"_i18n.Name")),e.R7$(3),e.JRh(e.bMT(26,26,"_i18n.Information")),e.R7$(3),e.JRh(e.bMT(29,28,"_i18n.Department")),e.R7$(3),e.JRh(e.bMT(32,30,"_i18n.DIDSTableTitle")),e.R7$(3),e.JRh(e.bMT(35,32,"_i18n.RouteTo")),e.R7$(4),e.Dyx(e.brH(40,34,o.displayedItems,(o.currentPage-1)*o.itemsPerPage,o.currentPage*o.itemsPerPage)),e.R7$(6),e.Y8G("currentPage",o.currentPage)("itemsPerPage",o.itemsPerPage)("totalItems",o.displayedItems.length)("showBoundaryLinks",!0))},dependencies:[In.H,Qe.j,St.Kk,St.UL,ut.K,St.hs,vs.dg,Ta.Wk,Be.L,a.X1,a.BC,a.l_,de.u4,Ts.b,V.OI,Ve.f,ks.i,Lt.F,ht.c,V.P9,P.D9,V.Jj],encapsulation:2,changeDetection:0})}return n})();var Ds=l(99788);var Os=l(40605);const Vs={sbc:n=>{const s=(0,r.WQX)(_e.N),t=(0,r.WQX)(oe.s);return s.getSbc({name:n.params.id}).pipe((0,U.W)(i=>t.handleError(i)))}};var Nn=l(70299),js=l(28768);let Ws=(()=>{class n{transform(t){if(null==t||""===t)return"";const i=Se().duration(t),o=i.subtract({milliseconds:i.milliseconds()});return o.asDays()<1?o.format("HH:mm:ss"):o.humanize()}static \u0275fac=function(i){return new(i||n)};static \u0275pipe=e.EJ8({name:"appElapsedTime",type:n,pure:!0})}return n})();const Xs=["tabset"];function Ls(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",10),e.bIt("click",function(){r.eBV(t);const o=e.XpG();
1return r.Njj(o.pushConfig())}),e.nrm(1,"app-share-solid-icon",11),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("disabled",!t.canPushConfig),e.R7$(2),e.SpI(" ",e.bMT(3,2,"_i18n.SbcPushConfig")," ")}}function Ys(n,s){if(1&n&&(e.j41(0,"fieldset")(1,"div",12)(2,"field-input",13),e.nrm(3,"val-errors",14),e.k0s(),e.j41(4,"app-group-select",15),e.nrm(5,"val-errors",14),e.k0s()()(),e.j41(6,"fieldset")(7,"legend"),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"div",12),e.nrm(11,"app-input-copy-to-clipboard",16)(12,"app-input-copy-to-clipboard",17),e.k0s()(),e.j41(13,"fieldset")(14,"legend"),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"div",12),e.nrm(18,"app-input-copy-to-clipboard",18)(19,"app-input-copy-to-clipboard",19),e.k0s(),e.j41(20,"div",12),e.nrm(21,"app-input-copy-to-clipboard",20),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.Y8G("formControl",t.f.DisplayName)("maxlength",50),e.R7$(),e.Y8G("control",t.f.DisplayName),e.R7$(),e.Y8G("formControl",t.f.Group)("showChangeWarning",!0)("changeWarningLabel","_i18n.ChangeSbcWarning"),e.R7$(),e.Y8G("control",t.f.Group),e.R7$(3),e.JRh(e.bMT(9,16,"_i18n.ProvisioningInfo")),e.R7$(3),e.Y8G("text",t.sbcDescription.text)("data",t.sbcDescription.link),e.R7$(),e.Y8G("data",t.sbc.Name)("conceal",!0),e.R7$(3),e.JRh(e.bMT(16,18,"_i18n.ConnectionInformation")),e.R7$(3),e.Y8G("data",t.sbc.LocalIPv4),e.R7$(),e.Y8G("data",t.sbc.PublicIP),e.R7$(2),e.Y8G("data",t.sbc.Version)}}function Us(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",21),e.nI1(1,"async")),2&n){const t=e.XpG();e.Y8G("invalid",e.bMT(1,1,t.tabGeneralInvalid$))}}function Js(n,s){1&n&&e.eu8(0)}function Hs(n,s){1&n&&e.nrm(0,"app-tab-heading",22)}function Qs(n,s){1&n&&(e.nrm(0,"span",27),e.j41(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()),2&n&&(e.R7$(2),e.JRh(e.bMT(3,1,"_i18n.Up")))}function qs(n,s){1&n&&(e.nrm(0,"span",28),e.j41(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()),2&n&&(e.R7$(2),e.JRh(e.bMT(3,1,"_i18n.Down")))}function zs(n,s){1&n&&(e.j41(0,"span",31),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"_i18n.Udp")))}function Ks(n,s){1&n&&(e.j41(0,"span",32),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"_i18n.Tcp")))}function Zs(n,s){if(1&n&&(e.j41(0,"tr")(1,"td"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"td",29),e.EFF(5),e.k0s()(),e.j41(6,"tr")(7,"td"),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"td",30),e.nVh(11,zs,3,3,"span",31)(12,Ks,3,3,"span",32),e.k0s()(),e.j41(13,"tr")(14,"td"),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"td",33),e.EFF(18),e.k0s()(),e.j41(19,"tr")(20,"td"),e.EFF(21),e.nI1(22,"translate"),e.k0s(),e.j41(23,"td",34),e.EFF(24),e.k0s()(),e.j41(25,"tr")(26,"td"),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"td",35),e.EFF(30),e.k0s()(),e.j41(31,"tr")(32,"td"),e.EFF(33),e.nI1(34,"translate"),e.k0s(),e.j41(35,"td",36),e.EFF(36),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,12,"_i18n.PhonesOnline")),e.R7$(3),e.JRh(t.RegisteredPhones),e.R7$(3),e.JRh(e.bMT(9,14,"_i18n.RtpTransport")),e.R7$(3),e.vxM(t.UdpActive?11:12),e.R7$(4),e.JRh(e.bMT(16,16,"_i18n.LatencyMs")),e.R7$(3),e.JRh(t.Latency),e.R7$(3),e.JRh(e.bMT(22,18,"_i18n.CpuUsage")),e.R7$(3),e.JRh(t.Cpu&&`${t.Cpu} %`),e.R7$(3),e.JRh(e.bMT(28,20,"_i18n.MemoryUsage")),e.R7$(3),e.JRh(t.Memory&&`${t.Memory} %`),e.R7$(3),e.JRh(e.bMT(34,22,"_i18n.DiskUsage")),e.R7$(3),e.JRh(t.Disk&&`${t.Disk} %`)}}function el(n,s){if(1&n&&(e.j41(0,"table",8)(1,"tbody")(2,"tr")(3,"td"),e.EFF(4,"Status"),e.k0s(),e.j41(5,"td",23)(6,"div",24),e.nVh(7,Qs,4,3)(8,qs,4,3),e.k0s()()(),e.j41(9,"tr")(10,"td",25),e.EFF(11),e.nI1(12,"translate"),e.k0s(),e.j41(13,"td",26),e.EFF(14),e.nI1(15,"appElapsedTime"),e.k0s()(),e.nVh(16,Zs,37,24),e.k0s()()),2&n){const t=s;e.R7$(7),e.vxM(t.Up?7:8),e.R7$(4),e.SpI(" ",e.bMT(12,4,t.Up?"_i18n.Uptime":"_i18n.Downtime")," "),e.R7$(3),e.SpI(" ",e.bMT(15,6,t.ElapsedTime)," "),e.R7$(2),e.vxM(t.Up?16:-1)}}
1function tl(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",45),e.nI1(1,"async")),2&n){const t=e.XpG(2);e.Y8G("invalid",e.bMT(1,1,t.tabSettingsInvalid$))}}function nl(n,s){if(1&n&&(e.j41(0,"tab",9),e.DNE(1,tl,2,3,"ng-template",5),e.j41(2,"fieldset")(3,"legend"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"div",12)(7,"field-select",37),e.nrm(8,"val-errors",38),e.k0s(),e.j41(9,"field-input-number",39),e.nrm(10,"val-errors",38),e.k0s(),e.j41(11,"div",40),e.nrm(12,"field-checkbox",41),e.j41(13,"field-input",42),e.nrm(14,"val-errors",38),e.k0s()()()(),e.j41(15,"fieldset")(16,"legend"),e.EFF(17),e.nI1(18,"translate"),e.k0s(),e.j41(19,"div",12)(20,"field-select",43),e.nrm(21,"val-errors",38),e.k0s(),e.j41(22,"field-select",44),e.nrm(23,"val-errors",38),e.k0s()()()()),2&n){const t=e.XpG();e.R7$(4),e.JRh(e.bMT(5,18,"_i18n.Options")),e.R7$(3),e.Y8G("formControl",t.f.Security)("options",t.securityOptions),e.R7$(),e.Y8G("control",t.f.Security),e.R7$(),e.Y8G("formControl",t.f.AudioPort)("min",1024)("max",65406),e.R7$(),e.Y8G("control",t.f.AudioPort),e.R7$(2),e.Y8G("formControl",t.f.PassiveServerIsEnabled),e.R7$(),e.Y8G("formControl",t.f.PassiveServer),e.R7$(),e.Y8G("control",t.f.PassiveServer),e.R7$(3),e.JRh(e.bMT(18,20,"_i18n.LoggingAndTroubleshooting")),e.R7$(3),e.Y8G("formControl",t.f.LogLevel)("options",t.logLevelOptions),e.R7$(),e.Y8G("control",t.f.LogLevel),e.R7$(),e.Y8G("formControl",t.f.LogSize)("options",t.logSizeOptions),e.R7$(),e.Y8G("control",t.f.LogSize)}}let il=(()=>{class n{destroyRef=(0,r.WQX)(r.abz);router=(0,r.WQX)(m.Ix);route=(0,r.WQX)(m.nX);sbcsApiService=(0,r.WQX)(_e.N);modalService=(0,r.WQX)(j.B);cd=(0,r.WQX)(f.gRc);groups=ke.MQ.groups(this.route);sbc=(()=>this.route.snapshot.data.sbc)();sbcDescription=(0,tt.lZ)(this.sbc);sbcConnection$=(0,_t.h)((0,Y.of)(this.sbc.Connection),(0,Os.Y)(5e3).pipe((0,R.n)(()=>this.sbcsApiService.getSbc({name:this.sbc.Name,$select:["Connection","HasConnection"]}).pipe((0,D.A4)())),(0,Je.M)(t=>{Object.assign(this.sbc,t),this.cd.markForCheck()}),(0,G.T)(t=>t.Connection)));tabset;form=new a.gE({DisplayName:new a.MJ(this.sbc.DisplayName??"",{nonNullable:!0,validators:a.k0.required}),Group:new a.MJ({value:this.sbc.Group&&this.groups.find(t=>t.Number===this.sbc.Group)||null,disabled:this.isUserAssigned}),LogLevel:new a.MJ({value:this.sbc.LogLevel,disabled:!this.isStandaloneSbc}),LogSize:new a.MJ({value:this.sbc.LogSize,disabled:!this.isStandaloneSbc}),Security:new a.MJ({value:this.sbc.Security,disabled:!this.isStandaloneSbc}),AudioPort:new a.MJ({value:this.sbc.AudioPort,disabled:!this.isStandaloneSbc},[a.k0.required,a.k0.min(1024),a.k0.max(65406)]),PassiveServerIsEnabled:new a.MJ({value:this.sbc.PassiveServerIsEnabled,disabled:!this.isStandaloneSbc}),PassiveServer:new a.MJ({value:this.sbc.PassiveServer,disabled:!this.isStandaloneSbc},[a.k0.required,b.sh])});logLevelOptions=[{value:"None",label:"_i18n.LoggingLevelOff"},{value:"Low",label:"_i18n.LoggingLevelLow"},{value:"Medium",label:"_i18n.LoggingLevelMedium"},{value:"Verbose",label:"_i18n.LoggingLevelVerbose"}];logSizeOptions=[{value:100,label:"100 MB"},{value:500,label:"500 MB"},{value:1e3,label:"1 GB"},{value:2e3,label:"2 GB"},{value:4e3,label:"4 GB"}];securityOptions=[{value:"TLS",label:"TLS"},{value:"TCP",label:"TCP"}];ngOnInit(){(0,C.XP)(this.f.PassiveServerIsEnabled).pipe((0,O.pQ)(this.destroyRef)).subscribe(t=>{(0,C.TZ)(this.f.PassiveServer,t&&this.isStandaloneSbc,!0)})}get tabGeneralInvalid$(){return(0,$.S)([this.f.DisplayName,this.f.Group])}get tabSettingsInvalid$(){return(0,$.S)([this.f.LogLevel,this.f.LogSize,this.f.Security,this.f.AudioPort,this.f.PassiveServer])}tabConnectionInvalid$=(0,Y.of)(!1);get isStandaloneSbc(){return!this.sbc.PhoneMAC}get isUserAssigned(){return null!=this.sbc.PhoneUserId}get f(){return this.form.controls}save$=()=>{const{Group:t,...i}=this.form.value;return this.sbcsApiService.updateSbc({name:this.sbc.Name,pbxSbc:{...i,Group:null===t?"":t?.Number}}).pipe((0,D.Pr)("_i18n.VoiceAndChatNotFoundErrorMessage",i.DisplayName))};
1navigateBack(){this.router.navigate(["office","voice-and-chat"])}get canPushConfig(){return this.isStandaloneSbc&&this.sbc.HasConnection&&this.form.pristine}pushConfig(){this.canPushConfig&&this.modalService.confirmation("_i18n.SbcPushConfigConfirmation").pipe((0,R.n)(()=>this.sbcsApiService.pushConfig({name:this.sbc.Name})),(0,D.Pr)("_i18n.SBCNotFoundConfigErrorMessage",this.f.DisplayName.value),(0,D.Tg)(this.modalService),(0,Je.M)(()=>this.navigateBack())).subscribe()}onValidation(){this.tabset&&(0,$.q)(this.tabset,[this.tabGeneralInvalid$,this.tabConnectionInvalid$,this.tabSettingsInvalid$])}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],viewQuery:function(i,o){if(1&i&&e.GBs(Xs,5),2&i){let d;e.mGM(d=e.lsd())&&(o.tabset=d.first)}},decls:14,vars:8,consts:[["general",""],["tabset",""],["header","_i18n.SBC","helpUrl","_i18n.TrunkEditorUri",3,"back","showValidation","formGroup","save$"],["buttons","","type","button","data-qa","push-config",1,"btn","btn-primary","ms-2",3,"disabled"],["id","general"],["tabHeading",""],[4,"ngTemplateOutlet"],["id","statistics"],[1,"scrollable-table"],["id","settings"],["buttons","","type","button","data-qa","push-config",1,"btn","btn-primary","ms-2",3,"click","disabled"],[1,"customSVGIcons","svg-xs"],[1,"row"],["data-qa","display-name","label","_i18n.Name","autocomplete","new-name",1,"col-lg-6",3,"formControl","maxlength"],["label","_i18n.Name",3,"control"],["data-qa","group","label","_i18n.LimitTo",1,"col-lg-6",3,"formControl","showChangeWarning","changeWarningLabel"],["label","_i18n.PrefProvisioningUrl",1,"col-lg-6",3,"text","data"],["label","_i18n.AuthenticationKeyId",1,"col-lg-6",3,"data","conceal"],["label","_i18n.LocalIP","data-qa","local-ip",1,"col-lg-6",3,"data"],["label","_i18n.PublicIP","data-qa","public-ip",1,"col-lg-6",3,"data"],["label","_i18n.Version","data-qa","version",1,"col-lg-6",3,"data"],["label","_i18n.General","data-qa","general-tab",3,"invalid"],["label","_i18n.Statistics","data-qa","statistics-tab"],["data-qa","status"],[1,"d-flex","gap-1","align-items-center"],["data-qa","elapsed-time-label"],["data-qa","elapsed-time"],["app-arrow-alt-up-solid-icon","",1,"svg-md","fillIconGreen"],["app-arrow-alt-down-solid-icon","",1,"svg-md","fillIconRed"],["data-qa","phones-online"],["data-qa","rtp-transport"],[1,"color-green"],[1,"text-error"],["data-qa","latency"],["data-qa","cpu-usage"],["data-qa","memory-usage"],["data-qa","disk-usage"],["label","_i18n.Security","data-qa","security","hint","_i18n.SbcSecurityHint",1,"col-lg-6",3,"formControl","options"],[3,"control"],["label","_i18n.FirstRtpPort","data-qa","audio-port","hint","_i18n.SbcAudioPortHint",1,"col-lg-6",3,"formControl","min","max"],[1,"col-lg-6","pt-2"],["label","_i18n.EnableFailover","data-qa","passive-server-enabled","hint","_i18n.SbcFailoverDescription",3,"formControl"],["placeholder","_i18n.SbcFailoverPassiveServer","data-qa","passive-server",3,"formControl"],["label","_i18n.LoggingSettings","data-qa","log-level",1,"col-lg-6",3,"formControl","options"],["label","_i18n.LogSize","data-qa","log-size",1,"col-lg-6",3,"formControl","options"],["label","_i18n.Settings","data-qa","settings-tab",3,"invalid"]],template:function(i,o){if(1&i&&(e.j41(0,"edit-panel",2),e.bIt("back",function(){return o.navigateBack()})("showValidation",function(){return o.onValidation()}),e.nVh(1,Ls,4,4,"button",3),e.DNE(2,Ys,22,20,"ng-template",null,0,e.C5r),e.j41(4,"tabset",null,1)(6,"tab",4),e.DNE(7,Us,2,3,"ng-template",5)(8,Js,1,0,"ng-container",6),e.k0s(),e.j41(9,"tab",7),e.DNE(10,Hs,1,0,"ng-template",5),e.nVh(11,el,17,8,"table",8),e.nI1(12,"async"),e.k0s(),e.nVh(13,nl,24,22,"tab",9),e.k0s()()),2&i){let d;const c=e.sdS(3);e.Y8G("formGroup",o.form)("save$",o.save$),e.R7$(),e.vxM(o.isStandaloneSbc?1:-1),e.R7$(7),e.Y8G("ngTemplateOutlet",c),e.R7$(3),e.vxM((d=e.bMT(12,6,o.sbcConnection$))?11:-1,d),e.R7$(2),e.vxM(o.isStandaloneSbc?13:-1)}},dependencies:[le.Q,a.X1,a.BC,a.cb,a.tU,a.l_,a.j4,Q.m,A.IH,Oe.x,Nn.Y,fe.q,Re.t,L.fw,ye.b,V.T3,L.V6,L.Bh,he.B,js.f,xe.kq,zt.B,qt.C,P.D9,V.Jj,Ws],encapsulation:2,changeDetection:0})}return n})();var Sn=l(64277),al=l(76122),Fe=l(36463),it=l(60007);const rl=["tabset"],sl=n=>({data:n});
1function ll(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",20),e.nI1(1,"async")),2&n){const t=e.XpG();e.Y8G("invalid",e.bMT(1,1,t.tabGeneral))}}function dl(n,s){if(1&n&&(e.j41(0,"field-select",7),e.nrm(1,"val-errors",21),e.k0s()),2&n){const t=e.XpG();e.Y8G("searchable",!0)("options",t.languages)}}function cl(n,s){1&n&&(e.j41(0,"field-select",8),e.nrm(1,"val-errors",22),e.k0s()),2&n&&e.Y8G("options",s)("searchable",!0)}function ul(n,s){if(1&n&&e.nrm(0,"app-fxs-template-variables",9),2&n){const t=e.XpG();e.Y8G("formControl",t.f.Variables)("variables",t.dect.Template.Variables)}}function pl(n,s){if(1&n&&(e.j41(0,"div",10)(1,"field-select",23),e.nrm(2,"val-errors",24),e.k0s()()),2&n){const t=e.XpG();e.R7$(),e.Y8G("options",t.networkInterfaces)}}function ml(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate"),e.nI1(2,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.RoutingDevice")+" "+e.bMT(2,3,"_i18n.IsRequired"))}function hl(n,s){if(1&n&&(e.j41(0,"field-wrapper",13),e.nrm(1,"ng-select",25),e.j41(2,"val-errors",26),e.DNE(3,ml,3,5,"ng-template",27),e.k0s()()),2&n){const t=e.XpG();e.Y8G("required",!0),e.R7$(),e.Y8G("items",t.sbcs)("clearable",!1)("searchable",!0)}}function bl(n,s){if(1&n&&(e.j41(0,"field-wrapper",14)(1,"a",28),e.EFF(2),e.k0s()()),2&n){const t=e.XpG();e.R7$(),e.Y8G("href",t.webConsoleUrl,e.B4B),e.R7$(),e.JRh(t.webConsoleUrl)}}function fl(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",29),e.nI1(1,"async")),2&n){const t=e.XpG();e.Y8G("invalid",e.bMT(1,1,t.tabUsers))}}let gl=(()=>{class n{xapiError=(0,r.WQX)(et.Ko);fb=(0,r.WQX)(a.ok);route=(0,r.WQX)(m.nX);router=(0,r.WQX)(m.Ix);cd=(0,r.WQX)(f.gRc);fxsService=(0,r.WQX)(Me.V);modalService=(0,r.WQX)(j.B);tabset;dect=this.route.snapshot.data.dect;sbcs=this.route.snapshot.data.sbcs;form=this.createForm();networkInterfaces=this.route.snapshot.data.networkInterfaces;isLocalDevice(){return"LocalLan"===this.dect.Provisioning?.Method}createForm(){return this.fb.group({Name:[this.dect.Name,a.k0.required],LocalInterface:this.fb.control({value:this.dect.Provisioning?.LocalInterface,disabled:!this.isLocalDevice()}),Language:this.fb.control({value:this.dect.Language??"",disabled:!this.dect.Template?.Languages?.length}),TimeZone:this.fb.control({value:this.dect.TimeZone??"",disabled:!this.dect.Template?.TimeZones?.length}),SbcName:this.fb.control({value:this.dect.Provisioning?.SbcName,disabled:!this.hasRoutingDevice},this.hasRoutingDevice?[a.k0.required,(0,b.J9)(this.sbcs.map(t=>t.Name))]:[]),Users:this.createDectUsersArray(),Variables:new a.MJ(this.dect.Variables??[],{nonNullable:!0})})}createDectUsersArray(){const t=Math.max(...this.dect.FxsLines?.map(d=>d.Key??0)??[]),i=Math.min(this.dect.Template?.NumberOfExtensions??0,10),o=Math.max(t,i);return this.fb.array(Array.from({length:o},(d,c)=>{const v=this.dect.FxsLines?.find(M=>M.Key===c+1);return this.fb.control(v??null)}))}get isFxs(){return"Fxs"===this.dect.Template?.DeviceType}get f(){return this.form.controls}get usersFormArray(){return this.f.Users}get tabGeneral(){return(0,$.S)([this.f.Name,this.f.SbcName])}get tabUsers(){return(0,$.S)([this.f.Users])}get macAddress(){return this.dect.MacAddress??""}get provisioningLink(){return this.dect.Provisioning?.ProvLink??""}get webConsoleUrl(){return this.dect.Registered?.InterfaceLink}webConsoleUsername="admin";get webConsolePassword(){return this.dect.Password??"admin"}languages=this.dect.Template?.Languages??[];timeZones=this.dect.Template?.TimeZones?.length?[{value:"",label:"_i18n.GlobalTimezone"},...this.dect.Template.TimeZones.filter(Boolean).map(t=>({value:t,label:t}))]:null;get hasRoutingDevice(){return"SBC"===this.dect.Provisioning?.Method}get numberOfExtensions(){return this.dect.Template?.NumberOfExtensions??0}activateInvalidTab(){(0,$.q)(this.tabset,[this.tabGeneral,this.tabUsers])}updatingFxs=!1;renewCredentials(){this.updatingFxs||(this.updatingFxs=!0,this.cd.markForCheck(),this.fxsService.regenerateWebCredentials({macAddress:this.dect.MacAddress}).pipe((0,D.Pr)("_i18n.DECTNotFoundErrorMessage",this.dect.ModelName),(0,D.Tg)(this.modalService),(0,hn.j)(()=>{this.updatingFxs=!1,this.cd.markForCheck()})).subscribe(({Password:t})=>{this.dect.Password=t}))}save$=()=>{const t={Name:this.f.Name.value,Language:this.f.Language.value,TimeZone:this.f.TimeZone.value,Provisioning:{SbcName:this.hasRoutingDevice?this.f.SbcName.value:void 0,LocalInterface:this.f.LocalInterface.value},Variables:this.f.Variables.value,FxsLines:bn(this.f.Users.value)};return this.updatingFxs=!0,this.cd.markForCheck(),this.fxsService.updateFxs({macAddress:this.dect.MacAddress,pbxFxs:t}
1).pipe((0,D.Pr)("_i18n.VoiceAndChatNotFoundErrorMessage",this.dect.Name),(0,R.n)(()=>this.navigateBack()),(0,U.W)(i=>(this.updatingFxs=!1,this.cd.markForCheck(),this.xapiError?.error(this.cd,i,this.form,null,!0,o=>o.replace(/^FxsLines/,"Users")),this.activateInvalidTab(),ge.w)))};navigateBack(){return this.router.navigate(["office","voice-and-chat"])}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-edit-dect"]],viewQuery:function(i,o){if(1&i&&e.GBs(rl,5),2&i){let d;e.mGM(d=e.lsd())&&(o.tabset=d.first)}},decls:41,vars:43,consts:[["tabset",""],["helpUrl","_i18n.TrunkEditorUri","data-qa","dect-editor",3,"back","showValidation","header","formGroup","save$"],["id","general"],["tabHeading",""],["label","_i18n.Name","formControlName","Name","data-qa","name",3,"maxlength"],["controlName","Name","label","_i18n.Name"],["data-qa","dect-configuration-guide",3,"innerHTML"],["label","_i18n.Language","data-qa","dect-language","formControlName","Language",3,"searchable","options"],["label","_i18n.TimeZone","data-qa","time-zone","formControlName","TimeZone",3,"options","searchable"],[3,"formControl","variables"],[1,"row"],["data-qa","provisioning-link","label","_i18n.ProvisioningUrl",1,"col-md-6",3,"data"],["data-qa","mac-address","label","_i18n.MACAddress",1,"col-md-6",3,"data"],["label","_i18n.RoutingDevice","data-qa","sbc-name",3,"required"],["label","_i18n.WebConsoleUrl","data-qa","web-console-url"],["label","_i18n.WebConsoleUsername","data-qa","web-console-username",1,"col-md-6",3,"data"],["label","_i18n.WebConsolePassword","data-qa","dect-password","description","true",1,"col-md-6",3,"data","conceal"],["description","","data-qa","reset-credentials",1,"link","dashed",3,"click"],["id","users"],[3,"numberOfExtensions","usersFormArray","allowFaxExtensions"],["label","_i18n.General",3,"invalid"],["controlName","Language"],["controlName","TimeZone"],["label","_i18n.NetworkInterface","data-qa","interface","formControlName","LocalInterface",1,"col-md-6",3,"options"],["controlName","LocalInterface"],["bindLabel","DisplayName","bindValue","Name","formControlName","SbcName","data-qa","select",3,"items","clearable","searchable"],["controlName","SbcName","label","_i18n.RoutingDevice"],["valError","listElementNotFound"],["rel","noopener","target","_blank",1,"link",3,"href"],["label","_i18n.Users",3,"invalid"]],template:function(i,o){if(1&i&&(e.j41(0,"edit-panel",1),e.bIt("back",function(){return o.navigateBack()})("showValidation",function(){return o.activateInvalidTab()}),e.j41(1,"tabset",null,0)(3,"tab",2),e.DNE(4,ll,2,3,"ng-template",3),e.j41(5,"field-input",4),e.nrm(6,"val-errors",5),e.k0s(),e.nrm(7,"p",6),e.nI1(8,"trunkGuideLink"),e.nI1(9,"async"),e.nI1(10,"translate"),e.j41(11,"fieldset")(12,"legend"),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.nVh(15,dl,2,2,"field-select",7),e.nVh(16,cl,2,2,"field-select",8),e.nVh(17,ul,1,2,"app-fxs-template-variables",9),e.k0s(),e.j41(18,"fieldset")(19,"legend"),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"div",10),e.nrm(23,"app-input-copy-to-clipboard",11)(24,"app-input-copy-to-clipboard",12),e.k0s(),e.nVh(25,pl,3,1,"div",10),e.nVh(26,hl,4,4,"field-wrapper",13),e.k0s(),e.j41(27,"fieldset")(28,"legend"),e.EFF(29),e.nI1(30,"translate"),e.k0s(),e.nVh(31,bl,3,2,"field-wrapper",14),e.j41(32,"div",10),e.nrm(33,"app-input-copy-to-clipboard",15),e.j41(34,"app-input-copy-to-clipboard",16)(35,"a",17),e.bIt("click",function(){return o.renewCredentials()}),e.EFF(36),e.nI1(37,"translate"),e.k0s()()()()(),e.j41(38,"tab",18),e.DNE(39,fl,2,3,"ng-template",3),e.nrm(40,"app-select-users",19),e.k0s()()()),2&i){let d;e.Y8G("header",o.isFxs?"_i18n.EditFxs":"_i18n.EditDectBaseStation")("formGroup",o.form)("save$",o.save$),e.R7$(5),e.Y8G("maxlength",50),e.R7$(2),e.Y8G("innerHTML",e.i5U(10,30,o.isFxs?"_i18n.SeeFXSConfigGuide":"_i18n.SeeDectConfigGuide",e.eq3(41,sl,e.bMT(9,28,e.i5U(8,25,null==o.dect?null:o.dect.ModelName,"link_to_phone_doc")))),e.npT),e.R7$(6),e.JRh(e.bMT(14,33,"_i18n.DeviceOptions")),e.R7$(2),e.vxM(o.languages.length?15:-1),e.R7$(),e.vxM((d=o.timeZones)?16:-1,d),e.R7$(),e.vxM(o.dect.Template?17:-1),e.R7$(3),e.JRh(e.bMT(21,35,"_i18n.Advanced")),e.R7$(3),e.Y8G("data",o.provisioningLink),e.R7$(),e.Y8G("data",o.macAddress),e.R7$(),e.vxM(o.isLocalDevice()?25:-1),e.R7$(),e.vxM(o.hasRoutingDevice?26:-1),e.R7$(3),e.JRh(e.bMT(30,37,"_i18n.DeviceWebConsoleHeader")),e.R7$(2),e.vxM(o.webConsoleUrl?31:-1),e.R7$(2),e.Y8G("data",o.webConsoleUsername),e.R7$(),e.Y8G("data",o.webConsolePassword)("conceal",!0),e.R7$(),e.AVh("disabled",o.updatingFxs),e.R7$(),e.SpI(" ",e.bMT(37,39,"_i18n.ResetCredentials")," "),e.R7$(4),e.Y8G("numberOfExtensions",o.numberOfExtensions)("usersFormArray",o.usersFormArray)("allowFaxExtensions",o.isFxs)}},dependencies:[le.Q,a.X1,a.BC,a.cb,a.tU,a.l_,a.j4,a.JD,L.fw,L.V6,L.Bh,ye.b,Q.m,A.IH,fe.q,Tn,Nn.Y,me.z,ee.vr,A.VI,kn,V.Jj,P.D9,Ie],encapsulation:2})}return n})();
1var Cl=l(46484),vl=l(10567),Tl=l(5595),kl=l(99179);const Mn="gatewayParams",Ge={[Mn]:()=>(0,r.WQX)(It.o).parameters$};var Il=l(45501);const yl=["tabset"],Nl=()=>["FromDisplayName"];function Sl(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",22),e.nI1(1,"async")),2&n){const t=e.XpG();e.Y8G("invalid",e.bMT(1,1,t.tabGeneral))}}function Ml(n,s){if(1&n&&e.nrm(0,"field-input",10),2&n){const t=e.XpG();e.Y8G("formControl",t.f.remotePBXPrefix)}}function El(n,s){1&n&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"_i18n.SlaveBridgeAuthentication")))}function Pl(n,s){1&n&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"_i18n.MasterBridgeAuthentication")))}function xl(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.PasswordWeak"))}function wl(n,s){if(1&n&&(e.j41(0,"fieldset")(1,"legend"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"field-checkbox",23),e.j41(5,"div",4)(6,"div",5)(7,"field-input",24),e.nrm(8,"val-errors",7),e.k0s()(),e.j41(9,"div",5)(10,"field-input-number",25),e.nrm(11,"val-errors",7),e.k0s()()()()),2&n){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,8,"_i18n.RemotePBX")),e.R7$(2),e.Y8G("formControl",t.f.tunnelEnabled),e.R7$(3),e.Y8G("formControl",t.f.tunnelRemoteAddr),e.R7$(),e.Y8G("control",t.f.tunnelRemoteAddr),e.R7$(2),e.Y8G("formControl",t.f.tunnelRemotePort)("min",0)("max",65535),e.R7$(),e.Y8G("control",t.f.tunnelRemotePort)}}function Fl(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",34),e.nI1(1,"async")),2&n){const t=e.XpG(2);e.Y8G("invalid",e.bMT(1,1,t.tabPresence))}}function Gl(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.SpI(" ",e.bMT(1,1,"_i18n.IsNotValidDomainWithPort")," ")}function Al(n,s){if(1&n){const t=e.RV6();e.j41(0,"tab",13),e.DNE(1,Fl,2,3,"ng-template",3),e.j41(2,"fieldset")(3,"legend"),e.nrm(4,"field-checkbox",26),e.k0s(),e.j41(5,"app-departments-select",27),e.nrm(6,"val-errors",7),e.k0s()(),e.j41(7,"fieldset")(8,"legend"),e.nrm(9,"field-checkbox",28),e.k0s(),e.j41(10,"field-input",29)(11,"val-errors",7),e.DNE(12,Gl,2,3,"ng-template",30),e.k0s()(),e.j41(13,"field-wrapper",31)(14,"app-button-add",32),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.add())}),e.k0s()(),e.nrm(15,"val-errors",7),e.j41(16,"app-peers-table",33),e.bIt("deletePeer",function(o){r.eBV(t);const d=e.XpG();return r.Njj(d.removeExtension(o))}),e.k0s()()()}if(2&n){const t=e.XpG();e.Y8G("tabOrder",2),e.R7$(4),e.Y8G("formControl",t.f.publishInfo),e.R7$(),e.Y8G("formControl",t.f.publicInfoGroups)("groups",t.availablePublicInfoGroups),e.R7$(),e.Y8G("control",t.f.publicInfoGroups),e.R7$(3),e.Y8G("formControl",t.f.receiveInfo),e.R7$(),e.Y8G("formControl",t.f.remoteMyPhoneUriHost),e.R7$(),e.Y8G("control",t.f.remoteMyPhoneUriHost),e.R7$(2),e.Y8G("disabled",t.f.receiveExtensions.disabled),e.R7$(),e.Y8G("disabled",t.f.receiveExtensions.disabled),e.R7$(),e.Y8G("control",t.f.receiveExtensions),e.R7$(),e.Y8G("peersControl",t.f.receiveExtensions)("showMembership",!0)}}function Dl(n,s){if(1&n&&(e.nrm(0,"app-tab-heading",35),e.nI1(1,"async")),2&n){const t=e.XpG();e.Y8G("invalid",e.bMT(1,1,t.tabAdvanced))}}function $l(n,s){1&n&&(e.EFF(0),e.nI1(1,"translate")),2&n&&e.JRh(e.bMT(1,1,"_i18n.SpecifyCodec"))}function Ol(n,s){if(1&n&&(e.j41(0,"fieldset")(1,"legend")(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.nrm(5,"app-codecs",36),e.j41(6,"val-errors",7),e.DNE(7,$l,2,3,"ng-template",37),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.AVh("red-circle-mark",t.f.gateway.controls.codecs.invalid),e.R7$(),e.SpI(" ",e.bMT(4,7,"_i18n.CodecsPriority")," "),e.R7$(2),e.Y8G("allowAdd",!0)("allowDelete",!0)("codecs",t.f.gateway.controls.codecs),e.R7$(),e.Y8G("control",t.f.gateway.controls.codecs)}}function Vl(n,s){if(1&n&&(e.j41(0,"fieldset",21)(1,"legend")(2,"span"),e.nI1(3,"async"),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.nrm(6,"app-gateway-parameters",38),e.k0s()),2&n){const t=e.XpG();e.R7$(2),e.AVh("red-circle-mark",e.bMT(3,7,t.callerIdControlInvalid$)),e.R7$(2),e.SpI(" ",e.bMT(5,9,"_i18n.CallerIdControl")," "),e.R7$(2),e.Y8G("formControl",t.form.controls.gateway.controls.outboundParams)("gatewayParams",t.gatewayParams)("showOnlyWithNames",e.lJ4(11,Nl))("showCustomFieldColumn",!0)}}let Et=(()=>{class n{route=(0,r.WQX)(m.nX);router=(0,r.WQX)(m.Ix);trunksApiService=(0,r.WQX)(p.T);modalService=(0,r.WQX)(j.B);cd=(0,r.WQX)(f.gRc);destroy$=(0,r.WQX)(r.abz);tabset;isNew=!1;form;trunk;isAdmin;availablePublicInfoGroups;gatewayParams;get header(){return this.trunk.Gateway?.Name||""}get f(){return this.form.controls}get tabGeneral(){return(0,$.S)([this.f.gateway.controls.name,this.f.number,this.f.remotePBXPrefix,this.f.simultaneousCalls,this.f.authPassword,this.f.authPassword,this.f.tunnelEnabled,this.f.tunnelRemoteAddr,this.f.tunnelRemotePort])}get tabPresence(){return(0,$.S)([this.f.remoteMyPhoneUriHost,this.f.publicInfoGroups])}get tabAdvanced(){return(0,$.S)([this.f.enableInboundRules,this.f.enableOutboundRules,this.f.gateway.controls.supportReplaces,this.f.gateway.controls.supportReinvite,this.f.gateway.controls.SRTPMode,this.f.gateway.controls.deliverAudio,this.f.gateway.controls.outboundParams,this.f.gateway.controls.codecs])}isEditBridgeAllowed(){return this.isAdmin}get isWebMeetingBridge(){return(0,g.sb)(this.trunk)}get isSlaveBridge(){return"BridgeSlave"===this.trunk.Gateway?.Type||"BridgeSlaveOverTunnel"===this.trunk.Gateway?.Type}get isMasterBridge(){return"BridgeMaster"===this.trunk.Gateway?.Type}activateInvalidTab(){this.tabset&&(0,$.q)(this.tabset,[this.tabGeneral,...this.isWebMeetingBridge?[]:[this.tabPresence],this.tabAdvanced])}get callerIdControlInvalid$(){return(0,$.S)([this.f.gateway.controls.outboundParams])}constructor(){const t=this.route,i=this.destroy$,{trunk:o,isAdmin:d,publicInfoGroups:c,isPaid:v}=t.snapshot.data;this.isAdmin=d,this.isNew=0===(o.Id??0),this.availablePublicInfoGroups=c,this.trunk=o,this.form=function qn(n){return new a.gE({gateway:Qn(n.Gateway),number:new a.MJ(n.Number??"",{nonNullable:!0,validators:a.k0.required}),publishInfo:new a.MJ(n.PublishInfo??!1,{nonNullable:!0}),receiveInfo:new a.MJ(n.ReceiveInfo??!1,{nonNullable:!0}),remoteMyPhoneUriHost:new a.MJ(n.RemoteMyPhoneUriHost??"",{nonNullable:!0,validators:[a.k0.required,$n]}),remotePBXPrefix:new a.MJ(n.RemotePBXPreffix??"",{nonNullable:!0}),authPassword:new a.MJ(n.AuthPassword??{Value:""},{nonNullable:!0,validators:b.ln.map(b.ys)}),tunnelEnabled:new a.MJ(n.TunnelEnabled??!1,{nonNullable:!0}),tunnelRemoteAddr:new a.MJ(n.TunnelRemoteAddr??"",{nonNullable:!0,validators:[a.k0.required,b.AG]}),tunnelRemotePort:new a.MJ(n.TunnelRemotePort??5090,{nonNullable:!0,validators:[a.k0.required,a.k0.min(0),a.k0.max(65535)]}),simultaneousCalls:new a.MJ(n.SimultaneousCalls??10,{nonNullable:!0,validators:[a.k0.min(1)]}),enableInboundRules:new a.MJ(n.EnableInboundCalls??!1,{nonNullable:!0}),enableOutboundRules:new a.MJ(n.EnableOutboundCalls??!1,{nonNullable:!0}),publicInfoGroups:new a.MJ(n.PublicInfoGroups??[],{nonNullable:!0}),receiveExtensions:new a.MJ(n.ReceiveExtensions??[],{nonNullable:!0})})}(o),this.gatewayParams=(n=>n.snapshot.data[Mn])(t),this.isWebMeetingBridge&&((0,C.TZ)(this.f.gateway.controls.name,!1),(0,C.TZ)(this.f.tunnelRemoteAddr,!1),(0,C.TZ)(this.f.tunnelRemotePort,!1),(0,C.TZ)(this.f.gateway.controls.codecs,!1),(0,C.TZ)(this.f.receiveInfo,!1),(0,C.TZ)(this.f.publishInfo,!1),this.form.patchValue({receiveInfo:!1,publishInfo:!1},{emitEvent:!1})),(0,C.XP)(this.f.receiveInfo).pipe((0,O.pQ)(i)).subscribe(M=>{(0,C.TZ)(this.f.remoteMyPhoneUriHost,M),(0,C.TZ)(this.f.receiveExtensions,M)}),v||(this.f.receiveInfo.value&&this.f.receiveInfo.setValue(!1),(0,C.TZ)(this.f.receiveInfo,!1)),(0,C.XP)(this.f.publishInfo).pipe((0,O.pQ)(i)).subscribe(M=>{(0,C.TZ)(this.f.publicInfoGroups,M)}),this.isMasterBridge&&(0,C.XP)(this.f.tunnelEnabled).pipe((0,O.pQ)(i)).subscribe(M=>{(0,C.TZ)(this.f.tunnelRemoteAddr,M),(0,C.TZ)(this.f.tunnelRemotePort,M)}),this.isSlaveBridge&&(0,C.XP)(this.f.tunnelEnabled).pipe((0,O.pQ)(i)).subscribe(M=>{this.form.controls.tunnelRemotePort.dirty||5060!==this.form.controls.tunnelRemotePort.value&&5090!==this.form.controls.tunnelRemotePort.value||this.form.controls.tunnelRemotePort.setValue(M?5090:5060)})}add(){this.modalService.showComponent(vl.N,{initialState:{header:"_i18n.SelectUsers",showMembership:!0,searchTypes:[q.J.Extension],hideHotdesking:!0,initialSelected:this.f.receiveExtensions.value??[]}}).pipe((0,D.Sf)()).subscribe({next:t=>{this.f.receiveExtensions.setValue(t),this.f.receiveExtensions.markAsDirty(),this.cd.markForCheck()},error:t=>this.modalService.error(t)})}save$=()=>{const t=this.trunk.Id??0,i=(0,g.IT)(this.form.value);return i.RoutingRules=[{RuleName:"",CallType:"AllCalls",Condition:"ForwardAll",AlterDestinationDuringHolidays:!1,AlterDestinationDuringOutOfOfficeHours:!1,Hours:{Type:"AllHours",IgnoreHolidays:!0},HolidaysDestination:{Type:"Extension",External:"",To:"Extension"},OfficeHoursDestination:{Type:"Extension",External:"",To:"Extension"},OutOfOfficeHoursDestination:{Type:"Extension",External:"",To:"Extension"}}],i.AuthID=i.Number,i.Gateway&&(i.Gateway.Type===I.Z.BridgeSlave||i.Gateway.Type===I.Z.BridgeSlaveOverTunnel)&&(i.Gateway.Host=i.TunnelRemoteAddr,i.Gateway.Port=i.TunnelRemotePort),(this.isNew?this.trunksApiService.createTrunk({pbxTrunk:i}):this.trunksApiService.updateTrunk({id:t,pbxTrunk:i}
1).pipe((0,D.Pr)("_i18n.VoiceAndChatNotFoundErrorMessage",this.trunk.Gateway?.Name))).pipe((0,R.n)(()=>this.navigateBack()))};navigateBack(){return this.router.navigate(["office","voice-and-chat"])}removeExtension(t){this.f.receiveExtensions.setValue(this.f.receiveExtensions.value.filter(i=>i!==t)),this.f.receiveExtensions.markAsDirty()}srtpOptions=en.b;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-edit-bridge"]],viewQuery:function(i,o){if(1&i&&e.GBs(yl,5),2&i){let d;e.mGM(d=e.lsd())&&(o.tabset=d.first)}},decls:48,vars:33,consts:[["tabset",""],[3,"showValidation","back","isNewEntity","formGroup","header","saveDisabledByReason","helpUrl","save$"],["id","general",3,"tabOrder"],["tabHeading",""],[1,"row"],[1,"col-md-6"],["data-qa","bridge-name","label","_i18n.NameOfBridge",3,"formControl"],[3,"control"],["data-qa","virtual-number","label","_i18n.VirtualExtensionNumber",3,"formControl"],["data-qa","sim-calls","label","_i18n.SimultaneousCalls",3,"formControl"],["data-qa","outbound-prefix","label","_i18n.OutboundRulePrefix",3,"formControl"],["data-qa","authentication-password","label","_i18n.AuthenticationPassword",3,"formControl","maxlength"],["valError","pattern"],["id","presence",3,"tabOrder"],["id","advanced",3,"tabOrder"],["data-qa","allow-inbound-calls","label","_i18n.AllowInboundCalls",3,"formControl"],["data-qa","allow-outbound-calls","label","_i18n.AllowOutboundCalls",3,"formControl"],["formGroupName","gateway",1,"col-md-6"],["formControlName","deliverAudio","data-qa","pbx-deliver-audio","label","_i18n.DeliverAudio",1,"col-md-6"],["formControlName","SRTPMode","label","_i18n.SrtpMode","data-qa","srtp-mode",3,"options","clearable","searchable"],["controlName","SRTPMode"],[1,"caller-id-fieldset"],["label","_i18n.General",3,"invalid"],["data-qa","tunnel","label","_i18n.TunnelEnabled",3,"formControl"],["data-qa","tunnel-remote-address","label","_i18n.TunnelRemoteAddr",3,"formControl"],["data-qa","tunnel-remote-port","label","_i18n.TunnelRemotePort",3,"formControl","min","max"],["data-qa","publish-information","label","_i18n.PublishInformation",3,"formControl"],["placeholder","_i18n.SelectGroupsPlaceholder","valueField","Number",1,"col-lg-6","d-block",3,"formControl","groups"],["data-qa","recieved-information","label","_i18n.ReceiveInformation",3,"formControl"],["data-qa","remote-myphone-host","placeholder","_i18n.RemoteMyPhoneUriHostPlaceholder",1,"col-md-6",3,"formControl"],["valError","domainWithPort"],["data-qa","received-info-ext","description","_i18n.ReceiveInfoExtensionsLabel",3,"disabled"],["text","_i18n.SelectUsers","data-qa","add-member","theme","border",3,"click","disabled"],["data-qa","received-exts",3,"deletePeer","peersControl","showMembership"],["label","_i18n.BridgePresence",3,"invalid"],["label","_i18n.Advanced",3,"invalid"],[3,"allowAdd","allowDelete","codecs"],["valError","required"],["possibleValuesProperty","outboundParamPossibleValues",3,"formControl","gatewayParams","showOnlyWithNames","showCustomFieldColumn"]],template:function(i,o){1&i&&(e.j41(0,"edit-panel",1),e.bIt("showValidation",function(){return o.activateInvalidTab()})("back",function(){return o.navigateBack()}),e.j41(1,"tabset",null,0)(3,"tab",2),e.DNE(4,Sl,2,3,"ng-template",3),e.j41(5,"fieldset")(6,"div",4)(7,"div",5)(8,"field-input",6),e.nrm(9,"val-errors",7),e.k0s()(),e.j41(10,"div",5)(11,"field-input",8),e.nrm(12,"val-errors",7),e.k0s()()(),e.j41(13,"div",4)(14,"div",5),e.nrm(15,"field-input-number",9),e.k0s(),e.j41(16,"div",5),e.nVh(17,Ml,1,1,"field-input",10),e.k0s()()(),e.j41(18,"fieldset")(19,"legend"),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.nVh(22,El,3,3,"p")(23,Pl,3,3,"p"),e.j41(24,"field-input-concealed-password",11)(25,"val-errors",7),e.DNE(26,xl,2,3,"ng-template",12),e.k0s()()(),e.nVh(27,wl,12,10,"fieldset"),e.k0s(),e.nVh(28,Al,17,13,"tab",13),e.j41(29,"tab",14),e.DNE(30,Dl,2,3,"ng-template",3),e.j41(31,"fieldset")(32,"legend"),e.EFF(33),e.nI1(34,"translate"),e.k0s(),e.j41(35,"div",4)(36,"div",5),e.nrm(37,"field-checkbox",15),e.k0s(),e.j41(38,"div",5),e.nrm(39,"field-checkbox",16),e.k0s(),e.j41(40,"div",17),e.nrm(41,"field-checkbox",18),e.k0s(),e.nrm(42,"div",5),e.j41(43,"div",17)(44,"field-select",19),e.nrm(45,"val-errors",20),e.k0s()()()(),e.nVh(46,Ol,8,9,"fieldset"),e.nVh(47,Vl,7,12,"fieldset",21),e.k0s()()()),2&i&&(e.Y8G("isNewEntity",o.isNew)("formGroup",o.form)("header",o.header)("saveDisabledByReason",o.isEditBridgeAllowed()?"":"_i18n.FeatureUnavailableOnCurrentEdition")("helpUrl","_i18n.TrunkEditorUri")("save$",o.save$),e.R7$(3),e.Y8G("tabOrder",1),e.R7$(5),e.Y8G("formControl",o.f.gateway.controls.name),e.R7$(),e.Y8G("control",o.f.gateway.controls.name),e.R7$(2),e.Y8G("formControl",o.f.number),e.R7$(),e.Y8G("control",o.f.number),e.R7$(3),e.Y8G("formControl",o.f.simultaneousCalls),e.R7$(2),e.vxM(o.isWebMeetingBridge?-1:17),e.R7$(3),e.JRh(e.bMT(21,29,"_i18n.Authentication")),e.R7$(2),e.vxM(o.isSlaveBridge?22:o.isMasterBridge?23:-1),e.R7$(2),e.Y8G("formControl",o.f.authPassword)("maxlength",50),e.R7$(),e.Y8G("control",o.f.authPassword),e.R7$(2),e.vxM(o.isWebMeetingBridge||!o.isMasterBridge&&!o.isSlaveBridge?-1:27),e.R7$(),e.vxM(o.isWebMeetingBridge?-1:28),e.R7$(),e.Y8G("tabOrder",3),e.R7$(4),e.JRh(e.bMT(34,31,"_i18n.Options")),e.R7$(4),e.Y8G("formControl",o.f.enableInboundRules),e.R7$(2),e.Y8G("formControl",o.f.enableOutboundRules),e.R7$(5),e.Y8G("options",o.srtpOptions)("clearable",!1)("searchable",!1),e.R7$(2),e.vxM(o.isWebMeetingBridge?-1:46),e.R7$(),e.vxM(o.isWebMeetingBridge||!o.isMasterBridge&&!o.isSlaveBridge?-1:47))},dependencies:[le.Q,a.X1,a.BC,a.cb,a.tU,a.l_,a.j4,a.JD,a.$R,L.fw,L.V6,Bt.Z,L.Bh,ye.b,Q.m,A.IH,he.B,Tl.p,A.VI,Re.t,Il.N,me.z,Qe.j,kl.j,fe.q,Zt.V,Kt,P.D9,V.Jj],encapsulation:2,changeDetection:0})}return n})();var Xl=l(45984),Ll=l(77498),Yl=l(8e4);const En_RtpMismatchDetected="RTPMismatchDetected",En_CodecMismatch="CodecMismatch";var Ul=l(60370);const Pn=n=>({p1:n}),xn=n=>({report:n});
1function Jl(n,s){if(1&n&&(e.nrm(0,"app-severity",3),e.nI1(1,"translate")),2&n){const t=e.XpG().report,i=e.XpG();e.Y8G("level",t.Level)("label",i.label(t))("translateParams",e.eq3(5,Pn,e.bMT(1,3,i.failedCallLabel(t))))}}function Hl(n,s){if(1&n&&(e.nrm(0,"app-severity",3),e.nI1(1,"amLocal"),e.nI1(2,"amDateFormat")),2&n){const t=e.XpG().report,i=e.XpG();e.Y8G("level",i.getLevel(t))("label",i.label(t))("translateParams",e.eq3(8,Pn,e.i5U(2,5,e.bMT(1,3,t.Params[0]),"L LT")))}}function Ql(n,s){if(1&n&&(e.j41(0,"accordion",4)(1,"accordion-group")(2,"div",5)(3,"button",6),e.nrm(4,"app-severity",7),e.k0s()(),e.j41(5,"pre",8),e.EFF(6),e.k0s()()()),2&n){const t=e.XpG().report,i=e.XpG();e.Y8G("isAnimated",!0),e.R7$(4),e.Y8G("level",i.getLevel(t))("label",i.label(t)),e.R7$(2),e.SpI("                        ",t.Params[0],"\n                    ")}}function ql(n,s){if(1&n&&(e.j41(0,"li"),e.EFF(1),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.SpI(" ",t," ")}}function zl(n,s){if(1&n&&(e.j41(0,"ul",9),e.Z7z(1,ql,2,1,"li",null,e.fX1),e.k0s()),2&n){const t=e.XpG(2).report,i=e.XpG();e.R7$(),e.Dyx(i.splitParams(t.Params[2]))}}function Kl(n,s){if(1&n&&(e.j41(0,"li"),e.EFF(1),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.SpI(" ",t," ")}}function Zl(n,s){if(1&n&&(e.j41(0,"ul",9),e.Z7z(1,Kl,2,1,"li",null,e.fX1),e.k0s()),2&n){const t=e.XpG(2).report,i=e.XpG();e.R7$(),e.Dyx(i.splitParams(t.Params[1]))}}function ed(n,s){if(1&n&&(e.j41(0,"app-severity",3),e.nVh(1,zl,3,0,"ul",9)(2,Zl,3,0,"ul",9),e.k0s()),2&n){const t=e.XpG().report,i=e.XpG();e.Y8G("level",i.getLevel(t))("label",i.label(t))("translateParams",i.params(t)),e.R7$(),e.vxM("AltProxyResolvesToSRV"===t.Code||"ProxyResolvesToSRV"===t.Code||"RegistrarResolvesToSRV"===t.Code?1:"AltProxyResolvesToNAPTR"===t.Code||"ProxyResolvesToNAPTR"===t.Code||"RegistrarResolvesToNAPTR"===t.Code?2:-1)}}function td(n,s){if(1&n&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n){const t=e.XpG().report,i=e.XpG();e.R7$(),e.JRh(e.bMT(2,1,i.recommendations[t.Code]))}}function nd(n,s){if(1&n&&(e.j41(0,"div"),e.nVh(1,Jl,2,7,"app-severity",3)(2,Hl,3,10,"app-severity",3)(3,Ql,7,4,"accordion",4)(4,ed,3,4,"app-severity",3),e.nVh(5,td,3,3,"p"),e.k0s()),2&n){const t=s.report,i=e.XpG();e.AVh("col-lg-6",i.twoColumnsViewOnDesktop()),e.R7$(),e.vxM("OutboundCallFailed"===t.Code&&i.knownFailureReasons.includes(t.Params[0])?1:"RegisteredOK"===t.Code?2:"SIPMessageResponse"===t.Code||"InboundSIPMessage"===t.Code?3:4),e.R7$(4),e.vxM(i.recommendations[t.Code]?5:-1)}}function id(n,s){if(1&n&&e.eu8(0,10),2&n){const t=s.$implicit;e.XpG(2);const i=e.sdS(1);e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(2,xn,t))}}function od(n,s){if(1&n&&(e.j41(0,"div",2),e.Z7z(1,id,1,4,"ng-container",10,e.fX1),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Dyx(t.analInfos())}}function ad(n,s){if(1&n&&e.eu8(0,10),2&n){const t=s.$implicit;e.XpG(2);const i=e.sdS(1);e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(2,xn,t))}}function rd(n,s){if(1&n&&(e.j41(0,"div",2)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.Z7z(4,ad,1,4,"ng-container",10,e.fX1),e.k0s()),2&n){const t=e.XpG();e.R7$(2),e.SpI(" ",e.bMT(3,1,"_i18n.DetectedIssues")," "),e.R7$(2),e.Dyx(t.analOther())}}const sd={[En_CodecMismatch]:"_i18n.TestRecommendation.CodecMismatch",[En_RtpMismatchDetected]:"_i18n.TestRecommendation.RtpMismatchDetected"};let Pt=(()=>{class n{typeToken;recommendations=sd;knownFailureReasons=["caller-terminated","disabled-trunk","busy-or-limit","not-registered","no-destinations","ServerError","MakeCallFailed","Unknown","NoInvite","RoutingFailure"];twoColumnsViewOnDesktop=(0,f.hFB)(!1);report=(0,f.hFB)();analOther=(0,N.EW)(()=>this.report()?.filter(t=>"Info"!==t.Level)??[]);analInfos=(0,N.EW)(()=>this.report()?.filter(t=>"Info"===t.Level)??[]);failedCallLabel(t){return`_i18n.FailedCallReason.${t.Params[0]}`}splitParams(t){return t.replaceAll(/[\[\]]/g,"").split(", ")}params(t){return(t.Params??[]).reduce((i,o,d)=>(i["p"+(d+1)]=o,i),{})}getLevel(t){return"Info"===t.Level?"Check":t.Level}label(t){return`_i18n.TestTrunkReports.${t.Code}`}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-test-output"]],inputs:{twoColumnsViewOnDesktop:[1,"twoColumnsViewOnDesktop"],report:[1,"report"]},decls:4,vars:3,consts:[["reportTemplate",""],[3,"typedTemplate"],[1,"mb-3","row"],[1,"d-block","mb-2",3,"level","label","translateParams"],[1,"accordion-options","d-block","mb-2",3,"isAnimated"],["accordion-heading","",1,"accordion-toggle"],["type","button",1,"btn","btn-link"],[3,"level","label"],[1,"text-keep-lines"],[1,"list-unstyled"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(i,o){1&i&&(e.DNE(0,nd,6,4,"ng-template",1,0,e.C5r),e.nVh(2,od,3,0,"div",2),e.nVh(3,rd,6,3,"div",2)),2&i&&(e.Y8G("typedTemplate",o.typeToken),e.R7$(2),e.vxM(o.analInfos().length>0?2:-1),e.R7$(),e.vxM(o.analOther().length>0?3:-1))},dependencies:[Yl.X,V.T3,Ul.M,Xe.Mj,Xe.kt,P.D9,tn.h,vt.a],encapsulation:2,changeDetection:0})}return n})();var ld=l(19859),dd=l(18810),wn=l(90558),cd=l(20284),Fn=l(33971);function ud(n,s){if(1&n&&(e.j41(0,"tr")(1,"td",2),e.EFF(2),e.nI1(3,"amDateFormat"),e.k0s(),e.j41(4,"td",3)(5,"pre",4),e.EFF(6),e.k0s()()()),2&n){const t=s.$implicit;e.R7$(2),e.SpI(" ",e.i5U(3,2,t.TimeStamp,"LTS")," "),e.R7$(4),e.JRh(t.Text)}}function pd(n,s){if(1&n&&(e.j41(0,"table",1)(1,"tbody"),e.Z7z(2,ud,7,5,"tr",null,e.fX1),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.Dyx(t.log)}}let Gn=(()=>{class n extends ne.m{buttons=B.P.Next|B.P.Cancel;log;download(){if(!this.log||!this.log.length)return;const t=this.makeCsv(this.log),i=new Blob([t],{type:"text/csv"}),o=URL.createObjectURL(i);(0,Fn.AE)(o,"call-log.csv")}makeCsv(t){return["TimeStamp,Text",...t.map(i=>[Se()(i.TimeStamp).format("LTS"),'"'+(i.Text??"").replace(/"/g,'""')+'"'].join(","))].join("\r\n")}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(n)))(o||n)}})();static \u0275cmp=e.VBU({type:n,selectors:[["app-test-trunk-call-log"]],hostVars:2,hostBindings:function(i,o){2&i&&e.AVh("modal-lg",!0)},inputs:{log:"log"},features:[e.Vt3],decls:2,vars:3,consts:[["header","_i18n.CallLog","cancelText","_i18n.Close","nextText","_i18n.Download",3,"nextClicked","scrollable","buttons"],[1,"scrollable-table"],["nowrap","",1,"align-top","ps-0"],[1,"pe-0"],[1,"mb-0","py-1"]],template:function(i,o){1&i&&(e.j41(0,"app-modal-dialog",0),e.bIt("nextClicked",function(){return o.download()}),e.nVh(1,pd,4,0,"table",1),e.k0s()),2&i&&(e.Y8G("scrollable",!0)("buttons",o.buttons),e.R7$(),e.vxM(o.log?1:-1))},dependencies:[ie.p,vt.a],encapsulation:2,changeDetection:0})}return n})();var md=l(3914),hd=l.n(md),ot=l(11041);function xt(n){const s=(0,qe.$z)(n,t=>
1t.Level);return Object.entries(s).map(([t,i])=>({$level:t,[ot.Cw]:i.map(o=>hd()(o.Template,o.Params)).join("\n")}))}function An(n){return{[ot.Cw]:n?.map(s=>`${s.TimeStamp}: ${s.Text}`).join("\n")??""}}let at=(()=>{class n{trunks=(0,r.WQX)(p.T);trunkTemplatesApiService=(0,r.WQX)(ve.L);modalService=(0,r.WQX)(j.B);trunkReport=[];outboundCallReport=[];outboundTestLog;inbountTestLog;inboundCallReport=[];report(t){this.trunks.getTrunk({id:t,$select:["Gateway/TemplateFilename"]}).pipe((0,R.n)(i=>this.trunkTemplatesApiService.getTrunkTemplate({id:i.Gateway.TemplateFilename,$select:["Content"]})),(0,G.T)(i=>{const o=(0,ot.QC)(i.Content);return o.doc.report={trunk:{report:xt(this.trunkReport)},inbound:{report:xt(this.inboundCallReport),log:An(this.inbountTestLog)},outbound:{report:xt(this.outboundCallReport),log:An(this.outboundTestLog)}},(0,ot.Z)(o,"gateway-template")})).subscribe({next:i=>(0,Fn.mq)(i,"provider_report.pv.xml","text/xml;charset=utf-8"),error:i=>this.modalService.error(i)})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=r.jDH({token:n,factory:n.\u0275fac})}return n})();function bd(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",5),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.cancelTest())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&n&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"_i18n.Cancel")," "))}function fd(n,s){}function gd(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",2),e.nrm(1,"field-input",6),e.j41(2,"button",7),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.testCall())}),e.nrm(3,"app-phone-alt-solid-icon"),e.k0s(),e.j41(4,"button",8),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.cancel())}),e.nrm(5,"app-times-light-icon"),e.k0s(),e.j41(6,"val-errors",9),e.DNE(7,fd,0,0,"ng-template",10),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("placeholder","Enter phone number")("formControl",t.phoneControl)("wcAutofocus",10)("maxlength",50),e.R7$(),e.Y8G("disabled",t.phoneControl.invalid),e.R7$(4),e.Y8G("control",t.phoneControl)}}function _d(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",13),e.bIt("click",function(){r.eBV(t);const o=e.XpG(2);return r.Njj(o.showCallLog())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&n){const t=e.XpG(2);e.Y8G("disabled",t.inProgress()),e.R7$(),e.SpI(" ",e.bMT(2,2,"_i18n.CallLog")," ")}}function Cd(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",11),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.enterPhoneNumber())}),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.nVh(3,_d,3,4,"button",12)}if(2&n){const t=e.XpG();e.Y8G("disabled",t.hasErrors()||t.inProgress()),e.R7$(),e.SpI(" ",e.bMT(2,3,"_i18n.Start")," "),e.R7$(2),e.vxM(t.testTrunkService.outboundTestLog?3:-1)}}function vd(n,s){1&n&&e.nrm(0,"span",3)}function Td(n,s){if(1&n&&e.nrm(0,"app-test-output",4),2&n){const t=e.XpG();e.Y8G("report",t.testTrunkService.outboundCallReport)}}let kd=(()=>{class n{testTrunkService=(0,r.WQX)(at);trunkId=(0,f.hFB)();hasErrors=(0,f.hFB)();inProgress=(0,f.hFB)();cd=(0,r.WQX)(f.gRc);deviceService=(0,r.WQX)(wn.gc);trunksApiService=(0,r.WQX)(p.T);phoneService=(0,r.WQX)(cd.u);modalService=(0,r.WQX)(j.B);testSub;enterOutboundPhone=!1;phoneControl=new a.MJ("",[a.k0.required]);enterPhoneNumber(){this.cd.markForCheck(),this.phoneControl.markAsUntouched(),this.phoneControl.setValue(""),this.enterOutboundPhone=!0}cancel(){this.cd.markForCheck(),this.enterOutboundPhone=!1}cancelTest(){this.testSub?.unsubscribe(),this.testSub=void 0,this.cd.markForCheck()}showCallLog(){this.modalService.showDialog(Gn,{log:this.testTrunkService.outboundTestLog})}testCall(){this.cd.markForCheck(),this.enterOutboundPhone=!1,this.testSub=(0,te.z)([this.deviceService.selectedPhoneDevice$,this.phoneService.pushDeviceRegistration$]).pipe((0,G.T)(([t,i])=>t?.Contact===wn.sm?i?.Contact:t?.Contact),(0,_n.s)(1),(0,R.n)(t=>t?this.trunksApiService.testOutboundCall({id:this.trunkId(),trunksTrunkTestOutboundCallRequestBody:{contact:t,destination:this.phoneControl.value}}):(0,dd.$)(()=>new Error("No registration found")))).subscribe({complete:()=>{this.cancelTest()},next:t=>{this.testTrunkService.outboundCallReport=t.Reports??[],this.testTrunkService.outboundTestLog=t.Log,this.cd.markForCheck()},error:t=>{this.cancelTest(),this.modalService.error(t)}})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-test-outbound-call"]],inputs:{trunkId:[1,"trunkId"],hasErrors:[1,"hasErrors"],inProgress:[1,"inProgress"]},decls:9,vars:5,consts:[[1,"mb-2","gap-2","d-flex","align-items-center"],["data-qa","cancel-outbound-test","type","button",1,"btn","btn-secondary"],[1,"d-flex"],["data-qa","spinner","a
1pp-spinner-regular-icon","",1,"customSVGIcons","svg-md"],[3,"report"],["data-qa","cancel-outbound-test","type","button",1,"btn","btn-secondary",3,"click"],[1,"mb-0",3,"placeholder","formControl","wcAutofocus","maxlength"],["data-qa","save","type","button",1,"btn","btn-border",3,"click","disabled"],["data-qa","cancel","type","button",1,"btn","btn-border",3,"click"],[1,"ms-2","align-self-center",3,"control"],["valError","required"],["data-qa","test","type","button",1,"btn","btn-primary",3,"click","disabled"],["data-qa","test-log","type","button",1,"btn","btn-secondary",3,"disabled"],["data-qa","test-log","type","button",1,"btn","btn-secondary",3,"click","disabled"]],template:function(i,o){1&i&&(e.j41(0,"legend")(1,"div",0),e.EFF(2),e.nI1(3,"translate"),e.nVh(4,bd,3,3,"button",1)(5,gd,8,6,"div",2)(6,Cd,4,5),e.k0s()(),e.nVh(7,vd,1,0,"span",3)(8,Td,1,1,"app-test-output",4)),2&i&&(e.R7$(2),e.SpI(" ",e.bMT(3,3,"_i18n.OutboundCallTest")," "),e.R7$(2),e.vxM(o.testSub?4:o.enterOutboundPhone?5:6),e.R7$(3),e.vxM(o.testSub?7:8))},dependencies:[Q.m,Pt,Wt.D,A.VI,A.IH,ct.J,a.X1,a.BC,a.tU,a.l_,ld.v,Pe.a,P.D9],encapsulation:2,changeDetection:0})}return n})();function Rd(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",4),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.cancelTest())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&n&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"_i18n.Cancel")," "))}function Id(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",7),e.bIt("click",function(){r.eBV(t);const o=e.XpG(2);return r.Njj(o.showCallLog())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&n){const t=e.XpG(2);e.Y8G("disabled",t.inProgress()),e.R7$(),e.SpI(" ",e.bMT(2,2,"_i18n.CallLog")," ")}}function yd(n,s){if(1&n){const t=e.RV6();e.j41(0,"button",5),e.bIt("click",function(){r.eBV(t);const o=e.XpG();return r.Njj(o.testCall())}),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.nVh(3,Id,3,4,"button",6)}if(2&n){const t=e.XpG();e.Y8G("disabled",t.hasErrors()||t.inProgress()),e.R7$(),e.SpI(" ",e.bMT(2,3,"_i18n.Start")," "),e.R7$(2),e.vxM(t.testTrunkService.inbountTestLog?3:-1)}}function Nd(n,s){1&n&&e.nrm(0,"span",2)}function Sd(n,s){if(1&n&&e.nrm(0,"app-test-output",3),2&n){const t=e.XpG();e.Y8G("report",t.testTrunkService.inboundCallReport)}}let Md=(()=>{class n{testTrunkService=(0,r.WQX)(at);trunkId=(0,f.hFB)();hasErrors=(0,f.hFB)();inProgress=(0,f.hFB)();cd=(0,r.WQX)(f.gRc);trunksApiService=(0,r.WQX)(p.T);modalService=(0,r.WQX)(j.B);testSub;cancelTest(){this.testSub?.unsubscribe(),this.testSub=void 0,this.cd.markForCheck()}showCallLog(){this.modalService.showDialog(Gn,{log:this.testTrunkService.inbountTestLog})}testCall(){this.cd.markForCheck(),this.testSub=this.trunksApiService.testInboundCall({id:this.trunkId()}).subscribe({complete:()=>{this.cancelTest()},next:t=>{this.testTrunkService.inboundCallReport=t.Reports??[],this.testTrunkService.inbountTestLog=t.Log,this.cd.markForCheck()},error:t=>{this.cancelTest(),this.modalService.error(t)}})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-test-inbound-call"]],inputs:{trunkId:[1,"trunkId"],hasErrors:[1,"hasErrors"],inProgress:[1,"inProgress"]},decls:8,vars:5,consts:[[1,"mb-2","gap-2","d-flex","align-items-center"],["data-qa","cancel-test","type","button",1,"btn","btn-secondary"],["data-qa","spinner","app-spinner-regular-icon","",1,"customSVGIcons","svg-md"],[3,"report"],["data-qa","cancel-test","type","button",1,"btn","btn-secondary",3,"click"],["data-qa","test","type","button",1,"btn","btn-primary",3,"click","disabled"],["data-qa","test-log","type","button",1,"btn","btn-secondary",3,"disabled"],["data-qa","test-log","type","button",1,"btn","btn-secondary",3,"click","disabled"]],template:function(i,o){1&i&&(e.j41(0,"legend")(1,"div",0),e.EFF(2),e.nI1(3,"translate"),e.nV
1h(4,Rd,3,3,"button",1)(5,yd,4,5),e.k0s()(),e.nVh(6,Nd,1,0,"span",2)(7,Sd,1,1,"app-test-output",3)),2&i&&(e.R7$(2),e.SpI(" ",e.bMT(3,3,"_i18n.InboundCallTest")," "),e.R7$(2),e.vxM(o.testSub?4:5),e.R7$(2),e.vxM(o.testSub?6:7))},dependencies:[Pt,a.X1,Pe.a,P.D9],encapsulation:2,changeDetection:0})}return n})();function Ed(n,s){1&n&&e.nrm(0,"span",5)}function Pd(n,s){if(1&n&&e.nrm(0,"app-test-output",6),2&n){const t=e.XpG();e.Y8G("report",t.testTrunkService.trunkReport)("twoColumnsViewOnDesktop",!0)}}let xd=(()=>{class n{testTrunkService=(0,r.WQX)(at);cd=(0,r.WQX)(f.gRc);trunksApiService=(0,r.WQX)(p.T);location=(0,r.WQX)(Xl.aZ);inProgress=(0,r.vPA)(!0);hasErrors=(0,r.vPA)(!1);id=f.hFB.required();trunk=f.hFB.required();refresh$=new Ne.B;constructor(){const t=(0,O.br)(this.id);this.refresh$.pipe((0,R.n)(()=>t),(0,R.n)(i=>(this.inProgress.set(!0),this.trunksApiService.refreshRegistration({trunksRefreshRegistrationRequestBody:{id:+i}}).pipe((0,Ll.c)(2e3),(0,R.n)(()=>this.trunksApiService.runAnalysis({id:+i})),(0,U.W)(o=>(0,Y.of)(void 0))))),(0,O.pQ)()).subscribe({next:i=>{this.inProgress.set(!1),this.testTrunkService.trunkReport=i?.value??[],this.hasErrors.set(this.testTrunkService.trunkReport.some(o=>"Critical"===o.Level||"Error"===o.Level))}}),this.makeTest()}makeTest(){this.refresh$.next(),this.testTrunkService.trunkReport=[],this.cd.markForCheck()}getPageHeader(){return`SIP Trunk Checker [${this.trunk()?.Gateway?.Name}]`}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-test-trunk"]],inputs:{id:[1,"id"],trunk:[1,"trunk"]},features:[e.Jv_([at])],decls:20,vars:18,consts:[[3,"back","header"],["header","","data-qa","generate-report","type","button",1,"btn","btn-primary",3,"click"],[1,"mb-2"],[1,"mb-2","gap-2","d-flex","align-items-center"],["data-qa","test","type","button",1,"btn","btn-primary",3,"click","disabled"],["data-qa","spinner","app-spinner-regular-icon","",1,"customSVGIcons","svg-md"],[3,"report","twoColumnsViewOnDesktop"],[1,"row"],[1,"col-lg-6"],[3,"trunkId","hasErrors","inProgress"]],template:function(i,o){1&i&&(e.j41(0,"app-page",0),e.bIt("back",function(){return o.location.back()}),e.j41(1,"button",1),e.bIt("click",function(){return o.testTrunkService.report(+o.id())}),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"fieldset",2)(6,"legend")(7,"div",3),e.EFF(8),e.nI1(9,"translate"),e.j41(10,"button",4),e.bIt("click",function(){return o.makeTest()}),e.EFF(11),e.nI1(12,"translate"),e.k0s()()(),e.nVh(13,Ed,1,0,"span",5)(14,Pd,1,2,"app-test-output",6),e.k0s(),e.j41(15,"div",7)(16,"fieldset",8),e.nrm(17,"app-test-inbound-call",9),e.k0s(),e.j41(18,"fieldset",8),e.nrm(19,"app-test-outbound-call",9),e.k0s()()()),2&i&&(e.Y8G("header",o.getPageHeader()),e.R7$(3),e.JRh(e.bMT(4,12,"_i18n.GenerateReport")),e.R7$(5),e.SpI(" ",e.bMT(9,14,"_i18n.TrunkAnalysis")," "),e.R7$(2),e.Y8G("disabled",o.inProgress()),e.R7$(),e.SpI(" ",e.bMT(12,16,"_i18n.Start")," "),e.R7$(2),e.vxM(o.inProgress()?13:14),e.R7$(4),e.Y8G("trunkId",o.trunk().Id)("hasErrors",o.hasErrors())("inProgress",o.inProgress()),e.R7$(2),e.Y8G("trunkId",o.trunk().Id)("hasErrors",o.hasErrors())("inProgress",o.inProgress()))},dependencies:[In.H,a.X1,Pt,Md,kd,Pe.a,P.D9],encapsulation:2,changeDetection:0})}return n})();var wt=l(53879);const Fd=[{path:"",component:As,resolve:{params:Fe.cT,restrictions:Tt.E$,websiteAndTrunk:()=>{const n=(0,r.WQX)(oe.s);return(0,r.WQX)(mn).getRecords$().pipe((0,U.W)(t=>n.handleError(t)))},...Mt.C}},{path:"test/:id",component:xd,resolve:{trunk:n=>{const s=(0,r.WQX)(p.T),t=(0,r.WQX)(ve.L),i=(0,r.WQX)(oe.s);return s.getTrunk({id:n.params.id,$select:["RoutingRules","Id","ConfigurationIssue","IsOnline","EnableOutboundCalls","EnableInboundCalls","TrunkRegTimes","Gateway"],$expand:["RoutingRules"]}).pipe((0,R.n)(o=>t.getTrunkTemplate({id:o.Gateway.TemplateFilename}).pipe((0,G.T)(d=>({...o,template:d.Content})),(0,U.W)(d=>(0,Y.of)(o)))),(0,U.W)(o=>i.handleError(o)))}},data:{helpUri:"_i18n.AdminManualUri"}},{path:"trunk/edit/:id",component:va,runGuardsAndResolvers:"pathParamsOrQueryParamsChange",resolve:{trunkData:n=>{const s=+n.params.id,t=(0,r.WQX)(It.o),i=(0,r.WQX)(p.T),o=(0,r.WQX)(j.B),d=(0,r.WQX)(ve.L),c=(0,r.WQX)(oe.s);return i.getTrunk({id:s,$expand:[`RoutingRules($select=Id,Condition,Data,OfficeHoursDestination,RuleName),Groups($select=GroupId,Name,Number;${pn.n0}),EmergencyGeoLocations($expand=Location)`]}).pipe((0,R.n)(v=>{const M=n.queryParams.newTemplate;return M?d.getTrunkTemplate({id:M}).pipe((0,R.n)(E=>(0,ue.vY)(E,t,M).pipe((0,G.T)(X=>({trunk:{...v,...X,Gateway:{...v.Gateway,...X.Gateway}},trunkTemplate:E}))))):d.getTrunkTemplate({id:v.Gateway.TemplateFilename}).pipe((0,R.n)(E=>(0,ue.vY)(E,t).pipe((0,G.T)(X=>({trunk:v,trunkTemplate:E,templateDiff:(0,ue.IS)(X,v)})))))}),(0,U.W)(v=>v instanceof Ds.e?(o.error(v),ge.w):c.handleError(v)))},systemInfo:Sn.M,...ke.T4,...Ge,isAdmin:it.ev},data:{helpUri:"_i18n.AdminManualUri"}},{path:"trunk/new/:provider",component:ia,resolve:{params:Fe.cT,restrictions:Tt.E$,...ke.T4,...Ge,provider:n=>{const s=(0,r.WQX)(ve.L),t=(0,r.WQX)(p.T),i=(0,r.WQX)(oe.s),o=n.params.provider;return(0,te.z)([s.getTrunkTemplate({id:o}),t.initTrunk({template:o})]).pipe((0,G.T)(([d,c])=>({trunk:c,trunkTemplate:d})),(0,U.W)(d=>i.handleError(d)))},systemInfo:Sn.M,...Mt.C},data:{helpUri:"_i18n.AdminManualUri"}},{path:"bridge/master/new",component:Et,resolve:{trunk:()=>{const n=(0,r.WQX)(p.T),s=(0,r.WQX)(oe.s);return n.initMasterBridge().pipe((0,U.W)(t=>s.handleError(t)))},isAdmin:it.ev,publicInfoGroups:wt.k,...Ge,isPaid:Fe.M7},data:{helpUri:"_i18n.AdminManualUri"}},{path:"bridge/slave/new",component:Et,resolve:{trunk:()=>{const n=(0,r.WQX)(p.T),s=(0,r.WQX)(oe.s);return n.initSlaveBridge().pipe((0,U.W)(t=>s.handleError(t)))},isAdmin:it.ev,publicInfoGroups:wt.k,...Ge,isPaid:Fe.M7},data:{helpUri:"_i18n.AdminManualUri"}},{path:"bridge/edit/:id",component:Et,resolve:{trunk:n=>{const s=+n.params.id,t=(0,r.WQX)(p.T),i=(0,r.WQX)(oe.s);return t.getTrunk({id:s,$expand:["ReceiveExtensions($expand=MemberOf)"]}).pipe((0,U.W)(o=>i.handleError(o)))},isAdmin:it.ev,publicInfoGroups:wt.k,...Ge,isPaid:Fe.M7},data:{helpUri:"_i18n.AdminManualUri"}},{path:"messaging",loadChildren:()=>Promise.all([l.e(2076),l.e(8645)]).then(l.bind(l,28645)).then(n=>n.liveChatRoutes)},{path:"sbc/:id",component:il,data:{helpUri:"_i18n.AdminManualUri"},resolve:{...Vs,...ke.T4}},{path:"fxs/:id",component:gl,data:{helpUri:"_i18n.AdminManualUri"},resolve:{networkInterfaces:al.j,dect:n=>{const s=(0,r.WQX)(Me.V),t=(0,r.WQX)(oe.s);return s.getFxs({macAddress:n.params.id,$expand:["Template,Registered"]}).pipe((0,U.W)(i=>t.handleError(i)))},sbcs:Cl.i}}]},5595(J,F,l){"use strict";l.d(F,{p:()=>I});var r=l(89417),f=l(49764),N=l(95604),p=l(32834),w=l(68018),R=l(8516),a=l(35547),m=l(85802);const g=[[["input","hidden",""]],[["",8,"input-group-append"]],[["button"]],[["val-errors"],["show-error-warning"]],[["","description",""]]],S=["input[hidden]",".input-group-append","button","val-errors,show-error-warning","[description]"];function y(T,b){if(1&T){const h=a.RV6();a.j41(0,"app-times-regular-icon",8),a.bIt("click",function(){m.eBV(h);const u=a.XpG();return m.Njj(u.clear())}),a.k0s()}}function _(T,b){if(1&T){const h=a.RV6();a.j41(0,"button",9),a.bIt("click",function(){m.eBV(h);const u=a.XpG();return m.Njj(u.inlineBtnClick())}),a.nrm(1,"lucide-icon",10),a.k0s()}if(2&T){const h=a.XpG();a.Y8G("disabled",h.disabled||h.inlineButtonDisabled),a.R7$(),a.Y8G("img",h.inlineBtnIcon)}}let I=(()=>{class T extends f.${writtenValueConcealed;get concealedUnchanged(){return this.writtenValueConcealed&&!this.changed}get inlineBtnIcon(){return this.concealedUnchanged?void 0:super.inlineBtnIcon}writeValue(h){super.writeValue(h),this.writtenValueConcealed=h?.Concealed??
1!1,this.isConcealed||=this.writtenValueConcealed}parse(h){return h?.Concealed?"**********":h?.Value??""}format(h){return{Value:h}}validate(h){if(!this.concealedUnchanged){if(!this.value&&this.isRequired)return{required:!0};if(this.minlength>0&&this.value&&this.value.length<this.minlength)return{minlength:{requiredLength:this.minlength}}}return super.validate(h)}onPaste(h){this.concealedUnchanged&&(this.value=" "),super.onPaste(h)}preventInvalidInput(h){!h.ctrlKey&&this.concealedUnchanged&&(this.value=" "),super.preventInvalidInput(h)}static \u0275fac=(()=>{let h;return function(u){return(h||(h=a.xGo(T)))(u||T)}})();static \u0275cmp=a.VBU({type:T,selectors:[["field-input-concealed-password"]],features:[a.Jv_([{provide:r.kq,multi:!0,useExisting:T},{provide:r.cz,multi:!0,useExisting:T}]),a.Vt3],ngContentSelectors:S,decls:14,vars:23,consts:[["inputElement",""],[3,"label","labelFor","inlineLabel","disabled","required","description","hint"],[1,"input-group"],["data-qa","input",1,"form-control",3,"ngModelChange","keydown","paste","focus","blur","type","id","maxlength","minlength","autocomplete","name","disabled","readonly","placeholder","ngModel"],["data-qa","clear",1,"clear"],["type","button","data-qa","btn",1,"btn","btn-border","btn-icon",3,"disabled"],["ngProjectAs","val-errors",5,["val-errors"]],["ngProjectAs","[description]",5,["","description",""]],["data-qa","clear",1,"clear",3,"click"],["type","button","data-qa","btn",1,"btn","btn-border","btn-icon",3,"click","disabled"],[3,"img"]],template:function(C,u){1&C&&(a.NAR(g),a.j41(0,"field-wrapper",1)(1,"div",2),a.SdG(2),a.j41(3,"input",3,0),a.nI1(5,"translate"),a.bIt("ngModelChange",function(k){return u.valueChanged(k)})("keydown",function(k){return u.preventInvalidInput(k)})("paste",function(k){return u.onPaste(k)})("focus",function(){return u.onFocus()})("blur",function(k){return u.onBlur(k)}),a.k0s(),a.nVh(6,y,1,0,"app-times-regular-icon",4),a.SdG(7,1),a.SdG(8,2),a.nVh(9,_,2,2,"button",5),a.k0s(),a.qex(10,6),a.SdG(11,3),a.bVm(),a.qex(12,7),a.SdG(13,4),a.bVm(),a.k0s()),2&C&&(a.Y8G("label",u.label)("labelFor",u.id)("inlineLabel",u.inlineLabel)("disabled",u.disabled)("required",u.isRequired)("description",u.description)("hint",u.hint),a.R7$(3),a.AVh("text-truncate",u.readonly),a.Y8G("type",u.type)("id",u.id)("maxlength",u.maxlength??null)("minlength",u.minlength)("autocomplete",u.autocomplete)("name",u.name)("disabled",u.disabled)("readonly",u.readonly||u.noManualInput)("placeholder",a.bMT(5,21,u.indeterminate?u.indeterminatePlaceholder:u.placeholder||""))("ngModel",u.value),a.R7$(3),a.vxM(u.indeterminate&&!u.disabled?6:-1),a.R7$(3),a.vxM(u.inlineBtnIcon?9:-1))},dependencies:[N.z,r.X1,r.me,r.BC,r.xh,r.tU,r.YN,r.vS,p.R,R.flO,R.WGl,w.D9],styles:[".conceal[_nghost-%COMP%]   input[_ngcontent-%COMP%]{-webkit-text-security:disc}","[_nghost-%COMP%]{display:block;margin-bottom:16px}[_nghost-%COMP%]   field-wrapper[_ngcontent-%COMP%]{margin-bottom:0}[_nghost-%COMP%]     .input-group>.btn{border-left:0}.max-length-3[_nghost-%COMP%]     input[type=number]{max-width:calc(12px * 2 + .65em * 3);min-width:calc(12px * 2 + .65em * 3)}.max-length-4[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 2.6em);min-width:calc(24px + 2.6em)}.max-length-5[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 3.25em);min-width:calc(24px + 3.25em)}.max-length-6[_nghost-%COMP%]     input[type=number]{max-width:calc(12px * 2 + .65em * 6);min-width:calc(12px * 2 + .65em * 6)}.max-length-7[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 4.55em);min-width:calc(24px + 4.55em)}.min-length-3[_nghost-%COMP%]     input[type=number]{min-width:calc(12px * 2 + .65em * 3)}.min-length-4[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 2.6em)}.min-length-5[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 3.25em)}.min-length-6[_nghost-%COMP%]     input[type=number]{min-width:calc(12px * 2 + .65em * 6)}.min-length-7[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 4.55em)}[_nghost-%COMP%]   .clear[_ngcontent-%COMP%]{position:absolute;top:10px;right:10px;cursor:pointer;--svg-color: currentColor;--svg-vertical-align: baseline}"],changeDetection:0})}return T})()},49764(J,F,l){"use strict";l.d(F,{$:()=>I});var r=l(35547),f=l(85802),N=l(89417),p=l(84460),w=l(95604),R=l(32834),a=l(68018),m=l(8516);const g=[[["input","hidden",""]],[["",8,"input-group-append"]],[["button"]],[["val-errors"],["show-error-warning"]],[["","description",""]]],S=["input[hidden]",".input-group-append","button","val-errors,show-error-warning","[description]"];function y(T,b){if(1&T){const h=r.RV6();r.j41(0,"app-times-regular-icon",8),r.bIt("click",function(){f.eBV(h);const u=r.XpG();return f.Njj(u.clear())}),r.k0s()}}function _(T,b){if(1&T){const h=r.RV6();r.j41(0,"button",9),r.bIt("click",function(){f.eBV(h);const u=r.XpG();return f.Njj(u.inlineBtnClick())}),r.nrm(1,"lucide-icon",10),r.k0s()}if(2&T){const h=r.XpG();r.Y8G("disabled",h.disabled||h.inlineButtonDisabled),r.R7$(),r.Y8G("img",h.inlineBtnIcon)}}let I=(()=>
1{class T extends p.m{inlineButtonIcon;inlineButtonClick;get hasConcealClass(){return this.isConcealed&&this.concealByClass}get type(){return this.isConcealed&&!this.concealByClass?"password":"text"}get inlineBtnIcon(){return this.isConcealed?m.X_F:m.kU3}get isAutocomplete(){return this.autocomplete&&"off"!==this.autocomplete}inlineBtnClick(){this.isConcealed=!this.isConcealed}get concealByClass(){return this.canConcealByClass&&!this.isAutocomplete}canConcealByClass;isConcealed=!0;constructor(){const h=(0,f.WQX)(r.aKT);super(),this.canConcealByClass="webkitTextSecurity"in window.getComputedStyle(h.nativeElement)}static \u0275fac=function(C){return new(C||T)};static \u0275cmp=r.VBU({type:T,selectors:[["field-input-password"]],hostVars:2,hostBindings:function(C,u){2&C&&r.AVh("conceal",u.hasConcealClass)},features:[r.Jv_([{provide:N.kq,multi:!0,useExisting:T}]),r.Vt3],ngContentSelectors:S,decls:14,vars:23,consts:[["inputElement",""],[3,"label","labelFor","inlineLabel","disabled","required","description","hint"],[1,"input-group"],["data-qa","input",1,"form-control",3,"ngModelChange","keydown","paste","focus","blur","type","id","maxlength","minlength","autocomplete","name","disabled","readonly","placeholder","ngModel"],["data-qa","clear",1,"clear"],["type","button","data-qa","btn",1,"btn","btn-border","btn-icon",3,"disabled"],["ngProjectAs","val-errors",5,["val-errors"]],["ngProjectAs","[description]",5,["","description",""]],["data-qa","clear",1,"clear",3,"click"],["type","button","data-qa","btn",1,"btn","btn-border","btn-icon",3,"click","disabled"],[3,"img"]],template:function(C,u){1&C&&(r.NAR(g),r.j41(0,"field-wrapper",1)(1,"div",2),r.SdG(2),r.j41(3,"input",3,0),r.nI1(5,"translate"),r.bIt("ngModelChange",function(k){return u.valueChanged(k)})("keydown",function(k){return u.preventInvalidInput(k)})("paste",function(k){return u.onPaste(k)})("focus",function(){return u.onFocus()})("blur",function(k){return u.onBlur(k)}),r.k0s(),r.nVh(6,y,1,0,"app-times-regular-icon",4),r.SdG(7,1),r.SdG(8,2),r.nVh(9,_,2,2,"button",5),r.k0s(),r.qex(10,6),r.SdG(11,3),r.bVm(),r.qex(12,7),r.SdG(13,4),r.bVm(),r.k0s()),2&C&&(r.Y8G("label",u.label)("labelFor",u.id)("inlineLabel",u.inlineLabel)("disabled",u.disabled)("required",u.isRequired)("description",u.description)("hint",u.hint),r.R7$(3),r.AVh("text-truncate",u.readonly),r.Y8G("type",u.type)("id",u.id)("maxlength",u.maxlength??null)("minlength",u.minlength)("autocomplete",u.autocomplete)("name",u.name)("disabled",u.disabled)("readonly",u.readonly||u.noManualInput)("placeholder",r.bMT(5,21,u.indeterminate?u.indeterminatePlaceholder:u.placeholder||""))("ngModel",u.value),r.R7$(3),r.vxM(u.indeterminate&&!u.disabled?6:-1),r.R7$(3),r.vxM(u.inlineBtnIcon?9:-1))},dependencies:[w.z,N.X1,N.me,N.BC,N.xh,N.tU,N.YN,N.vS,R.R,m.flO,m.WGl,a.D9],styles:[".conceal[_nghost-%COMP%]   input[_ngcontent-%COMP%]{-webkit-text-security:disc}","[_nghost-%COMP%]{display:block;margin-bottom:16px}[_nghost-%COMP%]   field-wrapper[_ngcontent-%COMP%]{margin-bottom:0}[_nghost-%COMP%]     .input-group>.btn{border-left:0}.max-length-3[_nghost-%COMP%]     input[type=number]{max-width:calc(12px * 2 + .65em * 3);min-width:calc(12px * 2 + .65em * 3)}.max-length-4[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 2.6em);min-width:calc(24px + 2.6em)}.max-length-5[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 3.25em);min-width:calc(24px + 3.25em)}.max-length-6[_nghost-%COMP%]     input[type=number]{max-width:calc(12px * 2 + .65em * 6);min-width:calc(12px * 2 + .65em * 6)}.max-length-7[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 4.55em);min-width:calc(24px + 4.55em)}.min-length-3[_nghost-%COMP%]     input[type=number]{min-width:calc(12px * 2 + .65em * 3)}.min-length-4[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 2.6em)}.min-length-5[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 3.25em)}.min-length-6[_nghost-%COMP%]     input[type=number]{min-width:calc(12px * 2 + .65em * 6)}.min-length-7[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 4.55em)}[_nghost-%COMP%]   .clear[_ngcontent-%COMP%]{position:absolute;top:10px;right:10px;cursor:pointer;--svg-color: currentColor;--svg-vertical-align: baseline}"],changeDetection:0})}return T})()},83975(J,F,l){"use strict";l.d(F,{e:()=>b});var r=l(89417),f=l(84460),N=l(95604),p=l(32834),w=l(68018),R=l(8516),a=l(35547),m=l(85802);const g=[[["input","hidden",""]],[["",8,"input-group-append"]],[["button"]],[["val-errors"],["show-error-warning"]],[["","description",""]]],S=["input[hidden]",".input-group-append","button","val-errors,show-error-warning","[description]"];function y(h,C){if(1&h){const u=a.RV6();a.j41(0,"app-times-regular-icon",8),a.bIt("click",function(){m.eBV(u);const k=a.XpG();return m.Njj(k.clear())}),a.k0s()}}function _(h,C){if(1&h){const u=a.RV6();a.j41(0,"button",9),a.bIt("click",function(){m.eBV(u);const k=a.XpG();return m.Njj(k.inlineBtnClick())}),a.nrm(1,"lucide-icon",10),a.k0s()}if(2&h){const u=a.XpG();a.Y8G("disabled",u.disabled||u.inlineButtonDisabled),a.R7$(),a.Y8G("img",u.inlineBtnIcon)}}function I(h){return/\d/.test(h||"")?"+"+(h||"").replace(/\D/g,"").substring(0,15):""}const T=/^\+([1-9]\d{1,14})?$/;let b=(()=>{class h extends f.m{e164;maxlength=30;outerValue;writeValue(u){super.writeValue(u),this.outerValue=u}valueChanged(u){if(this.e164){this.value=this.setPlusOnStart(u);const x=I(u);return this.onChange(x),void(this.outerValue=x)}super.valueChanged(u),this.outerValue=u}onFocus(){this.e164&&!this.value?.startsWith("+")&&(this.value=this.setPlusOnStart(this.value)),super.onFocus()}onBlur(u){this.e164&&this.value&&(this.value=I(this.value),this.value!==this.outerValue&&(this.onChange(this.value),this.outerValue=this.value)),super.onBlur(u)}validate(u){return this.e164&&u.value&&!T.test(u.value)?{invalidPhoneNumber:!0}:super.validate(u)}setPlusOnStart(u){return("+"+(u||"")).replace(/\+{2,}/,"+")}static \u0275fac=(()=>{let u;
1return function(k){return(u||(u=a.xGo(h)))(k||h)}})();static \u0275cmp=a.VBU({type:h,selectors:[["field-input-phone"]],inputs:{e164:"e164"},features:[a.Jv_([{provide:r.kq,multi:!0,useExisting:h},{provide:r.cz,multi:!0,useExisting:h}]),a.Vt3],ngContentSelectors:S,decls:14,vars:23,consts:[["inputElement",""],[3,"label","labelFor","inlineLabel","disabled","required","description","hint"],[1,"input-group"],["data-qa","input",1,"form-control",3,"ngModelChange","keydown","paste","focus","blur","type","id","maxlength","minlength","autocomplete","name","disabled","readonly","placeholder","ngModel"],["data-qa","clear",1,"clear"],["type","button","data-qa","btn",1,"btn","btn-border","btn-icon",3,"disabled"],["ngProjectAs","val-errors",5,["val-errors"]],["ngProjectAs","[description]",5,["","description",""]],["data-qa","clear",1,"clear",3,"click"],["type","button","data-qa","btn",1,"btn","btn-border","btn-icon",3,"click","disabled"],[3,"img"]],template:function(x,k){1&x&&(a.NAR(g),a.j41(0,"field-wrapper",1)(1,"div",2),a.SdG(2),a.j41(3,"input",3,0),a.nI1(5,"translate"),a.bIt("ngModelChange",function(H){return k.valueChanged(H)})("keydown",function(H){return k.preventInvalidInput(H)})("paste",function(H){return k.onPaste(H)})("focus",function(){return k.onFocus()})("blur",function(H){return k.onBlur(H)}),a.k0s(),a.nVh(6,y,1,0,"app-times-regular-icon",4),a.SdG(7,1),a.SdG(8,2),a.nVh(9,_,2,2,"button",5),a.k0s(),a.qex(10,6),a.SdG(11,3),a.bVm(),a.qex(12,7),a.SdG(13,4),a.bVm(),a.k0s()),2&x&&(a.Y8G("label",k.label)("labelFor",k.id)("inlineLabel",k.inlineLabel)("disabled",k.disabled)("required",k.isRequired)("description",k.description)("hint",k.hint),a.R7$(3),a.AVh("text-truncate",k.readonly),a.Y8G("type",k.type)("id",k.id)("maxlength",k.maxlength??null)("minlength",k.minlength)("autocomplete",k.autocomplete)("name",k.name)("disabled",k.disabled)("readonly",k.readonly||k.noManualInput)("placeholder",a.bMT(5,21,k.indeterminate?k.indeterminatePlaceholder:k.placeholder||""))("ngModel",k.value),a.R7$(3),a.vxM(k.indeterminate&&!k.disabled?6:-1),a.R7$(3),a.vxM(k.inlineBtnIcon?9:-1))},dependencies:[N.z,r.X1,r.me,r.BC,r.xh,r.tU,r.YN,r.vS,p.R,R.flO,R.WGl,w.D9],styles:["[_nghost-%COMP%]{display:block;margin-bottom:16px}[_nghost-%COMP%]   field-wrapper[_ngcontent-%COMP%]{margin-bottom:0}[_nghost-%COMP%]     .input-group>.btn{border-left:0}.max-length-3[_nghost-%COMP%]     input[type=number]{max-width:calc(12px * 2 + .65em * 3);min-width:calc(12px * 2 + .65em * 3)}.max-length-4[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 2.6em);min-width:calc(24px + 2.6em)}.max-length-5[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 3.25em);min-width:calc(24px + 3.25em)}.max-length-6[_nghost-%COMP%]     input[type=number]{max-width:calc(12px * 2 + .65em * 6);min-width:calc(12px * 2 + .65em * 6)}.max-length-7[_nghost-%COMP%]     input[type=number]{max-width:calc(24px + 4.55em);min-width:calc(24px + 4.55em)}.min-length-3[_nghost-%COMP%]     input[type=number]{min-width:calc(12px * 2 + .65em * 3)}.min-length-4[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 2.6em)}.min-length-5[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 3.25em)}.min-length-6[_nghost-%COMP%]     input[type=number]{min-width:calc(12px * 2 + .65em * 6)}.min-length-7[_nghost-%COMP%]     input[type=number]{min-width:calc(24px + 4.55em)}[_nghost-%COMP%]   .clear[_ngcontent-%COMP%]{position:absolute;top:10px;right:10px;cursor:pointer;--svg-color: currentColor;--svg-vertical-align: baseline}"],changeDetection:0})}return h})()},98505(J,F,l){"use strict";l.d(F,{C:()=>N});var r=l(35547),f=l(85802);let N=(()=>{class p{static \u0275fac=function(a){return new(a||p)};static \u0275cmp=r.VBU({type:p,selectors:[["app-arrow-alt-down-solid-icon"],["","app-arrow-alt-down-solid-icon",""]],decls:2,vars:0,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512"],["d","M176 32h96c13.3 0 24 10.7 24 24v200h103.8c21.4 0 32.1 25.8 17 41L241 473c-9.4 9.4-24.6 9.4-34 0L31.3 297c-15.1-15.1-4.4-41 17-41H152V56c0-13.3 10.7-24 24-24z"]],template:function(a,m){1&a&&(f.qSk(),r.rj2(0,"svg",0),r.Hgh(1,"path",1),r.eux())},encapsulation:2})}return p})()},56197(J,F,l){"use strict";l.d(F,{s:()=>N});var r=l(35547),f=l(85802);let N=(()=>{class p{static \u0275fac=function(a){return new(a||p)};static \u0275cmp=r.VBU({type:p,selectors:[["app-up-to-line-solid-icon"],["","app-up-to-line-solid-icon",""]],decls:2,vars:0,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 384 512"],["d","M342.1 262.1L219.3 139.3c-7.2-7.2-17.1-11.3-27.3-11.3s-20.1 4.1-27.3 11.3L41.9 262.1c-6.4 6.4-9.9 15-9.9 24C32 304.8 47.2 320 65.9 320l62.1 0 0 128c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V320l62.1 0c18.7 0 33.9-15.2 33.9-33.9c0-9-3.6-17.6-9.9-24zM32 96H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96z"]],template:function(a,m){1&a&&(f.qSk(),r.rj2(0,"svg",0),r.Hgh(1,"path",1),r.eux())},encapsulation:2})}return p})()},81789(J,F,l){"use strict";l.d(F,{b:()=>y});var r=l(17705),f=l(68580),N=l(68018),p=l(35547),w=l(85802);const R=[[["","icon",""]],[["","dropdown-item",""]]],a=["[icon]","[dropdown-item]"],m=(_,I)=>I.value;
1function g(_,I){if(1&_){const T=p.RV6();p.j41(0,"div",5),p.bIt("click",function(){const h=w.eBV(T).$implicit,C=p.XpG(2);return w.Njj(C.selectedChange.emit(h.value))}),p.EFF(1),p.nI1(2,"translate"),p.k0s()}if(2&_){const T=I.$implicit,b=p.XpG(2);p.AVh("active",T.value===b.selected)("disabled",T.disabled),p.BMQ("data-qa",T.dataQa),p.R7$(),p.SpI(" ",p.bMT(2,6,T.label)," ")}}function S(_,I){if(1&_&&(p.j41(0,"div",3),p.Z7z(1,g,3,8,"div",4,m),p.SdG(3,1),p.k0s()),2&_){const T=p.XpG();p.AVh("dropdown-menu-right","right"===T.alignment),p.R7$(),p.Dyx(T.options)}}let y=(()=>{class _{theme="btn-plain";alignment="right";options;selected;text;disabled;selectedChange=(0,r.CGW)();get buttonText(){return this.text||this.options.find(T=>T.value===this.selected)?.label||""}static \u0275fac=function(b){return new(b||_)};static \u0275cmp=p.VBU({type:_,selectors:[["app-button-with-dropdown"]],inputs:{theme:"theme",alignment:"alignment",options:"options",selected:"selected",text:"text",disabled:"disabled"},outputs:{selectedChange:"selectedChange"},ngContentSelectors:a,decls:7,vars:7,consts:[["dropdown","",1,"btn-group",3,"isDisabled"],["type","button","dropdownToggle","","data-qa","toggle"],["class","dropdown-menu",3,"dropdown-menu-right",4,"dropdownMenu"],[1,"dropdown-menu"],[3,"active","disabled"],[3,"click"]],template:function(b,h){1&b&&(p.NAR(R),p.j41(0,"div",0)(1,"button",1),p.SdG(2),p.j41(3,"span"),p.EFF(4),p.nI1(5,"translate"),p.k0s()(),p.DNE(6,S,4,2,"div",2),p.k0s()),2&b&&(p.Y8G("isDisabled",!0===h.disabled),p.R7$(),p.HbH(p.VkB("btn ",h.theme," dropdown-toggle")),p.R7$(3),p.JRh(p.bMT(5,5,h.buttonText)))},dependencies:[f.Kk,f.hs,f.UL,N.D9],styles:["[_nghost-%COMP%]     .dropdown-menu a, [_nghost-%COMP%]     .dropdown-menu button{color:var(--text-primary);background-color:transparent;border:none;box-shadow:none;text-decoration:none}[_nghost-%COMP%]     .dropdown-menu>*{padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);transition:.2s;cursor:pointer}[_nghost-%COMP%]     .dropdown-menu>*.active, [_nghost-%COMP%]     .dropdown-menu>*:hover{background-color:var(--bg-primary-hover)}[_nghost-%COMP%]     .dropdown-menu>*:disabled, [_nghost-%COMP%]     .dropdown-menu>*.disabled{opacity:.7;cursor:default;background-color:transparent}[_nghost-%COMP%]     .dropdown-menu-right{inset:100% 0 auto auto!important}"],changeDetection:0})}return _})()},60370(J,F,l){"use strict";l.d(F,{M:()=>N});var r=l(35547),f=l(85802);let N=(()=>{class p{typeToken;contentTemplate=(0,f.WQX)(r.C4Q);static ngTemplateContextGuard(R,a){return!0}static \u0275fac=function(a){return new(a||p)};static \u0275dir=r.FsC({type:p,selectors:[["ng-template","typedTemplate",""]],inputs:{typeToken:[0,"typedTemplate","typeToken"]}})}return p})()},78662(J,F,l){"use strict";l.d(F,{m:()=>w});var r=l(97201),f=l(4499),N=l(35547),p=l(85802);let w=(()=>{class R extends f.d{bulkLinksDelete(m,g="body"){const S=m?.websiteLinksBulkLinksDeleteRequestBody;if(null==S)throw new Error("Required parameter websiteLinksBulkLinksDeleteRequestBody was null or undefined when calling bulkLinksDelete.");let y=this.defaultHeaders;y=this.configuration.addCredentialToHeaders("Application","Authorization",y,"Bearer ");const _=this.configuration.selectHeaderAccept(["application/json"]);void 0!==_&&(y=y.set("Accept",_));const T=this.configuration.selectHeaderContentType(["application/json"]);void 0!==T&&(y=y.set("Content-Type",T));let b="json";_&&(b=_.startsWith("text")?"text":this.configuration.isJsonMime(_)?"json":"blob");const{basePath:C,withCredentials:u}=this.configuration;return this.httpClient.request("post",`${C}/WebsiteLinks/Pbx.BulkLinksDelete`,{body:S,responseType:b,...u?{withCredentials:u}:{},headers:y,observe:g})}bulkLinksDeleteQuery(m,g="body",S=!1,y){if(null==m.websiteLinksBulkLinksDeleteRequestBody)throw new Error("Required parameter websiteLinksBulkLinksDeleteRequestBody was null or undefined when calling bulkLinksDelete.");return"/WebsiteLinks/Pbx.BulkLinksDelete"}createWeblink(m,g="body"){const S=m?.pbxWeblink;if(null==S)throw new Error("Required parameter pbxWeblink was null or undefined when calling createWeblink.");let y=this.defaultHeaders;y=this.configuration.addCredentialToHeaders("Application","Authorization",y,"Bearer ");const _=this.configuration.selectHeaderAccept(["application/json"]);void 0!==_&&(y=y.set("Accept",_));const T=this.configuration.selectHeaderContentType(["application/json"]);void 0!==T&&(y=y.set("Content-Type",T));let b="json";_&&(b=_.startsWith("text")?"text":this.configuration.isJsonMime(_)?"json":"blob");const{basePath:C,withCredentials:u}=this.configuration;
1return this.httpClient.request("post",`${C}/WebsiteLinks`,{body:S,responseType:b,...u?{withCredentials:u}:{},headers:y,observe:g})}createWeblinkQuery(m,g="body",S=!1,y){if(null==m.pbxWeblink)throw new Error("Required parameter pbxWeblink was null or undefined when calling createWeblink.");return"/WebsiteLinks"}deleteWeblink(m,g="body"){const S=m?.link;if(null==S)throw new Error("Required parameter link was null or undefined when calling deleteWeblink.");const y=m?.ifMatch;let _=this.defaultHeaders;null!=y&&(_=_.set("If-Match",String(y))),_=this.configuration.addCredentialToHeaders("Application","Authorization",_,"Bearer ");const I=this.configuration.selectHeaderAccept(["application/json"]);void 0!==I&&(_=_.set("Accept",I));let T="json";I&&(T=I.startsWith("text")?"text":this.configuration.isJsonMime(I)?"json":"blob");let b=`/WebsiteLinks(${this.configuration.encodeParam({name:"link",value:S,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})})`;const{basePath:h,withCredentials:C}=this.configuration;return this.httpClient.request("delete",`${h}${b}`,{responseType:T,...C?{withCredentials:C}:{},headers:_,observe:g})}deleteWeblinkQuery(m,g="body",S=!1,y){const _=m.link;if(null==_)throw new Error("Required parameter link was null or undefined when calling deleteWeblink.");return`/WebsiteLinks(${this.configuration.encodeParam({name:"link",value:_,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})})`}getWeblink(m,g="body"){const S=m?.link;if(null==S)throw new Error("Required parameter link was null or undefined when calling getWeblink.");const y=m?.$select,_=m?.$expand;let I=new r.rx(this.encoder);I=this.addToHttpParams(I,"$select",y,r.l2.Form,!1),I=this.addToHttpParams(I,"$expand",_,r.l2.Form,!1);let T=this.defaultHeaders;T=this.configuration.addCredentialToHeaders("Application","Authorization",T,"Bearer ");const b=this.configuration.selectHeaderAccept(["application/json"]);void 0!==b&&(T=T.set("Accept",b));let h="json";b&&(h=b.startsWith("text")?"text":this.configuration.isJsonMime(b)?"json":"blob");let C=`/WebsiteLinks(${this.configuration.encodeParam({name:"link",value:S,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})})`;const{basePath:u,withCredentials:x}=this.configuration;return this.httpClient.request("get",`${u}${C}`,{params:I.toHttpParams(),responseType:h,...x?{withCredentials:x}:{},headers:T,observe:g})}getWeblinkQuery(m,g="body",S=!1,y){const _=m.link;if(null==_)throw new Error("Required parameter link was null or undefined when calling getWeblink.");const I=m.$select,T=m.$expand;let b=new r.rx(this.encoder);return b=this.addToHttpParams(b,"$select",I,r.l2.Form,!1),b=this.addToHttpParams(b,"$expand",T,r.l2.Form,!1),`/WebsiteLinks(${this.configuration.encodeParam({name:"link",value:_,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})})?`+b.toString()}listWeblink(m,g="body"){const S=m?.$top,y=m?.$skip,_=m?.$search,I=m?.$filter,T=m?.$count,b=m?.$orderby,h=m?.$select,C=m?.$expand;let u=new r.rx(this.encoder);u=this.addToHttpParams(u,"$top",S,r.l2.Form,!1),u=this.addToHttpParams(u,"$skip",y,r.l2.Form,!1),u=this.addToHttpParams(u,"$search",_,r.l2.Form,!1),u=this.addToHttpParams(u,"$filter",I,r.l2.Form,!1),u=this.addToHttpParams(u,"$count",T,r.l2.Form,!1),u=this.addToHttpParams(u,"$orderby",b,r.l2.Form,!1),u=this.addToHttpParams(u,"$select",h,r.l2.Form,!1),u=this.addToHttpParams(u,"$expand",C,r.l2.Form,!1);let x=this.defaultHeaders;x=this.configuration.addCredentialToHeaders("Application","Authorization",x,"Bearer ");const k=this.configuration.selectHeaderAccept(["application/json"]);void 0!==k&&(x=x.set("Accept",k));let K="json";k&&(K=k.startsWith("text")?"text":this.configuration.isJsonMime(k)?"json":"blob");const{basePath:De,withCredentials:se}=this.configuration;return this.httpClient.request("get",`${De}/WebsiteLinks`,{params:u.toHttpParams(),responseType:K,...se?{withCredentials:se}:{},headers:x,observe:g})}listWeblinkQuery(m,g="body",S=!1,y){const _=m.$top,I=m.$skip,T=m.$search,b=m.$filter,h=m.$count,C=m.$orderby,u=m.$select,x=m.$expand;let k=new r.rx(this.encoder);return k=this.addToHttpParams(k,"$top",_,r.l2.Form,!1),k=this.addToHttpParams(k,"$skip",I,r.l2.Form,!1),k=this.addToHttpParams(k,"$search",T,r.l2.Form,!1),k=this.addToHttpParams(k,"$filter",b,r.l2.Form,!1),k=this.addToHttpParams(k,"$count",h,r.l2.Form,!1),k=this.addToHttpParams(k,"$orderby",C,r.l2.Form,!1),k=this.addToHttpParams(k,"$select",u,r.l2.Form,!1),k=this.addToHttpParams(k,"$expand",x,r.l2.Form,!1),"/WebsiteLinks?"+k.toString()}updateWeblink(m,g="body"){const S=m?.link;if(null==S)throw new Error("Required parameter link was null or undefined when calling updateWeblink.");const y=m?.pbxWeblink;let _=this.defaultHeaders;_=this.configuration.addCredentialToHeaders("Application","Authorization",_,"Bearer ");const I=this.configuration.selectHeaderAccept(["application/json"]);void 0!==I&&(_=_.set("Accept",I));const b=this.configuration.selectHeaderContentType(["application/json"]);void 0!==b&&(_=_.set("Content-Type",b));let h="json";I&&(h=I.startsWith("text")?"text":this.configuration.isJsonMime(I)?"json":"blob");let C=`/WebsiteLinks(${this.configuration.encodeParam({name:"link",value:S,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})})`;const{basePath:u,withCredentials:x}=this.configuration;return this.httpClient.request("patch",`${u}${C}`,{body:y,responseType:h,...x?{withCredentials:x}:{},headers:_,observe:g})}updateWeblinkQuery(m,g="body",S=!1,y){const _=m.link;if(null==_)throw new Error("Required parameter link was null or undefined when calling updateWeblink.");return`/WebsiteLinks(${this.configuration.encodeParam({name:"link",value:_,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})})`}
1validateLink(m,g="body"){const S=m?.websiteLinksValidateLinkRequestBody;if(null==S)throw new Error("Required parameter websiteLinksValidateLinkRequestBody was null or undefined when calling validateLink.");let y=this.defaultHeaders;y=this.configuration.addCredentialToHeaders("Application","Authorization",y,"Bearer ");const _=this.configuration.selectHeaderAccept(["application/json"]);void 0!==_&&(y=y.set("Accept",_));const T=this.configuration.selectHeaderContentType(["application/json"]);void 0!==T&&(y=y.set("Content-Type",T));let b="json";_&&(b=_.startsWith("text")?"text":this.configuration.isJsonMime(_)?"json":"blob");const{basePath:C,withCredentials:u}=this.configuration;return this.httpClient.request("post",`${C}/WebsiteLinks/Pbx.ValidateLink`,{body:S,responseType:b,...u?{withCredentials:u}:{},headers:y,observe:g})}validateLinkQuery(m,g="body",S=!1,y){if(null==m.websiteLinksValidateLinkRequestBody)throw new Error("Required parameter websiteLinksValidateLinkRequestBody was null or undefined when calling validateLink.");return"/WebsiteLinks/Pbx.ValidateLink"}static \u0275fac=(()=>{let m;return function(S){return(m||(m=N.xGo(R)))(S||R)}})();static \u0275prov=p.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}return R})()},82971(J,F,l){"use strict";l.d(F,{g:()=>r});const r={ContactsSpecifyNameSurnameCompany:"WARNINGS.CONTACTS_SPECIFY_NAME_SURNAME_COMPANY",ContactsSpecifyPhoneNumber:"WARNINGS.CONTACTS_SPECIFY_PHONE_NUMBER",ContactsSpecifyNameSurname:"WARNINGS.CONTACTS_SPECIFY_NAME_SURNAME",StringTooLong:"WARNINGS.STRING_TOO_LONG",LengthNotMore50Chars:"WARNINGS.LENGTH_NOT_MORE_50_CHARS",LengthNotMore255Chars:"WARNINGS.LENGTH_NOT_MORE_255_CHARS",InvalidHexCharacter:"WARNINGS.INVALID_HEX_CHARACTER",NoMoreNumbersAvailable:"WARNINGS.NO_MORE_NUMBERS_AVAILABLE",ErpServerError:"WARNINGS.ERP_SERVER_ERROR",LicenseNotFound:"WARNINGS.LICENSE_NOT_FOUND",LimitReached:"WARNINGS.LIMIT_REACHED",Invalid:"WARNINGS.INVALID",XapiCaptchaError:"WARNINGS.XAPI.CAPTCHA_ERROR",XapiInvalidPinNumber:"WARNINGS.XAPI.INVALID_PIN_NUMBER",XapiNotSupported:"WARNINGS.XAPI.NOT_SUPPORTED",XapiUserRoleDowngrade:"WARNINGS.XAPI.USER_ROLE_DOWNGRADE",GroupCannotBeDeleted:"WARNINGS.GROUP_CANNOT_BE_DELETED",CannotBeDeleted:"WARNINGS.CANNOT_BE_DELETED",GroupWithMembersCannotBeDeleted:"WARNINGS.GROUP_WITH_MEMBERS_CANNOT_BE_DELETED",XapiOtherUserRoleDowngrade:"WARNINGS.XAPI.OTHER_USER_ROLE_DOWNGRADE",XapiInvalidLicenseType:"WARNINGS.XAPI.INVALID_LICENSE_TYPE",InvalidPassword:"WARNINGS.INVALID_PASSWORD",XapiNotFound:"WARNINGS.XAPI.NOT_FOUND",XapiFileNotFound:"WARNINGS.XAPI.FILE_NOT_FOUND",XapiFileNotAccessible:"WARNINGS.XAPI.FILE_NOT_ACCESSIBLE",XapiRequired:"WARNINGS.XAPI.REQUIRED",XapiCanNotBeEmptyString:"WARNINGS.XAPI.CAN_NOT_BE_EMPTY_STRING",XapiDuplicate:"WARNINGS.XAPI.DUPLICATE",XapiMacUsedBy:"WARNINGS.XAPI.MAC_USED_BY",XapiAlreadyInUse:"WARNINGS.XAPI.ALREADY_IN_USE",MacAddressAlreadyInUse:"WARNINGS.MAC_ADDRESS_ALREADY_IN_USE",XapiPlaylistInUse:"WARNINGS.XAPI.PLAYLIST_IN_USE",XapiOutOfTheRange:"WARNINGS.XAPI.OUT_OF_THE_RANGE",XapiTooManyPhones:"WARNINGS.XAPI.TOO_MANY_PHONES",XapiTooManyTrunks:"WARNINGS.XAPI.TOO_MANY_TRUNKS",XapiTooManySbc:"WARNINGS.XAPI.TOO_MANY_SBC",XapiTooManyPrompts:"WARNINGS.XAPI.TOO_MANY_PROMPTS",XapiTooManyItemsInList:"WARNINGS.XAPI.TOO_MANY_ITEMS_IN_LIST",XapiAwsStorageUnderUsage:"WARNINGS.XAPI.AWS_STORAGE_UNDER_USAGE",XapiOutboundRulesLimitReached:"WARNINGS.XAPI.OUTBOUND_RULES_LIMIT_REACHED",XapiForbiddenChange:"WARNINGS.XAPI.FORBIDDEN_CHANGE",FaxServerCannotBeDeleted:"WARNINGS.FAX_SERVER_CANNOT_BE_DELETED",OperatorCannotBeDeleted:"WARNINGS.OPERATOR_CANNOT_BE_DELETED",UserExtensionCannotBeDeleted:"WARNINGS.USER_EXTENSION_CANNOT_BE_DELETED",XapiNumberIgnored:"WARNINGS.XAPI.NUMBER_IGNORED",XapiInvalidTimezone:"WARNINGS.XAPI.INVALID_TIMEZONE",XapiInvalidPath:"WARNINGS.XAPI.INVALID_PATH",XapiPathShouldNotContainSpaces:"WARNINGS.XAPI.PATH_SHOULD_NOT_CONTAIN_SPACES",XapiInvalidCredentials:"WARNINGS.XAPI.INVALID_CREDENTIALS",XapiCannotConnectFtp:"WARNINGS.XAPI.CANNOT_CONNECT_FTP",XapiCannotConnectSmb:"WARNINGS.XAPI.CANNOT_CONNECT_SMB",XapiCannotConnectSftp:"WARNINGS.XAPI.CANNOT_CONNECT_SFTP",XapiCannotConnectGoogleBucket:"WARNINGS.XAPI.CANNOT_CONNECT_GOOGLE_BUCKET",XapiCannotConnectAmazonS3Bucket:"WARNINGS.XAPI.CANNOT_CONNECT_AMAZON_S3_BUCKET",XapiPlaylistNoSource:"WARNINGS.XAPI.PLAYLIST_NO_SOURCE",XapiNoUsersInTeams:"WARNINGS.XAPI.NO_USERS_IN_TEAMS",XapiFileFormatIsIncorrect:"WARNINGS.XAPI.FILE_FORMAT_IS_INCORRECT",XapiInvalidFileName:"WARNINGS.XAPI.INVALID_FILE_NAME",CsvInvalidFileFormat:"WARNINGS.CSV_INVALID_FILE_FORMAT",CsvLineCorrupted:"WARNINGS.CSV_LINE_CORRUPTED",WrongCsvFileRequiredColumnsNotFound:"WARNINGS.WRONG_CSV_FILE_REQUIRED_COLUMNS_NOT_FOUND",CsvImportLimitReached:"WARNINGS.CSV_IMPORT_LIMIT_REACHED",WrongCsvFileRequiredHeaderNotFound:"WARNINGS.WRONG_CSV_FILE_REQUIRED_HEADER_NOT_FOUND",XapiFileIsTooLarge:"WARNINGS.XAPI.FILE_IS_TOO_LARGE",XapiSbcCertFqdnMismatch:"WARNINGS.XAPI.SBC_CERT_FQDN_MISMATCH",XapiSbcCertExpired:"WARNINGS.XAPI.SBC_CERT_EXPIRED",XapiSbcKeyCertMismatch:"WARNINGS.XAPI.SBC_KEY_CERT_MISMATCH",XapiCertificateExpired:"WARNINGS.XAPI.CERTIFICATE_EXPIRED",XapiNonExistentExtNumber:"WARNINGS.XAPI.NON_EXISTENT_EXT_NUMBER",XapiMcmModeRequired:"WARNINGS.XAPI.MCM_MODE_REQUIRED",InternationalprefixIsMissing:"WARNINGS.INTERNATIONALPREFIX_IS_MISSING",XapiChatLogIsDisabled:"WARNINGS.XAPI.CHAT_LOG_IS_DISABLED",WakeupIvrExists:"WARNINGS.WAKEUP_IVR_EXISTS",RingGroupEnablePaging:"WARNINGS.RING_GROUP_ENABLE_PAGING",XapiCreate1SipTruckEmergency:"WARNINGS.XAPI.CREATE_1_SIP_TRUCK_EMERGENCY",InvalidIpMask:"WARNINGS.INVALID_IP_MASK",TooManyBackups:"WARNINGS.TOO_MANY_BACKUPS",BackupLocationConfigError:"WARNINGS.BACKUP_LOCATION_CONFIG_ERROR",BackupNotFoundOrInvalid:"WARNINGS.BACKUP_NOT_FOUND_OR_INVALID",InvalidCallFlowFile:"WARNINGS.INVALID_CALL_FLOW_FILE",AlreadyExpired:"WARNINGS.ALREADY_EXPIRED",ExtractingOutsideTheDestinationDirectory:"WARNINGS.EXTRACTING_OUTSIDE_THE_DESTINATION_DIRECTORY",WiresharkNotFound:"WARNINGS.WIRESHARK_NOT_FOUND",CannotDeleteTrunksBindedErmergencyNumber:"WARNINGS.CANNOT_DELETE_TRUNKS_BINDED_ERMERGENCY_NUMBER",BlacklistNumberLimitExceeded:"WARNINGS.BLACKLIST_NUMBER_LIMIT_EXCEEDED",DoubleQuotesNotAllowed:"WARNINGS.DOUBLE_QUOTES_NOT_ALLOWED",McuRequestAlreadyInProgress:"WARNINGS.MCU_REQUEST_ALREADY_IN_PROGRESS",McuLimitReached:"WARNINGS.MCU_LIMIT_REACHED",McuWebmeetingBridgeNotFound:"WARNINGS.MCU_WEBMEETING_BRIDGE_NOT_FOUND",McuRequestNotFound:"WARNINGS.MCU_REQUEST_NOT_FOUND",McuRequestTimeout:"WARNINGS.MCU_REQUEST_TIMEOUT",ConverterRequestAlreadyInProgress:"WARNINGS.CONVERTER_REQUEST_ALREADY_IN_PROGRESS",ConverterLimitReached:"WARNINGS.CONVERTER_LIMIT_REACHED",ConverterWebmeetingBridgeNotFound:"WARNINGS.CONVERTER_WEBMEETING_BRIDGE_NOT_FOUND",ConverterRequestNotFound:"WARNINGS.CONVERTER_REQUEST_NOT_FOUND",ConverterRequestTimeout:"WARNINGS.CONVERTER_REQUEST_TIMEOUT",XapiOpenaiKeyIsMissing:"WARNINGS.XAPI.OPENAI_KEY_IS_MISSING",LengthNotMore2048Chars:"WARNINGS.LENGTH_NOT_MORE_2048_CHARS",InvalidSecurityCode:"WARNINGS.INVALID_SECURITY_CODE",SupportedMediaFormatWav:"WARNINGS.SUPPORTED_MEDIA_FORMAT_WAV",NoSecretDefined:"WARNINGS.NO_SECRET_DEFINED",UnableReachUpdatesServer:"WARNINGS.UNABLE_REACH_UPDATES_SERVER",ErrorDownloadingFromUpdatesServer:"WARNINGS.ERROR_DOWNLOADING_FROM_UPDATES_SERVER",CaptureLocalhostNotAllowed:"WARNINGS.CAPTURE_LOCALHOST_NOT_ALLOWED",CaptureOngoing:"WARNINGS.CAPTURE_ONGOING"}},81546(J,F,l){"use strict";l.d(F,{f:()=>N});var r=l(39974),f=l(85412);function N(p,w=1/0,R){return w=(w||0)<1?1/0:w,(0,r.N)((a,m)=>(0,f.h)(a,m,p,w,void 0,!0,R))}},3914(J){var F=/\{([0-9a-zA-Z_]+)\}/g;J.exports=function l(r){var f;if(2===arguments.length&&"object"==typeof arguments[1])f=arguments[1];else{f=new Array(arguments.length-1);for(var N=1;N<arguments.length;++N)f[N-1]=arguments[N]}return(!f||!f.hasOwnProperty)&&(f={}),r.replace(F,function(w,R,a){return"{"===r[a-1]&&"}"===r[a+w.length]?R:(f.hasOwnProperty(R)?f[R]:null)??""})}}}]);

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.