[{"data":1,"prerenderedAt":1215},["ShallowReactive",2],{"markdown-doc:\u002Fguide\u002Fstreaming":3,"markdown-source:recipes\u002Fresponse.ts":263,"mdc--98403-key":264},{"id":4,"title":5,"body":6,"description":252,"extension":253,"keywords":254,"locale":255,"meta":256,"navigation":257,"order":86,"path":258,"section":259,"seo":260,"stem":261,"__hash__":262},"docs\u002Fguide\u002Fstreaming.zh-CN.md","AI 流式接入",{"type":7,"value":8,"toc":246},"minimark",[9,18,23,40,152,178,182,185,189,192,206,210,217,231,235,242],[10,11,12,13,17],"p",{},"AI 回复通常分多次到达。应用负责接收网络数据并累计文本，",[14,15,16],"code",{},"QuireMarkdown"," 负责把当前已经收到的 Markdown 显示出来。它不发起模型请求，也不决定请求何时结束。",[19,20,22],"h2",{"id":21},"_1-把消息交给阅读组件","1. 把消息交给阅读组件",[10,24,25,26,31,32,35,36,39],{},"沿用",[27,28,30],"a",{"href":29},"\u002Fguide\u002Fgetting-started","快速开始","的组件导入。",[14,33,34],{},"message.id"," 是同一条回复的稳定标识，",[14,37,38],{},"message.text"," 是应用累计的文本：",[41,42,47],"pre",{"className":43,"code":44,"language":45,"meta":46,"style":46},"language-vue shiki shiki-themes github-light github-light github-dark","\u003CQuireMarkdown\n  :content=\"message.text\"\n  :identity=\"message.id\"\n  :status=\"message.receiving ? 'receiving' : 'complete'\"\n  @error=\"reportReadingError\"\n\u002F>\n","vue","",[14,48,49,62,84,100,128,146],{"__ignoreMap":46},[50,51,54,58],"span",{"class":52,"line":53},"line",1,[50,55,57],{"class":56},"sVPnS","\u003C",[50,59,61],{"class":60},"su0ou","QuireMarkdown\n",[50,63,65,68,72,75,79,81],{"class":52,"line":64},2,[50,66,67],{"class":56},"  :",[50,69,71],{"class":70},"sgQzM","content",[50,73,74],{"class":56},"=",[50,76,78],{"class":77},"s-HEn","\"",[50,80,38],{"class":56},[50,82,83],{"class":77},"\"\n",[50,85,87,89,92,94,96,98],{"class":52,"line":86},3,[50,88,67],{"class":56},[50,90,91],{"class":70},"identity",[50,93,74],{"class":56},[50,95,78],{"class":77},[50,97,34],{"class":56},[50,99,83],{"class":77},[50,101,103,105,108,110,112,115,119,122,125],{"class":52,"line":102},4,[50,104,67],{"class":56},[50,106,107],{"class":70},"status",[50,109,74],{"class":56},[50,111,78],{"class":77},[50,113,114],{"class":56},"message.receiving ",[50,116,118],{"class":117},"sDD9d","?",[50,120,121],{"class":77}," 'receiving'",[50,123,124],{"class":117}," :",[50,126,127],{"class":77}," 'complete'\"\n",[50,129,131,134,137,139,141,144],{"class":52,"line":130},5,[50,132,133],{"class":56},"  @",[50,135,136],{"class":70},"error",[50,138,74],{"class":56},[50,140,78],{"class":77},[50,142,143],{"class":56},"reportReadingError",[50,145,83],{"class":77},[50,147,149],{"class":52,"line":148},6,[50,150,151],{"class":56},"\u002F>\n",[10,153,154,155,159,160,162,163,166,167,170,171,174,175,177],{},"每次传入已收到的",[156,157,158],"strong",{},"完整原文","。同一消息的前缀追加复用解析会话；全文替换、清空、identity\n变化和 options 对象替换会重建会话并释放旧资源。",[14,161,107],{}," 为 ",[14,164,165],{},"receiving","、",[14,168,169],{},"complete","、\n",[14,172,173],{},"stopped"," 或 ",[14,176,136],{},"，只表示传输状态；停止不丢字，也不提前冻结块或补写语法结束标记。\n后到的链接、脚注定义仍可更新前文。外部网络请求由应用取消。",[19,179,181],{"id":180},"_2-观察追加和停止的效果","2. 观察追加和停止的效果",[10,183,184],{},"点击“开始流式演示”，观察标题、链接和脚注陆续出现；点击“停止”会保留已收到的文字。停止网络请求仍由应用负责。",[186,187],"docs-demo",{"name":188},"reading\u002Fstream",[19,190,191],{"id":191},"服务端首屏",[10,193,194,195,198,199,202,203,205],{},"默认 SSR 直接生成标题、列表、链接等语义内容，客户端首帧使用相同解析策略。资源加载\n只在客户端挂载后开始。需要推迟初次解析时使用 ",[14,196,197],{},"ssr=\"source\"","：服务端与首帧显示转义\n原文，挂载后解析。",[14,200,201],{},"state"," 可接收已有快照，但不能与 ",[14,204,71],{}," 同时提供。",[19,207,209],{"id":208},"_3-接收真实文本响应","3. 接收真实文本响应",[10,211,212,213,216],{},"下面的可复用函数只处理响应体为 ",[156,214,215],{},"原始 Markdown 文本"," 的 HTTP 流。\n把应用的 AbortSignal 同时交给 fetch 和此函数，并用 onText 更新 message.text；\n开始请求设 receiving，成功设 complete，主动取消设 stopped，其他失败设 error。\n旧请求的回调应核对请求身份，不能覆盖已切换的消息；组件卸载时由宿主 abort。",[10,218,219,222,223,226,227,230],{},[14,220,221],{},"recipes\u002Fresponse.ts"," 只负责从响应体读取和解码文本，",[14,224,225],{},"readMarkdownResponse(response, signal, onText)"," 会把累计全文交给 ",[14,228,229],{},"onText","，并在结束时返回全文。消息列表、请求状态和错误提示仍放在应用中。",[232,233],"docs-recipe",{"name":234},"recipes\u002Fresponse",[10,236,237,238,241],{},"如果服务端使用 SSE 或 JSON 事件，先在宿主解码协议，只把文本 delta 追加为 Markdown。\n不要把 ",[14,239,240],{},"data:","、事件 JSON 或二进制 chunk 的边界直接当作 Markdown；TextDecoder 必须跨块保留解码状态。",[243,244,245],"style",{},"html pre.shiki code .sVPnS, html code.shiki .sVPnS{--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .su0ou, html code.shiki .su0ou{--shiki-default:#22863A;--shiki-light:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sgQzM, html code.shiki .sgQzM{--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s-HEn, html code.shiki .s-HEn{--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sDD9d, html code.shiki .sDD9d{--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":46,"searchDepth":64,"depth":64,"links":247},[248,249,250,251],{"id":21,"depth":64,"text":22},{"id":180,"depth":64,"text":181},{"id":191,"depth":64,"text":191},{"id":208,"depth":64,"text":209},"把陆续收到的 Markdown 显示为同一条消息，并处理结束、取消与失败。","md",null,"zh-CN",{},true,"\u002Fguide\u002Fstreaming","接入指南",{"title":5,"description":252},"guide\u002Fstreaming.zh-CN","oVhMRLHCAIX5D9ymKsTwErhY5YIn32tUQrviUq6Edl8","\u002F**\n * Consume an HTTP response whose body is raw Markdown text, not SSE or provider JSON.\n * @param response - Response returned by the application's fetch call.\n * @param signal - The same AbortSignal passed to fetch by the host.\n * @param onText - Receives the entire accepted Markdown prefix after each decoded chunk.\n * @returns Complete source, preserving UTF-8 characters split across transport chunks.\n *\u002F\nexport async function readMarkdownResponse(response: Response, signal: AbortSignal, onText: (text: string) => void): Promise\u003Cstring> {\n  signal.throwIfAborted();\n  if (!response.ok || !response.body) throw new Error(`markdown-response:${response.status}`);\n  const reader = response.body.getReader(), decoder = new TextDecoder();\n  let content = \"\";\n  \u002F** Cancel producer reads; the component retains whatever the host has already accepted. *\u002F\n  const cancel = (): void => { void reader.cancel().catch(() => {}); };\n  signal.addEventListener(\"abort\", cancel, { once: true });\n  try {\n    while (true) {\n      const chunk = await reader.read();\n      signal.throwIfAborted();\n      if (chunk.done) break;\n      content += decoder.decode(chunk.value, { stream: true });\n      onText(content);\n    }\n    const tail = decoder.decode();\n    if (tail) { content += tail; onText(content); }\n    return content;\n  } finally {\n    signal.removeEventListener(\"abort\", cancel);\n    await reader.cancel().catch(() => {});\n    reader.releaseLock();\n  }\n}\n",{"data":265,"body":266},{},{"type":267,"children":268},"root",[269,1210],{"type":270,"tag":41,"props":271,"children":275},"element",{"className":272,"code":273,"language":274,"meta":46,"style":46},"language-ts shiki shiki-themes github-light github-light github-dark","\u002F**\n * Consume an HTTP response whose body is raw Markdown text, not SSE or provider JSON.\n * @param response - Response returned by the application's fetch call.\n * @param signal - The same AbortSignal passed to fetch by the host.\n * @param onText - Receives the entire accepted Markdown prefix after each decoded chunk.\n * @returns Complete source, preserving UTF-8 characters split across transport chunks.\n *\u002F\nexport async function readMarkdownResponse(response: Response, signal: AbortSignal, onText: (text: string) => void): Promise\u003Cstring> {\n  signal.throwIfAborted();\n  if (!response.ok || !response.body) throw new Error(`markdown-response:${response.status}`);\n  const reader = response.body.getReader(), decoder = new TextDecoder();\n  let content = \"\";\n  \u002F** Cancel producer reads; the component retains whatever the host has already accepted. *\u002F\n  const cancel = (): void => { void reader.cancel().catch(() => {}); };\n  signal.addEventListener(\"abort\", cancel, { once: true });\n  try {\n    while (true) {\n      const chunk = await reader.read();\n      signal.throwIfAborted();\n      if (chunk.done) break;\n      content += decoder.decode(chunk.value, { stream: true });\n      onText(content);\n    }\n    const tail = decoder.decode();\n    if (tail) { content += tail; onText(content); }\n    return content;\n  } finally {\n    signal.removeEventListener(\"abort\", cancel);\n    await reader.cancel().catch(() => {});\n    reader.releaseLock();\n  }\n}\n\n","ts",[276],{"type":270,"tag":14,"props":277,"children":278},{"__ignoreMap":46},[279,289,297,322,343,364,381,390,529,548,634,690,718,727,806,843,857,879,915,932,955,992,1006,1015,1045,1077,1091,1109,1136,1174,1192,1201],{"type":270,"tag":50,"props":280,"children":281},{"class":52,"line":53},[282],{"type":270,"tag":50,"props":283,"children":285},{"style":284},"--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D",[286],{"type":287,"value":288},"text","\u002F**\n",{"type":270,"tag":50,"props":290,"children":291},{"class":52,"line":64},[292],{"type":270,"tag":50,"props":293,"children":294},{"style":284},[295],{"type":287,"value":296}," * Consume an HTTP response whose body is raw Markdown text, not SSE or provider JSON.\n",{"type":270,"tag":50,"props":298,"children":299},{"class":52,"line":86},[300,305,311,317],{"type":270,"tag":50,"props":301,"children":302},{"style":284},[303],{"type":287,"value":304}," * ",{"type":270,"tag":50,"props":306,"children":308},{"style":307},"--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583",[309],{"type":287,"value":310},"@param",{"type":270,"tag":50,"props":312,"children":314},{"style":313},"--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8",[315],{"type":287,"value":316}," response",{"type":270,"tag":50,"props":318,"children":319},{"style":284},[320],{"type":287,"value":321}," - Response returned by the application's fetch call.\n",{"type":270,"tag":50,"props":323,"children":324},{"class":52,"line":102},[325,329,333,338],{"type":270,"tag":50,"props":326,"children":327},{"style":284},[328],{"type":287,"value":304},{"type":270,"tag":50,"props":330,"children":331},{"style":307},[332],{"type":287,"value":310},{"type":270,"tag":50,"props":334,"children":335},{"style":313},[336],{"type":287,"value":337}," signal",{"type":270,"tag":50,"props":339,"children":340},{"style":284},[341],{"type":287,"value":342}," - The same AbortSignal passed to fetch by the host.\n",{"type":270,"tag":50,"props":344,"children":345},{"class":52,"line":130},[346,350,354,359],{"type":270,"tag":50,"props":347,"children":348},{"style":284},[349],{"type":287,"value":304},{"type":270,"tag":50,"props":351,"children":352},{"style":307},[353],{"type":287,"value":310},{"type":270,"tag":50,"props":355,"children":356},{"style":313},[357],{"type":287,"value":358}," onText",{"type":270,"tag":50,"props":360,"children":361},{"style":284},[362],{"type":287,"value":363}," - Receives the entire accepted Markdown prefix after each decoded chunk.\n",{"type":270,"tag":50,"props":365,"children":366},{"class":52,"line":148},[367,371,376],{"type":270,"tag":50,"props":368,"children":369},{"style":284},[370],{"type":287,"value":304},{"type":270,"tag":50,"props":372,"children":373},{"style":307},[374],{"type":287,"value":375},"@returns",{"type":270,"tag":50,"props":377,"children":378},{"style":284},[379],{"type":287,"value":380}," Complete source, preserving UTF-8 characters split across transport chunks.\n",{"type":270,"tag":50,"props":382,"children":384},{"class":52,"line":383},7,[385],{"type":270,"tag":50,"props":386,"children":387},{"style":284},[388],{"type":287,"value":389}," *\u002F\n",{"type":270,"tag":50,"props":391,"children":393},{"class":52,"line":392},8,[394,399,404,409,415,420,426,431,436,441,446,450,455,459,463,467,472,476,480,486,491,496,501,506,510,515,519,524],{"type":270,"tag":50,"props":395,"children":396},{"style":307},[397],{"type":287,"value":398},"export",{"type":270,"tag":50,"props":400,"children":401},{"style":307},[402],{"type":287,"value":403}," async",{"type":270,"tag":50,"props":405,"children":406},{"style":307},[407],{"type":287,"value":408}," function",{"type":270,"tag":50,"props":410,"children":412},{"style":411},"--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0",[413],{"type":287,"value":414}," readMarkdownResponse",{"type":270,"tag":50,"props":416,"children":417},{"style":313},[418],{"type":287,"value":419},"(",{"type":270,"tag":50,"props":421,"children":423},{"style":422},"--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70",[424],{"type":287,"value":425},"response",{"type":270,"tag":50,"props":427,"children":428},{"style":307},[429],{"type":287,"value":430},":",{"type":270,"tag":50,"props":432,"children":433},{"style":411},[434],{"type":287,"value":435}," Response",{"type":270,"tag":50,"props":437,"children":438},{"style":313},[439],{"type":287,"value":440},", ",{"type":270,"tag":50,"props":442,"children":443},{"style":422},[444],{"type":287,"value":445},"signal",{"type":270,"tag":50,"props":447,"children":448},{"style":307},[449],{"type":287,"value":430},{"type":270,"tag":50,"props":451,"children":452},{"style":411},[453],{"type":287,"value":454}," AbortSignal",{"type":270,"tag":50,"props":456,"children":457},{"style":313},[458],{"type":287,"value":440},{"type":270,"tag":50,"props":460,"children":461},{"style":411},[462],{"type":287,"value":229},{"type":270,"tag":50,"props":464,"children":465},{"style":307},[466],{"type":287,"value":430},{"type":270,"tag":50,"props":468,"children":469},{"style":313},[470],{"type":287,"value":471}," (",{"type":270,"tag":50,"props":473,"children":474},{"style":422},[475],{"type":287,"value":287},{"type":270,"tag":50,"props":477,"children":478},{"style":307},[479],{"type":287,"value":430},{"type":270,"tag":50,"props":481,"children":483},{"style":482},"--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF",[484],{"type":287,"value":485}," string",{"type":270,"tag":50,"props":487,"children":488},{"style":313},[489],{"type":287,"value":490},") ",{"type":270,"tag":50,"props":492,"children":493},{"style":307},[494],{"type":287,"value":495},"=>",{"type":270,"tag":50,"props":497,"children":498},{"style":482},[499],{"type":287,"value":500}," void",{"type":270,"tag":50,"props":502,"children":503},{"style":313},[504],{"type":287,"value":505},")",{"type":270,"tag":50,"props":507,"children":508},{"style":307},[509],{"type":287,"value":430},{"type":270,"tag":50,"props":511,"children":512},{"style":411},[513],{"type":287,"value":514}," Promise",{"type":270,"tag":50,"props":516,"children":517},{"style":313},[518],{"type":287,"value":57},{"type":270,"tag":50,"props":520,"children":521},{"style":482},[522],{"type":287,"value":523},"string",{"type":270,"tag":50,"props":525,"children":526},{"style":313},[527],{"type":287,"value":528},"> {\n",{"type":270,"tag":50,"props":530,"children":532},{"class":52,"line":531},9,[533,538,543],{"type":270,"tag":50,"props":534,"children":535},{"style":313},[536],{"type":287,"value":537},"  signal.",{"type":270,"tag":50,"props":539,"children":540},{"style":411},[541],{"type":287,"value":542},"throwIfAborted",{"type":270,"tag":50,"props":544,"children":545},{"style":313},[546],{"type":287,"value":547},"();\n",{"type":270,"tag":50,"props":549,"children":551},{"class":52,"line":550},10,[552,557,561,566,571,576,581,586,591,596,601,605,611,615,620,624,629],{"type":270,"tag":50,"props":553,"children":554},{"style":307},[555],{"type":287,"value":556},"  if",{"type":270,"tag":50,"props":558,"children":559},{"style":313},[560],{"type":287,"value":471},{"type":270,"tag":50,"props":562,"children":563},{"style":307},[564],{"type":287,"value":565},"!",{"type":270,"tag":50,"props":567,"children":568},{"style":313},[569],{"type":287,"value":570},"response.ok ",{"type":270,"tag":50,"props":572,"children":573},{"style":307},[574],{"type":287,"value":575},"||",{"type":270,"tag":50,"props":577,"children":578},{"style":307},[579],{"type":287,"value":580}," !",{"type":270,"tag":50,"props":582,"children":583},{"style":313},[584],{"type":287,"value":585},"response.body) ",{"type":270,"tag":50,"props":587,"children":588},{"style":307},[589],{"type":287,"value":590},"throw",{"type":270,"tag":50,"props":592,"children":593},{"style":307},[594],{"type":287,"value":595}," new",{"type":270,"tag":50,"props":597,"children":598},{"style":411},[599],{"type":287,"value":600}," Error",{"type":270,"tag":50,"props":602,"children":603},{"style":313},[604],{"type":287,"value":419},{"type":270,"tag":50,"props":606,"children":608},{"style":607},"--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF",[609],{"type":287,"value":610},"`markdown-response:${",{"type":270,"tag":50,"props":612,"children":613},{"style":313},[614],{"type":287,"value":425},{"type":270,"tag":50,"props":616,"children":617},{"style":607},[618],{"type":287,"value":619},".",{"type":270,"tag":50,"props":621,"children":622},{"style":313},[623],{"type":287,"value":107},{"type":270,"tag":50,"props":625,"children":626},{"style":607},[627],{"type":287,"value":628},"}`",{"type":270,"tag":50,"props":630,"children":631},{"style":313},[632],{"type":287,"value":633},");\n",{"type":270,"tag":50,"props":635,"children":637},{"class":52,"line":636},11,[638,643,648,653,658,663,668,673,677,681,686],{"type":270,"tag":50,"props":639,"children":640},{"style":307},[641],{"type":287,"value":642},"  const",{"type":270,"tag":50,"props":644,"children":645},{"style":482},[646],{"type":287,"value":647}," reader",{"type":270,"tag":50,"props":649,"children":650},{"style":307},[651],{"type":287,"value":652}," =",{"type":270,"tag":50,"props":654,"children":655},{"style":313},[656],{"type":287,"value":657}," response.body.",{"type":270,"tag":50,"props":659,"children":660},{"style":411},[661],{"type":287,"value":662},"getReader",{"type":270,"tag":50,"props":664,"children":665},{"style":313},[666],{"type":287,"value":667},"(), ",{"type":270,"tag":50,"props":669,"children":670},{"style":482},[671],{"type":287,"value":672},"decoder",{"type":270,"tag":50,"props":674,"children":675},{"style":307},[676],{"type":287,"value":652},{"type":270,"tag":50,"props":678,"children":679},{"style":307},[680],{"type":287,"value":595},{"type":270,"tag":50,"props":682,"children":683},{"style":411},[684],{"type":287,"value":685}," TextDecoder",{"type":270,"tag":50,"props":687,"children":688},{"style":313},[689],{"type":287,"value":547},{"type":270,"tag":50,"props":691,"children":693},{"class":52,"line":692},12,[694,699,704,708,713],{"type":270,"tag":50,"props":695,"children":696},{"style":307},[697],{"type":287,"value":698},"  let",{"type":270,"tag":50,"props":700,"children":701},{"style":313},[702],{"type":287,"value":703}," content ",{"type":270,"tag":50,"props":705,"children":706},{"style":307},[707],{"type":287,"value":74},{"type":270,"tag":50,"props":709,"children":710},{"style":607},[711],{"type":287,"value":712}," \"\"",{"type":270,"tag":50,"props":714,"children":715},{"style":313},[716],{"type":287,"value":717},";\n",{"type":270,"tag":50,"props":719,"children":721},{"class":52,"line":720},13,[722],{"type":270,"tag":50,"props":723,"children":724},{"style":284},[725],{"type":287,"value":726},"  \u002F** Cancel producer reads; the component retains whatever the host has already accepted. *\u002F\n",{"type":270,"tag":50,"props":728,"children":730},{"class":52,"line":729},14,[731,735,740,744,749,753,757,762,767,772,777,782,787,792,797,801],{"type":270,"tag":50,"props":732,"children":733},{"style":307},[734],{"type":287,"value":642},{"type":270,"tag":50,"props":736,"children":737},{"style":411},[738],{"type":287,"value":739}," cancel",{"type":270,"tag":50,"props":741,"children":742},{"style":307},[743],{"type":287,"value":652},{"type":270,"tag":50,"props":745,"children":746},{"style":313},[747],{"type":287,"value":748}," ()",{"type":270,"tag":50,"props":750,"children":751},{"style":307},[752],{"type":287,"value":430},{"type":270,"tag":50,"props":754,"children":755},{"style":482},[756],{"type":287,"value":500},{"type":270,"tag":50,"props":758,"children":759},{"style":307},[760],{"type":287,"value":761}," =>",{"type":270,"tag":50,"props":763,"children":764},{"style":313},[765],{"type":287,"value":766}," { ",{"type":270,"tag":50,"props":768,"children":769},{"style":307},[770],{"type":287,"value":771},"void",{"type":270,"tag":50,"props":773,"children":774},{"style":313},[775],{"type":287,"value":776}," reader.",{"type":270,"tag":50,"props":778,"children":779},{"style":411},[780],{"type":287,"value":781},"cancel",{"type":270,"tag":50,"props":783,"children":784},{"style":313},[785],{"type":287,"value":786},"().",{"type":270,"tag":50,"props":788,"children":789},{"style":411},[790],{"type":287,"value":791},"catch",{"type":270,"tag":50,"props":793,"children":794},{"style":313},[795],{"type":287,"value":796},"(() ",{"type":270,"tag":50,"props":798,"children":799},{"style":307},[800],{"type":287,"value":495},{"type":270,"tag":50,"props":802,"children":803},{"style":313},[804],{"type":287,"value":805}," {}); };\n",{"type":270,"tag":50,"props":807,"children":809},{"class":52,"line":808},15,[810,814,819,823,828,833,838],{"type":270,"tag":50,"props":811,"children":812},{"style":313},[813],{"type":287,"value":537},{"type":270,"tag":50,"props":815,"children":816},{"style":411},[817],{"type":287,"value":818},"addEventListener",{"type":270,"tag":50,"props":820,"children":821},{"style":313},[822],{"type":287,"value":419},{"type":270,"tag":50,"props":824,"children":825},{"style":607},[826],{"type":287,"value":827},"\"abort\"",{"type":270,"tag":50,"props":829,"children":830},{"style":313},[831],{"type":287,"value":832},", cancel, { once: ",{"type":270,"tag":50,"props":834,"children":835},{"style":482},[836],{"type":287,"value":837},"true",{"type":270,"tag":50,"props":839,"children":840},{"style":313},[841],{"type":287,"value":842}," });\n",{"type":270,"tag":50,"props":844,"children":846},{"class":52,"line":845},16,[847,852],{"type":270,"tag":50,"props":848,"children":849},{"style":307},[850],{"type":287,"value":851},"  try",{"type":270,"tag":50,"props":853,"children":854},{"style":313},[855],{"type":287,"value":856}," {\n",{"type":270,"tag":50,"props":858,"children":860},{"class":52,"line":859},17,[861,866,870,874],{"type":270,"tag":50,"props":862,"children":863},{"style":307},[864],{"type":287,"value":865},"    while",{"type":270,"tag":50,"props":867,"children":868},{"style":313},[869],{"type":287,"value":471},{"type":270,"tag":50,"props":871,"children":872},{"style":482},[873],{"type":287,"value":837},{"type":270,"tag":50,"props":875,"children":876},{"style":313},[877],{"type":287,"value":878},") {\n",{"type":270,"tag":50,"props":880,"children":882},{"class":52,"line":881},18,[883,888,893,897,902,906,911],{"type":270,"tag":50,"props":884,"children":885},{"style":307},[886],{"type":287,"value":887},"      const",{"type":270,"tag":50,"props":889,"children":890},{"style":482},[891],{"type":287,"value":892}," chunk",{"type":270,"tag":50,"props":894,"children":895},{"style":307},[896],{"type":287,"value":652},{"type":270,"tag":50,"props":898,"children":899},{"style":307},[900],{"type":287,"value":901}," await",{"type":270,"tag":50,"props":903,"children":904},{"style":313},[905],{"type":287,"value":776},{"type":270,"tag":50,"props":907,"children":908},{"style":411},[909],{"type":287,"value":910},"read",{"type":270,"tag":50,"props":912,"children":913},{"style":313},[914],{"type":287,"value":547},{"type":270,"tag":50,"props":916,"children":918},{"class":52,"line":917},19,[919,924,928],{"type":270,"tag":50,"props":920,"children":921},{"style":313},[922],{"type":287,"value":923},"      signal.",{"type":270,"tag":50,"props":925,"children":926},{"style":411},[927],{"type":287,"value":542},{"type":270,"tag":50,"props":929,"children":930},{"style":313},[931],{"type":287,"value":547},{"type":270,"tag":50,"props":933,"children":935},{"class":52,"line":934},20,[936,941,946,951],{"type":270,"tag":50,"props":937,"children":938},{"style":307},[939],{"type":287,"value":940},"      if",{"type":270,"tag":50,"props":942,"children":943},{"style":313},[944],{"type":287,"value":945}," (chunk.done) ",{"type":270,"tag":50,"props":947,"children":948},{"style":307},[949],{"type":287,"value":950},"break",{"type":270,"tag":50,"props":952,"children":953},{"style":313},[954],{"type":287,"value":717},{"type":270,"tag":50,"props":956,"children":958},{"class":52,"line":957},21,[959,964,969,974,979,984,988],{"type":270,"tag":50,"props":960,"children":961},{"style":313},[962],{"type":287,"value":963},"      content ",{"type":270,"tag":50,"props":965,"children":966},{"style":307},[967],{"type":287,"value":968},"+=",{"type":270,"tag":50,"props":970,"children":971},{"style":313},[972],{"type":287,"value":973}," decoder.",{"type":270,"tag":50,"props":975,"children":976},{"style":411},[977],{"type":287,"value":978},"decode",{"type":270,"tag":50,"props":980,"children":981},{"style":313},[982],{"type":287,"value":983},"(chunk.value, { stream: ",{"type":270,"tag":50,"props":985,"children":986},{"style":482},[987],{"type":287,"value":837},{"type":270,"tag":50,"props":989,"children":990},{"style":313},[991],{"type":287,"value":842},{"type":270,"tag":50,"props":993,"children":995},{"class":52,"line":994},22,[996,1001],{"type":270,"tag":50,"props":997,"children":998},{"style":411},[999],{"type":287,"value":1000},"      onText",{"type":270,"tag":50,"props":1002,"children":1003},{"style":313},[1004],{"type":287,"value":1005},"(content);\n",{"type":270,"tag":50,"props":1007,"children":1009},{"class":52,"line":1008},23,[1010],{"type":270,"tag":50,"props":1011,"children":1012},{"style":313},[1013],{"type":287,"value":1014},"    }\n",{"type":270,"tag":50,"props":1016,"children":1018},{"class":52,"line":1017},24,[1019,1024,1029,1033,1037,1041],{"type":270,"tag":50,"props":1020,"children":1021},{"style":307},[1022],{"type":287,"value":1023},"    const",{"type":270,"tag":50,"props":1025,"children":1026},{"style":482},[1027],{"type":287,"value":1028}," tail",{"type":270,"tag":50,"props":1030,"children":1031},{"style":307},[1032],{"type":287,"value":652},{"type":270,"tag":50,"props":1034,"children":1035},{"style":313},[1036],{"type":287,"value":973},{"type":270,"tag":50,"props":1038,"children":1039},{"style":411},[1040],{"type":287,"value":978},{"type":270,"tag":50,"props":1042,"children":1043},{"style":313},[1044],{"type":287,"value":547},{"type":270,"tag":50,"props":1046,"children":1048},{"class":52,"line":1047},25,[1049,1054,1059,1063,1068,1072],{"type":270,"tag":50,"props":1050,"children":1051},{"style":307},[1052],{"type":287,"value":1053},"    if",{"type":270,"tag":50,"props":1055,"children":1056},{"style":313},[1057],{"type":287,"value":1058}," (tail) { content ",{"type":270,"tag":50,"props":1060,"children":1061},{"style":307},[1062],{"type":287,"value":968},{"type":270,"tag":50,"props":1064,"children":1065},{"style":313},[1066],{"type":287,"value":1067}," tail; ",{"type":270,"tag":50,"props":1069,"children":1070},{"style":411},[1071],{"type":287,"value":229},{"type":270,"tag":50,"props":1073,"children":1074},{"style":313},[1075],{"type":287,"value":1076},"(content); }\n",{"type":270,"tag":50,"props":1078,"children":1080},{"class":52,"line":1079},26,[1081,1086],{"type":270,"tag":50,"props":1082,"children":1083},{"style":307},[1084],{"type":287,"value":1085},"    return",{"type":270,"tag":50,"props":1087,"children":1088},{"style":313},[1089],{"type":287,"value":1090}," content;\n",{"type":270,"tag":50,"props":1092,"children":1094},{"class":52,"line":1093},27,[1095,1100,1105],{"type":270,"tag":50,"props":1096,"children":1097},{"style":313},[1098],{"type":287,"value":1099},"  } ",{"type":270,"tag":50,"props":1101,"children":1102},{"style":307},[1103],{"type":287,"value":1104},"finally",{"type":270,"tag":50,"props":1106,"children":1107},{"style":313},[1108],{"type":287,"value":856},{"type":270,"tag":50,"props":1110,"children":1112},{"class":52,"line":1111},28,[1113,1118,1123,1127,1131],{"type":270,"tag":50,"props":1114,"children":1115},{"style":313},[1116],{"type":287,"value":1117},"    signal.",{"type":270,"tag":50,"props":1119,"children":1120},{"style":411},[1121],{"type":287,"value":1122},"removeEventListener",{"type":270,"tag":50,"props":1124,"children":1125},{"style":313},[1126],{"type":287,"value":419},{"type":270,"tag":50,"props":1128,"children":1129},{"style":607},[1130],{"type":287,"value":827},{"type":270,"tag":50,"props":1132,"children":1133},{"style":313},[1134],{"type":287,"value":1135},", cancel);\n",{"type":270,"tag":50,"props":1137,"children":1139},{"class":52,"line":1138},29,[1140,1145,1149,1153,1157,1161,1165,1169],{"type":270,"tag":50,"props":1141,"children":1142},{"style":307},[1143],{"type":287,"value":1144},"    await",{"type":270,"tag":50,"props":1146,"children":1147},{"style":313},[1148],{"type":287,"value":776},{"type":270,"tag":50,"props":1150,"children":1151},{"style":411},[1152],{"type":287,"value":781},{"type":270,"tag":50,"props":1154,"children":1155},{"style":313},[1156],{"type":287,"value":786},{"type":270,"tag":50,"props":1158,"children":1159},{"style":411},[1160],{"type":287,"value":791},{"type":270,"tag":50,"props":1162,"children":1163},{"style":313},[1164],{"type":287,"value":796},{"type":270,"tag":50,"props":1166,"children":1167},{"style":307},[1168],{"type":287,"value":495},{"type":270,"tag":50,"props":1170,"children":1171},{"style":313},[1172],{"type":287,"value":1173}," {});\n",{"type":270,"tag":50,"props":1175,"children":1177},{"class":52,"line":1176},30,[1178,1183,1188],{"type":270,"tag":50,"props":1179,"children":1180},{"style":313},[1181],{"type":287,"value":1182},"    reader.",{"type":270,"tag":50,"props":1184,"children":1185},{"style":411},[1186],{"type":287,"value":1187},"releaseLock",{"type":270,"tag":50,"props":1189,"children":1190},{"style":313},[1191],{"type":287,"value":547},{"type":270,"tag":50,"props":1193,"children":1195},{"class":52,"line":1194},31,[1196],{"type":270,"tag":50,"props":1197,"children":1198},{"style":313},[1199],{"type":287,"value":1200},"  }\n",{"type":270,"tag":50,"props":1202,"children":1204},{"class":52,"line":1203},32,[1205],{"type":270,"tag":50,"props":1206,"children":1207},{"style":313},[1208],{"type":287,"value":1209},"}\n",{"type":270,"tag":243,"props":1211,"children":1212},{},[1213],{"type":287,"value":1214},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",1793045321582]