You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@netlify/serverless-functions-api

Package Overview
Dependencies
Maintainers
21
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/serverless-functions-api - npm Package Compare versions

Comparing version

to
1.24.0

2

dist/index.js
import{createRequire}from"module";const require=createRequire(import.meta.url);
import{fileURLToPath as er}from"url";import{Buffer as Mt}from"node:buffer";import{env as Bt,version as Gt}from"node:process";import{pipeline as Wt,Readable as Vt}from"node:stream";import{promisify as zt}from"node:util";var ee=e=>({id:e??""});var te="x-nf-client-connection-ip",re="x-nf-geo",ne="x-nf-account-id",H="x-nf-deploy-id",se="x-nf-deploy-context",oe="x-nf-deploy-published",ie="x-nf-site-id",ae="x-nf-request-flags",z="x-nf-invocation-metadata",ce="x-nf-request-id",ue=e=>{let t=new Headers;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&t.set(r.toLowerCase(),n)}),t},fe=e=>{let t={};for(let[r,n]of e.entries())r in t?t[r].push(n):t[r]=[n];return t};var he=e=>({context:e.get(se)??"",id:e.get(H)??"",published:e.get(oe)==="1"});import{Buffer as Je}from"buffer";var M=Symbol("Request flags"),_=Symbol("Request route"),Ke=typeof Request>"u"?class{}:Request,le,j=class extends(le=Ke,M,_,le){},pe=(e,t)=>{if(!(e==null||e===""))return t?Je.from(e,"base64"):e};var $=class{#e;#t;constructor(t){this.#e=new Set,this.#t=t}get(t){let r=this.#t[t];return r!==void 0&&this.#e.add(t),r}get evaluations(){return this.#e}},me=e=>e[M]??new $({}),de=(e,t)=>{e[M]=t};import{Buffer as Xe}from"node:buffer";var ge=e=>{if(e===null)return{};try{return JSON.parse(Xe.from(e,"base64").toString("utf-8"))}catch{return{}}};var xe=e=>e??"";var D=class{constructor(e,t,r,n,o,u){this.type=3,this.name="",this.prefix="",this.value="",this.suffix="",this.modifier=3,this.type=e,this.name=t,this.prefix=r,this.value=n,this.suffix=o,this.modifier=u}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},Ye=/[$_\p{ID_Start}]/u,Qe=/[$_\u200C\u200D\p{ID_Continue}]/u,K=".*";function Ze(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function we(e,t=!1){let r=[],n=0;for(;n<e.length;){let o=e[n],u=function(i){if(!t)throw new TypeError(i);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})};if(o==="*"){r.push({type:"ASTERISK",index:n,value:e[n++]});continue}if(o==="+"||o==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:e[n++]});continue}if(o==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});continue}if(o==="{"){r.push({type:"OPEN",index:n,value:e[n++]});continue}if(o==="}"){r.push({type:"CLOSE",index:n,value:e[n++]});continue}if(o===":"){let i="",s=n+1;for(;s<e.length;){let c=e.substr(s,1);if(s===n+1&&Ye.test(c)||s!==n+1&&Qe.test(c)){i+=e[s++];continue}break}if(!i){u(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:i}),n=s;continue}if(o==="("){let i=1,s="",c=n+1,a=!1;if(e[c]==="?"){u(`Pattern cannot start with "?" at ${c}`);continue}for(;c<e.length;){if(!Ze(e[c],!1)){u(`Invalid character '${e[c]}' at ${c}.`),a=!0;break}if(e[c]==="\\"){s+=e[c++]+e[c++];continue}if(e[c]===")"){if(i--,i===0){c++;break}}else if(e[c]==="("&&(i++,e[c+1]!=="?")){u(`Capturing groups are not allowed at ${c}`),a=!0;break}s+=e[c++]}if(a)continue;if(i){u(`Unbalanced pattern at ${n}`);continue}if(!s){u(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:s}),n=c;continue}r.push({type:"CHAR",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function Ce(e,t={}){let r=we(e);t.delimiter??(t.delimiter="/#?"),t.prefixes??(t.prefixes="./");let n=`[^${y(t.delimiter)}]+?`,o=[],u=0,i=0,s="",c=new Set,a=f=>{if(i<r.length&&r[i].type===f)return r[i++].value},h=()=>a("OTHER_MODIFIER")??a("ASTERISK"),l=f=>{let p=a(f);if(p!==void 0)return p;let{type:d,index:S}=r[i];throw new TypeError(`Unexpected ${d} at ${S}, expected ${f}`)},m=()=>{let f="",p;for(;p=a("CHAR")??a("ESCAPED_CHAR");)f+=p;return f},A=f=>f,E=t.encodePart||A,P="",w=f=>{P+=f},L=()=>{P.length&&(o.push(new D(3,"","",E(P),"",3)),P="")},T=(f,p,d,S,Z)=>{let g=3;switch(Z){case"?":g=1;break;case"*":g=0;break;case"+":g=2;break}if(!p&&!d&&g===3){w(f);return}if(L(),!p&&!d){if(!f)return;o.push(new D(3,"","",E(f),"",g));return}let x;d?d==="*"?x=K:x=d:x=n;let v=2;x===n?(v=1,x=""):x===K&&(v=0,x="");let b;if(p?b=p:d&&(b=u++),c.has(b))throw new TypeError(`Duplicate name '${b}'.`);c.add(b),o.push(new D(v,b,E(f),x,E(S),g))};for(;i<r.length;){let f=a("CHAR"),p=a("NAME"),d=a("REGEX");if(!p&&!d&&(d=a("ASTERISK")),p||d){let g=f??"";t.prefixes.indexOf(g)===-1&&(w(g),g=""),L();let x=h();T(g,p,d,"",x);continue}let S=f??a("ESCAPED_CHAR");if(S){w(S);continue}if(a("OPEN")){let g=m(),x=a("NAME"),v=a("REGEX");!x&&!v&&(v=a("ASTERISK"));let b=m();l("CLOSE");let ze=h();T(g,x,v,b,ze);continue}L(),l("END")}return o}function y(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Se(e){return e&&e.ignoreCase?"ui":"u"}function et(e,t,r){return be(Ce(e,r),t,r)}function N(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function be(e,t,r={}){r.delimiter??(r.delimiter="/#?"),r.prefixes??(r.prefixes="./"),r.sensitive??(r.sensitive=!1),r.strict??(r.strict=!1),r.end??(r.end=!0),r.start??(r.start=!0),r.endsWith="";let n=r.start?"^":"";for(let s of e){if(s.type===3){s.modifier===3?n+=y(s.value):n+=`(?:${y(s.value)})${N(s.modifier)}`;continue}t&&t.push(s.name);let c=`[^${y(r.delimiter)}]+?`,a=s.value;if(s.type===1?a=c:s.type===0&&(a=K),!s.prefix.length&&!s.suffix.length){s.modifier===3||s.modifier===1?n+=`(${a})${N(s.modifier)}`:n+=`((?:${a})${N(s.modifier)})`;continue}if(s.modifier===3||s.modifier===1){n+=`(?:${y(s.prefix)}(${a})${y(s.suffix)})`,n+=N(s.modifier);continue}n+=`(?:${y(s.prefix)}`,n+=`((?:${a})(?:`,n+=y(s.suffix),n+=y(s.prefix),n+=`(?:${a}))*)${y(s.suffix)})`,s.modifier===0&&(n+="?")}let o=`[${y(r.endsWith)}]|$`,u=`[${y(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${u}?`),r.endsWith.length?n+=`(?=${o})`:n+="$",new RegExp(n,Se(r));r.strict||(n+=`(?:${u}(?=${o}))?`);let i=!1;if(e.length){let s=e[e.length-1];s.type===3&&s.modifier===3&&(i=r.delimiter.indexOf(s)>-1)}return i||(n+=`(?=${u}|${o})`),new RegExp(n,Se(r))}var k={delimiter:"",prefixes:"",sensitive:!0,strict:!0},tt={delimiter:".",prefixes:"",sensitive:!0,strict:!0},rt={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function nt(e,t){return e.length?e[0]==="/"?!0:!t||e.length<2?!1:(e[0]=="\\"||e[0]=="{")&&e[1]=="/":!1}function Re(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function st(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function ke(e){return!e||e.length<2?!1:e[0]==="["||(e[0]==="\\"||e[0]==="{")&&e[1]==="["}var ve=["ftp","file","http","https","ws","wss"];function Ie(e){if(!e)return!0;for(let t of ve)if(e.test(t))return!0;return!1}function ot(e,t){if(e=Re(e,"#"),t||e==="")return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function it(e,t){if(e=Re(e,"?"),t||e==="")return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function at(e,t){return t||e===""?e:ke(e)?Le(e):Pe(e)}function ct(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.password=e,r.password}function ut(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}function ft(e,t,r){if(r||e==="")return e;if(t&&!ve.includes(t))return new URL(`${t}:${e}`).pathname;let n=e[0]=="/";return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}function ht(e,t,r){return Ee(t)===e&&(e=""),r||e===""?e:_e(e)}function lt(e,t){return e=st(e,":"),t||e===""?e:X(e)}function Ee(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function X(e){if(e==="")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function pt(e){if(e==="")return e;let t=new URL("https://example.com");return t.username=e,t.username}function mt(e){if(e==="")return e;let t=new URL("https://example.com");return t.password=e,t.password}function Pe(e){if(e==="")return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function Le(e){if(e==="")return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function _e(e){if(e===""||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function dt(e){if(e==="")return e;let t=new URL("https://example.com");return t.pathname=e[0]!=="/"?"/-"+e:e,e[0]!=="/"?t.pathname.substring(2,t.pathname.length):t.pathname}function gt(e){return e===""?e:new URL(`data:${e}`).pathname}function xt(e){if(e==="")return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function St(e){if(e==="")return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}var yt=class{constructor(e){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=e}get result(){return this.internalResult}parse(){for(this.tokenList=we(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,this.tokenList[this.tokenIndex].type==="END"){if(this.state===0){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}else if(this.state===2){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0)if(this.isGroupClose())this.groupDepth-=1;else continue;if(this.isGroupOpen()){this.groupDepth+=1;continue}switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let e=7,t=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(e=2,t=3):this.shouldTreatAsStandardURL&&(e=2),this.changeState(e,t)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1);break;case 9:break;case 10:break}}}changeState(e,t){switch(this.state){case 0:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 2:break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString();break;case 10:break}this.changeStateWithoutSettingComponent(e,t)}changeStateWithoutSettingComponent(e,t){this.state=e,this.componentStart=this.tokenIndex+t,this.tokenIndex+=t,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(e){this.rewind(),this.state=e}safeToken(e){return e<0&&(e=this.tokenList.length-e),e<this.tokenList.length?this.tokenList[e]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(e,t){let r=this.safeToken(e);return r.value===t&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if(this.tokenList[this.tokenIndex].value!=="?")return!1;let e=this.safeToken(this.tokenIndex-1);return e.type!=="NAME"&&e.type!=="REGEX"&&e.type!=="CLOSE"&&e.type!=="ASTERISK"}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return this.tokenList[this.tokenIndex].type=="OPEN"}isGroupClose(){return this.tokenList[this.tokenIndex].type=="CLOSE"}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){let e=this.tokenList[this.tokenIndex],t=this.safeToken(this.componentStart).index;return this.input.substring(t,e.index)}computeShouldTreatAsStandardURL(){let e={};Object.assign(e,k),e.encodePart=X;let t=et(this.makeComponentString(),void 0,e);this.shouldTreatAsStandardURL=Ie(t)}},J=["protocol","username","password","hostname","port","pathname","search","hash"],R="*";function ye(e,t){if(typeof e!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==""?r.search.substring(1,r.search.length):void 0,hash:r.hash!==""?r.hash.substring(1,r.hash.length):void 0}}function C(e,t){return t?O(e):e}function F(e,t,r){let n;if(typeof t.baseURL=="string")try{n=new URL(t.baseURL),e.protocol=C(n.protocol.substring(0,n.protocol.length-1),r),e.username=C(n.username,r),e.password=C(n.password,r),e.hostname=C(n.hostname,r),e.port=C(n.port,r),e.pathname=C(n.pathname,r),e.search=C(n.search.substring(1,n.search.length),r),e.hash=C(n.hash.substring(1,n.hash.length),r)}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol=="string"&&(e.protocol=lt(t.protocol,r)),typeof t.username=="string"&&(e.username=ut(t.username,r)),typeof t.password=="string"&&(e.password=ct(t.password,r)),typeof t.hostname=="string"&&(e.hostname=at(t.hostname,r)),typeof t.port=="string"&&(e.port=ht(t.port,e.protocol,r)),typeof t.pathname=="string"){if(e.pathname=t.pathname,n&&!nt(e.pathname,r)){let o=n.pathname.lastIndexOf("/");o>=0&&(e.pathname=C(n.pathname.substring(0,o+1),r)+e.pathname)}e.pathname=ft(e.pathname,e.protocol,r)}return typeof t.search=="string"&&(e.search=it(t.search,r)),typeof t.hash=="string"&&(e.hash=ot(t.hash,r)),e}function O(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function wt(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ct(e,t){t.delimiter??(t.delimiter="/#?"),t.prefixes??(t.prefixes="./"),t.sensitive??(t.sensitive=!1),t.strict??(t.strict=!1),t.end??(t.end=!0),t.start??(t.start=!0),t.endsWith="";let r=".*",n=`[^${wt(t.delimiter)}]+?`,o=/[$_\u200C\u200D\p{ID_Continue}]/u,u="";for(let i=0;i<e.length;++i){let s=e[i];if(s.type===3){if(s.modifier===3){u+=O(s.value);continue}u+=`{${O(s.value)}}${N(s.modifier)}`;continue}let c=s.hasCustomName(),a=!!s.suffix.length||!!s.prefix.length&&(s.prefix.length!==1||!t.prefixes.includes(s.prefix)),h=i>0?e[i-1]:null,l=i<e.length-1?e[i+1]:null;if(!a&&c&&s.type===1&&s.modifier===3&&l&&!l.prefix.length&&!l.suffix.length)if(l.type===3){let m=l.value.length>0?l.value[0]:"";a=o.test(m)}else a=!l.hasCustomName();if(!a&&!s.prefix.length&&h&&h.type===3){let m=h.value[h.value.length-1];a=t.prefixes.includes(m)}a&&(u+="{"),u+=O(s.prefix),c&&(u+=`:${s.name}`),s.type===2?u+=`(${s.value})`:s.type===1?c||(u+=`(${n})`):s.type===0&&(!c&&(!h||h.type===3||h.modifier!==3||a||s.prefix!=="")?u+="*":u+=`(${r})`),s.type===1&&c&&s.suffix.length&&o.test(s.suffix[0])&&(u+="\\"),u+=O(s.suffix),a&&(u+="}"),s.modifier!==3&&(u+=N(s.modifier))}return u}var B=class{constructor(e={},t,r){this.regexp={},this.names={},this.component_pattern={},this.parts={};try{let n;if(typeof t=="string"?n=t:r=t,typeof e=="string"){let s=new yt(e);if(s.parse(),e=s.result,n===void 0&&typeof e.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=n}else{if(!e||typeof e!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let o={ignoreCase:r.ignoreCase===!0},u={pathname:R,protocol:R,username:R,password:R,hostname:R,port:R,search:R,hash:R};this.pattern=F(u,e,!0),Ee(this.pattern.protocol)===this.pattern.port&&(this.pattern.port="");let i;for(i of J){if(!(i in this.pattern))continue;let s={},c=this.pattern[i];switch(this.names[i]=[],i){case"protocol":Object.assign(s,k),s.encodePart=X;break;case"username":Object.assign(s,k),s.encodePart=pt;break;case"password":Object.assign(s,k),s.encodePart=mt;break;case"hostname":Object.assign(s,tt),ke(c)?s.encodePart=Le:s.encodePart=Pe;break;case"port":Object.assign(s,k),s.encodePart=_e;break;case"pathname":Ie(this.regexp.protocol)?(Object.assign(s,rt,o),s.encodePart=dt):(Object.assign(s,k,o),s.encodePart=gt);break;case"search":Object.assign(s,k,o),s.encodePart=xt;break;case"hash":Object.assign(s,k,o),s.encodePart=St;break}try{this.parts[i]=Ce(c,s),this.regexp[i]=be(this.parts[i],this.names[i],s),this.component_pattern[i]=Ct(this.parts[i],s)}catch{throw new TypeError(`invalid ${i} pattern '${this.pattern[i]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}test(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{typeof e=="object"?r=F(r,e,!1):r=F(r,ye(e,t),!1)}catch{return!1}let n;for(n of J)if(!this.regexp[n].exec(r[n]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{typeof e=="object"?r=F(r,e,!1):r=F(r,ye(e,t),!1)}catch{return null}let n={};t?n.inputs=[e,t]:n.inputs=[e];let o;for(o of J){let u=this.regexp[o].exec(r[o]);if(!u)return null;let i={};for(let[s,c]of this.names[o].entries())if(typeof c=="string"||typeof c=="number"){let a=u[s+1];i[c]=a}n[o]={input:r[o]??"",groups:i}}return n}static compareComponent(e,t,r){let n=(s,c)=>{for(let a of["type","modifier","prefix","value","suffix"]){if(s[a]<c[a])return-1;if(s[a]===c[a])continue;return 1}return 0},o=new D(3,"","","","",3),u=new D(0,"","","","",3),i=(s,c)=>{let a=0;for(;a<Math.min(s.length,c.length);++a){let h=n(s[a],c[a]);if(h)return h}return s.length===c.length?0:n(s[a]??o,c[a]??o)};return!t.component_pattern[e]&&!r.component_pattern[e]?0:t.component_pattern[e]&&!r.component_pattern[e]?i(t.parts[e],[u]):!t.component_pattern[e]&&r.component_pattern[e]?i([u],r.parts[e]):i(t.parts[e],r.parts[e])}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=B);var Ne=(e,t)=>{var i;if(e===void 0)return{};let r=t.endsWith("/")?t.slice(0,-1):t,o=(i=new B({pathname:e,baseURL:r}).exec(r))==null?void 0:i.pathname.groups;return o?Object.entries(o).reduce((s,[c,a])=>a===void 0?s:{...s,[c]:a},{}):{}};var G=e=>e.headers.get(ce)||"";import{env as bt}from"process";var Ae=()=>({region:bt.AWS_REGION});import{env as Y}from"process";var Te=()=>({id:Y.SITE_ID,name:Y.SITE_NAME,url:Y.URL});var Rt=e=>{let t=JSON.stringify(e);return new Response(t,{headers:{"content-type":"application/json"}})},$e=(e,t,r)=>{let n={};try{n=Ne(e[_],e.url)}catch{console.log(`Could not parse function route ${e[_]}.`)}let o={enqueuedPromises:[]};return{context:{account:ee(e.headers.get(ne)),cookies:t.getPublicInterface(),deploy:he(e.headers),flags:me(e),geo:ge(e.headers.get(re)),ip:xe(e.headers.get(te)),json:Rt,log:console.log,next:()=>{throw new Error("`context.next` is not implemented for serverless functions")},params:n,requestId:G(e),rewrite:i=>{let s=kt(i,e.url);return vt(s)},server:Ae(),site:Te(),waitUntil:r?i=>{o.enqueuedPromises.push(i)}:void 0},state:o}},kt=(e,t)=>{if(e instanceof URL)return e;if(e.startsWith("/")){let r=new URL(t);return r.pathname=e,r}return new URL(e)},vt=async e=>await fetch(e);import Oe from"node:assert";function Fe(e){function t(a,h=2){return a.padStart(h,"0")}let r=t(e.getUTCDate().toString()),n=t(e.getUTCHours().toString()),o=t(e.getUTCMinutes().toString()),u=t(e.getUTCSeconds().toString()),i=e.getUTCFullYear(),s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return`${s[e.getUTCDay()]}, ${r} ${c[e.getUTCMonth()]} ${i} ${n}:${o}:${u} GMT`}var It=/^(?=[\u0020-\u007E]*$)[^()@<>,;:\\"[\]?={}\s]+$/;function Et(e){if(!e.name)return"";let t=[];if(Pt(e.name),_t(e.name,e.value),t.push(`${e.name}=${e.value}`),e.name.startsWith("__Secure")&&(e.secure=!0),e.name.startsWith("__Host")&&(e.path="/",e.secure=!0,delete e.domain),e.secure&&t.push("Secure"),e.httpOnly&&t.push("HttpOnly"),typeof e.maxAge=="number"&&Number.isInteger(e.maxAge)&&(Oe(e.maxAge>=0,"Max-Age must be an integer superior or equal to 0"),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(Nt(e.domain),t.push(`Domain=${e.domain}`)),e.sameSite&&t.push(`SameSite=${e.sameSite}`),e.path&&(Lt(e.path),t.push(`Path=${e.path}`)),e.expires){let{expires:r}=e,n=Fe(typeof r=="number"?new Date(r):r);t.push(`Expires=${n}`)}return e.unparsed&&t.push(e.unparsed.join("; ")),t.join("; ")}function Pt(e){if(e&&!It.test(e))throw new TypeError(`Invalid cookie name: "${e}".`)}function Lt(e){if(e!=null)for(let t=0;t<e.length;t++){let r=e.charAt(t);if(r<" "||r>"~"||r==";")throw new Error(`${e}: Invalid cookie path char '${r}'`)}}function _t(e,t){if(!(t==null||e==null))for(let r=0;r<t.length;r++){let n=t.charAt(r);if(n<"!"||n=='"'||n==","||n==";"||n=="\\"||n=="\x7F")throw new Error(`RFC2616 cookie '${e}' cannot contain character '${n}'`);if(n>"\x80")throw new Error(`RFC2616 cookie '${e}' can only have US-ASCII chars as value${n.charCodeAt(0).toString(16)}`)}}function Nt(e){if(e==null)return;let t=e.charAt(0),r=e.charAt(e.length-1);if(t=="-"||r=="."||r=="-")throw new Error(`Invalid first/last char in cookie domain: ${e}`)}function De(e){let t=e.get("Cookie");if(t!=null){let r={},n=t.split(";");for(let o of n){let[u,...i]=o.split("=");Oe(u!=null);let s=u.trim();r[s]=i.join("=")}return r}return{}}function Q(e,t){let r=Et(t);r&&e.append("Set-Cookie",r)}function Ue(e,t,r){Q(e,Object.assign({name:t,value:"",expires:new Date(0)},r))}var W=class{constructor(t){this.ops=[],this.request=t}apply(t){this.ops.forEach(r=>{switch(r.type){case"delete":Ue(t.headers,r.options.name,{domain:r.options.domain,path:r.options.path});break;case"set":Q(t.headers,r.cookie);break;default:}})}delete(t){let r={path:"/"},n=typeof t=="string"?{name:t}:t;this.ops.push({options:{...r,...n},type:"delete"})}get(t){return De(this.request.headers)[t]}getPublicInterface(){return{delete:this.delete.bind(this),get:this.get.bind(this),set:this.set.bind(this)}}set(t,r){let n;if(typeof t=="string"){if(typeof r!="string")throw new TypeError("You must provide the cookie value as a string to 'cookies.set'");n={name:t,value:r}}else n=t;this.ops.push({cookie:n,type:"set"})}};import{Buffer as qe}from"node:buffer";import He from"node:process";var At="NETLIFY_PURGE_API_TOKEN",Tt="NETLIFY_BLOBS_CONTEXT",je=(e,t,r)=>{var u,i;let{blobs:n}=t,o=(i=(u=r==null?void 0:r.clientContext)==null?void 0:u.custom)==null?void 0:i.purge_api_token;if(typeof n=="string"&&n!=="")try{let s=qe.from(n,"base64").toString("utf8"),c=JSON.parse(s),a=e.get(ie),h=e.get(H);He.env[Tt]=qe.from(JSON.stringify({edgeURL:c.url,uncachedEdgeURL:c.url_uncached,token:c.token,siteID:a,deployID:h,primaryRegion:c.primary_region})).toString("base64")}catch(s){console.error("An internal error occurred while setting up Netlify Blobs:",s)}typeof o=="string"&&o!==""&&(He.env[At]=o)};var V=class e extends Error{constructor(t){super(t),this.name="NetlifyUserError",Object.setPrototypeOf(this,e.prototype)}};import Ot from"node:http";import Dt from"node:https";import{AsyncLocalStorage as $t}from"node:async_hooks";var I=new $t;import{env as Ft}from"node:process";var U=(e,t)=>{Ft.NETLIFY_DEV||console.log("__nfSystemLog",{msg:e,fields:t})};var Ut=globalThis.fetch,Me=!1,Be=e=>{let t=I.getStore();if(t!=null&&t.cdnLoopHeader){if(e.headersSent){U("Headers already sent, cannot add CDN-Loop header");return}e.setHeader("CDN-Loop",t==null?void 0:t.cdnLoopHeader)}},Ge=()=>{if(!Me){Me=!0,globalThis.fetch=function(t,r){let n=new Request(t,r),o=I.getStore();return o!=null&&o.cdnLoopHeader&&n.headers.set("CDN-Loop",o.cdnLoopHeader),Ut(n)};for(let e of[Ot,Dt]){let t=e.request;e.get=function(...n){let o=t(...n);return Be(o),o.end(),o},e.request=function(...n){let o=t(...n);return Be(o),o}}}};import{promises as qt}from"node:fs";import{join as Ht}from"node:path";var jt="/tmp/nf_req_v1",We=(e,t)=>{if(!t){U("Failed to write request metadata file because AWS request ID is missing");return}let r=new URL(e.url),n=G(e),o={host:r.host,method:e.method,nf_req_id:n,ts:Date.now(),path:r.pathname},u=Ht(jt,t);return qt.writeFile(u,JSON.stringify(o)).catch(i=>{U("Failed to write request metadata file",{error:i.message})})};var Jt=zt(Wt),Kt=20,Xt=e=>awslambda.streamifyResponse(async(t,r,n)=>{let o=Bt.NETLIFY_LOCAL!==void 0,{body:u,httpMethod:i,flags:s,isBase64Encoded:c,headers:a,rawUrl:h,route:l}=t,m=new $(s||{}),A=ue(a),E=pe(u,c),P=m.get("serverless_functions_abort_signal")===!0?AbortSignal.timeout(n.getRemainingTimeInMillis()-Kt):void 0,w=new j(h,{body:E,headers:A,method:i,signal:P}),L=m.get("serverless_functions_metadata_file")===!0&&!o?We(w,n.awsRequestId):null;je(A,t,n),de(w,m),l&&(w[_]=l),m.get("serverless_functions_request_interceptor_v2")===!0&&Ge(),m.get("serverless_functions_wait_event_loop")===!0&&(n.callbackWaitsForEmptyEventLoop=!1);let T=m.get("serverless_functions_context_waituntil")===!0,f=new W(w),{context:p,state:d}=$e(w,f,T);try{let S=await I.run({cdnLoopHeader:A.get("cdn-loop"),context:p},()=>e.default(w,p));await Yt(S,r,f,m)}catch(S){throw await L,S}if(T&&d.enqueuedPromises.length!==0)try{await Promise.allSettled(d.enqueuedPromises)}catch(S){console.error(S)}await L}),Yt=async(e,t,r,n)=>{let o={version:Gt},u=Mt.from(JSON.stringify(o)).toString("base64");if(e instanceof Response){r.apply(e);let i=new Headers(e.headers),{body:s,status:c}=e,a=n.evaluations;a.size!==0&&i.set(ae,[...a].join(",")),i.set(z,u);let h={multiValueHeaders:fe(i),statusCode:c},l=awslambda.HttpResponseStream.from(t,h);if((n.get("serverless_functions_fix_empty_body")===!0||s===null)&&l.write(""),s===null){l.end();return}let m=Vt.fromWeb(s);await Jt(m,l);return}if(e===void 0){let i=awslambda.HttpResponseStream.from(t,{statusCode:204,headers:{[z]:u}});i.write(""),i.end();return}throw new V("Function returned an unsupported value. Accepted types are 'Response' or 'undefined'")};import q from"process";var Qt={delete:e=>{delete q.env[e]},get:e=>q.env[e],has:e=>!!q.env[e],set:(e,t)=>{q.env[e]=t},toObject:()=>Object.entries(q.env).reduce((e,[t,r])=>r===void 0?e:{...e,[t]:r},{})},Ve={get context(){let e=I.getStore();return(e==null?void 0:e.context)??null},env:Qt};globalThis.Netlify=Ve;var Zt=()=>Ve;var On=()=>er(import.meta.url);export{Xt as getLambdaHandler,Zt as getNetlifyGlobal,On as getPath};
import{fileURLToPath as nr}from"url";import{Buffer as zt}from"node:buffer";import Je from"node:process";import{pipeline as Jt,Readable as Kt}from"node:stream";import{promisify as Xt}from"node:util";var ne=e=>({id:e??""});var se="x-nf-client-connection-ip",ie="x-nf-geo",oe="x-nf-account-id",H="x-nf-deploy-id",ae="x-nf-deploy-context",ce="x-nf-deploy-published",ue="x-nf-site-id",he="x-nf-request-flags",z="x-nf-invocation-metadata",fe="x-nf-request-id",le=e=>{let t=new Headers;return Object.entries(e).forEach(([r,n])=>{n!==void 0&&t.set(r.toLowerCase(),n)}),t},pe=e=>{let t={};for(let[r,n]of e.entries())r in t?t[r].push(n):t[r]=[n];return t};var me=e=>({context:e.get(ae)??"",id:e.get(H)??"",published:e.get(ce)==="1"});import{Buffer as Ye}from"buffer";var M=Symbol("Request flags"),_=Symbol("Request route"),Qe=typeof Request>"u"?class{}:Request,de,j=class extends(de=Qe,M,_,de){},ge=(e,t)=>{if(!(e==null||e===""))return t?Ye.from(e,"base64"):e};var $=class{#e;#t;constructor(t){this.#e=new Set,this.#t=t}get(t){let r=this.#t[t];return r!==void 0&&this.#e.add(t),r}get evaluations(){return this.#e}},xe=e=>e[M]??new $({}),Se=(e,t)=>{e[M]=t};import{Buffer as Ze}from"node:buffer";var ye=e=>{if(e===null)return{};try{return JSON.parse(Ze.from(e,"base64").toString("utf-8"))}catch{return{}}};var we=e=>e??"";var D=class{constructor(e,t,r,n,i,u){this.type=3,this.name="",this.prefix="",this.value="",this.suffix="",this.modifier=3,this.type=e,this.name=t,this.prefix=r,this.value=n,this.suffix=i,this.modifier=u}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},et=/[$_\p{ID_Start}]/u,tt=/[$_\u200C\u200D\p{ID_Continue}]/u,K=".*";function rt(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function Re(e,t=!1){let r=[],n=0;for(;n<e.length;){let i=e[n],u=function(o){if(!t)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})};if(i==="*"){r.push({type:"ASTERISK",index:n,value:e[n++]});continue}if(i==="+"||i==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:e[n++]});continue}if(i==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});continue}if(i==="{"){r.push({type:"OPEN",index:n,value:e[n++]});continue}if(i==="}"){r.push({type:"CLOSE",index:n,value:e[n++]});continue}if(i===":"){let o="",s=n+1;for(;s<e.length;){let c=e.substr(s,1);if(s===n+1&&et.test(c)||s!==n+1&&tt.test(c)){o+=e[s++];continue}break}if(!o){u(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:o}),n=s;continue}if(i==="("){let o=1,s="",c=n+1,a=!1;if(e[c]==="?"){u(`Pattern cannot start with "?" at ${c}`);continue}for(;c<e.length;){if(!rt(e[c],!1)){u(`Invalid character '${e[c]}' at ${c}.`),a=!0;break}if(e[c]==="\\"){s+=e[c++]+e[c++];continue}if(e[c]===")"){if(o--,o===0){c++;break}}else if(e[c]==="("&&(o++,e[c+1]!=="?")){u(`Capturing groups are not allowed at ${c}`),a=!0;break}s+=e[c++]}if(a)continue;if(o){u(`Unbalanced pattern at ${n}`);continue}if(!s){u(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:s}),n=c;continue}r.push({type:"CHAR",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function ke(e,t={}){let r=Re(e);t.delimiter??(t.delimiter="/#?"),t.prefixes??(t.prefixes="./");let n=`[^${y(t.delimiter)}]+?`,i=[],u=0,o=0,s="",c=new Set,a=h=>{if(o<r.length&&r[o].type===h)return r[o++].value},f=()=>a("OTHER_MODIFIER")??a("ASTERISK"),l=h=>{let p=a(h);if(p!==void 0)return p;let{type:d,index:S}=r[o];throw new TypeError(`Unexpected ${d} at ${S}, expected ${h}`)},m=()=>{let h="",p;for(;p=a("CHAR")??a("ESCAPED_CHAR");)h+=p;return h},N=h=>h,I=t.encodePart||N,P="",w=h=>{P+=h},L=()=>{P.length&&(i.push(new D(3,"","",I(P),"",3)),P="")},T=(h,p,d,S,re)=>{let g=3;switch(re){case"?":g=1;break;case"*":g=0;break;case"+":g=2;break}if(!p&&!d&&g===3){w(h);return}if(L(),!p&&!d){if(!h)return;i.push(new D(3,"","",I(h),"",g));return}let x;d?d==="*"?x=K:x=d:x=n;let v=2;x===n?(v=1,x=""):x===K&&(v=0,x="");let b;if(p?b=p:d&&(b=u++),c.has(b))throw new TypeError(`Duplicate name '${b}'.`);c.add(b),i.push(new D(v,b,I(h),x,I(S),g))};for(;o<r.length;){let h=a("CHAR"),p=a("NAME"),d=a("REGEX");if(!p&&!d&&(d=a("ASTERISK")),p||d){let g=h??"";t.prefixes.indexOf(g)===-1&&(w(g),g=""),L();let x=f();T(g,p,d,"",x);continue}let S=h??a("ESCAPED_CHAR");if(S){w(S);continue}if(a("OPEN")){let g=m(),x=a("NAME"),v=a("REGEX");!x&&!v&&(v=a("ASTERISK"));let b=m();l("CLOSE");let Xe=f();T(g,x,v,b,Xe);continue}L(),l("END")}return i}function y(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ce(e){return e&&e.ignoreCase?"ui":"u"}function nt(e,t,r){return ve(ke(e,r),t,r)}function A(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function ve(e,t,r={}){r.delimiter??(r.delimiter="/#?"),r.prefixes??(r.prefixes="./"),r.sensitive??(r.sensitive=!1),r.strict??(r.strict=!1),r.end??(r.end=!0),r.start??(r.start=!0),r.endsWith="";let n=r.start?"^":"";for(let s of e){if(s.type===3){s.modifier===3?n+=y(s.value):n+=`(?:${y(s.value)})${A(s.modifier)}`;continue}t&&t.push(s.name);let c=`[^${y(r.delimiter)}]+?`,a=s.value;if(s.type===1?a=c:s.type===0&&(a=K),!s.prefix.length&&!s.suffix.length){s.modifier===3||s.modifier===1?n+=`(${a})${A(s.modifier)}`:n+=`((?:${a})${A(s.modifier)})`;continue}if(s.modifier===3||s.modifier===1){n+=`(?:${y(s.prefix)}(${a})${y(s.suffix)})`,n+=A(s.modifier);continue}n+=`(?:${y(s.prefix)}`,n+=`((?:${a})(?:`,n+=y(s.suffix),n+=y(s.prefix),n+=`(?:${a}))*)${y(s.suffix)})`,s.modifier===0&&(n+="?")}let i=`[${y(r.endsWith)}]|$`,u=`[${y(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${u}?`),r.endsWith.length?n+=`(?=${i})`:n+="$",new RegExp(n,Ce(r));r.strict||(n+=`(?:${u}(?=${i}))?`);let o=!1;if(e.length){let s=e[e.length-1];s.type===3&&s.modifier===3&&(o=r.delimiter.indexOf(s)>-1)}return o||(n+=`(?=${u}|${i})`),new RegExp(n,Ce(r))}var k={delimiter:"",prefixes:"",sensitive:!0,strict:!0},st={delimiter:".",prefixes:"",sensitive:!0,strict:!0},it={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function ot(e,t){return e.length?e[0]==="/"?!0:!t||e.length<2?!1:(e[0]=="\\"||e[0]=="{")&&e[1]=="/":!1}function Ee(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function at(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function Ie(e){return!e||e.length<2?!1:e[0]==="["||(e[0]==="\\"||e[0]==="{")&&e[1]==="["}var Pe=["ftp","file","http","https","ws","wss"];function Le(e){if(!e)return!0;for(let t of Pe)if(e.test(t))return!0;return!1}function ct(e,t){if(e=Ee(e,"#"),t||e==="")return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function ut(e,t){if(e=Ee(e,"?"),t||e==="")return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function ht(e,t){return t||e===""?e:Ie(e)?Ne(e):Ae(e)}function ft(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.password=e,r.password}function lt(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}function pt(e,t,r){if(r||e==="")return e;if(t&&!Pe.includes(t))return new URL(`${t}:${e}`).pathname;let n=e[0]=="/";return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}function mt(e,t,r){return _e(t)===e&&(e=""),r||e===""?e:Te(e)}function dt(e,t){return e=at(e,":"),t||e===""?e:X(e)}function _e(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function X(e){if(e==="")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function gt(e){if(e==="")return e;let t=new URL("https://example.com");return t.username=e,t.username}function xt(e){if(e==="")return e;let t=new URL("https://example.com");return t.password=e,t.password}function Ae(e){if(e==="")return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function Ne(e){if(e==="")return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function Te(e){if(e===""||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function St(e){if(e==="")return e;let t=new URL("https://example.com");return t.pathname=e[0]!=="/"?"/-"+e:e,e[0]!=="/"?t.pathname.substring(2,t.pathname.length):t.pathname}function yt(e){return e===""?e:new URL(`data:${e}`).pathname}function wt(e){if(e==="")return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function Ct(e){if(e==="")return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}var bt=class{constructor(e){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=e}get result(){return this.internalResult}parse(){for(this.tokenList=Re(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,this.tokenList[this.tokenIndex].type==="END"){if(this.state===0){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}else if(this.state===2){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0)if(this.isGroupClose())this.groupDepth-=1;else continue;if(this.isGroupOpen()){this.groupDepth+=1;continue}switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let e=7,t=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(e=2,t=3):this.shouldTreatAsStandardURL&&(e=2),this.changeState(e,t)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1);break;case 9:break;case 10:break}}}changeState(e,t){switch(this.state){case 0:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 2:break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString();break;case 10:break}this.changeStateWithoutSettingComponent(e,t)}changeStateWithoutSettingComponent(e,t){this.state=e,this.componentStart=this.tokenIndex+t,this.tokenIndex+=t,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(e){this.rewind(),this.state=e}safeToken(e){return e<0&&(e=this.tokenList.length-e),e<this.tokenList.length?this.tokenList[e]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(e,t){let r=this.safeToken(e);return r.value===t&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if(this.tokenList[this.tokenIndex].value!=="?")return!1;let e=this.safeToken(this.tokenIndex-1);return e.type!=="NAME"&&e.type!=="REGEX"&&e.type!=="CLOSE"&&e.type!=="ASTERISK"}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return this.tokenList[this.tokenIndex].type=="OPEN"}isGroupClose(){return this.tokenList[this.tokenIndex].type=="CLOSE"}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){let e=this.tokenList[this.tokenIndex],t=this.safeToken(this.componentStart).index;return this.input.substring(t,e.index)}computeShouldTreatAsStandardURL(){let e={};Object.assign(e,k),e.encodePart=X;let t=nt(this.makeComponentString(),void 0,e);this.shouldTreatAsStandardURL=Le(t)}},J=["protocol","username","password","hostname","port","pathname","search","hash"],R="*";function be(e,t){if(typeof e!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==""?r.search.substring(1,r.search.length):void 0,hash:r.hash!==""?r.hash.substring(1,r.hash.length):void 0}}function C(e,t){return t?O(e):e}function F(e,t,r){let n;if(typeof t.baseURL=="string")try{n=new URL(t.baseURL),e.protocol=C(n.protocol.substring(0,n.protocol.length-1),r),e.username=C(n.username,r),e.password=C(n.password,r),e.hostname=C(n.hostname,r),e.port=C(n.port,r),e.pathname=C(n.pathname,r),e.search=C(n.search.substring(1,n.search.length),r),e.hash=C(n.hash.substring(1,n.hash.length),r)}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol=="string"&&(e.protocol=dt(t.protocol,r)),typeof t.username=="string"&&(e.username=lt(t.username,r)),typeof t.password=="string"&&(e.password=ft(t.password,r)),typeof t.hostname=="string"&&(e.hostname=ht(t.hostname,r)),typeof t.port=="string"&&(e.port=mt(t.port,e.protocol,r)),typeof t.pathname=="string"){if(e.pathname=t.pathname,n&&!ot(e.pathname,r)){let i=n.pathname.lastIndexOf("/");i>=0&&(e.pathname=C(n.pathname.substring(0,i+1),r)+e.pathname)}e.pathname=pt(e.pathname,e.protocol,r)}return typeof t.search=="string"&&(e.search=ut(t.search,r)),typeof t.hash=="string"&&(e.hash=ct(t.hash,r)),e}function O(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function Rt(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function kt(e,t){t.delimiter??(t.delimiter="/#?"),t.prefixes??(t.prefixes="./"),t.sensitive??(t.sensitive=!1),t.strict??(t.strict=!1),t.end??(t.end=!0),t.start??(t.start=!0),t.endsWith="";let r=".*",n=`[^${Rt(t.delimiter)}]+?`,i=/[$_\u200C\u200D\p{ID_Continue}]/u,u="";for(let o=0;o<e.length;++o){let s=e[o];if(s.type===3){if(s.modifier===3){u+=O(s.value);continue}u+=`{${O(s.value)}}${A(s.modifier)}`;continue}let c=s.hasCustomName(),a=!!s.suffix.length||!!s.prefix.length&&(s.prefix.length!==1||!t.prefixes.includes(s.prefix)),f=o>0?e[o-1]:null,l=o<e.length-1?e[o+1]:null;if(!a&&c&&s.type===1&&s.modifier===3&&l&&!l.prefix.length&&!l.suffix.length)if(l.type===3){let m=l.value.length>0?l.value[0]:"";a=i.test(m)}else a=!l.hasCustomName();if(!a&&!s.prefix.length&&f&&f.type===3){let m=f.value[f.value.length-1];a=t.prefixes.includes(m)}a&&(u+="{"),u+=O(s.prefix),c&&(u+=`:${s.name}`),s.type===2?u+=`(${s.value})`:s.type===1?c||(u+=`(${n})`):s.type===0&&(!c&&(!f||f.type===3||f.modifier!==3||a||s.prefix!=="")?u+="*":u+=`(${r})`),s.type===1&&c&&s.suffix.length&&i.test(s.suffix[0])&&(u+="\\"),u+=O(s.suffix),a&&(u+="}"),s.modifier!==3&&(u+=A(s.modifier))}return u}var B=class{constructor(e={},t,r){this.regexp={},this.names={},this.component_pattern={},this.parts={};try{let n;if(typeof t=="string"?n=t:r=t,typeof e=="string"){let s=new bt(e);if(s.parse(),e=s.result,n===void 0&&typeof e.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=n}else{if(!e||typeof e!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let i={ignoreCase:r.ignoreCase===!0},u={pathname:R,protocol:R,username:R,password:R,hostname:R,port:R,search:R,hash:R};this.pattern=F(u,e,!0),_e(this.pattern.protocol)===this.pattern.port&&(this.pattern.port="");let o;for(o of J){if(!(o in this.pattern))continue;let s={},c=this.pattern[o];switch(this.names[o]=[],o){case"protocol":Object.assign(s,k),s.encodePart=X;break;case"username":Object.assign(s,k),s.encodePart=gt;break;case"password":Object.assign(s,k),s.encodePart=xt;break;case"hostname":Object.assign(s,st),Ie(c)?s.encodePart=Ne:s.encodePart=Ae;break;case"port":Object.assign(s,k),s.encodePart=Te;break;case"pathname":Le(this.regexp.protocol)?(Object.assign(s,it,i),s.encodePart=St):(Object.assign(s,k,i),s.encodePart=yt);break;case"search":Object.assign(s,k,i),s.encodePart=wt;break;case"hash":Object.assign(s,k,i),s.encodePart=Ct;break}try{this.parts[o]=ke(c,s),this.regexp[o]=ve(this.parts[o],this.names[o],s),this.component_pattern[o]=kt(this.parts[o],s)}catch{throw new TypeError(`invalid ${o} pattern '${this.pattern[o]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}test(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{typeof e=="object"?r=F(r,e,!1):r=F(r,be(e,t),!1)}catch{return!1}let n;for(n of J)if(!this.regexp[n].exec(r[n]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{typeof e=="object"?r=F(r,e,!1):r=F(r,be(e,t),!1)}catch{return null}let n={};t?n.inputs=[e,t]:n.inputs=[e];let i;for(i of J){let u=this.regexp[i].exec(r[i]);if(!u)return null;let o={};for(let[s,c]of this.names[i].entries())if(typeof c=="string"||typeof c=="number"){let a=u[s+1];o[c]=a}n[i]={input:r[i]??"",groups:o}}return n}static compareComponent(e,t,r){let n=(s,c)=>{for(let a of["type","modifier","prefix","value","suffix"]){if(s[a]<c[a])return-1;if(s[a]===c[a])continue;return 1}return 0},i=new D(3,"","","","",3),u=new D(0,"","","","",3),o=(s,c)=>{let a=0;for(;a<Math.min(s.length,c.length);++a){let f=n(s[a],c[a]);if(f)return f}return s.length===c.length?0:n(s[a]??i,c[a]??i)};return!t.component_pattern[e]&&!r.component_pattern[e]?0:t.component_pattern[e]&&!r.component_pattern[e]?o(t.parts[e],[u]):!t.component_pattern[e]&&r.component_pattern[e]?o([u],r.parts[e]):o(t.parts[e],r.parts[e])}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=B);var $e=(e,t)=>{var o;if(e===void 0)return{};let r=t.endsWith("/")?t.slice(0,-1):t,i=(o=new B({pathname:e,baseURL:r}).exec(r))==null?void 0:o.pathname.groups;return i?Object.entries(i).reduce((s,[c,a])=>a===void 0?s:{...s,[c]:a},{}):{}};var G=e=>e.headers.get(fe)||"";import{env as vt}from"process";var Fe=()=>({region:vt.AWS_REGION});import{env as Y}from"process";var Oe=()=>({id:Y.SITE_ID,name:Y.SITE_NAME,url:Y.URL});var Et=e=>{let t=JSON.stringify(e);return new Response(t,{headers:{"content-type":"application/json"}})},De=(e,t,r)=>{let n={};try{n=$e(e[_],e.url)}catch{console.log(`Could not parse function route ${e[_]}.`)}let i={enqueuedPromises:[]};return{context:{account:ne(e.headers.get(oe)),cookies:t.getPublicInterface(),deploy:me(e.headers),flags:xe(e),geo:ye(e.headers.get(ie)),ip:we(e.headers.get(se)),json:Et,log:console.log,next:()=>{throw new Error("`context.next` is not implemented for serverless functions")},params:n,requestId:G(e),rewrite:o=>{let s=It(o,e.url);return Pt(s)},server:Fe(),site:Oe(),waitUntil:r?o=>{i.enqueuedPromises.push(o)}:void 0},state:i}},It=(e,t)=>{if(e instanceof URL)return e;if(e.startsWith("/")){let r=new URL(t);return r.pathname=e,r}return new URL(e)},Pt=async e=>await fetch(e);import qe from"node:assert";function Ue(e){function t(a,f=2){return a.padStart(f,"0")}let r=t(e.getUTCDate().toString()),n=t(e.getUTCHours().toString()),i=t(e.getUTCMinutes().toString()),u=t(e.getUTCSeconds().toString()),o=e.getUTCFullYear(),s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return`${s[e.getUTCDay()]}, ${r} ${c[e.getUTCMonth()]} ${o} ${n}:${i}:${u} GMT`}var Lt=/^(?=[\u0020-\u007E]*$)[^()@<>,;:\\"[\]?={}\s]+$/;function _t(e){if(!e.name)return"";let t=[];if(At(e.name),Tt(e.name,e.value),t.push(`${e.name}=${e.value}`),e.name.startsWith("__Secure")&&(e.secure=!0),e.name.startsWith("__Host")&&(e.path="/",e.secure=!0,delete e.domain),e.secure&&t.push("Secure"),e.httpOnly&&t.push("HttpOnly"),typeof e.maxAge=="number"&&Number.isInteger(e.maxAge)&&(qe(e.maxAge>=0,"Max-Age must be an integer superior or equal to 0"),t.push(`Max-Age=${e.maxAge}`)),e.domain&&($t(e.domain),t.push(`Domain=${e.domain}`)),e.sameSite&&t.push(`SameSite=${e.sameSite}`),e.path&&(Nt(e.path),t.push(`Path=${e.path}`)),e.expires){let{expires:r}=e,n=Ue(typeof r=="number"?new Date(r):r);t.push(`Expires=${n}`)}return e.unparsed&&t.push(e.unparsed.join("; ")),t.join("; ")}function At(e){if(e&&!Lt.test(e))throw new TypeError(`Invalid cookie name: "${e}".`)}function Nt(e){if(e!=null)for(let t=0;t<e.length;t++){let r=e.charAt(t);if(r<" "||r>"~"||r==";")throw new Error(`${e}: Invalid cookie path char '${r}'`)}}function Tt(e,t){if(!(t==null||e==null))for(let r=0;r<t.length;r++){let n=t.charAt(r);if(n<"!"||n=='"'||n==","||n==";"||n=="\\"||n=="\x7F")throw new Error(`RFC2616 cookie '${e}' cannot contain character '${n}'`);if(n>"\x80")throw new Error(`RFC2616 cookie '${e}' can only have US-ASCII chars as value${n.charCodeAt(0).toString(16)}`)}}function $t(e){if(e==null)return;let t=e.charAt(0),r=e.charAt(e.length-1);if(t=="-"||r=="."||r=="-")throw new Error(`Invalid first/last char in cookie domain: ${e}`)}function He(e){let t=e.get("Cookie");if(t!=null){let r={},n=t.split(";");for(let i of n){let[u,...o]=i.split("=");qe(u!=null);let s=u.trim();r[s]=o.join("=")}return r}return{}}function Q(e,t){let r=_t(t);r&&e.append("Set-Cookie",r)}function je(e,t,r){Q(e,Object.assign({name:t,value:"",expires:new Date(0)},r))}var W=class{constructor(t){this.ops=[],this.request=t}apply(t){this.ops.forEach(r=>{switch(r.type){case"delete":je(t.headers,r.options.name,{domain:r.options.domain,path:r.options.path});break;case"set":Q(t.headers,r.cookie);break;default:}})}delete(t){let r={path:"/"},n=typeof t=="string"?{name:t}:t;this.ops.push({options:{...r,...n},type:"delete"})}get(t){return He(this.request.headers)[t]}getPublicInterface(){return{delete:this.delete.bind(this),get:this.get.bind(this),set:this.set.bind(this)}}set(t,r){let n;if(typeof t=="string"){if(typeof r!="string")throw new TypeError("You must provide the cookie value as a string to 'cookies.set'");n={name:t,value:r}}else n=t;this.ops.push({cookie:n,type:"set"})}};import{Buffer as Me}from"node:buffer";import Be from"node:process";var Ft="NETLIFY_PURGE_API_TOKEN",Ot="NETLIFY_BLOBS_CONTEXT",Ge=(e,t,r)=>{var u,o;let{blobs:n}=t,i=(o=(u=r==null?void 0:r.clientContext)==null?void 0:u.custom)==null?void 0:o.purge_api_token;if(typeof n=="string"&&n!=="")try{let s=Me.from(n,"base64").toString("utf8"),c=JSON.parse(s),a=e.get(ue),f=e.get(H);Be.env[Ot]=Me.from(JSON.stringify({edgeURL:c.url,uncachedEdgeURL:c.url_uncached,token:c.token,siteID:a,deployID:f,primaryRegion:c.primary_region})).toString("base64")}catch(s){console.error("An internal error occurred while setting up Netlify Blobs:",s)}typeof i=="string"&&i!==""&&(Be.env[Ft]=i)};var V=class e extends Error{constructor(t){super(t),this.name="NetlifyUserError",Object.setPrototypeOf(this,e.prototype)}};import qt from"node:http";import Ht from"node:https";import{AsyncLocalStorage as Dt}from"node:async_hooks";var E=new Dt;import{env as Ut}from"node:process";var U=(e,t)=>{Ut.NETLIFY_DEV||console.log("__nfSystemLog",{msg:e,fields:t})};var jt=globalThis.fetch,We=!1,Ve=e=>{let t=E.getStore();if(t!=null&&t.cdnLoopHeader){if(e.headersSent){U("Headers already sent, cannot add CDN-Loop header");return}e.setHeader("CDN-Loop",t==null?void 0:t.cdnLoopHeader)}},ze=()=>{if(!We){We=!0,globalThis.fetch=function(t,r){let n=new Request(t,r),i=E.getStore();return i!=null&&i.cdnLoopHeader&&n.headers.set("CDN-Loop",i.cdnLoopHeader),jt(n)};for(let e of[qt,Ht]){let t=e.request;e.get=function(...n){let i=t(...n);return Ve(i),i.end(),i},e.request=function(...n){let i=t(...n);return Ve(i),i}}}};import{promises as Mt,writeFileSync as Bt}from"node:fs";import{join as Gt}from"node:path";import Z from"node:process";var Wt=".error",Vt="/tmp/nf_req_v1",ee=class e{constructor(){this.entries=new Map}static getFilePath(t,r=""){return Gt(Vt,t+r)}async save(t,r){if(!r){U("Failed to write request metadata file because AWS request ID is missing");return}let n=new URL(t.url),i=G(t),u={host:n.host,method:t.method,nf_req_id:i,ts:Date.now(),path:n.pathname};this.entries.set(i,u);try{let o=e.getFilePath(r);await Mt.writeFile(o,JSON.stringify(u))}catch(o){U("Failed to write request metadata file",{error:o.message})}this.entries.delete(i)}flush(){for(let[t,r]of this.entries){let n=e.getFilePath(t,Wt);try{Bt(n,JSON.stringify(r))}catch{}}}},te=new ee;if(Z.env.NETLIFY_LOCAL===void 0){let e=t=>{te.flush();let r=Z.listeners("uncaughtException"),n=r.indexOf(e);if(!r[n+1])throw t};Z.on("uncaughtException",e)}var Yt=Xt(Jt),Qt=20,Zt=e=>awslambda.streamifyResponse(async(t,r,n)=>{let i=Je.env.NETLIFY_LOCAL!==void 0,{body:u,httpMethod:o,flags:s,isBase64Encoded:c,headers:a,rawUrl:f,route:l}=t,m=new $(s||{}),N=le(a),I=ge(u,c),P=m.get("serverless_functions_abort_signal")===!0?AbortSignal.timeout(n.getRemainingTimeInMillis()-Qt):void 0,w=new j(f,{body:I,headers:N,method:o,signal:P}),L=m.get("serverless_functions_metadata_file")===!0&&!i?te.save(w,n.awsRequestId):null;Ge(N,t,n),Se(w,m),l&&(w[_]=l),m.get("serverless_functions_request_interceptor_v2")===!0&&ze(),m.get("serverless_functions_wait_event_loop")===!0&&(n.callbackWaitsForEmptyEventLoop=!1);let T=m.get("serverless_functions_context_waituntil")===!0,h=new W(w),{context:p,state:d}=De(w,h,T);try{let S=await E.run({cdnLoopHeader:N.get("cdn-loop"),context:p},()=>e.default(w,p));await er(S,r,h,m)}catch(S){throw await L,S}if(T&&d.enqueuedPromises.length!==0)try{await Promise.allSettled(d.enqueuedPromises)}catch(S){console.error(S)}await L}),er=async(e,t,r,n)=>{let i={version:Je.version},u=zt.from(JSON.stringify(i)).toString("base64");if(e instanceof Response){r.apply(e);let o=new Headers(e.headers),{body:s,status:c}=e,a=n.evaluations;a.size!==0&&o.set(he,[...a].join(",")),o.set(z,u);let f={multiValueHeaders:pe(o),statusCode:c},l=awslambda.HttpResponseStream.from(t,f);if((n.get("serverless_functions_fix_empty_body")===!0||s===null)&&l.write(""),s===null){l.end();return}let m=Kt.fromWeb(s);await Yt(m,l);return}if(e===void 0){let o=awslambda.HttpResponseStream.from(t,{statusCode:204,headers:{[z]:u}});o.write(""),o.end();return}throw new V("Function returned an unsupported value. Accepted types are 'Response' or 'undefined'")};import q from"process";var tr={delete:e=>{delete q.env[e]},get:e=>q.env[e],has:e=>!!q.env[e],set:(e,t)=>{q.env[e]=t},toObject:()=>Object.entries(q.env).reduce((e,[t,r])=>r===void 0?e:{...e,[t]:r},{})},Ke={get context(){let e=E.getStore();return(e==null?void 0:e.context)??null},env:tr};globalThis.Netlify=Ke;var rr=()=>Ke;var Hn=()=>nr(import.meta.url);export{Zt as getLambdaHandler,rr as getNetlifyGlobal,Hn as getPath};

@@ -1,1 +0,16 @@

export declare const writeRequestMetadata: (req: Request, awsRequestID: string) => Promise<void> | undefined;
interface Metadata {
host: string;
method: string;
nf_req_id: string;
ts: number;
path: string;
}
declare class MetadataStore {
entries: Map<string, Metadata>;
constructor();
private static getFilePath;
save(req: Request, awsRequestID: string): Promise<void>;
flush(): void;
}
export declare const metadata: MetadataStore;
export {};
{
"name": "@netlify/serverless-functions-api",
"type": "module",
"version": "1.23.1",
"version": "1.24.0",
"files": [

@@ -6,0 +6,0 @@ "dist/**/*.d.ts",