import{r as s,E as p,_ as u,z as d,m as b,j as n,o as v,l as w,ay as y,P as E,B as T,ax as g,b as x,q as B}from"./index.Drusyo5m.js";var h=s.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(p,u({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))});h.displayName="Fullscreen";var f=s.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(p,u({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),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:"e9y9btk0"})(({theme:t,locked:e,target:o})=>({padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:e?c:"-1rem",right:t.spacing.none,transition:"none",...!e&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c},...o&&{[`${o}:hover &, ${o}:active &, ${o}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c}}}})),C=d("div",{target:"e9y9btk1"})(({theme:t})=>({color:b(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:t.shadows.toolbar,borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1,padding:t.spacing.twoXS})),M=d("div",{target:"e9y9btk2"})(({height:t,useContainerWidth:e,topCentered:o,useContainerHeight:a})=>({position:"relative",height:e&&t?t:a?t||"100%":"fit-content",maxWidth:"100%",width:e?"100%":"fit-content",...o?{display:"flex",justifyContent:"center"}:{}}));function m({label:t,show_label:e,icon:o,onClick:a}){const r=w(),i=e?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:v(x,{onClick:l=>{a&&a(),l.stopPropagation()},kind:T.ELEMENT_TOOLBAR,"aria-label":t,children:[o&&n(g,{content:o,size:"md",testid:"stElementToolbarButtonIcon"}),i&&n("span",{children:i})]})})})}const S=({onExpand:t,onCollapse:e,isFullScreen:o,locked:a,children:r,target:i,disableFullscreenMode:l})=>n(z,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||o,target:i,children:v(C,{"data-testid":"stElementToolbarButtonContainer",children:[r,t&&!l&&!o&&n(m,{label:"Fullscreen",icon:h,onClick:()=>t()}),e&&!l&&o&&n(m,{label:"Close fullscreen",icon:f,onClick:()=>e()})]})});export{M as S,S as T,m as a};
