bitmax-crm-widget 1.0.3 β 1.0.6
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/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useRef as
|
|
1
|
+
import e,{useState as t,useRef as n,useEffect as r}from"react";function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n,r,s,o,i){try{var a=e[o](i),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,s)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function a(e){o(i,r,s,a,c,"next",e)}function c(e){o(i,r,s,a,c,"throw",e)}a(void 0)})}}function a(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function o(r,n,s,o){var c=n&&n.prototype instanceof a?n:a,u=Object.create(c.prototype);return h(u,"_invoke",function(r,n,s){var o,a,c,u=0,l=s||[],h=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return o=t,a=0,c=e,d.n=r,i}};function p(r,n){for(a=r,c=n,t=0;!h&&u&&!s&&t<l.length;t++){var s,o=l[t],p=d.p,f=o[2];r>3?(s=f===n)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=p&&((s=r<2&&p<o[1])?(a=0,d.v=n,d.n=o[1]):p<f&&(s=r<3||o[0]>n||n>f)&&(o[4]=r,o[5]=n,d.n=f,a=0))}if(s||r>1)return i;throw h=!0,n}return function(s,l,f){if(u>1)throw TypeError("Generator is already running");for(h&&1===l&&p(l,f),a=l,c=f;(t=a<2?e:c)||!h;){o||(a?a<3?(a>1&&(d.n=-1),p(a,c)):d.n=c:d.v=c);try{if(u=2,o){if(a||(s="next"),t=o[s]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+s+"' method"),a=1);o=e}else if((t=(h=d.n<0)?c:r.call(n,d))!==i)break}catch(t){o=e,a=1,c=t}finally{u=1}}return{value:t,done:h}}}(r,s,o),!0),u}var i={};function a(){}function c(){}function u(){}t=Object.getPrototypeOf;var d=[][n]?t(t([][n]())):(h(t={},n,function(){return this}),t),p=u.prototype=a.prototype=Object.create(d);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,h(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=u,h(p,"constructor",u),h(u,"constructor",c),c.displayName="GeneratorFunction",h(u,s,"GeneratorFunction"),h(p),h(p,s,"Generator"),h(p,n,function(){return this}),h(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:f}})()}function h(e,t,r,n){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}h=function(e,t,r,n){function o(t,r){h(e,t,function(e){return this._invoke(t,r,e)})}t?s?s(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))},h(e,t,r,n)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,o,i,a=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t);else for(;!(c=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){u=!0,s=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw s}}return a}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}const m=Object.create(null);m.open="0",m.close="1",m.ping="2",m.pong="3",m.message="4",m.upgrade="5",m.noop="6";const g=Object.create(null);Object.keys(m).forEach(e=>{g[m[e]]=e});const y={type:"error",data:"parser error"},b="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),w="function"==typeof ArrayBuffer,v=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,E=({type:e,data:t},r,n)=>b&&t instanceof Blob?r?n(t):_(t,n):w&&(t instanceof ArrayBuffer||v(t))?r?n(t):_(new Blob([t]),n):n(m[e]+(t||"")),_=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+(e||""))},r.readAsDataURL(e)};function k(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let x;const O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)S[O.charCodeAt(e)]=e;const R="function"==typeof ArrayBuffer,T=(e,t)=>{if("string"!=typeof e)return{type:"message",data:C(e,t)};const r=e.charAt(0);if("b"===r)return{type:"message",data:A(e.substring(1),t)};return g[r]?e.length>1?{type:g[r],data:e.substring(1)}:{type:g[r]}:y},A=(e,t)=>{if(R){const r=(e=>{let t,r,n,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const u=new ArrayBuffer(i),l=new Uint8Array(u);for(t=0;t<a;t+=4)r=S[e.charCodeAt(t)],n=S[e.charCodeAt(t+1)],s=S[e.charCodeAt(t+2)],o=S[e.charCodeAt(t+3)],l[c++]=r<<2|n>>4,l[c++]=(15&n)<<4|s>>2,l[c++]=(3&s)<<6|63&o;return u})(e);return C(r,t)}return{base64:!0,data:e}},C=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,N=String.fromCharCode(30);function j(){return new TransformStream({transform(e,t){!function(e,t){b&&e.data instanceof Blob?e.data.arrayBuffer().then(k).then(t):w&&(e.data instanceof ArrayBuffer||v(e.data))?t(k(e.data)):E(e,!1,e=>{x||(x=new TextEncoder),t(x.encode(e))})}(e,r=>{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const e=new DataView(s.buffer);e.setUint8(0,126),e.setUint16(1,n)}else{s=new Uint8Array(9);const e=new DataView(s.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(n))}e.data&&"string"!=typeof e.data&&(s[0]|=128),t.enqueue(s),t.enqueue(r)})}})}let B;function L(e){return e.reduce((e,t)=>e+t.length,0)}function P(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let s=0;s<t;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function U(e){if(e)return function(e){for(var t in U.prototype)e[t]=U.prototype[t];return e}(e)}U.prototype.on=U.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},U.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},U.prototype.off=U.prototype.removeListener=U.prototype.removeAllListeners=U.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===t||r.fn===t){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},U.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){n=0;for(var s=(r=r.slice(0)).length;n<s;++n)r[n].apply(this,t)}return this},U.prototype.emitReserved=U.prototype.emit,U.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},U.prototype.hasListeners=function(e){return!!this.listeners(e).length};const F="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),D="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function q(e,...t){return t.reduce((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t),{})}const I=D.setTimeout,M=D.clearTimeout;function z(e,t){t.useNativeTimers?(e.setTimeoutFn=I.bind(D),e.clearTimeoutFn=M.bind(D)):(e.setTimeoutFn=D.setTimeout.bind(D),e.clearTimeoutFn=D.clearTimeout.bind(D))}function H(e){return"string"==typeof e?function(e){let t=0,r=0;for(let n=0,s=e.length;n<s;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}(e):Math.ceil(1.33*(e.byteLength||e.size))}function V(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class W extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class K extends U{constructor(e){super(),this.writable=!1,z(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,r){return super.emitReserved("error",new W(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=T(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}(e);return t.length?"?"+t:""}}class J extends K{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const r=e.split(N),n=[];for(let e=0;e<r.length;e++){const s=T(r[e],t);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const r=e.length,n=new Array(r);let s=0;e.forEach((e,o)=>{E(e,!1,e=>{n[o]=e,++s===r&&t(n.join(N))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=V()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let $=!1;try{$="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const G=$;function Y(){}class X extends J{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let r=location.port;r||(r=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class Q extends U{constructor(e,t,r){super(),this.createRequest=e,z(this,r),this._opts=r,this._method=r.method||"GET",this._uri=t,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;const t=q(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(t);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){return void this.setTimeoutFn(()=>{this._onError(e)},0)}"undefined"!=typeof document&&(this._index=Q.requestsCount++,Q.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=Y,e)try{this._xhr.abort()}catch(e){}"undefined"!=typeof document&&delete Q.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Q.requestsCount=0,Q.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Z);else if("function"==typeof addEventListener){addEventListener("onpagehide"in D?"pagehide":"unload",Z,!1)}function Z(){for(let e in Q.requests)Q.requests.hasOwnProperty(e)&&Q.requests[e].abort()}const ee=function(){const e=te({xdomain:!1});return e&&null!==e.responseType}();function te(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||G))return new XMLHttpRequest}catch(e){}if(!t)try{return new(D[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}const re="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class ne extends K{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,r=re?{}:q(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;E(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&F(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=V()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const se=D.WebSocket||D.MozWebSocket;const oe={websocket:class extends ne{createSocket(e,t,r){return re?new se(e,t,r):t?new se(e,t):new se(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends K{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=function(e,t){B||(B=new TextDecoder);const r=[];let n=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(r.push(i);;){if(0===n){if(L(r)<1)break;const e=P(r,1);o=!(128&~e[0]),s=127&e[0],n=s<126?3:126===s?1:2}else if(1===n){if(L(r)<2)break;const e=P(r,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),n=3}else if(2===n){if(L(r)<8)break;const e=P(r,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(y);break}s=o*Math.pow(2,32)+t.getUint32(4),n=3}else{if(L(r)<s)break;const e=P(r,s);a.enqueue(T(o?e:B.decode(e),t)),n=0}if(0===s||s>e){a.enqueue(y);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),n=j();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();const s=()=>{r.read().then(({done:e,value:t})=>{e||(this.onPacket(t),s())}).catch(e=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;this._writer.write(r).then(()=>{n&&F(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}},polling:class extends X{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=ee&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Q(te,this.uri(),e)}}},ie=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ae=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ce(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");-1!=r&&-1!=n&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let s=ie.exec(e||""),o={},i=14;for(;i--;)o[ae[i]]=s[i]||"";return-1!=r&&-1!=n&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||n.splice(0,1);"/"==t.slice(-1)&&n.splice(n.length-1,1);return n}(0,o.path),o.queryKey=function(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,n){t&&(r[t]=n)}),r}(0,o.query),o}const ue="function"==typeof addEventListener&&"function"==typeof removeEventListener,le=[];ue&&addEventListener("offline",()=>{le.forEach(e=>e())},!1);class he extends U{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const r=ce(e);t.hostname=r.host,t.secure="https"===r.protocol||"wss"===r.protocol,t.port=r.port,r.query&&(t.query=r.query)}else t.host&&(t.hostname=ce(t.host).host);z(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}(this.opts.query)),ue&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},le.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);const e=this.opts.rememberUpgrade&&he.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",he.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const r=this.writeBuffer[t].data;if(r&&(e+=H(r)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,F(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,r){return this._sendPacket("message",e,t,r),this}send(e,t,r){return this._sendPacket("message",e,t,r),this}_sendPacket(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;const s={type:e,data:t,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(he.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ue&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=le.indexOf(this._offlineEventListener);-1!==e&&le.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}he.protocol=4;class de extends he{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),r=!1;he.priorWebsocketSuccess=!1;const n=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;he.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,u(),t.close(),t=null)}const o=e=>{const r=new Error("probe error: "+e);r.transport=t.name,s(),this.emitReserved("upgradeError",r)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const u=()=>{t.removeListener("open",n),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",n),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}let pe=class extends de{constructor(e,t={}){const r="object"==typeof e?e:t;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>oe[e]).filter(e=>!!e)),super(e,r)}};const fe="function"==typeof ArrayBuffer,me=Object.prototype.toString,ge="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===me.call(Blob),ye="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===me.call(File);function be(e){return fe&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||ge&&e instanceof Blob||ye&&e instanceof File}function we(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)if(we(e[t]))return!0;return!1}if(be(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return we(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&we(e[t]))return!0;return!1}function ve(e){const t=[],r=e.data,n=e;return n.data=Ee(r,t),n.attachments=t.length,{packet:n,buffers:t}}function Ee(e,t){if(!e)return e;if(be(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ee(e[n],t);return r}if("object"==typeof e&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=Ee(e[n],t));return r}return e}function _e(e,t){return e.data=ke(e.data,t),delete e.attachments,e}function ke(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=ke(e[r],t);else if("object"==typeof e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=ke(e[r],t));return e}const xe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Oe;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(Oe||(Oe={}));function Se(e){return"[object Object]"===Object.prototype.toString.call(e)}class Re extends U{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===Oe.BINARY_EVENT;r||t.type===Oe.BINARY_ACK?(t.type=r?Oe.EVENT:Oe.ACK,this.reconstructor=new Te(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!be(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(void 0===Oe[r.type])throw new Error("unknown packet type "+r.type);if(r.type===Oe.BINARY_EVENT||r.type===Oe.BINARY_ACK){const n=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(n,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(s)}if("/"===e.charAt(t+1)){const n=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}r.nsp=e.substring(n,t)}else r.nsp="/";const n=e.charAt(t+1);if(""!==n&&Number(n)==n){const n=t+1;for(;++t;){const r=e.charAt(t);if(null==r||Number(r)!=r){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){const n=this.tryParse(e.substr(t));if(!Re.isPayloadValid(r.type,n))throw new Error("invalid payload");r.data=n}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case Oe.CONNECT:return Se(t);case Oe.DISCONNECT:return void 0===t;case Oe.CONNECT_ERROR:return"string"==typeof t||Se(t);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===xe.indexOf(t[0]));case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Te{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=_e(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var Ae=Object.freeze({__proto__:null,Decoder:Re,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==Oe.EVENT&&e.type!==Oe.ACK||!we(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===Oe.EVENT?Oe.BINARY_EVENT:Oe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==Oe.BINARY_EVENT&&e.type!==Oe.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=ve(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}},get PacketType(){return Oe},protocol:5});function Ce(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const Ne=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class je extends U{constructor(e,t,r){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=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ce(e,"open",this.onopen.bind(this)),Ce(e,"packet",this.onpacket.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var r,n,s;if(Ne.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:Oe.EVENT,data:t,options:{}};if(o.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),o.id=e}const i=null===(n=null===(r=this.io.engine)||void 0===r?void 0:r.transport)||void 0===n?void 0:n.writable,a=this.connected&&!(null===(s=this.io.engine)||void 0===s?void 0:s._hasPingExpired());return this.flags.volatile&&!i||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var r;const n=null!==(r=this.flags.timeout)&&void 0!==r?r:this._opts.ackTimeout;if(void 0===n)return void(this.acks[e]=t);const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((r,n)=>{const s=(e,t)=>e?n(e):r(t);s.withError=!0,t.push(s),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>{if(r!==this._queue[0])return;return null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...n)),r.pending=!1,this._drainQueue()}),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Oe.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 Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(e);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(e);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...n){r||(r=!0,t.packet({type:Oe.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}function Be(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Be.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+r:e-r}return 0|Math.min(e,this.max)},Be.prototype.reset=function(){this.attempts=0},Be.prototype.setMin=function(e){this.ms=e},Be.prototype.setMax=function(e){this.max=e},Be.prototype.setJitter=function(e){this.jitter=e};class Le extends U{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,z(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=t.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new Be({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||Ae;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new pe(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const n=Ce(t,"open",function(){r.onopen(),e&&e()}),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=Ce(t,"error",s);if(!1!==this._timeout){const e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(new Error("timeout")),t.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ce(e,"ping",this.onping.bind(this)),Ce(e,"data",this.ondata.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this)),Ce(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){F(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new je(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var r;this.cleanup(),null===(r=this.engine)||void 0===r||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Pe={};function Ue(e,t){"object"==typeof e&&(t=e,e=void 0);const r=function(e,t="",r){let n=e;r=r||"undefined"!=typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=ce(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 s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+t,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(t=t||{}).path||"/socket.io"),n=r.source,s=r.id,o=r.path,i=Pe[s]&&o in Pe[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Le(n,t):(Pe[s]||(Pe[s]=new Le(n,t)),a=Pe[s]),r.query&&!t.query&&(t.query=r.queryKey),a.socket(r.path,t)}function Fe(e,t){return function(){return e.apply(t,arguments)}}Object.assign(Ue,{Manager:Le,Socket:je,io:Ue,connect:Ue});const{toString:De}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:Ie,toStringTag:Me}=Symbol,ze=(e=>t=>{const r=De.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),He=e=>(e=e.toLowerCase(),t=>ze(t)===e),Ve=e=>t=>typeof t===e,{isArray:We}=Array,Ke=Ve("undefined");function Je(e){return null!==e&&!Ke(e)&&null!==e.constructor&&!Ke(e.constructor)&&Ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=He("ArrayBuffer");const Ge=Ve("string"),Ye=Ve("function"),Xe=Ve("number"),Qe=e=>null!==e&&"object"==typeof e,Ze=e=>{if("object"!==ze(e))return!1;const t=qe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Me in e||Ie in e)},et=He("Date"),tt=He("File"),rt=He("Blob"),nt=He("FileList"),st=He("URLSearchParams"),[ot,it,at,ct]=["ReadableStream","Request","Response","Headers"].map(He);function ut(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),We(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Je(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(n=0;n<o;n++)i=s[n],t.call(null,e[i],i,e)}}function lt(e,t){if(Je(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,s=r.length;for(;s-- >0;)if(n=r[s],t===n.toLowerCase())return n;return null}const ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,dt=e=>!Ke(e)&&e!==ht;const pt=(ft="undefined"!=typeof Uint8Array&&qe(Uint8Array),e=>ft&&e instanceof ft);var ft;const mt=He("HTMLFormElement"),gt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),yt=He("RegExp"),bt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ut(r,(r,s)=>{let o;!1!==(o=t(r,s,e))&&(n[s]=o||r)}),Object.defineProperties(e,n)};const wt=He("AsyncFunction"),vt=(Et="function"==typeof setImmediate,_t=Ye(ht.postMessage),Et?setImmediate:_t?(kt=`axios@${Math.random()}`,xt=[],ht.addEventListener("message",({source:e,data:t})=>{e===ht&&t===kt&&xt.length&&xt.shift()()},!1),e=>{xt.push(e),ht.postMessage(kt,"*")}):e=>setTimeout(e));var Et,_t,kt,xt;const Ot="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ht):"undefined"!=typeof process&&process.nextTick||vt;var St={isArray:We,isArrayBuffer:$e,isBuffer:Je,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ye(e.append)&&("formdata"===(t=ze(e))||"object"===t&&Ye(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$e(e.buffer),t},isString:Ge,isNumber:Xe,isBoolean:e=>!0===e||!1===e,isObject:Qe,isPlainObject:Ze,isEmptyObject:e=>{if(!Qe(e)||Je(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ot,isRequest:it,isResponse:at,isHeaders:ct,isUndefined:Ke,isDate:et,isFile:tt,isBlob:rt,isRegExp:yt,isFunction:Ye,isStream:e=>Qe(e)&&Ye(e.pipe),isURLSearchParams:st,isTypedArray:pt,isFileList:nt,forEach:ut,merge:function e(){const{caseless:t,skipUndefined:r}=dt(this)&&this||{},n={},s=(s,o)=>{const i=t&<(n,o)||o;Ze(n[i])&&Ze(s)?n[i]=e(n[i],s):Ze(s)?n[i]=e({},s):We(s)?n[i]=s.slice():r&&Ke(s)||(n[i]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ut(arguments[e],s);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(ut(t,(t,n)=>{r&&Ye(t)?e[n]=Fe(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&qe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:ze,kindOfTest:He,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(We(e))return e;let t=e.length;if(!Xe(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Ie]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:mt,hasOwnProperty:gt,hasOwnProp:gt,reduceDescriptors:bt,freezeMethods:e=>{bt(e,(t,r)=>{if(Ye(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Ye(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return We(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:lt,global:ht,isContextDefined:dt,isSpecCompliantForm:function(e){return!!(e&&Ye(e.append)&&"FormData"===e[Me]&&e[Ie])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Qe(e)){if(t.indexOf(e)>=0)return;if(Je(e))return e;if(!("toJSON"in e)){t[n]=e;const s=We(e)?[]:{};return ut(e,(e,t)=>{const o=r(e,n+1);!Ke(o)&&(s[t]=o)}),t[n]=void 0,s}}return e};return r(e,0)},isAsyncFn:wt,isThenable:e=>e&&(Qe(e)||Ye(e))&&Ye(e.then)&&Ye(e.catch),setImmediate:vt,asap:Ot,isIterable:e=>null!=e&&Ye(e[Ie])};function Rt(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}St.inherits(Rt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:St.toJSONObject(this.config),code:this.code,status:this.status}}});const Tt=Rt.prototype,At={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{At[e]={value:e}}),Object.defineProperties(Rt,At),Object.defineProperty(Tt,"isAxiosError",{value:!0}),Rt.from=(e,t,r,n,s,o)=>{const i=Object.create(Tt);St.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Rt.call(i,a,c,r,n,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function Ct(e){return St.isPlainObject(e)||St.isArray(e)}function Nt(e){return St.endsWith(e,"[]")?e.slice(0,-2):e}function jt(e,t,r){return e?e.concat(t).map(function(e,t){return e=Nt(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Bt=St.toFlatObject(St,{},null,function(e){return/^is[A-Z]/.test(e)});function Lt(e,t,r){if(!St.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=St.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!St.isUndefined(t[e])})).metaTokens,s=r.visitor||u,o=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&St.isSpecCompliantForm(t);if(!St.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(St.isDate(e))return e.toISOString();if(St.isBoolean(e))return e.toString();if(!a&&St.isBlob(e))throw new Rt("Blob is not supported. Use a Buffer instead.");return St.isArrayBuffer(e)||St.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,s){let a=e;if(e&&!s&&"object"==typeof e)if(St.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(St.isArray(e)&&function(e){return St.isArray(e)&&!e.some(Ct)}(e)||(St.isFileList(e)||St.endsWith(r,"[]"))&&(a=St.toArray(e)))return r=Nt(r),a.forEach(function(e,n){!St.isUndefined(e)&&null!==e&&t.append(!0===i?jt([r],n,o):null===i?r:r+"[]",c(e))}),!1;return!!Ct(e)||(t.append(jt(s,r,o),c(e)),!1)}const l=[],h=Object.assign(Bt,{defaultVisitor:u,convertValue:c,isVisitable:Ct});if(!St.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!St.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),St.forEach(r,function(r,o){!0===(!(St.isUndefined(r)||null===r)&&s.call(t,r,St.isString(o)?o.trim():o,n,h))&&e(r,n?n.concat(o):[o])}),l.pop()}}(e),t}function Pt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ut(e,t){this._pairs=[],e&&Lt(e,this,t)}const Ft=Ut.prototype;function Dt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qt(e,t,r){if(!t)return e;const n=r&&r.encode||Dt;St.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(o=s?s(t,r):St.isURLSearchParams(t)?t.toString():new Ut(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Ft.append=function(e,t){this._pairs.push([e,t])},Ft.toString=function(e){const t=e?function(t){return e.call(this,t,Pt)}:Pt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class It{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){St.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ut,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ht="undefined"!=typeof window&&"undefined"!=typeof document,Vt="object"==typeof navigator&&navigator||void 0,Wt=Ht&&(!Vt||["ReactNative","NativeScript","NS"].indexOf(Vt.product)<0),Kt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Jt=Ht&&window.location.href||"http://localhost";var $t={...Object.freeze({__proto__:null,hasBrowserEnv:Ht,hasStandardBrowserEnv:Wt,hasStandardBrowserWebWorkerEnv:Kt,navigator:Vt,origin:Jt}),...zt};function Gt(e){function t(e,r,n,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;if(o=!o&&St.isArray(n)?n.length:o,a)return St.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i;n[o]&&St.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],s)&&St.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}(n[o])),!i}if(St.isFormData(e)&&St.isFunction(e.entries)){const r={};return St.forEachEntry(e,(e,n)=>{t(function(e){return St.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const Yt={transitional:Mt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=St.isObject(e);s&&St.isHTMLForm(e)&&(e=new FormData(e));if(St.isFormData(e))return n?JSON.stringify(Gt(e)):e;if(St.isArrayBuffer(e)||St.isBuffer(e)||St.isStream(e)||St.isFile(e)||St.isBlob(e)||St.isReadableStream(e))return e;if(St.isArrayBufferView(e))return e.buffer;if(St.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Lt(e,new $t.classes.URLSearchParams,{visitor:function(e,t,r,n){return $t.isNode&&St.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=St.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Lt(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e,t,r){if(St.isString(e))try{return(t||JSON.parse)(e),St.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Yt.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(St.isResponse(e)||St.isReadableStream(e))return e;if(e&&St.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Rt.from(e,Rt.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:$t.classes.FormData,Blob:$t.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};St.forEach(["delete","get","head","post","put","patch"],e=>{Yt.headers[e]={}});const Xt=St.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 Qt=Symbol("internals");function Zt(e){return e&&String(e).trim().toLowerCase()}function er(e){return!1===e||null==e?e:St.isArray(e)?e.map(er):String(e)}function tr(e,t,r,n,s){return St.isFunction(n)?n.call(this,t,r):(s&&(t=r),St.isString(t)?St.isString(n)?-1!==t.indexOf(n):St.isRegExp(n)?n.test(t):void 0:void 0)}let rr=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(e,t,r){const s=Zt(t);if(!s)throw new Error("header name must be a non-empty string");const o=St.findKey(n,s);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=er(e))}const o=(e,t)=>St.forEach(e,(e,r)=>s(e,r,t));if(St.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(St.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||t[r]&&Xt[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(St.isObject(e)&&St.isIterable(e)){let r,n,s={};for(const t of e){if(!St.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(r=s[n])?St.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,r);return this}get(e,t){if(e=Zt(e)){const r=St.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(St.isFunction(t))return t.call(this,e,r);if(St.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Zt(e)){const r=St.findKey(this,e);return!(!r||void 0===this[r]||t&&!tr(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function s(e){if(e=Zt(e)){const s=St.findKey(r,e);!s||t&&!tr(0,r[s],s,t)||(delete r[s],n=!0)}}return St.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];e&&!tr(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return St.forEach(this,(n,s)=>{const o=St.findKey(r,s);if(o)return t[o]=er(n),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(s):String(s).trim();i!==s&&delete t[s],t[i]=er(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return St.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&St.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}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 r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Qt]=this[Qt]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Zt(e);t[n]||(!function(e,t){const r=St.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,s){return this[n].call(this,t,e,r,s)},configurable:!0})})}(r,e),t[n]=!0)}return St.isArray(e)?e.forEach(n):n(e),this}};function nr(e,t){const r=this||Yt,n=t||r,s=rr.from(n.headers);let o=n.data;return St.forEach(e,function(e){o=e.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function sr(e){return!(!e||!e.__CANCEL__)}function or(e,t,r){Rt.call(this,null==e?"canceled":e,Rt.ERR_CANCELED,t,r),this.name="CanceledError"}function ir(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Rt("Request failed with status code "+r.status,[Rt.ERR_BAD_REQUEST,Rt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}rr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),St.reduceDescriptors(rr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),St.freezeMethods(rr),St.inherits(or,Rt,{__CANCEL__:!0});const ar=(e,t,r=3)=>{let n=0;const s=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[i];s||(s=c),r[o]=a,n[o]=c;let l=i,h=0;for(;l!==o;)h+=r[l++],l%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const d=u&&c-u;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let r,n,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-a)))},()=>r&&i(r)]}(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,a=o-n,c=s(a);n=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},cr=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ur=e=>(...t)=>St.asap(()=>e(...t));var lr=$t.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,$t.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL($t.origin),$t.navigator&&/(msie|trident)/i.test($t.navigator.userAgent)):()=>!0,hr=$t.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];St.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),St.isString(n)&&a.push(`path=${n}`),St.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),St.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 dr(e,t,r){let n=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const pr=e=>e instanceof rr?{...e}:e;function fr(e,t){t=t||{};const r={};function n(e,t,r,n){return St.isPlainObject(e)&&St.isPlainObject(t)?St.merge.call({caseless:n},e,t):St.isPlainObject(t)?St.merge({},t):St.isArray(t)?t.slice():t}function s(e,t,r,s){return St.isUndefined(t)?St.isUndefined(e)?void 0:n(void 0,e,0,s):n(e,t,0,s)}function o(e,t){if(!St.isUndefined(t))return n(void 0,t)}function i(e,t){return St.isUndefined(t)?St.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,s,o){return o in t?n(r,s):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,r)=>s(pr(e),pr(t),0,!0)};return St.forEach(Object.keys({...e,...t}),function(n){const o=c[n]||s,i=o(e[n],t[n],n);St.isUndefined(i)&&o!==a||(r[n]=i)}),r}var mr=e=>{const t=fr({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=rr.from(i),t.url=qt(dr(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),St.isFormData(r))if($t.hasStandardBrowserEnv||$t.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(St.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if($t.hasStandardBrowserEnv&&(n&&St.isFunction(n)&&(n=n(t)),n||!1!==n&&lr(t.url))){const e=s&&o&&hr.read(o);e&&i.set(s,e)}return t};var gr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=mr(e);let s=n.data;const o=rr.from(n.headers).normalize();let i,a,c,u,l,{responseType:h,onUploadProgress:d,onDownloadProgress:p}=n;function f(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const n=rr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());ir(function(e){t(e),f()},function(e){r(e),f()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(r(new Rt("Request aborted",Rt.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const n=new Rt(t&&t.message?t.message:"Network Error",Rt.ERR_NETWORK,e,m);n.event=t||null,r(n),m=null},m.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||Mt;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Rt(t,s.clarifyTimeoutError?Rt.ETIMEDOUT:Rt.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&St.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),St.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),h&&"json"!==h&&(m.responseType=n.responseType),p&&([c,l]=ar(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,u]=ar(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(i=t=>{m&&(r(!t||t.type?new or(null,e,m):t),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);y&&-1===$t.protocols.indexOf(y)?r(new Rt("Unsupported protocol "+y+":",Rt.ERR_BAD_REQUEST,e)):m.send(s||null)})};const yr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const s=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Rt?t:new or(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new Rt(`timeout ${t} of ms exceeded`,Rt.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=()=>St.asap(i),a}},br=function*(e,t){let r=e.byteLength;if(r<t)return void(yield e);let n,s=0;for(;s<r;)n=s+t,yield e.slice(s,n),s=n},wr=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},vr=(e,t,r,n)=>{const s=async function*(e,t){for await(const r of wr(e))yield*br(r,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await s.next();if(t)return a(),void e.close();let o=n.byteLength;if(r){let e=i+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:Er}=St,_r=(({Request:e,Response:t})=>({Request:e,Response:t}))(St.global),{ReadableStream:kr,TextEncoder:xr}=St.global,Or=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Sr=e=>{e=St.merge.call({skipUndefined:!0},_r,e);const{fetch:t,Request:r,Response:n}=e,s=t?Er(t):"function"==typeof fetch,o=Er(r),i=Er(n);if(!s)return!1;const a=s&&Er(kr),c=s&&("function"==typeof xr?(u=new xr,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const l=o&&a&&Or(()=>{let e=!1;const t=new r($t.origin,{body:new kr,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=i&&a&&Or(()=>St.isReadableStream(new n("").body)),d={stream:h&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Rt(`Response type '${e}' is not supported`,Rt.ERR_NOT_SUPPORT,r)})});const p=async(e,t)=>{const n=St.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(St.isBlob(e))return e.size;if(St.isSpecCompliantForm(e)){const t=new r($t.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return St.isArrayBufferView(e)||St.isArrayBuffer(e)?e.byteLength:(St.isURLSearchParams(e)&&(e+=""),St.isString(e)?(await c(e)).byteLength:void 0)})(t):n};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:u,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:b,withCredentials:w="same-origin",fetchOptions:v}=mr(e),E=t||fetch;y=y?(y+"").toLowerCase():"text";let _=yr([c,u&&u.toAbortSignal()],f),k=null;const x=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let O;try{if(g&&l&&"get"!==i&&"head"!==i&&0!==(O=await p(b,a))){let e,t=new r(s,{method:"POST",body:a,duplex:"half"});if(St.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,r]=cr(O,ar(ur(g)));a=vr(t.body,65536,e,r)}}St.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in r.prototype,c={...v,signal:_,method:i.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};k=o&&new r(s,c);let u=await(o?E(k,v):E(s,c));const f=h&&("stream"===y||"response"===y);if(h&&(m||f&&x)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=St.toFiniteNumber(u.headers.get("content-length")),[r,s]=m&&cr(t,ar(ur(m),!0))||[];u=new n(vr(u.body,65536,r,()=>{s&&s(),x&&x()}),e)}y=y||"text";let S=await d[St.findKey(d,y)||"text"](u,e);return!f&&x&&x(),await new Promise((t,r)=>{ir(t,r,{data:S,headers:rr.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:k})})}catch(t){if(x&&x(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Rt("Network Error",Rt.ERR_NETWORK,e,k),{cause:t.cause||t});throw Rt.from(t,t&&t.code,e,k)}}},Rr=new Map,Tr=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i,a,c=o.length,u=Rr;for(;c--;)i=o[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:Sr(t)),u=a;return a};Tr();const Ar={http:null,xhr:gr,fetch:{get:Tr}};St.forEach(Ar,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Cr=e=>`- ${e}`,Nr=e=>St.isFunction(e)||null===e||!1===e;var jr={getAdapter:function(e,t){e=St.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],s=n,!Nr(n)&&(s=Ar[(r=String(n)).toLowerCase()],void 0===s))throw new Rt(`Unknown adapter '${r}'`);if(s&&(St.isFunction(s)||(s=s.get(t))))break;o[r||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Rt("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Cr).join("\n"):" "+Cr(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:Ar};function Br(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new or(null,e)}function Lr(e){Br(e),e.headers=rr.from(e.headers),e.data=nr.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return jr.getAdapter(e.adapter||Yt.adapter,e)(e).then(function(t){return Br(e),t.data=nr.call(e,e.transformResponse,t),t.headers=rr.from(t.headers),t},function(t){return sr(t)||(Br(e),t&&t.response&&(t.response.data=nr.call(e,e.transformResponse,t.response),t.response.headers=rr.from(t.response.headers))),Promise.reject(t)})}const Pr="1.13.2",Ur={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ur[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Fr={};Ur.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Pr+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,o)=>{if(!1===e)throw new Rt(n(s," has been removed"+(t?" in "+t:"")),Rt.ERR_DEPRECATED);return t&&!Fr[s]&&(Fr[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,o)}},Ur.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var Dr={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Rt("options must be an object",Rt.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new Rt("option "+o+" must be "+r,Rt.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Rt("Unknown option "+o,Rt.ERR_BAD_OPTION)}},validators:Ur};const qr=Dr.validators;let Ir=class{constructor(e){this.defaults=e||{},this.interceptors={request:new It,response:new It}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=fr(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;void 0!==r&&Dr.assertOptions(r,{silentJSONParsing:qr.transitional(qr.boolean),forcedJSONParsing:qr.transitional(qr.boolean),clarifyTimeoutError:qr.transitional(qr.boolean)},!1),null!=n&&(St.isFunction(n)?t.paramsSerializer={serialize:n}:Dr.assertOptions(n,{encode:qr.function,serialize:qr.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Dr.assertOptions(t,{baseUrl:qr.spelling("baseURL"),withXsrfToken:qr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&St.merge(s.common,s[t.method]);s&&St.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=rr.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,h=0;if(!a){const e=[Lr.bind(this),void 0];for(e.unshift(...i),e.push(...c),l=e.length,u=Promise.resolve(t);h<l;)u=u.then(e[h++],e[h++]);return u}l=i.length;let d=t;for(;h<l;){const e=i[h++],t=i[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Lr.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,l=c.length;h<l;)u=u.then(c[h++],c[h++]);return u}getUri(e){return qt(dr((e=fr(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};St.forEach(["delete","get","head","options"],function(e){Ir.prototype[e]=function(t,r){return this.request(fr(r||{},{method:e,url:t,data:(r||{}).data}))}}),St.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,s){return this.request(fr(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ir.prototype[e]=t(),Ir.prototype[e+"Form"]=t(!0)});const Mr={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(Mr).forEach(([e,t])=>{Mr[t]=e});const zr=function e(t){const r=new Ir(t),n=Fe(Ir.prototype.request,r);return St.extend(n,Ir.prototype,r,{allOwnKeys:!0}),St.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(fr(t,r))},n}(Yt);zr.Axios=Ir,zr.CanceledError=or,zr.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 r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,s){r.reason||(r.reason=new or(e,n,s),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},zr.isCancel=sr,zr.VERSION=Pr,zr.toFormData=Lt,zr.AxiosError=Rt,zr.Cancel=zr.CanceledError,zr.all=function(e){return Promise.all(e)},zr.spread=function(e){return function(t){return e.apply(null,t)}},zr.isAxiosError=function(e){return St.isObject(e)&&!0===e.isAxiosError},zr.mergeConfig=fr,zr.AxiosHeaders=rr,zr.formToJSON=e=>Gt(St.isHTMLForm(e)?new FormData(e):e),zr.getAdapter=jr.getAdapter,zr.HttpStatusCode=Mr,zr.default=zr;const{Axios:Hr,AxiosError:Vr,CanceledError:Wr,isCancel:Kr,CancelToken:Jr,VERSION:$r,all:Gr,Cancel:Yr,isAxiosError:Xr,spread:Qr,toFormData:Zr,AxiosHeaders:en,HttpStatusCode:tn,formToJSON:rn,getAdapter:nn,mergeConfig:sn}=zr;!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===r&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(".crm-widget-container{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.crm-chat-button{align-items:center;border:none;border-radius:50%;box-shadow:0 10px 25px rgba(0,0,0,.2);color:#fff;cursor:pointer;display:flex;font-size:24px;height:64px;justify-content:center;position:fixed;transition:all .2s;width:64px}.crm-chat-button:hover{transform:scale(1.1)}.crm-icon{height:32px;width:32px}.crm-icon-sm{height:24px;width:24px}.crm-badge{align-items:center;background-color:#ef4444;border-radius:50%;color:#fff;display:flex;font-size:12px;font-weight:600;height:20px;justify-content:center;position:absolute;right:-4px;top:-4px;width:20px}.crm-bottom-6{bottom:24px}.crm-right-6{right:24px}.crm-left-6{left:24px}.crm-top-6{top:24px}.crm-chat-window{background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.3);display:flex;flex-direction:column;height:600px;max-width:448px;overflow:hidden;position:fixed;width:100%}.crm-chat-window.crm-dark{background:#1f2937;border-color:#374151}.crm-chat-window.crm-bottom-6{bottom:100px}.crm-chat-window.crm-right-6{right:24px}.crm-chat-window.crm-left-6{left:24px}.crm-chat-window.crm-top-6{top:100px}@media (max-width:640px){.crm-chat-window{border-radius:0;bottom:0!important;height:100vh;left:0!important;max-width:100%;right:0!important;top:0!important}}.crm-header{align-items:center;color:#fff;display:flex;justify-content:space-between;padding:16px 24px}.crm-header-content{align-items:center;display:flex;gap:12px}.crm-avatar{align-items:center;background:#fff;border-radius:50%;display:flex;font-size:20px;height:40px;justify-content:center;width:40px}.crm-title{font-size:18px;font-weight:600;margin:0}.crm-status{align-items:center;display:flex;font-size:14px;gap:8px;opacity:.9}.crm-status-dot{border-radius:50%;height:8px;width:8px}.crm-status-dot.crm-online{background-color:#10b981}.crm-status-dot.crm-offline{background-color:#ef4444}.crm-close-btn{background:hsla(0,0%,100%,.2);border:none;border-radius:50%;color:#fff;cursor:pointer;padding:8px;transition:background .2s}.crm-close-btn:hover{background:hsla(0,0%,100%,.3)}.crm-messages{background:#f9fafb;display:flex;flex:1;flex-direction:column;gap:16px;overflow-y:auto;padding:16px}.crm-dark .crm-messages{background:#111827}.crm-welcome-message{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.1);padding:16px}.crm-dark .crm-welcome-message{background:#1f2937;border-color:#374151;color:#d1d5db}.crm-welcome-message p{color:#374151;font-size:14px;margin:0}.crm-dark .crm-welcome-message p{color:#d1d5db}.crm-message{display:flex}.crm-message-guest{justify-content:flex-end}.crm-message-agent{justify-content:flex-start}.crm-message-bubble{border-radius:16px;box-shadow:0 1px 2px rgba(0,0,0,.1);max-width:75%;padding:10px 16px}.crm-message-guest .crm-message-bubble{border-bottom-right-radius:4px;color:#fff}.crm-message-agent .crm-message-bubble{background:#fff;border:1px solid #e5e7eb;border-bottom-left-radius:4px;color:#1f2937}.crm-dark .crm-message-agent .crm-message-bubble{background:#1f2937;border-color:#374151;color:#f3f4f6}.crm-agent-name{font-size:12px;font-weight:500;margin:0 0 4px;opacity:.7}.crm-message-text{font-size:14px;line-height:1.5;margin:0;white-space:pre-wrap;word-break:break-word}.crm-message-time{font-size:11px;margin:4px 0 0;opacity:.7}.crm-typing-indicator{display:flex;gap:4px;padding:4px 0}.crm-typing-dot{animation:typing 1.4s infinite;background:#9ca3af;border-radius:50%;height:8px;width:8px}.crm-typing-dot:nth-child(2){animation-delay:.2s}.crm-typing-dot:nth-child(3){animation-delay:.4s}@keyframes typing{0%,60%,to{transform:translateY(0)}30%{transform:translateY(-10px)}}.crm-input-container{background:#fff;border-top:1px solid #e5e7eb;padding:16px}.crm-dark .crm-input-container{background:#1f2937;border-color:#374151}.crm-input-wrapper{align-items:flex-end;display:flex;gap:8px}.crm-input{background:#f9fafb;border:1px solid #d1d5db;border-radius:12px;color:#1f2937;flex:1;font-family:inherit;font-size:14px;max-height:120px;min-height:48px;padding:12px 16px;resize:none}.crm-input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.1);outline:none}.crm-input:disabled{cursor:not-allowed;opacity:.5}.crm-dark .crm-input{background:#111827;border-color:#4b5563;color:#f3f4f6}.crm-dark .crm-input::placeholder{color:#6b7280}.crm-send-btn{align-items:center;border:none;border-radius:12px;color:#fff;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;padding:12px;transition:all .2s}.crm-send-btn:hover:not(:disabled){box-shadow:0 4px 12px rgba(0,0,0,.2)}.crm-send-btn:disabled{cursor:not-allowed;opacity:.5}.crm-input-hint{color:#9ca3af;font-size:11px;margin:8px 0 0;text-align:center}.crm-dark .crm-input-hint{color:#6b7280}.crm-messages::-webkit-scrollbar{width:6px}.crm-messages::-webkit-scrollbar-track{background:transparent}.crm-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.crm-dark .crm-messages::-webkit-scrollbar-thumb{background:#4b5563}.crm-messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}");var on=function(s){var o=s.apiKey,a=s.apiUrl,c=void 0===a?"https://chat-crm-backend-7mzo.onrender.com":a,h=s.primaryColor,f=void 0===h?"#4F46E5":h,m=s.position,g=void 0===m?"bottom-right":m,y=s.userData,b=void 0===y?null:y,w=s.welcomeMessage,v=void 0===w?"π Welcome! How can we help you today?":w,E=s.companyName,_=void 0===E?"Support":E,k=s.autoOpen,x=void 0!==k&&k,O=s.showNotifications,S=void 0===O||O,R=s.playSound,T=void 0!==R&&R,A=s.theme,C=void 0===A?"light":A,N=s.zIndex,j=void 0===N?9999:N,B=d(t(x),2),L=B[0],P=B[1],U=d(t([]),2),F=U[0],D=U[1],q=d(t(""),2),I=q[0],M=q[1],z=d(t(null),2),H=z[0],V=z[1],W=d(t(null),2);W[0];var K=W[1],J=d(t(null),2),$=J[0],G=J[1],Y=d(t(!1),2),X=Y[0],Q=Y[1],Z=d(t(!1),2),ee=Z[0],te=Z[1],re=d(t("Support Agent"),2),ne=re[0],se=re[1],oe=d(t(0),2),ie=oe[0],ae=oe[1],ce=r(null);n(function(){var e;null===(e=ce.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[F]),n(function(){return L&&!H&&le(),function(){H&&H.disconnect()}},[L,b]);var ue=function(){return b?{name:b.name||"Guest User",email:b.email||null,phone:b.phone||null,userId:b.userId||null}:{name:localStorage.getItem("chatGuestName")||"Guest User",email:localStorage.getItem("chatGuestEmail")||null,phone:localStorage.getItem("chatGuestPhone")||null,userId:localStorage.getItem("chatUserId")||null}},le=function(){var e=i(l().m(function e(){var t,r,n,s,i,a,h,d;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=ue(),console.log("π Widget User Data:",{hasUserDataProp:!!b,userData:b,extractedUser:t}),e.n=1,zr.post("".concat(c,"/api/v1/webhook/guest-conversation"),{apiKey:o,guestName:t.name,guestEmail:t.email,guestPhone:t.phone,customUserId:t.userId});case 1:(r=e.v).data.success&&(n=r.data,s=n.conversationId,i=n.petitionId,a=n.queryId,K(a),G(s),localStorage.setItem("chatGuestId",a),localStorage.setItem("chatConversationId",s),localStorage.setItem("chatPetitionId",i),(h=Ue("".concat(c,"/widget"),{query:{conversationId:s,petitionId:i,apiKey:o},transports:["websocket","polling"]})).on("connect",function(){Q(!0),console.log("β
Connected to Chat CRM Widget Namespace")}),h.on("disconnect",function(){Q(!1),console.log("β Disconnected from Chat CRM")}),h.on("new-message",function(e){D(function(t){return[].concat(p(t),[u(u({},e),{},{sender:"agent",timestamp:new Date,read:!1})])}),te(!1),!L&&S&&(ae(function(e){return e+1}),T&&de())}),h.on("agent-typing",function(e){te(!0),se(e.agentName||"Support Agent"),setTimeout(function(){return te(!1)},3e3)}),V(h),D([{message:v,sender:"agent",timestamp:new Date,read:!0}])),e.n=3;break;case 2:e.p=2,d=e.v,console.error("β Chat initialization error:",d),alert("Failed to connect to chat. Please try again.");case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),he=function(){var e=i(l().m(function e(){var t,r,n;return l().w(function(e){for(;;)switch(e.n){case 0:if(I.trim()&&H&&X){e.n=1;break}return e.a(2);case 1:t=ue(),r=localStorage.getItem("chatPetitionId"),n={conversationId:$,petitionId:r,message:I.trim(),senderName:t.name||"Guest User",senderType:"Customer",timestamp:new Date};try{D(function(e){return[].concat(p(e),[{message:I.trim(),sender:"guest",read:!0,timestamp:new Date}])}),M(""),H.emit("widget-message",n)}catch(e){console.error("β Send message error:",e),D(function(e){return e.slice(0,-1)}),alert("Failed to send message. Please try again.")}case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),de=function(){var e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),r=e.createGain();t.connect(r),r.connect(e.destination),t.frequency.value=800,t.type="sine",r.gain.value=.1,t.start(),setTimeout(function(){return t.stop()},200)},pe=function(){var e={"bottom-right":"crm-bottom-6 crm-right-6","bottom-left":"crm-bottom-6 crm-left-6","top-right":"crm-top-6 crm-right-6","top-left":"crm-top-6 crm-left-6"};return e[g]||e["bottom-right"]},fe="dark"===C||"auto"===C&&window.matchMedia("(prefers-color-scheme: dark)").matches;return e.createElement("div",{className:"crm-widget-container",style:{zIndex:j}},e.createElement("button",{onClick:function(){P(!0),ae(0)},className:"crm-chat-button ".concat(pe()),style:{backgroundColor:f},"aria-label":"Open chat"},L?e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})):e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})),!L&&ie>0&&e.createElement("span",{className:"crm-badge"},ie)),L&&e.createElement("div",{className:"crm-chat-window ".concat(pe()," ").concat(fe?"crm-dark":"")},e.createElement("div",{className:"crm-header",style:{backgroundColor:f}},e.createElement("div",{className:"crm-header-content"},e.createElement("div",{className:"crm-avatar"},"π¬"),e.createElement("div",null,e.createElement("h3",{className:"crm-title"},_),e.createElement("div",{className:"crm-status"},e.createElement("div",{className:"crm-status-dot ".concat(X?"crm-online":"crm-offline")}),e.createElement("span",null,X?"Online":"Connecting...")))),e.createElement("button",{onClick:function(){return P(!1)},className:"crm-close-btn"},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})))),e.createElement("div",{className:"crm-messages"},0===F.length&&e.createElement("div",{className:"crm-welcome-message"},e.createElement("p",null,v)),F.map(function(t,r){return e.createElement("div",{key:r,className:"crm-message ".concat("guest"===t.sender?"crm-message-guest":"crm-message-agent")},e.createElement("div",{className:"crm-message-bubble",style:"guest"===t.sender?{backgroundColor:f}:{}},"agent"===t.sender&&e.createElement("p",{className:"crm-agent-name"},ne),e.createElement("p",{className:"crm-message-text"},t.message),e.createElement("p",{className:"crm-message-time"},(n=t.timestamp,new Date(n).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})))));var n}),ee&&e.createElement("div",{className:"crm-message crm-message-agent"},e.createElement("div",{className:"crm-message-bubble"},e.createElement("div",{className:"crm-typing-indicator"},e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"})))),e.createElement("div",{ref:ce})),e.createElement("div",{className:"crm-input-container"},e.createElement("div",{className:"crm-input-wrapper"},e.createElement("textarea",{value:I,onChange:function(e){return M(e.target.value)},onKeyPress:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),he())},placeholder:"Type your message...",rows:"1",className:"crm-input",disabled:!X}),e.createElement("button",{onClick:he,disabled:!I.trim()||!X,className:"crm-send-btn",style:{backgroundColor:f}},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})))),e.createElement("p",{className:"crm-input-hint"},"Press Enter to send β’ Shift+Enter for new line"))))};export{on as ChatCRMWidget};
|
|
3
|
+
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function o(n,r,s,o){var a=r&&r.prototype instanceof l?r:l,u=Object.create(a.prototype);return c(u,"_invoke",function(n,r,s){var o,a,c,l=0,u=s||[],h=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,a=0,c=e,d.n=n,i}};function p(n,r){for(a=n,c=r,t=0;!h&&l&&!s&&t<u.length;t++){var s,o=u[t],p=d.p,f=o[2];n>3?(s=f===r)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=p&&((s=n<2&&p<o[1])?(a=0,d.v=r,d.n=o[1]):p<f&&(s=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,d.n=f,a=0))}if(s||n>1)return i;throw h=!0,r}return function(s,u,f){if(l>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),a=u,c=f;(t=a<2?e:c)||!h;){o||(a?a<3?(a>1&&(d.n=-1),p(a,c)):d.n=c:d.v=c);try{if(l=2,o){if(a||(s="next"),t=o[s]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+s+"' method"),a=1);o=e}else if((t=(h=d.n<0)?c:n.call(r,d))!==i)break}catch(t){o=e,a=1,c=t}finally{l=1}}return{value:t,done:h}}}(n,s,o),!0),u}var i={};function l(){}function u(){}function h(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(c(t={},r,function(){return this}),t),p=h.prototype=l.prototype=Object.create(d);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return u.prototype=h,c(p,"constructor",h),c(h,"constructor",u),u.displayName="GeneratorFunction",c(h,s,"GeneratorFunction"),c(p),c(p,s,"Generator"),c(p,r,function(){return this}),c(p,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:f}})()}function c(e,t,n,r){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}c=function(e,t,n,r){function o(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},c(e,t,n,r)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,s,o,i,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,s=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw s}}return a}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}const d=Object.create(null);d.open="0",d.close="1",d.ping="2",d.pong="3",d.message="4",d.upgrade="5",d.noop="6";const p=Object.create(null);Object.keys(d).forEach(e=>{p[d[e]]=e});const f={type:"error",data:"parser error"},m="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),g="function"==typeof ArrayBuffer,y=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,b=({type:e,data:t},n,r)=>m&&t instanceof Blob?n?r(t):w(t,r):g&&(t instanceof ArrayBuffer||y(t))?n?r(t):w(new Blob([t]),r):r(d[e]+(t||"")),w=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function v(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let E;const _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)k[_.charCodeAt(e)]=e;const x="function"==typeof ArrayBuffer,O=(e,t)=>{if("string"!=typeof e)return{type:"message",data:R(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:S(e.substring(1),t)};return p[n]?e.length>1?{type:p[n],data:e.substring(1)}:{type:p[n]}:f},S=(e,t)=>{if(x){const n=(e=>{let t,n,r,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const l=new ArrayBuffer(i),u=new Uint8Array(l);for(t=0;t<a;t+=4)n=k[e.charCodeAt(t)],r=k[e.charCodeAt(t+1)],s=k[e.charCodeAt(t+2)],o=k[e.charCodeAt(t+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return l})(e);return R(n,t)}return{base64:!0,data:e}},R=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,T=String.fromCharCode(30);function A(){return new TransformStream({transform(e,t){!function(e,t){m&&e.data instanceof Blob?e.data.arrayBuffer().then(v).then(t):g&&(e.data instanceof ArrayBuffer||y(e.data))?t(v(e.data)):b(e,!1,e=>{E||(E=new TextEncoder),t(E.encode(e))})}(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const e=new DataView(s.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{s=new Uint8Array(9);const e=new DataView(s.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let C;function N(e){return e.reduce((e,t)=>e+t.length,0)}function B(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function j(e){if(e)return function(e){for(var t in j.prototype)e[t]=j.prototype[t];return e}(e)}j.prototype.on=j.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},j.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},j.prototype.off=j.prototype.removeListener=j.prototype.removeAllListeners=j.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},j.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},j.prototype.emitReserved=j.prototype.emit,j.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},j.prototype.hasListeners=function(e){return!!this.listeners(e).length};const L="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),P="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function U(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}const I=P.setTimeout,F=P.clearTimeout;function q(e,t){t.useNativeTimers?(e.setTimeoutFn=I.bind(P),e.clearTimeoutFn=F.bind(P)):(e.setTimeoutFn=P.setTimeout.bind(P),e.clearTimeoutFn=P.clearTimeout.bind(P))}function D(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}function M(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class z extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class H extends j{constructor(e){super(),this.writable=!1,q(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new z(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=O(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}class V extends H{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(T),r=[];for(let e=0;e<n.length;e++){const s=O(n[e],t);if(r.push(s),"error"===s.type)break}return r})(e,this.socket.binaryType).forEach(e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((e,o)=>{b(e,!1,e=>{r[o]=e,++s===n&&t(r.join(T))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=M()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let W=!1;try{W="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const K=W;function J(){}class $ extends V{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class G extends j{constructor(e,t,n){super(),this.createRequest=e,q(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=void 0!==n.data?n.data:null,this._create()}_create(){var e;const t=U(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(e){}if("POST"===this._method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(n.getResponseHeader("set-cookie"))),4===n.readyState&&(200===n.status||1223===n.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof n.status?n.status:0)},0))},n.send(this._data)}catch(e){return void this.setTimeoutFn(()=>{this._onError(e)},0)}"undefined"!=typeof document&&(this._index=G.requestsCount++,G.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=J,e)try{this._xhr.abort()}catch(e){}"undefined"!=typeof document&&delete G.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(G.requestsCount=0,G.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Y);else if("function"==typeof addEventListener){addEventListener("onpagehide"in P?"pagehide":"unload",Y,!1)}function Y(){for(let e in G.requests)G.requests.hasOwnProperty(e)&&G.requests[e].abort()}const X=function(){const e=Q({xdomain:!1});return e&&null!==e.responseType}();function Q(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||K))return new XMLHttpRequest}catch(e){}if(!t)try{return new(P[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}const Z="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class ee extends H{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Z?{}:U(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;b(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch(e){}r&&L(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=M()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const te=P.WebSocket||P.MozWebSocket;const ne={websocket:class extends ee{createSocket(e,t,n){return Z?new te(e,t,n):t?new te(e,t):new te(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends H{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=function(e,t){C||(C=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(0===r){if(N(n)<1)break;const e=B(n,1);o=!(128&~e[0]),s=127&e[0],r=s<126?3:126===s?1:2}else if(1===r){if(N(n)<2)break;const e=B(n,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(N(n)<8)break;const e=B(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(f);break}s=o*Math.pow(2,32)+t.getUint32(4),r=3}else{if(N(n)<s)break;const e=B(n,s);a.enqueue(O(o?e:C.decode(e),t)),r=0}if(0===s||s>e){a.enqueue(f);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=A();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const s=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),s())}).catch(e=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&L(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}},polling:class extends ${constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=X&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new G(Q,this.uri(),e)}}},re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,se=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function oe(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=re.exec(e||""),o={},i=14;for(;i--;)o[se[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}(0,o.query),o}const ie="function"==typeof addEventListener&&"function"==typeof removeEventListener,ae=[];ie&&addEventListener("offline",()=>{ae.forEach(e=>e())},!1);class ce extends j{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const n=oe(e);t.hostname=n.host,t.secure="https"===n.protocol||"wss"===n.protocol,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=oe(t.host).host);q(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),ie&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ae.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);const e=this.opts.rememberUpgrade&&ce.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",ce.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=D(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,L(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(ce.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ie&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=ae.indexOf(this._offlineEventListener);-1!==e&&ae.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}ce.protocol=4;class le extends ce{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;ce.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;ce.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function s(){n||(n=!0,l(),t.close(),t=null)}const o=e=>{const n=new Error("probe error: "+e);n.transport=t.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const l=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let ue=class extends le{constructor(e,t={}){const n="object"==typeof e?e:t;(!n.transports||n.transports&&"string"==typeof n.transports[0])&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(e=>ne[e]).filter(e=>!!e)),super(e,n)}};const he="function"==typeof ArrayBuffer,de=Object.prototype.toString,pe="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===de.call(Blob),fe="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===de.call(File);function me(e){return he&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||pe&&e instanceof Blob||fe&&e instanceof File}function ge(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(ge(e[t]))return!0;return!1}if(me(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return ge(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&ge(e[t]))return!0;return!1}function ye(e){const t=[],n=e.data,r=e;return r.data=be(n,t),r.attachments=t.length,{packet:r,buffers:t}}function be(e,t){if(!e)return e;if(me(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=be(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=be(e[r],t));return n}return e}function we(e,t){return e.data=ve(e.data,t),delete e.attachments,e}function ve(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ve(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ve(e[n],t));return e}const Ee=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var _e;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(_e||(_e={}));function ke(e){return"[object Object]"===Object.prototype.toString.call(e)}class xe extends j{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===_e.BINARY_EVENT;n||t.type===_e.BINARY_ACK?(t.type=n?_e.EVENT:_e.ACK,this.reconstructor=new Oe(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!me(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===_e[n.type])throw new Error("unknown packet type "+n.type);if(n.type===_e.BINARY_EVENT||n.type===_e.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!xe.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case _e.CONNECT:return ke(t);case _e.DISCONNECT:return void 0===t;case _e.CONNECT_ERROR:return"string"==typeof t||ke(t);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Ee.indexOf(t[0]));case _e.ACK:case _e.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Oe{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=we(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var Se=Object.freeze({__proto__:null,Decoder:xe,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==_e.EVENT&&e.type!==_e.ACK||!ge(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==_e.BINARY_EVENT&&e.type!==_e.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=ye(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},get PacketType(){return _e},protocol:5});function Re(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Te=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ae extends j{constructor(e,t,n){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=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Re(e,"open",this.onopen.bind(this)),Re(e,"packet",this.onpacket.bind(this)),Re(e,"error",this.onerror.bind(this)),Re(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,s;if(Te.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:_e.EVENT,data:t,options:{}};if(o.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,n=t.pop();this._registerAckCallback(e,n),o.id=e}const i=null===(r=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===r?void 0:r.writable,a=this.connected&&!(null===(s=this.io.engine)||void 0===s?void 0:s._hasPingExpired());return this.flags.volatile&&!i||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))},r),o=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((n,r)=>{const s=(e,t)=>e?r(e):n(t);s.withError=!0,t.push(s),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()}),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case _e.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 _e.EVENT:case _e.BINARY_EVENT:this.onevent(e);break;case _e.ACK:case _e.BINARY_ACK:this.onack(e);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:_e.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Ce(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ce.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},Ce.prototype.reset=function(){this.attempts=0},Ce.prototype.setMin=function(e){this.ms=e},Ce.prototype.setMax=function(e){this.max=e},Ce.prototype.setJitter=function(e){this.jitter=e};class Ne extends j{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,q(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Ce({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||Se;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new ue(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Re(t,"open",function(){n.onopen(),e&&e()}),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=Re(t,"error",s);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn(()=>{r(),s(new Error("timeout")),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Re(e,"ping",this.onping.bind(this)),Re(e,"data",this.ondata.bind(this)),Re(e,"error",this.onerror.bind(this)),Re(e,"close",this.onclose.bind(this)),Re(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){L(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ae(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Be={};function je(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=oe(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=Be[s]&&o in Be[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Ne(r,t):(Be[s]||(Be[s]=new Ne(r,t)),a=Be[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}function Le(e,t){return function(){return e.apply(t,arguments)}}Object.assign(je,{Manager:Ne,Socket:Ae,io:je,connect:je});const{toString:Pe}=Object.prototype,{getPrototypeOf:Ue}=Object,{iterator:Ie,toStringTag:Fe}=Symbol,qe=(e=>t=>{const n=Pe.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),De=e=>(e=e.toLowerCase(),t=>qe(t)===e),Me=e=>t=>typeof t===e,{isArray:ze}=Array,He=Me("undefined");function Ve(e){return null!==e&&!He(e)&&null!==e.constructor&&!He(e.constructor)&&Je(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const We=De("ArrayBuffer");const Ke=Me("string"),Je=Me("function"),$e=Me("number"),Ge=e=>null!==e&&"object"==typeof e,Ye=e=>{if("object"!==qe(e))return!1;const t=Ue(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Fe in e||Ie in e)},Xe=De("Date"),Qe=De("File"),Ze=De("Blob"),et=De("FileList"),tt=De("URLSearchParams"),[nt,rt,st,ot]=["ReadableStream","Request","Response","Headers"].map(De);function it(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),ze(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Ve(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(r=0;r<o;r++)i=s[r],t.call(null,e[i],i,e)}}function at(e,t){if(Ve(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,lt=e=>!He(e)&&e!==ct;const ut=(ht="undefined"!=typeof Uint8Array&&Ue(Uint8Array),e=>ht&&e instanceof ht);var ht;const dt=De("HTMLFormElement"),pt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ft=De("RegExp"),mt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};it(n,(n,s)=>{let o;!1!==(o=t(n,s,e))&&(r[s]=o||n)}),Object.defineProperties(e,r)};const gt=De("AsyncFunction"),yt=(bt="function"==typeof setImmediate,wt=Je(ct.postMessage),bt?setImmediate:wt?(vt=`axios@${Math.random()}`,Et=[],ct.addEventListener("message",({source:e,data:t})=>{e===ct&&t===vt&&Et.length&&Et.shift()()},!1),e=>{Et.push(e),ct.postMessage(vt,"*")}):e=>setTimeout(e));var bt,wt,vt,Et;const _t="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ct):"undefined"!=typeof process&&process.nextTick||yt;var kt={isArray:ze,isArrayBuffer:We,isBuffer:Ve,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Je(e.append)&&("formdata"===(t=qe(e))||"object"===t&&Je(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&We(e.buffer),t},isString:Ke,isNumber:$e,isBoolean:e=>!0===e||!1===e,isObject:Ge,isPlainObject:Ye,isEmptyObject:e=>{if(!Ge(e)||Ve(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:nt,isRequest:rt,isResponse:st,isHeaders:ot,isUndefined:He,isDate:Xe,isFile:Qe,isBlob:Ze,isRegExp:ft,isFunction:Je,isStream:e=>Ge(e)&&Je(e.pipe),isURLSearchParams:tt,isTypedArray:ut,isFileList:et,forEach:it,merge:function e(){const{caseless:t,skipUndefined:n}=lt(this)&&this||{},r={},s=(s,o)=>{const i=t&&at(r,o)||o;Ye(r[i])&&Ye(s)?r[i]=e(r[i],s):Ye(s)?r[i]=e({},s):ze(s)?r[i]=s.slice():n&&He(s)||(r[i]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&it(arguments[e],s);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(it(t,(t,r)=>{n&&Je(t)?e[r]=Le(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&Ue(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:qe,kindOfTest:De,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(ze(e))return e;let t=e.length;if(!$e(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ie]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.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:dt,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:mt,freezeMethods:e=>{mt(e,(t,n)=>{if(Je(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Je(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 ze(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:at,global:ct,isContextDefined:lt,isSpecCompliantForm:function(e){return!!(e&&Je(e.append)&&"FormData"===e[Fe]&&e[Ie])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Ge(e)){if(t.indexOf(e)>=0)return;if(Ve(e))return e;if(!("toJSON"in e)){t[r]=e;const s=ze(e)?[]:{};return it(e,(e,t)=>{const o=n(e,r+1);!He(o)&&(s[t]=o)}),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:gt,isThenable:e=>e&&(Ge(e)||Je(e))&&Je(e.then)&&Je(e.catch),setImmediate:yt,asap:_t,isIterable:e=>null!=e&&Je(e[Ie])};function xt(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}kt.inherits(xt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:kt.toJSONObject(this.config),code:this.code,status:this.status}}});const Ot=xt.prototype,St={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{St[e]={value:e}}),Object.defineProperties(xt,St),Object.defineProperty(Ot,"isAxiosError",{value:!0}),xt.from=(e,t,n,r,s,o)=>{const i=Object.create(Ot);kt.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return xt.call(i,a,c,n,r,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function Rt(e){return kt.isPlainObject(e)||kt.isArray(e)}function Tt(e){return kt.endsWith(e,"[]")?e.slice(0,-2):e}function At(e,t,n){return e?e.concat(t).map(function(e,t){return e=Tt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ct=kt.toFlatObject(kt,{},null,function(e){return/^is[A-Z]/.test(e)});function Nt(e,t,n){if(!kt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=kt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!kt.isUndefined(t[e])})).metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&kt.isSpecCompliantForm(t);if(!kt.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(kt.isDate(e))return e.toISOString();if(kt.isBoolean(e))return e.toString();if(!a&&kt.isBlob(e))throw new xt("Blob is not supported. Use a Buffer instead.");return kt.isArrayBuffer(e)||kt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,s){let a=e;if(e&&!s&&"object"==typeof e)if(kt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(kt.isArray(e)&&function(e){return kt.isArray(e)&&!e.some(Rt)}(e)||(kt.isFileList(e)||kt.endsWith(n,"[]"))&&(a=kt.toArray(e)))return n=Tt(n),a.forEach(function(e,r){!kt.isUndefined(e)&&null!==e&&t.append(!0===i?At([n],r,o):null===i?n:n+"[]",c(e))}),!1;return!!Rt(e)||(t.append(At(s,n,o),c(e)),!1)}const u=[],h=Object.assign(Ct,{defaultVisitor:l,convertValue:c,isVisitable:Rt});if(!kt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!kt.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),kt.forEach(n,function(n,o){!0===(!(kt.isUndefined(n)||null===n)&&s.call(t,n,kt.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o])}),u.pop()}}(e),t}function Bt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function jt(e,t){this._pairs=[],e&&Nt(e,this,t)}const Lt=jt.prototype;function Pt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ut(e,t,n){if(!t)return e;const r=n&&n.encode||Pt;kt.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(o=s?s(t,n):kt.isURLSearchParams(t)?t.toString():new jt(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Lt.append=function(e,t){this._pairs.push([e,t])},Lt.toString=function(e){const t=e?function(t){return e.call(this,t,Bt)}:Bt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class It{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){kt.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Ft={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:jt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Dt="undefined"!=typeof window&&"undefined"!=typeof document,Mt="object"==typeof navigator&&navigator||void 0,zt=Dt&&(!Mt||["ReactNative","NativeScript","NS"].indexOf(Mt.product)<0),Ht="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Vt=Dt&&window.location.href||"http://localhost";var Wt={...Object.freeze({__proto__:null,hasBrowserEnv:Dt,hasStandardBrowserEnv:zt,hasStandardBrowserWebWorkerEnv:Ht,navigator:Mt,origin:Vt}),...qt};function Kt(e){function t(e,n,r,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;if(o=!o&&kt.isArray(r)?r.length:o,a)return kt.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i;r[o]&&kt.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],s)&&kt.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}(r[o])),!i}if(kt.isFormData(e)&&kt.isFunction(e.entries)){const n={};return kt.forEachEntry(e,(e,r)=>{t(function(e){return kt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Jt={transitional:Ft,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=kt.isObject(e);s&&kt.isHTMLForm(e)&&(e=new FormData(e));if(kt.isFormData(e))return r?JSON.stringify(Kt(e)):e;if(kt.isArrayBuffer(e)||kt.isBuffer(e)||kt.isStream(e)||kt.isFile(e)||kt.isBlob(e)||kt.isReadableStream(e))return e;if(kt.isArrayBufferView(e))return e.buffer;if(kt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Nt(e,new Wt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Wt.isNode&&kt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=kt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Nt(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(kt.isString(e))try{return(t||JSON.parse)(e),kt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Jt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(kt.isResponse(e)||kt.isReadableStream(e))return e;if(e&&kt.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 xt.from(e,xt.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:Wt.classes.FormData,Blob:Wt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};kt.forEach(["delete","get","head","post","put","patch"],e=>{Jt.headers[e]={}});const $t=kt.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 Gt=Symbol("internals");function Yt(e){return e&&String(e).trim().toLowerCase()}function Xt(e){return!1===e||null==e?e:kt.isArray(e)?e.map(Xt):String(e)}function Qt(e,t,n,r,s){return kt.isFunction(r)?r.call(this,t,n):(s&&(t=n),kt.isString(t)?kt.isString(r)?-1!==t.indexOf(r):kt.isRegExp(r)?r.test(t):void 0:void 0)}let Zt=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=Yt(t);if(!s)throw new Error("header name must be a non-empty string");const o=kt.findKey(r,s);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Xt(e))}const o=(e,t)=>kt.forEach(e,(e,n)=>s(e,n,t));if(kt.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(kt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&$t[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(kt.isObject(e)&&kt.isIterable(e)){let n,r,s={};for(const t of e){if(!kt.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?kt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=Yt(e)){const n=kt.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(kt.isFunction(t))return t.call(this,e,n);if(kt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Yt(e)){const n=kt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Qt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=Yt(e)){const s=kt.findKey(n,e);!s||t&&!Qt(0,n[s],s,t)||(delete n[s],r=!0)}}return kt.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!Qt(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return kt.forEach(this,(r,s)=>{const o=kt.findKey(n,s);if(o)return t[o]=Xt(r),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(s):String(s).trim();i!==s&&delete t[s],t[i]=Xt(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return kt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&kt.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[Gt]=this[Gt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Yt(e);t[r]||(!function(e,t){const n=kt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})})}(n,e),t[r]=!0)}return kt.isArray(e)?e.forEach(r):r(e),this}};function en(e,t){const n=this||Jt,r=t||n,s=Zt.from(r.headers);let o=r.data;return kt.forEach(e,function(e){o=e.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function tn(e){return!(!e||!e.__CANCEL__)}function nn(e,t,n){xt.call(this,null==e?"canceled":e,xt.ERR_CANCELED,t,n),this.name="CanceledError"}function rn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new xt("Request failed with status code "+n.status,[xt.ERR_BAD_REQUEST,xt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),kt.reduceDescriptors(Zt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),kt.freezeMethods(Zt),kt.inherits(nn,xt,{__CANCEL__:!0});const sn=(e,t,n=3)=>{let r=0;const s=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];s||(s=c),n[o]=a,r[o]=c;let u=i,h=0;for(;u!==o;)h+=n[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const d=l&&c-l;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let n,r,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},o-a)))},()=>n&&i(n)]}(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,a=o-r,c=s(a);r=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},on=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},an=e=>(...t)=>kt.asap(()=>e(...t));var cn=Wt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Wt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Wt.origin),Wt.navigator&&/(msie|trident)/i.test(Wt.navigator.userAgent)):()=>!0,ln=Wt.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];kt.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),kt.isString(r)&&a.push(`path=${r}`),kt.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),kt.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 un(e,t,n){let r=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const hn=e=>e instanceof Zt?{...e}:e;function dn(e,t){t=t||{};const n={};function r(e,t,n,r){return kt.isPlainObject(e)&&kt.isPlainObject(t)?kt.merge.call({caseless:r},e,t):kt.isPlainObject(t)?kt.merge({},t):kt.isArray(t)?t.slice():t}function s(e,t,n,s){return kt.isUndefined(t)?kt.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function o(e,t){if(!kt.isUndefined(t))return r(void 0,t)}function i(e,t){return kt.isUndefined(t)?kt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,s,o){return o in t?r(n,s):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>s(hn(e),hn(t),0,!0)};return kt.forEach(Object.keys({...e,...t}),function(r){const o=c[r]||s,i=o(e[r],t[r],r);kt.isUndefined(i)&&o!==a||(n[r]=i)}),n}var pn=e=>{const t=dn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=Zt.from(i),t.url=Ut(un(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),kt.isFormData(n))if(Wt.hasStandardBrowserEnv||Wt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(kt.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(Wt.hasStandardBrowserEnv&&(r&&kt.isFunction(r)&&(r=r(t)),r||!1!==r&&cn(t.url))){const e=s&&o&&ln.read(o);e&&i.set(s,e)}return t};var fn="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=pn(e);let s=r.data;const o=Zt.from(r.headers).normalize();let i,a,c,l,u,{responseType:h,onUploadProgress:d,onDownloadProgress:p}=r;function f(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Zt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());rn(function(e){t(e),f()},function(e){n(e),f()},{data:h&&"text"!==h&&"json"!==h?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=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new xt("Request aborted",xt.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new xt(t&&t.message?t.message:"Network Error",xt.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||Ft;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new xt(t,s.clarifyTimeoutError?xt.ETIMEDOUT:xt.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&kt.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),kt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),p&&([c,u]=sn(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=sn(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new nn(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 y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Wt.protocols.indexOf(y)?n(new xt("Unsupported protocol "+y+":",xt.ERR_BAD_REQUEST,e)):m.send(s||null)})};const mn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof xt?t:new nn(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new xt(`timeout ${t} of ms exceeded`,xt.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>kt.asap(i),a}},gn=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},yn=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()}},bn=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of yn(e))yield*gn(n,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=i+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:wn}=kt,vn=(({Request:e,Response:t})=>({Request:e,Response:t}))(kt.global),{ReadableStream:En,TextEncoder:_n}=kt.global,kn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},xn=e=>{e=kt.merge.call({skipUndefined:!0},vn,e);const{fetch:t,Request:n,Response:r}=e,s=t?wn(t):"function"==typeof fetch,o=wn(n),i=wn(r);if(!s)return!1;const a=s&&wn(En),c=s&&("function"==typeof _n?(l=new _n,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=o&&a&&kn(()=>{let e=!1;const t=new n(Wt.origin,{body:new En,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=i&&a&&kn(()=>kt.isReadableStream(new r("").body)),d={stream:h&&(e=>e.body)};s&&["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 xt(`Response type '${e}' is not supported`,xt.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const r=kt.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(kt.isBlob(e))return e.size;if(kt.isSpecCompliantForm(e)){const t=new n(Wt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return kt.isArrayBufferView(e)||kt.isArrayBuffer(e)?e.byteLength:(kt.isURLSearchParams(e)&&(e+=""),kt.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:l,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:b,withCredentials:w="same-origin",fetchOptions:v}=pn(e),E=t||fetch;y=y?(y+"").toLowerCase():"text";let _=mn([c,l&&l.toAbortSignal()],f),k=null;const x=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let O;try{if(g&&u&&"get"!==i&&"head"!==i&&0!==(O=await p(b,a))){let e,t=new n(s,{method:"POST",body:a,duplex:"half"});if(kt.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=on(O,sn(an(g)));a=bn(t.body,65536,e,n)}}kt.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype,c={...v,signal:_,method:i.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};k=o&&new n(s,c);let l=await(o?E(k,v):E(s,c));const f=h&&("stream"===y||"response"===y);if(h&&(m||f&&x)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=kt.toFiniteNumber(l.headers.get("content-length")),[n,s]=m&&on(t,sn(an(m),!0))||[];l=new r(bn(l.body,65536,n,()=>{s&&s(),x&&x()}),e)}y=y||"text";let S=await d[kt.findKey(d,y)||"text"](l,e);return!f&&x&&x(),await new Promise((t,n)=>{rn(t,n,{data:S,headers:Zt.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:k})})}catch(t){if(x&&x(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new xt("Network Error",xt.ERR_NETWORK,e,k),{cause:t.cause||t});throw xt.from(t,t&&t.code,e,k)}}},On=new Map,Sn=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i,a,c=o.length,l=On;for(;c--;)i=o[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:xn(t)),l=a;return a};Sn();const Rn={http:null,xhr:fn,fetch:{get:Sn}};kt.forEach(Rn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Tn=e=>`- ${e}`,An=e=>kt.isFunction(e)||null===e||!1===e;var Cn={getAdapter:function(e,t){e=kt.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){let n;if(r=e[i],s=r,!An(r)&&(s=Rn[(n=String(r)).toLowerCase()],void 0===s))throw new xt(`Unknown adapter '${n}'`);if(s&&(kt.isFunction(s)||(s=s.get(t))))break;o[n||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new xt("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Tn).join("\n"):" "+Tn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:Rn};function Nn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nn(null,e)}function Bn(e){Nn(e),e.headers=Zt.from(e.headers),e.data=en.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Cn.getAdapter(e.adapter||Jt.adapter,e)(e).then(function(t){return Nn(e),t.data=en.call(e,e.transformResponse,t),t.headers=Zt.from(t.headers),t},function(t){return tn(t)||(Nn(e),t&&t.response&&(t.response.data=en.call(e,e.transformResponse,t.response),t.response.headers=Zt.from(t.response.headers))),Promise.reject(t)})}const jn="1.13.2",Ln={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ln[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Pn={};Ln.transitional=function(e,t,n){function r(e,t){return"[Axios v"+jn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,o)=>{if(!1===e)throw new xt(r(s," has been removed"+(t?" in "+t:"")),xt.ERR_DEPRECATED);return t&&!Pn[s]&&(Pn[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,o)}},Ln.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Un={assertOptions:function(e,t,n){if("object"!=typeof e)throw new xt("options must be an object",xt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const t=e[o],n=void 0===t||i(t,o,e);if(!0!==n)throw new xt("option "+o+" must be "+n,xt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new xt("Unknown option "+o,xt.ERR_BAD_OPTION)}},validators:Ln};const In=Un.validators;let Fn=class{constructor(e){this.defaults=e||{},this.interceptors={request:new It,response:new It}}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=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=dn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&Un.assertOptions(n,{silentJSONParsing:In.transitional(In.boolean),forcedJSONParsing:In.transitional(In.boolean),clarifyTimeoutError:In.transitional(In.boolean)},!1),null!=r&&(kt.isFunction(r)?t.paramsSerializer={serialize:r}:Un.assertOptions(r,{encode:In.function,serialize:In.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Un.assertOptions(t,{baseUrl:In.spelling("baseURL"),withXsrfToken:In.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&kt.merge(s.common,s[t.method]);s&&kt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=Zt.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,h=0;if(!a){const e=[Bn.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);h<u;)l=l.then(e[h++],e[h++]);return l}u=i.length;let d=t;for(;h<u;){const e=i[h++],t=i[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Bn.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,u=c.length;h<u;)l=l.then(c[h++],c[h++]);return l}getUri(e){return Ut(un((e=dn(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};kt.forEach(["delete","get","head","options"],function(e){Fn.prototype[e]=function(t,n){return this.request(dn(n||{},{method:e,url:t,data:(n||{}).data}))}}),kt.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,s){return this.request(dn(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Fn.prototype[e]=t(),Fn.prototype[e+"Form"]=t(!0)});const qn={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(qn).forEach(([e,t])=>{qn[t]=e});const Dn=function e(t){const n=new Fn(t),r=Le(Fn.prototype.request,n);return kt.extend(r,Fn.prototype,n,{allOwnKeys:!0}),kt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(dn(t,n))},r}(Jt);Dn.Axios=Fn,Dn.CanceledError=nn,Dn.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,s){n.reason||(n.reason=new nn(e,r,s),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}}},Dn.isCancel=tn,Dn.VERSION=jn,Dn.toFormData=Nt,Dn.AxiosError=xt,Dn.Cancel=Dn.CanceledError,Dn.all=function(e){return Promise.all(e)},Dn.spread=function(e){return function(t){return e.apply(null,t)}},Dn.isAxiosError=function(e){return kt.isObject(e)&&!0===e.isAxiosError},Dn.mergeConfig=dn,Dn.AxiosHeaders=Zt,Dn.formToJSON=e=>Kt(kt.isHTMLForm(e)?new FormData(e):e),Dn.getAdapter=Cn.getAdapter,Dn.HttpStatusCode=qn,Dn.default=Dn;const{Axios:Mn,AxiosError:zn,CanceledError:Hn,isCancel:Vn,CancelToken:Wn,VERSION:Kn,all:Jn,Cancel:$n,isAxiosError:Gn,spread:Yn,toFormData:Xn,AxiosHeaders:Qn,HttpStatusCode:Zn,formToJSON:er,getAdapter:tr,mergeConfig:nr}=Dn;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(".crm-widget-container{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.crm-chat-button{align-items:center;border:none;border-radius:50%;box-shadow:0 10px 25px rgba(0,0,0,.2);color:#fff;cursor:pointer;display:flex;font-size:24px;height:64px;justify-content:center;position:fixed;transition:all .2s;width:64px}.crm-chat-button:hover{transform:scale(1.1)}.crm-icon{height:32px;width:32px}.crm-icon-sm{height:24px;width:24px}.crm-spin{animation:crm-spin 1s linear infinite}@keyframes crm-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.crm-badge{align-items:center;background-color:#ef4444;border-radius:50%;color:#fff;display:flex;font-size:12px;font-weight:600;height:20px;justify-content:center;position:absolute;right:-4px;top:-4px;width:20px}.crm-bottom-6{bottom:24px}.crm-right-6{right:24px}.crm-left-6{left:24px}.crm-top-6{top:24px}.crm-chat-window{background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.3);display:flex;flex-direction:column;height:600px;max-width:448px;overflow:hidden;position:fixed;width:100%}.crm-chat-window.crm-dark{background:#1f2937;border-color:#374151}.crm-chat-window.crm-bottom-6{bottom:100px}.crm-chat-window.crm-right-6{right:24px}.crm-chat-window.crm-left-6{left:24px}.crm-chat-window.crm-top-6{top:100px}@media (max-width:640px){.crm-chat-window{border-radius:0;bottom:0!important;height:100vh;left:0!important;max-width:100%;right:0!important;top:0!important}}.crm-header{align-items:center;color:#fff;display:flex;justify-content:space-between;padding:16px 24px}.crm-header-content{align-items:center;display:flex;gap:12px}.crm-avatar{align-items:center;background:#fff;border-radius:50%;display:flex;font-size:20px;height:40px;justify-content:center;width:40px}.crm-title{font-size:18px;font-weight:600;margin:0}.crm-status{align-items:center;display:flex;font-size:14px;gap:8px;opacity:.9}.crm-status-dot{border-radius:50%;height:8px;width:8px}.crm-status-dot.crm-online{background-color:#10b981}.crm-status-dot.crm-offline{background-color:#ef4444}.crm-close-btn{background:hsla(0,0%,100%,.2);border:none;border-radius:50%;color:#fff;cursor:pointer;padding:8px;transition:background .2s}.crm-close-btn:hover{background:hsla(0,0%,100%,.3)}.crm-new-query-btn{align-items:center;background:hsla(0,0%,100%,.2);border:none;border-radius:50%;color:#fff;cursor:pointer;display:flex;justify-content:center;padding:8px;transition:all .2s}.crm-new-query-btn:hover{background:hsla(0,0%,100%,.3);transform:scale(1.05)}.crm-messages{background:#f9fafb;display:flex;flex:1;flex-direction:column;gap:16px;overflow-y:auto;padding:16px}.crm-dark .crm-messages{background:#111827}.crm-welcome-message{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.1);padding:16px}.crm-dark .crm-welcome-message{background:#1f2937;border-color:#374151;color:#d1d5db}.crm-welcome-message p{color:#374151;font-size:14px;margin:0}.crm-dark .crm-welcome-message p{color:#d1d5db}.crm-message{display:flex}.crm-message-guest{justify-content:flex-end}.crm-message-agent{justify-content:flex-start}.crm-message-system{justify-content:center}.crm-message-bubble{border-radius:16px;box-shadow:0 1px 2px rgba(0,0,0,.1);max-width:75%;padding:10px 16px}.crm-message-guest .crm-message-bubble{border-bottom-right-radius:4px;color:#fff}.crm-message-agent .crm-message-bubble{background:#fff;border:1px solid #e5e7eb;border-bottom-left-radius:4px;color:#1f2937}.crm-dark .crm-message-agent .crm-message-bubble{background:#1f2937;border-color:#374151;color:#f3f4f6}.crm-agent-name{font-size:12px;font-weight:500;margin:0 0 4px;opacity:.7}.crm-message-text{font-size:14px;line-height:1.5;margin:0;white-space:pre-wrap;word-break:break-word}.crm-message-time{font-size:11px;margin:4px 0 0;opacity:.7}.crm-typing-indicator{display:flex;gap:4px;padding:4px 0}.crm-typing-dot{animation:typing 1.4s infinite;background:#9ca3af;border-radius:50%;height:8px;width:8px}.crm-typing-dot:nth-child(2){animation-delay:.2s}.crm-typing-dot:nth-child(3){animation-delay:.4s}@keyframes typing{0%,60%,to{transform:translateY(0)}30%{transform:translateY(-10px)}}.crm-input-container{background:#fff;border-top:1px solid #e5e7eb;padding:16px}.crm-dark .crm-input-container{background:#1f2937;border-color:#374151}.crm-input-wrapper{align-items:flex-end;display:flex;gap:8px}.crm-input{background:#f9fafb;border:1px solid #d1d5db;border-radius:12px;color:#1f2937;flex:1;font-family:inherit;font-size:14px;max-height:120px;min-height:48px;padding:12px 16px;resize:none}.crm-input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.1);outline:none}.crm-input:disabled{cursor:not-allowed;opacity:.5}.crm-dark .crm-input{background:#111827;border-color:#4b5563;color:#f3f4f6}.crm-dark .crm-input::placeholder{color:#6b7280}.crm-send-btn{align-items:center;border:none;border-radius:12px;color:#fff;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;padding:12px;transition:all .2s}.crm-send-btn:hover:not(:disabled){box-shadow:0 4px 12px rgba(0,0,0,.2)}.crm-send-btn:disabled{cursor:not-allowed;opacity:.5}.crm-input-hint{color:#9ca3af;font-size:11px;margin:8px 0 0;text-align:center}.crm-dark .crm-input-hint{color:#6b7280}.crm-messages::-webkit-scrollbar{width:6px}.crm-messages::-webkit-scrollbar-track{background:transparent}.crm-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.crm-dark .crm-messages::-webkit-scrollbar-thumb{background:#4b5563}.crm-messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}");var rr=function(s){var o=s.apiKey,c=s.apiUrl,h=void 0===c?"https://chat-crm-backend-7mzo.onrender.com":c,d=s.primaryColor,p=void 0===d?"#4F46E5":d,f=s.position,m=void 0===f?"bottom-right":f,g=s.userData,y=void 0===g?null:g,b=s.welcomeMessage,w=void 0===b?"π Welcome! How can we help you today?":b,v=s.companyName,E=void 0===v?"Support":v,_=s.autoOpen,k=void 0!==_&&_,x=s.showNotifications,O=void 0===x||x,S=s.playSound,R=void 0!==S&&S,T=s.theme,A=void 0===T?"light":T,C=s.zIndex,N=void 0===C?9999:C,B=l(t(k),2),j=B[0],L=B[1],P=l(t([]),2),U=P[0],I=P[1],F=l(t(""),2),q=F[0],D=F[1],M=l(t(null),2),z=M[0],H=M[1],V=l(t(null),2);V[0];var W=V[1],K=l(t(null),2),J=K[0],$=K[1],G=l(t(!1),2),Y=G[0],X=G[1],Q=l(t(!1),2),Z=Q[0],ee=Q[1],te=l(t(!1),2),ne=te[0],re=te[1],se=l(t(!1),2),oe=se[0],ie=se[1],ae=l(t("Support Agent"),2),ce=ae[0],le=ae[1],ue=l(t(0),2),he=ue[0],de=ue[1],pe=l(t(!1),2),fe=pe[0],me=pe[1],ge=l(t("active"),2),ye=ge[0],be=ge[1],we=n(null);r(function(){var e;null===(e=we.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[U]),r(function(){return function(){z&&z.disconnect()}},[z]);var ve=function(){return y?{name:y.name||"Guest User",email:y.email||null,phone:y.phone||null,userId:y.userId||null}:{name:localStorage.getItem("chatGuestName")||"Guest User",email:localStorage.getItem("chatGuestEmail")||null,phone:localStorage.getItem("chatGuestPhone")||null,userId:localStorage.getItem("chatUserId")||null}},Ee=function(){var e=i(a().m(function e(){var t,n,r,s,i,c,l;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=ve(),ee(!0),e.p=1,console.log("π Creating new conversation for first message..."),e.n=2,Dn.post("".concat(h,"/api/v1/webhook/guest-conversation"),{apiKey:o,guestName:t.name,guestEmail:t.email,guestPhone:t.phone,customUserId:t.userId});case 2:if(!(n=e.v).data.success){e.n=3;break}return r=n.data,s=r.conversationId,i=r.petitionId,c=r.queryId,W(c),$(s),me(!0),localStorage.setItem("chatGuestId",c),localStorage.setItem("chatConversationId",s),localStorage.setItem("chatPetitionId",i),console.log("β
Conversation created:",{petitionId:i,queryId:c}),e.a(2,{newConvId:s,petitionId:i});case 3:throw new Error("Failed to create conversation");case 4:throw e.p=4,l=e.v,console.error("β Create conversation error:",l),l;case 5:return e.p=5,ee(!1),e.f(5);case 6:return e.a(2)}},e,null,[[1,4,5,6]])}));return function(){return e.apply(this,arguments)}}(),_e=function(){var e=i(a().m(function e(t){var n,r;return a().w(function(e){for(;;)if(0===e.n)return n=t.convId,r=t.petitionId,re(!0),e.a(2,new Promise(function(e,t){try{var s=je("".concat(h,"/widget"),{query:{conversationId:n,petitionId:r,apiKey:o},transports:["websocket","polling"]});s.on("connect",function(){X(!0),re(!1),console.log("β
Connected to Chat CRM Widget Namespace"),e(s)}),s.on("connect_error",function(e){re(!1),console.error("β Socket connect_error:",(null==e?void 0:e.message)||e)}),s.on("error",function(e){console.error("β Socket error:",e)}),s.on("disconnect",function(){X(!1),console.log("β Disconnected from Chat CRM")}),s.on("new-message",function(e){console.log("π¨ Received new-message:",e);var t={message:e.message||e.text||"",sender:"agent",senderName:e.senderName||"Agent",timestamp:e.timestamp||new Date,read:!1};I(function(e){return[].concat(u(e),[t])}),ie(!1),!j&&O&&(de(function(e){return e+1}),R&&xe())}),s.on("query-resolved",function(e){console.log("β
Query resolved:",e),be("resolved"),I(function(e){return[].concat(u(e),[{message:'β
This query has been resolved by the agent. Click "New Query" to start a new conversation.',sender:"system",timestamp:new Date,read:!0}])})}),s.on("query-reopened",function(e){console.log("π Query reopened:",e),be("active")}),s.on("agent-typing",function(e){ie(!0),le(e.agentName||"Support Agent"),setTimeout(function(){return ie(!1)},3e3)}),H(s)}catch(e){re(!1),t(e)}}))},e)}));return function(t){return e.apply(this,arguments)}}(),ke=function(){var e=i(a().m(function e(){var t,n,r,s,o,i,c,l,h;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(q.trim()&&"resolved"!==ye){e.n=1;break}return e.a(2);case 1:if(t=ve(),n=q.trim(),r=Date.now(),I(function(e){return[].concat(u(e),[{message:n,sender:"guest",senderName:t.name||"Guest User",read:!0,timestamp:new Date,tempId:r}])}),D(""),e.p=2,s=localStorage.getItem("chatPetitionId"),o=J||localStorage.getItem("chatConversationId"),s&&o){e.n=4;break}return e.n=3,Ee();case 3:i=e.v,o=i.newConvId,s=i.petitionId;case 4:if((c=z)&&Y){e.n=6;break}return e.n=5,_e({convId:o,petitionId:s});case 5:c=e.v;case 6:l={conversationId:o,petitionId:s,message:n,senderName:t.name||"Guest User",senderType:"Customer",timestamp:new Date},console.log("π€ Sending message:",l),c.emit("widget-message",l),e.n=8;break;case 7:e.p=7,h=e.v,console.error("β Send message error:",h),I(function(e){return e.filter(function(e){return e.tempId!==r})}),alert("Failed to send message. Please try again.");case 8:return e.a(2)}},e,null,[[2,7]])}));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.value=800,t.type="sine",n.gain.value=.1,t.start(),setTimeout(function(){return t.stop()},200)},Oe=function(){var e={"bottom-right":"crm-bottom-6 crm-right-6","bottom-left":"crm-bottom-6 crm-left-6","top-right":"crm-top-6 crm-right-6","top-left":"crm-top-6 crm-left-6"};return e[m]||e["bottom-right"]},Se="dark"===A||"auto"===A&&window.matchMedia("(prefers-color-scheme: dark)").matches;return e.createElement("div",{className:"crm-widget-container",style:{zIndex:N}},e.createElement("button",{onClick:function(){L(!0),de(0)},className:"crm-chat-button ".concat(Oe()),style:{backgroundColor:p},"aria-label":"Open chat"},j?e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})):e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})),!j&&he>0&&e.createElement("span",{className:"crm-badge"},he)),j&&e.createElement("div",{className:"crm-chat-window ".concat(Oe()," ").concat(Se?"crm-dark":"")},e.createElement("div",{className:"crm-header",style:{backgroundColor:p}},e.createElement("div",{className:"crm-header-content"},e.createElement("div",{className:"crm-avatar"},"π¬"),e.createElement("div",null,e.createElement("h3",{className:"crm-title"},E),e.createElement("div",{className:"crm-status"},e.createElement("div",{className:"crm-status-dot ".concat(Y?"crm-online":"crm-offline")}),e.createElement("span",null,"resolved"===ye?e.createElement("span",{style:{color:"#10B981"}},"β Resolved"):Y?"Online":ne?"Connectingβ¦":"Ready")))),e.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"center"}},fe&&e.createElement("button",{onClick:function(){localStorage.removeItem("chatGuestId"),localStorage.removeItem("chatConversationId"),localStorage.removeItem("chatPetitionId"),z&&z.disconnect(),H(null),W(null),$(null),X(!1),me(!1),be("active"),I([]),D(""),console.log("π Starting new query...")},className:"crm-new-query-btn",title:"Start New Query"},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"}))),e.createElement("button",{onClick:function(){return L(!1)},className:"crm-close-btn"},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))))),e.createElement("div",{className:"crm-messages"},!fe&&0===U.length&&e.createElement("div",{className:"crm-welcome-message"},e.createElement("p",null,w),e.createElement("p",{style:{fontSize:"0.875rem",marginTop:"8px",opacity:.7}},"π Start typing to begin your conversation")),U.map(function(t,n){return e.createElement("div",{key:n,className:"crm-message ".concat("guest"===t.sender?"crm-message-guest":"system"===t.sender?"crm-message-system":"crm-message-agent")},e.createElement("div",{className:"crm-message-bubble",style:"guest"===t.sender?{backgroundColor:p}:"system"===t.sender?{backgroundColor:"#F3F4F6",color:"#374151",border:"1px solid #E5E7EB"}:{}},"agent"===t.sender&&e.createElement("p",{className:"crm-agent-name"},t.senderName||ce),e.createElement("p",{className:"crm-message-text"},t.message),e.createElement("p",{className:"crm-message-time"},(r=t.timestamp,new Date(r).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})))));var r}),oe&&e.createElement("div",{className:"crm-message crm-message-agent"},e.createElement("div",{className:"crm-message-bubble"},e.createElement("div",{className:"crm-typing-indicator"},e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"})))),e.createElement("div",{ref:we})),e.createElement("div",{className:"crm-input-container"},e.createElement("div",{className:"crm-input-wrapper"},e.createElement("textarea",{value:q,onChange:function(e){return D(e.target.value)},onKeyPress:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ke())},placeholder:"resolved"===ye?"Query is resolved. Start a new query to continue.":"Type your message...",rows:"1",className:"crm-input",disabled:"resolved"===ye}),e.createElement("button",{onClick:ke,disabled:!q.trim()||Z||"resolved"===ye,className:"crm-send-btn",style:{backgroundColor:p}},Z?e.createElement("svg",{className:"crm-icon-sm crm-spin",fill:"none",viewBox:"0 0 24 24"},e.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.createElement("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})):e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})))),e.createElement("p",{className:"crm-input-hint"},fe?"Press Enter to send β’ Shift+Enter for new line":"Send your first message to start conversation"))))};export{rr as ChatCRMWidget};
|
|
4
4
|
//# sourceMappingURL=index.esm.js.map
|