polgo-upload-kit 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see bundle.js.LICENSE.txt */
2
+ (()=>{var __webpack_modules__={985:(e,t,r)=>{const n=r(425),i=r(846);e.exports={PolgoUploadClient:class{constructor(e,t){this.ambiente=e?"producao":"dev",this.url="https://mkgplyz3tc.execute-api.us-east-1.amazonaws.com/lambdaUploadProducao/arquivo/upload",this.stack=t}async uploadFile(e,t={}){let r;if(!(e instanceof Uint8Array))throw new TypeError("O arquivo não é um Uint8Array válido.");{const t=(await i.fromBuffer(e))?.mime||"application/octet-stream";r=new Blob([e],{type:t})}const o=new URLSearchParams;o.append("ambiente",this.ambiente),o.append("stack",this.stack),t.diretorio&&o.append("diretorio",t.diretorio),t.nomeArquivo&&o.append("nomeArquivo",t.nomeArquivo);const a=`${this.url}${o.toString()?`?${o.toString()}`:""}`,s=new FormData,c=t.nomeArquivo||"uploaded_file";s.append("file",r,c);try{return(await n.post(a,s,{headers:{"Content-Type":"multipart/form-data",Authorization:"Bearer 025154864ea17d1f294b69eb1defe112b5fa9a3c2bd88a40e70ebd29991da8aa"}})).data}catch(e){throw console.error("Erro ao fazer upload do arquivo:",e.message),new Error(`Falha ao realizar o upload do arquivo: ${e.message}`)}}}}},707:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";const Token=__webpack_require__(266),strtok3=__webpack_require__(452),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=__webpack_require__(760),supported=__webpack_require__(664),minimumBytes=4100;async function fromStream(e){const t=await strtok3.fromStream(e);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Buffer?e:Buffer.from(e);if(t&&t.length>1)return fromTokenizer(strtok3.fromBuffer(t))}function _check(e,t,r){r={offset:0,...r};for(const[n,i]of t.entries())if(r.mask){if(i!==(r.mask[n]&e[n+r.offset]))return!1}else if(i!==e[n+r.offset])return!1;return!0}async function fromTokenizer(e){try{return _fromTokenizer(e)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(e){let t=Buffer.alloc(minimumBytes);const r=(e,r)=>_check(t,e,r),n=(e,t)=>r(stringToBytes(e),t);if(e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),await e.peekBuffer(t,{length:12,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return await e.peekBuffer(t,{length:24,mayBeLess:!0}),n("PS-Adobe-",{offset:2})&&n(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n("ID3")){await e.ignore(6);const i=await e.readToken(uint32SyncSafeToken);return e.position+i>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(i),fromTokenizer(e))}if(n("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n("FLIF"))return{ext:"flif",mime:"image/flif"};if(n("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(n("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(n("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(n("FORM"))return{ext:"aif",mime:"audio/aiff"};if(n("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(t,{length:30});const o={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(o.filename=await e.readToken(new Token.StringType(o.filenameLength,"utf-8")),await e.ignore(o.extraFieldLength),"META-INF/mozilla.rsa"===o.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(o.filename.endsWith(".rels")||o.filename.endsWith(".xml"))switch(o.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}if(o.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(o.filename.startsWith("3D/")&&o.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===o.filename&&o.compressedSize===o.uncompressedSize)switch(await e.readToken(new Token.StringType(o.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}if(0===o.compressedSize){let a=-1;for(;a<0&&e.position<e.fileInfo.size;)await e.peekBuffer(t,{mayBeLess:!0}),a=t.indexOf("504B0304",0,"hex"),await e.ignore(a>=0?a:t.length)}else await e.ignore(o.compressedSize)}}catch(s){if(!(s instanceof strtok3.EndOfStreamError))throw s}return{ext:"zip",mime:"application/zip"}}if(n("OggS")){await e.ignore(28);const c=Buffer.alloc(8);return await e.readBuffer(c),_check(c,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(c,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(c,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(c,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(c,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(c,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(n("ftyp",{offset:4})&&96&t[8]){const f=t.toString("binary",8,12).replace("\0"," ").trim();switch(f){case"avif":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return f.startsWith("3g")?f.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n("MThd"))return{ext:"mid",mime:"audio/midi"};if(n("wOFF")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(n("wOF2")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(n("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(n("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(n("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(n("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(n("%PDF")){await e.ignore(1350);const u=10485760,l=Buffer.alloc(Math.min(u,e.fileInfo.size));return await e.readBuffer(l,{mayBeLess:!0}),l.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return n("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})||r([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await e.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function p(){const t=await e.peekNumber(Token.UINT8);let r=128,n=0;for(;!(t&r)&&0!==r;)++n,r>>=1;const i=Buffer.alloc(n+1);return await e.readBuffer(i),i}async function m(){const e=await p(),t=await p();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function d(t,r){for(;r>0;){const t=await m();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}const h=await m();switch(await d(0,h.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(n("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(n("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(n("MSCF")||n("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(n("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(n("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(n("IMPM"))return{ext:"it",mime:"audio/x-it"};if(n("-lh0-",{offset:2})||n("-lh1-",{offset:2})||n("-lh2-",{offset:2})||n("-lh3-",{offset:2})||n("-lh4-",{offset:2})||n("-lh5-",{offset:2})||n("-lh6-",{offset:2})||n("-lh7-",{offset:2})||n("-lzs-",{offset:2})||n("-lz4-",{offset:2})||n("-lz5-",{offset:2})||n("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(n("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(n("<?xml "))return{ext:"xml",mime:"application/xml"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(n("solid "))return{ext:"stl",mime:"model/stl"};if(n("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(n("!<arch>"))return await e.ignore(8),"debian-binary"===await e.readToken(new Token.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(r([137,80,78,71,13,10,26,10])){async function g(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const x=await g();if(x.length<0)return;switch(x.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(x.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(r([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(r([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(n("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r([48,38,178,117,142,102,207,17,166,217])){async function w(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Token.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const y=await w();let b=y.size-24;if(_check(y.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const E=Buffer.alloc(16);if(b-=await e.readBuffer(E),_check(E,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(E,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(b)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(r([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new Token.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(r([255,10])||r([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(r([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(t,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),n("BEGIN:")){if(n("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(n("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(n("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(n("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(n("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(r([4,0,0,0])&&t.length>=16){const v=t.readUInt32LE(12);if(v>12&&t.length>=v+16)try{const S=t.slice(16,v+16).toString();if(JSON.parse(S).files)return{ext:"asar",mime:"application/x-asar"}}catch(T){}}if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(n("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(n("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}const stream=readableStream=>new Promise(((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",(async()=>{const e=new stream.PassThrough;let t;t=stream.pipeline?stream.pipeline(readableStream,e,(()=>{})):readableStream.pipe(e);const r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{const t=await fromBuffer(r);e.fileType=t}catch(e){reject(e)}resolve(t)}))})),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)}),module.exports=fileType},846:(e,t,r)=>{"use strict";const n=r(363),i=r(707),o={fromFile:async function(e){const t=await n.fromFile(e);try{return await i.fromTokenizer(t)}finally{await t.close()}}};Object.assign(o,i),Object.defineProperty(o,"extensions",{get:()=>i.extensions}),Object.defineProperty(o,"mimeTypes",{get:()=>i.mimeTypes}),e.exports=o},664:e=>{"use strict";e.exports={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]}},760:(e,t)=>{"use strict";t.stringToBytes=e=>[...e].map((e=>e.charCodeAt(0))),t.tarHeaderChecksumMatches=(e,t=0)=>{const r=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n},t.uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<<s)-1,f=c>>1,u=-7,l=r?i-1:0,p=r?-1:1,m=e[t+l];for(l+=p,o=m&(1<<-u)-1,m>>=-u,u+=s;u>0;o=256*o+e[t+l],l+=p,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+l],l+=p,u-=8);if(0===o)o=1-f;else{if(o===c)return a?NaN:1/0*(m?-1:1);a+=Math.pow(2,n),o-=f}return(m?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,c,f=8*o-i-1,u=(1<<f)-1,l=u>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,d=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+l>=1?p/c:p*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=u?(s=0,a=u):a+l>=1?(s=(t*c-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+m]=255&s,m+=d,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+m]=255&a,m+=d,a/=256,f-=8);e[r+m-d]|=128*h}},122:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}}},523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndOfStreamError=t.defaultMessages=void 0,t.defaultMessages="End-Of-Stream";class r extends Error{constructor(){super(t.defaultMessages)}}t.EndOfStreamError=r},510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;const n=r(523),i=r(122);var o=r(523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return o.EndOfStreamError}}),t.StreamReader=class{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new n.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,t,r){if(0===r)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new n.EndOfStreamError;let i=r,o=0;for(;this.peekQueue.length>0&&i>0;){const r=this.peekQueue.pop();if(!r)throw new Error("peekData should be defined");const n=Math.min(r.length,i);e.set(r.subarray(0,n),t+o),o+=n,i-=n,n<r.length&&this.peekQueue.push(r.subarray(n))}for(;i>0&&!this.endOfStream;){const r=Math.min(i,1048576),n=await this.readFromStream(e,t+o,r);if(o+=n,n<r)break;i-=n}return o}async readFromStream(e,t,r){const n=this.s.read(r);if(n)return e.set(n,t),n.length;{const n={buffer:e,offset:t,length:r,deferred:new i.Deferred};return this.deferred=n.deferred,this.s.once("readable",(()=>{this.readDeferred(n)})),n.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}},705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;var n=r(523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});var i=r(510);Object.defineProperty(t,"StreamReader",{enumerable:!0,get:function(){return i.StreamReader}})},632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTokenizer=void 0;const n=r(705);t.AbstractTokenizer=class{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}}},492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferTokenizer=void 0;const n=r(705),i=r(632);class o extends i.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),i=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&i<r.length)throw new n.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+i),r.offset),i}async close(){}}t.BufferTokenizer=o},456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromFile=t.FileTokenizer=void 0;const n=r(632),i=r(705),o=r(343);class a extends n.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await o.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new i.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await o.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new i.EndOfStreamError;return n.bytesRead}async close(){return o.close(this.fd)}}t.FileTokenizer=a,t.fromFile=async function(e){const t=await o.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await o.open(e,"r");return new a(r,{path:e,size:t.size})}},343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readFile=t.writeFileSync=t.writeFile=t.read=t.open=t.close=t.stat=t.createReadStream=t.pathExists=void 0;const n=r(428);t.pathExists=n.existsSync,t.createReadStream=n.createReadStream,t.stat=async function(e){return new Promise(((t,r)=>{n.stat(e,((e,n)=>{e?r(e):t(n)}))}))},t.close=async function(e){return new Promise(((t,r)=>{n.close(e,(e=>{e?r(e):t()}))}))},t.open=async function(e,t){return new Promise(((r,i)=>{n.open(e,t,((e,t)=>{e?i(e):r(t)}))}))},t.read=async function(e,t,r,i,o){return new Promise(((a,s)=>{n.read(e,t,r,i,o,((e,t,r)=>{e?s(e):a({bytesRead:t,buffer:r})}))}))},t.writeFile=async function(e,t){return new Promise(((r,i)=>{n.writeFile(e,t,(e=>{e?i(e):r()}))}))},t.writeFileSync=function(e,t){n.writeFileSync(e,t)},t.readFile=async function(e){return new Promise(((t,r)=>{n.readFile(e,((e,n)=>{e?r(e):t(n)}))}))}},66:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadStreamTokenizer=void 0;const n=r(632),i=r(705);class o extends n.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new i.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const o=await this.streamReader.read(e,r.offset,r.length);if(this.position+=o,(!t||!t.mayBeLess)&&o<r.length)throw new i.EndOfStreamError;return o}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const i=new Uint8Array(r.length+t);return n=await this.peekBuffer(i,{mayBeLess:r.mayBeLess}),e.set(i.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof i.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new i.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const i=e-n,o=await this.readBuffer(r,{length:Math.min(t,i)});if(o<0)return o;n+=o}return n}}t.ReadStreamTokenizer=o},452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromStream=t.EndOfStreamError=void 0;const n=r(66),i=r(492);var o=r(705);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return o.EndOfStreamError}}),t.fromStream=function(e,t){return t=t||{},new n.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e,t){return new i.BufferTokenizer(e,t)}},363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromStream=t.fromBuffer=t.EndOfStreamError=t.fromFile=void 0;const n=r(343),i=r(452);var o=r(456);Object.defineProperty(t,"fromFile",{enumerable:!0,get:function(){return o.fromFile}});var a=r(452);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return a.EndOfStreamError}}),Object.defineProperty(t,"fromBuffer",{enumerable:!0,get:function(){return a.fromBuffer}}),t.fromStream=async function(e,t){if(t=t||{},e.path){const r=await n.stat(e.path);t.path=e.path,t.size=r.size}return i.fromStream(e,t)}},266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiStringType=t.StringType=t.BufferType=t.Uint8ArrayType=t.IgnoreType=t.Float80_LE=t.Float80_BE=t.Float64_LE=t.Float64_BE=t.Float32_LE=t.Float32_BE=t.Float16_LE=t.Float16_BE=t.INT64_BE=t.UINT64_BE=t.INT64_LE=t.UINT64_LE=t.INT32_LE=t.INT32_BE=t.INT24_BE=t.INT24_LE=t.INT16_LE=t.INT16_BE=t.INT8=t.UINT32_BE=t.UINT32_LE=t.UINT24_BE=t.UINT24_LE=t.UINT16_BE=t.UINT16_LE=t.UINT8=void 0;const n=r(251);function i(e){return new DataView(e.buffer,e.byteOffset)}t.UINT8={len:1,get:(e,t)=>i(e).getUint8(t),put:(e,t,r)=>(i(e).setUint8(t,r),t+1)},t.UINT16_LE={len:2,get:(e,t)=>i(e).getUint16(t,!0),put:(e,t,r)=>(i(e).setUint16(t,r,!0),t+2)},t.UINT16_BE={len:2,get:(e,t)=>i(e).getUint16(t),put:(e,t,r)=>(i(e).setUint16(t,r),t+2)},t.UINT24_LE={len:3,get(e,t){const r=i(e);return r.getUint8(t)+(r.getUint16(t+1,!0)<<8)},put(e,t,r){const n=i(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.UINT24_BE={len:3,get(e,t){const r=i(e);return(r.getUint16(t)<<8)+r.getUint8(t+2)},put(e,t,r){const n=i(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.UINT32_LE={len:4,get:(e,t)=>i(e).getUint32(t,!0),put:(e,t,r)=>(i(e).setUint32(t,r,!0),t+4)},t.UINT32_BE={len:4,get:(e,t)=>i(e).getUint32(t),put:(e,t,r)=>(i(e).setUint32(t,r),t+4)},t.INT8={len:1,get:(e,t)=>i(e).getInt8(t),put:(e,t,r)=>(i(e).setInt8(t,r),t+1)},t.INT16_BE={len:2,get:(e,t)=>i(e).getInt16(t),put:(e,t,r)=>(i(e).setInt16(t,r),t+2)},t.INT16_LE={len:2,get:(e,t)=>i(e).getInt16(t,!0),put:(e,t,r)=>(i(e).setInt16(t,r,!0),t+2)},t.INT24_LE={len:3,get(e,r){const n=t.UINT24_LE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=i(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.INT24_BE={len:3,get(e,r){const n=t.UINT24_BE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=i(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.INT32_BE={len:4,get:(e,t)=>i(e).getInt32(t),put:(e,t,r)=>(i(e).setInt32(t,r),t+4)},t.INT32_LE={len:4,get:(e,t)=>i(e).getInt32(t,!0),put:(e,t,r)=>(i(e).setInt32(t,r,!0),t+4)},t.UINT64_LE={len:8,get:(e,t)=>i(e).getBigUint64(t,!0),put:(e,t,r)=>(i(e).setBigUint64(t,r,!0),t+8)},t.INT64_LE={len:8,get:(e,t)=>i(e).getBigInt64(t,!0),put:(e,t,r)=>(i(e).setBigInt64(t,r,!0),t+8)},t.UINT64_BE={len:8,get:(e,t)=>i(e).getBigUint64(t),put:(e,t,r)=>(i(e).setBigUint64(t,r),t+8)},t.INT64_BE={len:8,get:(e,t)=>i(e).getBigInt64(t),put:(e,t,r)=>(i(e).setBigInt64(t,r),t+8)},t.Float16_BE={len:2,get(e,t){return n.read(e,t,!1,10,this.len)},put(e,t,r){return n.write(e,r,t,!1,10,this.len),t+this.len}},t.Float16_LE={len:2,get(e,t){return n.read(e,t,!0,10,this.len)},put(e,t,r){return n.write(e,r,t,!0,10,this.len),t+this.len}},t.Float32_BE={len:4,get:(e,t)=>i(e).getFloat32(t),put:(e,t,r)=>(i(e).setFloat32(t,r),t+4)},t.Float32_LE={len:4,get:(e,t)=>i(e).getFloat32(t,!0),put:(e,t,r)=>(i(e).setFloat32(t,r,!0),t+4)},t.Float64_BE={len:8,get:(e,t)=>i(e).getFloat64(t),put:(e,t,r)=>(i(e).setFloat64(t,r),t+8)},t.Float64_LE={len:8,get:(e,t)=>i(e).getFloat64(t,!0),put:(e,t,r)=>(i(e).setFloat64(t,r,!0),t+8)},t.Float80_BE={len:10,get(e,t){return n.read(e,t,!1,63,this.len)},put(e,t,r){return n.write(e,r,t,!1,63,this.len),t+this.len}},t.Float80_LE={len:10,get(e,t){return n.read(e,t,!0,63,this.len)},put(e,t,r){return n.write(e,r,t,!0,63,this.len),t+this.len}},t.IgnoreType=class{constructor(e){this.len=e}get(e,t){}},t.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}},t.BufferType=class{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}},t.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class o{constructor(e){this.len=e}static decode(e,t,r){let n="";for(let i=t;i<r;++i)n+=o.codePointToString(o.singleByteDecoder(e[i]));return n}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(o.inRange(e,0,127))return e;const t=o.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return o.decode(e,t,t+this.len)}}t.AnsiStringType=o,o.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},428:()=>{},425:(e,t,r)=>{"use strict";function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,a=(s=Object.create(null),e=>{const t=i.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const c=e=>(e=e.toLowerCase(),t=>a(t)===e),f=e=>t=>typeof t===e,{isArray:u}=Array,l=f("undefined"),p=c("ArrayBuffer"),m=f("string"),d=f("function"),h=f("number"),g=e=>null!==e&&"object"==typeof e,x=e=>{if("object"!==a(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},w=c("Date"),y=c("File"),b=c("Blob"),E=c("FileList"),v=c("URLSearchParams"),[S,T,_,O]=["ReadableStream","Request","Response","Headers"].map(c);function k(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function B(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,j=e=>!l(e)&&e!==R,A=(N="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>N&&e instanceof N);var N;const F=c("HTMLFormElement"),P=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),U=c("RegExp"),L=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};k(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},z="abcdefghijklmnopqrstuvwxyz",I="0123456789",C={DIGIT:I,ALPHA:z,ALPHA_DIGIT:z+z.toUpperCase()+I},M=c("AsyncFunction"),D=(q="function"==typeof setImmediate,H=d(R.postMessage),q?setImmediate:H?(W=`axios@${Math.random()}`,V=[],R.addEventListener("message",(({source:e,data:t})=>{e===R&&t===W&&V.length&&V.shift()()}),!1),e=>{V.push(e),R.postMessage(W,"*")}):e=>setTimeout(e));var q,H,W,V;const J="undefined"!=typeof queueMicrotask?queueMicrotask.bind(R):"undefined"!=typeof process&&process.nextTick||D;var $={isArray:u,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&d(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||d(e.append)&&("formdata"===(t=a(e))||"object"===t&&d(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:m,isNumber:h,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:x,isReadableStream:S,isRequest:T,isResponse:_,isHeaders:O,isUndefined:l,isDate:w,isFile:y,isBlob:b,isRegExp:U,isFunction:d,isStream:e=>g(e)&&d(e.pipe),isURLSearchParams:v,isTypedArray:A,isFileList:E,forEach:k,merge:function e(){const{caseless:t}=j(this)&&this||{},r={},n=(n,i)=>{const o=t&&B(r,i)||i;x(r[o])&&x(n)?r[o]=e(r[o],n):x(n)?r[o]=e({},n):u(n)?r[o]=n.slice():r[o]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&k(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:i}={})=>(k(t,((t,i)=>{r&&d(t)?e[i]=n(t,r):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,a,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&o(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!h(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:F,hasOwnProperty:P,hasOwnProp:P,reduceDescriptors:L,freezeMethods:e=>{L(e,((t,r)=>{if(d(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];d(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:B,global:R,isContextDefined:j,ALPHABET:C,generateString:(e=16,t=C.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&d(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=u(e)?[]:{};return k(e,((e,t)=>{const o=r(e,n+1);!l(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:M,isThenable:e=>e&&(g(e)||d(e))&&d(e.then)&&d(e.catch),setImmediate:D,asap:J};function K(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}$.inherits(K,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.status}}});const G=K.prototype,Q={};function X(e){return $.isPlainObject(e)||$.isArray(e)}function Z(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function Y(e,t,r){return e?e.concat(t).map((function(e,t){return e=Z(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Q[e]={value:e}})),Object.defineProperties(K,Q),Object.defineProperty(G,"isAxiosError",{value:!0}),K.from=(e,t,r,n,i,o)=>{const a=Object.create(G);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),K.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const ee=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,r){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,o=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!s&&$.isBlob(e))throw new K("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if($.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(X)}(e)||($.isFileList(e)||$.endsWith(r,"[]"))&&(s=$.toArray(e)))return r=Z(r),s.forEach((function(e,n){!$.isUndefined(e)&&null!==e&&t.append(!0===a?Y([r],n,o):null===a?r:r+"[]",c(e))})),!1;return!!X(e)||(t.append(Y(i,r,o),c(e)),!1)}const u=[],l=Object.assign(ee,{defaultVisitor:f,convertValue:c,isVisitable:X});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!$.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),$.forEach(r,(function(r,o){!0===(!($.isUndefined(r)||null===r)&&i.call(t,r,$.isString(o)?o.trim():o,n,l))&&e(r,n?n.concat(o):[o])})),u.pop()}}(e),t}function re(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ne(e,t){this._pairs=[],e&&te(e,this,t)}const ie=ne.prototype;function oe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ae(e,t,r){if(!t)return e;const n=r&&r.encode||oe,i=r&&r.serialize;let o;if(o=i?i(t,r):$.isURLSearchParams(t)?t.toString():new ne(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}ie.append=function(e,t){this._pairs.push([e,t])},ie.toString=function(e){const t=e?function(t){return e.call(this,t,re)}:re;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var se=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ne,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ue="undefined"!=typeof window&&"undefined"!=typeof document,le="object"==typeof navigator&&navigator||void 0,pe=ue&&(!le||["ReactNative","NativeScript","NS"].indexOf(le.product)<0),me="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,de=ue&&window.location.href||"http://localhost";var he={...Object.freeze({__proto__:null,hasBrowserEnv:ue,hasStandardBrowserWebWorkerEnv:me,hasStandardBrowserEnv:pe,navigator:le,origin:de}),...fe};function ge(e){function t(e,r,n,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&$.isArray(n)?n.length:o,s?($.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a):(n[o]&&$.isObject(n[o])||(n[o]=[]),t(e,r,n[o],i)&&$.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}(n[o])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const r={};return $.forEachEntry(e,((e,n)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const xe={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=$.isObject(e);if(i&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return n?JSON.stringify(ge(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new he.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return he.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=$.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e){if($.isString(e))try{return(0,JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||xe.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw K.from(e,K.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:he.classes.FormData,Blob:he.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],(e=>{xe.headers[e]={}}));var we=xe;const ye=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),be=Symbol("internals");function Ee(e){return e&&String(e).trim().toLowerCase()}function ve(e){return!1===e||null==e?e:$.isArray(e)?e.map(ve):String(e)}function Se(e,t,r,n,i){return $.isFunction(n)?n.call(this,t,r):(i&&(t=r),$.isString(t)?$.isString(n)?-1!==t.indexOf(n):$.isRegExp(n)?n.test(t):void 0:void 0)}class Te{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=Ee(t);if(!i)throw new Error("header name must be a non-empty string");const o=$.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=ve(e))}const o=(e,t)=>$.forEach(e,((e,r)=>i(e,r,t)));if($.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if($.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ye[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if($.isHeaders(e))for(const[t,n]of e.entries())i(n,t,r);else null!=e&&i(t,e,r);return this}get(e,t){if(e=Ee(e)){const r=$.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if($.isFunction(t))return t.call(this,e,r);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ee(e)){const r=$.findKey(this,e);return!(!r||void 0===this[r]||t&&!Se(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=Ee(e)){const i=$.findKey(r,e);!i||t&&!Se(0,r[i],i,t)||(delete r[i],n=!0)}}return $.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Se(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return $.forEach(this,((n,i)=>{const o=$.findKey(r,i);if(o)return t[o]=ve(n),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();a!==i&&delete t[i],t[a]=ve(n),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&$.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[be]=this[be]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Ee(e);t[n]||(function(e,t){const r=$.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return $.isArray(e)?e.forEach(n):n(e),this}}Te.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(Te.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),$.freezeMethods(Te);var _e=Te;function Oe(e,t){const r=this||we,n=t||r,i=_e.from(n.headers);let o=n.data;return $.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function ke(e){return!(!e||!e.__CANCEL__)}function Be(e,t,r){K.call(this,null==e?"canceled":e,K.ERR_CANCELED,t,r),this.name="CanceledError"}function Re(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new K("Request failed with status code "+r.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}$.inherits(Be,K,{__CANCEL__:!0});const je=(e,t,r=3)=>{let n=0;const i=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),f=n[a];i||(i=c),r[o]=s,n[o]=c;let u=a,l=0;for(;u!==o;)l+=r[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),c-i<t)return;const p=f&&c-f;return p?Math.round(1e3*l/p):void 0}}(50,250);return function(e,t){let r,n,i=0,o=1e3/t;const a=(t,o=Date.now())=>{i=o,r=null,n&&(clearTimeout(n),n=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=o?a(e,t):(r=e,n||(n=setTimeout((()=>{n=null,a(r)}),o-s)))},()=>r&&a(r)]}((r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,s=o-n,c=i(s);n=o,e({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&o<=a?(a-o)/c:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),r)},Ae=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ne=e=>(...t)=>$.asap((()=>e(...t)));var Fe=he.hasStandardBrowserEnv?function(){const e=he.navigator&&/(msie|trident)/i.test(he.navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=$.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0},Pe=he.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const a=[e+"="+encodeURIComponent(t)];$.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),$.isString(n)&&a.push("path="+n),$.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ue(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Le=e=>e instanceof _e?{...e}:e;function ze(e,t){t=t||{};const r={};function n(e,t,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function i(e,t,r){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!$.isUndefined(t))return n(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(Le(e),Le(t),!0)};return $.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=c[n]||i,a=o(e[n],t[n],n);$.isUndefined(a)&&o!==s||(r[n]=a)})),r}var Ie=e=>{const t=ze({},e);let r,{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:c}=t;if(t.headers=s=_e.from(s),t.url=ae(Ue(t.baseURL,t.url),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),$.isFormData(n))if(he.hasStandardBrowserEnv||he.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[e,...t]=r?r.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(he.hasStandardBrowserEnv&&(i&&$.isFunction(i)&&(i=i(t)),i||!1!==i&&Fe(t.url))){const e=o&&a&&Pe.read(a);e&&s.set(o,e)}return t},Ce="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=Ie(e);let i=n.data;const o=_e.from(n.headers).normalize();let a,s,c,f,u,{responseType:l,onUploadProgress:p,onDownloadProgress:m}=n;function d(){f&&f(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let h=new XMLHttpRequest;function g(){if(!h)return;const n=_e.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Re((function(e){t(e),d()}),(function(e){r(e),d()}),{data:l&&"text"!==l&&"json"!==l?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(r(new K("Request aborted",K.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new K("Network Error",K.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||ce;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new K(t,i.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,e,h)),h=null},void 0===i&&o.setContentType(null),"setRequestHeader"in h&&$.forEach(o.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),$.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),l&&"json"!==l&&(h.responseType=n.responseType),m&&([c,u]=je(m,!0),h.addEventListener("progress",c)),p&&h.upload&&([s,f]=je(p),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",f)),(n.cancelToken||n.signal)&&(a=t=>{h&&(r(!t||t.type?new Be(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const x=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);x&&-1===he.protocols.indexOf(x)?r(new K("Unsupported protocol "+x+":",K.ERR_BAD_REQUEST,e)):h.send(i||null)}))},Me=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const i=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof K?t:new Be(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new K(`timeout ${t} of ms exceeded`,K.ETIMEDOUT))}),t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i)));const{signal:s}=n;return s.unsubscribe=()=>$.asap(a),s}};const De=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,i=0;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},qe=(e,t,r,n)=>{const i=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*De(r,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await i.next();if(t)return s(),void e.close();let o=n.byteLength;if(r){let e=a+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},He="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,We=He&&"function"==typeof ReadableStream,Ve=He&&("function"==typeof TextEncoder?(Je=new TextEncoder,e=>Je.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Je;const $e=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ke=We&&$e((()=>{let e=!1;const t=new Request(he.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Ge=We&&$e((()=>$.isReadableStream(new Response("").body))),Qe={stream:Ge&&(e=>e.body)};var Xe;He&&(Xe=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Qe[e]&&(Qe[e]=$.isFunction(Xe[e])?t=>t[e]():(t,r)=>{throw new K(`Response type '${e}' is not supported`,K.ERR_NOT_SUPPORT,r)})})));const Ze={http:null,xhr:Ce,fetch:He&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:f,headers:u,withCredentials:l="same-origin",fetchOptions:p}=Ie(e);f=f?(f+"").toLowerCase():"text";let m,d=Me([i,o&&o.toAbortSignal()],a);const h=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let g;try{if(c&&Ke&&"get"!==r&&"head"!==r&&0!==(g=await(async(e,t)=>{const r=$.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e)){const t=new Request(he.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $.isArrayBufferView(e)||$.isArrayBuffer(e)?e.byteLength:($.isURLSearchParams(e)&&(e+=""),$.isString(e)?(await Ve(e)).byteLength:void 0)})(t):r})(u,n))){let e,r=new Request(t,{method:"POST",body:n,duplex:"half"});if($.isFormData(n)&&(e=r.headers.get("content-type"))&&u.setContentType(e),r.body){const[e,t]=Ae(g,je(Ne(c)));n=qe(r.body,65536,e,t)}}$.isString(l)||(l=l?"include":"omit");const i="credentials"in Request.prototype;m=new Request(t,{...p,signal:d,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:i?l:void 0});let o=await fetch(m);const a=Ge&&("stream"===f||"response"===f);if(Ge&&(s||a&&h)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=o[t]}));const t=$.toFiniteNumber(o.headers.get("content-length")),[r,n]=s&&Ae(t,je(Ne(s),!0))||[];o=new Response(qe(o.body,65536,r,(()=>{n&&n(),h&&h()})),e)}f=f||"text";let x=await Qe[$.findKey(Qe,f)||"text"](o,e);return!a&&h&&h(),await new Promise(((t,r)=>{Re(t,r,{data:x,headers:_e.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:m})}))}catch(t){if(h&&h(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new K("Network Error",K.ERR_NETWORK,e,m),{cause:t.cause||t});throw K.from(t,t&&t.code,e,m)}})};$.forEach(Ze,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ye=e=>`- ${e}`,et=e=>$.isFunction(e)||null===e||!1===e;var tt=e=>{e=$.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){let t;if(r=e[o],n=r,!et(r)&&(n=Ze[(t=String(r)).toLowerCase()],void 0===n))throw new K(`Unknown adapter '${t}'`);if(n)break;i[t||"#"+o]=n}if(!n){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new K("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Ye).join("\n"):" "+Ye(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function rt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Be(null,e)}function nt(e){return rt(e),e.headers=_e.from(e.headers),e.data=Oe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt(e.adapter||we.adapter)(e).then((function(t){return rt(e),t.data=Oe.call(e,e.transformResponse,t),t.headers=_e.from(t.headers),t}),(function(t){return ke(t)||(rt(e),t&&t.response&&(t.response.data=Oe.call(e,e.transformResponse,t.response),t.response.headers=_e.from(t.response.headers))),Promise.reject(t)}))}const it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const ot={};it.transitional=function(e,t,r){function n(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new K(n(i," has been removed"+(t?" in "+t:"")),K.ERR_DEPRECATED);return t&&!ot[i]&&(ot[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};var at={assertOptions:function(e,t,r){if("object"!=typeof e)throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],a=t[o];if(a){const t=e[o],r=void 0===t||a(t,o,e);if(!0!==r)throw new K("option "+o+" must be "+r,K.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new K("Unknown option "+o,K.ERR_BAD_OPTION)}},validators:it};const st=at.validators;class ct{constructor(e){this.defaults=e,this.interceptors={request:new se,response:new se}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ze(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&at.assertOptions(r,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean)},!1),null!=n&&($.isFunction(n)?t.paramsSerializer={serialize:n}:at.assertOptions(n,{encode:st.function,serialize:st.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&$.merge(i.common,i[t.method]);i&&$.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=_e.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let f;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,l=0;if(!s){const e=[nt.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),u=e.length,f=Promise.resolve(t);l<u;)f=f.then(e[l++],e[l++]);return f}u=a.length;let p=t;for(l=0;l<u;){const e=a[l++],t=a[l++];try{p=e(p)}catch(e){t.call(this,e);break}}try{f=nt.call(this,p)}catch(e){return Promise.reject(e)}for(l=0,u=c.length;l<u;)f=f.then(c[l++],c[l++]);return f}getUri(e){return ae(Ue((e=ze(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}$.forEach(["delete","get","head","options"],(function(e){ct.prototype[e]=function(t,r){return this.request(ze(r||{},{method:e,url:t,data:(r||{}).data}))}})),$.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(ze(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ct.prototype[e]=t(),ct.prototype[e+"Form"]=t(!0)}));var ft=ct;class ut{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new Be(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ut((function(t){e=t})),cancel:e}}}var lt=ut;const pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pt).forEach((([e,t])=>{pt[t]=e}));var mt=pt;const dt=function e(t){const r=new ft(t),i=n(ft.prototype.request,r);return $.extend(i,ft.prototype,r,{allOwnKeys:!0}),$.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(ze(t,r))},i}(we);dt.Axios=ft,dt.CanceledError=Be,dt.CancelToken=lt,dt.isCancel=ke,dt.VERSION="1.7.7",dt.toFormData=te,dt.AxiosError=K,dt.Cancel=dt.CanceledError,dt.all=function(e){return Promise.all(e)},dt.spread=function(e){return function(t){return e.apply(null,t)}},dt.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},dt.mergeConfig=ze,dt.AxiosHeaders=_e,dt.formToJSON=e=>ge($.isHTMLForm(e)?new FormData(e):e),dt.getAdapter=tt,dt.HttpStatusCode=mt,dt.default=dt,e.exports=dt}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var __webpack_exports__=__webpack_require__(985)})();
@@ -0,0 +1 @@
1
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "polgo-upload-kit",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "dist/polgoUploadClient.js",
5
5
  "scripts": {
6
- "build": "babel src --out-dir dist",
6
+ "build": "webpack --mode production",
7
7
  "prepublishOnly": "npm run build"
8
8
  },
9
9
  "keywords": [],
@@ -12,13 +12,20 @@
12
12
  "description": "",
13
13
  "dependencies": {
14
14
  "axios": "^1.7.7",
15
+ "babel-preset-es2015": "^6.24.1",
15
16
  "file-type": "^16.5.4",
16
17
  "form-data": "^4.0.1",
17
18
  "mime-types": "^2.1.35"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@babel/cli": "^7.25.9",
21
- "@babel/core": "^7.25.9",
22
- "@babel/preset-env": "^7.25.9"
22
+ "@babel/core": "^7.26.0",
23
+ "@babel/preset-env": "^7.26.0",
24
+ "babel-loader": "^9.2.1",
25
+ "css-loader": "^7.1.2",
26
+ "path-browserify": "^1.0.1",
27
+ "style-loader": "^4.0.0",
28
+ "webpack": "^5.95.0",
29
+ "webpack-cli": "^5.1.4"
23
30
  }
24
31
  }
@@ -0,0 +1,43 @@
1
+ // webpack.config.js
2
+ const path = require("path");
3
+
4
+ module.exports = {
5
+ entry: "./src/polgoUploadClient.js",
6
+ output: {
7
+ filename: "bundle.js", // Nome do arquivo de saída
8
+ path: path.resolve(__dirname, "dist"), // Diretório de saída
9
+ },
10
+ module: {
11
+ rules: [
12
+ {
13
+ test: /\.js$/, // Todos os arquivos .js
14
+ exclude: /node_modules/, // Ignora node_modules
15
+ use: {
16
+ loader: "babel-loader", // Usa o Babel para compatibilidade JS
17
+ },
18
+ },
19
+ {
20
+ test: /\.(png|jpg|jpeg|gif|webp)$/i, // Para imagens
21
+ type: "asset/resource", // Gera um arquivo separado para cada recurso
22
+ },
23
+ {
24
+ test: /\.css$/, // Para arquivos CSS
25
+ use: ["style-loader", "css-loader"], // Carrega CSS em estilos in-line
26
+ },
27
+ {
28
+ test: /\.json$/, // Para arquivos JSON, caso necessário
29
+ type: "json", // Webpack 5 já tem suporte nativo para JSON
30
+ },
31
+ {
32
+ test: /\.jsx?$/,
33
+ loader: "babel-loader",
34
+ exclude: /node_modules/,
35
+ },
36
+ ],
37
+ },
38
+ resolve: {
39
+ fallback: {
40
+ fs: false,
41
+ },
42
+ },
43
+ };
package/.babelrc DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "targets": {
7
- "node": "20"
8
- }
9
- }
10
- ]
11
- ]
12
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- const axios = require("axios");
4
- const fileType = require("file-type");
5
- class PolgoUploadClient {
6
- constructor(apiUrl) {
7
- this.apiUrl = apiUrl || "https://mkgplyz3tc.execute-api.us-east-1.amazonaws.com/lambdaUploadProducao/arquivo/upload";
8
- }
9
- uploadFile(uint8Array, options = {}) {
10
- let fileBlobPromise;
11
- if (uint8Array instanceof Uint8Array) {
12
- fileBlobPromise = fileType.fromBuffer(uint8Array).then(result => {
13
- const mimeType = result?.mime || "application/octet-stream";
14
- return new Blob([uint8Array], {
15
- type: mimeType
16
- });
17
- });
18
- } else {
19
- return Promise.reject(new TypeError("The provided file is not a valid Uint8Array."));
20
- }
21
- return fileBlobPromise.then(fileBlob => {
22
- const queryParams = new URLSearchParams();
23
- if (options.diretorio) {
24
- queryParams.append("diretorio", options.diretorio);
25
- }
26
- if (options.nomeArquivo) {
27
- queryParams.append("nomeArquivo", options.nomeArquivo);
28
- }
29
- const finalUrl = `${this.apiUrl}${queryParams.toString() ? `?${queryParams.toString()}` : ""}`;
30
- const form = new FormData();
31
- const fileName = options.nomeArquivo || "uploaded_file";
32
- form.append("file", fileBlob, fileName);
33
- return axios.post(finalUrl, form, {
34
- headers: {
35
- "Content-Type": "multipart/form-data"
36
- }
37
- }).then(response => response.data).catch(error => {
38
- console.error("Error uploading file:", error.message);
39
- throw new Error(`Failed to upload file: ${error.message}`);
40
- });
41
- });
42
- }
43
- }
44
- module.exports = {
45
- PolgoUploadClient
46
- };
@@ -1,57 +0,0 @@
1
- const axios = require("axios");
2
- const fileType = require("file-type");
3
-
4
- class PolgoUploadClient {
5
- constructor(apiUrl) {
6
- this.apiUrl =
7
- apiUrl ||
8
- "https://mkgplyz3tc.execute-api.us-east-1.amazonaws.com/lambdaUploadProducao/arquivo/upload";
9
- }
10
-
11
- uploadFile(uint8Array, options = {}) {
12
- let fileBlobPromise;
13
-
14
- if (uint8Array instanceof Uint8Array) {
15
- fileBlobPromise = fileType.fromBuffer(uint8Array).then((result) => {
16
- const mimeType = result?.mime || "application/octet-stream";
17
- return new Blob([uint8Array], { type: mimeType });
18
- });
19
- } else {
20
- return Promise.reject(
21
- new TypeError("The provided file is not a valid Uint8Array.")
22
- );
23
- }
24
-
25
- return fileBlobPromise.then((fileBlob) => {
26
- const queryParams = new URLSearchParams();
27
- if (options.diretorio) {
28
- queryParams.append("diretorio", options.diretorio);
29
- }
30
- if (options.nomeArquivo) {
31
- queryParams.append("nomeArquivo", options.nomeArquivo);
32
- }
33
-
34
- const finalUrl = `${this.apiUrl}${
35
- queryParams.toString() ? `?${queryParams.toString()}` : ""
36
- }`;
37
-
38
- const form = new FormData();
39
- const fileName = options.nomeArquivo || "uploaded_file";
40
- form.append("file", fileBlob, fileName);
41
-
42
- return axios
43
- .post(finalUrl, form, {
44
- headers: {
45
- "Content-Type": "multipart/form-data",
46
- },
47
- })
48
- .then((response) => response.data)
49
- .catch((error) => {
50
- console.error("Error uploading file:", error.message);
51
- throw new Error(`Failed to upload file: ${error.message}`);
52
- });
53
- });
54
- }
55
- }
56
-
57
- module.exports = { PolgoUploadClient };