module.exports=[55057,e=>{"use strict";e.i(34636);var t=e.i(99029),a=e.i(33329);let n=0,r={START_BOUNDARY:n++,HEADER_FIELD_START:n++,HEADER_FIELD:n++,HEADER_VALUE_START:n++,HEADER_VALUE:n++,HEADER_VALUE_ALMOST_DONE:n++,HEADERS_ALMOST_DONE:n++,PART_DATA_START:n++,PART_DATA:n++,END:n++},i=1,o=2,s=e=>32|e,E=()=>{};class d{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=E,this.onHeaderField=E,this.onHeadersEnd=E,this.onHeaderValue=E,this.onPartBegin=E,this.onPartData=E,this.onPartEnd=E,this.boundaryChars={};const t=new Uint8Array((e="\r\n--"+e).length);for(let a=0;a<e.length;a++)t[a]=e.charCodeAt(a),this.boundaryChars[t[a]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=r.START_BOUNDARY}write(e){let t,a,n=0,E=e.length,d=this.index,{lookbehind:A,boundary:h,boundaryChars:l,index:D,state:T,flags:_}=this,f=this.boundary.length,R=f-1,c=e.length,u=e=>{this[e+"Mark"]=n},H=e=>{delete this[e+"Mark"]},b=(e,t,a,n)=>{(void 0===t||t!==a)&&this[e](n&&n.subarray(t,a))},L=(t,a)=>{let r=t+"Mark";r in this&&(a?(b(t,this[r],n,e),delete this[r]):(b(t,this[r],e.length,e),this[r]=0))};for(n=0;n<E;n++)switch(t=e[n],T){case r.START_BOUNDARY:if(D===h.length-2){if(45===t)_|=o;else if(13!==t)return;D++;break}if(D-1==h.length-2){if(_&o&&45===t)T=r.END,_=0;else{if(_&o||10!==t)return;D=0,b("onPartBegin"),T=r.HEADER_FIELD_START}break}t!==h[D+2]&&(D=-2),t===h[D+2]&&D++;break;case r.HEADER_FIELD_START:T=r.HEADER_FIELD,u("onHeaderField"),D=0;case r.HEADER_FIELD:if(13===t){H("onHeaderField"),T=r.HEADERS_ALMOST_DONE;break}if(D++,45===t)break;if(58===t){if(1===D)return;L("onHeaderField",!0),T=r.HEADER_VALUE_START;break}if((a=s(t))<97||a>122)return;break;case r.HEADER_VALUE_START:if(32===t)break;u("onHeaderValue"),T=r.HEADER_VALUE;case r.HEADER_VALUE:13===t&&(L("onHeaderValue",!0),b("onHeaderEnd"),T=r.HEADER_VALUE_ALMOST_DONE);break;case r.HEADER_VALUE_ALMOST_DONE:if(10!==t)return;T=r.HEADER_FIELD_START;break;case r.HEADERS_ALMOST_DONE:if(10!==t)return;b("onHeadersEnd"),T=r.PART_DATA_START;break;case r.PART_DATA_START:T=r.PART_DATA,u("onPartData");case r.PART_DATA:if(d=D,0===D){for(n+=R;n<c&&!(e[n]in l);)n+=f;n-=R,t=e[n]}if(D<h.length)h[D]===t?(0===D&&L("onPartData",!0),D++):D=0;else if(D===h.length)D++,13===t?_|=i:45===t?_|=o:D=0;else if(D-1===h.length)if(_&i){if(D=0,10===t){_&=~i,b("onPartEnd"),b("onPartBegin"),T=r.HEADER_FIELD_START;break}}else _&o&&45===t?(b("onPartEnd"),T=r.END,_=0):D=0;D>0?A[D-1]=t:d>0&&(b("onPartData",0,d,new Uint8Array(A.buffer,A.byteOffset,A.byteLength)),d=0,u("onPartData"),n--);break;case r.END:break;default:throw Error(`Unexpected state entered: ${T}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=D,this.state=T,this.flags=_}end(){if(this.state===r.HEADER_FIELD_START&&0===this.index||this.state===r.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==r.END)throw Error("MultipartParser.end(): stream ended unexpectedly")}}async function A(e,n){let r,i,o,s,E,A;if(!/multipart/i.test(n))throw TypeError("Failed to fetch");let h=n.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!h)throw TypeError("no or bad content-type header, no multipart boundary");let l=new d(h[1]||h[2]),D=[],T=new a.FormData,_=e=>{o+=u.decode(e,{stream:!0})},f=e=>{D.push(e)},R=()=>{let e=new t.File(D,A,{type:E});T.append(s,e)},c=()=>{T.append(s,o)},u=new TextDecoder("utf-8");for await(let t of(u.decode(),l.onPartBegin=function(){l.onPartData=_,l.onPartEnd=c,r="",i="",o="",s="",E="",A=null,D.length=0},l.onHeaderField=function(e){r+=u.decode(e,{stream:!0})},l.onHeaderValue=function(e){i+=u.decode(e,{stream:!0})},l.onHeaderEnd=function(){if(i+=u.decode(),"content-disposition"===(r=r.toLowerCase())){let e=i.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);e&&(s=e[2]||e[3]||""),(A=function(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let a=t[2]||t[3]||"",n=a.slice(a.lastIndexOf("\\")+1);return(n=n.replace(/%22/g,'"')).replace(/&#(\d{4});/g,(e,t)=>String.fromCharCode(t))}(i))&&(l.onPartData=f,l.onPartEnd=R)}else"content-type"===r&&(E=i);i="",r=""},e))l.write(t);return l.end(),T}e.s(["toFormData",0,A])}];

//# sourceMappingURL=node_modules_node-fetch_src_utils_multipart-parser_0a9aeam.js.map