PageSourceSearch

https://app.zoppy.com.br/chunk-DJCIUKZQ.js

js zoppy.com.br collected 2026-10-08 00:41:31 UTC 2,844 bytes, 1 lines download raw bytes

1import{a as b}from"./chunk-4GP2BPJR.js";import{a as j}from"./chunk-5BT6VDTB.js";import{a as P}from"./chunk-UNTZTYVU.js";import"./chunk-277VYQ3G.js";import{a as x}from"./chunk-PPYMVQ4K.js";import{a as R}from"./chunk-ALF373LA.js";import"./chunk-53MXLG3J.js";import"./chunk-MQDYVSBZ.js";import"./chunk-MARJNDOE.js";import{k as p}from"./chunk-HLZC33O3.js";import{f as Y,h as c}from"./chunk-KE67Y5LU.js";import{Db as v,Eb as w,Fb as C,Ha as s,Wa as l,fb as u,ga as h,lb as g,ma as r,pd as V,sb as y,yb as S}from"./chunk-KA4KRCJ4.js";import{k as o}from"./chunk-5KTCK5IS.js";var I=(()=>{class i extends x{constructor(){super(r(V),r(c),r(p)),this.url=`${R.apiUrl}/api/yampi-key/redirect`,this.storage=r(p),this.codeVerifier=s(""),this.state=s("")}redirect(e,t,a){return o(this,null,function*(){return new Promise((E,L)=>{let n={},d=this.storage.getCodeVerifier(),f=this.storage.getState();d&&this.codeVerifier.set(d),f&&this.state.set(f),e&&(n.merchant=e),t&&(n.code=t),a&&(n.state=a);let T=new URLSearchParams(n).toString();this.post(`${this.url}?${T}`,{codeVerifier:this.codeVerifier(),state:this.state()}).subscribe({next:m=>{E(m)},error:m=>{L(m)}})})})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function $(i,k){i&1&&C(0,"static-loading",1),i&2&&y("isLoading",!0)}var X=(()=>{class i{constructor(){this.yampRedirectService=r(I),this.route=r(Y),this.router=r(c),this.toastService=r(b),this.loading=s(!0)}ngOnInit(){return o(this,null,function*(){try{yield this.handleYampiRedirect()}catch{this.resetYampiStorage(),this.showError("Erro ao integrar com Yampi")}finally{this.loading.set(!1)}})}handleYampiRedirect(){return o(this,null,function*(){let e=yield this.getQueryParams(),t=yield this.yampRedirectService.redirect(e.merchant,e.code,e.state);this.yampRedirectService.storage.setCodeVerifier(t.codeVerifier??""),this.yampRedirectService.storage.setState(t.state??""),t.successful&&(t.step===2?(this.showSuccess("Integra\xE7\xE3o com Yampi realizada com sucesso"),this.router.navigate([P.routes.integrations]),this.resetYampiStorage()):window.location.href=t.url)})}getQueryParams(){return new Promise(e=>{this.route.queryParams.subscribe(e)})}resetYampiStorage(){this.yampRedirectService.storage.deleteCodeVerifier(),this.yampRedirectService.storage.deleteState()}showError(e){this.toastService.error(e)}showSuccess(e){this.toastService.success(e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=u({type:i,selectors:[["app-yampi"]],decls:2,vars:1,consts:[[1,"w-full","h-screen","flex","justify-center","items-center"],[3,"isLoading"]],template:function(t,a){t&1&&(v(0,"div",0),g(1,$,1,1,"static-loading",1),w()),t&2&&(l(),S(a.loading()?1:-1))},dependencies:[j],encapsulation:2})}}return i})();export{X as YampiComponent};

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.