PageSourceSearch

https://app.stoqui.com.br/assets/PixListPage-CoujHxDc.js

js stoqui.com.br collected 2026-10-01 15:17:57 UTC 10,184 bytes, 1 lines download raw bytes

1import{j as e,a7 as s,ab as n,ao as z,T as r,N as j,ae as U,a9 as X,a2 as v,I as H,Q as A,X as J,ai as V,Z as Y,O as Z,aw as G}from"./mui-CRsYZxVY.js";import{r as y}from"./vendor-Dwao9eNC.js";import{u as ee,w,b as ie,e as te,r as se,bO as E,T as O,K as ae,dd as oe,de as re,df as ne,c4 as B,bJ as ce,O as de,b3 as le,aM as he,cR as xe,X as ue}from"./index-TALscxEc.js";import{d as ge}from"./Edit-BiqqVQWD.js";import{b as fe}from"./listaDeBancos-DVgYDDAw.js";import{d as _,P as $}from"./PixKeyListItem-tCdPzAqH.js";import{u as pe}from"./usePixKeys-CKz2VBnr.js";import{a as be,b as me}from"./query-8ViTdhdk.js";import{u as je}from"./usePaymentConfig-wna7msVS.js";import{u as ve}from"./useUpdateProviderPreference-CqMwIXec.js";import"./datePickers-BIJXYOKG.js";import"./icons-D8aatgQ4.js";import"./lab-DSem1Osk.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};o.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new o.Error().stack;i&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[i]="e8210439-6a6c-401a-a122-9273865eeb16",o._sentryDebugIdIdentifier="sentry-dbid-e8210439-6a6c-401a-a122-9273865eeb16")})()}catch{}const ye=()=>{const o=be(),{user:i}=ee(),c=i==null?void 0:i.id;return me({mutationFn:async({pixKeyId:x})=>{if(!c)throw new Error("User must be logged in to delete a Pix key.");const{data:d}=await w.from("configuracao_pagamento").select("chave_pix_checkout_id, provedor_pix").eq("user_id",c).single(),{error:a}=await w.from("chave_pix").delete().eq("id",x).eq("user_id",c);if(a)throw new Error(a.message);(d==null?void 0:d.chave_pix_checkout_id)===x&&await w.from("configuracao_pagamento").update({provedor_pix:null,chave_pix_checkout_id:null}).eq("user_id",c)},onSuccess:()=>{o.invalidateQueries({queryKey:["pixKeys"]}),o.invalidateQueries({queryKey:["paymentConfig"]})}})},k="#32BCAD",P="#2A9D8F",Ee=()=>{var W,T;const o=ie(),{data:i,isLoading:c,isError:x}=pe(),d=ye(),{data:a}=je(),l=ve(),{data:S}=te(),{triggerPaywall:M}=se(),[F,I]=y.useState(!1),[q,u]=y.useState(!1),[g,C]=y.useState(null),D=E(S,"pixChaveCheckout"),h=((W=a==null?void 0:a.providerPreferences)==null?void 0:W.pixProvider)==="pix"&&D,f=((T=a==null?void 0:a.providerPreferences)==null?void 0:T.chavePixCheckoutId)??null,L=(a==null?void 0:a.pixDiscount.enabled)??!1,Q=(a==null?void 0:a.pixDiscount.type)??"percentage",p=(a==null?void 0:a.pixDiscount.value)??0,K=()=>!L||p<=0?"Sem desconto":Q==="percentage"?`${p}%`:`R$ ${p.toFixed(2).replace(".",",")}`,N=async()=>{if(h)await l.mutateAsync({provedor_pix:null,chave_pix_checkout_id:null});else{if(!E(S,"pixChaveCheckout")){M("pix_checkout",{pageAction:()=>I(!0),source:"pix_list_toggle"});return}const t=i&&i.length>0?i[0].id:null;await l.mutateAsync({provedor_pix:"pix",chave_pix_checkout_id:t})}},R=async t=>{await l.mutateAsync({chave_pix_checkout_id:t})},b=i==null?void 0:i.find(t=>t.id===f);return c?e.jsxs(s,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(O,{title:"Pix",navigateBack:!0}),e.jsx(s,{sx:{flex:1,p:2},children:e.jsxs(n,{spacing:2,children:[e.jsx(z,{variant:"rectangular",height:200,sx:{borderRadius:2}}),e.jsx(z,{variant:"rectangular",height:80,sx:{borderRadius:2}})]})})]}):e.jsxs(s,{children:[e.jsx(O,{title:"Pix",navigateBack:!0}),e.jsx(s,{sx:{px:2,py:2,pb:10,display:"flex",flexDirection:"column"},children:x?e.jsx(ae,{primaryText:"Erro ao carregar as chaves Pix",secondaryText:"Por favor, tente novamente mais tarde."}):(i==null?void 0:i.length)===0?e.jsxs(e.Fragment,{children:[e.jsxs(s,{sx:{background:`linear-gradient(135deg, ${k} 0%, ${P} 100%)`,borderRadius:3,p:4,mb:3,color:"white",position:"relative",overflow:"hidden"},children:[e.jsxs(s,{sx:{position:"relative",zIndex:1},children:[e.jsx(_,{sx:{fontSize:48,mb:2}}),e.jsxs(r,{variant:"h5",fontWeight:700,gutterBottom:!0,children:["Receba Pix direto",e.jsx("br",{}),"na sua conta"]}),e.jsx(r,{variant:"body2",sx:{opacity:.95,mb:3,maxWidth:400},children:"Cadastre suas chaves Pix e receba pagamentos sem intermediários"}),e.jsxs(n,{spacing:1.5,children:[e.jsxs(n,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(s,{sx:{width:24,height:24,minWidth:24,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(oe,{style:{fontSize:14}})}),e.jsx(r,{variant:"body2",fontWeight:600,children:"Pix com chave no checkout"})]}),e.jsxs(n,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(s,{sx:{width:24,height:24,minWidth:24,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(re,{style:{fontSize:14}})}),e.jsx(r,{variant:"body2",fontWeight:600,children:"Sem taxas de intermediários"})]}),e.jsxs(n,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(s,{sx:{width:24,height:24,minWidth:24,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(ne,{style:{fontSize:14}})}),e.jsx(r,{variant:"body2",fontWeight:600,children:"Desconto Pix para seus clientes"})]})]})]}),e.jsx(s,{sx:{position:"absolute",top:-50,right:-50,width:200,height:200,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.1)"}}),e.jsx(s,{sx:{position:"absolute",bottom:-30,right:50,width:100,height:100,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.08)"}})]}),e.jsx(j,{variant:"contained",fullWidth:!0,startIcon:e.jsx(B,{}),onClick:()=>o("/profile/pix/create"),sx:{textTransform:"none",py:1.5,fontWeight:700,fontSize:"1rem",bgcolor:k,"&:hover":{bgcolor:P}},children:"Cadastrar chave Pix"})]}):i&&e.jsxs(e.Fragment,{children:[e.jsxs(s,{sx:{background:`linear-gradient(135deg, ${k} 0%, ${P} 100%)`,borderRadius:3,p:3,mb:3,color:"white",position:"relative",overflow:"hidden"},children:[e.jsxs(s,{sx:{position:"relative",zIndex:1},children:[e.jsx(_,{sx:{fontSize:48,mb:2}}),e.jsxs(n,{direction:"row",spacing:2,alignItems:"center",children:[e.jsx(s,{sx:{width:48,height:48,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ce,{sx:{fontSize:28}})}),e.jsxs(s,{sx:{flex:1},children:[e.jsx(r,{variant:"h6",fontWeight:700,children:"Pix configurado"}),e.jsxs(r,{variant:"body2",sx:{opacity:.9},children:[i.length," ",i.length===1?"chave cadastrada":"chaves cadastradas"]})]})]}),e.jsxs(n,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mt:2.5,py:1.5,px:2,bgcolor:"rgba(255,255,255,0.15)",borderRadius:2},children:[e.jsxs(n,{direction:"row",alignItems:"center",gap:.5,children:[e.jsx(r,{variant:"body2",fontWeight:600,children:"Usar no checkout"}),e.jsx(de,{variant:D?"cutout":"contained",fontSize:12})]}),e.jsx(U,{checked:h,onChange:N,disabled:l.isPending,sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"white"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{bgcolor:"rgba(255,255,255,0.3)"},"& .MuiSwitch-track":{bgcolor:"rgba(255,255,255,0.2)"}}})]})]}),e.jsx(s,{sx:{position:"absolute",top:-50,right:-50,width:200,height:200,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.1)"}}),e.jsx(s,{sx:{position:"absolute",bottom:-30,right:50,width:100,height:100,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.08)"}})]}),h&&e.jsx(X,{sx:{mb:3},children:e.jsx(s,{sx:{p:2},children:e.jsxs(n,{spacing:2,children:[e.jsx(le,{severity:"info",children:"Pagamentos com chave Pix não têm confirmação automática. O cliente verá um aviso para enviar o comprovante."}),e.jsx(v,{}),e.jsxs(n,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[e.jsx(n,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,flex:1},children:b?e.jsxs(e.Fragment,{children:[(()=>{const t=fe.find(m=>m.id===b.banco);return t?e.jsx("img",{src:t.logo,alt:t.nome,style:{width:24,height:24,flexShrink:0}}):e.jsx(_,{sx:{fontSize:24,color:"text.secondary",flexShrink:0}})})(),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(r,{variant:"body2",color:"text.secondary",children:"Chave selecionada"}),e.jsx(r,{variant:"body1",fontWeight:600,noWrap:!0,children:b.valor_chave})]})]}):e.jsxs(s,{children:[e.jsx(r,{variant:"body2",color:"text.secondary",children:"Chave selecionada"}),e.jsx(r,{variant:"body1",fontWeight:600,color:"error",children:"Nenhuma chave selecionada"})]})}),e.jsx(H,{onClick:()=>{C(f),u(!0)},size:"small",children:e.jsx(ge,{fontSize:"small"})})]}),e.jsx(v,{}
1),e.jsxs(n,{component:he,to:"/profile/checkout-settings",direction:"row",alignItems:"center",justifyContent:"space-between",sx:{textDecoration:"none",color:"inherit"},children:[e.jsxs(s,{children:[e.jsx(r,{variant:"body2",color:"text.secondary",children:"Desconto Pix"}),e.jsx(r,{variant:"body1",fontWeight:600,children:K()})]}),e.jsx(xe,{sx:{color:"action.active",fontSize:20}})]})]})})}),e.jsx(A,{children:i.map(t=>e.jsx($,{id:t.id,nome_recebedor:t.nome_recebedor,tipo_chave:t.tipo_chave,valor_chave:t.valor_chave,banco:t.banco,onDelete:m=>{d.mutateAsync({pixKeyId:m})},isCheckoutSelected:h&&f===t.id,onSetCheckout:h?R:void 0},t.id))})]})}),e.jsxs(J,{open:q,onClose:()=>u(!1),fullWidth:!0,maxWidth:"xs",children:[e.jsx(V,{children:"Chave para o checkout"}),e.jsx(v,{}),e.jsx(Y,{children:e.jsx(A,{children:i==null?void 0:i.map(t=>e.jsx($,{id:t.id,nome_recebedor:t.nome_recebedor,tipo_chave:t.tipo_chave,valor_chave:t.valor_chave,banco:t.banco,onClick:()=>C(t.id),isCheckoutSelected:g===t.id},t.id))})}),e.jsxs(Z,{children:[e.jsx(j,{onClick:()=>u(!1),children:"Cancelar"}),e.jsx(j,{variant:"contained",disabled:l.isPending||g===f,onClick:async()=>{g&&await R(g),u(!1)},children:"Salvar"})]})]}),e.jsx(ue,{open:F,onClose:()=>I(!1),title:"Recurso para assinantes",description:"Use suas chaves Pix diretamente no checkout da sua loja, sem intermediários.",planSuggestion:"pro"}),i&&i.length>0&&e.jsx(G,{color:"primary","aria-label":"add",sx:{position:"fixed",bottom:"calc(var(--safe-area-inset-bottom) + 16px)",right:16},onClick:()=>o("/profile/pix/create"),children:e.jsx(B,{})})]})};export{Ee as default};

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.