axios-0a86106b.js 11 KB

12
  1. import{i as Ce}from"./is-buffer-7d84b7d6.js";var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qe(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j={exports:{}},se=function(e,n){return function(){for(var t=new Array(arguments.length),i=0;i<t.length;i++)t[i]=arguments[i];return e.apply(n,t)}},Se=se,be=Ce,w=Object.prototype.toString;function ue(r){return w.call(r)==="[object Array]"}function xe(r){return w.call(r)==="[object ArrayBuffer]"}function Ae(r){return typeof FormData<"u"&&r instanceof FormData}function Ue(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&r.buffer instanceof ArrayBuffer,e}function ge(r){return typeof r=="string"}function Le(r){return typeof r=="number"}function Te(r){return typeof r>"u"}function fe(r){return r!==null&&typeof r=="object"}function Be(r){return w.call(r)==="[object Date]"}function De(r){return w.call(r)==="[object File]"}function Oe(r){return w.call(r)==="[object Blob]"}function ce(r){return w.call(r)==="[object Function]"}function $e(r){return fe(r)&&ce(r.pipe)}function Ne(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}function Pe(r){return r.replace(/^\s*/,"").replace(/\s*$/,"")}function He(){return typeof navigator<"u"&&navigator.product==="ReactNative"?!1:typeof window<"u"&&typeof document<"u"}function k(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),ue(r))for(var n=0,a=r.length;n<a;n++)e.call(null,r[n],n,r);else for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.call(null,r[t],t,r)}function le(){var r={};function e(t,i){typeof r[i]=="object"&&typeof t=="object"?r[i]=le(r[i],t):r[i]=t}for(var n=0,a=arguments.length;n<a;n++)k(arguments[n],e);return r}function Ie(r,e,n){return k(e,function(t,i){n&&typeof t=="function"?r[i]=Se(t,n):r[i]=t}),r}var d={isArray:ue,isArrayBuffer:xe,isBuffer:be,isFormData:Ae,isArrayBufferView:Ue,isString:ge,isNumber:Le,isObject:fe,isUndefined:Te,isDate:Be,isFile:De,isBlob:Oe,isFunction:ce,isStream:$e,isURLSearchParams:Ne,isStandardBrowserEnv:He,forEach:k,merge:le,extend:Ie,trim:Pe},Fe=d,_e=function(e,n){Fe.forEach(e,function(t,i){i!==n&&i.toUpperCase()===n.toUpperCase()&&(e[n]=t,delete e[i])})},A,X;function je(){return X||(X=1,A=function(e,n,a,t,i){return e.config=n,a&&(e.code=a),e.request=t,e.response=i,e}),A}var U,V;function de(){if(V)return U;V=1;var r=je();return U=function(n,a,t,i,u){var o=new Error(n);return r(o,a,t,i,u)},U}var g,J;function ke(){if(J)return g;J=1;var r=de();return g=function(n,a,t){var i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):a(r("Request failed with status code "+t.status,t.config,null,t.request,t))},g}var L,G;function Me(){if(G)return L;G=1;var r=d;function e(n){return encodeURIComponent(n).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}return L=function(a,t,i){if(!t)return a;var u;if(i)u=i(t);else if(r.isURLSearchParams(t))u=t.toString();else{var o=[];r.forEach(t,function(f,h){f===null||typeof f>"u"||(r.isArray(f)?h=h+"[]":f=[f],r.forEach(f,function(l){r.isDate(l)?l=l.toISOString():r.isObject(l)&&(l=JSON.stringify(l)),o.push(e(h)+"="+e(l))}))}),u=o.join("&")}return u&&(a+=(a.indexOf("?")===-1?"?":"&")+u),a},L}var T,K;function ze(){if(K)return T;K=1;var r=d,e=["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"];return T=function(a){var t={},i,u,o;return a&&r.forEach(a.split(`
  2. `),function(f){if(o=f.indexOf(":"),i=r.trim(f.substr(0,o)).toLowerCase(),u=r.trim(f.substr(o+1)),i){if(t[i]&&e.indexOf(i)>=0)return;i==="set-cookie"?t[i]=(t[i]?t[i]:[]).concat([u]):t[i]=t[i]?t[i]+", "+u:u}}),t},T}var B,W;function Xe(){if(W)return B;W=1;var r=d;return B=r.isStandardBrowserEnv()?function(){var n=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a"),t;function i(u){var o=u;return n&&(a.setAttribute("href",o),o=a.href),a.setAttribute("href",o),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return t=i(window.location.href),function(o){var m=r.isString(o)?i(o):o;return m.protocol===t.protocol&&m.host===t.host}}():function(){return function(){return!0}}(),B}var D,Y;function Ve(){if(Y)return D;Y=1;var r=d;return D=r.isStandardBrowserEnv()?function(){return{write:function(a,t,i,u,o,m){var f=[];f.push(a+"="+encodeURIComponent(t)),r.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),r.isString(u)&&f.push("path="+u),r.isString(o)&&f.push("domain="+o),m===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(a){var t=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),D}var O,Q;function Z(){if(Q)return O;Q=1;var r=d,e=ke(),n=Me(),a=ze(),t=Xe(),i=de();return O=function(o){return new Promise(function(f,h){var v=o.data,l=o.headers;r.isFormData(v)&&delete l["Content-Type"];var s=new XMLHttpRequest;if(o.auth){var ye=o.auth.username||"",Re=o.auth.password||"";l.Authorization="Basic "+btoa(ye+":"+Re)}if(s.open(o.method.toUpperCase(),n(o.url,o.params,o.paramsSerializer),!0),s.timeout=o.timeout,s.onreadystatechange=function(){if(!(!s||s.readyState!==4)&&!(s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0))){var E="getAllResponseHeaders"in s?a(s.getAllResponseHeaders()):null,C=!o.responseType||o.responseType==="text"?s.responseText:s.response,Ee={data:C,status:s.status,statusText:s.statusText,headers:E,config:o,request:s};e(f,h,Ee),s=null}},s.onerror=function(){h(i("Network Error",o,null,s)),s=null},s.ontimeout=function(){h(i("timeout of "+o.timeout+"ms exceeded",o,"ECONNABORTED",s)),s=null},r.isStandardBrowserEnv()){var we=Ve(),z=(o.withCredentials||t(o.url))&&o.xsrfCookieName?we.read(o.xsrfCookieName):void 0;z&&(l[o.xsrfHeaderName]=z)}if("setRequestHeader"in s&&r.forEach(l,function(E,C){typeof v>"u"&&C.toLowerCase()==="content-type"?delete l[C]:s.setRequestHeader(C,E)}),o.withCredentials&&(s.withCredentials=!0),o.responseType)try{s.responseType=o.responseType}catch(y){if(o.responseType!=="json")throw y}typeof o.onDownloadProgress=="function"&&s.addEventListener("progress",o.onDownloadProgress),typeof o.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",o.onUploadProgress),o.cancelToken&&o.cancelToken.promise.then(function(E){s&&(s.abort(),h(E),s=null)}),v===void 0&&(v=null),s.send(v)})},O}var c=d,Je=_e,Ge={"Content-Type":"application/x-www-form-urlencoded"};function ee(r,e){!c.isUndefined(r)&&c.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Ke(){var r;return(typeof XMLHttpRequest<"u"||typeof process<"u")&&(r=Z()),r}var S={adapter:Ke(),transformRequest:[function(e,n){return Je(n,"Content-Type"),c.isFormData(e)||c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)?e:c.isArrayBufferView(e)?e.buffer:c.isURLSearchParams(e)?(ee(n,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):c.isObject(e)?(ee(n,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};S.headers={common:{Accept:"application/json, text/plain, */*"}};c.forEach(["delete","get","head"],function(e){S.headers[e]={}});c.forEach(["post","put","patch"],function(e){S.headers[e]=c.merge(Ge)});var M=S,We=d;function b(){this.handlers=[]}b.prototype.use=function(e,n){return this.handlers.push({fulfilled:e,rejected:n}),this.handlers.length-1};b.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};b.prototype.forEach=function(e){We.forEach(this.handlers,function(a){a!==null&&e(a)})};var Ye=b,Qe=d,Ze=function(e,n,a){return Qe.forEach(a,function(i){e=i(e,n)}),e},$,re;function pe(){return re||(re=1,$=function(e){return!!(e&&e.__CANCEL__)}),$}var er=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},rr=function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e},te=d,N=Ze,tr=pe(),nr=M,ar=er,ir=rr;function P(r){r.cancelToken&&r.cancelToken.throwIfRequested()}var or=function(e){P(e),e.baseURL&&!ar(e.url)&&(e.url=ir(e.baseURL,e.url)),e.headers=e.headers||{},e.data=N(e.data,e.headers,e.transformRequest),e.headers=te.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),te.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var n=e.adapter||nr.adapter;return n(e).then(function(t){return P(e),t.data=N(t.data,t.headers,e.transformResponse),t},function(t){return tr(t)||(P(e),t&&t.response&&(t.response.data=N(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},sr=M,R=d,ne=Ye,ur=or;function x(r){this.defaults=r,this.interceptors={request:new ne,response:new ne}}x.prototype.request=function(e){typeof e=="string"&&(e=R.merge({url:arguments[0]},arguments[1])),e=R.merge(sr,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var n=[ur,void 0],a=Promise.resolve(e);for(this.interceptors.request.forEach(function(i){n.unshift(i.fulfilled,i.rejected)}),this.interceptors.response.forEach(function(i){n.push(i.fulfilled,i.rejected)});n.length;)a=a.then(n.shift(),n.shift());return a};R.forEach(["delete","get","head","options"],function(e){x.prototype[e]=function(n,a){return this.request(R.merge(a||{},{method:e,url:n}))}});R.forEach(["post","put","patch"],function(e){x.prototype[e]=function(n,a,t){return this.request(R.merge(t||{},{method:e,url:n,data:a}))}});var fr=x,H,ae;function he(){if(ae)return H;ae=1;function r(e){this.message=e}return r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,H=r,H}var I,ie;function cr(){if(ie)return I;ie=1;var r=he();function e(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var a;this.promise=new Promise(function(u){a=u});var t=this;n(function(u){t.reason||(t.reason=new r(u),a(t.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.source=function(){var a,t=new e(function(u){a=u});return{token:t,cancel:a}},I=e,I}var F,oe;function lr(){return oe||(oe=1,F=function(e){return function(a){return e.apply(null,a)}}),F}var _=d,dr=se,q=fr,me=M;function ve(r){var e=new q(r),n=dr(q.prototype.request,e);return _.extend(n,q.prototype,e),_.extend(n,e),n}var p=ve(me);p.Axios=q;p.create=function(e){return ve(_.merge(me,e))};p.Cancel=he();p.CancelToken=cr();p.isCancel=pe();p.all=function(e){return Promise.all(e)};p.spread=lr();j.exports=p;j.exports.default=p;var pr=j.exports,hr=pr;const yr=qe(hr);export{yr as a,vr as c,qe as g};