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BC,UAAAA,EAAWG,eAAAA,IACtC,CDkBuCE,CAAmB,CACvDjD,WAAAA,IADK0C,EAAAA,EAAAA,G,OAAOX,EAAAA,EAAAA,QAASa,EAAAA,EAAAA,UAIjBM,GAAkBzB,IAAaH,GAAWsB,GAAarB,EAoB7D,OAjBA4B,EAAAA,EAAAA,YAAU,WACR,GAAID,EAAgB,CAOlB,IAAME,EAAQC,YAAW,WACvB7B,GACD,GAAEE,GACH,OAAO,WACL4B,aAAaF,EACd,CACF,CACF,GAAE,CAAC5B,EAAY0B,EAAgBxB,IAEzB,CAACgB,EAAK,CAAEX,QAAAA,GAChB,C","sources":["webpack://customer-portal/./node_modules/react-intersection-observer-hook/src/utils.ts","webpack://customer-portal/./node_modules/react-intersection-observer-hook/src/useIntersectionObserver.ts","webpack://customer-portal/./node_modules/react-infinite-scroll-hook/src/useInfiniteScroll.ts","webpack://customer-portal/./node_modules/react-intersection-observer-hook/src/useTrackVisibility.ts"],"sourcesContent":["type EntryCallback = (entry: IntersectionObserverEntry) => void;\n\ntype CachedObserver = {\n observer: IntersectionObserver;\n entryCallbacks: Map;\n};\n\ntype ObserverCache = Map;\n\ntype ObserverCachesByRoot = Map<\n IntersectionObserverInit['root'],\n ObserverCache\n>;\n\nexport type CachedIntersectionObserver = {\n observe: (\n node: Element,\n callback: (entry: IntersectionObserverEntry) => void,\n ) => void;\n unobserve: (node: Element) => void;\n};\n\nexport function createObserverCache() {\n const cachesByRoot: ObserverCachesByRoot = new Map();\n\n function getObserver({\n root,\n rootMargin,\n threshold,\n }: IntersectionObserverInit): CachedIntersectionObserver {\n let cacheByRoot = cachesByRoot.get(root);\n\n if (!cacheByRoot) {\n cacheByRoot = new Map();\n cachesByRoot.set(root, cacheByRoot);\n }\n\n const cacheKey = JSON.stringify({ rootMargin, threshold });\n let cachedObserver = cacheByRoot.get(cacheKey);\n\n if (!cachedObserver) {\n const entryCallbacks = new Map();\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n const callback = entryCallbacks.get(entry.target);\n callback?.(entry);\n });\n },\n { root, rootMargin, threshold },\n );\n\n cachedObserver = { observer, entryCallbacks };\n\n cacheByRoot.set(cacheKey, cachedObserver);\n }\n\n return {\n observe: (\n node: Element,\n callback: (entry: IntersectionObserverEntry) => void,\n ) => {\n cachedObserver?.entryCallbacks.set(node, callback);\n cachedObserver?.observer.observe(node);\n },\n unobserve: (node: Element) => {\n cachedObserver?.entryCallbacks.delete(node);\n cachedObserver?.observer.unobserve(node);\n },\n };\n }\n\n return { getObserver };\n}\n","import { useState, useCallback, useRef } from 'react';\nimport { CachedIntersectionObserver, createObserverCache } from './utils';\nimport { Omit } from './types';\n\nconst DEFAULT_ROOT_MARGIN = '0px';\nconst DEFAULT_THRESHOLD = [0];\n\nexport type IntersectionObserverHookArgs = Omit<\n IntersectionObserverInit,\n 'root'\n>;\n\nexport type IntersectionObserverHookRefCallbackNode = Element | null;\n\nexport type IntersectionObserverHookRefCallback = (\n node: IntersectionObserverHookRefCallbackNode,\n) => void;\n\nexport type IntersectionObserverHookRootRefCallbackNode = IntersectionObserverInit['root'];\n\nexport type IntersectionObserverHookRootRefCallback = (\n node: IntersectionObserverHookRootRefCallbackNode,\n) => void;\n\nexport type IntersectionObserverHookResult = [\n IntersectionObserverHookRefCallback,\n {\n entry: IntersectionObserverEntry | undefined;\n rootRef: IntersectionObserverHookRootRefCallback;\n },\n];\n\nconst observerCache = createObserverCache();\n\n// For more info:\n// https://developers.google.com/web/updates/2016/04/intersectionobserver\n// https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\nfunction useIntersectionObserver(\n args?: IntersectionObserverHookArgs,\n): IntersectionObserverHookResult {\n const rootMargin = args?.rootMargin ?? DEFAULT_ROOT_MARGIN;\n const threshold = args?.threshold ?? DEFAULT_THRESHOLD;\n\n const nodeRef = useRef(null);\n const rootRef = useRef(null);\n const observerRef = useRef(null);\n\n const [entry, setEntry] = useState();\n\n const observe = useCallback(() => {\n const node = nodeRef.current;\n\n if (!node) {\n setEntry(undefined);\n return;\n }\n\n const observer = observerCache.getObserver({\n root: rootRef.current,\n rootMargin,\n threshold,\n });\n\n observer.observe(node, (observedEntry) => {\n setEntry(observedEntry);\n });\n\n observerRef.current = observer;\n }, [rootMargin, threshold]);\n\n const unobserve = useCallback(() => {\n const currentObserver = observerRef.current;\n const node = nodeRef.current;\n\n if (node) {\n currentObserver?.unobserve(node);\n }\n\n observerRef.current = null;\n }, []);\n\n // React will call the ref callback with the DOM element when the component mounts,\n // and call it with null when it unmounts.\n // So, we don't need an useEffect etc to unobserve nodes.\n // When nodeRef.current is null, it will be unobserved and observe function\n // won't do anything.\n const refCallback = useCallback(\n (node) => {\n unobserve();\n nodeRef.current = node;\n observe();\n },\n [observe, unobserve],\n );\n\n const rootRefCallback = useCallback(\n (rootNode) => {\n unobserve();\n rootRef.current = rootNode;\n observe();\n },\n [observe, unobserve],\n );\n\n return [refCallback, { entry, rootRef: rootRefCallback }];\n}\n\nexport default useIntersectionObserver;\n","import { useEffect } from 'react';\nimport {\n useTrackVisibility,\n IntersectionObserverHookArgs,\n IntersectionObserverHookRefCallback as UseInfiniteScrollHookRefCallback,\n IntersectionObserverHookRootRefCallback as UseInfiniteScrollHookRootRefCallback,\n} from 'react-intersection-observer-hook';\n\nconst DEFAULT_DELAY_IN_MS = 100;\n\nexport {\n UseInfiniteScrollHookRefCallback,\n UseInfiniteScrollHookRootRefCallback,\n};\n\nexport type UseInfiniteScrollHookResult = [\n UseInfiniteScrollHookRefCallback,\n { rootRef: UseInfiniteScrollHookRootRefCallback },\n];\n\nexport type UseInfiniteScrollHookArgs = Pick<\n IntersectionObserverHookArgs,\n // We pass this to 'IntersectionObserver'. We can use it to configure when to trigger 'onLoadMore'.\n 'rootMargin'\n> & {\n // Some sort of \"is fetching\" info of the request.\n loading: boolean;\n // If the list has more items to load.\n hasNextPage: boolean;\n // The callback function to execute when the 'onLoadMore' is triggered.\n // eslint-disable-next-line no-undef\n onLoadMore: VoidFunction;\n // Flag to stop infinite scrolling. Can be used in case of an error etc too.\n disabled?: boolean;\n // How long it should wait before triggering 'onLoadMore'.\n delayInMs?: number;\n};\n\nfunction useInfiniteScroll({\n loading,\n hasNextPage,\n onLoadMore,\n rootMargin,\n disabled,\n delayInMs = DEFAULT_DELAY_IN_MS,\n}: UseInfiniteScrollHookArgs): UseInfiniteScrollHookResult {\n const [ref, { rootRef, isVisible }] = useTrackVisibility({\n rootMargin,\n });\n\n const shouldLoadMore = !disabled && !loading && isVisible && hasNextPage;\n\n // eslint-disable-next-line consistent-return\n useEffect(() => {\n if (shouldLoadMore) {\n // When we trigger 'onLoadMore' and new items are added to the list,\n // right before they become rendered on the screen, 'loading' becomes false\n // and 'isVisible' can be true for a brief time, based on the scroll position.\n // So, it triggers 'onLoadMore' just after the first one is finished.\n // We use a small delay here to prevent this kind of situations.\n // It can be configured by hook args.\n const timer = setTimeout(() => {\n onLoadMore();\n }, delayInMs);\n return () => {\n clearTimeout(timer);\n };\n }\n }, [onLoadMore, shouldLoadMore, delayInMs]);\n\n return [ref, { rootRef }];\n}\n\nexport default useInfiniteScroll;\n","import { useState } from 'react';\nimport useIntersectionObserver, {\n IntersectionObserverHookArgs,\n IntersectionObserverHookResult,\n} from './useIntersectionObserver';\n\nexport type TrackVisibilityHookArgs = IntersectionObserverHookArgs;\n\nexport type TrackVisibilityHookResult = [\n IntersectionObserverHookResult[0],\n IntersectionObserverHookResult[1] & {\n isVisible: boolean;\n wasEverVisible: boolean;\n },\n];\n\nfunction useTrackVisibility(\n args?: IntersectionObserverHookArgs,\n): TrackVisibilityHookResult {\n const [ref, result] = useIntersectionObserver(args);\n const isVisible = Boolean(result.entry?.isIntersecting);\n const [wasEverVisible, setWasEverVisible] = useState(isVisible);\n\n if (isVisible && !wasEverVisible) {\n setWasEverVisible(true);\n }\n\n return [ref, { ...result, isVisible, wasEverVisible }];\n}\n\nexport default useTrackVisibility;\n"],"names":["createObserverCache","cachesByRoot","Map","getObserver","root","rootMargin","threshold","cacheByRoot","get","set","cacheKey","JSON","stringify","cachedObserver","entryCallbacks","observer","IntersectionObserver","entries","forEach","entry","callback","target","observe","node","unobserve","DEFAULT_THRESHOLD","observerCache","loading","hasNextPage","onLoadMore","disabled","delayInMs","DEFAULT_DELAY_IN_MS","args","nodeRef","useRef","rootRef","observerRef","useState","setEntry","useCallback","current","observedEntry","undefined","currentObserver","rootNode","useIntersectionObserver","ref","result","isVisible","Boolean","isIntersecting","wasEverVisible","setWasEverVisible","useTrackVisibility","shouldLoadMore","useEffect","timer","setTimeout","clearTimeout"],"sourceRoot":""}