import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{K_ as s}from"./shared-0-C4kdVF7Y.js";import{Mi as r,ki as o}from"./vendor-frame-CwiylG4Y.js";import{Fl as t}from"./shared-1-3-6x7RKF.js";var a=e(r()),n=o(),u=(0,a.createContext)({isExpanded:!0,setIsExpanded:()=>{},setIsExpandedTransient:()=>{},registerComposerRef:()=>{},focusComposer:()=>{}});function d(){return(0,a.useContext)(u)}function i({children:e}){const[r,o]=t(s.CODE_SIDEBAR_PINNED,!0),[d,i]=(0,a.useState)(r),c=(0,a.useRef)(null),l=(0,a.useCallback)(e=>{i(e),o(e)},[o]),m=(0,a.useCallback)(e=>{i(e)},[]),p=(0,a.useCallback)(e=>{c.current=e},[]),f=(0,a.useCallback)(()=>{setTimeout(()=>{c.current?.current?.focus()},50)},[]),C=(0,a.useMemo)(()=>({isExpanded:d,setIsExpanded:l,setIsExpandedTransient:m,registerComposerRef:p,focusComposer:f}),[d,l,m,p,f]);return(0,n.jsx)(u.Provider,{value:C,children:e})}export{d as n,i as t};