import ReactDOM__default from"react-dom";import React__default,{useRef,useState}from"react";var ShadowRoot=function(a){var b=a.mode,c=void 0===b?"open":b,d=a.delegatesFocus,e=a.children,f=void 0===e?null:e,g=useRef(null),h=useState(),i=h[0],j=h[1];return React__default.useEffect(function(){g.current&&j(g.current.attachShadow({delegatesFocus:void 0!==d&&d,mode:c}))},[]),(React__default.createElement("div",{ref:g,"data-shadow-host":"true",style:{height:"100%"}},i&&ReactDOM__default.createPortal(f,i)))};export{ShadowRoot as S};