import{jsxs as e,jsx as t}from"react/jsx-runtime";import d from"../../primitives/button.js";import"../../primitives/checkbox.js";import"../../primitives/dropdown-selector.js";import{Popover as a}from"../../primitives/popover.js";import"../../primitives/radio.js";import"../../primitives/segmented-control.js";import"../../primitives/switch.js";import s from"../../primitives/text.js";import{css as f}from"@styled/css/css";import{Stack as l,Divider as h}from"@styled/jsx";import{useState as u,useEffect as g}from"react";const x=({avatarUrl:i,email:o,name:r,logoutLabel:c="Log out",onLogout:m})=>{const[p,n]=u(!1);return g(()=>{n(!1)},[i]),e(a,{iconSize:28,placement:"bottom right",variant:"text",children:[t(a.LeadingIcon,{children:i&&!p?t("img",{style:{borderRadius:"50%"},src:i,alt:"user avatar",onError:()=>n(!0)}):e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",children:[t("circle",{cx:"14",cy:"14",r:"13",fill:"url(#paint0_radial_3600_63997)",stroke:"white",strokeOpacity:"0.24",strokeWidth:"0.5"}),t("defs",{children:e("radialGradient",{id:"paint0_radial_3600_63997",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15 30.75) rotate(-90) scale(37.3333 65.833)",children:[t("stop",{offset:"0.01",stopColor:"#FFF507"}),t("stop",{offset:"0.259381",stopColor:"#F09BEB"}),t("stop",{offset:"0.598165",stopColor:"#412CB9"}),t("stop",{offset:"1",stopColor:"#18171A"})]})})]})}),t(a.Content,{className:f({w:r&&o?"200px":"fit-content",maxW:"200px"}),children:e(l,{w:"full",alignItems:"start",gap:0,children:[(o||r)&&e(l,{w:"full",gap:1,children:[r&&t(s,{fontWeight:"medium",children:r}),o&&t(s,{size:"sm",truncate:!0,fontColor:"text.secondary",children:o})]}),(o||r)&&t(h,{color:"surface.quaternary",my:3,minW:"88px"}),t(d,{label:c,textStyle:"negative",variant:"text",size:"sm",onPress:m})]})})]})};export{x as AccountMenu};
//# sourceMappingURL=account-menu.js.map
