| Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64 Path : /home/livedhms/lmgt/node_modules/next/dist/server/dev/ |
| Current File : //home/livedhms/lmgt/node_modules/next/dist/server/dev/debug-channel.js.map |
{"version":3,"sources":["../../../src/server/dev/debug-channel.ts"],"sourcesContent":["import { createBufferedTransformStream } from '../stream-utils/node-web-streams-helper'\nimport {\n HMR_MESSAGE_SENT_TO_BROWSER,\n type HmrMessageSentToBrowser,\n} from './hot-reloader-types'\n\nexport interface ReactDebugChannelForBrowser {\n readonly readable: ReadableStream<Uint8Array>\n // Might also get a writable stream as return channel in the future.\n}\n\nconst reactDebugChannelsByHtmlRequestId = new Map<\n string,\n ReactDebugChannelForBrowser\n>()\n\nexport function connectReactDebugChannel(\n requestId: string,\n debugChannel: ReactDebugChannelForBrowser,\n sendToClient: (message: HmrMessageSentToBrowser) => void\n) {\n const reader = debugChannel.readable\n .pipeThrough(\n // We're sending the chunks in batches to reduce overhead in the browser.\n createBufferedTransformStream({ maxBufferByteLength: 128 * 1024 })\n )\n .getReader()\n\n const stop = () => {\n sendToClient({\n type: HMR_MESSAGE_SENT_TO_BROWSER.REACT_DEBUG_CHUNK,\n requestId,\n chunk: null,\n })\n }\n\n const onError = (err: unknown) => {\n console.error(new Error('React debug channel stream error', { cause: err }))\n stop()\n }\n\n const progress = (entry: ReadableStreamReadResult<Uint8Array>) => {\n if (entry.done) {\n stop()\n } else {\n sendToClient({\n type: HMR_MESSAGE_SENT_TO_BROWSER.REACT_DEBUG_CHUNK,\n requestId,\n chunk: entry.value,\n })\n\n reader.read().then(progress, onError)\n }\n }\n\n reader.read().then(progress, onError)\n}\n\nexport function connectReactDebugChannelForHtmlRequest(\n htmlRequestId: string,\n sendToClient: (message: HmrMessageSentToBrowser) => void\n) {\n const debugChannel = reactDebugChannelsByHtmlRequestId.get(htmlRequestId)\n\n if (!debugChannel) {\n return\n }\n\n reactDebugChannelsByHtmlRequestId.delete(htmlRequestId)\n\n connectReactDebugChannel(htmlRequestId, debugChannel, sendToClient)\n}\n\nexport function setReactDebugChannelForHtmlRequest(\n htmlRequestId: string,\n debugChannel: ReactDebugChannelForBrowser\n) {\n // TODO: Clean up after a timeout, in case the client never connects, e.g.\n // when CURL'ing the page, or loading the page with JavaScript disabled etc.\n reactDebugChannelsByHtmlRequestId.set(htmlRequestId, debugChannel)\n}\n\nexport function deleteReactDebugChannelForHtmlRequest(htmlRequestId: string) {\n reactDebugChannelsByHtmlRequestId.delete(htmlRequestId)\n}\n"],"names":["connectReactDebugChannel","connectReactDebugChannelForHtmlRequest","deleteReactDebugChannelForHtmlRequest","setReactDebugChannelForHtmlRequest","reactDebugChannelsByHtmlRequestId","Map","requestId","debugChannel","sendToClient","reader","readable","pipeThrough","createBufferedTransformStream","maxBufferByteLength","getReader","stop","type","HMR_MESSAGE_SENT_TO_BROWSER","REACT_DEBUG_CHUNK","chunk","onError","err","console","error","Error","cause","progress","entry","done","value","read","then","htmlRequestId","get","delete","set"],"mappings":";;;;;;;;;;;;;;;;;IAgBgBA,wBAAwB;eAAxBA;;IA0CAC,sCAAsC;eAAtCA;;IAwBAC,qCAAqC;eAArCA;;IATAC,kCAAkC;eAAlCA;;;sCAzE8B;kCAIvC;AAOP,MAAMC,oCAAoC,IAAIC;AAKvC,SAASL,yBACdM,SAAiB,EACjBC,YAAyC,EACzCC,YAAwD;IAExD,MAAMC,SAASF,aAAaG,QAAQ,CACjCC,WAAW,CACV,yEAAyE;IACzEC,IAAAA,mDAA6B,EAAC;QAAEC,qBAAqB,MAAM;IAAK,IAEjEC,SAAS;IAEZ,MAAMC,OAAO;QACXP,aAAa;YACXQ,MAAMC,6CAA2B,CAACC,iBAAiB;YACnDZ;YACAa,OAAO;QACT;IACF;IAEA,MAAMC,UAAU,CAACC;QACfC,QAAQC,KAAK,CAAC,qBAA6D,CAA7D,IAAIC,MAAM,oCAAoC;YAAEC,OAAOJ;QAAI,IAA3D,qBA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