bpms_site/.svn/pristine/e4/e4f15dccfd5fb9d4f1b3d904aa304299f1034f59.svn-base
2025-11-02 16:38:49 +03:30

23 lines
201 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var __webpack_modules__={"../next-env/dist/index.js":(R,A,M)=>{(()=>{var A={840:R=>{"use strict";function A(R,M,D){let I=R.match(/(.?\${*[\w]*(?::-)?[\w]*}*)/g)||[];return I.reduce(function(R,q,$){let H,U;let F=/(.?)\${*([\w]*(?::-)?[\w]*)?}*/g.exec(q);if(!F||0===F.length)return R;let B=F[1];if("\\"===B)H=(U=F[0]).replace("\\$","$");else{let q=F[2].split(":-"),W=q[0];if(U=F[0].substring(B.length),H=Object.prototype.hasOwnProperty.call(M,W)?M[W]:D.parsed[W]||q[1]||"",q.length>1&&H){let A=I[$+1];I[$+1]="",R=R.replace(A,"")}H=A(H,M,D)}return R.replace(U,H)},R)}function M(R){let M=R.ignoreProcessEnv?{}:process.env;for(let D in R.parsed){let I=Object.prototype.hasOwnProperty.call(M,D)?M[D]:R.parsed[D];R.parsed[D]=A(I,M,R)}for(let A in R.parsed)M[A]=R.parsed[A];return R}R.exports.j=M},358:(R,A,M)=>{var D;let I=M(147),q=M(17),$=M(37);function H(R){console.log(`[dotenv][DEBUG] ${R}`)}let U="\n",F=/^\s*([\w.-]+)\s*=\s*(.*)?\s*$/,B=/\\n/g,W=/\r\n|\n|\r/;function z(R,A){let M=!!(A&&A.debug),D={};return R.toString().split(W).forEach(function(R,A){let I=R.match(F);if(null!=I){let R=I[1],A=I[2]||"",M=A.length-1,q='"'===A[0]&&'"'===A[M],$="'"===A[0]&&"'"===A[M];$||q?(A=A.substring(1,M),q&&(A=A.replace(B,U))):A=A.trim(),D[R]=A}else M&&H(`did not match key and value when parsing line ${A+1}: ${R}`)}),D}function G(R){return"~"===R[0]?q.join($.homedir(),R.slice(1)):R}D=function(R){let A=q.resolve(process.cwd(),".env"),M="utf8",D=!1;R&&(null!=R.path&&(A=G(R.path)),null!=R.encoding&&(M=R.encoding),null!=R.debug&&(D=!0));try{let R=z(I.readFileSync(A,{encoding:M}),{debug:D});return Object.keys(R).forEach(function(A){Object.prototype.hasOwnProperty.call(process.env,A)?D&&H(`"${A}" is already defined in \`process.env\` and will not be overwritten`):process.env[A]=R[A]}),{parsed:R}}catch(R){return{error:R}}},R.exports.Q=z},147:R=>{"use strict";R.exports=M("fs")},37:R=>{"use strict";R.exports=M("os")},17:R=>{"use strict";R.exports=M("path")}},D={};function I(R){var M=D[R];if(void 0!==M)return M.exports;var q=D[R]={exports:{}},$=!0;try{A[R](q,q.exports,I),$=!1}finally{$&&delete D[R]}return q.exports}(()=>{I.n=R=>{var A=R&&R.__esModule?()=>R.default:()=>R;return I.d(A,{a:A}),A}})(),(()=>{I.d=(R,A)=>{for(var M in A)I.o(A,M)&&!I.o(R,M)&&Object.defineProperty(R,M,{enumerable:!0,get:A[M]})}})(),(()=>{I.o=(R,A)=>Object.prototype.hasOwnProperty.call(R,A)})(),(()=>{I.r=R=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}})(),I.ab=__dirname+"/";var q={};(()=>{"use strict";let R,A;I.r(q),I.d(q,{initialEnv:()=>R,updateInitialEnv:()=>B,processEnv:()=>z,resetEnv:()=>G,loadEnvConfig:()=>X});var M=I(147);I.n(M);var D=I(17);I.n(D);var $=I(358),H=I(840);let U=[],F=[];function B(A){Object.assign(R||{},A)}function W(R){Object.keys(process.env).forEach(A=>{A.startsWith("__NEXT_PRIVATE")||void 0!==R[A]&&""!==R[A]||delete process.env[A]}),Object.entries(R).forEach(([R,A])=>{process.env[R]=A})}function z(A,M,I=console,q=!1,U){var B;if(R||(R=Object.assign({},process.env)),!q&&(process.env.__NEXT_PROCESSED_ENV||0===A.length))return process.env;process.env.__NEXT_PROCESSED_ENV="true";let W=Object.assign({},R),z={};for(let R of A)try{let A={};for(let M of(A.parsed=$.Q(R.contents),(A=(0,H.j)(A)).parsed&&!F.some(A=>A.contents===R.contents&&A.path===R.path)&&(null==U||U(R.path)),Object.keys(A.parsed||{})))void 0===z[M]&&void 0===W[M]&&(z[M]=null===(B=A.parsed)||void 0===B?void 0:B[M])}catch(A){I.error(`Failed to load env from ${D.join(M||"",R.path)}`,A)}return Object.assign(process.env,z)}function G(){R&&W(R)}function X(I,q,$=console,H=!1,B){if(R||(R=Object.assign({},process.env)),A&&!H)return{combinedEnv:A,loadedEnvFiles:U};W(R),F=U,U=[];let G=!1,X=G?"test":q?"development":"production",V=[`.env.${X}.local`,"test"!==X&&".env.local",`.env.${X}`,".env"].filter(Boolean);for(let R of V){let A=D.join(I,R);try{let D=M.statSync(A);if(!D.isFile())continue;let I=M.readFileSync(A,"utf8");U.push({path:R,contents:I})}catch(A){"ENOENT"!==A.code&&$.error(`Failed to load env from ${R}`,A)}}return{combinedEnv:A=z(U,I,$,H,B),loadedEnvFiles:U}}})(),R.exports=q})()},"./dist/compiled/@edge-runtime/cookies/index.js":R=>{"use strict";var A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,I=Object.prototype.hasOwnProperty,q=(R,q,$,H)=>{if(q&&"object"==typeof q||"function"==typeof q)for(let U of D(q))I.call(R,U)||U===$||A(R,U,{get:()=>q[U],enumerable:!(H=M(q,U))||H.enumerable});return R},$=R=>q(A({},"__esModule",{value:!0}),R),H={};function U(R){var A;let M=["path"in R&&R.path&&`Path=${R.path}`,"expires"in R&&(R.expires||0===R.expires)&&`Expires=${("number"==typeof R.expires?new Date(R.expires):R.expires).toUTCString()}`,"maxAge"in R&&"number"==typeof R.maxAge&&`Max-Age=${R.maxAge}`,"domain"in R&&R.domain&&`Domain=${R.domain}`,"secure"in R&&R.secure&&"Secure","httpOnly"in R&&R.httpOnly&&"HttpOnly","sameSite"in R&&R.sameSite&&`SameSite=${R.sameSite}`].filter(Boolean);return`${R.name}=${encodeURIComponent(null!=(A=R.value)?A:"")}; ${M.join("; ")}`}function F(R){let A=new Map;for(let M of R.split(/; */)){if(!M)continue;let R=M.indexOf("=");if(-1===R){A.set(M,"true");continue}let[D,I]=[M.slice(0,R),M.slice(R+1)];try{A.set(D,decodeURIComponent(null!=I?I:"true"))}catch{}}return A}function B(R){if(!R)return;let[[A,M],...D]=F(R),{domain:I,expires:q,httponly:$,maxage:H,path:U,samesite:B,secure:z}=Object.fromEntries(D.map(([R,A])=>[R.toLowerCase(),A])),X={name:A,value:decodeURIComponent(M),domain:I,...q&&{expires:new Date(q)},...$&&{httpOnly:!0},..."string"==typeof H&&{maxAge:Number(H)},path:U,...B&&{sameSite:G(B)},...z&&{secure:!0}};return W(X)}function W(R){let A={};for(let M in R)R[M]&&(A[M]=R[M]);return A}((R,M)=>{for(var D in M)A(R,D,{get:M[D],enumerable:!0})})(H,{RequestCookies:()=>V,ResponseCookies:()=>K,parseCookie:()=>F,parseSetCookie:()=>B,splitCookiesString:()=>X,stringifyCookie:()=>U}),R.exports=$(H);var z=["strict","lax","none"];function G(R){return R=R.toLowerCase(),z.includes(R)?R:void 0}function X(R){if(!R)return[];var A,M,D,I,q,$=[],H=0;function U(){for(;H<R.length&&/\s/.test(R.charAt(H));)H+=1;return H<R.length}function F(){return"="!==(M=R.charAt(H))&&";"!==M&&","!==M}for(;H<R.length;){for(A=H,q=!1;U();)if(","===(M=R.charAt(H))){for(D=H,H+=1,U(),I=H;H<R.length&&F();)H+=1;H<R.length&&"="===R.charAt(H)?(q=!0,H=I,$.push(R.substring(A,D)),A=H):H=D+1}else H+=1;(!q||H>=R.length)&&$.push(R.substring(A,R.length))}return $}var V=class{constructor(R){this._parsed=new Map,this._headers=R;let A=R.get("cookie");if(A){let R=F(A);for(let[A,M]of R)this._parsed.set(A,{name:A,value:M})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...R){let A="string"==typeof R[0]?R[0]:R[0].name;return this._parsed.get(A)}getAll(...R){var A;let M=Array.from(this._parsed);if(!R.length)return M.map(([R,A])=>A);let D="string"==typeof R[0]?R[0]:null==(A=R[0])?void 0:A.name;return M.filter(([R])=>R===D).map(([R,A])=>A)}has(R){return this._parsed.has(R)}set(...R){let[A,M]=1===R.length?[R[0].name,R[0].value]:R,D=this._parsed;return D.set(A,{name:A,value:M}),this._headers.set("cookie",Array.from(D).map(([R,A])=>U(A)).join("; ")),this}delete(R){let A=this._parsed,M=Array.isArray(R)?R.map(R=>A.delete(R)):A.delete(R);return this._headers.set("cookie",Array.from(A).map(([R,A])=>U(A)).join("; ")),M}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(R=>`${R.name}=${encodeURIComponent(R.value)}`).join("; ")}},K=class{constructor(R){var A,M;this._parsed=new Map,this._headers=R;let D=null==(A=R.getSetCookie)?void 0:A.call(R);M=R.get("set-cookie");let I=Array.isArray(D)?D:X(D);for(let R of I){let A=B(R);A&&this._parsed.set(A.name,A)}}get(...R){let A="string"==typeof R[0]?R[0]:R[0].name;return this._parsed.get(A)}getAll(...R){var A;let M=Array.from(this._parsed.values());if(!R.length)return M;let D="string"==typeof R[0]?R[0]:null==(A=R[0])?void 0:A.name;return M.filter(R=>R.name===D)}has(R){return this._parsed.has(R)}set(...R){let[A,M,D]=1===R.length?[R[0].name,R[0].value,R[0]]:R,I=this._parsed;return I.set(A,Y({name:A,value:M,...D})),J(I,this._headers),this}delete(...R){let[A,M,D]="string"==typeof R[0]?[R[0]]:[R[0].name,R[0].path,R[0].domain];return this.set({name:A,path:M,domain:D,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(U).join("; ")}};function J(R,A){for(let[,M]of(A.delete("set-cookie"),R)){let R=U(M);A.append("set-cookie",R)}}function Y(R={name:"",value:""}){return"number"==typeof R.expires&&(R.expires=new Date(R.expires)),R.maxAge&&(R.expires=new Date(Date.now()+1e3*R.maxAge)),(null===R.path||void 0===R.path)&&(R.path="/"),R}},"./dist/compiled/bytes/index.js":R=>{(()=>{"use strict";var A={56:R=>{/*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*/R.exports=q,R.exports.format=$,R.exports.parse=H;var A=/\B(?=(\d{3})+(?!\d))/g,M=/(?:\.0*|(\.[^0]+)0+)$/,D={b:1,kb:1024,mb:1048576,gb:1073741824,tb:1099511627776,pb:0x4000000000000},I=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function q(R,A){return"string"==typeof R?H(R):"number"==typeof R?$(R,A):null}function $(R,I){if(!Number.isFinite(R))return null;var q=Math.abs(R),$=I&&I.thousandsSeparator||"",H=I&&I.unitSeparator||"",U=I&&void 0!==I.decimalPlaces?I.decimalPlaces:2,F=!!(I&&I.fixedDecimals),B=I&&I.unit||"";B&&D[B.toLowerCase()]||(B=q>=D.pb?"PB":q>=D.tb?"TB":q>=D.gb?"GB":q>=D.mb?"MB":q>=D.kb?"KB":"B");var W=(R/D[B.toLowerCase()]).toFixed(U);return F||(W=W.replace(M,"$1")),$&&(W=W.split(".").map(function(R,M){return 0===M?R.replace(A,$):R}).join(".")),W+H+B}function H(R){if("number"==typeof R&&!isNaN(R))return R;if("string"!=typeof R)return null;var A,M=I.exec(R),q="b";return M?(A=parseFloat(M[1]),q=M[4].toLowerCase()):(A=parseInt(R,10),q="b"),Math.floor(D[q]*A)}}},M={};function D(R){var I=M[R];if(void 0!==I)return I.exports;var q=M[R]={exports:{}},$=!0;try{A[R](q,q.exports,D),$=!1}finally{$&&delete M[R]}return q.exports}D.ab=__dirname+"/";var I=D(56);R.exports=I})()},"./dist/compiled/content-type/index.js":R=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var A={};(()=>{var R=A,M=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,D=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,I=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,$=/([\\"])/g,H=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function U(R){if(!R||"object"!=typeof R)throw TypeError("argument obj is required");var A=R.parameters,M=R.type;if(!M||!H.test(M))throw TypeError("invalid type");var D=M;if(A&&"object"==typeof A)for(var q,$=Object.keys(A).sort(),U=0;U<$.length;U++){if(q=$[U],!I.test(q))throw TypeError("invalid parameter name");D+="; "+q+"="+W(A[q])}return D}function F(R){if(!R)throw TypeError("argument string is required");var A,D,I,$="object"==typeof R?B(R):R;if("string"!=typeof $)throw TypeError("argument string is required to be a string");var U=$.indexOf(";"),F=-1!==U?$.substr(0,U).trim():$.trim();if(!H.test(F))throw TypeError("invalid media type");var W=new z(F.toLowerCase());if(-1!==U){for(M.lastIndex=U;D=M.exec($);){if(D.index!==U)throw TypeError("invalid parameter format");U+=D[0].length,A=D[1].toLowerCase(),'"'===(I=D[2])[0]&&(I=I.substr(1,I.length-2).replace(q,"$1")),W.parameters[A]=I}if(U!==$.length)throw TypeError("invalid parameter format")}return W}function B(R){var A;if("function"==typeof R.getHeader?A=R.getHeader("content-type"):"object"==typeof R.headers&&(A=R.headers&&R.headers["content-type"]),"string"!=typeof A)throw TypeError("content-type header is missing from object");return A}function W(R){var A=String(R);if(I.test(A))return A;if(A.length>0&&!D.test(A))throw TypeError("invalid parameter value");return'"'+A.replace($,"\\$1")+'"'}function z(R){this.parameters=Object.create(null),this.type=R}R.format=U,R.parse=F})(),R.exports=A})()},"./dist/compiled/cookie/index.js":R=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var A={};(()=>{var R=A;/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/R.parse=$,R.serialize=H;var M=decodeURIComponent,D=encodeURIComponent,I=/; */,q=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function $(R,A){if("string"!=typeof R)throw TypeError("argument str must be a string");for(var D={},q=A||{},$=R.split(I),H=q.decode||M,F=0;F<$.length;F++){var B=$[F],W=B.indexOf("=");if(!(W<0)){var z=B.substr(0,W).trim(),G=B.substr(++W,B.length).trim();'"'==G[0]&&(G=G.slice(1,-1)),void 0==D[z]&&(D[z]=U(G,H))}}return D}function H(R,A,M){var I=M||{},$=I.encode||D;if("function"!=typeof $)throw TypeError("option encode is invalid");if(!q.test(R))throw TypeError("argument name is invalid");var H=$(A);if(H&&!q.test(H))throw TypeError("argument val is invalid");var U=R+"="+H;if(null!=I.maxAge){var F=I.maxAge-0;if(isNaN(F)||!isFinite(F))throw TypeError("option maxAge is invalid");U+="; Max-Age="+Math.floor(F)}if(I.domain){if(!q.test(I.domain))throw TypeError("option domain is invalid");U+="; Domain="+I.domain}if(I.path){if(!q.test(I.path))throw TypeError("option path is invalid");U+="; Path="+I.path}if(I.expires){if("function"!=typeof I.expires.toUTCString)throw TypeError("option expires is invalid");U+="; Expires="+I.expires.toUTCString()}if(I.httpOnly&&(U+="; HttpOnly"),I.secure&&(U+="; Secure"),I.sameSite)switch("string"==typeof I.sameSite?I.sameSite.toLowerCase():I.sameSite){case!0:case"strict":U+="; SameSite=Strict";break;case"lax":U+="; SameSite=Lax";break;case"none":U+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return U}function U(R,A){try{return A(R)}catch(A){return R}}})(),R.exports=A})()},"./dist/compiled/fresh/index.js":R=>{(()=>{"use strict";var A={695:R=>{/*!
* fresh
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2016-2017 Douglas Christopher Wilson
* MIT Licensed
*/var A=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function M(R,M){var q=R["if-modified-since"],$=R["if-none-match"];if(!q&&!$)return!1;var H=R["cache-control"];if(H&&A.test(H))return!1;if($&&"*"!==$){var U=M.etag;if(!U)return!1;for(var F=!0,B=I($),W=0;W<B.length;W++){var z=B[W];if(z===U||z==="W/"+U||"W/"+z===U){F=!1;break}}if(F)return!1}if(q){var G=M["last-modified"];if(!G||!(D(G)<=D(q)))return!1}return!0}function D(R){var A=R&&Date.parse(R);return"number"==typeof A?A:NaN}function I(R){for(var A=0,M=[],D=0,I=0,q=R.length;I<q;I++)switch(R.charCodeAt(I)){case 32:D===A&&(D=A=I+1);break;case 44:M.push(R.substring(D,A)),D=A=I+1;break;default:A=I+1}return M.push(R.substring(D,A)),M}R.exports=M}},M={};function D(R){var I=M[R];if(void 0!==I)return I.exports;var q=M[R]={exports:{}},$=!0;try{A[R](q,q.exports,D),$=!1}finally{$&&delete M[R]}return q.exports}D.ab=__dirname+"/";var I=D(695);R.exports=I})()},"./dist/compiled/lru-cache/index.js":R=>{(()=>{"use strict";var A={806:(R,A,M)=>{let D=M(190),I=Symbol("max"),q=Symbol("length"),$=Symbol("lengthCalculator"),H=Symbol("allowStale"),U=Symbol("maxAge"),F=Symbol("dispose"),B=Symbol("noDisposeOnSet"),W=Symbol("lruList"),z=Symbol("cache"),G=Symbol("updateAgeOnGet"),X=()=>1;class V{constructor(R){if("number"==typeof R&&(R={max:R}),R||(R={}),R.max&&("number"!=typeof R.max||R.max<0))throw TypeError("max must be a non-negative number");this[I]=R.max||1/0;let A=R.length||X;if(this[$]="function"!=typeof A?X:A,this[H]=R.stale||!1,R.maxAge&&"number"!=typeof R.maxAge)throw TypeError("maxAge must be a number");this[U]=R.maxAge||0,this[F]=R.dispose,this[B]=R.noDisposeOnSet||!1,this[G]=R.updateAgeOnGet||!1,this.reset()}set max(R){if("number"!=typeof R||R<0)throw TypeError("max must be a non-negative number");this[I]=R||1/0,Y(this)}get max(){return this[I]}set allowStale(R){this[H]=!!R}get allowStale(){return this[H]}set maxAge(R){if("number"!=typeof R)throw TypeError("maxAge must be a non-negative number");this[U]=R,Y(this)}get maxAge(){return this[U]}set lengthCalculator(R){"function"!=typeof R&&(R=X),R!==this[$]&&(this[$]=R,this[q]=0,this[W].forEach(R=>{R.length=this[$](R.value,R.key),this[q]+=R.length})),Y(this)}get lengthCalculator(){return this[$]}get length(){return this[q]}get itemCount(){return this[W].length}rforEach(R,A){A=A||this;for(let M=this[W].tail;null!==M;){let D=M.prev;ee(this,R,M,A),M=D}}forEach(R,A){A=A||this;for(let M=this[W].head;null!==M;){let D=M.next;ee(this,R,M,A),M=D}}keys(){return this[W].toArray().map(R=>R.key)}values(){return this[W].toArray().map(R=>R.value)}reset(){this[F]&&this[W]&&this[W].length&&this[W].forEach(R=>this[F](R.key,R.value)),this[z]=new Map,this[W]=new D,this[q]=0}dump(){return this[W].map(R=>!J(this,R)&&{k:R.key,v:R.value,e:R.now+(R.maxAge||0)}).toArray().filter(R=>R)}dumpLru(){return this[W]}set(R,A,M){if((M=M||this[U])&&"number"!=typeof M)throw TypeError("maxAge must be a number");let D=M?Date.now():0,H=this[$](A,R);if(this[z].has(R)){if(H>this[I])return Z(this,this[z].get(R)),!1;let $=this[z].get(R),U=$.value;return this[F]&&!this[B]&&this[F](R,U.value),U.now=D,U.maxAge=M,U.value=A,this[q]+=H-U.length,U.length=H,this.get(R),Y(this),!0}let G=new Q(R,A,H,D,M);return G.length>this[I]?(this[F]&&this[F](R,A),!1):(this[q]+=G.length,this[W].unshift(G),this[z].set(R,this[W].head),Y(this),!0)}has(R){if(!this[z].has(R))return!1;let A=this[z].get(R).value;return!J(this,A)}get(R){return K(this,R,!0)}peek(R){return K(this,R,!1)}pop(){let R=this[W].tail;return R?(Z(this,R),R.value):null}del(R){Z(this,this[z].get(R))}load(R){this.reset();let A=Date.now();for(let M=R.length-1;M>=0;M--){let D=R[M],I=D.e||0;if(0===I)this.set(D.k,D.v);else{let R=I-A;R>0&&this.set(D.k,D.v,R)}}}prune(){this[z].forEach((R,A)=>K(this,A,!1))}}let K=(R,A,M)=>{let D=R[z].get(A);if(D){let A=D.value;if(J(R,A)){if(Z(R,D),!R[H])return}else M&&(R[G]&&(D.value.now=Date.now()),R[W].unshiftNode(D));return A.value}},J=(R,A)=>{if(!A||!A.maxAge&&!R[U])return!1;let M=Date.now()-A.now;return A.maxAge?M>A.maxAge:R[U]&&M>R[U]},Y=R=>{if(R[q]>R[I])for(let A=R[W].tail;R[q]>R[I]&&null!==A;){let M=A.prev;Z(R,A),A=M}},Z=(R,A)=>{if(A){let M=A.value;R[F]&&R[F](M.key,M.value),R[q]-=M.length,R[z].delete(M.key),R[W].removeNode(A)}};class Q{constructor(R,A,M,D,I){this.key=R,this.value=A,this.length=M,this.now=D,this.maxAge=I||0}}let ee=(R,A,M,D)=>{let I=M.value;J(R,I)&&(Z(R,M),R[H]||(I=void 0)),I&&A.call(D,I.value,I.key,R)};R.exports=V},76:R=>{R.exports=function(R){R.prototype[Symbol.iterator]=function*(){for(let R=this.head;R;R=R.next)yield R.value}}},190:(R,A,M)=>{function D(R){var A=this;if(A instanceof D||(A=new D),A.tail=null,A.head=null,A.length=0,R&&"function"==typeof R.forEach)R.forEach(function(R){A.push(R)});else if(arguments.length>0)for(var M=0,I=arguments.length;M<I;M++)A.push(arguments[M]);return A}function I(R,A,M){var D=A===R.head?new H(M,null,A,R):new H(M,A,A.next,R);return null===D.next&&(R.tail=D),null===D.prev&&(R.head=D),R.length++,D}function q(R,A){R.tail=new H(A,R.tail,null,R),R.head||(R.head=R.tail),R.length++}function $(R,A){R.head=new H(A,null,R.head,R),R.tail||(R.tail=R.head),R.length++}function H(R,A,M,D){if(!(this instanceof H))return new H(R,A,M,D);this.list=D,this.value=R,A?(A.next=this,this.prev=A):this.prev=null,M?(M.prev=this,this.next=M):this.next=null}R.exports=D,D.Node=H,D.create=D,D.prototype.removeNode=function(R){if(R.list!==this)throw Error("removing node which does not belong to this list");var A=R.next,M=R.prev;return A&&(A.prev=M),M&&(M.next=A),R===this.head&&(this.head=A),R===this.tail&&(this.tail=M),R.list.length--,R.next=null,R.prev=null,R.list=null,A},D.prototype.unshiftNode=function(R){if(R!==this.head){R.list&&R.list.removeNode(R);var A=this.head;R.list=this,R.next=A,A&&(A.prev=R),this.head=R,this.tail||(this.tail=R),this.length++}},D.prototype.pushNode=function(R){if(R!==this.tail){R.list&&R.list.removeNode(R);var A=this.tail;R.list=this,R.prev=A,A&&(A.next=R),this.tail=R,this.head||(this.head=R),this.length++}},D.prototype.push=function(){for(var R=0,A=arguments.length;R<A;R++)q(this,arguments[R]);return this.length},D.prototype.unshift=function(){for(var R=0,A=arguments.length;R<A;R++)$(this,arguments[R]);return this.length},D.prototype.pop=function(){if(this.tail){var R=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,R}},D.prototype.shift=function(){if(this.head){var R=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,R}},D.prototype.forEach=function(R,A){A=A||this;for(var M=this.head,D=0;null!==M;D++)R.call(A,M.value,D,this),M=M.next},D.prototype.forEachReverse=function(R,A){A=A||this;for(var M=this.tail,D=this.length-1;null!==M;D--)R.call(A,M.value,D,this),M=M.prev},D.prototype.get=function(R){for(var A=0,M=this.head;null!==M&&A<R;A++)M=M.next;if(A===R&&null!==M)return M.value},D.prototype.getReverse=function(R){for(var A=0,M=this.tail;null!==M&&A<R;A++)M=M.prev;if(A===R&&null!==M)return M.value},D.prototype.map=function(R,A){A=A||this;for(var M=new D,I=this.head;null!==I;)M.push(R.call(A,I.value,this)),I=I.next;return M},D.prototype.mapReverse=function(R,A){A=A||this;for(var M=new D,I=this.tail;null!==I;)M.push(R.call(A,I.value,this)),I=I.prev;return M},D.prototype.reduce=function(R,A){var M,D=this.head;if(arguments.length>1)M=A;else if(this.head)D=this.head.next,M=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var I=0;null!==D;I++)M=R(M,D.value,I),D=D.next;return M},D.prototype.reduceReverse=function(R,A){var M,D=this.tail;if(arguments.length>1)M=A;else if(this.tail)D=this.tail.prev,M=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(var I=this.length-1;null!==D;I--)M=R(M,D.value,I),D=D.prev;return M},D.prototype.toArray=function(){for(var R=Array(this.length),A=0,M=this.head;null!==M;A++)R[A]=M.value,M=M.next;return R},D.prototype.toArrayReverse=function(){for(var R=Array(this.length),A=0,M=this.tail;null!==M;A++)R[A]=M.value,M=M.prev;return R},D.prototype.slice=function(R,A){(A=A||this.length)<0&&(A+=this.length),(R=R||0)<0&&(R+=this.length);var M=new D;if(A<R||A<0)return M;R<0&&(R=0),A>this.length&&(A=this.length);for(var I=0,q=this.head;null!==q&&I<R;I++)q=q.next;for(;null!==q&&I<A;I++,q=q.next)M.push(q.value);return M},D.prototype.sliceReverse=function(R,A){(A=A||this.length)<0&&(A+=this.length),(R=R||0)<0&&(R+=this.length);var M=new D;if(A<R||A<0)return M;R<0&&(R=0),A>this.length&&(A=this.length);for(var I=this.length,q=this.tail;null!==q&&I>A;I--)q=q.prev;for(;null!==q&&I>R;I--,q=q.prev)M.push(q.value);return M},D.prototype.splice=function(R,A){R>this.length&&(R=this.length-1),R<0&&(R=this.length+R);for(var M=0,D=this.head;null!==D&&M<R;M++)D=D.next;for(var q=[],M=0;D&&M<A;M++)q.push(D.value),D=this.removeNode(D);null===D&&(D=this.tail),D!==this.head&&D!==this.tail&&(D=D.prev);for(var M=2;M<arguments.length;M++)D=I(this,D,arguments[M]);return q},D.prototype.reverse=function(){for(var R=this.head,A=this.tail,M=R;null!==M;M=M.prev){var D=M.prev;M.prev=M.next,M.next=D}return this.head=A,this.tail=R,this};try{M(76)(D)}catch(R){}}},M={};function D(R){var I=M[R];if(void 0!==I)return I.exports;var q=M[R]={exports:{}},$=!0;try{A[R](q,q.exports,D),$=!1}finally{$&&delete M[R]}return q.exports}D.ab=__dirname+"/";var I=D(806);R.exports=I})()},"./dist/compiled/path-to-regexp/index.js":(R,A)=>{"use strict";var M;function D(R){for(var A=[],M=0;M<R.length;){var D=R[M];if("*"===D||"+"===D||"?"===D){A.push({type:"MODIFIER",index:M,value:R[M++]});continue}if("\\"===D){A.push({type:"ESCAPED_CHAR",index:M++,value:R[M++]});continue}if("{"===D){A.push({type:"OPEN",index:M,value:R[M++]});continue}if("}"===D){A.push({type:"CLOSE",index:M,value:R[M++]});continue}if(":"===D){for(var I="",q=M+1;q<R.length;){var $=R.charCodeAt(q);if($>=48&&$<=57||$>=65&&$<=90||$>=97&&$<=122||95===$){I+=R[q++];continue}break}if(!I)throw TypeError("Missing parameter name at "+M);A.push({type:"NAME",index:M,value:I}),M=q;continue}if("("===D){var H=1,U="",q=M+1;if("?"===R[q])throw TypeError('Pattern cannot start with "?" at '+q);for(;q<R.length;){if("\\"===R[q]){U+=R[q++]+R[q++];continue}if(")"===R[q]){if(0==--H){q++;break}}else if("("===R[q]&&(H++,"?"!==R[q+1]))throw TypeError("Capturing groups are not allowed at "+q);U+=R[q++]}if(H)throw TypeError("Unbalanced pattern at "+M);if(!U)throw TypeError("Missing pattern at "+M);A.push({type:"PATTERN",index:M,value:U}),M=q;continue}A.push({type:"CHAR",index:M,value:R[M++]})}return A.push({type:"END",index:M,value:""}),A}function I(R,A){void 0===A&&(A={});for(var M=D(R),I=A.prefixes,q=void 0===I?"./":I,$="[^"+U(A.delimiter||"/#?")+"]+?",H=[],F=0,B=0,W="",z=function(R){if(B<M.length&&M[B].type===R)return M[B++].value},G=function(R){var A=z(R);if(void 0!==A)return A;var D=M[B];throw TypeError("Unexpected "+D.type+" at "+D.index+", expected "+R)},X=function(){for(var R,A="";R=z("CHAR")||z("ESCAPED_CHAR");)A+=R;return A};B<M.length;){var V=z("CHAR"),K=z("NAME"),J=z("PATTERN");if(K||J){var Y=V||"";-1===q.indexOf(Y)&&(W+=Y,Y=""),W&&(H.push(W),W=""),H.push({name:K||F++,prefix:Y,suffix:"",pattern:J||$,modifier:z("MODIFIER")||""});continue}var Z=V||z("ESCAPED_CHAR");if(Z){W+=Z;continue}if(W&&(H.push(W),W=""),z("OPEN")){var Y=X(),Q=z("NAME")||"",ee=z("PATTERN")||"",et=X();G("CLOSE"),H.push({name:Q||(ee?F++:""),pattern:Q&&!ee?$:ee,prefix:Y,suffix:et,modifier:z("MODIFIER")||""});continue}G("END")}return H}function q(R,A){return $(I(R,A),A)}function $(R,A){void 0===A&&(A={});var M=F(A),D=A.encode,I=void 0===D?function(R){return R}:D,q=A.validate,$=void 0===q||q,H=R.map(function(R){if("object"==typeof R)return RegExp("^(?:"+R.pattern+")$",M)});return function(A){for(var M="",D=0;D<R.length;D++){var q=R[D];if("string"==typeof q){M+=q;continue}var U=A?A[q.name]:void 0,F="?"===q.modifier||"*"===q.modifier,B="*"===q.modifier||"+"===q.modifier;if(Array.isArray(U)){if(!B)throw TypeError('Expected "'+q.name+'" to not repeat, but got an array');if(0===U.length){if(F)continue;throw TypeError('Expected "'+q.name+'" to not be empty')}for(var W=0;W<U.length;W++){var z=I(U[W],q);if($&&!H[D].test(z))throw TypeError('Expected all "'+q.name+'" to match "'+q.pattern+'", but got "'+z+'"');M+=q.prefix+z+q.suffix}continue}if("string"==typeof U||"number"==typeof U){var z=I(String(U),q);if($&&!H[D].test(z))throw TypeError('Expected "'+q.name+'" to match "'+q.pattern+'", but got "'+z+'"');M+=q.prefix+z+q.suffix;continue}if(!F){var G=B?"an array":"a string";throw TypeError('Expected "'+q.name+'" to be '+G)}}return M}}function H(R,A,M){void 0===M&&(M={});var D=M.decode,I=void 0===D?function(R){return R}:D;return function(M){var D=R.exec(M);if(!D)return!1;for(var q=D[0],$=D.index,H=Object.create(null),U=function(R){if(void 0===D[R])return"continue";var M=A[R-1];"*"===M.modifier||"+"===M.modifier?H[M.name]=D[R].split(M.prefix+M.suffix).map(function(R){return I(R,M)}):H[M.name]=I(D[R],M)},F=1;F<D.length;F++)U(F);return{path:q,index:$,params:H}}}function U(R){return R.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function F(R){return R&&R.sensitive?"":"i"}function B(R,A){if(!A)return R;var M=R.source.match(/\((?!\?)/g);if(M)for(var D=0;D<M.length;D++)A.push({name:D,prefix:"",suffix:"",modifier:"",pattern:""});return R}function W(R,A,M){return RegExp("(?:"+R.map(function(R){return X(R,A,M).source}).join("|")+")",F(M))}function z(R,A,M){return G(I(R,M),A,M)}function G(R,A,M){void 0===M&&(M={});for(var D=M.strict,I=void 0!==D&&D,q=M.start,$=void 0===q||q,H=M.end,B=void 0===H||H,W=M.encode,z=void 0===W?function(R){return R}:W,G="["+U(M.endsWith||"")+"]|$",X="["+U(M.delimiter||"/#?")+"]",V=$?"^":"",K=0,J=R;K<J.length;K++){var Y=J[K];if("string"==typeof Y)V+=U(z(Y));else{var Z=U(z(Y.prefix)),Q=U(z(Y.suffix));if(Y.pattern){if(A&&A.push(Y),Z||Q){if("+"===Y.modifier||"*"===Y.modifier){var ee="*"===Y.modifier?"?":"";V+="(?:"+Z+"((?:"+Y.pattern+")(?:"+Q+Z+"(?:"+Y.pattern+"))*)"+Q+")"+ee}else V+="(?:"+Z+"("+Y.pattern+")"+Q+")"+Y.modifier}else V+="("+Y.pattern+")"+Y.modifier}else V+="(?:"+Z+Q+")"+Y.modifier}}if(B)I||(V+=X+"?"),V+=M.endsWith?"(?="+G+")":"$";else{var et=R[R.length-1],er="string"==typeof et?X.indexOf(et[et.length-1])>-1:void 0===et;I||(V+="(?:"+X+"(?="+G+"))?"),er||(V+="(?="+X+"|"+G+")")}return new RegExp(V,F(M))}function X(R,A,M){return R instanceof RegExp?B(R,A):Array.isArray(R)?W(R,A,M):z(R,A,M)}M={value:!0},M=I,A.MY=q,M=$,M=function(R,A){var M=[];return H(X(R,M,A),M,A)},A.WS=H,M=G,A.Bo=X},"./dist/compiled/ws/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{(()=>{var __webpack_modules__={28:(R,A,M)=>{"use strict";let D=M(335);D.createWebSocketStream=M(551),D.Server=M(597),D.Receiver=M(157),D.Sender=M(769),D.WebSocket=D,D.WebSocketServer=D.Server,R.exports=D},214:(R,A,M)=>{"use strict";let{EMPTY_BUFFER:D}=M(217);function I(R,A){if(0===R.length)return D;if(1===R.length)return R[0];let M=Buffer.allocUnsafe(A),I=0;for(let A=0;A<R.length;A++){let D=R[A];M.set(D,I),I+=D.length}return I<A?M.slice(0,I):M}function q(R,A,M,D,I){for(let q=0;q<I;q++)M[D+q]=R[q]^A[3&q]}function $(R,A){for(let M=0;M<R.length;M++)R[M]^=A[3&M]}function H(R){return R.byteLength===R.buffer.byteLength?R.buffer:R.buffer.slice(R.byteOffset,R.byteOffset+R.byteLength)}function U(R){let A;return(U.readOnly=!0,Buffer.isBuffer(R))?R:(R instanceof ArrayBuffer?A=Buffer.from(R):ArrayBuffer.isView(R)?A=Buffer.from(R.buffer,R.byteOffset,R.byteLength):(A=Buffer.from(R),U.readOnly=!1),A)}try{let A=M(605);R.exports={concat:I,mask(R,M,D,I,$){$<48?q(R,M,D,I,$):A.mask(R,M,D,I,$)},toArrayBuffer:H,toBuffer:U,unmask(R,M){R.length<32?$(R,M):A.unmask(R,M)}}}catch(A){R.exports={concat:I,mask:q,toArrayBuffer:H,toBuffer:U,unmask:$}}},217:R=>{"use strict";R.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}},874:(R,A,M)=>{"use strict";let{kForOnEventAttribute:D,kListener:I}=M(217),q=Symbol("kCode"),$=Symbol("kData"),H=Symbol("kError"),U=Symbol("kMessage"),F=Symbol("kReason"),B=Symbol("kTarget"),W=Symbol("kType"),z=Symbol("kWasClean");class G{constructor(R){this[B]=null,this[W]=R}get target(){return this[B]}get type(){return this[W]}}Object.defineProperty(G.prototype,"target",{enumerable:!0}),Object.defineProperty(G.prototype,"type",{enumerable:!0});class X extends G{constructor(R,A={}){super(R),this[q]=void 0===A.code?0:A.code,this[F]=void 0===A.reason?"":A.reason,this[z]=void 0!==A.wasClean&&A.wasClean}get code(){return this[q]}get reason(){return this[F]}get wasClean(){return this[z]}}Object.defineProperty(X.prototype,"code",{enumerable:!0}),Object.defineProperty(X.prototype,"reason",{enumerable:!0}),Object.defineProperty(X.prototype,"wasClean",{enumerable:!0});class V extends G{constructor(R,A={}){super(R),this[H]=void 0===A.error?null:A.error,this[U]=void 0===A.message?"":A.message}get error(){return this[H]}get message(){return this[U]}}Object.defineProperty(V.prototype,"error",{enumerable:!0}),Object.defineProperty(V.prototype,"message",{enumerable:!0});class K extends G{constructor(R,A={}){super(R),this[$]=void 0===A.data?null:A.data}get data(){return this[$]}}Object.defineProperty(K.prototype,"data",{enumerable:!0});let J={addEventListener(R,A,M={}){let q;if("message"===R)q=function(R,M){let D=new K("message",{data:M?R:R.toString()});D[B]=this,A.call(this,D)};else if("close"===R)q=function(R,M){let D=new X("close",{code:R,reason:M.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});D[B]=this,A.call(this,D)};else if("error"===R)q=function(R){let M=new V("error",{error:R,message:R.message});M[B]=this,A.call(this,M)};else{if("open"!==R)return;q=function(){let R=new G("open");R[B]=this,A.call(this,R)}}q[D]=!!M[D],q[I]=A,M.once?this.once(R,q):this.on(R,q)},removeEventListener(R,A){for(let M of this.listeners(R))if(M[I]===A&&!M[D]){this.removeListener(R,M);break}}};R.exports={CloseEvent:X,ErrorEvent:V,Event:G,EventTarget:J,MessageEvent:K}},725:(R,A,M)=>{"use strict";let{tokenChars:D}=M(848);function I(R,A,M){void 0===R[A]?R[A]=[M]:R[A].push(M)}function q(R){let A,M;let q=Object.create(null),$=Object.create(null),H=!1,U=!1,F=!1,B=-1,W=-1,z=-1,G=0;for(;G<R.length;G++)if(W=R.charCodeAt(G),void 0===A){if(-1===z&&1===D[W])-1===B&&(B=G);else if(0!==G&&(32===W||9===W))-1===z&&-1!==B&&(z=G);else if(59===W||44===W){if(-1===B)throw SyntaxError(`Unexpected character at index ${G}`);-1===z&&(z=G);let M=R.slice(B,z);44===W?(I(q,M,$),$=Object.create(null)):A=M,B=z=-1}else throw SyntaxError(`Unexpected character at index ${G}`)}else if(void 0===M){if(-1===z&&1===D[W])-1===B&&(B=G);else if(32===W||9===W)-1===z&&-1!==B&&(z=G);else if(59===W||44===W){if(-1===B)throw SyntaxError(`Unexpected character at index ${G}`);-1===z&&(z=G),I($,R.slice(B,z),!0),44===W&&(I(q,A,$),$=Object.create(null),A=void 0),B=z=-1}else if(61===W&&-1!==B&&-1===z)M=R.slice(B,G),B=z=-1;else throw SyntaxError(`Unexpected character at index ${G}`)}else if(U){if(1!==D[W])throw SyntaxError(`Unexpected character at index ${G}`);-1===B?B=G:H||(H=!0),U=!1}else if(F){if(1===D[W])-1===B&&(B=G);else if(34===W&&-1!==B)F=!1,z=G;else if(92===W)U=!0;else throw SyntaxError(`Unexpected character at index ${G}`)}else if(34===W&&61===R.charCodeAt(G-1))F=!0;else if(-1===z&&1===D[W])-1===B&&(B=G);else if(-1!==B&&(32===W||9===W))-1===z&&(z=G);else if(59===W||44===W){if(-1===B)throw SyntaxError(`Unexpected character at index ${G}`);-1===z&&(z=G);let D=R.slice(B,z);H&&(D=D.replace(/\\/g,""),H=!1),I($,M,D),44===W&&(I(q,A,$),$=Object.create(null),A=void 0),M=void 0,B=z=-1}else throw SyntaxError(`Unexpected character at index ${G}`);if(-1===B||F||32===W||9===W)throw SyntaxError("Unexpected end of input");-1===z&&(z=G);let X=R.slice(B,z);return void 0===A?I(q,X,$):(void 0===M?I($,X,!0):H?I($,M,X.replace(/\\/g,"")):I($,M,X),I(q,A,$)),q}function $(R){return Object.keys(R).map(A=>{let M=R[A];return Array.isArray(M)||(M=[M]),M.map(R=>[A].concat(Object.keys(R).map(A=>{let M=R[A];return Array.isArray(M)||(M=[M]),M.map(R=>!0===R?A:`${A}=${R}`).join("; ")})).join("; ")).join(", ")}).join(", ")}R.exports={format:$,parse:q}},462:R=>{"use strict";let A=Symbol("kDone"),M=Symbol("kRun");class D{constructor(R){this[A]=()=>{this.pending--,this[M]()},this.concurrency=R||1/0,this.jobs=[],this.pending=0}add(R){this.jobs.push(R),this[M]()}[M](){if(this.pending!==this.concurrency&&this.jobs.length){let R=this.jobs.shift();this.pending++,R(this[A])}}}R.exports=D},290:(R,A,M)=>{"use strict";let D;let I=M(796),q=M(214),$=M(462),{kStatusCode:H}=M(217),U=Buffer.from([0,0,255,255]),F=Symbol("permessage-deflate"),B=Symbol("total-length"),W=Symbol("callback"),z=Symbol("buffers"),G=Symbol("error");class X{constructor(R,A,M){if(this._maxPayload=0|M,this._options=R||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!A,this._deflate=null,this._inflate=null,this.params=null,!D){let R=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;D=new $(R)}}static get extensionName(){return"permessage-deflate"}offer(){let R={};return this._options.serverNoContextTakeover&&(R.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(R.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(R.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?R.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(R.client_max_window_bits=!0),R}accept(R){return R=this.normalizeParams(R),this.params=this._isServer?this.acceptAsServer(R):this.acceptAsClient(R),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let R=this._deflate[W];this._deflate.close(),this._deflate=null,R&&R(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(R){let A=this._options,M=R.find(R=>(!1!==A.serverNoContextTakeover||!R.server_no_context_takeover)&&(!R.server_max_window_bits||!1!==A.serverMaxWindowBits&&("number"!=typeof A.serverMaxWindowBits||!(A.serverMaxWindowBits>R.server_max_window_bits)))&&("number"!=typeof A.clientMaxWindowBits||!!R.client_max_window_bits));if(!M)throw Error("None of the extension offers can be accepted");return A.serverNoContextTakeover&&(M.server_no_context_takeover=!0),A.clientNoContextTakeover&&(M.client_no_context_takeover=!0),"number"==typeof A.serverMaxWindowBits&&(M.server_max_window_bits=A.serverMaxWindowBits),"number"==typeof A.clientMaxWindowBits?M.client_max_window_bits=A.clientMaxWindowBits:(!0===M.client_max_window_bits||!1===A.clientMaxWindowBits)&&delete M.client_max_window_bits,M}acceptAsClient(R){let A=R[0];if(!1===this._options.clientNoContextTakeover&&A.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(A.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&A.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(A.client_max_window_bits=this._options.clientMaxWindowBits);return A}normalizeParams(R){return R.forEach(R=>{Object.keys(R).forEach(A=>{let M=R[A];if(M.length>1)throw Error(`Parameter "${A}" must have only a single value`);if(M=M[0],"client_max_window_bits"===A){if(!0!==M){let R=+M;if(!Number.isInteger(R)||R<8||R>15)throw TypeError(`Invalid value for parameter "${A}": ${M}`);M=R}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${A}": ${M}`)}else if("server_max_window_bits"===A){let R=+M;if(!Number.isInteger(R)||R<8||R>15)throw TypeError(`Invalid value for parameter "${A}": ${M}`);M=R}else if("client_no_context_takeover"===A||"server_no_context_takeover"===A){if(!0!==M)throw TypeError(`Invalid value for parameter "${A}": ${M}`)}else throw Error(`Unknown parameter "${A}"`);R[A]=M})}),R}decompress(R,A,M){D.add(D=>{this._decompress(R,A,(R,A)=>{D(),M(R,A)})})}compress(R,A,M){D.add(D=>{this._compress(R,A,(R,A)=>{D(),M(R,A)})})}_decompress(R,A,M){let D=this._isServer?"client":"server";if(!this._inflate){let R=`${D}_max_window_bits`,A="number"!=typeof this.params[R]?I.Z_DEFAULT_WINDOWBITS:this.params[R];this._inflate=I.createInflateRaw({...this._options.zlibInflateOptions,windowBits:A}),this._inflate[F]=this,this._inflate[B]=0,this._inflate[z]=[],this._inflate.on("error",J),this._inflate.on("data",K)}this._inflate[W]=M,this._inflate.write(R),A&&this._inflate.write(U),this._inflate.flush(()=>{let R=this._inflate[G];if(R){this._inflate.close(),this._inflate=null,M(R);return}let I=q.concat(this._inflate[z],this._inflate[B]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[B]=0,this._inflate[z]=[],A&&this.params[`${D}_no_context_takeover`]&&this._inflate.reset()),M(null,I)})}_compress(R,A,M){let D=this._isServer?"server":"client";if(!this._deflate){let R=`${D}_max_window_bits`,A="number"!=typeof this.params[R]?I.Z_DEFAULT_WINDOWBITS:this.params[R];this._deflate=I.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:A}),this._deflate[B]=0,this._deflate[z]=[],this._deflate.on("data",V)}this._deflate[W]=M,this._deflate.write(R),this._deflate.flush(I.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let R=q.concat(this._deflate[z],this._deflate[B]);A&&(R=R.slice(0,R.length-4)),this._deflate[W]=null,this._deflate[B]=0,this._deflate[z]=[],A&&this.params[`${D}_no_context_takeover`]&&this._deflate.reset(),M(null,R)})}}function V(R){this[z].push(R),this[B]+=R.length}function K(R){if(this[B]+=R.length,this[F]._maxPayload<1||this[B]<=this[F]._maxPayload){this[z].push(R);return}this[G]=RangeError("Max payload size exceeded"),this[G].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[G][H]=1009,this.removeListener("data",K),this.reset()}function J(R){this[F]._inflate=null,R[H]=1007,this[W](R)}R.exports=X},157:(R,A,M)=>{"use strict";let{Writable:D}=M(781),I=M(290),{BINARY_TYPES:q,EMPTY_BUFFER:$,kStatusCode:H,kWebSocket:U}=M(217),{concat:F,toArrayBuffer:B,unmask:W}=M(214),{isValidStatusCode:z,isValidUTF8:G}=M(848),X=0,V=1,K=2,J=3,Y=4,Z=5;class Q extends D{constructor(R={}){super(),this._binaryType=R.binaryType||q[0],this._extensions=R.extensions||{},this._isServer=!!R.isServer,this._maxPayload=0|R.maxPayload,this._skipUTF8Validation=!!R.skipUTF8Validation,this[U]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=X,this._loop=!1}_write(R,A,M){if(8===this._opcode&&this._state==X)return M();this._bufferedBytes+=R.length,this._buffers.push(R),this.startLoop(M)}consume(R){if(this._bufferedBytes-=R,R===this._buffers[0].length)return this._buffers.shift();if(R<this._buffers[0].length){let A=this._buffers[0];return this._buffers[0]=A.slice(R),A.slice(0,R)}let A=Buffer.allocUnsafe(R);do{let M=this._buffers[0],D=A.length-R;R>=M.length?A.set(this._buffers.shift(),D):(A.set(new Uint8Array(M.buffer,M.byteOffset,R),D),this._buffers[0]=M.slice(R)),R-=M.length}while(R>0)return A}startLoop(R){let A;this._loop=!0;do switch(this._state){case X:A=this.getInfo();break;case V:A=this.getPayloadLength16();break;case K:A=this.getPayloadLength64();break;case J:this.getMask();break;case Y:A=this.getData(R);break;default:this._loop=!1;return}while(this._loop)R(A)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let R=this.consume(2);if((48&R[0])!=0)return this._loop=!1,ee(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let A=(64&R[0])==64;if(A&&!this._extensions[I.extensionName])return this._loop=!1,ee(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(128&R[0])==128,this._opcode=15&R[0],this._payloadLength=127&R[1],0===this._opcode){if(A)return this._loop=!1,ee(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,ee(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,ee(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=A}else{if(!(this._opcode>7)||!(this._opcode<11))return this._loop=!1,ee(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,ee(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(A)return this._loop=!1,ee(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,ee(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=(128&R[1])==128,this._isServer){if(!this._masked)return this._loop=!1,ee(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,ee(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=V;else{if(127!==this._payloadLength)return this.haveLength();this._state=K}}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let R=this.consume(8),A=R.readUInt32BE(0);return A>2097151?(this._loop=!1,ee(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=4294967296*A+R.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,ee(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=J:this._state=Y}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Y}getData(R){let A=$;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}A=this.consume(this._payloadLength),this._masked&&W(A,this._mask)}if(this._opcode>7)return this.controlMessage(A);if(this._compressed){this._state=Z,this.decompress(A,R);return}return A.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(A)),this.dataMessage()}decompress(R,A){let M=this._extensions[I.extensionName];M.decompress(R,this._fin,(R,M)=>{if(R)return A(R);if(M.length){if(this._messageLength+=M.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return A(ee(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(M)}let D=this.dataMessage();if(D)return A(D);this.startLoop(A)})}dataMessage(){if(this._fin){let R=this._messageLength,A=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let M;M="nodebuffer"===this._binaryType?F(A,R):"arraybuffer"===this._binaryType?B(F(A,R)):A,this.emit("message",M,!0)}else{let M=F(A,R);if(!this._skipUTF8Validation&&!G(M))return this._loop=!1,ee(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",M,!1)}}this._state=X}controlMessage(R){if(8===this._opcode){if(this._loop=!1,0===R.length)this.emit("conclude",1005,$),this.end();else{if(1===R.length)return ee(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");let A=R.readUInt16BE(0);if(!z(A))return ee(RangeError,`invalid status code ${A}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let M=R.slice(2);if(!this._skipUTF8Validation&&!G(M))return ee(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",A,M),this.end()}}else 9===this._opcode?this.emit("ping",R):this.emit("pong",R);this._state=X}}function ee(R,A,M,D,I){let q=new R(M?`Invalid WebSocket frame: ${A}`:A);return Error.captureStackTrace(q,ee),q.code=I,q[H]=D,q}R.exports=Q},769:(R,A,M)=>{"use strict";M(808),M(404);let{randomFillSync:D}=M(113),I=M(290),{EMPTY_BUFFER:q}=M(217),{isValidStatusCode:$}=M(848),{mask:H,toBuffer:U}=M(214),F=Buffer.alloc(4);class B{constructor(R,A){this._extensions=A||{},this._socket=R,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(R,A){let M=A.mask&&A.readOnly,I=A.mask?6:2,q=R.length;R.length>=65536?(I+=8,q=127):R.length>125&&(I+=2,q=126);let $=Buffer.allocUnsafe(M?R.length+I:I);return($[0]=A.fin?128|A.opcode:A.opcode,A.rsv1&&($[0]|=64),$[1]=q,126===q?$.writeUInt16BE(R.length,2):127===q&&($.writeUInt32BE(0,2),$.writeUInt32BE(R.length,6)),A.mask)?(D(F,0,4),$[1]|=128,$[I-4]=F[0],$[I-3]=F[1],$[I-2]=F[2],$[I-1]=F[3],M)?(H(R,F,$,I,R.length),[$]):(H(R,F,R,0,R.length),[$,R]):[$,R]}close(R,A,M,D){let I;if(void 0===R)I=q;else if("number"==typeof R&&$(R)){if(void 0!==A&&A.length){let M=Buffer.byteLength(A);if(M>123)throw RangeError("The message must not be greater than 123 bytes");(I=Buffer.allocUnsafe(2+M)).writeUInt16BE(R,0),"string"==typeof A?I.write(A,2):I.set(A,2)}else(I=Buffer.allocUnsafe(2)).writeUInt16BE(R,0)}else throw TypeError("First argument must be a valid error code number");this._deflating?this.enqueue([this.doClose,I,M,D]):this.doClose(I,M,D)}doClose(R,A,M){this.sendFrame(B.frame(R,{fin:!0,rsv1:!1,opcode:8,mask:A,readOnly:!1}),M)}ping(R,A,M){let D=U(R);if(D.length>125)throw RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,D,A,U.readOnly,M]):this.doPing(D,A,U.readOnly,M)}doPing(R,A,M,D){this.sendFrame(B.frame(R,{fin:!0,rsv1:!1,opcode:9,mask:A,readOnly:M}),D)}pong(R,A,M){let D=U(R);if(D.length>125)throw RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,D,A,U.readOnly,M]):this.doPong(D,A,U.readOnly,M)}doPong(R,A,M,D){this.sendFrame(B.frame(R,{fin:!0,rsv1:!1,opcode:10,mask:A,readOnly:M}),D)}send(R,A,M){let D=U(R),q=this._extensions[I.extensionName],$=A.binary?2:1,H=A.compress;if(this._firstFragment?(this._firstFragment=!1,H&&q&&q.params[q._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(H=D.length>=q._threshold),this._compress=H):(H=!1,$=0),A.fin&&(this._firstFragment=!0),q){let R={fin:A.fin,rsv1:H,opcode:$,mask:A.mask,readOnly:U.readOnly};this._deflating?this.enqueue([this.dispatch,D,this._compress,R,M]):this.dispatch(D,this._compress,R,M)}else this.sendFrame(B.frame(D,{fin:A.fin,rsv1:!1,opcode:$,mask:A.mask,readOnly:U.readOnly}),M)}dispatch(R,A,M,D){if(!A){this.sendFrame(B.frame(R,M),D);return}let q=this._extensions[I.extensionName];this._bufferedBytes+=R.length,this._deflating=!0,q.compress(R,M.fin,(A,I)=>{if(this._socket.destroyed){let R=Error("The socket was closed while data was being compressed");"function"==typeof D&&D(R);for(let A=0;A<this._queue.length;A++){let M=this._queue[A][4];"function"==typeof M&&M(R)}return}this._bufferedBytes-=R.length,this._deflating=!1,M.readOnly=!1,this.sendFrame(B.frame(I,M),D),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let R=this._queue.shift();this._bufferedBytes-=R[1].length,Reflect.apply(R[0],this,R.slice(1))}}enqueue(R){this._bufferedBytes+=R[1].length,this._queue.push(R)}sendFrame(R,A){2===R.length?(this._socket.cork(),this._socket.write(R[0]),this._socket.write(R[1],A),this._socket.uncork()):this._socket.write(R[0],A)}}R.exports=B},551:(R,A,M)=>{"use strict";let{Duplex:D}=M(781);function I(R){R.emit("close")}function q(){!this.destroyed&&this._writableState.finished&&this.destroy()}function $(R){this.removeListener("error",$),this.destroy(),0===this.listenerCount("error")&&this.emit("error",R)}function H(R,A){let M=!0,H=!0;function U(){M&&R._socket.resume()}R.readyState===R.CONNECTING?R.once("open",function(){R._receiver.removeAllListeners("drain"),R._receiver.on("drain",U)}):(R._receiver.removeAllListeners("drain"),R._receiver.on("drain",U));let F=new D({...A,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return R.on("message",function(A,D){let I=!D&&F._readableState.objectMode?A.toString():A;F.push(I)||(M=!1,R._socket.pause())}),R.once("error",function(R){F.destroyed||(H=!1,F.destroy(R))}),R.once("close",function(){F.destroyed||F.push(null)}),F._destroy=function(A,M){if(R.readyState===R.CLOSED){M(A),process.nextTick(I,F);return}let D=!1;R.once("error",function(R){D=!0,M(R)}),R.once("close",function(){D||M(A),process.nextTick(I,F)}),H&&R.terminate()},F._final=function(A){if(R.readyState===R.CONNECTING){R.once("open",function(){F._final(A)});return}null!==R._socket&&(R._socket._writableState.finished?(A(),F._readableState.endEmitted&&F.destroy()):(R._socket.once("finish",function(){A()}),R.close()))},F._read=function(){R.readyState!==R.OPEN||M||(M=!0,R._receiver._writableState.needDrain||R._socket.resume())},F._write=function(A,M,D){if(R.readyState===R.CONNECTING){R.once("open",function(){F._write(A,M,D)});return}R.send(A,D)},F.on("end",q),F.on("error",$),F}R.exports=H},955:(R,A,M)=>{"use strict";let{tokenChars:D}=M(848);function I(R){let A=new Set,M=-1,I=-1,q=0;for(;q<R.length;q++){let $=R.charCodeAt(q);if(-1===I&&1===D[$])-1===M&&(M=q);else if(0!==q&&(32===$||9===$))-1===I&&-1!==M&&(I=q);else if(44===$){if(-1===M)throw SyntaxError(`Unexpected character at index ${q}`);-1===I&&(I=q);let D=R.slice(M,I);if(A.has(D))throw SyntaxError(`The "${D}" subprotocol is duplicated`);A.add(D),M=I=-1}else throw SyntaxError(`Unexpected character at index ${q}`)}if(-1===M||-1!==I)throw SyntaxError("Unexpected end of input");let $=R.slice(M,q);if(A.has($))throw SyntaxError(`The "${$}" subprotocol is duplicated`);return A.add($),A}R.exports={parse:I}},848:(R,A,M)=>{"use strict";let D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function I(R){return R>=1e3&&R<=1014&&1004!==R&&1005!==R&&1006!==R||R>=3e3&&R<=4999}function q(R){let A=R.length,M=0;for(;M<A;)if((128&R[M])==0)M++;else if((224&R[M])==192){if(M+1===A||(192&R[M+1])!=128||(254&R[M])==192)return!1;M+=2}else if((240&R[M])==224){if(M+2>=A||(192&R[M+1])!=128||(192&R[M+2])!=128||224===R[M]&&(224&R[M+1])==128||237===R[M]&&(224&R[M+1])==160)return!1;M+=3}else{if((248&R[M])!=240||M+3>=A||(192&R[M+1])!=128||(192&R[M+2])!=128||(192&R[M+3])!=128||240===R[M]&&(240&R[M+1])==128||244===R[M]&&R[M+1]>143||R[M]>244)return!1;M+=4}return!0}try{let A=M(12);R.exports={isValidStatusCode:I,isValidUTF8:R=>R.length<150?q(R):A(R),tokenChars:D}}catch(A){R.exports={isValidStatusCode:I,isValidUTF8:q,tokenChars:D}}},597:(R,A,M)=>{"use strict";let D=M(361),I=M(685);M(687),M(808),M(404);let{createHash:q}=M(113),$=M(725),H=M(290),U=M(955),F=M(335),{GUID:B,kWebSocket:W}=M(217),z=/^[+/0-9A-Za-z]{22}==$/,G=0,X=1,V=2;class K extends D{constructor(R,A){if(super(),null==(R={maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...R}).port&&!R.server&&!R.noServer||null!=R.port&&(R.server||R.noServer)||R.server&&R.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=R.port?(this._server=I.createServer((R,A)=>{let M=I.STATUS_CODES[426];A.writeHead(426,{"Content-Length":M.length,"Content-Type":"text/plain"}),A.end(M)}),this._server.listen(R.port,R.host,R.backlog,A)):R.server&&(this._server=R.server),this._server){let R=this.emit.bind(this,"connection");this._removeListeners=J(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(A,M,D)=>{this.handleUpgrade(A,M,D,R)}})}!0===R.perMessageDeflate&&(R.perMessageDeflate={}),R.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=R,this._state=G}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(R){if(this._state===V){R&&this.once("close",()=>{R(Error("The server is not running"))}),process.nextTick(Y,this);return}if(R&&this.once("close",R),this._state!==X){if(this._state=X,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(Y,this);else{let R=this._server;this._removeListeners(),this._removeListeners=this._server=null,R.close(()=>{Y(this)})}}}shouldHandle(R){if(this.options.path){let A=R.url.indexOf("?"),M=-1!==A?R.url.slice(0,A):R.url;if(M!==this.options.path)return!1}return!0}handleUpgrade(R,A,M,D){A.on("error",Z);let I=void 0!==R.headers["sec-websocket-key"]&&R.headers["sec-websocket-key"],q=+R.headers["sec-websocket-version"];if("GET"!==R.method||"websocket"!==R.headers.upgrade.toLowerCase()||!I||!z.test(I)||8!==q&&13!==q||!this.shouldHandle(R))return Q(A,400);let F=R.headers["sec-websocket-protocol"],B=new Set;if(void 0!==F)try{B=U.parse(F)}catch(R){return Q(A,400)}let W=R.headers["sec-websocket-extensions"],G={};if(this.options.perMessageDeflate&&void 0!==W){let R=new H(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let A=$.parse(W);A[H.extensionName]&&(R.accept(A[H.extensionName]),G[H.extensionName]=R)}catch(R){return Q(A,400)}}if(this.options.verifyClient){let $={origin:R.headers[`${8===q?"sec-websocket-origin":"origin"}`],secure:!!(R.socket.authorized||R.socket.encrypted),req:R};if(2===this.options.verifyClient.length){this.options.verifyClient($,(q,$,H,U)=>{if(!q)return Q(A,$||401,H,U);this.completeUpgrade(G,I,B,R,A,M,D)});return}if(!this.options.verifyClient($))return Q(A,401)}this.completeUpgrade(G,I,B,R,A,M,D)}completeUpgrade(R,A,M,D,I,U,z){if(!I.readable||!I.writable)return I.destroy();if(I[W])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>G)return Q(I,503);let X=q("sha1").update(A+B).digest("base64"),V=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${X}`],K=new F(null);if(M.size){let R=this.options.handleProtocols?this.options.handleProtocols(M,D):M.values().next().value;R&&(V.push(`Sec-WebSocket-Protocol: ${R}`),K._protocol=R)}if(R[H.extensionName]){let A=R[H.extensionName].params,M=$.format({[H.extensionName]:[A]});V.push(`Sec-WebSocket-Extensions: ${M}`),K._extensions=R}this.emit("headers",V,D),I.write(V.concat("\r\n").join("\r\n")),I.removeListener("error",Z),K.setSocket(I,U,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(K),K.on("close",()=>{this.clients.delete(K),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Y,this)})),z(K,D)}}function J(R,A){for(let M of Object.keys(A))R.on(M,A[M]);return function(){for(let M of Object.keys(A))R.removeListener(M,A[M])}}function Y(R){R._state=V,R.emit("close")}function Z(){this.destroy()}function Q(R,A,M,D){R.writable&&(M=M||I.STATUS_CODES[A],D={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(M),...D},R.write(`HTTP/1.1 ${A} ${I.STATUS_CODES[A]}\r
`+Object.keys(D).map(R=>`${R}: ${D[R]}`).join("\r\n")+"\r\n\r\n"+M)),R.removeListener("error",Z),R.destroy()}R.exports=K},335:(R,A,M)=>{"use strict";let D=M(361),I=M(687),q=M(685),$=M(808),H=M(404),{randomBytes:U,createHash:F}=M(113),{Readable:B}=M(781),{URL:W}=M(310),z=M(290),G=M(157),X=M(769),{BINARY_TYPES:V,EMPTY_BUFFER:K,GUID:J,kForOnEventAttribute:Y,kListener:Z,kStatusCode:Q,kWebSocket:ee,NOOP:et}=M(217),{EventTarget:{addEventListener:er,removeEventListener:es}}=M(874),{format:ei,parse:en}=M(725),{toBuffer:ea}=M(214),eo=["CONNECTING","OPEN","CLOSING","CLOSED"],el=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,eh=[8,13],ed=3e4;class eu extends D{constructor(R,A,M){super(),this._binaryType=V[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=K,this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=eu.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==R?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===A?A=[]:Array.isArray(A)||("object"==typeof A&&null!==A?(M=A,A=[]):A=[A]),ec(this,R,A,M)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(R){V.includes(R)&&(this._binaryType=R,this._receiver&&(this._receiver._binaryType=R))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(R,A,M){let D=new G({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:M.maxPayload,skipUTF8Validation:M.skipUTF8Validation});this._sender=new X(R,this._extensions),this._receiver=D,this._socket=R,D[ee]=this,R[ee]=this,D.on("conclude",ev),D.on("drain",ey),D.on("error",e_),D.on("message",ew),D.on("ping",eb),D.on("pong",eE),R.setTimeout(0),R.setNoDelay(),A.length>0&&R.unshift(A),R.on("close",eC),R.on("data",eP),R.on("end",eR),R.on("error",eT),this._readyState=eu.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=eu.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[z.extensionName]&&this._extensions[z.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=eu.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(R,A){if(this.readyState!==eu.CLOSED){if(this.readyState===eu.CONNECTING){let R="WebSocket was closed before the connection was established";return em(this,this._req,R)}if(this.readyState===eu.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=eu.CLOSING,this._sender.close(R,A,!this._isServer,R=>{!R&&(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),ed)}}ping(R,A,M){if(this.readyState===eu.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof R?(M=R,R=A=void 0):"function"==typeof A&&(M=A,A=void 0),"number"==typeof R&&(R=R.toString()),this.readyState!==eu.OPEN){eg(this,R,M);return}void 0===A&&(A=!this._isServer),this._sender.ping(R||K,A,M)}pong(R,A,M){if(this.readyState===eu.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof R?(M=R,R=A=void 0):"function"==typeof A&&(M=A,A=void 0),"number"==typeof R&&(R=R.toString()),this.readyState!==eu.OPEN){eg(this,R,M);return}void 0===A&&(A=!this._isServer),this._sender.pong(R||K,A,M)}send(R,A,M){if(this.readyState===eu.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof A&&(M=A,A={}),"number"==typeof R&&(R=R.toString()),this.readyState!==eu.OPEN){eg(this,R,M);return}let D={binary:"string"!=typeof R,mask:!this._isServer,compress:!0,fin:!0,...A};this._extensions[z.extensionName]||(D.compress=!1),this._sender.send(R||K,D,M)}terminate(){if(this.readyState!==eu.CLOSED){if(this.readyState===eu.CONNECTING){let R="WebSocket was closed before the connection was established";return em(this,this._req,R)}this._socket&&(this._readyState=eu.CLOSING,this._socket.destroy())}}}function ec(R,A,M,D){let $,H;let B={protocolVersion:eh[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...D,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!eh.includes(B.protocolVersion))throw RangeError(`Unsupported protocol version: ${B.protocolVersion} (supported versions: ${eh.join(", ")})`);if(A instanceof W)$=A,R._url=A.href;else{try{$=new W(A)}catch(R){throw SyntaxError(`Invalid URL: ${A}`)}R._url=A}let G="wss:"===$.protocol,X="ws+unix:"===$.protocol;if("ws:"!==$.protocol&&!G&&!X)throw SyntaxError('The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"');if(X&&!$.pathname)throw SyntaxError("The URL's pathname is empty");if($.hash)throw SyntaxError("The URL contains a fragment identifier");let V=G?443:80,K=U(16).toString("base64"),Y=G?I.get:q.get,Z=new Set;if(B.createConnection=G?ef:ep,B.defaultPort=B.defaultPort||V,B.port=$.port||V,B.host=$.hostname.startsWith("[")?$.hostname.slice(1,-1):$.hostname,B.headers={"Sec-WebSocket-Version":B.protocolVersion,"Sec-WebSocket-Key":K,Connection:"Upgrade",Upgrade:"websocket",...B.headers},B.path=$.pathname+$.search,B.timeout=B.handshakeTimeout,B.perMessageDeflate&&(H=new z(!0!==B.perMessageDeflate?B.perMessageDeflate:{},!1,B.maxPayload),B.headers["Sec-WebSocket-Extensions"]=ei({[z.extensionName]:H.offer()})),M.length){for(let R of M){if("string"!=typeof R||!el.test(R)||Z.has(R))throw SyntaxError("An invalid or duplicated subprotocol was specified");Z.add(R)}B.headers["Sec-WebSocket-Protocol"]=M.join(",")}if(B.origin&&(B.protocolVersion<13?B.headers["Sec-WebSocket-Origin"]=B.origin:B.headers.Origin=B.origin),($.username||$.password)&&(B.auth=`${$.username}:${$.password}`),X){let R=B.path.split(":");B.socketPath=R[0],B.path=R[1]}let Q=R._req=Y(B);B.timeout&&Q.on("timeout",()=>{em(R,Q,"Opening handshake has timed out")}),Q.on("error",A=>{null===Q||Q.aborted||(Q=R._req=null,R._readyState=eu.CLOSING,R.emit("error",A),R.emitClose())}),Q.on("response",I=>{let q=I.headers.location,$=I.statusCode;if(q&&B.followRedirects&&$>=300&&$<400){if(++R._redirects>B.maxRedirects){em(R,Q,"Maximum redirects exceeded");return}Q.abort();let I=new W(q,A);ec(R,I,M,D)}else R.emit("unexpected-response",Q,I)||em(R,Q,`Unexpected server response: ${I.statusCode}`)}),Q.on("upgrade",(A,M,D)=>{let I;if(R.emit("upgrade",A),R.readyState!==eu.CONNECTING)return;Q=R._req=null;let q=F("sha1").update(K+J).digest("base64");if(A.headers["sec-websocket-accept"]!==q){em(R,M,"Invalid Sec-WebSocket-Accept header");return}let $=A.headers["sec-websocket-protocol"];if(void 0!==$?Z.size?Z.has($)||(I="Server sent an invalid subprotocol"):I="Server sent a subprotocol but none was requested":Z.size&&(I="Server sent no subprotocol"),I){em(R,M,I);return}$&&(R._protocol=$);let U=A.headers["sec-websocket-extensions"];if(void 0!==U){let A;if(!H){let A="Server sent a Sec-WebSocket-Extensions header but no extension was requested";em(R,M,A);return}try{A=en(U)}catch(D){let A="Invalid Sec-WebSocket-Extensions header";em(R,M,A);return}let D=Object.keys(A);if(1!==D.length||D[0]!==z.extensionName){let A="Server indicated an extension that was not requested";em(R,M,A);return}try{H.accept(A[z.extensionName])}catch(D){let A="Invalid Sec-WebSocket-Extensions header";em(R,M,A);return}R._extensions[z.extensionName]=H}R.setSocket(M,D,{maxPayload:B.maxPayload,skipUTF8Validation:B.skipUTF8Validation})})}function ep(R){return R.path=R.socketPath,$.connect(R)}function ef(R){return R.path=void 0,R.servername||""===R.servername||(R.servername=$.isIP(R.host)?"":R.host),H.connect(R)}function em(R,A,M){R._readyState=eu.CLOSING;let D=Error(M);Error.captureStackTrace(D,em),A.setHeader?(A.abort(),A.socket&&!A.socket.destroyed&&A.socket.destroy(),A.once("abort",R.emitClose.bind(R)),R.emit("error",D)):(A.destroy(D),A.once("error",R.emit.bind(R,"error")),A.once("close",R.emitClose.bind(R)))}function eg(R,A,M){if(A){let M=ea(A).length;R._socket?R._sender._bufferedBytes+=M:R._bufferedAmount+=M}if(M){let A=Error(`WebSocket is not open: readyState ${R.readyState} (${eo[R.readyState]})`);M(A)}}function ev(R,A){let M=this[ee];M._closeFrameReceived=!0,M._closeMessage=A,M._closeCode=R,void 0!==M._socket[ee]&&(M._socket.removeListener("data",eP),process.nextTick(eS,M._socket),1005===R?M.close():M.close(R,A))}function ey(){this[ee]._socket.resume()}function e_(R){let A=this[ee];void 0!==A._socket[ee]&&(A._socket.removeListener("data",eP),process.nextTick(eS,A._socket),A.close(R[Q])),A.emit("error",R)}function ex(){this[ee].emitClose()}function ew(R,A){this[ee].emit("message",R,A)}function eb(R){let A=this[ee];A.pong(R,!A._isServer,et),A.emit("ping",R)}function eE(R){this[ee].emit("pong",R)}function eS(R){R.resume()}function eC(){let R;let A=this[ee];this.removeListener("close",eC),this.removeListener("data",eP),this.removeListener("end",eR),A._readyState=eu.CLOSING,this._readableState.endEmitted||A._closeFrameReceived||A._receiver._writableState.errorEmitted||null===(R=A._socket.read())||A._receiver.write(R),A._receiver.end(),this[ee]=void 0,clearTimeout(A._closeTimer),A._receiver._writableState.finished||A._receiver._writableState.errorEmitted?A.emitClose():(A._receiver.on("error",ex),A._receiver.on("finish",ex))}function eP(R){this[ee]._receiver.write(R)||this.pause()}function eR(){let R=this[ee];R._readyState=eu.CLOSING,R._receiver.end(),this.end()}function eT(){let R=this[ee];this.removeListener("error",eT),this.on("error",et),R&&(R._readyState=eu.CLOSING,this.destroy())}Object.defineProperty(eu,"CONNECTING",{enumerable:!0,value:eo.indexOf("CONNECTING")}),Object.defineProperty(eu.prototype,"CONNECTING",{enumerable:!0,value:eo.indexOf("CONNECTING")}),Object.defineProperty(eu,"OPEN",{enumerable:!0,value:eo.indexOf("OPEN")}),Object.defineProperty(eu.prototype,"OPEN",{enumerable:!0,value:eo.indexOf("OPEN")}),Object.defineProperty(eu,"CLOSING",{enumerable:!0,value:eo.indexOf("CLOSING")}),Object.defineProperty(eu.prototype,"CLOSING",{enumerable:!0,value:eo.indexOf("CLOSING")}),Object.defineProperty(eu,"CLOSED",{enumerable:!0,value:eo.indexOf("CLOSED")}),Object.defineProperty(eu.prototype,"CLOSED",{enumerable:!0,value:eo.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(R=>{Object.defineProperty(eu.prototype,R,{enumerable:!0})}),["open","error","close","message"].forEach(R=>{Object.defineProperty(eu.prototype,`on${R}`,{enumerable:!0,get(){for(let A of this.listeners(R))if(A[Y])return A[Z];return null},set(A){for(let A of this.listeners(R))if(A[Y]){this.removeListener(R,A);break}"function"==typeof A&&this.addEventListener(R,A,{[Y]:!0})}})}),eu.prototype.addEventListener=er,eu.prototype.removeEventListener=es,R.exports=eu},605:module=>{module.exports=eval("require")("bufferutil")},12:module=>{module.exports=eval("require")("utf-8-validate")},113:R=>{"use strict";R.exports=__webpack_require__("crypto")},361:R=>{"use strict";R.exports=__webpack_require__("events")},685:R=>{"use strict";R.exports=__webpack_require__("http")},687:R=>{"use strict";R.exports=__webpack_require__("https")},808:R=>{"use strict";R.exports=__webpack_require__("net")},781:R=>{"use strict";R.exports=__webpack_require__("stream")},404:R=>{"use strict";R.exports=__webpack_require__("tls")},310:R=>{"use strict";R.exports=__webpack_require__("url")},796:R=>{"use strict";R.exports=__webpack_require__("zlib")}},__webpack_module_cache__={};function __nccwpck_require__(R){var A=__webpack_module_cache__[R];if(void 0!==A)return A.exports;var M=__webpack_module_cache__[R]={exports:{}},D=!0;try{__webpack_modules__[R](M,M.exports,__nccwpck_require__),D=!1}finally{D&&delete __webpack_module_cache__[R]}return M.exports}__nccwpck_require__.ab=__dirname+"/";var __nested_webpack_exports__=__nccwpck_require__(28);module.exports=__nested_webpack_exports__})()},"./dist/esm/client/components/app-router-headers.js":(R,A,M)=>{"use strict";M.d(A,{Am:()=>F,H4:()=>W,eY:()=>U,i4:()=>D,om:()=>I,pz:()=>$,vu:()=>B});let D="RSC",I="Next-Action",q="Next-Router-State-Tree",$="Next-Router-Prefetch",H="Next-Url",U="text/x-component",F=D+", "+q+", "+$+", "+H,B=[[D],[q],[$]],W="_rsc"},"./dist/esm/lib/constants.js":(R,A,M)=>{"use strict";M.d(A,{Ar:()=>H,BR:()=>B,Et:()=>$,Jp:()=>z,Qq:()=>q,X_:()=>F,dN:()=>D,o$:()=>W,of:()=>U,y3:()=>I});let D="nxtP",I="x-prerender-revalidate",q="x-prerender-revalidate-if-generated",$="x-next-cache-tags",H="x-next-cache-soft-tags",U="x-next-revalidated-tags",F="x-next-revalidate-tag-token",B=31536e3,W="instrumentation",z={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},G={reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};G.reactServerComponents,G.actionBrowser,G.appMetadataRoute,G.appRouteHandler,G.middleware,G.api,G.reactServerComponents,G.actionBrowser,G.appMetadataRoute,G.appRouteHandler,G.serverSideRendering,G.appPagesBrowser},"./dist/esm/lib/interop-default.js":(R,A,M)=>{"use strict";function D(R){return R.default||R}M.d(A,{X:()=>D})},"./dist/esm/lib/is-error.js":(R,A,M)=>{"use strict";function D(R){return Object.prototype.toString.call(R)}function I(R){if("[object Object]"!==D(R))return!1;let A=Object.getPrototypeOf(R);return null===A||A.hasOwnProperty("isPrototypeOf")}function q(R){return"object"==typeof R&&null!==R&&"name"in R&&"message"in R}function $(R){return q(R)?R:Error(I(R)?JSON.stringify(R):R+"")}M.d(A,{Z:()=>q,S:()=>$})},"./dist/esm/lib/web/chalk.js":(R,A,M)=>{"use strict";M.d(A,{Z:()=>I});let D=new Proxy(R=>R,{get:(R,A)=>["hex","rgb","ansi256","bgHex","bgRgb","bgAnsi256"].includes(A)?()=>D:D}),I=D},"./dist/esm/server/api-utils/get-cookie-parser.js":(R,A,M)=>{"use strict";function D(R){return function(){let{cookie:A}=R;if(!A)return{};let{parse:D}=M("./dist/compiled/cookie/index.js");return D(Array.isArray(A)?A.join("; "):A)}}M.d(A,{a:()=>D})},"./dist/esm/server/api-utils/index.js":(R,A,M)=>{"use strict";M.d(A,{Di:()=>W,Gy:()=>q,Iq:()=>H,Ku:()=>B,Lm:()=>G,MS:()=>X,OF:()=>z,QM:()=>F,dS:()=>U,gk:()=>K,uX:()=>$,y7:()=>V});var D=M("./dist/esm/server/web/spec-extension/adapters/headers.js"),I=M("./dist/esm/lib/constants.js");function q(R,A){return R.statusCode=A,R}function $(R,A,M){if("string"==typeof A&&(M=A,A=307),"number"!=typeof A||"string"!=typeof M)throw Error("Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').");return R.writeHead(A,{Location:M}),R.write(M),R.end(),R}function H(R,A){let M=D.h.from(R.headers),q=M.get(I.y3),$=q===A.previewModeId,H=M.has(I.Qq);return{isOnDemandRevalidate:$,revalidateOnlyGenerated:H}}let U="__prerender_bypass",F="__next_preview_data",B=4194304,W=Symbol(F),z=Symbol(U);function G(R,A={}){if(z in R)return R;let{serialize:D}=M("./dist/compiled/cookie/index.js"),I=R.getHeader("Set-Cookie");return R.setHeader("Set-Cookie",[..."string"==typeof I?[I]:Array.isArray(I)?I:[],D(U,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==A.path?{path:A.path}:void 0}),D(F,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==A.path?{path:A.path}:void 0})]),Object.defineProperty(R,z,{value:!0,enumerable:!1}),R}class X extends Error{constructor(R,A){super(A),this.statusCode=R}}function V(R,A,M){R.statusCode=A,R.statusMessage=M,R.end(M)}function K({req:R},A,M){let D={configurable:!0,enumerable:!0},I={...D,writable:!0};Object.defineProperty(R,A,{...D,get:()=>{let D=M();return Object.defineProperty(R,A,{...I,value:D}),D},set:M=>{Object.defineProperty(R,A,{...I,value:M})}})}},"./dist/esm/server/api-utils/node.js":(R,A,M)=>{"use strict";M.r(A),M.d(A,{apiResolver:()=>eo,parseBody:()=>Q,tryGetPreviewData:()=>Y});var D=M("./dist/esm/server/api-utils/index.js"),I=M("./dist/compiled/bytes/index.js"),q=M.n(I),$=M("./dist/esm/server/lib/etag.js"),H=M("./dist/esm/server/send-payload/index.js"),U=M("stream"),F=M("./dist/compiled/content-type/index.js"),B=M("./dist/esm/lib/is-error.js");M("./dist/esm/shared/lib/utils.js");var W=M("./dist/esm/lib/interop-default.js"),z=M("./dist/esm/server/api-utils/get-cookie-parser.js"),G=M("./lib/trace/tracer"),X=M("./dist/esm/server/lib/trace/constants.js"),V=M("./dist/esm/server/web/spec-extension/cookies.js"),K=M("./dist/esm/server/web/spec-extension/adapters/headers.js"),J=M("./dist/esm/lib/constants.js");function Y(R,A,I){var q,$;let H;if(I&&(0,D.Iq)(R,I).isOnDemandRevalidate)return!1;if(D.Di in R)return R[D.Di];let U=K.h.from(R.headers),F=new V.q(U),B=null==(q=F.get(D.dS))?void 0:q.value,W=null==($=F.get(D.QM))?void 0:$.value;if(B&&!W&&B===I.previewModeId){let A={};return Object.defineProperty(R,D.Di,{value:A,enumerable:!1}),A}if(!B&&!W)return!1;if(!B||!W||B!==I.previewModeId)return(0,D.Lm)(A),!1;try{let R=M("next/dist/compiled/jsonwebtoken");H=R.verify(W,I.previewModeSigningKey)}catch{return(0,D.Lm)(A),!1}let{decryptWithSecret:z}=M("./dist/esm/server/crypto-utils.js"),G=z(Buffer.from(I.previewModeEncryptionKey),H.data);try{let A=JSON.parse(G);return Object.defineProperty(R,D.Di,{value:A,enumerable:!1}),A}catch{return!1}}function Z(R){if(0===R.length)return{};try{return JSON.parse(R)}catch(R){throw new D.MS(400,"Invalid JSON")}}async function Q(R,A){let I,q;try{I=(0,F.parse)(R.headers["content-type"]||"text/plain")}catch{I=(0,F.parse)("text/plain")}let{type:$,parameters:H}=I,U=H.charset||"utf-8";try{let D=M("next/dist/compiled/raw-body");q=await D(R,{encoding:U,limit:A})}catch(R){if((0,B.Z)(R)&&"entity.too.large"===R.type)throw new D.MS(413,`Body exceeded ${A} limit`);throw new D.MS(400,"Invalid body")}let W=q.toString();if("application/json"===$||"application/ld+json"===$)return Z(W);if("application/x-www-form-urlencoded"!==$)return W;{let R=M("querystring");return R.decode(W)}}function ee(R){return R&&"boolean"!=typeof R?q().parse(R):D.Ku}function et(R,A,M){if(null==M){A.end();return}if(204===A.statusCode||304===A.statusCode){A.removeHeader("Content-Type"),A.removeHeader("Content-Length"),A.removeHeader("Transfer-Encoding"),A.end();return}let D=A.getHeader("Content-Type");if(M instanceof U.Stream){D||A.setHeader("Content-Type","application/octet-stream"),M.pipe(A);return}let I=["object","number","boolean"].includes(typeof M),q=I?JSON.stringify(M):M,F=(0,$.j)(q);if(!(0,H.Wz)(R,A,F)){if(Buffer.isBuffer(M)){D||A.setHeader("Content-Type","application/octet-stream"),A.setHeader("Content-Length",M.length),A.end(M);return}I&&A.setHeader("Content-Type","application/json; charset=utf-8"),A.setHeader("Content-Length",Buffer.byteLength(q)),A.end(q)}}function er(R,A){R.setHeader("Content-Type","application/json; charset=utf-8"),R.send(JSON.stringify(A))}function es(R){return"string"==typeof R&&R.length>=16}function ei(R,A){if(!es(A.previewModeId))throw Error("invariant: invalid previewModeId");let I=A.enable?void 0:new Date(0),{serialize:q}=M("./dist/compiled/cookie/index.js"),$=R.getHeader("Set-Cookie");return R.setHeader("Set-Cookie",[..."string"==typeof $?[$]:Array.isArray($)?$:[],q(D.dS,A.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:I})]),R}function en(R,A,I){if(!es(I.previewModeId))throw Error("invariant: invalid previewModeId");if(!es(I.previewModeEncryptionKey))throw Error("invariant: invalid previewModeEncryptionKey");if(!es(I.previewModeSigningKey))throw Error("invariant: invalid previewModeSigningKey");let q=M("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:$}=M("./dist/esm/server/crypto-utils.js"),H=q.sign({data:$(Buffer.from(I.previewModeEncryptionKey),JSON.stringify(A))},I.previewModeSigningKey,{algorithm:"HS256",...void 0!==I.maxAge?{expiresIn:I.maxAge}:void 0});if(H.length>2048)throw Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue");let{serialize:U}=M("./dist/compiled/cookie/index.js"),F=R.getHeader("Set-Cookie");return R.setHeader("Set-Cookie",[..."string"==typeof F?[F]:Array.isArray(F)?F:[],U(D.dS,I.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==I.maxAge?{maxAge:I.maxAge}:void 0,...void 0!==I.path?{path:I.path}:void 0}),U(D.QM,H,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==I.maxAge?{maxAge:I.maxAge}:void 0,...void 0!==I.path?{path:I.path}:void 0})]),R}async function ea(R,A,M,D){if("string"!=typeof R||!R.startsWith("/"))throw Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${R}`);let I={[J.y3]:D.previewModeId,...A.unstable_onlyGenerated?{[J.Qq]:"1"}:{}},q=[...D.allowedRevalidateHeaderKeys||[],...D.trustHostHeader?["cookie","x-vercel-protection-bypass"]:[]];for(let R of Object.keys(M.headers))q.includes(R)&&(I[R]=M.headers[R]);try{if(D.trustHostHeader){let D=await fetch(`https://${M.headers.host}${R}`,{method:"HEAD",headers:I}),q=D.headers.get("x-vercel-cache")||D.headers.get("x-nextjs-cache");if((null==q?void 0:q.toUpperCase())!=="REVALIDATED"&&!(404===D.status&&A.unstable_onlyGenerated))throw Error(`Invalid response ${D.status}`)}else if(D.revalidate)await D.revalidate({urlPath:R,revalidateHeaders:I,opts:A});else throw Error("Invariant: required internal revalidate method not passed to api-utils")}catch(A){throw Error(`Failed to revalidate ${R}: ${(0,B.Z)(A)?A.message:A}`)}}async function eo(R,A,M,I,$,H,U,F){let V=R,K=A;try{var J,Z,es,eo;if(!I){A.statusCode=404,A.end("Not Found");return}let H=I.config||{},U=(null==(J=H.api)?void 0:J.bodyParser)!==!1,B=(null==(Z=H.api)?void 0:Z.responseLimit)??!0;null==(es=H.api)||es.externalResolver,(0,D.gk)({req:V},"cookies",(0,z.a)(R.headers)),V.query=M,(0,D.gk)({req:V},"previewData",()=>Y(R,A,$)),(0,D.gk)({req:V},"preview",()=>!1!==V.previewData||void 0),(0,D.gk)({req:V},"draftMode",()=>V.preview),U&&!V.body&&(V.body=await Q(V,H.api&&H.api.bodyParser&&H.api.bodyParser.sizeLimit?H.api.bodyParser.sizeLimit:"1mb"));let el=0,eh=ee(B),ed=K.write,eu=K.end;K.write=(...R)=>(el+=Buffer.byteLength(R[0]||""),ed.apply(K,R)),K.end=(...A)=>(A.length&&"function"!=typeof A[0]&&(el+=Buffer.byteLength(A[0]||"")),B&&el>=eh&&console.warn(`API response for ${R.url} exceeds ${q().format(eh)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),eu.apply(K,A)),K.status=R=>(0,D.Gy)(K,R),K.send=R=>et(V,K,R),K.json=R=>er(K,R),K.redirect=(R,A)=>(0,D.uX)(K,R,A),K.setDraftMode=(R={enable:!0})=>ei(K,Object.assign({},$,R)),K.setPreviewData=(R,A={})=>en(K,R,Object.assign({},$,A)),K.clearPreviewData=(R={})=>(0,D.Lm)(K,R),K.revalidate=(A,M)=>ea(A,M||{},R,$);let ec=(0,W.X)(I);null==(eo=(0,G.getTracer)().getRootSpanAttributes())||eo.set("next.route",F),await (0,G.getTracer)().trace(X.Zq.runHandler,{spanName:`executing api route (pages) ${F}`},()=>ec(R,A))}catch(R){if(R instanceof D.MS)(0,D.y7)(K,R.statusCode,R.message);else{if(U)throw(0,B.Z)(R)&&(R.page=F),R;if(console.error(R),H)throw R;(0,D.y7)(K,500,"Internal Server Error")}}}},"./dist/esm/server/crypto-utils.js":(R,A,M)=>{"use strict";M.r(A),M.d(A,{decryptWithSecret:()=>z,encryptWithSecret:()=>W});var D=M("crypto"),I=M.n(D);let q="aes-256-gcm",$=32,H=16,U=16,F=64,B=1e5;function W(R,A){let M=I().randomBytes(H),D=I().randomBytes(F),U=I().pbkdf2Sync(R,D,B,$,"sha512"),W=I().createCipheriv(q,U,M),z=Buffer.concat([W.update(A,"utf8"),W.final()]),G=W.getAuthTag();return Buffer.concat([D,M,G,z]).toString("hex")}function z(R,A){let M=Buffer.from(A,"hex"),D=M.slice(0,F),W=M.slice(F,F+H),z=M.slice(F+H,F+H+U),G=M.slice(F+H+U),X=I().pbkdf2Sync(R,D,B,$,"sha512"),V=I().createDecipheriv(q,X,W);return V.setAuthTag(z),V.update(G)+V.final("utf8")}},"./dist/esm/server/lib/etag.js":(R,A,M)=>{"use strict";M.d(A,{j:()=>I});let D=R=>{let A=R.length,M=0,D=0,I=8997,q=0,$=33826,H=0,U=40164,F=0,B=52210;for(;M<A;)I^=R.charCodeAt(M++),D=435*I,q=435*$,H=435*U,F=435*B,H+=I<<8,F+=$<<8,q+=D>>>16,I=65535&D,H+=q>>>16,$=65535&q,B=F+(H>>>16)&65535,U=65535&H;return(15&B)*281474976710656+4294967296*U+65536*$+(I^B>>4)},I=(R,A=!1)=>{let M=A?'W/"':'"';return M+D(R).toString(36)+R.length.toString(36)+'"'}},"./dist/esm/server/lib/server-ipc/invoke-request.js":(R,A,M)=>{"use strict";M.d(A,{R:()=>I});var D=M("./dist/esm/server/lib/server-ipc/utils.js");let I=async(R,A,M)=>{let I=(0,D.M2)({"cache-control":"",...A.headers},D.EK);return await fetch(R,{headers:I,method:A.method,redirect:"manual",signal:A.signal,..."GET"!==A.method&&"HEAD"!==A.method&&M?{body:M,duplex:"half"}:{},next:{internal:!0}})}},"./dist/esm/server/lib/server-ipc/request-utils.js":(R,A,M)=>{"use strict";M.d(A,{p:()=>$});var D=M("./dist/esm/shared/lib/utils.js"),I=M("./dist/esm/server/lib/server-ipc/invoke-request.js");let q=R=>{if(!R||"object"!=typeof R||!R.stack)return R;let A=Error;"PageNotFoundError"===R.name&&(A=D.GP);let I=new A(R.message);I.stack=R.stack,I.name=R.name,I.digest=R.digest;{let{decorateServerError:A}=M("next/dist/compiled/@next/react-dev-overlay/dist/middleware");A(I,R.source||"server")}return I};async function $({fetchHostname:R="localhost",method:A,args:M,ipcPort:D,ipcKey:$}){if(D){let H=await (0,I.R)(`http://${R}:${D}?key=${$}&method=${A}&args=${encodeURIComponent(JSON.stringify(M))}`,{method:"GET",headers:{}}),U=await H.text();if(U.startsWith("{")&&U.endsWith("}")){let R=JSON.parse(U);if(R&&"object"==typeof R&&"err"in R&&"stack"in R.err)throw q(R.err);return R}}}},"./dist/esm/server/lib/server-ipc/utils.js":(R,A,M)=>{"use strict";M.d(A,{EK:()=>D,M2:()=>I});let D=["accept-encoding","keepalive","keep-alive","content-encoding","transfer-encoding","connection","expect"];[...D];let I=(R,A)=>{for(let[M,D]of(R["content-length"]&&"0"===R["content-length"]&&delete R["content-length"],Object.entries(R)))(A.includes(M)||!(Array.isArray(D)||"string"==typeof D))&&delete R[M];return R}},"./dist/esm/server/lib/trace/constants.js":(R,A,M)=>{"use strict";var D,I,q,$,H,U,F,B,W,z,G;M.d(A,{Xy:()=>$,Zq:()=>W,_J:()=>D,qj:()=>I}),function(R){R.handleRequest="BaseServer.handleRequest",R.run="BaseServer.run",R.pipe="BaseServer.pipe",R.getStaticHTML="BaseServer.getStaticHTML",R.render="BaseServer.render",R.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",R.renderToResponse="BaseServer.renderToResponse",R.renderToHTML="BaseServer.renderToHTML",R.renderError="BaseServer.renderError",R.renderErrorToResponse="BaseServer.renderErrorToResponse",R.renderErrorToHTML="BaseServer.renderErrorToHTML",R.render404="BaseServer.render404"}(D||(D={})),function(R){R.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",R.loadComponents="LoadComponents.loadComponents"}(I||(I={})),function(R){R.getRequestHandler="NextServer.getRequestHandler",R.getServer="NextServer.getServer",R.getServerRequestHandler="NextServer.getServerRequestHandler",R.createServer="createServer.createServer"}(q||(q={})),function(R){R.compression="NextNodeServer.compression",R.getBuildId="NextNodeServer.getBuildId",R.generateStaticRoutes="NextNodeServer.generateStaticRoutes",R.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",R.generatePublicRoutes="NextNodeServer.generatePublicRoutes",R.generateImageRoutes="NextNodeServer.generateImageRoutes.route",R.sendRenderResult="NextNodeServer.sendRenderResult",R.proxyRequest="NextNodeServer.proxyRequest",R.runApi="NextNodeServer.runApi",R.render="NextNodeServer.render",R.renderHTML="NextNodeServer.renderHTML",R.imageOptimizer="NextNodeServer.imageOptimizer",R.getPagePath="NextNodeServer.getPagePath",R.getRoutesManifest="NextNodeServer.getRoutesManifest",R.findPageComponents="NextNodeServer.findPageComponents",R.getFontManifest="NextNodeServer.getFontManifest",R.getServerComponentManifest="NextNodeServer.getServerComponentManifest",R.getRequestHandler="NextNodeServer.getRequestHandler",R.renderToHTML="NextNodeServer.renderToHTML",R.renderError="NextNodeServer.renderError",R.renderErrorToHTML="NextNodeServer.renderErrorToHTML",R.render404="NextNodeServer.render404",R.route="route",R.onProxyReq="onProxyReq",R.apiResolver="apiResolver",R.internalFetch="internalFetch"}($||($={})),function(R){R.startServer="startServer.startServer"}(H||(H={})),function(R){R.getServerSideProps="Render.getServerSideProps",R.getStaticProps="Render.getStaticProps",R.renderToString="Render.renderToString",R.renderDocument="Render.renderDocument",R.createBodyResult="Render.createBodyResult"}(U||(U={})),function(R){R.renderToString="AppRender.renderToString",R.renderToReadableStream="AppRender.renderToReadableStream",R.getBodyResult="AppRender.getBodyResult",R.fetch="AppRender.fetch"}(F||(F={})),function(R){R.executeRoute="Router.executeRoute"}(B||(B={})),function(R){R.runHandler="Node.runHandler"}(W||(W={})),function(R){R.runHandler="AppRouteRouteHandlers.runHandler"}(z||(z={})),function(R){R.generateMetadata="ResolveMetadata.generateMetadata"}(G||(G={}))},"./dist/esm/server/node-environment.js":(R,A,M)=>{if("function"!=typeof globalThis.AsyncLocalStorage){let{AsyncLocalStorage:R}=M("async_hooks");globalThis.AsyncLocalStorage=R}"function"!=typeof globalThis.WebSocket&&Object.defineProperty(globalThis,"WebSocket",{get:()=>M("./dist/compiled/ws/index.js").WebSocket}),"withResolvers"in Promise&&"function"==typeof Promise.withResolvers||(Promise.withResolvers=()=>{let R;let A=new Promise((A,M)=>{R={resolve:A,reject:M}});return{promise:A,resolve:R.resolve,reject:R.reject}})},"./dist/esm/server/node-polyfill-crypto.js":(R,A,M)=>{if(!global.crypto){let R;Object.defineProperty(global,"crypto",{enumerable:!1,configurable:!0,get:()=>(R||(R=M("node:crypto").webcrypto),R),set(A){R=A}})}},"./dist/esm/server/node-polyfill-fetch.js":(R,A,M)=>{if("undefined"==typeof fetch&&void 0===globalThis.fetch){function D(){return M("next/dist/compiled/undici")}function I(){let R=D().Request;return class extends R{constructor(R,A){super(R,A),this.next=null==A?void 0:A.next}}}globalThis.fetch=(...R)=>{var A;let M=D();return(null==(A=global.__NEXT_HTTP_AGENT_OPTIONS)?void 0:A.keepAlive)||global.__NEXT_UNDICI_AGENT_SET||(global.__NEXT_UNDICI_AGENT_SET=!0,M.setGlobalDispatcher(new M.Agent({pipelining:0})),console.warn('Warning - Configuring `keepAlive: false` is deprecated. Use `{ headers: { connection: "close" } }` instead.')),M.fetch(...R)},Object.defineProperties(global,{Headers:{get:()=>D().Headers},Request:{get:()=>I()},Response:{get:()=>D().Response}})}},"./dist/esm/server/node-polyfill-form.js":(R,A,M)=>{if(!global.FormData){let{FormData:R}=M("next/dist/compiled/@edge-runtime/ponyfill");global.FormData=R}if(!global.Blob){let{Blob:R}=M("next/dist/compiled/@edge-runtime/ponyfill");global.Blob=R}},"./dist/esm/server/node-polyfill-web-streams.js":(R,A,M)=>{if(!global.ReadableStream){if(M("stream/web").ReadableStream)global.ReadableStream=M("stream/web").ReadableStream;else{let{ReadableStream:R}=M("next/dist/compiled/@edge-runtime/ponyfill");global.ReadableStream=R}}if(!global.TransformStream){if(M("stream/web").TransformStream)global.TransformStream=M("stream/web").TransformStream;else{let{TransformStream:R}=M("next/dist/compiled/@edge-runtime/ponyfill");global.TransformStream=R}}},"./dist/esm/server/send-payload/index.js":(R,A,M)=>{"use strict";M.d(A,{BR:()=>B,Wz:()=>F});var D=M("./dist/esm/shared/lib/utils.js"),I=M("./dist/esm/server/lib/etag.js"),q=M("./dist/compiled/fresh/index.js"),$=M.n(q),H=M("./dist/esm/server/send-payload/revalidate-headers.js"),U=M("./dist/esm/client/components/app-router-headers.js");function F(R,A,M){return M&&A.setHeader("ETag",M),!!$()(R.headers,{etag:M})&&(A.statusCode=304,A.end(),!0)}async function B({req:R,res:A,result:M,type:q,generateEtags:$,poweredByHeader:B,options:W}){if((0,D.aC)(A))return;B&&"html"===q&&A.setHeader("X-Powered-By","Next.js"),null!=W&&(0,H.l)(A,W);let z=M.isDynamic?null:await M.toUnchunkedString();if(null!==z){let M=$?(0,I.j)(z):void 0;if(F(R,A,M))return}A.getHeader("Content-Type")||A.setHeader("Content-Type",M.contentType?M.contentType:"rsc"===q?U.eY:"json"===q?"application/json":"text/html; charset=utf-8"),z&&A.setHeader("Content-Length",Buffer.byteLength(z)),"HEAD"===R.method?A.end(null):null!==z?A.end(z):await M.pipe(A)}},"./dist/esm/server/send-payload/revalidate-headers.js":(R,A,M)=>{"use strict";function D(R,A){if(A.private||A.stateful)(A.private||!R.getHeader("Cache-Control"))&&R.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else if("number"==typeof A.revalidate){if(A.revalidate<1)throw Error(`invariant: invalid Cache-Control duration provided: ${A.revalidate} < 1`);R.setHeader("Cache-Control",`s-maxage=${A.revalidate}, stale-while-revalidate`)}else!1===A.revalidate&&R.setHeader("Cache-Control","s-maxage=31536000, stale-while-revalidate")}M.d(A,{l:()=>D})},"./dist/esm/server/web/spec-extension/adapters/headers.js":(R,A,M)=>{"use strict";M.d(A,{h:()=>q});class D{static get(R,A,M){let D=Reflect.get(R,A,M);return"function"==typeof D?D.bind(R):D}static set(R,A,M,D){return Reflect.set(R,A,M,D)}static has(R,A){return Reflect.has(R,A)}static deleteProperty(R,A){return Reflect.deleteProperty(R,A)}}class I extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new I}}class q extends Headers{constructor(R){super(),this.headers=new Proxy(R,{get(A,M,I){if("symbol"==typeof M)return D.get(A,M,I);let q=M.toLowerCase(),$=Object.keys(R).find(R=>R.toLowerCase()===q);if(void 0!==$)return D.get(A,$,I)},set(A,M,I,q){if("symbol"==typeof M)return D.set(A,M,I,q);let $=M.toLowerCase(),H=Object.keys(R).find(R=>R.toLowerCase()===$);return D.set(A,H??M,I,q)},has(A,M){if("symbol"==typeof M)return D.has(A,M);let I=M.toLowerCase(),q=Object.keys(R).find(R=>R.toLowerCase()===I);return void 0!==q&&D.has(A,q)},deleteProperty(A,M){if("symbol"==typeof M)return D.deleteProperty(A,M);let I=M.toLowerCase(),q=Object.keys(R).find(R=>R.toLowerCase()===I);return void 0===q||D.deleteProperty(A,q)}})}static seal(R){return new Proxy(R,{get(R,A,M){switch(A){case"append":case"delete":case"set":return I.callable;default:return D.get(R,A,M)}}})}merge(R){return Array.isArray(R)?R.join(", "):R}static from(R){return R instanceof Headers?R:new q(R)}append(R,A){let M=this.headers[R];"string"==typeof M?this.headers[R]=[M,A]:Array.isArray(M)?M.push(A):this.headers[R]=A}delete(R){delete this.headers[R]}get(R){let A=this.headers[R];return void 0!==A?this.merge(A):null}has(R){return void 0!==this.headers[R]}set(R,A){this.headers[R]=A}forEach(R,A){for(let[M,D]of this.entries())R.call(A,D,M,this)}*entries(){for(let R of Object.keys(this.headers)){let A=R.toLowerCase(),M=this.get(A);yield[A,M]}}*keys(){for(let R of Object.keys(this.headers)){let A=R.toLowerCase();yield A}}*values(){for(let R of Object.keys(this.headers)){let A=this.get(R);yield A}}[Symbol.iterator](){return this.entries()}}},"./dist/esm/server/web/spec-extension/cookies.js":(R,A,M)=>{"use strict";M.d(A,{q:()=>D.RequestCookies});var D=M("./dist/compiled/@edge-runtime/cookies/index.js")},"./dist/esm/server sync recursive":R=>{function A(R){var A=Error("Cannot find module '"+R+"'");throw A.code="MODULE_NOT_FOUND",A}A.keys=()=>[],A.resolve=A,A.id="./dist/esm/server sync recursive",R.exports=A},"./dist/esm/shared/lib/isomorphic/path.js":(R,A,M)=>{let D;D=M("path"),R.exports=D},"./dist/esm/shared/lib/modern-browserslist-target.js":R=>{let A=["chrome 64","edge 79","firefox 67","opera 51","safari 12"];R.exports=A},"./dist/esm/shared/lib/utils.js":(R,A,M)=>{"use strict";function D(R){let A,M=!1;return function(){for(var D=arguments.length,I=Array(D),q=0;q<D;q++)I[q]=arguments[q];return M||(M=!0,A=R(...I)),A}}function I(R){return R.finished||R.headersSent}function q(R){let A=R.split("?"),M=A[0];return M.replace(/\\/g,"/").replace(/\/\/+/g,"/")+(A[1]?"?"+A.slice(1).join("?"):"")}M.d(A,{At:()=>B,GP:()=>F,JW:()=>W,KM:()=>U,U3:()=>q,_9:()=>H,aC:()=>I,gf:()=>D});let $="undefined"!=typeof performance;$&&["mark","measure","getEntriesByName"].every(R=>"function"==typeof performance[R]);class H extends Error{}class U extends Error{}class F extends Error{constructor(R){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+R}}class B extends Error{constructor(R,A){super(),this.message="Failed to load static file for page: "+R+" "+A}}class W extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}},"./lib/trace/tracer":R=>{"use strict";R.exports=require("next/dist/server/lib/trace/tracer")},"next/dist/compiled/@edge-runtime/ponyfill":R=>{"use strict";R.exports=require("next/dist/compiled/@edge-runtime/ponyfill")},"next/dist/compiled/@next/react-dev-overlay/dist/middleware":R=>{"use strict";R.exports=require("next/dist/compiled/@next/react-dev-overlay/dist/middleware")},"next/dist/compiled/jsonwebtoken":R=>{"use strict";R.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/raw-body":R=>{"use strict";R.exports=require("next/dist/compiled/raw-body")},"next/dist/compiled/undici":R=>{"use strict";R.exports=require("next/dist/compiled/undici")},"./web/sandbox":R=>{"use strict";R.exports=require("next/dist/server/web/sandbox")},async_hooks:R=>{"use strict";R.exports=require("async_hooks")},crypto:R=>{"use strict";R.exports=require("crypto")},events:R=>{"use strict";R.exports=require("events")},fs:R=>{"use strict";R.exports=require("fs")},http:R=>{"use strict";R.exports=require("http")},https:R=>{"use strict";R.exports=require("https")},module:R=>{"use strict";R.exports=require("module")},net:R=>{"use strict";R.exports=require("net")},"node:crypto":R=>{"use strict";R.exports=require("node:crypto")},os:R=>{"use strict";R.exports=require("os")},path:R=>{"use strict";R.exports=require("path")},querystring:R=>{"use strict";R.exports=require("querystring")},stream:R=>{"use strict";R.exports=require("stream")},"stream/web":R=>{"use strict";R.exports=require("stream/web")},tls:R=>{"use strict";R.exports=require("tls")},url:R=>{"use strict";R.exports=require("url")},zlib:R=>{"use strict";R.exports=require("zlib")}},__webpack_module_cache__={};function __webpack_require__(R){var A=__webpack_module_cache__[R];if(void 0!==A)return A.exports;var M=__webpack_module_cache__[R]={exports:{}};return __webpack_modules__[R](M,M.exports,__webpack_require__),M.exports}(()=>{__webpack_require__.n=R=>{var A=R&&R.__esModule?()=>R.default:()=>R;return __webpack_require__.d(A,{a:A}),A}})(),(()=>{__webpack_require__.d=(R,A)=>{for(var M in A)__webpack_require__.o(A,M)&&!__webpack_require__.o(R,M)&&Object.defineProperty(R,M,{enumerable:!0,get:A[M]})}})(),(()=>{__webpack_require__.o=(R,A)=>Object.prototype.hasOwnProperty.call(R,A)})(),(()=>{__webpack_require__.r=R=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}})();var __webpack_exports__={};(()=>{"use strict";let R,A,M,D;__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{NoFallbackError:()=>r5,WrappedBuildError:()=>r3,default:()=>sV});var I,q={};__webpack_require__.r(q),__webpack_require__.d(q,{bootstrap:()=>eW,error:()=>eG,event:()=>eJ,info:()=>eK,prefixes:()=>eU,ready:()=>eV,trace:()=>eY,wait:()=>ez,warn:()=>eX,warnOnce:()=>eQ}),__webpack_require__("./dist/esm/server/node-environment.js");let $=__webpack_require__("path"),H=__webpack_require__("module"),U=H.prototype.require,F=H._resolveFilename,B=require.resolve,W=new Map,z={"styled-jsx":$.dirname(B("styled-jsx/package.json")),"styled-jsx/style":B("styled-jsx/style")},G=R=>Object.entries(R).map(([R,A])=>[R,B(A)]);(function(R=[]){for(let[A,M]of R)W.set(A,M)})(G(z)),H._resolveFilename=(function(R,A,M,D,I,q){let $=A.get(M);return $&&(M=$),R.call(H,M,D,I,q)}).bind(null,F,W),H.prototype.require=function(R){return R.endsWith(".shared-runtime")?U.call(this,`next/dist/server/future/route-modules/pages/vendored/contexts/${$.basename(R,".shared-runtime")}`):U.call(this,R)},__webpack_require__("./dist/esm/server/node-polyfill-fetch.js"),__webpack_require__("./dist/esm/server/node-polyfill-form.js"),__webpack_require__("./dist/esm/server/node-polyfill-web-streams.js"),__webpack_require__("./dist/esm/server/node-polyfill-crypto.js");var X=__webpack_require__("./dist/esm/shared/lib/utils.js");function V(R){let{re:A,groups:M}=R;return R=>{let D=A.exec(R);if(!D)return!1;let I=R=>{try{return decodeURIComponent(R)}catch(R){throw new X._9("failed to decode param")}},q={};return Object.keys(M).forEach(R=>{let A=M[R],$=D[A.pos];void 0!==$&&(q[R]=~$.indexOf("/")?$.split("/").map(R=>I(R)):A.repeat?[I($)]:I($))}),q}}var K=__webpack_require__("fs"),J=__webpack_require__.n(K),Y=__webpack_require__("path"),Z=__webpack_require__.n(Y);let Q=Symbol.for("NextInternalRequestMeta");function ee(R,A){let M=R[Q]||{};return"string"==typeof A?M[A]:M}function et(R,A){return R[Q]=A,A}function er(R,A,M){let D=ee(R);return D[A]=M,et(R,D)}function es(R,A){let M=ee(R);return delete M[A],et(R,M)}__webpack_require__("./dist/esm/shared/lib/modern-browserslist-target.js");let ei={client:"client",server:"server",edgeServer:"edge-server"},en=["x-invoke-path","x-invoke-status","x-invoke-error","x-invoke-query","x-middleware-invoke"];ei.client,ei.server,ei.edgeServer;let ea="phase-production-build",eo="pages-manifest.json",el="app-paths-manifest.json",eh="build-manifest.json",ed="next-font-manifest",eu="prerender-manifest.json",ec="routes-manifest.json",ep="middleware-manifest.json",ef="react-loadable-manifest.json",em="font-manifest.json",eg="server",ev="BUILD_ID",ey=["/_document","/_app","/_error"],e_="public",ex="__NEXT_BUILTIN_DOCUMENT__",ew="client-reference-manifest",eb="server-reference-manifest",eE="polyfills";Symbol(eE);let eS=307,eC=308,eP=["/500"];function eR(R,A){let M=Z().join(R,A);return J().existsSync(M)?M:(M=Z().join(R,"src",A),J().existsSync(M))?M:null}var eT=__webpack_require__("./dist/esm/server/api-utils/index.js"),ek=__webpack_require__("./dist/esm/server/api-utils/node.js"),eN=__webpack_require__("./dist/esm/server/api-utils/get-cookie-parser.js");class eA{constructor(R,A,M){this.method=R,this.url=A,this.body=M}get cookies(){return this._cookies?this._cookies:this._cookies=(0,eN.a)(this.headers)()}}class eO{constructor(R){this.destination=R}redirect(R,A){return this.setHeader("Location",R),this.statusCode=A,A===eC&&this.setHeader("Refresh",`0;url=${R}`),this}}let eM=Q;class eL extends eA{get originalRequest(){return this._req[Q]=this[Q],this._req.url=this.url,this._req.cookies=this.cookies,this._req}set originalRequest(R){this._req=R}constructor(R){super(R.method.toUpperCase(),R.url,R),this._req=R,this.headers=this._req.headers,this[eM]=this._req[Q]||{}}async parseBody(R){return(0,ek.parseBody)(this._req,R)}}class ej extends eO{get originalResponse(){return eT.OF in this&&(this._res[eT.OF]=this[eT.OF]),this._res}constructor(R){super(R),this._res=R,this.textBody=void 0}get sent(){return this._res.finished||this._res.headersSent}get statusCode(){return this._res.statusCode}set statusCode(R){this._res.statusCode=R}get statusMessage(){return this._res.statusMessage}set statusMessage(R){this._res.statusMessage=R}setHeader(R,A){return this._res.setHeader(R,A),this}removeHeader(R){return this._res.removeHeader(R),this}getHeaderValues(R){let A=this._res.getHeader(R);if(void 0!==A)return(Array.isArray(A)?A:[A]).map(R=>R.toString())}hasHeader(R){return this._res.hasHeader(R)}getHeader(R){let A=this.getHeaderValues(R);return Array.isArray(A)?A.join(","):void 0}getHeaders(){return this._res.getHeaders()}appendHeader(R,A){let M=this.getHeaderValues(R)??[];return M.includes(A)||this._res.setHeader(R,[...M,A]),this}body(R){return this.textBody=R,this}send(){this._res.end(this.textBody)}}var eD=__webpack_require__("./dist/esm/server/send-payload/index.js");function eI(R){let A={};return R.forEach((R,M)=>{void 0===A[M]?A[M]=R:Array.isArray(A[M])?A[M].push(R):A[M]=[A[M],R]}),A}function eq(R,A){let M=new URL("http://n"),D=A?new URL(A,M):R.startsWith(".")?new URL("http://n"):M,{pathname:I,searchParams:q,search:$,hash:H,href:U,origin:F}=new URL(R,D);if(F!==M.origin)throw Error("invariant: invalid relative URL, router received "+R);return{pathname:I,query:eI(q),search:$,hash:H,href:U.slice(M.origin.length)}}function e$(R){if(R.startsWith("/"))return eq(R);let A=new URL(R);return{hash:A.hash,hostname:A.hostname,href:A.href,pathname:A.pathname,port:A.port,protocol:A.protocol,query:eI(A.searchParams),search:A.search}}R=__webpack_require__("./dist/esm/lib/web/chalk.js").Z;let eH=R,eU={wait:eH.white(eH.bold("○")),error:eH.red(eH.bold("")),warn:eH.yellow(eH.bold("⚠")),ready:eH.bold("▲"),info:eH.white(eH.bold(" ")),event:eH.green(eH.bold("✓")),trace:eH.magenta(eH.bold("\xbb"))},eF={log:"log",warn:"warn",error:"error"};function eB(R,...A){(""===A[0]||void 0===A[0])&&1===A.length&&A.shift();let M=R in eF?eF[R]:"log",D=eU[R];0===A.length?console[M](""):console[M](" "+D,...A)}function eW(...R){console.log(" ",...R)}function ez(...R){eB("wait",...R)}function eG(...R){eB("error",...R)}function eX(...R){eB("warn",...R)}function eV(...R){eB("ready",...R)}function eK(...R){eB("info",...R)}function eJ(...R){eB("event",...R)}function eY(...R){eB("trace",...R)}let eZ=new Set;function eQ(...R){eZ.has(R[0])||(eZ.add(R.join(" ")),eX(...R))}var e0=__webpack_require__("url");let e1="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",e2=`(${e1}[.]){3}${e1}`,e4="(?:[0-9a-fA-F]{1,4})",e8=RegExp(`^((?:${e4}:){7}(?:${e4}|:)|(?:${e4}:){6}(?:${e2}|:${e4}|:)|(?:${e4}:){5}(?::${e2}|(:${e4}){1,2}|:)|(?:${e4}:){4}(?:(:${e4}){0,1}:${e2}|(:${e4}){1,3}|:)|(?:${e4}:){3}(?:(:${e4}){0,2}:${e2}|(:${e4}){1,4}|:)|(?:${e4}:){2}(?:(:${e4}){0,3}:${e2}|(:${e4}){1,5}|:)|(?:${e4}:){1}(?:(:${e4}){0,4}:${e2}|(:${e4}){1,6}|:)|(?::((?::${e4}){0,5}:${e2}|(?::${e4}){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$`);function e5(R){return e8.test(R)}function e3(R){return e5(R)?`[${R}]`:R}function e6(R){return R.statusCode||(R.permanent?eC:eS)}var e9=__webpack_require__("./dist/esm/lib/constants.js");function e7(R){return R===e9.Jp.experimentalEdge||R===e9.Jp.edge}let te=/\/\[[^/]+?\](?=\/|$)/;function tt(R){return te.test(R)}let tr=require("next/dist/shared/lib/runtime-config.external.js");var ts=__webpack_require__("./dist/esm/server/send-payload/revalidate-headers.js");function ti(R){return ey.includes(R)}function tn(R){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(R)}function ta(R){return(null==R?void 0:R.name)==="AbortError"}async function tl(R,A){let M=R.getReader(),D=!1,I=!1;function q(){I=!0,A.off("close",q),D||(D=!0,M.cancel().catch(()=>{}))}A.on("close",q);try{for(;;){let{done:R,value:q}=await M.read();if(D=R,R||I)break;q&&(A.write(q),null==A.flush||A.flush.call(A))}}catch(R){if(!ta(R))throw R}finally{A.off("close",q),D||M.cancel().catch(()=>{}),I||A.end()}}class th{static fromStatic(R){return new th(R)}constructor(R,{contentType:A,...M}={}){this.response=R,this.contentType=A,this.metadata=M}extendMetadata(R){Object.assign(this.metadata,R)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(){if("string"!=typeof this.response)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return this.response}async pipe(R){if(null===this.response)throw Error("Invariant: response is null. This is a bug in Next.js");if("string"==typeof this.response)throw Error("Invariant: static responses cannot be piped. This is a bug in Next.js");return await tl(this.response,R)}}function td(R){return R.replace(/\/$/,"")||"/"}function tu(R){return R.replace(/\\/g,"/")}function tc(R){let A=tu(R);return A.startsWith("/index/")&&!tt(A)?A.slice(6):"/index"!==A?A:"/"}function tp(R,A){return R.replace(RegExp("([/#?]"+(A?"|%(2f|23|3f)":"")+")","gi"),R=>encodeURIComponent(R))}function tf(R,A){let M;let D=R.split("/");return(A||[]).some(A=>!!D[1]&&D[1].toLowerCase()===A.toLowerCase()&&(M=A,D.splice(1,1),R=D.join("/")||"/",!0)),{pathname:R,detectedLocale:M}}var tm=__webpack_require__("./dist/compiled/path-to-regexp/index.js");function tg(R,A){let M=[],D=(0,tm.Bo)(R,M,{delimiter:"/",sensitive:"boolean"==typeof(null==A?void 0:A.sensitive)&&A.sensitive,strict:null==A?void 0:A.strict}),I=(0,tm.WS)((null==A?void 0:A.regexModifier)?new RegExp(A.regexModifier(D.source),D.flags):D,M);return(R,D)=>{if("string"!=typeof R)return!1;let q=I(R);if(!q)return!1;if(null==A?void 0:A.removeUnnamedParams)for(let R of M)"number"==typeof R.name&&delete q.params[R.name];return{...D,...q.params}}}let tv=["(..)(..)","(.)","(..)","(...)"];function ty(R){return void 0!==R.split("/").find(R=>tv.find(A=>R.startsWith(A)))}let t_=/[|\\{}()[\]^$+*?.-]/,tx=/[|\\{}()[\]^$+*?.-]/g;function tw(R){return t_.test(R)?R.replace(tx,"\\$&"):R}let tb="nxtP",tE="nxtI";function tS(R){let A=R.startsWith("[")&&R.endsWith("]");A&&(R=R.slice(1,-1));let M=R.startsWith("...");return M&&(R=R.slice(3)),{key:R,repeat:M,optional:A}}function tC(R){let A=td(R).slice(1).split("/"),M={},D=1;return{parameterizedRoute:A.map(R=>{let A=tv.find(A=>R.startsWith(A)),I=R.match(/\[((?:\[.*\])|.+)\]/);if(A&&I){let{key:R,optional:q,repeat:$}=tS(I[1]);return M[R]={pos:D++,repeat:$,optional:q},"/"+tw(A)+"([^/]+?)"}if(!I)return"/"+tw(R);{let{key:R,repeat:A,optional:q}=tS(I[1]);return M[R]={pos:D++,repeat:A,optional:q},A?q?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:M}}function tP(R){let{parameterizedRoute:A,groups:M}=tC(R);return{re:RegExp("^"+A+"(?:/)?$"),groups:M}}function tR(){let R=0;return()=>{let A="",M=++R;for(;M>0;)A+=String.fromCharCode(97+(M-1)%26),M=Math.floor((M-1)/26);return A}}function tT(R){let{getSafeRouteKey:A,segment:M,routeKeys:D,keyPrefix:I}=R,{key:q,optional:$,repeat:H}=tS(M),U=q.replace(/\W/g,"");I&&(U=""+I+U);let F=!1;return(0===U.length||U.length>30)&&(F=!0),isNaN(parseInt(U.slice(0,1)))||(F=!0),F&&(U=A()),I?D[U]=""+I+q:D[U]=""+q,H?$?"(?:/(?<"+U+">.+?))?":"/(?<"+U+">.+?)":"/(?<"+U+">[^/]+?)"}function tk(R,A){let M=td(R).slice(1).split("/"),D=tR(),I={};return{namedParameterizedRoute:M.map(R=>{let M=tv.some(A=>R.startsWith(A)),q=R.match(/\[((?:\[.*\])|.+)\]/);return M&&q?tT({getSafeRouteKey:D,segment:q[1],routeKeys:I,keyPrefix:A?tE:void 0}):q?tT({getSafeRouteKey:D,segment:q[1],routeKeys:I,keyPrefix:A?tb:void 0}):"/"+tw(R)}).join(""),routeKeys:I}}function tN(R,A){let M=tk(R,A);return{...tP(R),namedRegex:"^"+M.namedParameterizedRoute+"(?:/)?$",routeKeys:M.routeKeys}}var tA=__webpack_require__("./dist/esm/client/components/app-router-headers.js");function tO(R){let A="";for(let M=0;M<R.length;M++){let D=R.charCodeAt(M);(D>64&&D<91||D>96&&D<123)&&(A+=R[M])}return A}function tM(R,A){return R.replace(RegExp(":"+tw(A),"g"),"__ESC_COLON_"+A)}function tL(R){return R.replace(/__ESC_COLON_/gi,":")}function tj(R,A,M,D){void 0===M&&(M=[]),void 0===D&&(D=[]);let I={},q=M=>{let D;let q=M.key;switch(M.type){case"header":q=q.toLowerCase(),D=R.headers[q];break;case"cookie":if("cookies"in R)D=R.cookies[M.key];else{let A=(0,eN.a)(R.headers)();D=A[M.key]}break;case"query":D=A[q];break;case"host":{let{host:A}=(null==R?void 0:R.headers)||{},M=null==A?void 0:A.split(":")[0].toLowerCase();D=M}}if(!M.value&&D)return I[tO(q)]=D,!0;if(D){let R=RegExp("^"+M.value+"$"),A=Array.isArray(D)?D.slice(-1)[0].match(R):D.match(R);if(A)return Array.isArray(A)&&(A.groups?Object.keys(A.groups).forEach(R=>{I[R]=A.groups[R]}):"host"===M.type&&A[0]&&(I.host=A[0])),!0}return!1},$=M.every(R=>q(R))&&!D.some(R=>q(R));return!!$&&I}function tD(R,A){if(!R.includes(":"))return R;for(let M of Object.keys(A))R.includes(":"+M)&&(R=R.replace(RegExp(":"+M+"\\*","g"),":"+M+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+M+"\\?","g"),":"+M+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+M+"\\+","g"),":"+M+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+M+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+M));return R=R.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,tm.MY)("/"+R,{validate:!1})(A).slice(1)}function tI(R){let A;let M=Object.assign({},R.query);delete M.__nextLocale,delete M.__nextDefaultLocale,delete M.__nextDataReq,delete M.__nextInferredLocaleFromDefault,delete M[tA.H4];let D=R.destination;for(let A of Object.keys({...R.params,...M}))D=tM(D,A);let I=e$(D),q=I.query,$=tL(""+I.pathname+(I.hash||"")),H=tL(I.hostname||""),U=[],F=[];(0,tm.Bo)($,U),(0,tm.Bo)(H,F);let B=[];U.forEach(R=>B.push(R.name)),F.forEach(R=>B.push(R.name));let W=(0,tm.MY)($,{validate:!1}),z=(0,tm.MY)(H,{validate:!1});for(let[A,M]of Object.entries(q))Array.isArray(M)?q[A]=M.map(A=>tD(tL(A),R.params)):"string"==typeof M&&(q[A]=tD(tL(M),R.params));let G=Object.keys(R.params).filter(R=>"nextInternalLocale"!==R);if(R.appendParamsToQuery&&!G.some(R=>B.includes(R)))for(let A of G)A in q||(q[A]=R.params[A]);if(ty($))for(let A of $.split("/")){let M=tv.find(R=>A.startsWith(R));if(M){R.params["0"]=M;break}}try{A=W(R.params);let[M,D]=A.split("#");I.hostname=z(R.params),I.pathname=M,I.hash=(D?"#":"")+(D||""),delete I.search}catch(R){if(R.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw R}return I.query={...M,...I.query},{newUrl:A,destQuery:q,parsedDestination:I}}function tq(R){return R.startsWith("/")?R:"/"+R}function t$(R){return"("===R[0]&&R.endsWith(")")}function tH(R){return tq(R.split("/").reduce((R,A,M,D)=>!A||t$(A)||"@"===A[0]||("page"===A||"route"===A)&&M===D.length-1?R:R+"/"+A,""))}function tU(R,A){return A?R.replace(/\.rsc($|\?)/,"$1"):R}function tF(R,A,M,D,I){if(D&&A&&I){let A=(0,e0.parse)(R.url,!0);for(let R of(delete A.search,Object.keys(A.query)))(R!==e9.dN&&R.startsWith(e9.dN)||(M||Object.keys(I.groups)).includes(R))&&delete A.query[R];R.url=(0,e0.format)(A)}}function tB(R,A,M){if(!M)return R;for(let D of Object.keys(M.groups)){let{optional:I,repeat:q}=M.groups[D],$=`[${q?"...":""}${D}]`;I&&($=`[${$}]`);let H=R.indexOf($);if(H>-1){let M;let I=A[D];M=Array.isArray(I)?I.map(R=>R&&encodeURIComponent(R)).join("/"):I?encodeURIComponent(I):"",R=R.slice(0,H)+M+R.slice(H+$.length)}}return R}function tW({page:R,i18n:A,basePath:M,rewrites:D,pageIsDynamic:I,trailingSlash:q,caseSensitive:$}){let H,U,F;return I&&(F=(U=V(H=tN(R,!1)))(R)),{handleRewrites:function(H,F){let B={},W=F.pathname,z=()=>{let A=td(W||"");return A===td(R)||(null==U?void 0:U(A))},G=D=>{let z=tg(D.source+(q?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!$}),G=z(F.pathname);if((D.has||D.missing)&&G){let R=tj(H,F.query,D.has,D.missing);R?Object.assign(G,R):G=!1}if(G){let{parsedDestination:q,destQuery:$}=tI({appendParamsToQuery:!0,destination:D.destination,params:G,query:F.query});if(q.protocol)return!0;if(Object.assign(B,$,G),Object.assign(F.query,q.query),delete q.query,Object.assign(F,q),W=F.pathname,M&&(W=W.replace(RegExp(`^${M}`),"")||"/"),A){let R=tf(W,A.locales);W=R.pathname,F.query.nextInternalLocale=R.detectedLocale||G.nextInternalLocale}if(W===R)return!0;if(I&&U){let R=U(W);if(R)return F.query={...F.query,...R},!0}}return!1};for(let R of D.beforeFiles||[])G(R);if(W!==R){let R=!1;for(let A of D.afterFiles||[])if(R=G(A))break;if(!R&&!z()){for(let A of D.fallback||[])if(R=G(A))break}}return B},defaultRouteRegex:H,dynamicRouteMatcher:U,defaultRouteMatches:F,getParamsFromRouteMatches:function(R,M,D){return V(function(){let{groups:R,routeKeys:I}=H;return{re:{exec:q=>{let $=Object.fromEntries(new URLSearchParams(q)),H=A&&D&&$["1"]===D;for(let R of Object.keys($)){let A=$[R];if(R!==e9.dN&&R.startsWith(e9.dN)){let M=R.substring(e9.dN.length);$[M]=A,delete $[R]}}let U=Object.keys(I||{}),F=R=>{if(A){let I=Array.isArray(R),q=I?R[0]:R;if("string"==typeof q&&A.locales.some(R=>R.toLowerCase()===q.toLowerCase()&&(D=R,M.locale=D,!0)))return I&&R.splice(0,1),!I||0===R.length}return!1};return U.every(R=>$[R])?U.reduce((A,M)=>{let D=null==I?void 0:I[M];return D&&!F($[M])&&(A[R[D].pos]=$[M]),A},{}):Object.keys($).reduce((R,A)=>{if(!F($[A])){let M=A;return H&&(M=parseInt(A,10)-1+""),Object.assign(R,{[M]:$[A]})}return R},{})}},groups:R}}())(R.headers["x-now-route-matches"])},normalizeDynamicRouteParams:function(R,A){let M=!0;return H?{params:R=Object.keys(H.groups).reduce((D,I)=>{let q=R[I];"string"==typeof q&&(q=tU(q,!0)),Array.isArray(q)&&(q=q.map(R=>("string"==typeof R&&(R=tU(R,!0)),R)));let $=F[I],U=H.groups[I].optional,B=Array.isArray($)?$.some(R=>Array.isArray(q)?q.some(A=>A.includes(R)):null==q?void 0:q.includes(R)):null==q?void 0:q.includes($);return(B||void 0===q&&!(U&&A))&&(M=!1),U&&(!q||Array.isArray(q)&&1===q.length&&("index"===q[0]||q[0]===`[[...${I}]]`))&&(q=void 0,delete R[I]),q&&"string"==typeof q&&H.groups[I].repeat&&(q=q.split("/")),q&&(D[I]=q),D},{}),hasValidParams:M}:{params:R,hasValidParams:!1}},normalizeVercelUrl:(R,A,M)=>tF(R,A,M,I,H),interpolateDynamicPath:(R,A)=>tB(R,A,H)}}var tz=__webpack_require__("./dist/esm/lib/is-error.js");function tG(R){let A=R.indexOf("#"),M=R.indexOf("?"),D=M>-1&&(A<0||M<A);return D||A>-1?{pathname:R.substring(0,D?M:A),query:D?R.substring(M,A>-1?A:void 0):"",hash:A>-1?R.slice(A):""}:{pathname:R,query:"",hash:""}}function tX(R,A){if("string"!=typeof R)return!1;let{pathname:M}=tG(R);return M===A||M.startsWith(A+"/")}function tV(R,A){if(!tX(R,A))return R;let M=R.slice(A.length);return M.startsWith("/")?M:"/"+M}function tK(R,A){let M;if((null==A?void 0:A.host)&&!Array.isArray(A.host))M=A.host.toString().split(":")[0];else{if(!R.hostname)return;M=R.hostname}return M.toLowerCase()}function tJ(R,A){var M,D;let{basePath:I,i18n:q,trailingSlash:$}=null!=(M=A.nextConfig)?M:{},H={pathname:R,trailingSlash:"/"!==R?R.endsWith("/"):$};I&&tX(H.pathname,I)&&(H.pathname=tV(H.pathname,I),H.basePath=I);let U=H.pathname;if(H.pathname.startsWith("/_next/data/")&&H.pathname.endsWith(".json")){let R=H.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),M=R[0];H.buildId=M,U="index"!==R[1]?"/"+R.slice(1).join("/"):"/",!0===A.parseData&&(H.pathname=U)}if(q){let R=A.i18nProvider?A.i18nProvider.analyze(H.pathname):tf(H.pathname,q.locales);H.locale=R.detectedLocale,H.pathname=null!=(D=R.pathname)?D:H.pathname,!R.detectedLocale&&H.buildId&&(R=A.i18nProvider?A.i18nProvider.analyze(U):tf(U,q.locales)).detectedLocale&&(H.locale=R.detectedLocale)}return H}class tY{constructor(R){this.provider=R}normalize(R){let A=this.provider.analyze(R);return A.pathname}}class tZ{insert(R){this._insert(R.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(R){void 0===R&&(R="/");let A=[...this.children.keys()].sort();null!==this.slugName&&A.splice(A.indexOf("[]"),1),null!==this.restSlugName&&A.splice(A.indexOf("[...]"),1),null!==this.optionalRestSlugName&&A.splice(A.indexOf("[[...]]"),1);let M=A.map(A=>this.children.get(A)._smoosh(""+R+A+"/")).reduce((R,A)=>[...R,...A],[]);if(null!==this.slugName&&M.push(...this.children.get("[]")._smoosh(R+"["+this.slugName+"]/")),!this.placeholder){let A="/"===R?"/":R.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+A+'" and "'+A+"[[..."+this.optionalRestSlugName+']]").');M.unshift(A)}return null!==this.restSlugName&&M.push(...this.children.get("[...]")._smoosh(R+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&M.push(...this.children.get("[[...]]")._smoosh(R+"[[..."+this.optionalRestSlugName+"]]/")),M}_insert(R,A,M){if(0===R.length){this.placeholder=!1;return}if(M)throw Error("Catch-all must be the last part of the URL.");let D=R[0];if(D.startsWith("[")&&D.endsWith("]")){let q=D.slice(1,-1),$=!1;if(q.startsWith("[")&&q.endsWith("]")&&(q=q.slice(1,-1),$=!0),q.startsWith("...")&&(q=q.substring(3),M=!0),q.startsWith("[")||q.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+q+"').");if(q.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+q+"').");function I(R,M){if(null!==R&&R!==M)throw Error("You cannot use different slug names for the same dynamic path ('"+R+"' !== '"+M+"').");A.forEach(R=>{if(R===M)throw Error('You cannot have the same slug name "'+M+'" repeat within a single dynamic path');if(R.replace(/\W/g,"")===D.replace(/\W/g,""))throw Error('You cannot have the slug names "'+R+'" and "'+M+'" differ only by non-word symbols within a single dynamic path')}),A.push(M)}if(M){if($){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+R[0]+'" ).');I(this.optionalRestSlugName,q),this.optionalRestSlugName=q,D="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+R[0]+'").');I(this.restSlugName,q),this.restSlugName=q,D="[...]"}}else{if($)throw Error('Optional route parameters are not yet supported ("'+R[0]+'").');I(this.slugName,q),this.slugName=q,D="[]"}}this.children.has(D)||this.children.set(D,new tZ),this.children.get(D)._insert(R.slice(1),A,M)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function tQ(R){let A=new tZ;return R.forEach(R=>A.insert(R)),A.smoosh()}class t4{constructor(R){this.definition=R,tt(R.pathname)&&(this.dynamic=V(tP(R.pathname)))}get identity(){return this.definition.pathname}get isDynamic(){return void 0!==this.dynamic}match(R){let A=this.test(R);return A?{definition:this.definition,params:A.params}:null}test(R){if(this.dynamic){let A=this.dynamic(R);return A?{params:A}:null}return R===this.definition.pathname?{}:null}}class t8 extends t4{get identity(){var R;return`${this.definition.pathname}?__nextLocale=${null==(R=this.definition.i18n)?void 0:R.locale}`}match(R,A){var M,D;let I=this.test(R,A);return I?{definition:this.definition,params:I.params,detectedLocale:(null==A?void 0:null==(M=A.i18n)?void 0:M.detectedLocale)??(null==(D=this.definition.i18n)?void 0:D.locale)}:null}test(R,A){return this.definition.i18n&&(null==A?void 0:A.i18n)?this.definition.i18n.locale&&A.i18n.detectedLocale&&this.definition.i18n.locale!==A.i18n.detectedLocale?null:super.test(A.i18n.pathname):super.test(R)}}class t5{get compilationID(){return this.providers.length}async waitTillReady(){this.waitTillReadyPromise&&(await this.waitTillReadyPromise,delete this.waitTillReadyPromise)}async reload(){let R;this.waitTillReadyPromise=new Promise((A,M)=>{R={resolve:A,reject:M}});let A=this.compilationID;try{let R=[],M=await Promise.all(this.providers.map(R=>R.matchers())),D=new Map,I={};for(let A of M)for(let M of A){M.duplicated&&delete M.duplicated;let A=D.get(M.definition.pathname);if(A){let R=I[M.definition.pathname]??[A];R.push(M),I[M.definition.pathname]=R,A.duplicated=R,M.duplicated=R}R.push(M),D.set(M.definition.pathname,M)}if(this.matchers.duplicates=I,this.previousMatchers.length===R.length&&this.previousMatchers.every((A,M)=>A===R[M]))return;this.previousMatchers=R,this.matchers.static=R.filter(R=>!R.isDynamic);let q=R.filter(R=>R.isDynamic),$=new Map,H=[];for(let R=0;R<q.length;R++){let A=q[R].definition.pathname,M=$.get(A)??[];M.push(R),1===M.length&&($.set(A,M),H.push(A))}let U=tQ(H),F=[];for(let R of U){let A=$.get(R);if(!Array.isArray(A))throw Error("Invariant: expected to find identity in indexes map");let M=A.map(R=>q[R]);F.push(...M)}if(this.matchers.dynamic=F,this.compilationID!==A)throw Error("Invariant: expected compilation to finish before new matchers were added, possible missing await")}catch(A){R.reject(A)}finally{this.lastCompilationID=A,R.resolve()}}push(R){this.providers.push(R)}async test(R,A){let M=await this.match(R,A);return null!==M}async match(R,A){for await(let M of this.matchAll(R,A))return M;return null}validate(R,A,M){var D;return A instanceof t8?A.match(R,M):(null==(D=M.i18n)?void 0:D.inferredFromDefault)?A.match(M.i18n.pathname):A.match(R)}async *matchAll(R,A){if(this.lastCompilationID!==this.compilationID)throw Error("Invariant: expected routes to have been loaded before match");if(!tt(R=tq(R)))for(let M of this.matchers.static){let D=this.validate(R,M,A);D&&(yield D)}if(null==A?void 0:A.skipDynamic)return null;for(let M of this.matchers.dynamic){let D=this.validate(R,M,A);D&&(yield D)}return null}constructor(){this.providers=[],this.matchers={static:[],dynamic:[],duplicates:{}},this.lastCompilationID=this.compilationID,this.previousMatchers=[]}}function t6(R){return R.endsWith("/page")}var t9=__webpack_require__("./dist/esm/shared/lib/isomorphic/path.js"),t7=__webpack_require__.n(t9);class rt{constructor(...R){this.prefix=t7().posix.join(...R)}normalize(R){return t7().posix.join(this.prefix,R)}}function rr(R){let A=/^\/index(\/|$)/.test(R)&&!tt(R)?"/index"+R:"/"===R?"/index":tq(R);{let{posix:R}=__webpack_require__("path"),M=R.normalize(A);if(M!==A)throw new X.KM("Requested and resolved page mismatch: "+A+" "+M)}return A}class rs extends rt{constructor(){super("app")}normalize(R){return super.normalize(rr(R))}}class ri extends rt{constructor(R){super(R,eg)}normalize(R){return super.normalize(R)}}class rn{constructor(R=[]){this.normalizers=R}push(R){this.normalizers.push(R)}normalize(R){return this.normalizers.reduce((R,A)=>A.normalize(R),R)}}function ra(R){return{normalize:R}}class ro{normalize(R){return R.replace(/%5F/g,"_")}}class rl extends rn{constructor(){super([ra(tH),new ro])}normalize(R){return super.normalize(R)}}class rh{constructor(R){this.filename=new ri(R),this.pathname=new rl,this.bundlePath=new rs}}!function(R){R.PAGES="PAGES",R.PAGES_API="PAGES_API",R.APP_PAGE="APP_PAGE",R.APP_ROUTE="APP_ROUTE"}(I||(I={}));class rd extends t4{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class ru{constructor(R){this.loader=R,this.cached=[]}async matchers(){let R=await this.loader.load();if(!R)return[];if(this.data&&this.loader.compare(this.data,R))return this.cached;this.data=R;let A=await this.transform(R);return this.cached=A,A}}class rc extends ru{constructor(R,A){super({load:async()=>A.load(R),compare:(R,A)=>R===A})}}class rp extends rc{constructor(R,A){super(el,A),this.normalizers=new rh(R)}async transform(R){let A=Object.keys(R).filter(R=>t6(R)),M={};for(let R of A){let A=this.normalizers.pathname.normalize(R);A in M?M[A].push(R):M[A]=[R]}let D=[];for(let[A,q]of Object.entries(M)){let M=q[0],$=this.normalizers.filename.normalize(R[M]),H=this.normalizers.bundlePath.normalize(M);D.push(new rd({kind:I.APP_PAGE,pathname:A,page:M,bundlePath:H,filename:$,appPaths:q}))}return D}}function rf(R){return R.endsWith("/route")}class rm extends t4{}class rg extends rc{constructor(R,A){super(el,A),this.normalizers=new rh(R)}async transform(R){let A=Object.keys(R).filter(R=>rf(R)),M=[];for(let D of A){let A=this.normalizers.filename.normalize(R[D]),q=this.normalizers.pathname.normalize(D),$=this.normalizers.bundlePath.normalize(D);M.push(new rm({kind:I.APP_ROUTE,pathname:q,page:D,bundlePath:$,filename:A}))}return M}}function rv(R){return"/api"===R||!!(null==R?void 0:R.startsWith("/api/"))}class ry extends t4{}class r_ extends t8{}class rx extends rn{constructor(){super([ra(rr),new rt("pages")])}normalize(R){return super.normalize(R)}}class rw extends rt{constructor(R){super(R,eg)}normalize(R){return super.normalize(R)}}class rb{constructor(R){this.filename=new rw(R),this.bundlePath=new rx}}class rE extends rc{constructor(R,A,M){super(eo,A),this.i18nProvider=M,this.normalizers=new rb(R)}async transform(R){let A=Object.keys(R).filter(R=>rv(R)),M=[];for(let D of A)if(this.i18nProvider){let{detectedLocale:A,pathname:q}=this.i18nProvider.analyze(D);M.push(new r_({kind:I.PAGES_API,pathname:q,page:D,bundlePath:this.normalizers.bundlePath.normalize(D),filename:this.normalizers.filename.normalize(R[D]),i18n:{locale:A}}))}else M.push(new ry({kind:I.PAGES_API,pathname:D,page:D,bundlePath:this.normalizers.bundlePath.normalize(D),filename:this.normalizers.filename.normalize(R[D])}));return M}}class rS extends t4{}class rC extends t8{}class rP extends rc{constructor(R,A,M){super(eo,A),this.i18nProvider=M,this.normalizers=new rb(R)}async transform(R){let A=Object.keys(R).filter(R=>!rv(R)).filter(R=>{var A;let M=(null==(A=this.i18nProvider)?void 0:A.analyze(R).pathname)??R;return!ey.includes(M)}),M=[];for(let D of A)if(this.i18nProvider){let{detectedLocale:A,pathname:q}=this.i18nProvider.analyze(D);M.push(new rC({kind:I.PAGES,pathname:q,page:D,bundlePath:this.normalizers.bundlePath.normalize(D),filename:this.normalizers.filename.normalize(R[D]),i18n:{locale:A}}))}else M.push(new rS({kind:I.PAGES,pathname:D,page:D,bundlePath:this.normalizers.bundlePath.normalize(D),filename:this.normalizers.filename.normalize(R[D])}));return M}}class rR{constructor(R){this.getter=R}load(R){return this.getter(R)}}var rT=__webpack_require__("./lib/trace/tracer"),rk=__webpack_require__("./dist/esm/server/lib/trace/constants.js");class rN{constructor(R){var A;if(this.config=R,!R.locales.length)throw Error("Invariant: No locales provided");this.lowerCaseLocales=R.locales.map(R=>R.toLowerCase()),this.lowerCaseDomains=null==(A=R.domains)?void 0:A.map(R=>{var A;let M=R.domain.toLowerCase();return{defaultLocale:R.defaultLocale.toLowerCase(),hostname:M.split(":")[0],domain:M,locales:null==(A=R.locales)?void 0:A.map(R=>R.toLowerCase()),http:R.http}})}detectDomainLocale(R,A){if(R&&this.lowerCaseDomains&&this.config.domains){A&&(A=A.toLowerCase());for(let D=0;D<this.lowerCaseDomains.length;D++){var M;let I=this.lowerCaseDomains[D];if(I.hostname===R||(null==(M=I.locales)?void 0:M.some(R=>R===A)))return this.config.domains[D]}}}fromQuery(R,A){let M=A.__nextLocale;if(M){let A=this.analyze(R);if(A.detectedLocale){if(A.detectedLocale!==M)throw Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${M}' in '${R}' but found '${A.detectedLocale}'}`);R=A.pathname}}return{pathname:R,detectedLocale:M,inferredFromDefault:"1"===A.__nextInferredLocaleFromDefault}}analyze(R,A={}){let M=A.defaultLocale,D="string"==typeof M,I=R.split("/");if(!I[1])return{detectedLocale:M,pathname:R,inferredFromDefault:D};let q=I[1].toLowerCase(),$=this.lowerCaseLocales.indexOf(q);return $<0?{detectedLocale:M,pathname:R,inferredFromDefault:D}:(M=this.config.locales[$],D=!1,{detectedLocale:M,pathname:R=R.slice(M.length+1)||"/",inferredFromDefault:D})}}function rA(R){let A=new Headers;for(let[M,D]of Object.entries(R)){let R=Array.isArray(D)?D:[D];for(let D of R)void 0!==D&&("number"==typeof D&&(D=D.toString()),A.append(M,D))}return A}function rO(R){var A,M,D,I,q,$=[],H=0;function U(){for(;H<R.length&&/\s/.test(R.charAt(H));)H+=1;return H<R.length}function F(){return"="!==(M=R.charAt(H))&&";"!==M&&","!==M}for(;H<R.length;){for(A=H,q=!1;U();)if(","===(M=R.charAt(H))){for(D=H,H+=1,U(),I=H;H<R.length&&F();)H+=1;H<R.length&&"="===R.charAt(H)?(q=!0,H=I,$.push(R.substring(A,D)),A=H):H=D+1}else H+=1;(!q||H>=R.length)&&$.push(R.substring(A,R.length))}return $}function rM(R){let A={},M=[];if(R)for(let[D,I]of R.entries())"set-cookie"===D.toLowerCase()?(M.push(...rO(I)),A[D]=1===M.length?M[0]:M):A[D]=I;return A}function rL(R){try{return String(new URL(String(R)))}catch(A){throw Error(`URL is malformed "${String(R)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:A})}}async function rj(R,A,M){{var D;A.statusCode=M.status,A.statusMessage=M.statusText,null==(D=M.headers)||D.forEach((R,M)=>{if("set-cookie"===M.toLowerCase())for(let D of rO(R))A.appendHeader(M,D);else A.appendHeader(M,R)});let I=A.originalResponse;M.body&&"HEAD"!==R.method?await tl(M.body,I):I.end()}}var rD=__webpack_require__("./dist/esm/server/web/spec-extension/cookies.js");class rI extends null{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options")}static callable(){throw new rI}}function rq(){return new Response(null,{status:500})}function r$(R,A,M){if(R)for(let q of(M&&(M=M.toLowerCase()),R)){var D,I;let R=null==(D=q.domain)?void 0:D.split(":")[0].toLowerCase();if(A===R||M===q.defaultLocale.toLowerCase()||(null==(I=q.locales)?void 0:I.some(R=>R.toLowerCase()===M)))return q}}function rH(R,A){if(!R.startsWith("/")||!A)return R;let{pathname:M,query:D,hash:I}=tG(R);return""+A+M+D+I}function rU(R,A){if(!R.startsWith("/")||!A)return R;let{pathname:M,query:D,hash:I}=tG(R);return""+M+A+D+I}function rF(R,A,M,D){if(!A||A===M)return R;let I=R.toLowerCase();return!D&&(tX(I,"/api")||tX(I,"/"+A.toLowerCase()))?R:rH(R,"/"+A)}function rB(R){let A=rF(R.pathname,R.locale,R.buildId?void 0:R.defaultLocale,R.ignorePrefix);return(R.buildId||!R.trailingSlash)&&(A=td(A)),R.buildId&&(A=rU(rH(A,"/_next/data/"+R.buildId),"/"===R.pathname?"index.json":".json")),A=rH(A,R.basePath),!R.buildId&&R.trailingSlash?A.endsWith("/")?A:rU(A,"/"):td(A)}Symbol.for("next.mutated.cookies");let rW=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function rz(R,A){return new URL(String(R).replace(rW,"localhost"),A&&String(A).replace(rW,"localhost"))}let rG=Symbol("NextURLInternal");class rX{constructor(R,A,M){let D,I;"object"==typeof A&&"pathname"in A||"string"==typeof A?(D=A,I=M||{}):I=M||A||{},this[rG]={url:rz(R,D??I.base),options:I,basePath:""},this.analyze()}analyze(){var R,A,M,D,I;let q=tJ(this[rG].url.pathname,{nextConfig:this[rG].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[rG].options.i18nProvider}),$=tK(this[rG].url,this[rG].options.headers);this[rG].domainLocale=this[rG].options.i18nProvider?this[rG].options.i18nProvider.detectDomainLocale($):r$(null==(A=this[rG].options.nextConfig)?void 0:null==(R=A.i18n)?void 0:R.domains,$);let H=(null==(M=this[rG].domainLocale)?void 0:M.defaultLocale)||(null==(I=this[rG].options.nextConfig)?void 0:null==(D=I.i18n)?void 0:D.defaultLocale);this[rG].url.pathname=q.pathname,this[rG].defaultLocale=H,this[rG].basePath=q.basePath??"",this[rG].buildId=q.buildId,this[rG].locale=q.locale??H,this[rG].trailingSlash=q.trailingSlash}formatPathname(){return rB({basePath:this[rG].basePath,buildId:this[rG].buildId,defaultLocale:this[rG].options.forceLocale?void 0:this[rG].defaultLocale,locale:this[rG].locale,pathname:this[rG].url.pathname,trailingSlash:this[rG].trailingSlash})}formatSearch(){return this[rG].url.search}get buildId(){return this[rG].buildId}set buildId(R){this[rG].buildId=R}get locale(){return this[rG].locale??""}set locale(R){var A,M;if(!this[rG].locale||!(null==(M=this[rG].options.nextConfig)?void 0:null==(A=M.i18n)?void 0:A.locales.includes(R)))throw TypeError(`The NextURL configuration includes no locale "${R}"`);this[rG].locale=R}get defaultLocale(){return this[rG].defaultLocale}get domainLocale(){return this[rG].domainLocale}get searchParams(){return this[rG].url.searchParams}get host(){return this[rG].url.host}set host(R){this[rG].url.host=R}get hostname(){return this[rG].url.hostname}set hostname(R){this[rG].url.hostname=R}get port(){return this[rG].url.port}set port(R){this[rG].url.port=R}get protocol(){return this[rG].url.protocol}set protocol(R){this[rG].url.protocol=R}get href(){let R=this.formatPathname(),A=this.formatSearch();return`${this.protocol}//${this.host}${R}${A}${this.hash}`}set href(R){this[rG].url=rz(R),this.analyze()}get origin(){return this[rG].url.origin}get pathname(){return this[rG].url.pathname}set pathname(R){this[rG].url.pathname=R}get hash(){return this[rG].url.hash}set hash(R){this[rG].url.hash=R}get search(){return this[rG].url.search}set search(R){this[rG].url.search=R}get password(){return this[rG].url.password}set password(R){this[rG].url.password=R}get username(){return this[rG].url.username}set username(R){this[rG].url.username=R}get basePath(){return this[rG].basePath}set basePath(R){this[rG].basePath=R.startsWith("/")?R:`/${R}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new rX(String(this),this[rG].options)}}class rV extends Error{constructor(){super(`The request.page has been deprecated in favour of \`URLPattern\`.
Read more: https://nextjs.org/docs/messages/middleware-request-page
`)}}class rK extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
`)}}let rJ=Symbol("internal request");class rY extends Request{constructor(R,A={}){let M="string"!=typeof R&&"url"in R?R.url:String(R);rL(M),R instanceof Request?super(R,A):super(M,A);let D=new rX(M,{headers:rM(this.headers),nextConfig:A.nextConfig});this[rJ]={cookies:new rD.q(this.headers),geo:A.geo||{},ip:A.ip,nextUrl:D,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?M:D.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[rJ].cookies}get geo(){return this[rJ].geo}get ip(){return this[rJ].ip}get nextUrl(){return this[rJ].nextUrl}get page(){throw new rV}get ua(){throw new rK}get url(){return this[rJ].url}}function rZ(R){let{errored:A,destroyed:M}=R;if(A||M)return AbortSignal.abort(A);let D=new AbortController;function I(){D.abort(),R.off("finish",q)}function q(){R.off("close",I)}return R.once("close",I),R.once("finish",q),D.signal}class rQ{static fromBaseNextRequest(R,A){return"request"in R&&R.request?rQ.fromWebNextRequest(R):rQ.fromNodeNextRequest(R,A)}static fromNodeNextRequest(R,A){let M,D=null;if("GET"!==R.method&&"HEAD"!==R.method&&R.body&&(D=R.body),R.url.startsWith("http"))M=new URL(R.url);else{let A=ee(R,"__NEXT_INIT_URL");M=A&&A.startsWith("http")?new URL(R.url,A):new URL(R.url,"http://n")}return new rY(M,{body:D,method:R.method,headers:rA(R.headers),duplex:"half",signal:A})}static fromWebNextRequest(R){let A=null;return"GET"!==R.method&&"HEAD"!==R.method&&(A=R.body),new rY(R.url,{body:A,method:R.method,headers:rA(R.headers),duplex:"half",signal:R.request.signal})}}let r0=tg("/_next/data/:path*");function r1(R){return"string"==typeof R&&r0(R)}function r2(R,A){return void 0===A&&(A=""),R=R.replace(/\\/g,"/"),(R=A&&R.endsWith(A)?R.slice(0,-A.length):R).startsWith("/index/")&&!tt(R)?R=R.slice(6):"/index"===R&&(R="/"),R}tA.H4;let r4=["x-invoke-path","x-invoke-status","x-invoke-error","x-invoke-query","x-invoke-output","x-middleware-invoke"];function r8(R){for(let A of r4)delete R[A]}class r5 extends Error{}class r3 extends Error{constructor(R){super(),this.innerError=R}}class r6{constructor(R){var A,M,D;this.prepared=!1,this.preparedPromise=null,this.customErrorNo404Warn=(0,X.gf)(()=>{eX(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:I=".",quiet:q=!1,conf:$,dev:H=!1,minimalMode:U=!1,customServer:F=!0,hostname:B,port:W}=R;this.serverOptions=R,this.isRenderWorker=R._renderWorker,this.dir=__webpack_require__("path").resolve(I),this.quiet=q,this.loadEnvConfig({dev:H}),this.nextConfig=$,this.hostname=B,this.hostname&&(this.fetchHostname=e3(this.hostname)),this.port=W,this.distDir=__webpack_require__("path").join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!U&&this.getHasStaticDir(),this.i18nProvider=(null==(A=this.nextConfig.i18n)?void 0:A.locales)?new rN(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new tY(this.i18nProvider):void 0;let{serverRuntimeConfig:z={},publicRuntimeConfig:G,assetPrefix:V,generateEtags:K}=this.nextConfig;this.buildId=this.getBuildId();let J="minimalMode";this[J]=U||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.hasAppDir=this.getHasAppDir(H);let Y=this.hasAppDir;this.nextFontManifest=this.getNextFontManifest(),this.nextConfig.experimental.deploymentId&&(process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.experimental.deploymentId),this.renderOpts={deploymentId:this.nextConfig.experimental.deploymentId,strictNextHead:!!this.nextConfig.experimental.strictNextHead,poweredByHeader:this.nextConfig.poweredByHeader,canonicalBase:this.nextConfig.amp.canonicalBase||"",buildId:this.buildId,generateEtags:K,previewProps:this.getPrerenderManifest().preview,customServer:!0===F||void 0,ampOptimizerConfig:null==(M=this.nextConfig.experimental.amp)?void 0:M.optimizer,basePath:this.nextConfig.basePath,images:this.nextConfig.images,optimizeFonts:this.nextConfig.optimizeFonts,fontManifest:this.nextConfig.optimizeFonts&&!H?this.getFontManifest():void 0,optimizeCss:this.nextConfig.experimental.optimizeCss,nextConfigOutput:this.nextConfig.output,nextScriptWorkers:this.nextConfig.experimental.nextScriptWorkers,disableOptimizedLoading:this.nextConfig.experimental.disableOptimizedLoading,domainLocales:null==(D=this.nextConfig.i18n)?void 0:D.domains,distDir:this.distDir,serverComponents:Y,crossOrigin:this.nextConfig.crossOrigin?this.nextConfig.crossOrigin:void 0,largePageDataBytes:this.nextConfig.experimental.largePageDataBytes,runtimeConfig:Object.keys(G).length>0?G:void 0},(0,tr.setConfig)({serverRuntimeConfig:z,publicRuntimeConfig:G}),this.pagesManifest=this.getPagesManifest(),this.appPathsManifest=this.getAppPathsManifest(),this.appPathRoutes=this.getAppPathRoutes(),this.matchers=this.getRouteMatchers(),this.matchers.reload(),this.setAssetPrefix(V),this.responseCache=this.getResponseCache({dev:H})}reloadMatchers(){return this.matchers.reload()}async handleNextDataRequest(R,A,M){let D=this.getMiddleware(),I=r1(M.pathname);if(!I||!I.path)return{finished:!1};if(I.path[0]!==this.buildId)return R.headers["x-middleware-invoke"]?{finished:!1}:(await this.render404(R,A,M),{finished:!0});I.path.shift();let q=I.path[I.path.length-1];if("string"!=typeof q||!q.endsWith(".json"))return await this.render404(R,A,M),{finished:!0};let $=`/${I.path.join("/")}`;if($=r2($,".json"),D&&(this.nextConfig.trailingSlash&&!$.endsWith("/")&&($+="/"),!this.nextConfig.trailingSlash&&$.length>1&&$.endsWith("/")&&($=$.substring(0,$.length-1))),this.i18nProvider){var H;let I=null==R?void 0:null==(H=R.headers.host)?void 0:H.split(":")[0].toLowerCase(),q=this.i18nProvider.detectDomainLocale(I),U=(null==q?void 0:q.defaultLocale)??this.i18nProvider.config.defaultLocale,F=this.i18nProvider.analyze($);if(F.detectedLocale&&($=F.pathname),M.query.__nextLocale=F.detectedLocale,M.query.__nextDefaultLocale=U,F.detectedLocale||delete M.query.__nextInferredLocaleFromDefault,!F.detectedLocale&&!D)return M.query.__nextLocale=U,await this.render404(R,A,M),{finished:!0}}return M.pathname=$,M.query.__nextDataReq="1",{finished:!1}}async handleNextImageRequest(R,A,M){return{finished:!1}}async handleCatchallRenderRequest(R,A,M){return{finished:!1}}async handleCatchallMiddlewareRequest(R,A,M){return{finished:!1}}getRouteMatchers(){let R=new rR(R=>{switch(R){case eo:return this.getPagesManifest()??null;case el:return this.getAppPathsManifest()??null;default:return null}}),A=new t5;return A.push(new rP(this.distDir,R,this.i18nProvider)),A.push(new rE(this.distDir,R,this.i18nProvider)),this.hasAppDir&&(A.push(new rp(this.distDir,R)),A.push(new rg(this.distDir,R))),A}logError(R){this.quiet||console.error(R)}async handleRequest(R,A,M){await this.prepare();let D=R.method.toUpperCase();return(0,rT.getTracer)().trace(rk._J.handleRequest,{spanName:`${D} ${R.url}`,kind:rT.SpanKind.SERVER,attributes:{"http.method":D,"http.target":R.url}},async I=>this.handleRequestImpl(R,A,M).finally(()=>{if(!I)return;I.setAttributes({"http.status_code":A.statusCode});let R=(0,rT.getTracer)().getRootSpanAttributes();if(!R)return;if(R.get("next.span_type")!==rk._J.handleRequest){console.warn(`Unexpected root span type '${R.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);return}let M=R.get("next.route");if(M){let R=`${D} ${M}`;I.setAttributes({"next.route":M,"http.route":M,"next.span_name":R}),I.updateName(R)}}))}async handleRequestImpl(R,A,M){try{var D,I,q,$,H,U;await this.matchers.waitTillReady();let F=A.originalResponse||A,B=F.setHeader.bind(F);F.setHeader=(A,M)=>{if(!F.headersSent){if("set-cookie"===A.toLowerCase()){let A=ee(R,"_nextMiddlewareCookie");A&&Array.isArray(M)&&M.every((R,M)=>R===A[M])||(M=[...new Set([...A||[],..."string"==typeof M?[M]:Array.isArray(M)?M:[]])])}return B(A,M)}};let W=(R.url||"").split("?"),z=W[0];if(null==z?void 0:z.match(/(\\|\/\/)/)){let M=(0,X.U3)(R.url);A.redirect(M,308).body(M).send();return}if(M&&"object"==typeof M||(M=(0,e0.parse)(R.url,!0)),"string"==typeof M.query&&(M.query=Object.fromEntries(new URLSearchParams(M.query))),R.url.endsWith(".rsc"))M.query.__nextDataReq="1";else if(R.headers["x-now-route-matches"])for(let A of tA.vu)delete R.headers[A.toString().toLowerCase()];R.url=tU(R.url,this.hasAppDir),M.pathname=tU(M.pathname||"",this.hasAppDir),this.attachRequestMeta(R,M);let G=null==(D=this.i18nProvider)?void 0:D.detectDomainLocale(tK(M,R.headers)),V=(null==G?void 0:G.defaultLocale)||(null==(I=this.nextConfig.i18n)?void 0:I.defaultLocale);M.query.__nextDefaultLocale=V;let K=e$(R.url.replace(/^\/+/,"/")),J=tJ(K.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});K.pathname=J.pathname,J.basePath&&(R.url=tV(R.url,this.nextConfig.basePath),er(R,"_nextHadBasePath",!0));let Y="string"==typeof R.headers["x-matched-path"];if(Y)try{this.hasAppDir&&(R.url.match(/^\/index($|\?)/)&&(R.url=R.url.replace(/^\/index/,"/")),M.pathname="/index"===M.pathname?"/":M.pathname);let D=tU(new URL(R.headers["x-matched-path"],"http://localhost").pathname,this.hasAppDir),I=new URL(R.url,"http://localhost").pathname;I.startsWith("/_next/data/")&&(M.query.__nextDataReq="1");let U=this.stripNextDataPath(I);D=this.stripNextDataPath(D,!1);let F=null==(q=this.i18nProvider)?void 0:q.analyze(D,{defaultLocale:V});F&&(M.query.__nextLocale=F.detectedLocale,F.inferredFromDefault?M.query.__nextInferredLocaleFromDefault="1":delete M.query.__nextInferredLocaleFromDefault);let B=D=tc(D),W=await this.matchers.match(D,{i18n:F});W&&(B=W.definition.pathname);let z=void 0!==(null==W?void 0:W.params);F&&(D=F.pathname);let G=tW({pageIsDynamic:z,page:B,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==($=this.getRoutesManifest())?void 0:$.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});V&&!J.locale&&(M.pathname=`/${V}${M.pathname}`);let X=M.pathname,Y=G.handleRewrites(R,M),Z=Object.keys(Y),Q=X!==M.pathname;Q&&(er(R,"_nextRewroteUrl",M.pathname),er(R,"_nextDidRewrite",!0));let ee=new Set;for(let R of Object.keys(M.query)){let A=M.query[R];if(R!==e9.dN&&R.startsWith(e9.dN)){let D=R.substring(e9.dN.length);M.query[D]=A,ee.add(D),delete M.query[R]}}if(z){let A={},I=G.normalizeDynamicRouteParams(M.query);if(!I.hasValidParams&&z&&!tt(U)){let R=null==G.dynamicRouteMatcher?void 0:G.dynamicRouteMatcher.call(G,U);R&&(G.normalizeDynamicRouteParams(R),Object.assign(I.params,R),I.hasValidParams=!0)}if(I.hasValidParams&&(A=I.params),R.headers["x-now-route-matches"]&&tt(D)&&!I.hasValidParams){let D={},q=G.getParamsFromRouteMatches(R,D,M.query.__nextLocale||"");D.locale&&(M.query.__nextLocale=D.locale,delete M.query.__nextInferredLocaleFromDefault),(I=G.normalizeDynamicRouteParams(q,!0)).hasValidParams&&(A=I.params)}z&&G.defaultRouteMatches&&U===B&&!I.hasValidParams&&!G.normalizeDynamicRouteParams({...A},!0).hasValidParams&&(A=G.defaultRouteMatches),A&&(D=G.interpolateDynamicPath(B,A),R.url=G.interpolateDynamicPath(R.url,A))}for(let A of((z||Q)&&G.normalizeVercelUrl(R,!0,[...Z,...Object.keys((null==(H=G.defaultRouteRegex)?void 0:H.groups)||{})]),ee))delete M.query[A];M.pathname=D,K.pathname=M.pathname;let et=await this.handleNextDataRequest(R,A,M);if(et.finished)return}catch(M){if(M instanceof X._9||M instanceof X.KM)return A.statusCode=400,this.renderError(null,R,A,"/_error",{});throw M}if(er(R,"__nextIsLocaleDomain",!!G),J.locale&&(R.url=(0,e0.format)(K),er(R,"__nextStrippedLocale",!0)),!M.query.__nextLocale&&(J.locale?M.query.__nextLocale=J.locale:V&&(M.query.__nextLocale=V,M.query.__nextInferredLocaleFromDefault="1")),!this.serverOptions.webServerConfig&&!ee(R,"_nextIncrementalCache")){let A="https:";try{let M=new URL(ee(R,"__NEXT_INIT_URL")||"/","http://n");A=M.protocol}catch{}let M=this.getIncrementalCache({requestHeaders:Object.assign({},R.headers),requestProtocol:A.substring(0,A.length-1)});er(R,"_nextIncrementalCache",M),globalThis.__incrementalCache=M}let Z=R.headers["x-invoke-path"],Q=!Y&&Z;if(Q){if(R.headers["x-invoke-status"]){let D=R.headers["x-invoke-query"];"string"==typeof D&&Object.assign(M.query,JSON.parse(decodeURIComponent(D))),A.statusCode=Number(R.headers["x-invoke-status"]);let I=null;if("string"==typeof R.headers["x-invoke-error"]){let A=JSON.parse(R.headers["x-invoke-error"]||"{}");I=Error(A.message)}return this.renderError(I,R,A,"/_error",M.query)}let D=new URL(Z||"/","http://n"),I=tJ(D.pathname,{nextConfig:this.nextConfig,parseData:!1});I.locale&&(M.query.__nextLocale=I.locale),M.pathname!==D.pathname&&(M.pathname=D.pathname,er(R,"_nextRewroteUrl",I.pathname),er(R,"_nextDidRewrite",!0));let q=tf(tV(M.pathname,this.nextConfig.basePath||""),(null==(U=this.nextConfig.i18n)?void 0:U.locales)||[]);for(let R of(q.detectedLocale&&(M.query.__nextLocale=q.detectedLocale),M.pathname=q.pathname,Object.keys(M.query)))R.startsWith("__next")||R.startsWith("_next")||delete M.query[R];let $=R.headers["x-invoke-query"];if("string"==typeof $&&Object.assign(M.query,JSON.parse(decodeURIComponent($))),M.pathname.startsWith("/_next/image")){let D=await this.handleNextImageRequest(R,A,M);if(D.finished)return}let H=await this.handleNextDataRequest(R,A,M);if(H.finished)return;await this.handleCatchallRenderRequest(R,A,M);return}if(R.headers["x-middleware-invoke"]){let D=await this.handleNextDataRequest(R,A,M);if(D.finished)return;let I=await this.handleCatchallMiddlewareRequest(R,A,M);if(I.finished)return;{let R=Error();throw R.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},R.bubble=!0,R}}return!(Y||Q)&&J.basePath&&(M.pathname=tV(M.pathname,J.basePath)),A.statusCode=200,await this.run(R,A,M)}catch(M){if(M instanceof r5)throw M;if(M&&"object"==typeof M&&"ERR_INVALID_URL"===M.code||M instanceof X._9||M instanceof X.KM)return A.statusCode=400,this.renderError(null,R,A,"/_error",{});throw M}}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(R){this.renderOpts.assetPrefix=R?R.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return null===this.preparedPromise&&(this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async close(){}getAppPathRoutes(){let R={};return Object.keys(this.appPathsManifest||{}).forEach(A=>{let M=tH(A);R[M]||(R[M]=[]),R[M].push(A)}),R}async run(R,A,M){return(0,rT.getTracer)().trace(rk._J.run,async()=>this.runImpl(R,A,M))}async runImpl(R,A,M){await this.handleCatchallRenderRequest(R,A,M)}async pipe(R,A){return(0,rT.getTracer)().trace(rk._J.pipe,async()=>this.pipeImpl(R,A))}async pipeImpl(R,A){let M=tn(A.req.headers["user-agent"]||""),D={...A,renderOpts:{...this.renderOpts,supportsDynamicHTML:!M,isBot:!!M}},I=await R(D);if(null===I)return;let{req:q,res:$}=D,{body:H,type:U,revalidateOptions:F}=I;if(!$.sent){let{generateEtags:R,poweredByHeader:A,dev:M}=this.renderOpts;return M&&$.setHeader("Cache-Control","no-store, must-revalidate"),this.sendRenderResult(q,$,{result:H,type:U,generateEtags:R,poweredByHeader:A,options:F})}}async getStaticHTML(R,A){let M={...A,renderOpts:{...this.renderOpts,supportsDynamicHTML:!1}},D=await R(M);return null===D?null:D.body.toUnchunkedString()}async render(R,A,M,D={},I,q=!1){return(0,rT.getTracer)().trace(rk._J.render,async()=>this.renderImpl(R,A,M,D,I,q))}async renderImpl(R,A,M,D={},I,q=!1){return(M.startsWith("/")||console.warn(`Cannot render page with path "${M}", did you mean "/${M}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.renderOpts.customServer&&"/index"===M&&!await this.hasPage("/index")&&(M="/"),ti(M))?this.render404(R,A,I):this.pipe(R=>this.renderToResponse(R),{req:R,res:A,pathname:M,query:D})}async getStaticPaths({pathname:R}){var A;let M=null==(A=this.getPrerenderManifest().dynamicRoutes[R])?void 0:A.fallback;return{staticPaths:void 0,fallbackMode:"string"==typeof M?"static":null===M?"blocking":M}}async renderToResponseWithComponents(R,A){return(0,rT.getTracer)().trace(rk._J.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(R,A))}stripInternalHeaders(R){(!process.env.__NEXT_TEST_MODE||"1"!==process.env.__NEXT_NO_STRIP_INTERNAL_HEADERS)&&(r8(R.headers),"originalRequest"in R&&"headers"in R.originalRequest&&r8(R.originalRequest.headers))}async renderToResponseWithComponentsImpl({req:R,res:A,pathname:M,renderOpts:D},{components:q,query:$}){var H,U,F,B,W;let z,G;let V="/404"===M;this.stripInternalHeaders(R);let K="/500"===M,J=!0===q.isAppPath,Y=!!q.getServerSideProps,Z=!!q.getStaticPaths,Q=R.headers[tA.om.toLowerCase()],et=R.headers["content-type"],er="POST"===R.method&&(null==et?void 0:et.startsWith("multipart/form-data")),es=void 0!==Q&&"string"==typeof Q&&"POST"===R.method,ei=es||er,en=!!(null==(H=q.Component)?void 0:H.getInitialProps),ea=!!q.getStaticProps,eo=(0,e0.parse)(R.url||"").pathname||"/",el=ee(R,"_nextRewroteUrl")||eo,eh=!1,ed=tt(q.page);if(J&&ed){let A=await this.getStaticPaths({pathname:M,page:q.page,isAppPath:J,requestHeaders:R.headers});if(z=A.staticPaths,eh=void 0!==(G=A.fallbackMode),"export"===this.nextConfig.output){let R=q.page;if("static"!==G)throw Error(`Page "${R}" is missing exported function "generateStaticParams()", which is required with "output: export" config.`);let A=td(el);if(!(null==z?void 0:z.includes(A)))throw Error(`Page "${R}" is missing param "${A}" in "generateStaticParams()", which is required with "output: export" config.`)}eh&&(Z=!0)}if(eh||(null==z?void 0:z.includes(el))||R.headers["x-now-route-matches"])ea=!0;else{let R=this.getPrerenderManifest();ea=ea||!!R.routes["/index"===M?"/":M]}let eu=!!($.__nextDataReq||R.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(ea||Y);if(!ea&&R.headers["x-middleware-prefetch"]&&!(V||"/_error"===M))return A.setHeader("x-middleware-skip","1"),A.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),A.body("{}").send(),null;delete $.__nextDataReq,ea&&R.headers["x-matched-path"]&&R.url.startsWith("/_next/data")&&(R.url=this.stripNextDataPath(R.url)),R.headers["x-nextjs-data"]&&(!A.statusCode||200===A.statusCode)&&A.setHeader("x-nextjs-matched-path",`${$.__nextLocale?`/${$.__nextLocale}`:""}${M}`);let ec=!!R.headers[tA.i4.toLowerCase()];if(!J&&ec&&A.setHeader("vary",tA.Am),!V||eu||ec||(A.statusCode=404),eP.includes(M)&&(A.statusCode=parseInt(M.slice(1),10)),!ei&&!V&&!K&&"/_error"!==M&&"HEAD"!==R.method&&"GET"!==R.method&&("string"==typeof q.Component||ea))return A.statusCode=405,A.setHeader("Allow",["GET","HEAD"]),await this.renderError(null,R,A,M),null;if("string"==typeof q.Component)return{type:"html",body:th.fromStatic(q.Component)};if($.amp||delete $.amp,!0===D.supportsDynamicHTML){let A=tn(R.headers["user-agent"]||""),M="function"!=typeof(null==(B=q.Document)?void 0:B.getInitialProps)||ex in q.Document;D.supportsDynamicHTML=!ea&&!A&&!$.amp&&M,D.isBot=A}!eu&&J&&D.dev&&!1===D.supportsDynamicHTML&&(D.supportsDynamicHTML=!0);let ep=ea?null==(U=this.nextConfig.i18n)?void 0:U.defaultLocale:$.__nextDefaultLocale,ef=$.__nextLocale,em=null==(F=this.nextConfig.i18n)?void 0:F.locales,eg=!1;if(Y||ea){let{tryGetPreviewData:M}=__webpack_require__("./dist/esm/server/api-utils/node.js");eg=!1!==M(R,A,this.renderOpts.previewProps)}if(J&&(A.setHeader("vary",tA.Am),!eg&&ea&&R.headers[tA.i4.toLowerCase()]&&(!e7(D.runtime)||this.serverOptions.webServerConfig)))for(let A of tA.vu)delete R.headers[A.toString().toLowerCase()];let ev=!1,ey=!1;ea&&({isOnDemandRevalidate:ev,revalidateOnlyGenerated:ey}=(0,eT.Iq)(R,this.renderOpts.previewProps)),ea&&R.headers["x-matched-path"]&&(el=eo),eo=td(eo),el=td(el),this.localeNormalizer&&(el=this.localeNormalizer.normalize(el));let e_=R=>{let M={destination:R.pageProps.__N_REDIRECT,statusCode:R.pageProps.__N_REDIRECT_STATUS,basePath:R.pageProps.__N_REDIRECT_BASE_PATH},D=e6(M),{basePath:I}=this.nextConfig;I&&!1!==M.basePath&&M.destination.startsWith("/")&&(M.destination=`${I}${M.destination}`),M.destination.startsWith("/")&&(M.destination=(0,X.U3)(M.destination)),A.redirect(M.destination,D).body(M.destination).send()};eu&&(el=this.stripNextDataPath(el),eo=this.stripNextDataPath(eo));let ew=eg||!ea||D.supportsDynamicHTML||ei?null:`${ef?`/${ef}`:""}${("/"===M||"/"===el)&&ef?"":el}${$.amp?".amp":""}`;(V||K)&&ea&&(ew=`${ef?`/${ef}`:""}${M}${$.amp?".amp":""}`),ew&&(ew="/index"===(ew=ew.split("/").map(R=>{try{R=tp(decodeURIComponent(R),!0)}catch(R){throw new X._9("failed to decode param")}return R}).join("/"))&&"/"===M?"/":ew);let eb="https:";try{let A=new URL(ee(R,"__NEXT_INIT_URL")||"/","http://n");eb=A.protocol}catch{}let eE=globalThis.__incrementalCache||this.getIncrementalCache({requestHeaders:Object.assign({},R.headers),requestProtocol:eb.substring(0,eb.length-1)}),eS=async()=>{var H,U,F,B;let W,z;let G=!eu&&D.dev||!(ea||Z),X=(0,e0.parse)(R.url||"",!0).query;D.params&&Object.keys(D.params).forEach(R=>{delete X[R]});let K="/"!==eo&&this.nextConfig.trailingSlash,Q=(0,e0.format)({pathname:`${el}${K?"/":""}`,query:X}),ee={...q,...D,...J?{incrementalCache:eE,isRevalidate:ea,originalPathname:q.ComponentMod.originalPathname,serverActionsBodySizeLimit:this.nextConfig.experimental.serverActionsBodySizeLimit}:{},isDataReq:eu,resolvedUrl:Q,locale:ef,locales:em,defaultLocale:ep,resolvedAsPath:Y||en?(0,e0.format)({pathname:`${eo}${K?"/":""}`,query:X}):Q,supportsDynamicHTML:G,isOnDemandRevalidate:ev,isDraftMode:eg,isServerAction:ei};if((null==(H=q.routeModule)?void 0:H.definition.kind)===I.APP_ROUTE){let M=q.routeModule,I={params:D.params,prerenderManifest:this.getPrerenderManifest(),staticGenerationContext:{originalPathname:q.ComponentMod.originalPathname,supportsDynamicHTML:G,incrementalCache:eE,isRevalidate:ea}};try{let D=rQ.fromBaseNextRequest(R,rZ(A.originalResponse)),q=await M.handle(D,I);R.fetchMetrics=I.staticGenerationContext.fetchMetrics;let $=I.staticGenerationContext.fetchTags;if(ea){let R=await q.blob();W=rM(q.headers),$&&(W[e9.Et]=$),!W["content-type"]&&R.type&&(W["content-type"]=R.type);let A=(null==(B=I.staticGenerationContext.store)?void 0:B.revalidate)??!1,M={value:{kind:"ROUTE",status:q.status,body:Buffer.from(await R.arrayBuffer()),headers:W},revalidate:A};return M}return await rj(R,A,q),null}catch(M){if(ea)throw M;return eG(M),await rj(R,A,rq()),null}}else if((null==(U=q.routeModule)?void 0:U.definition.kind)===I.PAGES){let I=q.routeModule;ee.nextFontManifest=this.nextFontManifest,ee.clientReferenceManifest=q.clientReferenceManifest,z=await I.render(R.originalRequest??R,A.originalResponse??A,{page:M,params:D.params,query:$,renderOpts:ee})}else if((null==(F=q.routeModule)?void 0:F.definition.kind)===I.APP_PAGE){let I=R.headers[tA.pz.toLowerCase()];if(I&&ew)try{let R=await this.getPrefetchRsc(ew);if(R)return A.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),A.setHeader("content-type",tA.eY),A.body(R).send(),null}catch(R){}let H=q.routeModule;ee.nextFontManifest=this.nextFontManifest,z=await H.render(R.originalRequest??R,A.originalResponse??A,{page:V?"/404":M,params:D.params,query:$,renderOpts:ee})}else z=await this.renderHTML(R,A,M,$,ee);let{metadata:et}=z,er=et.fetchTags;if(er&&(W={[e9.Et]:er}),R.fetchMetrics=et.fetchMetrics,J&&ea&&0===et.revalidate){let R=et.staticBailoutInfo||{},A=Error(`Page changed from static to dynamic at runtime ${eo}${R.description?`, reason: ${R.description}`:""}
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);if(R.stack){let M=R.stack;A.stack=A.message+M.substring(M.indexOf("\n"))}throw A}return et.isNotFound?{value:null,revalidate:et.revalidate}:et.isRedirect?{value:{kind:"REDIRECT",props:et.pageData},revalidate:et.revalidate}:z.isNull?null:{value:{kind:"PAGE",html:z,pageData:et.pageData,headers:W,status:J?A.statusCode:void 0},revalidate:et.revalidate}},eC=await this.responseCache.get(ew,async(I,H)=>{I||A.sent,z||({staticPaths:z,fallbackMode:G}=Z?await this.getStaticPaths({pathname:M,requestHeaders:R.headers,isAppPath:J,page:q.page}):{staticPaths:void 0,fallbackMode:!1}),"static"===G&&tn(R.headers["user-agent"]||"")&&(G="blocking"),(null==H?void 0:H.isStale)===-1&&(ev=!0),ev&&(!1!==G||H)&&(G="blocking");let U=ew??(D.dev&&J?el:null);U&&$.amp&&(U=U.replace(/\.amp$/,"")),U&&(null==z||z.includes(U));let F=await eS();return F?{...F,revalidate:void 0!==F.revalidate?F.revalidate:1}:null},{incrementalCache:eE,isOnDemandRevalidate:ev,isPrefetch:"prefetch"===R.headers.purpose});if(!eC){if(ew&&!(ev&&ey))throw Error("invariant: cache entry required but not generated");return null}let{revalidate:eR,value:ek}=eC,eN=void 0!==eR?{private:eg||V&&ek,stateful:!ea,revalidate:eR}:void 0;if(ek){if("REDIRECT"===ek.kind)return(eN&&(0,ts.l)(A,eN),eu)?{type:"json",body:th.fromStatic(JSON.stringify(ek.props)),revalidateOptions:eN}:(await e_(ek.props),null);if("IMAGE"===ek.kind)throw Error("invariant SSG should not return an image cache value");if("ROUTE"===ek.kind){let M={...ek.headers};return ea||delete M[e9.Et],await rj(R,A,new Response(ek.body,{headers:rA(M),status:ek.status||200})),null}if(J){if(ea&&(null==(W=ek.headers)?void 0:W[e9.Et])&&A.setHeader(e9.Et,ek.headers[e9.Et]),eu&&"string"!=typeof ek.pageData)throw Error("invariant: Expected pageData to be a string for app data request but received "+typeof ek.pageData+". This is a bug in Next.js.");return ek.status&&(A.statusCode=ek.status),{type:eu?"rsc":"html",body:eu?th.fromStatic(ek.pageData):ek.html,revalidateOptions:eN}}return{type:eu?"json":"html",body:eu?th.fromStatic(JSON.stringify(ek.pageData)):ek.html,revalidateOptions:eN}}return(eN&&(0,ts.l)(A,eN),eu)?(A.statusCode=404,A.body('{"notFound":true}').send()):await this.render404(R,A,{pathname:M,query:$},!1),null}stripNextDataPath(R,A=!0){if(R.includes(this.buildId)){let A=R.substring(R.indexOf(this.buildId)+this.buildId.length);R=tc(A.replace(/\.json$/,""))}return this.localeNormalizer&&A?this.localeNormalizer.normalize(R):R}getOriginalAppPaths(R){if(this.hasAppDir){var A;let M=null==(A=this.appPathRoutes)?void 0:A[R];return M||null}return null}async renderPageComponent(R,A){var M;let{query:D,pathname:I}=R,q=this.getOriginalAppPaths(I),$=Array.isArray(q),H=I;$&&(H=q[q.length-1]);let U=await this.findPageComponents({page:H,query:D,params:R.renderOpts.params||{},isAppPath:$,sriEnabled:!!(null==(M=this.nextConfig.experimental.sri)?void 0:M.algorithm),appPaths:q,shouldEnsure:!1});if(U)try{return await this.renderToResponseWithComponents(R,U)}catch(M){let R=M instanceof r5;if(!R||R&&A)throw M}return!1}async renderToResponse(R){return(0,rT.getTracer)().trace(rk._J.renderToResponse,{spanName:"rendering page",attributes:{"next.route":R.pathname}},async()=>this.renderToResponseImpl(R))}async renderToResponseImpl(R){var A;let{res:M,query:D,pathname:I}=R,q=I,$=!!D._nextBubbleNoFallback;delete D[tA.H4],delete D._nextBubbleNoFallback;let H={i18n:null==(A=this.i18nProvider)?void 0:A.fromQuery(I,D)};try{for await(let A of this.matchers.matchAll(I,H)){R.req.headers["x-invoke-output"];let M=await this.renderPageComponent({...R,pathname:A.definition.pathname,renderOpts:{...R.renderOpts,params:A.params}},$);if(!1!==M)return M}if(this.serverOptions.webServerConfig){R.pathname=this.serverOptions.webServerConfig.page;let A=await this.renderPageComponent(R,$);if(!1!==A)return A}}catch(H){let A=(0,tz.S)(H);if(H instanceof X.At)throw console.error("Invariant: failed to load static page",JSON.stringify({page:q,url:R.req.url,matchedPath:R.req.headers["x-matched-path"],initUrl:ee(R.req,"__NEXT_INIT_URL"),didRewrite:ee(R.req,"_nextDidRewrite"),rewroteUrl:ee(R.req,"_nextRewroteUrl")},null,2)),A;if(A instanceof r5&&$)throw A;if(A instanceof X._9||A instanceof X.KM)return M.statusCode=400,await this.renderErrorToResponse(R,A);M.statusCode=500,await this.hasPage("/500")&&(R.query.__nextCustomErrorRender="1",await this.renderErrorToResponse(R,A),delete R.query.__nextCustomErrorRender);let D=A instanceof r3;if(!D)throw(0,tz.Z)(A)&&(A.page=q),A;let I=await this.renderErrorToResponse(R,D?A.innerError:A);return I}return this.getMiddleware()&&R.req.headers["x-nextjs-data"]&&(!M.statusCode||200===M.statusCode||404===M.statusCode)?(M.setHeader("x-nextjs-matched-path",`${D.__nextLocale?`/${D.__nextLocale}`:""}${I}`),M.statusCode=200,M.setHeader("content-type","application/json"),M.body("{}"),M.send(),null):(M.statusCode=404,this.renderErrorToResponse(R,null))}async renderToHTML(R,A,M,D={}){return(0,rT.getTracer)().trace(rk._J.renderToHTML,async()=>this.renderToHTMLImpl(R,A,M,D))}async renderToHTMLImpl(R,A,M,D={}){return this.getStaticHTML(R=>this.renderToResponse(R),{req:R,res:A,pathname:M,query:D})}async renderError(R,A,M,D,I={},q=!0){return(0,rT.getTracer)().trace(rk._J.renderError,async()=>this.renderErrorImpl(R,A,M,D,I,q))}async renderErrorImpl(R,A,M,D,I={},q=!0){return q&&M.setHeader("Cache-Control","no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async A=>{let D=await this.renderErrorToResponse(A,R);if(500===M.statusCode)throw R;return D},{req:A,res:M,pathname:D,query:I})}async renderErrorToResponse(R,A){return(0,rT.getTracer)().trace(rk._J.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(R,A))}async renderErrorToResponseImpl(R,A){let{res:M,query:D}=R;try{let I=null,q=404===M.statusCode,$=!1;q&&(this.hasAppDir&&(I=await this.findPageComponents({page:"/_not-found",query:D,params:{},isAppPath:!0,shouldEnsure:!0}),$=null!==I),!I&&await this.hasPage("/404")&&(I=await this.findPageComponents({page:"/404",query:D,params:{},isAppPath:!1,shouldEnsure:!0}),$=null!==I));let H=`/${M.statusCode}`;if(!R.query.__nextCustomErrorRender&&!I&&eP.includes(H)&&(I=await this.findPageComponents({page:H,query:D,params:{},isAppPath:!1,shouldEnsure:!0})),I||(I=await this.findPageComponents({page:"/_error",query:D,params:{},isAppPath:!1,shouldEnsure:!0}),H="/_error"),!I)throw new r3(Error("missing required error components"));I.components.routeModule?er(R.req,"_nextMatch",{definition:I.components.routeModule.definition,params:void 0}):es(R.req,"_nextMatch");try{return await this.renderToResponseWithComponents({...R,pathname:H,renderOpts:{...R.renderOpts,err:A}},I)}catch(R){if(R instanceof r5)throw Error("invariant: failed to render error page");throw R}}catch($){let A=(0,tz.S)($),I=A instanceof r3;I||this.logError(A),M.statusCode=500;let q=await this.getFallbackErrorComponents();if(q)return er(R.req,"_nextMatch",{definition:q.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...R,pathname:"/_error",renderOpts:{...R.renderOpts,err:I?A.innerError:A}},{query:D,components:q});return{type:"html",body:th.fromStatic("Internal Server Error")}}}async renderErrorToHTML(R,A,M,D,I={}){return this.getStaticHTML(A=>this.renderErrorToResponse(A,R),{req:A,res:M,pathname:D,query:I})}async render404(R,A,M,D=!0){let{pathname:I,query:q}=M||(0,e0.parse)(R.url,!0);return this.nextConfig.i18n&&(q.__nextLocale||=this.nextConfig.i18n.defaultLocale,q.__nextDefaultLocale||=this.nextConfig.i18n.defaultLocale),A.statusCode=404,this.renderError(null,R,A,I,q,D)}}var r9=__webpack_require__("./dist/compiled/lru-cache/index.js"),r7=__webpack_require__.n(r9);let se=new Map;function st(R,A=!0){let M=A&&se.get(R);if(M)return M;let D=JSON.parse((0,K.readFileSync)(R,"utf8"));return A&&se.set(R,D),D}let sr=!1,ss=sr?null:new(r7())({max:1e3});function si(R,A,M,D){let I;let q=`${R}:${A}:${M}:${D}`,$=null==ss?void 0:ss.get(q);if($)return $;let H=Z().join(A,eg);D&&(I=st(Z().join(H,el),!sr));let U=st(Z().join(H,eo),!sr);try{R=tc(rr(R))}catch(A){throw console.error(A),new X.GP(R)}let F=A=>{let D=A[R];if(!A[D]&&M){let I={};for(let R of Object.keys(A))I[tf(R,M).pathname]=U[R];D=I[R]}return D};return(I&&($=F(I)),$||($=F(U)),$)?($=Z().join(H,$),null==ss||ss.set(q,$),$):(null==ss||ss.set(q,null),null)}function sn(R,A,M,D){let I=si(R,A,M,D);if(!I)throw new X.GP(R);return I}function sa(R,A,M){let D=sn(R,A,void 0,M);if(D.endsWith(".html"))return K.promises.readFile(D,"utf8").catch(A=>{throw new X.At(R,A.message)});try{process.env.__NEXT_PRIVATE_RUNTIME_TYPE=M?"app":"pages";let R=require(D);return R}finally{process.env.__NEXT_PRIVATE_RUNTIME_TYPE=""}}function so(R){let A=Z().join(R,eg),M=st(Z().join(A,em));return M}var sl=__webpack_require__("./dist/esm/lib/interop-default.js");async function sh(R){return new Promise(A=>setTimeout(A,R))}async function sd(R,A=3){for(;;)try{return st(R)}catch(R){if(--A<=0)throw R;await sh(100)}}async function su(R,A){require(R);try{return globalThis.__RSC_MANIFEST[A]}catch(R){return}}async function sc({distDir:R,page:A,isAppPath:M}){let D={},I={};M||([D,I]=await Promise.all([Promise.resolve().then(()=>sa("/_document",R,!1)),Promise.resolve().then(()=>sa("/_app",R,!1))]));let q=await Promise.resolve().then(()=>sa(A,R,M)),$=M&&(A.endsWith("/page")||"/not-found"===A||"/_not-found"===A),[H,U,F,B]=await Promise.all([sd((0,Y.join)(R,eh)),sd((0,Y.join)(R,ef)),$?su((0,Y.join)(R,"server","app",A.replace(/%5F/g,"_")+"_"+ew+".js"),A.replace(/%5F/g,"_")):void 0,M?sd((0,Y.join)(R,"server",eb+".json")).catch(()=>null):null]),W=(0,sl.X)(q),z=(0,sl.X)(D),G=(0,sl.X)(I),{getServerSideProps:X,getStaticProps:V,getStaticPaths:K,routeModule:J}=q;return{App:G,Document:z,Component:W,buildManifest:H,reactLoadableManifest:U,pageConfig:q.config||{},ComponentMod:q,getServerSideProps:X,getStaticProps:V,getStaticPaths:K,clientReferenceManifest:F,serverActionsManifest:B,isAppPath:M,page:A,routeModule:J}}let sp=(0,rT.getTracer)().wrap(rk.qj.loadComponents,sc);function sf(R){return(A,M,D)=>{for(let I of R){let R=new RegExp(I.regexp).exec(A);if(R){if(I.has||I.missing){let R=tj(M,D,I.has,I.missing);if(!R)continue}return!0}}return!1}}var sm=__webpack_require__("../next-env/dist/index.js"),sg=__webpack_require__("stream"),sv=__webpack_require__.n(sg);function sy(R,A){for(let M in A){let D=A[M];"function"==typeof D&&(D=D.bind(R)),R[M]=D}return R}function s_(R){let A=null,M=new Promise((A,M)=>{R.on("end",A),R.on("error",M)}).catch(R=>({error:R}));return{async finalize(){if(A){let D=await M;if(D&&"object"==typeof D&&D.error)throw D.error;sy(R,A),A=R}},cloneBodyStream(){let M=A??R,D=new sg.PassThrough,I=new sg.PassThrough;return M.on("data",R=>{D.push(R),I.push(R)}),M.on("end",()=>{D.push(null),I.push(null)}),A=I,D}}}class sx{constructor(R){this.pendingResponses=new Map;let A="minimalMode";this[A]=R}get(R,A,M){var D;let{incrementalCache:I}=M,q=R?`${R}-${M.isOnDemandRevalidate?"1":"0"}`:null,$=q?this.pendingResponses.get(q):null;if($)return $;let H=()=>{},U=()=>{},F=new Promise((R,A)=>{H=R,U=A});q&&this.pendingResponses.set(q,F);let B=!1,W=R=>{q&&this.pendingResponses.set(q,Promise.resolve(R)),B||(B=!0,H(R))};return q&&(null==(D=this.previousCacheItem)?void 0:D.key)===q&&this.previousCacheItem.expiresAt>Date.now()?(W(this.previousCacheItem.entry),this.pendingResponses.delete(q)):(async()=>{let D=null;try{D=null;let I=await A(B,D),$=null===I?null:{...I,isMiss:!D};M.isOnDemandRevalidate||W($),R&&I&&void 0!==I.revalidate?this.previousCacheItem={key:q||R,entry:I,expiresAt:Date.now()+1e3}:this.previousCacheItem=void 0,M.isOnDemandRevalidate&&W($)}catch(A){D&&R&&await I.set(R,D.value,{revalidate:Math.min(Math.max(D.revalidate||3,3),30)}),B?console.error(A):U(A)}finally{q&&this.pendingResponses.delete(q)}})(),F}}let sw=0,sb="x-vercel-cache-tags",sE="x-vercel-sc-headers",sS="x-vercel-cache-state",sC="x-vercel-revalidate",sP="x-vercel-cache-item-name",sR="x-vercel-cache-control";class sT{static isAvailable(R){return!!(R._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL)}constructor(R){if(this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE,this.headers={},this.headers["Content-Type"]="application/json",sE in R._requestHeaders){let A=JSON.parse(R._requestHeaders[sE]);for(let R in A)this.headers[R]=A[R];delete R._requestHeaders[sE]}let M=R._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL,D=R._requestHeaders["x-vercel-sc-basepath"]||process.env.SUSPENSE_CACHE_BASEPATH;process.env.SUSPENSE_CACHE_AUTH_TOKEN&&(this.headers.Authorization=`Bearer ${process.env.SUSPENSE_CACHE_AUTH_TOKEN}`),M?(this.cacheEndpoint=`https://${M}${D||""}`,this.debug&&console.log("using cache endpoint",this.cacheEndpoint)):this.debug&&console.log("no cache endpoint available"),R.maxMemoryCacheSize?A||(this.debug&&console.log("using memory store for fetch cache"),A=new(r7())({max:R.maxMemoryCacheSize,length({value:R}){var A;if(!R)return 25;if("REDIRECT"===R.kind)return JSON.stringify(R.props).length;if("IMAGE"===R.kind)throw Error("invariant image should not be incremental-cache");return"FETCH"===R.kind?JSON.stringify(R.data||"").length:"ROUTE"===R.kind?R.body.length:R.html.length+((null==(A=JSON.stringify(R.pageData))?void 0:A.length)||0)}})):this.debug&&console.log("not using memory store for fetch cache")}async revalidateTag(R){if(this.debug&&console.log("revalidateTag",R),Date.now()<sw){this.debug&&console.log("rate limited ",sw);return}try{let A=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${R}`,{method:"POST",headers:this.headers,next:{internal:!0}});if(429===A.status){let R=A.headers.get("retry-after")||"60000";sw=Date.now()+parseInt(R)}if(!A.ok)throw Error(`Request failed with status ${A.status}.`)}catch(A){console.warn(`Failed to revalidate tag ${R}`,A)}}async get(R,M){let{tags:D,softTags:I,fetchCache:q,fetchIdx:$,fetchUrl:H}=M;if(!q)return null;if(Date.now()<sw)return this.debug&&console.log("rate limited"),null;let U=null==A?void 0:A.get(R);if(Date.now()-((null==U?void 0:U.lastModified)||0)>2e3&&(U=void 0),!U&&this.cacheEndpoint)try{let M=Date.now(),q={internal:!0,fetchType:"cache-get",fetchUrl:H,fetchIdx:$},F=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${R}`,{method:"GET",headers:{...this.headers,[sP]:H,[sb]:(null==D?void 0:D.join(","))||"",[e9.Ar]:(null==I?void 0:I.join(","))||""},next:q});if(429===F.status){let R=F.headers.get("retry-after")||"60000";sw=Date.now()+parseInt(R)}if(404===F.status)return this.debug&&console.log(`no fetch cache entry for ${R}, duration: ${Date.now()-M}ms`),null;if(!F.ok)throw console.error(await F.text()),Error(`invalid response from cache ${F.status}`);let B=await F.json();if(!B||"FETCH"!==B.kind)throw this.debug&&console.log({cached:B}),Error("invalid cache value");let W=F.headers.get(sS),z=F.headers.get("age");U={value:B,lastModified:"fresh"!==W?Date.now()-e9.BR:Date.now()-1e3*parseInt(z||"0",10)},this.debug&&console.log(`got fetch cache entry for ${R}, duration: ${Date.now()-M}ms, size: ${Object.keys(B).length}, cache-state: ${W} tags: ${null==D?void 0:D.join(",")} softTags: ${null==I?void 0:I.join(",")}`),U&&(null==A||A.set(R,U))}catch(R){this.debug&&console.error("Failed to get from fetch-cache",R)}return U||null}async set(R,M,{fetchCache:D,fetchIdx:I,fetchUrl:q,tags:$}){if(D){if(Date.now()<sw){this.debug&&console.log("rate limited");return}if(null==A||A.set(R,{value:M,lastModified:Date.now()}),this.cacheEndpoint)try{let A=Date.now();null!==M&&"revalidate"in M&&(this.headers[sC]=M.revalidate.toString()),!this.headers[sC]&&null!==M&&"data"in M&&(this.headers[sR]=M.data.headers["cache-control"]);let D=JSON.stringify({...M,tags:void 0});this.debug&&console.log("set cache",R);let H={internal:!0,fetchType:"cache-set",fetchUrl:q,fetchIdx:I},U=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${R}`,{method:"POST",headers:{...this.headers,[sP]:q||"",[sb]:(null==$?void 0:$.join(","))||""},body:D,next:H});if(429===U.status){let R=U.headers.get("retry-after")||"60000";sw=Date.now()+parseInt(R)}if(!U.ok)throw this.debug&&console.log(await U.text()),Error(`invalid response ${U.status}`);this.debug&&console.log(`successfully set to fetch-cache for ${R}, duration: ${Date.now()-A}ms, size: ${D.length}`)}catch(R){this.debug&&console.error("Failed to update fetch cache",R)}}}}class sk{constructor(R){this.fs=R.fs,this.flushToDisk=R.flushToDisk,this.serverDistDir=R.serverDistDir,this.appDir=!!R._appDir,this.revalidatedTags=R.revalidatedTags,R.maxMemoryCacheSize&&!M&&(M=new(r7())({max:R.maxMemoryCacheSize,length({value:R}){var A;if(!R)return 25;if("REDIRECT"===R.kind)return JSON.stringify(R.props).length;if("IMAGE"===R.kind)throw Error("invariant image should not be incremental-cache");return"FETCH"===R.kind?JSON.stringify(R.data||"").length:"ROUTE"===R.kind?R.body.length:R.html.length+((null==(A=JSON.stringify(R.pageData))?void 0:A.length)||0)}})),this.serverDistDir&&this.fs&&(this.tagsManifestPath=t7().join(this.serverDistDir,"..","cache","fetch-cache","tags-manifest.json"),this.loadTagsManifest())}loadTagsManifest(){if(this.tagsManifestPath&&this.fs&&!D)try{D=JSON.parse(this.fs.readFileSync(this.tagsManifestPath).toString("utf8"))}catch(R){D={version:1,items:{}}}}async revalidateTag(R){if(this.loadTagsManifest(),!D||!this.tagsManifestPath)return;let A=D.items[R]||{};A.revalidatedAt=Date.now(),D.items[R]=A;try{await this.fs.mkdir(t7().dirname(this.tagsManifestPath)),await this.fs.writeFile(this.tagsManifestPath,JSON.stringify(D||{}))}catch(R){console.warn("Failed to update tags manifest.",R)}}async get(R,{tags:A,softTags:I,fetchCache:q}={}){var $,H,U,F,B,W;let z=null==M?void 0:M.get(R);if(!z){try{let{filePath:A}=await this.getFsPath({pathname:`${R}.body`,appDir:!0}),M=await this.fs.readFile(A),{mtime:D}=await this.fs.stat(A),I=JSON.parse((await this.fs.readFile(A.replace(/\.body$/,".meta"))).toString("utf8")),q={lastModified:D.getTime(),value:{kind:"ROUTE",body:M,headers:I.headers,status:I.status}};return q}catch(R){}try{let{filePath:D,isAppPath:I}=await this.getFsPath({pathname:q?R:`${R}.html`,fetchCache:q}),$=(await this.fs.readFile(D)).toString("utf-8"),{mtime:H}=await this.fs.stat(D);if(q){let M=H.getTime(),D=JSON.parse($);if(z={lastModified:M,value:D},(null==(U=z.value)?void 0:U.kind)==="FETCH"){let M=null==(B=z.value)?void 0:null==(F=B.data)?void 0:F.tags;(null==A?void 0:A.every(R=>null==M?void 0:M.includes(R)))||await this.set(R,z.value,{tags:A})}}else{let A=I?(await this.fs.readFile((await this.getFsPath({pathname:`${R}.rsc`,appDir:!0})).filePath)).toString("utf8"):JSON.parse((await this.fs.readFile((await this.getFsPath({pathname:`${R}.json`,appDir:!1})).filePath)).toString("utf8")),M={};if(I)try{M=JSON.parse((await this.fs.readFile(D.replace(/\.html$/,".meta"))).toString("utf-8"))}catch{}z={lastModified:H.getTime(),value:{kind:"PAGE",html:$,pageData:A,headers:M.headers,status:M.status}}}z&&(null==M||M.set(R,z))}catch(R){}}if((null==z?void 0:null==($=z.value)?void 0:$.kind)==="PAGE"){let R;let A=null==(W=z.value.headers)?void 0:W[e9.Et];if("string"==typeof A&&(R=A.split(",")),null==R?void 0:R.length){this.loadTagsManifest();let A=R.some(R=>{var A;return(null==D?void 0:null==(A=D.items[R])?void 0:A.revalidatedAt)&&(null==D?void 0:D.items[R].revalidatedAt)>=((null==z?void 0:z.lastModified)||Date.now())});A&&(z=void 0)}}if(z&&(null==z?void 0:null==(H=z.value)?void 0:H.kind)==="FETCH"){this.loadTagsManifest();let R=[...A||[],...I||[]],M=R.some(R=>{var A;return!!this.revalidatedTags.includes(R)||(null==D?void 0:null==(A=D.items[R])?void 0:A.revalidatedAt)&&(null==D?void 0:D.items[R].revalidatedAt)>=((null==z?void 0:z.lastModified)||Date.now())});M&&(z=void 0)}return z||null}async set(R,A,D){if(null==M||M.set(R,{value:A,lastModified:Date.now()}),this.flushToDisk){if((null==A?void 0:A.kind)==="ROUTE"){let{filePath:M}=await this.getFsPath({pathname:`${R}.body`,appDir:!0});await this.fs.mkdir(t7().dirname(M)),await this.fs.writeFile(M,A.body),await this.fs.writeFile(M.replace(/\.body$/,".meta"),JSON.stringify({headers:A.headers,status:A.status}));return}if((null==A?void 0:A.kind)==="PAGE"){let M="string"==typeof A.pageData,{filePath:D}=await this.getFsPath({pathname:`${R}.html`,appDir:M});await this.fs.mkdir(t7().dirname(D)),await this.fs.writeFile(D,A.html),await this.fs.writeFile((await this.getFsPath({pathname:`${R}.${M?"rsc":"json"}`,appDir:M})).filePath,M?A.pageData:JSON.stringify(A.pageData)),(A.headers||A.status)&&await this.fs.writeFile(D.replace(/\.html$/,".meta"),JSON.stringify({headers:A.headers,status:A.status}))}else if((null==A?void 0:A.kind)==="FETCH"){let{filePath:M}=await this.getFsPath({pathname:R,fetchCache:!0});await this.fs.mkdir(t7().dirname(M)),await this.fs.writeFile(M,JSON.stringify({...A,tags:D.tags}))}}}async getFsPath({pathname:R,appDir:A,fetchCache:M}){if(M)return{filePath:t7().join(this.serverDistDir,"..","cache","fetch-cache",R),isAppPath:!1};let D=!1,I=t7().join(this.serverDistDir,"pages",R);if(!this.appDir||!1===A)return{filePath:I,isAppPath:D};try{return await this.fs.readFile(I),{filePath:I,isAppPath:D}}catch(A){return{filePath:t7().join(this.serverDistDir,"app",R),isAppPath:!0}}}}function sN(R){return new TextEncoder().encode(R)}let sA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sO="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let R=0;R<sA.length;R++)sO[sA.charCodeAt(R)]=R;let sM=R=>{let A=new Uint8Array(R),M,D=A.length,I="";for(M=0;M<D;M+=3)I+=sA[A[M]>>2]+sA[(3&A[M])<<4|A[M+1]>>4]+sA[(15&A[M+1])<<2|A[M+2]>>6]+sA[63&A[M+2]];return D%3==2?I=I.substring(0,I.length-1)+"=":D%3==1&&(I=I.substring(0,I.length-2)+"=="),I};function sL(R){return R.replace(/\/$/,"").replace(/\/index$/,"")||"/"}class sj{constructor({fs:R,dev:A,appDir:M,flushToDisk:D,fetchCache:I,minimalMode:q,serverDistDir:$,requestHeaders:H,requestProtocol:U,maxMemoryCacheSize:F,getPrerenderManifest:B,fetchCacheKeyPrefix:W,CurCacheHandler:z,allowedRevalidateHeaderKeys:G}){var X,V,K,J;this.locks=new Map,this.unlocks=new Map;let Y=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;z?Y&&console.log("using custom cache handler",z.name):(R&&$&&(Y&&console.log("using filesystem cache handler"),z=sk),sT.isAvailable({_requestHeaders:H})&&q&&I&&(Y&&console.log("using fetch cache handler"),z=sT)),process.env.__NEXT_TEST_MAX_ISR_CACHE&&(F=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=A;let Z="minimalMode";this[Z]=q,this.requestHeaders=H,this.requestProtocol=U,this.allowedRevalidateHeaderKeys=G,this.prerenderManifest=B(),this.fetchCacheKeyPrefix=W;let Q=[];H[e9.y3]===(null==(V=this.prerenderManifest)?void 0:null==(X=V.preview)?void 0:X.previewModeId)&&(this.isOnDemandRevalidate=!0),q&&"string"==typeof H[e9.of]&&H[e9.X_]===(null==(J=this.prerenderManifest)?void 0:null==(K=J.preview)?void 0:K.previewModeId)&&(Q=H[e9.of].split(",")),z&&(this.cacheHandler=new z({dev:A,fs:R,flushToDisk:D,serverDistDir:$,revalidatedTags:Q,maxMemoryCacheSize:F,_appDir:!!M,_requestHeaders:H,fetchCacheKeyPrefix:W}))}calculateRevalidate(R,A,M){if(M)return new Date().getTime()-1e3;let{initialRevalidateSeconds:D}=this.prerenderManifest.routes[sL(R)]||{initialRevalidateSeconds:1},I="number"==typeof D?1e3*D+A:D;return I}_getPathname(R,A){return A?R:rr(R)}async unlock(R){let A=this.unlocks.get(R);A&&(A(),this.locks.delete(R),this.unlocks.delete(R))}async lock(R){if(process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY){let A=__webpack_require__("./dist/esm/server/lib/server-ipc/request-utils.js").p;return await A({method:"lock",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[R]}),async()=>{await A({method:"unlock",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[R]})}}let A=()=>Promise.resolve(),M=this.locks.get(R);if(M)await M;else{let M=new Promise(R=>{A=async()=>{R()}});this.locks.set(R,M),this.unlocks.set(R,A)}return A}async revalidateTag(R){var A,M;if(process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY){let R=__webpack_require__("./dist/esm/server/lib/server-ipc/request-utils.js").p;return R({method:"revalidateTag",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[...arguments]})}return null==(M=this.cacheHandler)?void 0:null==(A=M.revalidateTag)?void 0:A.call(M,R)}async fetchCacheKey(R,A={}){let M;let D="v3",I=[];if(A.body){if("function"==typeof A.body.getReader){let R=A.body,M=R.getReader(),D=new Uint8Array;function q({done:R,value:A}){if(!R){if(A)try{I.push("string"==typeof A?A:sM(A));let R="string"==typeof A?sN(A):new Uint8Array(A),M=D;(D=new Uint8Array(M.byteLength+R.byteLength)).set(M),D.set(R,M.byteLength)}catch(R){console.error(R)}M.read().then(q)}}await M.read().then(q),A._ogBody=D}else if("function"==typeof A.body.keys){let R=A.body;for(let M of(A._ogBody=A.body,new Set([...R.keys()]))){let A=R.getAll(M);I.push(`${M}=${(await Promise.all(A.map(async R=>"string"==typeof R?R:await R.text()))).join(",")}`)}}else if("function"==typeof A.body.arrayBuffer){let R=A.body,M=await R.arrayBuffer();I.push(sM(await A.body.arrayBuffer())),A._ogBody=new Blob([M],{type:R.type})}else"string"==typeof A.body&&(I.push(A.body),A._ogBody=A.body)}let $=JSON.stringify([D,this.fetchCacheKeyPrefix||"",R,A.method,"function"==typeof(A.headers||{}).keys?Object.fromEntries(A.headers):A.headers,A.mode,A.redirect,A.credentials,A.referrer,A.referrerPolicy,A.integrity,A.cache,I]);{let R=__webpack_require__("crypto");M=R.createHash("sha256").update($).digest("hex")}return M}async get(R,A={}){var M,D,I;let q,$;if(process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY){let R=__webpack_require__("./dist/esm/server/lib/server-ipc/request-utils.js").p;return R({method:"get",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[...arguments]})}if(this.dev&&(!A.fetchCache||"no-cache"===this.requestHeaders["cache-control"]))return null;R=this._getPathname(R,A.fetchCache);let H=null,U=A.revalidate,F=await (null==(M=this.cacheHandler)?void 0:M.get(R,A));if((null==F?void 0:null==(D=F.value)?void 0:D.kind)==="FETCH"){let R=[...A.tags||[],...A.softTags||[]];if(R.some(R=>{var A;return null==(A=this.revalidatedTags)?void 0:A.includes(R)}))return null;U=U||F.value.revalidate;let M=Math.round((Date.now()-(F.lastModified||0))/1e3),D=M>U,I=F.value.data;return{isStale:D,value:{kind:"FETCH",data:I,revalidate:U},revalidateAfter:Date.now()+1e3*U}}let B=null==(I=this.prerenderManifest.routes[sL(R)])?void 0:I.initialRevalidateSeconds;return(null==F?void 0:F.lastModified)===-1?(q=-1,$=-1*e9.BR):q=!!(!1!==($=this.calculateRevalidate(R,(null==F?void 0:F.lastModified)||Date.now(),this.dev&&!A.fetchCache))&&$<Date.now())||void 0,F&&(H={isStale:q,curRevalidate:B,revalidateAfter:$,value:F.value}),!F&&this.prerenderManifest.notFoundRoutes.includes(R)&&(H={isStale:q,value:null,curRevalidate:B,revalidateAfter:$},this.set(R,H.value,A)),H}async set(R,A,M){if(process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY){let R=__webpack_require__("./dist/esm/server/lib/server-ipc/request-utils.js").p;return R({method:"set",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[...arguments]})}if(!this.dev||M.fetchCache){if(M.fetchCache&&JSON.stringify(A).length>2097152){if(this.dev)throw Error("fetch for over 2MB of data can not be cached");return}R=this._getPathname(R,M.fetchCache);try{var D;void 0===M.revalidate||M.fetchCache||(this.prerenderManifest.routes[R]={dataRoute:t7().posix.join("/_next/data",`${rr(R)}.json`),srcRoute:null,initialRevalidateSeconds:M.revalidate}),await (null==(D=this.cacheHandler)?void 0:D.set(R,A,M))}catch(A){console.warn("Failed to update prerender cache for",R,A)}}}}var sD=__webpack_require__("http"),sI=__webpack_require__("https");function sq(R){if(!globalThis.__NEXT_HTTP_AGENT){if(!R)throw Error("Expected config.httpAgentOptions to be an object");globalThis.__NEXT_HTTP_AGENT_OPTIONS=R.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new sD.Agent(R.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new sI.Agent(R.httpAgentOptions)}}function s$(R){return R.definition.kind===I.PAGES_API}let sH={readFile:R=>J().promises.readFile(R),readFileSync:R=>J().readFileSync(R),writeFile:(R,A)=>J().promises.writeFile(R,A),mkdir:R=>J().promises.mkdir(R,{recursive:!0}),stat:R=>J().promises.stat(R)};__webpack_require__("./dist/esm/server/lib/server-ipc/invoke-request.js"),__webpack_require__("./dist/esm/server/lib/server-ipc/utils.js");class sU extends sv().Readable{constructor({url:R,headers:A,method:M,socket:D=null,readable:I}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(R,A)=>{if("encrypted"!==A)throw Error("Method not implemented");return!1}}),this.url=R,this.headers=A,this.method=M,I&&(this.bodyReadable=I,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),D&&(this.socket=D)}get headersDistinct(){let R={};for(let[A,M]of Object.entries(this.headers))M&&(R[A]=Array.isArray(M)?M:[M]);return R}_read(R){if(this.bodyReadable)return this.bodyReadable._read(R);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Error("Method not implemented")}get complete(){throw Error("Method not implemented")}get trailers(){throw Error("Method not implemented")}get trailersDistinct(){throw Error("Method not implemented")}get rawTrailers(){throw Error("Method not implemented")}get rawHeaders(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}}class sF extends sv().Writable{constructor(R={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=R.statusCode??200,this.socket=R.socket??null,this.headers=R.headers?rA(R.headers):new Headers,this.headPromise=new Promise(R=>{this.headPromiseResolve=R}),this.hasStreamed=new Promise((R,A)=>{this.on("finish",()=>R(!0)),this.on("end",()=>R(!0)),this.on("error",R=>A(R))}).then(R=>{var A,M;return null==(A=(M=this).headPromiseResolve)||A.call(M),R}),R.resWriter&&(this.resWriter=R.resWriter)}appendHeader(R,A){let M=Array.isArray(A)?A:[A];for(let A of M)this.headers.append(R,A);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(R){return this.resWriter?this.resWriter(R):(this.buffers.push(Buffer.isBuffer(R)?R:Buffer.from(R)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(R,A,M){this.write(R),M()}writeHead(R,A,M){var D,I;if(M||"string"==typeof A?"string"==typeof A&&A.length>0&&(this.statusMessage=A):M=A,M){if(Array.isArray(M))for(let R=0;R<M.length;R+=2)this.setHeader(M[R],M[R+1]);else for(let[R,A]of Object.entries(M))void 0!==A&&this.setHeader(R,A)}return this.statusCode=R,this.headersSent=!0,null==(D=(I=this).headPromiseResolve)||D.call(I),this}hasHeader(R){return this.headers.has(R)}getHeader(R){return this.headers.get(R)??void 0}getHeaders(){return rM(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(R,A){if(Array.isArray(A))for(let M of(this.headers.delete(R),A))this.headers.append(R,M);else"number"==typeof A?this.headers.set(R,A.toString()):this.headers.set(R,A);return this}removeHeader(R){this.headers.delete(R)}get strictContentLength(){throw Error("Method not implemented.")}writeEarlyHints(){throw Error("Method not implemented.")}get req(){throw Error("Method not implemented.")}assignSocket(){throw Error("Method not implemented.")}detachSocket(){throw Error("Method not implemented.")}writeContinue(){throw Error("Method not implemented.")}writeProcessing(){throw Error("Method not implemented.")}get upgrading(){throw Error("Method not implemented.")}get chunkedEncoding(){throw Error("Method not implemented.")}get shouldKeepAlive(){throw Error("Method not implemented.")}get useChunkedEncodingByDefault(){throw Error("Method not implemented.")}get sendDate(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}addTrailers(){throw Error("Method not implemented.")}flushHeaders(){throw Error("Method not implemented.")}}function sB({url:R,headers:A={},method:M="GET",bodyReadable:D,resWriter:I,socket:q=null}){return{req:new sU({url:R,headers:A,method:M,socket:q,readable:D}),res:new sF({socket:q,resWriter:I})}}class sW{async load(R){return await require(R)}}class sz{static async load(R,A=new sW){let M=await A.load(R);if("routeModule"in M)return M.routeModule;throw Error(`Module "${R}" does not export a routeModule.`)}}let sG=new WeakMap;function sX(R){let A=sG.get(R);if(A)return A;if(!Array.isArray(R.matchers))throw Error(`Invariant: invalid matchers for middleware ${JSON.stringify(R)}`);let M=sf(R.matchers);return sG.set(R,M),M}class sV extends r6{constructor(R){super(R),this.renderOpts.optimizeFonts&&(process.env.__NEXT_OPTIMIZE_FONTS=JSON.stringify(this.renderOpts.optimizeFonts)),this.renderOpts.optimizeCss&&(process.env.__NEXT_OPTIMIZE_CSS=JSON.stringify(!0)),this.renderOpts.nextScriptWorkers&&(process.env.__NEXT_SCRIPT_WORKERS=JSON.stringify(!0)),this.nextConfig.experimental.deploymentId&&(process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.experimental.deploymentId);let{appDocumentPreloading:A}=this.nextConfig.experimental,M=void 0===A;if(R.dev||!0!==A&&M||(sp({distDir:this.distDir,page:"/_document",isAppPath:!1}).catch(()=>{}),sp({distDir:this.distDir,page:"/_app",isAppPath:!1}).catch(()=>{})),!R.dev){let{dynamicRoutes:R=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=R.map(R=>{let A=tP(R.page),M=V(A);return{match:M,page:R.page,re:A.re}})}sq(this.nextConfig),this.middlewareManifestPath=(0,Y.join)(this.serverDistDir,ep)}async handleUpgrade(){}async prepareImpl(){if(await super.prepareImpl(),!this.serverOptions.dev&&this.nextConfig.experimental.instrumentationHook)try{let R=await __webpack_require__("./dist/esm/server sync recursive")((0,Y.resolve)(this.serverOptions.dir||".",this.serverOptions.conf.distDir,"server",e9.o$));await (null==R.register?void 0:R.register.call(R))}catch(R){if("MODULE_NOT_FOUND"!==R.code)throw R.message=`An error occurred while loading instrumentation hook: ${R.message}`,R}}loadEnvConfig({dev:R,forceReload:A,silent:M}){(0,sm.loadEnvConfig)(this.dir,R,M?{info:()=>{},error:()=>{}}:q,A)}getIncrementalCache({requestHeaders:R,requestProtocol:A}){let M;let D=!1,{incrementalCacheHandlerPath:I}=this.nextConfig.experimental;return I&&(M=(M=__webpack_require__("./dist/esm/server sync recursive")((0,Y.isAbsolute)(I)?I:(0,Y.join)(this.distDir,I))).default||M),new sj({fs:this.getCacheFilesystem(),dev:D,requestHeaders:R,requestProtocol:A,appDir:this.hasAppDir,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCache:!0,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.experimental.isrMemoryCacheSize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:M})}getResponseCache(){return new sx(!0)}getPublicDir(){return(0,Y.join)(this.dir,e_)}getHasStaticDir(){return J().existsSync((0,Y.join)(this.dir,"static"))}getPagesManifest(){return st((0,Y.join)(this.serverDistDir,eo))}getAppPathsManifest(){if(this.hasAppDir)return st((0,Y.join)(this.serverDistDir,el))}async hasPage(R){var A;return!!si(R,this.distDir,null==(A=this.nextConfig.i18n)?void 0:A.locales,this.hasAppDir)}getBuildId(){let R=(0,Y.join)(this.distDir,ev);try{return J().readFileSync(R,"utf8").trim()}catch(A){if(!J().existsSync(R))throw Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`);throw A}}getHasAppDir(R){return!!eR(R?this.dir:this.serverDistDir,"app")}sendRenderResult(R,A,M){return(0,eD.BR)({req:R.originalRequest,res:A.originalResponse,...M})}async runApi(R,A,M,D){let I=this.getEdgeFunctionsPages();for(let q of I)if(q===D.definition.pathname){let I=await this.runEdgeFunction({req:R,res:A,query:M,params:D.params,page:D.definition.pathname,appPaths:null});if(I)return!0}let q=await sz.load(D.definition.filename);return M={...M,...D.params},delete M.__nextLocale,delete M.__nextDefaultLocale,delete M.__nextInferredLocaleFromDefault,await q.render(R.originalRequest,A.originalResponse,{previewProps:this.renderOpts.previewProps,revalidate:this.revalidate.bind(this),trustHostHeader:this.nextConfig.experimental.trustHostHeader,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,hostname:this.fetchHostname,minimalMode:!0,dev:!1,query:M,params:D.params,page:D.definition.pathname}),!0}async renderHTML(R,A,M,D,I){return(0,rT.getTracer)().trace(rk.Xy.renderHTML,async()=>this.renderHTMLImpl(R,A,M,D,I))}async renderHTMLImpl(R,A,M,D,I){throw Error("invariant: renderHTML should not be called in minimal mode")}async imageOptimizer(R,A,M){throw Error("invariant: imageOptimizer should not be called in minimal mode")}getPagePath(R,A){return sn(R,this.distDir,A,this.hasAppDir)}async renderPageComponent(R,A){let M=this.getEdgeFunctionsPages()||[];if(M.length){let A=this.getOriginalAppPaths(R.pathname),D=Array.isArray(A),I=R.pathname;for(let q of(D&&(I=A[0]),M))if(q===I)return await this.runEdgeFunction({req:R.req,res:R.res,query:R.query,params:R.renderOpts.params,page:I,appPaths:A}),null}return super.renderPageComponent(R,A)}async findPageComponents({page:R,query:A,params:M,isAppPath:D}){return(0,rT.getTracer)().trace(rk.Xy.findPageComponents,{spanName:"resolving page into components",attributes:{"next.route":D?tH(R):R}},()=>this.findPageComponentsImpl({page:R,query:A,params:M,isAppPath:D}))}async findPageComponentsImpl({page:R,query:A,params:M,isAppPath:D}){let I=[R];for(let q of(A.amp&&I.unshift((D?tH(R):rr(R))+".amp"),A.__nextLocale&&I.unshift(...I.map(R=>`/${A.__nextLocale}${"/"===R?"":R}`)),I))try{let R=await sp({distDir:this.distDir,page:q,isAppPath:D});if(A.__nextLocale&&"string"==typeof R.Component&&!q.startsWith(`/${A.__nextLocale}`))continue;return{components:R,query:{...R.getStaticProps?{amp:A.amp,__nextDataReq:A.__nextDataReq,__nextLocale:A.__nextLocale,__nextDefaultLocale:A.__nextDefaultLocale}:A,...(D?{}:M)||{}}}}catch(R){if(!(R instanceof X.GP))throw R}return null}getFontManifest(){return so(this.distDir)}getNextFontManifest(){return st((0,Y.join)(this.distDir,"server",ed+".json"))}async getFallback(R){R=rr(R);let A=this.getCacheFilesystem(),M=await A.readFile((0,Y.join)(this.serverDistDir,"pages",`${R}.html`));return M.toString("utf8")}async handleNextImageRequest(R,A,M){return A.statusCode=400,A.body("Bad Request").send(),{finished:!0}}async handleCatchallRenderRequest(R,A,M){let{pathname:D,query:I}=M;if(!D)throw Error("Invariant: pathname is undefined");I._nextBubbleNoFallback="1";try{var q;D=td(D);let $={i18n:null==(q=this.i18nProvider)?void 0:q.fromQuery(D,I)},H=await this.matchers.match(D,$);if(!H)return await this.render(R,A,D,I,M,!0),{finished:!0};er(R,"_nextMatch",H);let U=this.getEdgeFunctionsPages();for(let D of U){if(D!==H.definition.page)continue;if("export"===this.nextConfig.output)return await this.render404(R,A,M),{finished:!0};delete I._nextBubbleNoFallback,delete I[tA.H4];let q=await this.runEdgeFunction({req:R,res:A,query:I,params:H.params,page:H.definition.page,match:H,appPaths:null});if(q)return{finished:!0}}if(s$(H)){if("export"===this.nextConfig.output)return await this.render404(R,A,M),{finished:!0};delete I._nextBubbleNoFallback;let D=await this.handleApiRequest(R,A,I,H);if(D)return{finished:!0}}return await this.render(R,A,D,I,M,!0),{finished:!0}}catch(M){if(M instanceof r5){if(this.isRenderWorker)throw M;return{finished:!1}}try{return this.logError(M),A.statusCode=500,await this.renderError(M,R,A,D,I),{finished:!0}}catch{}throw M}}async logErrorWithOriginalStack(R,A){throw Error("Invariant: logErrorWithOriginalStack can only be called on the development server")}async ensurePage(R){throw Error("Invariant: ensurePage can only be called on the development server")}async handleApiRequest(R,A,M,D){return this.runApi(R,A,M,D)}async getPrefetchRsc(R){return this.getCacheFilesystem().readFile((0,Y.join)(this.serverDistDir,"app",`${R}.prefetch.rsc`)).then(R=>R.toString())}getCacheFilesystem(){return sH}normalizeReq(R){return R instanceof eL?R:new eL(R)}normalizeRes(R){return R instanceof ej?R:new ej(R)}getRequestHandler(){let R=this.makeRequestHandler();return R}makeRequestHandler(){this.prepare();let R=super.getRequestHandler();return(A,M,D)=>{var I,q;let $=this.normalizeReq(A),H=this.normalizeRes(M);return null==(I=this.nextConfig.experimental.logging)||I.level,null==(q=this.nextConfig.experimental.logging)||q.fullUrl,R($,H,D)}}async revalidate({urlPath:R,revalidateHeaders:A,opts:M}){let D=sB({url:R,headers:A}),I=this.getRequestHandler();if(await I(new eL(D.req),new ej(D.res)),await D.res.hasStreamed,"REVALIDATED"!==D.res.getHeader("x-nextjs-cache")&&!(404===D.res.statusCode&&M.unstable_onlyGenerated))throw Error(`Invalid response ${D.res.statusCode}`)}async render(R,A,M,D,I,q=!1){return super.render(this.normalizeReq(R),this.normalizeRes(A),M,D,I,q)}async renderToHTML(R,A,M,D){return super.renderToHTML(this.normalizeReq(R),this.normalizeRes(A),M,D)}async renderErrorToResponseImpl(R,A){let{req:M,res:D,query:I}=R,q=404===D.statusCode;if(q&&this.hasAppDir&&this.isRenderWorker){let R="/_not-found";if(this.getEdgeFunctionsPages().includes(R))return await this.runEdgeFunction({req:M,res:D,query:I||{},params:{},page:R,appPaths:null}),null}return super.renderErrorToResponseImpl(R,A)}async renderError(R,A,M,D,I,q){return super.renderError(R,this.normalizeReq(A),this.normalizeRes(M),D,I,q)}async renderErrorToHTML(R,A,M,D,I){return super.renderErrorToHTML(R,this.normalizeReq(A),this.normalizeRes(M),D,I)}async render404(R,A,M,D){return super.render404(this.normalizeReq(R),this.normalizeRes(A),M,D)}getMiddlewareManifest(){return null}getMiddleware(){var R;let A=this.getMiddlewareManifest(),M=null==A?void 0:null==(R=A.middleware)?void 0:R["/"];if(M)return{match:sX(M),page:"/"}}getEdgeFunctionsPages(){let R=this.getMiddlewareManifest();return R?Object.keys(R.functions):[]}getEdgeFunctionInfo(R){let A;let M=this.getMiddlewareManifest();if(!M)return null;try{A=tc(rr(R.page))}catch(R){return null}let D=R.middleware?M.middleware[A]:M.functions[A];if(!D){if(!R.middleware)throw new X.GP(A);return null}return{name:D.name,paths:D.files.map(R=>(0,Y.join)(this.distDir,R)),wasm:(D.wasm??[]).map(R=>({...R,filePath:(0,Y.join)(this.distDir,R.filePath)})),assets:(D.assets??[]).map(R=>({...R,filePath:(0,Y.join)(this.distDir,R.filePath)}))}}async hasMiddleware(R){let A=this.getEdgeFunctionInfo({page:R,middleware:!0});return!!(A&&A.paths.length>0)}async ensureMiddleware(){}async ensureEdgeFunction(R){}async runMiddleware(R){throw Error("invariant: runMiddleware should not be called in minimal mode")}async handleCatchallMiddlewareRequest(R,A,M){let D;let I=this.isRenderWorker&&R.headers["x-middleware-invoke"],q=(R=!1)=>I&&!R?(A.setHeader("x-middleware-invoke","1"),A.body("").send(),{finished:!0}):{finished:R};if(this.isRenderWorker&&!I)return{finished:!1};let $=this.getMiddleware();if(!$)return q();let H=ee(R,"__NEXT_INIT_URL"),U=e$(H),F=tJ(U.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});U.pathname=F.pathname;let B=td(M.pathname||"");if(!$.match(B,R,U.query))return q();let W=!1;for(let A of en)delete R.headers[A];this.stripInternalHeaders(R);try{if(await this.ensureMiddleware(),D=await this.runMiddleware({request:R,response:A,parsedUrl:U,parsed:M}),"response"in D){if(I){W=!0;let R=Error();throw R.result=D,R.bubble=!0,R}for(let[R,M]of Object.entries(rM(D.response.headers)))"content-encoding"!==R&&void 0!==M&&A.setHeader(R,M);A.statusCode=D.response.status;let{originalResponse:R}=A;return D.response.body?await tl(D.response.body,R):R.end(),{finished:!0}}}catch(I){if(W)throw I;if((0,tz.Z)(I)&&"ENOENT"===I.code)return await this.render404(R,A,M),{finished:!0};if(I instanceof X._9)return A.statusCode=400,await this.renderError(I,R,A,M.pathname||""),{finished:!0};let D=(0,tz.S)(I);return console.error(D),A.statusCode=500,await this.renderError(D,R,A,M.pathname||""),{finished:!0}}return"finished"in D?D:{finished:!1}}getPrerenderManifest(){var R,A,M;if(this._cachedPreviewManifest)return this._cachedPreviewManifest;if(R=this.renderOpts,(null==(A=this.serverOptions)?void 0:A.dev)||(null==(M=this.renderWorkerOpts)?void 0:M.dev)||process.env.NEXT_PHASE===ea)return this._cachedPreviewManifest={version:4,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:{previewModeId:__webpack_require__("crypto").randomBytes(16).toString("hex"),previewModeSigningKey:__webpack_require__("crypto").randomBytes(32).toString("hex"),previewModeEncryptionKey:__webpack_require__("crypto").randomBytes(32).toString("hex")}},this._cachedPreviewManifest;let D=st((0,Y.join)(this.distDir,eu));return this._cachedPreviewManifest=D}getRoutesManifest(){return(0,rT.getTracer)().trace(rk.Xy.getRoutesManifest,()=>{let R=st((0,Y.join)(this.distDir,ec)),A=R.rewrites??{beforeFiles:[],afterFiles:[],fallback:[]};return Array.isArray(A)&&(A={beforeFiles:[],afterFiles:A,fallback:[]}),{...R,rewrites:A}})}attachRequestMeta(R,A,M){var D,I,q;let $=(null==(D=null==(I=R.originalRequest)?void 0:I.socket)?void 0:D.encrypted)||(null==(q=R.headers["x-forwarded-proto"])?void 0:q.includes("https"))?"https":"http",H=this.fetchHostname&&this.port?`${$}://${this.fetchHostname}:${this.port}${R.url}`:this.nextConfig.experimental.trustHostHeader?`https://${R.headers.host||"localhost"}${R.url}`:R.url;er(R,"__NEXT_INIT_URL",H),er(R,"__NEXT_INIT_QUERY",{...A.query}),er(R,"_protocol",$),M||er(R,"__NEXT_CLONABLE_BODY",s_(R.body))}async runEdgeFunction(R){throw Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.")}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let R=(0,Y.join)(this.distDir,eg);return this._serverDistDir=R,R}async getFallbackErrorComponents(){return null}}})(),module.exports=__webpack_exports__})();