{"version":3,"sources":["../src/InView.tsx","../src/observe.ts","../src/useInView.tsx","../src/useIntersectionObserverRef.ts","../src/useOnInView.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { IntersectionObserverProps, PlainChildrenProps } from \"./index\";\nimport { observe } from \"./observe\";\n\ntype State = {\n  inView: boolean;\n  entry?: IntersectionObserverEntry;\n};\n\nfunction isPlainChildren(\n  props: IntersectionObserverProps | PlainChildrenProps,\n): props is PlainChildrenProps {\n  return typeof props.children !== \"function\";\n}\n\n/**\n ## Render props\n\n To use the `<InView>` component, you pass it a function. It will be called\n whenever the state changes, with the new value of `inView`. In addition to the\n `inView` prop, children also receive a `ref` that should be set on the\n containing DOM element. This is the element that the IntersectionObserver will\n monitor.\n\n If you need it, you can also access the\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\n on `entry`, giving you access to all the details about the current intersection\n state.\n\n ```jsx\n import { InView } from 'react-intersection-observer';\n\n const Component = () => (\n <InView>\n {({ inView, ref, entry }) => (\n      <div ref={ref}>\n        <h2>{`Header inside viewport ${inView}.`}</h2>\n      </div>\n    )}\n </InView>\n );\n\n export default Component;\n ```\n\n ## Plain children\n\n You can pass any element to the `<InView />`, and it will handle creating the\n wrapping DOM element. Add a handler to the `onChange` method, and control the\n state in your own component. Any extra props you add to `<InView>` will be\n passed to the HTML element, allowing you set the `className`, `style`, etc.\n\n ```jsx\n import { InView } from 'react-intersection-observer';\n\n const Component = () => (\n <InView as=\"div\" onChange={(inView, entry) => console.log('Inview:', inView)}>\n <h2>Plain children are always rendered. Use onChange to monitor state.</h2>\n </InView>\n );\n\n export default Component;\n ```\n */\nexport class InView extends React.Component<\n  IntersectionObserverProps | PlainChildrenProps,\n  State\n> {\n  node: Element | null = null;\n  _unobserveCb: (() => void) | null = null;\n  lastInView: boolean | undefined;\n\n  constructor(props: IntersectionObserverProps | PlainChildrenProps) {\n    super(props);\n    this.state = {\n      inView: !!props.initialInView,\n      entry: undefined,\n    };\n    this.lastInView = props.initialInView;\n  }\n\n  componentDidMount() {\n    this.unobserve();\n    this.observeNode();\n  }\n\n  componentDidUpdate(prevProps: IntersectionObserverProps) {\n    // If a IntersectionObserver option changed, reinit the observer\n    if (\n      prevProps.rootMargin !== this.props.rootMargin ||\n      prevProps.scrollMargin !== this.props.scrollMargin ||\n      prevProps.root !== this.props.root ||\n      prevProps.threshold !== this.props.threshold ||\n      prevProps.skip !== this.props.skip ||\n      prevProps.trackVisibility !== this.props.trackVisibility ||\n      prevProps.delay !== this.props.delay\n    ) {\n      this.unobserve();\n      this.observeNode();\n    }\n  }\n\n  componentWillUnmount() {\n    this.unobserve();\n  }\n\n  observeNode() {\n    if (!this.node || this.props.skip) return;\n    const {\n      threshold,\n      root,\n      rootMargin,\n      scrollMargin,\n      trackVisibility,\n      delay,\n      fallbackInView,\n    } = this.props;\n\n    if (this.lastInView === undefined) {\n      this.lastInView = this.props.initialInView;\n    }\n    this._unobserveCb = observe(\n      this.node,\n      this.handleChange,\n      {\n        threshold,\n        root,\n        rootMargin,\n        scrollMargin,\n        trackVisibility,\n        delay,\n      },\n      fallbackInView,\n    );\n  }\n\n  unobserve() {\n    if (this._unobserveCb) {\n      this._unobserveCb();\n      this._unobserveCb = null;\n    }\n  }\n\n  handleNode = (node?: Element | null) => {\n    if (this.node) {\n      // Clear the old observer, before we start observing a new element\n      this.unobserve();\n\n      if (!node && !this.props.triggerOnce && !this.props.skip) {\n        // Reset the state if we get a new node, and we aren't ignoring updates\n        this.setState({ inView: !!this.props.initialInView, entry: undefined });\n        this.lastInView = this.props.initialInView;\n      }\n    }\n\n    this.node = node ? node : null;\n    this.observeNode();\n  };\n\n  handleChange = (inView: boolean, entry: IntersectionObserverEntry) => {\n    const previousInView = this.lastInView;\n    this.lastInView = inView;\n\n    // Ignore the very first `false` notification so consumers only hear about actual state changes.\n    if (previousInView === undefined && !inView) {\n      return;\n    }\n\n    if (inView && this.props.triggerOnce) {\n      // If `triggerOnce` is true, we should stop observing the element.\n      this.unobserve();\n    }\n    if (!isPlainChildren(this.props)) {\n      // Store the current State, so we can pass it to the children in the next render update\n      // There's no reason to update the state for plain children, since it's not used in the rendering.\n      this.setState({ inView, entry });\n    }\n    if (this.props.onChange) {\n      // If the user is actively listening for onChange, always trigger it\n      this.props.onChange(inView, entry);\n    }\n  };\n\n  render() {\n    const { children } = this.props;\n    if (typeof children === \"function\") {\n      const { inView, entry } = this.state;\n      return children({ inView, entry, ref: this.handleNode });\n    }\n\n    const {\n      as,\n      triggerOnce,\n      threshold,\n      root,\n      rootMargin,\n      scrollMargin,\n      onChange,\n      skip,\n      trackVisibility,\n      delay,\n      initialInView,\n      fallbackInView,\n      ...props\n    } = this.props as PlainChildrenProps;\n\n    return React.createElement(\n      as || \"div\",\n      { ref: this.handleNode, ...props },\n      children,\n    );\n  }\n}\n","import type {\n  IntersectionObserverInitWithOptions,\n  ObserverInstanceCallback,\n} from \"./index\";\n\nconst observerMap = new Map<\n  string,\n  {\n    id: string;\n    observer: IntersectionObserver;\n    elements: Map<Element, Array<ObserverInstanceCallback>>;\n  }\n>();\n\nconst RootIds: WeakMap<Element | Document, string> = new WeakMap();\nlet rootId = 0;\n\nlet unsupportedValue: boolean | undefined;\n\n/**\n * What should be the default behavior if the IntersectionObserver is unsupported?\n * Ideally the polyfill has been loaded, you can have the following happen:\n * - `undefined`: Throw an error\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\n * **/\nexport function defaultFallbackInView(inView: boolean | undefined) {\n  unsupportedValue = inView;\n}\n\n/**\n * Generate a unique ID for the root element\n * @param root\n */\nfunction getRootId(root: IntersectionObserverInitWithOptions[\"root\"]) {\n  if (!root) return \"0\";\n  if (RootIds.has(root)) return RootIds.get(root);\n  rootId += 1;\n  RootIds.set(root, rootId.toString());\n  return RootIds.get(root);\n}\n\n/**\n * Convert the options to a string Id, based on the values.\n * Ensures we can reuse the same observer when observing elements with the same options.\n * @param options\n */\nexport function optionsToId(options: IntersectionObserverInitWithOptions) {\n  return Object.keys(options)\n    .sort()\n    .filter(\n      (key) =>\n        options[key as keyof IntersectionObserverInitWithOptions] !== undefined,\n    )\n    .map((key) => {\n      return `${key}_${\n        key === \"root\"\n          ? getRootId(options.root)\n          : options[key as keyof IntersectionObserverInitWithOptions]\n      }`;\n    })\n    .toString();\n}\n\nfunction createObserver(options: IntersectionObserverInitWithOptions) {\n  // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n  const id = optionsToId(options);\n  let instance = observerMap.get(id);\n\n  if (!instance) {\n    // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n    const elements = new Map<Element, Array<ObserverInstanceCallback>>();\n    let thresholds: number[] | readonly number[];\n\n    const observer = new IntersectionObserver((entries) => {\n      entries.forEach((entry) => {\n        // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n        // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n        const inView =\n          entry.isIntersecting &&\n          thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n\n        // @ts-expect-error support IntersectionObserver v2\n        if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n          // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n          // @ts-expect-error\n          entry.isVisible = inView;\n        }\n\n        // Copy the callbacks array before iterating to prevent issues when callbacks are removed during iteration (e.g., when using triggerOnce)\n        [...(elements.get(entry.target) ?? [])].forEach((callback) => {\n          callback(inView, entry);\n        });\n      });\n    }, options);\n\n    // Ensure we have a valid thresholds array. If not, use the threshold from the options\n    thresholds =\n      observer.thresholds ||\n      (Array.isArray(options.threshold)\n        ? options.threshold\n        : [options.threshold || 0]);\n\n    instance = {\n      id,\n      observer,\n      elements,\n    };\n\n    observerMap.set(id, instance);\n  }\n\n  return instance;\n}\n\n/**\n * @param element - DOM Element to observe\n * @param callback - Callback function to trigger when intersection status changes\n * @param options - Intersection Observer options\n * @param fallbackInView - Fallback inView value.\n * @return Function - Cleanup function that should be triggered to unregister the observer\n */\nexport function observe(\n  element: Element,\n  callback: ObserverInstanceCallback,\n  options: IntersectionObserverInitWithOptions = {},\n  fallbackInView = unsupportedValue,\n) {\n  if (\n    typeof window.IntersectionObserver === \"undefined\" &&\n    fallbackInView !== undefined\n  ) {\n    const bounds = element.getBoundingClientRect();\n    callback(fallbackInView, {\n      isIntersecting: fallbackInView,\n      target: element,\n      intersectionRatio:\n        typeof options.threshold === \"number\" ? options.threshold : 0,\n      time: 0,\n      boundingClientRect: bounds,\n      intersectionRect: bounds,\n      rootBounds: bounds,\n    });\n    return () => {\n      // Nothing to cleanup\n    };\n  }\n  // An observer with the same options can be reused, so lets use this fact\n  const { id, observer, elements } = createObserver(options);\n\n  // Register the callback listener for this element\n  const callbacks = elements.get(element) || [];\n  if (!elements.has(element)) {\n    elements.set(element, callbacks);\n  }\n\n  callbacks.push(callback);\n  observer.observe(element);\n\n  let unobserved = false;\n  return function unobserve() {\n    if (unobserved) return;\n    unobserved = true;\n\n    // Remove the callback from the callback list\n    callbacks.splice(callbacks.indexOf(callback), 1);\n\n    if (callbacks.length === 0) {\n      // No more callback exists for element, so destroy it\n      elements.delete(element);\n      observer.unobserve(element);\n    }\n\n    if (elements.size === 0) {\n      // No more elements are being observer by this instance, so destroy it\n      observer.disconnect();\n      observerMap.delete(id);\n    }\n  };\n}\n","import * as React from \"react\";\nimport type { IntersectionOptions, InViewHookResponse } from \"./index\";\nimport { useIntersectionObserverRef } from \"./useIntersectionObserverRef\";\n\nconst useIsomorphicLayoutEffect =\n  typeof window === \"undefined\" ? React.useEffect : React.useLayoutEffect;\n\ntype State = {\n  inView: boolean;\n  entry?: IntersectionObserverEntry;\n};\n\ntype RefState = {\n  node: Element | null;\n  reset: boolean;\n};\n\n/**\n * React Hooks make it easy to monitor the `inView` state of your components. Call\n * the `useInView` hook with the (optional) [options](#options) you need. It will\n * return an array containing a `ref`, the `inView` status and the current\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\n * report the status.\n *\n * @example\n * ```jsx\n * import React from 'react';\n * import { useInView } from 'react-intersection-observer';\n *\n * const Component = () => {\n *   const { ref, inView, entry } = useInView({\n *       threshold: 0,\n *   });\n *\n *   return (\n *     <div ref={ref}>\n *       <h2>{`Header inside viewport ${inView}.`}</h2>\n *     </div>\n *   );\n * };\n * ```\n */\nexport function useInView({\n  threshold,\n  delay,\n  trackVisibility,\n  rootMargin,\n  scrollMargin,\n  root,\n  triggerOnce,\n  skip,\n  initialInView,\n  fallbackInView,\n  onChange,\n}: IntersectionOptions = {}): InViewHookResponse {\n  const lastInViewRef = React.useRef<boolean | undefined>(initialInView);\n  const [state, setState] = React.useState<State>({\n    inView: !!initialInView,\n    entry: undefined,\n  });\n\n  const observerRef = useIntersectionObserverRef<Element>(\n    (inView, entry) => {\n      const previousInView = lastInViewRef.current;\n      lastInViewRef.current = inView;\n\n      // Ignore the very first `false` notification so consumers only hear about actual state changes.\n      if (previousInView === undefined && !inView) {\n        return;\n      }\n\n      setState({ inView, entry });\n      onChange?.(inView, entry);\n    },\n    {\n      threshold,\n      root,\n      rootMargin,\n      scrollMargin,\n      trackVisibility,\n      delay,\n      fallbackInView,\n      skip,\n      triggerOnce,\n    },\n  );\n\n  const refState = React.useRef<RefState>({\n    node: null,\n    reset: false,\n  });\n\n  const setRef = React.useCallback(\n    function setRef(node?: Element | null) {\n      if (node) {\n        refState.current.node = node;\n        refState.current.reset = false;\n      } else if (refState.current.node) {\n        refState.current.node = null;\n        refState.current.reset = true;\n      }\n\n      const cleanup = observerRef(node);\n      if (!cleanup) return;\n\n      return () => {\n        cleanup();\n        if (refState.current.node === node) {\n          refState.current.node = null;\n          refState.current.reset = true;\n        }\n      };\n    },\n    [observerRef],\n  );\n\n  useIsomorphicLayoutEffect(() => {\n    if (!refState.current.reset) return;\n    refState.current.reset = false;\n    if (triggerOnce || skip) return;\n\n    setState({ inView: !!initialInView, entry: undefined });\n    lastInViewRef.current = initialInView;\n  });\n\n  const result = [setRef, state.inView, state.entry] as InViewHookResponse;\n\n  // Support object destructuring, by adding the specific values.\n  result.ref = result[0];\n  result.inView = result[1];\n  result.entry = result[2];\n\n  return result;\n}\n","import * as React from \"react\";\nimport type { IntersectionObserverInitWithOptions } from \"./index\";\nimport { observe } from \"./observe\";\n\nconst useInsertionEffect = Reflect.get(React, \"useInsertionEffect\") as\n  | typeof React.useEffect\n  | undefined;\nconst useSyncEffect = useInsertionEffect ?? React.useEffect;\n\nexport function supportsRefCleanup(version: string | undefined) {\n  return version?.startsWith(\"19.\") || false;\n}\n\nconst canUseRefCleanup = supportsRefCleanup(React.version);\n\ntype ObserverCallback<TElement extends Element> = (\n  inView: boolean,\n  entry: IntersectionObserverEntry & { target: TElement },\n  previousInView: boolean | undefined,\n) => void;\n\ntype ObserverRefOptions = IntersectionObserverInitWithOptions & {\n  fallbackInView?: boolean;\n  skip?: boolean;\n  triggerOnce?: boolean;\n};\n\ntype ObserverRefCallback<TElement extends Element> = (\n  element: TElement | undefined | null,\n) => (() => void) | undefined;\n\ntype ObserverState<TElement extends Element> = {\n  node: TElement | null;\n  stop: (() => void) | undefined;\n  owner: ObserverRefCallback<TElement> | null;\n};\n\nexport function useIntersectionObserverRef<TElement extends Element>(\n  onIntersectionChange: ObserverCallback<TElement>,\n  {\n    threshold,\n    root,\n    rootMargin,\n    scrollMargin,\n    trackVisibility,\n    delay,\n    fallbackInView,\n    skip,\n    triggerOnce,\n  }: ObserverRefOptions,\n) {\n  const onIntersectionChangeRef = React.useRef(onIntersectionChange);\n  const observerStateRef = React.useRef<ObserverState<TElement>>({\n    node: null,\n    stop: undefined,\n    owner: null,\n  });\n\n  // React 17 has no effect that runs before callback refs attach. Keep its\n  // synchronous fallback behavior compatible by publishing during render.\n  if (!useInsertionEffect) {\n    onIntersectionChangeRef.current = onIntersectionChange;\n  }\n\n  useSyncEffect(() => {\n    onIntersectionChangeRef.current = onIntersectionChange;\n  }, [onIntersectionChange]);\n\n  // biome-ignore lint/correctness/useExhaustiveDependencies: Threshold arrays are normalized inside the callback\n  return React.useCallback(\n    function setRef(element: TElement | undefined | null) {\n      const observerState = observerStateRef.current;\n\n      if (!element && observerState.owner !== setRef) {\n        return;\n      }\n\n      if (element === observerState.node) {\n        observerState.owner = setRef;\n        return canUseRefCleanup ? observerState.stop : undefined;\n      }\n\n      const cleanup = observerState.stop;\n      observerState.stop = undefined;\n      cleanup?.();\n\n      if (!element || skip) {\n        observerState.node = null;\n        observerState.owner = element ? setRef : null;\n        return;\n      }\n\n      observerState.node = element;\n      observerState.owner = setRef;\n\n      let destroyObserver: (() => void) | undefined;\n      let previousInView: boolean | undefined;\n\n      function stopObserving() {\n        destroyObserver?.();\n\n        if (observerState.stop === stopObserving) {\n          observerState.node = null;\n          observerState.stop = undefined;\n        }\n      }\n\n      observerState.stop = stopObserving;\n      destroyObserver = observe(\n        element,\n        (inView, entry) => {\n          onIntersectionChangeRef.current(\n            inView,\n            entry as IntersectionObserverEntry & { target: TElement },\n            previousInView,\n          );\n          previousInView = inView;\n          if (triggerOnce && inView) stopObserving();\n        },\n        {\n          threshold,\n          root,\n          rootMargin,\n          scrollMargin,\n          trackVisibility,\n          delay,\n        },\n        fallbackInView,\n      );\n\n      if (observerState.stop !== stopObserving) destroyObserver();\n\n      return canUseRefCleanup ? observerState.stop : undefined;\n    },\n    [\n      Array.isArray(threshold) ? threshold.toString() : threshold,\n      root,\n      rootMargin,\n      scrollMargin,\n      trackVisibility,\n      delay,\n      fallbackInView,\n      skip,\n      triggerOnce,\n    ],\n  );\n}\n","import type {\n  IntersectionChangeEffect,\n  IntersectionEffectOptions,\n} from \"./index\";\nimport { useIntersectionObserverRef } from \"./useIntersectionObserverRef\";\n\n/**\n * React Hooks make it easy to monitor when elements come into and leave view. Call\n * the `useOnInView` hook with your callback and (optional) [options](#options).\n * It will return a ref callback that you can assign to the DOM element you want to monitor.\n * When the element enters or leaves the viewport, your callback will be triggered.\n *\n * This hook triggers no re-renders, and is useful for performance-critical use-cases or\n * when you need to trigger render independent side effects like tracking or logging.\n *\n * @example\n * ```jsx\n * import React from 'react';\n * import { useOnInView } from 'react-intersection-observer';\n *\n * const Component = () => {\n *   const inViewRef = useOnInView((inView, entry) => {\n *     if (inView) {\n *       console.log(\"Element is in view\", entry.target);\n *     } else {\n *       console.log(\"Element left view\", entry.target);\n *     }\n *   });\n *\n *   return (\n *     <div ref={inViewRef}>\n *       <h2>This element is being monitored</h2>\n *     </div>\n *   );\n * };\n * ```\n */\nexport const useOnInView = <TElement extends Element>(\n  onIntersectionChange: IntersectionChangeEffect<TElement>,\n  {\n    threshold,\n    root,\n    rootMargin,\n    scrollMargin,\n    trackVisibility,\n    delay,\n    triggerOnce,\n    skip,\n  }: IntersectionEffectOptions = {},\n): ((element: TElement | undefined | null) => (() => void) | undefined) => {\n  return useIntersectionObserverRef<TElement>(\n    (inView, entry, previousInView) => {\n      // Ignore the very first `false` notification so consumers only hear about actual state changes.\n      if (previousInView === undefined && !inView) {\n        return;\n      }\n\n      onIntersectionChange(inView, entry);\n    },\n    {\n      threshold,\n      root,\n      rootMargin,\n      scrollMargin,\n      trackVisibility,\n      delay,\n      triggerOnce,\n      skip,\n    },\n  );\n};\n"],"mappings":";;;;;;AAAA,YAAY,WAAW;;;ACKvB,IAAM,cAAc,oBAAI,IAOtB;AAEF,IAAM,UAA+C,oBAAI,QAAQ;AACjE,IAAI,SAAS;AAEb,IAAI;AAQG,SAAS,sBAAsB,QAA6B;AACjE,qBAAmB;AACrB;AAMA,SAAS,UAAU,MAAmD;AACpE,MAAI,CAAC,KAAM,QAAO;AAClB,MAAI,QAAQ,IAAI,IAAI,EAAG,QAAO,QAAQ,IAAI,IAAI;AAC9C,YAAU;AACV,UAAQ,IAAI,MAAM,OAAO,SAAS,CAAC;AACnC,SAAO,QAAQ,IAAI,IAAI;AACzB;AAOO,SAAS,YAAY,SAA8C;AACxE,SAAO,OAAO,KAAK,OAAO,EACvB,KAA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