PageSourceSearch

https://infinitycrmsite.web.app/chunk-HISURDVU.js

js infinitycrmsite.web.app collected 2026-10-03 12:26:56 UTC 5,666 bytes, 1 lines download raw bytes

1import{a as j}from"./chunk-SCHTQL3N.js";import{a as q,c as A}from"./chunk-BPQ7TE4K.js";import{a as z}from"./chunk-FVZJUPOX.js";import{a as L}from"./chunk-RSZUR4UV.js";import"./chunk-NZV7SEZX.js";import"./chunk-6F63ZG7X.js";import"./chunk-PKZJNWAJ.js";import{l as E,o as N,t as F}from"./chunk-MH6BJ7X6.js";import"./chunk-T5JS72MM.js";import{$b as s,Bb as M,Dc as D,Ea as C,Fa as w,Fd as T,Hb as y,Pb as a,Rb as x,_b as r,ac as b,ec as I,fc as O,gc as u,nd as R,pd as S,qb as i,rb as h,sc as c,tc as g,uc as k}from"./chunk-APOSNKLN.js";import{h as V}from"./chunk-TWZW5B45.js";var G=V(z());A();var H=()=>({tab:"invoices"});function U(n,o){if(n&1){let e=I();r(0,"button",8),O("click",function(){C(e);let l=u();return w(l.downloadReceipt())}),c(1),s()}if(n&2){let e=u();a("disabled",e.downloading),i(),k(" ",e.downloading?"Generating PDF...":"Download Invoice"," ")}}function W(n,o){n&1&&(r(0,"a",9),c(1,"View Invoices"),s()),n&2&&a("queryParams",D(1,H))}function Y(n,o){if(n&1&&(r(0,"div",10),b(1,"app-invoice-preview",11),s()),n&2){let e=u();i(),a("invoice",e.invoiceToDownload)}}var B=class n{constructor(o,e){this.route=o;this.billingService=e}failed=!1;failureMessage="The payment could not be completed. Please try again.";invoiceId="";invoiceNumber="receipt";downloading=!1;invoiceToDownload=null;ngOnInit(){this.failed=this.route.snapshot.routeConfig?.path?.includes("failed")??!1,this.failureMessage=this.normalizeFailureMessage(this.route.snapshot.queryParamMap.get("reason")),this.invoiceId=this.route.snapshot.queryParamMap.get("invoice_id")||"",this.invoiceNumber=this.route.snapshot.queryParamMap.get("invoice_number")||this.invoiceNumber}downloadReceipt(){this.invoiceId&&(this.downloading=!0,this.billingService.getInvoice(this.invoiceId).subscribe({next:o=>{this.invoiceToDownload=o,setTimeout(()=>{let t=document.getElementById("hidden-pdf-sandbox")?.querySelector("article.invoice-paper");t?(0,G.default)(t,{scale:2,useCORS:!0,logging:!1,backgroundColor:"#ffffff"}).then(l=>{let P=l.toDataURL("image/png"),d=new q("p","mm","a4"),f=210,_=295,p=l.height*f/l.width,m=p,v=0;for(d.addImage(P,"PNG",0,v,f,p),m-=_;m>=0;)v=m-p,d.addPage(),d.addImage(P,"PNG",0,v,f,p),m-=_;d.save(`invoice-${o.invoice_number}.pdf`),this.downloading=!1,this.invoiceToDownload=null}).catch(l=>{console.error("Error generating PDF:",l),this.downloading=!1,this.invoiceToDownload=null,this.failureMessage="Payment succeeded, but the invoice PDF could not be generated."}):(this.downloading=!1,this.invoiceToDownload=null,this.failureMessage="Payment succeeded, but invoice preview rendering failed.")},150)},error:()=>{this.downloading=!1,this.failureMessage="Payment succeeded, but the invoice details could not be retrieved."}}))}normalizeFailureMessage(o){let e=String(o||"").trim();return e?e.includes("is not valid JSON")||e.startsWith("Unexpected token")?"Payment failed due to an invalid server response. Please retry once. If the issue continues, contact support.":e:this.failureMessage}static \u0275fac=function(e){return new(e||n)(h(E),h(L))};static \u0275cmp=M({type:n,selectors:[["app-payment-result"]],decls:13,vars:10,consts:[[1,"payment-result"],[1,"payment-result__panel"],[1,"pi",3,"ngClass"],[1,"payment-result__actions"],["type","button",3,"disabled","click",4,"ngIf"],["routerLink","/billing/manage-subscription",3,"queryParams",4,"ngIf"],[3,"routerLink"],["id","hidden-pdf-sandbox","style","position: absolute; left: -9999px; top: -9999px; width: 800px; background: white;",4,"ngIf"],["type","button",3,"click","disabled"],["routerLink","/billing/manage-subscription",3,"queryParams"],["id","hidden-pdf-sandbox",2,"position","absolute","left","-9999px","top","-9999px","width","800px","background","white"],[3,"invoice"]],template:function(e,t){e&1&&(r(0,"section",0)(1,"div",1),b(2,"i",2),r(3,"h1"),c(4),s(),r(5,"p"),c(6),s(),r(7,"div",3),y(8,U,2,2,"button",4)(9,W,2,2,"a",5),r(10,"a",6),c(11),s()()(),y(12,Y,2,1,"div",7),s()),e&2&&(x("payment-result--failed",t.failed),i(2),a("ngClass",t.failed?"pi-times-circle":"pi-check-circle"),i(2),g(t.failed?"Payment failed":"Payment successful"),i(2),g(t.failed?t.failureMessage:"Your subscription is active now. Your receipt is available in billing."),i(2),a("ngIf",!t.failed&&t.invoiceId),i(),a("ngIf",!t.failed),i(),a("routerLink",t.failed?"/billing/packages":"/home"),i(),g(t.failed?"Retry Payment":"Go to dashboard"),i(),a("ngIf",t.invoiceToDownload))},dependencies:[T,R,S,F,N,j],styles:[".payment-result[_ngcontent-%COMP%]{min-height:100vh;display:grid;place-items:center;padding:1.5rem;background:#f4f7fb}.payment-result__panel[_ngcontent-%COMP%]{width:min(480px,100%);display:grid;justify-items:center;gap:1rem;padding:2rem;border:1px solid #d8e0ea;border-radius:12px;background:#fff;text-align:center}.payment-result[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:2.5rem;color:#16a34a}.payment-result--failed[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#dc2626}.payment-result[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0;color:#172033}.payment-result[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;color:#64748b}.payment-result__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;flex-wrap:wrap;justify-content:center}.payment-result[_ngcontent-%COMP%]   a[_ngcontent-%COMP%], .payment-result[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{border:0;border-radius:999px;padding:.85rem 1.35rem;background:#3b82f6;color:#fff;font-weight:800;text-decoration:none;cursor:pointer}.payment-result[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{font:inherit}.payment-result[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:disabled{opacity:.7;cursor:wait}"]})};export{B as PaymentResultComponent};

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.