1import{u as C,r as a,j as e,z as S,N as k,M as A,t as h,aP as E,Y as F,O as P,L,B as I,ai as T}from"./index-RvaEyP6C.js";import{LoginPage as q}from"./login-page-CyM-CLqD.js";import{s as z}from"./affiliates.functions-CiWVzSyX.js";import{I as r}from"./input-DXhCxZmw.js";import{L as M}from"./label-DEDFsXYd.js";import{T as W}from"./textarea-BErNT8cx.js";import{s as B}from"./audience-BjPhsdh4.js";import{C as O}from"./circle-check-Lv_sKsbV.js";import"./salescollab-logo-DqVM6MoT.js";import"./eye-off-CK12kjjH.js";import"./eye-Jjo8Xr8A.js";function _(){const{user:i,loading:n}=C();return a.useEffect(()=>{B("affiliate")},[]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):i?e.jsx(R,{}):e.jsx(q,{})}function R(){const i=S(),n=k(z),[o,l]=a.useState(""),[c,f]=a.useState(""),[m,y]=a.useState(""),[u,b]=a.useState(""),[p,j]=a.useState(""),[x,v]=a.useState(""),[g,N]=a.useState(""),d=A({mutationFn:async()=>n({data:{companyName:o.trim(),contactName:c.trim(),contactSurname:m.trim()||void 0,contactEmail:u.trim().toLowerCase(),website:p.trim()||void 0,audience:x.trim()||void 0,payoutEmail:g.trim().toLowerCase()||void 0}}),onSuccess:t=>{E(t.organizationId),typeof window<"u"&&window.sessionStorage.removeItem("assettrack:pending-account-type"),h.success("Application submitted â we'll review it shortly"),i({to:"/affiliates/dashboard",search:{org:t.organizationId}})},onError:t=>h.error(t.message)}),w=o.trim().length>1&&c.trim().length>0&&m.trim().length>0&&/\S+@\S+\.\S+/.test(u);return e.jsxs("div",{className:"min-h-screen bg-landing-bg",style:{fontFamily:"'Onest', system-ui, sans-serif"},children:[e.jsx(F,{}),e.jsxs("div",{className:"mx-auto max-w-[720px] px-4 sm:px-6 lg:px-8 py-12 sm:py-16",children:[e.jsxs("p",{className:"inline-flex items-center gap-2 text-[12px] uppercase tracking-[0.18em] text-brand-blue font-medium mb-3",children:[e.jsx(P,{className:"h-3.5 w-3.5"})," Partner program"]}),e.jsx("h1",{className:"text-[30px] sm:text-[40px] font-normal tracking-tight text-landing-dark",children:"Apply to refer AssetTrack"}),e.jsx("p",{className:"mt-3 text-[16px] text-landing-light-muted leading-relaxed",children:"Earn 20% recurring on every customer you introduce, for as long as they stay subscribed. We review every application personally â usually within 2 business days."}),e.jsxs("div",{className:"mt-10 rounded-2xl border border-landing-grid bg-white p-6 sm:p-8 space-y-5",children:[e.jsx(s,{label:"Company name",required:!0,children:e.jsx(r,{value:o,onChange:t=>l(t.target.value),placeholder:"e.g. Acme Insurance Brokers"})}),e.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[e.jsx(s,{label:"First name",required:!0,children:e.jsx(r,{value:c,onChange:t=>f(t.target.value),placeholder:"e.g. Sipho",autoComplete:"given-name"})}),e.jsx(s,{label:"Surname",required:!0,children:e.jsx(r,{value:m,onChange:t=>y(t.target.value),placeholder:"e.g. Naidoo",autoComplete:"family-name"})})]}),e.jsx(s,{label:"Contact email",required:!0,children:e.jsx(r,{type:"email",value:u,onChange:t=>b(t.target.value),placeholder:"[email protected]",autoComplete:"email"})}),e.jsx(s,{label:"Website (optional)",children:e.jsx(r,{value:p,onChange:t=>j(t.target.value),placeholder:"https://"})}),e.jsx(s,{label:"Who do you serve?",hint:"Tell us a bit about your customers â industry, size, location.",children:e.jsx(W,{value:x,onChange:t=>v(t.target.value),rows:4,placeholder:"e.g. SMME insurance brokers across South Africa, mostly 10â200 staff."})}),e.jsx(s,{label:"Payout email (optional)",hint:"Where we'll send EFT remittance. Defaults to your contact email.",children:e.jsx(r,{type:"email",value:g,onChange:t=>N(t.target.value),placeholder:"[email protected]"})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-2",children:[e.jsx(L,{to:"/for-partners",className:"text-[13px] text-landing-light-muted hover:text-landing-dark",children:"â Back to partner info"}),e.jsx(I,{size:"lg",className:"rounded-full gap-2 min-h-[48px] bg-brand-blue text-white hover:bg-brand-blue/90 font-medium text-[15px] px-7",disabled:!w||d.isPending,onClick:()=>d.mutate(),children:d.isPending?"Submittingâ¦":e.jsxs(e.Fragment,{children:["Submit application ",e.jsx(T,{className:"h-4 w-4"})]})})]})]}),e.jsx("ul",{className:"mt-8 space-y-2 text-[14px] text-landing-light-muted",children:["Free to join â no setup fees","Approved partners get a unique referral link and live dashboard","Monthly EFT payouts in ZAR","Lifetime commission for as long as your customer stays"].map(t=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"h-4 w-4 text-brand-blue"})," ",t]},t))})]})]})}function s({label:i,hint:n,required:o,children:l}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(M,{className:"text-[13px] font-medium text-landing-dark",children:[i," ",o&&e.jsx("span",{className:"text-brand-blue",children:"*"})]}),l,n&&e.jsx("p",{className:"text-[12px] text-landing-light-muted",children:n})]})}export{_ as component};
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.