"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),s=require("../machines/stack-machine.js"),r=require("../react-glue.js"),t=require("./use-iso-morphic-effect.js");exports.useIsTopLayer=function(c,i){let u=e.useId(),o=s.stackMachines.get(i),[a,n]=r.useSlice(o,e.useCallback((e=>[o.selectors.isTop(e,u),o.selectors.inStack(e,u)]),[o,u]));return t.useIsoMorphicEffect((()=>{if(c)return o.actions.push(u),()=>o.actions.pop(u)}),[o,c,u]),!!c&&(!n||a)};
//# sourceMappingURL=use-is-top-layer.js.map
