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