@ecodrix/erix-api 1.3.1 → 1.3.2
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/cli.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/ts/browser/index.global.js +1 -1
- package/dist/ts/browser/index.global.js.map +1 -1
- package/dist/ts/cjs/index.cjs +1 -1
- package/dist/ts/cjs/index.cjs.map +1 -1
- package/dist/ts/cjs/index.d.cts +4 -0
- package/dist/ts/esm/index.d.ts +4 -0
- package/dist/ts/esm/index.js +1 -1
- package/dist/ts/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
`,Zh=Es.encode(ft),ex=2,Pa=class{constructor(e,s){let{escapeName:i}=this.constructor,n=d.isString(s),a=`Content-Disposition: form-data; name="${i(e)}"${!n&&s.name?`; filename="${i(s.name)}"`:""}${ft}`;n?s=Es.encode(String(s).replace(/\r?\n|\r\n?/g,ft)):a+=`Content-Type: ${s.type||"application/octet-stream"}${ft}`,this.headers=Es.encode(a+ft),this.contentLength=n?s.byteLength:s.size,this.size=this.headers.byteLength+this.contentLength+ex,this.name=e,this.value=s}encode(){return je(this,null,function*(){yield this.headers;let{value:e}=this;d.isTypedArray(e)?yield e:yield*Me(Mi(e)),yield Zh})}static escapeName(e){return String(e).replace(/[\r\n"]/g,s=>({"\r":"%0D","\n":"%0A",'"':"%22"})[s])}},tx=(t,e,s)=>{let{tag:i="form-data-boundary",size:n=25,boundary:a=i+"-"+I.generateString(n,Qh)}=s||{};if(!d.isFormData(t))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let r=Es.encode("--"+a+ft),o=Es.encode("--"+a+"--"+ft),l=o.byteLength,u=Array.from(t.entries()).map(([m,f])=>{let g=new Pa(m,f);return l+=g.size,g});l+=r.byteLength*u.length,l=d.toFiniteNumber(l);let p={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(l)&&(p["Content-Length"]=l),e&&e(p),Dp.Readable.from((function(){return je(this,null,function*(){for(let m of u)yield r,yield*Me(m.encode());yield o})})())},jp=tx;var Ip=D(T("stream"),1),La=class extends Ip.default.Transform{__transform(e,s,i){this.push(e),i()}_transform(e,s,i){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,s)}this.__transform(e,s,i)}},Up=La;var sx=(t,e)=>d.isAsyncFn(t)?function(...s){let i=s.pop();t.apply(this,s).then(n=>{try{e?i(null,...e(n)):i(null,n)}catch(a){i(a)}},i)}:t,Fp=sx;function ix(t,e){t=t||10;let s=new Array(t),i=new Array(t),n=0,a=0,r;return e=e!==void 0?e:1e3,function(l){let u=Date.now(),p=i[a];r||(r=u),s[n]=l,i[n]=u;let m=a,f=0;for(;m!==n;)f+=s[m++],m=m%t;if(n=(n+1)%t,n===a&&(a=(a+1)%t),u-r<e)return;let g=p&&u-p;return g?Math.round(f*1e3/g):void 0}}var Mp=ix;function nx(t,e){let s=0,i=1e3/e,n,a,r=(u,p=Date.now())=>{s=p,n=null,a&&(clearTimeout(a),a=null),t(...u)};return[(...u)=>{let p=Date.now(),m=p-s;m>=i?r(u,p):(n=u,a||(a=setTimeout(()=>{a=null,r(n)},i-m)))},()=>n&&r(n)]}var zp=nx;var ze=(t,e,s=3)=>{let i=0,n=Mp(50,250);return zp(a=>{let r=a.loaded,o=a.lengthComputable?a.total:void 0,l=r-i,u=n(l),p=r<=o;i=r;let m={loaded:r,total:o,progress:o?r/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o&&p?(o-r)/u:void 0,event:a,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(m)},s)},It=(t,e)=>{let s=t!=null;return[i=>e[0]({lengthComputable:s,total:t,loaded:i}),e[1]]},Ut=t=>(...e)=>d.asap(()=>t(...e));function Na(t){if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;let e=t.indexOf(",");if(e<0)return 0;let s=t.slice(5,e),i=t.slice(e+1);if(/;base64/i.test(s)){let a=i.length,r=i.length;for(let f=0;f<r;f++)if(i.charCodeAt(f)===37&&f+2<r){let g=i.charCodeAt(f+1),h=i.charCodeAt(f+2);(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(a-=2,f+=2)}let o=0,l=r-1,u=f=>f>=2&&i.charCodeAt(f-2)===37&&i.charCodeAt(f-1)===51&&(i.charCodeAt(f)===68||i.charCodeAt(f)===100);l>=0&&(i.charCodeAt(l)===61?(o++,l--):u(l)&&(o++,l-=3)),o===1&&l>=0&&(i.charCodeAt(l)===61||u(l))&&o++;let m=Math.floor(a/4)*3-(o||0);return m>0?m:0}return Buffer.byteLength(i,"utf8")}var $p={flush:He.default.constants.Z_SYNC_FLUSH,finishFlush:He.default.constants.Z_SYNC_FLUSH},ax={flush:He.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:He.default.constants.BROTLI_OPERATION_FLUSH},Hp=d.isFunction(He.default.createBrotliDecompress),{http:rx,https:ox}=Yp.default,cx=/https:?/,Vp=I.protocols.map(t=>t+":"),Wp=(t,[e,s])=>(t.on("end",s).on("error",s),e),qa=class{constructor(){this.sessions=Object.create(null)}getSession(e,s){s=Object.assign({sessionTimeout:1e3},s);let i=this.sessions[e];if(i){let p=i.length;for(let m=0;m<p;m++){let[f,g]=i[m];if(!f.destroyed&&!f.closed&&Da.default.isDeepStrictEqual(g,s))return f}}let n=Ba.default.connect(e,s),a,r=()=>{if(a)return;a=!0;let p=i,m=p.length,f=m;for(;f--;)if(p[f][0]===n){m===1?delete this.sessions[e]:p.splice(f,1);return}},o=n.request,{sessionTimeout:l}=s;if(l!=null){let p,m=0;n.request=function(){let f=o.apply(this,arguments);return m++,p&&(clearTimeout(p),p=null),f.once("close",()=>{--m||(p=setTimeout(()=>{p=null,r()},l))}),f}}n.once("close",r);let u=[n,s];return i?i.push(u):i=this.sessions[e]=[u],n}},px=new qa;function lx(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function Zp(t,e,s){let i=e;if(!i&&i!==!1){let n=Kp.default.getProxyForUrl(s);n&&(i=new URL(n))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){if(!!(i.auth.username||i.auth.password))i.auth=(i.auth.username||"")+":"+(i.auth.password||"");else if(typeof i.auth=="object")throw new _("Invalid proxy authorization",_.ERR_BAD_OPTION,{proxy:i});let r=Buffer.from(i.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+r}t.headers.host=t.hostname+(t.port?":"+t.port:"");let n=i.hostname||i.host;t.hostname=n,t.host=n,t.port=i.port,t.path=s,i.protocol&&(t.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}t.beforeRedirects.proxy=function(a){Zp(a,e,a.href)}}var ux=typeof process!="undefined"&&d.kindOf(process)==="process",dx=t=>new Promise((e,s)=>{let i,n,a=(l,u)=>{n||(n=!0,i&&i(l,u))},r=l=>{a(l),e(l)},o=l=>{a(l,!0),s(l)};t(r,o,l=>i=l).catch(o)}),mx=({address:t,family:e})=>{if(!d.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},Gp=(t,e)=>mx(d.isObject(t)?t:{address:t,family:e}),fx={request(t,e){let s=t.protocol+"//"+t.hostname+":"+(t.port||(t.protocol==="https:"?443:80)),{http2Options:i,headers:n}=t,a=px.getSession(s,i),{HTTP2_HEADER_SCHEME:r,HTTP2_HEADER_METHOD:o,HTTP2_HEADER_PATH:l,HTTP2_HEADER_STATUS:u}=Ba.default.constants,p={[r]:t.protocol.replace(":",""),[o]:t.method,[l]:t.path};d.forEach(n,(f,g)=>{g.charAt(0)!==":"&&(p[g]=f)});let m=a.request(p);return m.once("response",f=>{let g=m;f=Object.assign({},f);let h=f[u];delete f[u],g.headers=f,g.statusCode=+h,e(g)}),m}},el=ux&&function(e){return dx(function(i,n,a){return c(this,null,function*(){let{data:r,lookup:o,family:l,httpVersion:u=1,http2Options:p}=e,{responseType:m,responseEncoding:f}=e,g=e.method.toUpperCase(),h,x=!1,y;if(u=+u,Number.isNaN(u))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(u!==1&&u!==2)throw TypeError(`Unsupported protocol version '${u}'`);let R=u===2;if(o){let A=Fp(o,S=>d.isArray(S)?S:[S]);o=(S,F,ne)=>{A(S,F,(N,Z,ae)=>{if(N)return ne(N);let ee=d.isArray(Z)?Z.map(Et=>Gp(Et)):[Gp(Z,ae)];F.all?ne(N,ee):ne(N,ee[0].address,ee[0].family)})}}let C=new Qp.EventEmitter;function v(A){try{C.emit("abort",!A||A.type?new ye(null,e,y):A)}catch(S){console.warn("emit error",S)}}C.once("abort",n);let E=()=>{e.cancelToken&&e.cancelToken.unsubscribe(v),e.signal&&e.signal.removeEventListener("abort",v),C.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(v),e.signal&&(e.signal.aborted?v():e.signal.addEventListener("abort",v))),a((A,S)=>{if(h=!0,S){x=!0,E();return}let{data:F}=A;if(F instanceof $e.default.Readable||F instanceof $e.default.Duplex){let ne=$e.default.finished(F,()=>{ne(),E()})}else E()});let U=pt(e.baseURL,e.url,e.allowAbsoluteUrls),P=new URL(U,I.hasBrowserEnv?I.origin:void 0),j=P.protocol||Vp[0];if(j==="data:"){if(e.maxContentLength>-1){let S=String(e.url||U||"");if(Na(S)>e.maxContentLength)return n(new _("maxContentLength size of "+e.maxContentLength+" exceeded",_.ERR_BAD_RESPONSE,e))}let A;if(g!=="GET")return Ie(i,n,{status:405,statusText:"method not allowed",headers:{},config:e});try{A=Ra(e.url,m==="blob",{Blob:e.env&&e.env.Blob})}catch(S){throw _.from(S,_.ERR_BAD_REQUEST,e)}return m==="text"?(A=A.toString(f),(!f||f==="utf8")&&(A=d.stripBOM(A))):m==="stream"&&(A=$e.default.Readable.from(A)),Ie(i,n,{data:A,status:200,statusText:"OK",headers:new W,config:e})}if(Vp.indexOf(j)===-1)return n(new _("Unsupported protocol "+j,_.ERR_BAD_REQUEST,e));let M=W.from(e.headers).normalize();M.set("User-Agent","axios/"+mt,!1);let{onUploadProgress:ce,onDownloadProgress:De}=e,Fe=e.maxRate,Re,K;if(d.isSpecCompliantForm(r)){let A=M.getContentType(/boundary=([-_\w\d]{10,70})/i);r=jp(r,S=>{M.set(S)},{tag:`axios-${mt}-boundary`,boundary:A&&A[1]||void 0})}else if(d.isFormData(r)&&d.isFunction(r.getHeaders)){if(M.set(r.getHeaders()),!M.hasContentLength())try{let A=yield Da.default.promisify(r.getLength).call(r);Number.isFinite(A)&&A>=0&&M.setContentLength(A)}catch(A){}}else if(d.isBlob(r)||d.isFile(r))r.size&&M.setContentType(r.type||"application/octet-stream"),M.setContentLength(r.size||0),r=$e.default.Readable.from(Mi(r));else if(r&&!d.isStream(r)){if(!Buffer.isBuffer(r))if(d.isArrayBuffer(r))r=Buffer.from(new Uint8Array(r));else if(d.isString(r))r=Buffer.from(r,"utf-8");else return n(new _("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",_.ERR_BAD_REQUEST,e));if(M.setContentLength(r.length,!1),e.maxBodyLength>-1&&r.length>e.maxBodyLength)return n(new _("Request body larger than maxBodyLength limit",_.ERR_BAD_REQUEST,e))}let ge=d.toFiniteNumber(M.getContentLength());d.isArray(Fe)?(Re=Fe[0],K=Fe[1]):Re=K=Fe,r&&(ce||Re)&&(d.isStream(r)||(r=$e.default.Readable.from(r,{objectMode:!1})),r=$e.default.pipeline([r,new Oa({maxRate:d.toFiniteNumber(Re)})],d.noop),ce&&r.on("progress",Wp(r,It(ge,ze(Ut(ce),!1,3)))));let Ee;if(e.auth){let A=e.auth.username||"",S=e.auth.password||"";Ee=A+":"+S}if(!Ee&&P.username){let A=P.username,S=P.password;Ee=A+":"+S}Ee&&M.delete("authorization");let J;try{J=ct(P.pathname+P.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(A){let S=new Error(A.message);return S.config=e,S.url=e.url,S.exists=!0,n(S)}M.set("Accept-Encoding","gzip, compress, deflate"+(Hp?", br":""),!1);let V={path:J,method:g,headers:M.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:Ee,protocol:j,family:l,beforeRedirect:lx,beforeRedirects:{},http2Options:p};!d.isUndefined(o)&&(V.lookup=o),e.socketPath?V.socketPath=e.socketPath:(V.hostname=P.hostname.startsWith("[")?P.hostname.slice(1,-1):P.hostname,V.port=P.port,Zp(V,e.proxy,j+"//"+P.hostname+(P.port?":"+P.port:"")+V.path));let X,Ze=cx.test(V.protocol);if(V.agent=Ze?e.httpsAgent:e.httpAgent,R?X=fx:e.transport?X=e.transport:e.maxRedirects===0?X=Ze?Xp.default:Jp.default:(e.maxRedirects&&(V.maxRedirects=e.maxRedirects),e.beforeRedirect&&(V.beforeRedirects.config=e.beforeRedirect),X=Ze?ox:rx),e.maxBodyLength>-1?V.maxBodyLength=e.maxBodyLength:V.maxBodyLength=1/0,e.insecureHTTPParser&&(V.insecureHTTPParser=e.insecureHTTPParser),y=X.request(V,function(S){if(y.destroyed)return;let F=[S],ne=d.toFiniteNumber(S.headers["content-length"]);if(De||K){let ee=new Oa({maxRate:d.toFiniteNumber(K)});De&&ee.on("progress",Wp(ee,It(ne,ze(Ut(De),!0,3)))),F.push(ee)}let N=S,Z=S.req||y;if(e.decompress!==!1&&S.headers["content-encoding"])switch((g==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":F.push(He.default.createUnzip($p)),delete S.headers["content-encoding"];break;case"deflate":F.push(new Up),F.push(He.default.createUnzip($p)),delete S.headers["content-encoding"];break;case"br":Hp&&(F.push(He.default.createBrotliDecompress(ax)),delete S.headers["content-encoding"])}N=F.length>1?$e.default.pipeline(F,d.noop):F[0];let ae={status:S.statusCode,statusText:S.statusMessage,headers:new W(S.headers),config:e,request:Z};if(m==="stream")ae.data=N,Ie(i,n,ae);else{let ee=[],Et=0;N.on("data",function(le){ee.push(le),Et+=le.length,e.maxContentLength>-1&&Et>e.maxContentLength&&(x=!0,N.destroy(),v(new _("maxContentLength size of "+e.maxContentLength+" exceeded",_.ERR_BAD_RESPONSE,e,Z)))}),N.on("aborted",function(){if(x)return;let le=new _("stream has been aborted",_.ERR_BAD_RESPONSE,e,Z);N.destroy(le),n(le)}),N.on("error",function(le){y.destroyed||n(_.from(le,null,e,Z))}),N.on("end",function(){try{let le=ee.length===1?ee[0]:Buffer.concat(ee);m!=="arraybuffer"&&(le=le.toString(f),(!f||f==="utf8")&&(le=d.stripBOM(le))),ae.data=le}catch(le){return n(_.from(le,null,e,ae.request,ae))}Ie(i,n,ae)})}C.once("abort",ee=>{N.destroyed||(N.emit("error",ee),N.destroy())})}),C.once("abort",A=>{y.close?y.close():y.destroy(A)}),y.on("error",function(S){n(_.from(S,null,e,y))}),y.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),e.timeout){let A=parseInt(e.timeout,10);if(Number.isNaN(A)){v(new _("error trying to parse `config.timeout` to int",_.ERR_BAD_OPTION_VALUE,e,y));return}y.setTimeout(A,function(){if(h)return;let F=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",ne=e.transitional||st;e.timeoutErrorMessage&&(F=e.timeoutErrorMessage),v(new _(F,ne.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,e,y))})}else y.setTimeout(0);if(d.isStream(r)){let A=!1,S=!1;r.on("end",()=>{A=!0}),r.once("error",F=>{S=!0,y.destroy(F)}),r.on("close",()=>{!A&&!S&&v(new ye("Request stream has been aborted",e,y))}),r.pipe(y)}else r&&y.write(r),y.end()})})};var tl=I.hasStandardBrowserEnv?((t,e)=>s=>(s=new URL(s,I.origin),t.protocol===s.protocol&&t.host===s.host&&(e||t.port===s.port)))(new URL(I.origin),I.navigator&&/(msie|trident)/i.test(I.navigator.userAgent)):()=>!0;var sl=I.hasStandardBrowserEnv?{write(t,e,s,i,n,a,r){if(typeof document=="undefined")return;let o=[`${t}=${encodeURIComponent(e)}`];d.isNumber(s)&&o.push(`expires=${new Date(s).toUTCString()}`),d.isString(i)&&o.push(`path=${i}`),d.isString(n)&&o.push(`domain=${n}`),a===!0&&o.push("secure"),d.isString(r)&&o.push(`SameSite=${r}`),document.cookie=o.join("; ")},read(t){if(typeof document=="undefined")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};var il=t=>t instanceof W?L({},t):t;function Le(t,e){e=e||{};let s={};function i(u,p,m,f){return d.isPlainObject(u)&&d.isPlainObject(p)?d.merge.call({caseless:f},u,p):d.isPlainObject(p)?d.merge({},p):d.isArray(p)?p.slice():p}function n(u,p,m,f){if(d.isUndefined(p)){if(!d.isUndefined(u))return i(void 0,u,m,f)}else return i(u,p,m,f)}function a(u,p){if(!d.isUndefined(p))return i(void 0,p)}function r(u,p){if(d.isUndefined(p)){if(!d.isUndefined(u))return i(void 0,u)}else return i(void 0,p)}function o(u,p,m){if(m in e)return i(u,p);if(m in t)return i(void 0,u)}let l={url:a,method:a,data:a,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:o,headers:(u,p,m)=>n(il(u),il(p),m,!0)};return d.forEach(Object.keys(L(L({},t),e)),function(p){if(p==="__proto__"||p==="constructor"||p==="prototype")return;let m=d.hasOwnProp(l,p)?l[p]:n,f=m(t[p],e[p],p);d.isUndefined(f)&&m!==o||(s[p]=f)}),s}var zi=t=>{let e=Le({},t),{data:s,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:a,headers:r,auth:o}=e;if(e.headers=r=W.from(r),e.url=ct(pt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),o&&r.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),d.isFormData(s)){if(I.hasStandardBrowserEnv||I.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(d.isFunction(s.getHeaders)){let l=s.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([p,m])=>{u.includes(p.toLowerCase())&&r.set(p,m)})}}if(I.hasStandardBrowserEnv&&(i&&d.isFunction(i)&&(i=i(e)),i||i!==!1&&tl(e.url))){let l=n&&a&&sl.read(a);l&&r.set(n,l)}return e};var hx=typeof XMLHttpRequest!="undefined",nl=hx&&function(t){return new Promise(function(s,i){let n=zi(t),a=n.data,r=W.from(n.headers).normalize(),{responseType:o,onUploadProgress:l,onDownloadProgress:u}=n,p,m,f,g,h;function x(){g&&g(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(p),n.signal&&n.signal.removeEventListener("abort",p)}let y=new XMLHttpRequest;y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout;function R(){if(!y)return;let v=W.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),U={data:!o||o==="text"||o==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:v,config:t,request:y};Ie(function(j){s(j),x()},function(j){i(j),x()},U),y=null}"onloadend"in y?y.onloadend=R:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(R)},y.onabort=function(){y&&(i(new _("Request aborted",_.ECONNABORTED,t,y)),y=null)},y.onerror=function(E){let U=E&&E.message?E.message:"Network Error",P=new _(U,_.ERR_NETWORK,t,y);P.event=E||null,i(P),y=null},y.ontimeout=function(){let E=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",U=n.transitional||st;n.timeoutErrorMessage&&(E=n.timeoutErrorMessage),i(new _(E,U.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,t,y)),y=null},a===void 0&&r.setContentType(null),"setRequestHeader"in y&&d.forEach(r.toJSON(),function(E,U){y.setRequestHeader(U,E)}),d.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),o&&o!=="json"&&(y.responseType=n.responseType),u&&([f,h]=ze(u,!0),y.addEventListener("progress",f)),l&&y.upload&&([m,g]=ze(l),y.upload.addEventListener("progress",m),y.upload.addEventListener("loadend",g)),(n.cancelToken||n.signal)&&(p=v=>{y&&(i(!v||v.type?new ye(null,t,y):v),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(p),n.signal&&(n.signal.aborted?p():n.signal.addEventListener("abort",p)));let C=ws(n.url);if(C&&I.protocols.indexOf(C)===-1){i(new _("Unsupported protocol "+C+":",_.ERR_BAD_REQUEST,t));return}y.send(a||null)})};var xx=(t,e)=>{let{length:s}=t=t?t.filter(Boolean):[];if(e||s){let i=new AbortController,n,a=function(u){if(!n){n=!0,o();let p=u instanceof Error?u:this.reason;i.abort(p instanceof _?p:new ye(p instanceof Error?p.message:p))}},r=e&&setTimeout(()=>{r=null,a(new _(`timeout of ${e}ms exceeded`,_.ETIMEDOUT))},e),o=()=>{t&&(r&&clearTimeout(r),r=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),t=null)};t.forEach(u=>u.addEventListener("abort",a));let{signal:l}=i;return l.unsubscribe=()=>d.asap(o),l}},al=xx;var gx=function*(t,e){let s=t.byteLength;if(!e||s<e){yield t;return}let i=0,n;for(;i<s;)n=i+e,yield t.slice(i,n),i=n},yx=function(t,e){return je(this,null,function*(){try{for(var s=Ur(vx(t)),i,n,a;i=!(n=yield new Ce(s.next())).done;i=!1){let r=n.value;yield*Me(gx(r,e))}}catch(n){a=[n]}finally{try{i&&(n=s.return)&&(yield new Ce(n.call(s)))}finally{if(a)throw a[0]}}})},vx=function(t){return je(this,null,function*(){if(t[Symbol.asyncIterator]){yield*Me(t);return}let e=t.getReader();try{for(;;){let{done:s,value:i}=yield new Ce(e.read());if(s)break;yield i}}finally{yield new Ce(e.cancel())}})},ja=(t,e,s,i)=>{let n=yx(t,e),a=0,r,o=u=>{r||(r=!0,i&&i(u))};return new ReadableStream({pull(u){return c(this,null,function*(){try{let{done:p,value:m}=yield n.next();if(p){o(),u.close();return}let f=m.byteLength;if(s){let g=a+=f;s(g)}u.enqueue(new Uint8Array(m))}catch(p){throw o(p),p}})},cancel(u){return o(u),n.return()}},{highWaterMark:2})};var rl=64*1024,{isFunction:$i}=d,bx=(({Request:t,Response:e})=>({Request:t,Response:e}))(d.global),{ReadableStream:ol,TextEncoder:cl}=d.global,pl=(t,...e)=>{try{return!!t(...e)}catch(s){return!1}},_x=t=>{t=d.merge.call({skipUndefined:!0},bx,t);let{fetch:e,Request:s,Response:i}=t,n=e?$i(e):typeof fetch=="function",a=$i(s),r=$i(i);if(!n)return!1;let o=n&&$i(ol),l=n&&(typeof cl=="function"?(h=>x=>h.encode(x))(new cl):h=>c(null,null,function*(){return new Uint8Array(yield new s(h).arrayBuffer())})),u=a&&o&&pl(()=>{let h=!1,x=new s(I.origin,{body:new ol,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!x}),p=r&&o&&pl(()=>d.isReadableStream(new i("").body)),m={stream:p&&(h=>h.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!m[h]&&(m[h]=(x,y)=>{let R=x&&x[h];if(R)return R.call(x);throw new _(`Response type '${h}' is not supported`,_.ERR_NOT_SUPPORT,y)})});let f=h=>c(null,null,function*(){if(h==null)return 0;if(d.isBlob(h))return h.size;if(d.isSpecCompliantForm(h))return(yield new s(I.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(d.isArrayBufferView(h)||d.isArrayBuffer(h))return h.byteLength;if(d.isURLSearchParams(h)&&(h=h+""),d.isString(h))return(yield l(h)).byteLength}),g=(h,x)=>c(null,null,function*(){let y=d.toFiniteNumber(h.getContentLength());return y==null?f(x):y});return h=>c(null,null,function*(){let{url:x,method:y,data:R,signal:C,cancelToken:v,timeout:E,onDownloadProgress:U,onUploadProgress:P,responseType:j,headers:M,withCredentials:ce="same-origin",fetchOptions:De}=zi(h),Fe=e||fetch;j=j?(j+"").toLowerCase():"text";let Re=al([C,v&&v.toAbortSignal()],E),K=null,ge=Re&&Re.unsubscribe&&(()=>{Re.unsubscribe()}),Ee;try{if(P&&u&&y!=="get"&&y!=="head"&&(Ee=yield g(M,R))!==0){let S=new s(x,{method:"POST",body:R,duplex:"half"}),F;if(d.isFormData(R)&&(F=S.headers.get("content-type"))&&M.setContentType(F),S.body){let[ne,N]=It(Ee,ze(Ut(P)));R=ja(S.body,rl,ne,N)}}d.isString(ce)||(ce=ce?"include":"omit");let J=a&&"credentials"in s.prototype,V=re(L({},De),{signal:Re,method:y.toUpperCase(),headers:M.normalize().toJSON(),body:R,duplex:"half",credentials:J?ce:void 0});K=a&&new s(x,V);let X=yield a?Fe(K,De):Fe(x,V),Ze=p&&(j==="stream"||j==="response");if(p&&(U||Ze&&ge)){let S={};["status","statusText","headers"].forEach(Z=>{S[Z]=X[Z]});let F=d.toFiniteNumber(X.headers.get("content-length")),[ne,N]=U&&It(F,ze(Ut(U),!0))||[];X=new i(ja(X.body,rl,ne,()=>{N&&N(),ge&&ge()}),S)}j=j||"text";let A=yield m[d.findKey(m,j)||"text"](X,h);return!Ze&&ge&&ge(),yield new Promise((S,F)=>{Ie(S,F,{data:A,headers:W.from(X.headers),status:X.status,statusText:X.statusText,config:h,request:K})})}catch(J){throw ge&&ge(),J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)?Object.assign(new _("Network Error",_.ERR_NETWORK,h,K,J&&J.response),{cause:J.cause||J}):_.from(J,J&&J.code,h,K,J&&J.response)}})},wx=new Map,Ia=t=>{let e=t&&t.env||{},{fetch:s,Request:i,Response:n}=e,a=[i,n,s],r=a.length,o=r,l,u,p=wx;for(;o--;)l=a[o],u=p.get(l),u===void 0&&p.set(l,u=o?new Map:_x(e)),p=u;return u},qw=Ia();var Ua={http:el,xhr:nl,fetch:{get:Ia}};d.forEach(Ua,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(s){}Object.defineProperty(t,"adapterName",{value:e})}});var ll=t=>`- ${t}`,Tx=t=>d.isFunction(t)||t===null||t===!1;function Sx(t,e){t=d.isArray(t)?t:[t];let{length:s}=t,i,n,a={};for(let r=0;r<s;r++){i=t[r];let o;if(n=i,!Tx(i)&&(n=Ua[(o=String(i)).toLowerCase()],n===void 0))throw new _(`Unknown adapter '${o}'`);if(n&&(d.isFunction(n)||(n=n.get(e))))break;a[o||"#"+r]=n}if(!n){let r=Object.entries(a).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build")),o=s?r.length>1?`since :
|
|
17
17
|
`+r.map(ll).join(`
|
|
18
18
|
`):" "+ll(r[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n}var Hi={getAdapter:Sx,adapters:Ua};function Fa(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ye(null,t)}function Vi(t){return Fa(t),t.headers=W.from(t.headers),t.data=xs.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Hi.getAdapter(t.adapter||Pt.adapter,t)(t).then(function(i){return Fa(t),i.data=xs.call(t,t.transformResponse,i),i.headers=W.from(i.headers),i},function(i){return gs(i)||(Fa(t),i&&i.response&&(i.response.data=xs.call(t,t.transformResponse,i.response),i.response.headers=W.from(i.response.headers))),Promise.reject(i)})}var Wi={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Wi[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var ul={};Wi.transitional=function(e,s,i){function n(a,r){return"[Axios v"+mt+"] Transitional option '"+a+"'"+r+(i?". "+i:"")}return(a,r,o)=>{if(e===!1)throw new _(n(r," has been removed"+(s?" in "+s:"")),_.ERR_DEPRECATED);return s&&!ul[r]&&(ul[r]=!0,console.warn(n(r," has been deprecated since v"+s+" and will be removed in the near future"))),e?e(a,r,o):!0}};Wi.spelling=function(e){return(s,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function kx(t,e,s){if(typeof t!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);let i=Object.keys(t),n=i.length;for(;n-- >0;){let a=i[n],r=e[a];if(r){let o=t[a],l=o===void 0||r(o,a,t);if(l!==!0)throw new _("option "+a+" must be "+l,_.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new _("Unknown option "+a,_.ERR_BAD_OPTION)}}var Ts={assertOptions:kx,validators:Wi};var Te=Ts.validators,Ft=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ta,response:new ta}}request(e,s){return c(this,null,function*(){try{return yield this._request(e,s)}catch(i){if(i instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;let a=n.stack?n.stack.replace(/^.+\n/,""):"";try{i.stack?a&&!String(i.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
|
19
|
-
`+a):i.stack=a}catch(r){}}throw i}})}_request(e,s){typeof e=="string"?(s=s||{},s.url=e):s=e||{},s=Le(this.defaults,s);let{transitional:i,paramsSerializer:n,headers:a}=s;i!==void 0&&Ts.assertOptions(i,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean),legacyInterceptorReqResOrdering:Te.transitional(Te.boolean)},!1),n!=null&&(d.isFunction(n)?s.paramsSerializer={serialize:n}:Ts.assertOptions(n,{encode:Te.function,serialize:Te.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),Ts.assertOptions(s,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let r=a&&d.merge(a.common,a[s.method]);a&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete a[h]}),s.headers=W.concat(r,a);let o=[],l=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(s)===!1)return;l=l&&x.synchronous;let y=s.transitional||st;y&&y.legacyInterceptorReqResOrdering?o.unshift(x.fulfilled,x.rejected):o.push(x.fulfilled,x.rejected)});let u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let p,m=0,f;if(!l){let h=[Vi.bind(this),void 0];for(h.unshift(...o),h.push(...u),f=h.length,p=Promise.resolve(s);m<f;)p=p.then(h[m++],h[m++]);return p}f=o.length;let g=s;for(;m<f;){let h=o[m++],x=o[m++];try{g=h(g)}catch(y){x.call(this,y);break}}try{p=Vi.call(this,g)}catch(h){return Promise.reject(h)}for(m=0,f=u.length;m<f;)p=p.then(u[m++],u[m++]);return p}getUri(e){e=Le(this.defaults,e);let s=pt(e.baseURL,e.url,e.allowAbsoluteUrls);return ct(s,e.params,e.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(e){Ft.prototype[e]=function(s,i){return this.request(Le(i||{},{method:e,url:s,data:(i||{}).data}))}});d.forEach(["post","put","patch"],function(e){function s(i){return function(a,r,o){return this.request(Le(o||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:a,data:r}))}}Ft.prototype[e]=s(),Ft.prototype[e+"Form"]=s(!0)});var Ss=Ft;var Ma=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(a){s=a});let i=this;this.promise.then(n=>{if(!i._listeners)return;let a=i._listeners.length;for(;a-- >0;)i._listeners[a](n);i._listeners=null}),this.promise.then=n=>{let a,r=new Promise(o=>{i.subscribe(o),a=o}).then(n);return r.cancel=function(){i.unsubscribe(a)},r},e(function(a,r,o){i.reason||(i.reason=new ye(a,r,o),s(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){let e=new AbortController,s=i=>{e.abort(i)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new t(function(n){e=n}),cancel:e}}},dl=Ma;function za(t){return function(s){return t.apply(null,s)}}function $a(t){return d.isObject(t)&&t.isAxiosError===!0}var Ha={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(Ha).forEach(([t,e])=>{Ha[e]=t});var ml=Ha;function fl(t){let e=new Ss(t),s=os(Ss.prototype.request,e);return d.extend(s,Ss.prototype,e,{allOwnKeys:!0}),d.extend(s,e,null,{allOwnKeys:!0}),s.create=function(n){return fl(Le(t,n))},s}var Y=fl(Pt);Y.Axios=Ss;Y.CanceledError=ye;Y.CancelToken=dl;Y.isCancel=gs;Y.VERSION=mt;Y.toFormData=tt;Y.AxiosError=_;Y.Cancel=Y.CanceledError;Y.all=function(e){return Promise.all(e)};Y.spread=za;Y.isAxiosError=$a;Y.mergeConfig=Le;Y.AxiosHeaders=W;Y.formToJSON=t=>Bi(d.isHTMLForm(t)?new FormData(t):t);Y.getAdapter=Hi.getAdapter;Y.HttpStatusCode=ml;Y.default=Y;var Mt=Y;var{Axios:NE,AxiosError:qE,CanceledError:BE,isCancel:DE,CancelToken:jE,VERSION:IE,all:UE,Cancel:FE,isAxiosError:ME,spread:zE,toFormData:$E,AxiosHeaders:HE,HttpStatusCode:VE,formToJSON:WE,getAdapter:GE,mergeConfig:KE}=Mt;var yl=D(xl(),1);var Va="axios-retry";function vl(t){let e=["ERR_CANCELED","ECONNABORTED"];return t.response||!t.code||e.includes(t.code)?!1:(0,yl.default)(t)}var bl=["get","head","options"],Cx=bl.concat(["put","delete"]);function Wa(t){return t.code!=="ECONNABORTED"&&(!t.response||t.response.status===429||t.response.status>=500&&t.response.status<=599)}function Ax(t){var e;return(e=t.config)!=null&&e.method?Wa(t)&&bl.indexOf(t.config.method)!==-1:!1}function _l(t){var e;return(e=t.config)!=null&&e.method?Wa(t)&&Cx.indexOf(t.config.method)!==-1:!1}function wl(t){return vl(t)||_l(t)}function Ga(t=void 0){var i;let e=(i=t==null?void 0:t.response)==null?void 0:i.headers["retry-after"];if(!e)return 0;let s=(Number(e)||0)*1e3;return s===0&&(s=(new Date(e).valueOf()||0)-Date.now()),Math.max(0,s)}function Ox(t=0,e=void 0){return Math.max(0,Ga(e))}function Px(t=0,e=void 0,s=100){let i=jr(2,t)*s,n=Math.max(i,Ga(e)),a=n*.2*Math.random();return n+a}function Lx(t=100){return(e=0,s=void 0)=>{let i=e*t;return Math.max(i,Ga(s))}}var Nx={retries:3,retryCondition:wl,retryDelay:Ox,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function qx(t,e){return L(L(L({},Nx),e),t[Va])}function gl(t,e,s=!1){let i=qx(t,e||{});return i.retryCount=i.retryCount||0,(!i.lastRequestTime||s)&&(i.lastRequestTime=Date.now()),t[Va]=i,i}function Bx(t,e){t.defaults.agent===e.agent&&delete e.agent,t.defaults.httpAgent===e.httpAgent&&delete e.httpAgent,t.defaults.httpsAgent===e.httpsAgent&&delete e.httpsAgent}function Dx(t,e){return c(this,null,function*(){let{retries:s,retryCondition:i}=t,n=(t.retryCount||0)<s&&i(e);if(typeof n=="object")try{return(yield n)!==!1}catch(a){return!1}return n})}function jx(t,e,s,i){return c(this,null,function*(){var l;e.retryCount+=1;let{retryDelay:n,shouldResetTimeout:a,onRetry:r}=e,o=n(e.retryCount,s);if(Bx(t,i),!a&&i.timeout&&e.lastRequestTime){let u=Date.now()-e.lastRequestTime,p=i.timeout-u-o;if(p<=0)return Promise.reject(s);i.timeout=p}return i.transformRequest=[u=>u],yield r(e.retryCount,s,i),(l=i.signal)!=null&&l.aborted?Promise.resolve(t(i)):new Promise(u=>{var f;let p=()=>{clearTimeout(m),u(t(i))},m=setTimeout(()=>{var g;u(t(i)),(g=i.signal)!=null&&g.removeEventListener&&i.signal.removeEventListener("abort",p)},o);(f=i.signal)!=null&&f.addEventListener&&i.signal.addEventListener("abort",p,{once:!0})})})}function Ix(t,e){return c(this,null,function*(){t.retryCount>=t.retries&&(yield t.onMaxRetryTimesExceeded(e,t.retryCount))})}var it=(t,e)=>{let s=t.interceptors.request.use(n=>{var a;return gl(n,e,!0),(a=n[Va])!=null&&a.validateResponse&&(n.validateStatus=()=>!1),n}),i=t.interceptors.response.use(null,n=>c(null,null,function*(){var o;let{config:a}=n;if(!a)return Promise.reject(n);let r=gl(a,e);return n.response&&((o=r.validateResponse)!=null&&o.call(r,n.response))?n.response:(yield Dx(r,n))?jx(t,r,n,a):(yield Ix(r,n),Promise.reject(n))}));return{requestInterceptorId:s,responseInterceptorId:i}};it.isNetworkError=vl;it.isSafeRequestError=Ax;it.isIdempotentRequestError=_l;it.isNetworkOrIdempotentRequestError=wl;it.exponentialDelay=Px;it.linearDelay=Lx;it.isRetryableError=Wa;var Gi=it;var er=D(Sl(),1);var Ne=Object.create(null);Ne.open="0";Ne.close="1";Ne.ping="2";Ne.pong="3";Ne.message="4";Ne.upgrade="5";Ne.noop="6";var ks=Object.create(null);Object.keys(Ne).forEach(t=>{ks[Ne[t]]=t});var Rs={type:"error",data:"parser error"};var Cs=({type:t,data:e},s,i)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?i(s?e:"b"+kl(e,!0).toString("base64")):i(Ne[t]+(e||"")),kl=(t,e)=>Buffer.isBuffer(t)||t instanceof Uint8Array&&!e?t:t instanceof ArrayBuffer?Buffer.from(t):Buffer.from(t.buffer,t.byteOffset,t.byteLength),Ja;function Rl(t,e){if(t.data instanceof ArrayBuffer||ArrayBuffer.isView(t.data))return e(kl(t.data,!1));Cs(t,!0,s=>{Ja||(Ja=new TextEncoder),e(Ja.encode(s))})}var As=(t,e)=>{if(typeof t!="string")return{type:"message",data:Cl(t,e)};let s=t.charAt(0);if(s==="b"){let i=Buffer.from(t.substring(1),"base64");return{type:"message",data:Cl(i,e)}}return ks[s]?t.length>1?{type:ks[s],data:t.substring(1)}:{type:ks[s]}:Rs},Cl=(t,e)=>{switch(e){case"arraybuffer":return t instanceof ArrayBuffer?t:Buffer.isBuffer(t)?t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):t.buffer;case"nodebuffer":default:return Buffer.isBuffer(t)?t:Buffer.from(t)}};var Al="",Ol=(t,e)=>{let s=t.length,i=new Array(s),n=0;t.forEach((a,r)=>{Cs(a,!1,o=>{i[r]=o,++n===s&&e(i.join(Al))})})},Pl=(t,e)=>{let s=t.split(Al),i=[];for(let n=0;n<s.length;n++){let a=As(s[n],e);if(i.push(a),a.type==="error")break}return i};function Ll(){return new TransformStream({transform(t,e){Rl(t,s=>{let i=s.length,n;if(i<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,i);else if(i<65536){n=new Uint8Array(3);let a=new DataView(n.buffer);a.setUint8(0,126),a.setUint16(1,i)}else{n=new Uint8Array(9);let a=new DataView(n.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(i))}t.data&&typeof t.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(s)})}})}var Xa;function Ki(t){return t.reduce((e,s)=>e+s.length,0)}function Ji(t,e){if(t[0].length===e)return t.shift();let s=new Uint8Array(e),i=0;for(let n=0;n<e;n++)s[n]=t[0][i++],i===t[0].length&&(t.shift(),i=0);return t.length&&i<t[0].length&&(t[0]=t[0].slice(i)),s}function Nl(t,e){Xa||(Xa=new TextDecoder);let s=[],i=0,n=-1,a=!1;return new TransformStream({transform(r,o){for(s.push(r);;){if(i===0){if(Ki(s)<1)break;let l=Ji(s,1);a=(l[0]&128)===128,n=l[0]&127,n<126?i=3:n===126?i=1:i=2}else if(i===1){if(Ki(s)<2)break;let l=Ji(s,2);n=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),i=3}else if(i===2){if(Ki(s)<8)break;let l=Ji(s,8),u=new DataView(l.buffer,l.byteOffset,l.length),p=u.getUint32(0);if(p>Math.pow(2,21)-1){o.enqueue(Rs);break}n=p*Math.pow(2,32)+u.getUint32(4),i=3}else{if(Ki(s)<n)break;let l=Ji(s,n);o.enqueue(As(a?l:Xa.decode(l),e)),i=0}if(n===0||n>t){o.enqueue(Rs);break}}}})}var Ya=4;function $(t){if(t)return Fx(t)}function Fx(t){for(var e in $.prototype)t[e]=$.prototype[e];return t}$.prototype.on=$.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};$.prototype.once=function(t,e){function s(){this.off(t,s),e.apply(this,arguments)}return s.fn=e,this.on(t,s),this};$.prototype.off=$.prototype.removeListener=$.prototype.removeAllListeners=$.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+t];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n<s.length;n++)if(i=s[n],i===e||i.fn===e){s.splice(n,1);break}return s.length===0&&delete this._callbacks["$"+t],this};$.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),s=this._callbacks["$"+t],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(s){s=s.slice(0);for(var i=0,n=s.length;i<n;++i)s[i].apply(this,e)}return this};$.prototype.emitReserved=$.prototype.emit;$.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};$.prototype.hasListeners=function(t){return!!this.listeners(t).length};var Ve=process.nextTick,de=global,ql="nodebuffer";function Bl(){return new Qa}function Mx(t){let e=t.split("; "),s=e[0].indexOf("=");if(s===-1)return;let i=e[0].substring(0,s).trim();if(!i.length)return;let n=e[0].substring(s+1).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));let a={name:i,value:n};for(let r=1;r<e.length;r++){let o=e[r].split("=");if(o.length!==2)continue;let l=o[0].trim(),u=o[1].trim();switch(l){case"Expires":a.expires=new Date(u);break;case"Max-Age":let p=new Date;p.setUTCSeconds(p.getUTCSeconds()+parseInt(u,10)),a.expires=p;break;default:}}return a}var Qa=class{constructor(){this._cookies=new Map}parseCookies(e){e&&e.forEach(s=>{let i=Mx(s);i&&this._cookies.set(i.name,i)})}get cookies(){let e=Date.now();return this._cookies.forEach((s,i)=>{var n;((n=s.expires)===null||n===void 0?void 0:n.getTime())<e&&this._cookies.delete(i)}),this._cookies.entries()}addCookies(e){let s=[];for(let[i,n]of this.cookies)s.push(`${i}=${n.value}`);s.length&&(e.setDisableHeaderCheck(!0),e.setRequestHeader("cookie",s.join("; ")))}appendCookies(e){for(let[s,i]of this.cookies)e.append("cookie",`${s}=${i.value}`)}};function Xi(t,...e){return e.reduce((s,i)=>(t.hasOwnProperty(i)&&(s[i]=t[i]),s),{})}var zx=de.setTimeout,$x=de.clearTimeout;function We(t,e){e.useNativeTimers?(t.setTimeoutFn=zx.bind(de),t.clearTimeoutFn=$x.bind(de)):(t.setTimeoutFn=de.setTimeout.bind(de),t.clearTimeoutFn=de.clearTimeout.bind(de))}var Hx=1.33;function Dl(t){return typeof t=="string"?Vx(t):Math.ceil((t.byteLength||t.size)*Hx)}function Vx(t){let e=0,s=0;for(let i=0,n=t.length;i<n;i++)e=t.charCodeAt(i),e<128?s+=1:e<2048?s+=2:e<55296||e>=57344?s+=3:(i++,s+=4);return s}function Yi(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function jl(t){let e="";for(let s in t)t.hasOwnProperty(s)&&(e.length&&(e+="&"),e+=encodeURIComponent(s)+"="+encodeURIComponent(t[s]));return e}function Il(t){let e={},s=t.split("&");for(let i=0,n=s.length;i<n;i++){let a=s[i].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}var Ul=D(ve(),1),Wx=(0,Ul.default)("engine.io-client:transport"),Qi=class extends Error{constructor(e,s,i){super(e),this.description=s,this.context=i,this.type="TransportError"}},Ge=class extends ${constructor(e){super(),this.writable=!1,We(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,s,i){return super.emitReserved("error",new Qi(e,s,i)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"?this.write(e):Wx("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let s=As(e,this.socket.binaryType);this.onPacket(s)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,s={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(s)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let s=jl(e);return s.length?"?"+s:""}};var Fl=D(ve(),1),qe=(0,Fl.default)("engine.io-client:polling"),Os=class extends Ge{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let s=()=>{qe("paused"),this.readyState="paused",e()};if(this._polling||!this.writable){let i=0;this._polling&&(qe("we are currently polling - waiting to pause"),i++,this.once("pollComplete",function(){qe("pre-pause polling complete"),--i||s()})),this.writable||(qe("we are currently writing - waiting to pause"),i++,this.once("drain",function(){qe("pre-pause writing complete"),--i||s()}))}else s()}_poll(){qe("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){qe("polling got data %s",e);let s=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Pl(e,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this._poll():qe('ignoring poll - transport state "%s"',this.readyState))}doClose(){let e=()=>{qe("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(qe("transport open - closing"),e()):(qe("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,Ol(e,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=Yi()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(e,s)}};var Ml=!1;try{Ml=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch(t){}var zl=Ml;var Hl=D(ve(),1),Za=(0,Hl.default)("engine.io-client:polling");function Gx(){}var Zi=class extends Os{constructor(e){if(super(e),typeof location!="undefined"){let s=location.protocol==="https:",i=location.port;i||(i=s?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||i!==e.port}}doWrite(e,s){let i=this.request({method:"POST",data:e});i.on("success",s),i.on("error",(n,a)=>{this.onError("xhr post error",n,a)})}doPoll(){Za("xhr poll");let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(s,i)=>{this.onError("xhr poll error",s,i)}),this.pollXhr=e}},Ke=class t extends ${constructor(e,s,i){super(),this.createRequest=e,We(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var e;let s=Xi(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{Za("xhr open %s: %s",this._method,this._uri),i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch(n){}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(n){}try{i.setRequestHeader("Accept","*/*")}catch(n){}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},Za("xhr data %s",this._data),i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document!="undefined"&&(this._index=t.requestsCount++,t.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr=="undefined"||this._xhr===null)){if(this._xhr.onreadystatechange=Gx,e)try{this._xhr.abort()}catch(s){}typeof document!="undefined"&&delete t.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Ke.requestsCount=0;Ke.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",$l);else if(typeof addEventListener=="function"){let t="onpagehide"in de?"pagehide":"unload";addEventListener(t,$l,!1)}}function $l(){for(let t in Ke.requests)Ke.requests.hasOwnProperty(t)&&Ke.requests[t].abort()}var AT=(function(){let t=Kx({xdomain:!1});return t&&t.responseType!==null})();function Kx(t){let e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||zl))return new XMLHttpRequest}catch(s){}if(!e)try{return new de[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(s){}}var Jx=er.default||er,$t=class extends Zi{request(e={}){var s;return Object.assign(e,{xd:this.xd,cookieJar:(s=this.socket)===null||s===void 0?void 0:s._cookieJar},this.opts),new Ke(i=>new Jx(i),this.uri(),e)}};var fy=D(Uu(),1),hy=D(ur(),1),xy=D(fr(),1),wr=D(dn(),1),gy=D(Ku(),1);var Ju=D(ve(),1),vy=(0,Ju.default)("engine.io-client:websocket"),by=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",fn=class extends Ge{get name(){return"websocket"}doOpen(){let e=this.uri(),s=this.opts.protocols,i=by?{}:Xi(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,s,i)}catch(n){return this.emitReserved("error",n)}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 s=0;s<e.length;s++){let i=e[s],n=s===e.length-1;Cs(i,this.supportsBinary,a=>{try{this.doWrite(i,a)}catch(r){vy("websocket closed before onclose event")}n&&Ve(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=Yi()),this.supportsBinary||(s.b64=1),this.createUri(e,s)}},a0=de.WebSocket||de.MozWebSocket;var Yt=class extends fn{createSocket(e,s,i){var n;if(!((n=this.socket)===null||n===void 0)&&n._cookieJar){i.headers=i.headers||{},i.headers.cookie=typeof i.headers.cookie=="string"?[i.headers.cookie]:i.headers.cookie||[];for(let[a,r]of this.socket._cookieJar.cookies)i.headers.cookie.push(`${a}=${r.value}`)}return new wr.default(e,s,i)}doWrite(e,s){let i={};e.options&&(i.compress=e.options.compress),this.opts.perMessageDeflate&&(typeof s=="string"?Buffer.byteLength(s):s.length)<this.opts.perMessageDeflate.threshold&&(i.compress=!1),this.ws.send(s,i)}};var Xu=D(ve(),1),Us=(0,Xu.default)("engine.io-client:webtransport"),Qt=class extends Ge{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(()=>{Us("transport closed gracefully"),this.onClose()}).catch(e=>{Us("transport closed due to %s",e),this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let s=Nl(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=e.readable.pipeThrough(s).getReader(),n=Ll();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();let a=()=>{i.read().then(({done:o,value:l})=>{if(o){Us("session is closed");return}Us("received chunk: %o",l),this.onPacket(l),a()}).catch(o=>{Us("an error occurred while reading: %s",o)})};a();let r={type:"open"};this.query.sid&&(r.data=`{"sid":"${this.query.sid}"}`),this._writer.write(r).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let s=0;s<e.length;s++){let i=e[s],n=s===e.length-1;this._writer.write(i).then(()=>{n&&Ve(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var Er={websocket:Yt,webtransport:Qt,polling:$t};var _y=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Zt(t){if(t.length>8e3)throw"URI too long";let e=t,s=t.indexOf("["),i=t.indexOf("]");s!=-1&&i!=-1&&(t=t.substring(0,s)+t.substring(s,i).replace(/:/g,";")+t.substring(i,t.length));let n=_y.exec(t||""),a={},r=14;for(;r--;)a[wy[r]]=n[r]||"";return s!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Ey(a,a.path),a.queryKey=Ty(a,a.query),a}function Ey(t,e){let s=/\/{2,9}/g,i=e.replace(s,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&i.splice(0,1),e.slice(-1)=="/"&&i.splice(i.length-1,1),i}function Ty(t,e){let s={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,n,a){n&&(s[n]=a)}),s}var Yu=D(ve(),1),z=(0,Yu.default)("engine.io-client:socket"),Tr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fs=[];Tr&&addEventListener("offline",()=>{z("closing %d connection(s) because the network was lost",Fs.length),Fs.forEach(t=>t())},!1);var bt=class t extends ${constructor(e,s){if(super(),this.binaryType=ql,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(s=e,e=null),e){let i=Zt(e);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=Zt(s.host).host);We(this,s),this.secure=s.secure!=null?s.secure:typeof location!="undefined"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=s.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),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},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Il(this.opts.query)),Tr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(z("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fs.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=Bl()),this._open()}createTransport(e){z('creating transport "%s"',e);let s=Object.assign({},this.opts.query);s.EIO=Ya,s.transport=e,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return z("options: %j",i),new this._transportsByName[e](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let e=this.opts.rememberUpgrade&&t.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(e);s.open(),this.setTransport(s)}setTransport(e){z("setting transport %s",e.name),this.transport&&(z("clearing existing transport %s",this.transport.name),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",s=>this._onClose("transport close",s))}onOpen(){z("socket open"),this.readyState="open",t.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(z('socket receive: type "%s", data "%s"',e.type,e.data),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":let s=new Error("server error");s.code=e.data,this._onError(s);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}else z('packet received with socket readyState "%s"',this.readyState)}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(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let 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,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();z("flushing %d packets in socket",e.length),this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Dl(n)),i>0&&s>this._maxPayload)return z("only send %d out of %d packets",i,this.writeBuffer.length),this.writeBuffer.slice(0,i);s+=2}return z("payload size is %d (max: %d)",s,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(z("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,Ve(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,s,i){return this._sendPacket("message",e,s,i),this}send(e,s,i){return this._sendPacket("message",e,s,i),this}_sendPacket(e,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let a={type:e,data:s,options:i};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),z("socket closing - telling transport to close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),e()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}_onError(e){if(z("socket error %j",e),t.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return z("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(z('socket close with reason: "%s"',e),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Tr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Fs.indexOf(this._offlineEventListener);i!==-1&&(z("removing listener for the 'offline' event"),Fs.splice(i,1))}this.readyState="closed",this.id=null,this.emitReserved("close",e,s),this.writeBuffer=[],this._prevBufferLen=0}}};bt.protocol=Ya;var hn=class extends bt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade){z("starting upgrade probes");for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}}_probe(e){z('probing transport "%s"',e);let s=this.createTransport(e),i=!1;bt.priorWebsocketSuccess=!1;let n=()=>{i||(z('probe transport "%s" opened',e),s.send([{type:"ping",data:"probe"}]),s.once("packet",m=>{if(!i)if(m.type==="pong"&&m.data==="probe"){if(z('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;bt.priorWebsocketSuccess=s.name==="websocket",z('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{i||this.readyState!=="closed"&&(z("changing transport and sending upgrade packet"),p(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{z('probe transport "%s" failed',e);let f=new Error("probe error");f.transport=s.name,this.emitReserved("upgradeError",f)}}))};function a(){i||(i=!0,p(),s.close(),s=null)}let r=m=>{let f=new Error("probe error: "+m);f.transport=s.name,a(),z('probe transport "%s" failed because of error: %s',e,m),this.emitReserved("upgradeError",f)};function o(){r("transport closed")}function l(){r("socket closed")}function u(m){s&&m.name!==s.name&&(z('"%s" works - aborting "%s"',m.name,s.name),a())}let p=()=>{s.removeListener("open",n),s.removeListener("error",r),s.removeListener("close",o),this.off("close",l),this.off("upgrading",u)};s.once("open",n),s.once("error",r),s.once("close",o),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{i||s.open()},200):s.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let s=[];for(let i=0;i<e.length;i++)~this.transports.indexOf(e[i])&&s.push(e[i]);return s}},es=class extends hn{constructor(e,s={}){let i=typeof e=="object"?e:s;(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(n=>Er[n]).filter(n=>!!n)),super(e,i)}};var A0=es.protocol;var Zu=D(ve(),1),Qu=(0,Zu.default)("socket.io-client:url");function ed(t,e="",s){let i=t;s=s||typeof location!="undefined"&&location,t==null&&(t=s.protocol+"//"+s.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=s.protocol+t:t=s.host+t),/^(https?|wss?):\/\//.test(t)||(Qu("protocol-less url %s",t),typeof s!="undefined"?t=s.protocol+"//"+t:t="https://"+t),Qu("parse %s",t),i=Zt(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let a=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+a+":"+i.port+e,i.href=i.protocol+"://"+a+(s&&s.port===i.port?"":":"+i.port),i}var Pr={};On(Pr,{Decoder:()=>Ar,Encoder:()=>Cr,PacketType:()=>O,isPacketValid:()=>By,protocol:()=>rd});var Cy=typeof ArrayBuffer=="function",Ay=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,td=Object.prototype.toString,Oy=typeof Blob=="function"||typeof Blob!="undefined"&&td.call(Blob)==="[object BlobConstructor]",Py=typeof File=="function"||typeof File!="undefined"&&td.call(File)==="[object FileConstructor]";function zs(t){return Cy&&(t instanceof ArrayBuffer||Ay(t))||Oy&&t instanceof Blob||Py&&t instanceof File}function Ms(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let s=0,i=t.length;s<i;s++)if(Ms(t[s]))return!0;return!1}if(zs(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ms(t.toJSON(),!0);for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Ms(t[s]))return!0;return!1}function sd(t){let e=[],s=t.data,i=t;return i.data=Sr(s,e),i.attachments=e.length,{packet:i,buffers:e}}function Sr(t,e){if(!t)return t;if(zs(t)){let s={_placeholder:!0,num:e.length};return e.push(t),s}else if(Array.isArray(t)){let s=new Array(t.length);for(let i=0;i<t.length;i++)s[i]=Sr(t[i],e);return s}else if(typeof t=="object"&&!(t instanceof Date)){let s={};for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=Sr(t[i],e));return s}return t}function id(t,e){return t.data=kr(t.data,e),delete t.attachments,t}function kr(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let s=0;s<t.length;s++)t[s]=kr(t[s],e);else if(typeof t=="object")for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&(t[s]=kr(t[s],e));return t}var nd=D(ve(),1),Rr=(0,nd.default)("socket.io-parser"),ad=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],rd=5,O;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(O||(O={}));var Cr=class{constructor(e){this.replacer=e}encode(e){return Rr("encoding packet %j",e),(e.type===O.EVENT||e.type===O.ACK)&&Ms(e)?this.encodeAsBinary({type:e.type===O.EVENT?O.BINARY_EVENT:O.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let s=""+e.type;return(e.type===O.BINARY_EVENT||e.type===O.BINARY_ACK)&&(s+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(s+=e.nsp+","),e.id!=null&&(s+=e.id),e.data!=null&&(s+=JSON.stringify(e.data,this.replacer)),Rr("encoded %j as %s",e,s),s}encodeAsBinary(e){let s=sd(e),i=this.encodeAsString(s.packet),n=s.buffers;return n.unshift(i),n}},Ar=class t extends ${constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let s;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(e);let i=s.type===O.BINARY_EVENT;i||s.type===O.BINARY_ACK?(s.type=i?O.EVENT:O.ACK,this.reconstructor=new Or(s),s.attachments===0&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else if(zs(e)||e.base64)if(this.reconstructor)s=this.reconstructor.takeBinaryData(e),s&&(this.reconstructor=null,super.emitReserved("decoded",s));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let s=0,i={type:Number(e.charAt(0))};if(O[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===O.BINARY_EVENT||i.type===O.BINARY_ACK){let a=s+1;for(;e.charAt(++s)!=="-"&&s!=e.length;);let r=e.substring(a,s);if(r!=Number(r)||e.charAt(s)!=="-")throw new Error("Illegal attachments");let o=Number(r);if(!od(o)||o<0)throw new Error("Illegal attachments");if(o>this.opts.maxAttachments)throw new Error("too many attachments");i.attachments=o}if(e.charAt(s+1)==="/"){let a=s+1;for(;++s&&!(e.charAt(s)===","||s===e.length););i.nsp=e.substring(a,s)}else i.nsp="/";let n=e.charAt(s+1);if(n!==""&&Number(n)==n){let a=s+1;for(;++s;){let r=e.charAt(s);if(r==null||Number(r)!=r){--s;break}if(s===e.length)break}i.id=Number(e.substring(a,s+1))}if(e.charAt(++s)){let a=this.tryParse(e.substr(s));if(t.isPayloadValid(i.type,a))i.data=a;else throw new Error("invalid payload")}return Rr("decoded %s as %j",e,i),i}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(s){return!1}}static isPayloadValid(e,s){switch(e){case O.CONNECT:return xn(s);case O.DISCONNECT:return s===void 0;case O.CONNECT_ERROR:return typeof s=="string"||xn(s);case O.EVENT:case O.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&ad.indexOf(s[0])===-1);case O.ACK:case O.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Or=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let s=id(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Ly(t){return typeof t=="string"}var od=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function Ny(t){return t===void 0||od(t)}function xn(t){return Object.prototype.toString.call(t)==="[object Object]"}function qy(t,e){switch(t){case O.CONNECT:return e===void 0||xn(e);case O.DISCONNECT:return e===void 0;case O.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&ad.indexOf(e[0])===-1);case O.ACK:return Array.isArray(e);case O.CONNECT_ERROR:return typeof e=="string"||xn(e);default:return!1}}function By(t){return Ly(t.nsp)&&Ny(t.id)&&qy(t.type,t.data)}function _e(t,e,s){return t.on(e,s),function(){t.off(e,s)}}var cd=D(ve(),1),Q=(0,cd.default)("socket.io-client:socket"),Dy=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),ts=class extends ${constructor(e,s,i){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=s,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[_e(e,"open",this.onopen.bind(this)),_e(e,"packet",this.onpacket.bind(this)),_e(e,"error",this.onerror.bind(this)),_e(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...s){var i,n,a;if(Dy.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(s.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;let r={type:O.EVENT,data:s};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){let p=this.ids++;Q("emitting packet with ack id %d",p);let m=s.pop();this._registerAckCallback(p,m),r.id=p}let o=(n=(i=this.io.engine)===null||i===void 0?void 0:i.transport)===null||n===void 0?void 0:n.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!o?Q("discard packet as the transport is not currently writable"):l?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(e,s){var i;let n=(i=this.flags.timeout)!==null&&i!==void 0?i:this._opts.ackTimeout;if(n===void 0){this.acks[e]=s;return}let a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&(Q("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(o,1));Q("event with ack id %d has timed out after %d ms",e,n),s.call(this,new Error("operation has timed out"))},n),r=(...o)=>{this.io.clearTimeoutFn(a),s.apply(this,o)};r.withError=!0,this.acks[e]=r}emitWithAck(e,...s){return new Promise((i,n)=>{let a=(r,o)=>r?n(r):i(o);a.withError=!0,s.push(a),this.emit(e,...s)})}_addToQueue(e){let s;typeof e[e.length-1]=="function"&&(s=e.pop());let i={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...a)=>i!==this._queue[0]?Q("packet [%d] already acknowledged",i.id):(n!==null?i.tryCount>this._opts.retries&&(Q("packet [%d] is discarded after %d tries",i.id,i.tryCount),this._queue.shift(),s&&s(n)):(Q("packet [%d] was successfully sent",i.id),this._queue.shift(),s&&s(null,...a)),i.pending=!1,this._drainQueue())),this._queue.push(i),this._drainQueue()}_drainQueue(e=!1){if(Q("draining queue"),!this.connected||this._queue.length===0)return;let s=this._queue[0];if(s.pending&&!e){Q("packet [%d] has already been sent and is waiting for an ack",s.id);return}s.pending=!0,s.tryCount++,Q("sending packet [%d] (try n\xB0%d)",s.id,s.tryCount),this.flags=s.flags,this.emit.apply(this,s.args)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){Q("transport is open - connecting"),typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:O.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,s){Q("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case O.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 O.EVENT:case O.BINARY_EVENT:this.onevent(e);break;case O.ACK:case O.BINARY_ACK:this.onack(e);break;case O.DISCONNECT:this.ondisconnect();break;case O.CONNECT_ERROR:this.destroy();let i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){let s=e.data||[];Q("emitting event %j",s),e.id!=null&&(Q("attaching ack callback to event"),s.push(this.ack(e.id))),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let s=this._anyListeners.slice();for(let i of s)i.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let s=this,i=!1;return function(...n){i||(i=!0,Q("sending ack %j",n),s.packet({type:O.ACK,id:e,data:n}))}}onack(e){let s=this.acks[e.id];if(typeof s!="function"){Q("bad ack %s",e.id);return}delete this.acks[e.id],Q("calling ack %s with %j",e.id,e.data),s.withError&&e.data.unshift(null),s.apply(this,e.data)}onconnect(e,s){Q("socket connected with id %s",e),this.id=e,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){Q("server disconnect (%s)",this.nsp),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&&(Q("performing disconnect (%s)",this.nsp),this.packet({type:O.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){let s=this._anyListeners;for(let i=0;i<s.length;i++)if(e===s[i])return s.splice(i,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){let s=this._anyOutgoingListeners;for(let i=0;i<s.length;i++)if(e===s[i])return s.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let s=this._anyOutgoingListeners.slice();for(let i of s)i.apply(this,e.data)}}};function _t(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}_t.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),s=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-s:t+s}return Math.min(t,this.max)|0};_t.prototype.reset=function(){this.attempts=0};_t.prototype.setMin=function(t){this.ms=t};_t.prototype.setMax=function(t){this.max=t};_t.prototype.setJitter=function(t){this.jitter=t};var pd=D(ve(),1),oe=(0,pd.default)("socket.io-client:manager"),ss=class extends ${constructor(e,s){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(s=e,e=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,We(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((i=s.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new _t({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=e;let n=s.parser||Pr;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var s;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(s=this.backoff)===null||s===void 0||s.setMin(e),this)}randomizationFactor(e){var s;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(s=this.backoff)===null||s===void 0||s.setJitter(e),this)}reconnectionDelayMax(e){var s;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(s=this.backoff)===null||s===void 0||s.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(oe("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;oe("opening %s",this.uri),this.engine=new es(this.uri,this.opts);let s=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let n=_e(s,"open",function(){i.onopen(),e&&e()}),a=o=>{oe("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},r=_e(s,"error",a);if(this._timeout!==!1){let o=this._timeout;oe("connect attempt will timeout after %d",o);let l=this.setTimeoutFn(()=>{oe("connect attempt timed out after %d",o),n(),a(new Error("timeout")),s.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(n),this.subs.push(r),this}connect(e){return this.open(e)}onopen(){oe("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(_e(e,"ping",this.onping.bind(this)),_e(e,"data",this.ondata.bind(this)),_e(e,"error",this.onerror.bind(this)),_e(e,"close",this.onclose.bind(this)),_e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(s){this.onclose("parse error",s)}}ondecoded(e){Ve(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){oe("error",e),this.emitReserved("error",e)}socket(e,s){let i=this.nsps[e];return i?this._autoConnect&&!i.active&&i.connect():(i=new ts(this,e,s),this.nsps[e]=i),i}_destroy(e){let s=Object.keys(this.nsps);for(let i of s)if(this.nsps[i].active){oe("socket %s is still active, skipping close",i);return}this._close()}_packet(e){oe("writing packet %j",e);let s=this.encoder.encode(e);for(let i=0;i<s.length;i++)this.engine.write(s[i],e.options)}cleanup(){oe("cleanup"),this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){oe("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,s){var i;oe("closed due to %s",e),this.cleanup(),(i=this.engine)===null||i===void 0||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)oe("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let s=this.backoff.duration();oe("will wait %dms before reconnect attempt",s),this._reconnecting=!0;let i=this.setTimeoutFn(()=>{e.skipReconnect||(oe("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(oe("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):(oe("reconnect success"),e.onreconnect())}))},s);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var ud=D(ve(),1),ld=(0,ud.default)("socket.io-client"),$s={};function Hs(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};let s=ed(t,e.path||"/socket.io"),i=s.source,n=s.id,a=s.path,r=$s[n]&&a in $s[n].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||r,l;return o?(ld("ignoring socket cache for %s",i),l=new ss(i,e)):($s[n]||(ld("new io instance for %s",i),$s[n]=new ss(i,e)),l=$s[n]),s.query&&!e.query&&(e.query=s.queryKey),l.socket(s.path,e)}Object.assign(Hs,{Manager:ss,Socket:ts,io:Hs,connect:Hs});var gn=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},we=class extends gn{constructor(s,i,n){super(s);k(this,"status");k(this,"code");this.name="APIError",this.status=i,this.code=n}},Vs=class extends we{constructor(e="Invalid API Key or Client Code"){super(e,401,"AUTH_FAILED"),this.name="AuthenticationError"}},Lr=class extends we{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};var w=class{constructor(e){this.client=e}post(e,s,i){return c(this,null,function*(){try{let n=this.buildConfig(i);return(yield this.client.post(e,s,n)).data}catch(n){this.handleError(n)}})}get(e,s){return c(this,null,function*(){try{let i=this.buildConfig(s);return(yield this.client.get(e,i)).data}catch(i){this.handleError(i)}})}patch(e,s,i){return c(this,null,function*(){try{let n=this.buildConfig(i);return(yield this.client.patch(e,s,n)).data}catch(n){this.handleError(n)}})}put(e,s,i){return c(this,null,function*(){try{let n=this.buildConfig(i);return(yield this.client.put(e,s,n)).data}catch(n){this.handleError(n)}})}deleteRequest(e,s){return c(this,null,function*(){try{let i=this.buildConfig(s);return(yield this.client.delete(e,i)).data}catch(i){this.handleError(i)}})}buildConfig(e){if(!e)return;let s=L({},e);return e.idempotencyKey&&(s.headers=re(L({},s.headers),{"Idempotency-Key":e.idempotencyKey})),s}handleError(e){var s,i,n;throw e.response?new we(((s=e.response.data)==null?void 0:s.message)||((i=e.response.data)==null?void 0:i.error)||"API Request Failed",e.response.status,(n=e.response.data)==null?void 0:n.code):new we(e.message||"Network Error")}};var yn=class extends w{list(e){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}/notes`)})}create(e,s){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/notes`,s)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/notes/${e}`,{content:s})})}pin(e,s=!0){return c(this,null,function*(){return this.patch(`/api/crm/notes/${e}/pin`,{isPinned:s})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/notes/${e}`)})}},Ws=class extends w{constructor(s){super(s);k(this,"notes");this.notes=new yn(s)}timeline(s,i){return c(this,null,function*(){return this.get(`/api/crm/leads/${s}/timeline`,{params:i})})}list(s,i){return c(this,null,function*(){return this.get(`/api/crm/leads/${s}/activities`,{params:L({},i)})})}log(s){return c(this,null,function*(){return this.post(`/api/crm/leads/${s.leadId}/activities`,s)})}logCall(s,i){return c(this,null,function*(){return this.post(`/api/crm/leads/${s}/calls`,i)})}};var Gs=class extends w{overview(e){return c(this,null,function*(){return this.get("/api/crm/analytics/overview",{params:e})})}funnel(e){return c(this,null,function*(){return this.get("/api/crm/analytics/funnel",{params:{pipelineId:e}})})}forecast(e){return c(this,null,function*(){return this.get("/api/crm/analytics/forecast",{params:{pipelineId:e}})})}sources(e){return c(this,null,function*(){return this.get("/api/crm/analytics/sources",{params:e})})}team(e){return c(this,null,function*(){return this.get("/api/crm/analytics/team",{params:e})})}heatmap(e){return c(this,null,function*(){return this.get("/api/crm/analytics/heatmap",{params:e})})}scores(){return c(this,null,function*(){return this.get("/api/crm/analytics/scores")})}stageTime(e){return c(this,null,function*(){return this.get("/api/crm/analytics/stage-time",{params:{pipelineId:e}})})}tiered(e){return c(this,null,function*(){return this.get("/api/crm/analytics/tiered",{params:e})})}summary(e){return c(this,null,function*(){return this.get("/api/crm/analytics/summary",{params:e})})}whatsapp(e){return c(this,null,function*(){return this.get("/api/crm/analytics/whatsapp",{params:e})})}};var Ks=class extends w{stats(){return c(this,null,function*(){return this.get("/api/crm/automation/stats")})}logs(e){return c(this,null,function*(){return this.get("/api/crm/automation/logs",{params:e})})}retryFailedEvent(e){return c(this,null,function*(){return this.post(`/api/crm/automation/logs/${e}/retry`,{})})}};var Js=class extends w{list(){return c(this,null,function*(){return this.get("/api/crm/automations")})}create(e){return c(this,null,function*(){return this.post("/api/crm/automations",e)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/automations/${e}`,s)})}toggle(e){return c(this,null,function*(){return this.patch(`/api/crm/automations/${e}/toggle`)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/automations/${e}`)})}bulkDelete(e){return c(this,null,function*(){return this.post("/api/crm/automations/bulk-delete",{ids:e})})}test(e,s){return c(this,null,function*(){return this.post(`/api/crm/automations/${e}/test`,{leadId:s})})}getAvailableEvents(){return c(this,null,function*(){return this.post("/api/crm/automations/events",{})})}enrollments(e,s){return c(this,null,function*(){return this.get(`/api/crm/automations/${e}/enrollments`,{params:s})})}getEnrollment(e){return c(this,null,function*(){return this.get(`/api/crm/automations/enrollments/${e}`)})}pauseEnrollment(e,s){return c(this,null,function*(){return this.post(`/api/crm/automations/${e}/enrollments/${s}/pause`,{})})}resumeEnrollment(e,s){return c(this,null,function*(){return this.post(`/api/crm/automations/${e}/enrollments/${s}/resume`,{})})}runs(e){return c(this,null,function*(){return this.get(`/api/crm/automations/${e}/runs`)})}getRun(e){return c(this,null,function*(){return this.get(`/api/crm/automations/runs/${e}`)})}resumeRun(e){return c(this,null,function*(){return this.post(`/api/crm/automations/runs/${e}/resume`,{})})}abortRun(e){return c(this,null,function*(){return this.post(`/api/crm/automations/runs/${e}/abort`,{})})}webhookEvent(e,s,i){return c(this,null,function*(){return this.post("/api/crm/webhook-event",{ruleId:e,eventName:s,payload:i})})}};var Xs=class extends w{create(e){return c(this,null,function*(){return this.post("/api/crm/leads",e)})}describe(){return c(this,null,function*(){let e=yield this.fields(),s=Array.isArray(e.data)?e.data:[],i=[{key:"firstName",label:"First Name",type:"string",required:!0,group:"Basic Info"},{key:"lastName",label:"Last Name",type:"string",required:!1,group:"Basic Info"},{key:"phone",label:"Phone Number",type:"phone",required:!0,group:"Contact"},{key:"email",label:"Email Address",type:"email",required:!1,group:"Contact"},{key:"status",label:"Status",type:"select",required:!0,options:[{label:"New",value:"new"},{label:"Contacted",value:"contacted"},{label:"Qualified",value:"qualified"},{label:"Won",value:"won"},{label:"Lost",value:"lost"}]},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],n=s.map(a=>({key:`metadata.extra.${a.name}`,label:a.label||a.name,type:a.type||"string",required:!!a.required,options:a.options,group:"Custom Fields"}));return{name:"Lead",fields:[...i,...n],uiHints:{icon:"User",primaryColor:"#3b82f6",defaultSort:{field:"createdAt",direction:"desc"},summaryFields:["firstName","lastName","phone","status"]}}})}upsert(e){return c(this,null,function*(){return this.post("/api/crm/leads/upsert",e)})}createMany(e,s=50){return c(this,null,function*(){let i=[];for(let n=0;n<e.length;n+=s){let r=e.slice(n,n+s).map(l=>this.create(l)),o=yield Promise.allSettled(r);for(let l of o)if(l.status==="fulfilled")i.push(l.value);else throw l.reason}return i})}import(e){return c(this,null,function*(){return this.post("/api/crm/leads/import",{leads:e})})}list(e){return c(this,null,function*(){let s=L({},e);return Array.isArray(s.tags)&&(s.tags=s.tags.join(",")),this.get("/api/crm/leads",{params:s})})}listAutoPaging(e){return je(this,null,function*(){let s=(e==null?void 0:e.page)||1,i=!0;for(;i;){let n=yield new Ce(this.list(re(L({},e),{page:s}))),a=Array.isArray(n.data)?n.data:n||[];if(a.length===0){i=!1;break}for(let r of a)yield r;n.pagination&&s<n.pagination.pages||!n.pagination&&a.length>0?s++:i=!1}})}retrieve(e){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}`)})}retrieveByPhone(e){return c(this,null,function*(){return this.get(`/api/crm/leads/phone/${encodeURIComponent(e)}`)})}retrieveByRef(e,s){return c(this,null,function*(){return this.get(`/api/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(s)}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}`,s)})}move(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}/move`,{stageId:s})})}convert(e,s,i){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/convert`,{outcome:s,reason:i})})}tags(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}/tags`,s)})}recalculateScore(e){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/score`,{})})}updateMetadata(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}/metadata`,s)})}fields(){return c(this,null,function*(){return this.get("/api/crm/leads/fields")})}notes(e){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}/notes`)})}activities(e,s){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}/timeline`,{params:s})})}createNote(e,s){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/notes`,s)})}updateNote(e,s,i){return c(this,null,function*(){return this.patch(`/api/crm/notes/${s}`,i)})}deleteNote(e,s){return c(this,null,function*(){return this.deleteRequest(`/api/crm/notes/${s}`)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/leads/${e}`)})}bulkDelete(e){return c(this,null,function*(){return this.deleteRequest("/api/crm/leads",{data:{ids:e}})})}};var Ys=class extends w{capture(e){return c(this,null,function*(){return this.post("/api/crm/payments/capture",e)})}};var Qs=class extends w{list(){return c(this,null,function*(){return this.get("/api/crm/pipelines")})}getStageManifest(e){return c(this,null,function*(){var n,a;let s=yield this.retrieve(e),i=Array.isArray((n=s.data)==null?void 0:n.stages)?s.data.stages:[];return{name:`Pipeline: ${((a=s.data)==null?void 0:a.name)||e}`,fields:i.map(r=>({key:r._id,label:r.name,type:"string",required:!0,options:[{label:r.name,value:r._id}],group:"Stages",uiHints:{color:r.color||"#cbd5e1",probability:r.probability}})),uiHints:{icon:"Columns",primaryColor:"#6366f1"}}})}create(e){return c(this,null,function*(){return this.post("/api/crm/pipelines",e)})}retrieve(e){return c(this,null,function*(){return this.get(`/api/crm/pipelines/${e}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}`,s)})}setDefault(e){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}/default`,{})})}duplicate(e,s){return c(this,null,function*(){return this.post(`/api/crm/pipelines/${e}/duplicate`,{newName:s})})}archive(e){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}/archive`,{})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/pipelines/${e}`)})}board(e){return c(this,null,function*(){return this.get(`/api/crm/pipelines/${e}/board`)})}forecast(e){return c(this,null,function*(){return this.get(`/api/crm/pipelines/${e}/forecast`)})}addStage(e,s){return c(this,null,function*(){return this.post(`/api/crm/pipelines/${e}/stages`,s)})}reorderStages(e,s){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}/stages/reorder`,{order:s})})}updateStage(e,s){return c(this,null,function*(){return this.patch(`/api/crm/stages/${e}`,s)})}deleteStage(e,s){return c(this,null,function*(){return this.deleteRequest(`/api/crm/stages/${e}`,{data:s?{moveLeadsToStageId:s}:void 0})})}};var Zs=class extends w{getConfig(){return c(this,null,function*(){return this.get("/api/crm/scoring")})}updateConfig(e){return c(this,null,function*(){return this.patch("/api/crm/scoring",e)})}recalculate(e){return c(this,null,function*(){return this.post(`/api/crm/scoring/${e}/recalculate`,{})})}};var ei=class extends w{enroll(e){return c(this,null,function*(){return this.post("/api/crm/sequences/enroll",e)})}unenroll(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/sequences/unenroll/${e}`)})}listForLead(e){return c(this,null,function*(){return this.get(`/api/crm/sequences/lead/${e}`)})}};var ti=class{constructor(e){k(this,"leads");k(this,"pipelines");k(this,"activities");k(this,"analytics");k(this,"automations");k(this,"sequences");k(this,"scoring");k(this,"payments");k(this,"automationDashboard");this.leads=new Xs(e),this.pipelines=new Qs(e),this.activities=new Ws(e),this.analytics=new Gs(e),this.automations=new Js(e),this.sequences=new ei(e),this.scoring=new Zs(e),this.payments=new Ys(e),this.automationDashboard=new Ks(e)}};var is=class extends w{sendCampaign(e){return c(this,null,function*(){return this.post("/api/saas/emails/campaign",e)})}sendTest(e){return c(this,null,function*(){return this.post("/api/saas/emails/test",{to:e})})}listTemplates(e){return c(this,null,function*(){return this.get("/api/saas/mail/templates",{params:e})})}getTemplate(e){return c(this,null,function*(){return this.get(`/api/saas/mail/templates/${e}`)})}createTemplate(e){return c(this,null,function*(){return this.post("/api/saas/mail/templates",e)})}updateTemplate(e,s){return c(this,null,function*(){return this.put(`/api/saas/mail/templates/${e}`,s)})}deleteTemplate(e,s=!1){return c(this,null,function*(){return this.deleteRequest(`/api/saas/mail/templates/${e}`,{params:{force:s}})})}previewTemplate(e,s){return c(this,null,function*(){return this.post(`/api/saas/mail/templates/${e}/preview`,s)})}},Nr=class extends is{};var si=class extends w{list(){return c(this,null,function*(){return this.get("/api/saas/events")})}assign(e){return c(this,null,function*(){return this.post("/api/saas/events/assign",e)})}unassign(e){return c(this,null,function*(){return this.post("/api/saas/events/unassign",{name:e})})}unassignBulk(e){return c(this,null,function*(){return this.post("/api/saas/events/unassign/bulk",{names:e})})}trigger(e){return c(this,null,function*(){return this.post("/api/saas/workflows/trigger",e)})}listCustomEvents(){return c(this,null,function*(){return this.get("/api/saas/crm/custom-events")})}createCustomEvent(e){return c(this,null,function*(){return this.post("/api/saas/crm/custom-events",e)})}deleteCustomEvent(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/crm/custom-events/${e}`)})}emit(e){return c(this,null,function*(){return this.post("/api/saas/crm/events/emit",e)})}};var ii=class extends w{system(){return c(this,null,function*(){return(yield this.get("/api/saas/health")).data})}clientHealth(){return c(this,null,function*(){return(yield this.get("/api/saas/health/client")).data})}getDiagnosticReport(){return c(this,null,function*(){return this.clientHealth()})}jobStatus(e){return c(this,null,function*(){return(yield this.get(`/api/saas/jobs/status/${e}`)).data})}};var ni=class extends w{listEventLogs(e){return c(this,null,function*(){return this.get("/api/saas/events/logs",{params:e})})}getEventLog(e){return c(this,null,function*(){return this.get(`/api/saas/events/logs/${e}`)})}listCallbackLogs(e){return c(this,null,function*(){return this.get("/api/saas/callbacks/logs",{params:e})})}getStats(){return c(this,null,function*(){return this.get("/api/saas/events/stats")})}};var vn=class extends w{sendCampaign(e){return c(this,null,function*(){return this.post("/api/saas/marketing/emails/campaign",e)})}sendTest(e){return c(this,null,function*(){return this.post("/api/saas/marketing/emails/test",{to:e})})}},bn=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/marketing/campaigns",{params:e})})}create(e){return c(this,null,function*(){return this.post("/api/saas/marketing/campaigns",e)})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/marketing/campaigns/${e}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/marketing/campaigns/${e}`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/marketing/campaigns/${e}`)})}send(e,s){return c(this,null,function*(){return this.post(`/api/saas/marketing/campaigns/${e}/send`,s||{})})}stats(e){return c(this,null,function*(){return this.get(`/api/saas/marketing/campaigns/${e}/stats`)})}},_n=class extends w{sendTemplate(e){return c(this,null,function*(){return this.post("/api/saas/marketing/whatsapp/send-template",e)})}},ai=class extends w{constructor(s){super(s);k(this,"emails");k(this,"campaigns");k(this,"whatsapp");this.emails=new vn(s),this.campaigns=new bn(s),this.whatsapp=new _n(s)}};var ns=class extends w{getUsage(){return c(this,null,function*(){return this.get("/api/saas/storage/usage")})}createFolder(e){return c(this,null,function*(){return this.post("/api/saas/storage/folders",{name:e})})}list(e,s){return c(this,null,function*(){return this.get(`/api/saas/storage/files/${e}`,{params:s})})}delete(e){return c(this,null,function*(){return this.deleteRequest("/api/saas/storage/files",{params:{key:e}})})}getDownloadUrl(e){return c(this,null,function*(){return this.post("/api/saas/storage/download-url",{key:e})})}upload(e,s){return c(this,null,function*(){let i=yield this.post("/api/saas/storage/upload-url",s),{uploadUrl:n,key:a}=i.data;yield Mt.put(n,e,{headers:{"Content-Type":s.contentType}});let r=e.size||e.byteLength||0;return this.post("/api/saas/storage/confirm-upload",{key:a,sizeBytes:r})})}},qr=class extends ns{};var ri=class extends w{create(e){return c(this,null,function*(){return this.post("/api/saas/meet",e)})}list(e){return c(this,null,function*(){return this.get("/api/saas/meet",{params:e})})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/meet/${e}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/meet/${e}`,s)})}reschedule(e,s){return c(this,null,function*(){return this.patch(`/api/saas/meet/${e}`,s)})}delete(e){return c(this,null,function*(){return this.update(e,{status:"cancelled"})})}};var oi=class extends w{listLogs(e){return c(this,null,function*(){return this.get("/api/saas/events/logs",{params:e})})}retrieveLog(e){return c(this,null,function*(){return this.get(`/api/saas/events/logs/${e}`)})}getStats(e){return c(this,null,function*(){return this.get("/api/saas/events/stats",{params:e})})}listCallbacks(e){return c(this,null,function*(){return this.get("/api/saas/callbacks/logs",{params:e})})}listAlerts(e){return c(this,null,function*(){return this.get("/api/crm/notifications",{params:e})})}dismissAlert(e){return c(this,null,function*(){return this.patch(`/api/crm/notifications/${e}/dismiss`)})}clearAllAlerts(){return c(this,null,function*(){return this.deleteRequest("/api/crm/notifications/clear-all")})}retryAction(e){return c(this,null,function*(){return this.post(`/api/crm/notifications/${e}/retry`,{})})}};var ci=class extends w{listFailed(){return c(this,null,function*(){return this.get("/api/saas/admin/queue/failed")})}getStats(){return c(this,null,function*(){return this.get("/api/saas/admin/queue/stats")})}retryJob(e){return c(this,null,function*(){return this.post(`/api/saas/admin/queue/${e}/retry`,{})})}deleteJob(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/admin/queue/${e}`)})}};var wn=class extends w{create(e){return c(this,null,function*(){return this.post("/api/saas/storage/folders",{name:e})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/storage/folders/${encodeURIComponent(e)}`)})}},En=class extends w{list(e,s){return c(this,null,function*(){return this.get(`/api/saas/storage/files/${e}`,{params:s})})}getUploadUrl(e){return c(this,null,function*(){return this.post("/api/saas/storage/upload-url",e)})}confirmUpload(e){return c(this,null,function*(){return this.post("/api/saas/storage/confirm-upload",e)})}getDownloadUrl(e){return c(this,null,function*(){return this.post("/api/saas/storage/download-url",{key:e})})}delete(e){return c(this,null,function*(){return this.deleteRequest("/api/saas/storage/files",{params:{key:e}})})}},pi=class extends w{constructor(s){super(s);k(this,"folders");k(this,"files");this.folders=new wn(s),this.files=new En(s)}usage(){return c(this,null,function*(){return this.get("/api/saas/storage/usage")})}};var wt=class extends we{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},li=class{constructEvent(e,s,i){return c(this,null,function*(){if(!s)throw new wt("No webhook signature provided");let n=Array.isArray(s)?s[0]:s;n.startsWith("sha256=")&&(n=n.slice(7));try{let a=yield import("crypto"),o=a.createHmac("sha256",i).update(e).digest("hex");if(!a.timingSafeEqual(Buffer.from(o),Buffer.from(n)))throw new wt("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(a){throw a instanceof wt?a:new wt(`Webhook payload parsing failed: ${a.message}`)}})}};var ui=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/chat/broadcasts",{params:e})})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/chat/broadcasts/${e}`)})}create(e){return c(this,null,function*(){return this.post("/api/saas/chat/broadcast",e)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/chat/broadcasts/${e}`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/chat/broadcasts/${e}`)})}};var di=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/chat/conversations",{params:e})})}create(e){return c(this,null,function*(){return this.post("/api/saas/chat/conversations",e)})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/chat/conversations/${e}`)})}messages(e,s){return c(this,null,function*(){return this.get(`/api/saas/chat/conversations/${e}/messages`,{params:s})})}linkLead(e,s,i){return c(this,null,function*(){return this.post(`/api/saas/chat/conversations/${e}/link-lead`,{leadId:s,leadData:i})})}markRead(e){return c(this,null,function*(){return this.post(`/api/saas/chat/conversations/${e}/read`,{})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/chat/conversations/${e}`)})}bulkDelete(e){return c(this,null,function*(){return this.post("/api/saas/chat/conversations/bulk-delete",{ids:e})})}};var mi=class extends w{send(e){return c(this,null,function*(){return this.post("/api/saas/chat/send",e)})}sendTemplate(e){return c(this,null,function*(){return this.post("/api/saas/chat/send",re(L({},e),{templateLanguage:e.language||e.templateLanguage||"en_US"}))})}star(e,s){return c(this,null,function*(){return this.post(`/api/saas/chat/messages/${e}/star`,{isStarred:s})})}react(e,s){return c(this,null,function*(){return this.post(`/api/saas/chat/messages/${e}/react`,{reaction:s})})}markRead(e){return c(this,null,function*(){return this.post(`/api/saas/chat/conversations/${e}/read`)})}upload(e){return c(this,null,function*(){let s=new FormData;return s.append("file",e),this.post("/api/saas/chat/upload",s,{headers:{"Content-Type":"multipart/form-data"}})})}};var fi=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/chat/templates",{params:e})})}sync(){return c(this,null,function*(){return this.post("/api/saas/chat/templates/sync",{})})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/${encodeURIComponent(e)}`)})}create(e){return c(this,null,function*(){return this.post("/api/saas/chat/templates",e)})}update(e,s){return c(this,null,function*(){return this.put(`/api/saas/chat/templates/${e}`,s)})}deleteTemplate(e,s){return c(this,null,function*(){return this.deleteRequest(`/api/saas/chat/templates/${encodeURIComponent(e)}${s?"?force=true":""}`)})}mappingConfig(){return c(this,null,function*(){return this.get("/api/saas/chat/templates/mapping/config")})}collections(){return c(this,null,function*(){return this.get("/api/saas/chat/templates/collections")})}collectionFields(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/collections/${encodeURIComponent(e)}/fields`)})}updateMapping(e,s){return c(this,null,function*(){return this.put(`/api/saas/chat/templates/${encodeURIComponent(e)}/mapping`,s)})}validate(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/${encodeURIComponent(e)}/validate`)})}preview(e,s){return c(this,null,function*(){return this.post(`/api/saas/chat/templates/${encodeURIComponent(e)}/preview`,{context:s})})}getVariableManifest(e){return c(this,null,function*(){var a,r;let s=yield this.retrieve(e),i=Array.isArray((a=s.data)==null?void 0:a.components)?s.data.components:[],n=[];for(let o of i)if(o.text){let l=o.text.match(/{{(\d+)}}/g);if(l)for(let u of l){let p=u.replace(/{{|}}/g,"");n.push({key:`var_${p}`,label:`${o.type} Var {{${p}}}`,type:"string",required:!0,group:o.type,description:`Variable placeholder in template ${o.type}`})}}return{name:`Template variables: ${((r=s.data)==null?void 0:r.name)||e}`,fields:n,uiHints:{icon:"Variables",primaryColor:"#059669"}}})}checkUsage(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/${encodeURIComponent(e)}/usage`)})}};var hi=class extends w{constructor(s){super(s);k(this,"messages");k(this,"conversations");k(this,"broadcasts");k(this,"templates");this.messages=new mi(s),this.conversations=new di(s),this.broadcasts=new ui(s),this.templates=new fi(s)}upload(s,i){return c(this,null,function*(){let n=new FormData;return n.append("file",s,i),this.post("/api/saas/chat/upload",n,{headers:typeof n.getHeaders=="function"?n.getHeaders():void 0})})}sendTemplate(s){return c(this,null,function*(){return this.post("/api/saas/marketing/whatsapp/send-template",s)})}};var xi=class extends w{listBlueprints(){return c(this,null,function*(){return this.get("/api/agency/blueprints")})}createBlueprint(e){return c(this,null,function*(){return this.post("/api/agency/blueprints",e)})}deployBlueprint(e){return c(this,null,function*(){return this.post("/api/agency/blueprints/deploy",e)})}getPortfolioStats(e){return c(this,null,function*(){return this.get(`/api/agency/portfolio/${e}/stats`)})}getPortfolioHealth(e){return c(this,null,function*(){return this.get(`/api/agency/portfolio/${e}/health`)})}getUsage(e){return c(this,null,function*(){return this.get(`/api/agency/usage/${e}`)})}listStaff(e){return c(this,null,function*(){return this.get(`/api/agency/staff/${e}`)})}createStaff(e){return c(this,null,function*(){return this.post("/api/agency/staff",e)})}};var Tn=class extends w{list(){return c(this,null,function*(){return this.get("/api/services/clients")})}getCountAndGenerateCode(){return c(this,null,function*(){return this.get("/api/services/clients/count")})}retrieve(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}`)})}getApiKey(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/api-key`)})}rotateApiKey(e){return c(this,null,function*(){return this.post(`/api/services/clients/${e}/api-key`,{})})}create(e){return c(this,null,function*(){return this.post("/api/services/clients",e)})}getConfig(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/config`)})}updateConfig(e,s){return c(this,null,function*(){return this.patch(`/api/services/clients/${e}/config`,s)})}getSecrets(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/secrets`)})}updateSecrets(e,s){return c(this,null,function*(){return this.post(`/api/services/clients/${e}/secrets`,s)})}replaceSecrets(e,s){return c(this,null,function*(){return this.put(`/api/services/clients/${e}/secrets`,s)})}patchSecrets(e,s){return c(this,null,function*(){return this.patch(`/api/services/clients/${e}/secrets`,s)})}getDataSource(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/datasource`)})}manageDataSource(e,s){return c(this,null,function*(){return this.post(`/api/services/clients/${e}/datasource`,s)})}updateIdentity(e,s){return c(this,null,function*(){return this.patch(`/api/services/clients/${e}/identity`,s)})}googleReauth(i){return c(this,arguments,function*(e,s={}){return this.post(`/api/services/clients/${e}/google/reauth`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/services/clients/${e}`)})}},Sn=class extends w{list(){return c(this,null,function*(){return this.get("/api/services/blogs")})}},kn=class extends w{add(e){return c(this,null,function*(){return this.post("/api/services/add-lead",e)})}},gi=class extends w{constructor(s){super(s);k(this,"clients");k(this,"blogs");k(this,"globalLeads");this.clients=new Tn(s),this.blogs=new Sn(s),this.globalLeads=new kn(s)}};var Rn=class extends w{getConfig(){return c(this,null,function*(){return this.get("/api/settings/email")})}switchProvider(e){return c(this,null,function*(){return this.post("/api/settings/email/provider",{provider:e})})}saveSmtp(e){return c(this,null,function*(){return this.post("/api/settings/email/smtp",e)})}initDomainVerification(e){return c(this,null,function*(){return this.post("/api/settings/email/ses/domain",{domain:e})})}saveEmailConfig(e){return c(this,null,function*(){return this.post("/api/settings/email/ses/config",e)})}checkSesVerification(){return c(this,null,function*(){return this.get("/api/settings/email/ses/verify")})}removeSesIdentity(){return c(this,null,function*(){return this.deleteRequest("/api/settings/email/ses/domain")})}sendTest(e){return c(this,null,function*(){return this.post("/api/settings/email/test",{toEmail:e})})}saveAdvancedConfig(e){return c(this,null,function*(){return this.post("/api/settings/email/advanced",e)})}getHealth(){return c(this,null,function*(){return this.get("/api/settings/email/health")})}fixDmarc(){return c(this,null,function*(){return this.post("/api/settings/email/ses/fix-dmarc",{})})}listProviders(){return c(this,null,function*(){return this.get("/api/settings/email/providers")})}},yi=class extends w{constructor(s){super(s);k(this,"email");this.email=new Rn(s)}};var vi=class extends w{list(){return c(this,null,function*(){return this.get("/api/saas/cors")})}create(e){return c(this,null,function*(){return this.post("/api/saas/cors",e)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/cors/${e}`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/cors/${e}`)})}};var jy="https://api.ecodrix.com",as=class{constructor(e){k(this,"client");k(this,"socket");k(this,"clientCode");k(this,"whatsapp");k(this,"crm");k(this,"media");k(this,"meet");k(this,"notifications");k(this,"email");k(this,"logs");k(this,"events");k(this,"webhooks");k(this,"storage");k(this,"marketing");k(this,"health");k(this,"queue");k(this,"agency");k(this,"services");k(this,"settings");k(this,"cors");var l,u,p,m,f;if(!e.apiKey)throw new Vs("API Key is required");this.clientCode=(l=e.clientCode)==null?void 0:l.toUpperCase();let s=(u=e.baseUrl)!=null?u:jy,i=e.socketUrl||s,n=typeof window!="undefined"&&typeof window.document!="undefined",a=n?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",r=n?((p=globalThis.navigator)==null?void 0:p.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",o={"x-api-key":e.apiKey,"x-client-code":((m=e.clientCode)==null?void 0:m.toUpperCase())||"","Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:"1.0.0",runtime:a,os:r})};if(e.coreApiKey&&(o["x-core-api-key"]=e.coreApiKey),this.client=Mt.create({baseURL:s,headers:o}),Gi(this.client,{retries:3,retryDelay:Gi.exponentialDelay,retryCondition:g=>{var h;return Gi.isNetworkOrIdempotentRequestError(g)||((h=g.response)==null?void 0:h.status)===429},onRetry:(g,h,x)=>{var R,C;typeof process!="undefined"&&((R=process.env)==null?void 0:R.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${g}/3): ${(C=x.method)==null?void 0:C.toUpperCase()} ${x.url}. Reason: ${h.message}`)}}),this.whatsapp=new hi(this.client),this.crm=new ti(this.client),this.media=new ns(this.client),this.meet=new ri(this.client),this.notifications=new oi(this.client),this.email=new is(this.client),this.logs=new ni(this.client),this.events=new si(this.client),this.webhooks=new li,this.storage=new pi(this.client),this.marketing=new ai(this.client),this.health=new ii(this.client),this.queue=new ci(this.client),this.agency=new xi(this.client),this.services=new gi(this.client),this.settings=new yi(this.client),this.cors=new vi(this.client),this.socket=Hs(i,{extraHeaders:{"x-api-key":e.apiKey,"x-client-code":((f=e.clientCode)==null?void 0:f.toUpperCase())||""}}),this.setupSocket(e.clientCode),n){let g={version:"1.2.2",clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=g,window.ecodrix||(window.ecodrix=this)}}joinRoom(e){this.socket.emit("join-room",e)}leaveRoom(e){this.socket.emit("leave-room",e)}setupSocket(e){this.socket.on("connect",()=>{e&&this.socket.emit("join-room",e.toUpperCase())})}on(e,s){return this.socket.on(e,s),this}disconnect(){this.socket.disconnect()}off(e,s){return this.socket.off(e,s),this}request(e,s,i,n){return c(this,null,function*(){var a,r,o;try{return(yield this.client.request({method:e,url:s,data:i,params:n})).data}catch(l){throw l.response?new we(((a=l.response.data)==null?void 0:a.message)||((r=l.response.data)==null?void 0:r.error)||"Raw Execution Failed",l.response.status,(o=l.response.data)==null?void 0:o.code):new we(l.message||"Network Error")}})}};var Iy=as;return bd(Uy);})();
|
|
19
|
+
`+a):i.stack=a}catch(r){}}throw i}})}_request(e,s){typeof e=="string"?(s=s||{},s.url=e):s=e||{},s=Le(this.defaults,s);let{transitional:i,paramsSerializer:n,headers:a}=s;i!==void 0&&Ts.assertOptions(i,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean),legacyInterceptorReqResOrdering:Te.transitional(Te.boolean)},!1),n!=null&&(d.isFunction(n)?s.paramsSerializer={serialize:n}:Ts.assertOptions(n,{encode:Te.function,serialize:Te.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),Ts.assertOptions(s,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let r=a&&d.merge(a.common,a[s.method]);a&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete a[h]}),s.headers=W.concat(r,a);let o=[],l=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(s)===!1)return;l=l&&x.synchronous;let y=s.transitional||st;y&&y.legacyInterceptorReqResOrdering?o.unshift(x.fulfilled,x.rejected):o.push(x.fulfilled,x.rejected)});let u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let p,m=0,f;if(!l){let h=[Vi.bind(this),void 0];for(h.unshift(...o),h.push(...u),f=h.length,p=Promise.resolve(s);m<f;)p=p.then(h[m++],h[m++]);return p}f=o.length;let g=s;for(;m<f;){let h=o[m++],x=o[m++];try{g=h(g)}catch(y){x.call(this,y);break}}try{p=Vi.call(this,g)}catch(h){return Promise.reject(h)}for(m=0,f=u.length;m<f;)p=p.then(u[m++],u[m++]);return p}getUri(e){e=Le(this.defaults,e);let s=pt(e.baseURL,e.url,e.allowAbsoluteUrls);return ct(s,e.params,e.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(e){Ft.prototype[e]=function(s,i){return this.request(Le(i||{},{method:e,url:s,data:(i||{}).data}))}});d.forEach(["post","put","patch"],function(e){function s(i){return function(a,r,o){return this.request(Le(o||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:a,data:r}))}}Ft.prototype[e]=s(),Ft.prototype[e+"Form"]=s(!0)});var Ss=Ft;var Ma=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(a){s=a});let i=this;this.promise.then(n=>{if(!i._listeners)return;let a=i._listeners.length;for(;a-- >0;)i._listeners[a](n);i._listeners=null}),this.promise.then=n=>{let a,r=new Promise(o=>{i.subscribe(o),a=o}).then(n);return r.cancel=function(){i.unsubscribe(a)},r},e(function(a,r,o){i.reason||(i.reason=new ye(a,r,o),s(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){let e=new AbortController,s=i=>{e.abort(i)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new t(function(n){e=n}),cancel:e}}},dl=Ma;function za(t){return function(s){return t.apply(null,s)}}function $a(t){return d.isObject(t)&&t.isAxiosError===!0}var Ha={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(Ha).forEach(([t,e])=>{Ha[e]=t});var ml=Ha;function fl(t){let e=new Ss(t),s=os(Ss.prototype.request,e);return d.extend(s,Ss.prototype,e,{allOwnKeys:!0}),d.extend(s,e,null,{allOwnKeys:!0}),s.create=function(n){return fl(Le(t,n))},s}var Y=fl(Pt);Y.Axios=Ss;Y.CanceledError=ye;Y.CancelToken=dl;Y.isCancel=gs;Y.VERSION=mt;Y.toFormData=tt;Y.AxiosError=_;Y.Cancel=Y.CanceledError;Y.all=function(e){return Promise.all(e)};Y.spread=za;Y.isAxiosError=$a;Y.mergeConfig=Le;Y.AxiosHeaders=W;Y.formToJSON=t=>Bi(d.isHTMLForm(t)?new FormData(t):t);Y.getAdapter=Hi.getAdapter;Y.HttpStatusCode=ml;Y.default=Y;var Mt=Y;var{Axios:NE,AxiosError:qE,CanceledError:BE,isCancel:DE,CancelToken:jE,VERSION:IE,all:UE,Cancel:FE,isAxiosError:ME,spread:zE,toFormData:$E,AxiosHeaders:HE,HttpStatusCode:VE,formToJSON:WE,getAdapter:GE,mergeConfig:KE}=Mt;var yl=D(xl(),1);var Va="axios-retry";function vl(t){let e=["ERR_CANCELED","ECONNABORTED"];return t.response||!t.code||e.includes(t.code)?!1:(0,yl.default)(t)}var bl=["get","head","options"],Cx=bl.concat(["put","delete"]);function Wa(t){return t.code!=="ECONNABORTED"&&(!t.response||t.response.status===429||t.response.status>=500&&t.response.status<=599)}function Ax(t){var e;return(e=t.config)!=null&&e.method?Wa(t)&&bl.indexOf(t.config.method)!==-1:!1}function _l(t){var e;return(e=t.config)!=null&&e.method?Wa(t)&&Cx.indexOf(t.config.method)!==-1:!1}function wl(t){return vl(t)||_l(t)}function Ga(t=void 0){var i;let e=(i=t==null?void 0:t.response)==null?void 0:i.headers["retry-after"];if(!e)return 0;let s=(Number(e)||0)*1e3;return s===0&&(s=(new Date(e).valueOf()||0)-Date.now()),Math.max(0,s)}function Ox(t=0,e=void 0){return Math.max(0,Ga(e))}function Px(t=0,e=void 0,s=100){let i=jr(2,t)*s,n=Math.max(i,Ga(e)),a=n*.2*Math.random();return n+a}function Lx(t=100){return(e=0,s=void 0)=>{let i=e*t;return Math.max(i,Ga(s))}}var Nx={retries:3,retryCondition:wl,retryDelay:Ox,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function qx(t,e){return L(L(L({},Nx),e),t[Va])}function gl(t,e,s=!1){let i=qx(t,e||{});return i.retryCount=i.retryCount||0,(!i.lastRequestTime||s)&&(i.lastRequestTime=Date.now()),t[Va]=i,i}function Bx(t,e){t.defaults.agent===e.agent&&delete e.agent,t.defaults.httpAgent===e.httpAgent&&delete e.httpAgent,t.defaults.httpsAgent===e.httpsAgent&&delete e.httpsAgent}function Dx(t,e){return c(this,null,function*(){let{retries:s,retryCondition:i}=t,n=(t.retryCount||0)<s&&i(e);if(typeof n=="object")try{return(yield n)!==!1}catch(a){return!1}return n})}function jx(t,e,s,i){return c(this,null,function*(){var l;e.retryCount+=1;let{retryDelay:n,shouldResetTimeout:a,onRetry:r}=e,o=n(e.retryCount,s);if(Bx(t,i),!a&&i.timeout&&e.lastRequestTime){let u=Date.now()-e.lastRequestTime,p=i.timeout-u-o;if(p<=0)return Promise.reject(s);i.timeout=p}return i.transformRequest=[u=>u],yield r(e.retryCount,s,i),(l=i.signal)!=null&&l.aborted?Promise.resolve(t(i)):new Promise(u=>{var f;let p=()=>{clearTimeout(m),u(t(i))},m=setTimeout(()=>{var g;u(t(i)),(g=i.signal)!=null&&g.removeEventListener&&i.signal.removeEventListener("abort",p)},o);(f=i.signal)!=null&&f.addEventListener&&i.signal.addEventListener("abort",p,{once:!0})})})}function Ix(t,e){return c(this,null,function*(){t.retryCount>=t.retries&&(yield t.onMaxRetryTimesExceeded(e,t.retryCount))})}var it=(t,e)=>{let s=t.interceptors.request.use(n=>{var a;return gl(n,e,!0),(a=n[Va])!=null&&a.validateResponse&&(n.validateStatus=()=>!1),n}),i=t.interceptors.response.use(null,n=>c(null,null,function*(){var o;let{config:a}=n;if(!a)return Promise.reject(n);let r=gl(a,e);return n.response&&((o=r.validateResponse)!=null&&o.call(r,n.response))?n.response:(yield Dx(r,n))?jx(t,r,n,a):(yield Ix(r,n),Promise.reject(n))}));return{requestInterceptorId:s,responseInterceptorId:i}};it.isNetworkError=vl;it.isSafeRequestError=Ax;it.isIdempotentRequestError=_l;it.isNetworkOrIdempotentRequestError=wl;it.exponentialDelay=Px;it.linearDelay=Lx;it.isRetryableError=Wa;var Gi=it;var er=D(Sl(),1);var Ne=Object.create(null);Ne.open="0";Ne.close="1";Ne.ping="2";Ne.pong="3";Ne.message="4";Ne.upgrade="5";Ne.noop="6";var ks=Object.create(null);Object.keys(Ne).forEach(t=>{ks[Ne[t]]=t});var Rs={type:"error",data:"parser error"};var Cs=({type:t,data:e},s,i)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?i(s?e:"b"+kl(e,!0).toString("base64")):i(Ne[t]+(e||"")),kl=(t,e)=>Buffer.isBuffer(t)||t instanceof Uint8Array&&!e?t:t instanceof ArrayBuffer?Buffer.from(t):Buffer.from(t.buffer,t.byteOffset,t.byteLength),Ja;function Rl(t,e){if(t.data instanceof ArrayBuffer||ArrayBuffer.isView(t.data))return e(kl(t.data,!1));Cs(t,!0,s=>{Ja||(Ja=new TextEncoder),e(Ja.encode(s))})}var As=(t,e)=>{if(typeof t!="string")return{type:"message",data:Cl(t,e)};let s=t.charAt(0);if(s==="b"){let i=Buffer.from(t.substring(1),"base64");return{type:"message",data:Cl(i,e)}}return ks[s]?t.length>1?{type:ks[s],data:t.substring(1)}:{type:ks[s]}:Rs},Cl=(t,e)=>{switch(e){case"arraybuffer":return t instanceof ArrayBuffer?t:Buffer.isBuffer(t)?t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):t.buffer;case"nodebuffer":default:return Buffer.isBuffer(t)?t:Buffer.from(t)}};var Al="",Ol=(t,e)=>{let s=t.length,i=new Array(s),n=0;t.forEach((a,r)=>{Cs(a,!1,o=>{i[r]=o,++n===s&&e(i.join(Al))})})},Pl=(t,e)=>{let s=t.split(Al),i=[];for(let n=0;n<s.length;n++){let a=As(s[n],e);if(i.push(a),a.type==="error")break}return i};function Ll(){return new TransformStream({transform(t,e){Rl(t,s=>{let i=s.length,n;if(i<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,i);else if(i<65536){n=new Uint8Array(3);let a=new DataView(n.buffer);a.setUint8(0,126),a.setUint16(1,i)}else{n=new Uint8Array(9);let a=new DataView(n.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(i))}t.data&&typeof t.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(s)})}})}var Xa;function Ki(t){return t.reduce((e,s)=>e+s.length,0)}function Ji(t,e){if(t[0].length===e)return t.shift();let s=new Uint8Array(e),i=0;for(let n=0;n<e;n++)s[n]=t[0][i++],i===t[0].length&&(t.shift(),i=0);return t.length&&i<t[0].length&&(t[0]=t[0].slice(i)),s}function Nl(t,e){Xa||(Xa=new TextDecoder);let s=[],i=0,n=-1,a=!1;return new TransformStream({transform(r,o){for(s.push(r);;){if(i===0){if(Ki(s)<1)break;let l=Ji(s,1);a=(l[0]&128)===128,n=l[0]&127,n<126?i=3:n===126?i=1:i=2}else if(i===1){if(Ki(s)<2)break;let l=Ji(s,2);n=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),i=3}else if(i===2){if(Ki(s)<8)break;let l=Ji(s,8),u=new DataView(l.buffer,l.byteOffset,l.length),p=u.getUint32(0);if(p>Math.pow(2,21)-1){o.enqueue(Rs);break}n=p*Math.pow(2,32)+u.getUint32(4),i=3}else{if(Ki(s)<n)break;let l=Ji(s,n);o.enqueue(As(a?l:Xa.decode(l),e)),i=0}if(n===0||n>t){o.enqueue(Rs);break}}}})}var Ya=4;function $(t){if(t)return Fx(t)}function Fx(t){for(var e in $.prototype)t[e]=$.prototype[e];return t}$.prototype.on=$.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};$.prototype.once=function(t,e){function s(){this.off(t,s),e.apply(this,arguments)}return s.fn=e,this.on(t,s),this};$.prototype.off=$.prototype.removeListener=$.prototype.removeAllListeners=$.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+t];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n<s.length;n++)if(i=s[n],i===e||i.fn===e){s.splice(n,1);break}return s.length===0&&delete this._callbacks["$"+t],this};$.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),s=this._callbacks["$"+t],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(s){s=s.slice(0);for(var i=0,n=s.length;i<n;++i)s[i].apply(this,e)}return this};$.prototype.emitReserved=$.prototype.emit;$.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};$.prototype.hasListeners=function(t){return!!this.listeners(t).length};var Ve=process.nextTick,de=global,ql="nodebuffer";function Bl(){return new Qa}function Mx(t){let e=t.split("; "),s=e[0].indexOf("=");if(s===-1)return;let i=e[0].substring(0,s).trim();if(!i.length)return;let n=e[0].substring(s+1).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));let a={name:i,value:n};for(let r=1;r<e.length;r++){let o=e[r].split("=");if(o.length!==2)continue;let l=o[0].trim(),u=o[1].trim();switch(l){case"Expires":a.expires=new Date(u);break;case"Max-Age":let p=new Date;p.setUTCSeconds(p.getUTCSeconds()+parseInt(u,10)),a.expires=p;break;default:}}return a}var Qa=class{constructor(){this._cookies=new Map}parseCookies(e){e&&e.forEach(s=>{let i=Mx(s);i&&this._cookies.set(i.name,i)})}get cookies(){let e=Date.now();return this._cookies.forEach((s,i)=>{var n;((n=s.expires)===null||n===void 0?void 0:n.getTime())<e&&this._cookies.delete(i)}),this._cookies.entries()}addCookies(e){let s=[];for(let[i,n]of this.cookies)s.push(`${i}=${n.value}`);s.length&&(e.setDisableHeaderCheck(!0),e.setRequestHeader("cookie",s.join("; ")))}appendCookies(e){for(let[s,i]of this.cookies)e.append("cookie",`${s}=${i.value}`)}};function Xi(t,...e){return e.reduce((s,i)=>(t.hasOwnProperty(i)&&(s[i]=t[i]),s),{})}var zx=de.setTimeout,$x=de.clearTimeout;function We(t,e){e.useNativeTimers?(t.setTimeoutFn=zx.bind(de),t.clearTimeoutFn=$x.bind(de)):(t.setTimeoutFn=de.setTimeout.bind(de),t.clearTimeoutFn=de.clearTimeout.bind(de))}var Hx=1.33;function Dl(t){return typeof t=="string"?Vx(t):Math.ceil((t.byteLength||t.size)*Hx)}function Vx(t){let e=0,s=0;for(let i=0,n=t.length;i<n;i++)e=t.charCodeAt(i),e<128?s+=1:e<2048?s+=2:e<55296||e>=57344?s+=3:(i++,s+=4);return s}function Yi(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function jl(t){let e="";for(let s in t)t.hasOwnProperty(s)&&(e.length&&(e+="&"),e+=encodeURIComponent(s)+"="+encodeURIComponent(t[s]));return e}function Il(t){let e={},s=t.split("&");for(let i=0,n=s.length;i<n;i++){let a=s[i].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}var Ul=D(ve(),1),Wx=(0,Ul.default)("engine.io-client:transport"),Qi=class extends Error{constructor(e,s,i){super(e),this.description=s,this.context=i,this.type="TransportError"}},Ge=class extends ${constructor(e){super(),this.writable=!1,We(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,s,i){return super.emitReserved("error",new Qi(e,s,i)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"?this.write(e):Wx("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let s=As(e,this.socket.binaryType);this.onPacket(s)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,s={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(s)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let s=jl(e);return s.length?"?"+s:""}};var Fl=D(ve(),1),qe=(0,Fl.default)("engine.io-client:polling"),Os=class extends Ge{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let s=()=>{qe("paused"),this.readyState="paused",e()};if(this._polling||!this.writable){let i=0;this._polling&&(qe("we are currently polling - waiting to pause"),i++,this.once("pollComplete",function(){qe("pre-pause polling complete"),--i||s()})),this.writable||(qe("we are currently writing - waiting to pause"),i++,this.once("drain",function(){qe("pre-pause writing complete"),--i||s()}))}else s()}_poll(){qe("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){qe("polling got data %s",e);let s=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Pl(e,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this._poll():qe('ignoring poll - transport state "%s"',this.readyState))}doClose(){let e=()=>{qe("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(qe("transport open - closing"),e()):(qe("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,Ol(e,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=Yi()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(e,s)}};var Ml=!1;try{Ml=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch(t){}var zl=Ml;var Hl=D(ve(),1),Za=(0,Hl.default)("engine.io-client:polling");function Gx(){}var Zi=class extends Os{constructor(e){if(super(e),typeof location!="undefined"){let s=location.protocol==="https:",i=location.port;i||(i=s?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||i!==e.port}}doWrite(e,s){let i=this.request({method:"POST",data:e});i.on("success",s),i.on("error",(n,a)=>{this.onError("xhr post error",n,a)})}doPoll(){Za("xhr poll");let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(s,i)=>{this.onError("xhr poll error",s,i)}),this.pollXhr=e}},Ke=class t extends ${constructor(e,s,i){super(),this.createRequest=e,We(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var e;let s=Xi(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{Za("xhr open %s: %s",this._method,this._uri),i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch(n){}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(n){}try{i.setRequestHeader("Accept","*/*")}catch(n){}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},Za("xhr data %s",this._data),i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document!="undefined"&&(this._index=t.requestsCount++,t.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr=="undefined"||this._xhr===null)){if(this._xhr.onreadystatechange=Gx,e)try{this._xhr.abort()}catch(s){}typeof document!="undefined"&&delete t.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Ke.requestsCount=0;Ke.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",$l);else if(typeof addEventListener=="function"){let t="onpagehide"in de?"pagehide":"unload";addEventListener(t,$l,!1)}}function $l(){for(let t in Ke.requests)Ke.requests.hasOwnProperty(t)&&Ke.requests[t].abort()}var AT=(function(){let t=Kx({xdomain:!1});return t&&t.responseType!==null})();function Kx(t){let e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||zl))return new XMLHttpRequest}catch(s){}if(!e)try{return new de[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(s){}}var Jx=er.default||er,$t=class extends Zi{request(e={}){var s;return Object.assign(e,{xd:this.xd,cookieJar:(s=this.socket)===null||s===void 0?void 0:s._cookieJar},this.opts),new Ke(i=>new Jx(i),this.uri(),e)}};var fy=D(Uu(),1),hy=D(ur(),1),xy=D(fr(),1),wr=D(dn(),1),gy=D(Ku(),1);var Ju=D(ve(),1),vy=(0,Ju.default)("engine.io-client:websocket"),by=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",fn=class extends Ge{get name(){return"websocket"}doOpen(){let e=this.uri(),s=this.opts.protocols,i=by?{}:Xi(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,s,i)}catch(n){return this.emitReserved("error",n)}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 s=0;s<e.length;s++){let i=e[s],n=s===e.length-1;Cs(i,this.supportsBinary,a=>{try{this.doWrite(i,a)}catch(r){vy("websocket closed before onclose event")}n&&Ve(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=Yi()),this.supportsBinary||(s.b64=1),this.createUri(e,s)}},a0=de.WebSocket||de.MozWebSocket;var Yt=class extends fn{createSocket(e,s,i){var n;if(!((n=this.socket)===null||n===void 0)&&n._cookieJar){i.headers=i.headers||{},i.headers.cookie=typeof i.headers.cookie=="string"?[i.headers.cookie]:i.headers.cookie||[];for(let[a,r]of this.socket._cookieJar.cookies)i.headers.cookie.push(`${a}=${r.value}`)}return new wr.default(e,s,i)}doWrite(e,s){let i={};e.options&&(i.compress=e.options.compress),this.opts.perMessageDeflate&&(typeof s=="string"?Buffer.byteLength(s):s.length)<this.opts.perMessageDeflate.threshold&&(i.compress=!1),this.ws.send(s,i)}};var Xu=D(ve(),1),Us=(0,Xu.default)("engine.io-client:webtransport"),Qt=class extends Ge{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(()=>{Us("transport closed gracefully"),this.onClose()}).catch(e=>{Us("transport closed due to %s",e),this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let s=Nl(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=e.readable.pipeThrough(s).getReader(),n=Ll();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();let a=()=>{i.read().then(({done:o,value:l})=>{if(o){Us("session is closed");return}Us("received chunk: %o",l),this.onPacket(l),a()}).catch(o=>{Us("an error occurred while reading: %s",o)})};a();let r={type:"open"};this.query.sid&&(r.data=`{"sid":"${this.query.sid}"}`),this._writer.write(r).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let s=0;s<e.length;s++){let i=e[s],n=s===e.length-1;this._writer.write(i).then(()=>{n&&Ve(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var Er={websocket:Yt,webtransport:Qt,polling:$t};var _y=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Zt(t){if(t.length>8e3)throw"URI too long";let e=t,s=t.indexOf("["),i=t.indexOf("]");s!=-1&&i!=-1&&(t=t.substring(0,s)+t.substring(s,i).replace(/:/g,";")+t.substring(i,t.length));let n=_y.exec(t||""),a={},r=14;for(;r--;)a[wy[r]]=n[r]||"";return s!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Ey(a,a.path),a.queryKey=Ty(a,a.query),a}function Ey(t,e){let s=/\/{2,9}/g,i=e.replace(s,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&i.splice(0,1),e.slice(-1)=="/"&&i.splice(i.length-1,1),i}function Ty(t,e){let s={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,n,a){n&&(s[n]=a)}),s}var Yu=D(ve(),1),z=(0,Yu.default)("engine.io-client:socket"),Tr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fs=[];Tr&&addEventListener("offline",()=>{z("closing %d connection(s) because the network was lost",Fs.length),Fs.forEach(t=>t())},!1);var bt=class t extends ${constructor(e,s){if(super(),this.binaryType=ql,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(s=e,e=null),e){let i=Zt(e);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=Zt(s.host).host);We(this,s),this.secure=s.secure!=null?s.secure:typeof location!="undefined"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=s.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),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},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Il(this.opts.query)),Tr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(z("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fs.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=Bl()),this._open()}createTransport(e){z('creating transport "%s"',e);let s=Object.assign({},this.opts.query);s.EIO=Ya,s.transport=e,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return z("options: %j",i),new this._transportsByName[e](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let e=this.opts.rememberUpgrade&&t.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(e);s.open(),this.setTransport(s)}setTransport(e){z("setting transport %s",e.name),this.transport&&(z("clearing existing transport %s",this.transport.name),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",s=>this._onClose("transport close",s))}onOpen(){z("socket open"),this.readyState="open",t.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(z('socket receive: type "%s", data "%s"',e.type,e.data),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":let s=new Error("server error");s.code=e.data,this._onError(s);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}else z('packet received with socket readyState "%s"',this.readyState)}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(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let 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,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();z("flushing %d packets in socket",e.length),this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Dl(n)),i>0&&s>this._maxPayload)return z("only send %d out of %d packets",i,this.writeBuffer.length),this.writeBuffer.slice(0,i);s+=2}return z("payload size is %d (max: %d)",s,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(z("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,Ve(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,s,i){return this._sendPacket("message",e,s,i),this}send(e,s,i){return this._sendPacket("message",e,s,i),this}_sendPacket(e,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let a={type:e,data:s,options:i};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),z("socket closing - telling transport to close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),e()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}_onError(e){if(z("socket error %j",e),t.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return z("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(z('socket close with reason: "%s"',e),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Tr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Fs.indexOf(this._offlineEventListener);i!==-1&&(z("removing listener for the 'offline' event"),Fs.splice(i,1))}this.readyState="closed",this.id=null,this.emitReserved("close",e,s),this.writeBuffer=[],this._prevBufferLen=0}}};bt.protocol=Ya;var hn=class extends bt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade){z("starting upgrade probes");for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}}_probe(e){z('probing transport "%s"',e);let s=this.createTransport(e),i=!1;bt.priorWebsocketSuccess=!1;let n=()=>{i||(z('probe transport "%s" opened',e),s.send([{type:"ping",data:"probe"}]),s.once("packet",m=>{if(!i)if(m.type==="pong"&&m.data==="probe"){if(z('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;bt.priorWebsocketSuccess=s.name==="websocket",z('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{i||this.readyState!=="closed"&&(z("changing transport and sending upgrade packet"),p(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{z('probe transport "%s" failed',e);let f=new Error("probe error");f.transport=s.name,this.emitReserved("upgradeError",f)}}))};function a(){i||(i=!0,p(),s.close(),s=null)}let r=m=>{let f=new Error("probe error: "+m);f.transport=s.name,a(),z('probe transport "%s" failed because of error: %s',e,m),this.emitReserved("upgradeError",f)};function o(){r("transport closed")}function l(){r("socket closed")}function u(m){s&&m.name!==s.name&&(z('"%s" works - aborting "%s"',m.name,s.name),a())}let p=()=>{s.removeListener("open",n),s.removeListener("error",r),s.removeListener("close",o),this.off("close",l),this.off("upgrading",u)};s.once("open",n),s.once("error",r),s.once("close",o),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{i||s.open()},200):s.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let s=[];for(let i=0;i<e.length;i++)~this.transports.indexOf(e[i])&&s.push(e[i]);return s}},es=class extends hn{constructor(e,s={}){let i=typeof e=="object"?e:s;(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(n=>Er[n]).filter(n=>!!n)),super(e,i)}};var A0=es.protocol;var Zu=D(ve(),1),Qu=(0,Zu.default)("socket.io-client:url");function ed(t,e="",s){let i=t;s=s||typeof location!="undefined"&&location,t==null&&(t=s.protocol+"//"+s.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=s.protocol+t:t=s.host+t),/^(https?|wss?):\/\//.test(t)||(Qu("protocol-less url %s",t),typeof s!="undefined"?t=s.protocol+"//"+t:t="https://"+t),Qu("parse %s",t),i=Zt(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let a=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+a+":"+i.port+e,i.href=i.protocol+"://"+a+(s&&s.port===i.port?"":":"+i.port),i}var Pr={};On(Pr,{Decoder:()=>Ar,Encoder:()=>Cr,PacketType:()=>O,isPacketValid:()=>By,protocol:()=>rd});var Cy=typeof ArrayBuffer=="function",Ay=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,td=Object.prototype.toString,Oy=typeof Blob=="function"||typeof Blob!="undefined"&&td.call(Blob)==="[object BlobConstructor]",Py=typeof File=="function"||typeof File!="undefined"&&td.call(File)==="[object FileConstructor]";function zs(t){return Cy&&(t instanceof ArrayBuffer||Ay(t))||Oy&&t instanceof Blob||Py&&t instanceof File}function Ms(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let s=0,i=t.length;s<i;s++)if(Ms(t[s]))return!0;return!1}if(zs(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ms(t.toJSON(),!0);for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Ms(t[s]))return!0;return!1}function sd(t){let e=[],s=t.data,i=t;return i.data=Sr(s,e),i.attachments=e.length,{packet:i,buffers:e}}function Sr(t,e){if(!t)return t;if(zs(t)){let s={_placeholder:!0,num:e.length};return e.push(t),s}else if(Array.isArray(t)){let s=new Array(t.length);for(let i=0;i<t.length;i++)s[i]=Sr(t[i],e);return s}else if(typeof t=="object"&&!(t instanceof Date)){let s={};for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=Sr(t[i],e));return s}return t}function id(t,e){return t.data=kr(t.data,e),delete t.attachments,t}function kr(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let s=0;s<t.length;s++)t[s]=kr(t[s],e);else if(typeof t=="object")for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&(t[s]=kr(t[s],e));return t}var nd=D(ve(),1),Rr=(0,nd.default)("socket.io-parser"),ad=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],rd=5,O;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(O||(O={}));var Cr=class{constructor(e){this.replacer=e}encode(e){return Rr("encoding packet %j",e),(e.type===O.EVENT||e.type===O.ACK)&&Ms(e)?this.encodeAsBinary({type:e.type===O.EVENT?O.BINARY_EVENT:O.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let s=""+e.type;return(e.type===O.BINARY_EVENT||e.type===O.BINARY_ACK)&&(s+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(s+=e.nsp+","),e.id!=null&&(s+=e.id),e.data!=null&&(s+=JSON.stringify(e.data,this.replacer)),Rr("encoded %j as %s",e,s),s}encodeAsBinary(e){let s=sd(e),i=this.encodeAsString(s.packet),n=s.buffers;return n.unshift(i),n}},Ar=class t extends ${constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let s;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(e);let i=s.type===O.BINARY_EVENT;i||s.type===O.BINARY_ACK?(s.type=i?O.EVENT:O.ACK,this.reconstructor=new Or(s),s.attachments===0&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else if(zs(e)||e.base64)if(this.reconstructor)s=this.reconstructor.takeBinaryData(e),s&&(this.reconstructor=null,super.emitReserved("decoded",s));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let s=0,i={type:Number(e.charAt(0))};if(O[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===O.BINARY_EVENT||i.type===O.BINARY_ACK){let a=s+1;for(;e.charAt(++s)!=="-"&&s!=e.length;);let r=e.substring(a,s);if(r!=Number(r)||e.charAt(s)!=="-")throw new Error("Illegal attachments");let o=Number(r);if(!od(o)||o<0)throw new Error("Illegal attachments");if(o>this.opts.maxAttachments)throw new Error("too many attachments");i.attachments=o}if(e.charAt(s+1)==="/"){let a=s+1;for(;++s&&!(e.charAt(s)===","||s===e.length););i.nsp=e.substring(a,s)}else i.nsp="/";let n=e.charAt(s+1);if(n!==""&&Number(n)==n){let a=s+1;for(;++s;){let r=e.charAt(s);if(r==null||Number(r)!=r){--s;break}if(s===e.length)break}i.id=Number(e.substring(a,s+1))}if(e.charAt(++s)){let a=this.tryParse(e.substr(s));if(t.isPayloadValid(i.type,a))i.data=a;else throw new Error("invalid payload")}return Rr("decoded %s as %j",e,i),i}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(s){return!1}}static isPayloadValid(e,s){switch(e){case O.CONNECT:return xn(s);case O.DISCONNECT:return s===void 0;case O.CONNECT_ERROR:return typeof s=="string"||xn(s);case O.EVENT:case O.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&ad.indexOf(s[0])===-1);case O.ACK:case O.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Or=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let s=id(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Ly(t){return typeof t=="string"}var od=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function Ny(t){return t===void 0||od(t)}function xn(t){return Object.prototype.toString.call(t)==="[object Object]"}function qy(t,e){switch(t){case O.CONNECT:return e===void 0||xn(e);case O.DISCONNECT:return e===void 0;case O.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&ad.indexOf(e[0])===-1);case O.ACK:return Array.isArray(e);case O.CONNECT_ERROR:return typeof e=="string"||xn(e);default:return!1}}function By(t){return Ly(t.nsp)&&Ny(t.id)&&qy(t.type,t.data)}function _e(t,e,s){return t.on(e,s),function(){t.off(e,s)}}var cd=D(ve(),1),Q=(0,cd.default)("socket.io-client:socket"),Dy=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),ts=class extends ${constructor(e,s,i){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=s,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[_e(e,"open",this.onopen.bind(this)),_e(e,"packet",this.onpacket.bind(this)),_e(e,"error",this.onerror.bind(this)),_e(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...s){var i,n,a;if(Dy.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(s.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;let r={type:O.EVENT,data:s};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){let p=this.ids++;Q("emitting packet with ack id %d",p);let m=s.pop();this._registerAckCallback(p,m),r.id=p}let o=(n=(i=this.io.engine)===null||i===void 0?void 0:i.transport)===null||n===void 0?void 0:n.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!o?Q("discard packet as the transport is not currently writable"):l?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(e,s){var i;let n=(i=this.flags.timeout)!==null&&i!==void 0?i:this._opts.ackTimeout;if(n===void 0){this.acks[e]=s;return}let a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&(Q("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(o,1));Q("event with ack id %d has timed out after %d ms",e,n),s.call(this,new Error("operation has timed out"))},n),r=(...o)=>{this.io.clearTimeoutFn(a),s.apply(this,o)};r.withError=!0,this.acks[e]=r}emitWithAck(e,...s){return new Promise((i,n)=>{let a=(r,o)=>r?n(r):i(o);a.withError=!0,s.push(a),this.emit(e,...s)})}_addToQueue(e){let s;typeof e[e.length-1]=="function"&&(s=e.pop());let i={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...a)=>i!==this._queue[0]?Q("packet [%d] already acknowledged",i.id):(n!==null?i.tryCount>this._opts.retries&&(Q("packet [%d] is discarded after %d tries",i.id,i.tryCount),this._queue.shift(),s&&s(n)):(Q("packet [%d] was successfully sent",i.id),this._queue.shift(),s&&s(null,...a)),i.pending=!1,this._drainQueue())),this._queue.push(i),this._drainQueue()}_drainQueue(e=!1){if(Q("draining queue"),!this.connected||this._queue.length===0)return;let s=this._queue[0];if(s.pending&&!e){Q("packet [%d] has already been sent and is waiting for an ack",s.id);return}s.pending=!0,s.tryCount++,Q("sending packet [%d] (try n\xB0%d)",s.id,s.tryCount),this.flags=s.flags,this.emit.apply(this,s.args)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){Q("transport is open - connecting"),typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:O.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,s){Q("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case O.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 O.EVENT:case O.BINARY_EVENT:this.onevent(e);break;case O.ACK:case O.BINARY_ACK:this.onack(e);break;case O.DISCONNECT:this.ondisconnect();break;case O.CONNECT_ERROR:this.destroy();let i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){let s=e.data||[];Q("emitting event %j",s),e.id!=null&&(Q("attaching ack callback to event"),s.push(this.ack(e.id))),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let s=this._anyListeners.slice();for(let i of s)i.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let s=this,i=!1;return function(...n){i||(i=!0,Q("sending ack %j",n),s.packet({type:O.ACK,id:e,data:n}))}}onack(e){let s=this.acks[e.id];if(typeof s!="function"){Q("bad ack %s",e.id);return}delete this.acks[e.id],Q("calling ack %s with %j",e.id,e.data),s.withError&&e.data.unshift(null),s.apply(this,e.data)}onconnect(e,s){Q("socket connected with id %s",e),this.id=e,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){Q("server disconnect (%s)",this.nsp),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&&(Q("performing disconnect (%s)",this.nsp),this.packet({type:O.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){let s=this._anyListeners;for(let i=0;i<s.length;i++)if(e===s[i])return s.splice(i,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){let s=this._anyOutgoingListeners;for(let i=0;i<s.length;i++)if(e===s[i])return s.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let s=this._anyOutgoingListeners.slice();for(let i of s)i.apply(this,e.data)}}};function _t(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}_t.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),s=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-s:t+s}return Math.min(t,this.max)|0};_t.prototype.reset=function(){this.attempts=0};_t.prototype.setMin=function(t){this.ms=t};_t.prototype.setMax=function(t){this.max=t};_t.prototype.setJitter=function(t){this.jitter=t};var pd=D(ve(),1),oe=(0,pd.default)("socket.io-client:manager"),ss=class extends ${constructor(e,s){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(s=e,e=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,We(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((i=s.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new _t({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=e;let n=s.parser||Pr;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var s;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(s=this.backoff)===null||s===void 0||s.setMin(e),this)}randomizationFactor(e){var s;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(s=this.backoff)===null||s===void 0||s.setJitter(e),this)}reconnectionDelayMax(e){var s;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(s=this.backoff)===null||s===void 0||s.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(oe("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;oe("opening %s",this.uri),this.engine=new es(this.uri,this.opts);let s=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let n=_e(s,"open",function(){i.onopen(),e&&e()}),a=o=>{oe("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},r=_e(s,"error",a);if(this._timeout!==!1){let o=this._timeout;oe("connect attempt will timeout after %d",o);let l=this.setTimeoutFn(()=>{oe("connect attempt timed out after %d",o),n(),a(new Error("timeout")),s.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(n),this.subs.push(r),this}connect(e){return this.open(e)}onopen(){oe("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(_e(e,"ping",this.onping.bind(this)),_e(e,"data",this.ondata.bind(this)),_e(e,"error",this.onerror.bind(this)),_e(e,"close",this.onclose.bind(this)),_e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(s){this.onclose("parse error",s)}}ondecoded(e){Ve(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){oe("error",e),this.emitReserved("error",e)}socket(e,s){let i=this.nsps[e];return i?this._autoConnect&&!i.active&&i.connect():(i=new ts(this,e,s),this.nsps[e]=i),i}_destroy(e){let s=Object.keys(this.nsps);for(let i of s)if(this.nsps[i].active){oe("socket %s is still active, skipping close",i);return}this._close()}_packet(e){oe("writing packet %j",e);let s=this.encoder.encode(e);for(let i=0;i<s.length;i++)this.engine.write(s[i],e.options)}cleanup(){oe("cleanup"),this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){oe("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,s){var i;oe("closed due to %s",e),this.cleanup(),(i=this.engine)===null||i===void 0||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)oe("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let s=this.backoff.duration();oe("will wait %dms before reconnect attempt",s),this._reconnecting=!0;let i=this.setTimeoutFn(()=>{e.skipReconnect||(oe("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(oe("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):(oe("reconnect success"),e.onreconnect())}))},s);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var ud=D(ve(),1),ld=(0,ud.default)("socket.io-client"),$s={};function Hs(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};let s=ed(t,e.path||"/socket.io"),i=s.source,n=s.id,a=s.path,r=$s[n]&&a in $s[n].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||r,l;return o?(ld("ignoring socket cache for %s",i),l=new ss(i,e)):($s[n]||(ld("new io instance for %s",i),$s[n]=new ss(i,e)),l=$s[n]),s.query&&!e.query&&(e.query=s.queryKey),l.socket(s.path,e)}Object.assign(Hs,{Manager:ss,Socket:ts,io:Hs,connect:Hs});var gn=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},we=class extends gn{constructor(s,i,n){super(s);k(this,"status");k(this,"code");this.name="APIError",this.status=i,this.code=n}},Vs=class extends we{constructor(e="Invalid API Key or Client Code"){super(e,401,"AUTH_FAILED"),this.name="AuthenticationError"}},Lr=class extends we{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};var w=class{constructor(e){this.client=e}post(e,s,i){return c(this,null,function*(){try{let n=this.buildConfig(i);return(yield this.client.post(e,s,n)).data}catch(n){this.handleError(n)}})}get(e,s){return c(this,null,function*(){try{let i=this.buildConfig(s);return(yield this.client.get(e,i)).data}catch(i){this.handleError(i)}})}patch(e,s,i){return c(this,null,function*(){try{let n=this.buildConfig(i);return(yield this.client.patch(e,s,n)).data}catch(n){this.handleError(n)}})}put(e,s,i){return c(this,null,function*(){try{let n=this.buildConfig(i);return(yield this.client.put(e,s,n)).data}catch(n){this.handleError(n)}})}deleteRequest(e,s){return c(this,null,function*(){try{let i=this.buildConfig(s);return(yield this.client.delete(e,i)).data}catch(i){this.handleError(i)}})}buildConfig(e){if(!e)return;let s=L({},e);return e.idempotencyKey&&(s.headers=re(L({},s.headers),{"Idempotency-Key":e.idempotencyKey})),s}handleError(e){var s,i,n;throw e.response?new we(((s=e.response.data)==null?void 0:s.message)||((i=e.response.data)==null?void 0:i.error)||"API Request Failed",e.response.status,(n=e.response.data)==null?void 0:n.code):new we(e.message||"Network Error")}};var yn=class extends w{list(e){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}/notes`)})}create(e,s){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/notes`,s)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/notes/${e}`,{content:s})})}pin(e,s=!0){return c(this,null,function*(){return this.patch(`/api/crm/notes/${e}/pin`,{isPinned:s})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/notes/${e}`)})}},Ws=class extends w{constructor(s){super(s);k(this,"notes");this.notes=new yn(s)}timeline(s,i){return c(this,null,function*(){return this.get(`/api/crm/leads/${s}/timeline`,{params:i})})}list(s,i){return c(this,null,function*(){return this.get(`/api/crm/leads/${s}/activities`,{params:L({},i)})})}log(s){return c(this,null,function*(){return this.post(`/api/crm/leads/${s.leadId}/activities`,s)})}logCall(s,i){return c(this,null,function*(){return this.post(`/api/crm/leads/${s}/calls`,i)})}};var Gs=class extends w{overview(e){return c(this,null,function*(){return this.get("/api/crm/analytics/overview",{params:e})})}funnel(e){return c(this,null,function*(){return this.get("/api/crm/analytics/funnel",{params:{pipelineId:e}})})}forecast(e){return c(this,null,function*(){return this.get("/api/crm/analytics/forecast",{params:{pipelineId:e}})})}sources(e){return c(this,null,function*(){return this.get("/api/crm/analytics/sources",{params:e})})}team(e){return c(this,null,function*(){return this.get("/api/crm/analytics/team",{params:e})})}heatmap(e){return c(this,null,function*(){return this.get("/api/crm/analytics/heatmap",{params:e})})}scores(){return c(this,null,function*(){return this.get("/api/crm/analytics/scores")})}stageTime(e){return c(this,null,function*(){return this.get("/api/crm/analytics/stage-time",{params:{pipelineId:e}})})}tiered(e){return c(this,null,function*(){return this.get("/api/crm/analytics/tiered",{params:e})})}summary(e){return c(this,null,function*(){return this.get("/api/crm/analytics/summary",{params:e})})}whatsapp(e){return c(this,null,function*(){return this.get("/api/crm/analytics/whatsapp",{params:e})})}};var Ks=class extends w{stats(){return c(this,null,function*(){return this.get("/api/crm/automation/stats")})}logs(e){return c(this,null,function*(){return this.get("/api/crm/automation/logs",{params:e})})}retryFailedEvent(e){return c(this,null,function*(){return this.post(`/api/crm/automation/logs/${e}/retry`,{})})}};var Js=class extends w{list(){return c(this,null,function*(){return this.get("/api/crm/automations")})}create(e){return c(this,null,function*(){return this.post("/api/crm/automations",e)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/automations/${e}`,s)})}toggle(e){return c(this,null,function*(){return this.patch(`/api/crm/automations/${e}/toggle`)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/automations/${e}`)})}bulkDelete(e){return c(this,null,function*(){return this.post("/api/crm/automations/bulk-delete",{ids:e})})}test(e,s){return c(this,null,function*(){return this.post(`/api/crm/automations/${e}/test`,{leadId:s})})}getAvailableEvents(){return c(this,null,function*(){return this.post("/api/crm/automations/events",{})})}enrollments(e,s){return c(this,null,function*(){return this.get(`/api/crm/automations/${e}/enrollments`,{params:s})})}getEnrollment(e){return c(this,null,function*(){return this.get(`/api/crm/automations/enrollments/${e}`)})}pauseEnrollment(e,s){return c(this,null,function*(){return this.post(`/api/crm/automations/${e}/enrollments/${s}/pause`,{})})}resumeEnrollment(e,s){return c(this,null,function*(){return this.post(`/api/crm/automations/${e}/enrollments/${s}/resume`,{})})}runs(e){return c(this,null,function*(){return this.get(`/api/crm/automations/${e}/runs`)})}getRun(e){return c(this,null,function*(){return this.get(`/api/crm/automations/runs/${e}`)})}resumeRun(e){return c(this,null,function*(){return this.post(`/api/crm/automations/runs/${e}/resume`,{})})}abortRun(e){return c(this,null,function*(){return this.post(`/api/crm/automations/runs/${e}/abort`,{})})}webhookEvent(e,s,i){return c(this,null,function*(){return this.post("/api/crm/webhook-event",{ruleId:e,eventName:s,payload:i})})}};var Xs=class extends w{create(e){return c(this,null,function*(){return this.post("/api/crm/leads",e)})}describe(){return c(this,null,function*(){let e=yield this.fields(),s=Array.isArray(e.data)?e.data:[],i=[{key:"firstName",label:"First Name",type:"string",required:!0,group:"Basic Info"},{key:"lastName",label:"Last Name",type:"string",required:!1,group:"Basic Info"},{key:"phone",label:"Phone Number",type:"phone",required:!0,group:"Contact"},{key:"email",label:"Email Address",type:"email",required:!1,group:"Contact"},{key:"status",label:"Status",type:"select",required:!0,options:[{label:"New",value:"new"},{label:"Contacted",value:"contacted"},{label:"Qualified",value:"qualified"},{label:"Won",value:"won"},{label:"Lost",value:"lost"}]},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],n=s.map(a=>({key:`metadata.extra.${a.name}`,label:a.label||a.name,type:a.type||"string",required:!!a.required,options:a.options,group:"Custom Fields"}));return{name:"Lead",fields:[...i,...n],uiHints:{icon:"User",primaryColor:"#3b82f6",defaultSort:{field:"createdAt",direction:"desc"},summaryFields:["firstName","lastName","phone","status"]}}})}upsert(e){return c(this,null,function*(){return this.post("/api/crm/leads/upsert",e)})}createMany(e,s=50){return c(this,null,function*(){let i=[];for(let n=0;n<e.length;n+=s){let r=e.slice(n,n+s).map(l=>this.create(l)),o=yield Promise.allSettled(r);for(let l of o)if(l.status==="fulfilled")i.push(l.value);else throw l.reason}return i})}import(e){return c(this,null,function*(){return this.post("/api/crm/leads/import",{leads:e})})}list(e){return c(this,null,function*(){let s=L({},e);return Array.isArray(s.tags)&&(s.tags=s.tags.join(",")),this.get("/api/crm/leads",{params:s})})}listAutoPaging(e){return je(this,null,function*(){let s=(e==null?void 0:e.page)||1,i=!0;for(;i;){let n=yield new Ce(this.list(re(L({},e),{page:s}))),a=Array.isArray(n.data)?n.data:n||[];if(a.length===0){i=!1;break}for(let r of a)yield r;n.pagination&&s<n.pagination.pages||!n.pagination&&a.length>0?s++:i=!1}})}retrieve(e){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}`)})}retrieveByPhone(e){return c(this,null,function*(){return this.get(`/api/crm/leads/phone/${encodeURIComponent(e)}`)})}retrieveByRef(e,s){return c(this,null,function*(){return this.get(`/api/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(s)}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}`,s)})}move(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}/move`,{stageId:s})})}convert(e,s,i){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/convert`,{outcome:s,reason:i})})}tags(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}/tags`,s)})}recalculateScore(e){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/score`,{})})}updateMetadata(e,s){return c(this,null,function*(){return this.patch(`/api/crm/leads/${e}/metadata`,s)})}fields(){return c(this,null,function*(){return this.get("/api/crm/leads/fields")})}notes(e){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}/notes`)})}activities(e,s){return c(this,null,function*(){return this.get(`/api/crm/leads/${e}/timeline`,{params:s})})}createNote(e,s){return c(this,null,function*(){return this.post(`/api/crm/leads/${e}/notes`,s)})}updateNote(e,s,i){return c(this,null,function*(){return this.patch(`/api/crm/notes/${s}`,i)})}deleteNote(e,s){return c(this,null,function*(){return this.deleteRequest(`/api/crm/notes/${s}`)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/leads/${e}`)})}bulkDelete(e){return c(this,null,function*(){return this.deleteRequest("/api/crm/leads",{data:{ids:e}})})}};var Ys=class extends w{capture(e){return c(this,null,function*(){return this.post("/api/crm/payments/capture",e)})}};var Qs=class extends w{list(){return c(this,null,function*(){return this.get("/api/crm/pipelines")})}getStageManifest(e){return c(this,null,function*(){var n,a;let s=yield this.retrieve(e),i=Array.isArray((n=s.data)==null?void 0:n.stages)?s.data.stages:[];return{name:`Pipeline: ${((a=s.data)==null?void 0:a.name)||e}`,fields:i.map(r=>({key:r._id,label:r.name,type:"string",required:!0,options:[{label:r.name,value:r._id}],group:"Stages",uiHints:{color:r.color||"#cbd5e1",probability:r.probability}})),uiHints:{icon:"Columns",primaryColor:"#6366f1"}}})}create(e){return c(this,null,function*(){return this.post("/api/crm/pipelines",e)})}retrieve(e){return c(this,null,function*(){return this.get(`/api/crm/pipelines/${e}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}`,s)})}setDefault(e){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}/default`,{})})}duplicate(e,s){return c(this,null,function*(){return this.post(`/api/crm/pipelines/${e}/duplicate`,{newName:s})})}archive(e){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}/archive`,{})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/pipelines/${e}`)})}checkInUse(e){return c(this,null,function*(){return this.get(`/api/crm/pipelines/${e}/in-use`)})}board(e){return c(this,null,function*(){return this.get(`/api/crm/pipelines/${e}/board`)})}forecast(e){return c(this,null,function*(){return this.get(`/api/crm/pipelines/${e}/forecast`)})}addStage(e,s){return c(this,null,function*(){return this.post(`/api/crm/pipelines/${e}/stages`,s)})}reorderStages(e,s){return c(this,null,function*(){return this.patch(`/api/crm/pipelines/${e}/stages/reorder`,{order:s})})}updateStage(e,s){return c(this,null,function*(){return this.patch(`/api/crm/stages/${e}`,s)})}deleteStage(e,s){return c(this,null,function*(){return this.deleteRequest(`/api/crm/stages/${e}`,{data:s?{moveLeadsToStageId:s}:void 0})})}};var Zs=class extends w{getConfig(){return c(this,null,function*(){return this.get("/api/crm/scoring")})}updateConfig(e){return c(this,null,function*(){return this.patch("/api/crm/scoring",e)})}recalculate(e){return c(this,null,function*(){return this.post(`/api/crm/scoring/${e}/recalculate`,{})})}};var ei=class extends w{enroll(e){return c(this,null,function*(){return this.post("/api/crm/sequences/enroll",e)})}unenroll(e){return c(this,null,function*(){return this.deleteRequest(`/api/crm/sequences/unenroll/${e}`)})}listForLead(e){return c(this,null,function*(){return this.get(`/api/crm/sequences/lead/${e}`)})}};var ti=class{constructor(e){k(this,"leads");k(this,"pipelines");k(this,"activities");k(this,"analytics");k(this,"automations");k(this,"sequences");k(this,"scoring");k(this,"payments");k(this,"automationDashboard");this.leads=new Xs(e),this.pipelines=new Qs(e),this.activities=new Ws(e),this.analytics=new Gs(e),this.automations=new Js(e),this.sequences=new ei(e),this.scoring=new Zs(e),this.payments=new Ys(e),this.automationDashboard=new Ks(e)}};var is=class extends w{sendCampaign(e){return c(this,null,function*(){return this.post("/api/saas/emails/campaign",e)})}sendTest(e){return c(this,null,function*(){return this.post("/api/saas/emails/test",{to:e})})}listTemplates(e){return c(this,null,function*(){return this.get("/api/saas/mail/templates",{params:e})})}getTemplate(e){return c(this,null,function*(){return this.get(`/api/saas/mail/templates/${e}`)})}createTemplate(e){return c(this,null,function*(){return this.post("/api/saas/mail/templates",e)})}updateTemplate(e,s){return c(this,null,function*(){return this.put(`/api/saas/mail/templates/${e}`,s)})}deleteTemplate(e,s=!1){return c(this,null,function*(){return this.deleteRequest(`/api/saas/mail/templates/${e}`,{params:{force:s}})})}previewTemplate(e,s){return c(this,null,function*(){return this.post(`/api/saas/mail/templates/${e}/preview`,s)})}},Nr=class extends is{};var si=class extends w{list(){return c(this,null,function*(){return this.get("/api/saas/events")})}assign(e){return c(this,null,function*(){return this.post("/api/saas/events/assign",e)})}unassign(e){return c(this,null,function*(){return this.post("/api/saas/events/unassign",{name:e})})}unassignBulk(e){return c(this,null,function*(){return this.post("/api/saas/events/unassign/bulk",{names:e})})}trigger(e){return c(this,null,function*(){return this.post("/api/saas/workflows/trigger",e)})}listCustomEvents(){return c(this,null,function*(){return this.get("/api/saas/crm/custom-events")})}createCustomEvent(e){return c(this,null,function*(){return this.post("/api/saas/crm/custom-events",e)})}deleteCustomEvent(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/crm/custom-events/${e}`)})}emit(e){return c(this,null,function*(){return this.post("/api/saas/crm/events/emit",e)})}};var ii=class extends w{system(){return c(this,null,function*(){return(yield this.get("/api/saas/health")).data})}clientHealth(){return c(this,null,function*(){return(yield this.get("/api/saas/health/client")).data})}getDiagnosticReport(){return c(this,null,function*(){return this.clientHealth()})}jobStatus(e){return c(this,null,function*(){return(yield this.get(`/api/saas/jobs/status/${e}`)).data})}};var ni=class extends w{listEventLogs(e){return c(this,null,function*(){return this.get("/api/saas/events/logs",{params:e})})}getEventLog(e){return c(this,null,function*(){return this.get(`/api/saas/events/logs/${e}`)})}listCallbackLogs(e){return c(this,null,function*(){return this.get("/api/saas/callbacks/logs",{params:e})})}getStats(){return c(this,null,function*(){return this.get("/api/saas/events/stats")})}};var vn=class extends w{sendCampaign(e){return c(this,null,function*(){return this.post("/api/saas/marketing/emails/campaign",e)})}sendTest(e){return c(this,null,function*(){return this.post("/api/saas/marketing/emails/test",{to:e})})}},bn=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/marketing/campaigns",{params:e})})}create(e){return c(this,null,function*(){return this.post("/api/saas/marketing/campaigns",e)})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/marketing/campaigns/${e}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/marketing/campaigns/${e}`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/marketing/campaigns/${e}`)})}send(e,s){return c(this,null,function*(){return this.post(`/api/saas/marketing/campaigns/${e}/send`,s||{})})}stats(e){return c(this,null,function*(){return this.get(`/api/saas/marketing/campaigns/${e}/stats`)})}},_n=class extends w{sendTemplate(e){return c(this,null,function*(){return this.post("/api/saas/marketing/whatsapp/send-template",e)})}},ai=class extends w{constructor(s){super(s);k(this,"emails");k(this,"campaigns");k(this,"whatsapp");this.emails=new vn(s),this.campaigns=new bn(s),this.whatsapp=new _n(s)}};var ns=class extends w{getUsage(){return c(this,null,function*(){return this.get("/api/saas/storage/usage")})}createFolder(e){return c(this,null,function*(){return this.post("/api/saas/storage/folders",{name:e})})}list(e,s){return c(this,null,function*(){return this.get(`/api/saas/storage/files/${e}`,{params:s})})}delete(e){return c(this,null,function*(){return this.deleteRequest("/api/saas/storage/files",{params:{key:e}})})}getDownloadUrl(e){return c(this,null,function*(){return this.post("/api/saas/storage/download-url",{key:e})})}upload(e,s){return c(this,null,function*(){let i=yield this.post("/api/saas/storage/upload-url",s),{uploadUrl:n,key:a}=i.data;yield Mt.put(n,e,{headers:{"Content-Type":s.contentType}});let r=e.size||e.byteLength||0;return this.post("/api/saas/storage/confirm-upload",{key:a,sizeBytes:r})})}},qr=class extends ns{};var ri=class extends w{create(e){return c(this,null,function*(){return this.post("/api/saas/meet",e)})}list(e){return c(this,null,function*(){return this.get("/api/saas/meet",{params:e})})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/meet/${e}`)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/meet/${e}`,s)})}reschedule(e,s){return c(this,null,function*(){return this.patch(`/api/saas/meet/${e}`,s)})}delete(e){return c(this,null,function*(){return this.update(e,{status:"cancelled"})})}};var oi=class extends w{listLogs(e){return c(this,null,function*(){return this.get("/api/saas/events/logs",{params:e})})}retrieveLog(e){return c(this,null,function*(){return this.get(`/api/saas/events/logs/${e}`)})}getStats(e){return c(this,null,function*(){return this.get("/api/saas/events/stats",{params:e})})}listCallbacks(e){return c(this,null,function*(){return this.get("/api/saas/callbacks/logs",{params:e})})}listAlerts(e){return c(this,null,function*(){return this.get("/api/crm/notifications",{params:e})})}dismissAlert(e){return c(this,null,function*(){return this.patch(`/api/crm/notifications/${e}/dismiss`)})}clearAllAlerts(){return c(this,null,function*(){return this.deleteRequest("/api/crm/notifications/clear-all")})}retryAction(e){return c(this,null,function*(){return this.post(`/api/crm/notifications/${e}/retry`,{})})}};var ci=class extends w{listFailed(){return c(this,null,function*(){return this.get("/api/saas/admin/queue/failed")})}getStats(){return c(this,null,function*(){return this.get("/api/saas/admin/queue/stats")})}retryJob(e){return c(this,null,function*(){return this.post(`/api/saas/admin/queue/${e}/retry`,{})})}deleteJob(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/admin/queue/${e}`)})}};var wn=class extends w{create(e){return c(this,null,function*(){return this.post("/api/saas/storage/folders",{name:e})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/storage/folders/${encodeURIComponent(e)}`)})}},En=class extends w{list(e,s){return c(this,null,function*(){return this.get(`/api/saas/storage/files/${e}`,{params:s})})}getUploadUrl(e){return c(this,null,function*(){return this.post("/api/saas/storage/upload-url",e)})}confirmUpload(e){return c(this,null,function*(){return this.post("/api/saas/storage/confirm-upload",e)})}getDownloadUrl(e){return c(this,null,function*(){return this.post("/api/saas/storage/download-url",{key:e})})}delete(e){return c(this,null,function*(){return this.deleteRequest("/api/saas/storage/files",{params:{key:e}})})}},pi=class extends w{constructor(s){super(s);k(this,"folders");k(this,"files");this.folders=new wn(s),this.files=new En(s)}usage(){return c(this,null,function*(){return this.get("/api/saas/storage/usage")})}};var wt=class extends we{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},li=class{constructEvent(e,s,i){return c(this,null,function*(){if(!s)throw new wt("No webhook signature provided");let n=Array.isArray(s)?s[0]:s;n.startsWith("sha256=")&&(n=n.slice(7));try{let a=yield import("crypto"),o=a.createHmac("sha256",i).update(e).digest("hex");if(!a.timingSafeEqual(Buffer.from(o),Buffer.from(n)))throw new wt("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(a){throw a instanceof wt?a:new wt(`Webhook payload parsing failed: ${a.message}`)}})}};var ui=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/chat/broadcasts",{params:e})})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/chat/broadcasts/${e}`)})}create(e){return c(this,null,function*(){return this.post("/api/saas/chat/broadcast",e)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/chat/broadcasts/${e}`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/chat/broadcasts/${e}`)})}};var di=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/chat/conversations",{params:e})})}create(e){return c(this,null,function*(){return this.post("/api/saas/chat/conversations",e)})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/chat/conversations/${e}`)})}messages(e,s){return c(this,null,function*(){return this.get(`/api/saas/chat/conversations/${e}/messages`,{params:s})})}linkLead(e,s,i){return c(this,null,function*(){return this.post(`/api/saas/chat/conversations/${e}/link-lead`,{leadId:s,leadData:i})})}markRead(e){return c(this,null,function*(){return this.post(`/api/saas/chat/conversations/${e}/read`,{})})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/chat/conversations/${e}`)})}bulkDelete(e){return c(this,null,function*(){return this.post("/api/saas/chat/conversations/bulk-delete",{ids:e})})}};var mi=class extends w{send(e){return c(this,null,function*(){return this.post("/api/saas/chat/send",e)})}sendTemplate(e){return c(this,null,function*(){return this.post("/api/saas/chat/send",re(L({},e),{templateLanguage:e.language||e.templateLanguage||"en_US"}))})}star(e,s){return c(this,null,function*(){return this.post(`/api/saas/chat/messages/${e}/star`,{isStarred:s})})}react(e,s){return c(this,null,function*(){return this.post(`/api/saas/chat/messages/${e}/react`,{reaction:s})})}markRead(e){return c(this,null,function*(){return this.post(`/api/saas/chat/conversations/${e}/read`)})}upload(e){return c(this,null,function*(){let s=new FormData;return s.append("file",e),this.post("/api/saas/chat/upload",s,{headers:{"Content-Type":"multipart/form-data"}})})}};var fi=class extends w{list(e){return c(this,null,function*(){return this.get("/api/saas/chat/templates",{params:e})})}sync(){return c(this,null,function*(){return this.post("/api/saas/chat/templates/sync",{})})}retrieve(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/${encodeURIComponent(e)}`)})}create(e){return c(this,null,function*(){return this.post("/api/saas/chat/templates",e)})}update(e,s){return c(this,null,function*(){return this.put(`/api/saas/chat/templates/${e}`,s)})}deleteTemplate(e,s){return c(this,null,function*(){return this.deleteRequest(`/api/saas/chat/templates/${encodeURIComponent(e)}${s?"?force=true":""}`)})}mappingConfig(){return c(this,null,function*(){return this.get("/api/saas/chat/templates/mapping/config")})}collections(){return c(this,null,function*(){return this.get("/api/saas/chat/templates/collections")})}collectionFields(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/collections/${encodeURIComponent(e)}/fields`)})}updateMapping(e,s){return c(this,null,function*(){return this.put(`/api/saas/chat/templates/${encodeURIComponent(e)}/mapping`,s)})}validate(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/${encodeURIComponent(e)}/validate`)})}preview(e,s){return c(this,null,function*(){return this.post(`/api/saas/chat/templates/${encodeURIComponent(e)}/preview`,{context:s})})}getVariableManifest(e){return c(this,null,function*(){var a,r;let s=yield this.retrieve(e),i=Array.isArray((a=s.data)==null?void 0:a.components)?s.data.components:[],n=[];for(let o of i)if(o.text){let l=o.text.match(/{{(\d+)}}/g);if(l)for(let u of l){let p=u.replace(/{{|}}/g,"");n.push({key:`var_${p}`,label:`${o.type} Var {{${p}}}`,type:"string",required:!0,group:o.type,description:`Variable placeholder in template ${o.type}`})}}return{name:`Template variables: ${((r=s.data)==null?void 0:r.name)||e}`,fields:n,uiHints:{icon:"Variables",primaryColor:"#059669"}}})}checkUsage(e){return c(this,null,function*(){return this.get(`/api/saas/chat/templates/${encodeURIComponent(e)}/usage`)})}};var hi=class extends w{constructor(s){super(s);k(this,"messages");k(this,"conversations");k(this,"broadcasts");k(this,"templates");this.messages=new mi(s),this.conversations=new di(s),this.broadcasts=new ui(s),this.templates=new fi(s)}upload(s,i){return c(this,null,function*(){let n=new FormData;return n.append("file",s,i),this.post("/api/saas/chat/upload",n,{headers:typeof n.getHeaders=="function"?n.getHeaders():void 0})})}sendTemplate(s){return c(this,null,function*(){return this.post("/api/saas/marketing/whatsapp/send-template",s)})}};var xi=class extends w{listBlueprints(){return c(this,null,function*(){return this.get("/api/agency/blueprints")})}createBlueprint(e){return c(this,null,function*(){return this.post("/api/agency/blueprints",e)})}deployBlueprint(e){return c(this,null,function*(){return this.post("/api/agency/blueprints/deploy",e)})}getPortfolioStats(e){return c(this,null,function*(){return this.get(`/api/agency/portfolio/${e}/stats`)})}getPortfolioHealth(e){return c(this,null,function*(){return this.get(`/api/agency/portfolio/${e}/health`)})}getUsage(e){return c(this,null,function*(){return this.get(`/api/agency/usage/${e}`)})}listStaff(e){return c(this,null,function*(){return this.get(`/api/agency/staff/${e}`)})}createStaff(e){return c(this,null,function*(){return this.post("/api/agency/staff",e)})}};var Tn=class extends w{list(){return c(this,null,function*(){return this.get("/api/services/clients")})}getCountAndGenerateCode(){return c(this,null,function*(){return this.get("/api/services/clients/count")})}retrieve(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}`)})}getApiKey(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/api-key`)})}rotateApiKey(e){return c(this,null,function*(){return this.post(`/api/services/clients/${e}/api-key`,{})})}create(e){return c(this,null,function*(){return this.post("/api/services/clients",e)})}getConfig(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/config`)})}updateConfig(e,s){return c(this,null,function*(){return this.patch(`/api/services/clients/${e}/config`,s)})}getSecrets(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/secrets`)})}updateSecrets(e,s){return c(this,null,function*(){return this.post(`/api/services/clients/${e}/secrets`,s)})}replaceSecrets(e,s){return c(this,null,function*(){return this.put(`/api/services/clients/${e}/secrets`,s)})}patchSecrets(e,s){return c(this,null,function*(){return this.patch(`/api/services/clients/${e}/secrets`,s)})}getDataSource(e){return c(this,null,function*(){return this.get(`/api/services/clients/${e}/datasource`)})}manageDataSource(e,s){return c(this,null,function*(){return this.post(`/api/services/clients/${e}/datasource`,s)})}updateIdentity(e,s){return c(this,null,function*(){return this.patch(`/api/services/clients/${e}/identity`,s)})}googleReauth(i){return c(this,arguments,function*(e,s={}){return this.post(`/api/services/clients/${e}/google/reauth`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/services/clients/${e}`)})}},Sn=class extends w{list(){return c(this,null,function*(){return this.get("/api/services/blogs")})}},kn=class extends w{add(e){return c(this,null,function*(){return this.post("/api/services/add-lead",e)})}},gi=class extends w{constructor(s){super(s);k(this,"clients");k(this,"blogs");k(this,"globalLeads");this.clients=new Tn(s),this.blogs=new Sn(s),this.globalLeads=new kn(s)}};var Rn=class extends w{getConfig(){return c(this,null,function*(){return this.get("/api/settings/email")})}switchProvider(e){return c(this,null,function*(){return this.post("/api/settings/email/provider",{provider:e})})}saveSmtp(e){return c(this,null,function*(){return this.post("/api/settings/email/smtp",e)})}initDomainVerification(e){return c(this,null,function*(){return this.post("/api/settings/email/ses/domain",{domain:e})})}saveEmailConfig(e){return c(this,null,function*(){return this.post("/api/settings/email/ses/config",e)})}checkSesVerification(){return c(this,null,function*(){return this.get("/api/settings/email/ses/verify")})}removeSesIdentity(){return c(this,null,function*(){return this.deleteRequest("/api/settings/email/ses/domain")})}sendTest(e){return c(this,null,function*(){return this.post("/api/settings/email/test",{toEmail:e})})}saveAdvancedConfig(e){return c(this,null,function*(){return this.post("/api/settings/email/advanced",e)})}getHealth(){return c(this,null,function*(){return this.get("/api/settings/email/health")})}fixDmarc(){return c(this,null,function*(){return this.post("/api/settings/email/ses/fix-dmarc",{})})}listProviders(){return c(this,null,function*(){return this.get("/api/settings/email/providers")})}},yi=class extends w{constructor(s){super(s);k(this,"email");this.email=new Rn(s)}};var vi=class extends w{list(){return c(this,null,function*(){return this.get("/api/saas/cors")})}create(e){return c(this,null,function*(){return this.post("/api/saas/cors",e)})}update(e,s){return c(this,null,function*(){return this.patch(`/api/saas/cors/${e}`,s)})}delete(e){return c(this,null,function*(){return this.deleteRequest(`/api/saas/cors/${e}`)})}};var jy="https://api.ecodrix.com",as=class{constructor(e){k(this,"client");k(this,"socket");k(this,"clientCode");k(this,"whatsapp");k(this,"crm");k(this,"media");k(this,"meet");k(this,"notifications");k(this,"email");k(this,"logs");k(this,"events");k(this,"webhooks");k(this,"storage");k(this,"marketing");k(this,"health");k(this,"queue");k(this,"agency");k(this,"services");k(this,"settings");k(this,"cors");var l,u,p,m,f;if(!e.apiKey)throw new Vs("API Key is required");this.clientCode=(l=e.clientCode)==null?void 0:l.toUpperCase();let s=(u=e.baseUrl)!=null?u:jy,i=e.socketUrl||s,n=typeof window!="undefined"&&typeof window.document!="undefined",a=n?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",r=n?((p=globalThis.navigator)==null?void 0:p.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",o={"x-api-key":e.apiKey,"x-client-code":((m=e.clientCode)==null?void 0:m.toUpperCase())||"","Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:"1.0.0",runtime:a,os:r})};if(e.coreApiKey&&(o["x-core-api-key"]=e.coreApiKey),this.client=Mt.create({baseURL:s,headers:o}),Gi(this.client,{retries:3,retryDelay:Gi.exponentialDelay,retryCondition:g=>{var h;return Gi.isNetworkOrIdempotentRequestError(g)||((h=g.response)==null?void 0:h.status)===429},onRetry:(g,h,x)=>{var R,C;typeof process!="undefined"&&((R=process.env)==null?void 0:R.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${g}/3): ${(C=x.method)==null?void 0:C.toUpperCase()} ${x.url}. Reason: ${h.message}`)}}),this.whatsapp=new hi(this.client),this.crm=new ti(this.client),this.media=new ns(this.client),this.meet=new ri(this.client),this.notifications=new oi(this.client),this.email=new is(this.client),this.logs=new ni(this.client),this.events=new si(this.client),this.webhooks=new li,this.storage=new pi(this.client),this.marketing=new ai(this.client),this.health=new ii(this.client),this.queue=new ci(this.client),this.agency=new xi(this.client),this.services=new gi(this.client),this.settings=new yi(this.client),this.cors=new vi(this.client),this.socket=Hs(i,{extraHeaders:{"x-api-key":e.apiKey,"x-client-code":((f=e.clientCode)==null?void 0:f.toUpperCase())||""}}),this.setupSocket(e.clientCode),n){let g={version:"1.2.2",clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=g,window.ecodrix||(window.ecodrix=this)}}joinRoom(e){this.socket.emit("join-room",e)}leaveRoom(e){this.socket.emit("leave-room",e)}setupSocket(e){this.socket.on("connect",()=>{e&&this.socket.emit("join-room",e.toUpperCase())})}on(e,s){return this.socket.on(e,s),this}disconnect(){this.socket.disconnect()}off(e,s){return this.socket.off(e,s),this}request(e,s,i,n){return c(this,null,function*(){var a,r,o;try{return(yield this.client.request({method:e,url:s,data:i,params:n})).data}catch(l){throw l.response?new we(((a=l.response.data)==null?void 0:a.message)||((r=l.response.data)==null?void 0:r.error)||"Raw Execution Failed",l.response.status,(o=l.response.data)==null?void 0:o.code):new we(l.message||"Network Error")}})}};var Iy=as;return bd(Uy);})();
|
|
20
20
|
/*! Bundled license information:
|
|
21
21
|
|
|
22
22
|
mime-db/index.js:
|