PageSourceSearch

https://www.instagem.ai/assets/CompleteCpf-DZWalyAC.js

js instagem.ai collected 2026-10-05 12:05:11 UTC 3,005 bytes, 1 lines download raw bytes

1import{b as v,d as N,E as _,u as b,s as C,r as o,j as e,C as w,g as y,h as E,k,l as S,z as F,I as P,a6 as L,c as R,o as T,S as z,n as I,cN as A,W as B,cO as p,ca as D,cP as q,cQ as H}from"./main-DX7XzkoU.js";import{R as M}from"./receipt-oRdhzA2v.js";function V(){const{t}=v(),[f]=N(),{toast:l}=_(),{user:i}=b(),u=C(f.get("redirect"))||"/dashboard",[n,x]=o.useState(""),[d,m]=o.useState(!1),[a,c]=o.useState(null),h=s=>{const r=A(s);x(r),a&&c(null)},j=()=>{const s=p(n);return s?s.length!==11?(c(t("complete_cpf.cpf_incomplete")),!1):H(s)?!0:(c(t("complete_cpf.cpf_invalid")),!1):(c(t("complete_cpf.cpf_required")),!1)},g=async()=>{if(j()&&i!=null&&i.email){m(!0);try{const{data:s,error:r}=await B.functions.invoke("update-subscriber-cpf",{body:{cpf:p(n)}});if(r)throw await D(r);if(s!=null&&s.error)throw new Error(s.error);l({title:t("complete_cpf.success_title"),description:t("complete_cpf.success_desc")}),window.location.href=u}catch(s){console.error("Error saving CPF:",s);const r=q(s)?s.message:t("complete_cpf.save_error");l({title:t("common.error"),description:r,variant:"destructive"})}finally{m(!1)}}};return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/30 flex items-center justify-center p-4",children:e.jsxs(w,{className:"w-full max-w-md",children:[e.jsxs(y,{className:"text-center space-y-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-r from-blue-500 to-indigo-500 mx-auto flex items-center justify-center",children:e.jsx(M,{className:"w-8 h-8 text-white"})}),e.jsxs("div",{children:[e.jsx(E,{className:"text-2xl",children:t("complete_cpf.title")}),e.jsx(k,{className:"mt-2",children:t("complete_cpf.description")})]})]}),e.jsxs(S,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{htmlFor:"cpf",className:"text-sm font-medium",children:[t("complete_cpf.cpf_label")," ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(P,{id:"cpf",type:"text",inputMode:"numeric",placeholder:"000.000.000-00",value:n,onChange:s=>h(s.target.value),className:`h-12 text-base ${a?"border-destructive focus-visible:ring-destructive":""}`,autoFocus:!0}),a&&e.jsxs("p",{className:"text-xs text-destructive flex items-center gap-1",children:[e.jsx(L,{className:"w-3 h-3"})," ",a]})]}),e.jsx(R,{onClick:g,disabled:d,className:"w-full h-12 text-base font-semibold",children:d?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"w-4 h-4 mr-2 animate-spin"}),t("common.saving")]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"w-4 h-4 mr-2"}),t("complete_cpf.save")]})}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[e.jsx(I,{className:"w-3 h-3 text-green-500"}),e.jsx("span",{children:t("complete_cpf.privacy_note")})]}),e.jsx("div",{className:"text-center",children:e.jsx("a",{href:"/support",className:"text-xs text-muted-foreground hover:text-primary underline",children:t("complete_cpf.support_link")})})]})]})})}export{V 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.