PageSourceSearch

https://futurecast.pro/assets/DeskSignup-ClKyyGD7.js

js futurecast.pro collected 2026-10-07 03:08:54 UTC 12,470 bytes, 1 lines download raw bytes

1import{r,j as e}from"./vendor-query-Dkm4furz.js";import{u as q,g as _,P as H,t as y}from"./index-Bxl4mrbd.js";import{a as Y,b as G}from"./vendor-react-C4nmQqxk.js";import"./vendor-pdf-5g-lfC8S.js";import"./vendor-charts-DHhRtk-9.js";import"./vendor-supabase-CbPlSJWC.js";const Q=["elite_plus","desk","enterprise","custom"];function X(t){return Q.find(c=>c===t)??"desk"}function W(t){const c=`/business/desk-signup?plan=${t}`;return{signupUrl:`/signup?${new URLSearchParams({next:c}).toString()}`,returnPath:c}}const o=15,x=75,K=100,P=[{key:"elite_plus",name:"Elite+",price:"$199",per:"/mo",seats:"1 seat",blurb:"Personal power plan",features:["Full REST API + webhooks","30 requests/min","Personal use"]},{key:"desk",name:"Desk",price:"$499",per:"/mo",seats:"Up to 5 seats",blurb:"For small teams",badge:"Most popular",features:["Everything in Elite+","Shared team workspace","Flat price — all seats included"]},{key:"enterprise",name:"Enterprise",price:"$1,100",per:"/mo",seats:"Up to 15 seats",blurb:"For funds & desks",features:["Everything in Desk","600 requests/min","Priority support · 99.9% SLA"]},{key:"custom",name:"Custom",price:"$1,100+",per:"/mo",seats:"15+ seats",blurb:"Size it to your team",features:["Everything in Enterprise",`+$${x}/mo per seat beyond 15`,"Scale as you grow"]}];function $(t){return t==="elite_plus"?1:t==="desk"?5:t==="enterprise"?o:20}function ae(){var z;const{user:t,isLoading:c}=q(),f=Y(),[A]=G(),k=X(A.get("plan")),[a,R]=r.useState(k),[p,M]=r.useState(""),[n,g]=r.useState($(k)),[i,B]=r.useState("card"),[v,D]=r.useState(""),[w,L]=r.useState(""),[S,U]=r.useState(""),[j,E]=r.useState(!1);r.useEffect(()=>{var s;t&&((s=t.user_metadata)==null?void 0:s.signup_source)!=="business"&&_.auth.updateUser({data:{signup_source:"business"}}).catch(()=>{})},[t]),r.useEffect(()=>{if(!c&&!t){const{signupUrl:s}=W(a);f(s,{replace:!0})}},[c,t,f,a]);function T(s){R(s),g($(s))}const m=o+1,h=K,I=r.useMemo(()=>a==="elite_plus"?199:a==="desk"?499:1100+Math.max(0,n-o)*x,[a,n]);if(c)return e.jsx("div",{className:"min-h-screen bg-[#0B0D0E] flex items-center justify-center text-zinc-400",children:"Loading…"});if(!t)return e.jsx("div",{className:"min-h-screen bg-[#0B0D0E] flex items-center justify-center text-zinc-400",children:"Redirecting to sign-up…"});async function F(){if(!t||!p.trim()){y({title:"Organization name is required",variant:"destructive"});return}if(i==="invoice"&&!v.trim()){y({title:"Billing email is required for invoice payment",variant:"destructive"});return}E(!0);try{const s=t.user_metadata,{data:l,error:d}=await _.functions.invoke("create-desk-checkout",{body:{userId:t.id,email:t.email,firstName:(s==null?void 0:s.firstName)||(s==null?void 0:s.first_name)||"",lastName:(s==null?void 0:s.lastName)||(s==null?void 0:s.last_name)||"",orgName:p.trim(),orgSlug:p.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-"),plan:a==="custom"?"enterprise":a,seatCount:a==="elite_plus"?1:a==="desk"?5:a==="enterprise"?o:n,paymentMethod:i,billingEmail:i==="invoice"?v.trim():void 0,invoiceReference:i==="invoice"&&w.trim()||void 0,trialCode:i==="card"&&S.trim()||void 0}});if(d){let C=d.message;const N=d.context;if(N&&typeof N.json=="function")try{const b=await N.json();b!=null&&b.message&&(C=b.message)}catch{}throw new Error(C)}if(!(l!=null&&l.url))throw new Error("No checkout URL returned");window.location.replace(l.url)}catch(s){y({title:"Checkout failed",description:s.message,variant:"destructive"})}finally{E(!1)}}const O=i==="invoice"?j?"Generating invoice…":"Email me an invoice":j?"Starting…":"Continue to Stripe",u="w-full h-11 rounded-lg bg-white/[0.04] border border-white/10 px-3 text-sm text-white placeholder:text-zinc-500 outline-none focus:border-emerald-400/60 focus:ring-1 focus:ring-emerald-400/40 transition";return e.jsxs("div",{className:"fc-business fc-business-dark min-h-screen bg-[#0B0D0E] text-white",children:[e.jsxs("div",{className:"pointer-events-none fixed inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 h-[480px] w-[900px] rounded-full bg-emerald-500/10 blur-[120px]"}),e.jsx("div",{className:"absolute bottom-0 right-0 h-[300px] w-[500px] rounded-full bg-cyan-500/5 blur-[100px]"})]}),e.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 py-10 sm:py-14",children:[e.jsx("div",{className:"max-w-sm mx-auto mb-6",children:e.jsx(H,{})}),e.jsxs("div",{className:"text-center mb-10",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-emerald-400/20 bg-emerald-400/5 px-3 py-1 text-xs font-medium text-emerald-300 mb-4",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Futurecast for Business"]}),e.jsxs("h1",{className:"fc-h text-2xl sm:text-3xl font-semibold tracking-tight",children:["Set up your ",e.jsx("span",{className:"fc-em",children:"workspace"})]}),e.jsx("p",{className:"mt-2 text-zinc-400 max-w-xl mx-auto",children:"Pick a plan and name your organization to set up access to Futurecast research and available model estimates."})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 mb-10",children:P.map(s=>{const l=a===s.key;return e.jsxs("button",{type:"button",onClick:()=>T(s.key),className:`relative text-left rounded-2xl border p-5 transition-all duration-200 ${l?"border-emerald-400/60 bg-emerald-400/[0.06] shadow-[0_0_30px_-8px_rgba(52,211,153,0.35)]":"border-white/10 bg-white/[0.03] hover:border-white/25 hover:bg-white/[0.05]"}`,children:[s.badge&&e.jsx("span",{className:"absolute -top-2.5 left-4 rounded-full bg-emerald-400 px-2 py-0.5 text-[10px] font-semibold text-black",children:s.badge}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-semibold",children:s.name}
1),e.jsx("span",{className:`h-4 w-4 rounded-full border flex items-center justify-center ${l?"border-emerald-400 bg-emerald-400":"border-zinc-600"}`,children:l&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-black"})})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("span",{className:"text-2xl font-semibold",children:s.price}),e.jsx("span",{className:"text-sm text-zinc-400",children:s.per})]}),e.jsx("div",{className:"text-xs font-medium text-emerald-300/90 mt-1",children:s.seats}),e.jsx("div",{className:"text-xs text-zinc-500 mt-0.5",children:s.blurb}),e.jsx("ul",{className:"mt-3 space-y-1.5",children:s.features.map(d=>e.jsxs("li",{className:"flex items-start gap-1.5 text-xs text-zinc-400",children:[e.jsx("svg",{className:"h-3.5 w-3.5 mt-px shrink-0 text-emerald-400/80",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.7 5.3a1 1 0 010 1.4l-7 7a1 1 0 01-1.4 0l-3-3a1 1 0 111.4-1.4l2.3 2.29 6.3-6.3a1 1 0 011.4 0z",clipRule:"evenodd"})}),d]},d))})]},s.key)})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-6",children:[e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/[0.03] p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:"Organization name"}),e.jsx("input",{className:u,value:p,onChange:s=>M(s.target.value),placeholder:"Acme Capital"})]}),a==="custom"?e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:["Seats (",m,"–",h,")"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("input",{type:"range",min:m,max:h,value:n,onChange:s=>g(Number(s.target.value)),className:"flex-1 accent-emerald-400"}),e.jsx("input",{type:"number",min:m,max:h,value:n,onChange:s=>g(Math.min(h,Math.max(m,Number(s.target.value)||m))),className:`${u} w-20 text-center`})]}),e.jsxs("p",{className:"text-xs text-zinc-500 mt-1.5",children:["$1,100/mo covers the first 15 seats; each seat beyond adds $",x,"/mo."]})]}):e.jsxs("p",{className:"text-sm text-zinc-500",children:[a==="elite_plus"&&"Elite+ is a single-seat personal plan. Need teammates? Choose Desk, Enterprise, or Custom.",a==="desk"&&"$499/mo flat — up to 5 seats included, invite teammates any time.",a==="enterprise"&&"$1,100/mo flat — up to 15 seats included, invite teammates any time. Need more? Pick Custom."]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:"Payment method"}),e.jsx("div",{className:"space-y-2",children:[{value:"card",title:"Credit or debit card",desc:"Instant activation. Best for trying things out or smaller teams."},{value:"us_bank_account",title:"US bank account (ACH Direct Debit)",desc:"Lower fees on large invoices. Activates in 3–5 business days once your bank confirms."},{value:"invoice",title:"Request an invoice",desc:"Stripe-hosted invoice payable by ACH credit transfer or wire. Best for AP teams."}].map(s=>e.jsxs("label",{className:`flex gap-3 items-start rounded-xl border p-3.5 cursor-pointer transition ${i===s.value?"border-emerald-400/50 bg-emerald-400/[0.05]":"border-white/10 hover:border-white/25"}`,children:[e.jsx("input",{type:"radio",name:"paymentMethod",value:s.value,checked:i===s.value,onChange:()=>B(s.value),className:"mt-1 accent-emerald-400"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:s.title}),e.jsx("div",{className:"text-xs text-zinc-500",children:s.desc})]})]},s.value))})]}),i==="invoice"&&e.jsxs("div",{className:"space-y-3 rounded-xl border border-dashed border-white/15 p-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:"Billing email (where the invoice is sent)"}),e.jsx("input",{type:"email",className:u,value:v,onChange:s=>D(s.target.value),placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:"PO number / reference (optional)"}),e.jsx("input",{className:u,value:w,onChange:s=>L(s.target.value),placeholder:"PO-2026-0142"})]}),e.jsx("p",{className:"text-xs text-zinc-500",children:'Your organization appears in the dashboard immediately in a "pending" state. Access activates as soon as Stripe records the invoice as paid.'})]}),i==="card"&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-zinc-300 mb-1.5",children:"Trial code (optional)"}),e.jsx("input",{className:u,value:S,onChange:s=>U(s.target.value),placeholder:"Enter a code to start a free trial"}),e.jsx("p",{className:"text-xs text-zinc-500 mt-1.5",children:"Have a trial code? Enter it to start a 14-day free trial — your card 
1is saved but not charged until the trial ends. Without a code, billing starts today."})]}),i==="us_bank_account"&&e.jsx("p",{className:"text-xs text-zinc-500",children:"You'll be redirected to Stripe to securely link your bank account. Your seats activate once the first debit settles (typically 3–5 business days)."})]}),e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/[0.03] p-6 h-fit lg:sticky lg:top-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-zinc-300 uppercase tracking-wider mb-4",children:"Summary"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-zinc-400",children:"Plan"}),e.jsx("span",{className:"font-medium",children:(z=P.find(s=>s.key===a))==null?void 0:z.name})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-zinc-400",children:"Seats"}),e.jsx("span",{className:"font-medium",children:a==="elite_plus"?1:n})]}),a==="custom"&&n>o&&e.jsxs("div",{className:"flex justify-between text-zinc-400",children:[e.jsxs("span",{children:["Extra seats (",n-o," × $",x,")"]}),e.jsxs("span",{children:["$",(n-o)*x,"/mo"]})]}),e.jsxs("div",{className:"border-t border-white/10 pt-3 flex justify-between items-baseline",children:[e.jsx("span",{className:"text-zinc-400",children:"Monthly total"}),e.jsxs("span",{className:"text-2xl font-semibold",children:["$",I.toLocaleString(),e.jsx("span",{className:"text-sm text-zinc-400 font-normal",children:"/mo"})]})]})]}),e.jsx("button",{onClick:F,disabled:j,className:"mt-5 w-full h-12 rounded-xl bg-emerald-400 text-black font-semibold hover:bg-emerald-300 disabled:opacity-60 disabled:cursor-not-allowed transition",children:O}),e.jsx("p",{className:"text-[11px] text-zinc-500 mt-3 text-center",children:"Cancel anytime. Secure checkout by Stripe."})]})]})]})]})}export{ae 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.