{"version":3,"names":["getParentNode","isHTMLElement","isLastTraversableNode","findRootOwnerId","node","hasAttribute","getAttribute","undefined"],"sources":["find-root-owner-id.ts"],"sourcesContent":["/**\n * `findRootOwnerId` — walks up from a node to find the nearest ancestor\n * carrying `data-rootownerid`. Mirrors\n * `packages/react/src/menu/utils/findRootOwnerId.ts`.\n *\n * Used by `<ContextMenu.Trigger>`'s mouseup handler to detect mouseups\n * that originated inside a nested menu owned by this root (so a nested\n * context menu's mouseup doesn't cancel the outer open).\n */\nimport {\n\tgetParentNode,\n\tisHTMLElement,\n\tisLastTraversableNode,\n} from \"@floating-ui/utils/dom\";\n\nexport function findRootOwnerId(node: Node): string | undefined {\n\tif (isHTMLElement(node) && node.hasAttribute(\"data-rootownerid\")) {\n\t\treturn node.getAttribute(\"data-rootownerid\") ?? undefined;\n\t}\n\n\tif (isLastTraversableNode(node)) {\n\t\treturn undefined;\n\t}\n\n\treturn findRootOwnerId(getParentNode(node));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACCA,aAAa,EACbC,aAAa,EACbC,qBAAqB,QACf,wBAAwB;AAE/B,OAAO,SAASC,eAAeA,CAACC,IAAU,EAAsB;EAC/D,IAAIH,aAAa,CAACG,IAAI,CAAC,IAAIA,IAAI,CAACC,YAAY,CAAC,kBAAkB,CAAC,EAAE;IACjE,OAAOD,IAAI,CAACE,YAAY,CAAC,kBAAkB,CAAC,IAAIC,SAAS;EAC1D;EAEA,IAAIL,qBAAqB,CAACE,IAAI,CAAC,EAAE;IAChC,OAAOG,SAAS;EACjB;EAEA,OAAOJ,eAAe,CAACH,aAAa,CAACI,IAAI,CAAC,CAAC;AAC5C","ignoreList":[]}