{"version":3,"names":["getWindow","createEffect","createMemo","createSignal","contains","createStableCallback","useIsoLayoutEffect","getTarget","isMouseLikePointerType","createVirtualElement","domElement","data","offsetX","offsetY","isAutoUpdateEvent","contextElement","undefined","getBoundingClientRect","domRect","width","height","x","y","isXAxis","axis","isYAxis","canTrackCursorOnAutoUpdate","includes","dataRef","current","openEvent","type","pointerType","top","right","bottom","left","isMouseBasedEvent","event","clientX","useClientPoint","context","props","store","rootStore","isEnabled","enabled","axisOf","xProp","yProp","initialRef","cleanupListenerRef","setPointerType","name","ownedWrite","reactiveTick","setReactiveTick","setReference","newX","newY","referenceElement","domReference","state","domReferenceElement","set","handleReferenceEnterOrMove","open","clientY","currentTarget","t","openMemo","floatingMemo","floatingElement","domReferenceMemo","pointer","openCheck","win","handleMouseMove","target","addEventListener","removeListener","removeEventListener","reference","onPointerDown","onPointerEnter","onMouseMove","onMouseEnter","trigger"],"sources":["use-client-point.ts"],"sourcesContent":["/**\n * Stage 4.7 port of Base UI React's `useClientPoint` hook.\n *\n * React source:\n *   `base-ui/packages/react/src/floating-ui-react/hooks/useClientPoint.ts`\n *\n * Positions the floating element at a viewport client point (e.g. the\n * cursor). Used for context menus and tooltips that follow the cursor.\n * The hook installs a document `mousemove` listener while the floating\n * element is open and writes a fresh `VirtualElement` whose\n * `getBoundingClientRect()` returns the current `(x, y)` into the\n * store's `positionReference` slot — which `useFloating` prefers over\n * the raw `referenceElement`, so positioning tracks the cursor.\n *\n * ### React → Solid deviations\n *\n * 1. `useRef` → `MutableRef<T>` closures (matches sibling hooks). The\n *    `initialRef` / `cleanupListenerRef` state is preserved 1:1.\n *\n * 2. `useState<string | undefined>` (`pointerType`) →\n *    `createSignal<string | undefined>` so the listener-install effect\n *    re-runs when the pointer type changes (React's dep array doesn't\n *    actually include `pointerType`, but downstream reads inside the\n *    virtual-element factory go through the signal which is read\n *    lazily — correct either way).\n *\n * 3. `useState([])` (`reactive`) — React uses a tick-signal state to\n *    force the listener-install effect to re-run without changing any\n *    other dep. The Solid port uses a `createSignal<number>(0)` + bump\n *    counter with the same semantics.\n *\n * 4. `useStableCallback` → `createStableCallback`. Only used where the\n *    React source stabilized handler identity — Solid's\n *    non-re-rendering model doesn't strictly need it, but we preserve\n *    the shape for parity.\n *\n * 5. `useEffect(() => addListener(), [addListener, reactive])` → a\n *    single `createEffect(compute, apply)` that tracks the reactive\n *    inputs (`open`, `floatingElement`, `domReferenceElement`,\n *    `enabled`, `pointerType`, `reactiveTick`) and returns an\n *    `onCleanup` callback that removes the mousemove listener. The\n *    two smaller `useEffect`s that reset `initialRef` are collapsed\n *    into an `useIsoLayoutEffect` that runs synchronously on reactive\n *    changes.\n *\n * 6. React's `React.MouseEvent<Element>` → plain `MouseEvent`. The\n *    port's handler receives native events (Solid has no synthetic\n *    event wrapper).\n *\n * 7. Shadow-DOM-safe `contains()` from `src/internals/dom/contains.ts`\n *    replaces the raw `node.contains(target)` calls.\n *\n * 8. `React.useMemo` for the `reference` bag collapses to a plain\n *    object literal — Solid component bodies don't re-run, so the bag\n *    identity is already stable.\n *\n * ### Reason strings\n *\n * None. `useClientPoint` doesn't call `store.setOpen` — it only writes\n * the `positionReference` slot, so no `REASONS.*` mapping applies.\n */\nimport { getWindow } from \"@floating-ui/utils/dom\";\nimport { createEffect, createMemo, createSignal } from \"solid-js\";\nimport { contains } from \"../../dom/contains\";\nimport { createStableCallback } from \"../../stable-callback\";\nimport { useIsoLayoutEffect } from \"../../use-iso-layout-effect\";\nimport type {\n\tContextData,\n\tElementProps,\n\tFloatingContext,\n\tFloatingRootContext,\n\tMutableRef,\n\tReferenceType,\n} from \"../types\";\nimport { getTarget } from \"../utils/element\";\nimport { isMouseLikePointerType } from \"../utils/event\";\n\nfunction createVirtualElement(\n\tdomElement: Element | null | undefined,\n\tdata: {\n\t\taxis: \"x\" | \"y\" | \"both\";\n\t\tdataRef: MutableRef<ContextData>;\n\t\tpointerType: string | undefined;\n\t\tx: number | null;\n\t\ty: number | null;\n\t},\n): ReferenceType {\n\tlet offsetX: number | null = null;\n\tlet offsetY: number | null = null;\n\tlet isAutoUpdateEvent = false;\n\n\treturn {\n\t\tcontextElement: domElement || undefined,\n\t\tgetBoundingClientRect() {\n\t\t\tconst domRect = domElement?.getBoundingClientRect() || {\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0,\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t};\n\n\t\t\tconst isXAxis = data.axis === \"x\" || data.axis === \"both\";\n\t\t\tconst isYAxis = data.axis === \"y\" || data.axis === \"both\";\n\t\t\tconst canTrackCursorOnAutoUpdate =\n\t\t\t\t[\"mouseenter\", \"mousemove\"].includes(\n\t\t\t\t\tdata.dataRef.current.openEvent?.type || \"\",\n\t\t\t\t) && data.pointerType !== \"touch\";\n\n\t\t\tlet width = domRect.width;\n\t\t\tlet height = domRect.height;\n\t\t\tlet x = domRect.x;\n\t\t\tlet y = domRect.y;\n\n\t\t\tif (offsetX == null && data.x && isXAxis) {\n\t\t\t\toffsetX = domRect.x - data.x;\n\t\t\t}\n\n\t\t\tif (offsetY == null && data.y && isYAxis) {\n\t\t\t\toffsetY = domRect.y - data.y;\n\t\t\t}\n\n\t\t\tx -= offsetX || 0;\n\t\t\ty -= offsetY || 0;\n\t\t\twidth = 0;\n\t\t\theight = 0;\n\n\t\t\tif (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n\t\t\t\twidth = data.axis === \"y\" ? domRect.width : 0;\n\t\t\t\theight = data.axis === \"x\" ? domRect.height : 0;\n\t\t\t\tx = isXAxis && data.x != null ? data.x : x;\n\t\t\t\ty = isYAxis && data.y != null ? data.y : y;\n\t\t\t} else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {\n\t\t\t\theight = data.axis === \"x\" ? domRect.height : height;\n\t\t\t\twidth = data.axis === \"y\" ? domRect.width : width;\n\t\t\t}\n\n\t\t\tisAutoUpdateEvent = true;\n\n\t\t\treturn {\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tx,\n\t\t\t\ty,\n\t\t\t\ttop: y,\n\t\t\t\tright: x + width,\n\t\t\t\tbottom: y + height,\n\t\t\t\tleft: x,\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction isMouseBasedEvent(event: Event | undefined): event is MouseEvent {\n\treturn event != null && (event as MouseEvent).clientX != null;\n}\n\nexport interface UseClientPointProps {\n\t/**\n\t * Whether the Hook is enabled, including all internal Effects and event\n\t * handlers.\n\t * @default true\n\t */\n\tenabled?: boolean | undefined;\n\t/**\n\t * Whether to restrict the client point to an axis and use the reference\n\t * element (if it exists) as the other axis. This can be useful if the\n\t * floating element is also interactive.\n\t * @default 'both'\n\t */\n\taxis?: \"x\" | \"y\" | \"both\" | undefined;\n\t/**\n\t * An explicitly provided `x` client coordinate.\n\t * @default null\n\t */\n\tx?: number | null | undefined;\n\t/**\n\t * An explicitly provided `y` client coordinate.\n\t * @default null\n\t */\n\ty?: number | null | undefined;\n}\n\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nexport function useClientPoint(\n\tcontext: FloatingRootContext | FloatingContext,\n\tprops: UseClientPointProps = {},\n): ElementProps {\n\tconst store = \"rootStore\" in context ? context.rootStore : context;\n\tconst dataRef = store.context.dataRef;\n\n\t// Lazy accessors so consumer-passed `get enabled()` / `get axis()`\n\t// stay reactive AND don't trip `[STRICT_READ_UNTRACKED]` from this\n\t// hook's body (which runs inside the parent component's untracked\n\t// scope). Use sites read via the accessor; effects fold the value\n\t// into compute so apply stays clean.\n\tconst isEnabled = (): boolean =>\n\t\tprops.enabled === undefined ? true : props.enabled;\n\tconst axisOf = (): \"x\" | \"y\" | \"both\" =>\n\t\tprops.axis === undefined ? \"both\" : props.axis;\n\tconst { x: xProp = null, y: yProp = null } = props;\n\n\t// React `useRef` equivalents.\n\tconst initialRef: MutableRef<boolean> = { current: false };\n\tconst cleanupListenerRef: MutableRef<null | (() => void)> = { current: null };\n\n\tconst [pointerType, setPointerType] = createSignal<string | undefined>(\n\t\tundefined,\n\t\t{ name: \"useClientPoint.pointerType\", ownedWrite: true },\n\t);\n\t// React uses `useState([])` + `setReactive([])` as a tick-signal to\n\t// re-run the listener-install effect. Solid equivalent: a bumped counter.\n\tconst [reactiveTick, setReactiveTick] = createSignal(0, {\n\t\tname: \"useClientPoint.reactiveTick\",\n\t\townedWrite: true,\n\t});\n\n\tconst setReference = createStableCallback<\n\t\t(\n\t\t\tnewX: number | null,\n\t\t\tnewY: number | null,\n\t\t\treferenceElement?: Element | null,\n\t\t) => void\n\t>(\n\t\t() =>\n\t\t\t(\n\t\t\t\tnewX: number | null,\n\t\t\t\tnewY: number | null,\n\t\t\t\treferenceElement?: Element | null,\n\t\t\t) => {\n\t\t\t\tif (initialRef.current) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Prevent setting if the open event was not a mouse-like one\n\t\t\t\t// (e.g. focus to open, then hover over the reference element).\n\t\t\t\t// Only apply if the event exists.\n\t\t\t\tif (\n\t\t\t\t\tdataRef.current.openEvent &&\n\t\t\t\t\t!isMouseBasedEvent(dataRef.current.openEvent)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst domReference = store.state.domReferenceElement;\n\t\t\t\tstore.set(\n\t\t\t\t\t\"positionReference\",\n\t\t\t\t\tcreateVirtualElement(referenceElement ?? domReference, {\n\t\t\t\t\t\tx: newX,\n\t\t\t\t\t\ty: newY,\n\t\t\t\t\t\taxis: axisOf(),\n\t\t\t\t\t\tdataRef,\n\t\t\t\t\t\tpointerType: pointerType(),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t);\n\n\tconst handleReferenceEnterOrMove = createStableCallback<\n\t\t(event: MouseEvent) => void\n\t>(() => (event: MouseEvent) => {\n\t\tif (!store.state.open) {\n\t\t\tsetReference(\n\t\t\t\tevent.clientX,\n\t\t\t\tevent.clientY,\n\t\t\t\tevent.currentTarget as Element,\n\t\t\t);\n\t\t} else if (!cleanupListenerRef.current) {\n\t\t\t// If there's no cleanup, there's no listener, but we want to ensure\n\t\t\t// we add the listener if the cursor landed on the floating element\n\t\t\t// and then back on the reference (i.e. it's interactive).\n\t\t\tsetReactiveTick((t) => t + 1);\n\t\t}\n\t});\n\n\t// Per-key memos de-dupe the store's coarse `equals: false` signal into\n\t// per-field identity-equal accessors. Without this, writes from inside\n\t// the main effect (below) would re-fire the compute with a fresh tuple\n\t// each time and loop. With the memos, compute only re-runs when an\n\t// individual key's identity changes.\n\tconst openMemo = createMemo(() => store.state.open);\n\tconst floatingMemo = createMemo(() => store.state.floatingElement);\n\tconst domReferenceMemo = createMemo(() => store.state.domReferenceElement);\n\n\t// Main listener-install effect. React keyed this on\n\t// `[openCheck, enabled, floating, dataRef, domReference, store,\n\t// setReference]` plus a re-tick via `reactive`.\n\tcreateEffect(\n\t\t() => {\n\t\t\t// Tracked reads — mirrors React's dep array, through the\n\t\t\t// per-key memos so writes we make inside apply don't re-fire\n\t\t\t// the compute. Also captures `pointerType` here so the apply\n\t\t\t// callback never reads it directly (apply is unowned + strict).\n\t\t\tconst open = openMemo();\n\t\t\tconst floatingElement = floatingMemo();\n\t\t\tconst domReferenceElement = domReferenceMemo();\n\t\t\treactiveTick();\n\t\t\tconst pointer = pointerType();\n\t\t\tconst enabled = isEnabled();\n\t\t\tconst axis = axisOf();\n\t\t\treturn {\n\t\t\t\topen,\n\t\t\t\tfloatingElement,\n\t\t\t\tdomReferenceElement,\n\t\t\t\tpointer,\n\t\t\t\tenabled,\n\t\t\t\taxis,\n\t\t\t};\n\t\t},\n\t\t({\n\t\t\topen,\n\t\t\tfloatingElement,\n\t\t\tdomReferenceElement,\n\t\t\tpointer,\n\t\t\tenabled,\n\t\t\taxis,\n\t\t}) => {\n\t\t\t// Mirror React's `openCheck`: for mouse-like pointers keep\n\t\t\t// tracking even while the floating element is transitioning\n\t\t\t// out; for touch gate strictly on `open`.\n\t\t\tconst openCheck = isMouseLikePointerType(pointer)\n\t\t\t\t? floatingElement\n\t\t\t\t: open;\n\n\t\t\tif (!openCheck || !enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Controlled override: `x` / `y` props bypass cursor tracking.\n\t\t\tif (xProp != null || yProp != null) {\n\t\t\t\tinitialRef.current = false;\n\t\t\t\tstore.set(\n\t\t\t\t\t\"positionReference\",\n\t\t\t\t\tcreateVirtualElement(domReferenceElement, {\n\t\t\t\t\t\tx: xProp,\n\t\t\t\t\t\ty: yProp,\n\t\t\t\t\t\taxis,\n\t\t\t\t\t\tdataRef,\n\t\t\t\t\t\tpointerType: pointer,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst win = getWindow(floatingElement);\n\n\t\t\tfunction handleMouseMove(event: MouseEvent) {\n\t\t\t\tconst target = getTarget(event) as Element | null;\n\n\t\t\t\tif (!contains(floatingElement, target)) {\n\t\t\t\t\tsetReference(event.clientX, event.clientY);\n\t\t\t\t} else {\n\t\t\t\t\tcleanupListenerRef.current?.();\n\t\t\t\t\tcleanupListenerRef.current = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!dataRef.current.openEvent ||\n\t\t\t\tisMouseBasedEvent(dataRef.current.openEvent)\n\t\t\t) {\n\t\t\t\twin.addEventListener(\"mousemove\", handleMouseMove);\n\t\t\t\tconst removeListener = () => {\n\t\t\t\t\twin.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\t\t};\n\t\t\t\tcleanupListenerRef.current = () => {\n\t\t\t\t\tremoveListener();\n\t\t\t\t\tcleanupListenerRef.current = null;\n\t\t\t\t};\n\t\t\t\treturn () => {\n\t\t\t\t\tremoveListener();\n\t\t\t\t\tcleanupListenerRef.current = null;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tstore.set(\"positionReference\", domReferenceElement);\n\t\t\treturn undefined;\n\t\t},\n\t);\n\n\t// Reset `initialRef` when the floating element detaches (React runs\n\t// this inside a dedicated `useEffect`).\n\tuseIsoLayoutEffect(\n\t\t() => ({\n\t\t\tfloatingElement: store.state.floatingElement,\n\t\t\tenabled: isEnabled(),\n\t\t}),\n\t\t({ floatingElement, enabled }) => {\n\t\t\tif (enabled && !floatingElement) {\n\t\t\t\tinitialRef.current = false;\n\t\t\t}\n\t\t},\n\t);\n\n\t// Snapshot `initialRef` when disabled while open (React runs this\n\t// inside a dedicated `useEffect`). Prevents a stale cursor tracking\n\t// from overwriting the positionReference after `enabled` flips off.\n\tuseIsoLayoutEffect(\n\t\t() => ({ open: store.state.open, enabled: isEnabled() }),\n\t\t({ open, enabled }) => {\n\t\t\tif (!enabled && open) {\n\t\t\t\tinitialRef.current = true;\n\t\t\t}\n\t\t},\n\t);\n\n\tconst reference: ElementProps[\"reference\"] = {\n\t\tonPointerDown(event: PointerEvent) {\n\t\t\tif (!isEnabled()) return;\n\t\t\tsetPointerType(event.pointerType);\n\t\t},\n\t\tonPointerEnter(event: PointerEvent) {\n\t\t\tif (!isEnabled()) return;\n\t\t\tsetPointerType(event.pointerType);\n\t\t},\n\t\tonMouseMove(event: MouseEvent) {\n\t\t\tif (!isEnabled()) return;\n\t\t\thandleReferenceEnterOrMove(event);\n\t\t},\n\t\tonMouseEnter(event: MouseEvent) {\n\t\t\tif (!isEnabled()) return;\n\t\t\thandleReferenceEnterOrMove(event);\n\t\t},\n\t};\n\n\treturn { reference, trigger: reference };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,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