| Current Path : /var/www/pms.test.indaco.store/www/ |
| Current File : /var/www/pms.test.indaco.store/www/642.js |
"use strict";(self.webpackChunkpms_frontend=self.webpackChunkpms_frontend||[]).push([[642],{5514:(ee,q)=>{var u=function(){function s(d){if(!d)throw new TypeError("Invalid argument; `value` has no value.");this.value=s.EMPTY,d&&s.isGuid(d)&&(this.value=d)}return s.isGuid=function(d){var T=d.toString();return d&&(d instanceof s||s.validator.test(T))},s.create=function(){return new s([s.gen(2),s.gen(1),s.gen(1),s.gen(1),s.gen(3)].join("-"))},s.createEmpty=function(){return new s("emptyguid")},s.parse=function(d){return new s(d)},s.raw=function(){return[s.gen(2),s.gen(1),s.gen(1),s.gen(1),s.gen(3)].join("-")},s.gen=function(d){for(var T="",I=0;I<d;I++)T+=(65536*(1+Math.random())|0).toString(16).substring(1);return T},s.prototype.equals=function(d){return s.isGuid(d)&&this.value===d.toString()},s.prototype.isEmpty=function(){return this.value===s.EMPTY},s.prototype.toString=function(){return this.value},s.prototype.toJSON=function(){return{value:this.value}},s.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),s.EMPTY="00000000-0000-0000-0000-000000000000",s}();q.i=u},3642:(ee,q,l)=>{l.r(q),l.d(q,{AdminModule:()=>xn});var u=l(6019),s=l(9133),d=l(86),T=l(904),I=l(5304),g=l(8167),f=l(9112),M=l(138),te=l(2663),k=l(8977),Z=l(7964),O=l(6400),b=l(2262),c=l(4176),P=l(2605),h=l(8643),_=l(5175),C=l(4382),ne=l(8735),e=l(3668);let p=(()=>{class n{}return n.admin="admin",n.partners="partners",n.partnerDetail="partner",n.users="users",n.userDetail="user",n.plans="plans",n.planDetail="plan-detail",n.indacoModules="indaco-modules",n.indacoModuleDetail="indaco-module-detail",n.apiKeys="api-keys",n.apiKeyDetail="api-key-detail",n.channels="channels",n})(),v=(()=>{class n{constructor(t){this.router=t,this.currentChildState="",this.router.events.pipe((0,ne.h)(a=>a instanceof C.m2)).subscribe(()=>this.routeChanged())}get partnersRoutingLink(){return`/${p.admin}/${p.partners}`}get usersRoutingLink(){return`/${p.admin}/${p.users}`}get subscriptionPlansRoutingLink(){return`/${p.admin}/${p.plans}`}get indacoModulesRoutingLink(){return`/${p.admin}/${p.indacoModules}`}get apiKeysRoutingLink(){return`/${p.admin}/${p.apiKeys}`}get channelsRoutingLink(){return`/${p.admin}/${p.channels}`}goToPartners(){this.navigateTo(p.partners)}goToPartnerDetail(t){t?this.navigateTo(p.partnerDetail,t):this.navigateTo(p.partnerDetail)}goToUsers(){this.navigateTo(p.users)}goToUserDetail(t,a){this.navigateTo(p.userDetail,null!=t?t:"null",null!=a?a:"")}goToPlans(){this.navigateTo(p.plans)}goToSubscriptionPlanDetail(t){t?this.navigateTo(p.planDetail,t):this.navigateTo(p.planDetail)}goToModules(){this.navigateTo(p.indacoModules)}goToModuleDetail(t){t?this.navigateTo(p.indacoModuleDetail,t):this.navigateTo(p.indacoModuleDetail)}goToApiKeys(){this.navigateTo(p.apiKeys)}goToApiKeyDetail(t){t?this.navigateTo(p.apiKeyDetail,t):this.navigateTo(p.apiKeyDetail)}goToChannels(t){t?this.navigateTo(p.channels,t):this.navigateTo(p.channels)}navigateTo(t,...a){let i="";(null==a?void 0:a.length)>0&&a.forEach(r=>i=i.concat(`/${r}`)),this.router.navigate([`/${p.admin}/${t}${i}`])}routeChanged(){var t,a;this.currentChildState=null!==(a=null===(t=this.router.parseUrl(this.router.url).root.children.primary.segments[1])||void 0===t?void 0:t.path)&&void 0!==a?a:""}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(C.F0))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"any"}),n})(),ae=(()=>{class n{constructor(){}convertToAdminUser(t){var a,i;return JSON.parse(JSON.stringify({_id:t._id,username:t.username,email:t.email,userType:t.userType,partnerId:null===(a=t.partner)||void 0===a?void 0:a._id,password:t._id?"":void 0,userModuleAccessibleFeatures:t.userModuleAccessibleFeatures,plan:null===(i=t.partner)||void 0===i?void 0:i.subscriptionPlan}))}convertToUser(t){return{_id:t._id,username:t.username,email:t.email,userType:t.userType,partner:{_id:t.partnerId,companyName:"",subscriptionPlan:t.plan},userModuleAccessibleFeatures:t.userModuleAccessibleFeatures}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"any"}),n})();var U=l(8053),y=l(189),F=l(5514),$=l(2871);let H=(()=>{class n{constructor(t){this.apollo=t}generateNewApiKey(){return F.i.create().toString()}generateNewApiKeyPrefix(){return F.i.create().toString().split("-")[0]}getAllApiKeys(){const t=y.Ps`
query {
apiKeyMany {
_id,
keyPrefix,
name,
scopes,
enabled,
}
}
`;return this.apollo.query({query:t,fetchPolicy:"network-only"}).pipe((0,U.U)(a=>a.data.apiKeyMany))}getApiKey(t){const a=y.Ps`
query ($apiKeyId: MongoID!) {
apiKeyById (_id: $apiKeyId) {
_id,
keyPrefix,
name,
scopes,
enabled,
}
}
`;return this.apollo.query({query:a,fetchPolicy:"network-only",variables:{apiKeyId:t}}).pipe((0,U.U)(i=>i.data.apiKeyById))}saveApiKey(t){const a=this.getSaveMutation(t),i=Object.assign({},t);return this.sanitizeRecord(i),this.apollo.mutate({mutation:a,fetchPolicy:"network-only",variables:{apiKeyId:t._id,apiKeyRecord:i}}).pipe((0,U.U)(r=>t._id?r.data.apiKeyUpdateById.recordId:r.data.apiKeyCreateOne.recordId))}getSaveMutation(t){return t._id?y.Ps`
mutation ($apiKeyId: MongoID!, $apiKeyRecord: UpdateByIdApiKeyInput!) {
apiKeyUpdateById (_id: $apiKeyId, record: $apiKeyRecord) {
recordId
}
}
`:y.Ps`
mutation($apiKeyRecord: CreateOneApiKeyInput!) {
apiKeyCreateOne (record: $apiKeyRecord) {
recordId
}
}
`}sanitizeRecord(t){for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&a.startsWith("_")&&delete t[a]}}return n.\u0275fac=function(t){return new(t||n)(e.LFG($._M))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"any"}),n})();var J=l(4587),A=l(9966);const ie=["*"];let S=(()=>{class n{constructor(t){this.navigationService=t}get partnersRoutingLink(){return this.navigationService.partnersRoutingLink}get usersRoutingLink(){return this.navigationService.usersRoutingLink}get subscriptionPlansRoutingLink(){return this.navigationService.subscriptionPlansRoutingLink}get indacoModulesRoutingLink(){return this.navigationService.indacoModulesRoutingLink}get apiKeysRoutingLink(){return this.navigationService.apiKeysRoutingLink}get channelsRoutingLink(){return this.navigationService.channelsRoutingLink}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-admin"]],ngContentSelectors:ie,decls:43,vars:33,consts:[["mat-tab-nav-bar",""],["mat-tab-link","","routerLinkActive","",3,"routerLink","active"],["partnersla","routerLinkActive"],[1,"mat-18"],["susbscriptionplansla","routerLinkActive"],["indacomodulesla","routerLinkActive"],["usersla","routerLinkActive"],["apikeysla","routerLinkActive"],["channelsla","routerLinkActive"]],template:function(t,a){if(1&t&&(e.F$t(),e.TgZ(0,"mat-toolbar"),e.TgZ(1,"mat-icon"),e._uU(2,"settings"),e.qZA(),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"nav",0),e.TgZ(6,"a",1,2),e.TgZ(8,"mat-icon",3),e._uU(9,"business"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"a",1,4),e.TgZ(14,"mat-icon",3),e._uU(15,"ballot"),e.qZA(),e._uU(16),e.ALo(17,"translate"),e.qZA(),e.TgZ(18,"a",1,5),e.TgZ(20,"mat-icon",3),e._uU(21,"notes"),e.qZA(),e._uU(22),e.ALo(23,"translate"),e.qZA(),e.TgZ(24,"a",1,6),e.TgZ(26,"mat-icon",3),e._uU(27,"group"),e.qZA(),e._uU(28),e.ALo(29,"translate"),e.qZA(),e.TgZ(30,"a",1,7),e.TgZ(32,"mat-icon",3),e._uU(33,"vpn_key"),e.qZA(),e._uU(34),e.ALo(35,"translate"),e.qZA(),e.TgZ(36,"a",1,8),e.TgZ(38,"mat-icon",3),e._uU(39,"signpost"),e.qZA(),e._uU(40),e.ALo(41,"translate"),e.qZA(),e.qZA(),e.Hsn(42)),2&t){const i=e.MAs(7),r=e.MAs(13),m=e.MAs(19),x=e.MAs(25),w=e.MAs(31),L=e.MAs(37);e.xp6(3),e.hij(" ",e.lcZ(4,19,"shared.admin"),"\n"),e.xp6(3),e.Q6J("routerLink",a.partnersRoutingLink)("active",i.isActive),e.xp6(4),e.hij(" ",e.lcZ(11,21,"app.admin.partners.title")," "),e.xp6(2),e.Q6J("routerLink",a.subscriptionPlansRoutingLink)("active",r.isActive),e.xp6(4),e.hij(" ",e.lcZ(17,23,"app.admin.subscriptionPlans.title")," "),e.xp6(2),e.Q6J("routerLink",a.indacoModulesRoutingLink)("active",m.isActive),e.xp6(4),e.hij(" ",e.lcZ(23,25,"app.admin.modules.title")," "),e.xp6(2),e.Q6J("routerLink",a.usersRoutingLink)("active",x.isActive),e.xp6(4),e.hij(" ",e.lcZ(29,27,"app.admin.users.title")," "),e.xp6(2),e.Q6J("routerLink",a.apiKeysRoutingLink)("active",w.isActive),e.xp6(4),e.hij(" ",e.lcZ(35,29,"app.admin.apiKeys.title")," "),e.xp6(2),e.Q6J("routerLink",a.channelsRoutingLink)("active",L.isActive),e.xp6(4),e.hij(" ",e.lcZ(41,31,"app.channels.title")," ")}},directives:[h.Ye,f.Hw,P.BU,C.yS,P.Nj,C.Od],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();const oe=["partnersPaginator"],re=["partnersSort"];function se(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function le(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.companyName")," "))}function ce(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.companyName," ")}}function pe(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.seller")," "))}function de(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.seller," ")}}function ue(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.email")," "))}function me(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.email," ")}}function _e(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.status")," "))}function ge(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.active?"app.admin.partners.enabled":"app.admin.partners.disabled")," ")}}function fe(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.vatNumber")," "))}function he(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.vatNumber," ")}}function Ze(n,o){1&n&&(e.TgZ(0,"th",26),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function ve(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",25),e.TgZ(1,"button",27),e.NdJ("click",function(){const r=e.CHM(t).$implicit;return e.oxw(2).openPartnerDetail(r)}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA(),e.qZA(),e.qZA()}}function Ce(n,o){1&n&&e._UZ(0,"tr",28)}function xe(n,o){1&n&&e._UZ(0,"tr",29)}const Te=function(){return[10,20,30]};function Ae(n,o){if(1&n&&(e.TgZ(0,"div",7),e.TgZ(1,"div",8),e.TgZ(2,"table",9,10),e.ynx(4,11),e.YNc(5,le,3,3,"th",12),e.YNc(6,ce,2,1,"td",13),e.BQk(),e.ynx(7,14),e.YNc(8,pe,3,3,"th",12),e.YNc(9,de,2,1,"td",13),e.BQk(),e.ynx(10,15),e.YNc(11,ue,3,3,"th",12),e.YNc(12,me,2,1,"td",13),e.BQk(),e.ynx(13,16),e.YNc(14,_e,3,3,"th",12),e.YNc(15,ge,3,3,"td",13),e.BQk(),e.ynx(16,17),e.YNc(17,fe,3,3,"th",12),e.YNc(18,he,2,1,"td",13),e.BQk(),e.ynx(19,18),e.YNc(20,Ze,3,3,"th",19),e.YNc(21,ve,4,0,"td",13),e.BQk(),e.YNc(22,Ce,1,0,"tr",20),e.YNc(23,xe,1,0,"tr",21),e.qZA(),e._UZ(24,"mat-paginator",22,23),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.partnersDataSource),e.xp6(20),e.Q6J("matHeaderRowDef",t.partnersDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.partnersDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,Te))}}let be=(()=>{class n{constructor(t,a,i){this.partnerService=t,this.navigationService=a,this.snackBar=i,this.partners=[],this.partnersDataSource=new c.by(this.partners),this.partnersDisplayedColumns=["companyName","seller","email","vatNumber","actions"],this.loading=!1}ngOnInit(){this.fetchPartners()}openPartnerDetail(t){this.navigationService.goToPartnerDetail(t._id)}createNewPartner(){this.navigationService.goToPartnerDetail()}fetchPartners(){this.loading=!0,this.partnerService.getAllPartners().subscribe(t=>{this.partners=t,this.partnersDataSource.data=this.partners,setTimeout(()=>{this.partnersDataSource.sort=this.partnersSort,this.partnersDataSource.paginator=this.partnersPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.b),e.Y36(v),e.Y36(A.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-partners"]],viewQuery:function(t,a){if(1&t&&(e.Gf(oe,5),e.Gf(re,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.partnersPaginator=i.first),e.iGM(i=e.CRH())&&(a.partnersSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["partnersSort","matSort"],["matColumnDef","companyName"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","seller"],["matColumnDef","email"],["matColumnDef","active"],["matColumnDef","vatNumber"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["partnersPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin"),e.TgZ(1,"mat-toolbar"),e.TgZ(2,"mat-icon",0),e._uU(3,"business"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewPartner()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.qZA(),e.YNc(12,se,2,0,"div",3),e.YNc(13,Ae,26,5,"div",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.partners.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[S,h.Ye,f.Hw,d.lW,u.O5,Z.$g,c.BZ,b.YE,c.w1,c.fO,c.Dz,c.as,c.nj,k.NW,c.ge,b.nU,c.ev,c.XQ,c.Gk],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}#partners-list[_ngcontent-%COMP%]{padding:30px}"]}),n})();var ye=l(1915);let K=(()=>{class n{constructor(t){this.apollo=t}getAllSubscriptionPlans(){const t=y.Ps`
query {
subscriptionPlanMany {
_id,
name,
indacoModules {
_id,
code,
name,
},
}
}
`;return this.apollo.query({query:t,fetchPolicy:"network-only"}).pipe((0,U.U)(a=>a.data.subscriptionPlanMany))}getSubscriptionPlan(t){const a=y.Ps`
query ($subscriptionPlanId: MongoID!) {
subscriptionPlanById (_id: $subscriptionPlanId) {
_id,
name,
indacoModulesIds,
indacoModules {
_id,
code,
name
},
}
}
`;return this.apollo.query({query:a,fetchPolicy:"network-only",variables:{subscriptionPlanId:t}}).pipe((0,U.U)(i=>i.data.subscriptionPlanById))}saveSubscriptionPlan(t){const a=this.getSaveMutation(t),i=Object.assign({},t);for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&r.startsWith("_")&&delete i[r];return i.indacoModulesIds=t.indacoModules.map(r=>r._id),delete i.indacoModules,this.apollo.mutate({mutation:a,fetchPolicy:"network-only",variables:{subscriptionPlanId:t._id,subscriptionPlanRecord:i}}).pipe((0,U.U)(r=>t._id?r.data.subscriptionPlanUpdateById.recordId:r.data.subscriptionPlanCreateOne.recordId))}getSaveMutation(t){return t._id?y.Ps`
mutation ($subscriptionPlanId: MongoID!, $subscriptionPlanRecord: UpdateByIdSubscriptionPlanInput!) {
subscriptionPlanUpdateById (_id: $subscriptionPlanId, record: $subscriptionPlanRecord) {
recordId
}
}
`:y.Ps`
mutation ($subscriptionPlanRecord: CreateOneSubscriptionPlanInput!) {
subscriptionPlanCreateOne (record: $subscriptionPlanRecord) {
recordId
}
}
`}}return n.\u0275fac=function(t){return new(t||n)(e.LFG($._M))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var R=l(6731);function Pe(n,o){1&n&&(e.TgZ(0,"div",2),e._UZ(1,"mat-spinner",3),e.qZA())}function Me(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).partner.companyName=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function Ue(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).partner.seller=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function ke(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).partner.email=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function Se(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).partner.address=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function qe(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).partner.phone=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function Ie(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).partner.vatNumber=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function De(n,o){if(1&n&&(e.TgZ(0,"mat-option",13),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.Q6J("value",t._id),e.xp6(1),e.Oqu(t.name)}}function Ne(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",4),e.TgZ(1,"mat-form-field",5),e.TgZ(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",6),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.companyName=i}),e.qZA(),e.YNc(6,Me,3,0,"button",7),e.qZA(),e.TgZ(7,"mat-form-field",5),e.TgZ(8,"mat-label"),e._uU(9),e.ALo(10,"translate"),e.qZA(),e.TgZ(11,"input",8),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.seller=i}),e.qZA(),e.YNc(12,Ue,3,0,"button",7),e.qZA(),e.TgZ(13,"mat-form-field",5),e.TgZ(14,"mat-label"),e._uU(15),e.ALo(16,"translate"),e.qZA(),e.TgZ(17,"input",8),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.email=i}),e.qZA(),e.YNc(18,ke,3,0,"button",7),e.qZA(),e.TgZ(19,"mat-form-field",5),e.TgZ(20,"mat-label"),e._uU(21),e.ALo(22,"translate"),e.qZA(),e.TgZ(23,"input",8),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.address=i}),e.qZA(),e.YNc(24,Se,3,0,"button",7),e.qZA(),e.TgZ(25,"mat-form-field",5),e.TgZ(26,"mat-label"),e._uU(27),e.ALo(28,"translate"),e.qZA(),e.TgZ(29,"input",8),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.phone=i}),e.qZA(),e.YNc(30,qe,3,0,"button",7),e.qZA(),e.TgZ(31,"mat-form-field",5),e.TgZ(32,"mat-label"),e._uU(33),e.ALo(34,"translate"),e.qZA(),e.TgZ(35,"input",6),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.vatNumber=i}),e.qZA(),e.YNc(36,Ie,3,0,"button",7),e.qZA(),e.TgZ(37,"mat-form-field",5),e.TgZ(38,"mat-label"),e._uU(39),e.ALo(40,"translate"),e.qZA(),e.TgZ(41,"mat-select",9),e.NdJ("valueChange",function(i){return e.CHM(t),e.oxw().partner.subscriptionPlanId=i}),e.YNc(42,De,2,2,"mat-option",10),e.qZA(),e.qZA(),e.TgZ(43,"mat-checkbox",11),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.active=i}),e._uU(44),e.ALo(45,"translate"),e.qZA(),e.TgZ(46,"mat-checkbox",11),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().partner.enabled=i}),e._uU(47),e.ALo(48,"translate"),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,25,"app.admin.partners.companyName")),e.xp6(2),e.Q6J("ngModel",t.partner.companyName),e.xp6(1),e.Q6J("ngIf",t.partner.companyName),e.xp6(3),e.Oqu(e.lcZ(10,27,"app.admin.partners.seller")),e.xp6(2),e.Q6J("ngModel",t.partner.seller),e.xp6(1),e.Q6J("ngIf",t.partner.seller),e.xp6(3),e.Oqu(e.lcZ(16,29,"app.admin.partners.email")),e.xp6(2),e.Q6J("ngModel",t.partner.email),e.xp6(1),e.Q6J("ngIf",t.partner.email),e.xp6(3),e.Oqu(e.lcZ(22,31,"app.admin.partners.address")),e.xp6(2),e.Q6J("ngModel",t.partner.address),e.xp6(1),e.Q6J("ngIf",t.partner.address),e.xp6(3),e.Oqu(e.lcZ(28,33,"app.admin.partners.phone")),e.xp6(2),e.Q6J("ngModel",t.partner.phone),e.xp6(1),e.Q6J("ngIf",t.partner.phone),e.xp6(3),e.Oqu(e.lcZ(34,35,"app.admin.partners.vatNumber")),e.xp6(2),e.Q6J("ngModel",t.partner.vatNumber),e.xp6(1),e.Q6J("ngIf",t.partner.vatNumber),e.xp6(3),e.Oqu(e.lcZ(40,37,"app.admin.partners.subscriptionPlan")),e.xp6(2),e.Q6J("value",t.partner.subscriptionPlanId),e.xp6(1),e.Q6J("ngForOf",t.plans),e.xp6(1),e.Q6J("ngModel",t.partner.active),e.xp6(1),e.Oqu(e.lcZ(45,39,"app.admin.partners.active")),e.xp6(2),e.Q6J("ngModel",t.partner.enabled),e.xp6(1),e.Oqu(e.lcZ(48,41,"app.admin.partners.enabled"))}}let j=(()=>{class n{constructor(t,a,i,r){this.snackBar=t,this.partnerService=a,this.planService=i,this.translateService=r,this.partnerSaved=new e.vpe,this.loading=!1,this.plans=[]}get partner(){var t;return this._partner||this.emtpyPartner(),null!==(t=this._partner)&&void 0!==t?t:this.createEmptyPartner()}ngOnInit(){this.initPage()}save(){!this.validateInput()||(this.loading=!0,this.partnerService.savePartner(this.partner).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchPartner(t,!1),this.partnerSaved.emit(t)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}refresh(){this.partner._id?this.fetchPartner(this.partner._id):this.emtpyPartner()}initPage(){this.planService.getAllSubscriptionPlans().subscribe(t=>this.plans=t).add(()=>{this.partnerId&&this.fetchPartner(this.partnerId)})}fetchPartner(t,a=!0){return a&&(this.loading=!0),(0,ye.D)(this.partnerService.getPartner(t)).subscribe(i=>this._partner=Object.assign({},i)).add(()=>{a&&(this.loading=!1)})}emtpyPartner(){this._partner=this.createEmptyPartner()}createEmptyPartner(){return{_id:"",companyName:"",email:"",address:"",phone:"",active:!1,enabled:!1,forcePasswordChange:!0,subscriptionPlanId:"",vatNumber:"",seller:""}}validateInput(){return""!==this.partner.companyName&&""!==this.partner.vatNumber}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(A.ux),e.Y36(J.b),e.Y36(K),e.Y36(_.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["partner-info"]],inputs:{partnerId:"partnerId"},outputs:{partnerSaved:"partnerSaved"},decls:2,vars:2,consts:[["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["matInput","","type","text",3,"ngModel","ngModelChange"],[3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[1,"example-margin",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[3,"value"]],template:function(t,a){1&t&&(e.YNc(0,Pe,2,0,"div",0),e.YNc(1,Ne,49,43,"div",1)),2&t&&(e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[u.O5,Z.$g,g.KE,g.hX,M.Nt,s.Fj,s.Q7,s.JJ,s.On,O.gD,u.sg,T.oG,d.lW,g.R9,f.Hw,R.ey],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();var we=l(8922),Oe=l(2805),Je=l(1195),Ke=l(4384),E=l(7422),Y=l(3493),B=l(5425);function Ye(n,o){1&n&&(e.TgZ(0,"div",4),e._UZ(1,"mat-spinner",5),e.qZA())}function Qe(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"users-grid",6),e.NdJ("openClicked",function(i){return e.CHM(t),e.oxw().openUserDetail(i)})("deleteUserClicked",function(i){return e.CHM(t),e.oxw().deleteUser(i)})("resetPasswordClicked",function(i){return e.CHM(t),e.oxw().resetPassword(i)}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("users",t.users)}}let Le=(()=>{class n{constructor(t,a,i){this.userService=t,this.navigationService=a,this.snackBar=i,this.users=[],this.loading=!1}ngOnInit(){this.fetchUsers()}openUserDetail(t){this.navigationService.goToUserDetail(t._id,this.partnerId)}createNewUser(){this.navigationService.goToUserDetail(void 0,this.partnerId)}deleteUser(t){t._id&&(this.loading=!0,this.userService.deleteUser(t._id).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}resetPassword(t){this.loading=!0,this.userService.resetPassword(t.user,t.newPassword).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}fetchUsers(){this.loading=!0,this.partnerId&&this.userService.getPartnerUsers(this.partnerId).subscribe(t=>{this.users=t}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Y.f),e.Y36(v),e.Y36(A.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["partner-users"]],inputs:{partnerId:"partnerId"},decls:9,vars:5,consts:[[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar"),e._UZ(1,"span",0),e.TgZ(2,"button",1),e.NdJ("click",function(){return a.createNewUser()}),e.TgZ(3,"mat-icon"),e._uU(4,"add"),e.qZA(),e._uU(5),e.ALo(6,"translate"),e.qZA(),e.qZA(),e.YNc(7,Ye,2,0,"div",2),e.YNc(8,Qe,1,1,"users-grid",3)),2&t&&(e.xp6(5),e.hij(" ",e.lcZ(6,3,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[h.Ye,d.lW,f.Hw,u.O5,Z.$g,B.Y],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();function Fe(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"info"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.info")," "))}function $e(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"partner-info",8),e.NdJ("partnerSaved",function(i){return e.CHM(t),e.oxw().partnerSaved(i)}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("partnerId",t.partnerId)}}function He(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"group"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.users")," "))}function Re(n,o){if(1&n&&e._UZ(0,"partner-users",6),2&n){const t=e.oxw(2);e.Q6J("partnerId",t.partnerId)}}function je(n,o){1&n&&(e.TgZ(0,"mat-tab"),e.YNc(1,He,4,3,"ng-template",3),e.YNc(2,Re,1,1,"ng-template",4),e.qZA())}function Ee(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"inventory_2"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.catalog")," "))}function Be(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"price_check"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.priceList")," "))}function Ge(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"inventory_2"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.warehouse")," "))}function Xe(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"format_list_bulleted"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.listings")," "))}function ze(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"signpost"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.channels")," "))}let G=(()=>{class n{constructor(t,a){this.navigationService=t,this.route=a}get isNewPartner(){return!this.partnerId}ngOnInit(){this.partnerId=this.route.snapshot.paramMap.get("id")}partnerSaved(t){this.partnerId=t}back(){this.navigationService.goToPartners()}save(){this.partnerInfoComponent.save()}refresh(){this.partnerInfoComponent.refresh()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(v),e.Y36(C.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-partner-detail"]],viewQuery:function(t,a){if(1&t&&e.Gf(j,5),2&t){let i;e.iGM(i=e.CRH())&&(a.partnerInfoComponent=i.first)}},decls:40,vars:18,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["mat-tab-label",""],["matTabContent",""],[4,"ngIf"],[3,"partnerId"],[1,"mat-18"],[3,"partnerId","partnerSaved"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar"),e.TgZ(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA(),e.qZA(),e.TgZ(20,"mat-tab-group"),e.TgZ(21,"mat-tab"),e.YNc(22,Fe,4,3,"ng-template",3),e.YNc(23,$e,1,1,"ng-template",4),e.qZA(),e.YNc(24,je,3,0,"mat-tab",5),e.TgZ(25,"mat-tab"),e.YNc(26,Ee,4,3,"ng-template",3),e._UZ(27,"app-references",6),e.qZA(),e.TgZ(28,"mat-tab"),e.YNc(29,Be,4,3,"ng-template",3),e._UZ(30,"app-price-list",6),e.qZA(),e.TgZ(31,"mat-tab"),e.YNc(32,Ge,4,3,"ng-template",3),e._UZ(33,"app-warehouses",6),e.qZA(),e.TgZ(34,"mat-tab"),e.YNc(35,Xe,4,3,"ng-template",3),e._UZ(36,"app-listings",6),e.qZA(),e.TgZ(37,"mat-tab"),e.YNc(38,ze,4,3,"ng-template",3),e._UZ(39,"app-channels",6),e.qZA(),e.qZA()),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,10,"app.admin.partners.partner")),e.xp6(6),e.hij(" ",e.lcZ(9,12,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,14,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,16,"shared.buttons.save")," "),e.xp6(6),e.Q6J("ngIf",!a.isNewPartner),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId))},directives:[h.Ye,d.lW,f.Hw,P.SP,P.uX,P.uD,P.Vc,u.O5,we.x,Oe.D,Je.O,Ke.b,E.J,j,Le],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();const We=["usersPaginator"],Ve=["usersSort"];function et(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function tt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"users-grid",7),e.NdJ("openClicked",function(i){return e.CHM(t),e.oxw().openUserDetail(i)})("deleteUserClicked",function(i){return e.CHM(t),e.oxw().deleteUser(i)})("resetPasswordClicked",function(i){return e.CHM(t),e.oxw().resetPassword(i)}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("users",t.users)}}let nt=(()=>{class n{constructor(t,a,i){this.userService=t,this.navigationService=a,this.snackBar=i,this.users=[],this.usersDataSource=new c.by,this.loading=!1,this.usersDisplayedColumns=["username","email","actions"]}ngOnInit(){this.fetchUsers()}openUserDetail(t){this.navigationService.goToUserDetail(t._id)}createNewUser(){this.navigationService.goToUserDetail()}deleteUser(t){t._id&&(this.loading=!0,this.userService.deleteUser(t._id).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}resetPassword(t){this.loading=!0,this.userService.resetPassword(t.user,t.newPassword).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}fetchUsers(){this.loading=!0,this.userService.getAllSuperAdmins().subscribe(t=>{this.users=t,this.usersDataSource=new c.by(this.users),setTimeout(()=>{this.usersDataSource.sort=this.usersSort,this.usersDataSource.paginator=this.usersPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Y.f),e.Y36(v),e.Y36(A.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-users"]],viewQuery:function(t,a){if(1&t&&(e.Gf(We,5),e.Gf(Ve,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.usersPaginator=i.first),e.iGM(i=e.CRH())&&(a.usersSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked"]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin"),e.TgZ(1,"mat-toolbar"),e.TgZ(2,"mat-icon",0),e._uU(3,"group"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewUser()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.qZA(),e.YNc(12,et,2,0,"div",3),e.YNc(13,tt,1,1,"users-grid",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.users.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[S,h.Ye,f.Hw,d.lW,u.O5,Z.$g,B.Y],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();var X=l(6509),D=l(2202);function at(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function it(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).user.username=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function ot(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).user.email=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function rt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw(3).user.password=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function st(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8),e.TgZ(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"input",15),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw(2).user.password=i}),e.qZA(),e.YNc(5,rt,3,0,"button",10),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,3,"app.admin.users.password")),e.xp6(2),e.Q6J("ngModel",t.user.password),e.xp6(1),e.Q6J("ngIf",t.user.password)}}function lt(n,o){if(1&n&&(e.TgZ(0,"mat-option",18),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=o.$implicit;e.Q6J("value",t.value),e.xp6(1),e.Oqu(e.lcZ(2,2,"app.admin.users."+t.key.toLowerCase()))}}function ct(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8),e.TgZ(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"mat-select",16),e.NdJ("valueChange",function(i){return e.CHM(t),e.oxw(2).user.userType=i}),e.YNc(5,lt,3,4,"mat-option",17),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,3,"app.admin.users.userType")),e.xp6(2),e.Q6J("value",t.user.userType),e.xp6(1),e.Q6J("ngForOf",t.userTypes)}}function pt(n,o){if(1&n&&(e.TgZ(0,"mat-option",18),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.Q6J("value",t._id),e.xp6(1),e.Oqu(t.companyName)}}function dt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8),e.TgZ(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"mat-select",19),e.NdJ("valueChange",function(i){return e.CHM(t),e.oxw(2).user.partnerId=i})("valueChange",function(){return e.CHM(t),e.oxw(2).partnerChanged()}),e.YNc(5,pt,2,2,"mat-option",17),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,4,"app.admin.users.partner")),e.xp6(2),e.Q6J("value",t.user.partnerId)("disabled",t.predeterminedPartnerId),e.xp6(1),e.Q6J("ngForOf",t.partners)}}function ut(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"mat-checkbox",23),e.NdJ("change",function(i){const m=e.CHM(t).$implicit,x=e.oxw().$implicit;return e.oxw(3).featureActiveChanged(i,x,m)}),e._uU(2),e.qZA(),e.qZA()}if(2&n){const t=o.$implicit,a=e.oxw().$implicit,i=e.oxw(3);e.xp6(1),e.Q6J("disabled",i.isModuleDisabled(a))("checked",i.isFeatureActive(a,t)),e.xp6(1),e.hij(" ",t.name," ")}}function mt(n,o){if(1&n&&(e.TgZ(0,"div",21),e.TgZ(1,"h3"),e._uU(2),e.qZA(),e.YNc(3,ut,3,3,"div",22),e.qZA()),2&n){const t=o.$implicit;e.xp6(2),e.Oqu(t.name),e.xp6(1),e.Q6J("ngForOf",t.moduleAccessibleFeatures)}}function _t(n,o){if(1&n&&(e.TgZ(0,"div"),e.TgZ(1,"h2"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.YNc(4,mt,4,2,"div",20),e.qZA()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,2,"app.admin.users.features")),e.xp6(2),e.Q6J("ngForOf",t.modules)}}function gt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7),e.TgZ(1,"mat-form-field",8),e.TgZ(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().user.username=i}),e.qZA(),e.YNc(6,it,3,0,"button",10),e.qZA(),e.TgZ(7,"mat-form-field",8),e.TgZ(8,"mat-label"),e._uU(9),e.ALo(10,"translate"),e.qZA(),e.TgZ(11,"input",11),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().user.email=i}),e.qZA(),e.YNc(12,ot,3,0,"button",10),e.qZA(),e.YNc(13,st,6,5,"mat-form-field",12),e.YNc(14,ct,6,5,"mat-form-field",12),e.YNc(15,dt,6,6,"mat-form-field",12),e.YNc(16,_t,5,4,"div",13),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,10,"app.admin.users.username")),e.xp6(2),e.Q6J("ngModel",t.user.username),e.xp6(1),e.Q6J("ngIf",t.user.username),e.xp6(3),e.Oqu(e.lcZ(10,12,"app.admin.users.email")),e.xp6(2),e.Q6J("ngModel",t.user.email),e.xp6(1),e.Q6J("ngIf",t.user.email),e.xp6(1),e.Q6J("ngIf",t.isNewUser),e.xp6(1),e.Q6J("ngIf",!t.isSuperAdminCreation),e.xp6(1),e.Q6J("ngIf",!t.isSuperAdminCreation),e.xp6(1),e.Q6J("ngIf",!t.isSuperAdminCreation)}}let Q=(()=>{class n{constructor(t,a,i,r,m,x,w,L,Tn){this.adminUserService=t,this.indacoModuleService=a,this.keyValuePipe=i,this.navigationService=r,this.partnerService=m,this.route=x,this.snackBar=w,this.translateService=L,this.userService=Tn,this.loading=!1,this.partners=[],this.modules=[]}get user(){var t;return this._user||this.emptyUser(),null!==(t=this._user)&&void 0!==t?t:this.createEmptyUser()}get isNewUser(){var t;return!(null===(t=this._user)||void 0===t?void 0:t._id)}get userTypes(){let t=this.keyValuePipe.transform(X.E);return this.predeterminedPartnerId&&(t=t.filter(a=>a.value!==X.E.Admin)),t}get isSuperAdminCreation(){return!this.predeterminedPartnerId}ngOnInit(){this.initPage()}back(){this.predeterminedPartnerId?this.navigationService.goToPartnerDetail(this.predeterminedPartnerId):this.navigationService.goToUsers()}save(){!this.validateInput()||(this.loading=!0,this.userService.saveUser(this.adminUserService.convertToUser(this.user),this.user.partnerId,this.isNewUser?this.user.password:null).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchUser(t,!1)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>{this.loading=!1}))}refresh(){this.user._id?this.fetchUser(this.user._id):this.emptyUser()}isFeatureActive(t,a){return!!this.user.userModuleAccessibleFeatures.find(i=>i[0]==t.code&&i[1]==a.code)}featureActiveChanged(t,a,i){t.checked?this.user.userModuleAccessibleFeatures.push([a.code,i.code]):this.user.userModuleAccessibleFeatures=this.user.userModuleAccessibleFeatures.filter(r=>r[0]!=a.code||r[1]!=i.code)}isModuleDisabled(t){var a,i;return!(null===(i=null===(a=this.user.plan)||void 0===a?void 0:a.indacoModules)||void 0===i?void 0:i.find(r=>r._id==t._id))}partnerChanged(){this.assignUserSubscriptionPlan(this.user)}initPage(){this.loading=!0,this.fetchPartners().add(()=>this.fetchAllModules()).add(()=>{const t=this.route.snapshot.paramMap.get("id");return this.predeterminedPartnerId=this.route.snapshot.paramMap.get("partnerId"),t&&"null"!=t?this.fetchUser(t,!1):this.emptyUser()}).add(()=>this.loading=!1)}emptyUser(){this._user=this.createEmptyUser()}createEmptyUser(){var t;const a={username:"",email:"",userType:this.predeterminedPartnerId?"STD":"ADMIN",partnerId:null!==(t=this.predeterminedPartnerId)&&void 0!==t?t:null,userModuleAccessibleFeatures:[],plan:{}};return this.assignUserSubscriptionPlan(a),a}assignUserSubscriptionPlan(t){var a,i,r;""!==t.partnerId&&(t.plan=null!==(r=null===(i=null===(a=this.partners)||void 0===a?void 0:a.find(m=>m._id===t.partnerId))||void 0===i?void 0:i.subscriptionPlan)&&void 0!==r?r:{})}fetchUser(t,a=!0){return a&&(this.loading=!0),this.userService.getUser(t).subscribe(i=>{this._user=this.adminUserService.convertToAdminUser(i),this.predeterminedPartnerId&&(this._user.partnerId=this.predeterminedPartnerId)}).add(()=>{a&&(this.loading=!1)})}fetchAllModules(){return this.indacoModuleService.getAllModules().subscribe(t=>this.modules=t.filter(a=>a.moduleAccessibleFeatures.length>0))}fetchPartners(){return this.partnerService.getAllPartners().subscribe(t=>this.partners=t)}validateInput(){return""!==this.user.username&&""!==this.user.email&&/\S+@\S+\.\S+/.test(this.user.email)&&(""!==this.user.password||!this.isNewUser)&&""!==this.user.userType}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(ae),e.Y36(D.M),e.Y36(u.Nd),e.Y36(v),e.Y36(J.b),e.Y36(C.gz),e.Y36(A.ux),e.Y36(_.sK),e.Y36(Y.f))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-user-detail"]],decls:22,vars:14,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["matInput","","required","","type","email","email","",3,"ngModel","ngModelChange"],["class","full-width","appearance","fill",4,"ngIf"],[4,"ngIf"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],["matInput","","required","","required","","type","password",3,"ngModel","ngModelChange"],["required","",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[3,"value","disabled","valueChange"],["class","service-feature-container",4,"ngFor","ngForOf"],[1,"service-feature-container"],[4,"ngFor","ngForOf"],[3,"disabled","checked","change"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar"),e.TgZ(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA(),e.qZA(),e.YNc(20,at,2,0,"div",3),e.YNc(21,gt,17,14,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,6,"app.admin.users.user")),e.xp6(6),e.hij(" ",e.lcZ(9,8,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,10,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,12,"shared.buttons.save")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[h.Ye,d.lW,f.Hw,u.O5,Z.$g,g.KE,g.hX,M.Nt,s.Fj,s.Q7,s.JJ,s.On,s.on,g.R9,O.gD,u.sg,R.ey,T.oG],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}.service-feature-container[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:0}"]}),n})();function ft(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function ht(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).plan.name=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function Zt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"mat-checkbox",15),e.NdJ("change",function(i){const m=e.CHM(t).$implicit;return e.oxw(2).moduleActiveChanged(i,m)}),e._uU(2),e.qZA(),e.qZA()}if(2&n){const t=o.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("checked",a.isModuleActive(t)),e.xp6(1),e.hij(" ",t.name," ")}}function vt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7),e.TgZ(1,"mat-form-field",8),e.TgZ(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().plan.name=i}),e.qZA(),e.YNc(6,ht,3,0,"button",10),e.qZA(),e.TgZ(7,"div",11),e.TgZ(8,"div",12),e.TgZ(9,"h2"),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.YNc(12,Zt,3,2,"div",13),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,5,"app.admin.subscriptionPlans.name")),e.xp6(2),e.Q6J("ngModel",t.plan.name),e.xp6(1),e.Q6J("ngIf",t.plan.name),e.xp6(4),e.Oqu(e.lcZ(11,7,"app.admin.subscriptionPlans.modules")),e.xp6(2),e.Q6J("ngForOf",t.modules)}}let z=(()=>{class n{constructor(t,a,i,r,m,x){this.subscriptionPlanService=t,this.indacoModuleService=a,this.navigationService=i,this.route=r,this.snackBar=m,this.translateService=x,this.loading=!1,this.modules=[]}get plan(){var t;return this._plan||this.emptyPlan(),null!==(t=this._plan)&&void 0!==t?t:this.createEmptyPlan()}ngOnInit(){this.initPage()}back(){this.navigationService.goToPlans()}save(){!this.validateInput()||(this.loading=!0,this.subscriptionPlanService.saveSubscriptionPlan(this.plan).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchPlan(t,!1)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}refresh(){this.plan._id?this.fetchPlan(this.plan._id):this.emptyPlan()}isModuleActive(t){return!!this.plan.indacoModules.find(a=>a._id==t._id)}moduleActiveChanged(t,a){t.checked?this.plan.indacoModules.push(a):this.plan.indacoModules=this.plan.indacoModules.filter(i=>i._id!=a._id)}initPage(){this.loading=!0,this.fetchAllModules().add(()=>{const t=this.route.snapshot.paramMap.get("id");if(t)return this.fetchPlan(t,!1)}).add(()=>this.loading=!1)}fetchPlan(t,a=!0){return a&&(this.loading=!0),this.subscriptionPlanService.getSubscriptionPlan(t).subscribe(i=>this._plan=JSON.parse(JSON.stringify(i))).add(()=>{a&&(this.loading=!1)})}fetchAllModules(){return this.indacoModuleService.getAllModules().subscribe(t=>this.modules=t)}emptyPlan(){this._plan=this.createEmptyPlan()}createEmptyPlan(){return{_id:"",name:"",indacoModules:[],royaltyRate:0}}validateInput(){return""!==this.plan.name}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K),e.Y36(D.M),e.Y36(v),e.Y36(C.gz),e.Y36(A.ux),e.Y36(_.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-plan-detail"]],decls:22,vars:14,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],[1,"modules-container"],[1,"module-child-container"],[4,"ngFor","ngForOf"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[3,"checked","change"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar"),e.TgZ(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA(),e.qZA(),e.YNc(20,ft,2,0,"div",3),e.YNc(21,vt,13,9,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,6,"app.admin.subscriptionPlans.plan")),e.xp6(6),e.hij(" ",e.lcZ(9,8,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,10,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,12,"shared.buttons.save")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[h.Ye,d.lW,f.Hw,u.O5,Z.$g,g.KE,g.hX,M.Nt,s.Fj,s.Q7,s.JJ,s.On,u.sg,g.R9,T.oG],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}.modules-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-start}.module-child-container[_ngcontent-%COMP%]{margin:5px;padding:5px}"]}),n})();const Ct=["plansPaginator"],xt=["plansSort"];function Tt(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function At(n,o){1&n&&(e.TgZ(0,"th",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.subscriptionPlans.name")," "))}function bt(n,o){if(1&n&&(e.TgZ(0,"td",21),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.name," ")}}function yt(n,o){1&n&&(e.TgZ(0,"th",22),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function Pt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",21),e.TgZ(1,"button",23),e.NdJ("click",function(){const r=e.CHM(t).$implicit;return e.oxw(2).openSubscriptionPlanDetail(r)}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA(),e.qZA(),e.qZA()}}function Mt(n,o){1&n&&e._UZ(0,"tr",24)}function Ut(n,o){1&n&&e._UZ(0,"tr",25)}const kt=function(){return[5,10,20]};function St(n,o){if(1&n&&(e.TgZ(0,"div",7),e.TgZ(1,"div",8),e.TgZ(2,"table",9,10),e.ynx(4,11),e.YNc(5,At,3,3,"th",12),e.YNc(6,bt,2,1,"td",13),e.BQk(),e.ynx(7,14),e.YNc(8,yt,3,3,"th",15),e.YNc(9,Pt,4,0,"td",13),e.BQk(),e.YNc(10,Mt,1,0,"tr",16),e.YNc(11,Ut,1,0,"tr",17),e.qZA(),e._UZ(12,"mat-paginator",18,19),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.plansDataSource),e.xp6(8),e.Q6J("matHeaderRowDef",t.plansDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.plansDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,kt))}}let qt=(()=>{class n{constructor(t,a,i){this.subscriptionPlanService=t,this.navigationService=a,this.snackBar=i,this.plans=[],this.plansDataSource=new c.by(this.plans),this.plansDisplayedColumns=["name","actions"],this.loading=!1}ngOnInit(){this.fetchSubscriptionPlans()}openSubscriptionPlanDetail(t){this.navigationService.goToSubscriptionPlanDetail(t._id)}createNewSubscriptionPlan(){this.navigationService.goToSubscriptionPlanDetail()}fetchSubscriptionPlans(){this.loading=!0,this.subscriptionPlanService.getAllSubscriptionPlans().subscribe(t=>{this.plans=t,this.plansDataSource.data=this.plans,setTimeout(()=>{this.plansDataSource.sort=this.plansSort,this.plansDataSource.paginator=this.plansPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K),e.Y36(v),e.Y36(A.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-plans"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Ct,5),e.Gf(xt,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.plansPaginator=i.first),e.iGM(i=e.CRH())&&(a.plansSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["plansSort","matSort"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["plansPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin"),e.TgZ(1,"mat-toolbar"),e.TgZ(2,"mat-icon",0),e._uU(3,"ballot"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewSubscriptionPlan()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.qZA(),e.YNc(12,Tt,2,0,"div",3),e.YNc(13,St,14,5,"div",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.subscriptionPlans.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[S,h.Ye,f.Hw,d.lW,u.O5,Z.$g,c.BZ,b.YE,c.w1,c.fO,c.Dz,c.as,c.nj,k.NW,c.ge,b.nU,c.ev,c.XQ,c.Gk],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();const It=["modulesPaginator"],Dt=["modulesSort"];function Nt(n,o){1&n&&(e.TgZ(0,"div",3),e._UZ(1,"mat-spinner",4),e.qZA())}function wt(n,o){1&n&&(e.TgZ(0,"th",18),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.modules.name")," "))}function Ot(n,o){if(1&n&&(e.TgZ(0,"td",19),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.name," ")}}function Jt(n,o){1&n&&(e.TgZ(0,"th",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function Kt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",19),e.TgZ(1,"button",21),e.NdJ("click",function(){const r=e.CHM(t).$implicit;return e.oxw(2).openModuleDetail(r)}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA(),e.qZA(),e.qZA()}}function Yt(n,o){1&n&&e._UZ(0,"tr",22)}function Qt(n,o){1&n&&e._UZ(0,"tr",23)}const Lt=function(){return[5,10,20]};function Ft(n,o){if(1&n&&(e.TgZ(0,"div",5),e.TgZ(1,"div",6),e.TgZ(2,"table",7,8),e.ynx(4,9),e.YNc(5,wt,3,3,"th",10),e.YNc(6,Ot,2,1,"td",11),e.BQk(),e.ynx(7,12),e.YNc(8,Jt,3,3,"th",13),e.YNc(9,Kt,4,0,"td",11),e.BQk(),e.YNc(10,Yt,1,0,"tr",14),e.YNc(11,Qt,1,0,"tr",15),e.qZA(),e._UZ(12,"mat-paginator",16,17),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.modulesDataSource),e.xp6(8),e.Q6J("matHeaderRowDef",t.modulesDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.modulesDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,Lt))}}let $t=(()=>{class n{constructor(t,a,i){this.indacoModuleService=t,this.navigationService=a,this.snackBar=i,this.modules=[],this.modulesDataSource=new c.by(this.modules),this.modulesDisplayedColumns=["name","actions"],this.loading=!1}ngOnInit(){this.fetchModules()}openModuleDetail(t){this.navigationService.goToModuleDetail(t._id)}fetchModules(){this.loading=!0,this.indacoModuleService.getAllModules().subscribe(t=>{this.modules=t,this.modulesDataSource.data=this.modules,setTimeout(()=>{this.modulesDataSource.sort=this.modulesSort,this.modulesDataSource.paginator=this.modulesPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(D.M),e.Y36(v),e.Y36(A.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-indaco-modules"]],viewQuery:function(t,a){if(1&t&&(e.Gf(It,5),e.Gf(Dt,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.modulesPaginator=i.first),e.iGM(i=e.CRH())&&(a.modulesSort=i.first)}},decls:8,vars:5,consts:[[1,"mat-18"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["modulesSort","matSort"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["modulesPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin"),e.TgZ(1,"mat-toolbar"),e.TgZ(2,"mat-icon",0),e._uU(3,"notes"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.YNc(6,Nt,2,0,"div",1),e.YNc(7,Ft,14,5,"div",2),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,3,"app.admin.modules.title")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[S,h.Ye,f.Hw,u.O5,Z.$g,c.BZ,b.YE,c.w1,c.fO,c.Dz,c.as,c.nj,k.NW,c.ge,b.nU,c.ev,d.lW,c.XQ,c.Gk],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();function Ht(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function Rt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",11),e.TgZ(1,"mat-form-field",12),e.TgZ(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){return e.CHM(t).$implicit.code=i}),e.qZA(),e.qZA(),e.TgZ(6,"mat-form-field",13),e.TgZ(7,"mat-label"),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"input",9),e.NdJ("ngModelChange",function(i){return e.CHM(t).$implicit.name=i}),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=o.$implicit;e.xp6(3),e.Oqu(e.lcZ(4,4,"app.admin.modules.code")),e.xp6(2),e.Q6J("ngModel",t.code),e.xp6(3),e.Oqu(e.lcZ(9,6,"app.admin.modules.name")),e.xp6(2),e.Q6J("ngModel",t.name)}}function jt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7),e.TgZ(1,"mat-form-field",8),e.TgZ(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().module.code=i}),e.qZA(),e.qZA(),e.TgZ(6,"mat-form-field",8),e.TgZ(7,"mat-label"),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"input",9),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().module.name=i}),e.qZA(),e.qZA(),e.TgZ(11,"mat-toolbar"),e.TgZ(12,"span"),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.qZA(),e.YNc(15,Rt,11,8,"div",10),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,6,"app.admin.modules.code")),e.xp6(2),e.Q6J("ngModel",t.module.code),e.xp6(3),e.Oqu(e.lcZ(9,8,"app.admin.modules.name")),e.xp6(2),e.Q6J("ngModel",t.module.name),e.xp6(3),e.Oqu(e.lcZ(14,10,"app.admin.modules.features")),e.xp6(2),e.Q6J("ngForOf",t.module.moduleAccessibleFeatures)}}let W=(()=>{class n{constructor(t,a,i){this.indacoModuleService=t,this.navigationService=a,this.route=i,this.module={},this.loading=!1}ngOnInit(){this.getRouteParams()}back(){this.navigationService.goToModules()}refresh(){var t;(null===(t=this.module)||void 0===t?void 0:t._id)&&this.fetchModule(this.module._id)}getRouteParams(){const t=this.route.snapshot.paramMap.get("id");t&&this.fetchModule(t)}fetchModule(t,a=!0){a&&(this.loading=!0),this.indacoModuleService.getModule(t).subscribe(i=>{this.module=JSON.parse(JSON.stringify(i))}).add(()=>{a&&(this.loading=!1)})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(D.M),e.Y36(v),e.Y36(C.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-indaco-module-detail"]],decls:17,vars:11,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","type","text","disabled","",3,"ngModel","ngModelChange"],["class","feature-container",4,"ngFor","ngForOf"],[1,"feature-container"],["appearance","fill",1,"feature-code"],["appearance","fill",1,"feature-name"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar"),e.TgZ(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.qZA(),e.YNc(15,Ht,2,0,"div",3),e.YNc(16,jt,16,12,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,5,"app.admin.modules.service")),e.xp6(6),e.hij(" ",e.lcZ(9,7,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,9,"shared.buttons.cancel")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[h.Ye,d.lW,f.Hw,u.O5,Z.$g,g.KE,g.hX,M.Nt,s.Fj,s.JJ,s.On,u.sg],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}.feature-container[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:5px;width:100%;display:flex;flex-direction:row}.feature-code[_ngcontent-%COMP%]{margin-right:5px;flex:6;align-self:flex-start center}.feature-name[_ngcontent-%COMP%]{margin-left:5px;flex:6;align-self:flex-start center}.feature-button[_ngcontent-%COMP%]{margin-left:5px;flex:1;align-self:flex-end center}"]}),n})();var N=(()=>{return(n=N||(N={})).ModuleRegistration="MODULE_REGISTRATION",n.CheckServiceStatus="CHECK_SERVICE_STATUS",N;var n})();function Et(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function Bt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).apiKey.name=""}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA(),e.qZA()}}function Gt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8),e.TgZ(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"input",15,16),e.TgZ(6,"button",14),e.NdJ("click",function(){e.CHM(t);const i=e.MAs(5);return e.oxw(2).copyKeyToClipboard(i)}),e.TgZ(7,"mat-icon"),e._uU(8,"file_copy"),e.qZA(),e.qZA(),e.TgZ(9,"span",17),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,3,"app.admin.apiKeys.key")),e.xp6(2),e.Q6J("ngModel",t.apiKeyString),e.xp6(6),e.Oqu(e.lcZ(11,5,"app.admin.apiKeys.notice"))}}function Xt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"mat-checkbox",18),e.NdJ("change",function(i){const m=e.CHM(t).$implicit;return e.oxw(2).scopeActiveChanged(i,m.value)}),e._uU(2),e.qZA(),e.qZA()}if(2&n){const t=o.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("checked",a.isScopeActive(t.value)),e.xp6(1),e.hij(" ",t.key," ")}}function zt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7),e.TgZ(1,"mat-form-field",8),e.TgZ(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().apiKey.name=i}),e.qZA(),e.YNc(6,Bt,3,0,"button",10),e.qZA(),e.YNc(7,Gt,12,7,"mat-form-field",11),e.TgZ(8,"div"),e.TgZ(9,"mat-checkbox",12),e.NdJ("ngModelChange",function(i){return e.CHM(t),e.oxw().apiKey.enabled=i}),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.qZA(),e.TgZ(12,"h3"),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.YNc(15,Xt,3,2,"div",13),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,8,"app.admin.apiKeys.name")),e.xp6(2),e.Q6J("ngModel",t.apiKey.name),e.xp6(1),e.Q6J("ngIf",t.apiKey.name),e.xp6(1),e.Q6J("ngIf",t.isNewApiKey),e.xp6(2),e.Q6J("ngModel",t.apiKey.enabled),e.xp6(1),e.hij(" ",e.lcZ(11,10,"app.admin.apiKeys.enabled")," "),e.xp6(3),e.Oqu(e.lcZ(14,12,"app.admin.apiKeys.scopes")),e.xp6(2),e.Q6J("ngForOf",t.scopes)}}let V=(()=>{class n{constructor(t,a,i,r,m,x){this.apiKeyService=t,this.navigationService=a,this.snackBar=i,this.translateService=r,this.route=m,this.keyValuePipe=x,this.loading=!1}get apiKey(){var t;return this._apiKey||this.emptyApiKey(),null!==(t=this._apiKey)&&void 0!==t?t:this.createEmptyApiKey()}get isNewApiKey(){return!this.apiKey._id}get apiKeyString(){return this.isNewApiKey?`${this.apiKey.keyPrefix}.${this.apiKey.key}`:""}get scopes(){return this.keyValuePipe.transform(N)}ngOnInit(){this.initPage()}back(){this.navigationService.goToApiKeys()}save(){!this.validateInput()||(this.loading=!0,this.apiKeyService.saveApiKey(this.apiKey).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchApiKey(t,!1)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}refresh(){this.apiKey._id?this.fetchApiKey(this.apiKey._id):this.emptyApiKey()}copyKeyToClipboard(t){const a=document.createElement("textarea");a.style.position="fixed",a.style.top=0,a.style.left=0,a.style.width="2em",a.style.height="2em",a.style.padding=0,a.style.border="none",a.style.outline="none",a.style.boxShadow="none",a.style.background="transparent",a.value=this.apiKeyString,document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy"),this.snackBar.open(this.translateService.instant("app.admin.apiKeys.keyCopied"),void 0,{duration:3e3})}finally{document.body.removeChild(a)}}isScopeActive(t){return!!this.apiKey.scopes.find(a=>a===t)}scopeActiveChanged(t,a){t.checked?this.apiKey.scopes.push(a):this.apiKey.scopes=this.apiKey.scopes.filter(i=>i!==a)}initPage(){const t=this.route.snapshot.paramMap.get("id");t&&this.fetchApiKey(t)}fetchApiKey(t,a=!0){a&&(this.loading=!0),this.apiKeyService.getApiKey(t).subscribe(i=>{this._apiKey=JSON.parse(JSON.stringify(i))}).add(()=>{a&&(this.loading=!1)})}emptyApiKey(){this._apiKey=this.createEmptyApiKey()}createEmptyApiKey(){return{_id:"",keyPrefix:this.apiKeyService.generateNewApiKeyPrefix(),key:this.apiKeyService.generateNewApiKey(),name:"",scopes:[],enabled:!1}}validateInput(){return""!==this.apiKey.name}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(H),e.Y36(v),e.Y36(A.ux),e.Y36(_.sK),e.Y36(C.gz),e.Y36(u.Nd))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-api-key-detail"]],decls:22,vars:14,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["class","full-width","appearance","fill",4,"ngIf"],[3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],["matInput","","type","text","disabled","",3,"ngModel"],["apiKeyFieldInput",""],[1,"api-key-notice"],[3,"checked","change"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar"),e.TgZ(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA(),e.qZA(),e.YNc(20,Et,2,0,"div",3),e.YNc(21,zt,16,14,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,6,"app.admin.apiKeys.apiKey")),e.xp6(6),e.hij(" ",e.lcZ(9,8,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,10,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,12,"shared.buttons.save")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[h.Ye,d.lW,f.Hw,u.O5,Z.$g,g.KE,g.hX,M.Nt,s.Fj,s.Q7,s.JJ,s.On,T.oG,u.sg,g.R9],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}.api-key-notice[_ngcontent-%COMP%]{color:#00000061;font-size:small}"]}),n})();const Wt=["apiKeysPaginator"],Vt=["apiKeysSort"];function en(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function tn(n,o){1&n&&(e.TgZ(0,"th",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.apiKeys.name")," "))}function nn(n,o){if(1&n&&(e.TgZ(0,"td",21),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.name," ")}}function an(n,o){1&n&&(e.TgZ(0,"th",22),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function on(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",21),e.TgZ(1,"button",23),e.NdJ("click",function(){const r=e.CHM(t).$implicit;return e.oxw(2).openApiKeyDetail(r)}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA(),e.qZA(),e.qZA()}}function rn(n,o){1&n&&e._UZ(0,"tr",24)}function sn(n,o){1&n&&e._UZ(0,"tr",25)}const ln=function(){return[5,10,20]};function cn(n,o){if(1&n&&(e.TgZ(0,"div",7),e.TgZ(1,"div",8),e.TgZ(2,"table",9,10),e.ynx(4,11),e.YNc(5,tn,3,3,"th",12),e.YNc(6,nn,2,1,"td",13),e.BQk(),e.ynx(7,14),e.YNc(8,an,3,3,"th",15),e.YNc(9,on,4,0,"td",13),e.BQk(),e.YNc(10,rn,1,0,"tr",16),e.YNc(11,sn,1,0,"tr",17),e.qZA(),e._UZ(12,"mat-paginator",18,19),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.apiKeysDataSource),e.xp6(8),e.Q6J("matHeaderRowDef",t.apiKeysDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.apiKeysDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,ln))}}let pn=(()=>{class n{constructor(t,a,i){this.apiKeyService=t,this.navigationService=a,this.snackBar=i,this.apiKeys=[],this.apiKeysDataSource=new c.by(this.apiKeys),this.apiKeysDisplayedColumns=["name","actions"],this.loading=!1}ngOnInit(){this.fetchApiKeys()}openApiKeyDetail(t){this.navigationService.goToApiKeyDetail(t._id)}createNewApiKey(){this.navigationService.goToApiKeyDetail()}fetchApiKeys(){this.loading=!0,this.apiKeyService.getAllApiKeys().subscribe(t=>{this.apiKeys=t,this.apiKeysDataSource.data=this.apiKeys,setTimeout(()=>{this.apiKeysDataSource.sort=this.apiKeysSort,this.apiKeysDataSource.paginator=this.apiKeysPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(H),e.Y36(v),e.Y36(A.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-api-keys"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Wt,5),e.Gf(Vt,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.apiKeysPaginator=i.first),e.iGM(i=e.CRH())&&(a.apiKeysSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["apiKeysSort","matSort"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["apiKeysPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin"),e.TgZ(1,"mat-toolbar"),e.TgZ(2,"mat-icon",0),e._uU(3,"vpn_key"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewApiKey()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.qZA(),e.YNc(12,en,2,0,"div",3),e.YNc(13,cn,14,5,"div",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.apiKeys.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},directives:[S,h.Ye,f.Hw,d.lW,u.O5,Z.$g,c.BZ,b.YE,c.w1,c.fO,c.Dz,c.as,c.nj,k.NW,c.ge,b.nU,c.ev,c.XQ,c.Gk],pipes:[_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px} snack-bar-container.error-snackbar{background-color:red;color:#fff} .mat-simple-snackbar-action{color:#fff}"]}),n})();var dn=l(3869),un=l(5395),mn=l(3860),_n=l(4044),gn=l(6774),fn=l(7294);const hn=[{path:"createReference",component:dn.l},{path:"editReference",component:un.T},{path:"listing",component:mn.Y},{path:"reference",component:_n.C},{path:"warehouse",component:gn.d},{path:"warehouse-details",component:fn.k},{path:p.partners,component:be},{path:`${p.partnerDetail}/:id`,component:G},{path:p.partnerDetail,component:G},{path:p.users,component:nt},{path:`${p.userDetail}/:id/:partnerId`,component:Q},{path:`${p.userDetail}/:id`,component:Q},{path:p.userDetail,component:Q},{path:p.plans,component:qt},{path:`${p.planDetail}/:id`,component:z},{path:p.planDetail,component:z},{path:p.indacoModules,component:$t},{path:`${p.indacoModuleDetail}/:id`,component:W},{path:p.indacoModuleDetail,component:W},{path:p.apiKeys,component:pn},{path:`${p.apiKeyDetail}/:id`,component:V},{path:p.apiKeyDetail,component:V},{path:p.channels,component:E.J},{path:"",redirectTo:p.partners,pathMatch:"full"}];let Zn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[C.Bz.forChild(hn)],C.Bz]}),n})();var vn=l(1382),Cn=l(888);let xn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[u.Nd],imports:[[Zn,u.ez,s.u5,d.ot,Cn.QW,T.p9,I.Is,g.lN,f.Ps,M.c,te.ie,k.TU,Z.Cq,O.LD,b.JX,c.p0,P.Nh,h.g0,_.aw,vn.m]]}),n})()}}]);