PageSourceSearch

https://www.postproai.app/assets/Profile-BG3_Huu_.js

js postproai.app collected 2026-09-30 06:40:21 UTC 28,156 bytes, 1 lines download raw bytes

1import{j as e}from"./framer-CaZKyxF5.js";import{r as a}from"./react-core-I1an5Yvj.js";import{L as De,b as ze,d as Ee}from"./router-hu0_X6IN.js";import{u as Me,A as Te}from"./AvatarPickerDialog-DHfWFPDi.js";import{s as c,S as ce,u as Ve}from"./index-CgQCMZLE.js";import{N as Be}from"./Navigation-DEd5xZwB.js";import{u as Re}from"./useVoiceFingerprint-BQ48stAV.js";import{V as Ie}from"./VoiceFingerprintShareCard-Dq9PSuZj.js";import{u as Fe}from"./useSubscription-CSyFxm_3.js";import{T as We,a as He,b as Oe,c as _}from"./tabs-z40ejBaU.js";import{m as de,g as me,A as Ge,n as qe,o as re,P as le,U as Ye,p as Ze,j as Xe,c as ie,X as ne,Z as Je}from"./lucide-DPOR83NI.js";import{u as Ke}from"./useCredits-B9xejI4m.js";import"./dialog-BmwAI8Rn.js";import"./Combination-DWOYKpRr.js";import"./supabase-LX2YIkpS.js";import"./query-C2oTuvQ4.js";import"./index-CCpchn4D.js";import"./productFacts-D2ONJNuD.js";function Qe({userId:o}){const[s,u]=a.useState([]),[b,r]=a.useState(!0);if(a.useEffect(()=>{o&&c.from("payments").select("id, amount, currency, payment_method, status, subscription_tier, created_at, provider, transaction_id").eq("user_id",o).order("created_at",{ascending:!1}).limit(20).then(({data:l})=>{u(l||[]),r(!1)})},[o]),b)return e.jsx("div",{className:"space-y-2",children:[0,1,2].map(l=>e.jsx(ce,{className:"h-14 rounded-xl"},l))});if(s.length===0)return e.jsxs("div",{className:"text-center py-10 rounded-xl border border-dashed border-slate-200 bg-slate-50/50",children:[e.jsx(de,{className:"w-6 h-6 text-slate-400 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No payments yet."}),e.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Your invoices will appear here once you upgrade."})]});const f=l=>{const i=l.toLowerCase();return i.includes("succe")||i==="paid"||i==="completed"?"bg-emerald-50 border-emerald-200 text-emerald-700":i.includes("fail")||i.includes("reject")?"bg-rose-50 border-rose-200 text-rose-700":i.includes("pend")?"bg-amber-50 border-amber-200 text-amber-700":"bg-slate-50 border-slate-200 text-slate-600"};return e.jsxs("div",{className:"rounded-xl border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"hidden sm:grid grid-cols-[1fr_120px_120px_120px_100px] gap-4 px-4 py-2.5 bg-slate-50 border-b border-slate-200 text-[11px] font-bold uppercase tracking-wider text-slate-500",children:[e.jsx("span",{children:"Date"}),e.jsx("span",{children:"Plan"}),e.jsx("span",{children:"Method"}),e.jsx("span",{children:"Amount"}),e.jsx("span",{children:"Status"})]}),e.jsx("div",{className:"divide-y divide-slate-100",children:s.map(l=>e.jsxs("div",{className:"grid sm:grid-cols-[1fr_120px_120px_120px_100px] gap-2 sm:gap-4 px-4 py-3 hover:bg-slate-50/50 transition-colors text-sm",children:[e.jsxs("div",{className:"text-slate-700",children:[new Date(l.created_at).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),l.transaction_id&&e.jsxs("div",{className:"text-[11px] text-slate-400 truncate mt-0.5 inline-flex items-center gap-1",children:[e.jsx(me,{className:"w-3 h-3"}),l.transaction_id.slice(0,18)]})]}),e.jsx("div",{className:"text-slate-600 capitalize",children:l.subscription_tier||" - "}),e.jsx("div",{className:"text-slate-600 capitalize",children:l.provider||l.payment_method||" - "}),e.jsxs("div",{className:"font-semibold text-slate-900 tabular-nums",children:[(l.currency||"USD").toUpperCase()," ",Number(l.amount).toFixed(2)]}),e.jsx("div",{children:e.jsx("span",{className:`inline-block rounded-full px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider border ${f(l.status)}`,children:l.status})})]},l.id))})]})}const et={generate_post:"Post generated",enhance_post:"Post enhanced",refine_post:"Post refined",generate_hashtags:"Hashtag pack",research_post:"Post research",voice_fingerprint:"Voice analysis",profile_optimize:"Profile optimized",signup_grant:"Welcome credits",monthly_grant:"Monthly refill",streak_reward:"Streak reward"};function tt({userId:o}){const{wallet:s,history:u,balance:b,allowance:r,loading:f}=Ke(o);if(f||!o)return null;const l=r>0?Math.min(100,Math.round(b/r*100)):0;return e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-6 sm:p-7",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-blue-600",children:"Credits"}),e.jsx("p",{className:"mt-2 text-4xl font-semibold tabular-nums text-slate-900",children:b.toLocaleStr
1ing()}),e.jsx("p",{className:"mt-1 text-sm text-slate-500",children:r>0?`of ${r.toLocaleString()} monthly${s?.rollover_enabled?" · rolls over":""}`:"Starter credits - upgrade for a monthly refill"})]}),r===0&&e.jsxs(De,{to:"/pricing",className:"inline-flex items-center gap-1.5 rounded-lg bg-slate-900 px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-slate-800",children:["Upgrade ",e.jsx(Ge,{className:"h-4 w-4"})]})]}),r>0&&e.jsx("div",{className:"mt-5 h-1.5 w-full overflow-hidden rounded-full bg-slate-100",children:e.jsx("div",{className:"h-full rounded-full bg-blue-600 transition-all duration-700",style:{width:`${l}%`}})}),e.jsx("div",{className:"mt-6 grid grid-cols-3 gap-3 text-center",children:[{label:"Generate",cost:1},{label:"Research",cost:2},{label:"Voice analysis",cost:5}].map(i=>e.jsxs("div",{className:"rounded-xl bg-slate-50 px-3 py-3",children:[e.jsx("p",{className:"text-lg font-semibold tabular-nums text-slate-900",children:i.cost}),e.jsx("p",{className:"mt-0.5 text-[11px] leading-tight text-slate-500",children:i.label})]},i.label))}),u.length>0&&e.jsxs("div",{className:"mt-6 border-t border-slate-100 pt-5",children:[e.jsx("p",{className:"mb-3 text-[13px] font-medium text-slate-700",children:"Recent activity"}),e.jsx("ul",{className:"space-y-2.5",children:u.slice(0,6).map(i=>e.jsxs("li",{className:"flex items-center justify-between gap-3 text-sm",children:[e.jsx("span",{className:"truncate text-slate-600",children:et[i.action_type??""]??i.reason}),e.jsxs("span",{className:`shrink-0 tabular-nums font-medium ${i.delta>0?"text-blue-600":"text-slate-400"}`,children:[i.delta>0?"+":"",i.delta]})]},i.id))})]})]})}const oe=o=>{const s=o.toLowerCase();return s.includes("pro")||s.includes("business")||s.includes("agency")?"bg-blue-600 text-white border-blue-600":s.includes("creator")||s.includes("solo")||s.includes("starter")?"bg-blue-50 text-blue-700 border-blue-200":"bg-slate-100 text-slate-600 border-slate-200"},jt=()=>{const o=ze(),{toast:s}=Ve(),[u,b]=Ee(),[r,f]=a.useState(""),[l,i]=a.useState(""),[S,xe]=a.useState(""),[y,B]=a.useState(!1),[P,ue]=a.useState(!1),[R,I]=a.useState(!1),[F,W]=a.useState(!1),[H,O]=a.useState(!1),[G,q]=a.useState(!1),[Y,Z]=a.useState(!1),[pe,U]=a.useState(!1),[v,L]=a.useState(""),[w,A]=a.useState(""),[X,J]=a.useState(!1),[he,K]=a.useState(!1),be=a.useRef(null),[ge,Q]=a.useState(!1),{username:m,avatarUrl:$,bio:D,setUsername:ee,setAvatarUrl:z,setBio:te}=Me(),{fingerprint:p,loading:fe}=Re(r||void 0),{subscription:d,usageStats:E,loading:M}=Fe(),ve=u.get("tab")||"profile",T=t=>{const n=new URLSearchParams(u);n.set("tab",t),b(n,{replace:!0})};a.useEffect(()=>{(async()=>{const{data:n}=await c.auth.getUser();if(n?.user){f(n.user.id),i(n.user.email||""),xe(n.user.created_at||"");const N=n.user.app_metadata?.provider,h=(n.user.identities||[]).some(C=>C.provider==="google");ue(N==="google"||h);const{data:k}=await c.from("profiles").select("linkedin_id").eq("id",n.user.id).maybeSingle();B(!!k?.linkedin_id)}})()},[]);const je=a.useCallback(()=>{L(m||""),A(D||""),U(!0)},[m,D]),Ne=a.useCallback(()=>{U(!1),L(""),A("")},[]),ye=a.useCallback(async()=>{if(r){if(v.trim().length<2){s({title:"Username too short",description:"Must be at least 2 characters.",variant:"destructive"});return}try{J(!0);const{error:t}=await c.from("profiles").update({username:v.trim(),bio:w.trim(),updated_at:new Date().toISOString()}).eq("id",r);if(t)throw t;ee(v.trim()),te(w.trim()),U(!1),s({title:"Profile updated!",description:"Your changes have been saved."})}catch(t){s({title:"Save failed",description:t?.message||"Please try again.",variant:"destructive"})}finally{J(!1)}}},[r,v,w,s,ee,te]),we=a.useCallback(async t=>{if(!(!t.target.files?.length||!r))try{K(!0);const n=t.target.files[0],N=n.name.split(".").pop(),g=`${r}/${Date.now()}.${N}`,{error:h}=await c.storage.from("avatars").upload(g,n);if(h)throw h;const{data:{publicUrl:k}}=c.storage.from("avatars").getPublicUrl(g),{error:C}=await c.from("profiles").update({avatar_url:k}).eq("id",r);if(C)throw C;z(k),s({title:"Avatar updated!",description:"Your new photo is live."})}catch(n){s({title:"Upload failed",description:n?.message||"Please try again.",variant:"destructive"})}finally{K(!1)}},[r,s,z]),ke=a.useCallback(async()=>{try{I(!0);const t=window.location.host.replace(/^www\./,""),N=`${`${window.location.protocol}//${t}`}/linkedin/callback`,{data:g,error:h}=await c.functions.invoke("linkedin-auth",{body:{action:"get_auth_url",redirectUri:N}});if(h||!g?.authUrl)throw new Error(h?.message||"Unable to start LinkedIn linking");window.location.href=g.authUrl}catch(t){s({title:"LinkedIn connection failed",description:t?.message||"Please try again.",variant:"destructive"})}finally{I(!1)}},[s]),Ce=a.useCallback(async()=>{try{W(!0);const{data:t,error:n}=await c.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/profile`}});if(n)throw n;t?.url&&(window.location.href=t.url)}catch(t){s({title:"Google connection failed",description:t?.message||"Please try again.",variant:"destructive"})}finally{W(!1)}},[s]),_e=a.useCallback(async()=>
1{if(r&&confirm("Disconnect LinkedIn from this account?"))try{O(!0);const{error:t}=await c.from("profiles").update({linkedin_access_token:null,linkedin_id:null,linkedin_token_expires_at:null}).eq("id",r);if(t)throw t;B(!1),s({title:"LinkedIn disconnected"})}catch(t){s({title:"Could not disconnect",description:t?.message||"Please try again.",variant:"destructive"})}finally{O(!1)}},[s,r]),Se=a.useCallback(async()=>{if(r&&confirm("This will sign you out and flag your account for deletion. Continue?"))try{q(!0),await c.auth.signOut(),s({title:"Account deletion requested",description:"We've signed you out. Email [email protected] to finalize deletion."}),o("/auth")}catch(t){s({title:"Could not start deletion",description:t?.message||"Please try again.",variant:"destructive"})}finally{q(!1)}},[o,s,r]),Pe=a.useCallback(async()=>{if(l)try{Z(!0);const{error:t}=await c.auth.resetPasswordForEmail(l,{redirectTo:`${window.location.origin}/auth`});if(t)throw t;s({title:"Password reset email sent",description:`Check ${l} for the link.`})}catch(t){s({title:"Could not send email",description:t?.message||"Please try again.",variant:"destructive"})}finally{Z(!1)}},[l,s]),Ue=a.useCallback(async()=>{try{await c.auth.signOut({scope:"global"}),s({title:"Signed out from all devices"}),o("/auth")}catch(t){s({title:"Sign-out failed",description:t?.message,variant:"destructive"})}},[o,s]),j=d?.plan_name||d?.subscription_tier||"Free",V=E?.currentCount??0,x=E?.monthlyLimit??0,se=E?.remainingUses??0,Le=x>0?Math.min(100,Math.round(V/x*100)):0,Ae=x===-1?"Unlimited":x||" - ",ae=a.useMemo(()=>S?new Date(S).toLocaleDateString(void 0,{month:"long",year:"numeric"}):"",[S]),$e=a.useMemo(()=>[{key:"premium_templates",label:"Premium templates",on:d?.subscription_limits?.has_premium_templates}
1,{key:"virality_score",label:"Virality score",on:d?.subscription_limits?.has_virality_score},{key:"ab_testing",label:"A/B testing",on:d?.subscription_limits?.has_ab_testing},{key:"advanced_ai",label:"Advanced AI models",on:d?.subscription_limits?.has_advanced_ai},{key:"priority_support",label:"Priority support",on:d?.subscription_limits?.has_priority_support}],[d]);return e.jsxs("div",{className:"min-h-screen bg-[#f6f6f8] flex flex-col",children:[e.jsx(Be,{}),e.jsxs("main",{id:"main-content",className:"flex-grow max-w-[960px] mx-auto px-4 sm:px-6 lg:px-10 py-10 sm:py-12 w-full",children:[e.jsx("section",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6",children:[e.jsxs("div",{className:"flex items-center gap-5 min-w-0",children:[e.jsxs("div",{className:"relative group shrink-0",children:[$?e.jsx("img",{src:$,alt:m,className:"h-[72px] w-[72px] rounded-full object-cover border-2 border-white ring-2 ring-slate-100",loading:"lazy",decoding:"async"}):e.jsx("div",{className:"h-[72px] w-[72px] rounded-full bg-blue-50 border-2 border-white ring-2 ring-slate-100 flex items-center justify-center text-blue-600 text-2xl font-bold",children:m?m.charAt(0).toUpperCase():"U"}),e.jsx("button",{onClick:()=>Q(!0),disabled:he,className:"absolute inset-0 rounded-full bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center cursor-pointer","aria-label":"Change avatar",children:e.jsx(qe,{className:"w-5 h-5 text-white"})}),e.jsx("input",{ref:be,type:"file",accept:"image/*",onChange:we,className:"hidden","aria-label":"Upload avatar image"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h1",{className:"text-2xl sm:text-[26px] font-bold text-slate-900 tracking-tight truncate",children:m||"Your Name"}),e.jsx("span",{className:`rounded-full border px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider ${oe(j)}`,children:j})]}),e.jsx("p",{className:"text-[13px] text-slate-500 mt-1",children:l}),ae&&e.jsxs("p",{className:"text-[12px] text-slate-400 mt-0.5",children:["Member since ",ae]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("button",{onClick:()=>T("subscription"),className:"rounded-lg bg-blue-600 hover:bg-blue-700 px-4 py-2 text-sm font-semibold text-white transition-colors inline-flex items-center gap-1.5",children:[e.jsx(re,{className:"w-3.5 h-3.5"}),"Upgrade"]}),e.jsxs("button",{onClick:()=>T("profile"),className:"rounded-lg border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:border-slate-300 transition-colors inline-flex items-center gap-1.5",children:[e.jsx(le,{className:"w-3.5 h-3.5"}),"Edit"]})]})]})}),e.jsxs(We,{value:ve,onValueChange:T,className:"mt-8",children:[e.jsx(He,{className:"w-full justify-start bg-transparent border-b border-slate-200 rounded-none h-auto p-0 gap-1",children:[{v:"profile",label:"Profile",icon:Ye},{v:"subscription",label:"Subscription",icon:de},{v:"usage",label:"Usage",icon:Ze},{v:"security",label:"Security",icon:Xe}].map(t=>e.jsxs(Oe,{value:t.v,className:"relative rounded-none border-0 border-b-2 border-transparent px-4 py-3 text-[13px] font-semibold text-slate-500 data-[state=active]:text-blue-600 data-[state=active]:border-blue-600 data-[state=active]:bg-transparent data-[state=active]:shadow-none hover:text-slate-900 transition-colors -mb-px inline-flex items-center gap-2",children:[e.jsx(t.icon,{className:"w-4 h-4"}),t.label]},t.v))}),e.jsxs(_,{value:"profile",className:"mt-6 space-y-6",children:[e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 mb-1",children:"About you"}),e.jsx("p",{className:"text-[13px] text-slate-500 mb-6",children:"This appears on your public profile and shared assets."}),pe?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-slate-700 mb-1.5",children:"Display name"}
1),e.jsx("input",{value:v,onChange:t=>L(t.target.value),className:"w-full text-[15px] text-slate-900 border border-slate-300 rounded-lg px-3.5 py-2.5 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Your name",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-slate-700 mb-1.5",children:"Bio"}),e.jsx("textarea",{value:w,onChange:t=>A(t.target.value),rows:3,className:"w-full text-[14px] text-slate-700 border border-slate-300 rounded-lg px-3.5 py-2.5 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Write a short bio…"})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs("button",{onClick:ye,disabled:X,className:"rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-bold text-white hover:bg-blue-700 transition-colors disabled:opacity-60 inline-flex items-center gap-1.5",children:[e.jsx(ie,{className:"w-4 h-4"}),X?"Saving…":"Save changes"]}),e.jsxs("button",{onClick:Ne,className:"rounded-lg border border-slate-200 px-4 py-2.5 text-sm font-medium text-slate-600 hover:bg-slate-50 transition-colors inline-flex items-center gap-1.5",children:[e.jsx(ne,{className:"w-4 h-4"}),"Cancel"]})]})]}):e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-widest text-slate-400 font-bold mb-1",children:"Display name"}),e.jsx("p",{className:"text-[15px] text-slate-900",children:m||e.jsx("span",{className:"text-slate-400",children:"Not set"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-widest text-slate-400 font-bold mb-1",children:"Bio"}),e.jsx("p",{className:"text-[14px] text-slate-700 leading-relaxed whitespace-pre-wrap",children:D||e.jsx("span",{className:"text-slate-400",children:"Add a bio to tell people about yourself."})})]}),e.jsxs("button",{onClick:je,className:"rounded-lg border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:border-blue-600 hover:text-blue-600 transition-colors inline-flex items-center gap-1.5",children:[e.jsx(le,{className:"w-3.5 h-3.5"})," Edit"]})]})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-bold text-slate-900",children:"Voice Fingerprint"}),e.jsx("p",{className:"text-[13px] text-slate-500 mt-0.5",children:p?`Analyzed from ${p.post_count} posts.`:"Not trained yet."})]}),e.jsx("button",{onClick:()=>o("/onboarding"),className:"text-[13px] font-semibold text-blue-600 hover:underline shrink-0",children:p?"Retrain":"Set up"})]}),fe?e.jsx(ce,{className:"h-40 rounded-xl"}):p?e.jsx(Ie,{fingerprint:p,username:m||"user",shareUrl:`https://rskzizedzagohmvyhuyu.supabase.co/functions/v1/fingerprint-og/${r}`}):e.jsxs("div",{className:"text-center py-6 rounded-xl border border-dashed border-slate-200 bg-slate-50/50",children:[e.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"Analyze your posts to build your Voice Fingerprint."}),e.jsx("button",{onClick:()=>o("/onboarding"),className:"rounded-lg bg-blue-600 px-5 py-2 text-sm font-bold text-white hover:bg-blue-700 transition-colors",children:"Analyze my voice"})]})]})]}),e.jsxs(_,{value:"subscription",className:"mt-6 space-y-6",children:[e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-widest text-slate-400 font-bold mb-1",children:"Current plan"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-2xl font-bold text-slate-900 tracking-tight",children:j}),e.jsx("span",{className:`rounded-full border px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider ${oe(j)}`,children:d?.subscribed?"Active":"Trial"})]}),d?.subscription_end&&e.jsxs("p",{className:"text-[13px] text-slate-500 mt-1",children:["Next billing: ",new Date(d.subscription_end).toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs("button",{onClick:()=>o("/pricing"),className:"rounded-lg bg-blue-600 hover:bg-blue-700 px-5 py-2.5 text-sm font-bold text-white transition-colors inline-flex items-center gap-1.5",children:[e.jsx(re,{className:"w-4 h-4"})," Upgrade plan"]}),e.jsxs("button",{onClick:()=>o("/payment?tab=manage"),className:"rounded-lg border border-slate-200 px-5 py-2.5 text-sm font-medium text-slate-700 hover:border-slate-300 transition-colors inline-flex items-center gap-1.5",children:["Manage ",e.jsx(me,{className:"w-3.5 h-3.5"})]})]})]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-2",children:$e.map(t=>e.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 rounded-lg bg-slate-50/60 border border-slate-100",children:[t.on?e.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-600 flex items-center justify-center shrink-0",children:e.jsx(ie,{className:"w-3 h-3 text-white",strokeWidth:3})}):e.jsx("div",{className:"w-5 h-5 rounded-full bg-slate-200 flex items-center justify-center shrink-0",children:e.jsx(ne,{className:"w-3 h-3 text-slate-400",strokeWidth:3})}),e.jsx("span",{className:`text-[13px] ${t.on?"text-slate-900 font-medium":"text-slate-400"}`,children:t.label})]},t.key))})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-bold text-slate-900",children:"Payment history"}),e.jsx("p",{className:"text-[13px] text-slate-500 mt-0.5",children:"Your last 20 invoices."})]})}),r&&e.jsx(Qe,{userId:r})]})]}),e.jsxs(_,{value:"usage",className:"mt-6 space-y-6",children:[e.jsx(tt,{userId:r}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[{label:"Posts this month",value:M?"…":V},{label:"Remaining",value:M?"…":x===-1?"∞":Math.max(se,0)},{label:"Voice samples",value:p?p.post_count:" - "},{label:"Plan",value:j}].map(t=>e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 shadow-sm",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-widest text-slate-400 font-bold mb-2",children:t.label}),e.jsx("p",{className:"text-2xl font-bold text-slate-900 tabular-nums truncate",children:t.value})]},t.label))}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 mb-1",children:"Monthly usage"}),e.jsx("p",{className:"text-[13px] text-slate-500 mb-4",children:"Resets on the first of every month."}),e.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[e.jsx("span",{className:"text-slate-600",children:"Posts"}),e.jsx("span",{className:"font-bold text-slate-900 tabular-nums",children:M?"…":`${V}${x===-1?" / Unlimited":` / ${Ae}`}`})]}),e.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-blue-600 rounded-full transition-all duration-500",style:{width:x===-1?"100%":`${Le}%`}})}),x!==-1&&se<=3&&e.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-amber-50 border border-amber-200 flex items-start gap-2",children:[e.jsx(Je,{className:"w-4 h-4 text-amber-600 mt-0.5 shrink-0"}),e.jsxs("p",{className:"text-[13px] text-amber-800",children:["Running low. ",e.jsx("button",{onClick:()=>o("/pricing"),className:"font-semibold underline hover:no-underline",children:"Upgrade for more"}),"."]})]})]})]}),e.jsxs(_,{value:"security",className:"mt-6 space-y-6",children:[e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 mb-1",children:"Account"}),e.jsxs("p",{className:"text-[13px] text-slate-500 mb-5",children:["Signed in as ",e.jsx("span",{className:"text-slate-900 font-medium",children:l}),"."]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:Pe,disabled:Y,className:"rounded-lg border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:border-blue-600 hover:text-blue-600 transition-colors disabled:opacity-60",children:Y?"Sending…":"Send password reset email"}),e.jsx("button",{onClick:Ue,className:"rounded-lg border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:border-slate-300 transition-colors",children:"Sign out from all devices"})]})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 sm:p-8 shadow-sm",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 mb-5",children:"Connected accounts"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-xl bg-slate-50/60 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-[#0077B5] flex items-center justify-center shrink-0",children:e.jsx("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"
1currentColor",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"LinkedIn"}),e.jsx("p",{className:"text-xs text-slate-400 truncate",children:y?`Connected as ${m||"your account"}`:"Not connected"})]})]}),e.jsx("button",{onClick:y?_e:ke,disabled:R||H,className:`text-xs font-semibold transition-colors shrink-0 ${y?"text-rose-600 hover:text-rose-700":"text-blue-600 hover:text-blue-700"}`,children:R||H?"…":y?"Disconnect":"Connect"})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-xl bg-slate-50/60 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-white border border-slate-200 flex items-center justify-center shrink-0",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",children:[e.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),e.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Google"}),e.jsx("p",{className:"text-xs text-slate-400 truncate",children:P?l||"Connected":"Not connected"})]})]}),e.jsx("button",{onClick:Ce,disabled:F||P,className:"text-xs font-semibold text-blue-600 hover:text-blue-700 transition-colors shrink-0 disabled:text-slate-400",children:F?"…":P?"Connected":"Connect"})]})]})]}),e.jsxs("div",{className:"rounded-2xl border-2 border-rose-200 bg-rose-50/40 p-5 sm:p-8",children:[e.jsx("h3",{className:"text-base font-bold text-rose-700 mb-1",children:"Danger zone"}),e.jsx("p",{className:"text-[13px] text-rose-600/80 mb-4",children:"Permanent action. This cannot be undone."}),e.jsx("button",{onClick:Se,disabled:G,className:"rounded-lg bg-rose-600 hover:bg-rose-700 px-5 py-2.5 text-sm font-bold text-white transition-colors disabled:opacity-60",children:G?"Signing out…":"Delete my account"})]})]})]})]}),e.jsx(Te,{open:ge,onOpenChange:Q,userId:r,currentAvatarUrl:$,onPicked:t=>z(t)})]})};export{jt 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.