import { isServer } from "@solidjs/web";
import { isHydrating as isSolidHydrating } from "solid-js";

/**
 * Whether we are inside the hydration window — the Solid-2 equivalent of Base
 * UI React's `useIsHydrating`.
 *
 * Returns `true` while the markup is being produced or attached and must stay
 * byte-stable across the server→client boundary, and `false` for a
 * client-only (CSR) render. Concretely:
 *
 *   - **Server** (`renderToString*`): `isServer` is `true`. Solid's
 *     `isHydrating()` is always `false` on the server, so the `isServer` arm
 *     is what reports the hydration window here.
 *   - **Client, hydrating** (`hydrate()` or a resuming streamed `<Loading>`
 *     boundary): Solid's `isHydrating()` is `true` while server DOM is being
 *     claimed — so the first client pass sees the same value the server did
 *     and emits identical markup (no mismatch).
 *   - **Client, CSR or post-hydration**: both arms are `false`.
 *
 * Used to gate pre-paint `visibility: hidden` on geometry-positioned parts
 * (slider thumb / indicator in `renderBeforeHydration` mode) so the SSR'd
 * HTML doesn't flash at a wrong position before the prehydration script /
 * first measurement runs.
 *
 * NOTE: this is a plain read, not a reactive source, so read it where the
 * component is created. A consumer that needs to re-reveal *after* hydration
 * should depend on a measurement signal (which updates post-mount) rather
 * than expecting this to re-fire on its own.
 */
export function isHydrating() {
  return isServer || isSolidHydrating();
}
//# sourceMappingURL=is-hydrating.jsx.map
