New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@acrool/imgz-client

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acrool/imgz-client - npm Package Compare versions

Comparing version 0.0.2-alpha.0 to 0.0.2-alpha.1

dist/ImgzNodeClient.d.ts

10

dist/acrool-imgz-client.cjs.js

@@ -1,6 +0,6 @@

"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function Fe(e,t){return function(){return e.apply(t,arguments)}}const{toString:nt}=Object.prototype,{getPrototypeOf:ue}=Object,v=(e=>t=>{const n=nt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),C=e=>(e=e.toLowerCase(),t=>v(t)===e),V=e=>t=>typeof t===e,{isArray:D}=Array,j=V("undefined");function rt(e){return e!==null&&!j(e)&&e.constructor!==null&&!j(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Be=C("ArrayBuffer");function st(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Be(e.buffer),t}const ot=V("string"),A=V("function"),Le=V("number"),K=e=>e!==null&&typeof e=="object",it=e=>e===!0||e===!1,H=e=>{if(v(e)!=="object")return!1;const t=ue(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},at=C("Date"),ct=C("File"),ut=C("Blob"),lt=C("FileList"),ft=e=>K(e)&&A(e.pipe),dt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||A(e.append)&&((t=v(e))==="formdata"||t==="object"&&A(e.toString)&&e.toString()==="[object FormData]"))},ht=C("URLSearchParams"),[pt,mt,yt,bt]=["ReadableStream","Request","Response","Headers"].map(C),wt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function k(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),D(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function De(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const B=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ue=e=>!j(e)&&e!==B;function ne(){const{caseless:e}=Ue(this)&&this||{},t={},n=(r,s)=>{const o=e&&De(t,s)||s;H(t[o])&&H(r)?t[o]=ne(t[o],r):H(r)?t[o]=ne({},r):D(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&k(arguments[r],n);return t}const gt=(e,t,n,{allOwnKeys:r}={})=>(k(t,(s,o)=>{n&&A(s)?e[o]=Fe(s,n):e[o]=s},{allOwnKeys:r}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Rt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},St=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&ue(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Tt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ot=e=>{if(!e)return null;if(D(e))return e;let t=e.length;if(!Le(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},At=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ue(Uint8Array)),xt=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Ct=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pt=C("HTMLFormElement"),Nt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),be=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_t=C("RegExp"),qe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};k(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Ft=e=>{qe(e,(t,n)=>{if(A(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(A(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Bt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return D(e)?r(e):r(String(e).split(t)),n},Lt=()=>{},Dt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Z="abcdefghijklmnopqrstuvwxyz",we="0123456789",je={DIGIT:we,ALPHA:Z,ALPHA_DIGIT:Z+Z.toUpperCase()+we},Ut=(e=16,t=je.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function qt(e){return!!(e&&A(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const jt=e=>{const t=new Array(10),n=(r,s)=>{if(K(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=D(r)?[]:{};return k(r,(i,c)=>{const f=n(i,s+1);!j(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},kt=C("AsyncFunction"),It=e=>e&&(K(e)||A(e))&&A(e.then)&&A(e.catch),ke=((e,t)=>e?setImmediate:t?((n,r)=>(B.addEventListener("message",({source:s,data:o})=>{s===B&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),B.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",A(B.postMessage)),Ht=typeof queueMicrotask<"u"?queueMicrotask.bind(B):typeof process<"u"&&process.nextTick||ke,a={isArray:D,isArrayBuffer:Be,isBuffer:rt,isFormData:dt,isArrayBufferView:st,isString:ot,isNumber:Le,isBoolean:it,isObject:K,isPlainObject:H,isReadableStream:pt,isRequest:mt,isResponse:yt,isHeaders:bt,isUndefined:j,isDate:at,isFile:ct,isBlob:ut,isRegExp:_t,isFunction:A,isStream:ft,isURLSearchParams:ht,isTypedArray:At,isFileList:lt,forEach:k,merge:ne,extend:gt,trim:wt,stripBOM:Et,inherits:Rt,toFlatObject:St,kindOf:v,kindOfTest:C,endsWith:Tt,toArray:Ot,forEachEntry:xt,matchAll:Ct,isHTMLForm:Pt,hasOwnProperty:be,hasOwnProp:be,reduceDescriptors:qe,freezeMethods:Ft,toObjectSet:Bt,toCamelCase:Nt,noop:Lt,toFiniteNumber:Dt,findKey:De,global:B,isContextDefined:Ue,ALPHABET:je,generateString:Ut,isSpecCompliantForm:qt,toJSONObject:jt,isAsyncFn:kt,isThenable:It,setImmediate:ke,asap:Ht};function m(e,t,n,r,s){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),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ie=m.prototype,He={};["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=>{He[e]={value:e}});Object.defineProperties(m,He);Object.defineProperty(Ie,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(Ie);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Mt=null;function re(e){return a.isPlainObject(e)||a.isArray(e)}function Me(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function ge(e,t,n){return e?e.concat(t).map(function(s,o){return s=Me(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function zt(e){return a.isArray(e)&&!e.some(re)}const $t=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function X(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(!f&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,y,p){let w=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&zt(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(w=a.toArray(h)))return y=Me(y),w.forEach(function(S,P){!(a.isUndefined(S)||S===null)&&t.append(i===!0?ge([y],P,o):i===null?y:y+"[]",u(S))}),!1}return re(h)?!0:(t.append(ge(p,y,o),u(h)),!1)}const d=[],b=Object.assign($t,{defaultVisitor:l,convertValue:u,isVisitable:re});function E(h,y){if(!a.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(h),a.forEach(h,function(w,R){(!(a.isUndefined(w)||w===null)&&s.call(t,w,a.isString(R)?R.trim():R,y,b))===!0&&E(w,y?y.concat(R):[R])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function le(e,t){this._pairs=[],e&&X(e,this,t)}const ze=le.prototype;ze.append=function(t,n){this._pairs.push([t,n])};ze.toString=function(t){const n=t?function(r){return t.call(this,r,Ee)}:Ee;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Jt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||Jt,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new le(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Wt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Re=Wt,Je={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vt=typeof URLSearchParams<"u"?URLSearchParams:le,Vt=typeof FormData<"u"?FormData:null,Kt=typeof Blob<"u"?Blob:null,Xt={isBrowser:!0,classes:{URLSearchParams:vt,FormData:Vt,Blob:Kt},protocols:["http","https","file","blob","url","data"]},fe=typeof window<"u"&&typeof document<"u",se=typeof navigator=="object"&&navigator||void 0,Gt=fe&&(!se||["ReactNative","NativeScript","NS"].indexOf(se.product)<0),Qt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Zt=fe&&window.location.href||"http://localhost",Yt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fe,hasStandardBrowserEnv:Gt,hasStandardBrowserWebWorkerEnv:Qt,navigator:se,origin:Zt},Symbol.toStringTag,{value:"Module"})),O={...Yt,...Xt};function en(e,t){return X(e,new O.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return O.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function tn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function nn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function We(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=nn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(tn(r),s,n,0)}),n}return null}function rn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const de={transitional:Je,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(We(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return en(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return X(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),rn(t)):t}],transformResponse:[function(t){const n=this.transitional||de.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{de.headers[e]={}});const he=de,sn=a.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"]),on=e=>{const t={};let n,r,s;return e&&e.split(`
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&sn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Se=Symbol("internals");function q(e){return e&&String(e).trim().toLowerCase()}function M(e){return e===!1||e==null?e:a.isArray(e)?e.map(M):String(e)}function an(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const cn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Y(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function un(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function ln(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class G{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=q(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=M(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!cn(t))i(on(t),n);else if(a.isHeaders(t))for(const[c,f]of t.entries())o(f,c,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=q(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return an(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=q(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Y(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=q(i),i){const c=a.findKey(r,i);c&&(!n||Y(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Y(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=M(s),delete n[o];return}const c=t?un(o):String(o).trim();c!==o&&delete n[o],n[c]=M(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Se]=this[Se]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=q(i);r[c]||(ln(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}G.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(G.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(G);const x=G;function ee(e,t){const n=this||he,r=t||n,s=x.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ve(e){return!!(e&&e.__CANCEL__)}function U(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(U,m,{__CANCEL__:!0});function Ve(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function fn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,b=0;for(;d!==s;)b+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(b*1e3/E):void 0}}function hn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e.apply(null,u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const $=(e,t,n=3)=>{let r=0;const s=dn(50,250);return hn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Te=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Oe=e=>(...t)=>a.asap(()=>e(...t)),pn=O.hasStandardBrowserEnv?function(){const t=O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),mn=O.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.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(){return null},remove(){}};function yn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function bn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t){return e&&!yn(t)?bn(e,t):t}const Ae=e=>e instanceof x?{...e}:e;function L(e,t){t=t||{};const n={};function r(u,l,d){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:d},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d)}else return r(u,l,d)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l)=>s(Ae(u),Ae(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const d=f[l]||s,b=d(e[l],t[l],l);a.isUndefined(b)&&d!==c||(n[l]=b)}),n}const Xe=e=>{const t=L({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=x.from(i),t.url=$e(Ke(t.baseURL,t.url),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(O.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&pn(t.url))){const u=s&&o&&mn.read(o);u&&i.set(s,u)}return t},wn=typeof XMLHttpRequest<"u",gn=wn&&function(e){return new Promise(function(n,r){const s=Xe(e);let o=s.data;const i=x.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,b,E,h;function y(){E&&E(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function w(){if(!p)return;const S=x.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),T={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};Ve(function(F){n(F),y()},function(F){r(F),y()},T),p=null}"onloadend"in p?p.onloadend=w:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(w)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let P=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const T=s.transitional||Je;s.timeoutErrorMessage&&(P=s.timeoutErrorMessage),r(new m(P,T.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&a.forEach(i.toJSON(),function(P,T){p.setRequestHeader(T,P)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([b,h]=$(u,!0),p.addEventListener("progress",b)),f&&p.upload&&([d,E]=$(f),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(l=S=>{p&&(r(!S||S.type?new U(null,e,p):S),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const R=fn(s.url);if(R&&O.protocols.indexOf(R)===-1){r(new m("Unsupported protocol "+R+":",m.ERR_BAD_REQUEST,e));return}p.send(o||null)})},En=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new U(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Rn=En,Sn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Tn=async function*(e,t){for await(const n of On(e))yield*Sn(n,t)},On=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},xe=(e,t,n,r)=>{const s=Tn(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let b=o+=d;n(b)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Q=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ge=Q&&typeof ReadableStream=="function",An=Q&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Qe=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xn=Ge&&Qe(()=>{let e=!1;const t=new Request(O.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ce=64*1024,oe=Ge&&Qe(()=>a.isReadableStream(new Response("").body)),J={stream:oe&&(e=>e.body)};Q&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!J[t]&&(J[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const Cn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(O.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await An(e)).byteLength},Pn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Cn(t)},Nn=Q&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:b}=Xe(e);u=u?(u+"").toLowerCase():"text";let E=Rn([s,o&&o.toAbortSignal()],i),h;const y=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let p;try{if(f&&xn&&n!=="get"&&n!=="head"&&(p=await Pn(l,r))!==0){let T=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(a.isFormData(r)&&(N=T.headers.get("content-type"))&&l.setContentType(N),T.body){const[F,I]=Te(p,$(Oe(f)));r=xe(T.body,Ce,F,I)}}a.isString(d)||(d=d?"include":"omit");const w="credentials"in Request.prototype;h=new Request(t,{...b,signal:E,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:w?d:void 0});let R=await fetch(h);const S=oe&&(u==="stream"||u==="response");if(oe&&(c||S&&y)){const T={};["status","statusText","headers"].forEach(ye=>{T[ye]=R[ye]});const N=a.toFiniteNumber(R.headers.get("content-length")),[F,I]=c&&Te(N,$(Oe(c),!0))||[];R=new Response(xe(R.body,Ce,F,()=>{I&&I(),y&&y()}),T)}u=u||"text";let P=await J[a.findKey(J,u)||"text"](R,e);return!S&&y&&y(),await new Promise((T,N)=>{Ve(T,N,{data:P,headers:x.from(R.headers),status:R.status,statusText:R.statusText,config:e,request:h})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,h),{cause:w.cause||w}):m.from(w,w&&w.code,e,h)}}),ie={http:Mt,xhr:gn,fetch:Nn};a.forEach(ie,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Pe=e=>`- ${e}`,_n=e=>a.isFunction(e)||e===null||e===!1,Ze={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!_n(n)&&(r=ie[(i=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function Fe(e,t){return function(){return e.apply(t,arguments)}}const{toString:ot}=Object.prototype,{getPrototypeOf:ue}=Object,W=(e=>t=>{const n=ot.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),C=e=>(e=e.toLowerCase(),t=>W(t)===e),V=e=>t=>typeof t===e,{isArray:B}=Array,j=V("undefined");function it(e){return e!==null&&!j(e)&&e.constructor!==null&&!j(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=C("ArrayBuffer");function at(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qe(e.buffer),t}const ct=V("string"),A=V("function"),Le=V("number"),K=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,H=e=>{if(W(e)!=="object")return!1;const t=ue(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=C("Date"),ft=C("File"),dt=C("Blob"),ht=C("FileList"),pt=e=>K(e)&&A(e.pipe),mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||A(e.append)&&((t=W(e))==="formdata"||t==="object"&&A(e.toString)&&e.toString()==="[object FormData]"))},yt=C("URLSearchParams"),[bt,wt,gt,Et]=["ReadableStream","Request","Response","Headers"].map(C),St=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function I(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),B(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function Be(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),De=e=>!j(e)&&e!==q;function ne(){const{caseless:e}=De(this)&&this||{},t={},n=(r,s)=>{const o=e&&Be(t,s)||s;H(t[o])&&H(r)?t[o]=ne(t[o],r):H(r)?t[o]=ne({},r):B(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&I(arguments[r],n);return t}const Rt=(e,t,n,{allOwnKeys:r}={})=>(I(t,(s,o)=>{n&&A(s)?e[o]=Fe(s,n):e[o]=s},{allOwnKeys:r}),e),Ot=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Tt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},At=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&ue(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ct=e=>{if(!e)return null;if(B(e))return e;let t=e.length;if(!Le(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Pt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ue(Uint8Array)),Nt=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},_t=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Ft=C("HTMLFormElement"),qt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),be=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Lt=C("RegExp"),Ue=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};I(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Bt=e=>{Ue(e,(t,n)=>{if(A(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(A(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Dt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return B(e)?r(e):r(String(e).split(t)),n},Ut=()=>{},jt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Z="abcdefghijklmnopqrstuvwxyz",we="0123456789",je={DIGIT:we,ALPHA:Z,ALPHA_DIGIT:Z+Z.toUpperCase()+we},It=(e=16,t=je.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function kt(e){return!!(e&&A(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Ht=e=>{const t=new Array(10),n=(r,s)=>{if(K(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=B(r)?[]:{};return I(r,(i,c)=>{const f=n(i,s+1);!j(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Mt=C("AsyncFunction"),zt=e=>e&&(K(e)||A(e))&&A(e.then)&&A(e.catch),Ie=((e,t)=>e?setImmediate:t?((n,r)=>(q.addEventListener("message",({source:s,data:o})=>{s===q&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",A(q.postMessage)),$t=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||Ie,a={isArray:B,isArrayBuffer:qe,isBuffer:it,isFormData:mt,isArrayBufferView:at,isString:ct,isNumber:Le,isBoolean:ut,isObject:K,isPlainObject:H,isReadableStream:bt,isRequest:wt,isResponse:gt,isHeaders:Et,isUndefined:j,isDate:lt,isFile:ft,isBlob:dt,isRegExp:Lt,isFunction:A,isStream:pt,isURLSearchParams:yt,isTypedArray:Pt,isFileList:ht,forEach:I,merge:ne,extend:Rt,trim:St,stripBOM:Ot,inherits:Tt,toFlatObject:At,kindOf:W,kindOfTest:C,endsWith:xt,toArray:Ct,forEachEntry:Nt,matchAll:_t,isHTMLForm:Ft,hasOwnProperty:be,hasOwnProp:be,reduceDescriptors:Ue,freezeMethods:Bt,toObjectSet:Dt,toCamelCase:qt,noop:Ut,toFiniteNumber:jt,findKey:Be,global:q,isContextDefined:De,ALPHABET:je,generateString:It,isSpecCompliantForm:kt,toJSONObject:Ht,isAsyncFn:Mt,isThenable:zt,setImmediate:Ie,asap:$t};function m(e,t,n,r,s){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),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const ke=m.prototype,He={};["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=>{He[e]={value:e}});Object.defineProperties(m,He);Object.defineProperty(ke,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(ke);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const vt=null;function re(e){return a.isPlainObject(e)||a.isArray(e)}function Me(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function ge(e,t,n){return e?e.concat(t).map(function(s,o){return s=Me(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Jt(e){return a.isArray(e)&&!e.some(re)}const Wt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function X(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(!f&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,y,p){let w=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&Jt(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(w=a.toArray(h)))return y=Me(y),w.forEach(function(R,P){!(a.isUndefined(R)||R===null)&&t.append(i===!0?ge([y],P,o):i===null?y:y+"[]",u(R))}),!1}return re(h)?!0:(t.append(ge(p,y,o),u(h)),!1)}const d=[],b=Object.assign(Wt,{defaultVisitor:l,convertValue:u,isVisitable:re});function E(h,y){if(!a.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(h),a.forEach(h,function(w,S){(!(a.isUndefined(w)||w===null)&&s.call(t,w,a.isString(S)?S.trim():S,y,b))===!0&&E(w,y?y.concat(S):[S])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function le(e,t){this._pairs=[],e&&X(e,this,t)}const ze=le.prototype;ze.append=function(t,n){this._pairs.push([t,n])};ze.toString=function(t){const n=t?function(r){return t.call(this,r,Ee)}:Ee;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Vt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||Vt,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new le(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Kt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Se=Kt,ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xt=typeof URLSearchParams<"u"?URLSearchParams:le,Gt=typeof FormData<"u"?FormData:null,Qt=typeof Blob<"u"?Blob:null,Zt={isBrowser:!0,classes:{URLSearchParams:Xt,FormData:Gt,Blob:Qt},protocols:["http","https","file","blob","url","data"]},fe=typeof window<"u"&&typeof document<"u",se=typeof navigator=="object"&&navigator||void 0,Yt=fe&&(!se||["ReactNative","NativeScript","NS"].indexOf(se.product)<0),en=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),tn=fe&&window.location.href||"http://localhost",nn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fe,hasStandardBrowserEnv:Yt,hasStandardBrowserWebWorkerEnv:en,navigator:se,origin:tn},Symbol.toStringTag,{value:"Module"})),T={...nn,...Zt};function rn(e,t){return X(e,new T.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return T.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function sn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function on(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Je(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=on(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(sn(r),s,n,0)}),n}return null}function an(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const de={transitional:ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Je(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return rn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return X(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),an(t)):t}],transformResponse:[function(t){const n=this.transitional||de.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{de.headers[e]={}});const he=de,cn=a.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"]),un=e=>{const t={};let n,r,s;return e&&e.split(`
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&cn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Re=Symbol("internals");function U(e){return e&&String(e).trim().toLowerCase()}function M(e){return e===!1||e==null?e:a.isArray(e)?e.map(M):String(e)}function ln(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const fn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Y(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function dn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function hn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class G{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=U(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=M(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!fn(t))i(un(t),n);else if(a.isHeaders(t))for(const[c,f]of t.entries())o(f,c,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=U(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return ln(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=U(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Y(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=U(i),i){const c=a.findKey(r,i);c&&(!n||Y(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Y(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=M(s),delete n[o];return}const c=t?dn(o):String(o).trim();c!==o&&delete n[o],n[c]=M(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Re]=this[Re]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=U(i);r[c]||(hn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}G.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(G.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(G);const x=G;function ee(e,t){const n=this||he,r=t||n,s=x.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function We(e){return!!(e&&e.__CANCEL__)}function D(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(D,m,{__CANCEL__:!0});function Ve(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,b=0;for(;d!==s;)b+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(b*1e3/E):void 0}}function yn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e.apply(null,u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const $=(e,t,n=3)=>{let r=0;const s=mn(50,250);return yn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Oe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Te=e=>(...t)=>a.asap(()=>e(...t)),bn=T.hasStandardBrowserEnv?function(){const t=T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),wn=T.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.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(){return null},remove(){}};function gn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function En(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t){return e&&!gn(t)?En(e,t):t}const Ae=e=>e instanceof x?{...e}:e;function L(e,t){t=t||{};const n={};function r(u,l,d){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:d},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d)}else return r(u,l,d)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l)=>s(Ae(u),Ae(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const d=f[l]||s,b=d(e[l],t[l],l);a.isUndefined(b)&&d!==c||(n[l]=b)}),n}const Xe=e=>{const t=L({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=x.from(i),t.url=$e(Ke(t.baseURL,t.url),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(T.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&bn(t.url))){const u=s&&o&&wn.read(o);u&&i.set(s,u)}return t},Sn=typeof XMLHttpRequest<"u",Rn=Sn&&function(e){return new Promise(function(n,r){const s=Xe(e);let o=s.data;const i=x.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,b,E,h;function y(){E&&E(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function w(){if(!p)return;const R=x.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),O={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:R,config:e,request:p};Ve(function(F){n(F),y()},function(F){r(F),y()},O),p=null}"onloadend"in p?p.onloadend=w:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(w)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let P=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||ve;s.timeoutErrorMessage&&(P=s.timeoutErrorMessage),r(new m(P,O.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&a.forEach(i.toJSON(),function(P,O){p.setRequestHeader(O,P)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([b,h]=$(u,!0),p.addEventListener("progress",b)),f&&p.upload&&([d,E]=$(f),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(l=R=>{p&&(r(!R||R.type?new D(null,e,p):R),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const S=pn(s.url);if(S&&T.protocols.indexOf(S)===-1){r(new m("Unsupported protocol "+S+":",m.ERR_BAD_REQUEST,e));return}p.send(o||null)})},On=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new D(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Tn=On,An=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},xn=async function*(e,t){for await(const n of Cn(e))yield*An(n,t)},Cn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},xe=(e,t,n,r)=>{const s=xn(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let b=o+=d;n(b)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Q=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ge=Q&&typeof ReadableStream=="function",Pn=Q&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Qe=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Nn=Ge&&Qe(()=>{let e=!1;const t=new Request(T.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ce=64*1024,oe=Ge&&Qe(()=>a.isReadableStream(new Response("").body)),v={stream:oe&&(e=>e.body)};Q&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!v[t]&&(v[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const _n=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(T.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Pn(e)).byteLength},Fn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??_n(t)},qn=Q&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:b}=Xe(e);u=u?(u+"").toLowerCase():"text";let E=Tn([s,o&&o.toAbortSignal()],i),h;const y=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let p;try{if(f&&Nn&&n!=="get"&&n!=="head"&&(p=await Fn(l,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(a.isFormData(r)&&(N=O.headers.get("content-type"))&&l.setContentType(N),O.body){const[F,k]=Oe(p,$(Te(f)));r=xe(O.body,Ce,F,k)}}a.isString(d)||(d=d?"include":"omit");const w="credentials"in Request.prototype;h=new Request(t,{...b,signal:E,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:w?d:void 0});let S=await fetch(h);const R=oe&&(u==="stream"||u==="response");if(oe&&(c||R&&y)){const O={};["status","statusText","headers"].forEach(ye=>{O[ye]=S[ye]});const N=a.toFiniteNumber(S.headers.get("content-length")),[F,k]=c&&Oe(N,$(Te(c),!0))||[];S=new Response(xe(S.body,Ce,F,()=>{k&&k(),y&&y()}),O)}u=u||"text";let P=await v[a.findKey(v,u)||"text"](S,e);return!R&&y&&y(),await new Promise((O,N)=>{Ve(O,N,{data:P,headers:x.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:h})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,h),{cause:w.cause||w}):m.from(w,w&&w.code,e,h)}}),ie={http:vt,xhr:Rn,fetch:qn};a.forEach(ie,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Pe=e=>`- ${e}`,Ln=e=>a.isFunction(e)||e===null||e===!1,Ze={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!Ln(n)&&(r=ie[(i=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
`+o.map(Pe).join(`
`):" "+Pe(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:ie};function te(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new U(null,e)}function Ne(e){return te(e),e.headers=x.from(e.headers),e.data=ee.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ze.getAdapter(e.adapter||he.adapter)(e).then(function(r){return te(e),r.data=ee.call(e,e.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return ve(r)||(te(e),r&&r.response&&(r.response.data=ee.call(e,e.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const Ye="1.7.7",pe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{pe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const _e={};pe.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Ye+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!_e[i]&&(_e[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Fn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const ae={assertOptions:Fn,validators:pe},_=ae.validators;class W{constructor(t){this.defaults=t,this.interceptors={request:new Re,response:new Re}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=L(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:_.transitional(_.boolean),forcedJSONParsing:_.transitional(_.boolean),clarifyTimeoutError:_.transitional(_.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:_.function,serialize:_.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=x.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(f=f&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,d=0,b;if(!f){const h=[Ne.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,u),b=h.length,l=Promise.resolve(n);d<b;)l=l.then(h[d++],h[d++]);return l}b=c.length;let E=n;for(d=0;d<b;){const h=c[d++],y=c[d++];try{E=h(E)}catch(p){y.call(this,p);break}}try{l=Ne.call(this,E)}catch(h){return Promise.reject(h)}for(d=0,b=u.length;d<b;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=L(this.defaults,t);const n=Ke(t.baseURL,t.url);return $e(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){W.prototype[t]=function(n,r){return this.request(L(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(L(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}W.prototype[t]=n(),W.prototype[t+"Form"]=n(!0)});const z=W;class me{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new U(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new me(function(s){t=s}),cancel:t}}}const Bn=me;function Ln(e){return function(n){return e.apply(null,n)}}function Dn(e){return a.isObject(e)&&e.isAxiosError===!0}const ce={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(ce).forEach(([e,t])=>{ce[t]=e});const Un=ce;function et(e){const t=new z(e),n=Fe(z.prototype.request,t);return a.extend(n,z.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return et(L(e,s))},n}const g=et(he);g.Axios=z;g.CanceledError=U;g.CancelToken=Bn;g.isCancel=ve;g.VERSION=Ye;g.toFormData=X;g.AxiosError=m;g.Cancel=g.CanceledError;g.all=function(t){return Promise.all(t)};g.spread=Ln;g.isAxiosError=Dn;g.mergeConfig=L;g.AxiosHeaders=x;g.formToJSON=e=>We(a.isHTMLForm(e)?new FormData(e):e);g.getAdapter=Ze.getAdapter;g.HttpStatusCode=Un;g.default=g;const qn=g;class jn extends Error{constructor(t){super(t.message),this.response=t,this.code=t.code,this.initName()}initName(){this.name=this.constructor.name}getInfo(){return{message:this.response.message,code:this.response.code}}}const kn=e=>{const t=e.data;return new jn({message:(t==null?void 0:t.message)??e.statusText,code:(t==null?void 0:t.statusCode)??`HTTP_CODE_${e.status}`})},In=e=>e,Hn=e=>Promise.reject(kn(e.response)),Mn={formData:{"Content-Type":"multipart/form-data"},formUrlDecode:{"Content-Type":"application/x-www-form-urlencoded"},json:{"Content-Type":"application/json"}},zn=(e,t)=>{const n=qn.create({baseURL:e,method:"POST",headers:{...Mn.formData,"Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},timeout:(t==null?void 0:t.timeout)??12e5});n.interceptors.response.use(In,Hn);const r=(c,f)=>n({url:`/api/squash/${c}/upload`,data:f,responseType:"json"}),s=(c,f,u)=>n({url:`/api/squash/${c}`,data:f,responseType:u});return{squashUploader:r,squashWithBlob:(c,f)=>s(c,f,"blob"),squashWithArrayBuffer:(c,f)=>s(c,f,"arraybuffer")}};class tt{constructor(t){this.axiosInstance=zn(t)}async squashImage(t,n,r){const s={...r,sourceFile:n},o=await this.axiosInstance.squashWithBlob(t,s);return URL.createObjectURL(o.data)}async squashWebp(t,n){return await this.squashImage("webp",t,n)}async squashJpg(t,n){return await this.squashImage("jpg",t,n)}async squashPng(t,n){return await this.squashImage("png",t,n)}}const $n=async(e,t)=>{try{const n=Buffer.from(e);(void 0)(t,n)}catch(n){throw console.log("Error downloading file:",n),n}};exports.ImgzClient=tt;exports.default=tt;exports.saveFile=$n;
`):" "+Pe(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:ie};function te(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new D(null,e)}function Ne(e){return te(e),e.headers=x.from(e.headers),e.data=ee.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ze.getAdapter(e.adapter||he.adapter)(e).then(function(r){return te(e),r.data=ee.call(e,e.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return We(r)||(te(e),r&&r.response&&(r.response.data=ee.call(e,e.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const Ye="1.7.7",pe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{pe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const _e={};pe.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Ye+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!_e[i]&&(_e[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Bn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const ae={assertOptions:Bn,validators:pe},_=ae.validators;class J{constructor(t){this.defaults=t,this.interceptors={request:new Se,response:new Se}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=L(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:_.transitional(_.boolean),forcedJSONParsing:_.transitional(_.boolean),clarifyTimeoutError:_.transitional(_.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:_.function,serialize:_.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=x.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(f=f&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,d=0,b;if(!f){const h=[Ne.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,u),b=h.length,l=Promise.resolve(n);d<b;)l=l.then(h[d++],h[d++]);return l}b=c.length;let E=n;for(d=0;d<b;){const h=c[d++],y=c[d++];try{E=h(E)}catch(p){y.call(this,p);break}}try{l=Ne.call(this,E)}catch(h){return Promise.reject(h)}for(d=0,b=u.length;d<b;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=L(this.defaults,t);const n=Ke(t.baseURL,t.url);return $e(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){J.prototype[t]=function(n,r){return this.request(L(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(L(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}J.prototype[t]=n(),J.prototype[t+"Form"]=n(!0)});const z=J;class me{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new D(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new me(function(s){t=s}),cancel:t}}}const Dn=me;function Un(e){return function(n){return e.apply(null,n)}}function jn(e){return a.isObject(e)&&e.isAxiosError===!0}const ce={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(ce).forEach(([e,t])=>{ce[t]=e});const In=ce;function et(e){const t=new z(e),n=Fe(z.prototype.request,t);return a.extend(n,z.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return et(L(e,s))},n}const g=et(he);g.Axios=z;g.CanceledError=D;g.CancelToken=Dn;g.isCancel=We;g.VERSION=Ye;g.toFormData=X;g.AxiosError=m;g.Cancel=g.CanceledError;g.all=function(t){return Promise.all(t)};g.spread=Un;g.isAxiosError=jn;g.mergeConfig=L;g.AxiosHeaders=x;g.formToJSON=e=>Je(a.isHTMLForm(e)?new FormData(e):e);g.getAdapter=Ze.getAdapter;g.HttpStatusCode=In;g.default=g;const kn=g;class tt extends Error{constructor(t){super(t.message),this.response=t,this.code=t.code,this.initName()}initName(){this.name=this.constructor.name}getInfo(){return{message:this.response.message,code:this.response.code}}}const Hn=e=>{const t=e.data;return new tt({message:(t==null?void 0:t.message)??e.statusText,code:(t==null?void 0:t.statusCode)??`HTTP_CODE_${e.status}`})},Mn=e=>e,zn=e=>Promise.reject(Hn(e.response)),$n={formData:{"Content-Type":"multipart/form-data"},formUrlDecode:{"Content-Type":"application/x-www-form-urlencoded"},json:{"Content-Type":"application/json"}},nt=(e,t)=>{const n=kn.create({baseURL:e,method:"POST",headers:{...$n.formData,"Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},timeout:(t==null?void 0:t.timeout)??12e5});n.interceptors.response.use(Mn,zn);const r=(c,f)=>n({url:`/api/squash/${c}/upload`,data:f,responseType:"json"}),s=(c,f,u)=>n({url:`/api/squash/${c}`,data:f,responseType:u});return{squashUploader:r,squashWithBlob:(c,f)=>s(c,f,"blob"),squashWithArrayBuffer:(c,f)=>s(c,f,"arraybuffer")}};let rt=class{constructor(t){this.axiosInstance=nt(t)}async squashImage(t,n,r){const s={...r,sourceFile:n},o=await this.axiosInstance.squashWithBlob(t,s);return URL.createObjectURL(o.data)}async squashWebp(t,n){return await this.squashImage("webp",t,n)}async squashJpg(t,n){return await this.squashImage("jpg",t,n)}async squashPng(t,n){return await this.squashImage("png",t,n)}};const st=async(e,t)=>{try{const n=Buffer.from(e);(void 0)(t,n)}catch(n){throw console.log("Error downloading file:",n),n}};class vn{constructor(t,n){this.saveOperations=[];const r={timeout:n==null?void 0:n.timeout};this.axiosInstance=nt(t,r)}squashImage(t,n){return this.format=t,this.sourceFile=(void 0)(n),this}squashWebp(t){return this.squashImage("webp",t)}squashJpg(t){return this.squashImage("jpg",t)}squashPng(t){return this.squashImage("png",t)}toSave(t,n){const r=new Promise(async(s,o)=>{if(!(this.format&&this.sourceFile))return o(new tt({message:"You must first call the squash[Format] method before calling toSave()",code:"NO_CALL_SAVE"}));try{const i={quality:this.quality,...n,sourceFile:this.sourceFile},c=await this.axiosInstance.squashWithArrayBuffer(this.format,i);st(c.data,t),s(t)}catch(i){console.error("Error:",i),o(i)}});return this.saveOperations.push(r),this}async completeAll(){const t=await Promise.all(this.saveOperations);return this.saveOperations=[],this.format=void 0,this.sourceFile=void 0,this.quality=void 0,t}}exports.ImgzClient=rt;exports.ImgzNodeClient=vn;exports.default=rt;exports.saveFile=st;

@@ -6,29 +6,29 @@ function Fe(e, t) {

}
const { toString: tt } = Object.prototype, { getPrototypeOf: ue } = Object, V = ((e) => (t) => {
const n = tt.call(t);
const { toString: rt } = Object.prototype, { getPrototypeOf: ue } = Object, v = ((e) => (t) => {
const n = rt.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), C = (e) => (e = e.toLowerCase(), (t) => V(t) === e), v = (e) => (t) => typeof t === e, { isArray: D } = Array, j = v("undefined");
function nt(e) {
return e !== null && !j(e) && e.constructor !== null && !j(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
})(/* @__PURE__ */ Object.create(null)), C = (e) => (e = e.toLowerCase(), (t) => v(t) === e), V = (e) => (t) => typeof t === e, { isArray: B } = Array, I = V("undefined");
function st(e) {
return e !== null && !I(e) && e.constructor !== null && !I(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const Be = C("ArrayBuffer");
function rt(e) {
const qe = C("ArrayBuffer");
function ot(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Be(e.buffer), t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && qe(e.buffer), t;
}
const st = v("string"), A = v("function"), Le = v("number"), K = (e) => e !== null && typeof e == "object", ot = (e) => e === !0 || e === !1, H = (e) => {
if (V(e) !== "object")
const it = V("string"), A = V("function"), Le = V("number"), K = (e) => e !== null && typeof e == "object", at = (e) => e === !0 || e === !1, H = (e) => {
if (v(e) !== "object")
return !1;
const t = ue(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, it = C("Date"), at = C("File"), ct = C("Blob"), ut = C("FileList"), lt = (e) => K(e) && A(e.pipe), ft = (e) => {
}, ct = C("Date"), ut = C("File"), lt = C("Blob"), ft = C("FileList"), dt = (e) => K(e) && A(e.pipe), ht = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t = V(e)) === "formdata" || // detect form-data instance
return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t = v(e)) === "formdata" || // detect form-data instance
t === "object" && A(e.toString) && e.toString() === "[object FormData]"));
}, dt = C("URLSearchParams"), [ht, pt, mt, yt] = ["ReadableStream", "Request", "Response", "Headers"].map(C), bt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function k(e, t, { allOwnKeys: n = !1 } = {}) {
}, pt = C("URLSearchParams"), [mt, yt, bt, wt] = ["ReadableStream", "Request", "Response", "Headers"].map(C), gt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function j(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, s;
if (typeof e != "object" && (e = [e]), D(e))
if (typeof e != "object" && (e = [e]), B(e))
for (r = 0, s = e.length; r < s; r++)

@@ -43,3 +43,3 @@ t.call(null, e[r], r, e);

}
function De(e, t) {
function Be(e, t) {
t = t.toLowerCase();

@@ -53,19 +53,19 @@ const n = Object.keys(e);

}
const B = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Ue = (e) => !j(e) && e !== B;
const q = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), De = (e) => !I(e) && e !== q;
function ne() {
const { caseless: e } = Ue(this) && this || {}, t = {}, n = (r, s) => {
const o = e && De(t, s) || s;
H(t[o]) && H(r) ? t[o] = ne(t[o], r) : H(r) ? t[o] = ne({}, r) : D(r) ? t[o] = r.slice() : t[o] = r;
const { caseless: e } = De(this) && this || {}, t = {}, n = (r, s) => {
const o = e && Be(t, s) || s;
H(t[o]) && H(r) ? t[o] = ne(t[o], r) : H(r) ? t[o] = ne({}, r) : B(r) ? t[o] = r.slice() : t[o] = r;
};
for (let r = 0, s = arguments.length; r < s; r++)
arguments[r] && k(arguments[r], n);
arguments[r] && j(arguments[r], n);
return t;
}
const wt = (e, t, n, { allOwnKeys: r } = {}) => (k(t, (s, o) => {
const Et = (e, t, n, { allOwnKeys: r } = {}) => (j(t, (s, o) => {
n && A(s) ? e[o] = Fe(s, n) : e[o] = s;
}, { allOwnKeys: r }), e), Et = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), gt = (e, t, n, r) => {
}, { allOwnKeys: r }), e), Rt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), St = (e, t, n, r) => {
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), n && Object.assign(e.prototype, n);
}, Rt = (e, t, n, r) => {
}, Ot = (e, t, n, r) => {
let s, o, i;

@@ -81,10 +81,10 @@ const c = {};

return t;
}, St = (e, t, n) => {
}, Tt = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const r = e.indexOf(t, n);
return r !== -1 && r === n;
}, Tt = (e) => {
}, At = (e) => {
if (!e)
return null;
if (D(e))
if (B(e))
return e;

@@ -98,3 +98,3 @@ let t = e.length;

return n;
}, Ot = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ue(Uint8Array)), At = (e, t) => {
}, xt = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ue(Uint8Array)), Ct = (e, t) => {
const r = (e && e[Symbol.iterator]).call(e);

@@ -106,3 +106,3 @@ let s;

}
}, xt = (e, t) => {
}, Pt = (e, t) => {
let n;

@@ -113,3 +113,3 @@ const r = [];

return r;
}, Ct = C("HTMLFormElement"), Pt = (e) => e.toLowerCase().replace(
}, Nt = C("HTMLFormElement"), _t = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,

@@ -119,10 +119,10 @@ function(n, r, s) {

}
), be = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Nt = C("RegExp"), qe = (e, t) => {
), be = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ft = C("RegExp"), Ue = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
k(n, (s, o) => {
j(n, (s, o) => {
let i;
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
}), Object.defineProperties(e, r);
}, _t = (e) => {
qe(e, (t, n) => {
}, qt = (e) => {
Ue(e, (t, n) => {
if (A(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)

@@ -141,3 +141,3 @@ return !1;

});
}, Ft = (e, t) => {
}, Lt = (e, t) => {
const n = {}, r = (s) => {

@@ -148,9 +148,9 @@ s.forEach((o) => {

};
return D(e) ? r(e) : r(String(e).split(t)), n;
return B(e) ? r(e) : r(String(e).split(t)), n;
}, Bt = () => {
}, Lt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, Z = "abcdefghijklmnopqrstuvwxyz", we = "0123456789", je = {
}, Dt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, Z = "abcdefghijklmnopqrstuvwxyz", we = "0123456789", Ie = {
DIGIT: we,
ALPHA: Z,
ALPHA_DIGIT: Z + Z.toUpperCase() + we
}, Dt = (e = 16, t = je.ALPHA_DIGIT) => {
}, Ut = (e = 16, t = Ie.ALPHA_DIGIT) => {
let n = "";

@@ -162,6 +162,6 @@ const { length: r } = t;

};
function Ut(e) {
function It(e) {
return !!(e && A(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const qt = (e) => {
const jt = (e) => {
const t = new Array(10), n = (r, s) => {

@@ -173,6 +173,6 @@ if (K(r)) {

t[s] = r;
const o = D(r) ? [] : {};
return k(r, (i, c) => {
const o = B(r) ? [] : {};
return j(r, (i, c) => {
const f = n(i, s + 1);
!j(f) && (o[c] = f);
!I(f) && (o[c] = f);
}), t[s] = void 0, o;

@@ -184,68 +184,68 @@ }

return n(e, 0);
}, jt = C("AsyncFunction"), kt = (e) => e && (K(e) || A(e)) && A(e.then) && A(e.catch), ke = ((e, t) => e ? setImmediate : t ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
s === B && o === n && r.length && r.shift()();
}, kt = C("AsyncFunction"), Ht = (e) => e && (K(e) || A(e)) && A(e.then) && A(e.catch), je = ((e, t) => e ? setImmediate : t ? ((n, r) => (q.addEventListener("message", ({ source: s, data: o }) => {
s === q && o === n && r.length && r.shift()();
}, !1), (s) => {
r.push(s), B.postMessage(n, "*");
r.push(s), q.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
A(B.postMessage)
), It = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || ke, a = {
isArray: D,
isArrayBuffer: Be,
isBuffer: nt,
isFormData: ft,
isArrayBufferView: rt,
isString: st,
A(q.postMessage)
), Mt = typeof queueMicrotask < "u" ? queueMicrotask.bind(q) : typeof process < "u" && process.nextTick || je, a = {
isArray: B,
isArrayBuffer: qe,
isBuffer: st,
isFormData: ht,
isArrayBufferView: ot,
isString: it,
isNumber: Le,
isBoolean: ot,
isBoolean: at,
isObject: K,
isPlainObject: H,
isReadableStream: ht,
isRequest: pt,
isResponse: mt,
isHeaders: yt,
isUndefined: j,
isDate: it,
isFile: at,
isBlob: ct,
isRegExp: Nt,
isReadableStream: mt,
isRequest: yt,
isResponse: bt,
isHeaders: wt,
isUndefined: I,
isDate: ct,
isFile: ut,
isBlob: lt,
isRegExp: Ft,
isFunction: A,
isStream: lt,
isURLSearchParams: dt,
isTypedArray: Ot,
isFileList: ut,
forEach: k,
isStream: dt,
isURLSearchParams: pt,
isTypedArray: xt,
isFileList: ft,
forEach: j,
merge: ne,
extend: wt,
trim: bt,
stripBOM: Et,
inherits: gt,
toFlatObject: Rt,
kindOf: V,
extend: Et,
trim: gt,
stripBOM: Rt,
inherits: St,
toFlatObject: Ot,
kindOf: v,
kindOfTest: C,
endsWith: St,
toArray: Tt,
forEachEntry: At,
matchAll: xt,
isHTMLForm: Ct,
endsWith: Tt,
toArray: At,
forEachEntry: Ct,
matchAll: Pt,
isHTMLForm: Nt,
hasOwnProperty: be,
hasOwnProp: be,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: qe,
freezeMethods: _t,
toObjectSet: Ft,
toCamelCase: Pt,
reduceDescriptors: Ue,
freezeMethods: qt,
toObjectSet: Lt,
toCamelCase: _t,
noop: Bt,
toFiniteNumber: Lt,
findKey: De,
global: B,
isContextDefined: Ue,
ALPHABET: je,
generateString: Dt,
isSpecCompliantForm: Ut,
toJSONObject: qt,
isAsyncFn: jt,
isThenable: kt,
setImmediate: ke,
asap: It
toFiniteNumber: Dt,
findKey: Be,
global: q,
isContextDefined: De,
ALPHABET: Ie,
generateString: Ut,
isSpecCompliantForm: It,
toJSONObject: jt,
isAsyncFn: kt,
isThenable: Ht,
setImmediate: je,
asap: Mt
};

@@ -276,3 +276,3 @@ function m(e, t, n, r, s) {

});
const Ie = m.prototype, He = {};
const ke = m.prototype, He = {};
[

@@ -296,5 +296,5 @@ "ERR_BAD_OPTION_VALUE",

Object.defineProperties(m, He);
Object.defineProperty(Ie, "isAxiosError", { value: !0 });
Object.defineProperty(ke, "isAxiosError", { value: !0 });
m.from = (e, t, n, r, s, o) => {
const i = Object.create(Ie);
const i = Object.create(ke);
return a.toFlatObject(e, i, function(f) {

@@ -304,3 +304,3 @@ return f !== Error.prototype;

};
const Ht = null;
const zt = null;
function re(e) {

@@ -312,3 +312,3 @@ return a.isPlainObject(e) || a.isArray(e);

}
function Ee(e, t, n) {
function ge(e, t, n) {
return e ? e.concat(t).map(function(s, o) {

@@ -318,6 +318,6 @@ return s = Me(s), !n && o ? "[" + s + "]" : s;

}
function Mt(e) {
function $t(e) {
return a.isArray(e) && !e.some(re);
}
const zt = a.toFlatObject(a, {}, null, function(t) {
const Jt = a.toFlatObject(a, {}, null, function(t) {
return /^is[A-Z]/.test(t);

@@ -352,7 +352,7 @@ });

y = r ? y : y.slice(0, -2), h = JSON.stringify(h);
else if (a.isArray(h) && Mt(h) || (a.isFileList(h) || a.endsWith(y, "[]")) && (w = a.toArray(h)))
else if (a.isArray(h) && $t(h) || (a.isFileList(h) || a.endsWith(y, "[]")) && (w = a.toArray(h)))
return y = Me(y), w.forEach(function(S, P) {
!(a.isUndefined(S) || S === null) && t.append(
// eslint-disable-next-line no-nested-ternary
i === !0 ? Ee([y], P, o) : i === null ? y : y + "[]",
i === !0 ? ge([y], P, o) : i === null ? y : y + "[]",
u(S)

@@ -362,5 +362,5 @@ );

}
return re(h) ? !0 : (t.append(Ee(p, y, o), u(h)), !1);
return re(h) ? !0 : (t.append(ge(p, y, o), u(h)), !1);
}
const d = [], b = Object.assign(zt, {
const d = [], b = Object.assign(Jt, {
defaultVisitor: l,

@@ -370,3 +370,3 @@ convertValue: u,

});
function g(h, y) {
function E(h, y) {
if (!a.isUndefined(h)) {

@@ -382,3 +382,3 @@ if (d.indexOf(h) !== -1)

b
)) === !0 && g(w, y ? y.concat(R) : [R]);
)) === !0 && E(w, y ? y.concat(R) : [R]);
}), d.pop();

@@ -389,5 +389,5 @@ }

throw new TypeError("data must be an object");
return g(e), t;
return E(e), t;
}
function ge(e) {
function Ee(e) {
const t = {

@@ -415,4 +415,4 @@ "!": "%21",

const n = t ? function(r) {
return t.call(this, r, ge);
} : ge;
return t.call(this, r, Ee);
} : Ee;
return this._pairs.map(function(s) {

@@ -422,3 +422,3 @@ return n(s[0]) + "=" + n(s[1]);

};
function $t(e) {
function Wt(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");

@@ -429,3 +429,3 @@ }

return e;
const r = n && n.encode || $t, s = n && n.serialize;
const r = n && n.encode || Wt, s = n && n.serialize;
let o;

@@ -438,3 +438,3 @@ if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new le(t, n).toString(r), o) {

}
class Jt {
class vt {
constructor() {

@@ -493,37 +493,37 @@ this.handlers = [];

}
const Re = Jt, Je = {
const Re = vt, Je = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, Wt = typeof URLSearchParams < "u" ? URLSearchParams : le, Vt = typeof FormData < "u" ? FormData : null, vt = typeof Blob < "u" ? Blob : null, Kt = {
}, Vt = typeof URLSearchParams < "u" ? URLSearchParams : le, Kt = typeof FormData < "u" ? FormData : null, Xt = typeof Blob < "u" ? Blob : null, Gt = {
isBrowser: !0,
classes: {
URLSearchParams: Wt,
FormData: Vt,
Blob: vt
URLSearchParams: Vt,
FormData: Kt,
Blob: Xt
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, fe = typeof window < "u" && typeof document < "u", se = typeof navigator == "object" && navigator || void 0, Xt = fe && (!se || ["ReactNative", "NativeScript", "NS"].indexOf(se.product) < 0), Gt = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), Qt = fe && window.location.href || "http://localhost", Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, fe = typeof window < "u" && typeof document < "u", se = typeof navigator == "object" && navigator || void 0, Qt = fe && (!se || ["ReactNative", "NativeScript", "NS"].indexOf(se.product) < 0), Zt = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), Yt = fe && window.location.href || "http://localhost", en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: fe,
hasStandardBrowserEnv: Xt,
hasStandardBrowserWebWorkerEnv: Gt,
hasStandardBrowserEnv: Qt,
hasStandardBrowserWebWorkerEnv: Zt,
navigator: se,
origin: Qt
}, Symbol.toStringTag, { value: "Module" })), O = {
...Zt,
...Kt
origin: Yt
}, Symbol.toStringTag, { value: "Module" })), T = {
...en,
...Gt
};
function Yt(e, t) {
return X(e, new O.classes.URLSearchParams(), Object.assign({
function tn(e, t) {
return X(e, new T.classes.URLSearchParams(), Object.assign({
visitor: function(n, r, s, o) {
return O.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
return T.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
}
}, t));
}
function en(e) {
function nn(e) {
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function tn(e) {
function rn(e) {
const t = {}, n = Object.keys(e);

@@ -543,3 +543,3 @@ let r;

const c = Number.isFinite(+i), f = o >= n.length;
return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = tn(s[i])), !c);
return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = rn(s[i])), !c);
}

@@ -549,3 +549,3 @@ if (a.isFormData(e) && a.isFunction(e.entries)) {

return a.forEachEntry(e, (r, s) => {
t(en(r), s, n, 0);
t(nn(r), s, n, 0);
}), n;

@@ -555,3 +555,3 @@ }

}
function nn(e, t, n) {
function sn(e, t, n) {
if (a.isString(e))

@@ -582,3 +582,3 @@ try {

if (r.indexOf("application/x-www-form-urlencoded") > -1)
return Yt(t, this.formSerializer).toString();
return tn(t, this.formSerializer).toString();
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {

@@ -593,3 +593,3 @@ const f = this.env && this.env.FormData;

}
return o || s ? (n.setContentType("application/json", !1), nn(t)) : t;
return o || s ? (n.setContentType("application/json", !1), sn(t)) : t;
}],

@@ -621,4 +621,4 @@ transformResponse: [function(t) {

env: {
FormData: O.classes.FormData,
Blob: O.classes.Blob
FormData: T.classes.FormData,
Blob: T.classes.Blob
},

@@ -638,3 +638,3 @@ validateStatus: function(t) {

});
const he = de, rn = a.toObjectSet([
const he = de, on = a.toObjectSet([
"age",

@@ -657,3 +657,3 @@ "authorization",

"user-agent"
]), sn = (e) => {
]), an = (e) => {
const t = {};

@@ -663,6 +663,6 @@ let n, r, s;

`).forEach(function(i) {
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && rn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && on[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, Se = Symbol("internals");
function q(e) {
function U(e) {
return e && String(e).trim().toLowerCase();

@@ -673,3 +673,3 @@ }

}
function on(e) {
function cn(e) {
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;

@@ -681,3 +681,3 @@ let r;

}
const an = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
const un = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function Y(e, t, n, r, s) {

@@ -693,6 +693,6 @@ if (a.isFunction(r))

}
function cn(e) {
function ln(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function un(e, t) {
function fn(e, t) {
const n = a.toCamelCase(" " + t);

@@ -715,3 +715,3 @@ ["get", "set", "has"].forEach((r) => {

function o(c, f, u) {
const l = q(f);
const l = U(f);
if (!l)

@@ -725,4 +725,4 @@ throw new Error("header name must be a non-empty string");

i(t, n);
else if (a.isString(t) && (t = t.trim()) && !an(t))
i(sn(t), n);
else if (a.isString(t) && (t = t.trim()) && !un(t))
i(an(t), n);
else if (a.isHeaders(t))

@@ -736,3 +736,3 @@ for (const [c, f] of t.entries())

get(t, n) {
if (t = q(t), t) {
if (t = U(t), t) {
const r = a.findKey(this, t);

@@ -744,3 +744,3 @@ if (r) {

if (n === !0)
return on(s);
return cn(s);
if (a.isFunction(n))

@@ -755,3 +755,3 @@ return n.call(this, s, r);

has(t, n) {
if (t = q(t), t) {
if (t = U(t), t) {
const r = a.findKey(this, t);

@@ -766,3 +766,3 @@ return !!(r && this[r] !== void 0 && (!n || Y(this, this[r], r, n)));

function o(i) {
if (i = q(i), i) {
if (i = U(i), i) {
const c = a.findKey(r, i);

@@ -791,3 +791,3 @@ c && (!n || Y(r, r[c], c, n)) && (delete r[c], s = !0);

}
const c = t ? cn(o) : String(o).trim();
const c = t ? ln(o) : String(o).trim();
c !== o && delete n[o], n[c] = M(s), r[c] = !0;

@@ -827,4 +827,4 @@ }), this;

function o(i) {
const c = q(i);
r[c] || (un(s, i), r[c] = !0);
const c = U(i);
r[c] || (fn(s, i), r[c] = !0);
}

@@ -853,12 +853,12 @@ return a.isArray(t) ? t.forEach(o) : o(t), this;

}
function Ve(e) {
function ve(e) {
return !!(e && e.__CANCEL__);
}
function U(e, t, n) {
function D(e, t, n) {
m.call(this, e ?? "canceled", m.ERR_CANCELED, t, n), this.name = "CanceledError";
}
a.inherits(U, m, {
a.inherits(D, m, {
__CANCEL__: !0
});
function ve(e, t, n) {
function Ve(e, t, n) {
const r = n.config.validateStatus;

@@ -873,7 +873,7 @@ !n.status || !r || r(n.status) ? e(n) : t(new m(

}
function ln(e) {
function dn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function fn(e, t) {
function hn(e, t) {
e = e || 10;

@@ -890,7 +890,7 @@ const n = new Array(e), r = new Array(e);

return;
const g = l && u - l;
return g ? Math.round(b * 1e3 / g) : void 0;
const E = l && u - l;
return E ? Math.round(b * 1e3 / E) : void 0;
};
}
function dn(e, t) {
function pn(e, t) {
let n = 0, r = 1e3 / t, s, o;

@@ -909,4 +909,4 @@ const i = (u, l = Date.now()) => {

let r = 0;
const s = fn(50, 250);
return dn((o) => {
const s = hn(50, 250);
return pn((o) => {
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, f = i - r, u = s(f), l = i <= c;

@@ -927,3 +927,3 @@ r = i;

}, n);
}, Te = (e, t) => {
}, Oe = (e, t) => {
const n = e != null;

@@ -935,7 +935,7 @@ return [(r) => t[0]({

}), t[1]];
}, Oe = (e) => (...t) => a.asap(() => e(...t)), hn = O.hasStandardBrowserEnv ? (
}, Te = (e) => (...t) => a.asap(() => e(...t)), mn = T.hasStandardBrowserEnv ? (
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
function() {
const t = O.navigator && /(msie|trident)/i.test(O.navigator.userAgent), n = document.createElement("a");
const t = T.navigator && /(msie|trident)/i.test(T.navigator.userAgent), n = document.createElement("a");
let r;

@@ -967,3 +967,3 @@ function s(o) {

}()
), pn = O.hasStandardBrowserEnv ? (
), yn = T.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie

@@ -995,10 +995,10 @@ {

);
function mn(e) {
function bn(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function yn(e, t) {
function wn(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function Ke(e, t) {
return e && !mn(t) ? yn(e, t) : t;
return e && !bn(t) ? wn(e, t) : t;
}

@@ -1081,3 +1081,3 @@ const Ae = (e) => e instanceof x ? { ...e } : e;

if (a.isFormData(n)) {
if (O.hasStandardBrowserEnv || O.hasStandardBrowserWebWorkerEnv)
if (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv)
i.setContentType(void 0);

@@ -1089,8 +1089,8 @@ else if ((f = i.getContentType()) !== !1) {

}
if (O.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && hn(t.url))) {
const u = s && o && pn.read(o);
if (T.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && mn(t.url))) {
const u = s && o && yn.read(o);
u && i.set(s, u);
}
return t;
}, bn = typeof XMLHttpRequest < "u", wn = bn && function(e) {
}, gn = typeof XMLHttpRequest < "u", En = gn && function(e) {
return new Promise(function(n, r) {

@@ -1100,5 +1100,5 @@ const s = Xe(e);

const i = x.from(s.headers).normalize();
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, b, g, h;
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, b, E, h;
function y() {
g && g(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
}

@@ -1112,3 +1112,3 @@ let p = new XMLHttpRequest();

"getAllResponseHeaders" in p && p.getAllResponseHeaders()
), T = {
), O = {
data: !c || c === "text" || c === "json" ? p.responseText : p.response,

@@ -1121,7 +1121,7 @@ status: p.status,

};
ve(function(F) {
Ve(function(F) {
n(F), y();
}, function(F) {
r(F), y();
}, T), p = null;
}, O), p = null;
}

@@ -1136,16 +1136,16 @@ "onloadend" in p ? p.onloadend = w : p.onreadystatechange = function() {

let P = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
const T = s.transitional || Je;
const O = s.transitional || Je;
s.timeoutErrorMessage && (P = s.timeoutErrorMessage), r(new m(
P,
T.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
O.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
e,
p
)), p = null;
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(P, T) {
p.setRequestHeader(T, P);
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([b, h] = $(u, !0), p.addEventListener("progress", b)), f && p.upload && ([d, g] = $(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (l = (S) => {
p && (r(!S || S.type ? new U(null, e, p) : S), p.abort(), p = null);
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(P, O) {
p.setRequestHeader(O, P);
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([b, h] = $(u, !0), p.addEventListener("progress", b)), f && p.upload && ([d, E] = $(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (l = (S) => {
p && (r(!S || S.type ? new D(null, e, p) : S), p.abort(), p = null);
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
const R = ln(s.url);
if (R && O.protocols.indexOf(R) === -1) {
const R = dn(s.url);
if (R && T.protocols.indexOf(R) === -1) {
r(new m("Unsupported protocol " + R + ":", m.ERR_BAD_REQUEST, e));

@@ -1156,3 +1156,3 @@ return;

});
}, En = (e, t) => {
}, Rn = (e, t) => {
const { length: n } = e = e ? e.filter(Boolean) : [];

@@ -1165,3 +1165,3 @@ if (t || n) {

const l = u instanceof Error ? u : this.reason;
r.abort(l instanceof m ? l : new U(l instanceof Error ? l.message : l));
r.abort(l instanceof m ? l : new D(l instanceof Error ? l.message : l));
}

@@ -1181,3 +1181,3 @@ };

}
}, gn = En, Rn = function* (e, t) {
}, Sn = Rn, On = function* (e, t) {
let n = e.byteLength;

@@ -1191,6 +1191,6 @@ if (!t || n < t) {

s = r + t, yield e.slice(r, s), r = s;
}, Sn = async function* (e, t) {
for await (const n of Tn(e))
yield* Rn(n, t);
}, Tn = async function* (e) {
}, Tn = async function* (e, t) {
for await (const n of An(e))
yield* On(n, t);
}, An = async function* (e) {
if (e[Symbol.asyncIterator]) {

@@ -1212,3 +1212,3 @@ yield* e;

}, xe = (e, t, n, r) => {
const s = Sn(e, t);
const s = Tn(e, t);
let o = 0, i, c = (f) => {

@@ -1241,3 +1241,3 @@ i || (i = !0, r && r(f));

});
}, Q = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Ge = Q && typeof ReadableStream == "function", On = Q && (typeof TextEncoder == "function" ? ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Qe = (e, ...t) => {
}, Q = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Ge = Q && typeof ReadableStream == "function", xn = Q && (typeof TextEncoder == "function" ? ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Qe = (e, ...t) => {
try {

@@ -1248,5 +1248,5 @@ return !!e(...t);

}
}, An = Ge && Qe(() => {
}, Cn = Ge && Qe(() => {
let e = !1;
const t = new Request(O.origin, {
const t = new Request(T.origin, {
body: new ReadableStream(),

@@ -1269,3 +1269,3 @@ method: "POST",

})(new Response());
const xn = async (e) => {
const Pn = async (e) => {
if (e == null)

@@ -1276,3 +1276,3 @@ return 0;

if (a.isSpecCompliantForm(e))
return (await new Request(O.origin, {
return (await new Request(T.origin, {
method: "POST",

@@ -1284,7 +1284,7 @@ body: e

if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
return (await On(e)).byteLength;
}, Cn = async (e, t) => {
return (await xn(e)).byteLength;
}, Nn = async (e, t) => {
const n = a.toFiniteNumber(e.getContentLength());
return n ?? xn(t);
}, Pn = Q && (async (e) => {
return n ?? Pn(t);
}, _n = Q && (async (e) => {
let {

@@ -1305,10 +1305,10 @@ url: t,

u = u ? (u + "").toLowerCase() : "text";
let g = gn([s, o && o.toAbortSignal()], i), h;
const y = g && g.unsubscribe && (() => {
g.unsubscribe();
let E = Sn([s, o && o.toAbortSignal()], i), h;
const y = E && E.unsubscribe && (() => {
E.unsubscribe();
});
let p;
try {
if (f && An && n !== "get" && n !== "head" && (p = await Cn(l, r)) !== 0) {
let T = new Request(t, {
if (f && Cn && n !== "get" && n !== "head" && (p = await Nn(l, r)) !== 0) {
let O = new Request(t, {
method: "POST",

@@ -1318,8 +1318,8 @@ body: r,

}), N;
if (a.isFormData(r) && (N = T.headers.get("content-type")) && l.setContentType(N), T.body) {
const [F, I] = Te(
if (a.isFormData(r) && (N = O.headers.get("content-type")) && l.setContentType(N), O.body) {
const [F, k] = Oe(
p,
$(Oe(f))
$(Te(f))
);
r = xe(T.body, Ce, F, I);
r = xe(O.body, Ce, F, k);
}

@@ -1331,3 +1331,3 @@ }

...b,
signal: g,
signal: E,
method: n.toUpperCase(),

@@ -1342,15 +1342,15 @@ headers: l.normalize().toJSON(),

if (oe && (c || S && y)) {
const T = {};
const O = {};
["status", "statusText", "headers"].forEach((ye) => {
T[ye] = R[ye];
O[ye] = R[ye];
});
const N = a.toFiniteNumber(R.headers.get("content-length")), [F, I] = c && Te(
const N = a.toFiniteNumber(R.headers.get("content-length")), [F, k] = c && Oe(
N,
$(Oe(c), !0)
$(Te(c), !0)
) || [];
R = new Response(
xe(R.body, Ce, F, () => {
I && I(), y && y();
k && k(), y && y();
}),
T
O
);

@@ -1360,4 +1360,4 @@ }

let P = await J[a.findKey(J, u) || "text"](R, e);
return !S && y && y(), await new Promise((T, N) => {
ve(T, N, {
return !S && y && y(), await new Promise((O, N) => {
Ve(O, N, {
data: P,

@@ -1380,5 +1380,5 @@ headers: x.from(R.headers),

}), ie = {
http: Ht,
xhr: wn,
fetch: Pn
http: zt,
xhr: En,
fetch: _n
};

@@ -1394,3 +1394,3 @@ a.forEach(ie, (e, t) => {

});
const Pe = (e) => `- ${e}`, Nn = (e) => a.isFunction(e) || e === null || e === !1, Ze = {
const Pe = (e) => `- ${e}`, Fn = (e) => a.isFunction(e) || e === null || e === !1, Ze = {
getAdapter: (e) => {

@@ -1404,3 +1404,3 @@ e = a.isArray(e) ? e : [e];

let i;
if (r = n, !Nn(n) && (r = ie[(i = String(n)).toLowerCase()], r === void 0))
if (r = n, !Fn(n) && (r = ie[(i = String(n)).toLowerCase()], r === void 0))
throw new m(`Unknown adapter '${i}'`);

@@ -1429,3 +1429,3 @@ if (r)

if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new U(null, e);
throw new D(null, e);
}

@@ -1443,3 +1443,3 @@ function Ne(e) {

}, function(r) {
return Ve(r) || (te(e), r && r.response && (r.response.data = ee.call(
return ve(r) || (te(e), r && r.response && (r.response.data = ee.call(
e,

@@ -1476,3 +1476,3 @@ e.transformResponse,

};
function _n(e, t, n) {
function qn(e, t, n) {
if (typeof e != "object")

@@ -1495,3 +1495,3 @@ throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);

const ae = {
assertOptions: _n,
assertOptions: qn,
validators: pe

@@ -1571,7 +1571,7 @@ }, _ = ae.validators;

b = c.length;
let g = n;
let E = n;
for (d = 0; d < b; ) {
const h = c[d++], y = c[d++];
try {
g = h(g);
E = h(E);
} catch (p) {

@@ -1583,3 +1583,3 @@ y.call(this, p);

try {
l = Ne.call(this, g);
l = Ne.call(this, E);
} catch (h) {

@@ -1648,3 +1648,3 @@ return Promise.reject(h);

}, t(function(o, i, c) {
r.reason || (r.reason = new U(o, i, c), n(r.reason));
r.reason || (r.reason = new D(o, i, c), n(r.reason));
});

@@ -1698,3 +1698,3 @@ }

}
const Fn = me;
const Ln = me;
function Bn(e) {

@@ -1705,3 +1705,3 @@ return function(n) {

}
function Ln(e) {
function Dn(e) {
return a.isObject(e) && e.isAxiosError === !0;

@@ -1777,3 +1777,3 @@ }

});
const Dn = ce;
const Un = ce;
function et(e) {

@@ -1785,24 +1785,24 @@ const t = new z(e), n = Fe(z.prototype.request, t);

}
const E = et(he);
E.Axios = z;
E.CanceledError = U;
E.CancelToken = Fn;
E.isCancel = Ve;
E.VERSION = Ye;
E.toFormData = X;
E.AxiosError = m;
E.Cancel = E.CanceledError;
E.all = function(t) {
const g = et(he);
g.Axios = z;
g.CanceledError = D;
g.CancelToken = Ln;
g.isCancel = ve;
g.VERSION = Ye;
g.toFormData = X;
g.AxiosError = m;
g.Cancel = g.CanceledError;
g.all = function(t) {
return Promise.all(t);
};
E.spread = Bn;
E.isAxiosError = Ln;
E.mergeConfig = L;
E.AxiosHeaders = x;
E.formToJSON = (e) => We(a.isHTMLForm(e) ? new FormData(e) : e);
E.getAdapter = Ze.getAdapter;
E.HttpStatusCode = Dn;
E.default = E;
const Un = E;
class qn extends Error {
g.spread = Bn;
g.isAxiosError = Dn;
g.mergeConfig = L;
g.AxiosHeaders = x;
g.formToJSON = (e) => We(a.isHTMLForm(e) ? new FormData(e) : e);
g.getAdapter = Ze.getAdapter;
g.HttpStatusCode = Un;
g.default = g;
const In = g;
class tt extends Error {
constructor(t) {

@@ -1823,3 +1823,3 @@ super(t.message), this.response = t, this.code = t.code, this.initName();

const t = e.data;
return new qn({
return new tt({
message: (t == null ? void 0 : t.message) ?? e.statusText,

@@ -1829,3 +1829,3 @@ code: (t == null ? void 0 : t.statusCode) ?? `HTTP_CODE_${e.status}`

});
}, kn = (e) => e, In = (e) => Promise.reject(jn(e.response)), Hn = {
}, kn = (e) => e, Hn = (e) => Promise.reject(jn(e.response)), Mn = {
formData: { "Content-Type": "multipart/form-data" },

@@ -1835,8 +1835,8 @@ formUrlDecode: { "Content-Type": "application/x-www-form-urlencoded" },

json: { "Content-Type": "application/json" }
}, Mn = (e, t) => {
const n = Un.create({
}, nt = (e, t) => {
const n = In.create({
baseURL: e,
method: "POST",
headers: {
...Hn.formData,
...Mn.formData,
"Cache-Control": "no-cache",

@@ -1848,3 +1848,3 @@ "X-Requested-With": "XMLHttpRequest"

});
n.interceptors.response.use(kn, In);
n.interceptors.response.use(kn, Hn);
const r = (c, f) => n({

@@ -1865,5 +1865,5 @@ url: `/api/squash/${c}/upload`,

};
class zn {
let $n = class {
constructor(t) {
this.axiosInstance = Mn(t);
this.axiosInstance = nt(t);
}

@@ -1901,4 +1901,4 @@ async squashImage(t, n, r) {

}
}
const $n = async (e, t) => {
};
const zn = async (e, t) => {
try {

@@ -1911,6 +1911,69 @@ const n = Buffer.from(e);

};
class Wn {
constructor(t, n) {
this.saveOperations = [];
const r = {
timeout: n == null ? void 0 : n.timeout
};
this.axiosInstance = nt(t, r);
}
squashImage(t, n) {
return this.format = t, this.sourceFile = (void 0)(n), this;
}
/**
* 轉成 Webp
* @param sourceFilePath
*/
squashWebp(t) {
return this.squashImage("webp", t);
}
/**
* 轉成 Jpg
* @param sourceFilePath
*/
squashJpg(t) {
return this.squashImage("jpg", t);
}
/**
* 轉成 Png
* @param sourceFilePath
*/
squashPng(t) {
return this.squashImage("png", t);
}
/**
* 儲存
* @param saveFilePath
* @param options
*/
toSave(t, n) {
const r = new Promise(async (s, o) => {
if (!(this.format && this.sourceFile))
return o(new tt({ message: "You must first call the squash[Format] method before calling toSave()", code: "NO_CALL_SAVE" }));
try {
const i = {
quality: this.quality,
...n,
sourceFile: this.sourceFile
}, c = await this.axiosInstance.squashWithArrayBuffer(this.format, i);
zn(c.data, t), s(t);
} catch (i) {
console.error("Error:", i), o(i);
}
});
return this.saveOperations.push(r), this;
}
/**
* 等待所有的保存操作完成
*/
async completeAll() {
const t = await Promise.all(this.saveOperations);
return this.saveOperations = [], this.format = void 0, this.sourceFile = void 0, this.quality = void 0, t;
}
}
export {
zn as ImgzClient,
zn as default,
$n as saveFile
$n as ImgzClient,
Wn as ImgzNodeClient,
$n as default,
zn as saveFile
};
export { default as ImgzClient } from './ImgzClient';
export { default as ImgzNodeClient } from './ImgzNodeClient';
export { default } from './ImgzClient';
export * from './utils';
{
"name": "@acrool/imgz-client",
"version": "0.0.2-alpha.0",
"version": "0.0.2-alpha.1",
"description": "This is a Client of the acrool-imgz api server, which can isolate its core from the impact of the environment version.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc