1(self.webpackChunkf_cms=self.webpackChunkf_cms||[]).push([[4364],{24313:function(G,T){var r,h,s;h=[],void 0!==(s="function"==typeof(r=function(){"use strict";function b(f,l){return typeof l>"u"?l={autoBom:!1}:"object"!=typeof l&&(console.warn("Deprecated: Expected third argument to be a object"),l={autoBom:!l}),l.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(f.type)?new Blob(["\ufeff",f],{type:f.type}):f}function d(f,l,u){var m=new XMLHttpRequest;m.open("GET",f),m.responseType="blob",m.onload=function(){_(m.response,l,u)},m.onerror=function(){console.error("could not download file")},m.send()}function t(f){var l=new XMLHttpRequest;l.open("HEAD",f,!1);try{l.send()}catch{}return 200<=l.status&&299>=l.status}function C(f){try{f.dispatchEvent(new MouseEvent("click"))}catch{var l=document.createEvent("MouseEvents");l.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),f.dispatchEvent(l)}}var v="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,p=v.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),_=v.saveAs||("object"!=typeof window||window!==v?function(){}:"download"in HTMLAnchorElement.prototype&&!p?function(f,l,u){var m=v.URL||v.webkitURL,y=document.createElement("a");l=l||f.name||"download",y.download=l,y.rel="noopener","string"==typeof f?(y.href=f,y.origin===location.origin?C(y):t(y.href)?d(f,l,u):C(y,y.target="_blank")):(y.href=m.createObjectURL(f),setTimeout(function(){m.revokeObjectURL(y.href)},4e4),setTimeout(function(){C(y)},0))}:"msSaveOrOpenBlob"in navigator?function(f,l,u){if(l=l||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,u),l);else if(t(f))d(f,l,u);else{var m=document.createElement("a");m.href=f,m.target="_blank",setTimeout(function(){C(m)})}}:function(f,l,u,m){if((m=m||open("","_blank"))&&(m.document.title=m.document.body.innerText="downloading..."),"string"==typeof f)return d(f,l,u);var y="application/octet-stream"===f.type,k=/constructor/i.test(v.HTMLElement)||v.safari,Y=/CriOS\/[\d]+/.test(navigator.userAgent);if((Y||y&&k||p)&&typeof FileReader<"u"){var E=new FileReader;E.onloadend=function(){var I=E.result;I=Y?I:I.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=I:location=I,m=null},E.readAsDataURL(f)}else{var V=v.URL||v.webkitURL,N=V.createObjectURL(f);m?m.location=N:location.href=N,m=null,setTimeout(function(){V.revokeObjectURL(N)},4e4)}});v.saveAs=_.saveAs=_,G.exports=_})?r.apply(T,h):r)&&(G.exports=s)},4364:(G,T,r)=>{"use strict";r.r(T),r.d(T,{NotifyModule:()=>z});var h=r(56610),s=r(37222),b=r(60564),d=r(6389),t=r(23279);class C{constructor(n){this._mediaService=n}ngOnInit(){this.iamToken()}iamToken(){this._mediaService.getIamToken().subscribe()}static{this.\u0275fac=function(e){return new(e||C)(t.rXU(d.u))}}static{this.\u0275cmp=t.VBU({type:C,selectors:[["app-notify"]],decls:2,vars:0,consts:[[1,"container","large","mmp-nav-margin"]],template:function(e,i){1&e&&(t.j41(0,"div",0),t.nrm(1,"router-outlet"),t.k0s())},dependencies:[b.n3]})}}var v=r(70852),p=r(24937),_=r(20020),f=r(99406),l=r(37950),u=r(77019),m=r(22882),y=r(17438),k=r(49869);const Y=()=>["fa-solid","fa-filter"],E=()=>["..","sends"],V=()=>["..","create"],N=()=>["tableTitle",null,null,null],I=()=>["cellTitle",null,null,null];function dt(a,n){if(1&a){const e=t.RV6();t.j41(0,"button",38),t.bIt("click",function(){const o=t.eBV(e).$implicit,c=t.XpG(2);return t.Njj(c.setTimelineStatus(o.value))}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&a){let e,i;const o=n.$implicit,c=t.XpG(2);t.AVh("btn-primary",(null==(e=c.filterForm.get("timelineStatus"))?null:e.value)===o.value)("btn-outline-dark",(null==(i=c.filterForm.get("timelineStatus"))?null:i.value)!==o.value),t.R7$(),t.SpI(" ",t.bMT(2,5,o.labelKey)," ")}}function mt(a,n){if(1&a){const e=t.RV6();t.j41(0,"button",39),t.bIt("click",function(){t.eBV(e);const o=t.XpG(2);return t.Njj(o.clearFilters())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}
12&a&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"notify.management.clearFilters")," "))}function ft(a,n){if(1&a){const e=t.RV6();t.j41(0,"div",20)(1,"div",21)(2,"form",22)(3,"div",23)(4,"div",24)(5,"h5"),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.nrm(8,"input",25),t.k0s(),t.j41(9,"div",24)(10,"h5"),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.nrm(13,"input",26),t.k0s(),t.j41(14,"div",24)(15,"h5"),t.EFF(16),t.nI1(17,"translate"),t.k0s(),t.nrm(18,"input",27),t.k0s(),t.j41(19,"div",24)(20,"h5"),t.EFF(21),t.nI1(22,"translate"),t.k0s(),t.nrm(23,"input",28),t.k0s()(),t.j41(24,"div",29)(25,"div",24)(26,"h5"),t.EFF(27),t.nI1(28,"translate"),t.k0s(),t.nrm(29,"input",30),t.k0s(),t.j41(30,"div",24)(31,"h5"),t.EFF(32),t.nI1(33,"translate"),t.k0s(),t.nrm(34,"input",31),t.k0s(),t.j41(35,"div",32)(36,"h5"),t.EFF(37),t.nI1(38,"translate"),t.k0s(),t.j41(39,"div",33),t.DNE(40,dt,3,7,"button",34),t.k0s()()(),t.j41(41,"div",35),t.DNE(42,mt,3,3,"button",36),t.j41(43,"button",37),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.applyFilters())}),t.EFF(44),t.nI1(45,"translate"),t.k0s()()()()()}if(2&a){const e=t.XpG();t.R7$(2),t.Y8G("formGroup",e.filterForm),t.R7$(4),t.JRh(t.bMT(7,11,"notify.management.filterCreationFrom")),t.R7$(5),t.JRh(t.bMT(12,13,"notify.management.filterCreationTo")),t.R7$(5),t.JRh(t.bMT(17,15,"notify.management.filterScheduleFrom")),t.R7$(5),t.JRh(t.bMT(22,17,"notify.management.filterScheduleTo")),t.R7$(6),t.JRh(t.bMT(28,19,"notify.management.filterHourFrom")),t.R7$(5),t.JRh(t.bMT(33,21,"notify.management.filterHourTo")),t.R7$(5),t.JRh(t.bMT(38,23,"notify.management.timelineStatus")),t.R7$(3),t.Y8G("ngForOf",e.timelineOptions),t.R7$(2),t.Y8G("ngIf",e.activeFilterCount()>0),t.R7$(2),t.SpI(" ",t.bMT(45,25,"notify.management.applyFilters")," ")}}function pt(a,n){1&a&&(t.j41(0,"p",40),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"notify.management.emptyHistory")," "))}function ut(a,n){if(1&a){const e=t.RV6();t.j41(0,"mm-table",41),t.nI1(1,"paginate"),t.bIt("tdClick",function(o){t.eBV(e);const c=t.XpG();return t.Njj(c.sendNotify(o))}),t.k0s()}if(2&a){const e=t.XpG();t.Y8G("values",t.i5U(1,6,e.tableValues,e.config))("columnNames",e.tableColumnNames)("tableSize","unset")("thClass",t.lJ4(9,N))("tdClass",t.lJ4(10,I))("track",!1)}}function ht(a,n){if(1&a){const e=t.RV6();t.j41(0,"pagination-template",42,0),t.bIt("pageChange",function(o){t.eBV(e);const c=t.XpG();return t.Njj(c.getPagedNotifications(o-1))}),t.nrm(2,"mm-ngx-pagination",43),t.k0s()}if(2&a){const e=t.sdS(1),i=t.XpG();t.Y8G("id",i.config.id),t.R7$(2),t.Y8G("p",e)("config",i.config)}}class U{constructor(n,e,i,o,c,g,S){this.notifyService=n,this.translateService=e,this.loadingSpinner=i,this.messageService=o,this.mediaPickerService=c,this.router=g,this._appRef=S,this.searchNotifyControl=new s.hs,this.showFilters=!1,this.filterForm=new s.gE({creationDateStart:new s.MJ(""),creationDateEnd:new s.MJ(""),publishingDateStart:new s.MJ(""),publishingDateEnd:new s.MJ(""),publishingHourStart:new s.MJ(""),publishingHourEnd:new s.MJ(""),timelineStatus:new s.MJ("")}),this.appliedFilters={},this.timelineOptions=[{value:"",labelKey:"notify.management.timelineAll"},{value:"FUTURE",labelKey:"notify.management.timelineFuture"},{value:"TODAY",labelKey:"notify.management.timelineToday"},{value:"PAST",labelKey:"notify.management.timelinePast"},{value:"UNSCHEDULED",labelKey:"notify.management.timelineUnscheduled"}],this.config={id:"",itemsPerPage:1e3,currentPage:1},this.pageSize=12,this.loadingSpinner.setViewContainerRef(this._appRef.components[0].instance.vcr)}ngOnInit(){this.loadNotifications(0),this.mediaPickerService.dispatchSelected([])}applyFilters(){this.appliedFilters=this.buildFilterFromForm(),this.showFilters=!1,this.loadNotifications(0)}clearFilters(){this.filterForm.reset({creationDateStart:"",creationDateEnd:"",publishingDateStart:"",publishingDateEnd:"",publishingHourStart:"",publishingHourEnd:"",timelineStatus:""}),this.appliedFilters={},this.showFilters=!1,this.loadNotifications(0)}activeFilterCount(){const n=this.appliedFilters;let e=0;return(n.creationDateStart||n.creationDateEnd)&&(e+=1),(n.publishingDateStart||n.publishingDateEnd)&&(e+=1),(n.publishingHourStart||n.publishingHourEnd)&&(e+=1),n.timelineStatus&&(e+=1),e}setTimelineStatus(n){this.filterForm.patchValue({timelineStatus:n},{emitEvent:!1})}loadNotifications(n){this.loadingSpinner.getStatus()||this.loadingSpinner.open(),this.notifyService.searchManagementHistory(this.appliedFilters,n,this.pageSize).subscribe({next:e=>this.createNotifyTableData(e),error:()=>this.createNotifyTableData({content:[],pageable:{},size:this.pageSize,totalPages:0,totalElements:0})})}getPagedNotifications(n){this.loadNotifications(n)}createNotifyTableData(n){this.tableColumnNames=[this.translateService.instant("notify.management.notificationTitle"),this.translateService.instant("notify.management.notificationCreation"),this.translateService.instant("notify.management.notificationScheduleDate"),this.translateService.instant("notify.management.notificationScheduleHour")];const e=n.content||[];this.config={...this.config,currentPage:(n.pageable?.pageNumber??0)+1,itemsPerPage:n.size??this.pageSize,totalItems:n.totalElements,id:"notifyPagination"},this.pages=n.totalPages,this.tableValues=e.map(i=>({[this.tableColumnNames[0]]:i.title,[this.tableColumnNames[1]]:i.creationDate||"\u2014",[this.tableColumnNames[2]]:i.publishingDate||"\u2014",[this.tableColumnNames[3]]:i.publishingHour||"\u2014",title:i.title,id:i.id,linkTo:`modules/notify/edit/${i.id}`,afterIcons:[["icon icon-mudancas-de-cargo"]],iconEmitter:!0})),this.loadingSpinner.getStatus()&&this.loadingSpinner.close()}sendNotify(n){this.notifyService.sendNotify(n.id).subscribe(()=>this.addMessage(n),()=>this.messageService.add({severity:"error",summary:this.translateService.instant("notify.management.sendError"),detail:n.title}))}addMessage(n){this.messageService.add({severity:"success",summary:this.translateService.instant("notify.management.sendSuccess"),detail:n.title}),this.notifyService.emitSocketNotify(n)}searchNotifications(n){return new f.c(e=>{this.notifyService.getAllNotifications(n).subscribe({next:i=>{e.next(i.map(o=>({name:o.title,id:o.id})))},error:i=>{e.next(null),console.log({notidy_search:i})}})})}suggestionClicked(n){this.router.navigate(["/modules","notify","edit",n.id])}ngOnDestroy(){this.loadingSpinner.clearVcr()}buildFilterFromForm(){const n=this.filterForm.getRawValue();return{creationDateStart:n.creationDateStart||void 0,creationDateEnd:n.creationDateEnd||void 0,publishingDateStart:n.publishingDateStart||void 0,publishingDateEnd:n.publishingDateEnd||void 0,publishingHourStart:this.normalizeHour(n.publishingHourStart),publishingHourEnd:this.normalizeHour(n.publishingHourEnd),timelineStatus:n.timelineStatus||void 0}}normalizeHour(n){if(n)return n.length>=5?n.slice(0,5):n}static{this.\u0275fac=function(e){return new(e||U)(t.rXU(u.F),t.rXU(m.c$),t.rXU(p.kt),t.rXU(y.bg),t.rXU(l._),t.rXU(b.Ix),t.rXU(t.o8S))}}static{this.\u0275cmp=t.VBU({type:U,selectors:[["app-notify-management"]],decls:36,vars:43,consts:[["p","paginationApi"],[1,"n
1otify-management-content"],[1,"mm-box-container"],[1,"mm-box-header"],[1,"mm-box-content"],[1,"notify-desc"],[1,"notify-toolbar"],[1,"notify-search"],[1,"notify-search-field"],[3,"suggestionSelect","formControl","fieldset","debounceTime","type","placeholder","key","searchFn"],["type","button","aria-controls","notify-filter-panel",1,"btn","btn-lines","notify-filter-btn",3,"click"],[3,"icon"],[1,"btn","btn-outline-dark","notify-action-btn",3,"routerLink"],[1,"btn","btn-primary","notify-action-btn",3,"routerLink"],["class","filters","id","notify-filter-panel",4,"ngIf"],[1,"table-notifications"],["class","notify-empty",4,"ngIf"],[3,"values","columnNames","tableSize","thClass","tdClass","track","tdClick",4,"ngIf"],[1,"mt-1"],["maxSize","10",3,"id","pageChange",4,"ngIf"],["id","notify-filter-panel",1,"filters"],[1,"filters-content"],[3,"formGroup"],[1,"row"],[1,"col-6","col-lg-3"],["type","date","formControlName","creationDateStart",1,"form-control"],["type","date","formControlName","creationDateEnd",1,"form-control"],["type","date","formControlName","publishingDateStart",1,"form-control"],["type","date","formControlName","publishingDateEnd",1,"form-control"],[1,"row","mt-2"],["type","time","formControlName","publishingHourStart",1,"form-control"],["type","time","formControlName","publishingHourEnd",1,"form-control"],[1,"col-12","col-lg-6"],[1,"notify-timeline-tabs"],["type","button","class","btn btn-sm",3,"btn-primary","btn-outline-dark","click",4,"ngFor","ngForOf"],[1,"filter-actions"],["type","button","class","btn btn-outline-dark",3,"click",4,"ngIf"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-sm",3,"click"],["type","button",1,"btn","btn-outline-dark",3,"click"],[1,"notify-empty"],[3,"tdClick","values","columnNames","tableSize","thClass","tdClass","track"],["maxSize","10",3,"pageChange","id"],[3,"p","config"]],template:function(e,i){1&e&&(t.j41(0,"div",1)(1,"section",2)(2,"header",3),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"div",4)(6,"div",5)(7,"p"),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.j41(10,"p"),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.j41(13,"p"),t.EFF(14),t.nI1(15,"translate"),t.k0s()(),t.j41(16,"div",6)(17,"div",7)(18,"div",8)(19,"mmp5-search-suggest",9),t.nI1(20,"translate"),t.bIt("suggestionSelect",function(c){return i.suggestionClicked(c)}),t.k0s()(),t.j41(21,"button",10),t.nI1(22,"translate"),t.bIt("click",function(){return i.showFilters=!i.showFilters}),t.nrm(23,"mmp5-mm-icons",11),t.k0s(),t.j41(24,"button",12),t.EFF(25),t.nI1(26,"translate"),t.k0s(),t.j41(27,"button",13),t.EFF(28),t.nI1(29,"translate"),t.k0s()(),t.DNE(30,ft,46,27,"div",14),t.k0s(),t.j41(31,"div",15),t.DNE(32,pt,3,3,"p",16)(33,ut,2,11,"mm-table",17),t.j41(34,"div",18),t.DNE(35,ht,3,3,"pagination-template",19),t.k0s()()()()()),2&e&&(t.R7$(3),t.SpI(" ",t.bMT(4,24,"notify.management.notify")," "),t.R7$(5),t.JRh(t.bMT(9,26,"notify.management.youHaveSome")),t.R7$(3),t.JRh(t.bMT(12,28,"notify.management.notifiationsAreSended")),t.R7$(3),t.JRh(t.bMT(15,30,"notify.management.createViewEdit")),t.R7$(5),t.Y8G("formControl",i.searchNotifyControl)("fieldset",!0)("debounceTime",500)("type","search")("placeholder",t.bMT(20,32,"notify.management.search"))("key","notify-management-search")("searchFn",i.searchNotifications.bind(i)),t.R7$(2),t.AVh("actived",i.showFilters||i.activeFilterCount()>0),t.BMQ("aria-expanded",i.showFilters)("aria-label",t.bMT(22,34,"notify.management.filters")),t.R7$(2),t.Y8G("icon",t.lJ4(40,Y)),t.R7$(),t.Y8G("routerLink",t.lJ4(41,E)),t.R7$(),t.SpI(" ",t.bMT(26,36,"notify.management.sendHistory")," "),t.R7$(2),t.Y8G("routerLink",t.lJ4(42,V)),t.R7$(),t.SpI(" ",t.bMT(29,38,"notify.management.createNotification")," "),t.R7$(2),t.Y8G("ngIf",i.showFilters),t.R7$(2),t.Y8G("ngIf",i.tableValues&&0===i.tableValues.length),t.R7$(),t.Y8G("ngIf",i.tableValues&&i.tableValues.length>0),t.R7$(2),t.Y8G("ngIf",i.pages>1))},dependencies:[h.Sq,h.bT,s.qT,s.me,s.BC,s.cb,s.l_,s.j4,s.JD,b.Wk,p.uO,p.S3,p.IV,p.Ls,k.Qr,m.D9,k.kf],styles:[".notify-search[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;align-items:flex-end;
1gap:8px;margin-bottom:10px}.notify-search[_ngcontent-%COMP%] .notify-search-field[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.notify-search[_ngcontent-%COMP%] .notify-filter-btn[_ngcontent-%COMP%]{flex:0 0 auto}.notify-search[_ngcontent-%COMP%] .notify-action-btn[_ngcontent-%COMP%]{flex:0 0 auto;white-space:nowrap}.notify-search[_ngcontent-%COMP%] .btn-lines{color:var(--text);font-size:2rem;padding:.5rem 1rem}.notify-toolbar[_ngcontent-%COMP%]{position:relative}.filters[_ngcontent-%COMP%]{padding:2rem;margin-top:1rem;background-color:var(--lines);border-radius:5px;position:absolute;z-index:1000;width:100%;box-shadow:-1px 11px 5px -2px #00000045}.filters[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:5px}.actived[_ngcontent-%COMP%]{color:var(--primary)!important}.notify-timeline-tabs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.filter-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.notify-empty[_ngcontent-%COMP%]{margin:24px 0} .tableTitle{padding-left:60px!important}@media (max-width: 999px){.filters[_ngcontent-%COMP%]{position:relative;width:100%;box-shadow:-1px 11px 5px -2px #fff}}@media screen and (max-width: 768px){.notify-search[_ngcontent-%COMP%]{flex-wrap:wrap}.notify-search[_ngcontent-%COMP%] .notify-search-field[_ngcontent-%COMP%]{flex:1 1 calc(100% - 56px)}.notify-search[_ngcontent-%COMP%] .notify-action-btn[_ngcontent-%COMP%]{flex:1 1 auto}.notify-timeline-tabs[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{flex:1 1 calc(50% - 8px)}.filter-actions[_ngcontent-%COMP%]{flex-direction:column}.filter-actions[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{width:100%}}"]})}}var Z=r(9433),M=r(38486),R=r(24829);const Q=()=>["/notify"];class L{constructor(){}ngOnInit(){}static{this.\u0275fac=function(e){return new(e||L)}}static{this.\u0275cmp=t.VBU({type:L,selectors:[["mm-notify-desc"]],decls:70,vars:58,consts:[[3,"innerHTML"],[1,"notify-desc"],[1,"row"],[1,"col-12","col-lg-4"],[1,"dark"],[1,"d-flex","justify-content-end"],[3,"routerLink","innerHTML"],[1,"col-12","col-lg-6"]],template:function(e,i){1&e&&(t.nrm(0,"p",0),t.nI1(1,"translate"),t.j41(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"p")(7,"span")(8,"strong"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.EFF(11),t.nI1(12,"translate"),t.k0s()()()(),t.j41(13,"div",3)(14,"div",4)(15,"p")(16,"span")(17,"strong"),t.EFF(18),t.nI1(19,"translate"),t.k0s(),t.EFF(20),t.nI1(21,"translate"),t.k0s()(),t.j41(22,"p"),t.EFF(23),t.nI1(24,"translate"),t.k0s()()(),t.j41(25,"div",3)(26,"div",4)(27,"p")(28,"span")(29,"strong"),t.EFF(30),t.nI1(31,"translate"),t.k0s(),t.EFF(32),t.nI1(33,"translate"),t.k0s()(),t.j41(34,"p"),t.EFF(35),t.nI1(36,"translate"),t.k0s()()()(),t.j41(37,"div",5),t.nrm(38,"a",6),t.nI1(39,"translate"),t.k0s(),t.nrm(40,"p",0),t.nI1(41,"translate"),t.j41(42,"div",2)(43,"div",7)(44,"div",4)(45,"p")(46,"span")(47,"strong"),t.EFF(48),t.nI1(49,"translate"),t.k0s(),t.EFF(50),t.nI1(51,"translate"),t.k0s()()()(),t.j41(52,"div",7)(53,"div",4)(54,"p")(55,"span")(56,"strong"),t.EFF(57),t.nI1(58,"translate"),t.k0s(),t.EFF(59),t.nI1(60,"translate"),t.k0s()(),t.j41(61,"p"),t.EFF(62),t.nI1(63,"translate"),t.k0s()()()(),t.j41(64,"div",5),t.nrm(65,"a",6),t.nI1(66,"translate"),t.k0s(),t.j41(67,"p"),t.EFF(68),t.nI1(69,"translate"),t.k0s()()),2&e&&(t.Y8G("innerHTML",t.bMT(1,20,"notify.create.byDefault"),t.npT),t.R7$(9),t.SpI(" ",t.bMT(10,22,"notify.create.title")," "),t.R7$(2),t.SpI(" - ",t.bMT(12,24,"notify.create.titleDesc")," "),t.R7$(7),t.SpI(" ",t.bMT(19,26,"notify.create.message")," "),t.R7$(2),t.SpI(" - ",t.bMT(21,28,"notify.create.messageDesc")," "),t.R7$(3),t.JRh(t.bMT(24,30,"notify.create.hereStillNot")),t.R7$(7),t.SpI(" ",t.bMT(31,32,"notify.create.icon")," "),t.R7$(2),t.SpI(" - ",t.bMT(33,34,"notify.create.iconDesc")," "),t.R7$(3),t.JRh(t.bMT(36,36,"notify.create.oneIcon")),t.R7$(3),t.Y8G("routerLink",t.lJ4(56,Q))("innerHTML",t.bMT(39,38,"notify.create.aboutPush"),t.npT),t.R7$(2),t.Y8G("innerHTML",t.bMT(41,40,"notify.create.toComplete"),t.npT),t.R7$(8),t.JRh(t.bMT(49,42,"notify.create.name")),t.R7$(2),t.SpI(" - ",t.bMT(51,44,"notify.create.useThisField")," "),t.R7$(7),t.JRh(t.bMT(58,46,"n
1otify.create.formatedMessage")),t.R7$(2),t.SpI(" - ",t.bMT(60,48,"notify.create.itsPossible")," "),t.R7$(3),t.SpI(" ",t.bMT(63,50,"notify.create.meanwhileTheUser")," "),t.R7$(3),t.Y8G("routerLink",t.lJ4(57,Q))("innerHTML",t.bMT(66,52,"notify.create.aboutLightBox"),t.npT),t.R7$(3),t.JRh(t.bMT(69,54,"notify.create.nowThatYouKnow")))},dependencies:[b.Wk,m.D9],styles:[".notify-desc[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{margin-left:-20px;margin-right:-20px}.notify-desc[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{margin:10px 0;padding:20px;background-color:#e7eef7;border-radius:5px;height:calc(100% - 20px)}.notify-desc[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--text)}"]})}}var gt=r(89990),yt=r(88779),bt=r(12173),W=r(61310),tt=r(34286);const vt=()=>["IMAGE_GALLERY","TABS","COLLAPSE"];function _t(a,n){if(1&a&&(t.j41(0,"div",13),t.nrm(1,"img",14),t.nI1(2,"authImage"),t.nI1(3,"async"),t.nI1(4,"authImage"),t.nI1(5,"async"),t.nI1(6,"authImage"),t.nI1(7,"async"),t.k0s()),2&a){const e=t.XpG(2);t.R7$(),t.Y8G("src",t.bMT(3,6,t.ii3(2,1,null==e.selectedNotifyMedia?null:e.selectedNotifyMedia.url,"image",e.iTk,e.mdSrvc))||t.bMT(5,13,t.ii3(4,8,null==e.selectedNotifyMedia?null:e.selectedNotifyMedia.mediaUrl,"image",e.iTk,e.mdSrvc))||t.bMT(7,20,t.ii3(6,15,e.icoUrl,"image",e.iTk,e.mdSrvc)),t.B4B)}}function Ct(a,n){if(1&a){const e=t.RV6();t.j41(0,"div",1)(1,"h5"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nrm(4,"mmp5-fieldset-haruki",2),t.j41(5,"h5"),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.nrm(8,"mmp5-fieldset-haruki",2),t.j41(9,"div",3)(10,"span"),t.EFF(11),t.nI1(12,"translate"),t.k0s()(),t.j41(13,"h5"),t.EFF(14),t.nI1(15,"translate"),t.k0s(),t.nrm(16,"mmp5-fieldset-haruki",4),t.j41(17,"div",3)(18,"span"),t.EFF(19),t.nI1(20,"translate"),t.k0s()(),t.j41(21,"h5"),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.DNE(24,_t,8,22,"div",5),t.j41(25,"div",6)(26,"button",7),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.openMediaPicker())}),t.EFF(27),t.nI1(28,"translate"),t.k0s(),t.j41(29,"span"),t.EFF(30),t.nI1(31,"translate"),t.k0s()(),t.nrm(32,"div",8),t.j41(33,"h5"),t.EFF(34),t.nI1(35,"translate"),t.k0s(),t.nrm(36,"mm-ckeditor",9),t.j41(37,"mm-define-html-plus",10),t.bIt("value",function(o){t.eBV(e);const c=t.XpG();return t.Njj(c.update(o))}),t.k0s(),t.j41(38,"h5",11),t.EFF(39),t.nI1(40,"translate"),t.k0s(),t.j41(41,"mm-define-list-page",12),t.bIt("value",function(o){t.eBV(e);const c=t.XpG();return t.Njj(c.setHomePageList(o))}),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(2),t.SpI("",t.bMT(3,33,"notify.create.notificationName"),"*"),t.R7$(2),t.Y8G("formControl",null==e.form?null:e.form.get("name"))("key","notify-name"),t.R7$(2),t.SpI("",t.bMT(7,35,"notify.create.notificationTitle"),"*"),t.R7$(2),t.Y8G("formControl",null==e.form?null:e.form.get("title"))("key","notify-name"),t.R7$(3),t.Lme("",e.titleCharCounter," ",t.bMT(12,37,"notify.create.remainingChars"),""),t.R7$(3),t.JRh(t.bMT(15,39,"notify.create.message")),t.R7$(2),t.Y8G("formControl",null==e.form?null:e.form.get("message"))("type","textarea")("key","notify-name"),t.R7$(3),t.Lme("",e.messageCharCounter," ",t.bMT(20,41,"notify.create.remainingChars"),""),t.R7$(3),t.JRh(t.bMT(23,43,"notify.create.icon")),t.R7$(2),t.Y8G("ngIf",e.selectedNotifyMedia||e.icoUrl),t.R7$(3),t.JRh(t.bMT(28,45,"notify.create.chooseIcon")),t.R7$(3),t.JRh((null==e.selectedNotifyMedia?null:e.selectedNotifyMedia.title)||t.bMT(31,47,"notify.create.emptyMedia")),t.R7$(4),t.JRh(t.bMT(35,49,"notify.create.formatedMessage")),t.R7$(2),t.Y8G("data",e.form.get("content")),t.R7$(),t.Y8G("feature",e.form.get("htmlPlus"))("not-a-feature",!0)("remove-option",t.lJ4(53,vt)),t.R7$(2),t.JRh(t.bMT(40,51,"courses.modules.contents.sidebar.selectOnePage")),t.R7$(2),t.Y8G("pages",e.selectPage)("maxPages",100)("selectedPages",e.selectedPages)("selectHomepage",!0)("onlyHomePage",!1)("showCheck",!0)("showSelected",!1)("pickedItemAttribute","homePageId")("pickedCheckedAttribute","homePageId")}}class P{constructor(n,e,i,o,c,g,S){this.notifyService=n,this.fb=e,this.mediaPickerService=i,this._appRef=o,this._contentService=c,this._mediaService=g,this._utils=S,this.titleCharCounter=40,this.messageCharCounter=100,this.selectPage=[],this.selectedPages=[];let w=this._appRef.components[0].instance.vcr;this.mediaPickerService.setViewContainerRef(w)}ngOnInit(){this._utils.hasStorage("mdService")&&(this.mdSrvc=this._utils.getStorage("mdService")),this._mediaService.getIamToken().subscribe(n=>this.iTk=n),this.getNotify()}getNotify(){this.notifyService.getNotifyObj().pipe((0,M.s)(1)).subscribe(n=>this.createNotifyForm(n))}openMediaPicker(){let n=this._appRef.components[0].instance.vcr;this.mediaPickerService.setViewContainerRef(n),this.mediaPickerService.configMaxSeleted(1),this.mediaPickerService.configFilters({format:"image"}),this.mediaPickerService.open(),this.mediaPickerService.getSelectedsMediaFromMediaPicker().pipe((0,gt.i)(1),(0,M.s)(1)).subscribe(e=>this.configNotifyIcon(e))}configNotifyIcon(n){n.length>0&&(this.selectedNotifyMedia=n[0],this.form.patchValue({ico:this.selectedNotifyMedia.id}))}createNotifyForm(n){let{name:e,title:i,message:o,ico:c,content:g,homePage:S,htmlPlus:w}=n;this.form||(this.form=this.fb.group({name:[e,[s.k0.required]],title:[i,[s.k0.maxLength(40),s.k0.required]],message:[o,[s.k0.maxLength(100)]],ico:c,content:g,homePage:this.fb.array([]),htmlPlus:[w||[]]}),S&&this.fillArrayHomePage(S),console.log(this.form.get("htmlPlus")),this.form.valueChanges.subscribe(K=>this.validadeUpdateNotify(K)))}
1fillArrayHomePage(n){n.forEach(e=>{const i=this.resolveHomePageId(e);i&&(this.selectPage.push({homePageId:i}),this.addHomepage(i,e.id,e.clientId))})}validateMinimunInteger(n){return n>=0?n:0}update(n){console.log({event:n.content.contents}),console.log(this.form.get("htmlPlus").value);let e=n.content.contents;console.log({htmPlusVal:e}),this.form.get("htmlPlus").setValue(e)}validadeUpdateNotify(n){console.log({notify:n}),n.title&&(this.titleCharCounter=this.validateMinimunInteger(40-n.title.length)),n.message&&(this.messageCharCounter=this.validateMinimunInteger(100-n.message.length)),this.notifyService.updateNotifyObj(n,this.form.valid)}setHomePageList(n){this.homePage.clear(),(n||[]).forEach(e=>{const i=this.resolveHomePageId(e);i&&this.addHomepage(i)})}addHomepage(n,e,i){if(!n)return;const o=this.fb.group({id:[e||null],homePageId:[n],clientId:[i||null]});this.homePage.push(o)}resolveHomePageId(n){return n?.homePageId||n?.id||null}deleteHomePage(n){this.homePage.removeAt(n)}get homePage(){return this.form.controls.homePage}static{this.\u0275fac=function(e){return new(e||P)(t.rXU(u.F),t.rXU(s.ze),t.rXU(l._),t.rXU(t.o8S),t.rXU(yt.f),t.rXU(d.u),t.rXU(R.Aq))}}static{this.\u0275cmp=t.VBU({type:P,selectors:[["mm-notify-create-data"]],inputs:{icoUrl:"icoUrl"},decls:1,vars:1,consts:[["class","notify-create-data-content",4,"ngIf"],[1,"notify-create-data-content"],[3,"formControl","key"],[1,"char-counter"],[3,"formControl","type","key"],["class","img-preview",4,"ngIf"],[1,"d-flex","align-items-center"],[1,"btn","btn-primary","me-1",3,"click"],[1,"notification-image-cover"],[3,"data"],[3,"value","feature","not-a-feature","remove-option"],[1,"mt-3"],[3,"value","pages","maxPages","selectedPages","selectHomepage","onlyHomePage","showCheck","showSelected","pickedItemAttribute","pickedCheckedAttribute"],[1,"img-preview"],[1,"img-fluid",3,"src"]],template:function(e,i){1&e&&t.DNE(0,Ct,42,54,"div",0),2&e&&t.Y8G("ngIf",i.form)},dependencies:[h.bT,s.BC,s.l_,p.OD,bt.o,W.u,tt.K,h.Jj,m.D9,p.Ux],styles:[".notify-create-data-content[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:20px 0 10px}.notify-create-data-content[_ngcontent-%COMP%] .img-preview[_ngcontent-%COMP%]{margin-bottom:1rem}.notify-create-data-content[_ngcontent-%COMP%] .char-counter[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"]})}}var F=r(19190),kt=r(46715),St=r(95981);function It(a,n){if(1&a){const e=t.RV6();t.j41(0,"div",12)(1,"h6"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"mm-define-list-page",13),t.bIt("value",function(o){t.eBV(e);const c=t.XpG(2);return t.Njj(c.selectPage(o))}),t.k0s(),t.j41(5,"div",14)(6,"div",15)(7,"h6"),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.nrm(10,"mmp5-fieldset-haruki",16),t.k0s()()()}if(2&a){const e=t.XpG(2);t.R7$(2),t.SpI("",t.bMT(3,8,"notify.create.chooseTargetLink"),"*"),t.R7$(2),t.Y8G("pages",e.pages)("maxPages",1)("selectHomepage",!0)("onlyHomePage",!1),t.R7$(4),t.SpI("",t.bMT(9,10,"notify.create.TargetLinkButtonText"),"*"),t.R7$(2),t.Y8G("formControl",e.form.get("requiredInteractionPageBtnTxt"))("type","link-type-page-button-text")}}function Mt(a,n){if(1&a&&(t.j41(0,"div",17)(1,"div",14)(2,"div",15)(3,"h6"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nrm(6,"mmp5-fieldset-haruki",18),t.j41(7,"h6"),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.nrm(10,"mmp5-fieldset-haruki",18),t.k0s()()()),2&a){const e=t.XpG(2);t.R7$(4),t.SpI("",t.bMT(5,6,"notify.create.externalLink"),"*"),t.R7$(2),t.Y8G("formControl",e.form.get("url"))("key","notification-link-type-url"),t.R7$(2),t.SpI("",t.bMT(9,8,"notify.create.externalLinkButtonText"),"*"),t.R7$(2),t.Y8G("formControl",e.form.get("urlTitle"))("key","notification-link-type-url-title")}}function Ft(a,n){if(1&a&&(t.j41(0,"div",19)(1,"div",14)(2,"div",15)(3,"h6"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nrm(6,"mmp5-fieldset-haruki",18),t.j41(7,"h6"),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.nrm(10,"mmp5-fieldset-haruki",18),t.k0s()()()),2&a){const e=t.XpG(2);t.R7$(4),t.JRh(t.bMT(5,6,"notify.create.requireInteractionCheckboxText")),t.R7$(2),t.Y8G("formControl",e.form.get("requiredInteractionChkTxt"))("key","notify-require-interaction-checkbox-text"),t.R7$(2),t.JRh(t.bMT(9,8,"notify.create.requireInteractionButtonText")),t.R7$(2),t.Y8G("formControl",e.form.get("requiredInteractionBtnC
1hkTxt"))("key","notify-require-interaction-button-text")}}function Tt(a,n){if(1&a&&(t.j41(0,"div",1)(1,"div",2)(2,"h5"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"p"),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.nrm(8,"p",3),t.nI1(9,"translate"),t.nrm(10,"mmp5-fieldset-haruki",4),t.j41(11,"div",5),t.DNE(12,It,11,12,"div",6)(13,Mt,11,10,"div",7),t.k0s()(),t.j41(14,"div",8)(15,"h5"),t.EFF(16),t.nI1(17,"translate"),t.k0s(),t.nrm(18,"p",3),t.nI1(19,"translate"),t.j41(20,"p"),t.EFF(21),t.nI1(22,"translate"),t.k0s(),t.j41(23,"div",9)(24,"strong"),t.EFF(25),t.nI1(26,"translate"),t.k0s(),t.EFF(27),t.nI1(28,"translate"),t.k0s(),t.nrm(29,"mmp5-fieldset-haruki",10),t.nI1(30,"translate"),t.nI1(31,"translate"),t.DNE(32,Ft,11,10,"div",11),t.k0s()()),2&a){const e=t.XpG();t.R7$(3),t.JRh(t.bMT(4,22,"notify.create.notificationLink")),t.R7$(3),t.JRh(t.bMT(7,24,"notify.create.ItsPossibleAndCommon")),t.R7$(2),t.Y8G("innerHTML",t.bMT(9,26,"notify.create.ThisTargetingOccur"),t.npT),t.R7$(2),t.Y8G("formControl",e.form.get("type"))("key","notify-create-type")("type","radio")("options",e.interactionsOptions)("objectRadio",!0),t.R7$(),t.Y8G("ngSwitch",e.form.get("type").value),t.R7$(),t.Y8G("ngSwitchCase","PAGE"),t.R7$(),t.Y8G("ngSwitchCase","LINK"),t.R7$(3),t.JRh(t.bMT(17,28,"notify.create.requireInteractionHeader")),t.R7$(2),t.Y8G("innerHTML",t.bMT(19,30,"notify.create.youCanTurn"),t.npT),t.R7$(3),t.JRh(t.bMT(22,32,"notify.create.useThisFunction")),t.R7$(4),t.JRh(t.bMT(26,34,"notify.create.warning")),t.R7$(2),t.SpI(": ",t.bMT(28,36,"notify.create.whenThisFunction")," "),t.R7$(2),t.Y8G("formControl",e.form.get("requiredInteractionChk"))("type","checkbox")("checked",e.form.get("requiredInteractionChk").value)("label",t.bMT(30,38,"notify.create.requireInterection"))("tooltip",t.bMT(31,40,"notify.create.requiredInteractionTooltip")),t.R7$(3),t.Y8G("ngIf",e.form.get("requiredInteractionChk").value)}}class j{constructor(n,e){this.notifyService=n,this.fb=e,this.interactionsOptions=[{value:F.k.none,name:"Notifica\xe7\xe3o sem link"},{value:F.k.page,name:"P\xe1gina dentro da ferramenta (link interno)"},{value:F.k.link,name:"Endere\xe7o na internet (link externo)"}],this.picked$=new St.t([])}ngOnInit(){this.getNotifyConfig()}getNotifyConfig(){this.notifyService.getNotifyObj().pipe((0,M.s)(1)).subscribe(n=>this.createInteractionsForm(n))}createInteractionsForm(n){let{notifyInteraction:{pageId:e,menuId:i,requiredInteractionChk:o,requiredInteractionBtnChkTxt:c,requiredInteractionPageBtnTxt:g,requiredInteractionChkTxt:S,type:w,url:K,urlTitle:Ie,page:ct,domain:Fe}}=n;if(ct){let q={...ct,pageId:n.notifyInteraction.pageId,menuId:n.notifyInteraction.menuId};this.picked$.next([q]),this.picked$.asObservable().pipe((0,kt.$)()).subscribe(Me=>this.pages=Me)}if(!this.form){let q={pageId:e,menuId:i,requiredInteractionChk:o,requiredInteractionChkTxt:S,requiredInteractionBtnChkTxt:c,requiredInteractionPageBtnTxt:g,type:w,url:[K,[R.yL]],urlTitle:Ie,domain:[window.location.hostname]};this.form=this.fb.group(q),this.validateUpdateNotify(this.form.value),this.form.valueChanges.subscribe(lt=>{this.validateUpdateNotify(lt)})}}selectPage(n){if(0==n.length)return;let e=n.map(i=>({id:i.id,menuId:i.pageId,title:i.title}));this.form.patchValue({pageId:e[0].id,menuId:e[0].menuId})}updateControlValidity(n,e){n.setValidators(e),n.updateValueAndValidity({emitEvent:!1})}validateUpdateNotify(n){let{type:e,requiredInteractionChk:i}=n;e==F.k.link?(this.updateControlValidity(this.form.controls.url,[s.k0.required,R.yL]),this.updateControlValidity(this.form.controls.urlTitle,[s.k0.required]),this.updateControlValidity(this.form.controls.pageId,[]),this.updateControlValidity(this.form.controls.menuId,[]),this.updateControlValidity(this.form.controls.requiredInteractionPageBtnTxt,[])):e===F.k.page?(this.updateControlValidity(this.form.controls.pageId,[s.k0.required]),this.updateControlValidity(this.form.controls.menuId,[]),this.updateControlValidity(this.form.controls.urlTitle,[]),this.updateControlValidity(this.form.controls.url,[]),this.updateControlValidity(this.form.controls.requiredInteractionPageBtnTxt,[s.k0.required])):(this.updateControlValidity(this.form.controls.url,[]),this.updateControlValidity(this.form.controls.urlTitle,[]),this.updateControlValidity(this.form.controls.pageId,[]),this.updateControlValidity(this.form.controls.requiredInteractionPageBtnTxt,[])),i?(this.updateControlValidity(this.form.controls.requiredInteractionBtnC
1hkTxt,[s.k0.required]),this.updateControlValidity(this.form.controls.requiredInteractionChkTxt,[s.k0.required])):(this.updateControlValidity(this.form.controls.requiredInteractionBtnChkTxt,[]),this.updateControlValidity(this.form.controls.requiredInteractionChkTxt,[])),this.form.updateValueAndValidity({emitEvent:!1}),this.notifyService.updateNotifyObj({notifyInteraction:n},this.form.valid)}static{this.\u0275fac=function(e){return new(e||j)(t.rXU(u.F),t.rXU(s.ze))}}static{this.\u0275cmp=t.VBU({type:j,selectors:[["mm-notify-create-interactions"]],decls:1,vars:1,consts:[["class","notify-create-interactions-content",4,"ngIf"],[1,"notify-create-interactions-content"],[1,"notify-link-interactions-type","dark","mb-1"],[3,"innerHTML"],[3,"formControl","key","type","options","objectRadio"],[1,"link-type-page-switch",3,"ngSwitch"],["class","notification-link-type-page",4,"ngSwitchCase"],["class","notification-link-type-external",4,"ngSwitchCase"],[1,"notify-required-interactions","dark"],[1,"alert","alert-danger","mb-1","text-center"],[3,"formControl","type","checked","label","tooltip"],["class","notify-require-interaction-config",4,"ngIf"],[1,"notification-link-type-page"],[3,"value","pages","maxPages","selectHomepage","onlyHomePage"],[1,"row"],[1,"col-12","col-lg-6"],[3,"formControl","type"],[1,"notification-link-type-external"],[3,"formControl","key"],[1,"notify-require-interaction-config"]],template:function(e,i){1&e&&t.DNE(0,Tt,33,42,"div",0),2&e&&t.Y8G("ngIf",i.form)},dependencies:[h.bT,h.ux,h.e1,s.BC,s.l_,p.OD,W.u,m.D9],styles:[".notify-create-interactions-content[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{padding:20px;background-color:#e7eef7;border-radius:5px}.notify-create-interactions-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin:5px 0}.notify-create-interactions-content[_ngcontent-%COMP%] .content-page-list{background-color:#e7eef7;padding:15px 0}.notify-create-interactions-content[_ngcontent-%COMP%] .tooltip-input{position:relative!important;top:2px;right:0;margin-left:5px}.notify-create-interactions-content[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%]{font-size:13px}"]})}}function Rt(a,n){if(1&a&&(t.j41(0,"div",3)(1,"div",4)(2,"div",5)(3,"h6"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nrm(6,"mmp5-fieldset-haruki",6),t.k0s(),t.j41(7,"div",5)(8,"h6"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.nrm(11,"mmp5-fieldset-haruki",7),t.k0s()()()),2&a){const e=t.XpG();t.R7$(4),t.SpI("",t.bMT(5,8,"notify.create.scheduleSendDate"),"*"),t.R7$(2),t.Y8G("formControl",e.scheduleDate)("type","date")("key","scheduleDate"),t.R7$(3),t.SpI("",t.bMT(10,10,"notify.create.scheduleSendHour"),"*"),t.R7$(2),t.Y8G("formControl",e.scheduleHour)("key","scheduleDate")("mask",e.hourMask)}}class O{constructor(n,e){this.notifyService=n,this.fb=e,this.scheduleType=new s.hs(null),this.scheduleDate=new s.hs(null),this.scheduleHour=new s.hs(null),this.scheduleTypeOptions=[{name:"Enviar agora",value:!1},{name:"Agendar envio",value:!0}],this.hourMask=R.NN,this.scheduleForm=new s.J3({schedule:this.scheduleType,publishingDate:this.scheduleDate,publishingHour:this.scheduleHour})}ngOnInit(){this.getNotifyConfig(),this.listenToFormChange()}listenToFormChange(){this.scheduleForm.valueChanges.subscribe(n=>this.validateForm(n))}getNotifyConfig(){this.notifyService.getNotifyObj().pipe((0,M.s)(1)).subscribe(n=>this.configForm(n))}validateForm(n){n.schedule||(this.scheduleForm.controls.publishingDate.setValue("",{emitEvent:!1}),this.scheduleForm.controls.publishingHour.setValue("",{emitEvent:!1}),n.publishingDate=this.scheduleForm.controls.publishingDate.value,n.publishingHour=this.scheduleForm.controls.publishingHour.value),this.notifyService.updateNotifyObj(n,this.scheduleForm.valid)}configForm(n){let{publishingDate:e,publishingHour:i,schedule:o}=n;o?this.scheduleType.setValue(o):this.scheduleType.setValue(!1),this.scheduleDate.setValue(e),this.scheduleHour.setValue(i)}static{this.\u0275fac=function(e){return new(e||O)(t.rXU(u.F),t.rXU(s.ze))}}static{this.\u0275cmp=t.VBU({type:O,selectors:[["mm-notify-create-schedule"]],decls:3,vars:5,consts:[[1,"notify-create-schedule-content"],[3,"formControl","type","options","objectRadio"],["class","schedule-date",4,"ngIf"],[1,"schedule-date"],[1,"row"],[1,"col-12","col-lg-3"],[3,"formControl","type","key"],[3,"formControl","key","mask"]],template:function(e,i){1&e&&(t.j41(0,"div",0),t.nrm(1,"mmp5-fieldset-haruki",1),t.DNE(2,Rt,12,12,"div",2),t.k0s()),2&e&&(t.R7$(),t.Y8G("formControl",i.scheduleType)("type","radio")("options",i.scheduleTypeOptions)("objectRadio",!0),t.R7$(),t.Y8G("ngIf",i.scheduleType.value))},dependencies:[h.bT,s.BC,s.l_,p.OD,m.D9]})}}var xt=r(87899),Et=r(51841),et=r(72020);function Nt(a,n){if(1&a){const e=t.RV6();t.j41(0,"div",4)(1,"div",5)(2,"div",6)(3,"h6"),t.EFF(4,"Escolha os perfis de acesso e/ou usu\xe1rios que receber\xe3o esta notifica\xe7\xe3o."),t.k0s()()(),t.j41(5,"div",5)(6,"div",7)(7,"p"),t.EFF(8,"Perfis de acesso:"),t.k0s(),t.j41(9,"mm-list-item-picker",8),t.bIt("selected",function(o){t.eBV(e);const c=t.XpG(2);return t.Njj(c.populateList(null==o?null:o.items,"groups",o.type,o))}),t.j41(10,"p"),t.EFF(11,"Voc\xea ainda n\xe3o selecionou perfis de acesso para enviar esta notifica\xe7\xe3o."),t.k0s()()(),t.j41(12,"div",9)(13,"p"),t.EFF(14,"Usu\xe1rios:"),t.k0s(),t.j41(15,"mm-list-item-picker",8),t.bIt("selected",function(o){t.eBV(e);const c=t.XpG(2);return t.Njj(c.populateList(null==o?null:o.items,"users",o.type,o))}),t.j41(16,"p"),t.EFF(17,"Voc\xea ainda n\xe3o selecionou usu\xe1rios para enviar esta notifica\xe7\xe3o."),t.k0s()()()()()}if(2&a){const e=t.XpG(2);t.R7$(9),t.Y8G("items",e.groupsList)("type","edit")("placeholder","Buscar perfis de acesso")("formControl",e.formGroups)("attribute","name")("searchFn",e.searchGroups.bind(e)),t.R7$(6),t.Y8G("items",e.usersList)("type","edit")("placeholder","Buscar usu\xe1rios")("formControl",e.formUsers)("attribute","name")("searchFn",e.searchUsers.bind(e))}}function Pt(a,n){if(1&a&&(t.j41(0,"div",1),t.nrm(1,"mmp5-fieldset-haruki",2),t.DNE(2,Nt,18,12,"div",3),t.k0s()),2&a){const e=t.XpG();t.R7$(),t.Y8G("formControl",e.form.get("receiver"))("key","notify-create-receiver")("type","radio")("options",e.recipientsOptions)("objectRadio",!0),t.R7$(),t.Y8G("ngIf","SELECTED"==e.form.get("receiver").value)}}class ${constructor(n,e,i,o,c,g){this.notifyService=n,this.messageService=e,this.accessProfileService=i,this.userService=o,this.translate=c,this.fb=g,this.groups=[],this.users=[],this.groupsList=[],this.usersList=[],this.usersLength=0,this.groupsLength=0,this.recipientsOptions=[{value:F.C.all,name:"Enviar para todos os usu\xe1rios da ferramenta"},{value:F.C.recipients,name:"Escolher destinat\xe1rios"}]}ngOnInit(){this.notifyService.getNotifyObj().pipe((0,M.s)(1)).subscribe(n=>{this.notifyId=n.id,this.notifyInfo(this.notifyId)})}
1notifyInfo(n){n?this.notifyService.notifyInfo(n).subscribe(e=>{this.usersLength=e.users.length,this.groupsLength=e.groups.length,this.createInteractionsForm(e);let i=[];i=e.usersInfo?e.usersInfo:[],this.groupsList=e.groupsInfo?e.groupsInfo:[],i.forEach(o=>{this.usersList.push({name:o.fullName,id:o.id})})},e=>{console.log({notify_error:e}),this.setMessage("error","N\xe3o foi poss\xedvel recuperar os dados desta notifica\xe7\xe3o","Ocorreu um erro.")}):(this.createInteractionsForm({}),this.isValid("ALL",this.usersLength,this.groupsLength))}createInteractionsForm(n){this.formGroups=new s.hs(""),this.formUsers=new s.hs("");let e={receiver:n.receiver?n.receiver:"ALL"};this.form=this.fb.group(e),this.validateUpdateNotify(this.form.value),this.form.valueChanges.subscribe(i=>this.validateUpdateNotify(i))}searchGroups(n){return this.type="groups",new f.c(e=>{this.accessProfileService.getGroups({name:n,unpaged:!0}).subscribe(i=>{e.next(i.content.filter(o=>this.groups.indexOf(o.id)<=-1).map(o=>({name:o.name,id:o.id})))},i=>{e.next(null)})})}searchUsers(n){return this.type="users",new f.c(e=>{let i={query:n};this.userService.searchUsers(i).subscribe(o=>{e.next(o.content.map(c=>({name:c.fullName,id:c.id})))},o=>{e.next(null)})})}setMessage(n,e,i){this.messageService.add({severity:n,summary:e,detail:i})}validateUpdateNotify(n){let e=n.receiver?n.receiver:"ALL";this.isValid(e,this.usersLength,this.groupsLength),this.notifyService.getValidForm().subscribe(i=>{this.valid=i}),this.notifyService.updateNotifyObj(n,this.valid)}populateList(n,e,i,o){let c,g={notifyId:this.notifyId,id:""};"added"==i?(g={...g,id:o.added.id},this.send(e,i,g,c)):(g={...g,id:o.removed.id},this.send(e,i,g,c))}getLength(){this.notifyService.getUsers(this.notifyId).subscribe(n=>{this.usersLength=n.length,this.isValid(this.form.controls.receiver.value,this.usersLength,this.groupsLength)},n=>{this.usersLength=0,this.isValid(this.form.controls.receiver.value,this.usersLength,this.groupsLength)}),this.notifyService.getGroups(this.notifyId).subscribe(n=>{this.groupsLength=n.length,this.isValid(this.form.controls.receiver.value,this.usersLength,this.groupsLength)},n=>{this.groupsLength=0,this.isValid(this.form.controls.receiver.value,this.usersLength,this.groupsLength)})}isValid(n,e,i){"SELECTED"==n&&(e>0||i>0)||"ALL"==n?this.notifyService.setValidForm(!0):this.notifyService.setValidForm(!1)}send(n,e,i,o){this.messageType=null,o="groups"==n?"added"==e?this.notifyService.addGroup(i):this.notifyService.deleteGroup(i):"added"==e?this.notifyService.addUser(i):this.notifyService.deleteUser(i);let c=this.translate.instant(`notify.create.${e}.${n}`);o.subscribe(g=>{this.setMessage("success",c,""),this.getLength()},g=>this.setMessage("danger","N\xe3o foi poss\xedvel efetuar a altera\xe7\xe3o!","Ocorreu um erro."))}static{this.\u0275fac=function(e){return new(e||$)(t.rXU(u.F),t.rXU(y.bg),t.rXU(xt.$),t.rXU(Et.g),t.rXU(m.c$),t.rXU(s.ze))}}static{this.\u0275cmp=t.VBU({type:$,selectors:[["mm-notify-create-recipients"]],decls:1,vars:1,consts:[["class","notify-recipients",4,"ngIf"],[1,"notify-recipients"],[3,"formControl","key","type","options","objectRadio"],["class","groups-users",4,"ngIf"],[1,"groups-users"],[1,"row"],[1,"groups","col-12"],[1,"groups","col-md-6"],["ngDefaultControl","",3,"selected","items","type","placeholder","formControl","attribute","searchFn"],[1,"users","col-md-6"]],template:function(e,i){1&e&&t.DNE(0,Pt,3,6,"div",0),2&e&&t.Y8G("ngIf",i.form)},dependencies:[h.bT,s.me,s.BC,s.l_,p.OD,et.B],styles:[".notify-recipients[_ngcontent-%COMP%] .groups-users[_ngcontent-%COMP%]{margin-top:20px;background-color:#e7eef7;padding:15px}.notify-recipients[_ngcontent-%COMP%] .list-item-selector{background-color:#fff;border:1px solid #e7eef7;border-radius:5px 5px 0 0}.notify-recipients[_ngcontent-%COMP%] .list-items{background-color:#fff;margin-top:0;border:none;border-top:1px solid #e7eef7;border-radius:0}.notify-recipients[_ngcontent-%COMP%] input{border:none}@media screen and (max-width: 450px){.users[_ngcontent-%COMP%]{margin-top:10px}}"]})}}const jt=()=>["/notify"],Ot=()=>[".."];function $t(a,n){if(1&a&&t.nrm(0,"mmp5-wizard-steps",18),2&a){const e=t.XpG();t.Y8G("steps",e.wizardSteps)("icon",e.icons)("currentStep",e.currentStep)}}function Dt(a,n){1&a&&(t.j41(0,"div",19),t.nrm(1,"mm-notify-desc"),t.j41(2,"div",20)(3,"div",21),t.nrm(4,"mm-notify-create-data"),t.k0s()()())}function wt(a,n){1&a&&(t.j41(0,"div",22)(1,"p"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"p"),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.nrm(7,"mm-notify-create-interactions"),t.k0s()),2&a&&(t.R
17$(2),t.JRh(t.bMT(3,2,"notify.create.hereItsPossible")),t.R7$(3),t.JRh(t.bMT(6,4,"notify.create.ConfigureTheInterections")))}function Gt(a,n){1&a&&(t.j41(0,"div",22)(1,"p"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"p"),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.nrm(7,"mm-notify-create-recipients"),t.k0s()),2&a&&(t.R7$(2),t.JRh(t.bMT(3,2,"notify.create.segmentBase")),t.R7$(3),t.JRh(t.bMT(6,4,"notify.create.selectGroups")))}function Yt(a,n){1&a&&(t.j41(0,"div",23)(1,"p"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nrm(4,"mm-notify-create-schedule"),t.k0s()),2&a&&(t.R7$(2),t.JRh(t.bMT(3,1,"notify.create.weAreAlmostThere")))}function Vt(a,n){1&a&&(t.j41(0,"div",24)(1,"div",25)(2,"h1"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nrm(5,"img",26),t.nI1(6,"translate"),t.k0s(),t.j41(7,"p")(8,"span"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"a",27),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"span"),t.EFF(15),t.nI1(16,"translate"),t.k0s()(),t.j41(17,"p"),t.EFF(18),t.nI1(19,"translate"),t.k0s()()),2&a&&(t.R7$(3),t.JRh(t.bMT(4,7,"notify.create.youCompleted")),t.R7$(2),t.Y8G("alt",t.bMT(6,9,"notify.create.youCompleted")),t.R7$(4),t.JRh(t.bMT(10,11,"notify.create.youCanSee")),t.R7$(2),t.Y8G("routerLink",t.lJ4(19,jt)),t.R7$(),t.JRh(t.bMT(13,13,"notify.create.clickHere")),t.R7$(3),t.JRh(t.bMT(16,15,"notify.create.orNavigate")),t.R7$(3),t.JRh(t.bMT(19,17,"notify.create.seeYouSoon")))}function Ut(a,n){if(1&a){const e=t.RV6();t.j41(0,"button",28),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.weHaveToGoBack())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&a&&(t.R7$(),t.JRh(t.bMT(2,1,"button.before")))}function Lt(a,n){if(1&a){const e=t.RV6();t.j41(0,"button",29),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.sendNotify())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&a){const e=t.XpG();t.Y8G("disabled",!e.valid),t.R7$(),t.JRh(t.bMT(2,2,"button.next"))}}function Xt(a,n){1&a&&(t.j41(0,"a",30),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a&&(t.Y8G("routerLink",t.lJ4(4,Ot)),t.R7$(),t.JRh(t.bMT(2,2,"notify.create.finish")))}class X{constructor(n,e,i,o,c){this.translateService=n,this.messageService=e,this.notifyService=i,this.route=o,this.location=c,this.currentStep=1,this.createEmptyNotification()}ngOnInit(){this.getWizardSteps(),this.startOnStep(),this.getValidForm()}getValidForm(){this.notifyService.getValidForm().subscribe(n=>this.valid=n)}startOnStep(){let n=this.route.snapshot.queryParams.step;n&&(this.currentStep=Number(n))}createEmptyNotification(){this.notifyService.createEmptyNotify()}getWizardSteps(){this.icons=["icon icon-wizard-notificacoes-2","icon icon-wizard-notificacoes-3","icon icon-wizard-notificacoes-4","icon icon-wizar-5-2"],this.wizardSteps=[this.translateService.instant("notify.create.generalData"),this.translateService.instant("notify.create.interactions"),this.translateService.instant("notify.create.sendTo"),this.translateService.instant("notify.create.sendScheduling")]}sendNotify(){let n;switch(this.currentStep){case 1:n=this.notifyService.saveNotify();break;case 2:n=this.notifyService.saveNotifyInteractions();break;case 3:n=this.notifyService.saveNotifyRecipients();break;case 4:n=this.notifyService.saveNotifySchedule()}n.pipe((0,M.s)(1)).subscribe(e=>this.goToNextStep(e),e=>this.setMessage("error","N\xe3o foi possivel criar a notifica\xe7\xe3o","Ocorreu um erro."))}setMessage(n,e,i){this.messageService.add({severity:n,summary:e,detail:i}),(0,R.pg)()}goToNextStep(n){this.currentStep++,(0,R.pg)()}cancelCreateNotify(){this.location.back()}weHaveToGoBack(){this.currentStep--}static{this.\u0275fac=function(e){return new(e||X)(t.rXU(m.c$),t.rXU(y.bg),t.rXU(u.F),t.rXU(b.nX),t.rXU(h.aZ))}}static{this.\u0275cmp=t.VBU({type:X,selectors:[["app-notify-create"]],decls:23,vars:16,consts:[[1,"notify-create-content"],[1,"create-wizard"],[3,"steps","icon","currentStep",4,"ngIf"],[1,"mm-box-container"],[1,"mm-box-header"],[1,"mm-box-content"],[3,"ngSwitch"],["class","notify-generalData",4,"ngSwitchCase"],["class","notify-interactions",4,"ngSwitchCase"],["class","notify-schedule",4,"ngSwitchCase"],["class","notify-completed",4,"ngSwitchCase"],[1,"mm-box-footer"],[1,"d-flex","justify-content-between"],[1,"btn","btn-outline-dark",3,"click"],[1,"d-flex"],["class","btn btn-outline-dark me-1",3,"click",4,"ngIf"],["class","btn btn-primary",3,"disabled","click",4,"ngIf"],["class","btn btn-primary",3,"routerLink",4,"ngIf"],[3,"steps","icon","currentStep"],[1,"n
1otify-generalData"],[1,"row","justify-content-center"],[1,"col-12","col-lg-6"],[1,"notify-interactions"],[1,"notify-schedule"],[1,"notify-completed"],[1,"header-completed"],["src","../../../../assets/images/congrats.png",1,"img-fluid",3,"alt"],[3,"routerLink"],[1,"btn","btn-outline-dark","me-1",3,"click"],[1,"btn","btn-primary",3,"click","disabled"],[1,"btn","btn-primary",3,"routerLink"]],template:function(e,i){1&e&&(t.j41(0,"div",0)(1,"div",1),t.DNE(2,$t,1,3,"mmp5-wizard-steps",2),t.k0s(),t.j41(3,"section",3)(4,"header",4),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"div",5)(8,"div",6),t.DNE(9,Dt,5,0,"div",7)(10,wt,8,6,"div",8)(11,Gt,8,6,"div",8)(12,Yt,5,3,"div",9)(13,Vt,20,20,"div",10),t.k0s()(),t.j41(14,"div",11)(15,"div",12)(16,"button",13),t.bIt("click",function(){return i.cancelCreateNotify()}),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.j41(19,"div",14),t.DNE(20,Ut,3,3,"button",15)(21,Lt,3,4,"button",16)(22,Xt,3,5,"a",17),t.k0s()()()()()),2&e&&(t.R7$(2),t.Y8G("ngIf",i.wizardSteps),t.R7$(3),t.JRh(i.wizardSteps[i.currentStep-1]||t.bMT(6,12,"notify.create.congrats")),t.R7$(3),t.Y8G("ngSwitch",i.currentStep),t.R7$(),t.Y8G("ngSwitchCase",1),t.R7$(),t.Y8G("ngSwitchCase",2),t.R7$(),t.Y8G("ngSwitchCase",3),t.R7$(),t.Y8G("ngSwitchCase",4),t.R7$(),t.Y8G("ngSwitchCase",5),t.R7$(4),t.JRh(t.bMT(18,14,"button.cancel")),t.R7$(3),t.Y8G("ngIf",1!=i.currentStep&&5!=i.currentStep),t.R7$(),t.Y8G("ngIf",5!=i.currentStep),t.R7$(),t.Y8G("ngIf",5==i.currentStep))},dependencies:[h.bT,h.ux,h.e1,b.Wk,p.m0,L,P,j,O,$,m.D9],styles:[".notify-create-content[_ngcontent-%COMP%] .create-wizard[_ngcontent-%COMP%]{margin-bottom:100px}.notify-create-content[_ngcontent-%COMP%] .header-completed[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}"]})}}var Ht=r(93527),nt=r(41478),Jt=r(44053),D=r(97800),Bt=r(5725),At=r(75293),it=r(64600);const zt=()=>["icon","icon-grupos-dados"];function Wt(a,n){if(1&a&&(t.j41(0,"div",20),t.nrm(1,"mm-notify-send-list",21),t.k0s()),2&a){const e=t.XpG(2);t.R7$(),t.Y8G("redirectTo","/modules/notify/dashboard")("text","Disparo")("notifySends$",e.notifySends$)}}function Kt(a,n){if(1&a){const e=t.RV6();t.j41(0,"div",3)(1,"header",4)(2,"div",5),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"button",6),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.showList=!o.showList)}),t.nrm(6,"mmp5-mm-icons",7),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.DNE(9,Wt,2,3,"div",8),t.k0s(),t.j41(10,"div",9)(11,"p",10),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"mat-accordion")(15,"mat-expansion-panel")(16,"mat-expansion-panel-header")(17,"mat-panel-title")(18,"h6",11),t.EFF(19),t.nI1(20,"translate"),t.k0s()()(),t.j41(21,"div",12),t.nrm(22,"mm-notify-create-data",13),t.k0s()(),t.j41(23,"mat-expansion-panel")(24,"mat-expansion-panel-header")(25,"mat-panel-title")(26,"h6",11),t.EFF(27),t.nI1(28,"translate"),t.k0s()()(),t.j41(29,"div",12),t.nrm(30,"mm-notify-create-interactions"),t.k0s()(),t.j41(31,"mat-expansion-panel",14),t.bIt("afterExpand",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.overflow=!o.overflow)})("closed",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.overflow=!o.overflow)}),t.j41(32,"mat-expansion-panel-header")(33,"mat-panel-title")(34,"h6",11),t.EFF(35),t.nI1(36,"translate"),t.k0s()()(),t.j41(37,"div",12),t.nrm(38,"mm-notify-create-recipients"),t.k0s()(),t.j41(39,"mat-expansion-panel")(40,"mat-expansion-panel-header")(41,"mat-panel-title")(42,"h6",11),t.EFF(43),t.nI1(44,"translate"),t.k0s()()(),t.j41(45,"div",12),t.nrm(46,"mm-notify-create-schedule"),t.k0s()()()(),t.j41(47,"div",15)(48,"button",16),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.cancel())}),t.EFF(49),t.nI1(50,"translate"),t.k0s(),t.j41(51,"div",17)(52,"button",18),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.saveData("save"))}),t.EFF(53),t.nI1(54,"translate"),t.k0s(),t.j41(55,"button",19),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.saveData("editAndSave"))}),t.EFF(56),t.nI1(57,"translate"),t.k0s()()()()}if(2&a){const e=t.XpG();t.R7$(3),t.Lme(" ",t.bMT(4,17,"notify.edit.editNotify")," - ",e.title," "),t.R7$(3),t.Y8G("icon",t.lJ4(37,zt)),t.R7$(),t.SpI(" ",t.bMT(8,19,"notify.edit.statistics")," "),t.R7$(2),t.Y8G("ngIf",e.showList),t.R7$(3),t.JRh(t.bMT(13,21,"notify.edit.description")),t.R7$(7),t.SpI(" ",t.bMT(20,23,"notify.create.generalData"),""),t.R7$(3),t.Y8G("icoUrl",e.icoUrl),t.R7$(5),t.SpI(" ",t.bMT(28,25,"notify.create.interactions"),""),t.R7$(4),t.Y8G("ngClass",e.overflow?"overflow":"hidden"),t.R7$(4),t.SpI(" ",t.bMT(36,27,"notify.create.sendTo"),""),t.R7$(8),t.SpI(" ",t.bMT(44,29,"notify.create.sendScheduling"),""),t.R7$(6),t.JRh(t.bMT(50,31,"button.cancel")),t.R7$(3),t.Y8G("disabled",!e.valid),t.R7$(),t.JRh(t.bMT(54,33,"notify.edit.saveData")),t.R7$(2),t.Y8G("disabled",!e.valid),t.R7$(),t.JRh(t.bMT(57,35,"notify.edit.saveAndSend"))}}class H{constructor(n,e,i,o,c,g){this.activatedRoute=n,this.router=e,this.messageService=i,this.notifyService=o,this._dialog=c,this._translate=g}ngAfterContentInit(){this.notifyId=this.activatedRoute.snapshot.params.id,this.notifySends$=this.notifyService.getNotifySends(this.notifyId).pipe((0,Ht.T)(n=>
1n||[])),this.notifyInfo=this.notifyService.notifyInfo(this.notifyId).subscribe(n=>{this.notifyService.setNotifyObj(n),this.notifyService.validateNotifyObject(),this.title=n.name,this.icoUrl=n.icoUrl,this.notify=!0},n=>{console.log(n),this.messageService.add({severity:"error",summary:this._translate.instant("notify.edit.editNotify"),detail:this._translate.instant("notify.edit.retrieveYour")})}),this.notifyService.getValidForm().subscribe(n=>this.valid=n)}saveData(n){this.subscription=this.notifyService.getNotifyObj().pipe((0,M.s)(1)).subscribe(e=>{e.notifyInteraction.domain=window.location.hostname,this.editNotify="editAndSave"==n?this.notifyService.editAndSend(this.notifyId,e).subscribe(()=>{this.messageService.add({severity:"success",summary:this._translate.instant("notify.edit.editSendSuccess"),detail:e.title}),this.router.navigate(["/modules","notify"])},i=>{console.log(i),this.messageService.add({severity:"error",summary:this._translate.instant("notify.edit.editSendError"),detail:e.title})}):this.notifyService.editNotify(this.notifyId,e).subscribe(()=>{this.messageService.add({severity:"success",summary:this._translate.instant("notify.edit.editSuccess"),detail:e.title}),this.router.navigate(["/modules","notify"])},i=>{console.log(i),this.messageService.add({severity:"error",summary:this._translate.instant("notify.edit.editError"),detail:e.title})})})}deleteNotify(){let n={title:"Remover",message:this._translate.instant("cms.content.menu.wantRemoveNotify"),buttons:[{text:this._translate.instant("button.cancel"),type:"btn-outline-dark",data:"cancel"},{text:this._translate.instant("cms.content.menu.removeNotify"),type:"btn-primary",data:"remove"}]};this._dialog.open(nt.U,{maxHeight:"40rem",width:"40rem",data:n}).afterClosed().subscribe(i=>{"remove"==i&&this.notifyService.deleteNotify(this.notifyId).subscribe(()=>{this.messageService.add({severity:"success",summary:this._translate.instant("cms.content.menu.deleteSuccessNotify2"),detail:this._translate.instant("cms.content.menu.deleteSuccess3")}),this.router.navigate(["/modules","notify"])},()=>{this.messageService.add({severity:"error",summary:this._translate.instant("cms.content.menu.deleteErrorNotify"),detail:this._translate.instant("cms.content.menu.deleteError")})})})}cancel(){this.router.navigate(["/modules","notify"])}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),this.notifyInfo&&this.notifyInfo.unsubscribe(),this.editNotify&&this.editNotify.unsubscribe()}static{this.\u0275fac=function(e){return new(e||H)(t.rXU(b.nX),t.rXU(b.Ix),t.rXU(y.bg),t.rXU(u.F),t.rXU(Jt.bZ),t.rXU(m.c$))}}static{this.\u0275cmp=t.VBU({type:H,selectors:[["mm-notify-edit"]],decls:6,vars:10,consts:[[1,"notify-edit"],["class","mm-box-container",4,"ngIf"],[3,"click","back","tooltip","icon"],[1,"mm-box-container"],[1,"mm-box-header"],[1,"header-title"],[1,"btn","btn-primary","btn-small",3,"click"],[3,"icon"],["class","send-list",4,"ngIf"],[1,"expandable-data","mb-3"],[1,"description"],[1,"subtitle","mb-0"],[1,"content"],[3,"icoUrl"],[3,"afterExpand","closed","ngClass"],[1,"mm-box-footer"],[1,"btn","btn-outline-dark",3,"click"],[1,"save-buttons"],[1,"btn","btn-primary","save",3,"click","disabled"],[1,"btn","btn-primary",3,"click","disabled"],[1,"send-list"],[3,"redirectTo","text","notifySends$"]],template:function(e,i){1&e&&(t.j41(0,"div",0),t.DNE(1,Kt,58,38,"div",1),t.k0s(),t.j41(2,"mm-fab")(3,"button-item",2),t.bIt("click",function(){return i.saveData("save")}),t.k0s(),t.j41(4,"button-item",2),t.bIt("click",function(){return i.saveData("editAndSave")}
1),t.k0s(),t.j41(5,"button-item",2),t.bIt("click",function(){return i.deleteNotify()}),t.k0s()()),2&e&&(t.R7$(),t.Y8G("ngIf",i.notify),t.R7$(2),t.Y8G("back","blue")("tooltip","Salvar altera\xe7\xf5es")("icon","icon-salvar"),t.R7$(),t.Y8G("back","blue")("tooltip","Salvar e enviar")("icon","icon-mudancas-de-cargo"),t.R7$(),t.Y8G("back","red")("tooltip","Excluir notifica\xe7\xe3o")("icon","icon-toolbar-apagar"))},dependencies:[h.YU,h.bT,p.S3,D.BS,D.GK,D.Z2,D.WN,Bt.D,At.J,it.H,P,j,O,$,m.D9],styles:[".notify-edit[_ngcontent-%COMP%] header.mm-box-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;position:relative}.notify-edit[_ngcontent-%COMP%] header.mm-box-header[_ngcontent-%COMP%] button.btn[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.notify-edit[_ngcontent-%COMP%] header.mm-box-header[_ngcontent-%COMP%] button.btn[_ngcontent-%COMP%] mmp5-mm-icons[_ngcontent-%COMP%]{margin-right:5px}.notify-edit[_ngcontent-%COMP%] header.mm-box-header[_ngcontent-%COMP%] .send-list[_ngcontent-%COMP%]{position:absolute;top:90%;right:2.5rem;z-index:1;width:500px}.notify-edit[_ngcontent-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%]{background-color:#fff!important;border-block-end:1px #e6ecf5 solid;border-bottom-left-radius:0;border-bottom-right-radius:0}.notify-edit[_ngcontent-%COMP%] .content-panel[_ngcontent-%COMP%]{padding:25px!important}.notify-edit[_ngcontent-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%]:not([class*=mat-elevation-z]){box-shadow:none!important;border:1px #e6ecf5 solid}.notify-edit[_ngcontent-%COMP%] .mat-expansion-panel-body[_ngcontent-%COMP%]{border-bottom:1px #e6ecf5 solid!important;padding:25px 24px 16px!important}.notify-edit[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:25px 0 0}.notify-edit[_ngcontent-%COMP%] .mat-expansion-panel-spacing[_ngcontent-%COMP%]{margin:0}.notify-edit[_ngcontent-%COMP%] .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{overflow:visible}.notify-edit[_ngcontent-%COMP%] .mm-box-footer[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.notify-edit[_ngcontent-%COMP%] .mm-box-footer[_ngcontent-%COMP%] .save-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:15px}.notify-edit[_ngcontent-%COMP%] .expandable-data[_ngcontent-%COMP%]{margin:30px 30px 0;color:#232327}@media screen and (max-width: 450px){.save-buttons[_ngcontent-%COMP%]{text-align:center}.save-buttons[_ngcontent-%COMP%] .save[_ngcontent-%COMP%]{margin-bottom:10px}}"]})}}var ot=r(24313),qt=r(37236),at=r(68887),x=r(35025);const Zt=a=>["modules/notify/edit/",a],Qt=a=>["/hp/user-profile/",a],te=()=>["icon","icon-grupos-dados"],ee=(a,n)=>({"data-container":!0,"view-access":!0,fullHeight:a,first:n}),ne=a=>["visualizada",a],ie=a=>["n\xe3o visualizada",a],st=(a,n)=>[a,n],oe=a=>["intera\xe7oes",a],ae=a=>["sem intera\xe7\xf5es",a],se=()=>["cellTitle","cellTitle","cellTitle","cellTitle"];function re(a,n){if(1&a&&(t.j41(0,"div",31),t.nrm(1,"mm-notify-send-list",32),t.k0s()),2&a){const e=t.XpG().ngIf;t.R7$(),t.Y8G("id",e.notifyConfigId)}}function ce(a,n){if(1&a&&(t.j41(0,"div",33)(1,"div",17)(2,"p"),t.EFF(3),t.k0s(),t.j41(4,"p",14),t.EFF(5),t.k0s(),t.j41(6,"p"),t.EFF(7,"acessos no link."),t.k0s()(),t.j41(8,"div",18)(9,"p"),t.EFF(10,"Equivale a "),t.j41(11,"span"),t.EFF(12),t.k0s(),t.EFF(13," do n\xfamero total de visualiza\xe7\xf5es."),t.k0s(),t.nrm(14,"mmp5-graph",19),t.k0s()()),2&a){const e=t.XpG().ngIf,i=t.XpG();t.R7$(3),t.SpI("",e.views>1?"Destas "+e.views+" visualiza\xe7\xf5es ocasionaram":"Desta "+e.views+" visualiza\xe7\xe3o ocasionaram",","),t.R7$(2),t.JRh(e.interactions),t.R7$(7),t.SpI("",e.interactionsPercentage,"%"),t.R7$(2),t.Y8G("type",i.chartType)("title","")("elementId","chartInteractions")("width",i.chartWidth)("height",i.chartHeight)("options",i.chartOptions)("data",t.l_i(14,st,t.eq3(10,oe,e.interactions),t.eq3(12,ae,e.notInteractions)))}}function le(a,n){if(1&a&&(t.nrm(0,"mm-table",34),t.nI1(1,"paginate")),2&a){const e=t.XpG(2);t.Y8G("values",t.i5U(1,6,e.tableValues,e.config))("columnNames",e.tableColumnNames)("tableSize","unset")("tableWidth","100%")("tdClass",t.lJ4(9,se))("track",!1)}}function de(a,n){if(1&a){const e=t.RV6();t.j41(0,"pagination-template",35,0),t.bIt("pageChange",function(o){t.eBV(e);const c=t.XpG(2);return t.Njj(c.getPagedTrayusers({page:o-1}))}),t.nrm(2,"mm-ngx-pagination",36),t.k0s()}if(2&a){const e=t.sdS(1),i=t.XpG(2);t.Y8G("id",i.config.id),t.R7$(2),t.Y8G("p",e)("config",i.config)}}
1function me(a,n){if(1&a){const e=t.RV6();t.j41(0,"div",2)(1,"div",3),t.EFF(2),t.nI1(3,"translate"),t.nI1(4,"translate"),t.j41(5,"a",4),t.EFF(6),t.nI1(7,"translate"),t.k0s()(),t.j41(8,"div",5)(9,"ul",6)(10,"li"),t.EFF(11),t.nI1(12,"translate"),t.j41(13,"span"),t.EFF(14),t.k0s()(),t.j41(15,"li"),t.EFF(16),t.nI1(17,"translate"),t.j41(18,"span"),t.EFF(19),t.k0s()(),t.j41(20,"li"),t.EFF(21),t.nI1(22,"translate"),t.j41(23,"span"),t.EFF(24),t.k0s()(),t.j41(25,"li"),t.EFF(26),t.nI1(27,"translate"),t.j41(28,"a",4),t.EFF(29),t.k0s()()(),t.j41(30,"div",7)(31,"button",8),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.showList=!o.showList)}),t.nrm(32,"mmp5-mm-icons",9),t.EFF(33),t.nI1(34,"translate"),t.k0s(),t.DNE(35,re,2,1,"div",10),t.k0s()(),t.j41(36,"div",11)(37,"div",12)(38,"div",13)(39,"p"),t.EFF(40),t.nI1(41,"translate"),t.k0s(),t.j41(42,"p",14),t.EFF(43),t.k0s(),t.j41(44,"p"),t.EFF(45),t.k0s()()(),t.j41(46,"div",15)(47,"div",16)(48,"div",17)(49,"p"),t.EFF(50),t.k0s(),t.j41(51,"p",14),t.EFF(52),t.k0s(),t.j41(53,"p")(54,"span"),t.EFF(55),t.k0s(),t.EFF(56," esta notifica\xe7\xe3o."),t.k0s()(),t.j41(57,"div",18)(58,"p"),t.EFF(59,"Equivale a "),t.j41(60,"span"),t.EFF(61),t.k0s(),t.EFF(62," do n\xfamero total de envios."),t.k0s(),t.j41(63,"div"),t.nrm(64,"mmp5-graph",19),t.k0s()()(),t.DNE(65,ce,15,17,"div",20),t.k0s()(),t.j41(66,"div",21)(67,"div",6)(68,"p"),t.EFF(69,"Busque usu\xe1rios para visualizar as intera\xe7\xf5es deste com a notifica\xe7\xe3o."),t.k0s(),t.j41(70,"div",22),t.nrm(71,"mmp5-fieldset-haruki",23),t.k0s()(),t.j41(72,"div",24)(73,"button",25),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.downloadStats())}),t.EFF(74,"Baixar relat\xf3rio"),t.k0s()()(),t.j41(75,"div",26)(76,"div",27),t.DNE(77,le,2,10,"mm-table",28),t.j41(78,"div",29),t.DNE(79,de,3,3,"pagination-template",30),t.k0s()()()()}if(2&a){const e=n.ngIf,i=t.XpG();t.R7$(2),t.E5c(" ",t.bMT(3,38,"notify.edit.viewingTrigger")," ",e.order," ",t.bMT(4,40,"notify.edit.thisNotification")," "),t.R7$(3),t.Y8G("routerLink",t.eq3(56,Zt,e.notifyConfigId)),t.R7$(),t.SpI(" ",t.bMT(7,42,"notify.edit.returnThis")," "),t.R7$(5),t.SpI("",t.bMT(12,44,"notify.edit.notificaion"),": "),t.R7$(3),t.JRh(e.notifyConfigName),t.R7$(2),t.SpI("",t.bMT(17,46,"notify.edit.shot"),": "),t.R7$(3),t.JRh(e.order),t.R7$(2),t.SpI("",t.bMT(22,48,"notify.edit.madeIn"),": "),t.R7$(3),t.JRh(e.creationDate),t.R7$(2),t.SpI("",t.bMT(27,50,"notify.edit.per"),": "),t.R7$(2),t.Y8G("routerLink",t.eq3(58,Qt,e.createdById)),t.R7$(),t.JRh(e.createdBy.fullName),t.R7$(3),t.Y8G("icon",t.lJ4(60,te)),t.R7$(),t.SpI(" ",t.bMT(34,52,"notify.edit.statistics")," "),t.R7$(2),t.Y8G("ngIf",i.showList),t.R7$(5),t.JRh(t.bMT(41,54,"notify.edit.thisNotificationHas")),t.R7$(3),t.JRh(e.total),t.R7$(2),t.SpI("",e.total>1?"usu\xe1rios":"usu\xe1rio","."),t.R7$(2),t.Y8G("ngClass",t.l_i(61,ee,!e.notificationHasInteraction,e.notificationHasInteraction)),t.R7$(3),t.SpI("",e.total>1?"Destes "+e.total+" usu\xe1rios":"Deste "+e.total+" usu\xe1rio",","),t.R7$(2),t.JRh(e.views),t.R7$(3),t.JRh(e.views>1?"visualizaram":"visualizou"),t.R7$(6),t.SpI("",e.viewsPercentage,"%"),t.R7$(3),t.Y8G("type",i.chartType)("title","")("elementId","chartViews")("width",i.chartWidth)("height",i.chartHeight)("options",i.chartOptions)("data",t.l_i(68,st,t.eq3(64,ne,e.views),t.eq3(66,ie,e.notViews))),t.R7$(),t.Y8G("ngIf",e.notificationHasInteraction),t.R7$(6),t.Y8G("formControl",i.search)("type","search")("label","Buscar pelo nome"),t.R7$(6),t.Y8G("ngIf",i.tableValues),t.R7$(2),t.Y8G("ngIf",i.pages>1)}}class J{constructor(n,e,i,o,c){this.notifyService=n,this.loadingSpinner=e,this.translateService=i,this.route=o,this.vcr=c,this.search=new s.hs(""),this.chartType="PieChart",this.chartWidth=300,this.chartHeight=300,this.chartOptions={colors:["#ff5e3a","#3f4156"],sliceVisibilityThreshold:0,legend:{position:"top",alignment:"center",textStyle:{color:"#232327",fontSize:11}}},this.config={id:"",itemsPerPage:1e3,currentPage:1},this.searchConfig={pushNotificationId:"",name:"",page:0,size:10},this.loadingSpinner.setViewContainerRef(this.vcr)}ngOnInit(){this.loadingSpinner.getStatus()||this.loadingSpinner.open(),this.route.params.subscribe(n=>{this.pushNotificationId=n.pushNotificationId,this.notifyStats=this.notifyService.getStats(n.pushNotificationId).pipe((0,qt.M)(e=>this.stats=e)),this.getTrayNotifyUsers(),this.notifyStats&&this.loadingSpinner.getStatus()&&this.loadingSpinner.close()}),this.search.valueChanges.pipe((0,at.B)(500)).subscribe(n=>{let e={...this.searchConfig,pushNotificationId:this.pushNotificationId,name:n};this.getPagedTrayusers(e)})}download(n){let e;e=this.stats?`${this.stats.notifyConfigName}-Disparo-${this.stats.order}-${x().format("YYYYMMDD")}.xlsx`:`Disparo-${x().format("YYYYMMDD")}.xlsx`,(0,ot.saveAs)(n.body,e)}downloadStats(){this.notifyService.downloadNotifyStats(this.pushNotificationId).subscribe(n=>this.download(n))}getTrayNotifyUsers(){let n={...this.searchConfig,pushNotificationId:this.pushNotificationId};this.getPagedTrayusers(n)}getPagedTrayusers(n){n={...this.searchConfig,...n,pushNotificationId:this.pushNotificationId},this.loadingSpinner.getStatus()||this.loadingSpinner.open(),this.notifyService.getDashboardAllUsers(n).subscribe(e=>{this.createUsersTableData(e),this.notifyStats&&this.loadingSpinner.getStatus()&&this.loadingSpinner.close()},e=>{this.createUsersTableData({content:[],pageable:{}}),this.notifyStats&&this.loadingSpinner.getStatus()&&this.loadingSpinner.close()})}createUsersTableData(n){this.tableColumnNames=[this.translateService.instant("notify.dashboard.name"),this.translateService.instant("notify.dashboard.viewed"),this.translateService.instant("notify.dashboard.clicked"),this.translateService.instant("notify.dashboard.interactions")];let e=n.content;this.config={...this.config,currentPage:n.pageable.pageNumber+1,itemsPerPage:n.size,totalItems:n.totalElements,id:"trayUsersPagination"},this.pages=n.totalPages,this.tableValues=e.map(i=>{let o=i.viewDate?"icon icon-check":"icon icon-x",c="NONE"==i.type?"":i.interactionDate?"icon icon-check":"icon icon-x",g=i.required_interaction_chk&&i.interactionDate?"icon icon-check":i.required_interaction_chk?"icon icon-x":"";return{[this.tableColumnNames[0]]:i.fullName,[this.tableColumnNames[1]]:i.viewDate?x(i.viewDate).format("DD-MM-YYYY HH:mm:ss"):"N\xe3o visualizada",[this.tableColumnNames[2]]:"NONE"==i.type?"Sem link":i.interactionDate?x(i.interactionDate).format("DD-MM-YYYY HH:mm:ss"):"N\xe3o acessado",[this.tableColumnNames[3]]:i.required_interaction_chk&&i.interactionDate?x(i.interactionDate).format("DD-MM-YYYY HH:mm:ss"):i.required_interaction_chk?"N\xe3o Interagiu":"N\xe3o possui",linkTo:`/hp/user-profile/${i.user_id}`,beforeIcons:[null,[o],[c],[g]]}})}ngOnDestroy(){this.loadingSpinner.clearVcr()}static{this.\u0275fac=function(e){return new(e||J)(t.rXU(u.F),t.rXU(p.kt),t.rXU(m.c$),t.rXU(b.nX),t.rXU(t.c1b))}}static{this.\u0275cmp=t.VBU({type:J,selectors:[["mm-notify-dashboard"]],decls:2,vars:3,consts:[["p","paginationApi"],["class","notify-dashboard",4,"ngIf"],[1,"notify-dashboard"],[1,"col-12","alert","alert-info"],[3,"routerLink"],[1,"row","align-items-center"],[1,"col-8"],[1,"col-4","orderButton"],[1,"btn","btn-primary","btn-small",3,"click"],[3,"icon"],["class","send-list",4,"ngIf"],[1,"row","stats-container"],[1,"col-md-4","col-lg-4","col-sm-4"],[1,"data-container","send"],[1,"number"],[1,"col-md-8","col-lg-8","col-sm-8"],[3,"ngClass"],[1,"view-access-info","col-md-6","col-lg-6"],[1,"container-chart","col-md-6","col-lg-6"],[3,"type","title","elementId","width","height","o
1ptions","data"],["class","data-container view-access",4,"ngIf"],[1,"row","search-container"],[1,"search"],[3,"formControl","type","label"],[1,"col-4","report"],[1,"btn","btn-primary",3,"click"],[1,"row","list-container"],[1,"col-12","table-tray-users"],["class","d-flex",3,"values","columnNames","tableSize","tableWidth","tdClass","track",4,"ngIf"],[1,"mt-1"],["maxSize","10",3,"id","pageChange",4,"ngIf"],[1,"send-list"],[3,"id"],[1,"data-container","view-access"],[1,"d-flex",3,"values","columnNames","tableSize","tableWidth","tdClass","track"],["maxSize","10",3,"pageChange","id"],[3,"p","config"]],template:function(e,i){1&e&&(t.DNE(0,me,80,71,"div",1),t.nI1(1,"async")),2&e&&t.Y8G("ngIf",t.bMT(1,1,i.notifyStats))},dependencies:[h.YU,h.bT,s.BC,s.l_,b.Wk,p.uO,p.S3,p.OD,p.Ls,k.Qr,p.uJ,it.H,h.Jj,m.D9,k.kf],styles:[".notify-dashboard[_ngcontent-%COMP%] .alert-info[_ngcontent-%COMP%]{color:#38839f;border-color:#bee5eb;margin-bottom:30px;background-color:#d1ecf1}.notify-dashboard[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style-type:none;margin-left:0;margin-bottom:0}.notify-dashboard[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:700}.notify-dashboard[_ngcontent-%COMP%] .orderButton[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.notify-dashboard[_ngcontent-%COMP%] .orderButton[_ngcontent-%COMP%] .send-list[_ngcontent-%COMP%]{position:absolute;top:119%;right:4%;z-index:1;width:500px}.notify-dashboard[_ngcontent-%COMP%] .stats-container[_ngcontent-%COMP%]{margin-top:30px;margin-bottom:30px}.notify-dashboard[_ngcontent-%COMP%] .stats-container[_ngcontent-%COMP%] .data-container[_ngcontent-%COMP%]{background-color:#fff;border:1px solid #e6ecf5;border-radius:5px;padding:15px}.notify-dashboard[_ngcontent-%COMP%] .stats-container[_ngcontent-%COMP%] .data-container.send[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.notify-dashboard[_ngcontent-%COMP%] .stats-container[_ngcontent-%COMP%] .data-container.send[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-weight:700}.notify-dashboard[_ngcontent-%COMP%] .stats-container[_ngcontent-%COMP%] .data-container.send[_ngcontent-%COMP%] p.number[_ngcontent-%COMP%]{color:var(--primary);font-size:4rem}.notify-dashboard[_ngcontent-%COMP%] .view-access[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-right:0}.notify-dashboard[_ngcontent-%COMP%] .view-access.fullHeight[_ngcontent-%COMP%]{height:100%}.notify-dashboard[_ngcontent-%COMP%] .view-access.first[_ngcontent-%COMP%]{margin-bottom:30px}.notify-dashboard[_ngcontent-%COMP%] .view-access[_ngcontent-%COMP%] .container-chart[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column}.notify-dashboard[_ngcontent-%COMP%] .view-access[_ngcontent-%COMP%] .view-access-info[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column}.notify-dashboard[_ngcontent-%COMP%] .view-access[_ngcontent-%COMP%] .view-access-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-weight:700}.notify-dashboard[_ngcontent-%COMP%] .view-access[_ngcontent-%COMP%] .view-access-info[_ngcontent-%COMP%] p.number[_ngcontent-%COMP%]{color:var(--primary);font-size:3rem}.notify-dashboard[_ngcontent-%COMP%] .view-access[_ngcontent-%COMP%] .container-chart[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--primary)}.notify-dashboard[_ngcontent-%COMP%] .search-container[_ngcontent-%COMP%]{align-items:flex-end;justify-content:space-between;margin-top:30px}.notify-dashboard[_ngcontent-%COMP%] .search-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{width:300px}.notify-dashboard[_ngcontent-%COMP%] .search-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-weight:700}.notify-dashboard[_ngcontent-%COMP%] .search-container[_ngcontent-%COMP%] .report[_ngcontent-%COMP%]{display:flex;height:100%;justify-content:flex-end}.notify-dashboard[_ngcontent-%COMP%] .table-tray-users[_ngcontent-%COMP%]{margin-top:30px}.notify-dashboard[_ngcontent-%COMP%] .table-tray-users[_ngcontent-%COMP%] .cellTitle[_ngcontent-%COMP%]{justify-content:center;display:flex;align-items:center}.notify-dashboard[_ngcontent-%COMP%] .icons__before .icon{font-size:1.3rem}.notify-dashboard[_ngcontent-%COMP%] .icons__before .icon.icon-check{color:green}.notify-dashboard[_ngcontent-%COMP%] .icons__before .icon.icon-x{color:red}"]})}}const fe=()=>["..","management"],pe=()=>["tableTitle",null,null],ue=()=>["cellTitle",null,null];function he(a,n){1&a&&(t.j41(0,"p",24),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a&&(t.R
17$(),t.SpI(" ",t.bMT(2,1,"notify.management.emptySends")," "))}function ge(a,n){if(1&a&&(t.nrm(0,"mm-table",25),t.nI1(1,"paginate")),2&a){const e=t.XpG();t.Y8G("values",t.i5U(1,6,e.tableValues,e.config))("columnNames",e.tableColumnNames)("tableSize","unset")("thClass",t.lJ4(9,pe))("tdClass",t.lJ4(10,ue))("track",!1)}}function ye(a,n){if(1&a){const e=t.RV6();t.j41(0,"pagination-template",26,0),t.bIt("pageChange",function(o){t.eBV(e);const c=t.XpG();return t.Njj(c.getPagedSends(o-1))}),t.nrm(2,"mm-ngx-pagination",27),t.k0s()}if(2&a){const e=t.sdS(1),i=t.XpG();t.Y8G("id",i.config.id),t.R7$(2),t.Y8G("p",e)("config",i.config)}}class B{constructor(n,e,i,o,c){this.notifyService=n,this.translateService=e,this.loadingSpinner=i,this.messageService=o,this._appRef=c,this.filterForm=new s.gE({title:new s.MJ(""),sentDateStart:new s.MJ(this.isoDate(this.daysAgo(29))),sentDateEnd:new s.MJ(this.isoDate(new Date))}),this.config={id:"",itemsPerPage:1e3,currentPage:1},this.pageSize=12,this.downloading=!1,this.loadingSpinner.setViewContainerRef(this._appRef.components[0].instance.vcr)}ngOnInit(){this.loadSends(0),this.filterSub=this.filterForm.valueChanges.pipe((0,at.B)(400)).subscribe(()=>this.loadSends(0))}loadSends(n){this.loadingSpinner.getStatus()||this.loadingSpinner.open(),this.notifyService.searchManagementSends(this.currentFilter(),n,this.pageSize).subscribe({next:e=>this.createTable(e),error:()=>this.createTable({content:[],pageable:{},size:this.pageSize,totalPages:0,totalElements:0})})}getPagedSends(n){this.loadSends(n)}lastThirtyDays(){this.filterForm.patchValue({sentDateStart:this.isoDate(this.daysAgo(29)),sentDateEnd:this.isoDate(new Date)})}downloadExcel(){this.downloading||(this.downloading=!0,this.loadingSpinner.getStatus()||this.loadingSpinner.open(),this.notifyService.downloadManagementSends(this.currentFilter()).subscribe({next:n=>{const e=`historico-envios-${x().format("YYYYMMDD")}.xlsx`;(0,ot.saveAs)(n.body,e),this.finishDownload()},error:()=>{this.messageService.add({severity:"error",summary:this.translateService.instant("notify.management.downloadExcelError")}),this.finishDownload()}}))}createTable(n){this.tableColumnNames=[this.translateService.instant("notify.management.notificationTitle"),this.translateService.instant("notify.management.shotNumber"),this.translateService.instant("notify.management.sentAt")];const e=n.content||[];this.config={...this.config,currentPage:(n.pageable?.pageNumber??0)+1,itemsPerPage:n.size??this.pageSize,totalItems:n.totalElements,id:"notifySendPagination"},this.pages=n.totalPages,this.tableValues=e.map(i=>({[this.tableColumnNames[0]]:i.title,[this.tableColumnNames[1]]:i.order,[this.tableColumnNames[2]]:i.creationDate,id:i.id,linkTo:`modules/notify/dashboard/${i.id}`})),this.loadingSpinner.getStatus()&&this.loadingSpinner.close()}ngOnDestroy(){this.filterSub?.unsubscribe(),this.loadingSpinner.clearVcr()}finishDownload(){this.downloading=!1,this.loadingSpinner.getStatus()&&this.loadingSpinner.close()}currentFilter(){const n=this.filterForm.getRawValue();return{title:n.title||void 0,sentDateStart:n.sentDateStart||void 0,sentDateEnd:n.sentDateEnd||void 0}}daysAgo(n){const e=new Date;return e.setDate(e.getDate()-n),e}isoDate(n){return`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`}static{this.\u0275fac=function(e){return new(e||B)(t.rXU(u.F),t.rXU(m.c$),t.rXU(p.kt),t.rXU(y.bg),t.rXU(t.o8S))}}static{this.\u0275cmp=t.VBU({type:B,selectors:[["app-notify-send-history"]],decls:46,vars:34,consts:[["p","paginationApi"],[1,"notify-management-content"],[1,"mm-box-container"],[1,"mm-box-header"],[1,"mm-box-content"],[1,"notify-desc"],[1,"notify-filters",3,"formGroup"],[1,"row"],[1,"col-md-4"],["type","text","formControlName","title",1,"form-control",3,"placeholder"],[1,"col-md-2"],["type","date","formControlName","sentDateStart",1,"form-control"],["type","date","formControlName","sentDateEnd",1,"form-control"],[1,"col-md-2","notify-filters-actions"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-outline-dark",3,"routerLink"],[1,"row","notify-filters-row"],[1,"col-md-3","notify-filters-actions"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"table-notifications"],["class","notify-empty",4,"ngIf"],[3,"values","columnNames","tableSize","thClass","tdClass","track",4,"ngIf"],[1,"mt-1"],["maxSize","10",3,"id","pageChange",4,"ngIf"],[1,"notify-empty"],[3,"values","columnNames","tableSize","thClass","tdClass","track"],["maxSize","10",3,"pageChange","id"],[3,"p","config"]],template:function(e,i){1&e&&(t.j41(0,"div",1)(1,"section",2)(2,"header",3),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"div",4)(6,"div",5)(7,"p"),t.EFF(8),t.nI1(9,"translate"),t.k0s()(),t.j41(10,"form",6)(11,"div",7)(12,"div",8)(13,"label"),t.EFF(14),t.nI1(15,"translate"),t.k0s(),t.nrm(16,"input",9),t.nI1(17,"translate"),t.k0s(),t.j41(18,"div",10)(19,"label"),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.nrm(22,"input",11),t.k0s(),t.j41(23,"div",10)(24,"label"),t.EFF(25),t.nI1(26,"translate"),t.k0s(),t.nrm(27,"input",12),t.k0s(),t.j41(28,"div",13)(29,"button",14),t.bIt("click",function(){return i.lastThirtyDays()}),t.EFF(30),t.nI1(31,"translate"),t.k0s()(),t.j41(32,"div",13)(33,"button",15),t.EFF(34),t.nI1(35,"translate"),t.k0s()()(),t.j41(36,"div",16)(37,"div",17)(38,"button",18),t.bIt("click",function(){return i.downloadExcel
1()}),t.EFF(39),t.nI1(40,"translate"),t.k0s()()()(),t.j41(41,"div",19),t.DNE(42,he,3,3,"p",20)(43,ge,2,11,"mm-table",21),t.j41(44,"div",22),t.DNE(45,ye,3,3,"pagination-template",23),t.k0s()()()()()),2&e&&(t.R7$(3),t.SpI(" ",t.bMT(4,15,"notify.management.sendHistory")," "),t.R7$(5),t.JRh(t.bMT(9,17,"notify.management.sendHistoryDesc")),t.R7$(2),t.Y8G("formGroup",i.filterForm),t.R7$(4),t.JRh(t.bMT(15,19,"notify.management.filterTitle")),t.R7$(2),t.Y8G("placeholder",t.bMT(17,21,"notify.management.search")),t.R7$(4),t.JRh(t.bMT(21,23,"notify.management.filterSentFrom")),t.R7$(5),t.JRh(t.bMT(26,25,"notify.management.filterSentTo")),t.R7$(5),t.SpI(" ",t.bMT(31,27,"notify.management.last30Days")," "),t.R7$(3),t.Y8G("routerLink",t.lJ4(33,fe)),t.R7$(),t.SpI(" ",t.bMT(35,29,"notify.management.backToManagement")," "),t.R7$(4),t.Y8G("disabled",i.downloading),t.R7$(),t.SpI(" ",t.bMT(40,31,"notify.management.downloadExcel")," "),t.R7$(3),t.Y8G("ngIf",i.tableValues&&0===i.tableValues.length),t.R7$(),t.Y8G("ngIf",i.tableValues&&i.tableValues.length>0),t.R7$(2),t.Y8G("ngIf",i.pages>1))},dependencies:[h.bT,s.qT,s.me,s.BC,s.cb,s.j4,s.JD,b.Wk,p.uO,p.Ls,k.Qr,m.D9,k.kf],styles:[".notify-filters[_ngcontent-%COMP%]{margin-bottom:16px}.notify-filters[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:block;font-size:12px;margin-bottom:4px}.notify-filters[_ngcontent-%COMP%] .notify-filters-row[_ngcontent-%COMP%]{margin-top:10px}.notify-filters[_ngcontent-%COMP%] .notify-filters-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-end;padding-bottom:2px}.notify-filters[_ngcontent-%COMP%] .notify-filters-actions[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{width:100%}.notify-empty[_ngcontent-%COMP%]{margin:24px 0}@media screen and (max-width: 450px){.mt-1-r[_ngcontent-%COMP%]{margin-top:10px}}"]})}}var rt=r(81509);const be=[{path:"",component:C,canActivate:[v.v,Z.K,rt.L],data:{breadcrumb:"breadcrumb.notify.notify",role:["CI"],module:"notify"},children:[{path:"",redirectTo:"management",pathMatch:"full"},{path:"management",component:U,data:{breadcrumb:""}},{path:"sends",component:B,data:{breadcrumb:"breadcrumb.notify.sends"}},{path:"create",component:X,data:{breadcrumb:"breadcrumb.notify.create"}},{path:"edit/:id",component:H,data:{breadcrumb:"breadcrumb.notify.edit"}},{path:"dashboard/:pushNotificationId",component:J,data:{breadcrumb:"breadcrumb.notify.dashboard"}}]}];class A{static{this.\u0275fac=function(e){return new(e||A)}}static{this.\u0275mod=t.$C({type:A})}static{this.\u0275inj=t.G2t({providers:[v.v,Z.K,rt.L],imports:[b.iI.forChild(be),_.N,p._S,b.iI]})}}var ve=r(45877),_e=r(63408),Ce=r(67613),ke=r(14167),Se=r(65332);class z{static{this.\u0275fac=function(e){return new(e||z)}}static{this.\u0275mod=t.$C({type:z})}static{this.\u0275inj=t.G2t({providers:[l._],imports:[h.MD,s.X1,p._S,A,m.h,p.Vk,p.tz,p.rB,p.Nw,p.xZ,_e.S,p.Zi,W.u,et.B,p.Yx,k.ed,p.ys,D.MY,Ce.W,ve.Id,p.mn,ke.S,nt.U,Se.n,p.Go,tt.K]})}}},41478:(G,T,r)=>{"use strict";r.d(T,{U:()=>p});var h=r(56610),s=r(44053),b=r(24937),d=r(23279);const t=_=>["btn",_];function C(_,f){if(1&_&&d.nrm(0,"mmp5-fieldset-haruki",7),2&_){const l=f.$implicit;d.Y8G("formControl",l.formControl)("label",l.label)("type",null==l?null:l.type)}}function v(_,f){if(1&_){const l=d.RV6();d.j41(0,"button",8),d.bIt("click",function(){const m=d.eBV(l).$implicit,y=d.XpG();return d.Njj(y.close(null==m?null:m.data))}),d.EFF(1),d.k0s()}if(2&_){const l=f.$implicit;d.Y8G("ngClass",d.eq3(2,t,null==l?null:l.type)),d.R7$(),d.JRh(null==l?null:l.text)}}class p{constructor(f,l){this.dialogRef=f,this.data=l}ngOnInit(){}close(f){this.dialogRef.close(f)}static{this.\u0275fac=function(l){return new(l||p)(d.rXU(s.CP),d.rXU(s.Vh,8))}}static{this.\u0275cmp=d.VBU({type:p,selectors:[["app-simple-alert-dialog"]],standalone:!0,features:[d.aNF],decls:10,vars:4,consts:[[1,"mm-box-container","mb-0"],[1,"mm-box-header"],[1,"mm-box-content"],[1,"inputs"],[3,"formControl","label","type",4,"ngFor","ngForOf"],[1,"mm-box-footer"],[3,"ngClass","click",4,"ngFor","ngForOf"],[3,"formControl","label","type"],[3,"click","ngClass"]],template:function(l,u){1&l&&(d.j41(0,"section",0)(1,"header",1),d.EFF(2),d.k0s(),d.j41(3,"div",2)(4,"p"),d.EFF(5),d.k0s(),d.j41(6,"div",3),d.DNE(7,C,1,3,"mmp5-fieldset-haruki",4),d.k0s()(),d.j41(8,"div",5),d.DNE(9,v,2,4,"button",6),d.k0s()()),2&l&&(d.R7$(2),d.JRh(null==u.data?null:u.data.title),d.R7$(3),d.JRh(null==u.data?null:u.data.message),d.R7$(2),d.Y8G("ngForOf",null==u.data?null:u.data.inputs),d.R7$(2),d.Y8G("ngForOf",null==u.data?null:u.data.buttons))},dependencies:[h.MD,h.YU,h.Sq,s.hM,b.xZ,b.OD],styles:[".mm-box-footer[_ngcontent-%COMP%]{display:flex;justify-content:space-between}@media screen and (max-width: 450px){.btn[_ngcontent-%COMP%]{margin-left:10px}}"]})}}}}]);
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.