/opt/canhelp/node_modules/next/dist/client/components/http-access-fallback
NameSizeModeActions
error-boundary.d.ts7710644editdlrm
error-boundary.js61890644editdlrm
error-boundary.js.map91350644editdlrm
error-fallback.d.ts1580644editdlrm
error-fallback.js28790644editdlrm
error-fallback.js.map21920644editdlrm
http-access-fallback.d.ts9140644editdlrm
http-access-fallback.js23200644editdlrm
http-access-fallback.js.map27620644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js.map (9135B)
{"version":3,"sources":["../../../../src/client/components/http-access-fallback/error-boundary.tsx"],"sourcesContent":["'use client'\n\n/**\n * HTTPAccessFallbackBoundary is a boundary that catches errors and renders a\n * fallback component for HTTP errors.\n *\n * It receives the status code, and determine if it should render fallbacks for few HTTP 4xx errors.\n *\n * e.g. 404\n * 404 represents not found, and the fallback component pair contains the component and its styles.\n *\n */\n\nimport React, { useContext } from 'react'\nimport { useUntrackedPathname } from '../navigation-untracked'\nimport {\n HTTPAccessErrorStatus,\n getAccessFallbackHTTPStatus,\n getAccessFallbackErrorTypeByStatus,\n isHTTPAccessFallbackError,\n} from './http-access-fallback'\nimport { warnOnce } from '../../../shared/lib/utils/warn-once'\nimport { MissingSlotContext } from '../../../shared/lib/app-router-context.shared-runtime'\n\ninterface HTTPAccessFallbackBoundaryProps {\n notFound?: React.ReactNode\n forbidden?: React.ReactNode\n unauthorized?: React.ReactNode\n children: React.ReactNode\n missingSlots?: Set\n}\n\ninterface HTTPAccessFallbackErrorBoundaryProps\n extends HTTPAccessFallbackBoundaryProps {\n pathname: string | null\n missingSlots?: Set\n}\n\ninterface HTTPAccessBoundaryState {\n triggeredStatus: number | undefined\n previousPathname: string | null\n}\n\nclass HTTPAccessFallbackErrorBoundary extends React.Component<\n HTTPAccessFallbackErrorBoundaryProps,\n HTTPAccessBoundaryState\n> {\n constructor(props: HTTPAccessFallbackErrorBoundaryProps) {\n super(props)\n this.state = {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n\n componentDidCatch(): void {\n if (\n process.env.NODE_ENV === 'development' &&\n this.props.missingSlots &&\n this.props.missingSlots.size > 0 &&\n // A missing children slot is the typical not-found case, so no need to warn\n !this.props.missingSlots.has('children')\n ) {\n let warningMessage =\n 'No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs\\n\\n'\n\n const formattedSlots = Array.from(this.props.missingSlots)\n .sort((a, b) => a.localeCompare(b))\n .map((slot) => `@${slot}`)\n .join(', ')\n\n warningMessage += 'Missing slots: ' + formattedSlots\n\n warnOnce(warningMessage)\n }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isHTTPAccessFallbackError(error)) {\n const httpStatus = getAccessFallbackHTTPStatus(error)\n return {\n triggeredStatus: httpStatus,\n }\n }\n // Re-throw if error is not for 404\n throw error\n }\n\n static getDerivedStateFromProps(\n props: HTTPAccessFallbackErrorBoundaryProps,\n state: HTTPAccessBoundaryState\n ): HTTPAccessBoundaryState | null {\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.triggeredStatus) {\n return {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n return {\n triggeredStatus: state.triggeredStatus,\n previousPathname: props.pathname,\n }\n }\n\n render() {\n const { notFound, forbidden, unauthorized, children } = this.props\n const { triggeredStatus } = this.state\n const errorComponents = {\n [HTTPAccessErrorStatus.NOT_FOUND]: notFound,\n [HTTPAccessErrorStatus.FORBIDDEN]: forbidden,\n [HTTPAccessErrorStatus.UNAUTHORIZED]: unauthorized,\n }\n\n if (triggeredStatus) {\n const isNotFound =\n triggeredStatus === HTTPAccessErrorStatus.NOT_FOUND && notFound\n const isForbidden =\n triggeredStatus === HTTPAccessErrorStatus.FORBIDDEN && forbidden\n const isUnauthorized =\n triggeredStatus === HTTPAccessErrorStatus.UNAUTHORIZED && unauthorized\n\n // If there's no matched boundary in this layer, keep throwing the error by rendering the children\n if (!(isNotFound || isForbidden || isUnauthorized)) {\n return children\n }\n\n return (\n <>\n \n {process.env.NODE_ENV === 'development' && (\n \n )}\n {errorComponents[triggeredStatus]}\n \n )\n }\n\n return children\n }\n}\n\nexport function HTTPAccessFallbackBoundary({\n notFound,\n forbidden,\n unauthorized,\n children,\n}: HTTPAccessFallbackBoundaryProps) {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these error can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n const missingSlots = useContext(MissingSlotContext)\n const hasErrorFallback = !!(notFound || forbidden || unauthorized)\n\n if (hasErrorFallback) {\n return (\n \n {children}\n \n )\n }\n\n return <>{children}\n}\n"],"names":["HTTPAccessFallbackBoundary","HTTPAccessFallbackErrorBoundary","React","Component","componentDidCatch","process","env","NODE_ENV","props","missingSlots","size","has","warningMessage","formattedSlots","Array","from","sort","a","b","localeCompare","map","slot","join","warnOnce","getDerivedStateFromError","error","isHTTPAccessFallbackError","httpStatus","getAccessFallbackHTTPStatus","triggeredStatus","getDerivedStateFromProps","state","pathname","previousPathname","undefined","render","notFound","forbidden","unauthorized","children","errorComponents","HTTPAccessErrorStatus","NOT_FOUND","FORBIDDEN","UNAUTHORIZED","isNotFound","isForbidden","isUnauthorized","meta","name","content","getAccessFallbackErrorTypeByStatus","constructor","useUntrackedPathname","useContext","MissingSlotContext","hasErrorFallback"],"mappings":"AAAA;;;;;+BAuJgBA;;;eAAAA;;;;;iEA1IkB;qCACG;oCAM9B;0BACkB;+CACU;AAqBnC,MAAMC,wCAAwCC,cAAK,CAACC,SAAS;IAY3DC,oBAA0B;QACxB,IACEC,QAAQC,GAAG,CAACC,QAAQ,KAAK,iBACzB,IAAI,CAACC,KAAK,CAACC,YAA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