(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_hub-ui"]="1776171900957-0cd8d4af42"}catch(l){}})();import{r as c,j as r,c as V}from"./c2heove9.js";import{c as b}from"./cti2cxfc.js";import{s as M}from"./bzboi54p.js";import{B as A}from"./l4momybf.js";import{w as f,V as l,a6 as j,W as w,T as p}from"./la47cm74.js";import{A as S}from"./iy3smwie.js";import{m as C}from"./fr3stkr3.js";import{l as U}from"./f30dsew0.js";import{L as $}from"./ihq2tdkl.js";import{U as I}from"./hcf58i0r.js";import{h as Z}from"./ipu1vast.js";import{a as B}from"./vztx1043.js";import{E as g}from"./m5s21b8a.js";import{b as _}from"./dlfja1xs.js";const E=(e,t)=>r.jsxs("svg",{...e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,children:[r.jsx("rect",{y:48,width:48,height:48,rx:8,transform:"rotate(-90 0 48)",fill:"url(#paint0_linear_5607_1288)"}),r.jsx("path",{d:"M41.4469 21.6079C40.6132 21.0467 38.423 20.807 36.831 21.2363C36.7455 19.6503 35.927 18.3135 34.431 17.1471L33.8774 16.7755L33.5083 17.3332C32.7828 18.4344 32.4769 19.902 32.5851 21.2363C32.6706 22.0583 32.9562 22.982 33.5083 23.6524C31.4359 24.8547 29.5254 24.5817 21.065 24.5817H8.00289C7.96497 26.4923 8.27186 30.1668 10.6086 33.1583C10.867 33.489 11.1496 33.8085 11.457 34.1164C13.357 36.0189 16.2276 37.4143 20.52 37.4178C27.0688 37.4239 32.6792 33.8838 36.0923 25.3254C37.2152 25.3436 40.1799 25.5266 41.6309 22.7232C41.6663 22.6762 42 21.98 42 21.98L41.4469 21.6084V21.6079ZM16.5274 19.8611H12.8544V23.5341H16.5274V19.8611ZM21.2723 19.8611H17.5993V23.5341H21.2723V19.8611ZM26.0177 19.8611H22.3446V23.5341H26.0177V19.8611ZM30.763 19.8611H27.09V23.5341H30.763V19.8611ZM11.7821 19.8611H8.10906V23.5341H11.7821V19.8611ZM16.5274 15.2219H12.8544V18.8949H16.5274V15.2219ZM21.2723 15.2219H17.5993V18.8949H21.2723V15.2219ZM26.0177 15.2219H22.3446V18.8949H26.0177V15.2219ZM26.0177 10.5822H22.3446V14.2552H26.0177V10.5822Z",fill:"white"}),r.jsx("defs",{children:r.jsxs("linearGradient",{id:"paint0_linear_5607_1288",x1:0,y1:72,x2:48,y2:72,gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0D4DF2"}),r.jsx("stop",{offset:1,stopColor:"#2560FF"})]})})]}),W=c.forwardRef(E),v=c.forwardRef((e,t)=>r.jsx(f,{"data-testid":"AppLightLogo",...e,component:W,ref:t}));v.displayName="AppLight";function F({size:e}){return r.jsx(l,{sx:t=>({alignItems:"center",justifyContent:"center",backgroundColor:t.vars.palette.docker.blue[600],borderRadius:"4px",height:e,width:e}),children:r.jsx(A,{"data-testid":"default-org-logo",sx:{height:"60%",width:"60%",marginLeft:"0 !important"},htmlColor:"white"})})}function N({size:e}){return r.jsx(l,{sx:{alignItems:"center",justifyContent:"center",borderRadius:"4px",height:e,width:e},children:r.jsx(v,{})})}function D({user:e,size:t}){const a=()=>t===void 0||t<=24?"small":t<=40?"standard":"large",o=e.toUpperCase().split(" ").map(n=>n[0]).join();return r.jsx(S,{title:o,sx:{backgroundColor:"primary.dark"},imageAlt:e,size:a()})}function P({sx:e,size:t,namespace:a,accountDetails:o}){const n=o?.type==="user",i=(()=>{if(!o?.gravatar_url)return"";const d=o?.gravatar_url,s=new URL(d||"");return s.host==="gravatar.com"?M(s.toString(),{d:"404"}):s.toString()})();return a==="library"?r.jsx(N,{size:t}):r.jsx(j,{variant:n?"rounded":"square",src:i,alt:a,sx:C({borderRadius:n?"50%":"4px",width:t,height:t,background:"background.paper"},e),children:n?r.jsx(D,{user:a||"",size:t}):r.jsx(F,{size:t})})}const lr=V.memo(b(P)),T=(e,t)=>r.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...e,children:r.jsx("path",{d:"M13 11H17.8C18.9201 11 19.4802 11 19.908 11.218C20.2843 11.4097 20.5903 11.7157 20.782 12.092C21 12.5198 21 13.0799 21 14.2V21M13 21V6.2C13 5.0799 13 4.51984 12.782 4.09202C12.5903 3.71569 12.2843 3.40973 11.908 3.21799C11.4802 3 10.9201 3 9.8 3H6.2C5.0799 3 4.51984 3 4.09202 3.21799C3.71569 3.40973 3.40973 3.71569 3.21799 4.09202C3 4.51984 3 5.0799 3 6.2V21M22 21H2M6.5 7H9.5M6.5 11H9.5M6.5 15H9.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}),G=c.forwardRef(T),L=c.forwardRef((e,t)=>r.jsx(w,{"data-testid":"BuildingIcon",component:G,ref:t,...e}));L.muiName="Building";const O=(e,t)=>r.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...e,children:[r.jsx("path",{d:"M12 13C13.6569 13 15 11.6569 15 10C15 8.34315 13.6569 7 12 7C10.3431 7 9 8.34315 9 10C9 11.6569 10.3431 13 12 13Z",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M12 22C16 18 20 14.4183 20 10C20 5.58172 16.4183 2 12 2C7.58172 2 4 5.58172 4 10C4 14.4183 8 18 12 22Z",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]}),q=c.forwardRef(O),y=c.forwardRef((e,t)=>r.jsx(w,{"data-testid":"LocationIcon",component:q,ref:t,...e}));y.muiName="Location";const u="https://d36jcksde1wxzq.cloudfront.net/saas-mega/blueFingerprint.png";function J({alt:e,borderSize:t=3,hasGreyBorder:a=!1,src:o,sx:n,size:i=38}){const d=o?new URL(o):new URL(u);return d.searchParams.set("d",u),r.jsx(j,{src:d?.toString(),sx:C({"&.MuiAvatar-root":{display:"flex",justifyContent:"center",border:s=>o?`${t}px solid ${a?s.vars.palette.docker.grey[200]:s.vars.palette.docker.blue[300]}`:"",width:`${i+6}px`,height:`${i+6}px`},"&.MuiAvatar-colorDefault":{bgcolor:"transparent",border:"none",width:`${i+6}px`,height:`${i+6}px`},"& img":{width:`${i}px`,height:`${i}px`,padding:"3px",borderRadius:"50%",boxSizing:"content-box"}},n),alt:e})}function cr({company:e,description:t,displayName:a,isCurrentUser:o,location:n,avatar:i,profileType:d,profileUrl:s="",joinedDate:m,orgCTA:h,badge:H,productBadge:k}){const R=[d&&{id:"profileType",icon:r.jsx(I,{fontSize:"small"}),text:d},{id:"company",icon:r.jsx(L,{fontSize:"small"}),text:e},n&&{id:"location",icon:r.jsx(y,{fontSize:"small"}),text:n},s&&{id:"profileUrl",icon:r.jsx($,{color:"secondary",fontSize:"small"}),text:r.jsx(g,{href:s,rel:"nofollow noreferrer",children:s})},m&&{id:"joinedDate",icon:r.jsx(U,{color:"secondary",fontSize:"small"}),text:`Joined ${Z.utc(m).format("LL")}`}].map(x=>!x||_(x.text)?null:r.jsxs(l,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[x.icon," ",r.jsx(p,{variant:"body2",sx:{"& a":{textDecoration:"none"}},children:x.text})]},x.id));return r.jsxs(f,{"data-testid":"profile-header",children:[r.jsxs(l,{direction:{xs:"column",sm:"row"},spacing:{xs:4,sm:2},sx:[{alignItems:{xs:"center",sm:"flex-start"},py:4,maxHeight:"unset"},h!==void 0&&{maxHeight:"130px"}],children:[r.jsx(f,{"data-testid":"profileAvatar",sx:{minWidth:"160px",display:"flex",justifyContent:"center",alignItems:"center"},children:i||r.jsx(J,{size:80})}),r.jsxs(l,{spacing:1,children:[r.jsxs(l,{direction:{xs:"column",sm:"row"},spacing:{xs:0,sm:2},"data-testid":"profileName",sx:{alignItems:{sm:"center"}},children:[r.jsx(p,{variant:"h3",component:"h1",noWrap:!0,children:a}),k,o&&r.jsx("span",{children:r.jsx(g,{href:`${B()}/settings`,variant:"body2","data-testid":"editMyProfileLinkTest",children:"Edit profile"})})]}),H,t&&r.jsx(p,{variant:"body1",sx:{maxHeight:40,overflow:"hidden"},children:t}),r.jsx(l,{direction:"row",spacing:2,"data-testid":"profileDetails",sx:{flexWrap:"wrap",color:"secondary.main"},children:R})]})]}),h]})}export{cr as P,lr as W};