/**
 * @license React
 * react-server-dom-webpack-writer.browser.production.min.server.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
'use strict';var e=require("react"),k=null,m=0;function n(a,b){if(0!==b.length)if(512<b.length)0<m&&(a.enqueue(new Uint8Array(k.buffer,0,m)),k=new Uint8Array(512),m=0),a.enqueue(b);else{var d=k.length-m;d<b.length&&(0===d?a.enqueue(k):(k.set(b.subarray(0,d),m),a.enqueue(k),b=b.subarray(d)),k=new Uint8Array(512),m=0);k.set(b,m);m+=b.length}return!0}var p=new TextEncoder;function r(a){return p.encode(a)}function u(a,b){"function"===typeof a.error?a.error(b):a.close()}
var w=JSON.stringify,x=Symbol.for("react.module.reference"),y=Symbol.for("react.element"),aa=Symbol.for("react.fragment"),z=Symbol.for("react.provider"),ba=Symbol.for("react.forward_ref"),ca=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.default_value");function C(a,b,d,c,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b;this.sanitizeURL=g;this.removeEmptyString=h}var D="children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ");
D.push("innerText","textContent");D.forEach(function(a){new C(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new C(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new C(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new C(a,2,!1,a,null,!1,!1)});
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){new C(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new C(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new C(a,4,!1,a,null,!1,!1)});
["cols","rows","size","span"].forEach(function(a){new C(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){new C(a,5,!1,a.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function F(a){return a[1].toUpperCase()}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(E,
F);new C(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(E,F);new C(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(E,F);new C(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){new C(a,1,!1,a.toLowerCase(),null,!1,!1)});
new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){new C(a,1,!1,a.toLowerCase(),null,!0,!0)});
var G={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},da=["Webkit","ms","Moz","O"];Object.keys(G).forEach(function(a){da.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);G[b]=G[a]})});var H=Array.isArray;r("<script>");r("\x3c/script>");r('<script src="');r('<script type="module" src="');r('" async="">\x3c/script>');r("\x3c!-- --\x3e");r(' style="');r(":");r(";");r(" ");r('="');r('"');r('=""');r(">");
r("/>");r(' selected=""');r("\n");r("<!DOCTYPE html>");r("</");r(">");r('<template id="');r('"></template>');r("\x3c!--$--\x3e");r('\x3c!--$?--\x3e<template id="');r('"></template>');r("\x3c!--$!--\x3e");r("\x3c!--/$--\x3e");r('<div hidden id="');r('">');r("</div>");r('<svg aria-hidden="true" style="display:none" id="');r('">');r("</svg>");r('<math aria-hidden="true" style="display:none" id="');r('">');r("</math>");r('<table hidden id="');r('">');r("</table>");r('<table hidden><tbody id="');r('">');
r("</tbody></table>");r('<table hidden><tr id="');r('">');r("</tr></table>");r('<table hidden><colgroup id="');r('">');r("</colgroup></table>");r('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("');r('$RS("');r('","');r('")\x3c/script>');r('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("');
r('$RC("');r('","');r('")\x3c/script>');r('function $RX(a){if(a=document.getElementById(a))a=a.previousSibling,a.data="$!",a._reactRetry&&a._reactRetry()};$RX("');r('$RX("');r('")\x3c/script>');var I=null;
function J(a,b){if(a!==b){a.context._currentValue=a.parentValue;a=a.parent;var d=b.parent;if(null===a){if(null!==d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");}else{if(null===d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");J(a,d);b.context._currentValue=b.value}}}function K(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&K(a)}
function L(a){var b=a.parent;null!==b&&L(b);a.context._currentValue=a.value}function ea(a,b){a.context._currentValue=a.parentValue;a=a.parent;if(null===a)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===b.depth?J(a,b):ea(a,b)}
function fa(a,b){var d=b.parent;if(null===d)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===d.depth?J(a,d):fa(a,d);b.context._currentValue=b.value}function M(a){var b=I;b!==a&&(null===b?L(a):null===a?K(b):b.depth===a.depth?J(b,a):b.depth>a.depth?ea(b,a):fa(b,a),I=a)}function ha(a,b){var d=a._currentValue;a._currentValue=b;var c=I;return I=a={parent:c,depth:null===c?0:c.depth+1,context:a,parentValue:d,value:b}}
function ia(a){return a._currentValue}
var la={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:N,useTransition:N,getCacheForType:function(a){if(!R)throw Error("Reading the cache is only supported while rendering.");var b=R.get(a);void 0===b&&(b=a(),R.set(a,b));return b},readContext:ia,useContext:ia,useReducer:N,useRef:N,useState:N,useInsertionEffect:N,useLayoutEffect:N,useImperativeHandle:N,useEffect:N,useId:N,useMutableSource:N,useSyncExternalStore:N,useCacheRefresh:function(){return ja}};
function N(){throw Error("This Hook is not supported in Server Components.");}function ja(){if(!R)throw Error("Refreshing the cache is not supported in Server Components.");}var R=null,ma=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=ma.ContextRegistry,T=ma.ReactCurrentDispatcher;function na(a){console.error(a)}
function oa(a,b,d,c){var f=[],g={status:0,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,pingedSegments:f,completedModuleChunks:[],completedJSONChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenModules:new Map,writtenProviders:new Map,onError:void 0===d?na:d,toJSON:function(a,b){return pa(g,this,a,b)}};g.pendingChunks++;b=qa(c);a=ra(g,a,b);f.push(a);return g}var sa={};
function U(a,b,d,c){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in server components, nor passed to client components.");if("function"===typeof a)return a(c);if("string"===typeof a)return[y,a,b,c];if("symbol"===typeof a)return a===aa?c.children:[y,a,b,c];if(null!=a&&"object"===typeof a){if(a.$$typeof===x)return[y,a,b,c];switch(a.$$typeof){case A:var f=a._init;a=f(a._payload);return U(a,b,d,c);case ba:return b=a.render,b(c,void 0);case ca:return U(a.type,b,d,c);case z:return ha(a._context,
c.value),[y,a,b,{value:c.value,children:c.children,__pop:sa}]}}throw Error("Unsupported server component type: "+V(a));}function ra(a,b,d){var c={id:a.nextChunkId++,model:b,context:d,ping:function(){var b=a.pingedSegments;b.push(c);1===b.length&&ta(a)}};return c}function ua(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,d){return d})}function W(a){var b=JSON.stringify(a);return'"'+a+'"'===b?a:b}
function V(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.substr(0,10)+"...");case "object":if(H(a))return"[...]";a=ua(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
function X(a,b){if(H(a)){for(var d="[",c=0;c<a.length;c++){0<c&&(d+=", ");if(6<c){d+="...";break}var f=a[c];d=""+c===b&&"object"===typeof f&&null!==f?d+X(f):d+V(f)}return d+"]"}d="{";c=Object.keys(a);for(f=0;f<c.length;f++){0<f&&(d+=", ");if(6<f){d+="...";break}var g=c[f];d+=W(g)+": ";var h=a[g];d=g===b&&"object"===typeof h&&null!==h?d+X(h):d+V(h)}return d+"}"}
function pa(a,b,d,c){switch(c){case y:return"$"}for(;"object"===typeof c&&null!==c&&(c.$$typeof===y||c.$$typeof===A);)try{switch(c.$$typeof){case y:var f=c;c=U(f.type,f.key,f.ref,f.props);break;case A:var g=c._init;c=g(c._payload)}}catch(t){if("object"===typeof t&&null!==t&&"function"===typeof t.then)return a.pendingChunks++,a=ra(a,c,I),d=a.ping,t.then(d,d),"@"+a.id.toString(16);Y(a,t);a.pendingChunks++;d=a.nextChunkId++;Z(a,d,t);return"@"+d.toString(16)}if(null===c)return null;if("object"===typeof c){if(c.$$typeof===
x){f=c.filepath+"#"+c.name;g=a.writtenModules;var h=g.get(f);if(void 0!==h)return b[0]===y&&"1"===d?"@"+h.toString(16):"$"+h.toString(16);try{var q=a.bundlerConfig[c.filepath][c.name];a.pendingChunks++;var l=a.nextChunkId++,O=w(q),P="M"+l.toString(16)+":"+O+"\n";var Q=p.encode(P);a.completedModuleChunks.push(Q);g.set(f,l);return b[0]===y&&"1"===d?"@"+l.toString(16):"$"+l.toString(16)}catch(t){return a.pendingChunks++,d=a.nextChunkId++,Z(a,d,t),"$"+d.toString(16)}}else{if(c.$$typeof===z)return b=c._context._globalName,
c=a.writtenProviders,d=c.get(d),void 0===d&&(a.pendingChunks++,d=a.nextChunkId++,c.set(b,d),b="P"+d.toString(16)+":"+b+"\n",b=p.encode(b),a.completedJSONChunks.push(b)),"$"+d.toString(16);if(c===sa){a=I;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=d===B?a.context._defaultValue:d;I=a.parent;return}}return c}if("string"===typeof c)return a="$"===c[0]||"@"===c[0]?"$"+c:c,a;if("boolean"===typeof c||"number"===
typeof c||"undefined"===typeof c)return c;if("function"===typeof c){if(/^on[A-Z]/.test(d))throw Error("Event handlers cannot be passed to client component props. Remove "+(W(d)+" from these props if possible: "+X(b)+"\nIf you need interactivity, consider converting part of this to a client component."));throw Error("Functions cannot be passed directly to client components because they're not serializable. Remove "+(W(d)+" ("+(c.displayName||c.name||"function")+") from this object, or avoid the entire object: "+
X(b)));}if("symbol"===typeof c){q=a.writtenSymbols;l=q.get(c);if(void 0!==l)return"$"+l.toString(16);l=c.description;if(Symbol.for(l)!==c)throw Error("Only global symbols received from Symbol.for(...) can be passed to client components. The symbol Symbol.for("+(c.description+") cannot be found among global symbols. Remove ")+(W(d)+" from this object, or avoid the entire object: "+X(b)));a.pendingChunks++;d=a.nextChunkId++;b=w(l);b="S"+d.toString(16)+":"+b+"\n";b=p.encode(b);a.completedModuleChunks.push(b);
q.set(c,d);return"$"+d.toString(16)}if("bigint"===typeof c)throw Error("BigInt ("+c+") is not yet supported in client component props. Remove "+(W(d)+" from this object or use a plain number instead: "+X(b)));throw Error("Type "+typeof c+" is not supported in client component props. Remove "+(W(d)+" from this object, or avoid the entire object: "+X(b)));}function Y(a,b){a=a.onError;a(b)}function va(a,b){null!==a.destination?(a.status=2,u(a.destination,b)):(a.status=1,a.fatalError=b)}
function Z(a,b,d){var c="";try{if(d instanceof Error){var f=String(d.message);c=String(d.stack)}else f="Error: "+d}catch(g){f="An error occurred but serializing the error message failed."}d={message:f,stack:c};b="E"+b.toString(16)+":"+w(d)+"\n";b=p.encode(b);a.completedErrorChunks.push(b)}
function ta(a){var b=T.current,d=R;T.current=la;R=a.cache;try{var c=a.pingedSegments;a.pingedSegments=[];for(var f=0;f<c.length;f++){var g=c[f];var h=a;M(g.context);try{for(var q=g.model;"object"===typeof q&&null!==q&&q.$$typeof===y;){var l=q;g.model=q;q=U(l.type,l.key,l.ref,l.props)}var O=g.id,P=w(q,h.toJSON),Q="J"+O.toString(16)+":"+P+"\n";var t=p.encode(Q);h.completedJSONChunks.push(t)}catch(v){if("object"===typeof v&&null!==v&&"function"===typeof v.then){var ka=g.ping;v.then(ka,ka)}else Y(h,v),
Z(h,g.id,v)}}null!==a.destination&&wa(a,a.destination)}catch(v){Y(a,v),va(a,v)}finally{T.current=b,R=d}}
function wa(a,b){k=new Uint8Array(512);m=0;try{for(var d=a.completedModuleChunks,c=0;c<d.length;c++)if(a.pendingChunks--,!n(b,d[c])){a.destination=null;c++;break}d.splice(0,c);var f=a.completedJSONChunks;for(c=0;c<f.length;c++)if(a.pendingChunks--,!n(b,f[c])){a.destination=null;c++;break}f.splice(0,c);var g=a.completedErrorChunks;for(c=0;c<g.length;c++)if(a.pendingChunks--,!n(b,g[c])){a.destination=null;c++;break}g.splice(0,c)}finally{k&&0<m&&(b.enqueue(new Uint8Array(k.buffer,0,m)),k=null,m=0)}0===
a.pendingChunks&&b.close()}function qa(a){if(a){var b=I;M(null);for(var d=0;d<a.length;d++){var c=a[d],f=c[0];c=c[1];S[f]||(S[f]=e.createServerContext(f,B));ha(S[f],c)}a=I;M(b);return a}return null}
exports.renderToReadableStream=function(a,b,d,c){var f=oa(a,b,d?d.onError:void 0,c);return new ReadableStream({type:"bytes",start:function(){ta(f)},pull:function(a){if(1===f.status)f.status=2,u(a,f.fatalError);else if(2!==f.status&&null===f.destination){f.destination=a;try{wa(f,a)}catch(h){Y(f,h),va(f,h)}}},cancel:function(){}})};
