{"version":3,"names":["createEventEmitter","FloatingTreeStore","nodesRef","current","events","addNode","node","push","removeNode","index","indexOf","splice"],"sources":["floating-tree-store.ts"],"sourcesContent":["/**\n * Stage 3 port of Base UI React's `FloatingTreeStore`\n * (`packages/react/src/floating-ui-react/components/FloatingTreeStore.ts`).\n *\n * Stores and manages floating elements in a tree structure. Used as the\n * backing store for the `FloatingTree` component, and consumed by the\n * `useDismiss` / nested `useHover` paths (Stage 4) to traverse parent /\n * child relationships.\n *\n * Port notes:\n * - The React source uses a plain mutable `nodesRef: RefObject<Array<...>>`\n *   for the node list. The Solid port keeps the exact same shape —\n *   `MutableRef<FloatingNodeType[]>` — so call sites (`tree.nodesRef.current`)\n *   look identical. This is a ref-like, not a signal: consumers that need\n *   reactivity subscribe to the `events` emitter for `\"addnode\"` /\n *   `\"removenode\"` instead. Matches React (the original has no signal-style\n *   subscription either; `FloatingTree` itself is just a context carrier).\n * - Events are emitted via the same shared `createEventEmitter` utility.\n */\n\nimport type { FloatingEvents, FloatingNodeType, MutableRef } from \"../types\";\nimport { createEventEmitter } from \"../utils/create-event-emitter\";\n\nexport class FloatingTreeStore {\n\tpublic readonly nodesRef: MutableRef<Array<FloatingNodeType>> = {\n\t\tcurrent: [],\n\t};\n\n\tpublic readonly events: FloatingEvents = createEventEmitter();\n\n\tpublic addNode(node: FloatingNodeType): void {\n\t\tthis.nodesRef.current.push(node);\n\t}\n\n\tpublic removeNode(node: FloatingNodeType): void {\n\t\tconst index = this.nodesRef.current.indexOf(node);\n\t\tif (index !== -1) {\n\t\t\tthis.nodesRef.current.splice(index, 1);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,kBAAkB,QAAQ,+BAA+B;AAElE,OAAO,MAAMC,iBAAiB,CAAC;EACdC,QAAQ,GAAwC;IAC/DC,OAAO,EAAE;EACV,CAAC;EAEeC,MAAM,GAAmBJ,kBAAkB,CAAC,CAAC;EAEtDK,OAAOA,CAACC,IAAsB,EAAQ;IAC5C,IAAI,CAACJ,QAAQ,CAACC,OAAO,CAACI,IAAI,CAACD,IAAI,CAAC;EACjC;EAEOE,UAAUA,CAACF,IAAsB,EAAQ;IAC/C,MAAMG,KAAK,GAAG,IAAI,CAACP,QAAQ,CAACC,OAAO,CAACO,OAAO,CAACJ,IAAI,CAAC;IACjD,IAAIG,KAAK,KAAK,CAAC,CAAC,EAAE;MACjB,IAAI,CAACP,QAAQ,CAACC,OAAO,CAACQ,MAAM,CAACF,KAAK,EAAE,CAAC,CAAC;IACvC;EACD;AACD","ignoreList":[]}