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C+C,EAAS,CACZ,IAAMkC,EAAeC,CAAAA,EAAAA,EAAAA,mBAAAA,EAAoB,IAAMlC,GAAW,IAC1D,MAAO,IAAMmC,GAAAA,EAAAA,kBAAAA,EAAmBF,EAClC,CAGJ,EAAG,CAACnC,EAAY9C,EAAY4C,EAASG,EAASG,EAAW/C,OAAO,CAAC,EAM1D,CAACgD,EAAYJ,EAJC7C,CAAAA,EAAAA,EAAAA,WAAAA,EAAY,KAC/B8C,GAAW,EACb,EAAG,EAAE,EAEqC,6UC9H5B1C,qCAAAA,aAT0B,OASnC,SAASA,EACd8E,CAAmB,CACnBC,CAAmB,EAEnB,IAAMC,EAAW/F,GAAAA,EAAAA,MAAAA,EAAmB,KAAO,GACrCgG,EAAWhG,CAAAA,EAAAA,EAAAA,MAAAA,EAAmB,KAAO,GAE3C,MAAOL,CAAAA,EAAAA,EAAAA,OAAAA,EAAQ,IACRkG,GAASC,EAIP,GAJM,CAAO,MAKI,CAAlBlF,GACFmF,EAASnF,OAAO,GAChBoF,EAASpF,OAAO,KAEhBmF,EAASnF,OAAO,CAAGqF,EAASJ,EAAMjF,GAClCoF,EAASpF,OAAO,CAAGqF,EAASH,EAAMlF,GAEtC,EAXSiF,GAAQC,EAYhB,CAACD,EAAMC,EAAK,CACjB,CAEA,SAASG,EACPJ,CAAgC,CAChCjF,CAAiB,EAEjB,GAAoB,YAAhB,OAAOiF,EAST,OADAA,EAAKjF,OAAO,CAAGA,EACR,KACLiF,EAAKjF,OAAO,CAAG,IACjB,CAX8B,EAC9B,IAAMsF,EAAUL,EAAKjF,SACrB,YAAmC,OAAxBsF,EACFA,EAEA,IAAML,EAAK,KAEtB,CAMF,MANS,mOC5CT,iBAA8C","sources":["webpack://_N_E/../../src/client/get-domain-locale.ts","webpack://_N_E/../../src/client/link.tsx","webpack://_N_E/../../src/client/use-intersection.tsx","webpack://_N_E/../../src/client/use-merged-ref.ts","webpack://_N_E/./node_modules/next/link.js"],"sourcesContent":["import type { DomainLocale } from '../server/config'\nimport type { normalizeLocalePath as NormalizeFn } from './normalize-locale-path'\nimport type { detectDomainLocale as DetectFn } from './detect-domain-locale'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function getDomainLocale(\n path: string,\n locale?: string | false,\n locales?: string[],\n domainLocales?: DomainLocale[]\n) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const normalizeLocalePath: typeof NormalizeFn =\n require('./normalize-locale-path').normalizeLocalePath\n const detectDomainLocale: typeof DetectFn =\n require('./detect-domain-locale').detectDomainLocale\n\n const target = locale || normalizeLocalePath(path, locales).detectedLocale\n const domain = detectDomainLocale(domainLocales, undefined, target)\n if (domain) {\n const proto = `http${domain.http ? '' : 's'}://`\n const finalLocale = target === domain.defaultLocale ? '' : `/${target}`\n return `${proto}${domain.domain}${normalizePathTrailingSlash(\n `${basePath}${finalLocale}${path}`\n )}`\n }\n return false\n } else {\n return false\n }\n}\n","'use client'\n\nimport type {\n NextRouter,\n PrefetchOptions as RouterPrefetchOptions,\n} from '../shared/lib/router/router'\n\nimport React from 'react'\nimport type { UrlObject } from 'url'\nimport { resolveHref } from './resolve-href'\nimport { isLocalURL } from '../shared/lib/router/utils/is-local-url'\nimport { formatUrl } from '../shared/lib/router/utils/format-url'\nimport { isAbsoluteUrl } from '../shared/lib/utils'\nimport { addLocale } from './add-locale'\nimport { RouterContext } from '../shared/lib/router-context.shared-runtime'\nimport type { AppRouterInstance } from '../shared/lib/app-router-context.shared-runtime'\nimport { useIntersection } from './use-intersection'\nimport { getDomainLocale } from './get-domain-locale'\nimport { addBasePath } from './add-base-path'\nimport { useMergedRef } from './use-merged-ref'\n\ntype Url = string | UrlObject\ntype RequiredKeys = {\n [K in keyof T]-?: {} extends Pick ? never : K\n}[keyof T]\ntype OptionalKeys = {\n [K in keyof T]-?: {} extends Pick ? K : never\n}[keyof T]\n\ntype InternalLinkProps = {\n /**\n * The path or URL to navigate to. It can also be an object.\n *\n * @example https://nextjs.org/docs/api-reference/next/link#with-url-object\n */\n href: Url\n /**\n * Optional decorator for the path that will be shown in the browser URL bar. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://github.com/vercel/next.js/blob/v9.5.2/docs/api-reference/next/link.md#dynamic-routes) to see how it worked. Note: when this path differs from the one provided in `href` the previous `href`/`as` behavior is used as shown in the [previous docs](https://github.com/vercel/next.js/blob/v9.5.2/docs/api-reference/next/link.md#dynamic-routes).\n */\n as?: Url\n /**\n * Replace the current `history` state instead of adding a new url into the stack.\n *\n * @defaultValue `false`\n */\n replace?: boolean\n /**\n * Whether to override the default scroll behavior\n *\n * @example https://nextjs.org/docs/api-reference/next/link#disable-scrolling-to-the-top-of-the-page\n *\n * @defaultValue `true`\n */\n scroll?: boolean\n /**\n * Update the path of the current page without rerunning [`getStaticProps`](https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-props), [`getServerSideProps`](https://nextjs.org/docs/pages/building-your-application/data-fetching/get-server-side-props) or [`getInitialProps`](/docs/pages/api-reference/functions/get-initial-props).\n *\n * @defaultValue `false`\n */\n shallow?: boolean\n /**\n * Forces `Link` to send the `href` property to its child.\n *\n * @defaultValue `false`\n */\n passHref?: boolean\n /**\n * Prefetch the page in the background.\n * Any `` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`. Prefetching is only enabled in production.\n *\n * In App Router:\n * - `null` (default): For statically generated pages, this will prefetch the full React Server Component data. For dynamic pages, this will prefetch up to the nearest route segment with a [`loading.js`](https://nextjs.org/docs/app/api-reference/file-conventions/loading) file. If there is no loading file, it will not fetch the full tree to avoid fetching too much data.\n * - `true`: This will prefetch the full React Server Component data for all route segments, regardless of whether they contain a segment with `loading.js`.\n * - `false`: This will not prefetch any data, even on hover.\n *\n * In Pages Router:\n * - `true` (default): The full route & its data will be prefetched.\n * - `false`: Prefetching will not happen when entering the viewport, but will still happen on hover.\n * @defaultValue `true` (pages router) or `null` (app router)\n */\n prefetch?: boolean | null\n /**\n * The active locale is automatically prepended. `locale` allows for providing a different locale.\n * When `false` `href` has to include the locale as the default behavior is disabled.\n * Note: This is only available in the Pages Router.\n */\n locale?: string | false\n /**\n * Enable legacy link behavior.\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n /**\n * Optional event handler for when the mouse pointer is moved onto Link\n */\n onMouseEnter?: React.MouseEventHandler\n /**\n * Optional event handler for when Link is touched.\n */\n onTouchStart?: React.TouchEventHandler\n /**\n * Optional event handler for when Link is clicked.\n */\n onClick?: React.MouseEventHandler\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when the webpack plugin runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys\ntype LinkPropsOptional = OptionalKeys\n\nconst prefetched = new Set()\n\ntype PrefetchOptions = RouterPrefetchOptions & {\n /**\n * bypassPrefetchedCheck will bypass the check to see if the `href` has\n * already been fetched.\n */\n bypassPrefetchedCheck?: boolean\n}\n\nfunction prefetch(\n router: NextRouter,\n href: string,\n as: string,\n options: PrefetchOptions\n): void {\n if (typeof window === 'undefined') {\n return\n }\n\n if (!isLocalURL(href)) {\n return\n }\n\n // We should only dedupe requests when experimental.optimisticClientCache is\n // disabled.\n if (!options.bypassPrefetchedCheck) {\n const locale =\n // Let the link's locale prop override the default router locale.\n typeof options.locale !== 'undefined'\n ? options.locale\n : // Otherwise fallback to the router's locale.\n 'locale' in router\n ? router.locale\n : undefined\n\n const prefetchedKey = href + '%' + as + '%' + locale\n\n // If we've already fetched the key, then don't prefetch it again!\n if (prefetched.has(prefetchedKey)) {\n return\n }\n\n // Mark this URL as prefetched.\n prefetched.add(prefetchedKey)\n }\n\n // Prefetch the JSON page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n router.prefetch(href, as, options).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err\n }\n })\n}\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n router: NextRouter | AppRouterInstance,\n href: string,\n as: string,\n replace?: boolean,\n shallow?: boolean,\n scroll?: boolean,\n locale?: string | false\n): void {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n\n if (isAnchorNodeName && (isModifiedEvent(e) || !isLocalURL(href))) {\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n const navigate = () => {\n // If the router is an NextRouter instance it will have `beforePopState`\n const routerScroll = scroll ?? true\n if ('beforePopState' in router) {\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n locale,\n scroll: routerScroll,\n })\n } else {\n router[replace ? 'replace' : 'push'](as || href, {\n scroll: routerScroll,\n })\n }\n }\n\n navigate()\n}\n\ntype LinkPropsReal = React.PropsWithChildren<\n Omit, keyof LinkProps> &\n LinkProps\n>\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `` element to provide [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation between routes.\n *\n * It is the primary way to navigate between routes in Next.js.\n *\n * Read more: [Next.js docs: ``](https://nextjs.org/docs/app/api-reference/components/link)\n */\nconst Link = React.forwardRef(\n function LinkComponent(props, forwardedRef) {\n let children: React.ReactNode\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n locale,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = {children}\n }\n\n const router = React.useContext(RouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n locale: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (key === 'locale') {\n if (props[key] && valType !== 'string') {\n throw createPropError({\n key,\n expected: '`string`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'prefetch' ||\n key === 'legacyBehavior'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key\n }\n })\n }\n\n const { href, as } = React.useMemo(() => {\n if (!router) {\n const resolvedHref = formatStringOrUrl(hrefProp)\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref,\n }\n }\n\n const [resolvedHref, resolvedAs] = resolveHref(router, hrefProp, true)\n\n return {\n href: resolvedHref,\n as: asProp ? resolveHref(router, asProp) : resolvedAs || resolvedHref,\n }\n }, [router, hrefProp, asProp])\n\n const previousHref = React.useRef(href)\n const previousAs = React.useRef(as)\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to with \\`href\\` of \\`${hrefProp}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to with \\`href\\` of \\`${hrefProp}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid with child. Please remove or use .\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n const [setIntersectionRef, isVisible, resetVisible] = useIntersection({\n rootMargin: '200px',\n })\n\n const setIntersectionWithResetRef = React.useCallback(\n (el: Element) => {\n // Before the link getting observed, check if visible state need to be reset\n if (previousAs.current !== as || previousHref.current !== href) {\n resetVisible()\n previousAs.current = as\n previousHref.current = href\n }\n\n setIntersectionRef(el)\n },\n [as, href, resetVisible, setIntersectionRef]\n )\n\n const setRef = useMergedRef(setIntersectionWithResetRef, childRef)\n\n // Prefetch the URL if we haven't already and it's visible.\n React.useEffect(() => {\n // in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.\n if (process.env.NODE_ENV !== 'production') {\n return\n }\n\n if (!router) {\n return\n }\n\n // If we don't need to prefetch the URL, don't do prefetch.\n if (!isVisible || !prefetchEnabled) {\n return\n }\n\n // Prefetch the URL.\n prefetch(router, href, as, { locale })\n }, [as, href, isVisible, locale, prefetchEnabled, router?.locale, router])\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler\n onMouseEnter: React.MouseEventHandler\n onClick: React.MouseEventHandler\n href?: string\n ref?: any\n } = {\n ref: setRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n\n if (e.defaultPrevented) {\n return\n }\n\n linkClicked(e, router, href, as, replace, shallow, scroll, locale)\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n\n prefetch(router, href, as, {\n locale,\n priority: true,\n // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}\n bypassPrefetchedCheck: true,\n })\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n\n prefetch(router, href, as, {\n locale,\n priority: true,\n // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}\n bypassPrefetchedCheck: true,\n })\n },\n }\n\n // If child is an tag and doesn't have a href attribute, or if the 'passHref' property is\n // defined, we specify the current 'href', so that repetition is not needed by the user.\n // If the url is absolute, we can bypass the logic to prepend the domain and locale.\n if (isAbsoluteUrl(as)) {\n childProps.href = as\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n const curLocale = typeof locale !== 'undefined' ? locale : router?.locale\n\n // we only render domain locales if we are currently on a domain locale\n // so that locale links are still visitable in development/preview envs\n const localeDomain =\n router?.isLocaleDomain &&\n getDomainLocale(as, curLocale, router?.locales, router?.domainLocales)\n\n childProps.href =\n localeDomain ||\n addBasePath(addLocale(as, curLocale, router?.defaultLocale))\n }\n\n return legacyBehavior ? (\n React.cloneElement(child, childProps)\n ) : (\n \n {children}\n \n )\n }\n)\n\nexport default Link\n","import { useCallback, useEffect, useRef, useState } from 'react'\nimport {\n requestIdleCallback,\n cancelIdleCallback,\n} from './request-idle-callback'\n\ntype UseIntersectionObserverInit = Pick<\n IntersectionObserverInit,\n 'rootMargin' | 'root'\n>\n\ntype UseIntersection = { disabled?: boolean } & UseIntersectionObserverInit & {\n rootRef?: React.RefObject | null\n }\ntype ObserveCallback = (isVisible: boolean) => void\ntype Identifier = {\n root: Element | Document | null\n margin: string\n}\ntype Observer = {\n id: Identifier\n observer: IntersectionObserver\n elements: Map\n}\n\nconst hasIntersectionObserver = typeof IntersectionObserver === 'function'\n\nconst observers = new Map()\nconst idList: Identifier[] = []\n\nfunction createObserver(options: UseIntersectionObserverInit): Observer {\n const id = {\n root: options.root || null,\n margin: options.rootMargin || '',\n }\n const existing = idList.find(\n (obj) => obj.root === id.root && obj.margin === id.margin\n )\n let instance: Observer | undefined\n\n if (existing) {\n instance = observers.get(existing)\n if (instance) {\n return instance\n }\n }\n\n const elements = new Map()\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n const callback = elements.get(entry.target)\n const isVisible = entry.isIntersecting || entry.intersectionRatio > 0\n if (callback && isVisible) {\n callback(isVisible)\n }\n })\n }, options)\n instance = {\n id,\n observer,\n elements,\n }\n\n idList.push(id)\n observers.set(id, instance)\n return instance\n}\n\nfunction observe(\n element: Element,\n callback: ObserveCallback,\n options: UseIntersectionObserverInit\n): () => void {\n const { id, observer, elements } = createObserver(options)\n elements.set(element, callback)\n\n observer.observe(element)\n return function unobserve(): void {\n elements.delete(element)\n observer.unobserve(element)\n\n // Destroy observer when there's nothing left to watch:\n if (elements.size === 0) {\n observer.disconnect()\n observers.delete(id)\n const index = idList.findIndex(\n (obj) => obj.root === id.root && obj.margin === id.margin\n )\n if (index > -1) {\n idList.splice(index, 1)\n }\n }\n }\n}\n\nexport function useIntersection({\n rootRef,\n rootMargin,\n disabled,\n}: UseIntersection): [(element: T | null) => void, boolean, () => void] {\n const isDisabled: boolean = disabled || !hasIntersectionObserver\n\n const [visible, setVisible] = useState(false)\n const elementRef = useRef(null)\n const setElement = useCallback((element: T | null) => {\n elementRef.current = element\n }, [])\n\n useEffect(() => {\n if (hasIntersectionObserver) {\n if (isDisabled || visible) return\n\n const element = elementRef.current\n if (element && element.tagName) {\n const unobserve = observe(\n element,\n (isVisible) => isVisible && setVisible(isVisible),\n { root: rootRef?.current, rootMargin }\n )\n\n return unobserve\n }\n } else {\n if (!visible) {\n const idleCallback = requestIdleCallback(() => setVisible(true))\n return () => cancelIdleCallback(idleCallback)\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled, rootMargin, rootRef, visible, elementRef.current])\n\n const resetVisible = useCallback(() => {\n setVisible(false)\n }, [])\n\n return [setElement, visible, resetVisible]\n}\n","import { useMemo, useRef, type Ref } from 'react'\n\n// This is a compatibility hook to support React 18 and 19 refs.\n// In 19, a cleanup function from refs may be returned.\n// In 18, returning a cleanup function creates a warning.\n// Since we take userspace refs, we don't know ahead of time if a cleanup function will be returned.\n// This implements cleanup functions with the old behavior in 18.\n// We know refs are always called alternating with `null` and then `T`.\n// So a call with `null` means we need to call the previous cleanup functions.\nexport function useMergedRef(\n refA: Ref,\n refB: Ref\n): Ref {\n const cleanupA = useRef<() => void>(() => {})\n const cleanupB = useRef<() => void>(() => {})\n\n return useMemo(() => {\n if (!refA || !refB) {\n return refA || refB\n }\n\n return (current: TElement | null): void => {\n if (current === null) {\n cleanupA.current()\n cleanupB.current()\n } else {\n cleanupA.current = applyRef(refA, current)\n cleanupB.current = applyRef(refB, current)\n }\n }\n }, [refA, refB])\n}\n\nfunction applyRef(\n refA: NonNullable>,\n current: TElement\n) {\n if (typeof refA === 'function') {\n const cleanup = refA(current)\n if (typeof cleanup === 'function') {\n return cleanup\n } else {\n return () => refA(null)\n }\n } else {\n refA.current = current\n return () => {\n refA.current = null\n }\n }\n}\n","module.exports = require('./dist/client/link')\n"],"names":["getDomainLocale","path","locale","locales","domainLocales","prefetched","Set","prefetch","router","href","as","options","isLocalURL","bypassPrefetchedCheck","prefetchedKey","undefined","has","add","catch","formatStringOrUrl","urlObjOrString","formatUrl","React","forwardRef","LinkComponent","forwardedRef","children","child","hrefProp","asProp","childrenProp","prefetchProp","passHref","replace","shallow","scroll","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","restProps","props","a","useContext","RouterContext","prefetchEnabled","useMemo","resolvedHref","resolvedAs","resolveHref","previousHref","useRef","previousAs","only","childRef","ref","setIntersectionRef","isVisible","resetVisible","useIntersection","rootMargin","setIntersectionWithResetRef","useCallback","current","el","setRef","useMergedRef","useEffect","childProps","e","defaultPrevented","linkClicked","nodeName","currentTarget","toUpperCase","isModifiedEvent","target","event","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","preventDefault","navigate","routerScroll","priority","process","isAbsoluteUrl","type","curLocale","localeDomain","isLocaleDomain","addBasePath","addLocale","defaultLocale","cloneElement","hasIntersectionObserver","IntersectionObserver","observers","Map","idList","rootRef","disabled","isDisabled","visible","setVisible","useState","elementRef","setElement","element","tagName","observe","callback","id","observer","elements","createObserver","instance","root","margin","existing","find","obj","get","entries","forEach","entry","isIntersecting","intersectionRatio","push","set","unobserve","delete","size","disconnect","index","findIndex","splice","idleCallback","requestIdleCallback","cancelIdleCallback","refA","refB","cleanupA","cleanupB","applyRef","cleanup"],"sourceRoot":"","ignoreList":[4]}