PageSourceSearch

https://revixgo.com.br/app/5377.417200ec2b2417ad.js

js revixgo.com.br collected 2026-10-02 01:21:07 UTC 17,009 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5377],{45377(O,C,l){l.d(C,{ComunidadeUsuariosPageModule:()=>B});var p=l(72200),f=l(89417),d=l(57343),g=l(38132),c=l(10467),_=l(21413),y=l(39584),U=l(23294),h=l(56977),e=l(73664),u=l(2615),b=l(49544),k=l(39162),E=l(18700);function j(n,a){1&n&&(e.j41(0,"div",25),e.EFF(1," Nenhum membro encontrado. "),e.k0s())}function F(n,a){1&n&&(e.j41(0,"span",46),e.EFF(1," ADMIN "),e.k0s())}function N(n,a){if(1&n&&(e.j41(0,"span",47),e.EFF(1),e.k0s()),2&n){const r=e.XpG().$implicit;e.R7$(),e.SpI(" Casa ",r.numero," ")}}function I(n,a){1&n&&(e.j41(0,"a",48),e.nrm(1,"ion-icon",49),e.k0s()),2&n&&e.Y8G("href",a.ngIf,e.B4B)}function P(n,a){if(1&n){const r=e.RV6();e.j41(0,"button",50),e.bIt("click",function(){u.eBV(r);const t=e.XpG().$implicit,o=e.XpG();return u.Njj(o.abrirAcoesAdmin(t))}),e.nrm(1,"ion-icon",51),e.k0s()}}function A(n,a){1&n&&e.nrm(0,"ion-icon",52)}function G(n,a){1&n&&(e.j41(0,"a",53),e.nrm(1,"ion-icon",49),e.EFF(2," WhatsApp "),e.k0s()),2&n&&e.Y8G("href",a.ngIf,e.B4B)}function R(n,a){1&n&&(e.j41(0,"span",54),e.EFF(1," WhatsApp indispon\xedvel "),e.k0s())}function $(n,a){if(1&n){const r=e.RV6();e.qex(0),e.j41(1,"button",55),e.bIt("click",function(){u.eBV(r);const t=e.XpG().$implicit,o=e.XpG();return u.Njj(o.aprovar(t))}),e.EFF(2," Aprovar "),e.k0s(),e.j41(3,"button",56),e.bIt("click",function(){u.eBV(r);const t=e.XpG().$implicit,o=e.XpG();return u.Njj(o.negar(t))}),e.EFF(4," Negar "),e.k0s(),e.bVm()}}function w(n,a){if(1&n){const r=e.RV6();e.qex(0),e.j41(1,"button",57),e.bIt("click",function(){u.eBV(r);const t=e.XpG(2);return u.Njj(t.sairDaComunidade())}),e.EFF(2," Sair da comunidade "),e.k0s(),e.bVm()}}function T(n,a){if(1&n){const r=e.RV6();e.j41(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),e.EFF(4),e.k0s(),e.j41(5,"div",30)(6,"div",31),e.EFF(7),e.k0s(),e.j41(8,"div",32)(9,"span",33),e.EFF(10),e.k0s(),e.DNE(11,F,2,0,"span",34)(12,N,2,1,"span",35),e.k0s()()(),e.j41(13,"div",36),e.DNE(14,I,2,1,"a",37)(15,P,2,0,"button",38),e.k0s()(),e.j41(16,"div",39)(17,"button",40),e.bIt("click",function(){const t=u.eBV(r).$implicit,o=e.XpG();return u.Njj(o.abrirModalNumero(t))}),e.EFF(18),e.DNE(19,A,1,0,"ion-icon",41),e.k0s(),e.DNE(20,G,3,1,"a",42)(21,R,2,0,"span",43),e.k0s(),e.j41(22,"div",44),e.DNE(23,$,5,0,"ng-container",45)(24,w,3,0,"ng-container",45),e.k0s()()}if(2&n){const r=a.$implicit,i=e.XpG();e.R7$(4),e.SpI(" ",i.getIniciais(r.nome)," "),e.R7$(3),e.SpI(" ",r.nome," "),e.R7$(2),e.Y8G("ngClass",r.aprovado?"bg-emerald-50 text-emerald-700":"bg-amber-50 text-amber-700"),e.R7$(),e.SpI(" ",r.aprovado?"MEMBRO":"PENDENTE"," "),e.R7$(),e.Y8G("ngIf",r.admComunidade),e.R7$(),e.Y8G("ngIf",r.numero),e.R7$(2),e.Y8G("ngIf",i.whatsappUrl(r.fone)),e.R7$(),e.Y8G("ngIf",i.souAdmin&&r.aprovado&&r.idUsuario!==i.idUsuario),e.R7$(2),e.Y8G("disabled",!i.podeEditarNumero(r)),e.R7$(),e.SpI(" Casa N\xba ",r.numero??"\u2014"," "),e.R7$(),e.Y8G("ngIf",i.podeEditarNumero(r)),e.R7$(),e.Y8G("ngIf",i.whatsappUrl(r.fone)),e.R7$(),e.Y8G("ngIf",!i.whatsappUrl(r.fone)),e.R7$(2),e.Y8G("ngIf",i.souAdmin&&!r.aprovado),e.R7$(),e.Y8G("ngIf",r.idUsuario===i.idUsuario&&r.aprovado)}}function D(n,a){if(1&n){const r=e.RV6();e.j41(0,"ion-header",0)(1,"div",58)(2,"div",59),e.EFF(3,"Editar n\xfamero"),e.k0s(),e.j41(4,"div",8)(5,"ion-button",9),e.bIt("click",function(){u.eBV(r);const t=e.XpG();return u.Njj(t.fecharModalNumero())}),e.EFF(6,"Cancelar"),e.k0s(),e.j41(7,"ion-button",60),e.bIt("click",function(){u.eBV(r);const t=e.XpG();return u.Njj(t.salvarNumero())}),e.EFF(8,"Salvar"),e.k0s()()()(),e.j41(9,"ion-content",18)(10,"div",61)(11,"div",62)(12,"div",63),e.EFF(13,"N\xfamero da casa"),e.k0s(),e.j41(14,"ion-input",64),e.mxI("ngModelChange",function(t){u.eBV(r);const o=e.XpG();return e.DH7(o.numeroEditValor,t)||(o.numeroEditValor=t),u.Njj(t)}),e.k0s(),e.j41(15,"div",65),e.EFF(16," Apenas voc\xea pode alterar seu pr\xf3prio n\xfamero. "),e.k0s()()()()}if(2&n){const r=e.XpG();e.R7$(14),e.R50("ngModel",r.numeroEditValor)}}const S=[{path:"",component:(()=>{var n;class a{constructor(i,t,o,s,m,x,M,X){this.route=i,this.api=t,this.loadingCtrl=o,this.toastCtrl=s,this.alertCtrl=m,this.actionSheetCtrl=x,this.storage=M,this.router=X,this.idComunidade=0,this.nmComunidade="",this.emoji="",this.admComunidade=!1,this.itens=[],this.loading=!1,this.filtroStatus="ALL",this.ordenacao="NOME",this.q="",this.q$=new _.B,this.destroy$=new _.B,this.modalNumeroOpen=!1,this.souAdmin=!1;let v=this.storage.getLocalUser();this.idUsuario=Number(v.idUsuario),this.idGrupo=Number(v.idGrupo)}ngOnInit(){"DEPENDENTE"===this.storage.getLocalUser().perfil&&this.router.navigate(["/home-dependente"])}ionViewWillEnter(){this.route.queryParamMap.subscribe(i=>{const t={idComunidade:Number(i.get("idComunidade")||0),comunidade:i.get("comunidade")||"",emoji:i.get("emoji")||"",admComunidade:"1"===(i.get("admComunidade")||"0")};this.idComunidade=t.idComunidade,this.nmComunidade=t.comunidade,this.emoji=t.emoji,this.admComunidade=t.admComunidade}),this.q$.pipe((0,y.B)(350),(0,U.F)(),(0,h.Q)(this.destroy$)).subscribe(i=>{this.q=i,this.carregar()}),this.carregar()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onSearchChange(i){this.q$.next(i?.detail?.value??"")}carregar(i){var t=this;return(0,c.A)(function*(){t.loading=!0;try{const o=yield t.api.listar(t.idGrupo,t.idUsuario,t.idComunidade,t.filtroStatus,t.q,t.ordenacao).pipe((0,h.Q)(t.destroy$)).toPromise();t.itens=o??[],t.meuRegistro=t.itens.find(s=>s.idUsuario===t.idUsuario),t.souAdmin=!!t.meuRegistro?.admComunidade&&!!t.meuRegistro?.aprovado}catch{yield t.toast("Erro ao carregar membros.")}finally{t.loading=!1,i?.target?.complete?.()}})()}getIniciais(i){if(!i)return"?";const t=i.trim().split(/\s+/);return((t[0]?.[0]??"")+(t.length>1?t[t.length-1]?.[0]:"")).toUpperCase()}formatData(i){try{return new Date(i).toLocaleDateString("pt-BR")}catch{return""}}whatsappUrl(i){if(!i)return null;const t=(i+"").replace(/\D/g,"");if(!t)return null;const o=t.startsWith("55")?t:10===t.length||11===t.length?`55${t}`:t;return o.length<12?null:`https://wa.me/${o}`}podeEditarNumero(i){return i.idUsuario===this.idUsuario}abrirModalNumero(i){this.podeEditarNumero(i)&&(this.numeroEditIdComunidadeUsuario=i.idComunidadeUsuario,this.numeroEditValor=i.numero??null,this.modalNumeroOpen=!0)}fecharModalNumero(){this.modalNumeroOpen=!1,this.numeroEditIdComunidadeUsuario=void 0,this.numeroEditValor=void 0}salvarNumero(){var i=this;return(0,c.A)(function*(){const t=i.numeroEditIdComunidadeUsuario,o=Number(i.numeroEditValor);if(!o||o<=0)return void(yield i.toast("Informe um n\xfamero v\xe1lido."));const s=yield i.loadingCtrl.create({message:"Salvando..."});yield s.present();try{yield i.api.atualizarNumero(i.idGrupo,i.idUsuario,i.idComunidade,t,o).toPromise(),yield i.toast("N\xfamero atualizado."),i.fecharModalNumero(),yield i.carregar()}catch{yield i.toast("Erro ao atualizar n\xfamero.")}
1finally{s.dismiss()}})()}aprovar(i){var t=this;return(0,c.A)(function*(){if(yield t.confirmar(`Aprovar ${i.nome}?`,"O usu\xe1rio ser\xe1 adicionado como membro."))try{yield t.api.aprovar(t.idGrupo,t.idUsuario,t.idComunidade,i.idComunidadeUsuario).toPromise(),yield t.toast("Solicita\xe7\xe3o aprovada."),yield t.carregar()}catch{yield t.toast("Erro ao aprovar.")}})()}negar(i){var t=this;return(0,c.A)(function*(){if(yield t.confirmar(`Negar ${i.nome}?`,"A solicita\xe7\xe3o ser\xe1 exclu\xedda."))try{yield t.api.negar(t.idGrupo,t.idUsuario,t.idComunidade,i.idComunidadeUsuario).toPromise(),yield t.toast("Solicita\xe7\xe3o negada."),yield t.carregar()}catch{yield t.toast("Erro ao negar.")}})()}sairDaComunidade(){var i=this;return(0,c.A)(function*(){if(i.meuRegistro&&(yield i.confirmar("Sair da comunidade?","Voc\xea perder\xe1 acesso ao conte\xfado desta comunidade.")))try{yield i.api.sair(i.idGrupo,i.idUsuario,i.idComunidade,i.meuRegistro.idComunidadeUsuario).toPromise(),yield i.toast("Voc\xea saiu da comunidade."),i.router.navigate(["/home-cliente"])}catch{yield i.toast("Erro ao sair.")}})()}abrirAcoesAdmin(i){var t=this;return(0,c.A)(function*(){if(!t.souAdmin||i.idUsuario===t.idUsuario)return;const o=!!i.admComunidade;yield(yield t.actionSheetCtrl.create({header:i.nome,buttons:[o?{text:"Remover administrador",role:"destructive",handler:()=>t.setAdmin(i,!1)}:{text:"Tornar administrador",handler:()=>t.setAdmin(i,!0)},{text:"Excluir usu\xe1rio",role:"destructive",handler:()=>t.confirmExcluirUsuario(i)},{text:"Cancelar",role:"cancel"}].filter(Boolean)})).present()})()}confirmExcluirUsuario(i){var t=this;return(0,c.A)(function*(){if(yield t.confirmar("Excluir usu\xe1rio?","O usu\xe1rio ser\xe1 removido da comunidade."))try{yield t.api.sair(i.id_grupoPrinc,i.idUsuario,t.idComunidade,i.idComunidadeUsuario).toPromise(),yield(yield t.toastCtrl.create({message:"Usu\xe1rio removido da comunidade.",duration:2e3,position:"top",color:"warning"})).present(),t.ionViewWillEnter()}catch{yield t.toast("Erro ao sair.")}})()}setAdmin(i,t){var o=this;return(0,c.A)(function*(){const s=t?"Este usu\xe1rio poder\xe1 aprovar/recusar membros e gerenciar administradores.":"Este usu\xe1rio deixar\xe1 de ser administrador.";if(yield o.confirmar(t?"Tornar administrador?":"Remover administrador?",s))try{yield o.api.atualizarAdmin(o.idGrupo,o.idUsuario,o.idComunidade,i.idComunidadeUsuario,t).toPromise(),yield o.toast(t?"Administrador definido.":"Administrador removido."),yield o.carregar()}catch{yield o.toast("Erro ao atualizar administrador.")}})()}toast(i){var t=this;return(0,c.A)(function*(){yield(yield t.toastCtrl.create({message:i,duration:1800,position:"top",color:"warning"})).present()})()}confirmar(i,t){var o=this;return(0,c.A)(function*(){return new Promise(function(){var s=(0,c.A)(function*(m){yield(yield o.alertCtrl.create({header:i,message:t,buttons:[{text:"Cancelar",role:"cancel",handler:()=>m(!1)},{text:"Confirmar",handler:()=>m(!0)}]})).present()});return function(m){return s.apply(this,arguments)}}())})()}static#e=n=()=>(this.\u0275fac=function(t){return new(t||a)(e.rXU(b.nX),e.rXU(k.V),e.rXU(d.Xi),e.rXU(d.K_),e.rXU(d.hG),e.rXU(d.GD),e.rXU(E.n),e.rXU(b.Ix))},this.\u0275cmp=e.VBU({type:a,selectors:[["app-comunidade-usuarios"]],standalone:!1,decls:40,vars:10,consts:[[1,"ion-no-border"],[1,"bg-stone-100","px-4","pt-4","pb-3"],[1,"w-full","bg-stone-800","flex","items-center","justify-between","px-4","py-3"],[1,"flex","items-center","gap-3"],["slot","start"],[2,"color","white"],[1,"text-yellow-200","text-sm","font-semibold"],[1,"text-white","text-xs","opacity-80"],[1,"flex","items-center","gap-2"],["size","small","fill","clear",3,"click"],["name","refresh-outline"],[1,"mt-3"],["mode","ios","placeholder","Buscar por nome ou n\xfamero",3,"ionInput"],[1,"mt-2","flex","flex-wrap","items-center","gap-2"],[1,"px-3","py-1","rounded-full","text-sm","border",3,"click","ngClass"],[1,"mt-2","flex","items-center","justify-between","text-xs","text-stone-600"],[1,"flex","gap-2"],[1,"px-2","py-1","rounded-lg","border",3,"click","ngClass"],[1,"bg-stone-50"],[1,"pb-24"],["slot","fixed",3,"ionRefresh"],[1,"p-4","space-y-3"],["class","text-center text-stone-500 py-10",4,"ngIf"],["class","bg-white rounded-2xl border border-stone-200 px-3 py-3 shadow-sm",4,"ngFor","ngForOf"],[3,"didDismiss","isOpen"],[1,"text-center","text-stone-500","py-10"],[1,"bg-white","rounded-2xl","border","border-stone-200","px-3","py-3","shadow-sm"],[1,"flex","items-center","justify-between"],[1,"flex","items-center","gap-3","min-w-0"],[1,"h-9","w-9","rounded-full","bg-yellow-400","flex","items-center","justify-center","font-semibold","text-stone-800","text-[11px]","shrink-0"],[1,"min-w-0"],[1,"font-semibold","text-stone-900","text-sm","truncate"],[1,"flex","items-center","gap-2","mt-1","flex-wrap"],[1,"text-[10px]","px-2","py-0.5","rounded-full",3,"ngClass"],["class","text-[10px] px-2 py-0.5 rounded-full bg-stone-100 text-stone-700",4,"ngIf"],["class","text-[10px] text-stone-500",4,"ngIf"],[1,"flex","items-center","gap-1","
1shrink-0"],["target","_blank","class","h-9 w-9 rounded-xl bg-green-50 border border-green-100 flex items-center justify-center text-green-600",3,"href",4,"ngIf"],["class","h-9 w-9 rounded-xl border border-stone-200 flex items-center justify-center",3,"click",4,"ngIf"],[1,"mt-3","flex","flex-wrap","items-center","gap-2"],[1,"text-xs","px-3","py-1","rounded-full","border","border-stone-200","bg-stone-50","text-stone-700",3,"click","disabled"],["class","ml-1","name","create-outline",4,"ngIf"],["class","text-xs px-3 py-1 rounded-full border border-stone-200 bg-green-300 text-stone-700 flex items-center gap-1","target","_blank","rel","noopener",3,"href",4,"ngIf"],["class","text-xs text-stone-400",4,"ngIf"],[1,"mt-4","flex","items-center","justify-end","gap-2"],[4,"ngIf"],[1,"text-[10px]","px-2","py-0.5","rounded-full","bg-stone-100","text-stone-700"],[1,"text-[10px]","text-stone-500"],["target","_blank",1,"h-9","w-9","rounded-xl","bg-green-50","border","border-green-100","flex","items-center","justify-center","text-green-600",3,"href"],["name","logo-whatsapp"],[1,"h-9","w-9","rounded-xl","border","border-stone-200","flex","items-center","justify-center",3,"click"],["name","ellipsis-vertical-outline"],["name","create-outline",1,"ml-1"],["target","_blank","rel","noopener",1,"text-xs","px-3","py-1","rounded-full","border","border-stone-200","bg-green-300","text-stone-700","flex","items-center","gap-1",3,"href"],[1,"text-xs","text-stone-400"],[1,"px-3","py-2","rounded-xl","bg-yellow-400","text-stone-900","font-semibold",3,"click"],[1,"px-3","py-2","rounded-xl","border","border-red-300","text-red-600","font-semibold",3,"click"],[1,"px-3","py-2","rounded-xl","border","border-red-300","text-red-600","font-semibold","text-[10px]",3,"click"],[1,"bg-stone-900","text-white","px-4","pt-4","pb-3","flex","items-center","justify-between"],[1,"font-semibold"],["size","small","fill","solid",3,"click"],[1,"p-4"],[1,"bg-white","rounded-2xl","border","border-stone-200","p-4"],[1,"text-sm","text-stone-600","mb-2"],["type","number","inputmode","numeric","placeholder","Ex: 12",3,"ngModelChange","ngModel"],[1,"text-xs","text-stone-400","mt-2"]],template:function(t,o){1&t&&(e.j41(0,"ion-header",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"ion-buttons",4),e.nrm(5,"ion-back-button",5),e.k0s(),e.j41(6,"div")(7,"div",6),e.EFF(8," Membros da comunidade "),e.k0s(),e.j41(9,"div",7),e.EFF(10),e.k0s()()(),e.j41(11,"div",8)(12,"ion-button",9),e.bIt("click",function(){return o.carregar()}),e.nrm(13,"ion-icon",10),e.k0s()()(),e.j41(14,"div",11)(15,"ion-searchbar",12),e.bIt("ionInput",function(m){return o.onSearchChange(m)}),e.k0s()(),e.j41(16,"div",13)(17,"button",14),e.bIt("click",function(){return o.filtroStatus="ALL",o.carregar()}),e.EFF(18," Todos "),e.k0s(),e.j41(19,"button",14),e.bIt("click",function(){return o.filtroStatus="APROVADO",o.carregar()}),e.EFF(20," Aprovados "),e.k0s(),e.j41(21,"button",14),e.bIt("click",function(){return o.filtroStatus="PENDENTE",o.carregar()}),e.EFF(22," Pendentes "),e.k0s()(),e.j41(23,"div",15)(24,"span"),e.EFF(25,"Ordenar por"),e.k0s(),e.j41(26,"div",16)(27,"button",17),e.bIt("click",function(){return o.ordenacao="NOME",o.carregar()}),e.EFF(28," Nome "),e.k0s(),e.j41(29,"button",17),e.bIt("click",function(){return o.ordenacao="NUMERO",o.carregar()}),e.EFF(30," N\xfamero "),e.k0s()()()()(),e.j41(31,"ion-content",18)(32,"div",19)(33,"ion-refresher",20),e.bIt("ionRefresh",function(m){return o.carregar(m)}),e.nrm(34,"ion-refresher-content"),e.k0s(),e.j41(35,"div",21),e.DNE(36,j,2,0,"div",22)(37,T,25,15,"div",23),e.k0s(),e.j41(38,"ion-modal",24),e.bIt("didDismiss",function(){return o.fecharModalNumero()}),e.DNE(39,D,17,1,"ng-template"),e.k0s()()()),2&t&&(e.R7$(10),e.Lme(" ",o.emoji," - ",o.nmComunidade," "),e.R7$(7),e.Y8G("ngClass","ALL"===o.filtroStatus?"bg-yellow-400 text-stone-900 border-yellow-400":"bg-transparent border-stone-700"),e.R7$(2),e.Y8G("ngClass","APROVADO"===o.filtroStatus?"bg-yellow-400 text-stone-900 border-yellow-400":"bg-transparent border-stone-700"),e.R7$(2),e.Y8G("ngClass","PENDENTE"===o.filtroStatus?"bg-yellow-400 text-stone-900 border-yellow-400":"bg-transparent border-stone-700"),e.R7$(6),e.Y8G("ngClass","NOME"===o.ordenacao?"bg-amber-500 text-stone-900 border-white":"border-stone-700"),e.R7$(2),e.Y8G("ngClass","NUMERO"===o.ordenacao?"bg-amber-500 text-stone-900 border-white":"border-stone-700"),e.R7$(7),e.Y8G("ngIf",!(null!=o.itens&&o.itens.length||o.loading)),e.R7$(),e.Y8G("ngForOf",o.itens),e.R7$(),e.Y8G("isOpen",o.modalNumeroOpen))},dependencies:[p.YU,p.Sq,p.bT,f.BC,f.vS,d.Jm,d.QW,d.W9,d.eU,d.iq,d.$w,d.To,d.Ki,d.S1,d.Sb,d.su,d.Gw,d.el],encapsulation:2}))}return n(),a})()}];let V=(()=>{var n;class a{static#e=n=()=>(this.\u0275fac=function(t){return new(t||a)},this.\u0275mod=e.$C({type:a}),this.\u0275inj=u.G2t({imports:[g.iI.forChild(S),g.iI]}))}return n(),a})(),B=(()=>{var n;class a{static#e=n=()=>(this.\u0275fac=function(t){return new(t||a)},this.\u0275mod=e.$C({type:a}),this.\u0275inj=u.G2t({imports:[p.MD,f.YN,d.bv,V]}))}return n(),a})()}}]);

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.