import{r as s,E as p,_ as u,s as d,h as w,j as n,e as h,u as x,ak as y,P as E,B as b,al as g,b as T,S as B}from"./index.Bzd-hLkw.js";var v=s.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(p,u({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))});v.displayName="Fullscreen";var f=s.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(p,u({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))});f.displayName="FullscreenExit";const c="-2.65rem",z=d("div",{target:"ekeylwq0"})(({theme:t,locked:o,target:e})=>({padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:o?c:"-1rem",right:t.spacing.none,transition:"none",...!o&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c},...e&&{[`${e}:hover &, ${e}:active &, ${e}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c}}}})),C=d("div",{target:"ekeylwq1"})(({theme:t})=>({color:w(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1,padding:t.spacing.twoXS})),S=d("div",{target:"ekeylwq2"})(({height:t,useContainerWidth:o,topCentered:e,useContainerHeight:a})=>({position:"relative",height:o&&t?t:a?t||"100%":"fit-content",maxWidth:"100%",width:o?"100%":"fit-content",...e?{display:"flex",justifyContent:"center"}:{}}));function m({label:t,show_label:o,icon:e,onClick:a}){const r=x(),l=o?t:"";return n("div",{"data-testid":"stElementToolbarButton",children:n(y,{content:n(B,{source:t,allowHTML:!1,style:{fontSize:r.fontSizes.sm}}),placement:E.TOP,onMouseEnterDelay:1e3,inline:!0,children:h(T,{onClick:i=>{a&&a(),i.stopPropagation()},kind:b.ELEMENT_TOOLBAR,"aria-label":t,children:[e&&n(g,{content:e,size:"md",testid:"stElementToolbarButtonIcon"}),l&&n("span",{children:l})]})})})}const M=({onExpand:t,onCollapse:o,isFullScreen:e,locked:a,children:r,target:l,disableFullscreenMode:i})=>n(z,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||e,target:l,children:h(C,{"data-testid":"stElementToolbarButtonContainer",children:[r,t&&!i&&!e&&n(m,{label:"Fullscreen",icon:v,onClick:()=>t()}),o&&!i&&e&&n(m,{label:"Close fullscreen",icon:f,onClick:()=>o()})]})});export{S,M as T,m as a};
