{"version":3,"file":"useIsland.cjs","names":["getContext","ISLAND_CONTEXT_KEY"],"sources":["../../src/Island/useIsland.ts"],"sourcesContent":["import { getContext } from '../GlobalContext';\nimport { ISLAND_CONTEXT_KEY } from './constants';\n\n/**\n * Returns whether the current component is rendered inside an {@link Island}.\n *\n * Entry adapters use this signal to hydrate nested entries only when they are\n * mounted as part of an island hydration boundary.\n * The local React Island provider is used first; when it is absent, the hook\n * reads `ISLAND_CONTEXT_KEY` from `GlobalContext`, matching the portal helpers.\n *\n * @returns `true` inside an `Island`, otherwise `false`.\n *\n * @example\n * ```tsx\n * function DebugIslandState() {\n *   const isIsland = useIsland();\n *\n *   return <span>{isIsland ? 'island' : 'page'}</span>;\n * }\n * ```\n */\nexport function useIsland(): boolean {\n  return !!getContext<boolean>(ISLAND_CONTEXT_KEY);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,YAAqB;CACnC,OAAO,CAAC,CAACA,iCAAAA,WAAoBC,eAAAA,kBAAkB;AACjD"}