import{j as s}from"./index-6605a014.js";import{r as n}from"./react-e45097e1.js";import{V as m,y as f,D as j,X as y,x as h,Z as p,_ as g}from"./Author-826c76c5.js";import{L as C}from"./antd-6dbc138d.js";function I(){return s.jsx(m,{style:{position:"absolute",left:0,right:0,top:0,bottom:0,zIndex:10,alignItems:"center",justifyContent:"center"},children:s.jsx(C,{spin:!0})})}function P({children:t}){const e=f(),{importComponent:o}=j(),[[r,u],i]=n.useState([void 0,void 0]);return n.useEffect(()=>{const c=e.className.match(/^@(\w+)(?::(.+))?$/);if(c){const[x]=c.slice(1,3);if(x==="internal"){let a;if(o&&(a=o(e.className)),a||(a=y(e.className)),a){a.then(({default:l})=>{l.isLayoutable&&e.setData({isLayoutable:!0}),i([l,void 0])});return}}}i([n.Fragment,void 0])},[e,o]),r===void 0?s.jsx(I,{}):s.jsx(r,{...u,children:t})}function v({gpui:t,overlayStyles:e}){return n.useEffect(()=>{e&&t.setOverlayStyles(e)},[t,e]),s.jsx(p,{gpui:t,children:s.jsx(d,{})})}function d(){const t=f(),[e,o]=n.useState({}),[r]=h(["default"]);n.useEffect(()=>{t.className==="@internal:Columns"?o({"default.margin":0,"default.height":"100%"}):t.className==="@internal:Clipboard"&&o({"default.position":"absolute"})},[t.className]);const u=s.jsx(P,{children:t.children.map(i=>s.jsx(v,{gpui:i,overlayStyles:e},i.instanceId))});return s.jsx(m,{style:r,children:u})}function G({schema:t}){const e=n.useMemo(()=>new g(t),[t]);return s.jsx(p,{gpui:e,children:s.jsx(d,{})})}export{G as P};
