cool-common-utils 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amap-utils.js +1 -1
- package/dist/amap-utils.mjs +1 -1
- package/dist/commons/vendor-axios-eBPqXPbi.js +1 -0
- package/dist/commons/vendor-axios-qlYN5UV5.js +1 -0
- package/dist/commons/vendor-other-Cd2MOa_2.js +1 -0
- package/dist/commons/vendor-other-odeBaM7w.js +1 -0
- package/dist/commons/vendor-qs-B9_OEdmf.js +1 -0
- package/dist/commons/vendor-qs-L1Bpz2hz.js +1 -0
- package/dist/commons/vendor-socket.io-client-DfIeTHYA.js +1 -0
- package/dist/commons/vendor-socket.io-client-OWv_jVwG.js +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/request.js +1 -1
- package/dist/request.mjs +1 -1
- package/dist/socket-io.js +1 -1
- package/dist/socket-io.mjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/dist/websocket.js +1 -1
- package/dist/websocket.mjs +1 -1
- package/package.json +8 -10
- package/dist/commons/vendor-axios-DsdlaZnY.js +0 -1
- package/dist/commons/vendor-axios-DxFWCEd0.js +0 -1
- package/dist/commons/vendor-other-C48Un_So.js +0 -1
- package/dist/commons/vendor-other-oYX07ukn.js +0 -1
- package/dist/commons/vendor-qs-Dasci0ry.js +0 -1
- package/dist/commons/vendor-qs-DpjaCScg.js +0 -1
- package/dist/commons/vendor-socket.io-client-CkipB4mt.js +0 -1
- package/dist/commons/vendor-socket.io-client-DHDwO2X7.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=require("./vendor-other-Cd2MOa_2.js");function e(t,e,s){return t.on(e,s),function(){t.off(e,s)}}const s=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class i extends t.cjsExports.Emitter{constructor(t,e,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[e(t,"open",this.onopen.bind(this)),e(t,"packet",this.onpacket.bind(this)),e(t,"error",this.onerror.bind(this)),e(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(e,...i){var n,o,r;if(s.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const h={type:t.PacketType.EVENT,data:i,options:{}};if(h.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){const t=this.ids++,e=i.pop();this._registerAckCallback(t,e),h.id=t}const c=null===(o=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===o?void 0:o.writable,a=this.connected&&!(null===(r=this.io.engine)||void 0===r?void 0:r._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(t,e){var s;const i=null!==(s=this.flags.timeout)&&void 0!==s?s:this._opts.ackTimeout;if(void 0===i)return void(this.acks[t]=e);const n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,new Error("operation has timed out"))},i),o=(...t)=>{this.io.clearTimeoutFn(n),e.apply(this,t)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...e){return new Promise((s,i)=>{const n=(t,e)=>t?i(t):s(e);n.withError=!0,e.push(n),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...i)=>{this._queue[0];return null!==t?s.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...i)),s.pending=!1,this._drainQueue()}),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:t.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){const e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case t.PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case t.PacketType.EVENT:case t.PacketType.BINARY_EVENT:this.onevent(e);break;case t.PacketType.ACK:case t.PacketType.BINARY_ACK:this.onack(e);break;case t.PacketType.DISCONNECT:this.ondisconnect();break;case t.PacketType.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s)}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const s of e)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(e){const s=this;let i=!1;return function(...n){i||(i=!0,s.packet({type:t.PacketType.ACK,id:e,data:n}))}}onack(t){const e=this.acks[t.id];"function"==typeof e&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:t.PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const s of e)s.apply(this,t.data)}}}function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),s=Math.floor(e*this.jitter*t);t=1&Math.floor(10*e)?t+s:t-s}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t};class o extends t.cjsExports.Emitter{constructor(e,s){var i;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(s=e,e=void 0),(s=s||{}).path=s.path||"/socket.io",this.opts=s,t.installTimerFunctions(this,s),this.reconnection(!1!==s.reconnection),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(i=s.randomizationFactor)&&void 0!==i?i:.5),this.backoff=new n({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==s.timeout?2e4:s.timeout),this._readyState="closed",this.uri=e;const o=s.parser||t.parser;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=!1!==s.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(s){if(~this._readyState.indexOf("open"))return this;this.engine=new t.Socket(this.uri,this.opts);const i=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=e(i,"open",function(){n.onopen(),s&&s()}),r=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),s?s(t):this.maybeReconnectOnOpen()},h=e(i,"error",r);if(!1!==this._timeout){const t=this._timeout,e=this.setTimeoutFn(()=>{o(),r(new Error("timeout")),i.close()},t);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}return this.subs.push(o),this.subs.push(h),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(e(t,"ping",this.onping.bind(this)),e(t,"data",this.ondata.bind(this)),e(t,"error",this.onerror.bind(this)),e(t,"close",this.onclose.bind(this)),e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(e){t.nextTick(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new i(this,t,e),this.nsps[t]=s),s}_destroy(t){const e=Object.keys(this.nsps);for(const t of e){if(this.nsps[t].active)return}this._close()}_packet(t){const e=this.encoder.encode(t);for(let s=0;s<e.length;s++)this.engine.write(e[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var s;this.cleanup(),null===(s=this.engine)||void 0===s||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const r={};function h(e,s){"object"==typeof e&&(s=e,e=void 0);const i=function(e,s="",i){let n=e;i=i||"undefined"!=typeof location&&location,null==e&&(e=i.protocol+"//"+i.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?i.protocol+e:i.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==i?i.protocol+"//"+e:"https://"+e),n=t.parse(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+s,n.href=n.protocol+"://"+o+(i&&i.port===n.port?"":":"+n.port),n}(e,(s=s||{}).path||"/socket.io"),n=i.source,h=i.id,c=i.path,a=r[h]&&c in r[h].nsps;let u;return s.forceNew||s["force new connection"]||!1===s.multiplex||a?u=new o(n,s):(r[h]||(r[h]=new o(n,s)),u=r[h]),i.query&&!s.query&&(s.query=i.queryKey),u.socket(i.path,s)}Object.assign(h,{Manager:o,Socket:i,io:h,connect:h}),exports.lookup=h;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./request.js"),r=require("./message.js"),o=require("./websocket.js"),t=require("./socket-io.js"),s=require("./aes.js"),d=require("./verification-code.js"),i=require("./canvas-water.js"),a=require("./utils.js"),n=require("./amap-utils.js");require("./commons/vendor-other-
|
|
1
|
+
"use strict";var e=require("./request.js"),r=require("./message.js"),o=require("./websocket.js"),t=require("./socket-io.js"),s=require("./aes.js"),d=require("./verification-code.js"),i=require("./canvas-water.js"),a=require("./utils.js"),n=require("./amap-utils.js");require("./commons/vendor-other-Cd2MOa_2.js"),require("./commons/vendor-crypto-js-AYnBdXB5.js"),require("./commons/vendor-axios-qlYN5UV5.js"),require("./commons/vendor-qs-B9_OEdmf.js"),require("./commons/vendor-sweetalert-KX8J3Sv0.js"),require("./commons/vendor-socket.io-client-OWv_jVwG.js"),exports.CreateRequest=e.CreateRequest,exports.SweetAlert=r.SweetAlert,exports.SweetConfirm=r.SweetConfirm,exports.SweetError=r.SweetError,exports.SweetSuccess=r.SweetSuccess,exports.SweetWarning=r.SweetWarning,Object.defineProperty(exports,"EventId",{enumerable:!0,get:function(){return o.EventId}}),exports.Websocket=o.Websocket,exports.SocketIO=t.SocketIO,exports.decryptAES=s.decryptAES,exports.encryptAES=s.encryptAES,exports.codeRandomColor=d.codeRandomColor,exports.drawCode=d.drawCode,exports.CanvasWater=i.CanvasWater,exports.addWater=i.addWater,exports.TransformConvertor=a.TransformConvertor,exports.UUID=a.UUID,exports.flattenDeepArray=a.flattenDeepArray,exports.formatNumber=a.formatNumber,exports.formatSearchFiled=a.formatSearchFiled,exports.getSelectName=a.getSelectName,exports.getTreeName=a.getTreeName,exports.isJson=a.isJson,exports.isNumber=a.isNumber,exports.platformListGenerate=a.platformListGenerate,exports.replaceUrlOrigin=a.replaceUrlOrigin,exports.AddCarPolyline=n.AddCarPolyline,exports.AddCircleList=n.AddCircleList,exports.AddCircleMarkerList=n.AddCircleMarkerList,exports.AddCluster=n.AddCluster,exports.AddClusterFormGeoJson=n.AddClusterFormGeoJson,exports.AddHideMarkerList=n.AddHideMarkerList,exports.AddInfoWindow=n.AddInfoWindow,exports.AddLabelMarkerList=n.AddLabelMarkerList,exports.AddMarkerFormGeoJson=n.AddMarkerFormGeoJson,exports.AddMarkerList=n.AddMarkerList,exports.AddPolygonFormGeoJson=n.AddPolygonFormGeoJson,exports.AddPolygonList=n.AddPolygonList,exports.AddPolylineFormGeoJson=n.AddPolylineFormGeoJson,exports.AddPolylineList=n.AddPolylineList,exports.AddTrack=n.AddTrack,exports.AddTrackInfoWindow=n.AddTrackInfoWindow,exports.AddTrackList=n.AddTrackList,exports.RealtimeTrack=n.RealtimeTrack,exports.RectSelect=n.RectSelect,exports.setCenter=n.setCenter,exports.setCenterZoom=n.setCenterZoom,exports.setMapFitView=n.setMapFitView;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CreateRequest}from"./request.mjs";export{SweetAlert,SweetConfirm,SweetError,SweetSuccess,SweetWarning}from"./message.mjs";export{EventId,Websocket}from"./websocket.mjs";export{SocketIO}from"./socket-io.mjs";export{decryptAES,encryptAES}from"./aes.mjs";export{codeRandomColor,drawCode}from"./verification-code.mjs";export{CanvasWater,addWater}from"./canvas-water.mjs";export{TransformConvertor,UUID,flattenDeepArray,formatNumber,formatSearchFiled,getSelectName,getTreeName,isJson,isNumber,platformListGenerate,replaceUrlOrigin}from"./utils.mjs";export{AddCarPolyline,AddCircleList,AddCircleMarkerList,AddCluster,AddClusterFormGeoJson,AddHideMarkerList,AddInfoWindow,AddLabelMarkerList,AddMarkerFormGeoJson,AddMarkerList,AddPolygonFormGeoJson,AddPolygonList,AddPolylineFormGeoJson,AddPolylineList,AddTrack,AddTrackInfoWindow,AddTrackList,RealtimeTrack,RectSelect,setCenter,setCenterZoom,setMapFitView}from"./amap-utils.mjs";import"./commons/vendor-other-
|
|
1
|
+
export{CreateRequest}from"./request.mjs";export{SweetAlert,SweetConfirm,SweetError,SweetSuccess,SweetWarning}from"./message.mjs";export{EventId,Websocket}from"./websocket.mjs";export{SocketIO}from"./socket-io.mjs";export{decryptAES,encryptAES}from"./aes.mjs";export{codeRandomColor,drawCode}from"./verification-code.mjs";export{CanvasWater,addWater}from"./canvas-water.mjs";export{TransformConvertor,UUID,flattenDeepArray,formatNumber,formatSearchFiled,getSelectName,getTreeName,isJson,isNumber,platformListGenerate,replaceUrlOrigin}from"./utils.mjs";export{AddCarPolyline,AddCircleList,AddCircleMarkerList,AddCluster,AddClusterFormGeoJson,AddHideMarkerList,AddInfoWindow,AddLabelMarkerList,AddMarkerFormGeoJson,AddMarkerList,AddPolygonFormGeoJson,AddPolygonList,AddPolylineFormGeoJson,AddPolylineList,AddTrack,AddTrackInfoWindow,AddTrackList,RealtimeTrack,RectSelect,setCenter,setCenterZoom,setMapFitView}from"./amap-utils.mjs";import"./commons/vendor-other-odeBaM7w.js";import"./commons/vendor-crypto-js-Dhi5niDn.js";import"./commons/vendor-axios-eBPqXPbi.js";import"./commons/vendor-qs-L1Bpz2hz.js";import"./commons/vendor-sweetalert-4FJTrmvX.js";import"./commons/vendor-socket.io-client-DfIeTHYA.js";
|
package/dist/request.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./commons/vendor-other-
|
|
1
|
+
"use strict";var e=require("./commons/vendor-other-Cd2MOa_2.js"),t=require("./commons/vendor-axios-qlYN5UV5.js"),r=require("./commons/vendor-qs-B9_OEdmf.js"),n=require("./message.js");require("./commons/vendor-crypto-js-AYnBdXB5.js"),require("./commons/vendor-sweetalert-KX8J3Sv0.js");var o=new Map([["form","application/x-www-form-urlencoded;charset=UTF-8"],["upload","multipart/form-data"]]),s=function(){function s(r,n){var s;this.config=e.__assign(e.__assign({},{type:"",timeout:0,responseType:"json",withCredentials:!1,proxy:!1,ERROR_CODES:["1005","1006","1008","1009"]}),n||{}),this.postType=this.config.type,this.instance=t.axios.create({baseURL:r,headers:{"Content-Type":null!==(s=o.get(this.config.type))&&void 0!==s?s:"application/json;charset=UTF-8"},timeout:this.config.timeout,responseType:this.config.responseType,withCredentials:this.config.withCredentials,proxy:this.config.proxy}),this.setupInterceptors()}return s.prototype.setupInterceptors=function(){var e=this;this.instance.interceptors.request.use(function(r){var n,o,s=null===(o=(n=e.config).getAuthorization)||void 0===o?void 0:o.call(n);return s&&r.headers&&r.headers.set("Authorization",s),r.cancelToken=new t.axios.CancelToken(function(t){var n,o;null===(o=(n=e.config).cancelCallback)||void 0===o||o.call(n,{cancelToken:{name:r.url,cancel:t}})}),r},this.handleError),this.instance.interceptors.response.use(function(t){var r;return(null===(r=e.config.ERROR_CODES)||void 0===r?void 0:r.includes(String(t.data.code)))?(n.SweetError(t.data.msg).then(function(){var t,r;null===(r=(t=e.config).errorCallback)||void 0===r||r.call(t)}),Promise.reject(t.data.msg)):t.data},this.handleError)},s.prototype.handleError=function(e){return Promise.reject(e.message)},s.prototype.get=function(e,t){return this.instance.get(e,{params:t})},s.prototype.post=function(e,t){var n="form"===this.postType?r.qs.stringify(t):t;return this.instance.post(e,n)},s.prototype.put=function(e,t){var n="form"===this.postType?r.qs.stringify(t):t;return this.instance.put(e,n)},s.prototype.delete=function(e,t){return this.instance.delete(e,{params:{id:t}})},s}();exports.CreateRequest=s;
|
package/dist/request.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t}from"./commons/vendor-other-
|
|
1
|
+
import{_ as t}from"./commons/vendor-other-odeBaM7w.js";import{a as e}from"./commons/vendor-axios-eBPqXPbi.js";import{q as o}from"./commons/vendor-qs-L1Bpz2hz.js";import{SweetError as n}from"./message.mjs";import"./commons/vendor-crypto-js-Dhi5niDn.js";import"./commons/vendor-sweetalert-4FJTrmvX.js";var r=new Map([["form","application/x-www-form-urlencoded;charset=UTF-8"],["upload","multipart/form-data"]]),i=function(){function i(o,n){var i;this.config=t(t({},{type:"",timeout:0,responseType:"json",withCredentials:!1,proxy:!1,ERROR_CODES:["1005","1006","1008","1009"]}),n||{}),this.postType=this.config.type,this.instance=e.create({baseURL:o,headers:{"Content-Type":null!==(i=r.get(this.config.type))&&void 0!==i?i:"application/json;charset=UTF-8"},timeout:this.config.timeout,responseType:this.config.responseType,withCredentials:this.config.withCredentials,proxy:this.config.proxy}),this.setupInterceptors()}return i.prototype.setupInterceptors=function(){var t=this;this.instance.interceptors.request.use(function(o){var n,r,i=null===(r=(n=t.config).getAuthorization)||void 0===r?void 0:r.call(n);return i&&o.headers&&o.headers.set("Authorization",i),o.cancelToken=new e.CancelToken(function(e){var n,r;null===(r=(n=t.config).cancelCallback)||void 0===r||r.call(n,{cancelToken:{name:o.url,cancel:e}})}),o},this.handleError),this.instance.interceptors.response.use(function(e){var o;return(null===(o=t.config.ERROR_CODES)||void 0===o?void 0:o.includes(String(e.data.code)))?(n(e.data.msg).then(function(){var e,o;null===(o=(e=t.config).errorCallback)||void 0===o||o.call(e)}),Promise.reject(e.data.msg)):e.data},this.handleError)},i.prototype.handleError=function(t){return Promise.reject(t.message)},i.prototype.get=function(t,e){return this.instance.get(t,{params:e})},i.prototype.post=function(t,e){var n="form"===this.postType?o.stringify(e):e;return this.instance.post(t,n)},i.prototype.put=function(t,e){var n="form"===this.postType?o.stringify(e):e;return this.instance.put(t,n)},i.prototype.delete=function(t,e){return this.instance.delete(t,{params:{id:e}})},i}();export{i as CreateRequest};
|
package/dist/socket-io.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./commons/vendor-other-
|
|
1
|
+
"use strict";var e=require("./commons/vendor-other-Cd2MOa_2.js"),t=require("./commons/vendor-socket.io-client-OWv_jVwG.js"),o=require("./utils.js");require("./commons/vendor-crypto-js-AYnBdXB5.js");var s=function(){function s(e,t){void 0===t&&(t={}),this.socket=null,this.isConnected=!1,this.registerMessageHandlerMap=new Map,this.messageQueueList=new Map,this.options={reconnectionAttempts:5},this.options=Object.assign(this.options,t),this.createSocketIO(e)}return s.prototype.createSocketIO=function(o){var s,n,i,c,r,l,a,u=this;try{null===(i=this.socket)||void 0===i||i.disconnect(),this.socket=t.lookup(o,this.options),null===(c=this.socket)||void 0===c||c.on("connect",function(){var t,o,s;u.isConnected=!0;try{for(var n=e.__values(u.messageQueueList),i=n.next();!i.done;i=n.next()){var c=e.__read(i.value,2),r=c[0],l=c[1];null===(s=u.socket)||void 0===s||s.emit(l.event,l.data),u.messageQueueList.delete(r)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}console.log("socket.io连接成功")}),null===(r=this.socket)||void 0===r||r.on("disconnect",function(){u.isConnected=!1,console.log("socket.io连接断开")}),null===(l=this.socket)||void 0===l||l.on("connect_error",function(e){u.isConnected=!1,console.log("socket.io连接错误",e)});var d=function(e,t){null===(a=h.socket)||void 0===a||a.on(e,function(e){null==t||t(e)})},h=this;try{for(var v=e.__values(this.registerMessageHandlerMap),k=v.next();!k.done;k=v.next()){var p=e.__read(k.value,2);d(p[0],p[1])}}catch(e){s={error:e}}finally{try{k&&!k.done&&(n=v.return)&&n.call(v)}finally{if(s)throw s.error}}}catch(e){console.log("socket.io连接异常",e.message)}},s.prototype.disconnect=function(){this.socket&&(this.socket.disconnect(),this.socket=null,this.isConnected=!1,console.log("手动断开socket.io连接"))},s.prototype.send=function(e,t){var s;this.isConnected?null===(s=this.socket)||void 0===s||s.emit(e,t):this.messageQueueList.set("".concat(e,"-").concat(o.UUID(8,16)),{event:e,data:t})},s.prototype.registerMessageHandler=function(e,t){this.registerMessageHandlerMap.set(e,t)},s}();exports.SocketIO=s;
|
package/dist/socket-io.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,d as e}from"./commons/vendor-other-
|
|
1
|
+
import{b as t,d as e}from"./commons/vendor-other-odeBaM7w.js";import{l as o}from"./commons/vendor-socket.io-client-DfIeTHYA.js";import{UUID as n}from"./utils.mjs";import"./commons/vendor-crypto-js-Dhi5niDn.js";var s=function(){function s(t,e){void 0===e&&(e={}),this.socket=null,this.isConnected=!1,this.registerMessageHandlerMap=new Map,this.messageQueueList=new Map,this.options={reconnectionAttempts:5},this.options=Object.assign(this.options,e),this.createSocketIO(t)}return s.prototype.createSocketIO=function(n){var s,i,c,r,l,a,u,d=this;try{null===(c=this.socket)||void 0===c||c.disconnect(),this.socket=o(n,this.options),null===(r=this.socket)||void 0===r||r.on("connect",function(){var o,n,s;d.isConnected=!0;try{for(var i=t(d.messageQueueList),c=i.next();!c.done;c=i.next()){var r=e(c.value,2),l=r[0],a=r[1];null===(s=d.socket)||void 0===s||s.emit(a.event,a.data),d.messageQueueList.delete(l)}}catch(t){o={error:t}}finally{try{c&&!c.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}console.log("socket.io连接成功")}),null===(l=this.socket)||void 0===l||l.on("disconnect",function(){d.isConnected=!1,console.log("socket.io连接断开")}),null===(a=this.socket)||void 0===a||a.on("connect_error",function(t){d.isConnected=!1,console.log("socket.io连接错误",t)});var h=function(t,e){null===(u=p.socket)||void 0===u||u.on(t,function(t){null==e||e(t)})},p=this;try{for(var v=t(this.registerMessageHandlerMap),f=v.next();!f.done;f=v.next()){var m=e(f.value,2);h(m[0],m[1])}}catch(t){s={error:t}}finally{try{f&&!f.done&&(i=v.return)&&i.call(v)}finally{if(s)throw s.error}}}catch(t){console.log("socket.io连接异常",t.message)}},s.prototype.disconnect=function(){this.socket&&(this.socket.disconnect(),this.socket=null,this.isConnected=!1,console.log("手动断开socket.io连接"))},s.prototype.send=function(t,e){var o;this.isConnected?null===(o=this.socket)||void 0===o||o.emit(t,e):this.messageQueueList.set("".concat(t,"-").concat(n(8,16)),{event:t,data:e})},s.prototype.registerMessageHandler=function(t,e){this.registerMessageHandlerMap.set(t,e)},s}();export{s as SocketIO};
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("./commons/vendor-other-
|
|
1
|
+
"use strict";var t=require("./commons/vendor-other-Cd2MOa_2.js");require("./commons/vendor-crypto-js-AYnBdXB5.js");var r=function(n){return n.reduce(function(n,s){return s.children&&s.children.length?t.__spreadArray(t.__spreadArray(t.__spreadArray([],t.__read(n),!1),t.__read(r(s.children)),!1),[s],!1):t.__spreadArray(t.__spreadArray([],t.__read(n),!1),[s],!1)},[])},n=function(){function t(){this.M_PI=3.141592653589793,this.A=6378245,this.EE=.006693421622965943,this.X_PI=3e3*this.M_PI/180}return t.prototype.outOfChine=function(t){return t.lng<72.004||t.lng>137.8347||(t.lat<.8293||t.lat>55.8271)},t.prototype.WGS2GCJLat=function(t,r){var n=2*t-100+3*r+.2*r*r+.1*t*r+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,n+=2*(20*Math.sin(r*this.M_PI)+40*Math.sin(r/3*this.M_PI))/3,n+=2*(160*Math.sin(r/12*this.M_PI)+320*Math.sin(r*this.M_PI/30))/3},t.prototype.WGS2GCJLng=function(t,r){var n=300+t+2*r+.1*t*t+.1*t*r+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,n+=2*(20*Math.sin(t*this.M_PI)+40*Math.sin(t/3*this.M_PI))/3,n+=2*(150*Math.sin(t/12*this.M_PI)+300*Math.sin(t/30*this.M_PI))/3},t.prototype.transformLat=function(t,r){var n=2*t-100+3*r+.2*r*r+.1*t*r+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,n+=2*(20*Math.sin(r*this.M_PI)+40*Math.sin(r/3*this.M_PI))/3,n+=2*(160*Math.sin(r/12*this.M_PI)+320*Math.sin(r*this.M_PI/30))/3},t.prototype.transformLon=function(t,r){var n=300+t+2*r+.1*t*t+.1*t*r+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,n+=2*(20*Math.sin(t*this.M_PI)+40*Math.sin(t/3*this.M_PI))/3,n+=2*(150*Math.sin(t/12*this.M_PI)+300*Math.sin(t/30*this.M_PI))/3},t.prototype.delta=function(t,r){var n=6378245,s=.006693421622965943,e=this.transformLat(r-105,t-35),i=this.transformLon(r-105,t-35),a=t/180*this.M_PI,h=Math.sin(a);h=1-s*h*h;var o=Math.sqrt(h);return{lat:e=180*e/(n*(1-s)/(h*o)*this.M_PI),lon:i=180*i/(n/o*Math.cos(a)*this.M_PI)}},t.prototype.WGS2GCJ=function(t){if(!this.outOfChine(t)){var r={},n=this.WGS2GCJLat(t.lng-105,t.lat-35),s=this.WGS2GCJLng(t.lng-105,t.lat-35),e=t.lat/180*this.M_PI,i=Math.sin(e);i=1-this.EE*i*i;var a=Math.sqrt(i);return n=180*n/(this.A*(1-this.EE)/(i*a)*this.M_PI),s=180*s/(this.A/a*Math.cos(e)*this.M_PI),r.lat=Number(t.lat)+Number(n),r.lng=Number(t.lng)+Number(s),r}},t.prototype.GCJ2BD09=function(t){var r={},n=t.lng,s=t.lat,e=Math.sqrt(n*n+s*s)+2e-5*Math.sin(s*this.X_PI),i=Math.atan2(s,n)+3e-6*Math.cos(n*this.X_PI);return r.lng=e*Math.cos(i)+.0065,r.lat=e*Math.sin(i)+.006,r},t.prototype.WGS2BD09=function(t){var r=this.WGS2GCJ(t);return this.GCJ2BD09(r)},t.prototype.transformGCJ2WGS=function(t,r){var n=this.delta(t,r);return{lat:t-n.lat,lon:r-n.lon}},t}();exports.TransformConvertor=n,exports.UUID=function(t,r){var n,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=[];if(r=r||s.length,t)for(n=0;n<t;n++)e[n]=s[0|Math.random()*r];else{var i=void 0;for(e[8]=e[13]=e[18]=e[23]="-",e[14]="4",n=0;n<36;n++)e[n]||(i=0|16*Math.random(),e[n]=s[19===n?3&i|8:i])}return e.join("")},exports.flattenDeepArray=r,exports.formatNumber=function(t){return t<10?"0".concat(t):t},exports.formatSearchFiled=function(t){if("object"!=typeof t||null===t)return{};var r={};for(var n in t)if(Reflect.has(t,n)){var s=t[n];(s&&"boolean"!=typeof s||0===s&&"number"==typeof s)&&(r[n]=s)}return r},exports.getSelectName=function(t,r,n,s){void 0===s&&(s="string");var e=t.filter(function(t){return r.includes(t[n.key])}).map(function(t){return t[n.name]});return"string"===s?e.join():e},exports.getTreeName=function(t,n,s,e){void 0===e&&(e="string");var i=r(t).filter(function(t){return n.includes(t[s.key])}).map(function(t){return t[s.name]});return"string"===e?i.join():i},exports.isJson=function(t){if("string"!=typeof t)return!1;if(""===t.trim())return!1;try{return"object"==typeof JSON.parse(t)}catch(t){return!1}},exports.isNumber=function(t){return"number"==typeof t},exports.platformListGenerate=function(t,r){var n=[];if(Math.abs(t.length-2*(r-1))%(r-2)>0){var s=t.splice(0,r-1),e=Math.ceil(t.length/(r-2));n.push(s);for(var i=0;i<e;i++)n.push(t.splice(0,r-2))}else if(t.length>2*(r-1)){s=t.splice(0,r-1);var a=t.splice(t.length-(r-1),r-1);e=Math.ceil(t.length/(r-2));n.push(s);for(i=0;i<e;i++)n.push(t.splice(0,r-2)),i>=e-1&&n.push(a)}else if(t.length===r){s=t.splice(0,r);n.push(s)}else{s=t.splice(0,r-1),a=t.splice(t.length-(r-1),r-1);n.push(s),n.push(a)}return n},exports.replaceUrlOrigin=function(t,r){var n=new URL(t);return"".concat(r).concat(n.pathname).concat(n.search)};
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as t,d as n}from"./commons/vendor-other-
|
|
1
|
+
import{e as t,d as n}from"./commons/vendor-other-odeBaM7w.js";import"./commons/vendor-crypto-js-Dhi5niDn.js";var i=function(t){if("string"!=typeof t)return!1;if(""===t.trim())return!1;try{return"object"==typeof JSON.parse(t)}catch(t){return!1}},r=function(t){if("object"!=typeof t||null===t)return{};var n={};for(var i in t)if(Reflect.has(t,i)){var r=t[i];(r&&"boolean"!=typeof r||0===r&&"number"==typeof r)&&(n[i]=r)}return n},s=function(i){return i.reduce(function(i,r){return r.children&&r.children.length?t(t(t([],n(i),!1),n(s(r.children)),!1),[r],!1):t(t([],n(i),!1),[r],!1)},[])},h=function(t){return"number"==typeof t},a=function(){function t(){this.M_PI=3.141592653589793,this.A=6378245,this.EE=.006693421622965943,this.X_PI=3e3*this.M_PI/180}return t.prototype.outOfChine=function(t){return t.lng<72.004||t.lng>137.8347||(t.lat<.8293||t.lat>55.8271)},t.prototype.WGS2GCJLat=function(t,n){var i=2*t-100+3*n+.2*n*n+.1*t*n+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,i+=2*(20*Math.sin(n*this.M_PI)+40*Math.sin(n/3*this.M_PI))/3,i+=2*(160*Math.sin(n/12*this.M_PI)+320*Math.sin(n*this.M_PI/30))/3},t.prototype.WGS2GCJLng=function(t,n){var i=300+t+2*n+.1*t*t+.1*t*n+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,i+=2*(20*Math.sin(t*this.M_PI)+40*Math.sin(t/3*this.M_PI))/3,i+=2*(150*Math.sin(t/12*this.M_PI)+300*Math.sin(t/30*this.M_PI))/3},t.prototype.transformLat=function(t,n){var i=2*t-100+3*n+.2*n*n+.1*t*n+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,i+=2*(20*Math.sin(n*this.M_PI)+40*Math.sin(n/3*this.M_PI))/3,i+=2*(160*Math.sin(n/12*this.M_PI)+320*Math.sin(n*this.M_PI/30))/3},t.prototype.transformLon=function(t,n){var i=300+t+2*n+.1*t*t+.1*t*n+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*this.M_PI)+20*Math.sin(2*t*this.M_PI))/3,i+=2*(20*Math.sin(t*this.M_PI)+40*Math.sin(t/3*this.M_PI))/3,i+=2*(150*Math.sin(t/12*this.M_PI)+300*Math.sin(t/30*this.M_PI))/3},t.prototype.delta=function(t,n){var i=6378245,r=.006693421622965943,s=this.transformLat(n-105,t-35),h=this.transformLon(n-105,t-35),a=t/180*this.M_PI,e=Math.sin(a);e=1-r*e*e;var o=Math.sqrt(e);return{lat:s=180*s/(i*(1-r)/(e*o)*this.M_PI),lon:h=180*h/(i/o*Math.cos(a)*this.M_PI)}},t.prototype.WGS2GCJ=function(t){if(!this.outOfChine(t)){var n={},i=this.WGS2GCJLat(t.lng-105,t.lat-35),r=this.WGS2GCJLng(t.lng-105,t.lat-35),s=t.lat/180*this.M_PI,h=Math.sin(s);h=1-this.EE*h*h;var a=Math.sqrt(h);return i=180*i/(this.A*(1-this.EE)/(h*a)*this.M_PI),r=180*r/(this.A/a*Math.cos(s)*this.M_PI),n.lat=Number(t.lat)+Number(i),n.lng=Number(t.lng)+Number(r),n}},t.prototype.GCJ2BD09=function(t){var n={},i=t.lng,r=t.lat,s=Math.sqrt(i*i+r*r)+2e-5*Math.sin(r*this.X_PI),h=Math.atan2(r,i)+3e-6*Math.cos(i*this.X_PI);return n.lng=s*Math.cos(h)+.0065,n.lat=s*Math.sin(h)+.006,n},t.prototype.WGS2BD09=function(t){var n=this.WGS2GCJ(t);return this.GCJ2BD09(n)},t.prototype.transformGCJ2WGS=function(t,n){var i=this.delta(t,n);return{lat:t-i.lat,lon:n-i.lon}},t}(),e=function(t,n){var i,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(n=n||r.length,t)for(i=0;i<t;i++)s[i]=r[0|Math.random()*n];else{var h=void 0;for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",i=0;i<36;i++)s[i]||(h=0|16*Math.random(),s[i]=r[19===i?3&h|8:h])}return s.join("")},o=function(t,n,i,r){void 0===r&&(r="string");var h=s(t).filter(function(t){return n.includes(t[i.key])}).map(function(t){return t[i.name]});return"string"===r?h.join():h},M=function(t,n,i,r){void 0===r&&(r="string");var s=t.filter(function(t){return n.includes(t[i.key])}).map(function(t){return t[i.name]});return"string"===r?s.join():s},u=function(t,n){var i=[];if(Math.abs(t.length-2*(n-1))%(n-2)>0){var r=t.splice(0,n-1),s=Math.ceil(t.length/(n-2));i.push(r);for(var h=0;h<s;h++)i.push(t.splice(0,n-2))}else if(t.length>2*(n-1)){r=t.splice(0,n-1);var a=t.splice(t.length-(n-1),n-1);s=Math.ceil(t.length/(n-2));i.push(r);for(h=0;h<s;h++)i.push(t.splice(0,n-2)),h>=s-1&&i.push(a)}else if(t.length===n){r=t.splice(0,n);i.push(r)}else{r=t.splice(0,n-1),a=t.splice(t.length-(n-1),n-1);i.push(r),i.push(a)}return i},c=function(t,n){var i=new URL(t);return"".concat(n).concat(i.pathname).concat(i.search)},l=function(t){return t<10?"0".concat(t):t};export{a as TransformConvertor,e as UUID,s as flattenDeepArray,l as formatNumber,r as formatSearchFiled,M as getSelectName,o as getTreeName,i as isJson,h as isNumber,u as platformListGenerate,c as replaceUrlOrigin};
|
package/dist/websocket.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=require("./commons/vendor-other-
|
|
1
|
+
"use strict";var e,t=require("./commons/vendor-other-Cd2MOa_2.js"),o=require("./utils.js");require("./commons/vendor-crypto-js-AYnBdXB5.js"),exports.EventId=void 0,(e=exports.EventId||(exports.EventId={}))[e.HEARTBEAT=1e3]="HEARTBEAT";var s=function(){function e(e){var t=this;this.websocket=null,this.connectState=!1,this.reconnectCount=0,this.maxReconnectCount=5,this.reconnectTimestamp=1e4,this.heartBeatTimer=null,this.heartBeatTimeout=4e3,this.heartBeatData={actionId:exports.EventId.HEARTBEAT},this.registerTipMap=new Map,this.registerMessageHandlerMap=new Map,this.messageQueueList=new Map,this.startHeartBeat=function(){t.send(t.heartBeatData),t.heartBeatTimer=setTimeout(t.startHeartBeat,t.heartBeatTimeout)},this.url=e,this.addStatus(),this.initWebsocket()}return e.prototype.initWebsocket=function(){var e,t=this;0===this.reconnectCount&&console.log("%cWebSocket","background-color: #889CBB;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","初始化连接..."),(null===(e=this.websocket)||void 0===e?void 0:e.readyState)!==WebSocket.OPEN&&(this.websocket=new WebSocket(this.url),this.websocket.onopen=function(){t.websocketOpen()},this.websocket.onmessage=function(e){t.websocketOnMessage(e)},this.websocket.onerror=function(){t.websocketOnError()},this.websocket.onclose=function(){t.websocketOnClose()})},e.prototype.websocketOpen=function(){var e,o,s;this.connectState=!0,this.reconnectCount=0,this.clearHeartBeat(),this.startHeartBeat(),this.allRegisterWebsocket();try{for(var r=t.__values(this.messageQueueList),n=r.next();!n.done;n=r.next()){var a=t.__read(n.value,2),i=a[0],c=a[1];null===(s=this.websocket)||void 0===s||s.send(JSON.stringify(c)),this.messageQueueList.delete(i)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}this.changeStatusColor("#5FB878"),console.log("%cWebSocket","background-color: #5FB878;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","连接成功,等待服务端数据推送[onopen]...")},e.prototype.websocketOnError=function(){0===this.reconnectCount&&(this.changeStatusColor("#FF5722"),console.log("%cWebSocket","background-color: #FF5722;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","连接异常[onerror]...")),this.clearHeartBeat()},e.prototype.websocketOnClose=function(){0===this.reconnectCount&&(this.changeStatusColor("#FF5722"),console.log("%cWebSocket","background-color: #FF5722;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","连接断开[onclose]...")),this.connectState&&this.disconnectAndReconnect()},e.prototype.websocketOnMessage=function(e){var t=e.data;o.isJson(e.data)&&(t=JSON.parse(e.data)),-1!==t.msgType&&(this.allRegisterMessageHandler(t),window.dispatchEvent(new CustomEvent("websocketOnMessage",{detail:{data:t}})))},e.prototype.disconnectAndReconnect=function(){var e=this;this.reconnectCount<this.maxReconnectCount?(++this.reconnectCount,this.changeStatusColor("#FFB800"),console.log("%cWebSocket","background-color: #FFB800;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","尝试重连...".concat(this.reconnectCount,"/").concat(this.maxReconnectCount)),setTimeout(function(){e.initWebsocket()},this.reconnectTimestamp)):(this.clearHeartBeat(),this.connectState=!1,this.reconnectCount=0,this.changeStatusColor("#FF5722"),console.log("%cWebSocket","background-color: #FF5722;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","最大重连失败, 终止重连..."))},e.prototype.resetHeartBeat=function(){this.clearHeartBeat(),this.startHeartBeat()},e.prototype.clearHeartBeat=function(){this.heartBeatTimer&&clearTimeout(this.heartBeatTimer),this.heartBeatTimer=null},e.prototype.allRegisterWebsocket=function(){var e,o;try{for(var s=t.__values(this.registerTipMap.entries()),r=s.next();!r.done;r=s.next()){var n=t.__read(r.value,1)[0];this.send(this.registerTipMap.get(n))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=s.return)&&o.call(s)}finally{if(e)throw e.error}}},e.prototype.allRegisterMessageHandler=function(e){var o,s;try{for(var r=t.__values(this.registerMessageHandlerMap.entries()),n=r.next();!n.done;n=r.next()){var a=t.__read(n.value,1)[0];this.registerMessageHandlerMap.get(a)(e)}}catch(e){o={error:e}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(o)throw o.error}}},e.prototype.registerWebsocket=function(e){this.registerTipMap.set(String(e.eventId),e),this.send(e)},e.prototype.unregisterWebsocket=function(e){this.registerTipMap.delete(String(e.eventId)),this.send(e)},e.prototype.send=function(e){var t,s;(null===(t=this.websocket)||void 0===t?void 0:t.readyState)===WebSocket.OPEN&&this.connectState?null===(s=this.websocket)||void 0===s||s.send(JSON.stringify(e)):this.messageQueueList.set("".concat(e.eventId,"-").concat(o.UUID(8,16)),e)},e.prototype.message=function(e,t){this.registerMessageHandlerMap.set(e,t)},e.prototype.close=function(){this.websocket&&(this.connectState=!1,this.websocket.close(),this.websocket=null,this.changeStatusColor("#999999")),this.clearHeartBeat()},e.prototype.addStatus=function(){this.removeStatus();var e=document.createElement("div");e.id="websocketStatus",e.style.width="10px",e.style.height="10px",e.style.backgroundColor="#999999",e.style.position="fixed",e.style.right="0",e.style.top="0",e.style.zIndex="9999",document.body.appendChild(e)},e.prototype.removeStatus=function(){var e=document.getElementById("websocketStatus");e&&document.body.removeChild(e)},e.prototype.changeStatusColor=function(e){var t=document.getElementById("websocketStatus");t&&(t.style.backgroundColor=e)},e}();exports.Websocket=s;
|
package/dist/websocket.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,d as e}from"./commons/vendor-other-
|
|
1
|
+
import{b as t,d as e}from"./commons/vendor-other-odeBaM7w.js";import{isJson as o,UUID as n}from"./utils.mjs";import"./commons/vendor-crypto-js-Dhi5niDn.js";var r;!function(t){t[t.HEARTBEAT=1e3]="HEARTBEAT"}(r||(r={}));var s=function(){function s(t){var e=this;this.websocket=null,this.connectState=!1,this.reconnectCount=0,this.maxReconnectCount=5,this.reconnectTimestamp=1e4,this.heartBeatTimer=null,this.heartBeatTimeout=4e3,this.heartBeatData={actionId:r.HEARTBEAT},this.registerTipMap=new Map,this.registerMessageHandlerMap=new Map,this.messageQueueList=new Map,this.startHeartBeat=function(){e.send(e.heartBeatData),e.heartBeatTimer=setTimeout(e.startHeartBeat,e.heartBeatTimeout)},this.url=t,this.addStatus(),this.initWebsocket()}return s.prototype.initWebsocket=function(){var t,e=this;0===this.reconnectCount&&console.log("%cWebSocket","background-color: #889CBB;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","初始化连接..."),(null===(t=this.websocket)||void 0===t?void 0:t.readyState)!==WebSocket.OPEN&&(this.websocket=new WebSocket(this.url),this.websocket.onopen=function(){e.websocketOpen()},this.websocket.onmessage=function(t){e.websocketOnMessage(t)},this.websocket.onerror=function(){e.websocketOnError()},this.websocket.onclose=function(){e.websocketOnClose()})},s.prototype.websocketOpen=function(){var o,n,r;this.connectState=!0,this.reconnectCount=0,this.clearHeartBeat(),this.startHeartBeat(),this.allRegisterWebsocket();try{for(var s=t(this.messageQueueList),a=s.next();!a.done;a=s.next()){var i=e(a.value,2),c=i[0],l=i[1];null===(r=this.websocket)||void 0===r||r.send(JSON.stringify(l)),this.messageQueueList.delete(c)}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}this.changeStatusColor("#5FB878"),console.log("%cWebSocket","background-color: #5FB878;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","连接成功,等待服务端数据推送[onopen]...")},s.prototype.websocketOnError=function(){0===this.reconnectCount&&(this.changeStatusColor("#FF5722"),console.log("%cWebSocket","background-color: #FF5722;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","连接异常[onerror]...")),this.clearHeartBeat()},s.prototype.websocketOnClose=function(){0===this.reconnectCount&&(this.changeStatusColor("#FF5722"),console.log("%cWebSocket","background-color: #FF5722;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","连接断开[onclose]...")),this.connectState&&this.disconnectAndReconnect()},s.prototype.websocketOnMessage=function(t){var e=t.data;o(t.data)&&(e=JSON.parse(t.data)),-1!==e.msgType&&(this.allRegisterMessageHandler(e),window.dispatchEvent(new CustomEvent("websocketOnMessage",{detail:{data:e}})))},s.prototype.disconnectAndReconnect=function(){var t=this;this.reconnectCount<this.maxReconnectCount?(++this.reconnectCount,this.changeStatusColor("#FFB800"),console.log("%cWebSocket","background-color: #FFB800;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","尝试重连...".concat(this.reconnectCount,"/").concat(this.maxReconnectCount)),setTimeout(function(){t.initWebsocket()},this.reconnectTimestamp)):(this.clearHeartBeat(),this.connectState=!1,this.reconnectCount=0,this.changeStatusColor("#FF5722"),console.log("%cWebSocket","background-color: #FF5722;color: #FFFFFF;padding: 2px 5px;border-radius: 3px;","最大重连失败, 终止重连..."))},s.prototype.resetHeartBeat=function(){this.clearHeartBeat(),this.startHeartBeat()},s.prototype.clearHeartBeat=function(){this.heartBeatTimer&&clearTimeout(this.heartBeatTimer),this.heartBeatTimer=null},s.prototype.allRegisterWebsocket=function(){var o,n;try{for(var r=t(this.registerTipMap.entries()),s=r.next();!s.done;s=r.next()){var a=e(s.value,1)[0];this.send(this.registerTipMap.get(a))}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}},s.prototype.allRegisterMessageHandler=function(o){var n,r;try{for(var s=t(this.registerMessageHandlerMap.entries()),a=s.next();!a.done;a=s.next()){var i=e(a.value,1)[0];this.registerMessageHandlerMap.get(i)(o)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},s.prototype.registerWebsocket=function(t){this.registerTipMap.set(String(t.eventId),t),this.send(t)},s.prototype.unregisterWebsocket=function(t){this.registerTipMap.delete(String(t.eventId)),this.send(t)},s.prototype.send=function(t){var e,o;(null===(e=this.websocket)||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&this.connectState?null===(o=this.websocket)||void 0===o||o.send(JSON.stringify(t)):this.messageQueueList.set("".concat(t.eventId,"-").concat(n(8,16)),t)},s.prototype.message=function(t,e){this.registerMessageHandlerMap.set(t,e)},s.prototype.close=function(){this.websocket&&(this.connectState=!1,this.websocket.close(),this.websocket=null,this.changeStatusColor("#999999")),this.clearHeartBeat()},s.prototype.addStatus=function(){this.removeStatus();var t=document.createElement("div");t.id="websocketStatus",t.style.width="10px",t.style.height="10px",t.style.backgroundColor="#999999",t.style.position="fixed",t.style.right="0",t.style.top="0",t.style.zIndex="9999",document.body.appendChild(t)},s.prototype.removeStatus=function(){var t=document.getElementById("websocketStatus");t&&document.body.removeChild(t)},s.prototype.changeStatusColor=function(t){var e=document.getElementById("websocketStatus");e&&(e.style.backgroundColor=t)},s}();export{r as EventId,s as Websocket};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cool-common-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "cool工具函数库",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -24,11 +24,9 @@
|
|
|
24
24
|
"utils",
|
|
25
25
|
"water",
|
|
26
26
|
"aes",
|
|
27
|
-
"export-xlsx",
|
|
28
27
|
"amap-utils",
|
|
29
28
|
"request",
|
|
30
29
|
"axios",
|
|
31
|
-
"mqtt",
|
|
32
30
|
"socket-io",
|
|
33
31
|
"sweetalert"
|
|
34
32
|
],
|
|
@@ -44,13 +42,6 @@
|
|
|
44
42
|
},
|
|
45
43
|
"author": "cool-boy",
|
|
46
44
|
"license": "MIT",
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"axios": "^1.15.0",
|
|
49
|
-
"crypto-js": "^4.2.0",
|
|
50
|
-
"qs": "^6.15.1",
|
|
51
|
-
"socket.io-client": "^4.8.1",
|
|
52
|
-
"sweetalert": "^2.1.2"
|
|
53
|
-
},
|
|
54
45
|
"devDependencies": {
|
|
55
46
|
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
56
47
|
"@babel/preset-env": "^7.28.5",
|
|
@@ -81,5 +72,12 @@
|
|
|
81
72
|
"ts-node": "^10.9.2",
|
|
82
73
|
"tslib": "^2.8.1",
|
|
83
74
|
"typescript": "^5.9.3"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"axios": "^1.16.1",
|
|
78
|
+
"crypto-js": "^4.2.0",
|
|
79
|
+
"qs": "^6.15.2",
|
|
80
|
+
"socket.io-client": "^4.8.3",
|
|
81
|
+
"sweetalert": "^2.1.2"
|
|
84
82
|
}
|
|
85
83
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(i=Object.create(null),e=>{const n=t.call(e);return i[n]||(i[n]=n.slice(8,-1).toLowerCase())});var i;const a=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,u=c("undefined");function f(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const d=a("ArrayBuffer");const p=c("string"),h=c("function"),m=c("number"),b=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||o in e||r in e)},y=a("Date"),w=a("File"),E=a("Blob"),R=a("FileList");const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},S=void 0!==O.FormData?O.FormData:void 0,T=a("URLSearchParams"),[A,v,C,N]=["ReadableStream","Request","Response","Headers"].map(a);function _(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(f(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function x(e,t){if(f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,P=e=>!u(e)&&e!==j;const U=(F="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>F&&e instanceof F);var F;const L=a("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=a("RegExp"),k=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const q=a("AsyncFunction"),I=(M="function"==typeof setImmediate,z=h(j.postMessage),M?setImmediate:z?(H=`axios@${Math.random()}`,J=[],j.addEventListener("message",({source:e,data:t})=>{e===j&&t===H&&J.length&&J.shift()()},!1),e=>{J.push(e),j.postMessage(H,"*")}):e=>setTimeout(e));var M,z,H,J;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(j):"undefined"!=typeof process&&process.nextTick||I;var $={isArray:l,isArrayBuffer:d,isBuffer:f,isFormData:e=>{let t;return e&&(S&&e instanceof S||h(e.append)&&("formdata"===(t=s(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:g,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:v,isResponse:C,isHeaders:N,isUndefined:u,isDate:y,isFile:w,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:E,isRegExp:D,isFunction:h,isStream:e=>b(e)&&h(e.pipe),isURLSearchParams:T,isTypedArray:U,isFileList:R,forEach:_,merge:function e(){const{caseless:t,skipUndefined:n}=P(this)&&this||{},r={},o=(o,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=t&&x(r,s)||s;g(r[i])&&g(o)?r[i]=e(r[i],o):g(o)?r[i]=e({},o):l(o)?r[i]=o.slice():n&&u(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],o);return r},extend:(t,n,r,{allOwnKeys:o}={})=>(_(n,(n,o)=>{r&&h(n)?Object.defineProperty(t,o,{value:e(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:k,freezeMethods:e=>{k(e,(t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:j,isContextDefined:P,isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(f(e))return e;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return _(e,(e,t)=>{const s=n(e,r+1);!u(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:q,isThenable:e=>e&&(b(e)||h(e))&&h(e.then)&&h(e.catch),setImmediate:I,asap:W,isIterable:e=>null!=e&&h(e[r])};let V=class e extends Error{static from(t,n,r,o,s,i){const a=new e(t.message,n||t.code,r,o,s);return a.cause=t,a.name=t.name,null!=t.status&&null==a.status&&(a.status=t.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",V.ERR_BAD_OPTION="ERR_BAD_OPTION",V.ECONNABORTED="ECONNABORTED",V.ETIMEDOUT="ETIMEDOUT",V.ERR_NETWORK="ERR_NETWORK",V.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",V.ERR_DEPRECATED="ERR_DEPRECATED",V.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",V.ERR_BAD_REQUEST="ERR_BAD_REQUEST",V.ERR_CANCELED="ERR_CANCELED",V.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",V.ERR_INVALID_URL="ERR_INVALID_URL";function K(e){return $.isPlainObject(e)||$.isArray(e)}function X(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function G(e,t,n){return e?e.concat(t).map(function(e,t){return e=X(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Q=$.toFlatObject($,{},null,function(e){return/^is[A-Z]/.test(e)});function Y(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!$.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if($.isBoolean(e))return e.toString();if(!a&&$.isBlob(e))throw new V("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if($.isReactNative(t)&&$.isReactNativeBlob(e))return t.append(G(o,n,s),c(e)),!1;if(e&&!o&&"object"==typeof e)if($.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(K)}(e)||($.isFileList(e)||$.endsWith(n,"[]"))&&(a=$.toArray(e)))return n=X(n),a.forEach(function(e,r){!$.isUndefined(e)&&null!==e&&t.append(!0===i?G([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!K(e)||(t.append(G(o,n,s),c(e)),!1)}const u=[],f=Object.assign(Q,{defaultVisitor:l,convertValue:c,isVisitable:K});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!$.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),$.forEach(n,function(n,s){!0===(!($.isUndefined(n)||null===n)&&o.call(t,n,$.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function Z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ee(e,t){this._pairs=[],e&&Y(e,this,t)}const te=ee.prototype;function ne(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function re(e,t,n){if(!t)return e;const r=n&&n.encode||ne,o=$.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(i=s?s(t,o):$.isURLSearchParams(t)?t.toString():new ee(t,o).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}te.append=function(e,t){this._pairs.push([e,t])},te.toString=function(e){const t=e?function(t){return e.call(this,t,Z)}:Z;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class oe{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,function(t){null!==t&&e(t)})}}var se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ae="undefined"!=typeof window&&"undefined"!=typeof document,ce="object"==typeof navigator&&navigator||void 0,le=ae&&(!ce||["ReactNative","NativeScript","NS"].indexOf(ce.product)<0),ue="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fe=ae&&window.location.href||"http://localhost";var de={...Object.freeze({__proto__:null,hasBrowserEnv:ae,hasStandardBrowserEnv:le,hasStandardBrowserWebWorkerEnv:ue,navigator:ce,origin:fe}),...ie};function pe(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&$.isArray(r)?r.length:s,a)return $.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&$.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&$.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,(e,r)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const he={transitional:se,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=$.isObject(e);o&&$.isHTMLForm(e)&&(e=new FormData(e));if($.isFormData(e))return r?JSON.stringify(pe(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Y(e,new de.classes.URLSearchParams,{visitor:function(e,t,n,r){return de.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Y(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||he.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw V.from(e,V.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],e=>{he.headers[e]={}});const me=$.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"]);const be=Symbol("internals");function ge(e,t){if(!1!==e&&null!=e)if($.isArray(e))e.forEach(e=>ge(e,t));else if(!(e=>!/[\r\n]/.test(e))(String(e)))throw new Error(`Invalid character in header content ["${t}"]`)}function ye(e){return e&&String(e).trim().toLowerCase()}function we(e){return!1===e||null==e?e:$.isArray(e)?e.map(we):function(e){let t=e.length;for(;t>0;){const n=e.charCodeAt(t-1);if(10!==n&&13!==n)break;t-=1}return t===e.length?e:e.slice(0,t)}(String(e))}function Ee(e,t,n,r,o){return $.isFunction(r)?r.call(this,t,n):(o&&(t=n),$.isString(t)?$.isString(r)?-1!==t.indexOf(r):$.isRegExp(r)?r.test(t):void 0:void 0)}let Re=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ye(t);if(!o)throw new Error("header name must be a non-empty string");const s=$.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(ge(e,t),r[s||t]=we(e))}const s=(e,t)=>$.forEach(e,(e,n)=>o(e,n,t));if($.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if($.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&me[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if($.isObject(e)&&$.isIterable(e)){let n,r,o={};for(const t of e){if(!$.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?$.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ye(e)){const n=$.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(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}(e);if($.isFunction(t))return t.call(this,e,n);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ye(e)){const n=$.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ee(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ye(e)){const o=$.findKey(n,e);!o||t&&!Ee(0,n[o],o,t)||(delete n[o],r=!0)}}return $.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ee(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return $.forEach(this,(r,o)=>{const s=$.findKey(n,o);if(s)return t[s]=we(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=we(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&$.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[be]=this[be]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ye(e);t[r]||(!function(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}};function Oe(e,t){const n=this||he,r=t||n,o=Re.from(r.headers);let s=r.data;return $.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Se(e){return!(!e||!e.__CANCEL__)}Re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(Re.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),$.freezeMethods(Re);let Te=class extends V{constructor(e,t,n){super(null==e?"canceled":e,V.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ae(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new V("Request failed with status code "+n.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const ve=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ce=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ne=e=>(...t)=>$.asap(()=>e(...t));var _e=de.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,de.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(de.origin),de.navigator&&/(msie|trident)/i.test(de.navigator.userAgent)):()=>!0,xe=de.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];$.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),$.isString(r)&&a.push(`path=${r}`),$.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),$.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function je(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pe=e=>e instanceof Re?{...e}:e;function Ue(e,t){t=t||{};const n={};function r(e,t,n,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function o(e,t,n,o){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!$.isUndefined(t))return r(void 0,t)}function i(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,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:a,headers:(e,t,n)=>o(Pe(e),Pe(t),0,!0)};return $.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=$.hasOwnProp(c,r)?c[r]:o,i=s(e[r],t[r],r);$.isUndefined(i)&&s!==a||(n[r]=i)}),n}var Fe=e=>{const t=Ue({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Re.from(i),t.url=re(je(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),$.isFormData(n))if(de.hasStandardBrowserEnv||de.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if($.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(de.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||!1!==r&&_e(t.url))){const e=o&&s&&xe.read(s);e&&i.set(o,e)}return t};var Le="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Fe(e);let o=r.data;const s=Re.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function b(){if(!m)return;const r=Re.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ae(function(e){t(e),h()},function(e){n(e),h()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new V("Request aborted",V.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new V(r,V.ERR_NETWORK,e,m);o.event=t||null,n(o),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||se;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new V(t,o.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&$.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),$.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=ve(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=ve(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Te(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===de.protocols.indexOf(g)?n(new V("Unsupported protocol "+g+":",V.ERR_BAD_REQUEST,e)):m.send(o||null)})};const Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof V?t:new Te(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new V(`timeout of ${t}ms exceeded`,V.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>$.asap(i),a}},De=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},ke=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},qe=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of ke(e))yield*De(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ie}=$,Me=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:ze,TextEncoder:He}=$.global,Je=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},We=e=>{e=$.merge.call({skipUndefined:!0},Me,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ie(t):"function"==typeof fetch,s=Ie(n),i=Ie(r);if(!o)return!1;const a=o&&Ie(ze),c=o&&("function"==typeof He?(l=new He,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&Je(()=>{let e=!1;const t=new ze,r=new n(de.origin,{body:t,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return t.cancel(),e&&!r}),f=i&&a&&Je(()=>$.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const r=$.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e)){const t=new n(de.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $.isArrayBufferView(e)||$.isArrayBuffer(e)?e.byteLength:($.isURLSearchParams(e)&&(e+=""),$.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:h,onDownloadProgress:m,onUploadProgress:b,responseType:g,headers:y,withCredentials:w="same-origin",fetchOptions:E}=Fe(e),R=t||fetch;g=g?(g+"").toLowerCase():"text";let O=Be([c,l&&l.toAbortSignal()],h),S=null;const T=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let A;try{if(b&&u&&"get"!==i&&"head"!==i&&0!==(A=await p(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if($.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Ce(A,ve(Ne(b)));a=qe(t.body,65536,e,n)}}$.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:O,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let l=await(s?R(S,E):R(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(m||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=$.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&Ce(t,ve(Ne(m),!0))||[];l=new r(qe(l.body,65536,n,()=>{o&&o(),T&&T()}),e)}g=g||"text";let v=await d[$.findKey(d,g)||"text"](l,e);return!h&&T&&T(),await new Promise((t,n)=>{Ae(t,n,{data:v,headers:Re.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new V("Network Error",V.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw V.from(t,t&&t.code,e,S,t&&t.response)}}},$e=new Map,Ve=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=$e;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:We(t)),l=a;return a};Ve();const Ke={http:null,xhr:Le,fetch:{get:Ve}};$.forEach(Ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Xe=e=>`- ${e}`,Ge=e=>$.isFunction(e)||null===e||!1===e;var Qe={getAdapter:function(e,t){e=$.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!Ge(r)&&(o=Ke[(n=String(r)).toLowerCase()],void 0===o))throw new V(`Unknown adapter '${n}'`);if(o&&($.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Xe).join("\n"):" "+Xe(e[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Ke};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function Ze(e){Ye(e),e.headers=Re.from(e.headers),e.data=Oe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Qe.getAdapter(e.adapter||he.adapter,e)(e).then(function(t){return Ye(e),t.data=Oe.call(e,e.transformResponse,t),t.headers=Re.from(t.headers),t},function(t){return Se(t)||(Ye(e),t&&t.response&&(t.response.data=Oe.call(e,e.transformResponse,t.response),t.response.headers=Re.from(t.response.headers))),Promise.reject(t)})}const et="1.15.0",tt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const nt={};tt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+et+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new V(r(o," has been removed"+(t?" in "+t:"")),V.ERR_DEPRECATED);return t&&!nt[o]&&(nt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},tt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new V("option "+s+" must be "+n,V.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new V("Unknown option "+s,V.ERR_BAD_OPTION)}},validators:tt};const ot=rt.validators;let st=class{constructor(e){this.defaults=e||{},this.interceptors={request:new oe,response:new oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ue(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rt.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:rt.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rt.assertOptions(t,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&$.merge(o.common,o[t.method]);o&&$.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Re.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||se;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[Ze.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Ze.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return re(je((e=Ue(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$.forEach(["delete","get","head","options"],function(e){st.prototype[e]=function(t,n){return this.request(Ue(n||{},{method:e,url:t,data:(n||{}).data}))}}),$.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Ue(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}st.prototype[e]=t(),st.prototype[e+"Form"]=t(!0)});const it={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(it).forEach(([e,t])=>{it[t]=e});const at=function t(n){const r=new st(n),o=e(st.prototype.request,r);return $.extend(o,st.prototype,r,{allOwnKeys:!0}),$.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Ue(n,e))},o}(he);at.Axios=st,at.CanceledError=Te,at.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Te(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},at.isCancel=Se,at.VERSION=et,at.toFormData=Y,at.AxiosError=V,at.Cancel=at.CanceledError,at.all=function(e){return Promise.all(e)},at.spread=function(e){return function(t){return e.apply(null,t)}},at.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},at.mergeConfig=Ue,at.AxiosHeaders=Re,at.formToJSON=e=>pe($.isHTMLForm(e)?new FormData(e):e),at.getAdapter=Qe.getAdapter,at.HttpStatusCode=it,at.default=at;const{Axios:ct,AxiosError:lt,CanceledError:ut,isCancel:ft,CancelToken:dt,VERSION:pt,all:ht,Cancel:mt,isAxiosError:bt,spread:gt,toFormData:yt,AxiosHeaders:wt,HttpStatusCode:Et,formToJSON:Rt,getAdapter:Ot,mergeConfig:St}=at;exports.axios=at;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(i=Object.create(null),e=>{const n=t.call(e);return i[n]||(i[n]=n.slice(8,-1).toLowerCase())});var i;const a=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,u=c("undefined");function f(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const d=a("ArrayBuffer");const p=c("string"),h=c("function"),m=c("number"),b=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||o in e||r in e)},y=a("Date"),w=a("File"),E=a("Blob"),R=a("FileList");const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},S=void 0!==O.FormData?O.FormData:void 0,T=a("URLSearchParams"),[A,v,C,N]=["ReadableStream","Request","Response","Headers"].map(a);function _(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(f(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function x(e,t){if(f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,P=e=>!u(e)&&e!==j;const U=(F="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>F&&e instanceof F);var F;const L=a("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=a("RegExp"),k=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const q=a("AsyncFunction"),I=(M="function"==typeof setImmediate,z=h(j.postMessage),M?setImmediate:z?(H=`axios@${Math.random()}`,J=[],j.addEventListener("message",({source:e,data:t})=>{e===j&&t===H&&J.length&&J.shift()()},!1),e=>{J.push(e),j.postMessage(H,"*")}):e=>setTimeout(e));var M,z,H,J;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(j):"undefined"!=typeof process&&process.nextTick||I;var $={isArray:l,isArrayBuffer:d,isBuffer:f,isFormData:e=>{let t;return e&&(S&&e instanceof S||h(e.append)&&("formdata"===(t=s(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:g,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:v,isResponse:C,isHeaders:N,isUndefined:u,isDate:y,isFile:w,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:E,isRegExp:D,isFunction:h,isStream:e=>b(e)&&h(e.pipe),isURLSearchParams:T,isTypedArray:U,isFileList:R,forEach:_,merge:function e(){const{caseless:t,skipUndefined:n}=P(this)&&this||{},r={},o=(o,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=t&&x(r,s)||s;g(r[i])&&g(o)?r[i]=e(r[i],o):g(o)?r[i]=e({},o):l(o)?r[i]=o.slice():n&&u(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],o);return r},extend:(t,n,r,{allOwnKeys:o}={})=>(_(n,(n,o)=>{r&&h(n)?Object.defineProperty(t,o,{value:e(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:k,freezeMethods:e=>{k(e,(t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:j,isContextDefined:P,isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(f(e))return e;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return _(e,(e,t)=>{const s=n(e,r+1);!u(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:q,isThenable:e=>e&&(b(e)||h(e))&&h(e.then)&&h(e.catch),setImmediate:I,asap:W,isIterable:e=>null!=e&&h(e[r])};let V=class e extends Error{static from(t,n,r,o,s,i){const a=new e(t.message,n||t.code,r,o,s);return a.cause=t,a.name=t.name,null!=t.status&&null==a.status&&(a.status=t.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",V.ERR_BAD_OPTION="ERR_BAD_OPTION",V.ECONNABORTED="ECONNABORTED",V.ETIMEDOUT="ETIMEDOUT",V.ERR_NETWORK="ERR_NETWORK",V.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",V.ERR_DEPRECATED="ERR_DEPRECATED",V.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",V.ERR_BAD_REQUEST="ERR_BAD_REQUEST",V.ERR_CANCELED="ERR_CANCELED",V.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",V.ERR_INVALID_URL="ERR_INVALID_URL";function K(e){return $.isPlainObject(e)||$.isArray(e)}function X(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function G(e,t,n){return e?e.concat(t).map(function(e,t){return e=X(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Q=$.toFlatObject($,{},null,function(e){return/^is[A-Z]/.test(e)});function Y(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!$.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if($.isBoolean(e))return e.toString();if(!a&&$.isBlob(e))throw new V("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if($.isReactNative(t)&&$.isReactNativeBlob(e))return t.append(G(o,n,s),c(e)),!1;if(e&&!o&&"object"==typeof e)if($.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(K)}(e)||($.isFileList(e)||$.endsWith(n,"[]"))&&(a=$.toArray(e)))return n=X(n),a.forEach(function(e,r){!$.isUndefined(e)&&null!==e&&t.append(!0===i?G([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!K(e)||(t.append(G(o,n,s),c(e)),!1)}const u=[],f=Object.assign(Q,{defaultVisitor:l,convertValue:c,isVisitable:K});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!$.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),$.forEach(n,function(n,s){!0===(!($.isUndefined(n)||null===n)&&o.call(t,n,$.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function Z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ee(e,t){this._pairs=[],e&&Y(e,this,t)}const te=ee.prototype;function ne(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function re(e,t,n){if(!t)return e;const r=n&&n.encode||ne,o=$.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(i=s?s(t,o):$.isURLSearchParams(t)?t.toString():new ee(t,o).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}te.append=function(e,t){this._pairs.push([e,t])},te.toString=function(e){const t=e?function(t){return e.call(this,t,Z)}:Z;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class oe{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,function(t){null!==t&&e(t)})}}var se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ae="undefined"!=typeof window&&"undefined"!=typeof document,ce="object"==typeof navigator&&navigator||void 0,le=ae&&(!ce||["ReactNative","NativeScript","NS"].indexOf(ce.product)<0),ue="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fe=ae&&window.location.href||"http://localhost";var de={...Object.freeze({__proto__:null,hasBrowserEnv:ae,hasStandardBrowserEnv:le,hasStandardBrowserWebWorkerEnv:ue,navigator:ce,origin:fe}),...ie};function pe(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&$.isArray(r)?r.length:s,a)return $.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&$.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&$.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,(e,r)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const he={transitional:se,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=$.isObject(e);o&&$.isHTMLForm(e)&&(e=new FormData(e));if($.isFormData(e))return r?JSON.stringify(pe(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Y(e,new de.classes.URLSearchParams,{visitor:function(e,t,n,r){return de.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Y(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||he.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw V.from(e,V.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],e=>{he.headers[e]={}});const me=$.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"]);const be=Symbol("internals");function ge(e,t){if(!1!==e&&null!=e)if($.isArray(e))e.forEach(e=>ge(e,t));else if(!(e=>!/[\r\n]/.test(e))(String(e)))throw new Error(`Invalid character in header content ["${t}"]`)}function ye(e){return e&&String(e).trim().toLowerCase()}function we(e){return!1===e||null==e?e:$.isArray(e)?e.map(we):function(e){let t=e.length;for(;t>0;){const n=e.charCodeAt(t-1);if(10!==n&&13!==n)break;t-=1}return t===e.length?e:e.slice(0,t)}(String(e))}function Ee(e,t,n,r,o){return $.isFunction(r)?r.call(this,t,n):(o&&(t=n),$.isString(t)?$.isString(r)?-1!==t.indexOf(r):$.isRegExp(r)?r.test(t):void 0:void 0)}let Re=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ye(t);if(!o)throw new Error("header name must be a non-empty string");const s=$.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(ge(e,t),r[s||t]=we(e))}const s=(e,t)=>$.forEach(e,(e,n)=>o(e,n,t));if($.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if($.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&me[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if($.isObject(e)&&$.isIterable(e)){let n,r,o={};for(const t of e){if(!$.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?$.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ye(e)){const n=$.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(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}(e);if($.isFunction(t))return t.call(this,e,n);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ye(e)){const n=$.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ee(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ye(e)){const o=$.findKey(n,e);!o||t&&!Ee(0,n[o],o,t)||(delete n[o],r=!0)}}return $.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ee(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return $.forEach(this,(r,o)=>{const s=$.findKey(n,o);if(s)return t[s]=we(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=we(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&$.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[be]=this[be]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ye(e);t[r]||(!function(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}};function Oe(e,t){const n=this||he,r=t||n,o=Re.from(r.headers);let s=r.data;return $.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Se(e){return!(!e||!e.__CANCEL__)}Re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(Re.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),$.freezeMethods(Re);let Te=class extends V{constructor(e,t,n){super(null==e?"canceled":e,V.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ae(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new V("Request failed with status code "+n.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const ve=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ce=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ne=e=>(...t)=>$.asap(()=>e(...t));var _e=de.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,de.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(de.origin),de.navigator&&/(msie|trident)/i.test(de.navigator.userAgent)):()=>!0,xe=de.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];$.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),$.isString(r)&&a.push(`path=${r}`),$.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),$.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function je(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pe=e=>e instanceof Re?{...e}:e;function Ue(e,t){t=t||{};const n={};function r(e,t,n,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function o(e,t,n,o){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!$.isUndefined(t))return r(void 0,t)}function i(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,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:a,headers:(e,t,n)=>o(Pe(e),Pe(t),0,!0)};return $.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=$.hasOwnProp(c,r)?c[r]:o,i=s(e[r],t[r],r);$.isUndefined(i)&&s!==a||(n[r]=i)}),n}var Fe=e=>{const t=Ue({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Re.from(i),t.url=re(je(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),$.isFormData(n))if(de.hasStandardBrowserEnv||de.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if($.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(de.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||!1!==r&&_e(t.url))){const e=o&&s&&xe.read(s);e&&i.set(o,e)}return t};var Le="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Fe(e);let o=r.data;const s=Re.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function b(){if(!m)return;const r=Re.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ae(function(e){t(e),h()},function(e){n(e),h()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new V("Request aborted",V.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new V(r,V.ERR_NETWORK,e,m);o.event=t||null,n(o),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||se;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new V(t,o.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&$.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),$.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=ve(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=ve(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Te(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===de.protocols.indexOf(g)?n(new V("Unsupported protocol "+g+":",V.ERR_BAD_REQUEST,e)):m.send(o||null)})};const Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof V?t:new Te(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new V(`timeout of ${t}ms exceeded`,V.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>$.asap(i),a}},De=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},ke=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},qe=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of ke(e))yield*De(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ie}=$,Me=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:ze,TextEncoder:He}=$.global,Je=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},We=e=>{e=$.merge.call({skipUndefined:!0},Me,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ie(t):"function"==typeof fetch,s=Ie(n),i=Ie(r);if(!o)return!1;const a=o&&Ie(ze),c=o&&("function"==typeof He?(l=new He,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&Je(()=>{let e=!1;const t=new ze,r=new n(de.origin,{body:t,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return t.cancel(),e&&!r}),f=i&&a&&Je(()=>$.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const r=$.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e)){const t=new n(de.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $.isArrayBufferView(e)||$.isArrayBuffer(e)?e.byteLength:($.isURLSearchParams(e)&&(e+=""),$.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:h,onDownloadProgress:m,onUploadProgress:b,responseType:g,headers:y,withCredentials:w="same-origin",fetchOptions:E}=Fe(e),R=t||fetch;g=g?(g+"").toLowerCase():"text";let O=Be([c,l&&l.toAbortSignal()],h),S=null;const T=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let A;try{if(b&&u&&"get"!==i&&"head"!==i&&0!==(A=await p(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if($.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Ce(A,ve(Ne(b)));a=qe(t.body,65536,e,n)}}$.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:O,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let l=await(s?R(S,E):R(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(m||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=$.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&Ce(t,ve(Ne(m),!0))||[];l=new r(qe(l.body,65536,n,()=>{o&&o(),T&&T()}),e)}g=g||"text";let v=await d[$.findKey(d,g)||"text"](l,e);return!h&&T&&T(),await new Promise((t,n)=>{Ae(t,n,{data:v,headers:Re.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new V("Network Error",V.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw V.from(t,t&&t.code,e,S,t&&t.response)}}},$e=new Map,Ve=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=$e;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:We(t)),l=a;return a};Ve();const Ke={http:null,xhr:Le,fetch:{get:Ve}};$.forEach(Ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Xe=e=>`- ${e}`,Ge=e=>$.isFunction(e)||null===e||!1===e;var Qe={getAdapter:function(e,t){e=$.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!Ge(r)&&(o=Ke[(n=String(r)).toLowerCase()],void 0===o))throw new V(`Unknown adapter '${n}'`);if(o&&($.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Xe).join("\n"):" "+Xe(e[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Ke};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function Ze(e){Ye(e),e.headers=Re.from(e.headers),e.data=Oe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Qe.getAdapter(e.adapter||he.adapter,e)(e).then(function(t){return Ye(e),t.data=Oe.call(e,e.transformResponse,t),t.headers=Re.from(t.headers),t},function(t){return Se(t)||(Ye(e),t&&t.response&&(t.response.data=Oe.call(e,e.transformResponse,t.response),t.response.headers=Re.from(t.response.headers))),Promise.reject(t)})}const et="1.15.0",tt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const nt={};tt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+et+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new V(r(o," has been removed"+(t?" in "+t:"")),V.ERR_DEPRECATED);return t&&!nt[o]&&(nt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},tt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new V("option "+s+" must be "+n,V.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new V("Unknown option "+s,V.ERR_BAD_OPTION)}},validators:tt};const ot=rt.validators;let st=class{constructor(e){this.defaults=e||{},this.interceptors={request:new oe,response:new oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ue(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rt.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:rt.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rt.assertOptions(t,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&$.merge(o.common,o[t.method]);o&&$.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Re.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||se;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[Ze.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Ze.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return re(je((e=Ue(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$.forEach(["delete","get","head","options"],function(e){st.prototype[e]=function(t,n){return this.request(Ue(n||{},{method:e,url:t,data:(n||{}).data}))}}),$.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Ue(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}st.prototype[e]=t(),st.prototype[e+"Form"]=t(!0)});const it={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(it).forEach(([e,t])=>{it[t]=e});const at=function t(n){const r=new st(n),o=e(st.prototype.request,r);return $.extend(o,st.prototype,r,{allOwnKeys:!0}),$.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Ue(n,e))},o}(he);at.Axios=st,at.CanceledError=Te,at.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Te(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},at.isCancel=Se,at.VERSION=et,at.toFormData=Y,at.AxiosError=V,at.Cancel=at.CanceledError,at.all=function(e){return Promise.all(e)},at.spread=function(e){return function(t){return e.apply(null,t)}},at.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},at.mergeConfig=Ue,at.AxiosHeaders=Re,at.formToJSON=e=>pe($.isHTMLForm(e)?new FormData(e):e),at.getAdapter=Qe.getAdapter,at.HttpStatusCode=it,at.default=at;const{Axios:ct,AxiosError:lt,CanceledError:ut,isCancel:ft,CancelToken:dt,VERSION:pt,all:ht,Cancel:mt,isAxiosError:bt,spread:gt,toFormData:yt,AxiosHeaders:wt,HttpStatusCode:Et,formToJSON:Rt,getAdapter:Ot,mergeConfig:St}=at;export{at as a};
|