PageSourceSearch

https://dr-auau.web.app/chunk-2GQGKC6U.js

js dr-auau.web.app collected 2026-10-03 12:21:34 UTC 5,119 bytes, 1 lines download raw bytes

1import{a as j,b as R,c as $}from"./chunk-NDTFE2JH.js";import{Aa as T,Nb as U,Ob as X,Qb as A,Rb as q,k as V,m as F}from"./chunk-HW5L6WN7.js";import{$b as v,C as p,Db as _,Fa as u,Fb as E,Ga as g,Nb as x,Sb as r,Tb as a,Ub as P,Yb as f,bc as l,fb as I,h as y,kb as c,lc as d,ld as M,mc as k,nc as B,ra as s,tc as D,wa as w}from"./chunk-YZB547RT.js";function z(e,m){e&1&&P(0,"app-loading-spinner")}function L(e,m){if(e&1){let t=f();r(0,"p",3),d(1),a(),r(2,"button",4),v("click",function(){u(t);let n=l();return g(n.goAgenda())}),d(3," Voltar \xE0 agenda "),a()}if(e&2){let t=l();c(),k(t.errorMsg)}}function Q(e,m){if(e&1&&(r(0,"div",5),P(1,"img",7),a()),e&2){let t=l(2);c(),E("src",t.pixPaymentData.qrCode,I)}}function N(e,m){if(e&1){let t=f();r(0,"p",8),d(1),a(),r(2,"button",9),v("click",function(){u(t);let n=l(2);return g(n.copyCode())}),d(3," Copiar c\xF3digo PIX "),a()}if(e&2){let t=l(2);c(),B(" ",t.pixPaymentData.copyPaste," ")}}function G(e,m){if(e&1){let t=f();_(0,Q,2,1,"div",5)(1,N,4,1),r(2,"button",6),v("click",function(){u(t);let n=l();return g(n.goAgenda())}),d(3," Ir para minha agenda "),a()}if(e&2){let t=l();x(0,t.pixPaymentData.qrCode?0:-1),c(),x(1,t.pixPaymentData.copyPaste?1:-1)}}var se=(()=>{class e{constructor(){this.route=s(V),this.router=s(F),this.serviceService=s(T),this.stripeService=s(R),this.authService=s(A),this.snackBar=s(U),this.featureFlagsService=s($),this.loading=!0,this.errorMsg="",this.service=null,this.pixPaymentData=null}ngOnInit(){return y(this,null,function*(){if(!(yield p(this.featureFlagsService.pixEnabled$))){this.errorMsg="Pagamento via PIX est\xE1 temporariamente indispon\xEDvel. Entre em contato com o suporte.",this.loading=!1;return}let i=this.route.snapshot.paramMap.get("serviceId")||"",b=(yield p(this.authService.user$))?.uid;if(!i||!b){this.router.navigateByUrl("/buscar-profissionais");return}let o=yield this.serviceService.getServiceById(i);if(!o||o.customerId!==b){this.errorMsg="Atendimento n\xE3o encontrado ou voc\xEA n\xE3o tem permiss\xE3o.",this.loading=!1;return}if(o.slotSupersededByServiceId){this.snackBar.open("Este hor\xE1rio j\xE1 foi pago por outro pedido. O PIX n\xE3o \xE9 mais v\xE1lido. Selecione um novo hor\xE1rio com o veterin\xE1rio.",void 0,{duration:8e3}),this.router.navigateByUrl(o.providerId?`/buscar-profissionais/${o.providerId}`:"/buscar-profissionais"),this.loading=!1;return}if(o.status!=="pending"||o.paymentMethod!=="pix"||o.paymentStatus!=="pending"){this.snackBar.open("Este pagamento j\xE1 foi conclu\xEDdo ou n\xE3o est\xE1 pendente em PIX.",void 0,{duration:5e3}),this.router.navigateByUrl("/dashboard/agenda");return}this.service=o;let h=yield p(this.stripeService.checkPixPaymentReservation(i));if(!h?.ok){let S=h?.providerId||o.providerId||"",O=h?.reason?.trim()||"Este hor\xE1rio n\xE3o est\xE1 mais dispon\xEDvel. Escolha um novo hor\xE1rio com o veterin\xE1rio.";this.snackBar.open(O,void 0,{duration:7e3}),this.router.navigateByUrl(S?`/buscar-profissionais/${S}`:"/buscar-profissionais"),this.loading=!1;return}let C=yield p(this.stripeService.createPixPayment(o.providerId,i));if(!C?.providerPaymentId){this.errorMsg="N\xE3o foi poss\xEDvel gerar o PIX agora. Verifique se o veterin\xE1rio cadastrou a chave PIX ou tente mais tarde.",this.loading=!1;return}this.pixPaymentData={qrCode:C.qrCode??null,copyPaste:C.copyPaste??null},this.loading=!1})}copyCode(){return y(this,null,function*(){this.pixPaymentData?.copyPaste&&(yield navigator.clipboard.writeText(this.pixPaymentData.copyPaste),this.snackBar.open("C\xF3digo PIX copiado!",void 0,{duration:3e3}))})}goAgenda(){this.router.navigateByUrl("/dashboard/agenda")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=w({type:e,selectors:[["app-pagamento-consulta"]],standalone:!0,features:[D],decls:9,vars:1,consts:[[1,"mx-auto","max-w-lg","px-4","py-8"],[1,"mb-2","text-2xl","font-bold","text-primary-navyblue"],[1,"mb-6","text-sm","text-neutral-600"],[1,"text-sm","text-red-600"],["type","button",1,"mt-6","rounded-xl","bg-primary-pink","px-6","py-3","text-sm","font-semibold","text-white",3,"click"],[1,"mb-6","flex","justify-center"],["type","button",1,"w-full","rounded-xl","border","border-neutral-300","px-4","py-3","text-sm","font-medium","text-primary-navyblue",3,"click"],["alt","QR Code PIX",1,"h-56","w-56","rounded-lg","border","border-neutral-200","bg-white","object-contain","p-2",3,"src"],[1,"mb-4","break-all","rounded-lg","bg-neutral-100","p-3","text-xs","text-neutral-800"],["type","button",1,"mb-8","w-full","rounded-xl","bg-primary-pink","px-4","py-3","text-sm","font-semibold","text-white",3,"click"]],template:function(i,n){i&1&&(r(0,"app-default-outer-layout")(1,"div",0)(2,"h1",1),d(3," Finalizar pagamento PIX "),a(),r(4,"p",2),d(5," Use o QR Code ou o c\xF3digo copia e cola. Ap\xF3s o pagamento, a confirma\xE7\xE3o \xE9 autom\xE1tica. "),a(),_(6,z,1,0,"app-loading-spinner")(7,L,4,1)(8,G,4,2),a()()),i&2&&(c(6),x(6,n.loading?6:n.errorMsg?7:n.pixPaymentData&&(n.pixPaymentData.qrCode||n.pixPaymentData.copyPaste)?8:-1))},dependencies:[M,X,j,q]})}}return e})();export{se as PagamentoConsultaComponent};

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.