/opt/canhelp/node_modules/next/dist/esm/client
NameSizeModeActions
app-dir/-0755rm
compat/-0755rm
components/-0755rm
dev/-0755rm
legacy/-0755rm
lib/-0755rm
portal/-0755rm
react-client-callbacks/-0755rm
request/-0755rm
tracing/-0755rm
add-base-path.js4330644editdlrm
add-base-path.js.map9780644editdlrm
add-locale.js5010644editdlrm
add-locale.js.map8990644editdlrm
app-bootstrap.js22100644editdlrm
app-bootstrap.js.map39640644editdlrm
app-build-id.js9850644editdlrm
app-build-id.js.map14180644editdlrm
app-call-server.js6000644editdlrm
app-call-server.js.map10410644editdlrm
app-find-source-map-url.js11240644editdlrm
app-find-source-map-url.js.map20810644editdlrm
app-globals.js3010644editdlrm
app-globals.js.map6000644editdlrm
app-index.js102280644editdlrm
app-index.js.map172380644editdlrm
app-link-gc.js40250644editdlrm
app-link-gc.js.map51460644editdlrm
app-next-dev.js7330644editdlrm
app-next-dev.js.map12640644editdlrm
app-next-turbopack.js8430644editdlrm
app-next-turbopack.js.map16820644editdlrm
app-next.js8560644editdlrm
app-next.js.map12660644editdlrm
app-webpack.js27270644editdlrm
app-webpack.js.map32070644editdlrm
assign-location.js9950644editdlrm
assign-location.js.map15570644editdlrm
detect-domain-locale.js3800644editdlrm
detect-domain-locale.js.map7110644editdlrm
flight-data-helpers.js50880644editdlrm
flight-data-helpers.js.map86570644editdlrm
form-shared.js55520644editdlrm
form-shared.js.map106220644editdlrm
form.js52120644editdlrm
form.js.map83060644editdlrm
get-domain-locale.js9980644editdlrm
get-domain-locale.js.map24510644editdlrm
has-base-path.js2570644editdlrm
has-base-path.js.map5980644editdlrm
head-manager.js49880644editdlrm
head-manager.js.map83200644editdlrm
image-component.js128780644editdlrm
image-component.js.map214460644editdlrm
index.js312570644editdlrm
index.js.map527990644editdlrm
link.js181650644editdlrm
link.js.map343940644editdlrm
next-dev-turbopack.js14170644editdlrm
next-dev-turbopack.js.map30540644editdlrm
next-dev.js6260644editdlrm
next-dev.js.map12300644editdlrm
next-turbopack.js11660644editdlrm
next-turbopack.js.map23970644editdlrm
next.js3830644editdlrm
next.js.map8930644editdlrm
normalize-locale-path.js3390644editdlrm
normalize-locale-path.js.map8720644editdlrm
normalize-trailing-slash.js9350644editdlrm
normalize-trailing-slash.js.map17360644editdlrm
page-bootstrap.js63140644editdlrm
page-bootstrap.js.map90250644editdlrm
page-loader.js68200644editdlrm
page-loader.js.map122200644editdlrm
remove-base-path.js5260644editdlrm
remove-base-path.js.map11380644editdlrm
remove-locale.js6000644editdlrm
remove-locale.js.map13010644editdlrm
request-idle-callback.js6340644editdlrm
request-idle-callback.js.map13920644editdlrm
resolve-href.js48160644editdlrm
resolve-href.js.map79830644editdlrm
route-announcer.js23460644editdlrm
route-announcer.js.map35230644editdlrm
route-loader.js130750644editdlrm
route-loader.js.map230360644editdlrm
route-params.js68150644editdlrm
route-params.js.map108220644editdlrm
router.js58730644editdlrm
router.js.map88450644editdlrm
script.js126190644editdlrm
script.js.map187110644editdlrm
set-attributes-from-props.js18170644editdlrm
set-attributes-from-props.js.map31010644editdlrm
trusted-types.js14100644editdlrm
trusted-types.js.map19560644editdlrm
use-client-disallowed.js4760644editdlrm
use-client-disallowed.js.map7390644editdlrm
use-intersection.js32480644editdlrm
use-intersection.js.map66470644editdlrm
use-merged-ref.js23450644editdlrm
use-merged-ref.js.map35660644editdlrm
web-vitals.js4910644editdlrm
web-vitals.js.map10050644editdlrm
webpack.js18770644editdlrm
webpack.js.map25420644editdlrm
with-router.js7810644editdlrm
with-router.js.map19350644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/client/app-index.js (10228B)
import { jsx as _jsx } from "react/jsx-runtime"; import './app-globals'; import ReactDOMClient from 'react-dom/client'; import React, { use } from 'react'; // TODO: Explicitly import from client.browser // eslint-disable-next-line import/no-extraneous-dependencies import { createFromReadableStream as createFromReadableStreamBrowser } from 'react-server-dom-webpack/client'; import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'; import { onRecoverableError } from './react-client-callbacks/on-recoverable-error'; import { onCaughtError, onUncaughtError } from './react-client-callbacks/error-boundary-callbacks'; import { callServer } from './app-call-server'; import { findSourceMapURL } from './app-find-source-map-url'; import { createMutableActionQueue } from './components/app-router-instance'; import AppRouter from './components/app-router'; import { createInitialRouterState } from './components/router-reducer/create-initial-router-state'; import { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'; import { setAppBuildId } from './app-build-id'; /// const createFromReadableStream = createFromReadableStreamBrowser; const appElement = document; const encoder = new TextEncoder(); let initialServerDataBuffer = undefined; let initialServerDataWriter = undefined; let initialServerDataLoaded = false; let initialServerDataFlushed = false; let initialFormStateData = null; function nextServerDataCallback(seg) { if (seg[0] === 0) { initialServerDataBuffer = []; } else if (seg[0] === 1) { if (!initialServerDataBuffer) throw Object.defineProperty(new Error('Unexpected server data: missing bootstrap script.'), "__NEXT_ERROR_CODE", { value: "E18", enumerable: false, configurable: true }); if (initialServerDataWriter) { initialServerDataWriter.enqueue(encoder.encode(seg[1])); } else { initialServerDataBuffer.push(seg[1]); } } else if (seg[0] === 2) { initialFormStateData = seg[1]; } else if (seg[0] === 3) { if (!initialServerDataBuffer) throw Object.defineProperty(new Error('Unexpected server data: missing bootstrap script.'), "__NEXT_ERROR_CODE", { value: "E18", enumerable: false, configurable: true }); // Decode the base64 string back to binary data. const binaryString = atob(seg[1]); const decodedChunk = new Uint8Array(binaryString.length); for(var i = 0; i < binaryString.length; i++){ decodedChunk[i] = binaryString.charCodeAt(i); } if (initialServerDataWriter) { initialServerDataWriter.enqueue(decodedChunk); } else { initialServerDataBuffer.push(decodedChunk); } } } function isStreamErrorOrUnfinished(ctr) { // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished. return ctr.desiredSize === null || ctr.desiredSize < 0; } // There might be race conditions between `nextServerDataRegisterWriter` and // `DOMContentLoaded`. The former will be called when React starts to hydrate // the root, the latter will be called when the DOM is fully loaded. // For streaming, the former is called first due to partial hydration. // For non-streaming, the latter can be called first. // Hence, we use two variables `initialServerDataLoaded` and // `initialServerDataFlushed` to make sure the writer will be closed and // `initialServerDataBuffer` will be cleared in the right time. function nextServerDataRegisterWriter(ctr) { if (initialServerDataBuffer) { initialServerDataBuffer.forEach((val)=>{ ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val); }); if (initialServerDataLoaded && !initialServerDataFlushed) { if (isStreamErrorOrUnfinished(ctr)) { ctr.error(Object.defineProperty(new Error('The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'), "__NEXT_ERROR_CODE", { value: "E117", enumerable: false, configurable: true })); } else { ctr.close(); } initialServerDataFlushed = true; initialServerDataBuffer = undefined; } } initialServerDataWriter = ctr; } // When `DOMContentLoaded`, we can close all pending writers to finish hydration. const DOMContentLoaded = function() { if (initialServerDataWriter && !initialServerDataFlushed) { initialServerDataWriter.close(); initialServerDataFlushed = true; initialServerDataBuffer = undefined; } initialServerDataLoaded = true; }; // It's possible that the DOM is already loaded. if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', DOMContentLoaded, false); } else { // Delayed in marco task to ensure it's executed later than hydration setTimeout(DOMContentLoaded); } const nextServerDataLoadingGlobal = self.__next_f = self.__next_f || []; nextServerDataLoadingGlobal.forEach(nextServerDataCallback); nextServerDataLoadingGlobal.push = nextServerDataCallback; const readable = new ReadableStream({ start (controller) { nextServerDataRegisterWriter(controller); } }); const initialServerResponse = createFromReadableStream(readable, { callServer, findSourceMapURL }); function ServerRoot(param) { let { pendingActionQueue } = param; const initialRSCPayload = use(initialServerResponse); const actionQueue = use(pendingActionQueue); const router = /*#__PURE__*/ _jsx(AppRouter, { actionQueue: actionQueue, globalErrorState: initialRSCPayload.G, assetPrefix: initialRSCPayload.p }); if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) { // We provide missing slot information in a context provider only during development // as we log some additional information about the missing slots in the console. return /*#__PURE__*/ _jsx(MissingSlotContext, { value: initialRSCPayload.m, children: router }); } return router; } const StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP ? React.StrictMode : React.Fragment; function Root(param) { let { children } = param; if (process.env.__NEXT_TEST_MODE) { // eslint-disable-next-line react-hooks/rules-of-hooks React.useEffect(()=>{ window.__NEXT_HYDRATED = true; window.__NEXT_HYDRATED_AT = performance.now(); window.__NEXT_HYDRATED_CB == null ? void 0 : window.__NEXT_HYDRATED_CB.call(window); }, []); } return children; } function onDefaultTransitionIndicator() { // TODO: Compose default with user-configureable (e.g. nprogress) // TODO: Use React's default once we figure out hanging indicators: https://codesandbox.io/p/sandbox/charming-moon-hktkp6?file=%2Fsrc%2Findex.js%3A106%2C30 return ()=>{}; } const reactRootOptions = { onDefaultTransitionIndicator: onDefaultTransitionIndicator, onRecoverableError, onCaughtError, onUncaughtError }; export function hydrate(instrumentationHooks) { // React overrides `.then` and doesn't return a new promise chain, // so we wrap the action queue in a promise to ensure that its value // is defined when the promise resolves. // https://github.com/facebook/react/blob/163365a07872337e04826c4f501565d43dbd2fd4/packages/react-client/src/ReactFlightClient.js#L189-L190 const pendingActionQueue = new Promise((resolve, reject)=>{ initialServerResponse.then((initialRSCPayload)=>{ // setAppBuildId should be called only once, during JS initialization // and before any components have hydrated. setAppBuildId(initialRSCPayload.b); const initialTimestamp = Date.now(); resolve(createMutableActionQueue(createInitialRouterState({ navigatedAt: initialTimestamp, initialFlightData: initialRSCPayload.f, initialCanonicalUrlParts: initialRSCPayload.c, initialParallelRoutes: new Map(), location: window.location, couldBeIntercepted: initialRSCPayload.i, postponed: initialRSCPayload.s, prerendered: initialRSCPayload.S }), instrumentationHooks)); }, (err)=>reject(err)); }); const reactEl = /*#__PURE__*/ _jsx(StrictModeIfEnabled, { children: /*#__PURE__*/ _jsx(HeadManagerContext.Provider, { value: { appDir: true }, children: /*#__PURE__*/ _jsx(Root, { children: /*#__PURE__*/ _jsx(ServerRoot, { pendingActionQueue: pendingActionQueue }) }) }) }); if (document.documentElement.id === '__next_error__') { let element = reactEl; // Server rendering failed, fall back to client-side rendering if (process.env.NODE_ENV !== 'production') { const { RootLevelDevOverlayElement } = require('../next-devtools/userspace/app/client-entry'); // Note this won't cause hydration mismatch because we are doing CSR w/o hydration element = /*#__PURE__*/ _jsx(RootLevelDevOverlayElement, { children: element }); } ReactDOMClient.createRoot(appElement, reactRootOptions).render(element); } else { React.startTransition(()=>{ ReactDOMClient.hydrateRoot(appElement, reactEl, { ...reactRootOptions, formState: initialFormStateData }); }); } // TODO-APP: Remove this logic when Float has GC built-in in development. if (process.env.NODE_ENV !== 'production') { const { linkGc } = require('./app-link-gc'); linkGc(); } } //# sourceMappingURL=app-index.js.map