"use strict";var v=Object.create;var x=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var r in t)x(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of h(t))!g.call(e,i)&&i!==r&&x(e,i,{get:()=>t[i],enumerable:!(s=y(t,i))||s.enumerable});return e};var k=(e,t,r)=>(r=e!=null?v(P(e)):{},C(t||!e||!e.__esModule?x(r,"default",{value:e,enumerable:!0}):r,e)),G=e=>C(x({},"__esModule",{value:!0}),e);var b={};U(b,{UNSET_VALUE:()=>p,createOptionalContext:()=>E,createRequiredContext:()=>$,notSet:()=>c});module.exports=G(b);var n=k(require("react"),1);var p=Symbol.for("required-react-context/unset-value");function d(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function u(e,t){if(!e)throw new Error(t)}var c=(e,t)=>`${e}: context value is not set. Use ${t} to set the value.`,l=(e,{providerName:t,contextName:r})=>Object.assign((0,n.createContext)(e),{providerName:t,displayName:r}),f=(e,t)=>{for(let[r,s]of Object.entries(e))u(typeof s=="string",`${t}: Expected ${r} to be a string. Got: ${typeof s}`);e.hookName&&u(e.hookName.startsWith("use"),`${t}: hookName must start with "use". Got: ${e.hookName}`)},T=({name:e,contextName:t=`${d(e)}Context`,providerName:r=`${d(e)}Provider`,providerProp:s=e,consumerName:i=`${d(e)}Consumer`,hookName:m=`use${d(e)}`})=>({name:e,contextName:t,providerName:r,providerProp:s,consumerName:i,hookName:m});function $(){return{with(e){f(e,"createRequiredContext");let{contextName:t,providerName:r,providerProp:s,consumerName:i,hookName:m}=T(e),N=l(p,{providerName:r,contextName:t});return{[t]:N,[r](o){return n.default.createElement(N.Provider,{value:o[s]},o.children)},[i](o){return n.default.createElement(N.Consumer,null,a=>(u(a!==p,c(i,r)),o.children(a)))},[m](){let o=(0,n.useContext)(N);return u(o!==p,c(m,r)),(0,n.useDebugValue)(o),o}}}}}function E(e){return{with(t){f(t,"createOptionalContext");let{contextName:r,providerName:s,providerProp:i,consumerName:m,hookName:N}=T(t),o=l(e,{providerName:s,contextName:r});return{[r]:o,[s](a){return n.default.createElement(o.Provider,{value:a[i]},a.children)},[m](a){return n.default.createElement(o.Consumer,{...a})},[N](){let a=(0,n.useContext)(o);return(0,n.useDebugValue)(a),a}}}}}0&&(module.exports={UNSET_VALUE,createOptionalContext,createRequiredContext,notSet}); //# sourceMappingURL=index.cjs.map