1import{g as e,r as t,j as o}from"./vendor-react-CCcYlSr6.js";import{S as a,T as n}from"./vendor-supabase-BVFpzqvp.js";import{s as r,C as s,b as c}from"./index-BAjqQvK2.js";import{h as i}from"./colorUtils-BHeCG2RN.js";import{C as l}from"./CompanyLogo-D4uLzMh8.js";import"./vendor-query-BN8P0Aoi.js";const m=()=>{const m=e(),[d,u]=t.useState(null);return t.useState(""),t.useEffect(()=>{document.documentElement.classList.add("dark")},[]),t.useEffect(()=>{const e=localStorage.getItem("pending_invite_company_data");if(e)try{const t=JSON.parse(e);u(t),localStorage.getItem("pending_invite_token"),t.primary_color&&document.documentElement.style.setProperty("--primary",i(t.primary_color)),t.secondary_color&&document.documentElement.style.setProperty("--secondary",i(t.secondary_color)),t.accent_color&&document.documentElement.style.setProperty("--accent",i(t.accent_color)),t.font_family&&(document.body.style.fontFamily=`${t.font_family}, sans-serif`)}catch(t){}},[]),t.useEffect(()=>{(async()=>{const{data:{session:e}}=await r.auth.getSession();if(e){const e=localStorage.getItem("pending_invite_token");m(e?`/accept-invite?token=${e}`:"/portal")}})();const{data:{subscription:e}}=r.auth.onAuthStateChange((e,t)=>{if(t&&"SIGNED_IN"===e){const e=localStorage.getItem("pending_invite_token");m(e?`/accept-invite?token=${e}`:"/portal")}});return()=>e.unsubscribe()},[m]),o.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:d?.background_color?`linear-gradient(to bottom right, ${d.background_color}, hsl(var(--muted)))`:"linear-gradient(to bottom right, hsl(var(--background)), hsl(var(--muted)))"},children:o.jsxs(s,{className:"w-full max-w-md p-8",children:[o.jsx("div",{className:"mb-6 flex justify-center",children:o.jsx(l,{src:d?.logo_url,alt:d?.company_name?`${d.company_name} logo`:"BizzBox",className:"h-16",fallback:o.jsx("img",{src:c,alt:"BizzBox",className:"h-16 object-contain"})})}),o.jsxs("div",{className:"mb-8 text-center",children:[o.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:d?.company_name?"Create Your Account":"Welcome"}),o.jsx("p",{className:"text-muted-foreground",children:d?.company_name?`You've been invited to join ${d.company_name}'s workspace. Create your account below to get started.`:"Create your account or sign in"})]}),o.jsx(a,{supabaseClient:r,providers:[],view:d?.company_name?"sign_up":void 0,appearance:{theme:n,variables:{default:{colors:{brand:d?.primary_color||"hsl(var(--primary))",brandAccent:d?.secondary_color||"hsl(var(--primary))",inputText:"hsl(var(--foreground))",inputBackground:"hsl(var(--input))",inputBorder:"hsl(var(--border))",inputPlaceholder:"hsl(var(--muted-foreground))"},fontSizes:{baseInputSize:"16px"},fonts:{bodyFontFamily:d?.font_family||"Inter, sans-serif"}}},style:{button:{borderRadius:"6px"},input:{borderRadius:"6px"}}},redirectTo:`${window.location.origin}/accept-invite${(()=>{const e=localStorage.getItem("pending_invite_token"),t=new URLSearchParams(window.location.search).get("company"),o=new URLSearchParams;return e&&o.set("token",e),t&&o.set("company",t),o.toString()?`?${o.toString()}`:""})()}`})]})})};export{m 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.