1import{u as I,R as M,ce as L,r as c,s as k,j as a,E as q}from"./index-DsK5E-oE.js";import{f as A,W as O}from"./WorkspaceJoinShell-CSpu9D54.js";import"./ArrowLeftLineIcon-B6_1AzUp.js";const $=()=>{if(typeof window>"u"||new URLSearchParams(window.location.search).get("preview")!=="1")return!1;const s=window.location.hostname;return s==="localhost"||s==="127.0.0.1"||s.includes("lovableproject.com")||s.startsWith("id-preview--")||s.startsWith("preview--")},C={id:"preview-workspace",name:"Linkers",slug:"preview",logo_url:"",logo_dark_url:"",avatar_url:"",brand_color:"#FFE11E"},D={name:"Alex",surname:"Morgan",headline:"Product Designer",avatar_url:""};function B(){var _,N;const{t:s}=I(),g=M(),{slug:x}=L(),[m,S]=c.useState(null),[y,P]=c.useState(!0),[e,w]=c.useState(null),[h,f]=c.useState(!0),[b,R]=c.useState("");c.useEffect(()=>{(async()=>{var d;const n=$(),{data:{session:t}}=await k.auth.getSession();if(!t&&!n){try{localStorage.setItem("post_auth_redirect",window.location.pathname+window.location.search+window.location.hash)}catch{}g("/auth");return}const r=(d=new URLSearchParams(window.location.search).get("email"))==null?void 0:d.trim();R(r||(t==null?void 0:t.user.email)||"[email protected]");const i=x?await A(x):null;if(S(i||(n?C:null)),P(!1),!t&&n){w(D),f(!1);return}const{data:l}=await k.from("profiles").select("name, surname, headline, avatar_url").eq("user_id",t.user.id).eq("profile_type","personal").maybeSingle();l&&w(l),f(!1)})()},[x,g]);const j=[e==null?void 0:e.name,e==null?void 0:e.surname].filter(Boolean).join(" ").trim(),p=`${((_=e==null?void 0:e.name)==null?void 0:_[0])||""}${((N=e==null?void 0:e.surname)==null?void 0:N[0])||""}`.toUpperCase(),v=(m==null?void 0:m.brand_color)||"#FFE11E",W=(()=>{const n=v.replace("#","");if(n.length!==6)return"#0E1011";const t=parseInt(n.slice(0,2),16)/255,r=parseInt(n.slice(2,4),16)/255,i=parseInt(n.slice(4,6),16)/255,l=Math.max(t,r,i),d=Math.min(t,r,i),F=(l+d)/2,u=l-d;let o=0,E=0;if(u!==0){switch(E=u/(1-Math.abs(2*F-1)),l){case t:o=(r-i)/u%6;break;case r:o=(i-t)/u+2;break;default:o=(t-r)/u+4}o*=60,o<0&&(o+=360)}return`hsl(${o.toFixed(1)}, ${Math.round(E*100)}%, 35%)`})();return a.jsxs(O,{org:m,loading:y,footerHint:s("workspace_join.pending.hint","Your request has been sent successfully. A Workspace Administrator will review it, and you'll gain access as soon as it's approved."),children:[a.jsxs("div",{className:"grid grid-cols-[20px_auto_20px] items-center justify-center gap-2",style:{color:W},children:[a.jsx(q,{className:"w-5 h-5"}),a.jsx("h1",{className:"text-[20px] font-semibold leading-tight",children:s("workspace_join.pending.title","Your request has been sent")}),a.jsx("span",{"aria-hidden":!0,className:"w-5 h-5"})]}),a.jsx("p",{className:"mt-3 text-[15px] text-muted-foreground text-center leading-relaxed",children:s("workspace_join.pending.subtitle","You'll be able to access the Workspace as soon as an Administrator approves it.")}),a.jsxs("div",{className:"mt-7 rounded-[14px] bg-card p-[24px] flex flex-col items-center",style:{boxShadow:"0 0 0 1px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.08)"},children:[a.jsxs("div",{className:"relative flex items-center justify-center overflow-hidden",style:{width:72,height:56,borderRadius:9999,backgroundColor:h||!(e!=null&&e.avatar_url)&&!p?"hsl(var(--muted))":e!=null&&e.avatar_url?"transparent":`${v}33`},children:[h?a.jsx("span",{"aria-hidden":!0,className:"w-full h-full animate-pulse bg-muted"}):e!=null&&e.avatar_url?a.jsx("img",{src:e.avatar_url,alt:j,className:"w-full h-full object-cover"}):p?a.jsx("span",{className:"text-[18px] font-semibold text-foreground",children:p}):null,!h&&a.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{borderRadius:9999,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.10)"}})]}),h?a.jsxs(a.Fragment,{children:[a.jsx("span",{"aria-hidden":!0,className:"mt-4 h-5 w-40 rounded bg-muted animate-pulse"}),a.jsx("span",{"aria-hidden":!0,className:"mt-2 h-4 w-28 rounded bg-muted animate-pulse"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"mt-4 text-[20px] font-semibold text-foreground text-center",children:j||b}),(e==null?void 0:e.headline)&&a.jsx("p",{className:"mt-1 text-[15px] text-muted-foreground text-center",children:e.headline})]}),a.jsx("p",{className:"mt-3 text-[13px] text-muted-foreground text-center",children:b})]})]})}export{B 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.