1"use strict";(self.webpackChunkpleres_portal_agendamento_web_app=self.webpackChunkpleres_portal_agendamento_web_app||[]).push([[134],{2134:(Mm,Ze,g)=>{g.r(Ze),g.d(Ze,{MarcacaoModule:()=>Pm});var e=g(5062),h=g(6895),Ke=g(607),v=g(4006),b=g(3994),w=g(7152),Z=g(805),l=g(7857),J=g(567),$e=g(3679);let Ee=(()=>{class t{constructor(o){this.autorizadorServiceProxy=o,this.ElegibilidadeResult=new e.vpe,this.TimerExpired=new e.vpe,this.verificandoEligibilidade=!1}config(o,i,n){this.ElegibilidadeResult=new e.vpe,this.TimerExpired=new e.vpe,this.hubSignalRService=o,this.hubSignalRService.addConsultaElegibilidadeResponseListener(),this.domain=i,this.timeoutElegibilidadeSeconds=n,this.subscriptionElegibilidade=this.hubSignalRService.Eligibilidade.subscribe(a=>{this.verificandoEligibilidade=!1,this.stopTimer();const d=JSON.parse(a),r=new l.iCl({status:d.Status,mensagemErro:d.MensagemErro});this.ElegibilidadeResult.emit(r)})}get(o){o.requestId=this.hubSignalRService.RequestId,this.autorizadorServiceProxy.getElegibilidadeOperadora(this.domain,o).subscribe(i=>{"A"===i.status?(this.verificandoEligibilidade=!0,this.startTimer(this.timeoutElegibilidadeSeconds)):(this.ElegibilidadeResult.emit(i),this.stopTimer())},i=>{const n=new l.iCl({status:"E",mensagemErro:i});this.ElegibilidadeResult.emit(n),this.stopTimer()})}startTimer(o){this.timeout=o,this.timerValue=0,this.interval=setInterval(()=>{this.timerValue<this.timeout?(this.percentStatus=Math.floor(this.timerValue/this.timeout*100),this.timerValue++):(this.verificandoEligibilidade=!1,this.TimerExpired.emit(),this.stopTimer())},1e3)}stopTimer(){this.subscriptionElegibilidade.unsubscribe(),clearInterval(this.interval),this.timerValue=0}}return t.\u0275fac=function(o){return new(o||t)(e.LFG(l.Rdc))},t.\u0275prov=e.Yz7({token:t,factory:t.\u0275fac}),t})();var T=g(3168),$=g(7500),L=g(3631),oe=g(613),F=g(2137),Ie=g(8235);function Ve(t,s){1&t&&(e.TgZ(0,"div",3),e._uU(1,"Carregando..."),e.qZA())}function Be(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"fieldset",21)(1,"legend"),e._uU(2,"Qual?"),e.qZA(),e.TgZ(3,"div",15)(4,"div",26)(5,"div",27),e.NdJ("onClear",function(){e.CHM(o);const n=e.oxw(2);return n.model.convenio=null,n.model.plano=null,e.KtG(n.planos=[])}),e.TgZ(6,"p-autoComplete",28),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.model.convenio=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.getSuggestions(n,"fConvenios","convenios","nome","sinonimias"))})("onSelect",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.onSelectConvenio(n))})("onUnselect",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.planos=[])}),e.qZA()()(),e.TgZ(7,"div",26)(8,"div",29),e.NdJ("onClear",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.model.plano=null)}),e.TgZ(9,"p-autoComplete",30),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.model.plano=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.getSuggestions(n,"fPlanos","planos","nome","sinonimias"))})("onSelect",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.setSubmitButtonFocus())}),e.qZA()()()()()}if(2&t){const o=e.oxw(2);e.xp6(6),e.Q6J("ngModel",o.model.convenio)("suggestions",o.fConvenios),e.xp6(3),e.Q6J("ngModel",o.model.plano)("suggestions",o.fPlanos)("disabled",!o.model.convenio||!o.planos||!o.planos.length)("dropdown",!0)}}function ze(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",20)(1,"fieldset",21)(2,"legend"),e._uU(3,"Possui conv\xeanio?"),e.qZA(),e.TgZ(4,"div",15)(5,"div",22)(6,"p-radioButton",23),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.model.particular=n)}),e.qZA(),e._uU(7," \xa0 "),e.TgZ(8,"p-radioButton",24),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.model.particular=n)}),e.qZA()()()(),e.YNc(9,Be,10,6,"fieldset",25),e.qZA()}if(2&t){const o=e.oxw();e.xp6(6),e.Q6J("value",!1)("ngModel",o.model.particular),e.xp6(2),e.Q6J("value",!0)("ngModel",o.model.particular),e.xp6(1),e.Q6J("ngIf",0==o.model.particular)}}function je(t,s){if(1&t&&(e.TgZ(0,"fieldset")(1,"div",26)(2,"span",31)(3,"span"),e._uU(4,"Verificando elegibilidade junto a operadora..."),e.qZA(),e._UZ(5,"p-progressBar",32),e.qZA()()()),2&t){const o=e.oxw();e.xp6(5),e.Q6J("value",null==o.elegibilidadeService?null:o.elegibilidadeService.percentStatus)}}let We=(()=>{class t extends w.a{constructor(o){super(o),this.alertaElegibilidade=!1,this.nomeConvenio="",this.router=o.get(b.F0),this.confirmationService=o.get(Z.YP),this.registroService=o.get(l.s5D),this.hubSignalRService=o.get($e.P),this.elegibilidadeService=o.get(Ee),this.homeService=o.get(l.igG),this.convenios=[],this.planos=[],this.homeService=o.get(l.igG)}ngOnInit(){this.router.navigate(["/marcacao/exame"])}clear(){this.convenios=[],this.planos=[]}load(){this.verificaPermissaoTela(),this.get()}get(){this.startLoading(!0),(0,J.D)(this.convenioPlanoService.getConvenios(this.domain),this.convenioPlanoService.getPlanoParticular(this.domain),this.convenioPlanoService.getConvenioParticular(this.domain),this.convenioPlanoService.getPrefererPlano(this.domain)).subscribe(o=>{this.stopLoading(),this.getRegistro(),this.convenios=o[0],this.planoParticular=o[1],this.convenioParticular=o[2],this.preferencePlano=o[3],this.planos=[],this.loadModel(),this.model.reagendamento=!1,this.model.agendamento=void 0},o=>{this.verifyError(o)})}loadModel(){const o=this.isLoggedIn(),i=this.modelFinished.examesAgend
1ados&&this.modelFinished.examesAgendados.length>0,n=o&&this.model.username!==this.user.username,a=this.modelFinished.protocoloIdSelected;if(o&&(this.cleanModelFinished(),this.cleanModel()),(i||!o||n||a)&&(this.cleanModelFinished(),this.cleanModel()),(this.model.examesAgendados&&this.model.examesAgendados.length>0||this.model.examesNaoAgendaveis&&this.model.examesNaoAgendaveis.length>0)&&this.confirm(),this.model.particular)this.model.convenio=void 0,this.model.plano=void 0;else{!this.model.convenio&&this.preferencePlano&&this.preferencePlano.id!==this.planoParticular.id&&(this.model.convenio=this.convenios.filter(r=>r.id===this.preferencePlano.convenioId)[0],this.model.plano=this.preferencePlano);const d=this.model.plano;d&&(d.id===this.planoParticular.id?(this.model.plano=void 0,this.model.convenio=void 0,this.model.particular=!0):this.model.convenio?(this.onSelectConvenio(this.model.convenio),this.model.plano=d):this.model.convenio||(this.model.plano=void 0))}this.homeService.getDataLayer(this.domain).subscribe(d=>{this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:d})}getRegistro(){this.startLoading(!0),T.G.getItem("prontuario"),this.registroService.getRegistroProntuario(this.domain).subscribe(n=>{if(this.stopLoading(),n){if(!n.nomeCompleto)return this.router.navigate(["/backoffice/register"]),!1;if(!n.dataNascimento)return this.router.navigate(["/backoffice/register"]),!1;if(!n.celular)return this.router.navigate(["/backoffice/register"]),!1;if(1!==n.genero&&2!==n.genero)return this.router.navigate(["/backoffice/register"]),!1;if(!n.peso)return this.router.navigate(["/backoffice/register"]),!1;if(!n.altura)return this.router.navigate(["/backoffice/register"]),!1;if(!n.email)return this.router.navigate(["/backoffice/register"]),!1}},n=>{this.verifyError(n)})}goToPreviousStep(){this.router.navigate(["/"],{queryParamsHandling:"merge"})}goToNextStep(){if(void 0===this.model.particular)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe se voc\xea possui Conv\xeanio (Sim ou N\xe3o) para continuar","button"),!1;if(this.model.particular)this.model.convenio=this.convenioParticular,this.model.plano=this.planoParticular;else{if(!this.model.convenio)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Conv\xeanio para continuar","button"),!1;if(!this.model.plano)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Plano para continuar","button"),!1}this.model.convenioParticular=this.convenioParticular,this.model.planoParticular=this.planoParticular,this.syncModel(),this.next()}verificarElegibilidade(){const o=new l.sCj({convenioId:this.convenioModel.id,matricula:this.model.numeroCarteirinha,nomeBeneficiario:this.user.name,nomeOperadora:this.convenioModel.nomeOperadora});this.elegibilidadeService.get(o)}next(){const o=this.isLoggedIn();this.homeService.getDataLayer(this.domain).subscribe(i=>{this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:i}),this.getDataLayer("convenio-plano","Convenio-Plano | Exame"),o?this.convenioPlanoService.setProntuarioAreaMedica(this.model.profissionalSaude,this.domain).subscribe(()=>{this.model.username=this.user.username,this.goToExames()},i=>{this.verifyError(i)}):this.goToExames()}goToExames(){this.syncModel(),this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}confirm(){this.confirmationService.confirm({message:"J\xe1 existe um agendamento em andamento, deseja continuar?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",reject:()=>{this.cleanModelFinished(),this.cleanModel()}})}abrirPopupLogin(){this.eventCloseLogin=this.loginService.onClose.subscribe(o=>{this.onCloseLogin()}),this.ocultarAlertaElegibilidade(),this.exibirPopupLogin()}onCloseLogin(){this.eventCloseLogin.unsubscribe()}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-convenio-plano"]],features:[e._Bn([Z.YP,Ee]),e.qOj],decls:33,vars:9,consts:[[1,"row","mt-0","pt-0"],["class","col-12",4,"ngIf"],["class","col-12 mt-0",4,"ngIf"],[1,"col-12"],[4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[1,"popup"],[1,"background"],[1,"body"],[1,"spacing"],[1,"section"],[1,"row"],[1,"col-12","text-center"],["type","button",1,"btn","btn-info","text-uppercase","col-10","offset-1",3,"click"],["type","button",1,"btn","btn-secondary","text-uppercase","col-10","offset-1",3,"click"],["header","Confirmation","icon","pi pi-exclamation-triangle","acceptLabel","Sim","rejectLabel","N\xe3o"],[1,"col-12","mt-0"],[1,"p-3"],[1,"col-xl-2","col-lg-3","col-md-4","col-sm-6","col-12"],["name","modelParticular","label","Sim",3,"value","ngModel","ngModelChange"],["name","modelParticular","label","N\xe3o",3,"value","ngModel","ngModelChange"],["class","p-3",4,"ngIf"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-6","col-12","p-fluid"],["autocompleteSearchIcon","Conv\xeanio",3,"onClear"],["id","modelConvenio","name","modelConvenio","field","nome","placeholder","Digite o nome do conv\xeanio","emptyMessage","Nenhum registro encontrado",3,"ngModel","suggestions","ngModelChange","completeMethod","onSelect","onUnselect"],["autocompleteSearchIcon","Plano",3,"onClear"],["id","modelPlano","name","modelPlano","field","nome","placeholder","Digite o nome do plano","emptyMessage","Nenhum registro encontrado",3,"ngModel","suggestions","disabled","dropdown","ngModelChange","completeMethod","onSelect"],[1,"p-float-label","p-fluid"],[3,"value"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Ve,2,0,"div",1),e.YNc(2,ze,10,5,"div",2),e.TgZ(3,"div",3),e.YNc(4,je,6,1,"fieldset",4),e.qZA()(),e.TgZ(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8)(9,"button",9),e.NdJ("click",function(){return i.goToNextStep()}),e._uU(10,"Continuar"),e.qZA()()()()(),e.TgZ(11,"div",10),e._UZ(12,"div",11),e.TgZ(13,"div",12),e._UZ(14,"div",13),e.TgZ(15,"div",14)(16,"div",15)(17,"div",3)(18,"div",15)(19,"h4",16),e._uU(20),e.qZA()(),e._UZ(21,"div",15),e.TgZ(22,"div",15)(23,"p",16),e._uU(24,"Caso seu m\xe9dico tenha informado os exames na plataforma, eles aparecer\xe3o automaticamente como sugest\xe3o aqui no nosso portal"),e.qZA()(),e._UZ(25,"div",15),e.TgZ(26,"div",15)(27,"button",17),e.NdJ("click",function(){return i.abrirPopupLogin()}),e._uU(28,"Fazer o login"),e.qZA()(),e.TgZ(29,"div",15)(30,"button",18),e.NdJ("click",function(){return i.ocultarAlertaElegibilidade()}),e._uU(31,"Continuar sem login"),e.qZA()()()()()()(),e._UZ(32,"p-confirmDialog",19)),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded&&!(null!=i.elegibilidadeService&&i.elegibilidadeService.verificandoEligibilidade)),e.xp6(2),e.Q6J("ngIf",null==i.elegibilidadeService?null:i.elegibilidadeService.verificandoEligibilidade),e.xp6(5),e.Q6J("disabled",i.isLoading||(null==i.elegibilidadeService?null:i.elegibilidadeService.verificandoEligibilidade)),e.xp6(2),e.ekj("hidden",!i.alertaElegibilidade)("visible",i.alertaElegibilidade),e.xp6(9),e.hij("Cliente ",i.nomeConvenio," voc\xea pode agendar seus exames com mais facilidade se fizer o login"))},dependencies:[h.O5,$.j,v.JJ,v.On,L.Qc,oe.EU,F.Q,Ie.k],encapsulation:2}),t})();var U=g(5861),R=g(5055),E=g(254),I=g(8259),Xe=g(537),eo=g(7221),oo=g(7545),Pe=g(4850),io=g(1086),we=g(8896),ie=g(4455),te=g(1102),ne=g(4770),H=g(1740),V=g(5908),Me=g(769);const to=["ocrContainer"],no=["filePedidoMedico"],ao=function(t,s,o){return{"p-steps-incomplete":t,"p-steps-complete":s,"p-state-highlight p-steps-current":o}};function so(t,s){if(1&t&&(e.TgZ(0,"li",21)(1,"a",22)(2,"span",23),e._uU(3),e.qZA(),e.TgZ(4,"span",24),e._uU(5),e.qZA()()()),2&t){const o=s.$implicit,i=e.oxw(2);e.Q6J("ngClass",e.kEZ(3,ao,i.activeStep<+o.id,i.activeStep>+o.id,i.activeStep>=+o.id)),e.xp6(3),e.Oqu(o.id),e.xp6(2),e.Oqu(o.label)}}function ro(t,s){if(1&t&&(e.TgZ(0,"div",16)(1,"div",17)(2,"div",18)(3,"ul",19),e.YNc(4,so,6,7,"li",20),e.qZA()()()()),2&t){const o=e.oxw();e.xp6(4),e.Q6J("ngForOf",o.items)}}function co(t,s){1&t&&e._UZ(0,"div",25)}function lo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",40),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToPreviousStep())}),e._UZ(1,"i",41),e._uU(2," Trocar paciente "),e.qZA()}}function mo(t,s){if(1&t&&(e.TgZ(0,"option",42),e._uU(1),e.qZA()),2&t){const o=s.$implicit;e.Q6J("value",o.value),e.xp6(1),e.hij(" ",o.label," ")}}function _o(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"fieldset",26)(1,"legend"),e._uU(2,"Dados do paciente"),e.qZA(),e.TgZ(3,"div",27)(4,"div",28)(5,"button",29),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToRegister())}),e._UZ(6,"i",30),e._uU(7),e.qZA(),e.YNc(8,lo,3,0,"button",31),e.qZA(),e.TgZ(9,"div",32)(10,"small"),e._uU(11,"Paciente"),e.qZA(),e._UZ(12,"br"),e.TgZ(13,"input",33),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.prontuario.name=n)}),e.qZA()(),e.TgZ(14,"div",34)(15,"small"),e._uU(16,"Nascimento"),e.qZA(),e._UZ(17,"br"),e.TgZ(18,"p-calendar",35),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.prontuario.dataNascimento=n)})("onInput",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.onInputDate(n))}),e.qZA()(),e.TgZ(19,"div",34)(20,"small"),e._uU(21,"Sexo"),e.qZA(),e._UZ(22,"br"),e.TgZ(23,"select",36),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.prontuario.genero=n)}),e.YNc(24,mo,2,2,"option",37),e.qZA()(),e.TgZ(25,"div",34)(26,"small"),e._uU(27,"Peso"),e.qZA(),e._UZ(28,"br"),e.TgZ(29,"input",38),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.prontuario.peso=n)}),e.qZA()(),e.TgZ(30,"div",34)(31,"small"),e._uU(32,"Altura"),e.qZA(),e._UZ(33,"br"),e.TgZ(34,"input",39),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.prontuario.altura=n)}),e.qZA()()()()}if(2&t){const o=e.oxw();e.xp6(6),e.Q6J("ngClass",o.editar?"fa-check":"fa-edit"),e.xp6(1),e.hij(" ",o.textoBotaoEditar," "),e.xp6(1),e.Q6J("ngIf",o.showChangePatientButton),e.xp6(
15),e.Q6J("ngModel",o.prontuario.name)("disabled",!o.editar),e.xp6(5),e.Q6J("ngModel",o.prontuario.dataNascimento)("locale",o.locale)("dateFormat",o.locale.dateFormat)("showOnFocus",!1)("disabled",!o.editar),e.xp6(5),e.Q6J("ngModel",o.prontuario.genero)("disabled",!o.editar),e.xp6(1),e.Q6J("ngForOf",o.generos),e.xp6(5),e.Q6J("ngModel",o.prontuario.peso)("disabled",!o.editar),e.xp6(5),e.Q6J("ngModel",o.prontuario.altura)("disabled",!o.editar)}}const ue=function(t){return{"btn-primary text-white":t}};function po(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",45),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onChangeTipoPlano(2))}),e._uU(1),e.qZA()}if(2&t){const o=e.oxw(2);e.Q6J("ngClass",e.VKq(3,ue,2==o.marcacaoService.tipoConvenio&&!o.isDisabled()))("disabled",o.isDisabled()),e.xp6(1),e.Oqu(o.marcacaoService.nomeFidelidade)}}function uo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",58),e.NdJ("click",function(n){return n.stopPropagation()}),e.TgZ(1,"div",59)(2,"div",60)(3,"span",61),e.NdJ("click",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.abrirFilePicker(n))}),e._UZ(4,"i",62),e.TgZ(5,"span")(6,"b"),e._uU(7,"Novidade!!"),e.qZA(),e._uU(8," Fa\xe7a upload da sua carteirinha para leitura autom\xe1tica do conv\xeanio, plano, matr\xedcula e validade."),e.qZA(),e.TgZ(9,"em",63),e._uU(10,"Formatos aceitos: JPG, JPEG, PNG, PDF"),e.qZA()()()()()}}function go(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",9)(1,"div",52)(2,"div",53),e.NdJ("onClear",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onClearConvenio())})("onCameraClick",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.abrirFilePicker(n))}),e.TgZ(3,"p-autoComplete",54),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.marcacaoService.convenio=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.getSuggestions(n,"fConvenios","convenios","nome","sinonimias"))})("onFocus",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.abrirOcr(n))})("onSelect",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.onSelectConvenio(n))})("onUnselect",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onUnselectConvenio())}),e.qZA()(),e.YNc(4,uo,11,0,"div",55),e.qZA(),e.TgZ(5,"div",52)(6,"div",56),e.NdJ("onClear",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onClearPlano())}),e.TgZ(7,"p-autoComplete",57),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.marcacaoService.plano=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.getSuggestions(n,"fPlanos","planos","nome","sinonimias"))})("onSelect",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onSelectPlano())})("onUnselect",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onUnselectConvenio())}),e.qZA()()()()}if(2&t){const o=e.oxw(2);e.xp6(3),e.Q6J("ngModel",o.marcacaoService.convenio)("suggestions",o.fConvenios),e.xp6(1),e.Q6J("ngIf",o.marcacaoService.ocr),e.xp6(3),e.Q6J("ngModel",o.marcacaoService.plano)("suggestions",o.fPlanos)("disabled",!o.marcacaoService.convenio||!o.marcacaoService.planos||!o.marcacaoService.planos.length||o.isDisabled())("dropdown",!0)}}function ho(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",52)(1,"span",64)(2,"input",65),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.marcacaoService.matriculaConvenio=n)})("blur",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.salvarStorage("matricula",n.target.value))}),e.qZA(),e.TgZ(3,"label",66),e._uU(4,"Matr\xedcula"),e.qZA()()()}if(2&t){const o=e.oxw(2);e.xp6(2),e.Q6J("ngModel",o.marcacaoService.matriculaConvenio)("maxlength",o.qtdcaracteres)}}function fo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",67)(1,"span",64)(2,"p-calendar",68),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.marcacaoService.dataValidade=n)})("onSelect",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.salvarStorage("dataValidade",n))}),e.qZA(),e.TgZ(3,"label",66),e._uU(4,"Validade"),e.qZA()()()}if(2&t){const o=e.oxw(2);e.xp6(2),e.Q6J("ngModel",o.marcacaoService.dataValidade)("readonlyInput",!0)("showIcon",!0)("showButtonBar",!0)}}function vo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"fieldset",43)(1,"legend"),e._uU(2),e.qZA(),e.TgZ(3,"div",9)(4,"div",44)(5,"button",45),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.onChangeTipoPlano(0))}),e._uU(6,"Conv\xeanio"),e.qZA(),e.TgZ(7,"button",45),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.onChangeTipoPlano(1))}),e._uU(8,"Particular"),e.qZA(),e.YNc(9,po,2,5,"button",46),e.qZA()(),e.TgZ(10,"div",9),e._uU(11,"\xa0"),e.qZA(),e.TgZ(12,"div",47,48),e.YNc(14,go,8,7,"div",49),e.qZA(),e.TgZ(15,"div",9),e.YNc(16,ho,5,2,"div",50),e.YNc(17,fo,5,4,"div",51),e.qZA()()}if(2&t){const o=e.oxw();e.xp6(2),e.hij("Como deseja ",o.marcacaoService.tipoTextoConvenioPlano," seu exame?"),e.xp6(3),e.Q6J("ngClass",e.VKq(9,ue,0==o.marcacaoService.tipoConvenio&&!o.isDisabled()))("disabled",o.isDisabled()),e.xp6(2),e.Q6J("ngClass",e.VKq(11,ue,1==o.marcacaoService.tipoConvenio&&!o.isDisabled()))("disabled",o.isDisabled()),e.xp6(2),e.Q6J("ngIf",o.verificaPermissao("FUNC_MARCACAO_PLANOFIDELIDADE")&&""!==o.marcacaoService.n
1omeFidelidade&&void 0!==o.marcacaoService.nomeFidelidade&&o.isLoaded),e.xp6(5),e.Q6J("ngIf",0===o.marcacaoService.tipoConvenio),e.xp6(2),e.Q6J("ngIf",0===o.marcacaoService.tipoConvenio),e.xp6(1),e.Q6J("ngIf",0===o.marcacaoService.tipoConvenio)}}let xo=(()=>{class t extends w.a{get convenios(){return this.marcacaoService.convenios}get planos(){return this.marcacaoService.planos}get examesCount(){return this.marcacaoService.examesCount}get activeStep(){return this.marcacaoService.activeStep}set activeStep(o){this.marcacaoService.activeStep=o}ngAfterContentChecked(){this.cdr.detectChanges()}constructor(o,i,n){super(o),this.cdr=i,this.configPrimeNg=n,this.editar=!1,this.textoBotaoEditar="Editar",this.showChangePatientButton=!0,n.setTranslation(this.locale),this.router=o.get(b.F0),this.marcacaoService=o.get(R.B),this.marcacaoService.tipoConvenio=0,this.mobile=this.marcacaoService.isMobile(),this.prontuario=new l.gjG,this.documentoSevice=o.get(l.Bi_),this.documentosService=o.get(ie.c),this.imageCompress=o.get(ne.r2)}get usuarioLogado(){if(this.user)return this.user}get usuarioSelecionado(){if(this.user&&this.user.usuarioSelecionado)return this.prontuario.prontuarioId!==this.user.usuarioSelecionado.prontuarioId&&(this.prontuario=Object.assign(this.user.usuarioSelecionado),this.prontuario.dataNascimento=new Date(this.prontuario.dataNascimento),this.prontuario.genero=+this.prontuario.genero),this.user.usuarioSelecionado}goToPreviousStep(){E.$.unselectUser(),this.router.navigate(["/marcacao/prontuario"])}ngOnInit(){this.verifyNewRegister(),I("header").show(),I("footer").show(),this.iniciarCarregamentoGlobal(),this.marcacaoService.documentoService.exibeEtapaDocumento(this.domain).pipe((0,Xe.x)(()=>this.finalizarCarregamentoGlobal()),(0,eo.K)(()=>(0,io.of)([]))).subscribe(o=>{const i=o.find(n=>"ExibeEtapaDocumentoNoAgendamento"===n.nome);this.marcacaoService.exibirEtapaDocumentosNoAgendamento=!!i&&"true"===i.valor.toLowerCase(),this.items=[{label:"Exame",command:()=>{this.activeStep=1}},{label:"Unidade",command:()=>{this.activeStep=2}},...this.marcacaoService.exibirEtapaDocumentosNoAgendamento?[{label:"Documentos",command:()=>this.activeStep=3}]:[],{label:"Confirmar",command:()=>{this.activeStep=4}},{label:"Concluir",command:()=>{this.activeStep=5}}],this.items=this.items.map((n,a)=>({...n,id:(a+1).toString()}))}),this.marcacaoService.convenioPlanoService.getNomeFidelidade(this.domain).subscribe(o=>{o&&(this.marcacaoService.nomeFidelidade=o)}),this.isLoggedIn()&&"EnvioDocumento"!==this.user.role&&this.carregarConvenioPlanoProntuario(),this.showChangePatientButton=!E.$.getUsuarioFromOperadora()}verifyNewRegister(){this.cpfNewRegister=E.$.getCpfNewRegister(),this.cpfNewRegisterType=E.$.getCpfNewRegisterType(),this.getMedicoUnsubscribe=E.$.getMedicoUnsubscribe(),this.cpfNewRegister&&this.router.navigate("usuario"===this.cpfNewRegisterType?["/cadastro/registro"]:["/medico/registro"]),this.getMedicoUnsubscribe&&this.router.navigate(["/medico/unsubscribe"])}exibeOcultaPacienteLabApoiado(){return-1===window.location.href.indexOf("agendamento-concluido")&&-1===window.location.href.indexOf("home")&&-1===window.location.href.indexOf("historico")&&-1===window.location.href.indexOf("prontuario")}abrirPopupLogin(){this.eventCloseLogin=this.loginService.onClose.subscribe(o=>{this.onCloseLogin()}),this.ocultarAlertaElegibilidade(),this.exibirPopupLogin()}onCloseLogin(){this.eventCloseLogin.unsubscribe()}onChangeTipoPlano(o){this.marcacaoService.tipoConvenio=o,this.onChangeParticular()}goToRegister(){this.editar?(this.prontuario.genero=+this.prontuario.genero,this.startLoading(),this.registroService.atualizarProntuario(this.domain,this.prontuario).subscribe(o=>{o&&(E.$.selectUserPorModel(this.prontuario),this.stopLoading(),this.textoBotaoEditar="Editar",this.editar=!this.editar,this.prontuario.prontuarioId=0)},o=>{this.verifyError(o)})):(this.textoBotaoEditar="Salvar",this.editar=!this.editar)}carregarConvenioPlanoProntuario(){this.registroService.getConvenioPlanoProntuario(this.domain).subscribe(o=>{if(o){if(this.model.convenioParticular.id===o.convenio.id)this.onChangeTipoPlano(1);else if(this.model.convenioFidelidade.id==o.convenio.id)this.onChangeTipoPlano(2);else if(this.model.convenio.id!=o.convenio.id){let i=localStorage.getItem("matricula"),n=localStorage.getItem("dataValidade");this.marcacaoService.convenio=this.model.convenio,this.marcacaoService.plano=this.model.plano,this.qtdcaracteres=this.model.convenio.qtdcaracteres,this.marcacaoService.matriculaConvenio=i,this.marcacaoService.dataValidade=new Date(n)}else this.marcacaoService.convenio=o.convenio,this.marcacaoService.plano=o.plano,this.marcacaoService.dataValidade=o.dataValidade,this.marcacaoService.matriculaConvenio=o.matriculaConvenio,this.qtdcaracteres=o.convenio.qtdcaracteres;this.atualizarHorarios()}},o=>{this.verifyError(o)})}salvarStorage(o,i){localStorage.setItem(o,i)}onUploadFile(o,i){if(0===o.length)return!1;const n=o[0],a=n.type;if(null==a.match(/image\/*/)&&null==a.match(/application\/pdf/))return this.modalAlertService.open("warning","Aten\xe7\xe3o","Somente imagens e documentos em PDF s\xe3o suportados","button"),!1;this.renderFile(n,i)}renderFile(o,i){this.startLoading();const n=o.name,a=o.type,d=o.lastModified,r=new FileReader;r.onload=c=>{this.documentoSevice.ocrEnviarCarteirinhaConvenio(this.domain,c.target.result).pipe((0,oo.w)(_=>{var p,u,f,C;
1if(this.stopLoading(),_&&_.sucesso){if(_.idPlano>0){const x=this.marcacaoService.convenios.find(A=>A.id===_.idConvenio);return this.marcacaoService.convenio=x,this.marcacaoService.matriculaConvenio=_.carteirinha,this.marcacaoService.dataValidade=_.dataValidade?new Date(_.dataValidade):null,this.modalAlertService.open("success","Sucesso",_.mensagem,"button"),!(null===(u=null===(p=this.model)||void 0===p?void 0:p.documentos)||void 0===u)&&u.find(A=>A.nome===n&&A.tipo===i)||this.compressFile(c.target.result,i,n,a,d,o,0,0,""),this.onSelectConvenioAsync(x).pipe((0,Pe.U)(()=>_))}return this.marcacaoService.matriculaConvenio=_.carteirinha,this.marcacaoService.dataValidade=_.dataValidade?new Date(_.dataValidade):null,this.modalAlertService.open("warning","Aten\xe7\xe3o",_.mensagem,"button"),!(null===(C=null===(f=this.model)||void 0===f?void 0:f.documentos)||void 0===C)&&C.find(x=>x.nome===n&&x.tipo===i)||this.compressFile(c.target.result,i,n,a,d,o,0,0,""),this.atualizarHorarios(),we.E}return this.modalAlertService.open("warning","Aten\xe7\xe3o",_.mensagem,"button"),we.E})).subscribe(_=>{const p=this.marcacaoService.planos.find(u=>u.convenioId===this.marcacaoService.convenio.id&&u.id===_.idPlano);this.marcacaoService.plano=p,this.onSelectPlano()},_=>{this.verifyError(_)})},r.readAsDataURL(o)}clearFile(o){o.value=null}onDocumentClick(o){this.marcacaoService.ocr&&this.ocrContainer&&this.ocrContainer.nativeElement&&!this.ocrContainer.nativeElement.contains(o.target)&&(this.marcacaoService.ocr=!1)}abrirOcr(o){this.marcacaoService.ignorarProximoFocus?this.marcacaoService.ignorarProximoFocus=!1:(o.stopPropagation(),this.exibeOcultaDivOcr(!0))}abrirFilePicker(o){this.filePedidoMedico.nativeElement.click()}exibeOcultaDivOcr(o){this.marcacaoService.ocr=!!this.getUtilizaOCR()&&o}compressFile(o,i,n,a,d,r,c,m,_){var p=this;return(0,U.Z)(function*(){const u=new te.t({image:o.split(",")[1],tipo:i,fileName:n,mimeType:a,protocolo:c,prontuario:m,guidProtocolo:_,lastModified:d,file:r});if(p.model.documentos||(p.model.documentos=[]),"application/pdf"===a){const f=yield p.documentosService.saveFile(u);f&&p.model.documentos.push(f)}else if(p.imageCompress.byteCount(o)/1048576>1)p.imageCompress.compressFile(o,-1,100,50).then(function(){var x=(0,U.Z)(function*(A){u.image=A.split(",")[1];const P=yield p.documentosService.saveFile(u);P&&(p.model.documentos||(p.model.documentos=[]),p.model.documentos.push(P),p.syncModel())});return function(A){return x.apply(this,arguments)}}()).catch(function(){var x=(0,U.Z)(function*(A){const P=yield p.documentosService.saveFile(u);P&&(p.model.documentos||(p.model.documentos=[]),p.model.documentos.push(P),p.syncModel())});return function(A){return x.apply(this,arguments)}}());else{const x=yield p.documentosService.saveFile(u);x&&(p.model.documentos||(p.model.documentos=[]),p.model.documentos.push(x),p.syncModel())}})()}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(e.sBO),e.Y36(Z.b4))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-marcacao"]],viewQuery:function(o,i){if(1&o&&(e.Gf(to,5),e.Gf(no,5)),2&o){let n;e.iGM(n=e.CRH())&&(i.ocrContainer=n.first),e.iGM(n=e.CRH())&&(i.filePedidoMedico=n.first)}},hostBindings:function(o,i){1&o&&e.NdJ("click",function(a){return i.onDocumentClick(a)},!1,e.evT)},features:[e.qOj],decls:28,vars:9,consts:[["class","row exams-steps mt-xxl-0 mt-xl-0 mt-md-0 mt-sm-5",4,"ngIf"],["class","py-2",4,"ngIf"],["class","p-0 mt-4 apoiado-logado mb-0",4,"ngIf"],["class","p-3 mt-5 mb-0",4,"ngIf"],[1,"popup"],[1,"background"],[1,"body"],[1,"spacing"],[1,"section"],[1,"row"],[1,"col-12"],[1,"col-12","text-center"],["type","button",1,"btn","btn-info","text-uppercase","col-10","offset-1",3,"click"],["type","button",1,"btn","btn-secondary","text-uppercase","col-10","offset-1",3,"click"],["id","modelAdicionarPedidoMedicoUploadFile","type","file","accept",".jpg,.jpeg,.png,.pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["filePedidoMedico",""],[1,"row","exams-steps","mt-xxl-0","mt-xl-0","mt-md-0","mt-sm-5"],[1,"col-md-12","text-sm-center1","mb-md-3"],[1,"p-steps","p-widget","p-helper
1-clearfix"],["role","tablist",1,"p-0"],["role","tablistitem","class","p-steps-item",3,"ngClass",4,"ngFor","ngForOf"],["role","tablistitem",1,"p-steps-item",3,"ngClass"],["href","javascript:void(0)","tabindex","0",1,"p-menuitem-link","no-hand"],[1,"p-steps-number","d-block"],[1,"p-steps-title","d-md-block"],[1,"py-2"],[1,"p-0","mt-4","apoiado-logado","mb-0"],[1,"row","px-3","py-1"],[1,"col-xl-12","col-lg-12","col-md-12","col-sm-12","text-end"],["type","button",1,"btn","btn-outline-info","me-2","mt-2",3,"click"],[1,"fa","me-1",3,"ngClass"],["class","btn btn-outline-info mt-2","type","button",3,"click",4,"ngIf"],[1,"col-xl-4","col-lg-4","col-md-4","col-sm-12","mt-0"],["id","name","name","name","type","text","pInputText","",1,"text-uppercase",3,"ngModel","disabled","ngModelChange"],[1,"col-xl-2","col-lg-2","col-md-2","col-sm-12","mt-0"],[3,"ngModel","locale","dateFormat","showOnFocus","disabled","ngModelChange","onInput"],["pInputText","",1,"form-select",3,"ngModel","disabled","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["id","peso","name","peso","type","text","maxlength","6","size","20","pInputText","","currencyMask","",3,"ngModel","disabled","ngModelChange"],["id","altura","name","altura","type","text","maxlength","6","size","20","pInputText","","currencyMask","",3,"ngModel","disabled","ngModelChange"],["type","button",1,"btn","btn-outline-info","mt-2",3,"click"],[1,"fa","fa-exchange-alt"],[3,"value"],[1,"p-3","mt-5","mb-0"],[1,"col-md-12"],["name","modelTipoConvenio",1,"btn","btn-outline-primary","me-2","mb-2","tipoPlano",3,"ngClass","disabled","click"],["class","btn btn-outline-primary me-2 mb-2 tipoPlano","name","modelTipoConvenio",3,"ngClass","disabled","click",4,"ngIf"],[1,"position-relative"],["ocrContainer",""],["class","row",4,"ngIf"],["class","col-xl-6 col-lg-6 col-md-6 col-sm-12 p-fluid mt-2",4,"ngIf"],["class","col-xl-6 col-lg-6 col-md-6 col-sm-12 p-fluid mt-2 custom-calendar",4,"ngIf"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-12","p-fluid","mt-2"],["autocompleteSearchIcon","Conv\xeanio",3,"onClear","onCameraClick"],["id","modelConvenioGeral","name","modelConvenioGeral","field","nome","placeholder","Digite o nome do conv\xeanio","emptyMessage","Nenhum registro encontrado",1,"p-autocomplete",3,"ngModel","suggestions","ngModelChange","completeMethod","onFocus","onSelect","onUnselect"],[3,"click",4,"ngIf"],["autocompleteSearchIcon","Plano",1,"prime-dropdown",3,"onClear"],["id","modelPlanoGeral","name","modelPlanoGeral","field","nome","placeholder","Digite o nome do plano","emptyMessage","Nenhum registro encontrado",1,"p-autocomplete",3,"ngModel","suggestions","disabled","dropdown","ngModelChange","completeMethod","onSelect","onUnselect"],[3,"click"],[1,"d-flex","flex-column"],[1,"listCustom","m-0","p-0","bg-white","rounded","border","shadow-sm","w-100"],["role","button",1,"listItemsCustom","w-100","m-0","py-2","px-3","d-flex","flex-column","text-center",3,"click"],[1,"fa","fa-camera","text-primary","fa-lg"],[1,"text-primary","ocrTextoFormato"],[1,"p-float-label","p-fluid"],["id","modelMatricula","name","modelMatricula","pInputText","","pInputText","",3,"ngModel","maxlength","ngModelChange","blur"],["for","modelM"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-12","p-fluid","mt-2","custom-calendar"],["readonly","",1,"mb-0",3,"ngModel","readonlyInput","showIcon","showButtonBar","ngModelChange","onSelect"]],template:function(o,i){if(1&o){const n=e.EpF();e.YNc(0,ro,5,1,"div",0),e.YNc(1,co,1,0,"div",1),e.YNc(2,_o,35,17,"fieldset",2),e.YNc(3,vo,18,13,"fieldset",3),e.TgZ(4,"div",4),e._UZ(5,"div",5),e.TgZ(6,"div",6),e._UZ(7,"div",7),e.TgZ(8,"div",8)(9,"div",9)(10,"div",10)(11,"div",9)(12,"h4",11),e._uU(13),e.qZA()(),e._UZ(14,"div",9),e.TgZ(15,"div",9)(16,"p",11),e._uU(17,"Caso seu m\xe9dico tenha informado os exames na plataforma, eles aparecer\xe3o automaticamente como sugest\xe3o aqui no nosso portal"),e.qZA()(),e._UZ(18,"div",9),e.TgZ(19,"div",9)(20,"button",12),e.NdJ("click",function(){return i.abrirPopupLogin()}),e._uU(21,"Fazer o login"),e.qZA()(),e.TgZ(22,"div",9)(23,"button",13),e.NdJ("click",function(){return i.ocultarAlertaElegibilidade()}),e._uU(24,"Continuar sem login"),e.qZA()()()()()()(),e.TgZ(25,"input",14,15),e.NdJ("change",function(){e.CHM(n);const d=e.MAs(26);return i.onUploadFile(d.files,1),e.KtG(i.clearFile(d))}),e.qZA(),e._UZ(27,"router-outlet")}2&o&&(e.Q6J("ngIf",i.activeStep>
10&&i.mostraBulletsProcessoAgendamento),e.xp6(1),e.Q6J("ngIf",!i.usuarioSelecionado&&i.activeStep>0),e.xp6(1),e.Q6J("ngIf",i.usuarioLogado&&i.usuarioLogado.backoffice&&i.usuarioSelecionado&&i.exibeOcultaPacienteLabApoiado()),e.xp6(1),e.Q6J("ngIf",i.exibeConvenioPlano()&&i.isLoaded),e.xp6(1),e.ekj("hidden",!i.alertaElegibilidade)("visible",i.alertaElegibilidade),e.xp6(9),e.hij("Cliente ",i.nomeConvenio," voc\xea pode agendar seus exames com mais facilidade se fizer o login"))},dependencies:[h.mk,h.sg,h.O5,$.j,v.YN,v.Kr,v.Fj,v.EJ,v.JJ,v.nD,v.On,H.o,L.Qc,V.f,Me.g1,b.lC],styles:['@charset "UTF-8";.exams-steps em{font-size:25px;padding-right:5px}.exams-steps label{padding-left:5px;font-size:14px}.apoiado-logado span{color:#4632b4;font-weight:700}fieldset .apoiado-logado{padding:inherit}.custom-calendar .p-calendar input{margin-bottom:0!important}.custom-calendar .p-calendar button{margin-bottom:0!important;margin-right:0!important}.autocomplete-search{position:relative}.autocomplete-search .camera,.autocomplete-search .clear{position:absolute;top:50%;transform:translateY(-50%);height:20px;width:20px;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:10}.autocomplete-search .camera{right:42px;color:#4632b4;padding-left:22px}.autocomplete-search .p-autocomplete-input{padding-right:80px!important}.autocomplete-search .camera{top:calc(50% + 1px)}\n'],encapsulation:2}),t})();var ge=g(1160),y=g(4247),k=g(5839),B=g(8783),Q=g(1241),ae=g(1481);const Co=function(){return{width:"90%",overflow:"hidden"}};function Ao(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",1)(1,"p-dialog",2),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.display=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.clear())}),e._UZ(2,"div",3),e.qZA()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(7,Co)),e.Q6J("visible",o.display)("modal",!0)("responsive",!0)("baseZIndex",1e4),e.xp6(1),e.Q6J("innerHTML",o.model,e.oJD)}}let bo=(()=>{class t extends Q.b{set value(o){o&&this.load(o)}constructor(o,i){super(o),this.sanitizer=i,this.onClose=new e.vpe}ngOnInit(){this.clear()}clear(){this.model=void 0,this.display=!1,this.onClose.emit()}load(o){this.display=!0,this.model=this.sanitizer.bypassSecurityTrustHtml(o)}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(ae.H7))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-mais-informacao"]],inputs:{value:"value"},outputs:{onClose:"onClose"},features:[e.qOj],decls:1,vars:1,consts:[["class","mais-informacao-inner-html",4,"ngIf"],[1,"mais-informacao-inner-html"],["header","Mais Informa\xe7\xf5es",3,"visible","modal","responsive","baseZIndex","visibleChange","onHide"],[1,"row","mt-1","pb-1","margin-bottom-border",3,"innerHTML"]],template:function(o,i){1&o&&e.YNc(0,Ao,3,8,"div",0),2&o&&e.Q6J("ngIf",i.model)},dependencies:[h.O5,k.V],styles:[".mais-informacao-inner-html .row{display:inline}.mais-informacao-inner-html .row ul{margin-top:5px;margin-bottom:7px}\n"],encapsulation:2}),t})();var To=g(5529),Zo=g(3753),Eo=g(13),Io=g(5778);const Po=["searchInput"],wo=["listCustom"];function Mo(t,s){1&t&&e._UZ(0,"em",13)}function Uo(t,s){1&t&&e._UZ(0,"em",14)}function No(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"i",15),e.NdJ("click",function(){e.CHM(o),e.oxw();const n=e.MAs(12);return e.KtG(n.click())}),e.qZA()}}function So(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(n){const d=e.CHM(o).$implicit,r=e.oxw(2);return e.KtG(r.filtraEspecialidade(n,d))}),e._uU(1),e.qZA()}if(2&t){const o=s.$implicit;e.xp6(1),e.hij(" ",o," ")}}function yo(t,s){if(1&t&&(e.TgZ(0,"small",25)(1,"b"),e._uU(2,"\xc9 igual a: "),e.qZA(),e._uU(3),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(3),e.Oqu(o.sinonimias)}}function qo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"li",23),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(2);return e.KtG(d.onExameSelecionado(a))}),e.TgZ(1,"b"),e._uU(2),e.qZA(),e.YNc(3,yo,4,1,"small",24),e.qZA()}if(2&t){const o=s.$implicit;e.Q6J("title",o.sinonimia),e.xp6(2),e.Oqu(o.nome),e.xp6(1),e.Q6J("ngIf",o.sinonimias.length>0)}}function Jo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",16)(1,"div",17)(2,"div",18)(3,"span",19),e.NdJ("click",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.filtraEspecialidade(n,"all"))}),e._uU(4," Todos "),e.qZA(),e.YNc(5,So,2,1,"span",20),e.qZA()(),e.TgZ(6,"ul",21),e.YNc(7,qo,4,3,"li",22),e.qZA()()}if(2&t){const o=e.oxw();e.xp6(5),e.Q6J("ngForOf",o.especialidades),e.xp6(2),e.Q6J("ngForOf",o.montaLista)}}function ko(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"div",16)(2,"div",21)(3,"span",26),e.NdJ("click",function(){e.CHM(o),e.oxw();const n=e.MAs(12);return e.KtG(n.click())}
1),e._UZ(4,"i",27),e.TgZ(5,"span")(6,"strong"),e._uU(7,"Novidade!!"),e.qZA(),e._uU(8," Buscar exames pelo pedido m\xe9dico."),e.qZA(),e.TgZ(9,"em",28),e._uU(10,"Formatos aceitos: JPG, JPEG, PNG, PDF"),e.qZA()()()()()}}let Do=(()=>{class t extends w.a{constructor(o){super(o),this.listaAtiva=!1,this.loading=!1,this.userQuestionUpdate=new To.xQ,this.especialidades=[],this.ocr=!1,this.textoBusca="",this.exameSelecionado=new e.vpe,this.uploadFile=new e.vpe,this._textoBusca="",this.exameService=o.get(l.q07),this.documentoSevice=o.get(l.Bi_)}ngOnInit(){(0,Zo.R)(this.searchInput.nativeElement,"input").pipe((0,Pe.U)(o=>o.target.value),(0,Eo.b)(1e3),(0,Io.x)()).subscribe(o=>{""!=o.replace(/\s/g,"")?(this.loading=!0,this.filterListLumia(o)):this.clear()})}ngOnChanges(o){var i;if(null!==(i=o.textoBusca)&&void 0!==i&&i.currentValue){const n=o.textoBusca.currentValue;setTimeout(()=>{this.searchInput.nativeElement.focus(),this.filterListLumia(n)})}}filterListLumia(o){this.termoBusca=o;const i=[];this.loading=!0,this.lumiaAtiva&&this.termoBusca&&this.exameService.getBuscaInteligenteExames(this.termoBusca,this.domain).subscribe(n=>{this.listaAtiva=!0,n.forEach(a=>{const d=this.exames.find(r=>r.id===a.id);d&&(d.sinonimia=a.sinonimia,i.push(d))}),i.length&&(this.montaLista=i,this.montaListaFiltrada=i,this.setEspecialidades(this.montaLista)),this.loading=!1,this.controlDownUp()},()=>{this.filterListExames(this.termoBusca),this.clear()}),!this.lumiaAtiva&&this.termoBusca&&this.filterListExames(this.termoBusca)}filterListExames(o){this.listaAtiva=!0,this.montaLista=this.exames.filter(i=>this.contains(i.nome,o)||i.sinonimias.findIndex(n=>this.contains(n,o))>-1),this.montaListaFiltrada=this.montaLista,this.setEspecialidades(this.montaLista),this.loading=!1,this.controlDownUp()}setEspecialidades(o){const i=[];this.ocr=!1,o.forEach(a=>{""!=a.especialidade&&i.push(a.especialidade)});var n=i.filter(function(a,d){return i.indexOf(a)===d});this.especialidades=n,this.especialidades.length>0&&this.setFirstTag()}setFirstTag(){setTimeout(()=>{const i=document.getElementById("listaCustomTags").querySelectorAll("span");for(let n=0;n<i.length;n++)i[n].classList.remove("bg-list-blue"),i[n].classList.remove("text-white");i[0].classList.add("bg-list-blue"),i[0].classList.add("text-white")},300)}filtraEspecialidade(o,i){const a=o.target.parentNode.querySelectorAll("span");for(let c=0;c<a.length;c++)a[c].classList.remove("bg-list-blue"),a[c].classList.remove("text-white");o.target.classList.add("bg-list-blue"),o.target.classList.add("text-white");const d=this.montaListaFiltrada;this.montaLista="all"==i?d:d.filter(c=>this.contains(c.especialidade,i)||c.sinonimias.findIndex(m=>this.contains(m,i))>-1);const r=document.getElementsByClassName("listCustom")[0];this.searchInput.nativeElement.focus(),r.scrollTop=0,this.controlDownUp()}onExameSelecionado(o){this.exameSelecionado.emit(o),this.clear()}clear(){this.listaAtiva=!1,this._textoBusca="",this.searchInput.nativeElement.value="",this.montaLista=[],setTimeout(()=>{this.searchInput.nativeElement.focus()})}controlDownUp(){let o=-1;const i=document.getElementById("listCustom");i.addEventListener("keydown",n=>{var a,d;const r=Array.from(document.getElementsByClassName("listItemsCustom")).map(m=>m),c=i.querySelector(".listCustom");if("Enter"===n.key&&this.itemSelecionadoCustom&&this.itemSelecionadoCustom.click(),"ArrowDown"===n.key||"ArrowUp"===n.key){n.preventDefault(),"ArrowUp"===n.key&&o>0?o--:"ArrowDown"===n.key&&o<r.length-1&&o++,r.forEach(u=>{u?.classList.remove("selected")}),null===(a=r[o])||void 0===a||a.classList.add("selected"),this.itemSelecionadoCustom=r[o];const m=(null===(d=r[o])||void 0===d?void 0:d.offsetTop)||0;c.scrollTop=m-(c.clientHeight||0)}})}exibeOcultaDivOcr(o){this.ocr=!!this.getUtilizaOCR()&&o}clearFile(o){o.value=null}onDocumentClick(o){var i;null!==(i=this.listCustom)&&void 0!==i&&i.nativeElement.contains(o.target)||(this.ocr=!1,this.listaAtiva=!1)}onUploadFileEvent(o,i){this.exibeOcultaDivOcr(!1),this.uploadFile.emit({files:o,tipo:i})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-autocomplete"]],viewQuery:function(o,i){if(1&o&&(e.Gf(Po,7),e.Gf(wo,7)),2&o){let n;e.iGM(n=e.CRH())&&(i.searchInput=n.first),e.iGM(n=e.CRH())&&(i.listCustom=n.first)}},hostBindings:function(o,i){1&o&&e.NdJ("click",function(a){return i.onDocumentClick(a)},!1,e.evT)},inputs:{exames:"exames",lumiaAtiva:"lumiaAtiva",textoBusca:"textoBusca"},outputs:{exameSelecionado:"exameSelecionado",uploadFile:"uploadFile"},features:[e.qOj,e.TTD],decls:13,vars:6,consts:[["id","listCustom",1,"d-flex","flex-column","position-relative","z-index9"],["listCustom",""],[1,"d-flex","flex-row","justify-content-between","align-items-center","w-100","border","gap-2","py-2","px-3","rounded","parent-focus"],["class","fa fa-spinner fa-spin text-info",4,"ngIf"],["class","pi pi-search fa-md text-info","role","button","title","Busca",4,"ngIf"],["placeholder","Digite o nome do procedimento",1,"flex-grow-1","border-0","outline-none",3,"ngModel","focus","ngModelChange"],["searchInput",""],["class","fa fa-camera text-primary fa-lg","role","button","title","Buscar exames pelo pedido m\xe9dico",3,"click",4,"ngIf"],["role","button","title","Cancelar",1,"fas","fa-times","fa-md","text-info",3,"click"],["class","d-flex flex-column",4,"ngIf"],[4,"ngIf"],["id","modelAdicionarPedidoMedicoUploadFile","type","file","accept",".jpg,.jpeg,.png,.pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["filePedidoMedico",""],[1,"fa","fa-spinner","fa-spin","text-info"],["role","button","title","Busca",1,"pi","pi-search","fa-md","text-info"],["role","button","title","Buscar exames pelo pedido m\xe9dico",1,"fa","fa-camera","text-primary","fa-lg",3,"click"],[1,"d-flex","flex-column"],["id","listaCustomTags",1,"listaCustomTags","d-flex","flex-row","gap-1","overflow-auto","pt-2","pb-4"],[1,"d-flex","flex-row","gap-1"],[1,"badge","fs-normal","rounded-pill","bg-grey","text-black","fw-normal","hand",3,"click"],["class","badge fs-normal rounded-pill bg-grey text-black fw-normal hand",3,"click",4,"ngFor","ngForOf"],[1,"listCustom","m-0","p-0","bg-white","rounded","border","shadow-sm","w-100"],["class","listItemsCustom w-100 m-0 py-2 px-3 d-flex flex-column","role","button",3,"title","click",4,"ngFor","ngForOf"],["role","button",1,"listItemsCustom","w-100","m-0","py-2","px-3","d-flex","flex-column",3,"title","click"],["class","text-small",4,"ngIf"],[1,"text-small"],["role","button",1,"listItemsCustom","w-100","m-0","py-2","px-3","d-flex","flex-column","text-center",3,"click"],[1,"fa","fa-camera","text-primary","fa-lg"],[1,"text-primary","ocrTextoFormato"]],template:function(o,i){if(1&o){const n=e.EpF();e.TgZ(0,"div",0,1)(2,"div",2),e.YNc(3,Mo,1,0,"em",3),e.YNc(4,Uo,1,0,"em",4),e.TgZ(5,"input",5,6),e.NdJ("focus",function(){return i.exibeOcultaDivOcr(!0)})("ngModelChange",function(d){return i.textoBusca=d}),e.qZA(),e.YNc(7,No,1,0,"i",7),e.TgZ(8,"em",8),e.NdJ("click",function(){return i.clear()}),e.qZA()(),e.YNc(9,Jo,8,2,"div",9),e.YNc(10,ko,11,0,"div",10),e.qZA(),e.TgZ(11,"input",11,12),e.NdJ("change",function(){e.CHM(n);const d=e.MAs(12);return i.onUploadFileEvent(d.files,3),e.KtG(i.clearFile(d))}),e.qZA()}2&o&&(e.xp6(3),e.Q6J("ngIf",i.loading),e.xp6(1),e.Q6J("ngIf",!i.loading),e.xp6(1),e.Q6J("ngModel",i.textoBusca),e.xp6(2),e.Q6J("ngIf",i.getUtilizaOCR()),e.xp6(2),e.Q6J("ngIf",i.listaAtiva),e.xp6(1),e.Q6J("ngIf",i.ocr))},dependencies:[h.sg,h.O5,v.Fj,v.JJ,v.On],styles:[".selected{background-color:#007ad9;color:#fff;transition:linear .2s}.listItemsCustom:hover{background-color:#eee}.bg-grey{background-color:#ddd}.listaCustomTags::-webkit-scrollbar{width:5px}.listaCustomTags::-webkit-scrollbar-track{background:#f4f4f4}.listaCustomTags::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:20px;border:4px solid #f4f4f4}.listCustom{max-height:180px;overflow-y:auto}.ocrTextoFormato{font-size:12px}\n"],encapsulation:2}),t})();function Fo(t,s){if(1&t&&(e.TgZ(0,"a",3),e._UZ(1,"i",4),e.TgZ(2,"span",5),e._uU(3,"Agendar por whatsapp"),e.qZA()()),2&t){const o=e.oxw();e.s9C("href",o.urlWhatsapp,e.LSH)}}function Oo(t,s){if(1&t&&(e.TgZ(0,"a",6),e._UZ(1,"i",7),e.TgZ(2,"span"),e._uU(3,"Agendar por whatsapp"),e.qZA()()),2&t){const o=e.oxw();e.s9C("href",o.urlWhatsapp,e.LSH)}}function Ho(t,s){if(1&t&&(e.TgZ(0,"a",8),e._UZ(1,"i",9),e.TgZ(2,"span"),e._uU(3),e.qZA()()),2&t){const o=e.oxw();e.s9C("href",o.linkTelefoneMarca,e.LSH),e.xp6(3),e.Oqu(o.telefoneMarca)}}let Qo=(()=>{class t{constructor(o){this.authService=o,this.showWhatsappHelp=!1,this.showWhatsappHelpInline=!1,this.tempoBotaoWhatsapp=3e3,this.showWhatsApp=!0,this.showTelefoneMarca=!1}ngOnInit(){setTimeout(()=>{this.startWhatsAppHelp()},100)}startWhatsAppHelp(){var o,i;let n=this.authService.getSettings();this.showWhatsApp=""!==n?.UrlWhatsapp,this.showWhatsApp?(this.urlWhatsapp=null!==(o=n?.UrlWhatsapp)&&void 0!==o?o:"",this.tempoBotaoWhatsapp=null!==(i=n?.TempoBotaoWhatsapp)&&void 0!==i?i:9999,"timerFloat"==this.typeHelpWhatsapp&&setTimeout(()=>{this.showWhatsappHelp=!0},1e3*this.tempoBotaoWhatsapp),"inline"==this.typeHelpWhatsapp&&(this.showWhatsappHelpInline=!0)):(this.showTelefoneMarca=!0,this.linkTelefoneMarca="tel:+55"+n?.TelefoneMarca,this.telefoneMarca=this.getFormatedTelefoneMarca(n?.TelefoneMarca))}getFormatedTelefoneMarca(o){const i=o;return i?"("+i.toString().substr(0,2)+") "+i.toString().substr(2,4)+"-"+i.toString().substr(6,4):void 0}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(E.$))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-whatsapp-help"]],inputs:{typeHelpWhatsapp:"typeHelpWhatsapp"},decls:3,vars:3,consts:[["target","_blank","class","btn-whatsapp-help d-flex flex-row align-items-center gap-2 hand",3,"href",4,"ngIf"],["target","_blank","class","btn-whatsapp-help-inline d-flex align-items-center justify-content-center hand btn btn-sm text-white text-uppercase",3,"href",4,"ngIf"],["class","btn-telefone-inline d-flex align-items-center justify-content-center hand btn btn-sm text-white text-uppercase",3,"href",4,"ngIf"],["target","_blank",1,"btn-whatsapp-help","d-flex","flex-row","align-items-center","gap-2","hand",3,"href"],[1,"fab","fa-whatsapp","fa-lg"],[1,"fw-bold"],["target","_blank",1,"btn-whatsapp-help-inline","d-flex","align-items-center","justify-content-center","hand","btn","btn-sm","text-white","text-uppercase",3,"href"],[1,"fab","fa-whatsapp","fa-lg","me-2"],[1,"btn-telefone-inline","d-flex","align-items-center","justify-content-center","hand","btn","btn-sm","text-white","text-uppercase",3,"href"],[1,"fa","fa-phone-alt","fa-lg","me-2"]],template:function(o,i){1&o&&(e.YNc(0,Fo,4,1,"a",0),e.YNc(1,Oo,4,1,"a",1),e.YNc(2,Ho,4,2,"a",2)),2&o&&(e.Q6J("ngIf",i.showWhatsappHelp&&i.showWhatsApp),e.xp6(1),e.Q6J("ngIf",i.showWhatsappHelpInline&&i.showWhatsApp),e.xp6(1),e.Q6J("ngIf",i.showTelefoneMarca))},dependencies:[h.O5],styles:[".btn-whatsapp-help[_ngcontent-%COMP%]{position:fixed;right:30px;bottom:15%;background-color:#25d366;color:#fff;border-radius:50px;padding:10px 15px;z-index:999;transition:all .2s linear;text-decoration:none}.btn-whatsapp-help-inline[_ngcontent-%COMP%]{background-color:#25d366;text-decoration:none;transition:all .2s linear}.btn-whatsapp-help[_ngcontent-%COMP%]:hover, .btn-whatsapp-help-inline[_ngcontent-%COMP%]:hover{background-color:#128c7e}@media (max-width: 769px){.btn-whatsapp-help[_ngcontent-%COMP%]{display:flex;width:40px;height:40px;border-radius:500px;align-items:center;justify-content:center}.btn-whatsapp-help[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:none}}.btn-telefone-inline[_ngcontent-%COMP%]{background-color:#116fbf;text-decoration:none;transition:all .2s linear}"]}),t})();function Lo(t,s){if(1&t&&(e.TgZ(0,"div",14),e._uU(1),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Oqu(o.mensagem)}}function Ro(t,s){1&t&&e.GkF(0)}function Yo(t,s){1&t&&e.GkF(0)}function Go(t,s){if(1&t&&(e.TgZ(0,"div",0)(1,"p-tabView")(2,"p-tabPanel",21),e.YNc(3,Ro,1,0,"ng-container",22),e.qZA(),e.TgZ(4,"p-tabPanel",21),e.YNc(5,Yo,1,0,"ng-container",22),e.qZA()()()),2&t){const o=e.oxw(2),i=e.MAs(13),n=e.MAs(15);e.xp6(2),e.Q6J("header",o.isMobile?"Adicionados":"Exames Adicionados"),e.xp6(1),e.Q6J("ngTemplateOutlet",i),e.xp6(1),e.Q6J("header",o.isMobile?"Pendentes":"Exames N\xe3o Adicionados"),e.xp6(1),e.Q6J("ngTemplateOutlet",n)}}function Ko(t,s){1&t&&e.GkF(0,24)}function $o(t,s){if(1&t&&e.YNc(0,Ko,1,0,"ng-container",23),2&t){e.oxw(2);const o=e.MAs(13);e.Q6J("ngTemplateOutlet",o)}}function Vo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",15)(1,"fieldset",16)(2,"legend"),e._uU(3,"Selecione os seus procedimentos"),e.qZA(),e.TgZ(4,"div",0)(5,"div",17)(6,"app-autocomplete",18),e.NdJ("exameSelecionado",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.onExameSelecionado(n))})("uploadFile",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.onFileUpload(n))}),e.qZA()()(),e.YNc(7,Go,6,4,"div",19),e.YNc(8,$o,1,1,"ng-template",null,20,e.W1O),e.qZA()()}if(2&t){const o=e.MAs(9),i=e.oxw();e.xp6(6),e.Q6J("exames",i.exames)("lumiaAtiva",i.lumiaAtiva)("textoBusca",i.textoPesquisa),e.xp6(1),e.Q6J("ngIf",i.model.leituraExamePorOcr)("ngIfElse",o)}}function Bo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",25),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._UZ(1,"span",26),e._uU(2,"HOME "),e.qZA()}}function zo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"span",27),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.validarDadosParaAbrirModal())}),e._uU(1,"Continuar"),e.qZA()}}const Ue=function(){return{width:"450px",overflow:"hidden"}};function jo(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",28),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.tipoAgendamentoModal=n)}),e.TgZ(2,"div",29)(3,"div",30)(4,"p-radioButton",31),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.tipoAgendamentoValue=n)})("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.tipoAgendamento())}),e.qZA()(),e.TgZ(5,"div",32)(6,"h5",33),e._uU(7,"Todos juntos"),e.qZA(),e.TgZ(8,"small"),e._uU(9,"Juntaremos todos os exames no mesmo local e data."),e.qZA()()(),e.TgZ(10,"div",29)(11,"div",30)(12,"p-radioButton",34),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.tipoAgendamentoValue=n)})("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.tipoAgendamento())}),e.qZA()(),e.TgZ(13,"div",32)(14,"h5",33),e._uU(15,"Local e datas diferentes"),e.qZA(),e.TgZ(16,"small"),e._uU(17,"Mostraremos os locais e datas mais pr\xf3ximos."),e.qZA()()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(9,Ue)),e.Q6J("visible",o.tipoAgendamentoModal)("modal",!0)("responsive",!0)("baseZIndex",1e4)("closable",!0),e.xp6(3),e.Q6J("ngModel",o.tipoAgendamentoValue),e.xp6(8),e.Q6J("ngModel",o.tipoAgendamentoValue)}}function Wo(t,s){if(1&t&&(e.TgZ(0,"div",29),e._uU(1),e.qZA()),2&t){const o=s.$implicit,i=e.oxw(2);e.xp6(1),e.lnq(" - ",o.nomeExame," para o dia ",i.getFormatDate(o.data,"DD MMM YYYY")," \xe1s ",o.horario," ")}}function Xo(t,s){1&t&&(e.TgZ(0,"div",29),e._uU(1," Caso queira prosseguir com o agendamentos dos demais exames, clique em PROSSEGUIR. "),e.qZA())}function ei(t,s){1&t&&(e.TgZ(0,"div",29),e._uU(1," Ou entre em contato com a Central de Atendimento para obter a melhor op\xe7\xe3o de data e hor\xe1rio. "),e.qZA())}function oi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",40),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.prosseguir())}),e._uU(1,"Prosseguir"),e.qZA()}if(2&t){const o=e.oxw(2);e.Q6J("disabled",o.isLoading)}}function ii(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",35),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.displayExamesComRestricao=n)}),e.TgZ(2,"div",29)(3,"strong"),e._uU(4,"Existem exame(s) que j\xe1 possuem agendamento:"),e.qZA()(),e.YNc(5,Wo,2,3,"div",36),e.YNc(6,Xo,2,0,"div",37),e.YNc(7,ei,2,0,"div",37),e.TgZ(8,"div",5)(9,"div",6)(10,"button",38),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.displayExamesComRestricao=!1)}),e._uU(11,"Voltar"),e.qZA(),e.YNc(12,oi,2,1,"button",39),e.qZA()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(12,Ue)),e.Q6J("visible",o.displayExamesComRestricao)("modal",!0)("responsive",!0)("baseZIndex",1e4)("closable",!1),e.xp6(4),e.Q6J("ngForOf",o.examesComAgendamento),e.xp6(1),e.Q
16J("ngIf",o.model.exames.length>o.examesComAgendamento.length),e.xp6(1),e.Q6J("ngIf",o.model.exames.length>o.examesComAgendamento.length),e.xp6(3),e.Q6J("disabled",o.isLoading),e.xp6(2),e.Q6J("ngIf",o.model.exames.length>o.examesComAgendamento.length)}}function ti(t,s){if(1&t&&(e.TgZ(0,"span",46),e._uU(1),e.qZA()),2&t){const o=e.oxw(2);e.xp6(1),e.Oqu(o.getTextoExamesOcrLidos())}}function ni(t,s){1&t&&(e.TgZ(0,"span"),e._UZ(1,"em",61),e.qZA())}function ai(t,s){1&t&&(e.TgZ(0,"span",62),e._uU(1,"(Drive-Thru)"),e.qZA())}function si(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",63),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(2);return e.KtG(a.showMaisInformacoes(n.informacao))}),e._UZ(1,"em",64),e._uU(2,"\xa0Mais Informa\xe7\xf5es "),e.qZA()}}function di(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"label",65),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(2);return e.KtG(a.goToPreferenciaMedico(n))}),e._uU(2," Prefer\xeancia de Medico?"),e.qZA(),e.TgZ(3,"h6",66),e._uU(4),e.qZA()()}if(2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(4),e.Oqu(i.getPreferenciaMedico(o))}}function ri(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",48)(1,"div",49)(2,"button",50),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(2);return e.KtG(a.removeExame(n))}),e._UZ(3,"em",51),e.qZA(),e.TgZ(4,"div",52),e._UZ(5,"em",53),e.qZA(),e.TgZ(6,"div",54),e.YNc(7,ni,2,0,"span",9),e._uU(8),e.YNc(9,ai,2,0,"span",55),e._UZ(10,"br"),e.YNc(11,si,3,0,"a",56),e.qZA(),e.TgZ(12,"div",57),e.YNc(13,di,5,1,"div",9),e.qZA(),e.TgZ(14,"div",58)(15,"a",59),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(2);return e.KtG(a.removeExame(n))}),e._UZ(16,"em",60),e._uU(17,"Remover "),e.qZA()()()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.MGl("id","selectedExames",o.id,""),e.xp6(5),e.Q6J("ngClass",i.getClassIconExame(o.especialidade)),e.xp6(2),e.Q6J("ngIf",!o.agendavelAg),e.xp6(1),e.hij(" ",o.nome,"\xa0 "),e.xp6(1),e.Q6J("ngIf",o.driveThru),e.xp6(2),e.Q6J("ngIf",o.informacao),e.xp6(2),e.Q6J("ngIf",o.habilitaPreferenciaMedico&&i.model.exames.length<=1)}}function ci(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,ri,18,7,"p-card",47),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.exameIntegrado)}}function li(t,s){1&t&&(e.TgZ(0,"span"),e._UZ(1,"em",61),e.qZA())}function mi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",71),e.YNc(1,li,2,0,"span",9),e._uU(2),e.TgZ(3,"em",72),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(4);return e.KtG(a.removeExameLaboratorial(n))}),e.qZA()()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",!o.agendavelAg),e.xp6(1),e.hij("",o.nome," \xa0 ")}}function _i(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,mi,4,2,"div",70),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.exameIntegrado)}}function pi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card")(1,"div",0)(2,"div",67),e._UZ(3,"em",53),e.qZA(),e.TgZ(4,"div",68),e.YNc(5,_i,2,1,"div",43),e.qZA(),e.TgZ(6,"div",69)(7,"a",59),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.removeExamesLaboratoriais())}),e._UZ(8,"em",60),e._uU(9),e.qZA()()()()}if(2&t){const o=e.oxw(3);e.xp6(3),e.Q6J("ngClass",o.getClassIconExame(o.model.examesNaoAgendaveis[0].especialidade)),e.xp6(2),e.Q6J("ngForOf",o.model.examesNaoAgendaveis),e.xp6(4),e.hij("",o.getTextoRemover()," ")}}function ui(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,pi,10,3,"p-card",9),e.qZA()),2&t){const o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",o.model.examesNaoAgendaveis&&o.model.examesNaoAgendaveis.length>0)}}function gi(t,s){if(1&t&&(e.TgZ(0,"div",78),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hij(" ",o.nome," \xa0 ")}}function hi(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,gi,2,1,"div",77),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",o.exameIntegrado)}}function fi(t,s){if(1&t&&(e.TgZ(0,"div",78),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hij(" ",o.nome," \xa0 ")}}function vi(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,fi,2,1,"div",77),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",o.exameIntegrado)}}function xi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card")(1,"div",0)(2,"div",67),e._UZ(3,"em",73),e.qZA(),e.TgZ(4,"div",68),e.YNc(5,hi,2,1,"div",43),e.YNc(6,vi,2,1,"div",43),e.qZA(),e.TgZ(7,"div",74)(8,"a",75),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.removeExames())}),e._UZ(9,"em",76),e._uU(10),e.qZA()()()()}if(2&t){const o=e.oxw(2);e.xp6(5),e.Q6J("ngForOf",o.model.examesNaoAgendaveis),e.xp6(1),e.Q6J("ngForOf",o.model.exames),e.xp6(4),e.hij("\xa0",o.getTextoRemover()," ")}}function Ci(t,s){if(1&t&&(e.TgZ(0,"p-card",79)(1,"div",0)(2,"div",80),e._UZ(3,"em",81),e.qZA(),e.TgZ(4,"div",82)(5,"label"),e._uU(6),e.qZA()()()()),2&t){const o=e.oxw(2);e.xp6(6),e.hij(" Identificamos que os procedimentos selecionados ",o.getExamesLaboratoriais(o.model.examesDomiciliares,!1)," s\xe3o ofertados para atendimento domiciliar. ")}}function Ai(t,s){if(1&t&&(e.TgZ(0,"p-card",83)(1,"div",0)(2,"div",80),e._UZ(3,"em",84),e.qZA(),e.TgZ(4,"div",85)(5,"label"),e._uU(6),e.qZA()(),e.TgZ(7,"div",86),e._UZ(8,"a
1pp-whatsapp-help",87),e.qZA()()()),2&t){const o=e.oxw(2);e.xp6(6),e.hij(" ",o.getTextoExamesNaoAgendaveisAg()," ")}}function bi(t,s){if(1&t&&(e.TgZ(0,"div",41),e.YNc(1,ti,2,1,"span",42),e.YNc(2,ci,2,1,"div",43),e.YNc(3,ui,2,1,"div",9),e.YNc(4,xi,11,3,"p-card",9),e.YNc(5,Ci,7,1,"p-card",44),e.YNc(6,Ai,9,1,"p-card",45),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Q6J("ngIf",o.model.leituraExamePorOcr),e.xp6(1),e.Q6J("ngForOf",o.model.exames),e.xp6(1),e.Q6J("ngIf",o.verificaSeExibe(o.model.examesNaoAgendaveis)),e.xp6(1),e.Q6J("ngIf",o.model.exameIntegrado),e.xp6(1),e.Q6J("ngIf",o.model.contemExameDomiciliar&&o.model.examesDomiciliares&&o.model.examesDomiciliares.length>0&&!o.getExamesNaoAgendaveisAg()),e.xp6(1),e.Q6J("ngIf",o.getExamesNaoAgendaveisAg())}}function Ti(t,s){if(1&t&&(e.TgZ(0,"span",96),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hij(" ",o.nomeExamePleres,"")}}function Zi(t,s){1&t&&(e.TgZ(0,"span",97),e._UZ(1,"i",98),e.qZA())}function Ei(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-card",90),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(2);return e.KtG(!a.adicionado&&d.identificarExame(a))}),e.TgZ(2,"div",49)(3,"div",91)(4,"div",0)(5,"div",92)(6,"span"),e._uU(7),e._UZ(8,"br"),e.qZA(),e.YNc(9,Ti,2,1,"span",93),e.qZA(),e.TgZ(10,"div",94),e.YNc(11,Zi,2,0,"span",95),e.qZA()()()()()()}if(2&t){const o=s.$implicit;e.xp6(1),e.MGl("id","examesNaoIdentificadosOcr",o.id,""),e.Q6J("styleClass",o.adicionado?"cardSuccess":"cardWarning"),e.xp6(6),e.hij(" ",o.nome," "),e.xp6(2),e.Q6J("ngIf",o.adicionado),e.xp6(2),e.Q6J("ngIf",o.adicionado)}}function Ii(t,s){if(1&t&&(e.TgZ(0,"div",88)(1,"div",0)(2,"span",89),e._uU(3,"Clique no exame para pesquisar"),e.qZA(),e.YNc(4,Ei,12,5,"div",43),e.qZA()()),2&t){const o=e.oxw();e.xp6(4),e.Q6J("ngForOf",o.model.examesNaoIdentificadosOcr)}}let Pi=(()=>{class t extends w.a{constructor(o,i){super(o),this.confirmationService=i,this.displayExamesComRestricao=!1,this.verificandoPedidoExame=!1,this.lumiaAtiva=!1,this.tipoAgendamentoModal="",this.showHomeButton=!1,this.textoPesquisa="",this.examesNaoIdentificadosOcr=[],this.isMobile=window.innerWidth<=768,this.textoExamesOcr="",this.lat=0,this.long=0,this.router=o.get(b.F0),this.route=o.get(b.gz),this.exameService=o.get(l.q07),this.unidadeService=o.get(l.sc7),this.homeService=o.get(l.igG),this.marcacaoService=o.get(R.B),this.informacaoUnidadeService=o.get(l.muL),this.convenioPlanoService=o.get(l.xE1),this.documentoSevice=o.get(l.Bi_),this.documentosService=o.get(ie.c),this.imageCompress=o.get(ne.r2)}onResize(){this.isMobile=window.innerWidth<=768}ngOnInit(){this.changeStep(1),this.mostraBulletsProcessoAgendamento=!0,this.clear(),this.load()}clear(){if(this.mensagem="Carregando...",this.selectedExame=null,this.exames=[],this.fExames=[],this.examesComAgendamento=[],this.lat=0,this.long=0,this.model.exames||(this.model.exames=[]),this.model.examesNaoAgendaveis){const o=this.model.examesNaoAgendaveis.filter(i=>i.id!=this.model.exameAcId);this.model.examesNaoAgendaveis=o}else this.model.examesNaoAgendaveis=[];this.model.examesDomiciliares||(this.model.examesDomiciliares=[]),this.isLoggedIn()&&(this.modelFinished=new l.D_Z,this.modelFinished.particular=!1,T.G.setItem(this.STORAGE_KEY_MARCACAO_FINISHED,this.modelFinished)),this.model.meusPagamentos=!1,T.G.setItem(this.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL,0),this.model.reserva=null,this.syncClearModelIndividual()}load(){this.showHomeButton=!E.$.getUsuarioFromOperadora(),this.verificaPermissaoTela(),this.getUtilizaOCR(),this.get()}success(o){const i=o.coords;this.lat=i.latitude,this.long=i.longitude,this.model.isAtivoGps=!0}error(o){console.warn("ERROR("+o.code+"): "+o.message)}get(){this.redirect="resultados-online"==this.route.snapshot.queryParams.redirect?this.route.snapshot.queryParams.redirect:void 0,navigator.geolocation.getCurrentPosition(this.success.bind(this),this.error),this.authService.getSettings()?this.lumiaAtiva=this.getLumiaAtivado():E.$.loadedWebSettingsObservable.subscribe(()=>{this.lumiaAtiva=this.getLumiaAtivado()}),this.startLoading(!0),(0,J.D)(this.exameService.getExameAcId(this.domain),this.exameService.getExames(this.domain),this.unidadeService.getUnidadeCD(this.domain),this.unidadeService.getUnidadeVacina(this.domain),this.homeService.getDataLayer(this.domain),this.informacaoUnidadeService.getInfoUnidades(this.domain),this.unidadeService.getTurnos(this.domain),this.convenioPlanoService.getConvenioParticular(this.domain),this.convenioPlanoService.getPlanoParticular(this.domain),this.convenioPlanoService.getConvenioFidelidade(this.domain),this.convenioPlanoService.getPlanoFidelidade(this.domain),this.convenioPlanoService.getConvenios(this.domain)).subscribe(o=>{var i,n,a;this.model.exameAcId=o[0],this.exames=o[1].filter(r=>r.id!==this.model.exameAcId),this.model.exameACPermiteVariosAgendamentos=0!==this.model.exameAcId&&o[1].filter(r=>r.id===this.model.exameAcId)[0].permiteVariosAgendamentos,this.model.unidadeCD=o[2],this.model.unidadeVacina=o[3],this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o[4],this.unidades=o[5],this.model.turnos=o[6],this.model.convenioParticular=o[7],this.model.planoParticular=o[8],this.model.convenioFidelidade=o[9],this.model.planoFidelidade=o[10],this.marcacaoService.convenios=o[11];const d=new l.Otn;if(d.id=this.model.exameAcId,this.removeExame(d),this.verificarVariaveisUrl(),this.verificarAvisoDomiciliar(),this.model.convenio&&this.getPlanos(this.model.convenio.id),this.getPermiteIntegracaoOperadora()&&this.model.convenio&&this.model.convenio.integracaoOperadora&&this.isLoggedIn()){this.mensagem="Verificando Pedido(s) de Exame(s) na Operadora...",this.verificandoPedidoExame=!0;const r=this.getTimeoutConsultaElegibilidade();let c=0;setInterval(()=>{c<r?c++:this.verificandoPedidoExame&&(this.verificandoPedidoExame=!1,this.mensagem="",this.stopLoading())},1e3)}else this.stopLoading();if(this.user&&this.user.backoffice&&this.user.labApoiado&&this.user.labApoiado.convenioPadrao&&this.user.labApoiado.planoPadrao){const r=new l.p0k;r.id=this.user.labApoiado.convenioPadrao.id,r.nome=this.user.labApoiado.convenioPadrao.nome,r.integracaoOperadora=this.user.labApoiado.convenioPadrao.integracaoOperadora,r.idIntegracaoOperadora=this.user.labApoiado.convenioPadrao.idIntegracaoOperadora,r.nomeOperadora=this.user.labApoiado.convenioPadrao.nomeOperadora,r.mascaraMatricula=this.user.labApoiado.convenioPadrao.mascaraMatricula,r.sinonimias=this.user.labApoiado.convenioPadrao.sinonimias;const c=null!==(a=null===(n=null===(i=this.marcacaoService.convenios)||void 0===i?void 0:i.find(_=>{var p,u;return _.id===(null===(u=null===(p=this.user.labApoiado)||void 0===p?void 0:p.convenioPadrao)||void 0===u?void 0:u.id)}
1))||void 0===n?void 0:n.obrigarPedidoMedico)&&void 0!==a&&a;r.obrigarPedidoMedico=c,r.diasValidadePedidoMedico=this.user.labApoiado.convenioPadrao.diasValidadePedidoMedico,r.cobreColetaDomicilar=this.user.labApoiado.convenioPadrao.cobreColetaDomicilar,this.marcacaoService.convenio=r,this.getPlanos(this.marcacaoService.convenio.id);const m=new l.diK;m.id=this.user.labApoiado.planoPadrao.id,m.nome=this.user.labApoiado.planoPadrao.nome,m.convenioId=this.user.labApoiado.planoPadrao.convenioId,m.profissionalAreaMedica=this.user.labApoiado.planoPadrao.profissionalAreaMedica,m.sinonimias=this.user.labApoiado.planoPadrao.sinonimias,m.classificacao=this.user.labApoiado.planoPadrao.classificacao,this.marcacaoService.plano=m,this.atualizarHorarios(),this.convenioPlanoService.getExameNaoCobertosPlano(m.id,this.domain).subscribe(_=>{_&&(this.exames=this.exames.filter(p=>!_.map(u=>u.exameId).includes(p.id)))})}},o=>{this.verifyError(o)})}verificarVariaveisUrl(){const o=this.route.snapshot.queryParams.convenio,i=this.route.snapshot.queryParams.plano,n=this.route.snapshot.queryParams.exames;parseInt(i)===this.model.planoParticular.id?(this.marcacaoService.particular=!0,this.marcacaoService.tipoConvenio=1):parseInt(i)===this.model.planoFidelidade.id&&(this.marcacaoService.particular=!0,this.marcacaoService.tipoConvenio=2),this.verificarConvenio(o),this.verificarPlano(i),this.verificarExames(n,i,o),this.sincronizarConvenioPlano()}verificarExames(o,i,n){if(o){this.model.exames=[],this.model.examesDomiciliares=[],this.model.examesNaoAgendaveis=[];const a=o.split(",");if(a.length>0){const d=new l.Tmq;d.examesId=a,d.convenioId=+n,d.planoId=+i,this.exameService.pacoteExames(this.domain,d).subscribe(r=>{r.forEach(c=>{const m=this.exames.find(_=>_.id===+c.id);m&&(m.exameIntegrado=c.exameIntegrado,this.onSelectExame(m,-1))}),this.model.exameIntegrado=this.model.exames.filter(c=>c.exameIntegrado).length>0||this.model.examesNaoAgendaveis.filter(c=>c.exameIntegrado).length>0,this.model.exameIntegrado&&(this.model.examesPacotes=[],d.examesId.forEach(c=>{if(!(this.model.exames.filter(_=>_.id===+c).length>0||this.model.examesNaoAgendaveis.filter(_=>_.id===+c).length>0)){const _=new l.TIN;_.id=+c,this.model.examesPacotes.push(_)}})),this.syncModel()})}}}goToPreferenciaMedico(o){this.model.exameIdSelected=o.id,this.syncModel(),this.router.navigate(["/marcacao/preferencia-medico"],{queryParamsHandling:"merge"})}validarDadosParaAbrirModal(){if(!(this.model.exames&&0!==this.model.exames.length||this.model.examesNaoAgendaveis&&0!==this.model.examesNaoAgendaveis.length))return this.modalAlertService.open("error","Aten\xe7\xe3o","Informe um ou mais exames para continuar","button"),!1;this.validarConvenioSelecionado()&&(this.model.exames.length+this.model.examesNaoAgendaveis.length<this.model.totalExamesLidosOcr?this.confirmationService.confirm({message:"Existem exames identificados pelo OCR, por\xe9m n\xe3o foram selecionados para agendamento. Deseja continuar?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.openModalTipoAgendamento()}}):this.openModalTipoAgendamento())}openModalTipoAgendamento(){const o=[],i=[];this.model.exames.forEach(n=>{o.push(n)}),this.model.examesNaoAgendaveis.forEach(n=>{i.push(n)}),o.length>=1&&i.length>=1||o.length>1&&0==i.length?this.tipoAgendamentoModal="visible":(1==o.length||i.length>=1)&&this.goToNextStep()}tipoAgendamento(){this.tipoAgendamentoModal="","junto"==this.tipoAgendamentoValue?(this.marcacaoService.fluxoAgendamento=ge.g.TodosJuntos,this.goToNextStep()):(this.model.exames=this.model.exames.filter(o=>!1!==o.agendavelAg),this.model.examesNaoAgendaveis=this.model.examesNaoAgendaveis.filter(o=>!1!==o.agendavelAg),this.model.examesDomiciliares=this.model.examesDomiciliares.filter(o=>!1!==o.agendavelAg),this.marcacaoService.fluxoAgendamento=ge.g.Individual,this.syncModel(),this.getDataLayer("exame","Exame | Unidade"),this.router.navigate(["/marcacao/exame-individual"])),this.syncModel(),this.tipoAgendamentoValue=""}goToPreviousStep(){this.getDataLayer("exame","Exame | Convenio-Plano"),this.router.navigate(["/marcacao/home"],{queryParamsHandling:"merge"})}goToNextStep(){if(this.model.exames=this.model.exames.filter(o=>!1!==o.agendavelAg),this.model.examesNaoAgendaveis=this.model.examesNaoAgendaveis.filter(o=>!1!==o.agendavelAg),this.model.examesDomiciliares=this.model.examesDomiciliares.filter(o=>!1!==o.agendavelAg),this.syncModel(),!(this.model.exames&&0!==this.model.exames.length||this.model.examesNaoAgendaveis&&0!==this.model.examesNaoAgendaveis.length))return this.modalAlertService.open("error","Aten\xe7\xe3o","Informe um ou mais exames para continuar","button"),!1;
1if(this.validarConvenioSelecionado()){if(this.marcacaoService.matriculaConvenio&&!this.validarMatricula(this.marcacaoService.matriculaConvenio,this.marcacaoService.convenio.mascaraMatricula))return void this.modalAlertService.open("warning","Aten\xe7\xe3o","Verifique a regra do campo matr\xedcula: "+this.marcacaoService.convenio.mensagem,"button");this.validaQtdeDeExamesPorEspecialidadeDia(),this.CriarOrcamento()}}validaQtdeDeExamesPorEspecialidadeDia(){var o=this;return(0,U.Z)(function*(){const i=o.model.exames.concat(o.model.examesNaoAgendaveis);try{const n=yield o.marcacaoService.getRestricaoQtdeExamePorEspecialidadeDia(o.domain,i);n?o.modalAlertService.open("warning","Aten\xe7\xe3o",n,"button"):o.validaExames()}catch(n){o.verifyError(n)}})()}validaExames(){let o=!0;this.examesComAgendamento=[];const i=this.user?this.user.usuarioSelecionado.prontuarioId:void 0;void 0!==i?this.exameService.getAgendamentos(i,this.domain).subscribe(n=>{this.stopLoading(),n&&(this.agendamentos=n,this.model.exames.forEach(a=>{a.permiteVariosAgendamentos||this.agendamentos.forEach(d=>{d.exameId===a.id&&(d.nomeExame=a.nome,this.examesComAgendamento.push(d),o=!1,this.displayExamesComRestricao=!0)})}),o&&(o=this.validarExames()),o&&(this.model.agendaItemSaida=[],this.syncModel(),this.goToAgenda()))},n=>{this.verifyError(n)}):(o&&(o=this.validarExames()),o&&(this.model.agendaItemSaida=[],this.syncModel(),this.goToAgenda()))}goToAgenda(){this.startLoading();const o=new l.oaE;o.latitude=this.lat,o.longitude=this.long,o.exames=this.model.exames,o.examesAc=this.model.examesNaoAgendaveis,o.origemRequisicao="autoagendamento",this.unidadeService.getUnidadesProximas(!1,this.domain,o).subscribe(i=>{const n=[];for(let a=0;a<i.length;a++){const d=this.unidades.filter(r=>r.id===i[a].id);d&&d.length>0&&(d[0].distancia=i[a].distancia,d[0].totalExamesCobertos=i[a].totalExamesCobertos,n.push(d[0]))}this.model.unidades=n,this.stopLoading(),this.goToUnidade()},i=>{this.verifyError(i)})}goToUnidade(){this.model.unidadesSelecionadas=[],this.syncModel(),this.getDataLayer("exame","Exame | Unidade"),this.router.navigate(["/marcacao/unidade"],{queryParamsHandling:"merge"})}prosseguir(){this.examesComAgendamento.forEach(o=>{this.model.exames.splice(this.model.exames.findIndex(i=>i.id===o.exameId),1)}),this.model.agendaItemSaida=[],this.goToNextStep()}onSelectExame(o,i){if(this.model.exames||(this.model.exames=[]),this.model.examesNaoAgendaveis||(this.model.examesNaoAgendaveis=[]),this.model.examesDomiciliares||(this.model.examesDomiciliares=[]),this.model.examesNaoPermitidos||(this.model.examesNaoPermitidos=[]),this.model.exames.find(d=>d.medico||d.preferenciaMedicoGenero))return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o \xe9 poss\xedvel agendar mais de um exame quando h\xe1 escolha de m\xe9dico!","button"),this.clearExame(),!1;let a=this.model.exames.find(d=>d.id===o.id);if(a||(a=this.model.examesNaoAgendaveis.find(d=>d.id===o.id)),a||(a=this.model.examesNaoPermitidos.find(d=>d.id===o.id)),a)i<0?this.modalAlertService.open("warning","Aten\xe7\xe3o","Esse exame j\xe1 foi adicionado na lista abaixo!","button"):a.pedidoAtendimentoIntegracaoOperadoraId=i;else{const d=new l.TIN;if(d.init(o),d.particular=this.model.particular,d.cobertoPeloConvenio=!0,o.agendavel?this.model.exames.push(d):this.model.examesNaoAgendaveis.push(d),o.coletaDomicilar&&this.model.examesDomiciliares.push(d),this.verificarAvisoDomiciliar(),this.exameNaoIdentificadoOcrSelecionado){let r=this.model.examesNaoIdentificadosOcr.find(c=>c===this.exameNaoIdentificadoOcrSelecionado);r&&(r.codigoPleres=o.codigo,r.adicionado=!0,r.idExamePleres=o.id,r.nomeExamePleres=o.nome)}}this.syncModel(),this.clearExame()}verificaSeExibe(o){let i=!1;return o?.forEach(n=>{n.exameIntegrado||(i=!0)}),i}clearExame(){this.selectedExame=null,this.setSubmitButtonFocus()}removeExame(o){var i;if(this.model.exames.find(n=>n.id===o.id)){this.model.exames.splice(this.model.exames.findIndex(a=>a===o),1),o.coletaDomicilar&&this.model.examesDomiciliares.splice(this.model.examesDomiciliares.findIndex(a=>a===o),1),this.verificarAvisoDomiciliar();let n=null===(i=this.model.examesNaoIdentificadosOcr)||void 0===i?void 0:i.find(a=>a.codigoPleres===o.codigo);n&&(n.adicionado=!1),0==this.model.examesNaoAgendaveis.length&&0==this.model.exames.length&&(this.model.leituraExamePorOcr=!1,this.model.examesNaoIdentificadosOcr=[]),this.syncModel()}}verificarAvisoDomiciliar(){var o;if(this.model.contemExameDomiciliar=!1,null!==(o=this.model.unidadeCD)&&void 0!==o&&o.ativa){if(this.model.examesDomiciliares.length>0){const i=[];this.model.contemExameDomiciliar=!0,this.model.examesDomiciliares.forEac
1h(n=>{i.push(n.taxaId)}),this.model.contemExameDomiciliar=!(i.filter((n,a,d)=>d.indexOf(n)===a).length>1)}this.model.exames.length>0&&this.model.exames.forEach(i=>{this.model.contemExameDomiciliar=this.model.contemExameDomiciliar&&i.coletaDomicilar})}}removeExamesLaboratoriais(){this.model.examesNaoAgendaveis.forEach(o=>{this.model.examesDomiciliares.splice(this.model.examesDomiciliares.findIndex(n=>n===o),1);let i=this.model.examesNaoIdentificadosOcr.find(n=>n.codigoPleres===o.codigo);i&&(i.adicionado=!1)}),this.model.examesNaoAgendaveis=this.model.examesNaoAgendaveis.filter(o=>o.exameIntegrado),0==this.model.examesNaoAgendaveis.length&&0==this.model.exames.length&&(this.model.leituraExamePorOcr=!1,this.model.examesNaoIdentificadosOcr=[]),this.syncModel()}removeExames(){this.model.exameIntegrado=!1,this.model.exames=this.model.exames.filter(o=>!o.exameIntegrado),this.model.examesNaoAgendaveis=this.model.examesNaoAgendaveis.filter(o=>!o.exameIntegrado),this.model.examesPacotes=[],this.model.examesAgendados=[],this.model.examesDomiciliares=[],this.syncModel()}contarVacinas(){return this.model.exames.filter(i=>"VACINA"===i.especialidade.toUpperCase()).length+this.model.examesNaoAgendaveis.filter(i=>"VACINA"===i.especialidade.toUpperCase()).length}contarExamesExcetoVacinas(){return this.model.exames.filter(i=>"VACINA"!==i.especialidade.toUpperCase()).length+this.model.examesNaoAgendaveis.filter(i=>"VACINA"!==i.especialidade.toUpperCase()).length}getDocumentosObrigatorios(){const o=203===this.model.convenio.id,i="VACINA"===this.model.examesDomiciliares[0].especialidade.toUpperCase();return o&&i?"o Documento de Identifica\xe7\xe3o":o&&!i?"o Documento de Identifica\xe7\xe3o e Pedido M\xe9dico":"o Documento de Identifica\xe7\xe3o, Carteirinha do Conv\xeanio e Pedido M\xe9dico"}syncModel(){this.model.exames.forEach(o=>{o.data=void 0,o.horario=void 0,o.unidade=void 0}),super.syncModel()}showMaisInformacoes(o){this.selectedMaisInformacoes=o}hideMaisInformacoes(){this.selectedMaisInformacoes=void 0}checkPedidoIntegracaoOperadora(o,i=!0){this.exameService.getExamesIntegracaoOperadora(o,this.domain).subscribe(n=>{this.verificandoPedidoExame=!1,this.stopLoading(),null!==n&&n.length>0&&(n.forEach(a=>{const d=this.exames.find(r=>r.id===a.exameId);d&&this.onSelectExame(d,a.pedidoAtendimentoIntegracaoOperadoraId)}),this.getAvisoIntegracaoOperadora()&&(this.model.exames.length>0||this.model.examesNaoAgendaveis.length>0)&&i&&this.modalAlertService.open("info","Aten\xe7\xe3o",this.getAvisoIntegracaoOperadora(),"button"))},n=>{this.verificandoPedidoExame=!1,this.verifyError(n)})}setPedidoIntegracaoOperadora(o){this.exameService.setExamesIntegracaoOperadora(this.domain,o).subscribe(i=>{this.verificandoPedidoExame=!1,this.stopLoading(),null!==i&&i.length>0&&(i.forEach(n=>{const a=this.exames.find(d=>d.id===n.exameId);a&&this.onSelectExame(a,n.pedidoAtendimentoIntegracaoOperadoraId)}),this.getAvisoIntegracaoOperadora()&&(this.model.exames.length>0||this.model.examesNaoAgendaveis.length>0)&&(this.verificandoPedidoExame=!1,this.modalAlertService.open("info","Aten\xe7\xe3o",this.getAvisoIntegracaoOperadora(),"button"))),this.isPrevent()&&this.checkPedidoIntegracaoOperadora(this.model.convenio.idIntegracaoOperadora,!1)},i=>{this.verificandoPedidoExame=!1,this.verifyError(i)})}getClassIconExame(o){return"VACINA"===o?"fas fa-syringe title-icon":"AN\xc1LISES CLINICAS"===o?"fas fa-vial title-icon":"fas fa-file-medical-alt title-icon"}getSuggestionsExames(o){var i=this;return(0,U.Z)(function*(){const n=[];i.lumiaAtiva?yield i.exameService.getBuscaInteligenteExames(o,i.domain).subscribe(a=>{a.forEach(d=>{const r=i.exames.find(c=>c.id===d.id);r&&(r.sinonimia=d.sinonimia,n.push(r))}),n.length&&(i.fExames=n)},()=>{i.getSuggestionsFilterd(o),i.lumiaAtiva=!1}):i.getSuggestionsFilterd(o)})()}getSuggestionsFilterd(o){this.fExames=this.exames;let i=o;this.fExames=this.exames.filter(n=>this.contains(n.nome,i)||n.sinonimias.findIndex(a=>this.contains(a,i))>-1)}removeExameLaboratorial(o){this.model.examesDomiciliares.splice(this.model.examesDomiciliares.findIndex(n=>n===o),1),this.model.examesNaoAgendaveis.splice(this.model.examesNaoAgendaveis.findIndex(n=>n===o),1);let i=this.model.examesNaoIdentificadosOcr.find(n=>n.codigoPleres===o.codigo);i&&(i.adicionado=!1),this.syncModel()}getTextoRemover(){return this.model.examesNaoAgendaveis.length>1?"Remover Todos":"Remover"}formatedTelefoneMarca(){const o=this.getTelefoneMarca();
1return o?"("+o.toString().substr(0,2)+") "+o.toString().substr(2,4)+"-"+o.toString().substr(6,4):void 0}getExamesNaoAgendaveisAg(){var o,i,n,a;const d=null===(i=null===(o=this.model)||void 0===o?void 0:o.exames)||void 0===i?void 0:i.filter(c=>!1===c.agendavelAg),r=null===(a=null===(n=this.model)||void 0===n?void 0:n.examesNaoAgendaveis)||void 0===a?void 0:a.filter(c=>!1===c.agendavelAg);return!(!d&&!r)&&d.concat(r).length>0}getTextoExamesNaoAgendaveisAg(){const o=this.model.exames.filter(r=>!1===r.agendavelAg),i=this.model.examesNaoAgendaveis.filter(r=>!1===r.agendavelAg),n=o.concat(i);let a="";if(n){n.forEach(c=>{a+=(""===a?"":", ")+c.nome});const r=a.lastIndexOf(", ");r>0&&(a=a.substr(0,r)+" e "+a.substr(r+2))}let d=this.getSetting("TextoExameNaoAgendavel");return d=d.replace("#exames#",a),"TextoExameNaoAgendavel"===d&&(d=1===n.length?"O exame "+a+" possui uma maior complexidade para a realiza\xe7\xe3o do agendamento. Infelizmente n\xe3o poder\xe1 ser agendado atrav\xe9s do portal. Por favor clique no bot\xe3o ao lado para agendar seu exame via WhatsApp.":"Os exames "+a+" possuem uma maior complexidade para a realiza\xe7\xe3o do agendamento. Infelizmente n\xe3o poder\xe3o ser agendados atrav\xe9s do portal. Por favor clique no bot\xe3o ao lado para agendar seus exames via WhatsApp."),d}onExameSelecionado(o){this.onSelectExame(o,-1)}onFileUpload(o){if(this.loadModelBase(),0===o.files.length)return!1;const i=o.files[0],n=i.type;if(null==n.match(/image\/*/)&&null==n.match(/application\/pdf/))return this.modalAlertService.open("warning","Aten\xe7\xe3o","Somente imagens e documentos em PDF s\xe3o suportados","button"),!1;this.renderFile(i,o.tipo)}renderFile(o,i){this.startLoading();const n=o.name,a=o.type,d=o.lastModified;try{const r=new FileReader;r.onload=c=>{this.documentoSevice.ocrEnviarPedidoMedico(this.domain,c.target.result).subscribe(_=>{var p,u;this.stopLoading(),this.model.leituraExamePorOcr=!0;let f=0;_&&_.length>0&&(this.model.examesNaoIdentificadosOcr=[],this.model.totalExamesLidosOcr=_[0].dados.exames.length,_[0].dados.exames.forEach(C=>{const x=this.exames.find(A=>{var P;return A.codigo.toUpperCase().trim()===(null===(P=C.codigo)||void 0===P?void 0:P.toUpperCase().trim())});x?(this.onExameSelecionado(x),f++):this.model.examesNaoIdentificadosOcr.push(C)}),console.log(this.model.examesNaoIdentificadosOcr),this.syncModel(),this.modalAlertService.open("success","Leitura do pedido m\xe9dico feita com sucesso!","Alguns exames podem n\xe3o ter sido identificados automaticamente. Por favor, revise a lista de exames antes de continuar. Caso algum exame esteja ausente, voc\xea pode adicion\xe1-lo manualmente. Total de exames encontrados no sistema: "+f+" Total de exames identificados no pedido m\xe9dico: "+_[0].dados.exames.length,"button")),null!==(u=null===(p=this.model)||void 0===p?void 0:p.documentos)&&void 0!==u&&u.find(C=>C.nome===n&&C.tipo===i)||this.compressFile(c.target.result,i,n,a,d,o,0,0,"")},_=>{this.verifyError(_)}),setTimeout(()=>{},2e3)},r.readAsDataURL(o)}catch(r){this.stopLoading(),this.verifyError(r)}}compressFile(o,i,n,a,d,r,c,m,_){var p=this;return(0,U.Z)(function*(){const u=new te.t({image:o.split(",")[1],tipo:i,fileName:n,mimeType:a,protocolo:c,prontuario:m,guidProtocolo:_,lastModified:d,file:r});if("application/pdf"===a){const f=yield p.documentosService.saveFile(u);f&&p.model.documentos.push(f)}else if(p.imageCompress.byteCount(o)/1048576>1)p.imageCompress.compressFile(o,-1,100,50).then(function(){var x=(0,U.Z)(function*(A){u.image=A.split(",")[1];const P=yield p.documentosService.saveFile(u);P&&(p.model.documentos||(p.model.documentos=[]),p.model.documentos.push(P),p.syncModel())});return function(A){return x.apply(this,arguments)}}()).catch(function(){var x=(0,U.Z)(function*(A){const P=yield p.documentosService.saveFile(u);P&&(p.model.documentos||(p.model.documentos=[]),p.model.documentos.push(P),p.syncModel())});return function(A){return x.apply(this,arguments)}}());else{const x=yield p.documentosService.saveFile(u);x&&(p.model.documentos||(p.model.documentos=[]),p.model.documentos.push(x),p.syncModel())}})()}identificarExame(o){this.textoPesquisa="",setTimeout(()=>{this.textoPesquisa=o.nome,this.exameNaoIdentificadoOcrSelecionado=o})}removerExamePeloOcr(o){let i=this.model.exames.find(n=>n.codigo===o.codigoPleres);i||(i=this.model.examesNaoAgendaveis.find(n=>n.codigo===o.codigoPleres)),this.removeExameLaboratorial(i)}getTextoExamesOcrLidos(){return"Exames identificados: "+(this.model.exames.length+this.model.examesNaoAgendaveis.length)+" de "+this.model.totalExamesLidosOcr}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(Z.YP))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-exame"]],hostBindings:function(o,i){1&o&&e.NdJ("resize",function(){return i.onResize()},!1,e.Jf7)},outputs:{typeHelpWhatsapp:"typeHelpWhatsapp"},features:[e._Bn([Z.YP]),e.qOj],decls:18,vars:8,consts:[[1,"row"],["class","col-12",4,"ngIf"],["class","col-12 mt-md-0 mb-150",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end"],["id","modelVoltar","type","button","class","btn btn-outline-primary",3,"click",4,"ngIf"],["class","btn btn-primary text-uppercase ms-3",3,"click",4,"ngIf"],[4,"ngIf"],[3,"value","onClose"],["exameIdentificado",""],["exameNaoIdentificado",""],["header","Confirmation","icon","pi pi-exclamation-triangle","acceptLabel","Sim","rejectLabel","N\xe3o"],[1,"col-12"],[1,"col-12","mt-md-0","mb-150"],[1,"p-3","mt-4"],[1,"col-12","p-fluid"],[3,"exames","lumiaAtiva","textoBusca","exameSelecionado","uploadFile"],["class","row",4,"ngIf","ngIfElse"],["semTabs",""],[3,"header"],[4,"ngTemplateOutlet"],["ngIf","!this.model.leituraExamePorOcr",4,"ngTemplateOutlet"],["ngIf","!this.model.leituraExamePorOcr"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary",3,"click"],[1,"fas","fa-home","me-1"],[1,"btn","btn-primary","text-uppercase","ms-3",3,"click"],["header","Como gostaria de agendar seus exames?",3,"visible","modal","responsive","baseZIndex","closable","visibleChange"],[1,"row","mt-3"],[1,"col-md-1"],["value","junto","id","radio-box-agendamento-1",3,"ngModel","ngModelChange","click"],[1,"col-md-11"],[1,"fw-bold"],["value","individual","id","radio-box-agendamento-2",3,"ngModel","ngModelChange","click"],["header","ATEN\xc7\xc3O",3,"visible","modal","responsive","baseZIndex","closable","visibleChange"],["class","row mt-3",4,"ngFor","ngForOf"],["class","row mt-3",4,"ngIf"],["id","modelVoltarRestricao","type","button",1,"btn","btn-secondary",3,"disabled","click"],["id","modelProsseguirRestricao","type","button","class","btn btn-primary text-uppercase",3,"disabled","click",4,"ngIf"],["id","modelProsseguirRestricao","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[1,"col-12","p-fluid","mt-0","pt-0"],["class","text-start text-warning",4,"ngIf"],[4,"ngFor","ngForOf"],["id","selectedExamesDomiciliares","styleClass","dark",4,"ngIf"],["id","ExamesNaoDisponivelAgendamento","styleClass","dark",4,"ngIf"],[1,"text-start","text-warning"],[3,"id",4,"ngIf"],[3,"id"],[1,"row","position-relative"],["title","Remover",1,"float-end","times-sm-right","no-button","text-end",3,"click"],[1,"fas","fa-times","dark"],[1,"col-lg-1","col-md-1","col-sm-12","text-center","title"],[3,"ngClass"],[1,"col-lg-6","col-md-6","col-sm-12","text-lg-start","text-md-lg","text-sm-center1","title"],["class","text-warning",4,"ngIf"],["href","javascript:void(0)","class","btn btn-secondary btn-sm mt-1",3,"click",4,"ngIf"],[1,"col-lg-3","col-md-3","col-sm-12","p-fluid","text-center"],[1,"col-lg-2","col-md-2","col-sm-12","text-end"],["href","javascript:void(0)",1,"btn","btn-sm","btn-danger","text-white","d-none","d-lg-inline-block","text-uppercase",3,"click"],[1,"fas","fa-times","me-1"],[1,"fas","fa-exclamation","text-danger","me-2"],[1,"text-warning"],["href","javascript:void(0)",1,"btn","btn-secondary","btn-sm","mt-1",3,"click"],[1,"fas","fa-info-circle"],[1,"hand-underline",3,"click"],[1,"m-0"],[1,"col-lg-1","col-md-1","col-sm-12","p-fluid","text-center"],[1,"col-lg-9","col-md-9","col-sm-12","text-start","pb-1"],[1,"col-lg-2","col-md-2","col-sm-12","p-fluid","text-end","p-fluid","text-end"],["class","badge-text exame-badge badge badge-sm px-3 py-1 bg-light d-lg-inline-block text-uppercase me-2 mb-2",4,"ngIf"],[1,"badge-text","exame-badge","badge","badge-sm","px-3","py-1","bg-light","d-lg-inline-block","text-uppercase","me-2","mb-2"],[1,"fas","fa-lg","fa-times","hand",3,"click"],[1,"fas","fa-list","title-icon"],[1,"col-lg-2","col-md-2","col-sm-12","p-fluid","text-end","p-fluid"],["href","javascript:void(0)",1,"btn","btn-sm","btn-danger","d-none","d-lg-inline-block","text-uppercase",3,"click"],[1,"fas","fa-times"],["class","badge-text badge badge-sm bg-light px-3 py-1 d-lg-inline-block text-uppercase me-2 mb-2",4,"ngIf"],[1,"badge-text","badge","badge-sm","bg-light","px-3","py-1","d-lg-inline-block","text-uppercase","me-2","mb-2"],["id","selectedExamesDomiciliares","styleClass","dark"],[1,"col-xl-1","col-lg-1","col-md-1","col-sm-12","text-center","vertical-align-center","text-sm-center1"],[1,"fas","fa-home","title-icon","text-primary"],[1,"col-xl-11","col-lg-11","col-md-11","col-sm-12","text-start","text-sm-center1"],["id","ExamesNaoDisponivelAgendamento","styleClass","dark"],[1,"fas","fa-exclamation","title-icon","text-danger"],[1,"col-xl-8","col-lg-8","col-md-8","col-sm-12","text-start","text-sm-center1"],[1,"col-xl-3","col-lg-3","col-md-3","col-sm-12","text-end","text-sm-center1"],["typeHelpWhatsapp","inline"],[1,"col-12","p-fluid","text-md-end","text-sm-center1"],[1,"text-start"],[3,"id","styleClass","click"],[1,"col-lg-12","col-md-12","col-sm-12","text-lg-start","text-md-lg","title","pt-0","pb-0"],[1,"col-10","text-start"],["class","text-small",4,"ngIf"],[1,"col-2","text-end","pr-2"],["class","",4,"ngIf"],[1,"text-small"],[1,""],[1,"fas","fa","fa-check"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Lo,2,1,"div",1),e.YNc(2,Vo,10,5,"div",2),e.qZA(),e.TgZ(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6),e.YNc(7,Bo,3,0,"button",7),e.YNc(8,zo,2,0,"span",8),e.qZA()()()(),e.YNc(9,jo,18,10,"div",9),e.YNc(10,ii,13,13,"div",9),e.TgZ(11,"app-mais-informacao",10),e.NdJ("onClose",function(){return i.hideMaisInformacoes()}
1),e.qZA(),e.YNc(12,bi,7,6,"ng-template",null,11,e.W1O),e.YNc(14,Ii,5,1,"ng-template",null,12,e.W1O),e.TgZ(16,"app-mais-informacao",10),e.NdJ("onClose",function(){return i.hideMaisInformacoes()}),e.qZA(),e._UZ(17,"p-confirmDialog",13)),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(5),e.Q6J("ngIf",i.showHomeButton),e.xp6(1),e.Q6J("ngIf",!i.isLoading),e.xp6(1),e.Q6J("ngIf",i.tipoAgendamentoModal),e.xp6(1),e.Q6J("ngIf",i.displayExamesComRestricao),e.xp6(1),e.Q6J("value",i.selectedMaisInformacoes),e.xp6(5),e.Q6J("value",i.selectedMaisInformacoes))},dependencies:[h.mk,h.sg,h.O5,h.tP,v.JJ,v.On,y.Z,oe.EU,k.V,F.Q,B.xf,B.x4,bo,Do,Qo],styles:["@media screen and (max-width: 768px){::ng-deep .p-tabview .p-tabview-nav li .p-tabview-nav-link{font-size:8px!important;padding:.5rem .6rem!important}}@media screen and (max-width: 480px){::ng-deep .p-tabview .p-tabview-nav li .p-tabview-nav-link{font-size:6px!important;padding:.4rem!important}}@media screen and (max-width: 768px){::ng-deep .p-tabview .p-tabview-nav li .p-tabview-nav-link{white-space:normal!important;text-align:center;line-height:1.2}}.exame-badge{max-width:100%;white-space:normal!important;word-break:break-word;overflow-wrap:break-word;line-height:1.2}@media screen and (max-width: 768px){.exame-badge{max-width:100%;white-space:normal!important;word-break:break-word;overflow-wrap:break-word;line-height:1.2;display:inline-flex!important;justify-content:flex-start;text-align:left}}.cardWarning{background-color:#ffffe0!important;border-color:var(--gray-500);color:var(--gray-700);cursor:pointer}.cardWarning .title{font-size:18px;font-weight:700;color:var(--indigo)}.cardWarning .title em{font-size:30px}.cardWarning .title em.small-size{font-size:20px}.cardSuccess{background-color:#90ee90!important;border-color:var(--gray-500);color:var(--gray-700);cursor:pointer}.cardSuccess .title{font-size:18px;font-weight:700;color:var(--indigo)}.cardSuccess .title em{font-size:30px}.cardSuccess .title em.small-size{font-size:20px}\n"],encapsulation:2}),t})();var D=g(6928),Ne=g(1111),Y=g(3520),z=g(5362),he=g(7472),Se=g(3238);function wi(t,s){if(1&t&&(e.TgZ(0,"div",8),e._uU(1),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Oqu(o.mensagem)}}function Mi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",20)(1,"p-calendar",21),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.respostaSelecionada=n)}),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngModel",o.respostaSelecionada)("showTime",!0)("locale",i.locale)("dateFormat",i.locale.dateFormat)}}function Ui(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",22)(1,"p-calendar",23),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.respostaSelecionada=n)}),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngModel",o.respostaSelecionada)("locale",i.locale)("dateFormat",i.locale.dateFormat)}}function Ni(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",22)(1,"p-calendar",24),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.respostaSelecionada=n)}),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngModel",o.respostaSelecionada)("timeOnly",!0)("locale",i.locale)("dateFormat",i.locale.dateFormat)}}function Si(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",22)(1,"input",25),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.respostaSelecionada=n)}),e.qZA()()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngModel",o.respostaSelecionada)}}function yi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",22)(1,"p-selectButton",26),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.respostaSelecionada=n)}),e.qZA()()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("options",o.questaoPreparoOpcao)("ngModel",o.respostaSelecionada)}}function qi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",22)(1,"p-spinner",27),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.respostaSelecionada=n)}),e.qZA()()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngModel",o.respostaSelecionada)("min",0)}}function Ji(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",22)(1,"p-selectButton",28),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.respostaSelecionada=n)}),e.qZA()()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("options",o.questaoPreparoOpcao)("ngModel",o.respostaSelecionada)}}function ki(t,s){if(1&t&&(e.TgZ(0,"div",15)(1,"div",8)(2,"p-panel",16)(3,"p-header")(4,"div",15)(5,"div",17),e._uU(6),e.qZA(),e.YNc(7,Mi,2,4,"div",18),e.YNc(8,Ui,2,3,"div",19),e.YNc(9,Ni,2,4,"div",19),e.YNc(10,Si,2,1,"div",19),e.YNc(11,yi,2,2,"div",19),e.YNc(12,qi,2,2,"div",19),e.YNc(13,Ji,2,2,"div",19),e.qZA()()()()()),2&t){const o=s.$implicit;e.xp6(2),e.Q6J("collapsed",!(o.existeRestricao&&o.respostas)),e.xp6(4),e.Oqu(o.questao),e.xp6(1),e.Q6J("ngIf",1==o.tipoResposta),e.xp6(1),e.Q6J("ngIf",2==o.tipoResposta),e.xp6(1),e.Q6J("ngIf",3==o.tipoResposta),e.xp6(1),e.Q6J("ngIf",4==o.tipoResposta),e.xp6(1),e.Q6J("ngIf",5==o.tipoResposta),e.xp6(1),e.Q6J("ngIf",6==o.tipoResposta),e.xp6(1),e.Q6J("ngIf",7==o.tipoResposta)}}function Di(t,s){1&t&&(e.TgZ(0,"div",15)(1,"div",8)(2,"p",29),e._uU(3,"N\xe3o existe(m) questionarios(s) para este exame"),e.qZA()()())}function Fi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"fieldset")(1,"legend"),e._uU(2," Confirma\xe7\xe3o de Dados Pessoais "),e.qZA(),e.TgZ(3,"p-card",30)(4,"p-header")(5,"h6"),e._UZ(6,"em",31),e._uU(7,"\xa0 Dados Complementares "),e.qZA()(),e.TgZ(8,"div")(9,"div",15)(10,"div",32)(11,"span",33)(12,"input",34),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.nomeCompleto=n)}),e.qZA(),e.TgZ(13,"label",35),e._uU(14,"Nome Completo"),e.qZA()()(),e.TgZ(15,"div",36)(16,"span",33)(17,"p-inputMask",37),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.cpf=n)}),e.qZA(),e.TgZ(18,"label",38),e._uU(19,"CPF"),e.qZA()()(),e.TgZ(20,"div",39)(21,"p-selectButton",40),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.genero=n)}),e.qZA()()(),e.TgZ(22,"div",15)(23,"div",36)(24,"span",33)(25,"p-inputMask",41),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.celular=n)}),e.qZA(),e.TgZ(26,"label"),e._uU(27,"Celular"),e.qZA()()(),e.TgZ(28,"div",42)(29,"span",33)(30,"p-inputMask",43),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.dadosComplementares.cep=n)})("onBlur",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.buscarEnderecoPorCep(n.registro.dadosComplementares.cep))}),e.qZA(),e.TgZ(31,"label"),e._uU(32,"CEP"),e.qZA()()(),e.TgZ(33,"div",42)(34,"span",33)(35,"input",44),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.dadosComplementares.numero=n)}),e.qZA(),e.TgZ(36,"label"),e._uU(37,"N\xfamero"),e.qZA()()(),e.TgZ(38,"div",32)(39,"span",33)(40,"input",44),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.dadosComplementares.complemento=n)}),e.qZA(),e.TgZ(41,"label"),e._uU(42,"Complemento"),e.qZA()()()(),e.TgZ(43,"div",15)(44,"div",39)(45,"span",33)(46,"input",45),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.dadosComplementares.endereco=n)}),e.qZA(),e.TgZ(47,"label"),e._uU(48,"Endere\xe7o"),e.qZA()()(),e.TgZ(49,"div",36)(50,"span",33)(51,"input",45),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.dadosComplementares.bairro=n)}),e.qZA(),e.TgZ(52,"label"),e._uU(53,"Bairro"),e.qZA()()(),e.TgZ(54,"div",36)(55,"span",33)(56,"input",45),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.dadosComplementares.cidade=n)}),e.qZA(),e.TgZ(57,"label"),e._uU(58,"Cidade"),e.qZA()()(),e.TgZ(59,"div",42)(60,"span",33)(61,"input",46),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.registro.dadosComplementares.estado=n)}),e.qZA(),e.TgZ(62,"label"),e._uU(63,"Estado"),e.qZA()()()()()()()}if(2&t){const o=e.oxw(2);e.xp6(12),e.Q6J("ngModel",o.registro.nomeCompleto)("setfocus",!0)("disabled",!0),e.xp6(
15),e.Q6J("ngModel",o.registro.cpf)("mask","999.999.999-99")("disabled",!0),e.xp6(4),e.Q6J("ngModel",o.registro.genero)("options",o.generos),e.xp6(4),e.Q6J("ngModel",o.registro.celular)("mask","(99) 99999-9999"),e.xp6(5),e.Q6J("ngModel",o.registro.dadosComplementares.cep)("mask","99999999"),e.xp6(5),e.Q6J("ngModel",o.registro.dadosComplementares.numero),e.xp6(5),e.Q6J("ngModel",o.registro.dadosComplementares.complemento),e.xp6(6),e.Q6J("ngModel",o.registro.dadosComplementares.endereco)("disabled",o.enabledControles),e.xp6(5),e.Q6J("ngModel",o.registro.dadosComplementares.bairro)("disabled",o.enabledControles),e.xp6(5),e.Q6J("ngModel",o.registro.dadosComplementares.cidade)("disabled",o.enabledControles),e.xp6(5),e.Q6J("ngModel",o.registro.dadosComplementares.estado)("disabled",o.enabledControles)}}function Oi(t,s){if(1&t&&(e.TgZ(0,"div",8)(1,"fieldset",9)(2,"legend"),e._uU(3,"Possui alguma restri\xe7\xe3o?"),e.qZA(),e.TgZ(4,"p-card",10)(5,"p-header")(6,"h6",8),e._UZ(7,"em",11),e._uU(8,"\xa0Question\xe1rio "),e.qZA()(),e.YNc(9,ki,14,9,"div",12),e.qZA(),e.YNc(10,Di,4,0,"div",13),e.qZA(),e.TgZ(11,"p"),e._uU(12,"\xa0"),e.qZA(),e.YNc(13,Fi,64,22,"fieldset",14),e.qZA()),2&t){const o=e.oxw();e.xp6(9),e.Q6J("ngForOf",o.questionarios),e.xp6(1),e.Q6J("ngIf",!o.questionarios||0===o.questionarios.length),e.xp6(3),e.Q6J("ngIf",o.exibeConfirmacao&&o.questionarios&&o.questionarios.length>0)}}function Hi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",47),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep())}),e._uU(1,"Salvar"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}let Qi=(()=>{class t extends w.a{constructor(o){super(o),this.questionarioRespondido=!1,this.display=!0,this.enabledControles=!0,this.exibeConfirmacao=!0,this.router=o.get(b.F0),this.questionarioService=o.get(l.uhV),this.homeService=o.get(l.igG),this.registro=new l.KEf}ngOnInit(){this.verificaPermissaoTela(),this.questionarioRespondido=!1,this.mensagem="Carregando Questionario...",this.changeStep(0),this.clear(),this.load()}clear(){this.questionarios=[],this.respostas=[]}load(){this.getQuestionario(this.modelFinished.exameIdSelected,this.modelFinished.protocoloIdSelected)}getQuestionario(o,i){this.startLoading(!0),this.questionarioService.getQuestionario(o,i,this.user.usuarioSelecionado.username.toString(),this.domain).subscribe(n=>{this.questionarios=n,this.questionarios.forEach(a=>{if(a.respostaSelecionada&&(1===a.tipoResposta||2===a.tipoResposta||3===a.tipoResposta)&&(a.respostaSelecionada=new Date(a.respostaSelecionada)),a.respostaSelecionada&&6===a.tipoResposta&&(a.respostaSelecionada=+a.respostaSelecionada),a.respostaSelecionada&&7===a.tipoResposta&&(a.respostaSelecionada=a.questaoPreparoOpcao.find(d=>d.resposta===a.respostaSelecionada.resposta)),a.respostaSelecionada&&5===a.tipoResposta){const d=a.respostaSelecionada;a.respostaSelecionada=[],d.forEach(r=>{const c=a.questaoPreparoOpcao.find(m=>m.resposta===r.resposta);a.respostaSelecionada.push(c)})}}),this.getRegistro()},n=>{this.verifyError(n)})}getRegistro(){var i=D.y.getItem("titular-dependente");if(null===i){T.G.getItem("prontuario")}else i.indexOf("{")>=0&&JSON.parse(i);this.registroService.getRegistroProntuario(this.domain).subscribe(n=>{if(n){this.registro=n,n.dadosComplementares||(this.registro.dadosComplementares=new l.X_S,this.exibeConfirmacao=!0);const a=this.registro.dadosComplementares;a&&a.bairro&&a.cep&&a.cidade&&a.endereco&&a.estado&&a.numero&&this.registro.celular&&(this.exibeConfirmacao=!1)}else this.exibeConfirmacao=!1;this.stopLoading()})}setResposta(){this.mensagem="Salvando Altera\xe7\xf5es...",this.startLoading(!0);const o=this.getSetRespostaModel();var i=D.y.getItem("titular-dependente");if(i.indexOf("{")>=0){let n=JSON.parse(i);o.idProntuario=n.id}else o.idProntuario=parseInt(i);this.questionarioService.setResposta(this.domain,o).subscribe(()=>{this.stopLoading(),this.modelFinished.questionarioRespondido=this.questionarioRespondido,this.syncModelFinished(),this.router.navigate([this.routeState.getPreviousUrl(
1)],{queryParamsHandling:"merge"}),this.modalAlertService.open("success","Aten\xe7\xe3o","Altera\xe7\xf5es realizadas com sucesso!","timer")},n=>{this.verifyError(n)})}updateRegistro(){this.mensagem="Salvando Altera\xe7\xf5es...",this.startLoading(!0),this.registroService.updateRegistro(this.domain,this.registro).subscribe(()=>{this.setResposta()},o=>{this.verifyError(o)})}goToPreviousStep(){this.router.navigate([this.routeState.getPreviousUrl()])}goToNextStep(){this.exibeConfirmacao?this.validate()&&this.updateRegistro():this.setResposta()}syncModelFinished(){this.modelFinished.questionarios=this.questionarios,super.syncModelFinished()}getSetRespostaModel(){this.respostas=[],this.questionarios.forEach(i=>{const n=new l.Rl9;n.protocoloId=this.modelFinished.protocoloIdSelected,n.questaoPreparoId=i.questaoPreparoId,n.questaoPreparoItemId=i.questaoPreparoItemId,i.respostaSelecionada&&(n.resposta=1===i.tipoResposta||2===i.tipoResposta||3===i.tipoResposta?this.getFormatDate(i.respostaSelecionada,"YYYY-MM-DD HH:mm:ss"):5===i.tipoResposta?i.respostaSelecionada.map(a=>a.resposta).join("|"):7===i.tipoResposta?i.respostaSelecionada.resposta.toString():i.respostaSelecionada.toString(),this.questionarioRespondido=!0),this.respostas.push(n)});const o=new l.OhS;return o.questaoResposta=this.respostas,o.questionario=this.questionarios,o}buscarEnderecoPorCep(o){try{this.registroService.getEnderecoPorCEP(o,this.domain).subscribe(i=>{this.registro&&(this.registro.dadosComplementares=i,this.enabledControles=!!(i.bairro&&i.cep&&i.cidade&&i.endereco&&i.estado))})}catch{this.enabledControles=!1}}validate(){return this.registro.celular?this.registro.celular&&0==+this.clearMask(this.registro.celular)?(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe um Celular v\xe1lido","button"),!1):this.registro.residencial&&0==+this.clearMask(this.registro.residencial)?(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe um Telefone v\xe1lido","button"),!1):this.registro.dadosComplementares.cep?this.registro.dadosComplementares.numero?this.registro.dadosComplementares.endereco?this.registro.dadosComplementares.bairro?this.registro.dadosComplementares.cidade?!!this.registro.dadosComplementares.estado||(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Estado para continuar","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe a Cidade para continuar","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Bairro para continuar","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Endere\xe7o para continuar","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o N\xfamero para continuar","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Cep para continuar","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Celular para continuar","button"),!1)}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-questionario"]],features:[e.qOj],decls:10,vars:4,consts:[[1,"row","mt-3"],["class","col-12",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"],["id","modelContinuar","type","button","class","btn btn-primary text-uppercase",3,"disabled","click",4,"ngIf"],[1,"col-12"],[1,"p-3"],["styleClass","card-outline-dark-content p-2","id","cardQuestionario"],[1,"fas","fa-list-alt"],["class","row",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],[4,"ngIf"],[1,"row"],[3,"collapsed"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-12","text-start","w-100"],["class","col-xl-6 col-lg-6 col-md-6 col-sm-12 text-end text-sm-center1 w-100",4,"ngIf"],["class","col-xl-6 col-lg-6 col-md-6 col-sm-12 text-end w-100 text-sm-center1",4,"ngIf"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-12","text-end","text-sm-center1","w-100"],[3,"ngModel","showTime","locale","dateFormat","ngModelChange"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-12","text-end","w-100","text-sm-center1"],[3,"ngModel","locale","dateFormat","ngModelChange"],[3,"ngModel","timeOnly","locale","dateFormat","ngModelChange"],["type","text","pInputText","",1,"w-100",3,"ngModel","ngModelChange"],["o
1ptionLabel","label","multiple","multiple",3,"options","ngModel","ngModelChange"],[3,"ngModel","min","ngModelChange"],["optionLabel","label",3,"options","ngModel","ngModelChange"],[1,"text-danger","small"],["styleClass","card-outline-dark-content","id","cardQuestionario"],[1,"fas","fa-user-alt"],[1,"col-xl-5","col-lg-5","col-md-5","col-sm-5","col-12"],[1,"p-float-label","p-fluid"],["type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","setfocus","disabled","ngModelChange"],["for","modelNomeCompleto"],[1,"col-xl-3","col-lg-3","col-md-3","col-sm-3","col-12"],[3,"ngModel","mask","disabled","ngModelChange"],["for","modelCpf"],[1,"col-xl-4","col-lg-4","col-md-4","col-sm-4","col-12"],[3,"ngModel","options","ngModelChange"],[3,"ngModel","mask","ngModelChange"],[1,"col-xl-2","col-lg-2","col-md-2","col-sm-2","col-12"],[3,"ngModel","mask","ngModelChange","onBlur"],["type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","ngModelChange"],["type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","disabled","ngModelChange"],["type","text","size","300","maxlength","2","pInputText","",1,"form-control","text-uppercase",3,"ngModel","disabled","ngModelChange"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,wi,2,1,"div",1),e.YNc(2,Oi,14,3,"div",1),e.qZA(),e.TgZ(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"button",6),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(8,"Voltar"),e.qZA(),e.YNc(9,Hi,2,1,"button",7),e.qZA()()()()),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(5),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("ngIf",i.questionarios&&i.questionarios.length>0))},dependencies:[h.sg,h.O5,Ne.G,v.Fj,v.JJ,v.nD,v.On,H.o,Y.vy,Z.h4,y.Z,z.UN,V.f,he.s,Se.$j],encapsulation:2}),t})();function Li(t,s){1&t&&(e.TgZ(0,"div",8),e._uU(1," Carregando... "),e.qZA())}function Ri(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",18)(1,"div",0)(2,"div",19),e._uU(3),e.qZA(),e.TgZ(4,"div",20)(5,"button",21),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(2);return e.KtG(d.removeMedico(a))}),e._UZ(6,"em",22),e.qZA(),e.TgZ(7,"a",23),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(2);return e.KtG(d.removeMedico(a))}),e._UZ(8,"em",24),e._uU(9,"Remover"),e.qZA()()()()}if(2&t){const o=s.$implicit;e.MGl("id","selectedMedicos",o.id,""),e.xp6(3),e.hij(" ",o.nome," ")}}function Yi(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",8)(1,"fieldset",9)(2,"legend"),e._uU(3," Prefer\xeancia de M\xe9dico "),e.qZA(),e.TgZ(4,"div",0)(5,"div",10)(6,"span"),e._uU(7),e.qZA()()(),e.TgZ(8,"div",0)(9,"div",8)(10,"p-selectButton",11),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.selectedExame.preferenciaMedicoGenero=n)})("onChange",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.removeAllMedicos())})("onOptionClick",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.removerOpcao())}),e.qZA()()(),e.TgZ(11,"div",12)(12,"div",13)(13,"div",14)(14,"p-autoComplete",15),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.selectedMedico=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.getSuggestions(n,"fMedicos","medicos","nome"))})("onSelect",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.onSelectedMedico(n))}),e.qZA()()()(),e.TgZ(15,"div",0)(16,"div",16),e.YNc(17,Ri,10,2,"p-card",17),e.qZA()()()()}if(2&t){const o=e.oxw();e.xp6(7),e.Oqu(o.selectedExame.nome),e.xp6(3),e.Q6J("options",o.generos)("ngModel",o.selectedExame.preferenciaMedicoGenero),e.xp6(4),e.Q6J("ngModel",o.selectedMedico)("suggestions",o.fMedicos),e.xp6(3),e.Q6J("ngForOf",o.selectedMedicos)}}let Gi=(()=>{class t extends w.a{constructor(o){super(o),this.preferencialSexo=-1,this.router=o.get(b.F0),this.route=o.get(b.gz),this.preferenciaMedicoService=o.get(l.B4n)}ngOnInit(){this.exameId=this.model.exameIdSelected,this.changeStep(1),this.clear(),this.load(),this.selectedExame.preferenciaMedicoGenero>0&&(this.preferencialSexo=this.selectedExame.preferenciaMedicoGenero)}clear(){this.medicos=[],this.selectedMedicos=[],this.selectedExame=new l.TIN}load(){this.verificaPermissaoTela(),this.get()}get(){this.getMedicos(),this.exameIndex=this.model.exames.findIndex(o=>o.id===this.exameId),this.selectedExame=this.model.exames[this.exameIndex],this.generos=this.generos.filter(o=>null!==o.value)}getMedicos(){this.startLoading(!0),this.preferenciaMedicoService.getMedicos(this.exameId,this.domain).subscribe(o=>{this.stopLoading(),o&&(this.medicos=o,this.loadModel())},o=>{this.verifyError(o)})}loadModel(){const o=this.selectedExame.medico;o&&this.onSelectedMedico(o)}goToNextStep(){this.syncModel(),this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}goToPreviousStep(){this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}onSelectedMedico(o){const i=new l.Aq2;i.init(o),this.selectedMedicos=[],this.selectedMedicos.push(i),this.selectedMedico=null,this.selectedExame.preferenciaMedicoGenero=0,this.selectedExame.medico=i}removeMedico(o){this.selectedMedicos.find(i=>i===o)&&this.selectedMedicos.splice(this.selectedMedicos.findIndex(i=>i===o),1),this.selectedExame.medico=null}removeAllMedicos(){this.selectedMedicos=[],this.selectedExame.medico=null}removerOpcao(){-1===this.preferencialSexo||null===this.preferencialSexo||this.preferencialSexo!==this.selectedExame.preferenciaMedicoGenero?this.preferencialSexo=this.selectedExame.preferenciaMedicoGenero:this.selectedExame.preferenciaMedicoGenero=0}syncModel(){const o=new l.TIN;o.init(this.selectedExame),this.model.exames[this.exameIndex]=o,super.syncModel()}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-preferencia-medico"]],features:[e.qOj],decls:11,vars:4,consts:[[1,"row"],["class","col-12",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[1,"col-12"],[1,"p-3"],[1,"col-12","text-primary","text-end"],["id","modelGenero","name","modelGenero",3,"options","ngModel","ngModelChange","onChange","onOptionClick"],[1,"row","mt-3"],[1,"col-md-12","p-fluid"],["autocompleteSearchIcon","M\xe9dico"],["id","preferenciaSelecionarMedico","name","preferenciaSelecionarMedico","field","nome","placeholder","Digite o nome de um m\xe9dico espec\xedfico",1,"p-autocomplete",3,"ngModel","suggestions","ngModelChange","completeMethod","onSelect"],[1,"col-12","p-fluid"],[3,"id",4,"ngFor","ngForOf"],[3,"id"],[1,"col-10","text-start"],[1,"col-2","p-fluid","text-end","inputs"],["type","button","title","Remover",1,"no-button","d-inline-block","d-lg-none",3,"click"],[1,"fas","fa-times","dark"],["href","javascript:void(0)",1,"btn","btn-sm","btn-danger","text-white","d-none","d-lg-inline-block","text-uppercase",3,"click"],[1,"fas","fa-times","me-2"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Li,2,0,"div",1),e.YNc(2,Yi,18,6,"div",1),e.qZA(),e.TgZ(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"button",6),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(8,"Voltar"),e.qZA(),e.TgZ(9,"button",7),e.NdJ("click",function(){return i.goToNextStep()}),e._uU(10,"Selecionar"),e.qZA()()()()()),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(
15),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("disabled",i.isLoading))},dependencies:[h.sg,h.O5,$.j,v.JJ,v.On,L.Qc,y.Z,z.UN],encapsulation:2}),t})();var ye=g(100),Ki=g(9753),se=g(2210);function $i(t,s){1&t&&(e.TgZ(0,"div",8),e._uU(1," Endere\xe7o "),e.qZA())}function Vi(t,s){if(1&t&&(e.TgZ(0,"div",4),e._uU(1),e.qZA()),2&t){const o=e.oxw(2);e.xp6(1),e.hij(" ",o.model.endereco," ")}}function Bi(t,s){1&t&&(e.TgZ(0,"div",8),e._uU(1," Hor\xe1rios de Atendimento "),e.qZA())}function zi(t,s){if(1&t&&(e.TgZ(0,"div",4),e._uU(1),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.hij(" ",o.value," ")}}function ji(t,s){1&t&&(e.TgZ(0,"div",8),e._uU(1," Coleta de Exames de an\xe1lises cl\xednicas e entrega de material "),e.qZA())}function Wi(t,s){if(1&t&&(e.TgZ(0,"div",4),e._uU(1),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.hij(" ",o.value," ")}}function Xi(t,s){1&t&&(e.TgZ(0,"div",8),e._uU(1," Retirada de Exames "),e.qZA())}function et(t,s){if(1&t&&(e.TgZ(0,"div",4),e._uU(1),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.hij(" ",o.value," ")}}function ot(t,s){1&t&&(e.TgZ(0,"div",8),e._uU(1," Exames "),e.qZA())}function it(t,s){if(1&t&&(e.TgZ(0,"div",4),e._uU(1),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.hij(" ",o.value," ")}}const tt=function(){return{width:"90%",overflow:"hidden"}};function nt(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",1),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.display=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.clear())}),e.TgZ(2,"p"),e._uU(3,"\xa0"),e.qZA(),e.YNc(4,$i,2,0,"div",2),e.YNc(5,Vi,2,1,"div",3),e.TgZ(6,"div",4)(7,"div",5),e.YNc(8,Bi,2,0,"div",2),e.YNc(9,zi,2,1,"div",6),e.TgZ(10,"p"),e._uU(11,"\xa0"),e.qZA(),e.YNc(12,ji,2,0,"div",2),e.YNc(13,Wi,2,1,"div",6),e.TgZ(14,"p"),e._uU(15,"\xa0"),e.qZA(),e.YNc(16,Xi,2,0,"div",2),e.YNc(17,et,2,1,"div",6),e.TgZ(18,"p"),e._uU(19,"\xa0"),e.qZA(),e.YNc(20,ot,2,0,"div",2),e.YNc(21,it,2,1,"div",6),e.qZA(),e.TgZ(22,"div",5),e._UZ(23,"iframe",7),e.qZA()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(18,tt)),e.s9C("header",o.model.nome),e.Q6J("visible",o.display)("modal",!0)("responsive",!0)("baseZIndex",1e4),e.xp6(3),e.Q6J("ngIf",o.model.endereco),e.xp6(1),e.Q6J("ngIf",o.model.endereco),e.xp6(3),e.Q6J("ngIf",o.model.atendimentoHorarios&&o.model.atendimentoHorarios.length>0),e.xp6(1),e.Q6J("ngForOf",o.model.atendimentoHorarios),e.xp6(3),e.Q6J("ngIf",o.model.coletaExameHorarios&&o.model.coletaExameHorarios.length>0),e.xp6(1),e.Q6J("ngForOf",o.model.coletaExameHorarios),e.xp6(3),e.Q6J("ngIf",o.model.retiradaExameHorarios&&o.model.retiradaExameHorarios.length>0),e.xp6(1),e.Q6J("ngForOf",o.model.retiradaExameHorarios),e.xp6(3),e.Q6J("ngIf",o.model.exames&&o.model.exames.length>0),e.xp6(1),e.Q6J("ngForOf",o.model.exames),e.xp6(2),e.Q6J("src",o.urlIframe,e.uOi)}}let G=(()=>{class t extends Q.b{set value(o){o&&this.load(o)}constructor(o,i){super(o),this.sanitizer=i,this.onClose=new e.vpe,this.informacaoUnidadeService=o.get(l.muL)}ngOnInit(){this.clear()}clear(){this.model=void 0,this.display=!1,this.onClose.emit()}load(o){this.startLoading(),this.informacaoUnidadeService.getInfoUnidade(o,this.domain).subscribe(i=>{this.stopLoading(),this.display=!0,this.model=i,this.urlIframe=this.sanitizer.bypassSecurityTrustResourceUrl(this.getUrl())},i=>{this.verifyError(i)})}getUrl(){return"https://www.google.com/maps/embed/v1/place?key="+this.getGoogleMapsKey()+"&q="+this.getQuery()}getQuery(){return this.model?this.model.endereco.replace(/\ /g,"+"):""}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(ae.H7))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-unidade-informacao"]],inputs:{value:"value"},outputs:{onClose:"onClose"},features:[e.qOj],decls:1,vars:1,consts:[[4,"ngIf"],[3,"visible","modal","responsive","baseZIndex","header","visibleChange","onHide"],["class","row fw-bold",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-md-6","col-12"],["class","row",4,"ngFor","ngForOf"],["frameborder","0","allowfullscreen","",2,"border","0","height","100%","width","100%",3,"src"],[1,"row","fw-bold"]],template:function(o,i){1&o&&e.YNc(0,nt,24,19,"div",0),2&o&&e.Q6J("ngIf",i.model)},dependencies:[h.sg,h.O5,k.V],encapsulation:2}),t})();function at(t,s){if(1&t&&(e.TgZ(0,"div",12),e._uU(1),e.qZA()),2&t){const o=e.oxw(2);e.xp6(1),e.Oqu(o.mensagem)}}function st(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",19)(1,"span",20),e._uU(2,"Ordena\xe7\xe3o"),e.qZA(),e.TgZ(3,"p-dropdown",21),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.ordenacaoSelecionada=n)})("onChange",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.onSelectOrdenacao())}),e.qZA()()}if(2&t){const o=e.oxw(3);e.xp6(3),e.Q6J("options",o.ordenacao)("ngModel",o.ordenacaoSelecionada)}}function dt(t,s){1&t&&(e.TgZ(0,"div",9)(1,"div",12)(2,"p",22),e._uU(3,"N\xe3o foram encontrados hor\xe1rios dispon\xedveis, favor entrar em contato com a Central de Atendimento para verificarmos outras possibilidades."),e.qZA()()())}function rt(t,s){1&t&&(e.TgZ(0,"div",9)(1,"div",12)(2,"p",22),e._uU(3,"COVID-19 - Indisponibilidade de agendas no momento."),e.qZA()()())}function ct(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",9)(1,"div",23),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.abrirPopupEndereco())}),e.TgZ(2,"p-panel",24)(3,"p-header",25)(4,"div",9)(5,"div",26)(6,"p-radioButton",27),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.ofertaColetaDomiciliar=n)}),e.qZA()(),e.TgZ(7,"div",28)(8,"h5",29),e._UZ(9,"em",30),e._uU(10," ATENDIMENTO DOMICILIAR "),e.qZA()()(),e.TgZ(11,"div",9),e._uU(12,"\xa0"),e.qZA()()(),e.TgZ(13,"p-card",31),e._uU(14,"Verificar disponibilidade..."),e.qZA()()()}if(2&t){const o=e.oxw(3);e.xp6(2),e.Q6J("collapsed",!0),e.xp6(4),e.Q6J("ngModel",o.ofertaColetaDomiciliar)}}function lt(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",26)(1,"p-radioButton",47),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(4);return e.KtG(a.selectedUnidadeId=n)})("onClick",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.onClickUnidade(n.unidade))}),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(1),e.s9C("value",o.unidade.id),e.MGl("inputId","opt",o.unidade.id,""),e.Q6J("ngModel",i.selectedUnidadeId)}}function mt(t,s){1&t&&(e.TgZ(0,"div",48),e._UZ(1,"em",49),e.qZA())}function _t(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"h5",50),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.onClickUnidade(n.unidade))}),e._UZ(1,"em",51),e._uU(2),e.qZA()}if(2&t){const o=e.oxw().$implicit;e.xp6(2),e.hij(" ",o.unidade.nome," ")}}function pt(t,s){if(1&t&&(e.TgZ(0,"h5",52),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.Oqu(o.unidade.nome)}}function ut(t,s){if(1&t&&(e.TgZ(0,"span",54),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.hij("Dist\xe2ncia: ",o.unidade.distancia.toString().replace(".",",")," km")}}function gt(t,s){if(1&t&&(e.TgZ(0,"span",54),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.AsE("CEP: ",o.unidade.referenciaDistanciaCep," Dist\xe2ncia: ",o.unidade.distanciaCep.toString().replace(".",",")," km")}}function ht(t,s){if(1&t&&(e.TgZ(0,"div",40),e.YNc(1,ut,2,1,"span",53),e.YNc(2,gt,2,2,"span",53),e.qZA()),2&t){const o=e.oxw(4);e.xp6(1),e.Q6J("ngIf",!o.cepFiltroSelecionado),e.xp6(1),e.Q6J("ngIf",o.cepFiltroSelecionado)}}function ft(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"em",55),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(4);return e.KtG(n.abrirPopupEndereco())}),e.qZA()}}function vt(t,s){1&t&&(e.TgZ(0,"span",59),e._uU(1," - Possibilidade de reembolso com o plano"),e.qZA())}function xt(t,s){if(1&t&&(e.TgZ(0,"div",56)(1,"span",57),e._uU(2),e.YNc(3,vt,2,0,"span",58),e.qZA()()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(2),e.hij(" Total R$ ",i.getFormatCurrency(o.total)," "),e.xp6(1),e.Q6J("ngIf",!i.model.particular&&o.total>0&&i.model.plano.id!==i.model.planoFidelidade.id&&!i.model.convenio.parceiro)}}function Ct(t,s){1&t&&(e.TgZ(0,"div",12),e._uU(1,"Procurando Agenda..."),e.qZA())}function At(t,s){if(1&t&&(e.TgZ(0,"div",72)(1,"div",70),e._uU(2),e.qZA()()),2&t){const o=e.oxw(5).$implicit,i=e.oxw(3);e.xp6(2),e.hij("- ",i.getExamesLaboratoriais(o.examesAc,!0),"")}}function bt(t,s){if(1&t&&(e.TgZ(0,"div")(1,"div",69)(2,"div",70),e._uU(3),e.qZA()(),e.YNc(4,At,3,1,"div",71),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(6);e.xp6(3),e.lnq("- ",o.textoBotao," - ",o.exame.especialidade," - ",i.getValorExame(o),""),e.xp6(1),e.Q6J("ngIf",i.examesCoringa.includes(o.exame.id))}}function Tt(t,s){if(1&t&&(e.TgZ(0,"div",68),e.YNc(1,bt,5,4,"div",8),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",o.exame.nome)}}function Zt(t,s){if(1&t&&(e.TgZ(0,"fieldset",66)(1,"legend"),e._uU(2,"Exames"),e.qZA(),e.YNc(3,Tt,2,1,"div",67),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(3),e.Q6J("ngForOf",o.grupoAgendaSelecionada)}}function Et(t,s){if(1&t&&(e.TgZ(0,"div",73)(1,"div",74)(2,"fieldset",75)(3,"legend"),e._uU(4,"Adicional"),e.qZA(),e.TgZ(5,"div",9)(6,"div",69),e._uU(7),e.qZA()()()()()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(3);e.xp6(7),e.hij(" - ",i.getTaxas(o.listTaxaColetaDomiciliar)," ")}}function It(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"div",76)(2,"p",22),e._uU(3),e.qZA()()()),2&t){const o=s.$implicit;e.xp6(3),e.Oqu(o.nome)}}function Pt(t,s){if(1&t&&(e.TgZ(0,"div",73)(1,"div",74)(2,"fieldset",75)(3,"legend"),e._uU(4,"Ex
1ames com Restri\xe7\xf5es de Agenda"),e.qZA(),e.YNc(5,It,4,1,"div",18),e.qZA()()()),2&t){const o=e.oxw(2).$implicit;e.xp6(5),e.Q6J("ngForOf",o.examesComRestricao)}}function wt(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",83)(1,"em",84),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(6);return e.KtG(n.fecharCalendario())}),e.qZA(),e.TgZ(2,"p-calendar",85),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.data=n)})("onSelect",function(n){e.CHM(o);const a=e.oxw(6);return e.KtG(a.onSelectChangeData(n))}),e.qZA()()}if(2&t){const o=e.oxw(3).$implicit,i=e.oxw(3);e.xp6(2),e.Q6J("ngModel",o.data)("inline",!0)("locale",i.locale)("minDate",o.carenciaDataMinima)("disabledDates",o.disabledDates)("disabled",i.isLoading)}}function Mt(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",86)(1,"p-selectButton",87),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.horario=n)})("onChange",function(){e.CHM(o);const n=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.onChangeHorario(n))}),e.qZA()()}if(2&t){const o=e.oxw(3).$implicit;e.xp6(1),e.Q6J("options",o.selectedHorarios)("ngModel",o.horario)}}function Ut(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",89),e.NdJ("click",function(n){const d=e.CHM(o).$implicit,r=e.oxw(4).$implicit,c=e.oxw(3);return c.onChangeTurno(d.value,r),e.KtG(c.changeButtonTurno(n,d.value))}),e._uU(1),e.qZA()}if(2&t){const o=s.$implicit,i=e.oxw(4).$implicit;e.MGl("id","itemTurno",i.unidade.id,""),e.xp6(1),e.Oqu(o.label)}}function Nt(t,s){if(1&t&&(e.TgZ(0,"div"),e._uU(1," Per\xedodo"),e._UZ(2,"br"),e.YNc(3,Ut,2,2,"button",88),e.qZA()),2&t){const o=e.oxw(6);e.xp6(3),e.Q6J("ngForOf",o.turnos)}}function St(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"div",77)(2,"div",78),e._uU(3," Data mais pr\xf3xima"),e._UZ(4,"br"),e.TgZ(5,"b"),e._uU(6),e.qZA()(),e.TgZ(7,"div",79),e._uU(8," Escolher outra data"),e._UZ(9,"br"),e.TgZ(10,"em",80),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(5);return e.KtG(n.abrirCalendario())}),e.qZA(),e.YNc(11,wt,3,6,"div",81),e.qZA(),e.TgZ(12,"div",79),e.YNc(13,Mt,2,2,"div",82),e.YNc(14,Nt,4,1,"div",8),e.qZA()()()}if(2&t){const o=e.oxw(2).$implicit,i=e.oxw(3);e.Tol("text-center text-sm-size"),e.xp6(6),e.Oqu(i.getFormatDateName(o.data)),e.xp6(5),e.Q6J("ngIf",i.displayCalendario),e.xp6(2),e.Q6J("ngIf",o.selectedHorarios&&1===o.selectedHorarios.length),e.xp6(1),e.Q6J("ngIf",!i.isLoadedHorario&&o.selectedHorarios&&o.selectedHorarios.length>1||0===o.selectedHorarios.length)}}function yt(t,s){1&t&&(e.TgZ(0,"div",90)(1,"div",91),e._uU(2,"Procurando Agenda..."),e.qZA()())}function qt(t,s){1&t&&(e.TgZ(0,"div",94)(1,"p",95),e._uU(2,"N\xe3o foram encontrados hor\xe1rios dispon\xedveis para o dia informado"),e.qZA()())}function Jt(t,s){if(1&t&&(e.TgZ(0,"div",92),e.YNc(1,qt,3,0,"div",93),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngIf",!o.selectedHorarios||0===o.selectedHorarios.length)}}function kt(t,s){if(1&t&&(e.TgZ(0,"div")(1,"div",9)(2,"div",60),e.YNc(3,Zt,4,1,"fieldset",61),e.qZA()(),e.YNc(4,Et,8,1,"div",62),e.YNc(5,Pt,6,1,"div",62),e.YNc(6,St,15,6,"div",63),e.TgZ(7,"div",9),e.YNc(8,yt,3,0,"div",64),e.YNc(9,Jt,2,1,"div",65),e.qZA()()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(3),e.Q6J("ngIf",o.grupoAgendaSelecionada),e.xp6(1),e.Q6J("ngIf",o.grupoAgendaSelecionada&&o.listTaxaColetaDomiciliar.length>0),e.xp6(1),e.Q6J("ngIf",o.grupoAgendaSelecionada&&o.examesComRestricao&&o.examesComRestricao.length>0),e.xp6(1),e.Q6J("ngIf",o.isLoading&&!o.erro),e.xp6(2),e.Q6J("ngIf",i.isLoadedHorario),e.xp6(1),e.Q6J("ngIf",!i.isLoadedHorario)}}function Dt(t,s){if(1&t&&(e.TgZ(0,"p-card",96),e._UZ(1,"em",97),e._uU(2),e._UZ(3,"em",98),e._uU(4),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.Q6J("styleClass",i.selectedUnidadeId===o.unidade.id?"card-footer text-center selected":"card-footer text-center"),e.xp6(2),e.hij(" ",i.getFormatDate(o.data)," "),e.xp6(2),e.hij(" ",o.textoBotao," ")}}function Ft(t,s){1&t&&(e.TgZ(0,"p-card",99),e._uU(1,"pesquisando agendas..."),e.qZA())}function Ot(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"div",12)(2,"p-panel",32)(3,"p-header",25)(4,"div",9),e.YNc(5,lt,2,3,"div",33),e.YNc(6,mt,2,0,"div",34),e.TgZ(7,"div",35)(8,"div",36),e.YNc(9,_t,3,1,"h
15",37),e.YNc(10,pt,2,1,"h5",38),e.qZA(),e.YNc(11,ht,3,2,"div",39),e.TgZ(12,"div",40)(13,"span",41),e._uU(14),e.YNc(15,ft,1,0,"em",42),e.qZA()(),e.YNc(16,xt,4,2,"div",43),e.qZA(),e._UZ(17,"div",44),e.qZA()(),e.YNc(18,Ct,2,0,"div",10),e.YNc(19,kt,10,6,"div",8),e.qZA(),e.YNc(20,Dt,5,3,"p-card",45),e.YNc(21,Ft,2,0,"p-card",46),e.qZA()()),2&t){const o=s.$implicit,i=e.oxw(3);e.xp6(2),e.MGl("id","filteredAgendaRespostas",o.unidade.id,""),e.Q6J("collapsed",i.selectedUnidadeId!==+o.unidade.id&&"domiciliar"===i.tipoAgenda),e.xp6(3),e.Q6J("ngIf",o.isLoading),e.xp6(1),e.Q6J("ngIf",!o.isLoading),e.xp6(3),e.Q6J("ngIf",o.isLoading),e.xp6(1),e.Q6J("ngIf",!o.isLoading),e.xp6(1),e.Q6J("ngIf",o.unidade.distancia>0),e.xp6(3),e.hij("",o.unidade.endereco," "),e.xp6(1),e.Q6J("ngIf",o.isLoading),e.xp6(1),e.Q6J("ngIf",o.total),e.xp6(2),e.Q6J("ngIf",!i.isLoadedCalendario&&"domiciliar"===i.tipoAgenda),e.xp6(1),e.Q6J("ngIf",i.isLoadedCalendario&&"domiciliar"===i.tipoAgenda),e.xp6(1),e.Q6J("ngIf",o.isLoading),e.xp6(1),e.Q6J("ngIf",!o.isLoading)}}function Ht(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",26)(1,"p-radioButton",47),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(4);return e.KtG(a.selectedUnidadeId=n)})("onClick",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.onClickUnidade(n.unidade))}),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(1),e.s9C("value",o.unidade.id),e.MGl("inputId","opt",o.unidade.id,""),e.Q6J("ngModel",i.selectedUnidadeId)}}function Qt(t,s){1&t&&(e.TgZ(0,"div",48),e._UZ(1,"em",49),e.qZA())}function Lt(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",108),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.refreshAgendaUnidade(n))}),e._UZ(1,"em",109),e.qZA()}}function Rt(t,s){1&t&&e._UZ(0,"em",51)}function Yt(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"h5",50),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.onClickUnidade(n.unidade))}),e._uU(1),e.qZA()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.hij(" ",o.unidade.nome,"")}}function Gt(t,s){if(1&t&&(e.TgZ(0,"h5",52),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.Oqu(o.unidade.nome)}}function Kt(t,s){if(1&t&&(e.TgZ(0,"span",54),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.hij("Dist\xe2ncia: ",o.unidade.distancia.toString().replace(".",",")," km")}}function $t(t,s){if(1&t&&(e.TgZ(0,"span",54),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.AsE("CEP: ",o.unidade.referenciaDistanciaCep," Dist\xe2ncia: ",o.unidade.distanciaCep.toString().replace(".",",")," km")}}function Vt(t,s){if(1&t&&(e.TgZ(0,"div",104),e.YNc(1,Kt,2,1,"span",53),e.YNc(2,$t,2,2,"span",53),e.qZA()),2&t){const o=e.oxw(4);e.xp6(1),e.Q6J("ngIf",!o.cepFiltroSelecionado),e.xp6(1),e.Q6J("ngIf",o.cepFiltroSelecionado)}}function Bt(t,s){1&t&&e._UZ(0,"em",112)}function zt(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",110),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.showUnidadeInformacoes(n.unidade.id))}),e.YNc(1,Bt,1,0,"em",111),e.qZA()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf","ATENDIMENTO DOMICILIAR"!=o.unidade.nome)}}function jt(t,s){1&t&&e._UZ(0,"span",116)}const Wt=function(t){return{"texto-tachado":t}};function Xt(t,s){if(1&t&&(e.TgZ(0,"div",113)(1,"span",114),e._uU(2),e.qZA(),e.YNc(3,jt,1,0,"span",115),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(1),e.Q6J("ngClass",e.VKq(3,Wt,o.totalOriginal>o.total)),e.xp6(1),e.hij("Total R$ ",i.getFormatCurrency(o.totalOriginal),""),e.xp6(1),e.Q6J("ngIf",!i.model.particular&&o.total>0&&i.model.plano.id!==i.model.planoFidelidade.id)}}function en(t,s){1&t&&(e.TgZ(0,"span",116),e._uU(1," - Possibilidade de reembolso com o plano"),e.qZA())}function on(t,s){if(1&t&&(e.TgZ(0,"div",113)(1,"span",117),e._uU(2),e.qZA(),e.YNc(3,en,2,0,"span",115),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(2),e.hij("Total R$ ",i.getFormatCurrency(o.total),""),e.xp6(1),e.Q6J("ngIf",!i.model.particular&&o.total>0&&i.model.plano.id!==i.model.planoFidelidade.id&&!i.model.convenio.parceiro)}}function tn(t,s){if(1&t&&(e.TgZ(0,"div")(1,"span"),e._uU(2,"N\xe3o realiza"),e.qZA(),e._UZ(3,"br"),e.TgZ(4,"span",118),e._uU(5),e.qZA(),e._UZ(6,"br"),e.TgZ(7,"span"),e._uU(8,"do(s) procedimento(s)"),e.qZA()()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(5),e.Oqu(o.grupoAgendaSelecionada?i.totalExames-o.grupoAgendaSelecionada.length:0)}}function nn(t,s){if(1&t&&(e.TgZ(0,"div",129)(1,"div",130),e._uU(2),e.qZA()()),2&t){const o=e.oxw(5).$implicit,i=e.oxw(3);e.xp6(2),e.hij(" - ",i.getExamesLaboratoriais(o.examesAc,!0),"")}}function an(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"div",126)(2,"div",127),e._uU(3),e.qZA(),e.YNc(4,nn,3,1,"div",128),e.qZA()()),2&t){const o=e.oxw().$implicit,i=e.oxw(6);e.xp6(3),e.lnq("",o.textoBotao," - ",o.exame.nome," - ",i.getValorExame(o),""),e.xp6(1),e.Q6J("ngIf",i.examesCoringa.includes(o.exame.id))}}function sn(t,s){if(1&t&&(e.TgZ(0,"div",125),e.YNc(1,an,5,4,"div",0),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",o.exame.nome)}}function dn(t,s){if(1&t&&(e.TgZ(0,"fieldset",66)(1,"legend"),e._uU(2,"Exames"),e.qZA(),e.YNc(3,sn,2,1,"div",124),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(3),e.Q6J("ngForOf",o.grupoAgendaSelecionada)}}function rn(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"div",12)(2,"fieldset",75)(3,"legend"),e._uU(4,"Adicional"),e.qZA(),e.TgZ(5,"div",9)(6,"div",69),e._uU(7),e.qZA()()()()()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(3);e.xp6(7),e.hij(" - ",i.getTaxas(o.listTaxaColetaDomiciliar)," ")}}function cn(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"div",76)(2,"p",22),e._uU(3),e.qZA()()()),2&t){const o=s.$implicit;e.xp6(3),e.Oqu(o.nome)}}function ln(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"div",60)(2,"fieldset",75)(3,"legend"),e._uU(4,"Ex
1ames com Restri\xe7\xf5es de Agenda"),e.qZA(),e.YNc(5,cn,4,1,"div",18),e.qZA()()()),2&t){const o=e.oxw(2).$implicit;e.xp6(5),e.Q6J("ngForOf",o.examesComRestricao)}}function mn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",83)(1,"em",84),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(6);return e.KtG(n.fecharCalendario())}),e.qZA(),e.TgZ(2,"p-calendar",85),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.data=n)})("onSelect",function(n){e.CHM(o);const a=e.oxw(6);return e.KtG(a.onSelectChangeData(n))}),e.qZA()()}if(2&t){const o=e.oxw(3).$implicit,i=e.oxw(3);e.xp6(2),e.Q6J("ngModel",o.data)("inline",!0)("locale",i.locale)("minDate",o.carenciaDataMinima)("disabledDates",o.disabledDates)("disabled",i.isLoading)}}function _n(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",86)(1,"p-selectButton",87),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.horario=n)})("onChange",function(){e.CHM(o);const n=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.onChangeHorario(n))}),e.qZA()()}if(2&t){const o=e.oxw(3).$implicit;e.xp6(1),e.Q6J("options",o.selectedHorarios)("ngModel",o.horario)}}const pn=function(t,s){return{"btn-primary":t,"btn-light":s}};function un(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",132),e.NdJ("click",function(n){const d=e.CHM(o).$implicit,r=e.oxw(4).$implicit,c=e.oxw(3);return c.changeButtonTurno(n,d.value),e.KtG(c.onChangeTurno(d.value,r))}),e._uU(1),e.qZA()}if(2&t){const o=s.$implicit,i=e.oxw(4).$implicit,n=e.oxw(3);e.MGl("id","itemTurno",i.unidade.id,""),e.Q6J("ngClass",e.WLB(3,pn,n.setTurno===o.value,n.setTurno!==o.value)),e.xp6(1),e.Oqu(o.label)}}function gn(t,s){if(1&t&&(e.TgZ(0,"div"),e._uU(1," Per\xedodo"),e._UZ(2,"br"),e.YNc(3,un,2,6,"button",131),e.qZA()),2&t){const o=e.oxw(6);e.xp6(3),e.Q6J("ngForOf",o.turnos)}}function hn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"div",77)(2,"div",78),e._uU(3," Data mais pr\xf3xima"),e._UZ(4,"br"),e.TgZ(5,"b"),e._uU(6),e.qZA()(),e.TgZ(7,"div",79),e._uU(8," Escolher outra data"),e._UZ(9,"br"),e.TgZ(10,"em",80),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(5);return e.KtG(n.abrirCalendario())}),e.qZA(),e.YNc(11,mn,3,6,"div",81),e.qZA(),e.TgZ(12,"div",79),e.YNc(13,_n,2,2,"div",82),e.YNc(14,gn,4,1,"div",8),e.qZA()()()}if(2&t){const o=e.oxw(2).$implicit,i=e.oxw(3);e.Tol("text-center text-sm-size"),e.xp6(6),e.Oqu(i.getFormatDateName(o.data)),e.xp6(5),e.Q6J("ngIf",i.displayCalendario),e.xp6(2),e.Q6J("ngIf",o.selectedHorarios&&1===o.selectedHorarios.length),e.xp6(1),e.Q6J("ngIf",!i.isLoadedHorario&&o.selectedHorarios&&(o.selectedHorarios.length>1||0===o.selectedHorarios.length))}}function fn(t,s){1&t&&(e.TgZ(0,"p-card",99),e._uU(1,"pesquisando agendas..."),e.qZA())}function vn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",133),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(3);return e.KtG(a.refreshAgendaUnidade(n))}),e._uU(1,"clique aqui para buscar novamente..."),e.qZA()}}function xn(t,s){1&t&&(e.TgZ(0,"div",134)(1,"div",91),e._uU(2,"Procurando Agenda..."),e.qZA()())}function Cn(t,s){1&t&&(e.TgZ(0,"div",25)(1,"p",95),e._uU(2,"N\xe3o foram encontrados hor\xe1rios dispon\xedveis para o dia informado"),e.qZA()())}function An(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",138)(1,"em",84),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(6);return e.KtG(n.fecharHorarios())}),e.qZA(),e.TgZ(2,"p-selectButton",87),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.horario=n)})("onChange",function(){e.CHM(o);const n=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.onChangeHorario(n))}),e.qZA()()}if(2&t){const o=e.oxw(3).$implicit;e.xp6(2),e.Q6J("options",o.selectedHorarios)("ngModel",o.horario)}}function bn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",25)(1,"p-selectButton",87),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.horario=n)})("onChange",function(){e.CHM(o);const n=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.onChangeHorario(n))}),e.qZA()()}if(2&t){const o=e.oxw(3).$implicit;e.xp6(1),e.Q6J("options",o.selectedHorarios)("ngModel",o.horario)}}function Tn(t,s){if(1&t&&(e.TgZ(0,"div",135),e.YNc(1,Cn,3,0,"div",136),e.YNc(2,An,3,2,"div",137),e.YNc(3,bn,2,2,"div",136),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(3);e.xp6(1),e.Q6J("ngIf",!o.selectedHorarios||0===o.selectedHorarios.length),e.xp6(1),e.Q6J("ngIf",o.selectedHorarios&&o.selectedHorarios.length>1&&i.mobile&&i.displayHorarios),e.xp6(1),e.Q6J("ngIf",o.selectedHorarios&&o.selectedHorarios.length>1&&!i.mobile)}
1}function Zn(t,s){if(1&t&&(e.TgZ(0,"div")(1,"div",9)(2,"div",119),e.YNc(3,dn,4,1,"fieldset",61),e.qZA()(),e.YNc(4,rn,8,1,"div",0),e.YNc(5,ln,6,1,"div",0),e.YNc(6,hn,15,6,"div",63),e.YNc(7,fn,2,0,"p-card",46),e.YNc(8,vn,2,0,"p-card",120),e.TgZ(9,"div",121),e.YNc(10,xn,3,0,"div",122),e.YNc(11,Tn,4,3,"div",123),e.qZA()()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(3),e.Q6J("ngIf",o.grupoAgendaSelecionada),e.xp6(1),e.Q6J("ngIf",o.grupoAgendaSelecionada&&o.listTaxaColetaDomiciliar.length>0),e.xp6(1),e.Q6J("ngIf",o.grupoAgendaSelecionada&&o.examesComRestricao&&o.examesComRestricao.length>0),e.xp6(1),e.Q6J("ngIf",o.isLoading&&!o.erro),e.xp6(1),e.Q6J("ngIf",!o.isLoading&&!o.erro),e.xp6(1),e.Q6J("ngIf",o.erro),e.xp6(2),e.Q6J("ngIf",i.isLoadedHorario),e.xp6(1),e.Q6J("ngIf",!i.isLoadedHorario)}}function En(t,s){if(1&t&&(e.TgZ(0,"p-card",96),e._UZ(1,"em",97),e._uU(2),e._UZ(3,"em",98),e._uU(4),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.Q6J("styleClass",i.selectedUnidadeId===o.unidade.id?"card-footer text-center selected":"card-footer text-center"),e.xp6(2),e.hij(" ",i.getFormatDate(o.data)," "),e.xp6(2),e.hij("",o.textoBotao," ")}}function In(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"div",12)(2,"p-panel",32)(3,"p-header",25)(4,"div",9),e.YNc(5,Ht,2,3,"div",33),e.YNc(6,Qt,2,0,"div",34),e.YNc(7,Lt,2,0,"div",100),e.TgZ(8,"div",101)(9,"div",57),e.YNc(10,Rt,1,0,"em",102),e.YNc(11,Yt,2,1,"h5",37),e.YNc(12,Gt,2,1,"h5",38),e.qZA(),e.YNc(13,Vt,3,2,"div",103),e.TgZ(14,"div",104)(15,"span",41),e._uU(16),e.qZA(),e.YNc(17,zt,2,1,"a",105),e.qZA(),e.YNc(18,Xt,4,5,"div",106),e.YNc(19,on,4,2,"div",106),e.qZA(),e.TgZ(20,"div",107),e.YNc(21,tn,9,1,"div",8),e.qZA()()(),e.TgZ(22,"p-content"),e.YNc(23,Zn,12,8,"div",8),e.qZA()(),e.YNc(24,En,5,3,"p-card",45),e.qZA()()),2&t){const o=s.$implicit,i=e.oxw(3);e.xp6(2),e.MGl("id","filteredAgendaRespostas",o.unidade.id,""),e.Q6J("collapsed",i.selectedUnidadeId!==+o.unidade.id&&"domiciliar"!==i.tipoAgenda),e.xp6(3),e.Q6J("ngIf",o.isLoading&&!o.erro),e.xp6(1),e.Q6J("ngIf",!o.isLoading&&!o.erro),e.xp6(1),e.Q6J("ngIf",o.erro),e.xp6(3),e.Q6J("ngIf","ATENDIMENTO DOMICILIAR"===o.unidade.nome),e.xp6(1),e.Q6J("ngIf",o.isLoading),e.xp6(1),e.Q6J("ngIf",!o.isLoading),e.xp6(1),e.Q6J("ngIf",o.unidade.distancia>0),e.xp6(3),e.Oqu(o.unidade.endereco),e.xp6(1),e.Q6J("ngIf",!i.model.unidadeCD||o.unidade.id!==i.model.unidadeCD.id||!i.model.unidadeVacina||o.unidade.id!==i.model.unidadeVacina.id),e.xp6(1),e.Q6J("ngIf",o.total&&o.totalOriginal>o.total),e.xp6(1),e.Q6J("ngIf",o.total),e.xp6(2),e.Q6J("ngIf",o.grupoAgendaSelecionada&&i.totalExames-o.grupoAgendaSelecionada.length>0),e.xp6(2),e.Q6J("ngIf",i.isLoadedCalendario&&i.selectedUnidadeId===+o.unidade.id),e.xp6(1),e.Q6J("ngIf",o.isLoading)}}function Pn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",9)(1,"div",139)(2,"p-panel",140)(3,"p-header",25)(4,"div",141)(5,"p-radioButton",142),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(4);return e.KtG(a.selectedUnidadeId=n)})("onClick",function(){const a=e.CHM(o).$implicit,d=e.oxw(4);return e.KtG(d.onClickUnidade(a.unidade))}),e.qZA()(),e.TgZ(6,"div",143)(7,"div",57)(8,"h5",29),e._uU(9),e.qZA()(),e.TgZ(10,"div",104)(11,"span",144),e._uU(12),e.qZA()()()()(),e.TgZ(13,"p-card",99),e._uU(14,"Nenhum hor\xe1rio para unidade!"),e.qZA()()()}if(2&t){const o=s.$implicit,i=e.oxw(4);e.xp6(2),e.MGl("id","unidadesNaoEncontradas",o.unidade.id,""),e.Q6J("collapsed",i.selectedUnidadeId!==+o.unidade.id),e.xp6(3),e.s9C("value",o.unidade.id),e.MGl("inputId","opt",o.unidade.id,""),e.Q6J("ngModel",i.selectedUnidadeId)("disabled",!0),e.xp6(4),e.Oqu(o.unidade.nome),e.xp6(3),e.Oqu(o.unidade.endereco)}}function wn(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,Pn,15,8,"div",18),e.qZA()),2&t){const o=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",o.unidadesNaoEncontradas)}}function Mn(t,s){if(1&t&&(e.TgZ(0,"div",13)(1,"fieldset",14)(2,"legend"),e._uU(3,"Selecione a Unidade de Prefer\xeancia"),e.qZA(),e.TgZ(4,"div",9)(5,"div",15),e._uU(6," Encontramos "),e.TgZ(7,"span",16),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.YNc(10,st,4,2,"div",17),e.qZA(),e.YNc(11,dt,4,0,"div",0),e.YNc(12,rt,4,0,"div",0),e.YNc(13,ct,15,2,"div",0),e.YNc(14,Ot,22,14,"div",18),e.YNc(15,In,25,16,"div",18),e.YNc(16,wn,2,1,"div",8),e.qZA()()),2&t){const o=e.oxw(2);e.xp6(8),e.hij("",o.total," unidade(s)"),e.xp6(1),e.hij(" ",o.filtradosProximidade?"perto de voc\xea":""," "),e.xp6(1),e.Q6J("ngIf",o.ordenacao.length>1),e.xp6(1),e.Q6J("ngIf",(o.selectedUnidade&&o.filteredAgendaRespostas&&
10===o.filteredAgendaRespostas.length||0===o.filteredAgendaRespostas.length)&&(!o.hasCovid||o.hasCovid&&o.model.exames&&o.model.exames.length>1)),e.xp6(1),e.Q6J("ngIf",(o.selectedUnidade&&o.filteredAgendaRespostas&&0===o.filteredAgendaRespostas.length||0===o.filteredAgendaRespostas.length)&&o.hasCovid),e.xp6(1),e.Q6J("ngIf",(o.model.contemExameDomiciliar||o.verificaSeReagendamentoDomiciliar())&&!o.model.endereco),e.xp6(1),e.Q6J("ngForOf",o.getRespostas(!0)),e.xp6(1),e.Q6J("ngForOf",o.getRespostas()),e.xp6(1),e.Q6J("ngIf",!o.verificaSeReagendamentoDomiciliar())}}function Un(t,s){if(1&t&&(e.TgZ(0,"div",9),e.YNc(1,at,2,1,"div",10),e.YNc(2,Mn,17,9,"div",11),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Q6J("ngIf",!o.isLoaded),e.xp6(1),e.Q6J("ngIf",o.isLoaded)}}const qe=function(){return{width:"350px",overflow:"hidden"}};function Nn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",145),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.displayExamesComRestricao=n)}),e.TgZ(2,"div",146),e._uU(3," Existem exames com restri\xe7\xf5es de agenda:\xa0"),e.TgZ(4,"strong"),e._uU(5),e.qZA()(),e.TgZ(6,"div",146),e._uU(7," Caso queira prosseguir com o agendamentos dos demais exames, clique em PROSSEGUIR. "),e.qZA(),e.TgZ(8,"div",146),e._uU(9," Ou entre em contato com a Central de Atendimento para obter a melhor op\xe7\xe3o de data e hor\xe1rio. "),e.qZA(),e.TgZ(10,"div",3)(11,"div",4)(12,"button",147),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._uU(13,"Voltar"),e.qZA(),e.TgZ(14,"button",148),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.displayExamesComRestricao=!1)}),e._uU(15,"Prosseguir"),e.qZA()()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(10,qe)),e.Q6J("visible",o.displayExamesComRestricao)("modal",!0)("responsive",!0)("baseZIndex",1e4)("closable",!1),e.xp6(4),e.Oqu(o.getExamesComRestricoes()),e.xp6(7),e.Q6J("disabled",o.isLoading),e.xp6(2),e.Q6J("disabled",o.isLoading)}}const Sn=function(){return{width:"450px",overflow:"hidden"}};function yn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",149),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.displayContinuarComExamesParticular=n)}),e.TgZ(2,"div",146),e._uU(3," Tem alguns procedimentos que n\xe3o s\xe3o cobertos pelo conv\xeanio."),e._UZ(4,"br")(5,"br"),e._uU(6,"Gostaria de seguir com eles no particular? "),e.qZA(),e.TgZ(7,"div",3)(8,"div",4)(9,"button",150),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.recarregarTelaUnidades())}),e._uU(10,"N\xe3o"),e.qZA(),e.TgZ(11,"button",151),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.displayContinuarComExamesParticular=!1)}),e._uU(12,"Sim"),e.qZA()()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(9,Sn)),e.Q6J("visible",o.displayContinuarComExamesParticular)("modal",!0)("responsive",!0)("baseZIndex",1e4)("closable",!1),e.xp6(8),e.Q6J("disabled",o.isLoading),e.xp6(2),e.Q6J("disabled",o.isLoading)}}function qn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",145),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.displayExamesComMedicoPreferencial=n)}),e.TgZ(2,"div",146),e._uU(3," N\xe3o existe agenda para o m\xe9dico selecionado "),e.qZA(),e.TgZ(4,"div",146),e._uU(5," Caso queira prosseguir com o agendamentos sem o m\xe9dico de prefer\xeancia, clique em PROSSEGUIR. "),e.qZA(),e.TgZ(6,"div",146),e._uU(7," Ou entre em contato com a Central de Atendimento para obter a melhor op\xe7\xe3o de data e hor\xe1rio. "),e.qZA(),e.TgZ(8,"div",3)(9,"div",4)(10,"button",152),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._uU(11,"Voltar"),e.qZA(),e.TgZ(12,"button",148),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.refreshWithoutMedicoPreferencia())}),e._uU(13,"Prosseguir"),e.qZA()()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(9,qe)),e.Q6J("visible",o.displayExamesComMedicoPreferencial)("modal",!0)("responsive",!0)("baseZIndex",1e4)("closable",!1),e.xp6(9),e.Q6J("disabled",o.isLoading),e.xp6(2),e.Q6J("disabled",o.isLoading)}}let Jn=(()=>{class t extends w.a{constructor(o,i){super(o),this.configPrimeNg=i,this.filtradosProximidade=!0,this.isLoadedHorario=!1,this.isLoadedCalendario=!1,this.total=0,this.exibirBotaoVerMais=!1,this.tamanhoPagina=4,this.firstIndex=0,this.lastIndex=this.firstIndex+this.tamanhoPagina-1,this.temVacina=!1,this.contador=0,this.loteBuscaHorarios=4,this.displayCalendario=!1,this.displayHorarios=!1,this.mobile=!1,this.cepFiltroSelecionado=!1,i.setTranslation(this.locale),this.router=o.get(b.F0),this.unidadeService=o.get(l.sc7),this.enderecoService=o.get(ye.t),this.exameService=o.get(l.q07),this.cepService=o.get(Ki.q),this.mensagem=""}ngOnInit(){this.changeStep(2),this.clear(),this.load()}ngOnDestroy(){this.eventCloseLogin&&this.eventCloseLogin.unsubscribe(),this.eventCloseEndereco&&this.eventCloseEndereco.unsubscribe(),this.eventCloseCep&&this.eventCloseCep.unsubscribe()}loginTelaUnidade(){let o=new l.kA0;o=this.agendaRespostas.filter(i=>i.unidade.id===this.selectedUnidadeId)[0],T.G.setObject(this.STORAGE_KEY_LOGIN_UNIDADE,o)}clear(){T.G.setItem(this.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL,0),this.unidades=[],this.agendaRespostas=[],this.filteredAgendaRespostas=[],this.unidadesNaoEncontradas=[],this.turnos=[],this.selectedUnidade=void 0,this.selectedUnidadeId=void 0,this.selectedTurno=void 0,this.display=!1,this.displayExamesComRestricao=!1,this.displayExamesComMedicoPreferencial=!1,this.displayContinuarComExamesParticular=!1,this.today=new Date,this.disabledDates=[],this.total=0,this.examesComRestricao=[],this.examesCoringa=[],this.ordenacao=[],this.ordenacaoSelecionada=new l.GvL}load(){this.verificaPermissaoTela(),T.G.getObject(this.STORAGE_KEY_LOGIN_UNIDADE)?this.validarExames()?this.reservaAgenda(!0):this.goToExames():this.get()}carregarUnidades(){this.contador=0,this.unidadesNaoEncontradas=[],this.model.unidades.forEac
1h(o=>{const i=new l.kA0;i.unidade=o,this.verificaSeDomiciliar(i.unidade.id)?(i.unidade.distancia=0,o.distancia=0):i.visivel=!0,o.totalExamesCobertos>=1?this.filteredAgendaRespostas.push(i):this.verificaSeDomiciliar(i.unidade.id)||this.unidadesNaoEncontradas.push(i)}),this.model.unidades=this.model.unidades.filter(o=>o.totalExamesCobertos>=1),this.onSelectOrdenacao(),this.model.unidades.sort((o,i)=>o.distancia<i.distancia?-1:1)}get(){if(this.marcacaoService.convenios)if(this.carregarComboOrdenacao(),this.atualizarExibicaoHorarios(),this.carregarUnidades(),this.eventChangeConvenioPlano||(this.eventChangeConvenioPlano=this.marcacaoService.eventChangeConvenioPlano.subscribe(o=>{this.sincronizarConvenioPlano(),this.atualizarExibicaoHorarios(),this.clear(),this.marcacaoService.exibirHorarios&&this.get()})),this.marcacaoService.particular=this.model.particular,this.marcacaoService.convenio=this.model.convenio,this.marcacaoService.convenio&&!this.marcacaoService.planos&&this.getPlanos(this.marcacaoService.convenio.id),this.marcacaoService.plano=this.model.plano,this.marcacaoService.tipoConvenio=this.model.plano.id==this.model.planoParticular.id?1:""!==this.marcacaoService.nomeFidelidade&&void 0!==this.marcacaoService.nomeFidelidade&&this.model.plano.id==this.model.planoFidelidade.id?2:0,this.turnos=this.model.turnos,this.model.endereco=void 0,this.model.examesNaoAgendaveis&&(this.temVacina=this.model.examesNaoAgendaveis.filter(o=>"VACINA"===o.especialidade.toUpperCase()).length>0),this.verificaSeReagendamentoDomiciliar())this.prepararUnidadesReagendamento();else{const o=this.buscarLoteUnidades(!0);o&&o.length>0&&this.getAgendaUnidade(o)}else this.convenioPlanoService.getConvenios(this.domain).subscribe(o=>{this.marcacaoService.convenios=o,this.get()},o=>this.verifyError(o))}carregarComboOrdenacao(){this.ordenacao=[];const o=new l.GvL;o.label="Dist\xe2ncia",o.value="DT";const i=new l.GvL;i.label="Hor\xe1rio",i.value="DB";const n=new l.GvL;n.label="CEP",n.value="CE",this.model.isAtivoGps?(this.ordenacao.push(o),this.ordenacaoSelecionada.value=o.value):this.ordenacaoSelecionada.value=i.value,this.ordenacao.push(i),this.ordenacao.push(n)}refreshAgendaUnidade(o){o.isLoading=!1,o.erro=!1,this.getAgendaUnidade([o.unidade],!0)}getAgendaUnidade(o,i=!1){if(!this.marcacaoService.exibirHorarios)return;this.hasCovid=this.model.exames.findIndex(d=>d.nome.toLowerCase().indexOf("covid")>-1)>-1;const n=o.map(d=>d.id),a=this.getAgenda(n);if(this.model.endereco){const d=this.model.endereco.cep.replace("-","");d&&(a.faixaCepInicial=d.substr(0,5),a.faixaCepInicialExt=d.substr(5,3))}a.unidadeCD=this.model.unidadeCD,a.unidadeVacina=this.model.unidadeVacina,a.examesPacote=this.model.examesPacotes,a.buscarAgendasApenasNoConvenio=!!(this.user&&this.user.backoffice&&this.user.labApoiado.convenioPadrao),this.unidadeService.getSugestaoAgendamento(this.domain,a).subscribe(d=>{if(!this.marcacaoService.exibirHorarios)return;this.atualizarControlesAgenda(d.respostas,a),this.examesCoringa=d.examesCoringaAC,this.model.unidadeVacina&&this.model.unidadeVacina.id>0&&(this.temVacina=this.filteredAgendaRespostas.filter(c=>c.unidade.id===this.model.unidadeVacina.id).length>0);let r=!1;if(n.forEach(c=>{this.verificaSeDomiciliar(c)&&(r=!0)}),r)n.forEach(c=>{this.verificarResultadosUnidade(c===this.model.unidadeCD.id?this.model.unidadeCD:this.model.unidadeVacina)});else{const c=window.location.href.includes("unidade"),m=this.buscarLoteUnidades();m&&m.length>0&&c&&!i&&this.getAgendaUnidade(m)}this.model.examesPacotes&&d.examesPacote&&(this.model.examesPacotes=d.examesPacote),this.onSelectOrdenacao()},d=>{if(n&&n.forEach(r=>{const c=this.filteredAgendaRespostas.find(m=>m.unidade.id===r);c&&(c.isLoading=!0,c.erro=!0)}),!i){const r=this.buscarLoteUnidades();r&&r.length>0&&this.getAgendaUnidade(r)}})}verificarMedicoPreferencial(o){this.displayExamesComMedicoPreferencial=!1,0===o.length&&0===this.filteredAgendaRespostas.length&&this.model.exames.findIndex(i=>i.medico||i.preferenciaMedicoGenero>0)>-1&&(this.displayExamesComMedicoPreferencial=!0)}atualizarAgendaRespostas(o){o.forEach(i=>
1{i.unidade=this.buscarUnidade(i.unidade.id),this.verificaSeDomiciliar(i.unidade.id)&&(i.unidade.nome="ATENDIMENTO DOMICILIAR",this.model.endereco&&(i.unidade.cep=this.model.endereco.cep,i.unidade.endereco=this.model.endereco.endereco+", "+this.model.endereco.numero+" - "+this.model.endereco.cidade,i.unidade.numero=this.model.endereco.numero,i.unidade.bairro=this.model.endereco.bairro,i.unidade.cidade=this.model.endereco.cidade,i.unidade.estado=this.model.endereco.estado)),i.visivel=!0,i.horarios=[];for(const a in i.grupoAgenda){const d=new l.eaq;d.label=i.grupoAgenda[a][0].textoBotao,d.value=a,d.turno=this.getTurno(a),i.horarios.push(d)}const n=this.agendaRespostas.find(a=>a.unidade.id===i.unidade.id);if(n){const a=this.agendaRespostas.indexOf(n);this.agendaRespostas[a]=i}else this.agendaRespostas.push(i)})}buscarUnidade(o){let i=this.model.unidades.find(n=>n.id===o);return i||(this.model.unidadeCD&&(i=o===this.model.unidadeCD.id?this.model.unidadeCD:void 0),!i&&this.model.unidadeVacina&&(i=o===this.model.unidadeVacina.id?this.model.unidadeVacina:void 0)),i}atualizarControlesAgenda(o,i){this.verificarMedicoPreferencial(o),this.atualizarAgendaRespostas(o),o.forEach(n=>{const a=this.agendaRespostas.find(_=>_.unidade.id===n.unidade.id),d=this.filteredAgendaRespostas.find(_=>_.unidade.id===n.unidade.id),r=this.filteredAgendaRespostas.indexOf(d),c=this.unidadesNaoEncontradas.find(_=>_.unidade.id===n.unidade.id),m=a&&Object.keys(a.grupoAgenda).length>0||a.temAgenda;if(d)if(a&&(this.filteredAgendaRespostas[r]=a),a&&m){if(m&&(this.filteredAgendaRespostas[r].visivel=!0,this.filteredAgendaRespostas[r].isLoading=!0,c)){const _=this.unidadesNaoEncontradas.indexOf(c);this.unidadesNaoEncontradas.splice(_,1)}}else this.filteredAgendaRespostas[r].visivel=!1,c||this.unidadesNaoEncontradas.push(d)}),this.totalExames=this.model.exames.length,this.total=this.filteredAgendaRespostas?this.filteredAgendaRespostas.filter(n=>n.isLoading&&n.visivel).length:0,this.loadModel()}verMais(){this.startLoading(!1),this.firstIndex+=this.tamanhoPagina,this.lastIndex+=this.tamanhoPagina,this.getAgendaUnidade()}refreshWithoutMedicoPreferencia(){this.model.exames.forEach(o=>{o.medico=null}),super.syncModel(),this.ngOnInit()}validarGrupoAgendaSelecionada(o){let i=!0;return o||(i=!1),o.length<=0&&(i=!1),o.forEach(n=>{(!n.agendaId||0===n.agendaId||!n.horarioId||0===n.horarioId)&&(i=!1)}),i}atualizarEnderecoColetaDomiciliar(){this.model.endereco&&0===this.model.endereco.id&&this.registroService.getAllEnderecosPorProntuario("",this.domain).subscribe(o=>{const i=o.find(n=>n.cep===this.model.endereco.cep);i?(this.model.endereco.id=i.id,this.syncModel()):this.registroService.updateEndereco(this.user.usuarioSelecionado.prontuarioId,this.domain,this.model.endereco).subscribe(n=>{n&&(this.model.endereco.id=n,this.syncModel())},n=>{this.verifyError(n)})})}reservaAgenda(o){var i=this;return(0,U.Z)(function*(){var n,a,d,r,c;i.startLoading();let m=new l.kA0;if(T.G.getObject(i.STORAGE_KEY_LOGIN_UNIDADE)?(m=T.G.getObject(i.STORAGE_KEY_LOGIN_UNIDADE),i.filteredAgendaRespostas.push(m),i.selectedUnidadeId=m.unidade.id,T.G.removeItem(i.STORAGE_KEY_LOGIN_UNIDADE)):m=i.agendaRespostas.filter(f=>f.unidade.id===i.selectedUnidadeId)[0],i.model.reagendamento){let f=null!==(d=null===(a=null===(n=i.model)||void 0===n?void 0:n.agendamento)||void 0===a?void 0:a.agendamentoId)&&void 0!==d?d:null===(c=null===(r=i.model)||void 0===r?void 0:r.protocolo)||void 0===c?void 0:c.agendamentos[0].agendamentoId;m.grupoAgendaSelecionada.forEach(C=>C.agendamentoId=f)}i.model.exames.length>0&&m.grupoAgendaSelecionada.forEach(f=>{var C,x,A;f.exame.permiteVariosAgendamentos=null===(A=null===(x=null===(C=i.model)||void 0===C?void 0:C.exames)||void 0===x?void 0:x.find(P=>P.id==f.exame.id))||void 0===A?void 0:A.permiteVariosAgendamentos});const _=m.grupoAgendaSelecionada,p=m.grupoAgendaRepetida;if(!i.validarGrupoAgendaSelecionada(_))return i.stopLoading(),i.modalAlertService.open("warning","Aten\xe7\xe3o","Antes de continuar, selecione a data e o hor\xe1rio","button"),!1;let u=i.model.exames.concat(i.model.examesNaoAgendaveis);u.forEach(f=>f.data=m.data);try{let f=yield i.marcacaoService.getRestricaoQtdeExamePorEspecialidadeDia(i.domain,u);if(f)i.stopLoading(),i.modalAlertService.open("warning","Aten\xe7\xe3o",f,"button");else{i.mensagem="Efetuando reserva de horario...";const C=new l.IDb;C.reservaSelecionada=_,C.examesAc=m.examesAc,C.prontuarioId=i.user.usuarioSelecionado.prontuarioId,
1C.toJSON=function(){return C},p&&(C.grupoAgendaRepetida=p.filter(x=>x.horario===_[0].horario)),i.CriarOrcamento(),i.atualizarEnderecoColetaDomiciliar(),i.unidadeService.efetivarReservaAgendamento(i.domain,C).subscribe(x=>{x&&(C.reservaSelecionada=x,i.model.reserva=C,m.listTaxaColetaDomiciliar?(i.model.taxas=m.listTaxaColetaDomiciliar,i.model.taxas.forEach(A=>{A.toJSON=function(){return A}})):i.model.taxas=[],i.model.examesPacotes&&i.model.examesPacotes.length>0&&i.model.examesPacotes.forEach(A=>{A.unidade=m.unidade,A.data=m.data,A.horario=m.horario}),i.syncModel(),i.modelFinished.protocoloIdSelected=void 0,i.syncModelFinished(),i.marcacaoService.exibirEtapaDocumentosNoAgendamento?(i.getDataLayer("unidade","Unidade | Documento"),i.router.navigate(["/marcacao/documento"],{queryParamsHandling:"merge"})):(i.getDataLayer("unidade","Unidade | Resumo-Agendamento"),i.router.navigate(["/marcacao/resumo-agendamento"],{queryParamsHandling:"merge"})),i.stopLoading())},x=>{o&&(i.filteredAgendaRespostas=[],i.get()),i.verifyError(x)})}}catch(f){i.verifyError(f)}})()}getAgendaUnidadeData(o){this.startLoading(),this.isLoadedHorario=!0;const i=this.getAgenda([this.selectedUnidadeId],o);if(i.unidadeCD=this.model.unidadeCD,i.unidadeVacina=this.model.unidadeVacina,i.examesPacote=this.model.examesPacotes,this.model.endereco){const a=this.model.endereco.cep.replace("-","");a&&(i.faixaCepInicial=a.substr(0,5),i.faixaCepInicialExt=a.substr(5,3))}const n=this.filteredAgendaRespostas.find(a=>a.unidade.id===this.selectedUnidadeId);n&&(n.horarios=[],n.horario=null,n.selectedHorarios=[],n.grupoAgenda=void 0,n.grupoAgendaSelecionada=[]),this.unidadeService.getSugestaoAgendamentoItem(this.domain,i).subscribe(a=>{if(this.isLoadedHorario=!1,a&&n){this.displayExamesComRestricao=!1,this.examesComRestricao=[],this.filteredAgendaRespostas.find(r=>r.unidade.id===this.selectedUnidadeId).grupoAgendaRepetida=a.respostas[0].grupoAgendaRepetida,this.filteredAgendaRespostas.find(r=>r.unidade.id===this.selectedUnidadeId).total=a.respostas[0].total;let d=this.model.unidades.find(r=>r.id===n.unidade.id);d||(this.model.unidadeVacina&&(d=n.unidade.id===this.model.unidadeVacina.id?this.model.unidadeVacina:void 0),!d&&this.model.unidadeCD&&(d=n.unidade.id===this.model.unidadeCD.id?this.model.unidadeCD:void 0)),n.unidade=d,n.horarios=[],n.horario=a.respostas[0].horario,n.turno=a.respostas[0].turno,n.grupoAgenda=a.respostas[0].grupoAgenda,n.disabledDates=n.disabledDates.concat(a.respostas[0].disabledDates),n.examesComRestricao=a.respostas[0].examesComRestricao,n.examesAc=a.respostas[0].examesAc,n.listTaxaColetaDomiciliar=a.respostas[0].listTaxaColetaDomiciliar,n.examesComRestricao&&(this.examesComRestricao=n.examesComRestricao),this.examesComRestricao.length>0&&(this.displayExamesComRestricao=!0);for(const r in n.grupoAgenda){const c=new l.eaq;c.label=n.grupoAgenda[r][0].textoBotao,c.value=r,c.turno=this.getTurno(r),n.horarios.push(c)}n.turno&&n.turno.value&&this.onChangeTurno(this.setTurno?this.setTurno:n.turno.value,n),n.horario&&this.onChangeHorario(n),this.model.examesPacotes&&a.examesPacote&&(this.model.examesPacotes=a.examesPacote),this.model.desconto=a.descontoTaxa}this.stopLoading()},a=>{this.verifyError(a)})}loadModel(){this.filteredAgendaRespostas.forEach(i=>{i.horarios&&i.horarios.length>0&&this.onChangeTurno(this.setTurno?this.setTurno:i.turno.value,i)});const o=this.model.exames[0];if(o.unidade&&o.unidade.id){this.selectedUnidade=o.unidade,this.selectedUnidadeId=o.unidade.id,this.displayExamesComRestricao=!1,this.examesComRestricao=[];const i=this.filteredAgendaRespostas.find(n=>n.unidade.id===this.selectedUnidadeId);i&&(i.data=o.data,i.horario=o.horario,i.examesComRestricao&&(this.examesComRestricao=i.examesComRestricao),this.examesComRestricao.length>0&&(this.displayExamesComRestricao=!0)),this.isLoadedCalendario=!0}}agendaCalendarioDisponiveis(){const o=this.filteredAgendaRespostas.find(d=>d.unidade.id===this.selectedUnidadeId);this.displayExamesComRestricao=!1,0!==o.horarios.length&&(this.setTurno=o.horarios[0].turno.value),o.examesComRestricao&&(this.examesComRestricao=o.examesComRestricao),this.startLoading();let i=this.model.unidades.find(d=>d.id===this.selectedUnidadeId);this.model.domiciliar=this.model.unidadeCD&&i.id===this.model.unidadeCD.id||this.model.unidadeVacina&&i.id===this.model.unidadeVacina.id,this.model.domiciliar&&(o.grupoAgendaSelecionada[0].exame.especialidade=o.examesAc[0].especialidade),this.isLoadedCalendario=!1;const a=this.getAgenda([this.selectedUnidadeId],null==!o.grupoAgendaSelecionada?o.grupoAgendaSelecionada[0].dataBase:new Date);if(this.model.endereco){const d=this.model.endereco.cep.replace("-","");d&&(a.faixaCepInicial=d.substr(0,5),a.faixaCepInicialExt=d.substr(5,3))}this.unidadeService.getCalendarioDatasIndisponiveis(this.domain,a).subscribe(d=>{d&&(this.isLoadedCalendario=!0,o.disabledDates=d,this.examesComRestricao.length>0&&(this.displayExamesComRestricao=!0),this.displayContinuarComExamesParticular=!this.model.particular&&o.total>0&&this.model.plano.id!==this.model.planoFidelidade.id&&!this.model.convenio.parceiro),this.stopLoading()},d=>{this.verifyError(d),this.isLoadedCalendario=!0}),this.onChangeTurno(this.setTurno,o)}verificarResultadosUnidade(o){const i=this.filteredAgendaRespostas.find(d=>d.unidade.id===o.id),n=this.unidadesNaoEncontradas.find(d=>d.unidade.id===o.id);if(i&&i.grupoAgenda&&Object.keys(i.grupoAgenda).length>0||i.temAgenda)this.onClickUnidade(o);else{if(i&&(i.visivel=!1),n){const d=this.unidadesNaoEncontradas.indexOf(n);this.unidadesNaoEncontradas.splice(d,1)}this.model.endereco=void 0,super.syncModel(),this.abrirPopupEndereco(!0)}}getAgenda(o,i){const n=new l.Pkf;if(this.marcacaoService.exibirHorarios){if(void 0===this.model.plano&&(this.model.plano=this.marcacaoService.plano),n.convenioId=this.model.convenio.id,n.planoId=this.model.plano.id,n.exames=this.model.exames,n.origemRequisicao="autoagendamento",n.listPostoId=o,i&&(n.dataAgenda=i),this.model.examesNaoAgendaveis&&!n.exames.find(a=>a.id===this.model.exameAcId)&&this.model.examesNaoAgendaveis.length>0){const a=new l.TIN;a.id=this.model.exameAcId,a.nome="ANALISES CL\xcdNICAS",a.particular=this.model.examesNaoAgendaveis.filter(d=>d.particular).length>0,a.cobertoPeloConvenio=!(this.model.examesNaoAgendaveis.filter(d=>d.particular).length>0),a.planoId=a.particular?this.model.planoParticular.id:this.model.plano.id,a.permiteVariosAgendamentos=this.model.exameACPermiteVariosAgendamentos,n.exames.push(a)}return n.examesAc=this.model.examesNaoAgendaveis,n.profissionalSaude=this.model.profissionalSaude,n}}onSelectChangeData(o){this.getAgendaUnidadeData(o),this.displayCalendario=!1}onSelectOrdenacao(){this.cepFiltroSelecionado=!1,void 0===this.selectedUnidadeId&&("DT"===this.ordenacaoSelecionada.value?this.filteredAgendaRespostas.sort((o,i)=>o.unidade.distancia<i.unidade.distancia?-1:1):"CE"===this.ordenacaoSelecionada.value?this.abrirPopupCep():this.filteredAgendaRespostas.sort((o,i)=>o.examesComRestricao<i.examesComRestricao?-1:o.examesComRestricao>i.examesComRestricao?1:o.data<i.data?-1:o.data>i.data?1:o.horario<i.horario?-1:o.horario>i.horario?1:void 0))}recarregarTelaUnidades(){var o,i;let n=this.agendaRespostas.filter(r=>r.unidade.id===this.selectedUnidadeId);const a=JSON.parse(JSON.stringify(n[0].examesAc)),d=JSON.parse(JSON.stringify(n[0].grupoAgendaSelecionada));if(this.model.examesNaoAgendaveis){for(let r=0;r<a.length;r++)!isNaN(a[r].valor)&&0!==a[r].valor&&(this.model.examesNaoAgendaveis=this.model.examesNaoAgendaveis.filter(c=>c.id!==a[r].id),this.model.examesDomiciliares=this.model.examesDomiciliares.filter(c=>c.id!==a[r].id));this.model.examesNaoAgendaveis.length<=0&&(this.model.exames=this.model.exames.filter(r=>r.id!==this.model.exameAcId))}if(this.model.exames)for(let r=0;r<d.length;r++)!isNaN(d[r].valor)&&0!==d[r].valor&&(this.model.exames=this.model.exames.filter(c=>c.id!==d[r].exame.id));super.syncModel(),(null===(o=this.model.examesNaoAgendaveis)||void 0===o?void 0:o.length)>1||(null===(i=this.model.exames)||void 0===i?void 0:i.length)>1?(this.displayContinuarComExamesParticular=!1,this.displayExamesComRestricao=!1,this.displayExamesComMedicoPreferencial=!1,this.filteredAgendaRespostas=[],this.get()):this.goToPreviousStep()}goToPreviousStep(){this.syncClearModelIndividual(),this.model.reagendamento?(this.getDataLayer("unidade","Unidade | Meus-Agendamentos"),this.router.navigate(["/marcacao/meus-agendamentos"],{queryParamsHandling:"merge"})):(this.getDataLayer("unidade","Unidade | Exame"),this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"}))}goToNextStep(){var o,i,n,a;if(E.$.getUsuarioFromOperadora()&&(0===(null===(i=null===(o=this.user)||void 0===o?void 0:o.usuarioSelecionado)||void 0===i?void 0:i.peso)||0===(null===(a=null===(n=this.user)||void 0===n?void 0:n.usuarioSelecionado)||void 0===a?void 0:a.altura)))return this.modalAlertService.open("error","Aten\xe7\xe3o","Peso e Altura devem estar preenchidos para continuar!","button");if(this.model.examesPacotes&&this.model.examesPacotes.length>0){const c=this.agendaRespostas.filter(_=>_.unidade.id===this.selectedUnidadeId)[0].grupoAgendaSelecionada;if(this.totalExames-c.length>0)return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o \xe9 poss\xedvel seguir com o agendamento nesta unidade, existem exames que apresentam indisponibilidade.","button"),!1}if(!this.marcacaoService.matriculaConvenio||this.validarMatricula(this.marcacaoService.matriculaConvenio,this.marcacaoService.convenio.mascaraMatricula))return void 0===this.selectedUnidadeId?(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe uma unidade para continuar","button"),!1):void(this.isLoggedIn()?this.validarExames()?this.reservaAgenda():this.goToExames():(this.loginTelaUnidade(),this.abrirPopupLogin()));this.modalAlertService.open("warning","Aten\xe7\xe3o","Verifique a regra do campo matr\xedcula: "+this.marcacaoService.convenio.mensagem,"button")}goToExames(){this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}onSelectTurno(o){o?(this.filteredAgendaRespostas=[],this.agendaRespostas.forEach(i=>
1{const n=i.horarios.filter(a=>a.turno.value===o.value);n&&n.length>0&&(i.turno=o,i.horario=n[0].value,this.setTurno&&this.onChangeTurno(this.setTurno,i),this.setTurno||this.onChangeTurno(o.value,i),this.onChangeHorario(i))}),this.selectedTurno=this.turnos.find(i=>i.value===o.value)):(this.filteredAgendaRespostas=this.agendaRespostas.filter(i=>i.horarios.length>0),this.selectedTurno=void 0,this.selectedUnidade=void 0,this.selectedUnidadeId=void 0)}onUnselectTurno(){this.filteredAgendaRespostas=this.agendaRespostas.filter(o=>o.horarios.length>0),this.selectedTurno=void 0,this.selectedUnidade=void 0,this.selectedUnidadeId=void 0}onChangeTurno(o,i){this.setTurno&&(i.selectedHorarios=i.horarios.filter(n=>n.turno.value===this.setTurno)),o&&!this.setTurno&&(i.selectedHorarios=i.horarios.filter(n=>n.turno.value===o)),!o&&!this.setTurno&&(i.selectedHorarios=i.horarios)}onClickUnidade(o){var i,n;this.tipoAgenda=o.id===(null===(n=null===(i=this.model)||void 0===i?void 0:i.unidadeCD)||void 0===n?void 0:n.id)?"domiciliar":"unidade",this.examesComRestricao=[],this.selectedUnidadeId=+o.id,this.agendaCalendarioDisponiveis()}onSelectUnidade(o){this.examesComRestricao=[],o?(this.filteredAgendaRespostas=this.agendaRespostas.filter(i=>i.unidade.id===o.id),this.filteredAgendaRespostas.length||(this.filtradosProximidade=!1,this.getAgendaUnidade([o],!0)),this.selectedUnidadeId=+o.id,this.isLoadedCalendario=!0,this.agendaCalendarioDisponiveis()):(this.filteredAgendaRespostas=this.agendaRespostas.filter(i=>i.horarios.length>0),this.selectedUnidade=void 0,this.selectedUnidadeId=void 0,this.selectedTurno=void 0)}onUnselectUnidade(){this.filteredAgendaRespostas=this.agendaRespostas.filter(o=>o.horarios.length>0),this.selectedUnidade=void 0,this.selectedUnidadeId=void 0,this.selectedTurno=void 0}onChangeHorario(o){const i=this.filteredAgendaRespostas.find(a=>a.unidade.id===this.selectedUnidadeId);i.total=0,i.totalOriginal=0;const n=o.horarios.find(a=>a.value===o.horario);n&&(o.textoBotao=n.label),i&&(i.grupoAgendaSelecionada=i.grupoAgenda[o.horario],i.grupoAgendaSelecionada.forEach(a=>{i.totalOriginal+=a.valorOriginal,i.total+=a.valor}))}syncModel(){let o=this.model.unidades.find(n=>n.id===this.selectedUnidadeId);o||(this.model.unidadeCD&&(o=this.selectedUnidadeId===this.model.unidadeCD.id?this.model.unidadeCD:void 0),!o&&this.model.unidadeVacina&&(o=this.selectedUnidadeId===this.model.unidadeVacina.id?this.model.unidadeVacina:void 0));const i=this.filteredAgendaRespostas.find(n=>n.unidade.id===this.selectedUnidadeId);this.model.examesAgendados=[],i&&(i.grupoAgendaSelecionada.forEach(n=>{const a=new l.TIN;a.id=n.exame.id,a.nome=n.exame.nome,a.data=n.dataBase,a.horario=n.horario,a.valor=n.valor,a.cobertoPeloConvenio=n.atendeEsseExame,a.unidade=o,a.ordemExecucao=n.ordemExameGrupoExame,a.exameNecessitaAutorizacao=n.exameNecessitaAutorizacao,a.responsavelAutorizacao=n.responsavelAutorizacao,a.particular=n.exame.particular,a.termoCienciaOrientacaoId=n.exame.termoCienciaOrientacaoId,a.urlTermo=n.exame.urlTermo,a.especialidade=n.exame.especialidade,a.valorOriginal=n.valorOriginal,this.model.examesAgendados.push(a)}),this.model.domiciliar=this.model.unidadeCD&&o.id===this.model.unidadeCD.id||this.model.unidadeVacina&&o.id===this.model.unidadeVacina.id,null===this.model.domiciliar&&(this.model.domiciliar=!1),this.model.examesNaoAgendaveis&&(this.model.examesNaoAgendaveis.forEach(n=>{if(i.examesAc){const a=i.examesAc.find(d=>d.id===n.id);a&&(n.horario=a.horario,n.valor=a.valor,n.cobertoPeloConvenio=a.cobertoPeloConvenio,n.particular=a.particular)}}),this.model.examesAgendados=this.model.examesAgendados.sort((n,a)=>n.ordemExecucao-a.ordemExecucao),this.model.agendaItemSaida=[],this.model.turnos=this.turnos)),super.syncModel()}showUnidadeInformacoes(o){this.selectedInformacaoUnidadeId=o}hideUnidadeInformacoes(){this.selectedInformacaoUnidadeId=void 0}getValorExame(o){let i="";return o.valor?(i+=" R$ "+this.getFormatCurrency(o.valor),o.atendeEsseExame||(i+=this.model.convenio.parceiro?"":" - Procedimento Realizado no Particular")):o.atendeEsseExame||(i=" - NECESS\xc1RIO VALIDAR O PRE\xc7O DESTE PROCEDIMENTO"),i}getTurno(o){const i=new l.GvL;i.id=1,i.label="Manh\xe3",i.value="m";const n="2020-01-30T",a=new Date(n+o);return a>=new Date(n+"00:00")&&a<=new Date(n+"11:59")&&(i.id=1,i.label="Manh\xe3",i.value="m"),a>=new Date(n+"12:00")&&a<=new Date(n+"17:59")&&(i.id=2,i.label="Tarde",i.value="t"),a>=new Date(n+"18:00")&&a<=new Date(n+"23:59")&&(i.id=3,i.label="Noite",i.value="n"),a>=new Date(n+"00:00")&&a<new Date(n+"06:00")&&(i.id=4,i.label="Madrugada",i.value="d"),i}getExamesComRestricoes(){let o="";
1return this.examesComRestricao.forEach(i=>{o?o+=", "+i.nome:o=i.nome}),o}onCloseLogin(){this.eventCloseLogin.unsubscribe(),this.isLoggedIn()&&this.goToNextStep()}getRespostas(o=!1){return this.filteredAgendaRespostas.filter(i=>i.visivel&&this.verificaSeDomiciliar(i.unidade.id)===o)}verificaSeDomiciliar(o){return!!(this.model.unidadeCD&&this.model.unidadeCD.id===o||this.model.unidadeVacina&&this.model.unidadeVacina.id===o)}abrirPopupEndereco(o=!1){this.ofertaColetaDomiciliar=0,this.enderecoService.openPopup(o),this.eventCloseEndereco=this.enderecoService.onClose.subscribe(()=>{this.onCloseEndereco()})}abrirPopupCep(){this.cepService.openPopup(),this.eventCloseCep=this.cepService.onClose.subscribe(()=>{this.onCloseCep()})}onCloseEndereco(){if(this.eventCloseEndereco.unsubscribe(),this.loadModelBase(),this.model.endereco){let o=this.verificarVacina()?this.model.unidadeVacina:this.model.unidadeCD;const i=this.filteredAgendaRespostas.find(n=>n.unidade.id===o.id);i&&(i.visivel=!0,this.isLoadedCalendario=!1,i.unidade.nome="ATENDIMENTO DOMICILIAR",i.unidade.cep=this.model.endereco.cep,i.unidade.endereco=this.model.endereco.endereco+", "+this.model.endereco.numero+" - "+this.model.endereco.cidade,i.unidade.numero=this.model.endereco.numero,i.unidade.bairro=this.model.endereco.bairro,i.unidade.cidade=this.model.endereco.cidade,i.unidade.estado=this.model.endereco.estado),this.getAgendaUnidade([o])}}onCloseCep(){if(this.eventCloseCep.unsubscribe(),this.loadModelBase(),this.model.endereco.cep){const o=new l.oaE;o.exames=this.model.exames,o.examesAc=this.model.examesNaoAgendaveis,o.origemRequisicao="autoagendamento",o.endereco=this.model.endereco,o.cep=this.model.endereco.cep,this.getUnidadesProximasPorCep(o)}else this.ordenacaoSelecionada=this.ordenacao[0],this.onSelectOrdenacao()}buscarLoteUnidades(o=!1){let i=[],n=!1;for(let a=0;a<this.loteBuscaHorarios&&!n;a++){this.posicionarContador(o),o=!1;const d=this.model.unidades[this.contador];d?i.push(d):n=!0}return i}posicionarContador(o=!1){let i=this.model.unidades[this.contador],n=!o||this.verificaSeDomiciliar(i.id);for(;n&&this.contador<this.model.unidades.length;)this.contador++,i=this.model.unidades[this.contador],n=!!i&&this.verificaSeDomiciliar(i.id)}abrirPopupLogin(){this.eventCloseLogin=this.loginService.onClose.subscribe(o=>{this.onCloseLogin()}),this.exibirPopupLogin()}verificarVacina(){return!!this.model.exames&&this.model.exames.filter(o=>!!o.especialidade&&"VACINA"===o.especialidade.toUpperCase()).length>0}prepararUnidadesReagendamento(){this.verificaSeReagendamentoDomiciliar()&&(this.filteredAgendaRespostas.forEach(o=>{o.visivel=!1}),this.abrirPopupEndereco())}verificaSeReagendamentoDomiciliar(){if(!this.model.protocolo&&!this.model.agendamento)return!1;const o=this.verificaSeReagendamentoProtocolo()?this.model.protocolo.agendamentos[0].unidadeId:this.model.agendamento.unidadeId;return this.model.reagendamento&&this.verificaSeDomiciliar(o)}verificaSeReagendamentoProtocolo(){return this.model.reagendamento&&void 0!==this.model.protocolo}getUnidadesProximasPorCep(o){this.startLoading(!0),this.unidadeService.getUnidadesProximas(!1,this.domain,o).subscribe(i=>{for(let n=0;n<i.length;n++){const a=this.filteredAgendaRespostas.find(r=>r.unidade.id===i[n].id),d=this.filteredAgendaRespostas.indexOf(a);-1!=d&&(this.filteredAgendaRespostas[d].unidade.distanciaCep=i[n].distancia,this.filteredAgendaRespostas[d].unidade.referenciaDistanciaCep=o.cep)}this.filteredAgendaRespostas.sort((n,a)=>n.unidade.distanciaCep<a.unidade.distanciaCep?-1:1),this.cepFiltroSelecionado=!0,this.stopLoading()},i=>{this.verifyError(i),this.ordenacaoSelecionada=this.ordenacao[0],this.onSelectOrdenacao()})}abrirCalendario(){this.displayCalendario=!0}fecharCalendario(){this.displayCalendario=!1}abrirHorarios(){this.displayHorarios=!0}fecharHorarios(){this.displayHorarios=!1}changeButtonTurno(o,i){const n=o.target,a=document.getElementsByClassName("btnTurno");for(let d=0;d<a.length;d++)a[d].classList.remove("btn-primary"),a[d].classList.add("btn-light");n.classList.remove("btn-light"),n.classList.add("btn-primary"),this.mobile&&(this.displayHorarios=!0),this.setTurno=i}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(Z.b4))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-unidade"]],features:[e.qOj],decls:13,vars:7,consts:[["class","row",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary",3,"disabled","click"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase","ms-3",3,"disabled","click"],[3,"value","onClose"],[4,"ngIf"],[1,"row"],["class","col-12",4,"ngIf"],["class","col-12 mt-md-0 mt-3",4,"ngIf"],[1,"col-12"],[1,"col-12","mt-md-0","mt-3"],[1,"p-3"],[1,"col-sm-12","col-md-8"],[1,"fw-bold"],["class","col-sm-12 col-md-4 text-end",4,"ngIf"],["class","row",4,"ngFor","ngForOf"],[1,"col-sm-12","col-md-4","text-end"],[1,"span-text","fw-bold","dark-blue-text"],["o
1ptionLabel","label","styleClass","text-start",3,"options","ngModel","ngModelChange","onChange"],[1,"text-danger"],[1,"col-12",3,"click"],["styleClass","panel-content","id","dom",3,"collapsed"],[1,"w-100"],[1,"col-xl-1","col-lg-1","col-md-2","col-sm-12","text-center"],["value","1",3,"ngModel","ngModelChange"],[1,"col-xl-11","col-lg-11","col-md-10","col-sm-12","text-start"],[1,"hand","hand-fw-bold","text-sm-h5"],[1,"fas","fa-home","title-icon","me-1","text-primary"],["styleClass","card-footer selected text-center text-sm-size"],["styleClass","panel-content",3,"id","collapsed"],["class","col-xl-1 col-lg-1 col-md-2 col-sm-12 text-center",4,"ngIf"],["class","col-xl-1 col-lg-1 col-md-2 col-sm-12",4,"ngIf"],[1,"col-xl-10","col-lg-9","col-md-8","col-sm-12","text-start"],[1,"flex"],["class","hand hand-fw-bold",3,"click",4,"ngIf"],["class","hand hand-fw-bold",4,"ngIf"],["class","row d-md-flex ",4,"ngIf"],[1,"row","d-md-flex"],[1,"d-none","d-sm-block","pe-1","pt-1"],["class","fas fa-edit text-primary",3,"click",4,"ngIf"],["class","row d-md-flex fw-bold mt-0",4,"ngIf"],[1,"col-xl-1","col-lg-2","col-sm-12","text-end","resume","text-gray"],[3,"styleClass",4,"ngIf"],["styleClass","card-footer disabled text-center",4,"ngIf"],["name","optSelectedUnidade",3,"value","ngModel","inputId","ngModelChange","onClick"],[1,"col-xl-1","col-lg-1","col-md-2","col-sm-12"],[1,"pi","pi-spin","pi-spinner",2,"font-size","3em"],[1,"hand","hand-fw-bold",3,"click"],[1,"fas","fa-home","title-icon","pe-1","text-primary"],[1,"hand","hand-fw-bold"],["class","fw-bold dark-blue-text",4,"ngIf"],[1,"fw-bold","dark-blue-text"],[1,"fas","fa-edit","text-primary",3,"click"],[1,"row","d-md-flex","fw-bold","mt-0"],[1,""],["class","me-l",4,"ngIf"],[1,"me-l"],[1,"col-12","pt-0","mt-0"],["class","legenda pb-2",4,"ngIf"],["class","row mt-0",4,"ngIf"],[3,"class",4,"ngIf"],["class","col-xl-7 col-lg-7 col-md-12 col-sm-12 p-fluid pt-0 mt-0",4,"ngIf"],["class","col-xl-7 col-lg-7 col-md-12 col-sm-12 pt-0 mt-0",4,"ngIf"],[1,"legenda","pb-2"],["class","row text-start",4,"ngFor","ngForOf"],[1,"row","text-start"],[1,"col-12","mt-0","mb-0","pt-1","pb-1"],[1,"badge","bg-light","text-dark","px-3"],["class","col-12 mt-0 mb-0 pt-0 pb-1 text-gray",4,"ngIf"],[1,"col-12","mt-0","mb-0","pt-0","pb-1","text-gray"],[1,"row","mt-0"],[1,"col-12","mt-0"],[1,"legenda"],[1,"col-md-10"],[1,"row","m-0"],[1,"col-md-6","box-info"],[1,"col-md-3","margin-border","position-relative"],[1,"fas","fa-calendar-alt","fa-2x","text-primary","hand",3,"click"],["class","calandario text-start",4,"ngIf"],["class","w-100 mt-2",4,"ngIf"],[1,"calandario","text-start"],[1,"fas","fa-times","fa-lg",3,"click"],[3,"ngModel","inline","locale","minDate","disabledDates","disabled","ngModelChange","onSelect"],[1,"w-100","mt-2"],[3,"options","ngModel","ngModelChange","onChange"],["class","btn btn-sm btn-light mx-1 btnTurno",3,"id","click",4,"ngFor","ngForOf"],[1,"btn","btn-sm","btn-light","mx-1","btnTurno",3,"id","click"],[1,"col-xl-7","col-lg-7","col-md-12","col-sm-12","p-fluid","pt-0","mt-0"],[1,"col-12","ps-0","pt-0","mt-0"],[1,"col-xl-7","col-lg-7","col-md-12","col-sm-12","pt-0","mt-0"],["class","text-start w-100",4,"ngIf"],[1,"text-start","w-100"],[1,"text-danger","small"],[3,"styleClass"],[1,"fas","fa-calendar-alt"],[1,"fas","fa-clock"],["styleClass","card-footer disabled text-center"],["class","col-xl-1 col-lg-1 col-md-2 col-sm-12",3,"click",4,"ngIf"],[1,"col-xl-9","col-lg-9","col-md-6","col-sm-12","text-start"],["class","fas fa-home title-icon pe-1 text-primary",4,"ngIf"],["class","d-md-flex ",4,"ngIf"],[1,"d-md-flex"],["href","javascript:void(0)",3,"click",4,"ngIf"],["class"," d-md-flex fw-bold mt-0",4,"ngIf"],[1,"col-xl-2","col-lg-2","col-md-4","col-sm-12","text-center","resume","text-gray"],[1,"col-xl-1","col-lg-1","col-md-2","col-sm-12",3,"click"],[1,"pi","pi-exclamation-circle","hand",2,"font-size","3em"],["href","javascript:void(0)",3,"click"],["class","fas fa-info-circle",4,"ngIf"],[1,"fas","fa-info-circle"],[1,"d-md-flex","fw-bold","mt-0"],[1,"",3,"ngClass"],["class","ml-2",4,"ngIf"],[1,"ml-2"],[1,"pl-3"],[1,"title","text-primary"],[1,"col-12","pt-0","my-3"],["styleClass","card-footer danger text-center hand",3,"click",4,"ngIf"],[1,"row","mt-2"],["class","col-xl-12 col-lg-12 col-md-12 col-sm-12 p-fluid pt-0 mt-0",4,"ngIf"],["class","col-xl-12 col-lg-12 col-md-12 col-sm-12 pt-0 mt-0",4,"ngIf"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start"],[1,"col-md-10","mt-0","mb-0","pt-1","pb-1"],[1,"badge","bg-light","text-dark","px-3","quebrarLinhaExames"],["class","mt-2-10 mb-0 pt-0 pb-1 text-gray",4,"ngIf"],[1,"mt-2-10","mb-0","pt-0","pb-1","text-gray"],[1,"badge","bg-light","text-dark","px-3","quebrarLinhaExamesAC"],["class","btn btn-sm mx-1 btnTurno",3,"ngClass","id","click",4,"ngFor","ngForOf"],[1,"btn","btn-sm","mx-1","btnTurno",3,"ngClass","id","click"],["styleClass","card-footer danger text-center hand",3,"click"],[1,"col-xl-12","col-lg-12","col-md-12","col-sm-12","p-fluid","pt-0","mt-0"],[1,"col-xl-12","col-lg-12","col-md-12","col-sm-12","pt-0","mt-0"],["class","w-100",4,"ngIf"],["class","w-100 mobile",4,"ngIf"],[1,"w-100","mobile"],[1,"col-lg-12"],["styleClass","panel-content disabled",3,"id","collapsed"],[1,"col-xl-1","col-lg-1","col-md-2","col-sm-12","text-center","d-none"],["name","optSelectedUnidade",3,"value","ngModel","inputId","disabled","ngModelChange","onClick"],[1,"col-xl-12","col-lg-12","col-md-12","col-sm-12","text-start"],[1,"d-none","d-sm-block"],["header","ATEN\xc7\xc3O",3,"visible","modal","responsive","baseZIndex","closable","visibleChange"],[1,"row","mt-3"],["id","modelVoltarRestricao","type","button",1,"btn","btn-secondary",3,"disabled","click"],["id","modelProsseguirRestricao","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],["header","Procedimento(s) n\xe3o coberto pelo conv\xeanio",3,"visible","modal","responsive","baseZIndex","closable","visibleChange"],["id","modelVoltarParaExame","type","button",1,"btn","btn-secondary",3,"disabled","click"],["id","modelProsseguirComExamesParticulares","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],["id","modelVoltarRestricao","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"]],template:function(o,i){1&o&&(e.YNc(0,Un,3,2,"div",0),e.TgZ(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"button",5),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(6,"Voltar"),e.qZA(),e.TgZ(7,"button",6),e.NdJ("click",function(){return i.goToNextStep()}),e._uU(8,"Continuar"),e.qZA()()()()(),e.TgZ(9,"app-unidade-informacao",7),e.NdJ("onClose",function(){return i.hideUnidadeInformacoes()}),e.qZA(),e.YNc(10,Nn,16,11,"div",8),e.YNc(11,yn,13,10,"div",8),e.YNc(12,qn,14,10,"div",8)),2&o&&(e.Q6J("ngIf",i.marcacaoService.exibirHorarios),e.xp6(
15),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("value",i.selectedInformacaoUnidadeId),e.xp6(1),e.Q6J("ngIf",i.displayExamesComRestricao),e.xp6(1),e.Q6J("ngIf",i.displayContinuarComExamesParticular),e.xp6(1),e.Q6J("ngIf",i.displayExamesComMedicoPreferencial))},dependencies:[h.mk,h.sg,h.O5,v.JJ,v.On,Z.h4,se.Lt,y.Z,z.UN,oe.EU,V.f,k.V,he.s,G],styles:[".resume{font-size:11px}.resume span{font-size:14px;margin-top:3px}.resume span.title{font-weight:700;font-size:17px;margin-top:0}@media (max-width: 479px){.resume{font-size:.46rem}.resume span{font-size:11px}.resume span.title{font-size:14px}}@media (max-width: 1024px){.resume{font-size:9px}.resume span{font-size:12px}.resume span.title{font-size:15px}}.calandario{position:absolute;z-index:99;left:0;box-shadow:1px 1px 5px #333;background:#fff;padding:2%;margin-left:-2%}.calandario .p-datepicker{border:none;display:contents}.calandario .p-calendar{margin-top:40px}.calandario .fa-times{position:absolute;margin-right:10px;margin-top:10px;cursor:pointer;z-index:9;right:0}.mobile{position:absolute;z-index:99;left:0;box-shadow:1px 1px 5px #333;background:#fff;padding:40px 20px 20px}.mobile .fa-times{position:absolute;margin-right:10px;top:15px;right:0;cursor:pointer;z-index:9}.quebrarLinhaExamesAC{white-space:pre-wrap;line-height:1.5;text-align:left}.quebrarLinhaExames{white-space:pre-wrap;text-align:left}\n"],encapsulation:2}),t})();var de=g(2340),re=g(1989);function kn(t,s){1&t&&e._UZ(0,"div",8),2&t&&e.Q6J("innerHTML",s.$implicit,e.oJD)}function Dn(t,s){if(1&t&&(e.TgZ(0,"span")(1,"div",4)(2,"div",5)(3,"label",6),e._uU(4),e.qZA()()(),e.YNc(5,kn,1,1,"div",7),e.qZA()),2&t){const o=s.$implicit;e.xp6(4),e.Oqu(o.exameNome),e.xp6(1),e.Q6J("ngForOf",o.preparos)}}const Fn=function(){return{width:"90%",overflow:"hidden"}};function On(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",1)(1,"p-dialog",2),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.display=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.clear())}),e.YNc(2,Dn,6,2,"span",3),e.qZA()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(7,Fn)),e.Q6J("visible",o.display)("modal",!0)("responsive",!0)("baseZIndex",1e4),e.xp6(1),e.Q6J("ngForOf",o.models)}}let j=(()=>{class t extends Q.b{set value(o){if(o){this.models=[];const i=new l.Bl4;i.exameId=o.id,i.exameNome=o.nome,this.models.push(i),this.getPreparos(o.id)}}set values(o){o&&o.length>0&&(this.models=[],o.forEach(i=>{const n=new l.Bl4;n.exameId=i.id,n.exameNome=i.nome,this.models.push(n)}),this.getPreparosAC(this.models.map(i=>i.exameId)))}set protocoloId(o){o&&(this.models=[],this.getPreparosACProtocoloId(o))}constructor(o){super(o),this.onClose=new e.vpe,this.exameService=o.get(l.q07)}ngOnInit(){this.clear()}clear(){this.models=void 0,this.display=!1,this.onClose.emit()}getPreparos(o){this.startLoading(),this.exameService.getPreparos(o,this.domain).subscribe(i=>{this.stopLoading(),this.display=!0,this.models[0].preparos=i.preparos},i=>{this.verifyError(i)})}getPreparosAC(o){this.startLoading(),this.exameService.getPreparosAC(this.domain,o).subscribe(i=>{this.stopLoading(),this.display=!0,i.forEach(n=>{const a=this.models.find(d=>d.exameId===n.exameId);a&&(a.preparos=n.preparos)})},i=>{this.verifyError(i)})}getPreparosACProtocoloId(o){this.startLoading(),this.exameService.getPreparosACProtocoloId(o,this.domain).subscribe(i=>{this.stopLoading(),this.display=!0,this.models=i},i=>{this.verifyError(i)})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-preparo-informacao"]],inputs:{value:"value",values:"values",protocoloId:"protocoloId"},outputs:{onClose:"onClose"},features:[e.qOj],decls:1,vars:1,consts:[["class","preparo-inner-html",4,"ngIf"],[1,"preparo-inner-html"],["header","Preparos",3,"visible","modal","responsive","baseZIndex","visibleChange","onHide"],[4,"ngFor","ngForOf"],[1,"row","mt-1","pb-1","margin-bottom-border"],[1,"col-12","mt-1-0","pb-0"],[1,"fw-bold"],["class","row mt-1 pb-1 margin-bottom-border",3,"innerHTML",4,"ngFor","ngForOf"],[1,"row","mt-1","pb-1","margin-bottom-border",3,"innerHTML"]],template:function(o,i){1&o&&e.YNc(0,On,3,8,"div",0),2&o&&e.Q6J("ngIf",i.models&&i.models.length>0)},dependencies:[h.sg,h.O5,k.V],styles:[".preparo-inner-html .row p{width:100%}\n"],encapsulation:2}),t})();function Hn(t,s){1&t&&(e.TgZ(0,"div",13),e._uU(1,"Efetuando reserva do(s) exame(s)..."),e.qZA())}function Qn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"a",22),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.gerarPreparo())}),e._uU(2,"Consultar preparo"),e.qZA()()}}function Ln(t,s){1&t&&e._UZ(0,"em",44)}function Rn(t,s){1&t&&e._UZ(0,"em",45)}function Yn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",35),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.showExamesAc=!n.showExamesAc)}),e.YNc(1,Ln,1,0,"em",42),e.YNc(2,Rn,1,0,"em",43),e.qZA()}if(2&t){const o=e.oxw(3);e.xp6(1),e.Q6J("ngIf",o.showExamesAc),e.xp6(1),e.Q6J("ngIf",!o.showExamesAc)}}function Gn(t,s){1&t&&(e.TgZ(0,"span",46),e._uU(1,"(Drive-Thru)"),e.qZA())}function Kn(t,s){if(1&t&&(e.TgZ(0,"b"),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(1),e.hij(" e participa\xe7\xe3o de R$ ",i.getFormatCurrency(o.valor),"")}}function $n(t,s){if(1&t&&(e.TgZ(0,"small",47),e._uU(1," Coberto pelo conv\xeanio "),e.YNc(2,Kn,2,1,"b",17),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(2),e.Q6J("ngIf",+o.valor>0)}}function Vn(t,s){if(1&t&&(e.TgZ(0,"b"),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(1),e.hij("Pre\xe7o Particular R$ ",i.getFormatCurrency(o.valor),"")}}function Bn(t,s){1&t&&(e.TgZ(0,"b"),e._uU(1,"Confira o pre\xe7o na central de atendimento"),e.qZA())}function zn(t,s){if(1&t&&(e.TgZ(0,"small",48),e._uU(1," N\xe3o coberto pelo conv\xeanio. "),e.YNc(2,Vn,2,1,"b",17),e.YNc(3,Bn,2,0,"b",17),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(2),e.Q6J("ngIf",+o.valor>0),e.xp6(1),e.Q6J("ngIf",0==+o.valor)}}function jn(t,s){if(1&t&&(e.TgZ(0,"div",23)(1,"label",50),e._uU(2),e.qZA()()),2&t){const o=s.$implicit;e.xp6(2),e.Oqu(o.nome)}}function Wn(t,s){if(1&t&&(e.TgZ(0,"div")(1,"div",49),e.YNc(2,jn,3,1,"div",19),e.qZA()()),2&t){const o=e.oxw(3);e.xp6(2),e.Q6J("ngForOf",o.examesNaoAgendaveis)}}function Xn(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"a",51),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(2);return e.KtG(a.confirm(n))}),e._UZ(2,"em",52),e.qZA()()}}function ea(t,s){1&t&&e._UZ(0,"em",53)}function oa(t,s){if(1&t&&(e.TgZ(0,"div")(1,"span"),e._UZ(2,"em",54),e._uU(3),e.qZA()()),2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.xp6(3),e.hij(" ",i.getPreferenciaMedico(o)," ")}}function ia(t,s){if(1&t&&(e.TgZ(0,"b",57),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(1),e.hij("Pre\xe7o Particular R$ ",i.getFormatCurrency(o.valorOriginal),"")}}function ta(t,s){1&t&&e._UZ(0,"br")}
1function na(t,s){if(1&t&&(e.TgZ(0,"b"),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(1),e.hij("Pre\xe7o Particular R$ ",i.getFormatCurrency(o.valor),"")}}function aa(t,s){if(1&t&&(e.TgZ(0,"b"),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(1),e.hij("Pre\xe7o R$ ",i.getFormatCurrency(o.valor),"")}}function sa(t,s){1&t&&(e.TgZ(0,"b"),e._uU(1,"Confira o pre\xe7o na central de atendimento"),e.qZA())}function da(t,s){1&t&&(e.TgZ(0,"b"),e._uU(1,"Exame no pacote"),e.qZA())}function ra(t,s){if(1&t&&(e.TgZ(0,"div",55),e.YNc(1,ia,2,1,"b",56),e.YNc(2,ta,1,0,"br",17),e.YNc(3,na,2,1,"b",17),e.YNc(4,aa,2,1,"b",17),e.YNc(5,sa,2,0,"b",17),e.YNc(6,da,2,0,"b",17),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",+o.valorOriginal>+o.valor),e.xp6(1),e.Q6J("ngIf",+o.valorOriginal>+o.valor),e.xp6(1),e.Q6J("ngIf",+o.valor>0&&!i.model.convenio.parceiro),e.xp6(1),e.Q6J("ngIf",+o.valor>0&&i.model.convenio.parceiro),e.xp6(1),e.Q6J("ngIf",0==+o.valor&&!i.examesPacote),e.xp6(1),e.Q6J("ngIf",0==+o.valor&&i.examesPacote)}}function ca(t,s){if(1&t&&(e.TgZ(0,"b"),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(1),e.hij("Pre\xe7o R$ ",i.getFormatCurrency(o.valor),"")}}function la(t,s){1&t&&(e.TgZ(0,"b"),e._uU(1,"Confira o pre\xe7o na central de atendimento"),e.qZA())}function ma(t,s){if(1&t&&(e.TgZ(0,"div",55),e.YNc(1,ca,2,1,"b",17),e.YNc(2,la,2,0,"b",17),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",+o.valor>0),e.xp6(1),e.Q6J("ngIf",0==+o.valor)}}
1function _a(t,s){1&t&&(e.TgZ(0,"div",58),e._uU(1," Exame sem cobertura pelo seu plano de sa\xfade. Verifique com o seu plano se existe possibilidade de reembolso. "),e.qZA())}function pa(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",59)(1,"p-checkbox",60),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.selectedTermo=n)}),e.qZA(),e.TgZ(2,"span",61),e._uU(3,"Declaro que li e aceito o "),e.TgZ(4,"b")(5,"a",62),e._uU(6,"Termo de Ci\xeancia e Orienta\xe7\xe3o"),e.qZA()(),e._uU(7," para paciente e/ou respons\xe1vel."),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("binary",!0)("ngModel",o.selectedTermo),e.xp6(4),e.Q6J("href",i.FazerDownload(o.id),e.LSH)}}function ua(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",23)(1,"div",24)(2,"div",25)(3,"div",26)(4,"h2",27),e._uU(5),e.YNc(6,Yn,3,2,"a",28),e.YNc(7,Gn,2,0,"span",29),e.qZA(),e.YNc(8,$n,3,1,"small",30),e.YNc(9,zn,4,2,"small",31),e.YNc(10,Wn,3,1,"div",17),e.qZA(),e.TgZ(11,"div",32),e.YNc(12,Xn,3,0,"div",17),e.qZA()(),e.TgZ(13,"div",33),e._UZ(14,"em",34),e._uU(15),e.TgZ(16,"a",35),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(2);return e.KtG(d.showUnidadeInformacoes(a.unidade.id))}),e.YNc(17,ea,1,0,"em",36),e.qZA()(),e.TgZ(18,"div")(19,"span"),e._UZ(20,"em",37),e._uU(21),e.qZA()(),e.TgZ(22,"div")(23,"span"),e._UZ(24,"em",38),e._uU(25),e.qZA()(),e.YNc(26,oa,4,1,"div",17),e.YNc(27,ra,7,6,"div",39),e.YNc(28,ma,3,2,"div",39),e.YNc(29,_a,2,0,"div",40),e.YNc(30,pa,8,3,"div",41),e.qZA()()}if(2&t){const o=s.$implicit,i=e.oxw(2);e.xp6(5),e.hij("",o.nome," "),e.xp6(1),e.Q6J("ngIf","AN\xc1LISES CLINICAS"===o.especialidade),e.xp6(1),e.Q6J("ngIf",o.driveThru),e.xp6(1),e.Q6J("ngIf",o.cobertoPeloConvenio&&!o.particular&&!i.model.particular&&!i.model.profissionalSaude&&0==+o.valor),e.xp6(1),e.Q6J("ngIf",!(o.cobertoPeloConvenio||o.particular||i.model.particular||i.model.plano.id===i.model.planoFidelidade.id||i.model.convenio.parceiro)),e.xp6(1),e.Q6J("ngIf","AN\xc1LISES CLINICAS"===o.especialidade&&i.showExamesAc&&i.examesNaoAgendaveis.length),e.xp6(2),e.Q6J("ngIf",!i.model.reagendamento),e.xp6(3),e.hij(" Unidade: ",o.unidade.nome," "),e.xp6(2),e.Q6J("ngIf","ATENDIMENTO DOMICILIAR"!=o.unidade.nome),e.xp6(4),e.hij(" Data: ",i.getFormatDateName(o.data),""),e.xp6(4),e.hij(" Hor\xe1rio: ",i.getHorario(o),""),e.xp6(1),e.Q6J("ngIf",o.preferenciaMedicoGenero||o.medico),e.xp6(1),e.Q6J("ngIf",o.particular||i.model.particular||+o.valor>0),e.xp6(1),e.Q6J("ngIf",!o.cobertoPeloConvenio&&!o.particular&&!i.model.particular&&i.model.plano.id===i.model.planoFidelidade.id),e.xp6(1),e.Q6J("ngIf",!o.cobertoPeloConvenio&&!i.model.particular&&i.model.plano.id!==i.model.planoFidelidade.id&&!i.model.convenio.parceiro),e.xp6(1),e.Q6J("ngIf",o.termoCienciaOrientacaoId>0)}}function ga(t,s){if(1&t&&(e.TgZ(0,"div",23)(1,"div",24)(2,"div",25)(3,"div",26)(4,"h2",27),e._uU(5,"Exames do Pacote:"),e.qZA(),e.TgZ(6,"label",50),e._uU(7),e.qZA()()()()()),2&t){const o=e.oxw(3);e.xp6(7),e.Oqu(o.getExamesLaboratoriais(o.examesDentroDoPacote,!1))}}function ha(t,s){if(1&t&&(e.TgZ(0,"section",63),e.YNc(1,ga,8,1,"div",64),e.qZA()),2&t){const o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",o.examesNaoAgendaveis&&o.examesNaoAgendaveis.length>0&&!1===o.domiciliar)}}function fa(t,s){if(1&t&&(e.TgZ(0,"section",63)(1,"div",23)(2,"div",24)(3,"div",25)(4,"div",26)(5,"h2",27),e._uU(6),e.qZA(),e.TgZ(7,"label",50),e._uU(8),e.qZA()()()()()()),2&t){const o=e.oxw(2);e.xp6(6),e.hij("",o.examesDomiciliares[0].especialidade,":"),e.xp6(2),e.Oqu(o.getExamesLaboratoriais(o.examesDomiciliares,!1))}}function va(t,s){if(1&t&&(e.TgZ(0,"span",74),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(1),e.hij(" R$ ",i.getFormatCurrency(o.valor)," ")}}function xa(t,s){1&t&&(e.TgZ(0,"span",77),e._uU(1," Coberto pelo conv\xeanio "),e.qZA())}function Ca(t,s){if(1&t&&(e.TgZ(0,"div",23)(1,"div",73)(2,"span",74),e._uU(3),e.qZA(),e.YNc(4,va,2,1,"span",75),e.YNc(5,xa,2,0,"span",76),e.qZA()()),2&t){const o=s.$implicit;e.xp6(3),e.Oqu(o.nome),e.xp6(1),e.Q6J("ngIf",o.valor),e.xp6(1),e.Q6J("ngIf",!o.valor)}}function Aa(t,s){if(1&t&&(e.TgZ(0,"div",69)(1,"div",33),e._uU(2," Taxas "),e.qZA(),e.TgZ(3,"div",33),e._uU(4),e.qZA()()),2&t){const o=e.oxw(3);e.xp6(4),e.hij(" R$ ",o.getFormatCurrency(o.totalTaxas)," ")}}function ba(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",78),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.goToNextStep(""))}),e._uU(1,"Pagar Online"),e.qZA()}if(2&t){const o=e.oxw(3);e.Q6J("disabled",o.isLoading)}}function Ta(t,s){if(1&t&&(e.TgZ(0,"section",65)(1,"div",66)(2,"h2",27),e._uU(3,"Exame(s) a ser(em) pago(s)"),e.qZA()(),e.YNc(4,Ca,6,3,"div",19),e.TgZ(5,"div",67),e.YNc(6,Aa,5,1,"div",68),e.TgZ(7,"div",69)(8,"div",70),e._uU(9," Total "),e.qZA(),e.TgZ(10,"div",70),e._uU(11),e.qZA()(),e.TgZ(12,"div",71),e.YNc(13,ba,2,1,"button",72),e.qZA()()()),2&t){const o=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",o.exames),e.xp6(2),e.Q6J("ngIf",o.totalTaxas>
10),e.xp6(5),e.hij(" R$ ",o.getFormatCurrency(o.totalPayment)," "),e.xp6(2),e.Q6J("ngIf",!o.user.backoffice&&!o.agendamentoIndividual&&null!=o.publicKey)}}function Za(t,s){if(1&t&&(e.TgZ(0,"span",74),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(1),e.hij(" R$ ",i.getFormatCurrency(o.valor)," ")}}function Ea(t,s){1&t&&(e.TgZ(0,"span",77),e._uU(1," Coberto pelo conv\xeanio "),e.qZA())}function Ia(t,s){if(1&t&&(e.TgZ(0,"div",23)(1,"div",73)(2,"span",74),e._uU(3),e.qZA(),e.YNc(4,Za,2,1,"span",75),e.YNc(5,Ea,2,0,"span",76),e.qZA()()),2&t){const o=s.$implicit;e.xp6(3),e.Oqu(o.nome),e.xp6(1),e.Q6J("ngIf",o.valor),e.xp6(1),e.Q6J("ngIf",!o.valor)}}function Pa(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",78),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.goToNextStep(""))}),e._uU(1,"Pagar Online"),e.qZA()}if(2&t){const o=e.oxw(3);e.Q6J("disabled",o.isLoading)}}function wa(t,s){if(1&t&&(e.TgZ(0,"section",65)(1,"div",66)(2,"h2",27),e._uU(3,"Pacote(s) a ser(em) pago(s)"),e.qZA()(),e.YNc(4,Ia,6,3,"div",19),e.TgZ(5,"div",67)(6,"div",69)(7,"div",33),e._uU(8," Taxas "),e.qZA(),e.TgZ(9,"div",33),e._uU(10),e.qZA()(),e.TgZ(11,"div",69)(12,"div",33),e._uU(13," Total "),e.qZA(),e.TgZ(14,"div",33),e._uU(15),e.qZA()(),e.TgZ(16,"div",71),e.YNc(17,Pa,2,1,"button",72),e.qZA()()()),2&t){const o=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",o.examesPacote),e.xp6(6),e.hij(" R$ ",o.getFormatCurrency(o.totalTaxas)," "),e.xp6(5),e.hij(" R$ ",o.getFormatCurrency(o.totalPaymentPacote)," "),e.xp6(2),e.Q6J("ngIf",!o.user.backoffice)}}function Ma(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",85)(1,"div",86)(2,"input",89),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.pessoaIndicada=n)}),e.qZA()()()}if(2&t){const o=e.oxw(3);e.xp6(2),e.Q6J("ngModel",o.pessoaIndicada)("disabled",o.indicacaoReagendamento)}}const Je=function(t){return{"btn-primary text-white":t}};function Ua(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"section",65)(1,"div",79)(2,"div",80)(3,"div",81)(4,"div",82)(5,"div",83)(6,"span",50),e._UZ(7,"em",84),e._uU(8," Ajude quem te indicou a ganhar pontos!"),e.qZA()(),e.TgZ(9,"div",83)(10,"span",50),e._uU(11,"Como voc\xea chegou at\xe9 n\xf3s?"),e.qZA()(),e.TgZ(12,"div",83)(13,"span",50),e._uU(14,"Foi indica\xe7\xe3o?"),e.qZA()(),e.TgZ(15,"div",85)(16,"div",86)(17,"button",87),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onChangeFidelidade(0))}),e._uU(18," Sim "),e.qZA(),e.TgZ(19,"button",87),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onChangeFidelidade(1))}),e._uU(20," N\xe3o "),e.qZA()()(),e.YNc(21,Ma,3,2,"div",88),e.qZA()()()()()}if(2&t){const o=e.oxw(2);e.xp6(17),e.Q6J("ngClass",e.VKq(5,Je,0==o.fidelidadeSelecionada&&!o.indicacaoReagendamento))("disabled",o.indicacaoReagendamento),e.xp6(2),e.Q6J("ngClass",e.VKq(7,Je,1==o.fidelidadeSelecionada&&!o.indicacaoReagendamento))("disabled",o.indicacaoReagendamento),e.xp6(2),e.Q6J("ngIf",o.showIndicacaoFidelidade)}}function Na(t,s){if(1&t&&(e.TgZ(0,"div",14)(1,"div",15)(2,"h1",16),e._uU(3,"Confirme os dados do agendamento"),e.qZA(),e.YNc(4,Qn,3,0,"div",17),e.qZA(),e.TgZ(5,"section",18),e.YNc(6,ua,31,16,"div",19),e.qZA(),e.YNc(7,ha,2,1,"section",20),e.YNc(8,fa,9,2,"section",20),e.YNc(9,Ta,14,4,"section",21),e.YNc(10,wa,18,4,"section",21),e.YNc(11,Ua,22,9,"section",21),e.qZA()),2&t){const o=e.oxw();e.xp6(4),e.Q6J("ngIf",!o.model.reagendamento),e.xp6(2),e.Q6J("ngForOf",o.exames),e.xp6(1),e.Q6J("ngIf",o.examesPacote&&o.examesPacote.length>0),e.xp6(1),e.Q6J("ngIf",o.examesDomiciliares&&o.examesDomiciliares.length>0&&!0===o.domiciliar),e.xp6(1),e.Q6J("ngIf",!o.examesPacote),e.xp6(1),e.Q6J("ngIf",o.examesPacote&&o.examesPacote.length>0),e.xp6(1),e.Q6J("ngIf",o.habilitaProgramaFidelidade())}}function Sa(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",90),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep("pagarunidade"))}),e._uU(1,"CONFIRMAR AGENDAMENTO"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}function ya(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",91),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep(""))}),e._uU(1),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading),e.xp6(1),e.Oqu(o.getTextoBotaoAvancar())}}let qa=(()=>{class t extends w.a{constructor(o){super(o),this.fidelidadeSelecionada=-1,this.showIndicacaoFidelidade=!1,this.pessoaIndicada="",this.indicacaoReagendamento=!1,this.showTotalExames=!0,this.toggleTotalExamesText="(Ver menos)",this.coletaDomicilar=!1,this.agendamentoIndividual=!1,this.showExamesAc=!1,this.router=o.get(b.F0),this.confirmationService=o.get(Z.YP),this.resumoService=o.get(l.Q2b),this.meusAgendamentosService=o.get(l.t0i),this.preferenciasMedicoService=o.get(l.B4n),this.autorizacaoService=o.get(l.Rdc),this.homeService=o.get(l.igG),this.pagamentoService=o.get(l.eTo),this.termoService=o.get(l.Zfh),this.documentosService=o.get(ie.c),this.termoProntuarioService=o.get(l.skb),this.load()}load(){this.verificaPermissaoTela(),this.totalPayment=0,this.totalPaymentPacote=0,this.totalTaxas=0,this.hasPayment=!1,this.selectedTermo=!1,this.exames=this.model.examesAgend
1ados,this.examesNaoAgendaveis=this.model.examesNaoAgendaveis,this.model.medico=new l.Aq2,this.today=new Date,this.domiciliar=this.model.domiciliar,this.examesDomiciliares=this.model.examesDomiciliares,this.examesDentroDoPacote=[],setTimeout(()=>{this.ajustaAltura()},2e3),void 0!==T.G.getItem(this.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL)&&T.G.setItem(this.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL,0),null!==this.modelIndividual&&(this.agendamentoIndividual=!0),this.minDatePedido=this.addDays(new Date,this.model.convenio.diasValidadePedidoMedico>0?-this.model.convenio.diasValidadePedidoMedico:-180),this.model.examesAgendados||this.router.navigate(["/"],{queryParamsHandling:"merge"}),this.examesComRestricao.forEach(o=>{this.exames=this.exames.filter(i=>i.id!==o.id)}),this.model.examesPacotes&&this.model.examesPacotes.length>0&&(this.examesPacote=this.model.examesPacotes),this.examesNaoAgendaveis&&this.examesNaoAgendaveis.length>0&&Object.assign(this.examesDentroDoPacote,this.examesNaoAgendaveis.filter(o=>0===o.valor)),this.exames.forEach(o=>{this.totalPayment+=o.valor,this.coletaDomicilar="ATENDIMENTO DOMICILIAR"===o.unidade.nome,o.id!==this.model.exameAcId&&0===o.valor&&this.examesDentroDoPacote.push(o),this.examesPacote&&o.valor>0&&this.examesPacote.push(o),this.model.exames.forEach(i=>{o.nome===i.nome&&(o.termoCienciaOrientacaoId=i.termoCienciaOrientacaoId,o.urlTermo=i.urlTermo)})}),this.model.taxas.forEach(o=>{this.totalTaxas+=o.taxa}),this.model.examesPacotes&&this.model.examesPacotes.length>0&&this.model.examesPacotes.forEach(o=>{this.totalPaymentPacote+=o.valor}),this.totalPayment+=this.totalTaxas,this.totalPaymentPacote+=this.totalTaxas,(this.totalPayment>0||this.totalPaymentPacote>0)&&(this.hasPayment=!0),-1===this.exames.findIndex(o=>o.id===this.model.exameAcId)&&!1===this.model.domiciliar&&(this.examesNaoAgendaveis=[]),(0,J.D)(this.pagamentoService.getChavePublica(this.exames[0].unidade.id,this.domain)).subscribe(o=>{this.publicKey=o[0]}),this.homeService.getDataLayer(this.domain).subscribe(o=>{this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o}),this.model.possuiIndicacaoProgramaFidelidade?(this.pessoaIndicada=this.model.possuiIndicacaoProgramaFidelidade,this.fidelidadeSelecionada=0,this.indicacaoReagendamento=!0,this.showIndicacaoFidelidade=!0,this.onChangeFidelidade(0)):this.onChangeFidelidade(1)}getExamesACForaDoPacote(){return this.examesNaoAgendaveis.filter(o=>!this.examesDentroDoPacote.find(i=>i===o))}FazerDownload(o){return`${de.N.apiBaseUrl}/api/${this.domain}/Termo/FazerDownloadTermo?id=${o}&isTermo=false&${E.$.getJwTQueryToken()}`}gerarPreparo(){this.startLoading(),this.reserva=[],this.exames.forEach(i=>{const n=this.model.reserva.reservaSelecionada.find(a=>a.exame.id===i.id);n.exame=i,this.reserva.push(n)}),this.model.reserva.examesAc&&this.model.reserva.examesAc.forEach(i=>{const n=new l.ZWf;n.postoId=this.model.reserva.reservaSelecionada[0].postoId,n.planoId=i.particular?this.model.reserva.reservaSelecionada[0].planoId:this.model.plano.id,n.exame=i,n.valor=i.valor,n.exame.particular=!i.cobertoPeloConvenio,this.reserva.push(n)});const o=new l.IzA;o.marcacao=this.model,o.reserva=this.reserva,o.prontuarioId=this.user.usuarioSelecionado.prontuarioId,this.resumoService.gerarPreparoAgendamento(this.domain,o).subscribe(i=>{i&&(this.router.navigate([]).then(n=>{window.open(i,"_blank")}),this.syncModel()),this.stopLoading()})}getTextoBotaoAvancar(){return(this.totalPayment>0||this.totalPaymentPacote>0)&&!this.coletaDomicilar&&this.publicKey&&!this.user.backoffice?"Pagar Online":"CONCLUIR AGENDAMENTO"}getHorario(o){const i=this.model.reserva.reservaSelecionada.find(n=>n.exame.id===o.id);return i&&i.textoBotao?i.textoBotao:o.horario}addDays(o,i){return o.setDate(o.getDate()+i),o}agendarExames(o){if(this.exames.findIndex(i=>i.termoCienciaOrientacaoId>0)>-1&&this.exames.findIndex(i=>i.termoCienciaOrientacaoId>0&&!0!==i.selectedTermo)>-1)return this.modalAlertService.open("warning","Aten\xe7\xe3o","\xc9 necess\xe1rio concordar com o Termo de Ci\xeancia e Orienta\xe7\xe3o","button"),!1;if(this.exames.findIndex(i=>i.termoCienciaOrientacaoId>0)>-1&&this.exames.findIndex(i=>i.termoCienciaOrientacaoId>0&&!0!==i.selectedTermo)>-1)return this.modalAlertService.open("warning","Aten\xe7\xe3o","\xc9 necess\xe1rio concordar com o Termo de Ci\xeancia e Orienta\xe7\xe3o","button"),!1;if(this.exames.findIndex(i=>i.termoCienciaOrientacaoId>0)>-1&&this.exames.findIndex(i=>i.termoCienciaOrientacaoId>0&&!0!==i.selectedTermo)>-1)return this.modalAlertService.open("warning","Aten\xe7\xe3o","\xc9 necess\xe1rio concordar com o Termo de Ci\xeancia e Orienta\xe7\xe3o","button"),!1;if(this.startLoading(!1),this.model.reagendamento){const i=new l.x1_;i.agendamentos=[],this.model.protocolo?i.agendamentos=this.model.protocolo.agendamentos:this.model.agendamento&&i.agendamentos.push(this.model.agendamento),this.model.endereco&&i.agendamentos.forEach(n=>
1{n.idEnderecoColetaDomiciliar=this.model.endereco.id}),this.reagendar(i,o)}else{this.reserva=[],this.exames.forEach(n=>{const a=this.model.reserva.reservaSelecionada.find(d=>d.exame.id===n.id);a.exame=n,this.reserva.push(a)}),this.model.reserva.examesAc&&this.model.reserva.examesAc.forEach(n=>{const a=new l.ZWf;a.postoId=this.model.reserva.reservaSelecionada[0].postoId,a.planoId=n.particular?this.model.reserva.reservaSelecionada[0].planoId:this.model.plano.id,a.exame=n,a.valor=n.valor,a.exame.particular=n.particular,this.reserva.push(a)});const i=new l.IzA;if(i.marcacao=this.model,i.reserva=this.reserva,i.prontuarioId=this.user.usuarioSelecionado.prontuarioId,i.nomeIndicacaoFidelidade=this.pessoaIndicada,i.labApoiado=this.user.backoffice&&this.user.username?this.user.username:"",this.model.reagendamento){const n=new l.x1_;n.agendamentos=[],this.model.protocolo?n.agendamentos=this.model.protocolo.agendamentos:this.model.agendamento&&n.agendamentos.push(this.model.agendamento),i.reagendar=n,this.reagendar(n,"")}else this.resumoService.confirmarReservaAgendamento(this.domain,i).subscribe(n=>{if(this.stopLoading(),n){const a=new l.IDb;a.reservaSelecionada=this.reserva,this.model.reserva=a,this.model.examesAgendados=this.exames,this.model.protocoloIdSelected=n.protocoloId,this.model.pagamentoEmAndamento=n.pagamentoEmAndamento,this.model.pagamentoEfetuadoComSucesso=n.pagamentoEfetuadoComSucesso,this.model.erroPagamento=n.erroPagamento,this.model.documentosEnviados=n.documentosEnviados,this.model.linkInstrucao=n.linkInstrucao,this.syncModel(),this.cleanModelFinished(),this.syncClearModelIndividual(),this.modelFinished=this.model;const d=this.marcacaoService.exibirEtapaDocumentosNoAgendamento;this.hasPayment&&this.getPermitePagamentoOnline()&&"pagarunidade"!==o&&!this.user.backoffice?(this.modelFinished.exibirAlertaPagamento=!0,this.syncModelFinished(),(d||this.model.documentos&&this.model.documentos.length>0)&&this.enviarDocumentos(n.protocoloId,this.user.usuarioSelecionado.prontuarioId),this.getDataLayer("resumo-agendamento","Resumo-Agendamento | Pagamento"),this.router.navigate(["/marcacao/pagamento"],{queryParamsHandling:"merge"})):(this.syncModelFinished(),this.modelFinished.exibirAlertaPagamento=!1,(d||this.model.documentos&&this.model.documentos.length>0)&&this.enviarDocumentos(n.protocoloId,this.user.usuarioSelecionado.prontuarioId),this.getDataLayer("resumo-agendamento","Resumo-Agendamento | Agendamento-Concluido"),this.router.navigate(["/marcacao/agendamento-concluido"],{queryParamsHandling:"merge"}))}},n=>{this.verifyError(n)})}}reagendar(o,i){const n=[];o.agendamentos.forEach(d=>{const r=this.model.reserva.reservaSelecionada.find(m=>m.exame.id===d.exameId),c=this.model.examesAgendados.find(m=>m.id===d.exameId);r||this.modalAlertService.open("warning","Aten\xe7\xe3o","Reserva para o agendamento n\xe3o encontrada!","button"),c||this.modalAlertService.open("warning","Aten\xe7\xe3o","Exame n\xe3o encontrado na lista!","button"),c&&r&&n.push(r)});const a=new l.IzA;a.reagendar=o,a.reserva=n,a.prontuarioId=this.user.usuarioSelecionado.prontuarioId,a.nomeIndicacaoFidelidade=this.pessoaIndicada,this.meusAgendamentosService.reagendar(this.domain,a).subscribe(d=>{this.stopLoading(),this.model.protocoloIdSelected=o.agendamentos[0].protocoloId,this.modelFinished=this.model,this.modelFinished.linkInstrucao=d.linkInstrucao,this.cleanModel(),this.syncModel(),this.syncModelFinished(),!this.model.domiciliar&&this.hasPayment&&this.getPermitePagamentoOnline()&&"pagarunidade"!==i?(this.modelFinished.exibirAlertaPagamento=!0,this.syncModelFinished(),this.router.navigate(["/marcacao/pagamento"],{queryParamsHandling:"merge"})):(this.syncModelFinished(),this.modelFinished.exibirAlertaPagamento=!1,this.router.navigate(["/marcacao/agendamento-concluido"],{queryParamsHandling:"merge"}))},d=>{this.verifyError(d)})}ngOnInit(){this.changeStep(this.marcacaoService.exibirEtapaDocumentosNoAgendamento?4:3)}removeExame(o){o.id===this.model.exameAcId&&(this.model.examesNaoAgendaveis=[]),this.model.examesAgendados.find(i=>
1i.id===o.id)&&this.model.examesAgendados.splice(this.model.examesAgendados.findIndex(i=>i.id===o.id),1),this.exames.find(i=>i.id===o.id)&&this.exames.splice(this.exames.findIndex(i=>i.id===o.id),1),this.exames.length<1&&(this.model.exames=[],this.modalAlertService.open("warning","Aten\xe7\xe3o","Sua lista de exames esta vazia, insira novos exames para prosseguir.","button"),this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})),this.syncModel()}goToNextStep(o){if(!this.validoParaAgendarExames()||!this.validarFidelidade())return!1;this.termoProntuarioService.verificarTermoProntuarioAtivo(1,this.domain).subscribe(i=>{if(i.termoEstaAtivo){let a=i.mensagem,d=new l.POH;d.idTermoProntuario=i.termoProntuarioId,this.confirmationService.confirm({message:a,header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{d.resposta=!0,this.termoProntuarioService.responderTermoProntuario(this.domain,d).subscribe(r=>{this.agendarExames(o)})},reject:()=>{d.resposta=!1,this.termoProntuarioService.responderTermoProntuario(this.domain,d).subscribe(r=>{this.agendarExames(o)})}})}else this.agendarExames(o)})}validarFidelidade(){return-1===this.fidelidadeSelecionada?(this.modalAlertService.open("warning","Aten\xe7\xe3o","\xc9 necess\xe1rio selecionar Sim ou N\xe3o no item Programa de Fidelidade","button"),!1):0!==this.fidelidadeSelecionada||""!==this.pessoaIndicada||(this.modalAlertService.open("warning","Aten\xe7\xe3o","\xc9 necess\xe1rio digitar o nome da pessoa que te indicou","button"),!1)}validoParaAgendarExames(){return!(this.exames.findIndex(o=>o.termoCienciaOrientacaoId>0)>-1&&this.exames.findIndex(o=>o.termoCienciaOrientacaoId>0&&!0!==o.selectedTermo)>-1&&(this.modalAlertService.open("warning","Aten\xe7\xe3o","\xc9 necess\xe1rio concordar com o Termo de Ci\xeancia e Orienta\xe7\xe3o.","button"),1))}goToPreviousStep(){this.marcacaoService.exibirEtapaDocumentosNoAgendamento?(this.getDataLayer("resumo-agendamento","Resumo-Agendamento | Documento"),this.router.navigate(["/marcacao/documento"],{queryParamsHandling:"merge"})):(this.getDataLayer("resumo-agendamento","Resumo-Agendamento | Unidade"),this.router.navigate(["/marcacao/unidade"],{queryParamsHandling:"merge"}))}confirm(o){this.confirmationService.confirm({message:"Deseja cancelar o agendamento deste exame?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.removeExame(o)}})}showPreparoInformacoes(o){this.model.exameAcId===o.id||"ATENDIMENTO DOMICILIAR"===o.nome||"ANALISES CL\xcdNICAS"===o.nome?this.selectedExamePreparoAC=this.model.examesNaoAgendaveis:this.selectedExamePreparo=o}hidePreparoInformacoes(){this.selectedExamePreparo=void 0,this.selectedExamePreparoAC=void 0}showUnidadeInformacoes(o){this.selectedInformacaoUnidadeId=o}hideUnidadeInformacoes(){this.selectedInformacaoUnidadeId=void 0}toggleTotalExames(){this.showTotalExames=!this.showTotalExames,this.toggleTotalExamesText=this.showTotalExames?"(Ver menos)":"(Ver mais)"}getClassIconExame(o){return"VACINA"===o?"fas fa-syringe title-icon":"AN\xc1LISES CLINICAS"===o?"fas fa-vial title-icon":"fas fa-file-medical-alt title-icon"}ajustaAltura(){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){const o=[];I(".resumoAgendamento .p-card-content").each(function(){I(this).attr("style",""),o.push(I(this).height())});const i=Math.max.apply(Math,o);I(".resumoAgendamento .p-card-content").each(function(){I(this).height(i+"px")})}}onChangeFidelidade(o){this.fidelidadeSelecionada=o,this.showIndicacaoFidelidade=0===o}enviarDocumentos(o,i){this.model.documentos.forEach(n=>{if(!n.url){const a=new te.t({image:n.fileBase64,tipo:n.tipo,fileName:n.nome,mimeType:n.mimeType,protocolo:o,prontuario:i,lastModified:n.ultimaModificacao});this.documentosService.saveFile(a)}})}habilitaProgramaFidelidade(){return"True"===this.getSetting("HabilitaProgramaFidelidade")}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-resumo-agendamento"]],features:[e._Bn([Z.YP]),e.qOj],decls:14,vars:8,consts:[[1,"row","resumoAgendamento"],["class","col-12",4,"ngIf"],["class","col-12 mt-3",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"],["id","modelConcluir","type","button","class","btn btn-primary",3,"disabled","click",4,"ngIf"],["id","modelContinuar","type","button","class","btn btn-primary text-uppercase",3,"disabled","click",4,"ngIf"],["header","Confirmation","acceptLabel","Sim","rejectLabel","N\xe3o"],[3,"value","values","onClose"],[3,"value","onClose"],[1,"col-12"],[1,"col-12","mt-3"],[1,"d-flex","flex-column","flex-md-row","px-3","px-lg-0","
1justify-content-between"],[1,"fs-6","fw-bold","py-2"],[4,"ngIf"],[1,"bg-white","px-3","py-0"],["class","px-2",4,"ngFor","ngForOf"],["class","bg-white px-3 py-0 mt-3",4,"ngIf"],["class","bg-white px-3 py-0 pb-2 mt-3",4,"ngIf"],["href","javascript:void(0)","title","Consultar preparo",1,"btn","btn-info","btn-sm",3,"click"],[1,"px-2"],[1,"d-flex","flex-column","gap-2","py-4","border-bottom"],[1,"d-flex","flex-row","justify-content-between"],[1,"d-flex","flex-column","gap-1"],[1,"fs-6","fw-bold","m-0","p-0"],["href","javascript:void(0)",3,"click",4,"ngIf"],["class","text-warning ms-2",4,"ngIf"],["class","text-success",4,"ngIf"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","align-items-end","gap-2"],[1,""],[1,"fa","fa-map-marker-alt","me-2","opacity-25"],["href","javascript:void(0)",3,"click"],["class","fas fa-info-circle opacity-25",4,"ngIf"],[1,"fa","fa-calendar","me-2","opacity-25"],[1,"fas","fa-clock","me-2","opacity-25"],["class","text-warning bold",4,"ngIf"],["class","bold",4,"ngIf"],["class","div-footer termo-de-ciencia-e-orientacao",4,"ngIf"],["class","fas fa-chevron-up",4,"ngIf"],["class","fas fa-chevron-down",4,"ngIf"],[1,"fas","fa-chevron-up"],[1,"fas","fa-chevron-down"],[1,"text-warning","ms-2"],[1,"text-success"],[1,"text-danger"],[1,"bg-light","px-3","py-2"],[1,"subtitle"],["href","javascript:void(0)",1,"text-dark",3,"click"],[1,"fas","fa-trash"],[1,"fas","fa-info-circle","opacity-25"],[1,"fas","fa-user-md","me-2","opacity-25"],[1,"text-warning","bold"],["class","texto-tachado",4,"ngIf"],[1,"texto-tachado"],[1,"bold"],[1,"div-footer","termo-de-ciencia-e-orientacao"],["name","checkboxTermo",3,"binary","ngModel","ngModelChange"],[1,"ms-3"],["target","_blank",1,"hand-underline",2,"text-decoration","underline",3,"href"],[1,"bg-white","px-3","py-0","mt-3"],["class","px-2",4,"ngIf"],[1,"bg-white","px-3","py-0","pb-2","mt-3"],[1,"d-flex","flex-column","gap-2","px-2","py-4"],[1,"d-flex","flex-column","gap-3","px-2","py-3"],["class","d-flex flex-row justify-content-between subtitle small-size",4,"ngIf"],[1,"d-flex","flex-row","justify-content-between","subtitle","small-size"],[1,"fw-bold"],[1,"d-flex","flex-row","justify-content-end","small-size","my-4"],["id","modelContinuar","type","button","class","btn btn-info",3,"disabled","click",4,"ngIf"],[1,"d-flex","flex-row","justify-content-between","border-bottom","py-2"],[1,"subtitle","small-size"],["class","subtitle small-size",4,"ngIf"],["class","subtitle small-size text-success",4,"ngIf"],[1,"subtitle","small-size","text-success"],["id","modelContinuar","type","button",1,"btn","btn-info",3,"disabled","click"],[1,"row","mt-0"],[1,"col-12","mt-0","p-fluid"],[1,"row","m-0"],[1,"col-12","mt-0","text-center"],[1,"row","pb-2"],[1,"fas","fa-solid","fa-briefcase","subtitle"],[1,"row","pb-2","text-center"],[1,"d-flex","col-md-6","offset-md-3","gap-4","text-center"],["name","fidelidade",1,"btn","btn-outline-primary","py-2","button-flex-1",3,"ngClass","disabled","click"],["class","row pb-2 text-center",4,"ngIf"],["type","text","placeholder","Digite o nome da pessoa que indicou","maxlength","200",1,"form-control","outline-none",3,"ngModel","disabled","ngModelChange"],["id","modelConcluir","type","button",1,"btn","btn-primary",3,"disabled","click"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Hn,2,0,"div",1),e.YNc(2,Na,12,7,"div",2),e.qZA(),e.TgZ(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"button",7),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(8,"Voltar"),e.qZA(),e.YNc(9,Sa,2,1,"button",8),e.YNc(10,ya,2,2,"button",9),e.qZA()()()(),e._UZ(11,"p-confirmDialog",10),e.TgZ(12,"app-preparo-informacao",11),e.NdJ("onClose",function(){return i.hidePreparoInformacoes()}),e.qZA(),e.TgZ(13,"app-unidade-informacao",12),e.NdJ("onClose",function(){return i.hideUnidadeInformacoes()}),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(5),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("ngIf",!i.user.backoffice),e.xp6(1),e.Q6J("ngIf",i.user.backoffice),e.xp6(2),e.Q6J("value",i.selectedExamePreparo)("values",i.selectedExamePreparoAC),e.xp6(1),e.Q6J("value",i.selectedInformacaoUnidadeId))}
1,dependencies:[h.mk,h.sg,h.O5,v.Fj,v.JJ,v.nD,v.On,F.Q,re.XZ,G,j],styles:[".termo-de-ciencia-e-orientacao{width:100%;padding:20px;border-radius:3px;background:#D6EEF8 0% 0% no-repeat padding-box;border:1px solid #d3d3d3;box-shadow:1px 1px 1px 1px #0000000d;text-align:left;margin-top:10px}.termo-de-ciencia-e-orientacao span{font-size:12px;margin-left:0;margin-top:2px}.resumoAgendamento .autocomplete-search span.clear.clear-dd{right:35px!important}\n"],encapsulation:2}),t})();var fe=g(529),W=g(5991),Ja=g(330),ka=g(9230);function Da(t,s){if(1&t&&(e.TgZ(0,"div",12),e._uU(1),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Oqu(o.mensagem)}}function Fa(t,s){if(1&t&&(e.TgZ(0,"span",29),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.Oqu(o.label)}}const Oa=function(t,s,o,i){return{"p-steps-incomplete":t,"p-steps-complete":s,"p-state-highlight p-steps-current":o,"p-helper-hidden":i}};function Ha(t,s){if(1&t&&(e.TgZ(0,"li",25)(1,"a",26)(2,"span",27),e._uU(3),e.qZA(),e.YNc(4,Fa,2,1,"span",28),e.qZA()()),2&t){const o=s.$implicit,i=e.oxw(2);e.Q6J("ngClass",e.l5B(3,Oa,i.activeStepLine<+o.id,i.activeStepLine>+o.id,i.activeStepLine>=+o.id,!1===o.visible)),e.xp6(3),e.Oqu(o.id),e.xp6(1),e.Q6J("ngIf",!i.mobile)}}function Qa(t,s){1&t&&(e.TgZ(0,"div"),e._uU(1," Documento j\xe1 enviado. "),e.qZA())}function La(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",40)(1,"p"),e._uU(2," Tire uma foto do seu documento (Frente e Verso) "),e.TgZ(3,"a",41),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.showQuaisDocumentosSaoValidos())}),e._UZ(4,"em",42),e._uU(5,"\xa0Quais documentos s\xe3o v\xe1lidos? "),e.qZA()()()}}const K=function(t){return{background:t,"background-size":"cover","aspect-ratio":"1/1"}};function Ra(t,s){if(1&t&&e._UZ(0,"div",52),2&t){const o=e.oxw().$implicit;e.Q6J("ngStyle",e.VKq(1,K,"url("+o.thumbnailUrl+") no-repeat center center"))}}function Ya(t,s){if(1&t&&(e.TgZ(0,"div",53),e._UZ(1,"img",54),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hYB("src","data:",o.thumbMimeType,";base64,",o.thumbBase64,"",e.LSH)}}function Ga(t,s){1&t&&(e.TgZ(0,"div",55)(1,"a",56),e._UZ(2,"em",57),e.qZA()())}function Ka(t,s){if(1&t&&(e.TgZ(0,"a",58),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()),2&t){const o=e.oxw().$implicit;e.s9C("href",o.url,e.LSH)}}function $a(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.openContentInNewTab(n))}),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()}}function Va(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43),e.YNc(1,Ra,1,3,"div",44),e.YNc(2,Ya,2,2,"div",45),e.YNc(3,Ga,3,0,"div",46),e.TgZ(4,"div",47),e.YNc(5,Ka,3,1,"a",48),e.YNc(6,$a,3,0,"a",49),e.TgZ(7,"a",50),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.confirm(a))}),e._UZ(8,"em",51),e._uU(9," Remover "),e.qZA()()()}if(2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.nome.includes(".pdf")&&o.thumbnailUrl),e.xp6(1),e.Q6J("ngIf",!o.thumbnailUrl&&!o.nome.includes(".pdf")),e.xp6(1),e.Q6J("ngIf",o.nome.includes(".pdf")),e.xp6(2),e.Q6J("ngIf",o.url),e.xp6(1),e.Q6J("ngIf",!o.url&&o.fileBase64)}}function Ba(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",30)(1,"div",31)(2,"h4",32),e._UZ(3,"span",33),e._uU(4,". Documento de Identifica\xe7\xe3o"),e.qZA(),e.YNc(5,Qa,2,0,"div",11),e.qZA(),e.YNc(6,La,6,0,"div",34),e.TgZ(7,"div",31)(8,"input",35,36),e.NdJ("change",function(){e.CHM(o);const n=e.MAs(9),a=e.oxw(2);return a.onUploadFile(n.files,7),e.KtG(a.clearFile(n))}),e.qZA(),e.TgZ(10,"button",37),e.NdJ("click",function(){e.CHM(o);const n=e.MAs(9);return e.KtG(n.click())}),e._UZ(11,"em",38),e._uU(12," Adicionar "),e.qZA()(),e.YNc(13,Va,10,5,"div",39),e.ALo(14,"filterFor"),e.qZA()}if(2&t){const o=e.oxw(2);e.xp6(5),e.Q6J("ngIf",!o.verificaSePossuiDocumentos(7)),e.xp6(1),e.Q6J("ngIf",o.verificaSePossuiDocumentos(7)),e.xp6(4),e.Q6J("disabled",o.isLoading),e.xp6(3),e.Q6J("ngForOf",e.Dn7(14,4,o.model.documentos,"tipo",7))}}function za(t,s){1&t&&(e.TgZ(0,"div"),e._uU(1," Documento j\xe1 enviado. "),e.qZA())}function ja(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",40)(1,"p"),e._uU(2," Tire uma foto de sua carteira de conv\xeanio (Frente e Vers
1o) "),e.TgZ(3,"a",41),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.showQuaisDocumentosSaoValidos())}),e._UZ(4,"em",42),e._uU(5,"\xa0Quais documentos s\xe3o v\xe1lidos? "),e.qZA()()()}}function Wa(t,s){if(1&t&&e._UZ(0,"div",52),2&t){const o=e.oxw().$implicit;e.Q6J("ngStyle",e.VKq(1,K,"url("+o.thumbnailUrl+") no-repeat center center"))}}function Xa(t,s){if(1&t&&(e.TgZ(0,"div",53),e._UZ(1,"img",54),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hYB("src","data:",o.thumbMimeType,";base64,",o.thumbBase64,"",e.LSH)}}function es(t,s){1&t&&(e.TgZ(0,"div",55)(1,"a",56),e._UZ(2,"em",57),e.qZA()())}function os(t,s){if(1&t&&(e.TgZ(0,"a",58),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()),2&t){const o=e.oxw().$implicit;e.s9C("href",o.url,e.LSH)}}function is(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.openContentInNewTab(n))}),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()}}function ts(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43),e.YNc(1,Wa,1,3,"div",44),e.YNc(2,Xa,2,2,"div",45),e.YNc(3,es,3,0,"div",46),e.TgZ(4,"div",47),e.YNc(5,os,3,1,"a",48),e.YNc(6,is,3,0,"a",49),e.TgZ(7,"a",50),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.confirm(a))}),e._UZ(8,"em",51),e._uU(9," Remover "),e.qZA()()()}if(2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.nome.includes(".pdf")&&o.thumbnailUrl),e.xp6(1),e.Q6J("ngIf",!o.thumbnailUrl&&!o.nome.includes(".pdf")),e.xp6(1),e.Q6J("ngIf",o.nome.includes(".pdf")),e.xp6(2),e.Q6J("ngIf",o.url),e.xp6(1),e.Q6J("ngIf",!o.url&&o.fileBase64)}}function ns(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",61)(1,"div",31)(2,"h4",32),e._UZ(3,"span",33),e._uU(4,". Carteirinha do Conv\xeanio"),e.qZA(),e.YNc(5,za,2,0,"div",11),e.qZA(),e.YNc(6,ja,6,0,"div",34),e.TgZ(7,"div",31)(8,"input",62,63),e.NdJ("change",function(){e.CHM(o);const n=e.MAs(9),a=e.oxw(2);return a.onUploadFile(n.files,1),e.KtG(a.clearFile(n))}),e.qZA(),e.TgZ(10,"button",64),e.NdJ("click",function(){e.CHM(o);const n=e.MAs(9);return e.KtG(n.click())}),e._UZ(11,"em",38),e._uU(12," Adicionar "),e.qZA()(),e.YNc(13,ts,10,5,"div",39),e.ALo(14,"filterFor"),e.qZA()}if(2&t){const o=e.oxw(2);e.xp6(5),e.Q6J("ngIf",!o.verificaSePossuiDocumentos(1)),e.xp6(1),e.Q6J("ngIf",o.verificaSePossuiDocumentos(1)),e.xp6(4),e.Q6J("disabled",o.isLoading),e.xp6(3),e.Q6J("ngForOf",e.Dn7(14,4,o.model.documentos,"tipo",1))}}function as(t,s){1&t&&(e.TgZ(0,"div"),e._uU(1," Documento j\xe1 enviado. "),e.qZA())}function ss(t,s){1&t&&(e.TgZ(0,"div",40)(1,"p"),e._uU(2," Tire uma foto do pedido m\xe9dico "),e.qZA(),e.TgZ(3,"p")(4,"b"),e._uU(5,"Caso tenha exames de sangue, urina ou fezes para realizar na mesma data do exame agendado, por favor anexar o pedido m\xe9dico para agilizarmos o seu atendimento."),e.qZA()()())}function ds(t,s){if(1&t&&e._UZ(0,"div",52),2&t){const o=e.oxw().$implicit;e.Q6J("ngStyle",e.VKq(1,K,"url("+o.thumbnailUrl+") no-repeat center center"))}}function rs(t,s){if(1&t&&(e.TgZ(0,"div",53),e._UZ(1,"img",54),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hYB("src","data:",o.thumbMimeType,";base64,",o.thumbBase64,"",e.LSH)}}function cs(t,s){1&t&&(e.TgZ(0,"div",55)(1,"a",56),e._UZ(2,"em",57),e.qZA()())}function ls(t,s){if(1&t&&(e.TgZ(0,"a",58),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()),2&t){const o=e.oxw().$implicit;e.s9C("href",o.url,e.LSH)}}function ms(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.openContentInNewTab(n))}),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()}}function _s(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43),e.YNc(1,ds,1,3,"div",44),e.YNc(2,rs,2,2,"div",45),e.YNc(3,cs,3,0,"div",46),e.TgZ(4,"div",47),e.YNc(5,ls,3,1,"a",48),e.YNc(6,ms,3,0,"a",49),e.TgZ(7,"a",50),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.confirm(a))}),e._UZ(8,"em",51),e._uU(9," Remover "),e.qZA()()()}if(2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.nome.includes(".pdf")&&o.thumbnailUrl),e.xp6(1),e.Q6J("ngIf",!o.thumbnailUrl&&!o.nome.includes(".pdf")),e.xp6(1),e.Q6J("ngIf",o.nome.includes(".pdf")),e.xp6(2),e.Q6J("ngIf",o.url),e.xp6(1),e.Q6J("ngIf",!o.url&&o.fileBase64)}}function ps(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",61)(1,"div",31)(2,"h4",32),e._UZ(3,"span",33),e._uU(4,". Pedido M\xe9dico"),e.qZA(),e.YNc(5,as,2,0,"div",11),e.qZA(),e.YNc(6,ss,6,0,"div",34),e.TgZ(7,"div",31)(8,"input",65,66),e.NdJ("change",function(){e.CHM(o);const n=e.MAs(9),a=e.oxw(2);return a.onUploadFile(n.files,3),e.KtG(a.clearFile(n))}),e.qZA(),e.TgZ(10,"button",67),e.NdJ("click",function(){e.CHM(o);const n=e.MAs(9);return e.KtG(n.click())}),e._UZ(11,"em",38),e._uU(12," Adicionar "),e.qZA()(),e.YNc(13,_s,10,5,"div",39),e.ALo(14,"filterFor"),e.qZA()}if(2&t){const o=e.oxw(2);e.xp6(5),e.Q6J("ngIf",!o.verificaSePossuiDocumentos(3)),e.xp6(1),e.Q6J("ngIf",o.verificaSePossuiDocumentos(3)),e.xp6(4),e.Q6J("disabled",o.isLoading),e.xp6(3),e.Q6J("ngForOf",e.Dn7(14,4,o.model.documentos,"tipo",3))}}function us(t,s){1&t&&(e.TgZ(0,"p"),e._uU(1," Tire uma foto de exames anteriores "),e.qZA())}function gs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",73),e.NdJ("click",function(){e.CHM(o),e.oxw();const n=e.MAs(9);return e.KtG(n.click())}),e._UZ(1,"em",38),e._uU(2," Adicionar "),e.qZA()}if(2&t){const o=e.oxw(3);e.Q6J("disabled",o.isLoading)}}function hs(t,s){if(1&t&&e._UZ(0,"div",52),2&t){const o=e.oxw().$implicit;e.Q6J("ngStyle",e.VKq(1,K,"url("+o.thumbnailUrl+") no-repeat center center"))}}function fs(t,s){if(1&t&&(e.TgZ(0,"div",53),e._UZ(1,"img",54),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hYB("src","data:",o.thumbMimeType,";base64,",o.thumbBase64,"",e.LSH)}}function vs(t,s){1&t&&(e.TgZ(0,"div",55)(1,"a",56),e._UZ(2,"em",57),e.qZA()())}function xs(t,s){if(1&t&&(e.TgZ(0,"a",58),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()),2&t){const o=e.oxw().$implicit;
1e.s9C("href",o.url,e.LSH)}}function Cs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.openContentInNewTab(n))}),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()}}function As(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43),e.YNc(1,hs,1,3,"div",44),e.YNc(2,fs,2,2,"div",45),e.YNc(3,vs,3,0,"div",46),e.TgZ(4,"div",47),e.YNc(5,xs,3,1,"a",48),e.YNc(6,Cs,3,0,"a",49),e.TgZ(7,"a",50),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.confirm(a))}),e._UZ(8,"em",51),e._uU(9," Remover "),e.qZA()()()}if(2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.nome.includes(".pdf")&&o.thumbnailUrl),e.xp6(1),e.Q6J("ngIf",!o.thumbnailUrl&&!o.nome.includes(".pdf")),e.xp6(1),e.Q6J("ngIf",o.nome.includes(".pdf")),e.xp6(2),e.Q6J("ngIf",o.url),e.xp6(1),e.Q6J("ngIf",!o.url&&o.fileBase64)}}const bs=function(t){return{"bg-light":t}};function Ts(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"span",74)(1,"p-checkbox",75),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.ckeckTermo=n)})("onChange",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.AssinarTermo())}),e.qZA(),e.TgZ(2,"span",76),e._uU(3," Declaro que li e aceito o "),e.TgZ(4,"b")(5,"a",77),e._uU(6,"Termo de Consentimento de Resultados Anteriores"),e.qZA()(),e._uU(7," para paciente e/ou respons\xe1vel."),e.qZA()()}if(2&t){const o=e.oxw(3);e.Q6J("ngClass",e.VKq(5,bs,!o.mobile)),e.xp6(1),e.Q6J("binary",!0)("ngModel",o.ckeckTermo)("disabled",o.userCheckTermo),e.xp6(4),e.Q6J("href",o.getUrlTermo(),e.LSH)}}function Zs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",61)(1,"div",31)(2,"h4",32),e._UZ(3,"span",33),e._uU(4,". Exames Anteriores"),e.qZA()(),e.TgZ(5,"div",40),e.YNc(6,us,2,0,"p",11),e.qZA(),e.TgZ(7,"div",31)(8,"input",68,69),e.NdJ("change",function(){e.CHM(o);const n=e.MAs(9),a=e.oxw(2);return a.onUploadFile(n.files,9),e.KtG(a.clearFile(n))}),e.qZA(),e.YNc(10,gs,3,1,"button",70),e.qZA(),e.YNc(11,As,10,5,"div",39),e.ALo(12,"filterFor"),e.TgZ(13,"div",71),e.YNc(14,Ts,8,7,"span",72),e.qZA()()}if(2&t){const o=e.oxw(2);e.xp6(6),e.Q6J("ngIf",o.ckeckTermo),e.xp6(4),e.Q6J("ngIf",o.ckeckTermo),e.xp6(1),e.Q6J("ngForOf",e.Dn7(12,4,o.model.documentos,"tipo",9)),e.xp6(3),e.Q6J("ngIf",o.verificaSeExisteTermo)}}function Es(t,s){if(1&t&&e._UZ(0,"div",52),2&t){const o=e.oxw().$implicit;e.Q6J("ngStyle",e.VKq(1,K,"url("+o.thumbnailUrl+") no-repeat center center"))}}function Is(t,s){if(1&t&&(e.TgZ(0,"div",53),e._UZ(1,"img",54),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hYB("src","data:",o.thumbMimeType,";base64,",o.thumbBase64,"",e.LSH)}}function Ps(t,s){1&t&&(e.TgZ(0,"div",55)(1,"a",56),e._UZ(2,"em",57),e.qZA()())}function ws(t,s){if(1&t&&(e.TgZ(0,"a",58),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()),2&t){const o=e.oxw().$implicit;e.s9C("href",o.url,e.LSH)}}function Ms(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.openContentInNewTab(n))}),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()}}function Us(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43),e.YNc(1,Es,1,3,"div",44),e.YNc(2,Is,2,2,"div",45),e.YNc(3,Ps,3,0,"div",46),e.TgZ(4,"div",47),e.YNc(5,ws,3,1,"a",48),e.YNc(6,Ms,3,0,"a",49),e.TgZ(7,"a",50),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.confirm(a))}),e._UZ(8,"em",51),e._uU(9," Remover "),e.qZA()()()}if(2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.nome.includes(".pdf")&&o.thumbnailUrl),e.xp6(1),e.Q6J("ngIf",!o.thumbnailUrl&&!o.nome.includes(".pdf")),e.xp6(1),e.Q6J("ngIf",o.nome.includes(".pdf")),e.xp6(2),e.Q6J("ngIf",o.url),e.xp6(1),e.Q6J("ngIf",!o.url&&o.fileBase64)}}function Ns(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",61)(1,"div",31)(2,"h4",32),e._UZ(3,"span",33),e._uU(4,". Outros Documentos"),e.qZA()(),e.TgZ(5,"div",40)(6,"p"),e._uU(7," Conforme instru\xe7\xf5es da nossa equipe de operadores "),e.qZA()(),e.TgZ(8,"div",31)(9,"input",78,79),e.NdJ("change",function(){e.CHM(o);const n=e.MAs(10),a=e.oxw(2);return a.onUploadFile(n.files,5),e.KtG(a.clearFile(n))}
1),e.qZA(),e.TgZ(11,"button",80),e.NdJ("click",function(){e.CHM(o);const n=e.MAs(10);return e.KtG(n.click())}),e._UZ(12,"em",38),e._uU(13," Adicionar "),e.qZA()(),e.YNc(14,Us,10,5,"div",39),e.ALo(15,"filterFor"),e.qZA()}if(2&t){const o=e.oxw(2);e.xp6(11),e.Q6J("disabled",o.isLoading),e.xp6(3),e.Q6J("ngForOf",e.Dn7(15,2,o.model.documentos,"tipo",5))}}function Ss(t,s){if(1&t&&e._UZ(0,"div",52),2&t){const o=e.oxw().$implicit;e.Q6J("ngStyle",e.VKq(1,K,"url("+o.thumbnailUrl+") no-repeat center center"))}}function ys(t,s){if(1&t&&(e.TgZ(0,"div",53),e._UZ(1,"img",54),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hYB("src","data:",o.thumbMimeType,";base64,",o.thumbBase64,"",e.LSH)}}function qs(t,s){1&t&&(e.TgZ(0,"div",55)(1,"a",56),e._UZ(2,"em",57),e.qZA()())}function Js(t,s){if(1&t&&(e.TgZ(0,"a",58),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()),2&t){const o=e.oxw().$implicit;e.s9C("href",o.url,e.LSH)}}function ks(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.openContentInNewTab(n))}),e._UZ(1,"em",59),e._uU(2," Visualizar "),e.qZA()}}function Ds(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43),e.YNc(1,Ss,1,3,"div",44),e.YNc(2,ys,2,2,"div",45),e.YNc(3,qs,3,0,"div",46),e.TgZ(4,"div",47),e.YNc(5,Js,3,1,"a",48),e.YNc(6,ks,3,0,"a",49),e.TgZ(7,"a",84),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.confirm(a))}),e._UZ(8,"em",51),e._uU(9," Remover "),e.qZA()()()}if(2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.nome.includes(".pdf")&&o.thumbnailUrl),e.xp6(1),e.Q6J("ngIf",!o.thumbnailUrl&&!o.nome.includes(".pdf")),e.xp6(1),e.Q6J("ngIf",o.nome.includes(".pdf")),e.xp6(2),e.Q6J("ngIf",o.url),e.xp6(1),e.Q6J("ngIf",!o.url&&o.fileBase64)}}function Fs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",61)(1,"div",31)(2,"h4",32),e._UZ(3,"span",33),e._uU(4,". Carteirinha de Vacina\xe7\xe3o"),e.qZA()(),e.TgZ(5,"div",40)(6,"p"),e._uU(7," Tire uma foto de sua carteirinha de vacina\xe7\xe3o "),e.qZA()(),e.TgZ(8,"div",31)(9,"input",81,82),e.NdJ("change",function(){e.CHM(o);const n=e.MAs(10),a=e.oxw(2);return a.onUploadFile(n.files,6),e.KtG(a.clearFile(n))}),e.qZA(),e.TgZ(11,"button",83),e.NdJ("click",function(){e.CHM(o);const n=e.MAs(10);return e.KtG(n.click())}),e._UZ(12,"em",38),e._uU(13," Adicionar "),e.qZA()(),e.YNc(14,Ds,10,5,"div",39),e.ALo(15,"filterFor"),e.qZA()}if(2&t){const o=e.oxw(2);e.xp6(11),e.Q6J("disabled",o.isLoading),e.xp6(3),e.Q6J("ngForOf",e.Dn7(15,2,o.model.documentos,"tipo",6))}}function Os(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",85),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.voltaStep())}),e._UZ(1,"em",86),e._uU(2," Anterior "),e.qZA()}}function Hs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",85),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.avancaStep())}),e._uU(1," Pr\xf3ximo "),e._UZ(2,"em",87),e.qZA()}}function Qs(t,s){if(1&t&&(e.TgZ(0,"div",13)(1,"fieldset",14)(2,"legend"),e._uU(3," Web Check-in"),e.qZA(),e.TgZ(4,"div",15)(5,"div",16)(6,"div",17)(7,"ul",18),e.YNc(8,Ha,5,8,"li",19),e.qZA()()()(),e.YNc(9,Ba,15,8,"div",20),e.YNc(10,ns,15,8,"div",21),e.YNc(11,ps,15,8,"div",21),e.YNc(12,Zs,15,8,"div",21),e.YNc(13,Ns,16,6,"div",21),e.YNc(14,Fs,16,6,"div",21),e.TgZ(15,"div",22)(16,"div",23),e._UZ(17,"hr"),e.qZA(),e.TgZ(18,"div",23),e.YNc(19,Os,3,0,"button",24),e.YNc(20,Hs,3,0,"button",24),e.qZA()()()()),2&t){const o=e.oxw();e.xp6(8),e.Q6J("ngForOf",o.etapas),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_DOCUMENTO_IDENTIFICACAO")&&o.verificaSePossuiDocumentos(7)),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_DOCUMENTO_CARTEIRINHACONVENIO")&&o.verificaSePossuiDocumentos(1)),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_DOCUMENTO_PEDIDOMEDICO")&&o.verificaSePossuiDocumentos(3)),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_DOCUMENTO_EXAMESANTERIORES")),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_DOCUMENTO_OUTROSDOCUMENTOS")),e.xp6(1),e.Q6J("ngIf",o.vacina&&o.verificaPermissao("FUNC_DOCUMENTO_CARTEIRINHAVACINACAO")),e.xp6(5),e.Q6J("ngIf",o.stepActive>=1),e.xp6(1),e.Q6J("ngIf",o.stepActive<o.contSteps-1)}}function Ls(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",88),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._uU(1,"Voltar"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}function Rs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",89),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep())}),e._uU(1,"Continuar"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}function Ys(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",90),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.finalizar())}),e._uU(1,"Finalizar"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}const Gs=function(){return{width:"350px",overflow:"hidden"}};function Ks(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",91),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.display=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.hideQuaisDocumentosSaoValidos())}),e.TgZ(2,"div",92),e._uU(3,"RG"),e.qZA(),e.TgZ(4,"div",0),e._uU(5,"CNH"),e.qZA(),e.TgZ(6,"div",0),e._uU(7,"Passaporte"),e.qZA(),e.TgZ(8,"div",93),e._uU(9,"Carteira de Trabalho"),e.qZA()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(6,Gs)),e.Q6J("visible",o.display)("modal",!0)("responsive",!0)("baseZIndex",1e4)}}let $s=(()=>{class t extends w.a{constructor(o){super(o),this.vacina=!1,this.userCheckTermo=!1,this.stepVolta=!1,this.stepAvanca=!0,this.stepActive=0,this.newEtapas=[],this.activeStepLine=0,this.protocolo=0,this.guidProtocolo="",this.router=o.get(b.F0),this.http=o.get(fe.eN),this.confirmationService=o.get(Z.YP),this.imageCompress=o.get(ne.r2),this.documentoService=o.get(l.Bi_),this.homeService=o.get(l.igG),this.activatedRoute=o.get(b.gz),this.termoService=o.get(l.Zfh),this.route=o.get(b.gz),this.documentosService=o.get(ie.c)}ngOnInit(){this.urlUpload=de.N.apiBaseUrl+"/api/"+this.domain+"/documento/upload/tipo/protocolo/prontuario/guidprotocolo",this.protocolo=this.modelFinished.protocoloIdSelected,this.guidProtocolo=this.route.
1snapshot.queryParams.key,this.guidProtocolo&&(this.mostraBulletsProcessoAgendamento=!1),this.isLoggedIn()&&(this.prontuario=this.user.usuarioSelecionado.prontuarioId),I("header").show(),I("footer").show(),this.etapas=[{id:"1",label:"Documento de-identifica\xe7\xe3o",visible:this.verificaPermissao("FUNC_DOCUMENTO_IDENTIFICACAO"),automationId:7},{id:"2",label:"Carteirinha do-conv\xeanio",visible:this.verificaPermissao("FUNC_DOCUMENTO_CARTEIRINHACONVENIO"),automationId:1},{id:"3",label:"Pedido-m\xe9dico",visible:this.verificaPermissao("FUNC_DOCUMENTO_PEDIDOMEDICO"),automationId:3},{id:"4",label:"Exames-anteriores",visible:this.verificaPermissao("FUNC_DOCUMENTO_EXAMESANTERIORES"),automationId:9},{id:"5",label:"Outros-documentos",visible:this.verificaPermissao("FUNC_DOCUMENTO_OUTROSDOCUMENTOS"),automationId:5},{id:"6",label:"Carteirinha de-Vacina\xe7\xe3o",visible:!(!this.vacina||!this.verificaPermissao("FUNC_DOCUMENTO_CARTEIRINHAVACINACAO")),automationId:6}],this.load()}getUrlTermo(){return`${de.N.apiBaseUrl}/api/${this.domain}/Termo/FazerDownloadTermo?id=0&isTermo=true&${E.$.getJwTQueryToken()}`}load(){this.changeStep(3),this.verificaPermissaoTela(),this.get(),this.modelFinished.protocoloIdSelected?(this.activeStepLine=0,this.vacina=this.modelFinished.vacina):(this.activeStepLine=3,this.model.unidadeVacina&&this.model.examesAgendados&&(this.vacina=this.model.examesAgendados.filter(o=>o.unidade.id===this.model.unidadeVacina.id).length>0)),this.totalPayment=0,this.totalTaxas=0,this.hasPayment=!1,this.model.examesAgendados&&this.model.examesAgendados.length>0&&this.model.examesAgendados.forEach(o=>{this.totalPayment+=o.valor}),this.model.taxas&&(this.model.taxas.forEach(o=>{this.totalTaxas+=o.taxa}),this.totalPayment+=this.totalTaxas,this.totalPayment>0&&(this.hasPayment=!0))}ajustaLabelSteps(){setTimeout(()=>{const o=document.getElementsByClassName("p-steps-title");for(let i=0;i<o.length;i++){const n=o[i].textContent.replace(/\-/g,"<br>");o[i].innerHTML=n}},1e3)}get(){this.getMeusDocumentos(),this.homeService.getDataLayer(this.domain).subscribe(o=>{this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o})}getMeusDocumentos(){if(this.startLoading(!0),this.mensagem="Buscando Meus Documentos...",this.route.snapshot.queryParams.key)this.documentoService.verificarLinkDocumentoEAgendamento(this.route.snapshot.queryParams.key,this.domain).subscribe(o=>{if(o){if(o.mensagemError)return this.stopLoading(),this.modalAlertService.open("warning","Aten\xe7\xe3o",o.mensagemError.toString(),"button"),void this.router.navigate(["/marcacao/exame"]);o.token&&E.$.signIn(o.token)}this.documentoService.getDocumentosPorGuid(this.route.snapshot.queryParams.key,this.domain).subscribe(i=>{this.stopLoading(),this.model.documentos=i,this.verificaSePossuiDocumentos(7),this.verificaTermoAceite(),this.montaStepsLine(),this.termoService.verificarExisteTermo(this.domain).subscribe(n=>{n&&(this.verificaSeExisteTermo=0!==n,this.verificaSeExisteTermo&&(this.ckeckTermo=!0))}),this.montarSteps(!0),this.ajustaLabelSteps(),setTimeout(()=>{this.ajustaAltura()},1e3)},i=>{this.route.snapshot.queryParams.key?this.router.navigate(["/marcacao/exame"]):this.verifyError(i)})},o=>{this.verifyError(o),this.route.snapshot.queryParams.key&&this.router.navigate(["/marcacao/exame"])});else{let o=new l.gqh;o.prontuarioId=this.prontuario,o.protocoloId=this.modelFinished.protocoloIdSelected,this.documentoService.getDocumentos(W.w.encryptKey(o),this.domain).subscribe(i=>{this.stopLoading(),i&&(this.model.documentos?i.forEach(n=>{this.model.documentos.findIndex(a=>a.id===n.id)<0&&this.model.documentos.push(n)}):this.model.documentos=i),this.montarSteps(!1),setTimeout(()=>{this.ajustaAltura()},1e3),this.verificaTermoAceite(),this.montaStepsLine(),this.ajustaLabelSteps()},i=>{this.verifyError(i)})}this.termoService.verificarExisteTermo(this.domain).subscribe(o=>{this.verificaSeExisteTermo=0!==o,this.verificaSeExisteTermo||(this.ckeckTermo=!0)})}verificaTermoAceite(){this.model&&this.model.documentos&&(this.userCheckTermo=null!=this.model.documentos.find(o=>9===o.tipo),this.userCheckTermo&&(this.ckeckTermo=!0))}onUploadFile(o,i){if(0===o.length)return!1;const n=o[0],a=n.type;if(null==a.match(/image\/*/)&&null==a.match(/application\/pdf/))return this.modalAlertService.open("warning","Aten\xe7\xe3o","Somente imagens e documentos em PDF s\xe3o suportados","button"),!1;const d=this.getLimitFileSizeInMegabytes();if(n.size>1024*d*1024)return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o \xe9 permitido enviar arquivos acima de "+d.toString()+"MB","button"),!1;this.renderFile(n,i)}renderFile(o,i){this.startLoading();const n=o.name,a=o.type,d=o.lastModified,r=new FileReader;r.onload=c=>{this.compressFile(c.target.result,i,n,a,d,o),setTimeout(()=>{this.ajustaAltura()},2e3)}
1,r.readAsDataURL(o)}compressFile(o,i,n,a,d,r){var c=this;return(0,U.Z)(function*(){const m=new te.t({image:o.split(",")[1],tipo:i,fileName:n,mimeType:a,protocolo:c.protocolo,prontuario:c.prontuario,guidProtocolo:c.guidProtocolo,lastModified:d,file:r});if("application/pdf"===a){const _=yield c.documentosService.saveFile(m);_&&c.model.documentos.push(_)}else if(c.imageCompress.byteCount(o)/1048576>1)c.imageCompress.compressFile(o,-1,100,50).then(function(){var u=(0,U.Z)(function*(f){m.image=f.split(",")[1];const C=yield c.documentosService.saveFile(m);C&&c.model.documentos.push(C)});return function(f){return u.apply(this,arguments)}}()).catch(function(){var u=(0,U.Z)(function*(f){const C=yield c.documentosService.saveFile(m);C&&c.model.documentos.push(C)});return function(f){return u.apply(this,arguments)}}());else{const u=yield c.documentosService.saveFile(m);u&&c.model.documentos.push(u)}})()}AssinarTermo(){this.ckeckTermo&&(this.startLoading(),this.termoService.assinarTermo(this.modelFinished.protocoloIdSelected,this.route.snapshot.queryParams.key,this.domain).subscribe(o=>{this.stopLoading()},o=>{this.verifyError(o)}))}onRemoveFile(o){if(o.salvo){this.startLoading(),""!==o.fileBase64&&(o.fileBase64=void 0),""!==o.thumbBase64&&(o.thumbBase64=void 0);let i=W.w.encryptValue(W.w.encryptKey(o));this.documentoService.dropDocumento(i,this.domain).subscribe(n=>{this.stopLoading(),n&&(this.removeFile(o),this.verificaTermoAceite(),this.modalAlertService.open("success","Aten\xe7\xe3o","Arquivo exclu\xeddo com Sucesso!","timer"))},n=>{this.verifyError(n)})}else this.removeFile(o),this.modalAlertService.open("success","Aten\xe7\xe3o","Arquivo exclu\xeddo com Sucesso!","timer"),this.syncModel()}removeFile(o){const i=this.model.documentos.findIndex(n=>n.id===o.id);this.model.documentos.splice(i,1)}confirm(o){this.confirmationService.confirm({message:"Deseja excluir a imagem?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.onRemoveFile(o)}})}getClassPanelName(o){return this.model.documentos.filter(i=>i.tipo===o).length>0?" panel-success-content":""}clearFile(o){o.value=null}goToPreviousStep(){this.modelFinished.documentosEnviados=!!this.model.documentos&&this.model.documentos.filter(o=>o.tipo<5).length>0,this.syncModelFinished(),this.mostraBulletsProcessoAgendamento?(this.getDataLayer("documento","Documento | Unidade"),this.router.navigate(this.marcacaoService.fluxoAgendamento===ge.g.TodosJuntos?["/marcacao/unidade"]:["/marcacao/exame-individual"],{queryParamsHandling:"merge"}
1)):this.router.navigate([this.routeState.getPreviousUrl()],{queryParamsHandling:"merge"})}goToNextStep(){this.model.protocoloIdSelected?(this.modelFinished.documentosEnviados=!!this.model.documentos&&this.model.documentos.length>0,this.syncModelFinished()):this.validarCondicoes()&&(this.getDataLayer("documento","Documento | Resumo-Agendamento"),this.router.navigate(["/marcacao/resumo-agendamento"],{queryParamsHandling:"merge"}))}validarCondicoes(){return this.user.backoffice?this.validarPedidoMedico():this.vacina&&this.vacina?this.validarDocumentoIdentificacao()&&this.validarCarteirinhaConvenio():this.validarDocumentoIdentificacao()&&this.validarCarteirinhaConvenio()&&this.validarPedidoMedico()}validarDocumentoIdentificacao(){return!this.model.domiciliar&&!this.modelFinished.domiciliar||!this.verificaPermissao("FUNC_DOCUMENTO_IDENTIFICACAO")||0!==this.model.documentos.filter(i=>7===i.tipo).length||(this.modalAlertService.open("warning","Aten\xe7\xe3o","O documento de identifica\xe7\xe3o \xe9 obrigat\xf3rio!","button"),!1)}validarCarteirinhaConvenio(){return!this.model.domiciliar&&!this.modelFinished.domiciliar||!!(this.model.convenio&&this.model.convenioParticular&&(this.model.convenio.id==this.model.convenioParticular.id||this.model.convenio.id==this.model.convenioFidelidade.id)||this.modelFinished.convenio&&this.modelFinished.convenioFidelidade&&(this.modelFinished.convenio.id==this.modelFinished.convenioParticular.id||this.modelFinished.convenio.id==this.modelFinished.convenioFidelidade.id))||!this.verificaPermissao("FUNC_DOCUMENTO_CARTEIRINHACONVENIO")||0!==this.model.documentos.filter(i=>1===i.tipo).length||(this.modalAlertService.open("warning","Aten\xe7\xe3o","A carteirinha de conv\xeanio \xe9 obrigat\xf3ria!","button"),!1)}validarPedidoMedico(){var o,i,n,a,d,r,c,m,_,p,u,f;const C=null===(i=null===(o=this.model)||void 0===o?void 0:o.convenio)||void 0===i?void 0:i.obrigarPedidoMedico,x=0===(null===(a=null===(n=this.model)||void 0===n?void 0:n.documentos)||void 0===a?void 0:a.filter(M=>M.tipo===Ja.A.Pedido_Medico).length),A=this.verificaPermissao("FUNC_DOCUMENTO_PEDIDOMEDICO"),P=(null===(d=this.model)||void 0===d?void 0:d.domiciliar)||(null===(r=this.modelFinished)||void 0===r?void 0:r.domiciliar),_e=(null===(m=null===(c=this.model)||void 0===c?void 0:c.exames)||void 0===m?void 0:m.filter(M=>{var S;return"VACINA"===(null===(S=M.especialidade)||void 0===S?void 0:S.toUpperCase())}).length)>0,pe=(null===(p=null===(_=this.model)||void 0===_?void 0:_.exames)||void 0===p?void 0:p.filter(M=>{var S;return"VACINA"!==(null===(S=M.especialidade)||void 0===S?void 0:S.toUpperCase())}).length)>0||(null===(f=null===(u=this.model)||void 0===u?void 0:u.examesNaoAgendaveis)||void 0===f?void 0:f.length)>0;return!((!_e||pe)&&(_e&&pe&&C&&x||P&&x||A&&x&&C)&&(this.modalAlertService.open("warning","Aten\xe7\xe3o","O pedido m\xe9dico \xe9 obrigat\xf3rio!","button"),1))}validarOutrosDocumentos(){return!this.verificaPermissao("FUNC_DOCUMENTO_OUTROSDOCUMENTOS")||0!==this.model.documentos.filter(o=>5===o.tipo).length||(this.modalAlertService.open("warning","Aten\xe7\xe3o","O campo de outros documentos \xe9 obrigat\xf3rio!","button"),!1)}validarCarteirinhaVacinacao(){return!this.verificaPermissao("FUNC_DOCUMENTO_CARTEIRINHAVACINACAO")||0!==this.model.documentos.filter(o=>6===o.tipo).length||(this.modalAlertService.open("warning","Aten\xe7\xe3o","A carteirinha de vacina\xe7\xe3o \xe9 obrigat\xf3ria!","button"),!1)}showQuaisDocumentosSaoValidos(){this.display=!0}hideQuaisDocumentosSaoValidos(){this.display=!1}openContentInNewTab(o){if("application/pdf"===o.mimeType){const i='<iframe width="100%" height="98%" src="data:'+o.mimeType+";base64,"+escape(o.fileBase64)+'"></iframe>';window.open("").document.write(i)}else{const i=new Image;i.src="data:"+o.mimeType+";base64,"+o.fileBase64;const n=window.open("");n.document.title=o.nome,n.document.write(i.outerHTML)}}ajustaAltura(){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){const o=[];I(".boxDocumentos .p-panel-content").each(function(){I(this).attr("style",""),o.push(I(this).height())});const i=Math.max.apply(Math,o);I(".boxDocumentos .p-panel-content").each(function(){I(this).height(i+"px")})}}verificaSePossuiDocumentos(o){var i,n;const a=null===(n=null===(i=this.model)||void 0===i?void 0:i.documentos)||void 0===n?void 0:n.find(r=>r.tipo===o);let d;
1switch(!0){case this.route.snapshot.queryParams.key&&void 0!==a&&!0===a.criadoAgora:d=!0;break;case this.route.snapshot.queryParams.key&&void 0!==a:d=!1;break;default:d=!0}return d}voltaStep(){this.stepActive=this.stepActive-1,this.ativaStep(this.stepActive),this.ultimoStep=this.newEtapas.length-1===this.stepActive}avancaStep(){this.stepActive=this.stepActive+1,this.ativaStep(this.stepActive),this.ultimoStep=this.newEtapas.length-1===this.stepActive}ativaStep(o){const i=document.getElementsByClassName("stepsLine");for(let n=0;n<i.length;n++)i[n].classList.remove("stepLineShow");i[o].classList.add("stepLineShow"),this.activeStepLine=o+1}montaStepsLine(){setTimeout(()=>{const o=document.getElementsByClassName("stepsLine");o[this.stepActive].classList.add("stepLineShow"),this.contSteps=o.length,this.activeStepLine=1;for(let i=0;i<o.length;i++)o[i].getElementsByClassName("numSteps")[0].innerHTML=`${i+1}`},1e3)}finalizar(){if(this.user.backoffice){if(!this.validarPedidoMedico()&&this.verificaPermissao("FUNC_DOCUMENTO_PEDIDOMEDICO"))return}else if(!this.validarCondicoes())return;this.modalAlertService.open("success","Sucesso","Seus documentos foram anexados! Aguarde nosso e-mail com Qr Code e confirma\xe7\xe3o do Web Check.","button"),this.route.snapshot.queryParams.key?E.$.signOut(!0):this.router.navigate(["/marcacao/home"])}montarSteps(o){let i=0;this.etapas.forEach(o?n=>{let a=this.model.documentos.find(d=>d.tipo===n.automationId);n.visible&&!a&&(i+=1,this.newEtapas.push({id:i,label:n.label,visible:n.visible,enumTipoDocumento:n.automationId}))}:n=>{n.visible&&(i+=1,this.newEtapas.push({id:i,label:n.label,visible:n.visible,enumTipoDocumento:n.automationId}))}),this.etapas=this.newEtapas}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-documento"]],features:[e._Bn([Z.YP,ne.r2]),e.qOj],decls:12,vars:6,consts:[[1,"row"],["class","col-12",4,"ngIf"],["class","col-12 mt-3",4,"ngIf"],["header","Confirmation","icon","pi pi-exclamation-triangle","acceptLabel","Sim","rejectLabel","N\xe3o"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button","class","btn btn-outline-primary",3,"disabled","click",4,"ngIf"],["id","modelContinuar","type","button","class","btn btn-primary text-uppercase ms-3",3,"disabled","click",4,"ngIf"],["id","modelFinalizar","type","button","class","btn btn-primary text-uppercase ms-3",3,"disabled","click",4,"ngIf"],[4,"ngIf"],[1,"col-12"],[1,"col-12","mt-3"],[1,"boxDocumentos","px-3"],[1,"row","mb-md-5","mb-sm-1"],[1,"col-12","text-sm-center1","mb-md-3"],[1,"p-steps","p-widget","p-helper-clearfix"],["role","tablist"],["role","tablistitem","class","p-steps-item",3,"ngClass",4,"ngFor","ngForOf"],["class","row mt-md-4 mt-sm-2 mb-4 p-2 stepsLine",4,"ngIf"],["class","row mt-4 mb-4 p-2 stepsLine",4,"ngIf"],[1,"row","mt-4","mb-4"],[1,"col-md-12","text-center"],["type","button","class","btn btn-info mx-2",3,"click",4,"ngIf"],["role","tablistitem",1,"p-steps-item",3,"ngClass"],["href","javascript:void(0)","tabindex","0",1,"p-menuitem-link","no-hand"],[1,"p-steps-number"],["class","p-steps-title d-md-block",4,"ngIf"],[1,"p-steps-title","d-md-block"],[1,"row","mt-md-4","mt-sm-2","mb-4","p-2","stepsLine"],[1,"col-md-12"],[1,"text-info","bold"],[1,"numSteps"],["class","col-md-12 mt-0",4,"ngIf"],["id","modelAdicionarDocumentoIdentificacaoUploadFile","type","file","accept","image/*,application/pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["fileDocumentoIdentificacao",""],["id","modelAdicionarDocumentoIdentificacao","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[1,"fas","fa-plus","dark"],["class","col-md-3 bg-light",4,"ngFor","ngForOf"],[1,"col-md-12","mt-0"],["href","javascript:void(0)",1,"btn","btn-dark","btn-sm",3,"click"],[1,"fas","fa-info-circle"],[1,"col-md-3","bg-light"],["class","text-end subtitle d-block pe-0",3,"ngStyle",4,"ngIf"],["class","text-end subtitle d-block pe-0",4,"ngIf"],["class","ext-center mt-0 pe-1",4,"ngIf"],[1,"text-end"],["target","_blank","class","btn btn-sm btn-outline-primary d-inline-block text-uppercase mt-3",3,"href",4,"ngIf"],["href","javascript:void(0)","class","btn btn-sm btn-info d-inline-block text-uppercase mt-3",3,"click",4,"ngIf"],["href","javascript:void(0)",1,"btn","btn-sm","btn-outline-danger","d-inline-block","text-uppercase","mt-3","ms-2",3,"click"],[1,"fas","fa-times"],[1,"text-end","subtitle","d-block","pe-0",3,"ngStyle"],[1,"text-end","subtitle","d-block","pe-0"],["width","50",1,"img-fluid",3,"src"],[1,"ext-center","mt-0","pe-1"],[1,"btn","btn-sm","d-inline-block","text-uppercase","mt-3","text-center"],[1,"fas","fa-file-pdf","fa-5x"],["target","_blank",1,"btn","btn-sm","btn-outline-primary","d-inline-block","text-uppercase","mt-3",3,"href"],[1,"fas","fa-eye"],["href","javascript:void(0)",1,"btn","btn-sm","btn-info","d-inline-block","text-uppercase","mt-3",3,"click"],[1,"row","mt-4","mb-4","p-2","stepsLine"],["id","modelAdicionarCarteirinhaUploadFile","type","file","accept","image/*,application/pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["fileCarteirinha",""],["id","modelAdicionarCarteirinha","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],["id","modelAdicionarPedidoMedicoUploadFile","type","file","accept","image/*,application/pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["filePedidoMedico",""],["id","modelAdicionarPedidoMedico","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],["id","modelAdicionarExameAnteriorUploadFile","type","file","accept","image/*,application/pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["fileExameAnterior",""],["id","modelAdicionarExameAnterior","type","button","class","btn btn-primary text-uppercase",3,"disabled","click",4,"ngIf"],[1,"col-md-12","ms-0","p-0","m-0","mt-5"],["class","p-3",3,"ngClass",4,"ngIf"],["id","modelAdicionarExameAnterior","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[1,"p-3",3,"ngClass"],["name","checkboxTermo",3,"binary","ngModel","disabled","ngModelChange","onChange"],[1,"ms-2"],["target","_blank",1,"hand-underline",2,"text-decoration","underline",3,"href"],["id","modelAdicionarOutrosDocumentosUploadFile","type","file","accept","image/*,application/pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["fileOutrosDocumentos",""],["id","modelAdicionarOutrosDocumentos","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],["type","file","accept","image/*,application/pdf","placeholder","Escolha um arquivo",2,"display","none",3,"change"],["fileCarteirinhaVacinacao",""],["id","modelAdicionarCarteirinhaVacinacao","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],["href","modelAdicionarOutrosDocumentosBtnRemover",1,"btn","btn-sm","btn-outline-danger","d-inline-block","text-uppercase","mt-3","ms-2",3,"click"],["type","button",1,"btn","btn-info","mx-2",3,"click"],[1,"fas","fa-chevron-left","dar
1k"],[1,"fas","fa-chevron-right","dark"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary",3,"disabled","click"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase","ms-3",3,"disabled","click"],["id","modelFinalizar","type","button",1,"btn","btn-primary","text-uppercase","ms-3",3,"disabled","click"],["header","Quais documentos s\xe3o v\xe1lidos?",3,"visible","modal","responsive","baseZIndex","visibleChange","onHide"],[1,"row","mt-3"],[1,"row","mb-2"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Da,2,1,"div",1),e.YNc(2,Qs,21,9,"div",2),e.qZA(),e._UZ(3,"p-confirmDialog",3),e.TgZ(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7),e.YNc(8,Ls,2,1,"button",8),e.YNc(9,Rs,2,1,"button",9),e.YNc(10,Ys,2,1,"button",10),e.qZA()()()(),e.YNc(11,Ks,10,7,"div",11)),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(6),e.Q6J("ngIf",!i.guidProtocolo),e.xp6(1),e.Q6J("ngIf",!i.modelFinished.protocoloIdSelected&&!i.guidProtocolo),e.xp6(1),e.Q6J("ngIf",i.ultimoStep&&(i.modelFinished.protocoloIdSelected||i.guidProtocolo)),e.xp6(1),e.Q6J("ngIf",i.display))},dependencies:[h.mk,h.sg,h.O5,h.PC,v.JJ,v.On,k.V,F.Q,re.XZ,ka.n],styles:["body .p-steps .p-steps-item{width:150px}.stepsLine{display:none}.stepLineShow{display:flex}\n"],encapsulation:2}),t})();function Vs(t,s){if(1&t&&(e.TgZ(0,"a",22),e._uU(1," Consultar preparo"),e.qZA()),2&t){const o=e.oxw();e.s9C("href",o.modelFinished.linkInstrucao,e.LSH)}}function Bs(t,s){1&t&&(e.TgZ(0,"div",23),e._uU(1," Pagamento efetuado com sucesso, sua transa\xe7\xe3o foi aprovada! "),e.qZA())}function zs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",24),e._uU(1," Pagamento est\xe1 sendo processado, para acompanhar acesse o menu "),e.TgZ(2,"a",25),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToMeusPagamentos())}),e._uU(3,'"Meus Pagamentos"'),e.qZA(),e._uU(4,". "),e.qZA()}}function js(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",26),e._uU(1," Ocorreu um erro durante o pagamento! Acesse o menu "),e.TgZ(2,"a",27),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToMeusPagamentos())}),e._uU(3,'"Meus Pagamentos"'),e.qZA(),e._uU(4," e repita o processo. "),e.qZA()}}function Ws(t,s){1&t&&(e.TgZ(0,"div",28),e._uU(1," O pagamento dever\xe1 ser feito na unidade no dia da realiza\xe7\xe3o do procedimento. "),e.qZA())}function Xs(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",29),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToHome())}),e._UZ(1,"span",30),e._uU(2,"HOME "),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}function ed(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",31),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToMeusAgendamentos())}),e._uU(1,"Meus agendamentos"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}function od(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",32),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToMeusPagamentos())}),e._uU(1,"Meus pagamentos"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}const id=function(t,s){return{"btn-info":t,"btn-primary":s}};let td=(()=>{class t extends w.a{get userName(){return this.user.usuarioSelecionado.nomeSocial?this.user.usuarioSelecionado.nomeSocial.toUpperCase():this.user.usuarioSelecionado.name}constructor(o,i){super(o),this.sanitizer=i,this.coletaDomicilar=!1,this.router=o.get(b.F0),this.agendamentoConcluidoService=o.get(l.jJy),this.homeService=o.get(l.igG),this.questionarioService=o.get(l.uhV)}ngOnInit(){this.changeStep(5),this.verificaPermissaoTela(),this.tempo=0,this.exames=this.modelFinished.examesAgendados,this.examesNaoAgendaveis=this.modelFinished.examesNaoAgendaveis,this.examesNecessitamAutorizacaoConvenio=this.modelFinished.examesAgendados.filter(i=>i.exameNecessitaAutorizacao&&"E"===i.responsavelAutorizacao).concat(this.modelFinished.examesNaoAgendaveis.filter(i=>i.exameNecessitaAutorizacao&&"E"===i.responsavelAutorizacao)),this.examesNecessitamAutorizacaoPaciente=this.modelFinished.examesAgendados.filter(i=>i.exameNecessitaAutorizacao&&"C"===i.responsavelAutorizacao).concat(this.modelFinished.examesNaoAgendaveis.filter(i=>i.exameNecessitaAutorizacao&&"C"===i.responsavelAutorizacao)),this.examesPacote=this.modelFinished.examesPacotes,(!this.exames||0===this.exames.length)&&this.goToNextStep();const o=new l.xPG;o.exames=this.exames,o.unidadeId=this.exames[0].unidade.id,(0,J.D)(this.homeService.getDataLayer(this.domain),this.agendamentoConcluidoService.getTempo(this.domain,o),this.questionarioService.getQuestionario(this.modelFinished.exameIdSelected,this.modelFinished.protocoloIdSelected,this.user.usuarioSelecionado.username,this.domain)).subscribe(i=>{this.stopLoading(),this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:i[0],this.tempo=i[1],this.exibeQuestionario=i[2].length>0,this.load()},i=>{this.verifyError(i)})}load(){this.homeService.getDataLayer(this.domain).subscribe(o=>{this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o}),this.cleanModel(),this.unidades=[],this.agendas=[],this.exames.sort((o,i)=>new Date("1900-01-01T"+o.horario).getTime()-new Date("1900-01-01T"+i.horario).getTime()),this.exames.forEac
1h(o=>{if(!this.unidades.find(i=>i.id===o.unidade.id)){this.coletaDomicilar="ATENDIMENTO DOMICILIAR"===o.unidade.nome,this.coletaDomicilar&&(o.unidade.endereco=this.formatarEndereco(this.modelFinished.endereco)),this.unidades.push(o.unidade);const i={};i.id=o.id,i.data=o.data,i.horario=o.horario,i.urlAgendamento=this.sanitizer.bypassSecurityTrustResourceUrl(this.getUrl(o)),this.agendas.push(i)}}),setTimeout(()=>{this.ajustaAltura()},1e3)}formatarEndereco(o){if(!o)return"";const{endereco:i,numero:n,bairro:a,cidade:d,estado:r,cep:c}=o;return`${[i,n,a,d,r,c].filter(Boolean).join(", ")}`}getHorario(o){const i=this.modelFinished.reserva.reservaSelecionada.find(n=>n.exame.id===o.id);return i&&i.textoBotao?i.textoBotao:o.horario}getUrl(o){let i="http://www.google.com/calendar/event?action=TEMPLATE&dates=";return i+=this.getDates(o)+"&text="+this.getTitle()+"&location="+this.getLocation(o)+"&details="+this.getDetails(o),i}getDates(o){return this.getFormatDate(o.data,"YYYYMMDD")+"T"+(+o.horario.substr(0,2)+3)+o.horario.substr(3,2)+"00Z/"+this.getFormatDate(o.data,"YYYYMMDD")+"T"+(+o.horario.substr(0,2)+3)+o.horario.substr(3,2)+"00Z"}getTitle(){return"Agendamento de exame"}getLocation(o){return o.unidade?o.unidade.endereco+", "+o.unidade.numero+" - "+o.unidade.bairro+", "+o.unidade.cidade+" - "+o.unidade.estado+", "+o.unidade.cep+", Brasil":""}getDetails(o){return"Exame(s): "+o.nome}goToNextStep(){const o=E.$.getUsuarioFromOperadora();this.user.backoffice&&!o?(this.getDataLayer("agendar-online"),T.G.removeItem("pesquisaProntuarios"),this.cleanModel(),E.$.unselectUser(),this.router.navigate(["/marcacao/prontuario"],{queryParamsHandling:"merge"})):(this.getDataLayer("agendar-online"),this.cleanModel(),this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"}))}goToMeusAgendamentos(){this.cleanModel(),this.router.navigate(["/marcacao/meus-agendamentos"],{queryParamsHandling:"merge"})}goToHome(){this.cleanModel(),this.router.navigate(["/marcacao/home"],{queryParamsHandling:"merge"})}goToMeusPagamentos(){this.cleanModel(),this.router.navigate(["/marcacao/meus-pagamentos"],{queryParamsHandling:"merge"})}goToQuestionario(){T.G.setItem("titular-dependente",this.modelFinished.reserva.reservaSelecionada[0].dados.dadosParaSelecionarHorario[0].idProntuario),this.router.navigate(["/marcacao/questionario"],{queryParamsHandling:"merge"})}goToDocumento(){this.mostraBulletsProcessoAgendamento=!1,this.router.navigate(["/marcacao/documento"],{queryParamsHandling:"merge"})}showPreparoInformacoes(o){this.modelFinished.exameAcId===o.id||"ATENDIMENTO DOMICILIAR"===o.nome||"ANALISES CL\xcdNICAS"===o.nome?this.selectedExamePreparoAC=this.examesNaoAgendaveis:this.selectedExamePreparo=o}hidePreparoInformacoes(){this.selectedExamePreparo=void 0,this.selectedExamePreparoAC=void 0}showUnidadeInformacoes(o){this.selectedInformacaoUnidadeId=o}hideUnidadeInformacoes(){this.selectedInformacaoUnidadeId=void 0}ajustaAltura(){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){const o=[];I(".ajusta-altura .p-card-body").each(function(){I(this).attr("style",""),o.push(I(this).height())});const i=Math.max.apply(Math,o);I(".ajusta-altura .p-card-body").each(function(){I(this).height(i+"px")})}}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(ae.H7))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-agendamento-concluido"]],features:[e.qOj],decls:27,vars:17,consts:[[1,"row","pt-0"],[1,"col-md-12","mt-3","pt-0"],[1,"d-flex","flex-column","gap-2","align-items-center","text-center"],[1,"far","fa-check-circle","fa-4x","text-success"],[1,"fs-4","mt-3","fs"],["href","javascript:void(0)",1,"btn","btn-md","m-1",3,"ngClass","click"],["target","_blank","class","text-info",3,"href",4,"ngIf"],[1,"mt-3"],["class","alert alert-success","role","alert",4,"ngIf"],["class","alert alert-warning","role","alert",4,"ngIf"],["class","alert alert-danger","role","alert",4,"ngIf"],["class","alert alert-info","role","alert",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button","class","btn btn-outline-primary me-3 mb-sm-1",3,"disabled","click",4,"ngIf"],["id","modelMeusAgend
1amentos","type","button","class","btn btn-outline-primary me-3 mb-sm-1",3,"disabled","click",4,"ngIf"],["id","modelMeusPagamentos","type","button","class","btn btn-outline-primary me-3 mb-sm-1",3,"disabled","click",4,"ngIf"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase","mb-sm-1","me-sm-1",3,"disabled","click"],[3,"value","values","onClose"],[3,"value","onClose"],["target","_blank",1,"text-info",3,"href"],["role","alert",1,"alert","alert-success"],["role","alert",1,"alert","alert-warning"],["href","javascript:void(0)",1,"btn","btn-link","title","text-warning","align-btnlink-p",3,"click"],["role","alert",1,"alert","alert-danger"],["href","javascript:void(0)",1,"btn","btn-link","title","text-danger","align-btnlink-p",3,"click"],["role","alert",1,"alert","alert-info"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3","mb-sm-1",3,"disabled","click"],[1,"fas","fa-home","me-1"],["id","modelMeusAgendamentos","type","button",1,"btn","btn-outline-primary","me-3","mb-sm-1",3,"disabled","click"],["id","modelMeusPagamentos","type","button",1,"btn","btn-outline-primary","me-3","mb-sm-1",3,"disabled","click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"section",2),e._UZ(3,"em",3),e.TgZ(4,"h1",4),e._uU(5),e.qZA(),e.TgZ(6,"p"),e._uU(7,"Para agilizar o atendimento envie seus documentos e consulte o preparo dos seus exames."),e.qZA(),e.TgZ(8,"a",5),e.NdJ("click",function(){return i.goToDocumento()}),e._uU(9," Enviar Documentos "),e.qZA(),e.YNc(10,Vs,2,1,"a",6),e.TgZ(11,"div",7),e.YNc(12,Bs,2,0,"div",8),e.YNc(13,zs,5,0,"div",9),e.YNc(14,js,5,0,"div",10),e.YNc(15,Ws,2,0,"div",11),e.qZA()()()(),e.TgZ(16,"div",12)(17,"div",13)(18,"div",14)(19,"div",15),e.YNc(20,Xs,3,1,"button",16),e.YNc(21,ed,2,1,"button",17),e.YNc(22,od,2,1,"button",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return i.goToNextStep()}),e._uU(24,"Novo Agendamento"),e.qZA()()()()(),e.TgZ(25,"app-preparo-informacao",20),e.NdJ("onClose",function(){return i.hidePreparoInformacoes()}),e.qZA(),e.TgZ(26,"app-unidade-informacao",21),e.NdJ("onClose",function(){return i.hideUnidadeInformacoes()}),e.qZA()),2&o&&(e.xp6(5),e.hij("",i.userName,", seus exames foram agendados!"),e.xp6(3),e.Q6J("ngClass",e.WLB(14,id,!i.modelFinished.documentosEnviados,i.modelFinished.documentosEnviados)),e.xp6(2),e.Q6J("ngIf",i.modelFinished.linkInstrucao),e.xp6(2),e.Q6J("ngIf",i.modelFinished.pagamentoEfetuadoComSucesso),e.xp6(1),e.Q6J("ngIf",i.modelFinished.pagamentoEmAndamento),e.xp6(1),e.Q6J("ngIf",i.modelFinished.erroPagamento&&""!=i.modelFinished.erroPagamento),e.xp6(1),e.Q6J("ngIf",!i.modelFinished.pagamentoEfetuadoComSucesso),e.xp6(5),e.Q6J("ngIf",!i.user.backoffice),e.xp6(1),e.Q6J("ngIf",!i.user.backoffice),e.xp6(1),e.Q6J("ngIf",i.modelFinished.erroPagamento&&""!=i.modelFinished.erroPagamento),e.xp6(1),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("value",i.selectedExamePreparo)("values",i.selectedExamePreparoAC),e.xp6(1),e.Q6J("value",i.selectedInformacaoUnidadeId))},dependencies:[h.mk,h.O5,G,j],encapsulation:2}),t})();var ke=g(6163);function nd(t,s){if(1&t&&(e.TgZ(0,"div",4)(1,"div",5)(2,"label",6),e._uU(3),e.qZA()()()),2&t){const o=e.oxw().$implicit;e.xp6(3),e.Oqu(o.exameNome)}}function ad(t,s){if(1&t&&(e.TgZ(0,"span"),e.YNc(1,nd,4,1,"div",3),e.qZA()),2&t){const o=s.$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",o.exameId!=i.exameAcId)}}const sd=function(){return{width:"90%",overflow:"hidden"}};function dd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",1),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.display=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.clear())}),e.YNc(2,ad,2,1,"span",2),e.qZA()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(7,sd)),e.Q6J("visible",o.display)("modal",!0)("responsive",!0)("baseZIndex",1e4),e.xp6(1),e.Q6J("ngForOf",o.models)}}let De=(()=>{class t extends Q.b{set protocoloId(o){o&&(this.models=[],this.getExamesAnalisesClinicas(o))}constructor(o){super(o),this.onClose=new e.vpe,this.exameService=o.get(l.q07)}ngOnInit(){this.clear()}clear(){this.models=void 0,this.display=!1,this.onClose.emit()}getExamesAnalisesClinicas(o){this.startLoading(),this.exameService.getExamesAnalisesClinicas(o,this.domain).subscribe(i=>{this.stopLoading(),this.display=!0,this.models=i},i=>{this.verifyError(i)})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-exames-analises-clinicas"]],inputs:{exameAcId:"exameAcId",protocoloId:"protocoloId"},outputs:{onClose:"onClose"},features:[e.qOj],decls:1,vars:1,consts:[[4,"ngIf"],["header","Outros Exames",3,"visible","modal","responsive","baseZIndex","visibleChange","onHide"],[4,"ngFor","ngForOf"],["class","row mt-1 pb-1 margin-bottom-border",4,"ngIf"],[1,"row","mt-1","pb-1","margin-bottom-border"],[1,"col-12","mt-0","pb-1-0"],[1,"fw-bold"]],template:function(o,i){1&o&&e.YNc(0,dd,3,8,"div",0),2&o&&e.Q6J("ngIf",i.models&&i.models.length>0)},dependencies:[h.sg,h.O5,k.V],encapsulation:2}),t})();const rd=function(){return{width:"90%",overflow:"hidden"}};function cd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",1),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.display=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.clear())}),e.TgZ(2,"div",2)(3,"div",3)(4,"p-checkbox",4),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.selectedTermo=n)})("onChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.onChangeTermo(n))}),e.qZA(),e.TgZ(5,"span",5),e._uU(6,"Declaro que li e aceito o "),e.TgZ(7,"strong")(8,"a",6),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.FazerDownload(n.model.exameId))}),e._uU(9,"Termo de Ci\xeancia e Orienta\xe7\xe3o"),e.qZA()(),e._uU(10," para paciente e/ou respons\xe1vel."),e.qZA()()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(9,rd)),e.Q6J("visible",o.display)("modal",!0)("responsive",!0)("baseZIndex",1e4),e.xp6(3),e.Q6J("binary",!0)("ngModel",o.selectedTermo)("disabled",o.model.termoCienciaOrientacao)}}let Fe=(()=>{class t extends Q.b{set value(o){o&&(this.display=!0,this.model=o,this.selectedTermo=this.model.termoCienciaOrientacao)}constructor(o){super(o),this.onClose=new e.vpe,this.resumoService=o.get(l.Q2b),this.termoService=o.get(l.Zfh)}ngOnInit(){this.clear()}clear(){this.model=void 0,this.display=!1,this.selectedTermo=!1,this.onClose.emit()}FazerDownload(o){this.termoService.fazerDownloadTermo(o,!1,this.domain).subscribe(i=>{if(i){const n='<iframe width="100%" height="98%" src="data:application/pdf;base64,'+escape(i)+'"></iframe>';window.open("").document.write(n)}})}
1onChangeTermo(o){if(o){this.startLoading();const i=new l.TnB;i.preAgendamentoId=this.model.preAgendamentoId,i.termoCienciaOrientacaoId=this.model.termoCienciaOrientacaoId,i.exameId=this.model.exameId,this.model.protocoloId&&(i.protocoloId=this.model.protocoloId),this.resumoService.checkTermoCienciaOrientacao(this.domain,i).subscribe(n=>{this.model.termoCienciaOrientacao=!0,this.modalAlertService.open("success","Aten\xe7\xe3o",n,"timer"),this.stopLoading(),this.clear()},n=>{this.verifyError(n)})}}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-termo-ciencia-orientacao"]],inputs:{value:"value"},outputs:{onClose:"onClose"},features:[e.qOj],decls:1,vars:1,consts:[[4,"ngIf"],["header","Termo de ciencia e orienta\xe7\xe3o",3,"visible","modal","responsive","baseZIndex","visibleChange","onHide"],[1,"row","mb-1"],[1,"div-footer","termo-de-ciencia-e-orientacao"],["name","checkboxTermo",3,"binary","ngModel","disabled","ngModelChange","onChange"],[1,"ms-2"],[1,"hand-underline",2,"text-decoration","underline",3,"click"]],template:function(o,i){1&o&&e.YNc(0,cd,11,10,"div",0),2&o&&e.Q6J("ngIf",i.model)},dependencies:[h.O5,v.JJ,v.On,k.V,re.XZ],styles:[".termo-de-ciencia-e-orientacao{width:100%;padding:20px;border-radius:3px;background:#D6EEF8 0% 0% no-repeat padding-box;border:1px solid #d3d3d3;box-shadow:1px 1px 1px 1px #0000000d;text-align:left;margin-top:10px}.termo-de-ciencia-e-orientacao span{font-size:12px;margin-left:0}\n"],encapsulation:2}),t})();function ld(t,s){if(1&t&&(e.TgZ(0,"div",13),e._uU(1),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Oqu(o.mensagem)}}function md(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",30),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(3);return e.KtG(a.reagendarProtocolo(n,n.agendaIndividual))}),e._UZ(1,"em",31),e._uU(2," Reagendar Protocolo "),e.qZA()}}function _d(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",26)(1,"a",27),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.confirmProtocolo(n))}),e._UZ(2,"em",28),e._uU(3," Cancelar Protocolo "),e.qZA(),e.YNc(4,md,3,0,"a",29),e.qZA()}if(2&t){const o=e.oxw(4);e.xp6(4),e.Q6J("ngIf",o.configReagendamento&&o.configReagendamento.value)}}function pd(t,s){1&t&&(e.TgZ(0,"span",55),e._uU(1,"(Drive-Thru)"),e.qZA())}function ud(t,s){1&t&&e._UZ(0,"em",56)}function gd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",57),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.showExamesAnalisesClinicas(n.protocoloId))}),e._uU(1," ver mais "),e.qZA()}if(2&t){const o=e.oxw(6);e.ekj("disabled",o.isLoading)}}function hd(t,s){if(1&t&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.Oqu(o.horario)}}function fd(t,s){1&t&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&t&&(e.xp6(1),e.Oqu("7h \xe0s 12h"))}function vd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",61),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(5);return e.KtG(a.reagendar(n))}),e._UZ(1,"em",31),e._uU(2," Reagendar exame "),e.qZA()}}function xd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",58)(1,"a",59),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.confirm(n))}),e._UZ(2,"em",28),e._uU(3," Cancelar exame "),e.qZA(),e.YNc(4,vd,3,0,"a",60),e.qZA()}if(2&t){const o=e.oxw(3).$implicit,i=e.oxw(3);e.xp6(4),e.Q6J("ngIf",i.configReagendamento&&i.configReagendamento.value&&0==o.agendaIndividual)}}const ve=function(t){return{"w-100":t}};function Cd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",62),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.buscarUrlDocumento(n))}),e._uU(1," Consultar preparo "),e.qZA()}if(2&t){const o=e.oxw(6);e.Q6J("ngClass",e.VKq(1,ve,o.mobile))}}function Ad(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",62),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.showPreparoInformacoes(n))}),e._uU(1," Consultar preparo "),e.qZA()}if(2&t){const o=e.oxw(6);e.Q6J("ngClass",e.VKq(1,ve,o.mobile))}}const ce=function(t,s,o){return{"w-100":t,"btn-outline-primary":s,"btn-outline-success":o}};function bd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",63),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.showTermoCienciaOrientacao(n))}),e._uU(1," Consultar termos "),e.qZA()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ngClass",e.kEZ(1,ce,i.mobile,!o.termoCienciaOrientacao,o.termoCienciaOrientacao))}}function Td(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.goToDocumento(n.protocoloId))}),e._uU(1," Fazer Web check-in "),e.qZA()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ngClass",e.kEZ(1,ce,i.mobile,!o.documentosEnviados,o.documentosEnviados))}}function Zd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.goToDocumento(n.protocoloId))}),e._uU(1," Enviar Documentos "),e.qZA()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ngClass",e.kEZ(1,ce,i.mobile,!o.documentosEnviados,o.documentosEnviados))}}function Ed(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",65),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.goToQuestionario(n.exameId,n.protocoloId,n.prontuarioId))}),e._uU(1," Responder question\xe1rio "),e.qZA()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ngClass",e.kEZ(1,ce,i.mobile,!o.questionarioRespondido,o.questionarioRespondido))}}function Id(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",66),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.goToResultado(n.protocoloId))}),e._uU(1," Consultar resultado "),e.qZA()}if(2&t){const o=e.oxw(6);e.Q6J("ngClass",e.VKq(1,ve,o.mobile))}}const Pd=function(t,s){return{"col-xl-8 col-lg-8 col-md-8":t,"text-center mt-2":s}},wd=function(t,s,o,i,n){return{"w-100":t,"text-success":s,"text-danger":o,"text-warning":i,"text-info":n}};function Md(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",34)(1,"div",19)(2,"div",35)(3,"span",36),e._uU(4),e.YNc(5,pd,2,0,"span",37),e.TgZ(6,"a",38),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(5);return e.KtG(d.showUnidadeInformacoes(a.unidadeId))}),e.YNc(7,ud,1,0,"em",39),e.qZA(),e.YNc(8,gd,2,2,"a",40),e.qZA()()(),e.TgZ(9,"div",19)(10,"div",41)(11,"span",42),e._uU(12),e.YNc(13,hd,2,1,"span",43),e.YNc(14,fd,2,1,"span",43),e.qZA()(),e.YNc(15,xd,5,1,"div",44),e.TgZ(16,"div",45)(17,"div",46),e._uU(18),e.qZA()(),e.TgZ(19,"div",47),e._UZ(20,"div",48),e.qZA()(),e.TgZ(21,"div",19)(22,"div",49),e.YNc(23,Cd,2,3,"a",50),e.YNc(24,Ad,2,3,"a",50),e.YNc(25,bd,2,5,"a",51),e.YNc(26,Td,2,5,"a",52),e.YNc(27,Zd,2,5,"a",52),e.YNc(28,Ed,2,5,"a",53),e.YNc(29,Id,2,3,"a",54),e.qZA()()()}if(2&t){const o=s.$implicit,i=s.last,n=e.oxw(5);e.MGl("id","selectedExames",o.id,""),e.Q6J("styleClass","border-only-none padding-child-0 light"),e.xp6(4),e.hij("",o.nomeExame," "),e.xp6(1),e.Q6J("ngIf",o.driveThru),e.xp6(2),e.Q6J("ngIf","ATENDIMENTO DOMICILIAR"!=o.nomeExame),e.xp6(1),e.Q6J("ngIf",o.exameNaoAgendavel),e.xp6(4),e.hij(" ",n.getFormatDateName(o.data)," - "),e.xp6(1),e.Q6J("ngIf",!("VACINA"===o.nomeExame||"ATENDIMENTO DOMICILIAR"===o.nomeExame)),e.xp6(1),e.Q6J("ngIf","VACINA"===o.nomeExame||"ATENDIMENTO DOMICILIAR"===o.nomeExame),e.xp6(1),e.Q6J("ngIf",0===o.statusAgendamento),e.xp6(1),e.Q6J("ngClass",e.WLB(20,Pd,o.statusAgendamento>0,n.mobile)),e.xp6(1),e.Q6J("ngClass",e.qbA(23,wd,n.mobile,o.statusAgendamento>=5,4===o.statusAgendamento,o.statusAgendamento>0&&o.statusAgendamento<4,0===o.statusAgendamento)),e.xp6(1),e.Oqu(o.statusAgendadamentoDetalhe),e.xp6(5),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_MEUSAGENDAMENTOS_PREPARO")&&o.linkInstrucao&&""!==o.linkInstrucao&&i),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_MEUSAGENDAMENTOS_PREPARO")&&(!o.linkInstrucao||""===o.linkInstrucao)&&i),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_MEUSAGENDAMENTOS_TERMO")&&o.termoCienciaOrientacaoId>0),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_MEUSAGENDAMENTOS_DOCUMENTO")&&0===o.statusAgendamento&&i&&n.configRealizaWebCheckIn),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_MEUSAGENDAMENTOS_DOCUMENTO")&&0===o.statusAgendamento&&i&&!n.configRealizaWebCheckIn),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_MEUSAGENDAMENTOS_QUESTIONARIO")&&0===o.statusAgendamento&&o.possuiQuestionario),e.xp6(1),e.Q6J("ngIf",n.getPermiteResultadoOnline()&&0!==o.statusAgendamento)}}function Ud(t,s){if(1&t&&(e.TgZ(0,"div",32),e.YNc(1,Md,30,29,"p-card",33),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",o.agendamentos)}}function Nd(t,s){1&t&&(e.TgZ(0,"div",19)(1,"div",13)(2,"p",67),e._uU(3,"N\xe3o existe(m) exame(s) agendado(s) para voc\xea"),e.qZA()()())}
1function Sd(t,s){if(1&t&&(e.TgZ(0,"p-card",22)(1,"div",19)(2,"div",23)(3,"h5"),e._uU(4,"Protocolo: "),e.TgZ(5,"b"),e._uU(6),e.qZA()()(),e.YNc(7,_d,5,1,"div",24),e.qZA(),e.YNc(8,Ud,2,1,"div",25),e.YNc(9,Nd,4,0,"div",18),e.qZA()),2&t){const o=s.$implicit;e.oxw(2);const i=e.MAs(5);e.xp6(6),e.Oqu(o.protocoloId),e.xp6(1),e.Q6J("ngIf","0"==i.activeItem.id),e.xp6(1),e.Q6J("ngIf",o.agendamentos&&o.agendamentos.length>0),e.xp6(1),e.Q6J("ngIf",!o.agendamentos||0===o.agendamentos.length)}}function yd(t,s){if(1&t&&(e.TgZ(0,"div",19)(1,"div",20),e.YNc(2,Sd,10,4,"p-card",21),e.qZA()()),2&t){const o=e.oxw(2);e.xp6(2),e.Q6J("ngForOf",o.meusProtocolos)}}function qd(t,s){1&t&&(e.TgZ(0,"div",19)(1,"div",13)(2,"p",67),e._uU(3,"N\xe3o existe(m) protocolos(s) para voc\xea"),e.qZA()()())}function Jd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",14)(1,"fieldset",15)(2,"legend"),e._uU(3," Meus Agendamentos"),e.qZA(),e.TgZ(4,"p-tabMenu",16,17),e.NdJ("click",function(){e.CHM(o);const n=e.MAs(5),a=e.oxw();return e.KtG(a.buscarAgendamento(n.activeItem.id))}),e.qZA(),e.YNc(6,yd,3,1,"div",18),e.YNc(7,qd,4,0,"div",18),e.qZA()()}if(2&t){const o=e.oxw();e.xp6(4),e.Q6J("model",o.items)("scrollable",!0)("activeItem",o.items[0]),e.xp6(2),e.Q6J("ngIf",o.meusProtocolos&&o.meusProtocolos.length>0),e.xp6(1),e.Q6J("ngIf",!o.meusProtocolos||0===o.meusProtocolos.length)}}let kd=(()=>{class t extends w.a{constructor(o,i){super(o),this.confirmationService=i,this.router=o.get(b.F0),this.meusAgendamentosService=o.get(l.t0i),this.pagamentoService=o.get(l.eTo),this.exameService=o.get(l.q07),this.unidadeService=o.get(l.sc7),this.homeService=o.get(l.igG),this.informacaoUnidadeService=o.get(l.muL),this.route=o.get(b.gz),this.convenioPlanoService=o.get(l.xE1)}ngOnInit(){this.items=[{label:"Agendado",id:"0"},{label:"Ausente",id:"1"},{label:"Cancelado",id:"4"},{label:"Atendido",id:"5"},{label:"WebCheckin",id:"6"}],this.changeStep(0),this.clear(),this.load()}clear(){this.meusAgendamentos=[],this.meusProtocolos=[]}load(){this.verificaPermissaoTela(),this.redirect=this.route.snapshot.queryParams.redirect,this.isLoggedIn()?this.get():(this.eventCloseLogin=this.loginService.onClose.subscribe(o=>{this.onCloseLogin()}),this.exibirPopupLogin())}onCloseLogin(){this.eventCloseLogin.unsubscribe(),this.isLoggedIn()?this.get():this.router.navigate(["marcacao/home"],{queryParamsHandling:"merge"})}get(){this.startLoading(!0),this.mensagem="Buscando Meus Agendamentos...",this.configRealizaWebCheckIn="true"===this.getSetting("RealizaWebCheckin").toLowerCase(),(0,J.D)(this.exameService.getExameAcId(this.domain),this.meusAgendamentosService.getMeusAgendamentos(0,this.domain),this.unidadeService.getUnidadeCD(this.domain),this.unidadeService.getUnidadeVacina(this.domain),this.exameService.getConfig("BotaoReagendar",this.domain),this.homeService.getDataLayer(this.domain),this.informacaoUnidadeService.getInfoUnidades(this.domain),this.convenioPlanoService.getConvenioParticular(this.domain),this.convenioPlanoService.getConvenioFidelidade(this.domain)).subscribe(o=>{this.modelFinished.exameAcId=o[0],this.meusAgendamentos=o[1].agendamentos,this.meusProtocolos=o[1].protocolos,this.examesCoringa=o[1].examesCoringa,this.unidadeCD=o[2],this.unidadeVacina=o[3],this.configReagendamento=o[4],this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o[5],this.unidades=o[6],this.modelFinished.convenioParticular=o[7],this.modelFinished.convenioFidelidade=o[8],this.meusProtocolos.forEach(i=>{const n=[];i.agendamentos.forEach(a=>{n.push(a.unidadeId)}),[...new Set(n)].length>1?(i.agendaIndividual=!0,i.agendamentos.forEach(a=>{a.agendaIndividual=!0})):(i.agendaIndividual=!1,i.agendamentos.forEach(a=>{a.agendaIndividual=!1}))}),this.stopLoading()},o=>{this.verifyError(o)})}confirm(o){this.pagamentoService.getVerificaPagamentos(o.protocoloId,this.domain).subscribe(i=>{if(i)return this.modalAlertService.open("warning","Aten\xe7\xe3o","O seu agendamento n\xe3o pode ser cancelado, pois possui um pagamento. Por favor, entrar em contato com a Central de Atendimento solicitando o cancelamento e o estorno de seu pagamento","button"),!1;if(this.getPermitePagamentoOnline()&&o.pagamentoOnline){let n=new Date;const a=new Date(o.data.getFullYear(),o.data.getMonth(),o.data.getDate(),+o.horario.split(":")[0],+o.horario.split(":")[1]);if(n=new Date(n.setDate(1+n.getDate())),a.getTime()<n.getTime())return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o \xe9 poss\xedvel cancelar em menos de 24h agendamento com pagamento on-line, procure a central de atendimento","button"),!1}this.confirmationService.confirm({message:"Deseja cancelar o agendamento deste exame?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.removeAgendamento(o)}})},i=>{this.verifyError(i)})}buscarAgendamento(o){let i=+o;this.meusAgendamentos=null,this.startLoading(),(0,J.D)(this.meusAgendamentosService.getMeusAgend
1amentos(i,this.domain)).subscribe(n=>{this.meusAgendamentos=n[0].agendamentos,this.meusProtocolos=n[0].protocolos,this.examesCoringa=n[0].examesCoringa,this.stopLoading()},n=>{this.verifyError(n)})}removeAgendamento(o){this.meusAgendamentos.length>=1&&this.meusAgendamentos.find(i=>i.agendamentoId===o.agendamentoId)&&this.dropAgendamento(o)}dropAgendamento(o){this.mensagem="Cancelando Agendamento...",this.startLoading(!0),this.meusAgendamentosService.dropAgendamento(this.domain,o).subscribe(i=>{this.stopLoading(),this.modalAlertService.open("success","Aten\xe7\xe3o","Agendamento cancelado com sucesso","timer"),this.clear(),this.get()},i=>{this.verifyError(i)})}confirmProtocolo(o){this.pagamentoService.getVerificaPagamentos(o.protocoloId,this.domain).subscribe(i=>{if(i)return this.modalAlertService.open("warning","Aten\xe7\xe3o","O seu agendamento n\xe3o pode ser cancelado, pois possui um pagamento. Por favor, entrar em contato com a Central de Atendimento solicitando o cancelamento e o estorno de seu pagamento","button"),!1;let n=0;o.agendamentos.forEach(a=>{if(this.getPermitePagamentoOnline()&&a.pagamentoOnline&&0===n){let r=new Date;const c=new Date(a.data.getFullYear(),a.data.getMonth(),a.data.getDate(),+a.horario.split(":")[0],+a.horario.split(":")[1]);r=new Date(r.setDate(1+r.getDate())),c.getTime()<r.getTime()&&(this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o \xe9 poss\xedvel cancelar em menos de 24h agendamento com pagamento on-line, procure a central de atendimento","button"),n++)}}),0===n&&this.confirmationService.confirm({message:"Deseja cancelar todos os agendamentos deste protocolo?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.removeProtocolo(o)}})},i=>{this.verifyError(i)})}removeProtocolo(o){this.mensagem="Cancelando Protocolo...",this.startLoading(!0),this.meusAgendamentosService.dropProtocolo(this.domain,o).subscribe(()=>{this.stopLoading(),this.modalAlertService.open("success","Aten\xe7\xe3o","Protocolo cancelado com sucesso","timer"),this.clear(),this.get()},i=>{this.verifyError(i)})}reagendar(o){this.cleanModel(),this.cleanModelFinished(),this.model.agendamento=o,this.pagamentoService.getVerificaPagamentos(o.protocoloId,this.domain).subscribe(i=>{if(i)return this.modalAlertService.open("warning","Aten\xe7\xe3o","O seu reagendamento n\xe3o pode ser realizado, pois possui um pagamento. Por favor, entrar em contato com a Central de Atendimento solicitando o cancelamento e o estorno de seu pagamento","button"),!1;this.prepararReagendamento(!1,null)},i=>{this.verifyError(i)})}reagendarProtocolo(o,i){this.cleanModel(),this.cleanModelFinished(),this.model.protocolo=o,this.pagamentoService.getVerificaPagamentos(o.protocoloId,this.domain).subscribe(n=>{if(n)return this.modalAlertService.open("warning","Aten\xe7\xe3o","O seu reagendamento n\xe3o pode ser realizado, pois possui um pagamento. Por favor, entrar em contato com a Central de Atendimento solicitando o cancelamento e o estorno de seu pagamento","button"),!1;this.prepararReagendamento(!0,i)},n=>{this.verifyError(n)})}prepararReagendamento(o,i){this.model.reagendamento=!0;const n=o?this.model.protocolo.agendamentos[0].convenioId:this.model.agendamento.convenioId,a=o?this.model.protocolo.agendamentos[0].planoId:this.model.agendamento.planoId,d=o?this.model.protocolo.protocoloId:this.model.agendamento.protocoloId;(0,J.D)(this.exameService.getExames(this.domain),this.convenioPlanoService.getConvenios(this.domain),this.convenioPlanoService.getPlanos(n,this.domain),this.convenioPlanoService.getConvenioParticular(this.domain),this.convenioPlanoService.getPlanoParticular(this.domain),this.exameService.getExameAcId(this.domain),this.unidadeService.getUnidadeCD(this.domain),this.unidadeService.getUnidadeVacina(this.domain),this.unidadeService.getTurnos(this.domain),this.convenioPlanoService.getPlanoFidelidade(this.domain),this.convenioPlanoService.getConvenioFidelidade(this.domain),this.meusAgendamentosService.buscarIndicacaoProgramaFidelidade(d,this.domain)).subscribe(r=>{const c=r[0],m=r[1],_=r[2],p=r[3],u=r[4],f=r[5],C=r[6],x=r[7],A=r[8],P=r[9],_e=r[10],pe=r[11];if(this.model.convenioParticular=p,this.model.planoParticular=u,this.model.exameAcId=f,this.model.unidadeCD=C,this.model.unidadeVacina=x,this.model.turnos=A,this.model.planoFidelidade=P,this.model.convenioFidelidade=_e,this.model.possuiIndicacaoProgramaFidelidade=pe,this.model.agendaItemSaida=[],this.model.exames=[],this.model.examesNaoAgendaveis=[],this.model.examesDomiciliares=[],n!==p.id?(this.model.convenio=m.find(M=>M.id===n),this.model.plano=_.find(M=>M.id===a)):(this.model.convenio=p,this.model.plano=u,this.model.particular=!0),o){let M=0;if(this.model.protocolo.agendamentos.forEach(S=>{this.inicializarExame(S,c,f)&&M++}),M<this.model.protocolo.agendamentos.length)return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o foi poss\xedvel inicializar os exames do protocolo para reagendamento!","button"),this.stopLoading(),!1}else if(!this.inicializarExame(this.model.agendamento,c,f))return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o foi poss\xedvel inicializar o exame para reagendamento!","button"),this.stopLoading(),!1;if(this.syncModel(),this.stopLoading(),this.model.examesNaoAgendaveis.filter(M=>"VACINA"===M.especialidade.toUpperCase()).length>0)this.model.unidades=void 0,this.goToUnidade(i);else{this.startLoading();const M=new l.oaE;M.exames=this.model.exames,M.examesAc=this.model.examesNaoAgendaveis,M.origemRequisicao="autoagendamento",this.unidadeService.getUnidadesProximas(!1,this.domain,M).subscribe(S=>{const be=[];for(let ee=0;ee<S.length;ee++){const Te=this.unidades.filter(wm=>wm.id===S[ee].id);Te[0].distancia=S[ee].distancia,Te[0].totalExamesCobertos=S[ee].totalExamesCobertos,be.push(Te[0])}this.model.unidades=be,this.stopLoading(),this.goToUnidade(i)},S=>{this.verifyError(S)})}},r=>{this.verifyError(r)})}goToUnidade(o){this.model.unidadesSelecionadas=[],this.syncModel(),this.router.navigate(null===o?["/marcacao/unidade"]:["/marcacao/exame-individual"],{queryParamsHandling:"merge"})}inicializarExame(o,i,n){const a=i.find(m=>m.id===o.exameId),d=this.examesCoringa.filter(m=>m===o.exameId).length>0,r=this.model.exames.filter(m=>m.id===a.id).length>0;if(a&&!d&&!r){const m=new l.TIN;if(0!==o.idMedicoPreferencial){const _=new l.Aq2;_.id=o.idMedicoPreferencial,a.medico=_}m.init(a),this.model.exames.push(m)}return this.atualizarExamesNaoAgendaveis(o,i)}atualizarExamesNaoAgendaveis(o,i){const n=this.examesCoringa.filter(a=>a===o.exameId).length>0;if(o.examesNaoAgendaveis){let a=0;return o.examesNaoAgendaveis.forEach(d=>{const r=i.find(m=>m.id===d.id),c=this.model.examesNaoAgendaveis.filter(m=>m.id===r.id).length>0;if(r){if(!c){const m=new l.TIN;m.init(r),this.model.examesNaoAgendaveis.push(m),n&&this.model.examesDomiciliares.push(m)}a++}}),a===o.examesNaoAgendaveis.length}return!0}showPreparoInformacoes(o){const i=new l.TIN;i.id=o.exameId,i.nome=o.nomeExame,this.modelFinished.exameAcId===i.id||"ATENDIMENTO DOMICILIAR"===i.nome||"ANALISES CL\xcdNICAS"===i.nome?this.selectedExamePreparoAcProtocoloId=o.protocoloId:this.selectedExamePreparo=i}hidePreparoInformacoes(){this.selectedExamePreparo=void 0,this.selectedExamePreparoAcProtocoloId=void 0}showUnidadeInformacoes(o){this.selectedInformacaoUnidadeId=o}hideUnidadeInformacoes(){this.selectedInformacaoUnidadeId=void 0}showTermoCienciaOrientacao(o){this.selectedTermoCienciaOrientacao=o}hideTermoCienciaOrientacao(){this.selectedTermoCienciaOrientacao=void 0}showExamesAnalisesClinicas(o){this.selectedExameAcProtocoloId=o}hideExamesAnalisesClinicas(){this.selectedExameAcProtocoloId=void 0}goToPreviousStep(){this.router.navigate([this.routeState.getPreviousUrl(
1)],{queryParamsHandling:"merge"})}goToNextStep(){this.getDataLayer("agendar-online"),this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}goToQuestionario(o,i,n){T.G.setItem("titular-dependente",n),this.cleanModelFinished(),this.modelFinished.protocoloIdSelected=i,this.modelFinished.exameIdSelected=o,this.syncModelFinished(),this.router.navigate(["/marcacao/questionario"],{queryParamsHandling:"merge"})}goToDocumento(o){var i;if(this.unidadeVacina){const n=this.meusAgendamentos.filter(a=>a.protocoloId===o&&a.unidadeId===this.unidadeVacina.id);this.modelFinished.vacina=n.length>0}this.modelFinished.protocoloIdSelected=o,this.modelFinished.convenio=new l.p0k,this.modelFinished.convenio.id=null===(i=this.meusAgendamentos.find(n=>n.protocoloId===o))||void 0===i?void 0:i.convenioId,this.syncModelFinished(),this.mostraBulletsProcessoAgendamento=!1,this.router.navigate(["/marcacao/documento"],{queryParamsHandling:"merge"})}buscarUrlDocumento(o){this.startLoading(!1),this.meusAgendamentosService.buscarLinkPreparo(this.domain,o).subscribe(i=>{i&&(this.stopLoading(),window.open(i,"_blank"))},i=>{this.showPreparoInformacoes(o)})}goToResultado(o){this.mensagem="Buscando resultado...",this.exameService.getResultado(o,this.domain).subscribe(i=>{this.mensagem="",window.open(i,"_blank")},i=>{this.verifyError(i)})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(Z.YP))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-meus-agendamentos"]],features:[e._Bn([Z.YP]),e.qOj],decls:16,vars:10,consts:[[1,"row","pt-0","mt-4"],["class","col-12",4,"ngIf"],["class","col-12 mt-3",4,"ngIf"],["header","Confirmation","icon","pi pi-exclamation-triangle","acceptLabel","Sim","rejectLabel","N\xe3o"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[3,"value","protocoloId","onClose"],[3,"value","onClose"],[3,"protocoloId","exameAcId","onClose"],[1,"col-12"],[1,"col-12","mt-3"],[1,"p-3"],[3,"model","scrollable","activeItem","click"],["tab",""],["class","row",4,"ngIf"],[1,"row"],[1,"col-12","mt-0","p-fluid","text-end"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start"],[1,"col-xl-4","col-lg-4","col-md-4","col-sm-12"],["class","col-xl-8 col-lg-8 col-md-8 col-sm-12",4,"ngIf"],["class","",4,"ngIf"],[1,"col-xl-8","col-lg-8","col-md-8","col-sm-12"],["href","javascript:void(0)","title","Cancelar",1,"btn","btn-sm","border","me-2","mb-2","text-primary","bold",3,"click"],[1,"fas","fa-times","text-danger"],["href","javascript:void(0)","class","btn btn-sm border me-2 mb-2 text-primary fw-bold","title","Reagendar",3,"click",4,"ngIf"],["href","javascript:void(0)","title","Reagendar",1,"btn","btn-sm","border","me-2","mb-2","text-primary","fw-bold",3,"click"],[1,"fas","fa-calendar"],[1,""],["class","p-0 mt-0",3,"id","styleClass",4,"ngFor","ngForOf"],[1,"p-0","mt-0",3,"id","styleClass"],[1,"col-md-12","mb-0","mt-0","pt-0"],[1,"title"],["class","text-warning",4,"ngIf"],["href","javascript:void(0)",3,"click"],["class","fas fa-info-circle ms-2 me-2",4,"ngIf"],["href","javascript:void(0)","class","btn btn-sm border me-2 text-primary fw-bold",3,"disabled","click",4,"ngIf"],[1,"col-md-4","mt-0","pt-0"],[1,"text-black-50"],[4,"ngIf"],["class","col-xl-5 col-lg-5 col-md-5 col-sm-12 mt-0 pt-0",4,"ngIf"],[1,"col-xl-3","col-lg-3","col-md-3","col-sm-12","mt-0","pt-0","text-end",3,"ngClass"],[1,"fw-bold","fs-5",3,"ngClass"],[1,"col-md-12","mt-0","mb-0","pt-0"],[1,"border-only-bottom","border-gray","p-1","w-100"],[1,"col-md-12","col-sm-12","mt-0"],["href","javascript:void(0)","class","btn btn-outline-primary m-1 fw-bold","title","Preparo",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)","class","btn m-1 fw-bold btn-outline-primary","title","Termos",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)","class","btn m-1 bold","title","Documentos",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)","class","btn m-1 bold","title","Question\xe1rio",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)","class","btn btn-outline-primary m-1 fw-bold","title","Resultado",3,"ngClass","click",4,"ngIf"],[1,"text-warning"],[1,"fas","fa-info-circle","ms-2","me-2"],["href","javascript:void(0)",1,"btn","btn-sm","border","me-2","text-primary","fw-bold",3,"click"],[1,"col-xl-5","col-lg-5","col-md-5","col-sm-12","mt-0","pt-0"],["href","javascript:void(0)","title","Cancelar",1,"btn","btn-sm","border","mb-2","me-2","text-primary","fw-bold",3,"click"],["href","javascript:void(0)","class","btn btn-sm border mb-2 me-2 text-primary fw-bold","title","Reagendar",3,"click",4,"ngIf"],["href","javascript:void(0)","title","Reagendar",1,"btn","btn-sm","border","mb-2","me-2","text-primary","fw-bold",3,"click"],["href","javascript:void(0)","title","Preparo",1,"btn","btn-outline-primary","m-1","fw-bold",3,"ngClass","click"],["href","javascript:void(0)","title","Termos",1,"btn","m-1","fw-bold","btn-outline-primary",3,"ngClass","click"],["href","javascript:void(0)","title","Documentos",1,"btn","m-1","bold",3,"ngClass","click"],["href","javascript:void(0)","title","Question\xe1rio",1,"btn","m-1","bold",3,"ngClass","click"],["href","javascript:void(0)","title","Resultado",1,"btn","btn-outline-primary","m-1","fw-bold",3,"ngClass","click"],[1,"text-danger","small"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,ld,2,1,"div",1),e.YNc(2,Jd,8,5,"div",2),e.qZA(),e._UZ(3,"p-confirmDialog",3),e.TgZ(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"button",8),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(9,"Voltar"),e.qZA(),e.TgZ(10,"button",9),e.NdJ("click",function(){return i.goToNextStep()}),e._uU(11,"Novo Agendamento"),e.qZA()()()()(),e.TgZ(12,"app-preparo-informacao",10),e.NdJ("onClose",function(){return i.hidePreparoInformacoes()}
1),e.qZA(),e.TgZ(13,"app-unidade-informacao",11),e.NdJ("onClose",function(){return i.hideUnidadeInformacoes()}),e.qZA(),e.TgZ(14,"app-termo-ciencia-orientacao",11),e.NdJ("onClose",function(){return i.hideTermoCienciaOrientacao()}),e.qZA(),e.TgZ(15,"app-exames-analises-clinicas",12),e.NdJ("onClose",function(){return i.hideExamesAnalisesClinicas()}),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(6),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("value",i.selectedExamePreparo)("protocoloId",i.selectedExamePreparoAcProtocoloId),e.xp6(1),e.Q6J("value",i.selectedInformacaoUnidadeId),e.xp6(1),e.Q6J("value",i.selectedTermoCienciaOrientacao),e.xp6(1),e.Q6J("protocoloId",i.selectedExameAcProtocoloId)("exameAcId",i.model.exameAcId))},dependencies:[h.mk,h.sg,h.O5,y.Z,F.Q,ke.d,G,j,De,Fe],styles:[".p-tabmenu-nav li:nth-last-child(2) a{margin-right:38px!important}\n"],encapsulation:2}),t})(),Dd=(()=>{class t{constructor(){this.regexBandeira={Mastercard:/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/,AmericanExpress:/^3[47]\d{13,14}$/,Visa:/^4[0-9]{12}(?:[0-9]{3})/,Amex:/^3[47][0-9]{13}/,Aura:"^507860",BaneseCard:"^636117",Cabal:"(60420[1-9]|6042[1-9][0-9]|6043[0-9]{2}|604400)",Diners:"(36[0-8][0-9]{3}|369[0-8][0-9]{2}|3699[0-8][0-9]|36999[0-9])",Discover:/^6(?:011|5[0-9]{2})[0-9]{12}/,Elo:"^4011(78|79)|^43(1274|8935)|^45(1416|7393|763(1|2))|^504175|^627780|^63(6297|6368|6369)|(65003[5-9]|65004[0-9]|65005[01])|(65040[5-9]|6504[1-3][0-9])|(65048[5-9]|65049[0-9]|6505[0-2][0-9]|65053[0-8])|(65054[1-9]|6505[5-8][0-9]|65059[0-8])|(65070[0-9]|65071[0-8])|(65072[0-7])|(65090[1-9]|6509[1-6][0-9]|65097[0-8])|(65165[2-9]|6516[67][0-9])|(65500[0-9]|65501[0-9])|(65502[1-9]|6550[34][0-9]|65505[0-8])|^(506699|5067[0-6][0-9]|50677[0-8])|^(509[0-8][0-9]{2}|5099[0-8][0-9]|50999[0-9])|^65003[1-3]|^(65003[5-9]|65004d|65005[0-1])|^(65040[5-9]|6504[1-3]d)|^(65048[5-9]|65049d|6505[0-2]d|65053[0-8])|^(65054[1-9]|6505[5-8]d|65059[0-8])|^(65070d|65071[0-8])|^65072[0-7]|^(65090[1-9]|65091d|650920)|^(65165[2-9]|6516[6-7]d)|^(65500d|65501d)|^(65502[1-9]|6550[3-4]d|65505[0-8])",FortBrasil:"^628167",GrandCard:"^605032",Hipercard:"^606282|^637095|^637599|^637568",JCB:/^(?:2131|1800|35\d{3})\d{11}/,PersonalCard:"^636085",Sorocred:"^627892|^636414",Valecard:"^606444|^606458|^606482"}}getBandeira(o){let i="";return Object.keys(this.regexBandeira).forEach(n=>{const a=o.replace(/\./g,"").match(this.regexBandeira[n]);a&&a&&(i=n)}),i}}return t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=e.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class Fd{constructor(s,o){this._document=o;const i=this._textarea=this._document.createElement("textarea"),n=i.style;n.position="fixed",n.top=n.opacity="0",n.left="-999em",i.setAttribute("aria-hidden","true"),i.value=s,this._document.body.appendChild(i)}copy(){const s=this._textarea;let o=!1;try{if(s){const i=this._document.activeElement;s.select(),s.setSelectionRange(0,s.value.length),o=this._document.execCommand("copy"),i&&i.focus()}}catch{}return o}destroy(){const s=this._textarea;s&&(s.parentNode&&s.parentNode.removeChild(s),this._textarea=void 0)}}let Oe=(()=>{class t{constructor(o){this._document=o}copy(o){const i=this.beginCopy(o),n=i.copy();return i.destroy(),n}beginCopy(o){return new Fd(o,this._document)}}return t.\u0275fac=function(o){return new(o||t)(e.LFG(h.K0))},t.\u0275prov=(0,e.Yz7)({factory:function(){return new t((0,e.LFG)(h.K0))},token:t,providedIn:"root"}),t})(),Hd=(()=>{class t{}return t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({}),t})();var He=g(7932);function Qd(t,s){if(1&t&&(e.TgZ(0,"div",9),e._uU(1),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Oqu(o.mensagem)}}function Ld(t,s){1&t&&(e.TgZ(0,"div",0)(1,"div",34)(2,"div",35),e._uU(3,"Observamos que voc\xea possui exames a serem pagos em seu agendamento. Voc\xea pode efetuar o pagamento abaixo ou posteriormente no menu Meus Pagamentos."),e.qZA()()())}function Rd(t,s){1&t&&(e.TgZ(0,"span",41),e._uU(1,"(Drive-Thru)"),e.qZA())}
1function Yd(t,s){if(1&t&&(e.TgZ(0,"div",36)(1,"div",37)(2,"span",38),e._uU(3),e.qZA(),e._UZ(4,"p",39),e.YNc(5,Rd,2,0,"span",40),e.qZA(),e.TgZ(6,"div",26)(7,"span",38),e._uU(8),e.qZA()()()),2&t){const o=s.$implicit,i=e.oxw(2);e.xp6(3),e.Oqu(o.nome),e.xp6(2),e.Q6J("ngIf",o.driveThru),e.xp6(3),e.hij("R$ ",i.getFormatCurrency(o.valor),"")}}function Gd(t,s){if(1&t&&(e.TgZ(0,"div",36)(1,"div",37)(2,"span",38),e._uU(3,"TAXAS"),e.qZA()(),e.TgZ(4,"div",26)(5,"span",38),e._uU(6),e.qZA()()()),2&t){const o=e.oxw(2);e.xp6(6),e.hij("R$ ",o.getFormatCurrency(o.totalTaxas),"")}}function Kd(t,s){if(1&t&&(e.TgZ(0,"div",15)(1,"div",25),e._uU(2),e.qZA(),e.TgZ(3,"div",26),e._uU(4),e.qZA()()),2&t){const o=e.oxw(2);e.xp6(2),e.hij("Desconto com Pix (",o.porcentagemDesconto,"%)"),e.xp6(2),e.hij("- R$ ",o.getFormatCurrency(o.desconto),"")}}const Qe=function(t){return{"btn-primary text-white":t}};function $d(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",42),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onChangeFormaPagamento(1))}),e._uU(1," Pix "),e.qZA()}if(2&t){const o=e.oxw(2);e.Q6J("ngClass",e.VKq(1,Qe,1==o.formaPagamentoSelecionado))}}function Vd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",0)(1,"div",50)(2,"span",51)(3,"input",57),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.modelPagamento.nomeCompleto=n)}),e.qZA(),e.TgZ(4,"label"),e._uU(5,"Nome (como descrito no cart\xe3o)*"),e.qZA()()()()}if(2&t){const o=e.oxw(3);e.xp6(3),e.Q6J("ngModel",o.modelPagamento.nomeCompleto)("setfocus",!0)}}function Bd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",0)(1,"div",50)(2,"span",51)(3,"p-inputMask",58),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.modelPagamento.numeroCartao=n)})("onComplete",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.carregarBandeira())})("onBlur",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.carregarBandeira())})("onInput",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.carregarBandeira())}),e.qZA(),e.TgZ(4,"label"),e._uU(5,"N\xfamero do cart\xe3o*"),e.qZA()()()()}if(2&t){const o=e.oxw(3);e.xp6(3),e.Q6J("ngModel",o.modelPagamento.numeroCartao)("mask","9999.9999.9999.9999")}}function zd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",0)(1,"div",59)(2,"span",51)(3,"p-inputMask",60),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.modelPagamento.dataValidade=n)}),e.qZA(),e.TgZ(4,"label"),e._uU(5,"Validade (mm/aaaa)*"),e.qZA()()(),e.TgZ(6,"div",59)(7,"span",51)(8,"p-inputMask",61),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.modelPagamento.codigoSeguranca=n)}),e.qZA(),e.TgZ(9,"label"),e._uU(10,"CVV/CVC*"),e.qZA()()()()}if(2&t){const o=e.oxw(3);e.xp6(3),e.Q6J("ngModel",o.modelPagamento.dataValidade)("mask","99/9999"),e.xp6(5),e.Q6J("ngModel",o.modelPagamento.codigoSeguranca)("mask","999")}}function jd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",62),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.goToPay())}),e._uU(1,"Pagar Online"),e.qZA()}if(2&t){const o=e.oxw(3);e.Q6J("disabled",o.isLoading)}}const Le=function(t){return{active:t}};function Wd(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",43)(1,"div",44)(2,"div",45)(3,"div",17)(4,"div",20),e._uU(5,"Dados do Pagamento"),e.qZA()()()(),e.TgZ(6,"div",46)(7,"div",47)(8,"img",48),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.bandeiraSelected="visa")}),e.qZA()(),e.TgZ(9,"div",47)(10,"img",49),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.bandeiraSelected="mastercard")}),e.qZA()()(),e.TgZ(11,"div",0)(12,"div",50)(13,"span",51)(14,"p-dropdown",52),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.modelPagamento.parcela=n)}),e.qZA(),e.TgZ(15,"label",53),e._uU(16,"Forma de pagamento:*"),e.qZA()()()(),e.YNc(17,Vd,6,2,"div",13),e.TgZ(18,"div",0)(19,"div",50)(20,"span",51)(21,"p-inputMask",54),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.modelPagamento.cpf=n)}),e.qZA(),e.TgZ(22,"label"),e._uU(23,"CPF Titular*"),e.qZA()()()(),e.YNc(24,Bd,6,2,"div",13),e.YNc(25,zd,11,4,"div",13),e.TgZ(26,"p")(27,"small")(28,"strong"),e._uU(29,"* campos obrigat\xf3rios"),e.qZA()()(),e.TgZ(30,"div",0)(31,"div",55),e.YNc(32,jd,2,1,"button",56),e.qZA()()()}if(2&t){const o=e.oxw(2);e.xp6(8),e.Q6J("ngClass",e.VKq(11,Le,"visa"==o.bandeiraSelected)),e.xp6(2),e.Q6J("ngClass",e.VKq(13,Le,"mastercard"==o.bandeiraSelected)),e.xp6(4),e.Q6J("options",o.parcelas)("ngModel",o.modelPagamento.parcela),e.xp6(3),e.Q6J("ngIf",0===o.cartaoSelected.externoId),e.xp6(4),e.Q6J("mask","999.999.999-99")("placeholder","CPF Titular*")("ngModel",o.modelPagamento.cpf),e.xp6(3),e.Q6J("ngIf",0===o.cartaoSelected.externoId),e.xp6(1),e.Q6J("ngIf",0===o.cartaoSelected.externoId),e.xp6(7),e.Q6J("ngIf",o.hasModelFinished)}}function Xd(t,s){1&t&&(e.TgZ(0,"div",69)(1,"span",70),e._uU(2,"Erro ao gerar chave PIX, tente novamente."),e.qZA()())}function er(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",68)(1,"div",69)(2,"span",70),e._uU(3,"Clique aqui para gerar a chave Pix para pagamento."),e.qZA()(),e.TgZ(4,"div",71)(5,"button",72),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.gerarChavePix())}),e._uU(6,"Gerar Chave Pix"),e.qZA()(),e.YNc(7,Xd,3,0,"div",73),e.qZA()}if(2&t){const o=e.oxw(3);e.xp6(7),e.Q6J("ngIf",o.exibeErroPix)}}function or(t,s){1&t&&(e.TgZ(0,"div",74),e._UZ(1,"p-progressSpinner"),e.qZA())}function ir(t,s){1&t&&e._UZ(0,"i",84)}function tr(t,s){if(1&t&&(e.TgZ(0,"div",0)(1,"span",85),e._uU(2),e.qZA()()),2&t){const o=e.oxw(4);e.xp6(2),e.hij("Aguardando pagamento ",o.contador,"")}}const nr=function(t){return{"btn-success text-white":t}};function ar(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",64)(1,"div",75)(2,"span"),e._uU(3,"PIX dispon\xedvel para pagamento!"),e.qZA()(),e.TgZ(4,"p-card",76)(5,"div",0)(6,"div",77),e._UZ(7,"iframe",78),e.qZA(),e.TgZ(8,"div",79)(9,"input",80),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.copiarChavePix())}),e.qZA(),e.TgZ(10,"div",81)(11,"button",82),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.copiarChavePix())}),e.YNc(12,ir,1,0,"i",83),e._uU(13),e.qZA()()()(),e.YNc(14,tr,3,1,"div",13),e.qZA()()}if(2&t){const o=e.oxw(3);e.xp6(7),e.Q6J("src",o.safeQrCode,e.uOi),e.xp6(2),e.Q6J("value",o.codigoPix),e.xp6(2),e.Q6J("ngClass",e.VKq(6,nr,o.mensagemCodigoPixCopiado)),e.xp6(1),e.Q6J("ngIf",o.mensagemCodigoPixCopiado),e.xp6(1),e.hij(" ",o.mensagemCodigoPixCopiado?"C\xf3digo copiado":"Copiar c\xf3digo"," "),e.xp6(1),e.Q6J("ngIf",o.hasModelFinished&&!o.model.meusPagamentos)}}function sr(t,s){if(1&t&&(e.TgZ(0,"p-card",63)(1,"div",64),e.YNc(2,er,8,1,"div",65),e.YNc(3,or,2,0,"div",66),e.YNc(4,ar,15,8,"div",67),e.qZA()()),2&t){const o=e.oxw(2);e.xp6(2),e.Q6J("ngIf",!o.showChavePix&&!o.loadChavePix),e.xp6(1),e.Q6J("ngIf",o.loadChavePix),e.xp6(1),e.Q6J("ngIf",o.showChavePix)}}function dr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",9)(1,"fieldset",10)(2,"legend"),e._uU(3,"Resumo de Pagamento"),e.qZA(),e.TgZ(4,"div",11)(5,"div",12),e.YNc(6,Ld,4,0,"div",13),e.TgZ(7,"p-card",14)(8,"div",15)(9,"div",16)(10,"div",17)(11,"div",18),e._uU(12),e.qZA()()(),e.TgZ(13,"div",16)(14,"div",17)(15,"div",18)(16,"span",19),e._uU(17),e.qZA()()(),e.TgZ(18,"div",17)(19,"div",18)(20,"span",19),e._uU(21),e.qZA()()(),e.TgZ(22,"div",17)(23,"div",20)(24,"span",19),e._uU(25),e.qZA()()(),e._UZ(26,"hr",21),e.qZA(),e.TgZ(27,"div",16)(28,"div",17)(29,"div",20),e._uU(30,"Exame(s) a ser(em) pago(s)"),e.qZA()()(),e.TgZ(31,"div",16),e.YNc(32,Yd,9,3,"div",22),e.YNc(33,Gd,7,1,"div",23),e.YNc(34,Kd,5,2,"div",24),e.TgZ(35,"div",15)(36,"div",25),e._uU(37,"Total"),e.qZA(),e.TgZ(38,"div",26),e._uU(39),e.qZA()()()()()(),e.TgZ(40,"div",27)(41,"p-card",28)(42,"div",29)(43,"button",30),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.onChangeFormaPagamento(0))}),e._uU(44," Cart\xe3o de Cr\xe9dito "),e.qZA(),e.YNc(45,$d,2,3,"button",31),e.qZA()(),e.YNc(46,Wd,33,15,"p-card",32),e.YNc(47,sr,5,3,"p-card",33),e.qZA()()()()}if(2&t){const o=e.oxw();e.xp6(6),e.Q6J("ngIf",o.exibirAlertaPagamento),e.xp6(6),e.hij("Protocolo ",o.modelFinished.protocoloIdSelected,""),e.xp6(5),e.hij(" Nome: ",o.nomePaciente,""),e.xp6(4),e.hij(" CPF: ",o.getFormatCpf(o.cpf),""),e.xp6(4),e.hij(" Data de Nascimento: ",o.getFormatDate(o.dataNascimento),""),e.xp6(7),e.Q6J("ngForOf",o.exames),e.xp6(1),e.Q6J("ngIf",o.totalTaxas>0),e.xp6(1),e.Q6J("ngIf",1==o.formaPagamentoSelecionado&&o.porcentagemDesconto>
10),e.xp6(5),e.hij("R$ ",o.getFormatCurrency(o.valor),""),e.xp6(4),e.Q6J("ngClass",e.VKq(14,Qe,0==o.formaPagamentoSelecionado&&o.getAtivarPagamentoPorPix()))("disabled",o.showChavePix&&!o.trocaParaCartao||!o.getAtivarPagamentoPorPix()),e.xp6(2),e.Q6J("ngIf",o.getAtivarPagamentoPorPix()),e.xp6(1),e.Q6J("ngIf",0===o.formaPagamentoSelecionado),e.xp6(1),e.Q6J("ngIf",1===o.formaPagamentoSelecionado&&o.getAtivarPagamentoPorPix())}}function rr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",86),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep())}),e._uU(1,"Pagar depois"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}function cr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",87),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._uU(1,"Voltar"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}let lr=(()=>{class t extends w.a{constructor(o,i){super(o),this.confirmationService=i,this.showChavePix=!1,this.qrCode="",this.codigoPix="",this.mensagemCodigoPixCopiado=!1,this.timeToNewToken=60,this.trocaParaCartao=!1,this.loadChavePix=!1,this.desconto=0,this.porcentagemDesconto=0,this.valor=0,this.totalPaymentSemDesconto=0,this.exibeErroPix=!1,this.router=o.get(b.F0),this.http=o.get(fe.eN),this.pagamentoService=o.get(l.eTo),this.meusPagamentosService=o.get(l.BQg),this.unidadeService=o.get(l.sc7),this.cartoesService=o.get(Dd),this.homeService=o.get(l.igG),this.route=o.get(b.gz),this.clipBoard=o.get(Oe),this.sanitizer=o.get(ae.H7),this.enderecoService=o.get(ye.t)}ngOnInit(){this.changeStep(3),this.clear(),this.load()}clear(){this.modelPagamento=new l.plV,this.totalPayment=0,this.totalTaxas=0,this.bandeiraSelected="",this.publicKey="";const o=new l.zkT;o.init({externoId:0,numero:"Adicionar Novo Cart\xe3o"}),this.cartoes=[],this.cartoes.push(o),this.cartaoSelected=this.cartoes[0]}load(o=!0){if(this.mensagem="Carregando...",this.verificaPermissaoTela(),this.timeToNewToken=Number.parseInt(this.TempoConfirmacaoPagamentoPixEmSegundos()),o){let i=this.obterProtocoloRota();if(i)return void this.carregarDadosProtocolo(i)}if(this.prontuarioId||this.user){if(this.cpf||(this.cpf=this.user.username),this.nomePaciente||(this.nomePaciente=this.user.usuarioSelecionado.nomeSocial?this.user.usuarioSelecionado.nomeSocial.toUpperCase():this.user.usuarioSelecionado.name),this.dataNascimento||(this.dataNascimento=this.user.dataNascimento?this.user.dataNascimento:this.user.usuarioSelecionado.dataNascimento),this.prontuarioId||(this.prontuarioId=this.user.prontuarioId),this.exames=this.hasModelFinished?this.modelFinished.examesPacotes?this.modelFinished.examesPacotes:this.modelFinished.examesAgendados:this.model.examesPacotes?this.model.examesPacotes:this.model.examesAgendados,this.taxas=this.hasModelFinished?this.modelFinished.taxas:this.model.taxas,this.modelFinished.exibirAlertaPagamento&&(this.exibirAlertaPagamento=this.modelFinished.exibirAlertaPagamento),this.exames||this.router.navigate(["/"],{queryParamsHandling:"merge"}),this.examesComRestricao.forEach(i=>{this.exames=this.exames.filter(n=>n.id!==i.id)}),this.exames.forEach(i=>{this.totalPayment+=i.valor}),this.taxas&&this.taxas.forEach(i=>{this.totalTaxas+=i.taxa}),this.totalPayment+=this.totalTaxas,this.valor=this.totalPayment,(0,J.D)(this.pagamentoService.getChavePublica(this.exames[0].unidade.id,this.domain),this.pagamentoService.getParcelas(this.totalPayment,this.domain),this.homeService.getDataLayer(this.domain),this.pagamentoService.getPercentualDesconto(this.domain)).subscribe(i=>{this.stopLoading(),this.publicKey=i[0],this.parcelas=i[1],this.modelPagamento.parcela=this.parcelas[0],this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:i[2],this.porcentagemDesconto=i[3],this.publicKey||this.router.navigate(this.model.domiciliar?["/marcacao/resumo-agendamento"]:["/marcacao/agendamento-concluido"],{queryParamsHandling:"merge"})},i=>{this.verifyError(i)}),(0,e.X6Q)()&&"http://localhost:4200"===window.location.origin){const i=new Date;i.setFullYear(i.getFullYear()+5);const n=i.getFullYear();this.modelPagamento.nomeCompleto="JUDITE DA SILVA",this.modelPagamento.numeroCartao="4444.4444.4444.4448",this.modelPagamento.dataValidade="12/"+n,this.modelPagamento.codigoSeguranca="484",this.modelPagamento.cpf="123.456.789-09",this.bandeiraSelected="visa"}this.bandeiras=["mastercard","visa","american_express"],this.modelFinished.pagamento&&this.modelFinished.pagamento.chavePix&&(this.showChavePix=!0,this.trocaParaCartao=!0,this.qrCode=this.modelFinished.pagamento.qrCodePix,this.codigoPix=this.modelFinished.pagamento.chavePix,this.safeQrCode=this.sanitizer.bypassSecurityTrustResourceUrl(this.qrCode)),this.getAtivarPagamentoPorPix()||(this.formaPagamentoSelecionado=0)}else this.router.navigate(["/marcacao/exame"])}
1obterProtocoloRota(){return this.route.snapshot.queryParams.protocolo}carregarDadosProtocolo(o){(0,J.D)(this.meusPagamentosService.getMeuPagamento(o,this.domain),this.unidadeService.getUnidades(this.domain)).subscribe(i=>this.carregarPagamento(i[0],i[1]),i=>this.verifyError(i))}carregarPagamento(o,i){if(!o)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Link expirado. Este link n\xe3o \xe9 mais v\xe1lido.","button"),void this.router.navigate(["/marcacao/exame"]);let n=!0;const a=new Date;o.exames.forEach(r=>{new Date(r.dataExame.getFullYear(),r.dataExame.getMonth(),r.dataExame.getDate(),+r.horarioExame.split(":")[0],+r.horarioExame.split(":")[1]).getTime()<=a.getTime()&&(n=!1)}),n||(this.modalAlertService.open("warning","Aten\xe7\xe3o","Link expirado. Este link n\xe3o \xe9 mais v\xe1lido.","button"),this.router.navigate(this.user?["/marcacao/meus-pagamentos"]:["/marcacao/exame"])),![0,3].includes(o.statusPagamento)&&!o.chavePix&&(this.modalAlertService.open("warning","Aten\xe7\xe3o","Link expirado. Este link n\xe3o \xe9 mais v\xe1lido.","button"),this.router.navigate(this.user?["/marcacao/meus-pagamentos"]:["/marcacao/exame"])),this.startLoading(!0),this.cleanModelFinished(),this.cleanModel(),this.modelFinished.protocoloIdSelected=o.protocoloId,this.modelFinished.examesAgendados=[],this.model.protocoloIdSelected=o.protocoloId,this.model.meusPagamentos=!0,this.exibirAlertaPagamento=!1,this.nomePaciente=o.nomePaciente,this.dataNascimento=o.dataNascimento,this.cpf=o.cpf,this.prontuarioId=o.prontuarioId;let d=0;if(o.exames.forEach(r=>{const c=new l.TIN,m=i.filter(_=>_.id===r.unidadeId)[0];c.id=r.exameId,c.driveThru=r.driveThru,c.nome=r.nomeExame,c.valor=4!==r.statusAgendamento?r.valorExame:0,c.unidade=m,c.data=r.dataExame,c.horario=r.horarioExame,this.modelFinished.examesAgendados.push(c),d+=r.valorExame}),d<o.valorTotal){const r=new l.jU5;r.taxa=o.valorTotal-d,this.modelFinished.taxas=[r]}this.modelFinished.pagamento=new l.plV,this.modelFinished.pagamento.qrCodePix=o.qrCodePix,this.modelFinished.pagamento.chavePix=o.chavePix,this.syncModel(),this.syncModelFinished(),this.load(!1)}carregarBandeira(){let o=this.cartoesService.getBandeira(this.modelPagamento.numeroCartao);o&&("Visa"===o||"Mastercard"===o||"AmericanExpress"===o)&&(o=o.toLowerCase(),o=o.replace("americanexpress","american_express")),this.bandeiraSelected=o}goToPreviousStep(){this.router.navigate([this.routeState.getPreviousUrl(
1)],{queryParamsHandling:"merge"})}goToNextStep(){this.modelFinished.exibirAlertaPagamento&&(this.modelFinished.exibirAlertaPagamento=!1,this.syncModelFinished()),this.timeToNewToken=0,clearInterval(this.countDown),this.model.meusPagamentos?(this.getDataLayer("pagamento","Pagamento | Meus-Pagamentos"),this.router.navigate(["/marcacao/meus-pagamentos"],{queryParamsHandling:"merge"})):(this.getDataLayer("pagamento","Pagamento | Agendamento-Conluido"),this.router.navigate(["/marcacao/agendamento-concluido"],{queryParamsHandling:"merge"}))}goToPay(){this.validate()&&this.newPaymentProfile()}validate(){if(0===this.cartaoSelected.externoId){if(!this.modelPagamento.nomeCompleto)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Nome para continuar","button"),!1;if(!this.modelPagamento.numeroCartao)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o N\xfamero do Cart\xe3o para continuar","button"),!1;if(!this.bandeiraSelected)return this.modalAlertService.open("warning","Aten\xe7\xe3o","S\xf3 aceitamos cart\xe3o de bandeira Visa, Mastercard e American Express","button"),!1;if(!this.modelPagamento.dataValidade)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe a Data de Validade para continuar","button"),!1;const o=this.modelPagamento.dataValidade.split("/");if(new Date(+o[1],+o[0],0)<new Date)return this.modalAlertService.open("warning","Aten\xe7\xe3o","A data de vencimento deve ser superior a data atual","button"),!1;if(!this.modelPagamento.codigoSeguranca)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o C\xf3digo de Seguran\xe7a para continuar","button"),!1}return this.modelPagamento.cpf?this.ValidaCPF(this.modelPagamento.cpf)?!(!this.modelPagamento.parcela||!this.modelPagamento.parcela.id)||(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o N\xfamero de Parcela(s) para continuar","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","O CPF informado \xe9 inv\xe1lido","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o CPF do Titular para continuar","button"),!1)}ValidaCPF(o){if(null==(o=(o=(o=o.replace(".","")).replace(".","")).replace("-",""))||11!==o.length||"00000000000"===o||"11111111111"===o||"22222222222"===o||"33333333333"===o||"44444444444"===o||"55555555555"===o||"66666666666"===o||"77777777777"===o||"88888888888"===o||"99999999999"===o)return!1;let i=0,n="",d=10,r=0,c=0,m=0,_=0,p="";p=o.substring(0,9);for(let u=0;u<9;u++){if(n=p.charAt(u),-1==="0123456789".search(n))return!1;i=Number(n),r+=i*d,d--}c=r%11,m=11-c,m>9&&(m=0),d=11,r=0,p+=m;for(let u=0;u<10;u++)n=p.charAt(u),i=Number(n),r+=i*d,d--;return c=r%11,_=11-c,_>9&&(_=0),p+=_,o===p}newPaymentProfile(){if(this.startLoading(!1),0===this.cartaoSelected.externoId){const o=this.getVindiUrl()+"/public/payment_profiles";this.http.post(o,{holder_name:this.modelPagamento.nomeCompleto,card_expiration:this.modelPagamento.dataValidade,card_number:this.modelPagamento.numeroCartao,card_cvv:this.modelPagamento.codigoSeguranca,payment_method_code:"credit_card",payment_company_code:this.bandeiraSelected,registry_code:this.modelPagamento.cpf},{headers:new fe.WM({Authorization:"Basic "+btoa(this.publicKey+":"),"Content-Type":"application/json",Accept:"application/json","Response-Type":"application/json"})}).subscribe(n=>{this.modelPagamento.gatewayToken=n.payment_profile.gateway_token,this.newPayment()},n=>{n.exception&&n.exception.errors?(this.stopLoading(),n.exception.errors.filter(a=>"payment_profile"!==a.parameter).forEach(a=>{this.paymentError="Pagamento n\xe3o permitido. Favor verificar os dados informados.","card_cvv"==a.parameter&&(this.paymentError="Verifique o c\xf3digo de seguran\xe7a."),"card_expiration"==a.parameter&&(this.paymentError="Verifique a validade."),"card_number"==a.parameter&&(this.paymentError="Verifique o n\xfamero do cart\xe3o."),"holder_name"==a.parameter&&(this.paymentError="Verifique o nome."),"registry_code"==a.parameter&&(this.paymentError="Verifique o CPF."),this.modalAlertService.open("error","Aten\xe7\xe3o",this.paymentError,"button")})):this.verifyError(n)})}else this.newPayment()}newPayment(){const o=this.modelPagamento.numeroCartao,i=this.modelPagamento.codigoSeguranca;0!==this.cartaoSelected.externoId?(this.modelPagamento.cartaoExternoId=this.cartaoSelected.externoId,this.modelPagamento.nomeCompleto=this.cartaoSelected.nomeCompleto,this.modelPagamento.numeroCartao=this.cartaoSelected.numero,this.modelPagamento.dataValidade=this.cartaoSelected.dataValidade):this.modelPagamento.numeroCartao=o.split(".")[0]+"."+o.split(".")[1].substr(0,2)+"XX.XXXX."+o.split(".")[3],this.modelPagamento.protocoloId=this.model.protocoloIdSelected?this.model.protocoloIdSelected:this.modelFinished.protocoloIdSelected,this.modelPagamento.postoId=this.exames[0].unidade.id,this.modelPagamento.valorTotal=this.totalPayment,this.modelPagamento.bandeira=this.bandeiraSelected,delete this.modelPagamento.codigoSeguranca,this.stopLoading(),this.mensagem="Efetuando pagamento...",this.startLoading(!0),this.modelPagamento.prontuarioId=this.prontuarioId,this.pagamentoService.newPagamento(this.domain,this.modelPagamento).subscribe(n=>{this.stopLoading(),n?(this.model.pagamentoEfetuadoComSucesso=!0,this.modelFinished.pagamentoEfetuadoComSucesso=!0):this.modelFinished.pagamentoEmAndamento=!0,this.syncModel(),this.syncModelFinished(),this.goToNextStep()},n=>{this.modelPagamento.numeroCartao=o,this.modelPagamento.codigoSeguranca=i,this.verifyError(n)})}getBandeiraClass(o){if(o&&o.bandeira){let i=o.bandeira.toLowerCase();return"america_express"===i&&(i="amex"),i}return""}goToAgenda(){this.getDataLayer("pagamento","Pagamento | Resumo-Agendamento"),this.router.navigate(["/marcacao/resumo-agendamento"],{queryParamsHandling:"merge"})}onChangeFormaPagamento(o){this.formaPagamentoSelecionado=o,1===this.formaPagamentoSelecionado&&this.porcentagemDesconto>0?(this.desconto=this.totalPayment*(this.porcentagemDesconto/100),this.valor=this.totalPayment-this.desconto):this.valor=this.totalPayment}gerarChavePix(){this.loadChavePix=!0,this.registroService.getAllEnderecosPorProntuario(void 0,this.domain).subscribe(o=>{0===o.length?(this.confirmationService.confirm({message:"Voc\xea n\xe3o posssui endere\xe7os cadastrados. Para continuar com o pagamento por Pix \xe9 necess\xe1rio cadastrar. Deseja continuar?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.enderecoService.openPopup(!1)}}),this.loadChavePix=!1):(this.modelPagamento.protocoloId=this.model.protocoloIdSelected?this.model.protocoloIdSelected:this.modelFinished.protocoloIdSelected,this.modelPagamento.postoId=this.exames[0].unidade.id,this.modelPagamento.valorTotal=this.totalPayment,this.modelPagamento.prontuarioId=this.prontuarioId,this.modelPagamento.nomeCompleto=this.nomePaciente,this.modelPagamento.numeroCartao=void 0,this.modelPagamento.dataValidade=void 0,this.modelPagamento.codigoSeguranca=void 0,this.modelPagamento.cpf=this.cpf,this.bandeiraSelected="",this.pagamentoService.newPagamentoPix(this.domain,this.modelPagamento).subscribe(i=>{this.loadChavePix=!1,i&&"rejected"!==i.retorno.charges[0].lastTransaction.status?(this.showChavePix=!0,this.qrCode=i.retorno.charges[0].lastTransaction.gatewayResponseField.qrCodePath,this.codigoPix=i.retorno.charges[0].lastTransaction.gatewayResponseField.qrCodeOriginalPath,this.safeQrCode=this.sanitizer.bypassSecurityTrustResourceUrl(this.qrCode),this.hasModelFinished&&!this.model.meusPagamentos&&this.countDownVerificaPagamentoPix(this.modelPagamento.protocoloId)):(this.exibeErroPix=!0,this.showChavePix=!1)},i=>{this.loadChavePix=!1,this.verifyError(i)}))},o=>{this.loadChavePix=!1,this.verifyError(o)})}copiarChavePix(){this.clipBoard.copy(this.codigoPix),this.mensagemCodigoPixCopiado=!0}countDownVerificaPagamentoPix(o){this.countDown=setInterval(()=>{this.timeToNewToken=this.timeToNewToken-1;const i=Math.floor(this.timeToNewToken/60),n=this.timeToNewToken%60;this.contador=`${i}:${n<10?`0${n}`:n}`,this.timeToNewToken%5==0&&this.pagamentoService.getVerificaPagamentos(o,this.domain).subscribe(d=>{d&&(this.model.pagamentoEfetuadoComSucesso=!0,this.modelFinished.pagamentoEfetuadoComSucesso=!0,clearInterval(this.countDown),this.syncModel(),this.syncModelFinished(),this.goToNextStep())},d=>{this.verifyError(d)}),0==this.timeToNewToken&&(this.timeToNewToken=60,clearInterval(this.countDown),this.modelFinished.pixPendente=!0,this.syncModel(),this.syncModelFinished(),this.goToNextStep())},1e3)}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(Z.YP))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-pagamento"]],features:[e._Bn([Z.YP]),e.qOj],decls:10,vars:4,consts:[[1,"row"],["class","col-12",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelConcluir","type","button","class","btn btn-outline-primary me-3",3,"disabled","click",4,"ngIf"],["id","modelVoltar","type","button","class","btn btn-outline-primary me-3",3,"disabled","click",4,"ngIf"],["header","Confirmation","icon","pi pi-exclamation-triangle","acceptLabel","Sim","rejectLabel","N\xe3o"],[1,"col-12"],[1,"p-4"],[1,"row","justify-content-center"],[1,"col-lg-7","col-12","mt-0","pt-0","mb-0","pb-0"],["class","row",4,"ngIf"],["id","selectedResumoPagamento","styleClass","dark"],[1,"row","mt-0","pt-0","mb-0","pb-0"],[1,"col-12","mt-0","pt-0","mb-0","pb-0"],[1,"row","mt-0","pt-0"],[1,"col-12","mt-0","pt-0","text-start","pb-0"],[1,"subtitle"],[1,"col-12","mt-0","pt-0","text-start"],[1,"break-line-total","ms-0","me-0"],["class","row mt-0 pt-0 pb-0",4,"ngFor","ngForOf"],["class","row mt-0 pt-0 pb-0",4,"ngIf"],["class","row mt-0 pt-0 mb-0 pb-0",4,"ngIf"],[1,"col-8","mt-0","pt-0","text-start","text-uppercase"],[1,"col-4","mt-0","pt-0","text-end"],[1,"col-lg-7","col-12","mt-0","pt-0"],["id","selectFormaPagamento","styleClass","card-gray dark bg-white mb-0 pt-2 pb-2 text-center"],[1,"d-flex","gap-4"],["name","modelTipoPagamento",1,"btn","btn-outline-primary","py-2","button-flex-1",3,"ngClass","disabled","click"],["class","btn btn-outline-primary py-2 button-flex-1","name","modelTipoPagamento",3,"ngClass","click",4,"ngIf"],["id","selectedResumoPagamento","styleClass","card-gray dark bg-white mb-0 pb-0",4,"ngIf"],["id","selectedResumoPagamentoPix","styleClass","card-gray dark bg-white mb-0 pb-0 mx-auto",4,"ngIf"],[1,"col-12","p-fluid","mt-0"],["role","alert",1,"alert","alert-warning"],[1,"row","mt-0","pt-0","pb-0"],[1,"col-8","mt-0","pt-0","text-start"],[1,"subtitle","small-size"],[1,"mt-0"],["class","text-warning small-size",4,"ngIf"],[1,"text-warning","small-size"],["name","modelTipoPagamento",1,"btn","btn-outline-primary","py-2","button-flex-1",3,"ngClass","click"],["id","selectedResumoPagamento","styleClass","card-gray dark bg-white mb-0 pb-0"],[1,"row","mb-0","pb-0"],[1,"col-12","mt-0","pt-0"],[1,"row","no-gutters","mt-0","pt-0","justify-content-center"],[1,"col-2","mt-0","pt-0"],["src","assets/visa.jpg","alt","bandeira",1,"card-bandeira",3,"ngClass","click"],["src","assets/mastercard.jpg","alt","mastercard",1,"card-bandeira","hand",3,"ngClass","click"],[1,"col-12","mt-0","pb-1","pt-1","mt-4"],[1,"p-float-label","p-fluid"],["id","modelPagamentoParcela","optionLabel","label",3,"options","ngModel","ngModelChange"],["for","modelPagamentoParcela"],["id","modelPagamentoCpf","name","modelPagamentoCpf",3,"mask","placeholder","ngModel","ngModelChange"],[1,"col-12","text-end"],["id","modelContinuar","type","button","class","btn btn-primary text-uppercase p-2",3,"disabled","click",4,"ngIf"],["id","modelPagamentoNomeCompleto","name","modelPagamentoNomeCompleto","type","text","size","300","maxlength","200","pInputText","","placeholder","Nome (como descrito no cart\xe3o)*",1,"form-control","text-uppercase",3,"ngModel","setfocus","ngModelChange"],["id","modelPagamentoNumeroCartao","name","modelPagamentoNumeroCartao","placeholder","N\xfamero do cart\xe3o*",3,"ngModel","mask","ngModelChange","onComplete","onBlur","onInput"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-6","col-12","mt-0","pb-1","pt-1","mt-4"],["id","modelPagamentoDataValidade","name","modelPagamentoDataValidade","placeholder","Validade (mm/aaaa)*",3,"ngModel","mask","ngModelChange"],["id","modelPagamentoCodigoSeguranca","name","modelPagamentoCodigoSeguranca","placeholder","CVV/CVC*",3,"ngModel","mask","ngModelChange"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase","p-2",3,"disabled","click"],["id","selectedResumoPagamentoPix","styleClass","card-gray dark bg-white mb-0 pb-0 mx-auto"],[1,"col-12","mx-auto","mt-0","pt-0","mb-0","pb-0"],["class","col-12 mx-auto",4,"ngIf"],["class","col-12 mx-auto mt-0 pt-0 mb-0 pb-0 text-center",4,"ngIf"],["class","col-12 mx-auto mt-0 pt-0 mb-0 pb-0",4,"ngIf"],[1,"col-12","mx-auto"],[1,"row","mx-auto","justify-content-center"],[1,"mx-auto","text-center"],[1,"row","col-lg-6","col-md-6","col-lg-6","mx-auto"],["name","modelTipoConvenio",1,"btn","btn-outline-primary","me-2","mb-2","py-2",3,"click"],["class","row mx-auto justify-content-center",4,"ngIf"],[1,"col-12","mx-auto","mt-0","pt-0","mb-0","pb-0","text-center"],[1,"col-12","mx-auto","mt-0","pt-0"],["id","selectFormaPagamento","styleClass","dark col-12 mx-auto mb-0 pt-2 pb-2"],[1,"col-md-4","text-center"],[1,"w-100",3,"src"],[1,"col-md-8","mx-auto","mt-2","pt-2"],["type","text","readonly","",1,"form-control","py-2",3,"value","click"],[1,"col-md-12"],["name","modelTipoConvenio",1,"btn","btn-primary","p-2",3,"ngClass","click"],["class","fas fa-check",4,"ngIf"],[1,"fas","fa-check"],[1,"mx-auto","text-end"],["id","modelConcluir","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Qd,2,1,"div",1),e.YNc(2,dr,48,16,"div",1),e.qZA(),e.TgZ(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5),e.YNc(7,rr,2,1,"button",6),e.YNc(8,cr,2,1,"button",7),e.qZA()()()(),e._UZ(9,"p-confirmDialog",8)),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(
15),e.Q6J("ngIf",i.hasModelFinished&&!i.model.meusPagamentos),e.xp6(1),e.Q6J("ngIf",i.model.meusPagamentos))},dependencies:[h.mk,h.sg,h.O5,Ne.G,v.Fj,v.JJ,v.nD,v.On,H.o,Y.vy,se.Lt,y.Z,F.Q,He.G],styles:[".termo-de-ciencia-e-orientacao{width:100%;padding:20px;border-radius:3px;background:#D6EEF8 0% 0% no-repeat padding-box;border:1px solid #d3d3d3;box-shadow:1px 1px 1px 1px #0000000d;text-align:left;margin-top:10px}.termo-de-ciencia-e-orientacao span{font-size:12px;margin-left:10px}.p-float-label label{color:#858585!important}\n"],encapsulation:2}),t})();var Re=g(6712);function mr(t,s){if(1&t&&(e.TgZ(0,"div",13)(1,"div",3)(2,"div",11),e._UZ(3,"em",14),e._uU(4,"\xa0 "),e.TgZ(5,"span",7),e._uU(6),e.qZA()(),e.TgZ(7,"div",12)(8,"span",7),e._uU(9),e.qZA()()()()),2&t){const o=s.$implicit,i=e.oxw(2);e.xp6(6),e.Oqu(o.nomeExame),e.xp6(3),e.hij("R$ ",i.getFormatCurrency(o.valorExame),"")}}function _r(t,s){1&t&&(e.TgZ(0,"div",11)(1,"label",7),e._uU(2,"Desconto"),e.qZA()())}function pr(t,s){if(1&t&&(e.TgZ(0,"div",12)(1,"label",7),e._uU(2),e.qZA()()),2&t){const o=e.oxw(2);e.xp6(2),e.hij("- R$ ",o.getFormatCurrency(o.model.valorTotal-o.model.valorPago),"")}}const ur=function(){return{width:"90%",overflow:"hidden"}};function gr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",1)(1,"p-dialog",2),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.display=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.clear())}),e.TgZ(2,"div",3)(3,"div",4)(4,"label",5),e._uU(5),e.qZA()()(),e._UZ(6,"div",6),e.TgZ(7,"div",3)(8,"div",4)(9,"label",5),e._uU(10,"Informa\xe7\xf5es do Protocolo"),e.qZA()(),e.TgZ(11,"div",4)(12,"span",5),e._uU(13,"Data de Agendamento:"),e.qZA(),e._uU(14),e.qZA(),e.TgZ(15,"div",4)(16,"span",5),e._uU(17,"Forma de Pagamento:"),e.qZA(),e._uU(18),e.qZA(),e.TgZ(19,"div",4)(20,"span",5),e._uU(21,"Status:"),e.qZA(),e._uU(22),e.qZA()(),e._UZ(23,"div",6),e.TgZ(24,"div",3)(25,"div",4)(26,"label",5),e._uU(27,"Endere\xe7o da Unidade"),e.qZA()(),e.TgZ(28,"div",4)(29,"span",7),e._uU(30),e.qZA()(),e.TgZ(31,"div",4)(32,"span",7),e._uU(33),e.qZA()()(),e._UZ(34,"div",6),e.TgZ(35,"div",3)(36,"div",4)(37,"label",5),e._uU(38,"Ex
1ames"),e.qZA()(),e.YNc(39,mr,10,2,"div",8),e.qZA(),e._UZ(40,"div",6),e.TgZ(41,"div",3),e.YNc(42,_r,3,0,"div",9),e.YNc(43,pr,3,1,"div",10),e.TgZ(44,"div",11)(45,"label",5),e._uU(46,"Total"),e.qZA()(),e.TgZ(47,"div",12)(48,"label",5),e._uU(49),e.qZA()()()()()}if(2&t){const o=e.oxw();e.xp6(1),e.Akn(e.DdM(16,ur)),e.Q6J("visible",o.display)("modal",!0)("responsive",!0)("baseZIndex",1e4),e.xp6(4),e.hij("Protocolo \xa0",o.model.protocoloId,""),e.xp6(9),e.hij(" ",o.getFormatDate(o.model.data,"DD/MM/YYYY")," "),e.xp6(4),e.hij(" ",o.model.formaPagamento," "),e.xp6(4),e.hij(" ",o.model.statusPagamentoDetalhe," "),e.xp6(8),e.Oqu(o.model.bairro),e.xp6(3),e.Oqu(o.model.endereco),e.xp6(6),e.Q6J("ngForOf",o.model.exames),e.xp6(3),e.Q6J("ngIf",o.model.valorTotal!==o.model.valorPago),e.xp6(1),e.Q6J("ngIf",o.model.valorTotal!==o.model.valorPago),e.xp6(6),e.hij("R$ ",o.getFormatCurrency(o.model.valorPago),"")}}let hr=(()=>{class t extends Q.b{set value(o){o&&(this.protocoloId=o,this.getDetalhesMeuPagamento(this.protocoloId,this.user.usuarioSelecionado.prontuarioId))}constructor(o){super(o),this.onClose=new e.vpe,this.meusPagamentosService=o.get(l.BQg)}ngOnInit(){this.clear()}clear(){this.model=void 0,this.display=!1,this.onClose.emit()}getDetalhesMeuPagamento(o,i){this.startLoading(),this.meusPagamentosService.getDetalhesMeuPagamento(this.protocoloId,i,this.domain).subscribe(n=>{this.stopLoading(),this.display=!0,this.model=n},n=>{this.verifyError(n)})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-detalhes-pagamento"]],inputs:{value:"value"},outputs:{onClose:"onClose"},features:[e.qOj],decls:1,vars:1,consts:[["class","detalhes-pagamento-inner-html",4,"ngIf"],[1,"detalhes-pagamento-inner-html"],["header","Detalhes do Pagamento",3,"visible","modal","responsive","baseZIndex","visibleChange","onHide"],[1,"row","mt-1","pb-1"],[1,"col-12","mt-0","pb-0"],[1,"fw-bold"],[1,"break-line-total"],[1,"span"],["class","col-12 mt-0 pb-0 pt-0",4,"ngFor","ngForOf"],["class","col-xl-10 col-lg-10 col-md-9 col-sm-12 mt-0 pb-0",4,"ngIf"],["class","col-xl-2 col-lg-2 col-md-3 col-sm-12 mt-0 pb-0",4,"ngIf"],[1,"col-xl-10","col-lg-10","col-md-9","col-sm-12","mt-0","pb-0"],[1,"col-xl-2","col-lg-2","col-md-3","col-sm-12","mt-0","pb-0"],[1,"col-12","mt-0","pb-0","pt-0"],[1,"fa","fa-file-medical-alt","title-icon"]],template:function(o,i){1&o&&e.YNc(0,gr,50,17,"div",0),2&o&&e.Q6J("ngIf",i.model)},dependencies:[h.sg,h.O5,k.V],styles:[".detalhes-pagamento-inner-html .row p{width:100%}\n"],encapsulation:2}),t})();function fr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",12),e._uU(1),e.TgZ(2,"button",13),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.fecharErro())}),e.qZA()()}if(2&t){const o=e.oxw();e.xp6(1),e.hij(" ",o.textoErro," ")}}function vr(t,s){1&t&&e._UZ(0,"i",30)}function xr(t,s){1&t&&e._UZ(0,"i",31)}function Cr(t,s){1&t&&e._UZ(0,"i",30)}function Ar(t,s){1&t&&e._UZ(0,"i",31)}function br(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",14)(1,"div",15)(2,"div",8)(3,"div",16)(4,"div",17)(5,"label"),e._uU(6,"Tipo Pagamento:"),e.qZA()(),e.TgZ(7,"div",18)(8,"span"),e._uU(9),e.qZA()()()(),e.TgZ(10,"div",8)(11,"div",16)(12,"div",19)(13,"label"),e._uU(14,"Valor:"),e.qZA()(),e.TgZ(15,"div",18)(16,"span",9),e._uU(17,"R$ "),e.qZA(),e.TgZ(18,"span"),e._uU(19),e.qZA()()()(),e.TgZ(20,"div",8)(21,"div",20)(22,"div",21)(23,"label"),e._uU(24,"Recibo:"),e.qZA()(),e.TgZ(25,"div",22)(26,"span",23)(27,"a",24),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw();return e.KtG(d.obterDocumento(a.idRecibo,1))}),e.YNc(28,vr,1,0,"i",25),e.YNc(29,xr,1,0,"i",26),e.qZA()()()()(),e.TgZ(30,"div",8)(31,"div",27)(32,"div",21)(33,"label"),e._uU(34,"Nota Fiscal:"),e.qZA()(),e.TgZ(35,"div",28)(36,"span",23)(37,"a",29),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw();return e.KtG(d.obterDocumento(a.idRecibo,2))}),e.YNc(38,Cr,1,0,"i",25),e.YNc(39,Ar,1,0,"i",26),e.qZA()()()()()()()}if(2&t){const o=s.$implicit,i=e.oxw();e.MGl("id","selectedExames",o.tipoPagamento,""),e.xp6(9),e.Oqu(o.descricaoTipoPagamento),e.xp6(10),e.Oqu(i.getFormatCurrency(o.valorPago)),e.xp6(9),e.Q6J("ngIf",i.loadingReciboId!==o.idRecibo),e.xp6(1),e.Q6J("ngIf",i.loadingReciboId===o.idRecibo),e.xp6(8),e.ekj("disabled",!o.linkNotaFiscal),e.xp6(1),e.Q6J("ngIf",i.loadingNFId!==o.idRecibo),e.xp6(1),e.Q6J("ngIf",i.loadingNFId===o.idRecibo)}}const Tr=function(){return{width:"60%",overflow:"hidden"}};let Zr=(()=>{class t extends Q.b{constructor(o){super(o),this.loadingReciboId=null,this.loadingNFId=null,this.idAtendimento=null,this.onClose=new e.vpe,this.meusPagamentosService=o.get(l.BQg)}set value(o){o&&(this.display=!0,this.detalhesHistoricoPagamento=o)}set valueIdAtendimento(o){o&&(this.idAtendimento=o)}ngOnInit(){}clear(){this.display=!1,this.onClose.emit()}obterDocumento(o,i){var a,n=this;1===i?this.loadingReciboId=o:this.loadingNFId=o,this.meusPagamentosService.getMeusDocumentosGet(o,this.idAtendimento,i,this.domain).subscribe({next:a=>{if(a&&a.data){const r=window.URL.createObjectURL(a.data);window.open(r,"_blank"),setTimeout(()=>{window.URL.revokeObjectURL(r)},1e3)}},error:(a=(0,U.Z)(function*(d){if(n.loadingReciboId=null,n.loadingNFId=null,d.exception instanceof Blob){const r=yield d.exception.text();try{const c=JSON.parse(r);n.textoErro=c.message}catch{n.textoErro="Ocorreu um erro ao buscar o documento."}}else n.textoErro="Ocorreu um erro ao buscar o documento."}),function(r){return a.apply(this,arguments)}),complete:()=>{this.loadingReciboId=null,this.loadingNFId=null,this.textoErro=void 0}})}fecharErro(){this.textoErro=void 0}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-detalhes-historico-p
1agamento"]],inputs:{value:"value",valueIdAtendimento:"valueIdAtendimento"},outputs:{onClose:"onClose"},features:[e.qOj],decls:24,vars:9,consts:[["header","Detalhes do Pagamento",3,"visible","modal","responsive","baseZIndex","visibleChange","onHide"],["class","alert alert-danger alert-dismissible fade show","role","alert",4,"ngIf"],[1,"col-12","d-none","d-sm-block"],[1,"break-line-gray"],[1,"row","fw-bold","m-0","p-0"],[1,"col-sm-12","col-md-3"],[1,"d-none","d-lg-inline","d-md-none"],[1,"d-inline","d-lg-none"],[1,"col"],[1,"d-none","d-lg-inline"],[1,"col-12","p-fluid","pt-0","mt-0"],[3,"id",4,"ngFor","ngForOf"],["role","alert",1,"alert","alert-danger","alert-dismissible","fade","show"],["type","button","aria-label","Close",1,"btn-close",3,"click"],[3,"id"],[1,"row","wrapper"],[1,"row","m-0","p-0"],["data-evidence","Tipo:",1,"col","visual-small","evidence"],[1,"col","col-md-12","visual-large","text-start","pb-0","pt-0","pb-lg-0","pt-lg-2"],["data-evidence","Valor:",1,"col","visual-small","evidence"],[1,"row","p-0"],[1,"col","visual-small"],[1,"col","visual-large","text-start"],[1,"fw-bold","marging-top-0","pt-0"],["target","_blank","tabindex","-1","data-bs-toggle","tooltip","data-bs-placement","top","title","Recibo",1,"btn","btn-outline-dark","btn-sm","m-1",3,"disabled","click"],["class","fas fa-download",4,"ngIf"],["class","fas fa-spinner fa-spin",4,"ngIf"],[1,"row"],[1,"col","col-md-12","visual-large","text-start"],["target","_blank","tabindex","-1","data-bs-toggle","tooltip","data-bs-placement","top","title","Recibo",1,"btn","btn-outline-dark","btn-sm","m-1",3,"click"],[1,"fas","fa-download"],[1,"fas","fa-spinner","fa-spin"]],template:function(o,i){1&o&&(e.TgZ(0,"p-dialog",0),e.NdJ("visibleChange",function(a){return i.display=a})("onHide",function(){return i.clear()}),e.YNc(1,fr,3,1,"div",1),e.TgZ(2,"div",2),e._UZ(3,"div",3),e.TgZ(4,"div",4)(5,"div",5)(6,"span",6),e._uU(7,"Tipo Pagamento"),e.qZA(),e.TgZ(8,"span",7),e._uU(9,"Tipo"),e.qZA()(),e.TgZ(10,"div",8)(11,"span"),e._uU(12,"Valor"),e.qZA()(),e.TgZ(13,"div",8)(14,"span"),e._uU(15,"Recibo"),e.qZA()(),e.TgZ(16,"div",8)(17,"span",9),e._uU(18,"Nota Fiscal"),e.qZA(),e.TgZ(19,"span",7),e._uU(20,"NF"),e.qZA()()(),e._UZ(21,"div",3),e.qZA(),e.TgZ(22,"div",10),e.YNc(23,br,40,9,"p-card",11),e.qZA()()),2&o&&(e.Akn(e.DdM(8,Tr)),e.Q6J("visible",i.display)("modal",!0)("responsive",!0)("baseZIndex",1e4),e.xp6(1),e.Q6J("ngIf",i.textoErro),e.xp6(22),e.Q6J("ngForOf",i.detalhesHistoricoPagamento))},dependencies:[h.sg,h.O5,y.Z,k.V],styles:[".p-card-body{padding:0!important;vertical-align:center!important}"]}),t})();function Er(t,s){if(1&t&&(e.TgZ(0,"div",10),e._UZ(1,"em",11),e.TgZ(2,"p"),e._uU(3,"\xa0"),e.qZA(),e._uU(4),e.qZA()),2&t){const o=e.oxw();e.xp6(4),e.hij(" ",o.mensagem," ")}}function Ir(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(2);return e.KtG(a.goToPagamento(n))}),e._UZ(1,"em",45),e._uU(2,"Pagar agora "),e.qZA()}}const Pr=function(t,s,o,i){return{"text-success":t,"text-danger":s,"text-warning":o,"text-info":i}};function wr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",28)(1,"div",29)(2,"div",24)(3,"div",30)(4,"div",31)(5,"label"),e._uU(6,"N\xfamero do protocolo:"),e.qZA()(),e.TgZ(7,"div",32)(8,"span"),e._uU(9),e.qZA()()()(),e.TgZ(10,"div",17)(11,"div",30)(12,"div",33)(13,"label"),e._uU(14,"Data agendada:"),e.qZA()(),e.TgZ(15,"div",34)(16,"span"),e._uU(17),e.qZA(),e.TgZ(18,"p",35),e._uU(19),e.qZA()()()(),e.TgZ(20,"div",17)(21,"div",30)(22,"div",36)(23,"label"),e._uU(24,"Pagamento:"),e.qZA()(),e.TgZ(25,"div",34)(26,"span"),e._uU(27,"Pagamento"),e.qZA()()()(),e.TgZ(28,"div",17)(29,"div",37)(30,"div",36)(31,"label"),e._uU(32,"Status:"),e.qZA()(),e.TgZ(33,"div",34)(34,"span",38),e._uU(35),e.qZA()()()(),e.TgZ(36,"div",17)(37,"div",12)(38,"div",36)(39,"label"),e._uU(40,"Valor:"),e.qZA()(),e.TgZ(41,"div",32)(42,"span",39),e._uU(43),e.qZA()()()()(),e._UZ(44,"div",40),e.TgZ(45,"div",12)(46,"div",41),e.YNc(47,Ir,3,0,"a",42),e.TgZ(48,"a",43),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(2);return e.KtG(d.showDetalhesMeuPagamento(a.protocoloId))}),e._uU(49,"+ DETALHES"),e.qZA()()()()}if(2&t){const o=s.$implicit,i=e.oxw(2);e.MGl("id","selectedExames",o.id,""),e.Q6J("styleClass","dark"+(o.statusPagamento<2?" bg-white":"")),e.xp6(9),e.Oqu(o.protocoloId),e.xp6(8),e.AsE("",i.getFormatDate(o.data,"DD MMM YY"),"\xa0",o.horario,""),e.xp6(2),e.Oqu(i.getFormatDate(o.data,"dddd")),e.xp6(15),e.Q6J("ngClass",e.l5B(10,Pr,2===o.statusPagamento,3===o.statusPagamento||4===o.statusPagamento||6===o.statusPagamento,o.statusPagamento<2,5===o.statusPagamento||o.statusPagamento>=7)),e.xp6(1),e.hij(" ",o.statusPagamentoDetalhe," "),e.xp6(8),e.hij(" R$ ",i.getFormatCurrency(o.valorTotal)," "),e.xp6(4),e.Q6J("ngIf",0===o.statusPagamento||6===o.statusPagamento||1===o.statusPagamento&&o.chavePix)}}function Mr(t,s){1&t&&(e.TgZ(0,"div",12)(1,"div",10)(2,"p",46),e._uU(3,"N\xe3o existe(m) pagamento(s) para voc\xea"),e.qZA()()())}function Ur(t,s){1&t&&(e.TgZ(0,"div",47)(1,"p",48),e._uU(2," Para cancelar o pagamento \xe9 necess\xe1rio entrar em contato com a Central de Atendimento "),e.qZA()())}const Nr=function(t,s){return{"text-success":t,"text-danger":s}};function Sr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",49)(1,"div",29)(2,"div",24)(3,"div",30)(4,"div",50)(5,"label"),e._uU(6,"Num. Atendimento:"),e.qZA()(),e.TgZ(7,"div",32)(8,"span"),e._uU(9),e.qZA()()()(),e.TgZ(10,"div",17)(11,"div",30)(12,"div",51)(13,"label"),e._uU(14,"Data Atendimento:"),e.qZA()(),e.TgZ(15,"div",34)(16,"span"),e._uU(17),e.qZA(),e.TgZ(18,"p",52),e._uU(19),e.qZA()()()(),e.TgZ(20,"div",17)(21,"div",37)(22,"div",36)(23,"label"),e._uU(24,"Status:"),e.qZA()(),e.TgZ(25,"div",34)(26,"span",38),e._uU(27),e.qZA()()()(),e.TgZ(28,"div",17)(29,"div",12)(30,"div",36)(31,"label"),e._uU(32,"Valor:"),e.qZA()(),e.TgZ(33,"div",32)(34,"span",39),e._uU(35),e.qZA()()()()(),e._UZ(36,"div",40),e.TgZ(37,"div",12)(38,"div",41)(39,"a",43),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(2);return e.KtG(d.showDetalhesHistoricoPagamento(a.detalhes,a.idAtendimento))}),e._uU(40,"+ DETALHES"),e.qZA()()()()}if(2&t){const o=s.$implicit,i=e.oxw(2);e.MGl("id","selectedExames",o.idPosto+"-"+o.numeroAtendimento,""),e.xp6(9),e.Oqu(o.idPosto+"-"+o.numeroAtendimento),e.xp6(8),e.hij("",i.getFormatDate(o.dataAtendimento,"DD MMM YY"),"\xa0"),e.xp6(2),e.Oqu(i.getFormatDate(o.dataAtendimento,"dddd")),e.xp6(7),e.Q6J("ngClass",e.WLB(7,Nr,"Pago"===o.statusPagamento,"Pago"!==o.statusPagamento)),e.xp6(1),e.hij(" ",o.statusPagamento," "),e.xp6(8),e.hij(" R$ ",i.getFormatCurrency(o.valorTotal)," ")}}function yr(t,s){1&t&&(e.TgZ(0,"div",53)(1,"span"),e._uU(2,"Carregando.... "),e.qZA(),e._UZ(3,"em",54),e.qZA())}function qr(t,s){1&t&&(e.TgZ(0,"div",12)(1,"div",10)(2,"p",46),e._uU(3,"N\xe3o existe(m) pagamento(s) para voc\xea"),e.qZA()()())}function Jr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",10)(1,"div",12)(2,"p-tabView")(3,"p-tabPanel",13)(4,"div",14),e._UZ(5,"div",15),e.TgZ(6,"div",16)(7,"div",17)(8,"span"),e._uU(9,"N\xfamero do protocolo"),e.qZA()(),e.TgZ(10,"div",17)(11,"span"),e._uU(12,"Data agendada"),e.qZA()(),e.TgZ(13,"div",17)(14,"span"),e._uU(15,"Pagamento"),e.qZA()(),e.TgZ(16,"div",17)(17,"span"),e._uU(18,"Status"),e.qZA()(),e.TgZ(19,"div",17)(20,"span"),e._uU(21,"Valor"),e.qZA()()(),e._UZ(22,"div",15),e.qZA(),e.TgZ(23,"div",18),e.YNc(24,wr,50,15,"p-card",19),e.qZA(),e.YNc(25,Mr,4,0,"div",20),e.qZA(),e.TgZ(26,"p-tabPanel",21),e.YNc(27,Ur,3,0,"div",22),e.TgZ(28,"div",14),e._UZ(29,"div",15),e.TgZ(30,"div",23)(31,"div",24)(32,"span"),e._uU(33,"Num. Atendimento"),e.qZA()(),e.TgZ(34,"div",17)(35,"span"),e._uU(36,"Data Atendimento"),e.qZA()(),e.TgZ(37,"div",17)(38,"span"),e._uU(39,"Status Pagamento"),e.qZA()(),e.TgZ(40,"div",17)(41,"span"),e._uU(42,"Valor"),e.qZA()()(),e._UZ(43,"div",15),e.qZA(),e.TgZ(44,"div",25),e.NdJ("scrolled",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.getHistoricoPagamentos())}),e.YNc(45,Sr,41,10,"p-card",26),e.YNc(46,yr,4,0,"div",27),e.qZA(),e.YNc(47,qr,4,0,"div",20),e.qZA()()()()}if(2&t){const o=e.oxw();e.xp6(24),e.Q6J("ngForOf",o.meusPagamentos),e.xp6(1),e.Q6J("ngIf",!o.meusPagamentos||0===o.meusPagamentos.length),e.xp6(2),e.Q6J("ngIf",o.historicoPagamentos&&o.historicoPagamentos.length>0),e.xp6(17),e.Q6J("infiniteScrollDistance",1)("infiniteScrollThrottle",200),e.xp6(1),e.Q6J("ngForOf",o.historicoPagamentos),e.xp6(1),e.Q6J("ngIf",o.loadingHistorico),e.xp6(1),e.Q6J("ngIf",!o.historicoPagamentos||0===o.historicoPagamentos.length)}}let kr=(()=>{class t extends w.a{constructor(o){super(o),this.historicoPagamentos=[],this.historicoPage=1,this.historicoPageSize=10,this.loadingHistorico=!1,this.temMaisHistorico=!0,this.erroHistorico=!1,this.router=o.get(b.F0),this.confirmationService=o.get(Z.YP),this.meusPagamentosService=o.get(l.BQg),this.unidadeService=o.get(l.sc7),this.route=o.get(b.gz)}ngOnInit(){this.changeStep(0),this.clear(),this.load()}clear(){this.meusPagamentos=[]}
1load(){this.verificaPermissaoTela(),this.redirect=this.route.snapshot.queryParams.redirect,this.isLoggedIn()?this.get():(this.eventCloseLogin=this.loginService.onClose.subscribe(o=>{this.onCloseLogin()}),this.exibirPopupLogin())}onCloseLogin(){this.eventCloseLogin.unsubscribe(),this.isLoggedIn()?this.get():this.router.navigate(["marcacao/home"],{queryParamsHandling:"merge"})}get(){this.getMeusPagamentos()}getMeusPagamentos(){this.startLoading(!0),this.mensagem="Buscando Meus Pagamentos...",(0,J.D)(this.meusPagamentosService.getMeusPagamentos(this.domain),this.unidadeService.getUnidades(this.domain)).subscribe(o=>{this.stopLoading(),this.meusPagamentos=o[0].filter(i=>0===i.statusPagamento),this.todosMeusPagamentos=o[0].filter(i=>0!==i.statusPagamento),this.unidades=o[1],this.getHistoricoPagamentos()},o=>{this.verifyError(o)})}getHistoricoPagamentos(){!this.loadingHistorico&&this.temMaisHistorico&&(this.loadingHistorico=!0,this.erroHistorico=!1,this.meusPagamentosService.getHistoricoPagamentos(this.historicoPage,this.historicoPageSize,this.domain).subscribe({next:i=>{if(0===(i=i||[]).length)return this.temMaisHistorico=!1,void(this.loadingHistorico=!1);this.historicoPagamentos=[...this.historicoPagamentos,...i],this.historicoPage++,i.length<this.historicoPageSize&&(this.temMaisHistorico=!1),this.loadingHistorico=!1},error:i=>{this.erroHistorico=!0,this.loadingHistorico=!1,this.verifyError(i)}}))}goToPreviousStep(){this.router.navigate([this.routeState.getPreviousUrl(
1)],{queryParamsHandling:"merge"})}goToNextStep(){this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}goToPagamento(o){let i=!0;const n=new Date;if(o.exames.forEach(d=>{new Date(d.dataExame.getFullYear(),d.dataExame.getMonth(),d.dataExame.getDate(),+d.horarioExame.split(":")[0],+d.horarioExame.split(":")[1]).getTime()<=n.getTime()&&(i=!1),this.model.meusPagamentos=!0,this.syncModel()}),!i)return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o \xe9 mais poss\xedvel pagar agora!","button"),!1;this.startLoading(!0),this.mensagem="Redirecionando para tela de Pagamentos...",this.cleanModelFinished(),this.modelFinished.protocoloIdSelected=o.protocoloId,this.modelFinished.examesAgendados=[];let a=0;if(o.exames.forEach(d=>{const r=new l.TIN,c=this.unidades.filter(m=>m.id===d.unidadeId)[0];r.id=d.exameId,r.driveThru=d.driveThru,r.nome=d.nomeExame,r.valor=4!==d.statusAgendamento?d.valorExame:0,r.unidade=c,r.data=d.dataExame,r.horario=d.horarioExame,this.modelFinished.examesAgendados.push(r),a+=d.valorExame}),a<o.valorTotal){const d=new l.jU5;d.taxa=o.valorTotal-a,this.modelFinished.taxas=[d]}this.modelFinished.pagamento=new l.plV,this.modelFinished.pagamento.chavePix=o.chavePix,this.modelFinished.pagamento.qrCodePix=o.qrCodePix,this.syncModel(),this.syncModelFinished(),this.router.navigate(["/marcacao/pagamento"],{queryParamsHandling:"merge"})}showDetalhesMeuPagamento(o){this.selectedProtocoloId=o}hideDetalhesMeuPagamento(){this.selectedProtocoloId=void 0}showDetalhesHistoricoPagamento(o,i){this.selectedDetalheHistoricoPagamento=o,this.selectedIdAtendimento=i}hideDetalhesHistoricoPagamento(){this.selectedDetalheHistoricoPagamento=void 0,this.selectedIdAtendimento=void 0}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-meus-pagamentos"]],features:[e._Bn([Z.YP]),e.qOj],decls:13,vars:7,consts:[[1,"row","mt-5"],["class","col-12",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[3,"value","onClose"],[3,"value","valueIdAtendimento","onClose"],[1,"col-12"],[1,"pi","pi-spin","pi-spinner",2,"font-size","3em"],[1,"row"],["header","Pagamentos Futuros"],[1,"col-12","d-none","d-sm-block"],[1,"break-line-gray"],[1,"row","fw-bold","m-0","p-0","text-center"],[1,"col"],[1,"col-12","p-fluid","pt-0","mt-0"],[3,"id","styleClass",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["header","Hist\xf3rico de Pagamentos"],["class","col-12 p-fluid pt-0 mt-0 pb-0 mb-0",4,"ngIf"],[1,"row","fw-bold","m-0","p-0"],[1,"col-sm-12","col-md-3"],["infiniteScroll","",1,"col-12","p-fluid","pt-0","mt-0",3,"infiniteScrollDistance","infiniteScrollThrottle","scrolled"],[3,"id",4,"ngFor","ngForOf"],["class","text-center p-3",4,"ngIf"],[3,"id","styleClass"],[1,"row","wrapper"],[1,"row","m-0","p-0"],["data-evidence","Protocolo:",1,"col","visual-small","evidence"],[1,"col","col-md-12","visual-large","text-start"],["data-evidence","Data:",1,"col","visual-small","evidence"],[1,"col","visual-large","text-start"],[1,"d-none","d-sm-block"],[1,"col","visual-small"],[1,"row","p-0"],[1,"fw-bold","marging-top-0","pt-0",3,"ngClass"],[1,"title","mt-0","pt-0","me-2"],[1,"break-line-total"],[1,"col-12","text-end","pt-0","mt-0","pb-0"],["href","javascript:void(0)","class","btn btn-sm btn-success m-1 text-white",3,"click",4,"ngIf"],["href","javascript:void(0)",1,"btn","btn-outline-dark","btn-sm","m-1",3,"click"],["href","javascript:void(0)",1,"btn","btn-sm","btn-success","m-1","text-white",3,"click"],[1,"fas","fa-credit-card","me-2"],[1,"text-danger","small"],[1,"col-12","p-fluid","pt-0","mt-0","pb-0","mb-0"],[1,"text-danger","small","pt-0","mt-0"],[3,"id"],["data-evidence","Num. Atendimento:",1,"col","visual-small","evidence"],["data-evidence","Data Atendimento:",1,"col","visual-small","evidence"],[1,"d-none","d-sm-block","text-small"],[1,"text-center","p-3"],[1,"pi","pi-spin","pi-spinner"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Er,5,1,"div",1),e.YNc(2,Jr,48,8,"div",1),e.qZA(),e.TgZ(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"button",6),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(8,"Voltar"),e.qZA(),e.TgZ(9,"button",7),e.NdJ("click",function(){return i.goToNextStep()}),e._uU(10,"Novo Agendamento"),e.qZA()()()()(),e.TgZ(11,"app-detalhes-pagamento",8),e.NdJ("onClose",function(){return i.hideDetalhesMeuPagamento()}
1),e.qZA(),e.TgZ(12,"app-detalhes-historico-pagamento",9),e.NdJ("onClose",function(){return i.hideDetalhesHistoricoPagamento()}),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(5),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("value",i.selectedProtocoloId),e.xp6(1),e.Q6J("value",i.selectedDetalheHistoricoPagamento)("valueIdAtendimento",i.selectedIdAtendimento))},dependencies:[h.mk,h.sg,h.O5,y.Z,B.xf,B.x4,Re.Ry,hr,Zr],styles:["@media (max-width: 767px){.no-mobile{display:none}.visual-small{text-align:right;display:block;padding:0;margin:0}.visual-large>span{margin-left:1em}.visual-large{text-align:left;padding:0;margin:0}.visual-small>label{margin:0}}@media (max-width: 575px){.evidence[data-evidence]:after{content:attr(data-evidence);font-size:13px}.evidence>label{display:none}}@media (min-width: 768px){.visual-small{display:none}.visual-large{padding-top:0;margin-top:0}}\n"],encapsulation:2}),t})();function Dr(t,s){1&t&&(e.TgZ(0,"div",13),e._uU(1,"Carregando..."),e.qZA())}function Fr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",25)(1,"p-card",26),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.enderecoEscolhido=a)}),e.TgZ(2,"div",27),e._UZ(3,"em",28),e.TgZ(4,"div",29)(5,"div")(6,"strong"),e._uU(7),e.qZA()(),e.TgZ(8,"div")(9,"p"),e._uU(10),e.qZA()(),e.TgZ(11,"div")(12,"p"),e._uU(13),e.qZA()()()()()()}if(2&t){const o=s.$implicit,i=e.oxw(3);e.xp6(1),e.MGl("id","selectedUnidade",o.id,""),e.Q6J("styleClass",o.id===(null==i.enderecoEscolhido?null:i.enderecoEscolhido.id)?"card-gray light selected-card custom-p-card-endereco":"card-gray dark custom-p-card-endereco"),e.xp6(6),e.Oqu(1==o.tipo?"Residencial":2==o.tipo?"Comercial":"Outros"),e.xp6(3),e.lnq("",o.endereco,", ",o.numero," ",o.complemento,""),e.xp6(3),e.lnq("",o.cidade,", ",o.estado,", ",o.cep,"")}}function Or(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"fieldset",15)(1,"legend"),e._uU(2,"Selecione o endere\xe7o"),e.qZA(),e.TgZ(3,"div",0)(4,"div",13),e._uU(5),e.qZA()(),e.TgZ(6,"div",0),e.YNc(7,Fr,14,9,"div",16),e.qZA(),e.TgZ(8,"div",4)(9,"div",5)(10,"button",17),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.showNovoEndereco())}),e._UZ(11,"em",18),e._uU(12," Adicionar endere\xe7o"),e.qZA(),e.TgZ(13,"button",19),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.prencherEndereco())}),e._UZ(14,"em",20),e._uU(15," Editar endere\xe7o"),e.qZA(),e.TgZ(16,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.confirmRemoverEndereco())}),e._UZ(17,"em",22),e._uU(18," Remover endere\xe7o"),e.qZA(),e.TgZ(19,"button",23),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.maisEnderecos())}),e._UZ(20,"em",24),e._uU(21," Mais endere\xe7os"),e.qZA()()()()}if(2&t){const o=e.oxw(2);e.xp6(5),e.Oqu(o.textoInformativo),e.xp6(2),e.Q6J("ngForOf",o.enderecosMostrados),e.xp6(3),e.Q6J("disabled",o.flagAdicionarEndereco),e.xp6(3),e.Q6J("disabled",!(null!=o.enderecoEscolhido&&o.enderecoEscolhido.id)),e.xp6(3),e.Q6J("disabled",!(null!=o.enderecoEscolhido&&o.enderecoEscolhido.id)),e.xp6(3),e.Q6J("disabled",o.enderecosUsuario&&!o.enderecosUsuario.length)}}function Hr(t,s){1&t&&e._UZ(0,"div",38)}function Qr(t,s){1&t&&(e.TgZ(0,"div",53)(1,"div",54),e._uU(2," Por favor, digite seu endere\xe7o completo."),e.qZA()())}function Lr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",55)(1,"div",56)(2,"p-autoComplete",57),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.estadoAutoCompleteEscolhido=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.getSuggestions(n,"fEstados","estadosAutoComplete","label"))})("onSelect",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.buscarCepPorEndereco())}),e.qZA()()()}if(2&t){const o=e.oxw(3);e.xp6(2),e.Q6J("ngModel",o.estadoAutoCompleteEscolhido)("suggestions",o.fEstados)("dropdown",!0)("forceSelection",!0)}}function Rr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",58)(1,"span",43)(2,"p-autoComplete",59),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.novoEndereco.estado=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.getSuggestions(n,"fEstados","estadosAutoComplete","label"))})("onBlur",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.buscarCepPorEndereco())}),e.qZA(),e.TgZ(3,"label"),e._uU(4,"Estado"),e.qZA()()()}if(2&t){const o=e.oxw(3);e.xp6(2),e.Q6J("ngModel",o.novoEndereco.estado)("suggestions",o.fEstados)("disabled",o.enabledControles)}}function Yr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"fieldset",15)(1,"legend"),e._uU(2,"Cadastro de endere\xe7o"),e.qZA(),e.TgZ(3,"div")(4,"div",30)(5,"div",31)(6,"span",32)(7,"p-inputMask",33),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.novoEndereco.cep=n)})("onBlur",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.buscarEnderecoPorCep(n.novoEndereco.cep))}),e.qZA(),e.TgZ(8,"label"),e._uU(9,"CEP"),e.qZA()(),e.TgZ(10,"button",34),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.habilitarCamposEndereco())}),e.TgZ(11,"p",35),e._uU(12,"N\xe3o sei o CEP"),e.qZA()()(),e.YNc(13,Hr,1,0,"div",36),e.YNc(14,Qr,3,0,"div",37),e._UZ(15,"div",38),e.TgZ(16,"div",39),e._uU(17,"Tipo de Endere\xe7o:"),e.qZA(),e.TgZ(18,"div",40)(19,"p-selectButton",41),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.novoEndereco.tipo=n)}),e.qZA()(),e._UZ(20,"div",38),e.TgZ(21,"div",42)(22,"span",43)(23,"input",44),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.novoEndereco.endereco=n)})("blur",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.buscarCepPorEndereco())}),e.qZA(),e.TgZ(24,"label"),e._uU(25,"Logradouro"),e.qZA()()(),e.TgZ(26,"div",45)(27,"span",43)(28,"input",46),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.novoEndereco.numero=n)}),e.qZA(),e.TgZ(29,"label"),e._uU(30,"N\xfamero"),e.qZA()()(),e.TgZ(31,"div",42)(32,"span",43)(33,"input",47),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.novoEndereco.complemento=n)}),e.qZA(),e.TgZ(34,"label"),e._uU(35,"Complemento"),e.qZA()()(),e.TgZ(36,"div",48)(37,"span",43)(38,"input",49),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.novoEndereco.bairro=n)})("blur",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.buscarCepPorEndereco())}),e.qZA(),e.TgZ(39,"label"),e._uU(40,"Bairro"),e.qZA()()(),e.TgZ(41,"div",48)(42,"span",43)(43,"input",50),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(2);return e.KtG(a.novoEndereco.cidade=n)})("blur",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.buscarCepPorEndereco())}),e.qZA(),e.TgZ(44,"label"),e._uU(45,"Cidade"),e.qZA()()(),e.YNc(46,Lr,3,4,"div",51),e.YNc(47,Rr,5,3,"div",52),e.qZA()()()}if(2&t){const o=e.oxw(2);e.xp6(7),e.Q6J("ngModel",o.novoEndereco.cep)("mask","99999-999"),e.xp6(6),e.Q6J("ngIf",o.flagNaoSeiCep),e.xp6(1),e.Q6J("ngIf",o.flagNaoSeiCep),e.xp6(
15),e.Q6J("ngModel",o.novoEndereco.tipo)("options",o.tipos),e.xp6(4),e.Q6J("ngModel",o.novoEndereco.endereco)("disabled",o.enabledControles),e.xp6(5),e.Q6J("ngModel",o.novoEndereco.numero),e.xp6(5),e.Q6J("ngModel",o.novoEndereco.complemento),e.xp6(5),e.Q6J("ngModel",o.novoEndereco.bairro)("disabled",o.enabledControles),e.xp6(5),e.Q6J("ngModel",o.novoEndereco.cidade)("disabled",o.enabledControles),e.xp6(3),e.Q6J("ngIf",!o.enabledControles),e.xp6(1),e.Q6J("ngIf",o.enabledControles)}}function Gr(t,s){if(1&t&&(e.TgZ(0,"div",13),e.YNc(1,Or,22,6,"fieldset",14),e.YNc(2,Yr,48,16,"fieldset",14),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Q6J("ngIf",!o.flagAdicionarEndereco),e.xp6(1),e.Q6J("ngIf",o.flagAdicionarEndereco)}}function Kr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.flagAdicionarEndereco=!1)}),e._uU(1,"Cancelar"),e.qZA()}}function $r(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",61),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.gravarEndereco())}),e._uU(1,"Salvar"),e.qZA()}}function Vr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",62),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._uU(1,"Voltar"),e.qZA()}}function Br(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",63),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.gravarEndereco())}),e._uU(1,"Continuar"),e.qZA()}}function zr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",64),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._uU(1,"Voltar"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}function jr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",65),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep())}),e._uU(1,"Continuar"),e.qZA()}if(2&t){const o=e.oxw();e.Q6J("disabled",o.isLoading)}}let Wr=(()=>{class t extends w.a{constructor(o){super(o),this.tipos=[{label:"Residencial",title:"Residencial",value:1,icon:"fas fa-map-marker-alt"},{label:"Comercial",title:"Comercial",value:2,icon:"fas fa-map-marker-alt"},{label:"Outros",title:"Outros",value:3,icon:"fas fa-map-marker-alt"}],this.enabledControles=!0,this.flagAdicionarEndereco=!1,this.flagNaoSeiCep=!1,this.router=o.get(b.F0),this.unidadeService=o.get(l.sc7),this.informacaoUnidadeService=o.get(l.muL),this.homeService=o.get(l.igG),this.confirmationService=o.get(Z.YP)}ngOnInit(){this.changeStep(2),this.load()}load(){this.verificaPermissaoTela(),this.textoInformativo="Selecione um endere\xe7o para encontrarmos uma unidade pr\xf3xima a voc\xea.",this.novoEndereco=new l.X_S,this.enderecoEscolhido=this.model.endereco,this.flagAdicionarEndereco=!1,this.get()}get(){this.startLoading(!0),this.homeService.getDataLayer(this.domain).subscribe(o=>{this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o}),this.isLoggedIn()?this.registroService.getAllEnderecosPorProntuario("",this.domain).subscribe(o=>{this.enderecosMostrados=o.slice(0,3),this.enderecosUsuario=o.slice(3)},o=>{this.verifyError(o)}):(this.showNovoEndereco(),this.model.endereco&&(this.novoEndereco=this.model.endereco,this.enderecoEscolhido=this.model.endereco)),this.registroService.getEstados(this.domain).subscribe(o=>{this.estados=o},o=>{this.verifyError(o)}),this.informacaoUnidadeService.getInfoUnidades(this.domain).subscribe(o=>{this.stopLoading(),this.unidades=o},o=>{this.verifyError(o)})}showNovoEndereco(){this.flagAdicionarEndereco=!0,this.novoEndereco=new l.X_S,this.novoEndereco.tipo=1,this.enderecoEscolhido=new l.X_S}maisEnderecos(){this.enderecosUsuario.length&&this.enderecosMostrados.push(this.enderecosUsuario.pop())}buscarEnderecoPorCep(o){try{this.registroService.getEnderecoPorCEP(o,this.domain).subscribe(i=>{const n=this.novoEndereco.tipo;this.novoEndereco=i,this.novoEndereco.tipo=n,this.enderecoEscolhido.id&&this.enderecoEscolhido.id>0&&(this.novoEndereco.id=this.enderecoEscolhido.id),this.enabledControles=!!(i.bairro&&i.cep&&i.cidade&&i.endereco&&i.estado)})}catch{this.enabledControles=!1}}gravarEndereco(){return this.novoEndereco.numero?this.novoEndereco.cep?this.novoEndereco.tipo?void(this.isLoggedIn()?this.registroService.updateEndereco(+this.user.prontuarioId,this.domain,this.novoEndereco).subscribe(o=>{this.modalAlertService.open("success","Aten\xe7\xe3o","Endere\xe7o atualizado!","timer"),this.model.endereco=this.enderecoEscolhido,super.syncModel(),this.load()},o=>{this.verifyError(o)}):(this.model.endereco=this.novoEndereco,this.enderecoEscolhido=this.novoEndereco,super.syncModel(),this.goToNextStep())):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Favor selecionar o tipo do endere\xe7o.","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Cep n\xe3o encontrado.","button"),!1):(this.modalAlertService.open("warning","Aten\xe7\xe3o","Digite o numero do endere\xe7o.","button"),!1)}prencherEndereco(){this.flagAdicionarEndereco=!0,this.novoEndereco.tipo=0===this.enderecoEscolhido.tipo?3:this.enderecoEscolhido.tipo,this.novoEndereco.bairro=this.enderecoEscolhido.bairro,this.novoEndereco.cidade=this.enderecoEscolhido.cidade,this.novoEndereco.estado=this.enderecoEscolhido.estado,this.novoEndereco.id=this.enderecoEscolhido.id,this.novoEndereco.numero=this.enderecoEscolhido.numero,this.novoEndereco.complemento=this.enderecoEscolhido.complemento,this.novoEndereco.cep=this.enderecoEscolhido.cep,this.novoEndereco.endereco=this.enderecoEscolhido.endereco}confirmRemoverEndereco(){this.confirmationService.confirm({message:"Tem certeza que deseja remover o endere\xe7o selecionado?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.removerEndereco()}})}removerEndereco(){this.enderecoEscolhido.bloqueado=!0,this.registroService.updateEndereco(+this.user.prontuarioId,this.domain,this.enderecoEscolhido).subscribe(o=>{this.modalAlertService.open("success","Aten\xe7\xe3o","Endere\xe7o removido!","timer"),this.enderecoEscolhido=void 0,super.syncModel(),this.load()},o=>{this.verifyError(o)})}apagarCampos(){this.novoEndereco=new l.X_S}habilitarCamposEndereco(){this.flagNaoSeiCep=!0,this.estadosAutoComplete=this.estados.map((o,i)=>({id:i,label:o.nome,value:o.sigla})),this.novoEndereco=new l.X_S,this.enabledControles=!1}buscarCepPorEndereco(){if(this.novoEndereco.estado=this.estadoAutoCompleteEscolhido.label,this.novoEndereco.cidade&&this.novoEndereco.estado&&this.novoEndereco.endereco)try{const o=this.estados.filter(i=>i.nome===this.novoEndereco.estado)[0].sigla;this.registroService.getCEPPorEndereco(o,this.novoEndereco.cidade,this.novoEndereco.endereco,this.domain).subscribe(i=>{this.novoEndereco.bairro=i.bairro,this.novoEndereco.cidade=i.cidade,this.novoEndereco.estado=i.estado,this.novoEndereco.id=0,this.novoEndereco.cep=i.cep,this.novoEndereco.endereco=i.endereco,this.flagAdicionarEndereco=!0})}catch{this.modalAlertService.open("error","Aten\xe7\xe3o","Cep n\xe3o encontrado para este endere\xe7o","button")}}goToPreviousStep(){this.router.navigate(!0===this.model.reagendamento?["/marcacao/meus-agendamentos"]:["/marcacao/exame"],{queryParamsHandling:"merge"})}goToNextStep(){if(this.enderecoEscolhido)if(this.model.examesNaoAgendaveis.filter(o=>"VACINA"===o.especialidade.toUpperCase()).length>0)this.model.unidades=void 0,this.goToUnidade();else{this.startLoading();const o=new l.oaE;o.endereco=this.enderecoEscolhido,o.exames=this.model.exames,o.examesAc=this.model.examesNaoAgendaveis,o.origemRequisicao="autoagendamento",this.unidadeService.getUnidadesProximas(!1,this.domain,o).subscribe(i=>{const n=[];for(let a=0;a<i.length;a++){const d=this.unidades.filter(r=>r.id===i[a].id);d[0].distancia=i[a].distancia,d[0].totalExamesCobertos=i[a].totalExamesCobertos,n.push(d[0])}this.model.unidades=n,this.stopLoading(),this.getDataLayer("endereco"),this.goToUnidade()},i=>{this.verifyError(i)})}else this.modalAlertService.open("warning","Aten\xe7\xe3o","Voc\xea n\xe3o pode prosseguir antes de escolher um endere\xe7o!","button")}goToUnidade(){this.model.endereco=this.enderecoEscolhido,this.model.unidadesSelecionadas=[],this.syncModel(),this.router.navigate(["/marcacao/unidade"],{queryParamsHandling:"merge"})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-endereco"]],features:[e._Bn([Z.YP]),e.qOj],decls:14,vars:8,consts:[[1,"row"],["class","col-12",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelCancelar","type","button","class","btn btn-outline-primary",3,"click",4,"ngIf"],["id","modelSalvar","type","button","class","btn btn-primary text-uppercase",3,"click",4,"ngIf"],["id","modelVoltarNaoLogado","type","button","class","btn btn-outline-primary",3,"click",4,"ngIf"],["id","modelContinuarNaoLogado","type","button","class","btn btn-primary text-uppercase",3,"click",4,"ngIf"],["id","modelVoltar","type","button","class","btn btn-outline-primary",3,"disabled","click",4,"ngIf"],["id","modelContinuar","type","button","class","btn btn-primary text-uppercase",3,"disabled","click",4,"ngIf"],["header","Confirmation","icon","pi pi-exclamation-triangle","acceptLabel","Sim","rejectLabel","N\xe3o"],[1,"col-12"],["class","p-3",4,"ngIf"],[1,"p-3"],["class","p-fluid mt-0 col-12 col-md-6 col-lg-4 hand",4,"ngFor","ngForOf"],["id","btn_adicionar_endereco","type","button",1,"col-auto","col-sm-12","btn","btn-secondary",3,"disabled","click"],[1,"fas","fa-plus"],["id","btn_editar_endereco","type","button",1,"col-auto","col-sm-12","btn","btn-secondary",3,"disabled","click"],[1,"fas","fa-edit"],["id","btn_remover_endereco","type","button",1,"col-auto","col-sm-12","btn","btn-secondary",3,"disabled","click"],[1,"fas","fa-times"],["id","btn_mais_enderecos","type","button",1,"col-auto","col-sm-12","btn","btn-secondary",3,"disabled","click"],[1,"fas","fa-angle-double-right"],[1,"p-fluid","mt-0","col-12","col-md-6","col-lg-4","hand"],[3,"id","styleClass","click"],[1,"row","align-items-center"],[1,"col-2","fas","fa-home","fa-2x"],[1,"col-auto",2,"font-weight","400","font-size","14px","padding-left","0px","padding-right","0px"],[1,"row","justify-content"],[1,"col-12","d-flex"],[1,"p-float-label","align-self-stretch"],["id","novoEnderecoCep",1,"custom-inputMask",3,"ngModel","mask","ngModelChange","onBlur"],["id","btn_nao_sei_cep","type","button",1,"btn","btn-primary","text-uppercase","align-self-stretch","m-0",2,"align-items","center",3,"click"],[2,"font-size","12px","margin-left","5px","margin-right","5px","margin-bottom","0px"],["style","width: 100%;",4,"ngIf"],["class","col-12 p-fluid mt-0",4,"ngIf"],[2,"width","100%"],[1,"col-12","pb-0"],["id","novoEnderecoTipo",1,"col-xl-6","col-lg-6","col-md-8","col-sm-12","col-12","pt-0"],[3,"ngModel","options","ngModelChange"],[1,"col-xl-4","col-lg-4","col-md-4","col-sm-4","col-12"],[1,"p-float-label","p-fluid"],["id","novoEnderecoEndereco","type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","disabled","ngModelChange","blur"],[1,"col-xl-2","col-lg-2","col-md-4","col-sm-4","col-4"],["id","novoEnderecoNumero","type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","ngModelChange"],["id","novoEnderecoComplemento","type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","ngModelChange"],[1,"col-xl-3","col-lg-3","col-md-3","col-sm-3","col-12"],["id","novoEnderecoBairro","type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","disabled","ngModelChange","blur"],["id","novoEnderecoCidade","type","text","size","300","maxlength","200","pInputText","",1,"form-control","text-uppercase",3,"ngModel","disabled","ngModelChange","blur"],["class","col-xl-3
1col-lg-3 col-md-4 col-sm-6 col-12 p-fluid",4,"ngIf"],["class","col-xl-3 col-lg-3 col-md-3 col-sm-3 col-12 d-flex",4,"ngIf"],[1,"col-12","p-fluid","mt-0"],["role","alert",1,"alert","alert-warning"],[1,"col-xl-3","col-lg-3","col-md-4","col-sm-6","col-12","p-fluid"],["autocompleteSearchIcon","Estado"],["id","modelEndereco","name","modelEndereco","field","label","emptyMessage","Nenhum estado encontrado",3,"ngModel","suggestions","dropdown","forceSelection","ngModelChange","completeMethod","onSelect"],[1,"col-xl-3","col-lg-3","col-md-3","col-sm-3","col-12","d-flex"],["id","novoEnderecoEstado",3,"ngModel","suggestions","disabled","ngModelChange","completeMethod","onBlur"],["id","modelCancelar","type","button",1,"btn","btn-outline-primary",3,"click"],["id","modelSalvar","type","button",1,"btn","btn-primary","text-uppercase",3,"click"],["id","modelVoltarNaoLogado","type","button",1,"btn","btn-outline-primary",3,"click"],["id","modelContinuarNaoLogado","type","button",1,"btn","btn-primary","text-uppercase",3,"click"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary",3,"disabled","click"],["id","modelContinuar","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,Dr,2,0,"div",1),e.YNc(2,Gr,3,2,"div",1),e.qZA(),e.TgZ(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5),e.YNc(7,Kr,2,0,"button",6),e.YNc(8,$r,2,0,"button",7),e.YNc(9,Vr,2,0,"button",8),e.YNc(10,Br,2,0,"button",9),e.YNc(11,zr,2,1,"button",10),e.YNc(12,jr,2,1,"button",11),e.qZA()()()(),e._UZ(13,"p-confirmDialog",12)),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded&&i.unidades),e.xp6(5),e.Q6J("ngIf",i.flagAdicionarEndereco&&i.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",i.flagAdicionarEndereco&&i.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",i.flagAdicionarEndereco&&!i.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",i.flagAdicionarEndereco&&!i.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",!i.flagAdicionarEndereco),e.xp6(1),e.Q6J("ngIf",!i.flagAdicionarEndereco))},dependencies:[h.sg,h.O5,$.j,v.Fj,v.JJ,v.nD,v.On,H.o,Y.vy,L.Qc,y.Z,z.UN,F.Q],styles:["#clear{float:right;height:20px;width:20px;top:5px;right:5px;border-radius:20px;background:#f1f1f1;color:#fff;font-weight:700;text-align:center;cursor:pointer}#clear:hover{background:#ccc}.custom-p-card-endereco{min-height:120px!important}p{margin:inherit}\n"],encapsulation:2}),t})();var le=g(193),N=g(603),X=g(5439);function Xr(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",34),e.NdJ("click",function(n){const d=e.CHM(o).$implicit,r=e.oxw(3);return e.KtG(r.selectItem(n,d))}),e.TgZ(1,"div",3)(2,"div",35)(3,"span",36),e._uU(4),e.qZA()(),e.TgZ(5,"div",37),e._UZ(6,"span"),e.qZA()(),e.TgZ(7,"div",3)(8,"div",38)(9,"div",3)(10,"div",39)(11,"p",40),e._uU(12),e.qZA()(),e.TgZ(13,"div",41)(14,"p",40),e._uU(15),e.qZA()(),e.TgZ(16,"div",41)(17,"p",40),e._uU(18),e.qZA()()()()()()}if(2&t){const o=s.$implicit,i=e.oxw(3);e.MGl("id","selectedProntuario",o.id,""),e.xp6(4),e.Oqu(i.getNomeTitularDependente(o)),e.xp6(2),e.Tol(!1===o.bloqueado?"fa fa-unlock text-success fa-lg":"fa fa-lock text-danger fa-lg"),e.xp6(6),e.Oqu(0===o.tipoDocumento||2===o.tipoDocumento?"Titular":"Dependente"),e.xp6(3),e.AsE("",0===o.tipoDocumento||1===o.tipoDocumento?"CPF: ":"Passaporte: "," ",2!==o.tipoDocumento?i.getFormatCpf(o.numCpf):o.numCpf,""),e.xp6(3),e.hij("Data de Nascimento: ",i.getFormatDate(o.dataNascimento),"")}}function ec(t,s){if(1&t&&(e.TgZ(0,"div",31)(1,"div",32),e.YNc(2,Xr,19,8,"p-card",33),e.qZA()()),2&t){const o=e.oxw(2);e.xp6(2),e.Q6J("ngForOf",o.titularDependenteModel)}}function oc(t,s){1&t&&(e.TgZ(0,"div",3)(1,"div",42)(2,"p-card",43)(3,"div",44),e._uU(4," Nenhum paciente encontrado "),e.qZA()()()())}function ic(t,s){if(1&t&&(e.TgZ(0,"fieldset",28)(1,"legend"),e._uU(2,"Selecione o paciente abaixo"),e.qZA(),e.YNc(3,ec,3,1,"div",29),e.YNc(4,oc,5,0,"div",30),e.qZA()),2&t){const o=e.oxw();e.xp6(3),e.Q6J("ngIf",o.titularDependenteModel&&o.titularDependenteModel.length>0),e.xp6(1),e.Q6J("ngIf",o.titularDependenteModel&&0==o.titularDependenteModel.length)}}function tc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",45),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToRegister(n.itemSelecionado,!0))}),e._uU(1," ADICIONAR DEPENDENTE "),e.qZA()}}function nc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"button",46),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToRegister(n.itemSelecionado,!1))}),e._uU(1," EDITAR CADASTRO "),e.qZA()}}let ac=(()=>{class t extends w.a{constructor(o){super(o),this.router=o.get(b.F0),this.accountService=o.get(l.k4Y)}ngOnInit(){this.verificaPermissaoTela(),this.itemSelecionado=void 0;const o=D.y.getItem("cpf");o?this.pesquisaTitularDependente.numCpf=o:this.loadModelBase(),(this.pesquisaTitularDependente.numCpf||this.pesquisaTitularDependente.nomeCompleto||this.pesquisaTitularDependente.dataNascimento)&&this.getProntuario(),this.titularDependenteModel=void 0,this.userLogin=new l.n5m,this.usuarioLogado=T.G.getItem("user-session-lab-apoiado")}authenticate(o){this.startLoading(),this.accountService.setTitularDependentes(this.domain,o).subscribe(i=>{E.$.selectUser(i),this.stopLoading(),this.router.navigate(["/marcacao/exame"])},i=>{this.verifyError(i)})}setUsername(o){D.y.setItem("cpf",this.clearMask(o))}getProntuario(){try{void 0===this.pesquisaTitularDependente.numCpf||""===this.pesquisaTitularDependente.numCpf?this.modalAlertService.open("warning","Aten\xe7\xe3o","Campo CPF \xe9 obrigat\xf3rio","button"):(this.startLoading(!0),this.numCpf=void 0===this.pesquisaTitularDependente.numCpf?void 0:this.clearMask(this.pesquisaTitularDependente.numCpf),this.nomeCompleto=this.pesquisaTitularDependente.nomeCompleto,this.itemSelecionado=void 0,this.titularDependenteModel=void 0,T.G.removeItem("prontuarios"),T.G.removeItem("prontuario"),T.G.removeItem("pesquisaProntuarios"),D.y.removeItem("cpf"),this.dataNascimento=this.pesquisaTitularDependente.dataNascimento?new Date(X(this.pesquisaTitularDependente.dataNascimento,"DD/MM/YYYY").toString()):void 0,this.registroService.getProntuario(this.numCpf,this.nomeCompleto,this.dataNascimento,this.domain).subscribe(o=>{this.stopLoading(),this.titularDependenteModel=o,T.G.setItem("prontuarios",o),T.G.setItem("pesquisaProntuarios",this.pesquisaTitularDependente)},o=>{this.verifyError(o)}))}catch(o){this.stopLoading(),this.verifyError(o),this.modalAlertService.open("error","Aten\xe7\xe3o",o,"button")}}selectItem(o,i){const n=document.getElementsByClassName("p-card");for(let d=0;d<n.length;d++)n[d].classList.remove("selecionado");(o.target||o.srcElement||o.currentTarget).closest(".hand").classList.add("selecionado"),this.itemSelecionado=i,!0===this.itemSelecionado.bloqueado?this.modalAlertService.open("warning","Aten\xe7\xe3o","Este prontu\xe1rio est\xe1 bloqueado. Favor entrar em contato com a equipe de apoio.","button"):(this.userLogin.username=this.itemSelecionado.numCpf,this.setUsername(this.userLogin.username))}clear(){this.itemSelecionado=void 0,this.pesquisaTitularDependente=new l.CpM,this.titularDependenteModel=void 0,T.G.removeItem("prontuarios"),T.G.removeItem("prontuario"),T.G.removeItem("pesquisaProntuarios"),D.y.removeItem("cpf")}getTextoBotaoAvancar(){return this.titularDependenteModel&&this.titularDependenteModel.length>0?"CONTINUAR":"CADASTRAR PACIENTE"}goToNextStep(){if("CADASTRAR PACIENTE"==this.getTextoBotaoAvancar()){const o=btoa(unescape(encodeURIComponent(btoa(unescape(encodeURIComponent("CADASTRAR PACIENTE"))))));void 0!==this.pesquisaTitularDependente.numCpf&&D.y.setItem("cpf",this.clearMask(this.pesquisaTitularDependente.numCpf)),this.router.navigate(["/backoffice/register"],{queryParams:{registro:o}})}else this.authenticate(this.itemSelecionado)}verificarItemSelecionado(){return typeof this.itemSelecionado>"u"}goToRegister(o,i){this.getDataLayer("meu-cadastro"),T.G.setItem("prontuario",o),D.y.setItem("dependente",i?"true":"false");const n=JSON.stringify(o),a=btoa(unescape(encodeURIComponent(btoa(unescape(encodeURIComponent(n))))));this.router.navigate(["/backoffice/register"],{queryParams:{registro:a}})}goToPreviousStep(){this.router.navigate(["/marcao/home"])}getNomeTitularDependente(o){return o.nomeSocial?o.nomeSocial.toUpperCase():o.nomeCompleto.toUpperCase()}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-prontuario"]],features:[e.qOj],decls:43,vars:12,consts:[[1,"row","mt-3"],[1,"col-12"],[1,"p-3"],[1,"row"],[1,"col-xl-4","col-lg-4","col-md-12","col-sm-12","pe-0"],[1,"p-fluid"],["for","modelNomeCompleto"],["id","modelNomeCompleto","name","modelNomeCompleto","type","text","maxlength","200","placeholder","Nome do Paciente","pInputText","",3,"ngModel","ngModelChange"],[1,"col-xl-2","col-lg-2","col-md-6","col-sm-12","pe-0"],["for","modelCpf",1,""],["type","text","id","modelCpf","name","modelCpf","placeholder","CPF/Passaporte","maxlength","11","pInputText","",3,"ngModel","ngModelChange","keydown"],["for","modelDataNascimento"],["id","modelCpf","name","modelCpf","placeholder","Data de nascimento",3,"mask","ngModel","ngModelChange"],[1,"col-xl-2","col-lg-2","col-md-6","col-sm-12","pe-0","text-end"],["for","modelDataNascimento",1,"d-none","d-lg-block"],["id","modelPesquisar","type","button",1,"btn","btn-primary","w-100",3,"disabled","click"],[1,"fa","fa-search","me-2"],[1,"col-xl-2","col-lg-2","col-md-6","col-sm-12","text-end"],["id","modelLimpar","type","button",1,"btn","btn-outline-primary","w-100",3,"disabled","click"],["class","p-3 mt-3",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3",3,"disabled","click"],["class","btn btn-info me-3","type","button","title","Clique para adicionar um dependente",3,"click",4,"ngIf"],["class","btn btn-info me-3","type","button","title","Clique para editar o cadastro",3,"click",4,"ngIf"],["id","modelAdicionarDependente","type","button",1,"btn","btn-primary","text-uppercase",3,"disabled","click"],[1,"p-3","mt-3"],["class","row mb-2",4,"ngIf"],["class","row",4,"ngIf"],[1,"row","mb-2"],[1,"col-12","p-fluid","text-start"],["styleClass","card-gray hand pt-0 pb-0",3,"id","click",4,"ngFor","ngForOf"],["styleClass","card-gray hand pt-0 pb-0",3,"id","click"],[1,"col-xl-11","col-lg-11","col-md-11","col-sm-11","pt-0","pb-0"],[1,"title","text-start"],[1,"col-xl-1","col-lg-1","col-md-1","col-sm-1","pt-0","pb-0","text-end"],[1,"col-xl-9","col-lg-9","col-md-9","col-sm-9","pt-0","pb-0"],[1,"col-lg-3"],[1,"fw-bold","textCard"],[1,"col-lg-4"],[1,"col-12","p-fluid","text-center"],["id","selectedProntuario","styleClass","card-gray hand pt-0 pb-0 naoEncontrado"],[1,"col-12","text-center"],["type","button","title","Clique para adicionar um dependente",1,"btn","btn-info","me-3",3,"click"],["type","button","title","Clique para editar o cadastro",1,"btn","btn-info","me-3",3,"click"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"fieldset",2)(3,"legend"),e._uU(4,"Procure por um paciente"),e.qZA(),e.TgZ(5,"div",3)(6,"div",4)(7,"span",5)(8,"label",6),e._uU(9,"Nome do Paciente"),e.qZA(),e.TgZ(10,"input",7),e.NdJ("ngModelChange",function(a){return i.pesquisaTitularDependente.nomeCompleto=a}),e.qZA()()(),e.TgZ(11,"div",8)(12,"span",5)(13,"label",9),e._uU(14,"CPF/Passaporte"),e.qZA(),e.TgZ(15,"input",10),e.NdJ("ngModelChange",function(a){return i.pesquisaTitularDependente.numCpf=a})("keydown",function(a){return i.validarNumeros(a)}),e.qZA()()(),e.TgZ(16,"div",8)(17,"span",5)(18,"label",11),e._uU(19,"Data de nascimento"),e.qZA(),e.TgZ(20,"p-inputMask",12),e.NdJ("ngModelChange",function(a){return i.pesquisaTitularDependente.dataNascimento=a}),e.qZA()()(),e.TgZ(21,"div",13)(22,"label",14),e._uU(23,"\xa0"),e.qZA(),e.TgZ(24,"button",15),e.NdJ("click",function(){return i.getProntuario()}),e._UZ(25,"em",16),e._uU(26,"BUSCAR"),e.qZA()(),e.TgZ(27,"div",17)(28,"label",14),e._uU(29,"\xa0"),e.qZA(),e.TgZ(30,"button",18),e.NdJ("click",function(){return i.clear()}),e._uU(31,"LIMPAR"),e.qZA()()()(),e.YNc(32,ic,5,2,"fieldset",19),e.qZA(),e.TgZ(33,"div",20)(34,"div",21)(35,"div",22)(36,"div",23)(37,"button",24),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(38,"Voltar"),e.qZA(),e.YNc(39,tc,2,0,"button",25),e.YNc(40,nc,2,0,"button",26),e.TgZ(41,"button",27),e.NdJ("click",function(){return i.goToNextStep()}),e._uU(42),e.qZA()()()()()()),2&o&&(e.xp6(10),e.Q6J("ngModel",i.pesquisaTitularDependente.nomeCompleto),e.xp6(
15),e.Q6J("ngModel",i.pesquisaTitularDependente.numCpf),e.xp6(5),e.Q6J("mask","99/99/9999")("ngModel",i.pesquisaTitularDependente.dataNascimento),e.xp6(4),e.Q6J("disabled",i.isLoading),e.xp6(6),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("ngIf",i.titularDependenteModel),e.xp6(5),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("ngIf",i.itemSelecionado&&!1===i.itemSelecionado.bloqueado&&0===i.itemSelecionado.tipoDocumento),e.xp6(1),e.Q6J("ngIf",i.itemSelecionado&&!1===i.itemSelecionado.bloqueado&&i.verificaPermissao("FUNC_PRONTUARIO_EDITAR")),e.xp6(1),e.Q6J("disabled","CONTINUAR"==i.getTextoBotaoAvancar()&&i.itemSelecionado&&!1!==i.itemSelecionado.bloqueado),e.xp6(1),e.Oqu(i.getTextoBotaoAvancar()))},dependencies:[h.sg,h.O5,v.Fj,v.JJ,v.nD,v.On,H.o,Y.vy,y.Z],styles:["body .p-card.card-gray{min-height:auto!important}label{font-size:14px;color:#6c757d;left:14px}body .p-card{border:2px solid #22bc9f}.selecionado{background-color:#22bc9f!important;border:2px solid rgb(37,104,35)!important;transition:all .3s linear}.textCard{font-size:14px!important;color:#666!important}.selecionado *{color:#fff!important}.naoEncontrado{font-size:14px!important;border:2px #666 solid!important;color:#666!important}\n"],encapsulation:2}),t})();var O=g(261);function sc(t,s){1&t&&(e.TgZ(0,"div",4),e._uU(1,"Carregando..."),e.qZA())}function dc(t,s){if(1&t&&(e.TgZ(0,"label",16),e._uU(1),e.qZA()),2&t){const o=e.oxw(3);e.xp6(1),e.hij("\xa0",o.getNome(),"\xa0")}}function rc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"legend")(1,"label"),e._uU(2,"Ol\xe1,"),e.qZA(),e.YNc(3,dc,2,1,"label",14),e._uU(4,"\xa0 "),e.TgZ(5,"label",15),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.signOut())}),e._uU(6,"(sair)"),e.qZA()()}if(2&t){const o=e.oxw(2);e.xp6(3),e.Q6J("ngIf",o.isLoggedIn())}}function cc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",17)(1,"p-card",18),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToProntuario())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToProntuario())}),e._UZ(5,"em",22),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Agendar para o Paciente"),e.qZA()()()()()}}function lc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",17)(1,"p-card",24),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToHistoricoAgendamentos())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToHistoricoAgendamentos())}),e._UZ(5,"em",25),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Hist\xf3rico de Agendamentos"),e.qZA()()()()()}}function mc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",17)(1,"p-card",26),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToChangePassword())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToChangePassword())}),e._UZ(5,"em",27),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Alterar Senha"),e.qZA()()()()()}}function _c(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",17)(1,"p-card",26),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToUserParceiro())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToUserParceiro())}),e._UZ(5,"em",28),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Usu\xe1rios"),e.qZA()()()()()}}function pc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",38),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.selectItem(a))}),e.TgZ(1,"div",8)(2,"div",39)(3,"span",23),e._uU(4),e.qZA(),e.TgZ(5,"p"),e._uU(6),e.qZA(),e.TgZ(7,"p"),e._uU(8),e.qZA()(),e.TgZ(9,"div",40)(10,"button",41),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(3);return e.KtG(d.selectItem(a))}),e._UZ(11,"em",42),e.qZA()()()()}if(2&t){const o=s.$implicit,i=e.oxw(3);e.MGl("id","selectedPacientes",o.id,""),e.xp6(4),e.Oqu(i.getNomeTitularDependente(o)),e.xp6(2),e.hij("Data de Nascimento: ",i.getFormatDate(o.dataNascimento),""),e.xp6(2),e.hij("Tipo: ",0==o.tipoDocumento?"Titular":"Dependente","")}}function uc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",29)(1,"div",8)(2,"div",30)(3,"label",31),e._uU(4,"Escolha um Paciente abaixo"),e.qZA()(),e.TgZ(5,"div",32)(6,"button",33),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToMeuCadastro("true"))}),e._uU(7,"ADICIONAR DEPENDENTE"),e.qZA()()(),e.TgZ(8,"div",8)(9,"div",34),e.YNc(10,pc,12,4,"p-card",35),e.qZA()(),e.TgZ(11,"div",36)(12,"a",37),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.changeUser=!n.changeUser)}),e._uU(13,"Voltar"),e.qZA()()()}if(2&t){const o=e.oxw(2);e.xp6(6),e.Q6J("disabled",0!==o.usuarioLogado.usuarioSelecionado.tipoDocumento),e.xp6(4),e.Q6J("ngForOf",o.result)}}function gc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",18),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToAgendarOnline())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToAgendarOnline())}),e._UZ(5,"em",44),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Agendar Online"),e.qZA()()()()()}}function hc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",24),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);
1return e.KtG(n.goToMeusAgendamentos())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToMeusAgendamentos())}),e._UZ(5,"em",25),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Meus Agendamentos"),e.qZA()()()()()}}function fc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",45)(1,"p-card",46),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToAdmin())}),e.TgZ(2,"div",47)(3,"div",48)(4,"button",49),e._UZ(5,"em",25),e.qZA()(),e.TgZ(6,"div",48)(7,"span",23),e._uU(8,"Administra\xe7\xe3o"),e.qZA()()()()()}}function vc(t,s){if(1&t&&(e.TgZ(0,"div",20)(1,"span",23),e._uU(2),e.qZA()()),2&t){const o=e.oxw(3);e.xp6(2),e.hij("Meus Pagamentos (",o.totalPagamentos,")")}}function xc(t,s){1&t&&(e.TgZ(0,"div",20)(1,"span",23),e._uU(2,"Meus Pagamentos"),e.qZA()())}function Cc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",50),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToMeusPagamentos())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToMeusPagamentos())}),e._UZ(5,"em",51),e.qZA()(),e.YNc(6,vc,3,1,"div",52),e.YNc(7,xc,3,0,"div",52),e.qZA()()()}if(2&t){const o=e.oxw(2);e.xp6(6),e.Q6J("ngIf",o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",!o.isLoggedIn())}}function Ac(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",53),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToMeuCadastro("false"))}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToMeuCadastro("false"))}),e._UZ(5,"em",28),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Meu Cadastro"),e.qZA()()()()()}}function bc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",18),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.changeUser=!n.changeUser)}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.changeUser=!n.changeUser)}),e._UZ(5,"em",22),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Trocar de Paciente"),e.qZA()()()()()}}function Tc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",54),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToResultadosOnLine())}),e.TgZ(2,"div",19)(3,"div",20)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToResultadosOnLine())}),e._UZ(5,"em",55),e.qZA()(),e.TgZ(6,"div",20)(7,"span",23),e._uU(8,"Meus Resultados"),e.qZA()()()()()}}function Zc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",56),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToOrcamento())}),e.TgZ(2,"div",19)(3,"div",57)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToOrcamento())}),e._UZ(5,"em",58),e.qZA()(),e.TgZ(6,"div",57)(7,"span",23),e._uU(8,"Pre\xe7os e Coberturas"),e.qZA()()()()()}}function Ec(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"p-card",56),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToPrivacidade())}),e.TgZ(2,"div",19)(3,"div",57)(4,"button",21),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToPrivacidade())}),e._UZ(5,"em",59),e.qZA()(),e.TgZ(6,"div",57)(7,"span",23),e._uU(8,"Privacidade"),e.qZA()()()()()}}function Ic(t,s){1&t&&(e.TgZ(0,"div")(1,"p",79),e._uU(2),e.qZA()()),2&t&&(e.xp6(2),e.Oqu("7h \xe0s 12h"))}function Pc(t,s){if(1&t&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&t){const o=e.oxw().$implicit;e.xp6(2),e.Oqu(o.horario)}}function wc(t,s){1&t&&(e.TgZ(0,"span",80),e._uU(1,"(Drive-Thru)"),e.qZA())}function Mc(t,s){1&t&&e._UZ(0,"em",81)}function Uc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",64)(1,"div",69)(2,"span"),e._uU(3),e.qZA(),e.TgZ(4,"p",70),e._uU(5),e.qZA(),e._UZ(6,"p",71),e.YNc(7,Ic,3,1,"div",7),e.YNc(8,Pc,3,1,"div",7),e.qZA(),e.TgZ(9,"div",72)(10,"span",73),e._uU(11),e.YNc(12,wc,2,0,"span",74),e._uU(13,"\xa0 "),e.TgZ(14,"a",75),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(5);return e.KtG(d.showUnidadeInformacoes(a.unidadeId))}),e.YNc(15,Mc,1,0,"em",76),e.qZA()()(),e.TgZ(16,"div",77)(17,"label",78),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(5);
1return e.KtG(n.goToMeusAgendamentos())}),e._uU(18,"Mais detalhes"),e.qZA()()()}if(2&t){const o=s.$implicit,i=e.oxw(5);e.xp6(3),e.Oqu(i.getFormatDate(o.data,"DD MMM YY")),e.xp6(2),e.Oqu(i.getFormatDate(o.data,"dddd")),e.xp6(2),e.Q6J("ngIf","VACINA"===o.nomeExame||"ATENDIMENTO DOMICILIAR"===o.nomeExame),e.xp6(1),e.Q6J("ngIf",!("VACINA"===o.nomeExame||"ATENDIMENTO DOMICILIAR"===o.nomeExame)),e.xp6(3),e.hij("",o.nomeExame,"\xa0"),e.xp6(1),e.Q6J("ngIf",o.driveThru),e.xp6(3),e.Q6J("ngIf","ATENDIMENTO DOMICILIAR"!=o.nomeExame)}}function Nc(t,s){if(1&t&&(e.TgZ(0,"div",64)(1,"div",67),e.YNc(2,Uc,19,7,"div",68),e.qZA()()),2&t){const o=e.oxw().$implicit;e.xp6(2),e.Q6J("ngForOf",o.agendamentos)}}function Sc(t,s){if(1&t&&(e.TgZ(0,"p-card",63)(1,"div",64)(2,"div",65)(3,"h5"),e._uU(4,"Protocolo: "),e.TgZ(5,"strong"),e._uU(6),e.qZA()()()(),e.YNc(7,Nc,3,1,"div",66),e.qZA()),2&t){const o=s.$implicit,i=e.oxw(3);e.xp6(6),e.Oqu(o.protocoloId),e.xp6(1),e.Q6J("ngIf",o.agendamentos&&o.agendamentos.length>0&&!i.labApoiado)}}function yc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"fieldset",60)(1,"legend")(2,"label"),e._uU(3,"Pr\xf3ximos agendamentos\xa0"),e.qZA(),e.TgZ(4,"label",15),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goToMeusAgendamentos())}),e._uU(5," (ver todos os agendamentos)"),e.qZA()(),e.TgZ(6,"div",8)(7,"div",61),e.YNc(8,Sc,8,2,"p-card",62),e.qZA()()()}if(2&t){const o=e.oxw(2);e.xp6(8),e.Q6J("ngForOf",o.meusProtocolos)}}function qc(t,s){if(1&t&&(e.TgZ(0,"div",5)(1,"fieldset",6),e.YNc(2,rc,7,1,"legend",7),e.TgZ(3,"div",8),e.YNc(4,cc,9,0,"div",9),e.YNc(5,lc,9,0,"div",9),e.YNc(6,mc,9,0,"div",9),e.YNc(7,_c,9,0,"div",9),e.YNc(8,uc,14,2,"div",10),e.YNc(9,gc,9,0,"div",11),e.YNc(10,hc,9,0,"div",11),e.YNc(11,fc,9,0,"div",12),e.YNc(12,Cc,8,2,"div",11),e.YNc(13,Ac,9,0,"div",11),e.YNc(14,bc,9,0,"div",11),e.YNc(15,Tc,9,0,"div",11),e.YNc(16,Zc,9,0,"div",11),e.YNc(17,Ec,9,0,"div",11),e.qZA()(),e.YNc(18,yc,9,1,"fieldset",13),e.qZA()),2&t){const o=e.oxw();e.xp6(2),e.Q6J("ngIf",o.isLoggedIn()),e.xp6(2),e.Q6J("ngIf",o.verificaPermissao("TELA_MARCACAO_PRONTUARIO")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_HOME_HISTORICOAGENDAMENTOS")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_HOME_ALTERARSENHA")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",o.verificaPermissao("FUNC_HOME_CADUSUARIOPARCEIRO")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",o.changeUser&&o.verificaPermissao("FUNC_MARCACAO_HOME_TROCARPACIENTE")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("FUNC_HOME_AGENDARONLINE")),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("TELA_MARCACAO_MEUSAGENDAMENTOS")),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("TELA_ADMIN")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("TELA_MARCACAO_MEUSPAGAMENTOS")&&o.getPermitePagamentoOnline()),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("FUNC_HOME_MEUCADASTRO")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("FUNC_MARCACAO_HOME_TROCARPACIENTE")&&o.isLoggedIn()),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("FUNC_HOME_RESULTADOSONLINE")&&o.urlRol),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("FUNC_HOME_ORCAMENTOS")),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.verificaPermissao("FUNC_HOME_ORCAMENTOS")),e.xp6(1),e.Q6J("ngIf",!o.changeUser&&o.meusProtocolos&&o.meusProtocolos.length>0&&o.verificaPermissao("FUNC_MARCACAO_HOME_PROXIMOSAGENDAMENTOS")&&o.isLoggedIn())}}let Jc=(()=>{class t extends w.a{constructor(o){super(o),this.router=o.get(b.F0),this.accountService=o.get(l.k4Y),this.meusAgendamentosService=o.get(l.t0i),this.homeService=o.get(l.igG),this.route=o.get(b.gz)}get usuarioLogado(){return this.user}get hasTitularDependente(){return this.result&&this.result.length>1}ngOnInit(){this.changeStep(0),this.clear(),this.load()}clear(){this.result=null,this.changeUser=!1,this.meusProtocolos=[]}load(){this.redirect=this.route.snapshot.queryParams.redirect,this.verificaPermissaoTela(),this.isLoggedIn()?this.get():(this.eventCloseLoginHome=this.loginService.onClose.subscribe(o=>{this.onCloseLogin()}),this.urlRol="UrlResultadosOnLine"===this.getSetting("UrlResultadosOnLine")?void 0:this.getSetting("UrlResultadosOnLine"),this.urlRol?"resultados-online"===this.redirect&&this.urlRol&&this.exibirPopupLogin():E.$.loadedWeb
1SettingsObservable.subscribe(()=>{this.urlRol="UrlResultadosOnLine"===this.getSetting("UrlResultadosOnLine")?void 0:this.getSetting("UrlResultadosOnLine"),"resultados-online"===this.redirect&&this.urlRol&&this.exibirPopupLogin()})),setTimeout(()=>{this.ajustaAltura()},2e3),this.stopLoading()}onCloseLogin(){this.eventCloseLoginHome.unsubscribe();const o={...this.route.snapshot.queryParams};"resultados-online"===o.redirect&&delete o.redirect,this.isLoggedIn()&&"resultados-online"==this.redirect&&this.urlRol?this.goToResultadosOnLine():this.get()}isLabApoiado(){return this.authService.isLoggedIn()&&this.authService.isInRole([O.y.BACKOFFICE])}isPleres(){return this.authService.isLoggedIn()&&this.authService.isInRole([O.y.PLERES])}get(){this.urlRol="UrlResultadosOnLine"===this.getSetting("UrlResultadosOnLine")?void 0:this.getSetting("UrlResultadosOnLine"),this.startLoading(),this.user&&!this.user.backoffice&&(0,J.D)(this.meusAgendamentosService.getMeusAgendamentos(0,this.domain),this.registroService.getTitularDependentes(this.user.username,this.domain),this.homeService.getDataLayer(this.domain)).subscribe(o=>{this.stopLoading(),this.meusProtocolos=o[0].protocolos.filter(i=>i.possuiAgendamentosAtivos),this.totalPagamentos=o[0].agendamentos.filter(i=>i.pagamentoOnline).length,this.totalDocumentos=o[0].agendamentos.filter(i=>!i.documentosEnviados).length,this.totalQuestionarios=o[0].agendamentos.filter(i=>!i.questionarioRespondido).length,this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o[2],o[1]&&o[1].length>0&&(this.result=o[1]),this.stopLoading()},o=>{this.verifyError(o)})}selectItem(o){this.startLoading(!0),this.accountService.setTitularDependentes(this.domain,o).subscribe(i=>{E.$.selectUser(i),this.registroService.getConvenioPlanoProntuario(this.domain).subscribe(n=>{n?(this.marcacaoService.convenio=n.convenio,this.marcacaoService.plano=n.plano,this.marcacaoService.dataValidade=n.dataValidade,this.marcacaoService.matriculaConvenio=n.matriculaConvenio):(this.marcacaoService.convenio=void 0,this.marcacaoService.plano=void 0,this.marcacaoService.dataValidade=void 0,this.marcacaoService.matriculaConvenio=void 0)},n=>{this.verifyError(n)}),this.stopLoading(),this.changeUser=!this.changeUser},i=>{this.verifyError(i)})}goToChangePassword(){this.router.navigate(["/backoffice/password/change"])}showUnidadeInformacoes(o){this.selectedInformacaoUnidadeId=o}hideUnidadeInformacoes(){this.selectedInformacaoUnidadeId=void 0}goToAgendarOnline(){this.getDataLayer("agendar-online");const o={...this.route.snapshot.queryParams};"resultados-online"===o.redirect&&delete o.redirect,this.router.navigate(["/marcacao/exame"],{queryParams:o})}goToMeuCadastro(o){this.getDataLayer("meu-cadastro"),D.y.setItem("dependente",o),this.router.navigate(["/backoffice/register"],{queryParamsHandling:"merge"})}goToWebCheckin(){this.router.navigateByUrl("/marcacao/meus-agendamentos")}goToMeusPagamentos(){this.getDataLayer("meus-pagamentos");const o={...this.route.snapshot.queryParams};"resultados-online"===o.redirect&&delete o.redirect,this.router.navigate(["/marcacao/meus-pagamentos"],{queryParams:o})}goToResultadosOnline(){this.getDataLayer("resultados-online"),this.router.navigate(["/marcacao/meus-agendamentos"],{queryParamsHandling:"merge"})}goToAdmin(){this.router.navigate(["/admin"],{queryParamsHandling:"merge"})}goToQuestionarios(){this.router.navigate(["/marcacao/meus-agendamentos"],{queryParamsHandling:"merge"})}goToMeusAgendamentos(){this.getDataLayer("meus-agendamentos");const o={...this.route.snapshot.queryParams};"resultados-online"===o.redirect&&delete o.redirect,this.router.navigate(["/marcacao/meus-agendamentos"],{queryParams:o})}goToProntuario(){this.router.navigate(["/marcacao/prontuario"])}goToHistoricoAgendamentos(){this.router.navigate(["/marcacao/historico"])}goToPreviousStep(){this.router.navigate(["/marcacao/home"])}goToUserParceiro(){this.router.navigate(["/backoffice/user-parceiro"])}signOut(){this.user&&this.user.backoffice?(E.$.signOut(!1),this.closeMenu(),this.getLoginBackOfficeNoSSO()?(window.location.href=window.location.href+"?redirect=backoffice",this.openSSO()):this.router.navigate(["/backoffice/login"])):(E.$.signOut(!1),window.location.reload())}closeMenu(){I("#modelMenuCabecalho").click()}controlRoute(){this.getLgpdAtivado()?this.router.navigateByUrl("/lgpd"):this.router.navigateByUrl("/marcacao/convenio-plano")}ajustaAltura(){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){const o=[];I(".dashboard .p-card-content").each(function(){I(this).attr("style",""),o.push(I(this).height())});const i=Math.max.apply(Math,o);I(".dashboard .p-card-content").each(function(){I(this).height(i+"px")})}}goToResultadosOnLine(){this.isLoggedIn()?this.redirectResultadosOnLine():(this.eventCloseLoginHome=this.loginService.onClose.subscribe(o=>{this.isLoggedIn()&&this.redirectResultadosOnLine()}),this.exibirPopupLogin())}goToOrcamento(){this.router.navigate(["/marcacao/orcamento"])}goToPrivacidade(){this.router.navigate(["/marcacao/privacidade"])}redirectResultadosOnLine(){this.startLoading();const o=this.getSetting("UrlResultadosOnLine"),i=T.G.getItemPixeon("user-session").token,n=sessionStorage.getItem("user-session"),a=W.w.decrypt
1Value(n);let d=new l.jNJ;d.token=i,this.accountService.validarTokenROL(this.domain,d).subscribe(r=>{if(this.stopLoading(),r){const c={...this.route.snapshot.queryParams};"resultados-online"===c.redirect&&delete c.redirect,this.router.navigate([o.replace("@token",a)],{queryParams:c}).then(m=>{window.location.href=o.replace("@token",a)})}else this.modalAlertService.open("warning","Aten\xe7\xe3o","Redirecionando para o login...","timer"),this.signOut()},r=>{this.modalAlertService.open("warning","Aten\xe7\xe3o","Redirecionando para o login...","timer"),this.signOut()})}getNome(){return this.usuarioLogado.backoffice?this.usuarioLogado.labApoiado&&0===this.usuarioLogado.labApoiado.id?this.usuarioLogado.name:this.usuarioLogado.labApoiado.nomeLaboatorioApoiado:null==this.usuarioLogado.usuarioSelecionado?this.usuarioLogado.nomeSocial?this.usuarioLogado.nomeSocial:this.usuarioLogado.name:this.usuarioLogado.usuarioSelecionado.nomeSocial?this.usuarioLogado.usuarioSelecionado.nomeSocial.toUpperCase():this.usuarioLogado.usuarioSelecionado.name?this.usuarioLogado.usuarioSelecionado.name:this.usuarioLogado.usuarioSelecionado.nomeCompleto}getNomeTitularDependente(o){return o.nomeSocial?o.nomeSocial.toUpperCase():o.nomeCompleto.toUpperCase()}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-home"]],features:[e.qOj],decls:4,vars:3,consts:[[1,"row","mt-5"],["class","col-md-12",4,"ngIf"],["class","col-md-12 mt-0",4,"ngIf"],[3,"value","onClose"],[1,"col-md-12"],[1,"col-md-12","mt-0"],[1,"p-3"],[4,"ngIf"],[1,"row"],["class","col-sm-12 col-lg-4",4,"ngIf"],["class","",4,"ngIf"],["class","col-xl-3 col-lg-4 col-md-6 col-sm-12",4,"ngIf"],["class","col-xl-4 col-lg-4 col-md-12 col-sm-12",4,"ngIf"],["class","pt-0",4,"ngIf"],["class","text-primary fs-5",4,"ngIf"],[1,"hand-underline","small","fw-bold",3,"click"],[1,"text-primary","fs-5"],[1,"col-sm-12","col-lg-4"],["id","modelGoToAgendarOnline","styleClass","bg-info border-0 hand m-0 pb-2",3,"click"],[1,"row","text-white"],[1,"col-md-12","text-center"],["type","button",1,"no-button",3,"click"],[1,"fas","fa-users","light","big-size"],[1,"title","hand"],["id","modelGoToMeusAgendamentos","styleClass","bg-info border-0 hand m-0 pb-2",3,"click"],[1,"fas","fa-calendar-plus","light","big-size"],["id","modelGoToAlterarSenha","styleClass","bg-info border-0 hand m-0 pb-2",3,"click"],[1,"fas","fa-key","light","big-size"],[1,"fas","fa-user-edit","light","big-size"],[1,""],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-12","p-fluid","text-start"],[1,"pb-2","small","text-gray","fw-bold"],[1,"col-xl-6","col-lg-6","col-md-6","col-sm-12","p-fluid","text-end"],["id","btnModalDependentes","type","button",1,"btn","btn-primary",3,"disabled","click"],[1,"col-md-12","p-fluid","text-start"],["styleClass","card-gray hand",3,"id","click",4,"ngFor","ngForOf"],[1,"col-md-12","p-fluid","text-end"],["href","#",1,"btn","btn-outline-primary","m-0",3,"click"],["styleClass","card-gray hand",3,"id","click"],[1,"col-9","text-start"],[1,"col-3","text-end"],["type","button","title","Escolher",1,"no-button",3,"click"],[1,"fas","fa-chevron-circle-right"],[1,"col-xl-3","col-lg-4","col-md-6","col-sm-12"],[1,"fas","fa-calendar-alt","light","big-size"],[1,"col-xl-4","col-lg-4","col-md-12","col-sm-12"],["id","modelGoToAdmin","styleClass","bg-info border-0 hand m-0 pb-2",3,"click"],[1,"text-white"],[1,"col-md-12","mt-0","text-center"],["type","button",1,"no-button"],["id","modelGoToMeusPagamentos","styleClass","bg-info border-0 hand m-0 pb-2",3,"click"],[1,"fas","fa-credit-card","light","big-size"],["class","col-md-12 text-center",4,"ngIf"],["id","modelGoToMeuCadastro","styleClass","bg-info border-0 hand m-0 pb-2",3,"click"],["id","modelGoToResultadosOnline","styleClass","bg-info border-0 hand m-0 pb-2",3,"click"],[1,"fas","fa-heartbeat","light","big-size"],["id","modelGoToOrcamento","styleClass","bg-info border-0 hand no-margin m-0 pb-2",3,"click"],[1,"col-12","text-center"],[1,"fas","fa-dollar-sign","light","big-size"],[1,"fas","fa-file-export","light","big-size"],[1,"pt-0"],[1,"col-md-12","mt-0","p-fluid","text-end"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start"],[1,"row","m-0","p-0"],[1,"col-md-12","text-sm-center1"],["class","row m-0 p-0",4,"ngIf"],[1,"col-md-12","p-fluid","text-end","mt-0","border-only-top"],["class","row m-0 p-0",4,"ngFor","ngForOf"],[1,"col-xl-2","col-lg-2","col-md-3","col-sm-12","text-start","subtitle","d-block","m-0","p-0","text-sm-center1"],[1,"d-sm-block"],[1,"mt-0"],[1,"col-xl-8","col-lg-8","col-md-7","col-sm-12","text-start","text-sm-center1"],[1,"title"],["class","text-warning",4,"ngIf"],["href","javascript:void(0)",3,"click"],["class","fas fa-info-circle fa-lg",4,"ngIf"],[1,"col-xl-2","col-lg-2","col-md-2","col-sm-12","text-sm-center1"],[1,"hand-underline","small","fw-bold","text-gray",3,"click"],[1,"text-align-left","fw-bold"],[1,"text-warning"],[1,"fas","fa-info-circle","fa-lg"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,sc,2,0,"div",1),e.YNc(2,qc,19,16,"div",2),e.qZA(),e.TgZ(3,"a
1pp-unidade-informacao",3),e.NdJ("onClose",function(){return i.hideUnidadeInformacoes()}),e.qZA()),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(1),e.Q6J("value",i.selectedInformacaoUnidadeId))},dependencies:[h.sg,h.O5,y.Z,G],styles:[".bgResultadosOnline{position:fixed;width:100%;height:100%;top:0;left:0;background-color:#fff;z-index:9999}\n"],encapsulation:2}),t})();function kc(t,s){1&t&&e._UZ(0,"div",40)}function Dc(t,s){1&t&&e._UZ(0,"em",64)}function Fc(t,s){1&t&&(e.TgZ(0,"div")(1,"p",65),e._uU(2),e.qZA()()),2&t&&(e.xp6(2),e.Oqu("7h \xe0s 12h"))}function Oc(t,s){if(1&t&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&t){const o=e.oxw().$implicit;e.xp6(2),e.Oqu(o.horario)}}function Hc(t,s){1&t&&(e.TgZ(0,"span",66),e._uU(1,"(Drive-Thru)"),e.qZA())}function Qc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",67),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(4);return e.KtG(a.showExamesAnalisesClinicas(n.protocoloId))}),e._uU(1," ver mais "),e.qZA()}if(2&t){const o=e.oxw(5);e.ekj("disabled",o.isLoading)}}function Lc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",68),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(4);return e.KtG(a.buscarUrlDocumento(n))}),e._UZ(1,"em",69),e.qZA()}}function Rc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",68),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(4);return e.KtG(a.showPreparoInformacoes(n))}),e._UZ(1,"em",69),e.qZA()}}const xe=function(t,s){return{"btn-outline-info":t,"btn-outline-primary":s}};function Yc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",70),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(4);return e.KtG(a.showTermoCienciaOrientacao(n))}),e._UZ(1,"em",71),e.qZA()}if(2&t){const o=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(1,xe,!o.termoCienciaOrientacao,o.termoCienciaOrientacao))}}function Gc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",72),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(4);return e.KtG(a.goToDocumento(n.protocoloId,n.prontuarioId))}),e._UZ(1,"em",73),e.qZA()}if(2&t){const o=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(1,xe,!o.documentosEnviados,o.documentosEnviados))}}function Kc(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"a",74),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(4);return e.KtG(a.goToQuestionario(n.exameId,n.protocoloId,n.prontuarioId))}),e._UZ(1,"em",75),e.qZA()}if(2&t){const o=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(1,xe,!o.questionarioRespondido,o.questionarioRespondido))}}const Ye=function(t,s,o,i){return{"text-success":t,"text-danger":s,"text-warning":o,"text-info":i}};function $c(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-card",43)(1,"div",3)(2,"div",44),e._uU(3),e.qZA()(),e.TgZ(4,"div",3)(5,"div",45),e._uU(6," \xa0"),e.TgZ(7,"strong"),e._uU(8),e.qZA(),e._uU(9," \xa0 "),e.TgZ(10,"a",46),e.NdJ("click",function(){const a=e.CHM(o).$implicit,d=e.oxw(4);return e.KtG(d.showUnidadeInformacoes(a.unidadeId))}),e.YNc(11,Dc,1,0,"em",47),e.qZA()(),e.TgZ(12,"div",48)(13,"span"),e._uU(14),e.qZA(),e.TgZ(15,"p",49),e._uU(16),e.qZA(),e._UZ(17,"p",50),e.YNc(18,Fc,3,1,"div",51),e.YNc(19,Oc,3,1,"div",51),e.TgZ(20,"p",52),e._uU(21,"\xa0"),e.qZA(),e.TgZ(22,"p",53),e._uU(23),e.qZA()(),e.TgZ(24,"div",54)(25,"p",55),e._uU(26),e.qZA(),e.TgZ(27,"p",56),e._uU(28,"\xa0"),e.qZA(),e.TgZ(29,"span",57),e._uU(30),e.YNc(31,Hc,2,0,"span",58),e._uU(32,"\xa0 "),e.YNc(33,Qc,2,2,"a",59),e.qZA(),e.TgZ(34,"p"),e._uU(35,"\xa0"),e.qZA(),e.TgZ(36,"p"),e._uU(37,"\xa0"),e.qZA(),e.YNc(38,Lc,2,0,"a",60),e.YNc(39,Rc,2,0,"a",60),e.YNc(40,Yc,2,4,"a",61),e.YNc(41,Gc,2,4,"a",62),e.YNc(42,Kc,2,4,"a",63),e.qZA()()()}if(2&t){const o=s.$implicit,i=e.oxw(2).$implicit,n=e.oxw(2);e.MGl("id","selectedExames",o.id,""),e.Q6J("styleClass","border-only-top card-gray"+(0===o.statusAgendamento?" light":"")),e.xp6(3),e.hij(" Nome Paciente: ",n.getNome(o),"\xa0 "),e.xp6(5),e.Oqu(o.nomeUnidade),e.xp6(3),e.Q6J("ngIf","ATENDIMENTO DOMICILIAR"!=o.nomeExame),e.xp6(3),e.Oqu(n.getFormatDate(o.data,"DD MMM YY")),e.xp6(2),e.Oqu(n.getFormatDate(o.data,"dddd")),e.xp6(2),e.Q6J("ngIf","VACINA"===o.nomeExame||"ATENDIMENTO DOMICILIAR"===o.nomeExame),e.xp6(1),e.Q6J("ngIf",!("VACINA"===o.nomeExame||"ATENDIMENTO DOMICILIAR"===o.nomeExame)),e.xp6(3),e.Q6J("ngClass",e.l5B(21,Ye,5===o.statusAgendamento,4===o.statusAgendamento,o.statusAgendamento>0&&o.statusAgendamento<4,0===o.statusAgendamento)),e.xp6(1),e.hij(" ",o.statusAgendadamentoDetalhe," "),e.xp6(2),e.Q6J("ngClass",e.l5B(26,Ye,5===o.statusAgendamento,4===o.statusAgendamento,o.statusAgendamento>0&&o.statusAgendamento<4,0===o.statusAgendamento)),e.xp6(1),e.hij(" ",o.statusAgendadamentoDetalhe," "),e.xp6(4),e.hij("",o.nomeExame,"\xa0"),e.xp6(1),e.Q6J("ngIf",o.driveThru),e.xp6(2),e.Q6J("ngIf",i.possuiExamesNaoAgendaveis),e.xp6(
15),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_HISTORICOAGENDAMENTOS_PREPARO")&&o.linkInstrucao&&""!==o.linkInstrucao),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_HISTORICOAGENDAMENTOS_PREPARO")&&(!o.linkInstrucao||""===o.linkInstrucao)),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_HISTORICOAGENDAMENTOS_TERMO")&&0===o.statusAgendamento&&o.termoCienciaOrientacaoId>0),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_HISTORICOAGENDAMENTOS_DOCUMENTO")),e.xp6(1),e.Q6J("ngIf",n.verificaPermissao("FUNC_HOME_HISTORICOAGENDAMENTOS_QUESTIONARIO")&&o.possuiQuestionario)}}function Vc(t,s){if(1&t&&(e.TgZ(0,"div",3)(1,"div",41),e.YNc(2,$c,43,31,"p-card",42),e.qZA()()),2&t){const o=e.oxw().$implicit;e.xp6(2),e.Q6J("ngForOf",o.agendamentos)}}function Bc(t,s){1&t&&(e.TgZ(0,"div",3)(1,"div",76)(2,"p",77),e._uU(3,"N\xe3o existe(m) exame(s) agendado(s) para voc\xea"),e.qZA()()())}function zc(t,s){if(1&t&&(e.TgZ(0,"p-card",36)(1,"div",3)(2,"div",37)(3,"p",38),e._uU(4,"\xa0"),e.qZA(),e.TgZ(5,"h5"),e._uU(6,"\xa0\xa0Protocolo: "),e.TgZ(7,"strong"),e._uU(8),e.qZA()()(),e.YNc(9,kc,1,0,"div",39),e.qZA(),e.YNc(10,Vc,3,1,"div",25),e.YNc(11,Bc,4,0,"div",25),e.qZA()),2&t){const o=s.$implicit;e.xp6(8),e.Oqu(o.protocoloId),e.xp6(1),e.Q6J("ngIf",!0===o.possuiAgendamentosAtivos),e.xp6(1),e.Q6J("ngIf",o.agendamentos&&o.agendamentos.length>0),e.xp6(1),e.Q6J("ngIf",!o.agendamentos||0===o.agendamentos.length)}}function jc(t,s){if(1&t&&(e.TgZ(0,"div",3)(1,"div",34),e.YNc(2,zc,12,4,"p-card",35),e.qZA()()),2&t){const o=e.oxw();e.xp6(2),e.Q6J("ngForOf",o.meusProtocolos)}}function Wc(t,s){1&t&&(e.TgZ(0,"div",3)(1,"div",78)(2,"p-card",79)(3,"div",80),e._uU(4," Nenhum agendamento encontrado "),e.qZA()()()())}let Xc=(()=>{class t extends w.a{constructor(o){super(o),this.router=o.get(b.F0),this.meusAgendamentosService=o.get(l.t0i),this.historicoAgendamentosService=o.get(l.HAC),this.accountService=o.get(l.k4Y)}ngOnInit(){this.verificaPermissaoTela(),this.historicoAgendamentosRequest=new l.MWi,this.numCpf=void 0,this.idProtocolo=void 0,this.startLoading(),this.historicoAgendamentosService.getStatusAgendamento(this.domain).subscribe(o=>{this.statusAgendamentos=o,this.statusAgendamento=o[1]}),this.historicoAgendamentosRequest.numCpf?this.historicoAgendamentosService.getHistoricoAgendamentos(this.domain,this.historicoAgendamentosRequest).subscribe(o=>{this.meusProtocolos=o.protocolos,this.meusAgendamentos=o.agendamentos,this.stopLoading(),this.numCpf=this.historicoAgendamentosRequest.numCpf,this.dataInicial=this.historicoAgendamentosRequest.dataInicial?X(this.historicoAgendamentosRequest.dataInicial).format("DD/MM/YYYY").toString():null,this.dataFinal=this.historicoAgendamentosRequest.dataFinal?X(this.historicoAgendamentosRequest.dataFinal).format("DD/MM/YYYY").toString():null,this.statusAgendamento=this.statusAgendamentos.find(i=>i.value===this.historicoAgendamentosRequest.status),this.idProtocolo=this.historicoAgendamentosRequest.idProtocolo,this.usuarioLogado.username=this.historicoAgendamentosRequest.labApoiado}):this.stopLoading()}get usuarioLogado(){return this.user}goToQuestionario(o,i,n){T.G.setItem("titular-dependente",n),this.cleanModelFinished(),this.modelFinished.protocoloIdSelected=i,this.modelFinished.exameIdSelected=o,this.syncModelFinished(),this.getProntuario(n.toString(),"/marcacao/questionario")}goToDocumento(o,i){if(this.cleanModelFinished(),this.unidadeVacina){const n=this.meusAgendamentos.filter(a=>a.protocoloId===o&&a.unidadeId===this.unidadeVacina.id);this.modelFinished.vacina=n.length>0}this.modelFinished.protocoloIdSelected=o,this.getProntuario(i,"/marcacao/documento")}showUnidadeInformacoes(o){this.selectedInformacaoUnidadeId=o}hideUnidadeInformacoes(){this.selectedInformacaoUnidadeId=void 0}showTermoCienciaOrientacao(o){this.selectedTermoCienciaOrientacao=o}hideTermoCienciaOrientacao(){this.selectedTermoCienciaOrientacao=void 0}getHistoricoAgendamentos(){try{this.numCpf?(this.startLoading(!0),this.historicoAgendamentosRequest.numCpf=void 0===this.numCpf?void 0:this.numCpf.replace(".","").replace(".","").replace("-",""),this.historicoAgendamentosRequest.dataInicial=this.dataInicial?new Date(X(this.dataInicial,"DD/MM/YYYY").toString()):void 0,this.historicoAgendamentosRequest.dataFinal=this.dataFinal?new Date(X(this.dataFinal,"DD/MM/YYYY").toString()):void 0,this.historicoAgendamentosRequest.status=this.statusAgendamento.value,this.historicoAgendamentosRequest.i
1dProtocolo=this.idProtocolo,this.historicoAgendamentosRequest.labApoiado=this.usuarioLogado.username,this.historicoAgendamentosRequest.roleAtual=this.user.role,this.historicoAgendamentosService.getHistoricoAgendamentos(this.domain,this.historicoAgendamentosRequest).subscribe(o=>{this.stopLoading(),this.meusProtocolos=o.protocolos,this.meusAgendamentos=o.agendamentos})):this.modalAlertService.open("warning","Aten\xe7\xe3o","Campo CPF/Passaporte \xe9 obrigat\xf3rio na pesquisa","button")}catch(o){this.stopLoading(),this.verifyError(o),this.modalAlertService.open("error","Aten\xe7\xe3o",o,"button")}}showPreparoInformacoes(o){const i=new l.TIN;i.id=o.exameId,i.nome=o.nomeExame,this.modelFinished.exameAcId===i.id||"ATENDIMENTO DOMICILIAR"===i.nome||"ANALISES CL\xcdNICAS"===i.nome?this.selectedExamePreparoAcProtocoloId=o.protocoloId:this.selectedExamePreparo=i}hidePreparoInformacoes(){this.selectedExamePreparo=void 0,this.selectedExamePreparoAcProtocoloId=void 0}showExamesAnalisesClinicas(o){this.selectedExameAcProtocoloId=o}hideExamesAnalisesClinicas(){this.selectedExameAcProtocoloId=void 0}clear(){this.numCpf=void 0,this.dataInicial=void 0,this.dataFinal=void 0,this.historicoAgendamentosRequest.nome=void 0,this.historicoAgendamentosRequest.status=this.statusAgendamento[1],this.idProtocolo=void 0,this.statusAgendamento=this.statusAgendamentos[1],this.meusProtocolos=void 0,this.meusAgendamentos=void 0,T.G.removeItem("titular-dependente")}buscarUrlDocumento(o){this.startLoading(!1),this.meusAgendamentosService.buscarLinkPreparo(this.domain,o).subscribe(i=>{i&&(this.stopLoading(),window.open(i,"_blank"))},i=>{this.showPreparoInformacoes(o)})}goToPreviousStep(){this.router.navigateByUrl("/marcacao/home")}authenticate(o){this.startLoading(),this.accountService.setTitularDependentes(this.domain,o).subscribe(i=>{E.$.selectUser(i)},i=>{this.verifyError(i)})}getProntuario(o,i){this.registroService.getProntuario(this.numCpf,"",void 0,this.domain).subscribe(n=>{if(n){this.syncModelFinished();let a=new l.gjG;a.altura=n[0].altura,a.peso=n[0].peso,a.genero=n[0].genero,a.prontuarioId=n[0].id,a.name=n[0].nomeCompleto,a.username=n[0].numCpf,a.dataNascimento=n[0].dataNascimento,a.email=n[0].eMailPrincipal;let d=W.w.encryptKey(a);E.$.selectUser(d),this.mostraBulletsProcessoAgendamento=!1,this.router.navigate([i])}else this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o foi poss\xedvel localizar o prontu\xe1rio","button")})}getNome(o){return o.nomeSocial?o.nomeSocial.toUpperCase():o.nomePaciente.toUpperCase()}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-historico-agendamentos"]],features:[e.qOj],decls:60,vars:19,consts:[[1,"row","mt-3"],[1,"col-12","mt-0"],[1,"p-3"],[1,"row"],[1,"col-xl-3","col-lg-3","col-md-12","col-sm-12","pe-0"],[1,"p-fluid"],["for","modelNomeCompleto"],["id","modelNomeCompleto","name","modelNomeCompleto","type","text","maxlength","200","placeholder","Nome do Paciente","pInputText","",3,"ngModel","ngModelChange"],[1,"col-xl-3","col-lg-3","col-md-6","col-sm-12","pe-0"],["for","modelCpf",1,""],["type","text","id","modelCpf","name","modelCpf","placeholder","CPF/Passaporte","maxlength","11","pInputText","",3,"ngModel","ngModelChange","keydown"],["for","modelProtocolo"],["id","modelProtocolo","name","modelProtocolo","type","text","maxlength","200","placeholder","N\xfamero Protocolo","pInputText","",3,"ngModel","ngModelChange"],["optionLabel","label","id","statusAgendamento",3,"options","ngModel","ngModelChange"],["for","modelDataInicial"],["id","modelDataInicial","name","dataInicial","placeholder","Data inicial",3,"mask","ngModel","ngModelChange"],["for","modelDataFinal"],["id","modelDataFinal","name","dataFinal","placeholder","Data final",3,"mask","ngModel","ngModelChange"],[1,"col-xl-2","col-lg-2","col-md-6","col-sm-12","pe-0","text-end"],["for","modelPesquisar"],["id","modelPesquisar","type","button",1,"btn","btn-primary","w-100",3,"disabled","click"],[1,"fa","fa-search","me-2"],[1,"col-xl-2","col-lg-2","col-md-6","col-sm-12","text-end"],["for","modelLimpar"],["id","modelLimpar","type","button",1,"btn","btn-outline-primary","ms-3","w-100",3,"disabled","click"],["class","row",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary",3,"disabled","click"],[3,"value","protocoloId","onClose"],[3,"protocoloId","onClose"],[3,"value","onClose"],[1,"col-12","mt-0","mb-4","pb-6","p-fluid","text-end","text-sm-center1"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start"],[1,"col-md-10","col-sm-12"],[2,"line-height","5px"],["class","col-md-2 col-sm-12 text-end mt-0 pe-1",4,"ngIf"],[1,"col-md-2","col-sm-12","text-end","mt-0","pe-1"],[1,"col-12","p-fluid","text-end","mt-0"],[3,"id","styleClass",4,"ngFor","ngForOf"],[3,"id","styleClass"],[1,"col-xl-12","col-lg-12","col-sm-12","text-start","subtitle","d-block","pe-1-0","text-sm-center"],[1,"col-xl-12","col-lg-12","col-sm-12","text-start"],["href","javascript:void(0)",3,"click"],["class","fas fa-info-circle fa-lg",4,"ngIf"],[1,"col-xl-1","col-lg-2","col-sm-12","text-start","subtitle","d-block","pe-1-0","text-sm-center"],[1,"d-none","d-sm-block"],[1,"mt-0"],[4,"ngIf"],[1,"mt-1"],[1,"d-none","d-sm-block","fw-bold",3,"ngClass"],[1,"col-xl-9","col-lg-8","col-sm-12","text-start"],[1,"d-block","d-sm-none","fw-bold",3,"ngClass"],[1,"mt-0","d-block","d-sm-none"],[1,"title"],["class","text-warning",4,"ngIf"],["href","javascript:void(0)","class","hand-underline small",3,"disabled","click",4,"ngIf"],["href","javascript:void(0)","class","btn btn-outline-info me-1","title","Preparo",3,"click",4,"ngIf"],["href","javascript:void(0)","class","btn me-1","title","Termos",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)","class","btn me-1","title","Documentos",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)","class","btn m-1","title","Question\xe1rio",3,"ngClass","click",4,"ngIf"],[1,"fas","fa-info-circle","fa-lg"],[1,"text-align-left","fw-bold"],[1,"text-warning"],["href","javascript:void(0)",1,"hand-underline","small",3,"click"],["href","javascript:void(0)","title","Preparo",1,"btn","btn-outline-info","me-1",3,"click"],[1,"fa","fa-notes-medical","fa-lg"],["href","javascript:void(0)","title","Termos",1,"btn","me-1",3,"ngClass","click"],[1,"fas","fa-clipboard-check","fa-lg"],["href","javascript:void(0)","title","Documentos",1,"btn","me-1",3,"ngClass","click"],[1,"fas","fa-id-card","fa-lg"],["href","javascript:void(0)","title","Question\xe1rio",1,"btn","m-1",3,"ngClass","click"],[1,"fas","fa-list-alt","fa-lg"],[1,"col-12"],[1,"text-danger","small"],[1,"col-12","p-fluid","text-center"],["id","selectedAgendamento","styleClass","card-gray hand pt-0 pb-0 naoEncontrado"],[1,"col-12","text-center"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"fieldset",2)(3,"legend"),e._uU(4,"Procure por um agendamento"),e.qZA(),e.TgZ(5,"div",3)(6,"div",4)(7,"span",5)(8,"label",6),e._uU(9,"Nome do Paciente"),e.qZA(),e.TgZ(10,"input",7),e.NdJ("ngModelChange",function(a){return i.historicoAgendamentosRequest.nome=a}),e.qZA()()(),e.TgZ(11,"div",8)(12,"span",5)(13,"label",9),e._uU(14,"CPF/Passaporte"),e.qZA(),e.TgZ(15,"input",10),e.NdJ("ngModelChange",function(a){return i.numCpf=a})("keydown",function(a){return i.validarNumeros(a)}),e.qZA()()(),e.TgZ(16,"div",8)(17,"span",5)(18,"label",11),e._uU(19,"Protocolo"),e.qZA(),e.TgZ(20,"input",12),e.NdJ("ngModelChange",function(a){return i.idProtocolo=a}),e.qZA()()(),e.TgZ(21,"div",8)(22,"label",11),e._uU(23,"Status Agendamento"),e.qZA(),e._UZ(24,"br"),e.TgZ(25,"p-dropdown",13),e.NdJ("ngModelChange",function(a){return i.statusAgendamento=a}),e.qZA()()(),e.TgZ(26,"div",3)(27,"div",8)(28,"span",5)(29,"label",14),e._uU(30,"Data Inicial Agendamento"),e.qZA(),e.TgZ(31,"p-inputMask",15),e.NdJ("ngModelChange",function(a){return i.dataInicial=a}),e.qZA()()(),e.TgZ(32,"div",8)(33,"span",5)(34,"label",16),e._uU(35,"Data Final Agendamento"),e.qZA(),e.TgZ(36,"p-inputMask",17),e.NdJ("ngModelChange",function(a){return i.dataFinal=a}),e.qZA()()(),e.TgZ(37,"div",18)(38,"label",19),e._uU(39,"\xa0"),e.qZA(),e.TgZ(40,"button",20),e.NdJ("click",function(){return i.getHistoricoAgendamentos()}),e._UZ(41,"em",21),e._uU(42,"BUSCAR"),e.qZA()(),e.TgZ(43,"div",22)(44,"label",23),e._uU(45,"\xa0"),e.qZA(),e.TgZ(46,"button",24),e.NdJ("click",function(){return i.clear()}),e._uU(47,"LIMPAR"),e.qZA()()()(),e.YNc(48,jc,3,1,"div",25),e.YNc(49,Wc,5,0,"div",25),e.qZA(),e.TgZ(50,"div",26)(51,"div",27)(52,"div",28)(53,"div",29)(54,"button",30),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(55,"Voltar"),e.qZA()()()()(),e.TgZ(56,"app-preparo-informacao",31),e.NdJ("onClose",function(){return i.hidePreparoInformacoes()}),e.qZA(),e.TgZ(57,"app-exames-analises-clinicas",32),e.NdJ("onClose",function(){return i.hideExamesAnalisesClinicas()}),e.qZA(),e.TgZ(58,"app-unidade-informacao",33),e.NdJ("onClose",function(){return i.hideUnidadeInformacoes()}
1),e.qZA(),e.TgZ(59,"app-termo-ciencia-orientacao",33),e.NdJ("onClose",function(){return i.hideTermoCienciaOrientacao()}),e.qZA()()),2&o&&(e.xp6(10),e.Q6J("ngModel",i.historicoAgendamentosRequest.nome),e.xp6(5),e.Q6J("ngModel",i.numCpf),e.xp6(5),e.Q6J("ngModel",i.idProtocolo),e.xp6(5),e.Q6J("options",i.statusAgendamentos)("ngModel",i.statusAgendamento),e.xp6(6),e.Q6J("mask","99/99/9999")("ngModel",i.dataInicial),e.xp6(5),e.Q6J("mask","99/99/9999")("ngModel",i.dataFinal),e.xp6(4),e.Q6J("disabled",i.isLoading),e.xp6(6),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("ngIf",i.meusProtocolos&&i.meusProtocolos.length>0),e.xp6(1),e.Q6J("ngIf",i.meusProtocolos&&0==i.meusProtocolos.length),e.xp6(5),e.Q6J("disabled",i.isLoading),e.xp6(2),e.Q6J("value",i.selectedExamePreparo)("protocoloId",i.selectedExamePreparoAcProtocoloId),e.xp6(1),e.Q6J("protocoloId",i.selectedExameAcProtocoloId),e.xp6(1),e.Q6J("value",i.selectedInformacaoUnidadeId),e.xp6(1),e.Q6J("value",i.selectedTermoCienciaOrientacao))},dependencies:[h.mk,h.sg,h.O5,v.Fj,v.JJ,v.nD,v.On,H.o,Y.vy,se.Lt,y.Z,G,j,De,Fe],styles:["body .p-card.card-gray{min-height:auto!important}label{font-size:14px;color:#6c757d;left:14px}body .p-card{border:2px solid #22bc9f}.selecionado{background-color:#22bc9f!important;border:2px solid rgb(37,104,35)!important;transition:all .3s linear}.textCard{font-size:14px!important;color:#666!important}.selecionado *{color:#fff!important}.naoEncontrado{font-size:14px!important;border:2px #666 solid!important;color:#666!important}\n"],encapsulation:2}),t})(),el=(()=>{class t extends w.a{constructor(o){super(o),this.meusAgendamentosService=o.get(l.t0i),this.activatedRoute=o.get(b.gz)}ngOnInit(){this.load()}load(){let o;this.textoTela="Gerando Preparo....",this.startLoading(!1),o=new l.VtJ,this.activatedRoute.queryParams.subscribe(i=>{this.guid_protocolo=i.key}),this.meusAgendamentosService.buscarLinkPreparoPorGuid(this.guid_protocolo,this.domain).subscribe(i=>{i&&(this.stopLoading(),location.href=i)},i=>{this.textoTela="Documento de preparo n\xe3o encontrado!",this.verifyError(i)})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-gerar-preparo"]],features:[e._Bn([Z.YP]),e.qOj],decls:2,vars:1,template:function(o,i){1&o&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&o&&(e.xp6(1),e.Oqu(i.textoTela))}}),t})();var ol=g(2646),Ce=g(3608);function il(t,s){if(1&t&&(e.TgZ(0,"div",5),e._uU(1),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Oqu(o.mensagem)}}function tl(t,s){if(1&t&&(e.TgZ(0,"div",27),e._uU(1),e.qZA()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hij("\xe9 igual a ",o.sinonimia,"")}}function nl(t,s){if(1&t&&(e.TgZ(0,"div",25),e._uU(1),e.qZA(),e.YNc(2,tl,2,1,"div",26)),2&t){const o=s.$implicit;e.xp6(1),e.Oqu(o.nome),e.xp6(1),e.Q6J("ngIf",o.sinonimia)}}function al(t,s){1&t&&(e.TgZ(0,"div",41),e._uU(1," Consultando coberturas "),e._UZ(2,"em",42),e.qZA())}function sl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",43)(1,"a",44),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(2);return e.KtG(a.buscarPrecoExames(n))}),e._UZ(2,"em",45),e.qZA()()}}function dl(t,s){if(1&t&&(e.TgZ(0,"div",46)(1,"label",47),e._uU(2),e.qZA()()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(2),e.hij(" R$ ",i.getFormatCurrency(o.valor)," ")}}function rl(t,s){1&t&&(e.TgZ(0,"div",48)(1,"label",47),e._uU(2," Coberto pelo plano "),e.qZA()())}function cl(t,s){1&t&&(e.TgZ(0,"div",48)(1,"label",47),e._uU(2," Selecione o conv\xeanio e plano "),e.qZA()())}function ll(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",49)(1,"a",50),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(2);return e.KtG(a.removeExame(n))}),e._UZ(2,"em",51),e.qZA()()}}function ml(t,s){if(1&t&&(e.TgZ(0,"div",52),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.hij(" ",o.observacao," ")}}function _l(t,s){if(1&t&&(e.TgZ(0,"p-card",30)(1,"div",31)(2,"div",32),e._UZ(3,"em",33),e.qZA(),e.TgZ(4,"div",34),e._uU(5),e.qZA(),e.YNc(6,al,3,0,"div",35),e.YNc(7,sl,3,0,"div",36),e.YNc(8,dl,3,1,"div",37),e.YNc(9,rl,3,0,"div",38),e.YNc(10,cl,3,0,"div",38),e.YNc(11,ll,3,0,"div",39),e.qZA(),e.YNc(12,ml,2,1,"div",40),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.MGl("id","selectedExames",o.id,""),e.xp6(3),e.Q6J("ngClass",i.getClassIconExame(o.especialidade)),e.xp6(2),e.hij(" ",o.nome," "),e.xp6(1),e.Q6J("ngIf",!o.isLoaded&&!o.isError),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.isError),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.valor>0&&!o.isError),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&0===o.valor),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.valor<0),e.xp6(1),e.Q6J("ngIf",o.isLoaded),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.observacao)}}function pl(t,s){if(1&t&&(e.TgZ(0,"div",28),e.YNc(1,_l,13,10,"p-card",29),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.exameIntegrado)}}function ul(t,s){1&t&&(e.TgZ(0,"div",41),e._uU(1," Consultando coberturas "),e._UZ(2,"em",42),e.qZA())}function gl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",56)(1,"a",57),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(2);return e.KtG(a.buscarPrecoExames(n))}),e._UZ(2,"em",45),e.qZA()()}}function hl(t,s){if(1&t&&(e.TgZ(0,"div",48)(1,"div")(2,"label",47),e._uU(3),e.qZA()()()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(2);e.xp6(3),e.hij(" R$ ",i.getFormatCurrency(o.valor)," ")}}function fl(t,s){1&t&&(e.TgZ(0,"div",48)(1,"div")(2,"label",47),e._uU(3," Coberto pelo plano "),e.qZA()()())}function vl(t,s){1&t&&(e.TgZ(0,"div",48)(1,"div")(2,"label",47),e._uU(3," Selecione o conv\xeanio e plano "),e.qZA()()())}function xl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",49)(1,"a",50),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(2);return e.KtG(a.removeExameLaboratorial(n))}),e._UZ(2,"em",51),e.qZA()()}}function Cl(t,s){if(1&t&&(e.TgZ(0,"div",58),e._uU(1),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.hij(" ",o.observacao," ")}}function Al(t,s){if(1&t&&(e.TgZ(0,"p-card",30)(1,"div",31)(2,"div",32),e._UZ(3,"em",33),e.qZA(),e.TgZ(4,"div",53),e._uU(5),e.qZA(),e.YNc(6,ul,3,0,"div",35),e.YNc(7,gl,3,0,"div",54),e.YNc(8,hl,4,1,"div",38),e.YNc(9,fl,4,0,"div",38),e.YNc(10,vl,4,0,"div",38),e.YNc(11,xl,3,0,"div",39),e.qZA(),e.YNc(12,Cl,2,1,"div",55),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(2);e.MGl("id","selectedExames",o.id,""),e.xp6(3),e.Q6J("ngClass",i.getClassIconExame(o.especialidade)),e.xp6(2),e.hij(" ",o.nome," "),e.xp6(1),e.Q6J("ngIf",!o.isLoaded&&!o.isError),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.isError),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.valor>0&&!o.isError),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&0===o.valor),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.valor<0),e.xp6(1),e.Q6J("ngIf",o.isLoaded),e.xp6(1),e.Q6J("ngIf",o.isLoaded&&o.observacao)}}function bl(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,Al,13,10,"p-card",29),e.qZA()),2&t){const o=s.$implicit;e.xp6(1),e.Q6J("ngIf",!o.exameIntegrado)}}function Tl(t,s){if(1&t&&(e.TgZ(0,"p-card",59)(1,"div",60)(2,"div",61)(3,"small"),e._uU(4,"TOTAL A PAGAR:"),e.qZA(),e.TgZ(5,"span",62),e._uU(6),e.qZA()()()()),2&t){const o=e.oxw(2);e.xp6(6),e.hij("R$ ",o.getFormatCurrency(o.calcularTotalAPagar()),"")}}function Zl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",6)(1,"fieldset",7)(2,"legend"),e._uU(3,"Selecione os seus procedimentos"),e.qZA(),e.TgZ(4,"div",0)(5,"div",8)(6,"div",9),e.NdJ("onClear",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.selectedExame=null)}),e.TgZ(7,"p-autoComplete",10),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.selectedExame=n)})("completeMethod",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.getSuggestionsExames(n))})("onSelect",function(n){e.CHM(o);const a=e.oxw();return e.KtG(a.onSelectExame(n,-1))}),e.YNc(8,nl,3,2,"ng-template",11),e.qZA()()()(),e.TgZ(9,"div",0)(10,"div",12),e.YNc(11,pl,2,1,"div",13),e.YNc(12,bl,2,1,"div",14),e.qZA()(),e.YNc(13,Tl,7,1,"p-card",15),e.qZA(),e.TgZ(14,"div",16)(15,"div",17)(16,"div",18)(17,"div",19)(18,"button",20),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToPreviousStep())}),e._UZ(19,"span",21),e._uU(20," HOME "),e.qZA(),e.TgZ(21,"button",22),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToVisualizarPreparo())}),e._uU(22,"VISUALIZAR PREPARO"),e.qZA(),e.TgZ(23,"button",23),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToReceberPorEMail())}),e._uU(24,"RECEBER POR E-MAIL"),e.qZA(),e.TgZ(25,"button",24),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep())}),e._uU(26,"AGENDAR"),e.qZA()()()()()()}if(2&t){const o=e.oxw();e.xp6(7),e.Q6J("ngModel",o.selectedExame)("suggestions",o.fExames),e.xp6(4),e.Q6J("ngForOf",o.model.exames),e.xp6(1),e.Q6J("ngForOf",o.model.examesNaoAgendaveis),e.xp6(1),e.Q6J("ngIf",o.calcularTotalAPagar()>=0&&(o.model.exames&&o.model.exames.length>0||o.model.examesNaoAgendaveis&&o.model.examesNaoAgendaveis.length>0)),e.xp6(8),e.Q6J("disabled",o.isLoading),e.xp6(2),e.Q6J("disabled",o.isLoading),e.xp6(2),e.Q6J("disabled",o.isLoading)}}let El=(()=>{class t extends w.a{constructor(o,i){super(o),this.confirmationService=i,this.lat=0,this.long=0,this.lumiaAtiva=!1,this.marcacaoService=o.get(R.B),this.router=o.get(b.F0),this.route=o.get(b.gz),this.exameService=o.get(l.q07),this.hubSignalRService=o.get(ol.P),this.unidadeService=o.get(l.sc7),this.homeService=o.get(l.igG),this.marcacaoService=o.get(R.B),this.informacaoUnidadeService=o.get(l.muL),this.convenioPlanoService=o.get(l.xE1)}ngOnInit(){this.load()}load(){this.get()}success(o){const i=o.coords;this.lat=i.latitude,this.long=i.longitude,this.model.isAtivoGps=!0}error(o){console.warn("ERROR("+o.code+"): "+o.message)}get(){navigator.geolocation.getCurrentPosition(this.success.bind(this),this.error),this.activeStep=-1,this.authService.getSettings()?this.lumiaAtiva=this.getLumiaAtivado():E.$.loadedWeb
1SettingsObservable.subscribe(()=>{this.lumiaAtiva=this.getLumiaAtivado()}),this.startLoading(!0),this.marcacaoService.tipoTextoConvenioPlano="or\xe7ar",this.dtoBuscarPrecoExame=new l.m3b,(0,J.D)(this.exameService.getExameAcId(this.domain),this.exameService.getExames(this.domain),this.unidadeService.getUnidadeCD(this.domain),this.unidadeService.getUnidadeVacina(this.domain),this.homeService.getDataLayer(this.domain),this.informacaoUnidadeService.getInfoUnidades(this.domain),this.unidadeService.getTurnos(this.domain),this.convenioPlanoService.getConvenioParticular(this.domain),this.convenioPlanoService.getPlanoParticular(this.domain),this.convenioPlanoService.getConvenioFidelidade(this.domain),this.convenioPlanoService.getPlanoFidelidade(this.domain),this.convenioPlanoService.getConvenios(this.domain)).subscribe(o=>{this.stopLoading(),this.model.exameAcId=o[0],this.exames=o[1].filter(n=>n.id!==this.model.exameAcId),this.model.unidadeCD=o[2],this.model.unidadeVacina=o[3],this.model.dataLayer=this.model.dataLayer?this.model.dataLayer:o[4],this.unidades=o[5],this.model.turnos=o[6],this.model.convenioParticular=o[7],this.model.planoParticular=o[8],this.model.convenioFidelidade=o[9],this.model.planoFidelidade=o[10],this.marcacaoService.convenios=o[11];const i=new l.Otn;i.id=this.model.exameAcId,this.removeExame(i),this.model.convenio&&this.getPlanos(this.model.convenio.id),this.model.plano||(this.model.plano=new l.diK),this.atualizarConvenioPlano()},o=>{this.model.exames&&this.model.exames.length>0&&this.model.exames.forEach(i=>{i.isLoaded=!0,i.isError=!0}),this.model.examesNaoAgendaveis&&this.model.examesNaoAgendaveis.length>0&&this.model.examesNaoAgendaveis.forEach(i=>{i.isLoaded=!0,i.isError=!0}),this.verifyError(o)})}atualizarConvenioPlano(){this.marcacaoService.exibirHorarios&&(this.marcacaoService.convenios?(this.atualizarExibicaoHorarios(),this.eventChangeConvenioPlano||(this.eventChangeConvenioPlano=this.marcacaoService.eventChangeConvenioPlano.subscribe(o=>{this.sincronizarConvenioPlano(),this.atualizarExibicaoHorarios(),this.model.exames&&this.model.exames.length>0&&this.model.exames.forEach(i=>i.valor=-1),this.model.examesNaoAgendaveis&&this.model.examesNaoAgendaveis.length>0&&this.model.examesNaoAgendaveis.forEach(i=>i.valor=-1),this.marcacaoService.exibirHorarios&&this.atualizarConvenioPlano()})),this.marcacaoService.particular=this.model.particular,this.marcacaoService.convenio=this.model.convenio,this.marcacaoService.convenio&&!this.marcacaoService.planos&&this.getPlanos(this.marcacaoService.convenio.id),this.marcacaoService.plano=this.model.plano,this.marcacaoService.tipoConvenio=this.model.plano.id==this.model.planoParticular.id?1:""!==this.marcacaoService.nomeFidelidade&&void 0!==this.marcacaoService.nomeFidelidade&&this.model.plano.id==this.model.planoFidelidade.id?2:0,this.buscarPrecoExamesPelaModel()):this.convenioPlanoService.getConvenios(this.domain).subscribe(o=>{this.marcacaoService.convenios=o,this.atualizarConvenioPlano()},o=>this.verifyError(o)))}removeExame(o){this.model.exames&&this.model.exames.find(i=>i.id===o.id)&&(this.model.exames.splice(this.model.exames.findIndex(i=>i===o),1),o.coletaDomicilar&&this.model.examesDomiciliares.splice(this.model.examesDomiciliares.findIndex(i=>i===o),1),this.verificarAvisoDomiciliar(),this.syncModel())}verificarAvisoDomiciliar(){if(this.model.examesDomiciliares.length>0){const o=[];this.model.contemExameDomiciliar=!0,this.model.examesDomiciliares.forEac
1h(i=>{o.push(i.taxaId)}),this.model.contemExameDomiciliar=!(o.filter((i,n,a)=>a.indexOf(i)===n).length>1)}this.model.exames.length>0&&this.model.exames.forEach(o=>{this.model.contemExameDomiciliar=this.model.contemExameDomiciliar&&o.coletaDomicilar})}getSuggestionsExames(o){this.lumiaAtiva?this.exameService.getBuscaInteligenteExames(o.query,this.domain).subscribe(i=>{this.fExames=[],i.forEach(n=>{const a=this.exames.find(d=>d.id===n.id);a&&(a.sinonimia=n.sinonimia,this.fExames.push(a))})},()=>{this.lumiaAtiva=!1}):this.getSuggestions(o,"fExames","exames","nome","sinonimias")}verificaSeExibe(o){let i=!1;return o.forEach(n=>{n.exameIntegrado||(i=!0)}),i}getExamesNaoAgendaveisAg(){const o=this.model.exames.filter(a=>!1===a.agendavelAg),i=this.model.examesNaoAgendaveis.filter(a=>!1===a.agendavelAg);return o.concat(i).length>0}onSelectExame(o,i){if(!this.validarConvenioSelecionado())return;if(this.model.exames||(this.model.exames=[]),this.model.examesNaoAgendaveis||(this.model.examesNaoAgendaveis=[]),this.model.examesDomiciliares||(this.model.examesDomiciliares=[]),this.model.examesNaoPermitidos||(this.model.examesNaoPermitidos=[]),this.model.exames.find(d=>d.medico||d.preferenciaMedicoGenero))return this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o \xe9 poss\xedvel agendar mais de um exame quando h\xe1 escolha de m\xe9dico!","button"),this.clearExame(),!1;let a=this.model.exames.find(d=>d.id===o.id);if(a||(a=this.model.examesNaoAgendaveis.find(d=>d.id===o.id)),a||(a=this.model.examesNaoPermitidos.find(d=>d.id===o.id)),a)i<0?this.modalAlertService.open("warning","Aten\xe7\xe3o","Esse exame j\xe1 foi adicionado na lista abaixo!","button"):a.pedidoAtendimentoIntegracaoOperadoraId=i;else{const d=new l.TIN;d.init(o),d.particular=this.model.particular,d.cobertoPeloConvenio=!0,d.isLoaded=!1,o.agendavel?this.model.exames.push(d):this.model.examesNaoAgendaveis.push(d),o.coletaDomicilar&&this.model.examesDomiciliares.push(d),this.verificarAvisoDomiciliar()}this.buscarPrecoExames(o),this.syncModel(),this.clearExame()}getClassIconExame(o){return"VACINA"===o?"fas fa-syringe title-icon":"AN\xc1LISES CLINICAS"===o?"fas fa-vial title-icon":"fas fa-file-medical-alt title-icon"}clearExame(){this.selectedExame=null,this.setSubmitButtonFocus()}getTextoRemover(){return this.model.examesNaoAgendaveis.length>1?"Remover Todos":"Remover"}removeExamesLaboratoriais(){this.model.examesNaoAgendaveis.forEach(o=>{this.model.examesDomiciliares.splice(this.model.examesDomiciliares.findIndex(i=>i===o),1)}),this.model.examesNaoAgendaveis=this.model.examesNaoAgendaveis.filter(o=>o.exameIntegrado),this.syncModel()}removeExameLaboratorial(o){this.model.examesDomiciliares.splice(this.model.examesDomiciliares.findIndex(i=>i===o),1),this.model.examesNaoAgendaveis.splice(this.model.examesNaoAgendaveis.findIndex(i=>i===o),1),this.syncModel()}validarConvenioSelecionado(){if(void 0===this.marcacaoService.particular)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe se voc\xea possui Conv\xeanio (Sim ou N\xe3o) para continuar","button"),!1;if(""!==this.marcacaoService.nomeFidelidade&&void 0!==this.marcacaoService.nomeFidelidade){if(0===this.marcacaoService.tipoConvenio){if(!this.marcacaoService.convenio)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Conv\xeanio para continuar","button"),!1;if(!this.marcacaoService.plano)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Plano para continuar","button"),!1}}else if(!this.marcacaoService.particular){if(!this.marcacaoService.convenio)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Conv\xeanio para continuar","button"),!1;if(!this.marcacaoService.plano)return this.modalAlertService.open("warning","Aten\xe7\xe3o","Informe o Plano para continuar","button"),!1}return this.sincronizarConvenioPlano(),!0}goToVisualizarPreparo(){this.showPreparoInformacoes()}goToReceberPorEMail(){this.isLoggedIn()?this.confirmPreparoPorEmail():(this.eventCloseLogin=this.loginService.onClose.subscribe(o=>{this.isLoggedIn()&&this.confirmPreparoPorEmail()}),this.exibirPopupLogin())}goToNextStep(){this.model.exames&&!(this.model.exames.length<=0)||this.model.examesNaoAgendaveis&&!(this.model.examesNaoAgendaveis.length<=0)?this.goToAgenda():this.modalAlertService.open("warning","Aten\xe7\xe3o","Favor incluir exames para continuar com o agendamento","button")}hidePreparoInformacoes(){this.selectedExamePreparo=void 0}calcularTotalAPagar(){let o=0;return!this.model.exames||!this.model.examesNaoAgendaveis||this.model.exames.concat(this.model.examesNaoAgendaveis).forEac
1h(n=>{o+=n.valor}),o}goToPreviousStep(){this.router.navigate(["/marcacao/home"],{queryParamsHandling:"merge"})}goToAgenda(){this.startLoading();const o=new l.oaE;o.latitude=this.lat,o.longitude=this.long,o.exames=this.model.exames,o.examesAc=this.model.examesNaoAgendaveis,o.origemRequisicao="autoagendamento",this.unidadeService.getUnidadesProximas(!1,this.domain,o).subscribe(i=>{const n=[];for(let a=0;a<i.length;a++){const d=this.unidades.filter(r=>r.id===i[a].id);d[0].distancia=i[a].distancia,d[0].totalExamesCobertos=i[a].totalExamesCobertos,n.push(d[0])}this.model.unidades=n,this.stopLoading(),this.goToUnidade()},i=>{this.verifyError(i)})}goToUnidade(){this.model.unidadesSelecionadas=[],this.syncModel(),this.getDataLayer("exame","Exame | Unidade"),this.router.navigate(["/marcacao/unidade"])}buscarPrecoExamesPelaModel(){this.marcacaoService.exibirHorarios&&((void 0===this.model.plano||0===this.model.plano.id)&&(this.model.plano=this.marcacaoService.plano),this.model.exames&&this.model.exames.length>0&&this.model.exames.forEach(o=>{o.isLoaded=!1,o.isError=!1;const i=new l.Otn;i.id=o.id,i.nome=o.nome,i.especialidade=o.especialidade,i.idEspecialidade=o.idEspecialidade,this.buscarPrecoExames(i)}),this.model.examesNaoAgendaveis&&this.model.examesNaoAgendaveis.length>0&&this.model.examesNaoAgendaveis.forEach(o=>{o.isLoaded=!1,o.isError=!1;let i=new l.Otn;i.id=o.id,i.nome=o.nome,i.especialidade=o.especialidade,i.idEspecialidade=o.idEspecialidade,this.buscarPrecoExames(i)}))}buscarPrecoExames(o){this.dtoBuscarPrecoExame.convenio=new l.CGJ,this.dtoBuscarPrecoExame.convenio.id=this.marcacaoService.convenio.id,this.dtoBuscarPrecoExame.plano=new l.IfL,this.dtoBuscarPrecoExame.plano.id=this.marcacaoService.plano.id,this.dtoBuscarPrecoExame.plano.nome=this.marcacaoService.plano.nome;let i=new l.tn2;i.id=o.id,i.nome=o.nome,i.especialidadeId=o.idEspecialidade,i.especialidade=o.especialidade;const n=[];if(n.push(i),this.dtoBuscarPrecoExame.exames=n,this.model.exames&&this.model.exames.length>0&&this.model.exames.find(a=>a.id===o.id)){const a=this.model.exames.findIndex(d=>d.id===o.id);this.model.exames[a].isLoaded=!1,this.model.exames[a].isError=!1,this.model.exames[a].valor=0,this.model.exames[a].observacao=""}else{const a=this.model.examesNaoAgendaveis.findIndex(d=>d.id===o.id);this.model.examesNaoAgendaveis[a].isLoaded=!1,this.model.examesNaoAgendaveis[a].isError=!1,this.model.examesNaoAgendaveis[a].valor=0,this.model.examesNaoAgendaveis[a].observacao=""}this.exameService.getCalculosDePrecoExames(this.domain,this.dtoBuscarPrecoExame).subscribe(a=>{if(a){if(this.calculoPreco=a,this.model.exames&&this.model.exames.length>0&&this.model.exames.find(d=>d.id===a.exame.id)){const d=this.model.exames.findIndex(r=>
1r.id===a.exame.id);this.model.exames[d].valor=a.valor,this.model.exames[d].isLoaded=!0,this.model.exames[d].observacao=a.observacao}else if(this.model.examesNaoAgendaveis&&this.model.examesNaoAgendaveis.length>0){const d=this.model.examesNaoAgendaveis.findIndex(r=>r.id===a.exame.id);this.model.examesNaoAgendaveis[d].valor=a.valor,this.model.examesNaoAgendaveis[d].isLoaded=!0,this.model.examesNaoAgendaveis[d].observacao=a.observacao}}else this.model.exames.find(d=>d.id===o.id).isLoaded=!0;this.syncModel()},a=>{this.model.exames&&this.model.exames.length>0&&this.model.exames.find(d=>d.id===o.id)?(this.model.exames.find(d=>d.id===o.id).isError=!0,this.model.exames.find(d=>d.id===o.id).isLoaded=!0):this.model.examesNaoAgendaveis&&this.model.examesNaoAgendaveis.length>0&&(this.model.examesNaoAgendaveis.find(d=>d.id===o.id).isError=!0,this.model.examesNaoAgendaveis.find(d=>d.id===o.id).isLoaded=!0)})}showPreparoInformacoes(){if((!this.model.exames||this.model.exames.length<=0)&&(!this.model.examesNaoAgendaveis||this.model.examesNaoAgendaveis.length<=0))return void this.modalAlertService.open("warning","Aten\xe7\xe3o","Favor incluir exames para gera\xe7\xe3o do preparo","button");let o=[];const i=this.model.exames.concat(this.model.examesNaoAgendaveis);i&&i.length>0&&i.forEach(n=>{let a=new l.TIN;a.id=n.id,a.nome=n.nome,o.push(a)}),this.selectedExamePreparo=o}confirmPreparoPorEmail(){this.model.exames&&!(this.model.exames.length<=0)||this.model.examesNaoAgendaveis&&!(this.model.examesNaoAgendaveis.length<=0)?this.confirmationService.confirm({message:"O preparo ser\xe1 enviado para o e-mail "+this.user.usuarioSelecionado.email+" Deseja continuar?",header:"Confirma\xe7\xe3o",icon:"pi pi-exclamation-triangle",accept:()=>{this.goToEnviarPreparoPorEMail()}}):this.modalAlertService.open("warning","Aten\xe7\xe3o","Favor incluir exames para o envio do or\xe7amento por e-mail","button")}goToEnviarPreparoPorEMail(){this.startLoading(),this.model.enviarOrcamentoPorEmail=!0,this.exameMarcacaoService.postCriarOrcamento(this.domain,this.model).subscribe(o=>{this.stopLoading(),o&&(this.model.orcamento=o,this.modalAlertService.open("success","Sucesso","E-mail enviado com sucesso","button"))},o=>{this.verifyError(o)})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(Z.YP))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-orcamento"]],features:[e._Bn([Z.YP]),e.qOj],decls:5,vars:3,consts:[[1,"row"],["class","col-12",4,"ngIf"],["class","col-12 mt-md-0",4,"ngIf"],[3,"values","onClose"],["header","Confirmation","icon","pi pi-exclamation-triangle","acceptLabel","Sim","rejectLabel","N\xe3o"],[1,"col-12"],[1,"col-12","mt-md-0"],[1,"p-3","mt-4","mb-4"],[1,"col-12","p-fluid"],["autocompleteSearchIcon","(Vacina, Covid, Outros)",3,"onClear"],["id","modelSelecionarExame","name","exameSelecionarExame","field","nome","placeholder","Digite o nome do procedimento","emptyMessage","* Caso n\xe3o encontre o exame, entre em contato com a central de atendimento",1,"p-autocomplete",3,"ngModel","suggestions","ngModelChange","completeMethod","onSelect"],["pTemplate","item"],[1,"col-12","p-fluid","text-lg-right","text-md-right","text-sm-center1"],["class","p-0 m-0",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["id","1","styleClass","dark py-0",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-3"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end","inputs"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary","me-3","mb-sm-1",3,"click"],[1,"fas","fa-home"],["id","modelVisualizarPreparo","type","button",1,"btn","btn-primary","text-uppercase","me-3","mb-sm-1",3,"disabled","click"],["id","modelReceberPorEMail","type","button",1,"btn","btn-primary","text-uppercase","me-3","mb-sm-1",3,"disabled","click"],["id","modelAgendar","type","button",1,"btn","btn-primary","text-uppercase","mb-sm-1","me-sm-1",3,"disabled","click"],[2,"font-weight","bold"],["style","font-size: 10px",4,"ngIf"],[2,"font-size","10px"],[1,"p-0","m-0"],[3,"id",4,"ngIf"],[3,"id"],[1,"row","d-flex","align-items-center"],[1,"col-lg-1","col-md-1","col-sm-12","text-center","title","py-0"],[3,"ngClass"],[1,"col-lg-6","col-md-6","col-sm-12","text-lg-start","text-md-lg","text-sm-center1","title","py-0"],["class","col-xl-5 col-lg-5 col-md-2 col-sm-12 py-0",4,"ngIf"],["class","col-xl-4 col-lg-4 col-md-2 col-sm-12 text-end py-0",4,"ngIf"],["class","col-lg-4 col-md-4 col-sm-12 p-fluid text-sm-center1 text-lg-right al
1igin-center py-0",4,"ngIf"],["class","col-lg-4 col-md-4 col-sm-12 p-fluid text-sm-center1 text-lg-right py-0",4,"ngIf"],["class","col-lg-1 col-md-1 col-sm-12 text-end py-0",4,"ngIf"],["class","col-lg-12 col-md-12 col-sm-12 text-lg-right text-sm-center1 text-info py-0","style","font-size: 8pt; font-style: normal;",4,"ngIf"],[1,"col-xl-5","col-lg-5","col-md-2","col-sm-12","py-0"],[1,"pi","pi-spin","pi-spinner"],[1,"col-xl-4","col-lg-4","col-md-2","col-sm-12","text-end","py-0"],["href","javascript:void(0)","pTooltip","Ocorreu um erro ao consultar a cobertura. Clique aqui para tentar novamente.","tooltipPosition","top","title","Ocorreu um erro ao consultar a cobertura. Clique aqui para tentar novamente.",1,"btn","btn-lg","d-none","d-lg-inline-block","text-uppercase","text-danger",3,"click"],[1,"pi","pi-exclamation-circle","hand"],[1,"col-lg-4","col-md-4","col-sm-12","p-fluid","text-sm-center1","text-lg-right","aligin-center","py-0"],[1,"text-lg-right","text-md-lg","title"],[1,"col-lg-4","col-md-4","col-sm-12","p-fluid","text-sm-center1","text-lg-right","py-0"],[1,"col-lg-1","col-md-1","col-sm-12","text-end","py-0"],["href","javascript:void(0)",1,"btn","btn-md","text-info","d-none","d-lg-inline-block","text-uppercase",3,"click"],[1,"fas","fa-trash"],[1,"col-lg-12","col-md-12","col-sm-12","text-lg-right","text-sm-center1","text-info","py-0",2,"font-size","8pt","font-style","normal"],[1,"col-lg-6","col-md-6","col-sm-12","text-lg-left","text-md-lg","text-sm-center1","title","py-0"],["class","col-xl-4 col-lg-4 col-md-2 col-sm-12 text-sm-end",4,"ngIf"],["class","col-lg-12 col-md-12 col-sm-12 text-lg-right text-sm-center1 py-0 text-info","style","font-size: 8pt; font-style: normal;",4,"ngIf"],[1,"col-xl-4","col-lg-4","col-md-2","col-sm-12","text-sm-end"],["href","javascript:void(0)","pTooltip","Ocorreu um erro ao consultar a cobertura. Clique aqui para tentar novamente.","tooltipPosition","top","title","Ocorreu um erro ao consultar a cobertura. Clique aqui para tentar novamente.",1,"btn","btn-lg","d-none","d-lg-inline-block","text-uppercase",3,"click"],[1,"col-lg-12","col-md-12","col-sm-12","text-lg-right","text-sm-center1","py-0","text-info",2,"font-size","8pt","font-style","normal"],["id","1","styleClass","dark py-0"],[1,"row","py-0"],[1,"col-12","text-end","py-0"],[1,"fs-5","text-primary","ms-3"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0),e.YNc(1,il,2,1,"div",1),e.YNc(2,Zl,27,8,"div",2),e.qZA(),e.TgZ(3,"app-preparo-informacao",3),e.NdJ("onClose",function(){return i.hidePreparoInformacoes()}),e.qZA(),e._UZ(4,"p-confirmDialog",4)),2&o&&(e.xp6(1),e.Q6J("ngIf",!i.isLoaded),e.xp6(1),e.Q6J("ngIf",i.isLoaded),e.xp6(1),e.Q6J("values",i.selectedExamePreparo))},dependencies:[h.mk,h.sg,h.O5,$.j,v.JJ,v.On,Z.jx,L.Qc,y.Z,F.Q,Ce.u,j],encapsulation:2}),t})();var Il=g(9160),Ge=g(7913),Pl=g(5593);function wl(t,s){1&t&&(e.TgZ(0,"div",4)(1,"label")(2,"p",5),e._uU(3,"Buscando termos..."),e.qZA()()())}function Ml(t,s){1&t&&(e.TgZ(0,"div",16)(1,"label")(2,"p",17),e._UZ(3,"i",18),e.qZA()()())}function Ul(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",16)(1,"p-inputSwitch",19),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw().$implicit;return e.KtG(a.assinado=n)})("onChange",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(2);return e.KtG(a.assinar(n))}),e.qZA()()}if(2&t){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngModel",o.assinado)}}function Nl(t,s){if(1&t&&(e.TgZ(0,"div")(1,"p-card",8)(2,"div",4)(3,"div",9)(4,"div",10)(5,"a",11),e._UZ(6,"p-button",12),e.qZA()(),e.TgZ(7,"div",13)(8,"label")(9,"p",5),e._uU(10),e.qZA()(),e.TgZ(11,"p"),e._uU(12),e.qZA(),e.TgZ(13,"p")(14,"b"),e._uU(15),e.qZA()()(),e.TgZ(16,"div",14),e.YNc(17,Ml,4,0,"div",15),e.YNc(18,Ul,2,1,"div",15),e.qZA()()()()()),2&t){const o=s.$implicit,i=e.oxw(2);e.xp6(5),e.Q6J("href",i.EfetuarDonwload(o),e.LSH),e.xp6(5),e.Oqu(o.nome),e.xp6(2),e.Oqu(i.truncate(o.texto,750)),e.xp6(3),e.hij("Atualizado em: ",i.getFormatDateTime(o.dataAtualizacao),""),e.xp6(2),e.Q6J("ngIf",o.suporte),e.xp6(1),e.Q6J("ngIf",!o.suporte)}}function Sl(t,s){if(1&t&&(e.TgZ(0,"div",4)(1,"div",6),e.YNc(2,Nl,19,6,"div",7),e.qZA()()),2&t){const o=e.oxw();e.xp6(2),e.Q6J("ngForOf",o.termos)}}let yl=(()=>{class t extends w.a{constructor(o){super(o),this.carregando=!0,this.assinando=!1,this.termoService=o.get(l.Zfh),this.notificacoesService=o.get(Il.V)}ngOnInit(){this.activeStep=0,this.carregarTermos()}carregarTermos(){this.termoService.buscarTermosConsentimentoDPOAssinadosOuRevogados(this.domain).subscribe(o=>{this.carregando=!1,this.termos=o},o=>{this.verifyError(o)})}truncate(o,i){return o.length>i?o.substr(0,i-1)+"\u2026":o}assinar(o){o.suporte=!0,this.termoService.assinarOuRevogarTermo(this.domain,o).subscribe(i=>{i&&(o.id=i,o.suporte=!1,this.notificacoesService.syncNotificacoes(!0))},i=>{o.suporte=!1,o.assinado=!o.assinado,this.verifyError(i)})}EfetuarDonwload(o){return`${de.N.apiBaseUrl}/api/${this.domain}/Termo/EfetuarDownloadTermo?versaoTipoTermoConsentimento=${o.versaoTipoTermoConsentimento}&idTermo=${o.id}&${E.$.getJwTQueryToken()}`}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-privacidade"]],features:[e.qOj],decls:7,vars:2,consts:[[1,"row","mt-3"],[1,"col-12"],[1,"p-3","pt-0","mt-3"],["class","row",4,"ngIf"],[1,"row"],[1,"title","hand","bold"],[1,"col-12","p-fluid","text-end"],[4,"ngFor","ngForOf"],["styleClass","dark hand"],[1,"d-flex","flex-row","align-items-center","position-relative"],[1,"position-absolute","end-0","top-0","me-3"],["target","_blank",3,"href"],["icon","pi pi-download","styleClass","p-button-outlined","pTooltip","Download","tooltipPosition","bottom"],[1,"col-lg-11","col-md-10","text-start","px-3"],[1,"col-lg-1","col-md-2","text-start"],["class","row text-center",4,"ngIf"],[1,"row","text-center"],[1,"hand","bold","text-center"],[1,"pi","pi-spin","pi-spinner",2,"font-size","2rem"],[3,"ngModel","ngModelChange","onChange"]],template:function(o,i){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"fieldset",2)(3,"legend"),e._uU(4," Privacidade "),e.qZA(),e.YNc(5,wl,4,0,"div",3),e.YNc(6,Sl,3,1,"div",3),e.qZA()()()),2&o&&(e.xp6(5),e.Q6J("ngIf",i.carregando),e.xp6(1),e.Q6J("ngIf",!i.carregando))},dependencies:[h.sg,h.O5,v.JJ,v.On,y.Z,Ge.Ql,Pl.zx,Ce.u]}),t})();var me=g(2174);const ql=["accordion"],Jl=["accordionAC"],kl=["accordionAllTabsAC"],Dl=["accordionTab"],Fl=["accordionTabInner"];function Ol(t,s){if(1&t&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2),e.ALo(3,"date"),e.qZA()),2&t){const o=e.oxw(3).$implicit;e.xp6(2),e.hij(" ",e.xi3(3,1,o.unidadeData,"dd/MM/yyyy"),"")}}function Hl(t,s){if(1&t&&(e.TgZ(0,"span"),e._UZ(1,"i",30),e._uU(2),e.qZA()),2&t){const o=e.oxw(3).$implicit;e.xp6(2),e.hij(" ",o.unidadeHora,"")}}function Ql(t,s){if(1&t&&(e.TgZ(0,"span",33),e._uU(1),e.qZA()),2&t){const o=e.oxw(4).$implicit,i=e.oxw(3);
1e.xp6(1),e.hij("Valor: R$ ",i.getFormatCurrency(o.valorOriginal),"")}}function Ll(t,s){1&t&&e._UZ(0,"br")}function Rl(t,s){if(1&t&&(e.TgZ(0,"div"),e.YNc(1,Ql,2,1,"span",31),e.YNc(2,Ll,1,0,"br",15),e.TgZ(3,"span",32),e._uU(4),e.qZA()()),2&t){const o=e.oxw(3).$implicit,i=e.oxw(3);e.xp6(1),e.Q6J("ngIf",o.valorOriginal>o.valor),e.xp6(1),e.Q6J("ngIf",o.valorOriginal>o.valor),e.xp6(2),e.hij("Valor: R$ ",i.getFormatCurrency(o.valor),"")}}const Ae=function(t){return{"padding-top-10px":t}};function Yl(t,s){if(1&t&&(e.TgZ(0,"div",26)(1,"div",27),e._UZ(2,"i",28),e._uU(3),e.qZA(),e.TgZ(4,"div",27),e.YNc(5,Ol,4,4,"span",15),e.qZA(),e.TgZ(6,"div",27),e.YNc(7,Hl,3,1,"span",15),e.qZA(),e.YNc(8,Rl,5,3,"div",15),e.qZA()),2&t){const o=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngClass",e.VKq(7,Ae,o.valorOriginal>o.valor)),e.xp6(2),e.hij(" ",o.unidadeNome," "),e.xp6(1),e.Q6J("ngClass",e.VKq(9,Ae,o.valorOriginal>o.valor)),e.xp6(1),e.Q6J("ngIf",o.unidadeData),e.xp6(1),e.Q6J("ngClass",e.VKq(11,Ae,o.valorOriginal>o.valor)),e.xp6(1),e.Q6J("ngIf",o.unidadeHora),e.xp6(1),e.Q6J("ngIf",o.valor>0)}}function Gl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",21,22),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(3);return e.KtG(a.listarUnidades(n))}),e.TgZ(2,"div",23),e._UZ(3,"em",24),e._uU(4),e.qZA(),e.YNc(5,Yl,9,13,"div",25),e.qZA()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.xp6(3),e.Q6J("ngClass",i.getClassIconExame(o.especialidade)),e.xp6(1),e.hij(" ",o.nome," "),e.xp6(1),e.Q6J("ngIf",o.unidadeAtivaId>0)}}function Kl(t,s){1&t&&(e.TgZ(0,"small",44),e._uU(1," - Possibilidade de reembolso com o plano"),e.qZA())}function $l(t,s){if(1&t&&(e.TgZ(0,"div",42)(1,"small",32),e._uU(2),e.qZA(),e.YNc(3,Kl,2,0,"small",43),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(5);e.xp6(2),e.hij("Total R$ ",i.getFormatCurrency(o.total),""),e.xp6(1),e.Q6J("ngIf",!i.model.particular&&o.total>0&&void 0!==i.model.plano&&i.model.plano.id!==i.model.planoFidelidade.id)}}function Vl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",38,39),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(),a=n.$implicit,d=n.index,r=e.oxw(2).$implicit,c=e.oxw(3);return c.listarUnidadesAgenda(r,a,d),c.activeIndexAccordionID=d,r.unidadeAtivaId=a.id,e.KtG(r.unidadeAtiva.push(a))}),e.TgZ(2,"div")(3,"div",23),e._uU(4),e.qZA(),e.TgZ(5,"small",40),e._uU(6),e.qZA(),e.YNc(7,$l,4,2,"div",41),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(2).$implicit;e.Q6J("ngClass",i.unidadeAtivaId===o.id?"border border-bottom-0 border-info":"accordionExamesHeader"),e.xp6(4),e.hij(" ",o.nome," "),e.xp6(2),e.Oqu(o.endereco),e.xp6(1),e.Q6J("ngIf",o.total)}}function Bl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",54)(1,"div",55)(2,"em",56),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(7);return e.KtG(n.fecharCalendario())}),e.qZA(),e.TgZ(3,"p-calendar",57),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(4).$implicit;return e.KtG(a.unidadeData=n)})("onSelect",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(2).$implicit,d=e.oxw(3);return e.KtG(d.onSelectChangeData(a,n))}),e.qZA()()()}if(2&t){const o=e.oxw(4).$implicit,i=e.oxw(3);e.xp6(3),e.Q6J("ngModel",o.unidadeData)("inline",!0)("locale",i.locale)("minDate",i.today)("disabledDates",o.disabledDates)("disabled",i.isLoading)}}function zl(t,s){if(1&t&&(e.TgZ(0,"option",58),e._uU(1),e.qZA()),2&t){const o=s.$implicit;e.Q6J("value",o.value),e.xp6(1),e.Oqu(o.label)}}function jl(t,s){if(1&t&&(e.TgZ(0,"option",58),e._uU(1),e.qZA()),2&t){const o=s.$implicit;e.Q6J("value",o.horario),e.xp6(1),e.Oqu(o.horario)}}function Wl(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",27)(1,"div",45)(2,"div",46)(3,"label"),e._uU(4,"Selecione a data"),e.qZA(),e.TgZ(5,"div",47)(6,"input",48),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.showHideCalendario(n))}),e.ALo(7,"date"),e.qZA(),e.TgZ(8,"i",49),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.showHideCalendario(n))}),e.qZA(),e.YNc(9,Bl,4,6,"div",50),e.qZA()(),e.TgZ(10,"div",46)(11,"label"),e._uU(12,"Selecione o per\xedodo"),e.qZA(),e.TgZ(13,"div")(14,"select",51),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.periodoSelecionado=n)})("change",function(){e.CHM(o);const n=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.filtrarPeriodo(n))}),e.TgZ(15,"option",52),e._uU(16,"--selecione--"),e.qZA(),e.YNc(17,zl,2,2,"option",53),e.qZA()()(),e.TgZ(18,"div",46)(19,"label"),e._uU(20,"Selecione o hor\xe1rio"),e.qZA(),e.TgZ(21,"div")(22,"select",51),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(3).$implicit;return e.KtG(a.unidadeHora=n)})("change",function(){e.CHM(o);const n=e.oxw(3),a=n.$implicit,d=n.index,r=e.oxw(3);return e.KtG(r.onSelectChangeHour(a,d))}),e.TgZ(23,"option",52),e._uU(24,"--selecione--"),e.qZA(),e.YNc(25,jl,2,2,"option",53),e.qZA()()()()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(2).$implicit,n=e.oxw(3);e.Q6J("ngClass",i.unidadeAtivaId===o.id?"border border-top-0 border-info":""),e.xp6(6),e.Q6J("value",e.xi3(7,9,
1i.unidadeData,"yyyy-MM-dd")),e.xp6(3),e.Q6J("ngIf",i.unidadeCalendar&&i.unidadeAtivaId==o.id),e.xp6(5),e.Q6J("ngModel",i.periodoSelecionado)("disabled",""==i.unidadeData),e.xp6(3),e.Q6J("ngForOf",n.model.turnos),e.xp6(5),e.Q6J("ngModel",i.unidadeHora)("disabled",""===i.periodoSelecionado),e.xp6(3),e.Q6J("ngForOf",i.unidadeHorariosPeriodo)}}function Xl(t,s){if(1&t&&(e.TgZ(0,"p-accordionTab",36),e.YNc(1,Vl,8,4,"ng-template",37),e.YNc(2,Wl,26,12,"ng-template",20),e.qZA()),2&t){const o=s.$implicit,i=e.oxw(2).$implicit;e.Q6J("id",i.id+"-"+o.id)}}function em(t,s){if(1&t&&(e.TgZ(0,"p-accordion",34),e.YNc(1,Xl,3,1,"p-accordionTab",35),e.qZA()),2&t){const o=e.oxw().$implicit,i=e.oxw(3);e.Q6J("multiple",!1)("activeIndex",i.activeIndexAccordion),e.xp6(1),e.Q6J("ngForOf",o.unidades)}}function om(t,s){if(1&t&&(e.TgZ(0,"p-accordion",16,17)(3,"p-accordionTab",18),e.YNc(4,Gl,6,3,"ng-template",19),e.YNc(5,em,2,3,"ng-template",20),e.qZA()()),2&t){const o=s.$implicit;e.Q6J("multiple",!0)("activeIndex",o.accordionActive)}}function im(t,s){if(1&t&&(e.TgZ(0,"div",69),e._UZ(1,"i",28),e._uU(2),e.qZA()),2&t){const o=e.oxw(5);e.xp6(2),e.hij(" ",o.montaExameUnidadeAC.unidadeNomeAC," ")}}function tm(t,s){if(1&t&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2),e.ALo(3,"date"),e.qZA()),2&t){const o=e.oxw(5);e.xp6(2),e.hij(" ",e.xi3(3,1,o.unidadeDataAC,"dd/MM/yyyy"),"")}}function nm(t,s){if(1&t&&(e.TgZ(0,"span"),e._UZ(1,"i",30),e._uU(2),e.qZA()),2&t){const o=e.oxw(5);e.xp6(2),e.hij(" ",o.montaExameUnidadeAC.unidadeHorariosAC,"")}}function am(t,s){if(1&t&&(e.TgZ(0,"div",69)(1,"span",32),e._uU(2),e.qZA()()),2&t){const o=e.oxw(5);e.xp6(2),e.hij("Valor: R$ ",o.getFormatCurrency(o.montaExameUnidadeAC.totalAC),"")}}function sm(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",64,65),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(4);return e.KtG(n.listarUnidadesAC())}),e.TgZ(2,"div",66)(3,"div",23),e._UZ(4,"em",67),e._uU(5," AN\xc1LISES CL\xcdNICAS "),e.qZA()(),e.TgZ(6,"div",26),e.YNc(7,im,3,1,"div",68),e.TgZ(8,"div",69),e.YNc(9,tm,4,4,"span",15),e.qZA(),e.TgZ(10,"div",69),e.YNc(11,nm,3,1,"span",15),e.qZA(),e.YNc(12,am,3,1,"div",68),e.qZA()()}if(2&t){const o=e.oxw(4);e.xp6(7),e.Q6J("ngIf",o.montaExameUnidadeAC.unidadeAtivaIdAC),e.xp6(2),e.Q6J("ngIf",o.unidadeDataAC),e.xp6(2),e.Q6J("ngIf",o.montaExameUnidadeAC.unidadeHorariosAC),e.xp6(1),e.Q6J("ngIf",o.montaExameUnidadeAC.totalAC>0)}}function dm(t,s){1&t&&(e.TgZ(0,"small",44),e._uU(1," - Possibilidade de reembolso com o plano"),e.qZA())}function rm(t,s){if(1&t&&(e.TgZ(0,"div",42)(1,"small",32),e._uU(2),e.qZA(),e.YNc(3,dm,2,0,"small",43),e.qZA()),2&t){const o=e.oxw(2).$implicit,i=e.oxw(5);e.xp6(2),e.hij("Total R$ ",i.getFormatCurrency(o.total),""),e.xp6(1),e.Q6J("ngIf",!i.model.particular&&o.total>0&&i.model.plano.id!==i.model.planoFidelidade.id)}}function cm(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",38),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,a=e.oxw(5);return e.KtG(a.listarUnidadesAgendaAC(n))}),e.TgZ(1,"div")(2,"div",23),e._uU(3),e.qZA(),e.TgZ(4,"small",40),e._uU(5),e.qZA(),e.YNc(6,rm,4,2,"div",41),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ngClass",i.montaExameUnidadeAC.unidadeAtivaIdAC===o.id?"border border-bottom-0 border-info":"accordionExamesHeader"),e.xp6(3),e.Oqu(o.nome),e.xp6(2),e.Oqu(o.endereco),e.xp6(1),e.Q6J("ngIf",o.total)}}function lm(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",54)(1,"div",55)(2,"em",56),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(7);return e.KtG(n.fecharCalendario())}),e.qZA(),e.TgZ(3,"p-calendar",57),e.NdJ("ngModelChange",function(n){e.CHM(o);const a=e.oxw(7);return e.KtG(a.unidadeDataAC=n)})("onSelect",function(){e.CHM(o);const n=e.oxw(2).$implicit,a=e.oxw(5);return e.KtG(a.onSelectChangeData(null,n))}),e.qZA()()()}if(2&t){const o=e.oxw(7);e.xp6(3),e.Q6J("ngModel",o.unidadeDataAC)("inline",!0)("locale",o.locale)("minDate",o.today)("disabledDates",o.montaExameUnidadeAC.disabledDatesAC)("disabled",o.isLoading)}}function mm(t,s){1&t&&(e.TgZ(0,"label"),e._uU(1,"Comparecer na unidade"),e.qZA())}function _m(t,s){if(1&t&&(e.TgZ(0,"div",73),e._uU(1),e.qZA()),2&t){const o=e.oxw(7);e.xp6(1),e.hij(" ",o.montaExameUnidadeAC.unidadeHorariosAC," ")}}function pm(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",70)(1,"div",71)(2,"div",46)(3,"label"),e._uU(4,"Selecione a data"),e.qZA(),e.TgZ(5,"div",47)(6,"input",48),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(6);return e.KtG(n.displayCalendarioAC=!0)}),e.ALo(7,"date"),e.qZA(),e.TgZ(8,"i",49),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(6);return e.KtG(n.displayCalendarioAC=!0)}),e.qZA(),e.YNc(9,lm,4,6,"div",50),e.qZA()(),e.TgZ(10,"div",46),e.YNc(11,mm,2,0,"label",15),e.YNc(12,_m,2,1,"div",72),e.qZA(),e._UZ(13,"div",46),e.qZA()()}if(2&t){const o=e.oxw().$implicit,i=e.oxw(5);e.Q6J("ngClass",i.montaExameUnidadeAC.unidadeAtivaIdAC===o.id?"border border-top-0 border-info":"accordionExamesHeader"),e.xp6(6),e.Q6J("value",e.xi3(7,5,i.unidadeDataAC,"yyyy-MM-dd")),e.xp6(3),e.Q6J("ngIf",i.displayCalendarioAC),e.xp6(2),e.Q6J("ngIf",!i.isLoading&&i.montaExameUnidadeAC.unidadeHorariosAC),e.xp6(1),e.Q6J("ngIf",!i.isLoading&&i.montaExameUnidadeAC.unidadeHorariosAC)}}function um(t,s){1&t&&(e.TgZ(0,"p-accordionTab",36),e.YNc(1,cm,7,4,"ng-template",19),e.YNc(2,pm,14,8,"ng-template",20),e.qZA()),2&t&&e.Q6J("id","ac-"+s.$implicit.id)}function gm(t,s){if(1&t&&(e.TgZ(0,"p-accordion",34),e.YNc(1,um,3,1,"p-accordionTab",35),e.qZA()),2&t){const o=e.oxw(4);e.Q6J("multiple",!1)("activeIndex",o.activeIndexAccordion),e.xp6(1),e.Q6J("ngForOf",o.filterUnidadesAC)}}function hm(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"p-accordion",59)(1,"p-accordionTab",60),e.YNc(2,sm,13,4,"ng-template",61),e.TgZ(3,"div",62),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.modalExamesAC=!0)}),e._UZ(4,"i",63),e._uU(5,"Ver exames"),e.qZA(),e.YNc(6,gm,2,3,"ng-template",20),e.qZA()()}}function fm(t,s){if(1&t&&(e.TgZ(0,"div",23)(1,"div",76),e._UZ(2,"em",24),e._uU(3),e.qZA()()),2&t){const o=s.$implicit,i=e.oxw(4);e.xp6(2),e.Q6J("ngClass",i.getClassIconExame(o.especialidade)),e.xp6(1),e.hij("",o.nome," ")}}const vm=function(){return{width:"450px",overflow:"hidden"}};function xm(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"p-dialog",74),e.NdJ("visibleChange",function(n){e.CHM(o);const a=e.oxw(3);return e.KtG(a.modalExamesAC=n)}),e.TgZ(2,"div",7),e.YNc(3,fm,4,2,"div",75),e.qZA()()()}if(2&t){const o=e.oxw(3);e.xp6(1),e.Akn(e.DdM(8,vm)),e.Q6J("visible",o.modalExamesAC)("modal",!0)("responsive",!0)("baseZIndex",1e4)("closable",!0),e.xp6(2),e.Q6J("ngForOf",o.montaExameUnidadeAC)}}function Cm(t,s){if(1&t&&(e.TgZ(0,"div",9)(1,"fieldset",10)(2,"div",7)(3,"div",11),e._uU(4,"Selecione o local ou data mais pr\xf3xima para cada procedimento"),e.qZA()(),e.TgZ(5,"div",12),e.YNc(6,om,6,2,"p-accordion",13),e.YNc(7,hm,7,0,"p-accordion",14),e.YNc(8,xm,4,9,"div",15),e.qZA()()()),2&t){const o=e.oxw(2);e.xp6(6),e.Q6J("ngForOf",o.montaExameUnidade),e.xp6(1),e.Q6J("ngIf",o.montaExameUnidadeAC.length),e.xp6(1),e.Q6J("ngIf",o.modalExamesAC)}}function Am(t,s){if(1&t&&(e.TgZ(0,"div",7),e.YNc(1,Cm,9,3,"div",8),e.qZA()),2&t){const o=e.oxw();e.xp6(1),e.Q6J("ngIf",o.isLoaded)}}function bm(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"span",77),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.goToNextStep())}),e._uU(1,"Continuar"),e.qZA()}}let Tm=(()=>{class t extends w.a{get isExpanded(){return this._isExpanded}set isExpanded(o){this._isExpanded=o}constructor(o,i){super(o),this.configPrimeNg=i,this.today=new Date,this.filterUnidades=new Array,this.filterUnidadesAC=new Array,this.displayCalendario=!1,this.displayCalendarioAC=!1,this.activeIndexAc=-1,this.cepFiltroSelecionado=!1,this.qtdCarregamentoUnidades=4,this.modalExamesAC=!1,this.activeIndexExames=[],this.accordions=[],this._isExpanded=!1,i.setTranslation(this.locale),this.router=o.get(b.F0),this.authService=o.get(E.$),this.marcacaoService=o.get(R.B),this.unidadeService=o.get(l.sc7),this.informacaoUnidadeService=o.get(l.muL),this.exameService=o.get(l.q07)}ngOnInit(){this.startLoading(),this.changeStep(2),this.carregaConvenios(),this.carregaUnidades(),this.load(),this.setLoad()}setLoad(){this.filteredAgendaRespostas=[],this.montaExameUnidade=this.model.exames.filter(o=>o.id!==this.model.exameAcId),this.examesAC=this.model.examesNaoAgendaveis,this.montaExameUnidade.forEach(o=>{o.unidadeData="",o.unidadeHora=[],o.turnos=[],o.unidadeAtivaId=0,o.listaUnidadesId=[],o.unidadeCalendar=!1,o.periodoSelecionado="",o.unidadeHorariosPeriodo=[],o.unidadeHorarios=[],o.turno=[],o.unidadeAtiva=[],o.unidades=[],o.horarioSelecionado=[],o.valorOriginal=0,o.valor=0,o.grupoAgendaSelecionada=new l.ZWf}),this.montaExameUnidadeAC=this.model.examesNaoAgendaveis,this.montaExameUnidadeAC.unidadeNomeAC="",this.montaExameUnidadeAC.unidadeDataAC="",this.montaExameUnidadeAC.unidadeHoraAC="",this.montaExameUnidadeAC.unidadeAtivaIdAC=0,this.montaExameUnidadeAC.unidadeAtivaAC=[],this.montaExameUnidadeAC.unidadeCalendar=!1,this.montaExameUnidadeAC.unidadeHorariosAC="",this.montaExameUnidadeAC.disabledDatesAC=[],this.montaExameUnidadeAC.unidadesAC=[],this.montaExameUnidadeAC.horarioSelecionadoAC=[],this.montaExameUnidadeAC.totalAC=0,this.montaExameUnidadeAC.grupoAgendaSelecionada=new l.ZWf,this.montaExameUnidadeAC.examesAC=this.model.examesNaoAgendaveis}ngAfterViewInit(){}load(){this.model.reserva&&T.G.getItem(this.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL)&&1==T.G.getItem(this.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL)?this.goToNextStep():(this.syncModel(!1),this.get(),setTimeout(()=>{this.carregaPrimeiraTab()},1e3))}carregaPrimeiraTab(){this.accordionTab&&this.montaExameUnidade.length&&this.accordionTab.forEach((o,i)=>{0==i&&o.nativeElement.click()})}goToExames(){this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}
1verificaModelExamesUnidades(){this.model.exames.forEach((o,i)=>{if(null!=o.unidade){const n=this.montaExameUnidade.findIndex(d=>d.id===o.id);this.montaExameUnidade[n].unidadeAtivaId=o.unidade.id,this.montaExameUnidade[n].unidadeNome=o.unidade.nome,this.montaExameUnidade[n].unidadeData=o.data,this.montaExameUnidade[n].unidadeHora=o.horario;const a=this.getPeriodOfDay(o.data,o.horario);this.montaExameUnidade[n].periodoSelecionado=a}})}verificaModelExamesUnidadesAC(){this.model.examesNaoAgendaveis.forEach((o,i)=>{null!=o.unidade&&(this.montaExameUnidadeAC.unidadeAtivaIdAC=o.unidade.id,this.montaExameUnidadeAC.unidadeNomeAC=o.unidade.nome,this.unidadeDataAC=o.data,this.montaExameUnidadeAC.unidadeHoraAC=o.horario,this.montaExameUnidadeAC.unidadeHorariosAC=o.horario,this.montaExameUnidadeAC.unidadeAtivaAC=o.unidade)})}carregaUnidades(){this.informacaoUnidadeService.getInfoUnidades(this.domain).subscribe(o=>{this.getUnidades=o},o=>{this.startLoading(),this.verifyError(o)})}carregaConvenios(){this.convenioPlanoService.getConvenios(this.domain).subscribe(o=>{this.marcacaoService.convenios=o},o=>{this.verifyError(o)})}get(){this.marcacaoService.convenios?(this.eventChangeConvenioPlano||(this.eventChangeConvenioPlano=this.marcacaoService.eventChangeConvenioPlano.subscribe(o=>{this.sincronizarConvenioPlano(),this.atualizarExibicaoHorarios(),this.marcacaoService.exibirHorarios&&this.get(),this.fecharTodasAsAbasInit(),this.setLoad()})),this.marcacaoService.particular=this.model.particular,this.marcacaoService.convenio=this.model.convenio,this.marcacaoService.convenio&&!this.marcacaoService.planos&&this.getPlanos(this.marcacaoService.convenio.id),this.marcacaoService.plano=this.model.plano,this.marcacaoService.tipoConvenio=void 0!==this.model.plano&&this.model.plano.id==this.model.planoParticular.id?1:""!==this.marcacaoService.nomeFidelidade&&void 0!==this.marcacaoService.nomeFidelidade&&void 0!==this.model.plano&&this.model.plano.id==this.model.planoFidelidade.id?2:0,this.fecharTodasAsAbasInit(),this.setLoad()):this.convenioPlanoService.getConvenios(this.domain).subscribe(o=>{this.marcacaoService.convenios=o,this.get(),this.fecharTodasAsAbasInit(),this.setLoad()},o=>this.verifyError(o)),this.stopLoading()}listarUnidades(o=null){var i=this;this.startLoading();const n=this.montaExameUnidade.findIndex(a=>a.id===o.id);if(this.montaExameUnidade[n].unidades.length>0)o.itemAtivo=void 0,this.stopLoading();else{const a=[];this.filterUnidades=[];const d=[];this.getUnidades.forEach(m=>{var _,p;m.id!==(null===(_=this.model.unidadeCD)||void 0===_?void 0:_.id)&&m.id!==(null===(p=this.model.unidadeVacina)||void 0===p?void 0:p.id)&&d.push(m.id)});const c=this.dividirPostoEmGrupos(d,this.qtdCarregamentoUnidades).map(function(){var m=(0,U.Z)(function*(_){i.displayCalendario=!1,i.displayCalendarioAC=!1,i.montaExameUnidade.forEach(f=>{f.unidadeCalendar=!1});const p=new l.Pkf;p.dataAgenda=o.unidadeData,p.exames=[o],p.examesAc=[],p.listPostoId=_,p.convenioId=i.model.convenio.id,p.planoId=i.model.plano.id,p.origemRequisicao="autoagendamento",p.buscarAgendasApenasNoConvenio=!1,i.user&&i.user.backoffice&&i.user.labApoiado.convenioPadrao&&(p.buscarAgendasApenasNoConvenio=!0),(yield i.unidadeService.getSugestaoAgendamento(i.domain,p).toPromise()).respostas.forEach(f=>{if(f.temAgenda){a.push(f.unidade.id);const x=i.getUnidades.filter(A=>f.unidade.id===A.id).filter(A=>"ATENDIMENTO DOMICILIAR"!==A.nome);x.length&&x.forEach(A=>{A.total=f.total,A.carenciaDataMinima=f.carenciaDataMinima,i.filterUnidades.push(A)})}})});return function(_){return m.apply(this,arguments)}}());Promise.all(c).then(()=>{var m,_,p,u,f,C,x,A,P;this.montaExameUnidade[n].unidades=this.filterUnidades,this.montaExameUnidade[n].itemAtivo=null===(m=this.montaExameUnidade[n].itemAtivo)||void 0===m||m,this.montaExameUnidade[n].unidadeNome=null!==(_=this.montaExameUnidade[n].unidadeNome)&&void 0!==_?_:"",this.montaExameUnidade[n].unidadeData=null!==(p=this.montaExameUnidade[n].unidadeData)&&void 0!==p?p:"",this.montaExameUnidade[n].unidadeHora=null!==(u=this.montaExameUnidade[n].unidadeHora)&&void 0!==u?u:[],this.montaExameUnidade[n].unidadeAtivaId=null!==(f=this.montaExameUnidade[n].unidadeAtivaId)&&void 0!==f?f:0,this.montaExameUnidade[n].unidadeAtiva=null!==(C=this.montaExameUnidade[n].unidadeAtiva)&&void 0!==C?C:[],this.montaExameUnidade[n].unidadeCalendar=!1,this.montaExameUnidade[n].unidadeHorarios=null!==(x=this.montaExameUnidade[n].unidadeHorarios)&&void 0!==x?x:[],this.montaExameUnidade[n].unidadeHorariosPeriodo=null!==(A=this.montaExameUnidade[n].unidadeHorariosPeriodo)&&void 0!==A?A:[],this.montaExameUnidade[n].periodoSelecionado=null!==(P=this.montaExameUnidade[n].periodoSelecionado)&&void 0!==P?P:"",this.syncMontaExame(),this.stopLoading()}).catch(m=>{this.stopLoading(),this.verifyError(m)})}}listarUnidadesAC(){var o=this;if(this.startLoading(),this.displayCalendarioAC=!1,this.montaExameUnidadeAC.unidadesAC.length)this.montaExameUnidadeAC.itemAtivo=void 0,this.stopLoading();else{const i=[],n=[];
1this.getUnidades.forEach(r=>{var c,m;r.id!==this.model.unidadeCD.id&&r.id!==(null===(m=null===(c=this.model)||void 0===c?void 0:c.unidadeVacina)||void 0===m?void 0:m.id)&&n.push(r.id)});const d=this.dividirPostoEmGrupos(n,this.qtdCarregamentoUnidades).map(function(){var r=(0,U.Z)(function*(c){o.displayCalendarioAC=!1;const m=new l.Pkf;o.montaExameUnidadeAC.unidadeCalendarAC=!1,o.montaExameUnidadeAC.unidadeHoraAC="",o.montaExameUnidadeAC.periodoSelecionadoAC="",o.montaExameUnidadeAC.unidadeHorariosAC="";const _=new l.TIN;m.dataAgenda=null,_.id=o.model.exameAcId,_.nome="ANALISES CL\xcdNICAS",_.particular=o.model.examesNaoAgendaveis.filter(u=>u.particular).length>0,_.cobertoPeloConvenio=!(o.model.examesNaoAgendaveis.filter(u=>u.particular).length>0),_.planoId=_.particular?o.model.planoParticular.id:o.model.plano.id,m.examesAc=o.montaExameUnidadeAC,m.exames=[_],m.listPostoId=c,m.convenioId=o.model.convenio.id,m.planoId=o.model.plano.id,m.origemRequisicao="autoagendamento",m.buscarAgendasApenasNoConvenio=!1,m.unidadeCD=o.model.unidadeCD,m.unidadeVacina=o.model.unidadeVacina,o.user&&o.user.backoffice&&o.user.labApoiado.convenioPadrao&&(m.buscarAgendasApenasNoConvenio=!0),(yield o.unidadeService.getSugestaoAgendamento(o.domain,m).toPromise()).respostas.forEach(u=>{if(u.temAgenda){i.push(u.unidade.id);const C=o.getUnidades.filter(x=>u.unidade.id===x.id).filter(x=>"ATENDIMENTO DOMICILIAR"!==x.nome);C.length&&(C.forEach(x=>{x.total=u.total,o.filterUnidadesAC.push(x),o.montaExameUnidadeAC.unidadesAC.push(x)}),o.montaExameUnidadeAC.itemAtivoAC=!0)}})});return function(c){return r.apply(this,arguments)}}());Promise.all(d).then(()=>{this.syncMontaExame(),this.stopLoading()}).catch(r=>{this.stopLoading(),this.verifyError(r)})}}dividirPostoEmGrupos(o,i){const n=[];for(let a=0;a<o.length;a+=i)n.push(o.slice(a,a+i));return n}listarUnidadesAgenda(o,i,n){this.startLoading();const a=this.montaExameUnidade.findIndex(d=>d.id===o.id);o.unidadeAtivaId!==i.id&&(this.model.exames[a].unidade=i,this.limpaPreenchimentoUnidades(o)),this.activeIndexAccordion=o.id+"-"+i.id,this.montaExameUnidade[a].unidadeAtiva=[],this.montaExameUnidade[a].unidadeNome=i.nome,this.getDatasIndisponiveis(o,i)}limpaPreenchimentoUnidades(o){o.unidadeData="",o.periodoSelecionado="",o.unidadeHorariosPeriodo=[],o.unidadeHorarios=[],o.unidadeHora=""}listarUnidadesAgendaAC(o){this.startLoading(),this.displayCalendarioAC=!1,this.activeIndexAccordionAC="ac-"+o.id,this.montaExameUnidadeAC.unidadeAtivaIdAC!==o.id&&(this.model.examesNaoAgendaveis.forEach(i=>{i.unidade=o}),this.montaExameUnidadeAC.unidadeNomeAC=o.nome,this.montaExameUnidadeAC.unidadeAtivaIdAC=o.id,this.montaExameUnidadeAC.unidadeHorariosAC="",this.unidadeDataAC=null,this.montaExameUnidadeAC.totalAC=o.total,this.getDatasIndisponiveis(null,o))}getDatasIndisponiveis(o=null,i){const n=new l.Pkf;if(n.dataAgenda=new Date,null!=o)n.exames=[o],n.examesAc=[];else{const a=new l.TIN;a.id=this.model.exameAcId,a.nome="ANALISES CL\xcdNICAS",a.particular=this.model.examesNaoAgendaveis.filter(d=>d.particular).length>0,a.cobertoPeloConvenio=!(this.model.examesNaoAgendaveis.filter(d=>d.particular).length>0),a.planoId=a.particular?this.model.planoParticular.id:this.model.plano.id,n.examesAc=this.montaExameUnidadeAC,n.exames=[a]}n.listPostoId=[i.id],n.convenioId=this.model.convenio.id,n.planoId=this.model.plano.id,n.origemRequisicao="autoagendamento",this.unidadeService.getCalendarioDatasIndisponiveis(this.domain,n).subscribe(a=>{if(a)if(null!=o){const d=this.montaExameUnidade.findIndex(c=>c.id===o.id);this.montaExameUnidade[d].disabledDates=a;const r=this.gerarIntervaloCarencia(i.carenciaDataMinima);this.montaExameUnidade[d].disabledDates.push(...r)}else this.montaExameUnidadeAC.disabledDatesAC=a;this.stopLoading(),this.syncMontaExame()},a=>{this.stopLoading(),this.verifyError(a)})}gerarIntervaloCarencia(o){const i=[],n=new Date;for(;n<=o;)i.push(new Date(n)),n.setDate(n.getDate()+1);return i}onSelectChangeData(o=null,i){this.startLoading(),this.displayCalendario=!1,this.displayCalendarioAC=!1,this.montaExameUnidade.forEach(a=>{a.unidadeCalendar=!1});const n=new l.Pkf;if(null!=o){o.periodoSelecionado="",o.unidadeHorariosPeriodo=[],o.unidadeHorarios=[],o.unidadeHora="";const a=this.montaExameUnidade.findIndex(d=>d.id===o.id);this.model.exames[a].data=o.unidadeData,this.syncMontaExame(),n.dataAgenda=o.unidadeData,n.exames=[o],n.examesAc=[]}else{const a=new l.TIN;a.id=this.model.exameAcId,a.nome="ANALISES CL\xcdNICAS",a.particular=this.model.examesNaoAgendaveis.filter(d=>d.particular).length>0,a.cobertoPeloConvenio=!(this.model.examesNaoAgendaveis.filter(d=>d.particular).length>0),a.planoId=a.particular?this.model.planoParticular.id:this.model.plano.id,n.examesAc=this.model.examesNaoAgendaveis,n.exames=[a],n.unidadeCD=this.model.unidadeCD,n.unidadeVacina=this.model.unidadeVacina,this.model.examesNaoAgendaveis.forEach(d=>{d.data=this.unidadeDataAC,n.dataAgenda=this.unidadeDataAC}),this.montaExameUnidadeAC.unidadeDataAC=this.unidadeDataAC,this.montaExameUnidadeAC.unidadeHorariosAC=this.unidadeHorariosAC,this.syncMontaExame()}n.listPostoId=[i.id],n.convenioId=this.model.convenio.id,n.planoId=this.model.plano.id,n.origemRequisicao="autoagendamento",this.unidadeService.getSugestaoAgend
1amentoItem(this.domain,n).subscribe(a=>{if(a.respostas[0].grupoAgenda)if(null!=o){const d=this.montaExameUnidade.findIndex(r=>r.id===o.id);a.respostas[0].turno?(this.montaExameUnidade[d].turnos=[a.respostas[0].turno],this.montaExameUnidade[d].grupoAgendaSelecionada=a.respostas[0].grupoAgendaSelecionada):(this.montaExameUnidade[d].turnos=[],this.montaExameUnidade[d].unidadeCalendar=!1,this.montaExameUnidade[d].unidadeHora=[],this.montaExameUnidade[d].unidadeData="",this.montaExameUnidade[d].periodoSelecionado="",this.montaExameUnidade[d].unidadeHorariosPeriodo=[],this.montaExameUnidade[d].unidadeHorarios=[],this.modalAlertService.open("warning","Aten\xe7\xe3o","N\xe3o existem per\xedodos e hor\xe1rios para essa data!","button"));for(const r in a.respostas[0].grupoAgenda)this.montaExameUnidade[d].unidadeHorarios.push(a.respostas[0].grupoAgenda[r][0]),this.montaExameUnidade[d].unidadeHorariosPeriodo.push(a.respostas[0].grupoAgenda[r][0])}else this.montaExameUnidadeAC.unidadeHorariosAC=a.respostas[0].textoBotao,this.model.examesNaoAgendaveis.forEach(d=>{const r=a.respostas[0].examesAc.filter(c=>c.id===d.id);d.valor=r[0].valor,d.horario=a.respostas[0].textoBotao}),this.montaExameUnidadeAC.forEach(d=>{d.horario=a.respostas[0].textoBotao,d.grupoAgendaSelecionada=a.respostas[0].grupoAgendaSelecionada,this.syncMontaExame()}),this.fecharTodasAsAbasAC();this.stopLoading()},a=>{this.stopLoading(),this.verifyError(a)})}filtrarPeriodo(o){const i=this.montaExameUnidade.findIndex(n=>n.id===o.id);this.montaExameUnidade[i].unidadeHorariosPeriodo=[],this.montaExameUnidade[i].unidadeHorarios.forEach(n=>{this.getPeriodOfDay(this.montaExameUnidade[i].unidadeData,n.horario)===this.montaExameUnidade[i].periodoSelecionado&&this.montaExameUnidade[i].unidadeHorariosPeriodo.push(n)})}onSelectChangeHour(o,i){const n=this.montaExameUnidade.findIndex(d=>d.id===o.id);this.model.exames[n].horario=this.montaExameUnidade[n].unidadeHora,this.montaExameUnidade[n].horarioSelecionado=this.montaExameUnidade[n].unidadeHorarios.find(d=>d.horario===this.montaExameUnidade[n].unidadeHora),this.montaExameUnidade[n].valorOriginal=this.montaExameUnidade[n].horarioSelecionado.valorOriginal,this.montaExameUnidade[n].valor=this.montaExameUnidade[n].horarioSelecionado.valor;let a=new l.ZWf;a=this.montaExameUnidade[n].unidadeHorarios.find(d=>d.horario===this.montaExameUnidade[n].unidadeHora),this.montaExameUnidade[n].grupoAgendaSelecionada=a,this.syncMontaExame(),this.fecharTodasAsAbas(i)}fecharTodasAsAbas(o){this.accordionAllTabs.toArray().forEach(i=>
1{i.tabs.forEach((n,a)=>{n.selected=!1})}),this.abrirProximaAba(o)}fecharTodasAsAbasInit(){this.accordionAllTabs&&this.accordionAllTabs.toArray().forEach(o=>{o.tabs.forEach((i,n)=>{n!=this.activeIndexAccordionID&&(i.selected=!1)})})}abrirProximaAba(o){const i=o+1;this.accordionTab.toArray().length>=i+1?this.accordionTab.toArray()[i].nativeElement.click():this.accordionAllTabsAC&&this.accordionAllTabsAC.nativeElement.click()}fecharTodasAsAbasAC(){this.accordionAllTabsAC&&this.accordionAllTabsAC.nativeElement.click()}showHideCalendario(o){this.montaExameUnidade.forEach(n=>{n.unidadeCalendar=!1});const i=this.montaExameUnidade.findIndex(n=>n.id===o.id);this.montaExameUnidade[i].unidadeCalendar=!0}fecharCalendario(){this.montaExameUnidade.forEach(o=>{o.unidadeCalendar=!1}),this.displayCalendarioAC=!1}goToPreviousStep(){this.modelIndividual={exames:[],examesNaoAgendaveis:[]},this.syncClearModelIndividual(),this.model.reagendamento?(this.getDataLayer("unidade","Unidade | Meus-Agendamentos"),this.router.navigate(["/marcacao/meus-agendamentos"],{queryParamsHandling:"merge"}),this.startLoading()):(this.getDataLayer("unidade","Unidade | Exame"),this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"}),this.startLoading())}goToNextStep(){var o=this;return(0,U.Z)(function*(){var i,n;o.startLoading();let a=[];if(o.model.exames.length&&o.montaExameUnidade&&o.montaExameUnidade.length&&o.montaExameUnidade.forEach(c=>{(0===c.unidadeAtivaId||""===c.unidadeData||0===c.unidadeHora.length)&&a.push(1)}),o.model.examesNaoAgendaveis.length&&o.montaExameUnidadeAC&&(0===o.montaExameUnidadeAC.unidadeAtivaIdAC||""===o.unidadeDataAC.toString()||""===o.montaExameUnidadeAC.unidadeHorariosAC)&&a.push(1),a.length>0)return o.modalAlertService.open("warning","Aten\xe7\xe3o","Favor escolher a unidade, dia e hor\xe1rio em cada item da lista!","button"),void o.stopLoading();const d=new l.IDb;if(d.prontuarioId=null==o.user?0:o.user.usuarioSelecionado.prontuarioId,d.grupoAgendaRepetida=[],d.examesAc=o.model.examesNaoAgendaveis.length>0?o.geraReservaExamesAC():[],d.reservaSelecionada=o.model.exames.length>0?o.geraReservaExames():[],o.model.reagendamento&&(null===(n=null===(i=o.model)||void 0===i?void 0:i.protocolo)||void 0===n||n.agendamentos.forEach(c=>{let m=c.agendamentoId;d.reservaSelecionada.find(_=>_.exame.id===c.exameId).agendamentoId=m})),d.toJSON=function(){return d},o.model.reserva=d,o.syncModel(),!o.isLoggedIn())return T.G.setItem(o.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL,1),void o.exibirPopupLogin();if(!o.validarExames())return T.G.setItem(o.STORAGE_KEY_AGENDAMENTO_INDIVIDUAL,0),void o.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"});let r=yield o.verificarRestricaoQtdeExamePorEspecialidadeDia(d);r?(o.stopLoading(),o.modalAlertService.open("warning","Aten\xe7\xe3o",r,"button")):o.unidadeService.efetivarReservaAgendamento(o.domain,d).subscribe(c=>{c&&(d.reservaSelecionada=c,o.model.reserva=d,o.model.taxas=[],o.model.examesAgendados=[],c.forEach(m=>{const _=new l.sLM(o.getUnidades.filter(f=>f.id===m.postoId)),p=o.montaExameUnidade.filter(f=>f.id===m.exame.id&&f.unidadeHora===m.horario)[0],u=new l.TIN;u.id=m.exame.id,u.nome=m.exame.nome,u.data=m.dataBase,u.horario=m.horario,u.valor=m.valor,u.cobertoPeloConvenio=m.atendeEsseExame,u.unidade=_[0],u.ordemExecucao=m.ordemExameGrupoExame,u.exameNecessitaAutorizacao=m.exameNecessitaAutorizacao,u.responsavelAutorizacao=m.responsavelAutorizacao,u.particular=m.exame.particular,u.termoCienciaOrientacaoId=m.exame.termoCienciaOrientacaoId,u.urlTermo=m.exame.urlTermo,u.especialidade=m.exame.especialidade,u.valorOriginal=p?.valorOriginal,o.model.examesAgendados.push(u)}),o.model.examesNaoAgendaveis&&(o.model.examesNaoAgendaveis.forEach(m=>{if(d.examesAc){const _=d.examesAc.find(p=>p.id===m.id);_&&(m.horario=_.horario,m.valor=_.valor,m.cobertoPeloConvenio=_.cobertoPeloConvenio,m.particular=_.particular)}}),o.model.examesAgendados=o.model.examesAgendados.sort((m,_)=>m.ordemExecucao-_.ordemExecucao),o.model.agendaItemSaida=[]),o.syncModel(),o.modelFinished.protocoloIdSelected=void 0,o.syncModelFinished(),o.getDataLayer("unidade","Unidade | Documento"),o.router.navigate(["/marcacao/
1documento"],{queryParamsHandling:"merge"}),o.stopLoading())},c=>{o.verifyError(c)})})()}geraReservaExamesAC(){const o=[];return this.model.examesNaoAgendaveis.forEach((i,n)=>{const a=new l.TIN;a.id=i.id,a.nome=i.nome,a.particular=i.particular,a.especialidade=i.especialidade,a.valor=i.valor,o.push(a)}),o}geraReservaExames(){const o=[];let i=this.modelIndividual.exames;return null!=this.modelIndividual.examesNaoAgendaveis[0]&&(i=this.modelIndividual.exames.concat(this.modelIndividual.examesNaoAgendaveis[0])),i.forEach((n,a)=>{const d=new l.ZWf,r=new l.SiI;r.erro=void 0,r.valorExameParticular=n.calculoPreco.valorExameParticular,r.valorAnexoParticular=n.calculoPreco.valorAnexoParticular,r.valorExamePlano=n.calculoPreco.valorExamePlano,r.valorAnexoPlano=n.calculoPreco.valorAnexoPlano,r.idPosto=n.postoId,r.nomePosto=n.calculoPreco.nomePosto,r.idPlano=n.planoId,r.idConvenio=this.model.convenio.id,r.idExame=n.exame.id,r.porcentagemPacienteExame=n.calculoPreco.porcentagemPacienteExame,r.porcentagemAnexoPaciente=n.calculoPreco.porcentagemAnexoPaciente,r.responsavelAutorizacao=n.calculoPreco.responsavelAutorizacao,r.codigoAmb=n.calculoPreco.codigoAmb,r.codigoTabelaTiss=n.calculoPreco.codigoTabelaTiss,r.atendeEsseExame=n.calculoPreco.atendeEsseExame;const c=new l.TIN;if(c.id=n.exame.id,c.nome=n.exame.nome,c.particular=n.exame.particular,c.especialidade=n.exame.especialidade,d.agendaId=n.agendaId,d.atendeEsseExame=n.atendeEsseExame,d.calculoPreco=r,d.convenioId=this.model.convenio.id,d.dataBase=new Date(n.dataBase),d.diferenciado=n.diferenciado,d.exame=c,d.horario=n.horario,d.horarioId=n.horarioId,d.intervalo=n.intervalo,d.planoId=n.planoId,d.postoId=n.postoId,d.textoBotao=n.textoBotao,"AN\xc1LISES CLINICAS"==n.exame.especialidade){let m=0;this.model.examesNaoAgendaveis.forEach(_=>{m+=_.valor}),d.valor=m}else d.valor=n.valor;o.push(d)}),o}getClassIconExame(o){return"VACINA"===o?"fas fa-syringe title-icon":"AN\xc1LISES CLINICAS"===o?"fas fa-vial title-icon":"fas fa-file-medical-alt title-icon"}getPeriodOfDay(o,i){const n=this.getFormatDateYMD(o),d=new Date(n+"T"+i).getHours();return d>=6&&d<12?"m":d>=12&&d<18?"t":d>=18&&d<=23?"n":d>=0&&d<6?"d":void 0}syncMontaExame(){const o=[];this.montaExameUnidade.forEach((n,a)=>{o.push(n.grupoAgendaSelecionada)});const i=[];this.montaExameUnidadeAC.examesAC.forEach((n,a)=>{i.push(n.grupoAgendaSelecionada)}),this.modelIndividual={exames:o,examesNaoAgendaveis:i},super.syncModelIndividual(this.modelIndividual),super.syncModel()}verificarRestricaoQtdeExamePorEspecialidadeDia(o){var i=this;return(0,U.Z)(function*(){let n=[];i.montaExameUnidade?n=i.montaExameUnidade.concat(i.montaExameUnidadeAC):o.reservaSelecionada.forEach(a=>{let d={};d.especialidade=a.exame.especialidade,d.data=a.dataBase,n.push(d)});try{return yield i.marcacaoService.getRestricaoQtdeExamePorEspecialidadeDia(i.domain,n)}catch(a){i.verifyError(a)}})()}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3),e.Y36(Z.b4))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-exame-individual"]],viewQuery:function(o,i){if(1&o&&(e.Gf(ql,5),e.Gf(Jl,5),e.Gf(kl,5),e.Gf(Dl,5),e.Gf(Fl,5),e.Gf(me.UQ,5)),2&o){let n;e.iGM(n=e.CRH())&&(i.accordion=n.first),e.iGM(n=e.CRH())&&(i.accordionAC=n.first),e.iGM(n=e.CRH())&&(i.accordionAllTabsAC=n.first),e.iGM(n=e.CRH())&&(i.accordionTab=n),e.iGM(n=e.CRH())&&(i.accordionTabInner=n),e.iGM(n=e.CRH())&&(i.accordionAllTabs=n)}},features:[e.qOj],decls:8,vars:2,consts:[["class","row",4,"ngIf"],[1,"buttons-fixed-bottom","bg-white","py-2"],[1,"container"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","text-end"],["id","modelVoltar","type","button",1,"btn","btn-outline-primary",3,"click"],["class","btn btn-primary text-uppercase ms-3",3,"click",4,"ngIf"],[1,"row"],["class","col-12 mt-md-0 mt-3",4,"ngIf"],[1,"col-12","mt-md-0","mt-3"],[1,"p-3","accordionExames"],[1,"col-sm-12","col-md-8"],[1,"row","accordionExames"],["class","w-full mb-2","expandIcon","fa fa-chevron-circle-right text-info","collapseIcon","fa fa-chevron-circle-down text-info",3,"multiple","activeIndex",4,"ngFor","ngForOf"],["class","w-full mb-2","expandIcon","fa fa-chevron-circle-right text-info","collapseIcon","fa fa-chevron-circle-down text-info",4,"ngIf"],[4,"ngIf"],["expandIcon","fa fa-chevron-circle-right text-info","collapseIcon","fa fa-chevron-circle-down text-info",1,"w-full","mb-2",3,"multiple","activeIndex"],["accordion","","accordionAllTabs",""],["iconPos","end"],["pTemplate","header","class","accordionExamesHeader"],["pTemplate","content"],[1,"d-md-flex","w-100","align-items-center","justify-content-between","py-3",3,"click"],["accordionTab",""],[1,"vertical-align-middle","text-primary"],[1,"me-2",3,"ngClass"],["class","d-lg-flex gap-3 text-black-50 me-4 font14px",4,"ngIf"],[1,"d-lg-flex","gap-3","text-black-50","me-4","font14px"],[3,"ngClass"],[1,"fa","fa-map-marker-alt"],[1,"fa","fa-calendar-alt"],[1,"fas","fa-clock"],["class","texto-tachado-novo-fluxo",4,"ngIf"],[1,""],[1,"texto-tachado-novo-fluxo"],["expandIcon"," ","collapseIcon"," ",1,"w-full",3,"multiple","activeIndex"],["
1iconPos","end",3,"id",4,"ngFor","ngForOf"],["iconPos","end",3,"id"],["pTemplate","header","class","mt-3"],[1,"d-flex","w-100","align-items-center","gap-4","px-3","py-3",3,"ngClass","click"],["accordionTabInner",""],[1,"text-primary","fw-normal"],["class","fw-normal fs-6 text-dark",4,"ngIf"],[1,"fw-normal","fs-6","text-dark"],["class","ml-2",4,"ngIf"],[1,"ml-2"],[1,"d-flex","flex-column","flex-md-row","justify-content-between","gap-2","px-3","py-3"],[1,"w-100"],[1,"d-flex","align-items-center","w-100","position-relative"],["type","date","placeholder","Selecione a data","readonly","",1,"form-control",3,"value","click"],[1,"fa","fa-calendar-alt","position-absolute","hand","iconCalendar",3,"click"],["class","calendario text-start position-fixed z-index9",4,"ngIf"],[1,"form-control","form-select",3,"ngModel","disabled","ngModelChange","change"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"calendario","text-start","position-fixed","z-index9"],[1,"position-relative","d-flex","flex-column","gap-2"],[1,"fas","fa-times","fa-lg","text-white","d-flex","align-self-end","hand",3,"click"],[3,"ngModel","inline","locale","minDate","disabledDates","disabled","ngModelChange","onSelect"],[3,"value"],["expandIcon","fa fa-chevron-circle-right text-info","collapseIcon","fa fa-chevron-circle-down text-info",1,"w-full","mb-2"],["iconPos","end",1,"position-relative"],["pTemplate","header","class","accordionExamesHeader position-relative"],[1,"position-absolute","mostrarExamesAC","btn","btn-info",3,"click"],[1,"pi","pi-external-link","me-2"],[1,"d-md-flex","w-100","align-items-center","justify-content-between",3,"click"],["accordionAllTabsAC",""],[1,"d-md-flex","flex-column","flex-grow-1","py-3"],[1,"fas","fa-vial","title-icon","me-2"],["class","my-0 my-md-2",4,"ngIf"],[1,"my-0","my-md-2"],[1,"py-3","px-3",3,"ngClass"],[1,"d-flex","flex-column","flex-md-row","justify-content-between","gap-2"],["class","bg-info form-control text-center text-white rounded-1",4,"ngIf"],[1,"bg-info","form-control","text-center","text-white","rounded-1"],["header","Exames de An\xe1lises Cl\xednicas",3,"visible","modal","responsive","baseZIndex","closable","visibleChange"],["class","vertical-align-middle text-primary",4,"ngFor","ngForOf"],[1,"py-1"],[1,"btn","btn-primary","text-uppercase","ms-3",3,"click"]],template:function(o,i){1&o&&(e.YNc(0,Am,2,1,"div",0),e.TgZ(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"button",5),e.NdJ("click",function(){return i.goToPreviousStep()}),e._uU(6," Voltar "),e.qZA(),e.YNc(7,bm,2,0,"span",6),e.qZA()()()()),2&o&&(e.Q6J("ngIf",i.model.particular||!i.model.particular&&void 0!==i.model.plano),e.xp6(7),e.Q6J("ngIf",!i.isLoading))},dependencies:[h.mk,h.sg,h.O5,v.YN,v.Kr,v.EJ,v.JJ,v.On,Z.jx,V.f,k.V,me.UQ,me.US,h.uU],styles:["[_nghost-%COMP%] .accordionExames .p-accordion-toggle-icon-end{position:absolute;right:20px}[_nghost-%COMP%] .accordionExames .p-accordion-header .p-accordion-header-link{background-color:#f1f2f6!important;border-color:#dee2e6!important;padding-top:0!important;padding-bottom:0!important}[_nghost-%COMP%] .accordionExames .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}[_nghost-%COMP%] .p-accordion .p-accordion-content .p-accordion .p-accordion-header .p-accordion-header-link{padding:0}[_nghost-%COMP%] .p-accordion .p-accordion-content .p-accordion .p-accordion-content{padding:0}[_nghost-%COMP%] .p-accordion .p-accordion-content .p-accordion .p-accordion-tab{margin-bottom:8px!important}[_nghost-%COMP%] .iconCalendar{right:15px}.calendario[_ngcontent-%COMP%]{box-shadow:1px 1px 5px #333;background:#fff;width:100%;height:100%;top:0;left:0;background:rgba(0,0,0,.6);z-index:999999999!important;display:flex;justify-content:center;align-items:center;flex-direction:column}.p-datepicker[_ngcontent-%COMP%]{border:none!important}.mostrarExamesAC[_ngcontent-%COMP%]{top:10px;left:210px;z-index:999}@media (max-width: 768px){.accordionExames[_ngcontent-%COMP%]{padding-bottom:30px}.mostrarExamesAC[_ngcontent-%COMP%]{left:0;width:100%!important;top:100%}}"]}),t})(),Zm=(()=>{class t extends w.a{constructor(o){super(o),this.router=o.get(b.F0)}ngOnInit(){this.router.navigate(["/marcacao/exame"],{queryParamsHandling:"merge"})}}return t.\u0275fac=function(o){return new(o||t)(e.Y36(e.zs3))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-redirect"]],features:[e.qOj],decls:2,vars:0,template:function(o,i){1&o&&(e.TgZ(0,"p"),e._uU(1,"Redirecionando....."),e.qZA())}}),t})();var q=g(5299);let Em=(()=>{class t{}return t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({imports:[b.Bz.forChild([{path:"",component:xo,children:[{path:"redirect",component:Zm,canActivate:[le.a]},{path:"convenio-plano",component:We,canActivate:[N.T,q.Y]},{path:"exame",component:Pi,canActivate:[N.T]},{path:"preferencia-medico",component:Gi,canActivate:[N.T,q.Y]},{path:"unidade",component:Jn,canActivate:[N.T]},{path:"endereco",component:Wr,canActivate:[N.T,q.Y]},{path:"home",component:Jc,canActivate:[N.T,q.Y]}
1,{path:"questionario",component:Qi,canActivate:[le.a,q.Y]},{path:"resumo-agendamento",component:qa,canActivate:[le.a]},{path:"documento",component:$s,canActivate:[N.T],data:{permissions:[O.y.AGENDAMENTO,O.y.ADMIN]}},{path:"agendamento-concluido",component:td,canActivate:[le.a]},{path:"meus-agendamentos",component:kd,canActivate:[N.T,q.Y],data:{permissions:[O.y.AGENDAMENTO,O.y.ADMIN]}},{path:"meus-pagamentos",component:kr,canActivate:[N.T,q.Y],data:{permissions:[O.y.AGENDAMENTO,O.y.ADMIN]}},{path:"pagamento",component:lr,canActivate:[N.T,q.Y]},{path:"prontuario",component:ac,canActivate:[N.T,q.Y]},{path:"historico",component:Xc,canActivate:[N.T,q.Y]},{path:"gerar-preparo",component:el,canActivate:[N.T,q.Y]},{path:"orcamento",component:El,canActivate:[N.T,q.Y]},{path:"privacidade",component:yl,canActivate:[N.T,q.Y]},{path:"exame-individual",component:Tm,canActivate:[N.T,q.Y]}]}]),b.Bz]}),t})();var Im=g(1167);let Pm=(()=>{class t{}return t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({providers:[R.B,{provide:e.soG,useValue:"pt-BR"}],imports:[h.ez,Ke.A,v.u5,H.j,Y.zz,se.kW,L.WN,y.d,z.Qy,Im.KZ,Ge.Iu,oe.cc,V._8,k.S,he.Q,F.D,Se.Fm,re.nD,Ie.q,Me.zh,Em,ke.i,B.LU,Ce.z,Hd,He.L,me.fx,Re.Rq]}),t})()}}]);
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.