1import{r,j as e,ak as k,J as y,k as b,m,X as w,at as N}from"./index-u0HMC9Vb.js";const n=7;function R({onClose:c}){const[l,s]=r.useState(!1),o=async()=>{var x;if(window.self!==window.top){alert("Checkout is only available from the published app. Please open the app directly.");return}s(!0);const t=window.location.origin,p=await m.functions.invoke("createCheckoutSession",{product:"residency",success_url:`${t}/Residency?application=submitted`,cancel_url:`${t}/Residency`});(x=p.data)!=null&&x.url&&(window.location.href=p.data.url),s(!1)};return e.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center px-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:c}),e.jsxs("div",{className:"relative bg-background border border-border w-full max-w-md p-8",children:[e.jsx("button",{onClick:c,className:"absolute top-4 right-4 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(w,{className:"w-4 h-4",strokeWidth:1.5})}),e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-[0.3em] text-muted-foreground mb-4",children:"RESIDENCY"}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-3 leading-tight tracking-tight",children:"Apply your design identity in real-world contexts"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-4",children:"A live, cohort-based experience. Work on a real brief with a real partner â bringing everything from Studio into a single authored outcome."}),e.jsxs("div",{className:"flex items-start gap-3 px-4 py-3 border border-border/50 bg-muted/30 mb-5 text-xs text-muted-foreground leading-relaxed",children:[e.jsx(y,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5",strokeWidth:1.5}),e.jsxs("span",{children:["Your card will be ",e.jsx("strong",{className:"text-foreground",children:"authorised but not charged"})," until your application is reviewed. If not accepted, the hold is released immediately â no payment taken."]})]}),e.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[e.jsx("span",{className:"text-2xl font-semibold tracking-tight",children:"£1,800"}),e.jsx("span",{className:"text-xs text-muted-foreground font-meta uppercase tracking-widest",children:"per cohort"})]}),e.jsx("p",{className:"text-[9px] font-meta text-muted-foreground tracking-widest uppercase mb-6",children:"Maximum 5 participants per cohort · Application only"}),e.jsxs("button",{onClick:o,disabled:l,className:"flex items-center justify-between w-full px-5 py-4 bg-foreground text-background hover:opacity-90 transition-opacity disabled:opacity-60",children:[e.jsx("span",{className:"text-xs font-semibold tracking-tight",children:"Apply for Residency"}),l?e.jsx(b,{className:"w-4 h-4 animate-spin flex-shrink-0",strokeWidth:1.5}):e.jsx(N,{className:"w-4 h-4 flex-shrink-0",strokeWidth:1.5})]})]})]})}function W(){const[c,l]=r.useState(!1),[s,o]=r.useState(null),[t,p]=r.useState({self:null,other:null}),[x,v]=r.useState(!1),[j,S]=r.useState(!1);r.useEffect(()=>{new URLSearchParams(window.location.search).get("application")==="submitted"&&(S(!0),window.history.replaceState({},"","/Residency"))},[]),r.useEffect(()=>{async function i(){try{const a=await m.auth.me();if(!a){o("not_logged_in");return}if(a.role==="admin"){v(!0),o("eligible");return}const d=(await m.entities.TRESDAProfile.filter({user_id:a.id}))[0];if(!d){o("no_profile");return}const g=d.self_score??0,f=d.other_score??0;p({self:g,other:f}),g>=n&&f>=n?o("eligible"):o("not_eligible")}catch{o("not_logged_in")}}i()},[]);const u=s===null;return e.jsxs("div",{style:{minHeight:"100vh",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},children:[c&&e.jsx(R,{onClose:()=>l(!1)}),e.jsxs("div",{style:{maxWidth:"520px",margin:"0 auto",padding:"80px 28px 120px"},children:[e.jsx("p",{style:{fontSize:"10px",fontFamily:"monospace",letterSpacing:"0.22em",color:"hsl(var(--muted-foreground))",textTransform:"uppercase",marginBottom:"24px"},children:"Synthesis â The Living Proofâ¢"}),e.jsxs("h1",{style:{fontSize:"28px",fontWeight:600,letterSpacing:"-0.022em",lineHeight:1.25,marginBottom:"20px"},children:["Apply your design identity",e.jsx("br",{}),"in real-world contexts"]}),e.jsxs("p",{style:{fontSize:"15px",color:"hsl(var(--muted-foreground))",lineHeight:1.7,marginBottom:"48px"},children:["Residency is a live, cohort-based experience.",e.jsx("br",{}),"You work on a real brief, with a real partner, within a structured timeline â bringing everything from Studio into a single, authored outcome."]}),e.jsx("div",{style:{height:"1px",background:"hsl(var(--border))",marginBottom:"48px"}}),e.jsxs("div",{style:{marginBottom:"48px"},children:[e.jsx("p",{style:{fontSize:"10px",fontFamily:"monospace",letterSpacing:"0.18em",color:"hsl(var(--muted-foreground))",textTransform:"uppercase",marginBottom:"20px"},children:"Entry requirements"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[{label:"001 â Self",sub:`SOS Score ⥠${n}/10`,score:t.self,met:t.self!==null&&t.self>=n},{label:"002 â Other",sub:`SOS Score ⥠${n}/10`,score:t.other,met:t.other!==null&&t.other>=n},{label:"TRESDA ID",sub:"Established",met:s!=="no_profile"&&s!=="not_logged_in"}].map(({label:i,sub:a,score:h,met:d})=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[u?e.jsx("div",{style:{width:"14px",height:"14px",borderRadius:"50%",background:"hsl(var(--border))"}}):d?e.jsx(k,{style:{width:"14px",height:"14px",color:"hsl(var(--success, 142 60% 36%))",flexShrink:0},strokeWidth:1.5}):e.jsx(y,{style:{width:"14px",height:"14px",color:"hsl(var(--muted-foreground))",flexShrink:0},strokeWidth:1.5}),e.jsx("p",{style:{fontSize:"14px",fontWeight:500,minWidth:"140px"},children:i}),e.jsxs("p",{style:{fontSize:"11px",fontFamily:"monospace",color:"hsl(var(--muted-foreground))",letterSpacing:"0.06em"},children:[h!=null?`${h}/10 â `:"",a]})]},i))})]}),e.jsx("div",{style:{height:"1px",background:"hsl(var(--border))",marginBottom:"48px"}}),e.jsxs("div",{children:[e.jsxs("p",{style:{fontSize:"13px",color:"hsl(var(--muted-foreground))",lineHeight:1.65,marginBottom:"8px"},children:["Residency cohorts open on a rolling basis.",e.jsx("br",{}),"Applications are reviewed individually. Maximum 5 participants per cohort."]}),e.jsx("p",{style:{fontSize:"13px",fontWeight:600,marginBottom:"24px"},children:"£1,800 per cohort"}),j?e.jsxs("div",{style:{padding:"16px",border:"1px solid hsl(var(--border))",background:"hsl(var(--muted))",maxWidth:"380px"},children:[e.jsx("p",{style:{fontSize:"11px",fontFamily:"monospace",letterSpacing:"0.1em",textTransform:"uppercase",color:"hsl(var(--foreground))",marginBottom:"6px"},children:"Application received"}),e.jsx("p",{style:{fontSize:"13px",color:"hsl(var(--muted-foreground))",lineHeight:1.6},children:"Your card has been authorised and is on hold. We'll review your application and be in touch â if not accepted, the hold is released immediately."})]}):u?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:"hsl(var(--muted-foreground))"},children:[e.jsx(b,{style:{width:"14px",height:"14px",animation:"spin 0.8s linear infinite"}}),e.jsx("span",{style:{fontSize:"12px",fontFamily:"monospace"},children:"Checking eligibilityâ¦"})]}):s==="eligible"?e.jsx("button",{onClick:()=>l(!0),style:{fontSize:"11px",fontFamily:"monospace",letterSpacing:"0.14em",textTransform:"uppercase",color:"hsl(var(--background))",background:"hsl(var(--foreground))",border:"none",cursor:"pointer",padding:"14px 24px",transition:"opacity 0.15s",minHeight:"unset"},onMouseEnter:i=>i.target.style.opacity="0.8",onMouseLeave:i=>i.target.style.opacity="1",children:"Apply for Residency â"}):e.jsxs("div",{style:{padding:"16px",border:"1px solid hsl(var(--border))",background:"hsl(var(--muted))",maxWidth:"380px"},children:[e.jsx("p",{style:{fontSize:"11px",fontFamily:"monospace",letterSpacing:"0.1em",textTransform:"uppercase",color:"hsl(var(--muted-foreground))",marginBottom:"6px"},children:"Not yet eligible"}),e.jsxs("p",{style:{fontSize:"13px",color:"hsl(var(--foreground))",lineHeight:1.6},children:["Complete Studio 001 and 002 with an SOS score of ",n,"/10 or above to apply for Residency."]})]})]})]})]})}export{W 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.