import{h as e,r as t}from"./parser-CO9mSyAT-DpTf752T.js";import{K as n,dt as r,pt as i,q as a,z as o}from"./documents-Dt-ukOSU-BVqbxOXK.js";import{createContext as s,useContext as c,useMemo as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=h(n)?.definitions??[],f=h(i)?.definitions??[],p=[...d,...f];function m(e,n,i){let a=[...p];for(let t of[e,n,i]){if(!t)continue;let e=h(t);e&&a.push(...e.definitions)}return r(o({kind:t.DOCUMENT,definitions:a}))}function h(t){try{return t?e(t):null}catch{return null}}var g=s({sharedSchema:a,error:void 0});function _(e,t,n){try{return{sharedSchema:m(e,t,n),error:void 0}}catch(e){return{sharedSchema:a,error:e instanceof Error?e:Error(typeof e==`string`?e:JSON.stringify(e),{cause:e})}}}function v(e){let{children:t,globalStateSchemaSdl:n,localStateSchemaSdl:r,operationSchemasSdl:i}=e,a=l(()=>_(n,r,i),[n,r,i]);return u(g.Provider,{value:a,children:t})}function y(){return c(g)}export{h as n,y as r,v as t};
//# sourceMappingURL=schema-context-BI_GX1rt-ht02k7AL.js.map