{"version":3,"file":"context.mjs","names":[],"sources":["../../../../../../../../src/lib/controller/overlay/context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { OverlayController } from \"@/lib/controller/overlay/OverlayController\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\n\nexport interface OverlayContext {\n  /**\n   * The enclosing overlays' controllers, keyed by the Flow component name the\n   * providing overlay registers itself under. Innermost wins per name – a\n   * `Modal` inside a `Modal` overwrites the `Modal` entry – but the map does\n   * not record which of two differently named overlays is the inner one.\n   */\n  byType: Partial<Record<FlowComponentName, OverlayController | undefined>>;\n  /**\n   * The controller of the innermost overlay this subtree is the _content_ of,\n   * whatever its component name. `undefined` outside any overlay content.\n   *\n   * Only providers that wrap overlay content set it. `OverlayTrigger` wraps the\n   * trigger as well, so it contributes to `byType` only – an `Action` in the\n   * trigger button is not inside the overlay it opens.\n   */\n  nearest?: OverlayController;\n}\n\nexport const overlayContext = createContext<OverlayContext>({ byType: {} });\n\nexport const useOverlayContext = (): OverlayContext =>\n  useContext(overlayContext);\n"],"mappings":";;;;AAuBA,IAAa,iBAAiB,cAA8B,EAAE,QAAQ,CAAC,EAAE,CAAC;AAE1E,IAAa,0BACX,WAAW,cAAc"}