import{h as i,j as c}from"./codemirror-core-DIzFijqu.js";import{c7 as $,I as v,i as b,aR as h,c8 as j}from"./react-dom-C0IJc3nR.js";var y=Symbol("default");function S(e,l){let t=i.useContext(e);if(l===null)return null;if(t&&typeof t=="object"&&"slots"in t&&t.slots){let a=new Intl.ListFormat().format(Object.keys(t.slots).map(o=>`"${o}"`));if(!l&&!t.slots[y])throw new Error(`A slot prop is required. Valid slot names are ${a}.`);let s=l||y;if(!t.slots[s])throw new Error(`Invalid slot "${l}". Valid slot names are ${a}.`);return t.slots[s]}return t}function w(e,l,t){let a=S(t,e.slot)||{},{ref:s,...o}=a,f=$(i.useMemo(()=>v(l,s),[l,s])),n=b(o,e);return"style"in o&&o.style&&"style"in e&&e.style&&(typeof o.style=="function"||typeof e.style=="function"?n.style=r=>{let m=typeof o.style=="function"?o.style(r):o.style,u={...r.defaultStyle,...m},x=typeof e.style=="function"?e.style({...r,defaultStyle:u}):e.style;return{...u,...x}}:n.style={...o.style,...e.style}),[n,f]}var d=i.createContext(null),C=i.forwardRef(function(l,t){[l,t]=w(l,t,d);let{validationErrors:a,validationBehavior:s="native",children:o,className:f,...n}=l;const r=i.useMemo(()=>h({className:f}),[f]);return c.jsx("form",{noValidate:s!=="native",...n,ref:t,className:r,children:c.jsx(d.Provider,{value:{...l,validationBehavior:s},children:c.jsx(j.Provider,{value:a??{},children:o})})})});export{C as F,d as a,S as u};
