@emuanalytics/flow-engine-client 1.3.50 → 1.3.64

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/bundle.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";var FlowEngineClient=(()=>{var it=Object.create;var U=Object.defineProperty,st=Object.defineProperties,ot=Object.getOwnPropertyDescriptor,at=Object.getOwnPropertyDescriptors,ut=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,ct=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable;var Ne=(t,e,r)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e||(e={}))Ue.call(e,r)&&Ne(t,r,e[r]);if(De)for(var r of De(e))lt.call(e,r)&&Ne(t,r,e[r]);return t},ae=(t,e)=>st(t,at(e));var l=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ft=(t,e)=>{for(var r in e)U(t,r,{get:e[r],enumerable:!0})},Be=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ut(e))!Ue.call(t,i)&&i!==r&&U(t,i,{get:()=>e[i],enumerable:!(n=ot(e,i))||n.enumerable});return t};var je=(t,e,r)=>(r=t!=null?it(ct(t)):{},Be(e||!t||!t.__esModule?U(r,"default",{value:t,enumerable:!0}):r,t)),pt=t=>Be(U({},"__esModule",{value:!0}),t);var ue=l((gn,Le)=>{"use strict";Le.exports=function(e,r){return function(){for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];return e.apply(r,i)}}});var d=l((En,ke)=>{"use strict";var dt=ue(),le=Object.prototype.toString,fe=function(t){return function(e){var r=le.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function S(t){return t=t.toLowerCase(),function(r){return fe(r)===t}}function pe(t){return Array.isArray(t)}function $(t){return typeof t>"u"}function ht(t){return t!==null&&!$(t)&&t.constructor!==null&&!$(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}var $e=S("ArrayBuffer");function mt(t){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&$e(t.buffer),e}function yt(t){return typeof t=="string"}function vt(t){return typeof t=="number"}function Fe(t){return t!==null&&typeof t=="object"}function L(t){if(fe(t)!=="object")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}var gt=S("Date"),Et=S("File"),xt=S("Blob"),bt=S("FileList");function de(t){return le.call(t)==="[object Function]"}function wt(t){return Fe(t)&&de(t.pipe)}function Rt(t){var e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||le.call(t)===e||de(t.toString)&&t.toString()===e)}var Ct=S("URLSearchParams");function Pt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ot(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function he(t,e){if(!(t===null||typeof t>"u"))if(typeof t!="object"&&(t=[t]),pe(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}function ce(){var t={};function e(i,s){L(t[s])&&L(i)?t[s]=ce(t[s],i):L(i)?t[s]=ce({},i):pe(i)?t[s]=i.slice():t[s]=i}for(var r=0,n=arguments.length;r<n;r++)he(arguments[r],e);return t}function St(t,e,r){return he(e,function(i,s){r&&typeof i=="function"?t[s]=dt(i,r):t[s]=i}),t}function At(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}function qt(t,e,r,n){t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)}function Tt(t,e,r){var n,i,s,o={};e=e||{};do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)s=n[i],o[s]||(e[s]=t[s],o[s]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e}function _t(t,e,r){t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;var n=t.indexOf(e,r);return n!==-1&&n===r}function It(t){if(!t)return null;var e=t.length;if($(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r}var Dt=function(t){return function(e){return t&&e instanceof t}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));ke.exports={isArray:pe,isArrayBuffer:$e,isBuffer:ht,isFormData:Rt,isArrayBufferView:mt,isString:yt,isNumber:vt,isObject:Fe,isPlainObject:L,isUndefined:$,isDate:gt,isFile:Et,isBlob:xt,isFunction:de,isStream:wt,isURLSearchParams:Ct,isStandardBrowserEnv:Ot,forEach:he,merge:ce,extend:St,trim:Pt,stripBOM:At,inherits:qt,toFlatObject:Tt,kindOf:fe,kindOfTest:S,endsWith:_t,toArray:It,isTypedArray:Dt,isFileList:bt}});var me=l((xn,Me)=>{"use strict";var T=d();function Ke(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Me.exports=function(e,r,n){if(!r)return e;var i;if(n)i=n(r);else if(T.isURLSearchParams(r))i=r.toString();else{var s=[];T.forEach(r,function(c,m){c===null||typeof c>"u"||(T.isArray(c)?m=m+"[]":c=[c],T.forEach(c,function(f){T.isDate(f)?f=f.toISOString():T.isObject(f)&&(f=JSON.stringify(f)),s.push(Ke(m)+"="+Ke(f))}))}),i=s.join("&")}if(i){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}});var He=l((bn,Je)=>{"use strict";var Nt=d();function F(){this.handlers=[]}F.prototype.use=function(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};F.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};F.prototype.forEach=function(e){Nt.forEach(this.handlers,function(n){n!==null&&e(n)})};Je.exports=F});var Qe=l((wn,ze)=>{"use strict";var Ut=d();ze.exports=function(e,r){Ut.forEach(e,function(i,s){s!==r&&s.toUpperCase()===r.toUpperCase()&&(e[r]=i,delete e[s])})}});var A=l((Rn,Ye)=>{"use strict";var Ve=d();function _(t,e,r,n,i){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Ve.inherits(_,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var We=_.prototype,Xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(t){Xe[t]={value:t}});Object.defineProperties(_,Xe);Object.defineProperty(We,"isAxiosError",{value:!0});_.from=function(t,e,r,n,i,s){var o=Object.create(We);return Ve.toFlatObject(t,o,function(c){return c!==Error.prototype}),_.call(o,t.message,e,r,n,i),o.name=t.name,s&&Object.assign(o,s),o};Ye.exports=_});var ye=l((Cn,Ge)=>{"use strict";Ge.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var ve=l((Pn,Ze)=>{"use strict";var w=d();function Bt(t,e){e=e||new FormData;var r=[];function n(s){return s===null?"":w.isDate(s)?s.toISOString():w.isArrayBuffer(s)||w.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function i(s,o){if(w.isPlainObject(s)||w.isArray(s)){if(r.indexOf(s)!==-1)throw Error("Circular reference detected in "+o);r.push(s),w.forEach(s,function(c,m){if(!w.isUndefined(c)){var a=o?o+"."+m:m,f;if(c&&!o&&typeof c=="object"){if(w.endsWith(m,"{}"))c=JSON.stringify(c);else if(w.endsWith(m,"[]")&&(f=w.toArray(c))){f.forEach(function(g){!w.isUndefined(g)&&e.append(a,n(g))});return}}i(c,a)}}),r.pop()}else e.append(o,n(s))}return i(t),e}Ze.exports=Bt});var rr=l((On,er)=>{"use strict";var ge=A();er.exports=function(e,r,n){var i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):r(new ge("Request failed with status code "+n.status,[ge.ERR_BAD_REQUEST,ge.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}});var nr=l((Sn,tr)=>{"use strict";var k=d();tr.exports=k.isStandardBrowserEnv()?function(){return{write:function(r,n,i,s,o,u){var c=[];c.push(r+"="+encodeURIComponent(n)),k.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),k.isString(s)&&c.push("path="+s),k.isString(o)&&c.push("domain="+o),u===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var sr=l((An,ir)=>{"use strict";ir.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}});var ar=l((qn,or)=>{"use strict";or.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}});var Ee=l((Tn,ur)=>{"use strict";var jt=sr(),Lt=ar();ur.exports=function(e,r){return e&&!jt(r)?Lt(e,r):r}});var lr=l((_n,cr)=>{"use strict";var xe=d(),$t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];cr.exports=function(e){var r={},n,i,s;return e&&xe.forEach(e.split(`
2
- `),function(u){if(s=u.indexOf(":"),n=xe.trim(u.substr(0,s)).toLowerCase(),i=xe.trim(u.substr(s+1)),n){if(r[n]&&$t.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([i]):r[n]=r[n]?r[n]+", "+i:i}}),r}});var dr=l((In,pr)=>{"use strict";var fr=d();pr.exports=fr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(s){var o=s;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(o){var u=fr.isString(o)?i(o):o;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}()});var B=l((Dn,mr)=>{"use strict";var be=A(),Ft=d();function hr(t){be.call(this,t==null?"canceled":t,be.ERR_CANCELED),this.name="CanceledError"}Ft.inherits(hr,be,{__CANCEL__:!0});mr.exports=hr});var vr=l((Nn,yr)=>{"use strict";yr.exports=function(e){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}});var we=l((Un,gr)=>{"use strict";var j=d(),kt=rr(),Kt=nr(),Mt=me(),Jt=Ee(),Ht=lr(),zt=dr(),Qt=ye(),R=A(),Vt=B(),Wt=vr();gr.exports=function(e){return new Promise(function(n,i){var s=e.data,o=e.headers,u=e.responseType,c;function m(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}j.isFormData(s)&&j.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(f+":"+g)}var y=Jt(e.baseURL,e.url);a.open(e.method.toUpperCase(),Mt(y,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function _e(){if(!!a){var b="getAllResponseHeaders"in a?Ht(a.getAllResponseHeaders()):null,q=!u||u==="text"||u==="json"?a.responseText:a.response,O={data:q,status:a.status,statusText:a.statusText,headers:b,config:e,request:a};kt(function(oe){n(oe),m()},function(oe){i(oe),m()},O),a=null}}if("onloadend"in a?a.onloadend=_e:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(_e)},a.onabort=function(){!a||(i(new R("Request aborted",R.ECONNABORTED,e,a)),a=null)},a.onerror=function(){i(new R("Network Error",R.ERR_NETWORK,e,a,a)),a=null},a.ontimeout=function(){var q=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",O=e.transitional||Qt;e.timeoutErrorMessage&&(q=e.timeoutErrorMessage),i(new R(q,O.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,a)),a=null},j.isStandardBrowserEnv()){var Ie=(e.withCredentials||zt(y))&&e.xsrfCookieName?Kt.read(e.xsrfCookieName):void 0;Ie&&(o[e.xsrfHeaderName]=Ie)}"setRequestHeader"in a&&j.forEach(o,function(q,O){typeof s>"u"&&O.toLowerCase()==="content-type"?delete o[O]:a.setRequestHeader(O,q)}),j.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),u&&u!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(c=function(b){!a||(i(!b||b&&b.type?new Vt:b),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c))),s||(s=null);var se=Wt(y);if(se&&["http","https","file"].indexOf(se)===-1){i(new R("Unsupported protocol "+se+":",R.ERR_BAD_REQUEST,e));return}a.send(s)})}});var xr=l((Bn,Er)=>{Er.exports=null});var M=l((jn,Cr)=>{"use strict";var h=d(),br=Qe(),wr=A(),Xt=ye(),Yt=ve(),Gt={"Content-Type":"application/x-www-form-urlencoded"};function Rr(t,e){!h.isUndefined(t)&&h.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Zt(){var t;return typeof XMLHttpRequest<"u"?t=we():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(t=we()),t}function en(t,e,r){if(h.isString(t))try{return(e||JSON.parse)(t),h.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var K={transitional:Xt,adapter:Zt(),transformRequest:[function(e,r){if(br(r,"Accept"),br(r,"Content-Type"),h.isFormData(e)||h.isArrayBuffer(e)||h.isBuffer(e)||h.isStream(e)||h.isFile(e)||h.isBlob(e))return e;if(h.isArrayBufferView(e))return e.buffer;if(h.isURLSearchParams(e))return Rr(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n=h.isObject(e),i=r&&r["Content-Type"],s;if((s=h.isFileList(e))||n&&i==="multipart/form-data"){var o=this.env&&this.env.FormData;return Yt(s?{"files[]":e}:e,o&&new o)}else if(n||i==="application/json")return Rr(r,"application/json"),en(e);return e}],transformResponse:[function(e){var r=this.transitional||K.transitional,n=r&&r.silentJSONParsing,i=r&&r.forcedJSONParsing,s=!n&&this.responseType==="json";if(s||i&&h.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(s)throw o.name==="SyntaxError"?wr.from(o,wr.ERR_BAD_RESPONSE,this,null,this.response):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xr()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};h.forEach(["delete","get","head"],function(e){K.headers[e]={}});h.forEach(["post","put","patch"],function(e){K.headers[e]=h.merge(Gt)});Cr.exports=K});var Or=l((Ln,Pr)=>{"use strict";var rn=d(),tn=M();Pr.exports=function(e,r,n){var i=this||tn;return rn.forEach(n,function(o){e=o.call(i,e,r)}),e}});var Re=l(($n,Sr)=>{"use strict";Sr.exports=function(e){return!!(e&&e.__CANCEL__)}});var Tr=l((Fn,qr)=>{"use strict";var Ar=d(),Ce=Or(),nn=Re(),sn=M(),on=B();function Pe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new on}qr.exports=function(e){Pe(e),e.headers=e.headers||{},e.data=Ce.call(e,e.data,e.headers,e.transformRequest),e.headers=Ar.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Ar.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var r=e.adapter||sn.adapter;return r(e).then(function(i){return Pe(e),i.data=Ce.call(e,i.data,i.headers,e.transformResponse),i},function(i){return nn(i)||(Pe(e),i&&i.response&&(i.response.data=Ce.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})}});var Oe=l((kn,_r)=>{"use strict";var E=d();_r.exports=function(e,r){r=r||{};var n={};function i(a,f){return E.isPlainObject(a)&&E.isPlainObject(f)?E.merge(a,f):E.isPlainObject(f)?E.merge({},f):E.isArray(f)?f.slice():f}function s(a){if(E.isUndefined(r[a])){if(!E.isUndefined(e[a]))return i(void 0,e[a])}else return i(e[a],r[a])}function o(a){if(!E.isUndefined(r[a]))return i(void 0,r[a])}function u(a){if(E.isUndefined(r[a])){if(!E.isUndefined(e[a]))return i(void 0,e[a])}else return i(void 0,r[a])}function c(a){if(a in r)return i(e[a],r[a]);if(a in e)return i(void 0,e[a])}var m={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c};return E.forEach(Object.keys(e).concat(Object.keys(r)),function(f){var g=m[f]||s,y=g(f);E.isUndefined(y)&&g!==c||(n[f]=y)}),n}});var Se=l((Kn,Ir)=>{Ir.exports={version:"0.27.2"}});var Ur=l((Mn,Nr)=>{"use strict";var an=Se().version,P=A(),Ae={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){Ae[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var Dr={};Ae.transitional=function(e,r,n){function i(s,o){return"[Axios v"+an+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return function(s,o,u){if(e===!1)throw new P(i(o," has been removed"+(r?" in "+r:"")),P.ERR_DEPRECATED);return r&&!Dr[o]&&(Dr[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,u):!0}};function un(t,e,r){if(typeof t!="object")throw new P("options must be an object",P.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),i=n.length;i-- >0;){var s=n[i],o=e[s];if(o){var u=t[s],c=u===void 0||o(u,s,t);if(c!==!0)throw new P("option "+s+" must be "+c,P.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new P("Unknown option "+s,P.ERR_BAD_OPTION)}}Nr.exports={assertOptions:un,validators:Ae}});var kr=l((Jn,Fr)=>{"use strict";var Lr=d(),cn=me(),Br=He(),jr=Tr(),J=Oe(),ln=Ee(),$r=Ur(),I=$r.validators;function D(t){this.defaults=t,this.interceptors={request:new Br,response:new Br}}D.prototype.request=function(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=J(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&$r.assertOptions(n,{silentJSONParsing:I.transitional(I.boolean),forcedJSONParsing:I.transitional(I.boolean),clarifyTimeoutError:I.transitional(I.boolean)},!1);var i=[],s=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(s=s&&y.synchronous,i.unshift(y.fulfilled,y.rejected))});var o=[];this.interceptors.response.forEach(function(y){o.push(y.fulfilled,y.rejected)});var u;if(!s){var c=[jr,void 0];for(Array.prototype.unshift.apply(c,i),c=c.concat(o),u=Promise.resolve(r);c.length;)u=u.then(c.shift(),c.shift());return u}for(var m=r;i.length;){var a=i.shift(),f=i.shift();try{m=a(m)}catch(g){f(g);break}}try{u=jr(m)}catch(g){return Promise.reject(g)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};D.prototype.getUri=function(e){e=J(this.defaults,e);var r=ln(e.baseURL,e.url);return cn(r,e.params,e.paramsSerializer)};Lr.forEach(["delete","get","head","options"],function(e){D.prototype[e]=function(r,n){return this.request(J(n||{},{method:e,url:r,data:(n||{}).data}))}});Lr.forEach(["post","put","patch"],function(e){function r(n){return function(s,o,u){return this.request(J(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}D.prototype[e]=r(),D.prototype[e+"Form"]=r(!0)});Fr.exports=D});var Mr=l((Hn,Kr)=>{"use strict";var fn=B();function N(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(i){e=i});var r=this;this.promise.then(function(n){if(!!r._listeners){var i,s=r._listeners.length;for(i=0;i<s;i++)r._listeners[i](n);r._listeners=null}}),this.promise.then=function(n){var i,s=new Promise(function(o){r.subscribe(o),i=o}).then(n);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i){r.reason||(r.reason=new fn(i),e(r.reason))})}N.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};N.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};N.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}};N.source=function(){var e,r=new N(function(i){e=i});return{token:r,cancel:e}};Kr.exports=N});var Hr=l((zn,Jr)=>{"use strict";Jr.exports=function(e){return function(n){return e.apply(null,n)}}});var Qr=l((Qn,zr)=>{"use strict";var pn=d();zr.exports=function(e){return pn.isObject(e)&&e.isAxiosError===!0}});var Xr=l((Vn,qe)=>{"use strict";var Vr=d(),dn=ue(),H=kr(),hn=Oe(),mn=M();function Wr(t){var e=new H(t),r=dn(H.prototype.request,e);return Vr.extend(r,H.prototype,e),Vr.extend(r,e),r.create=function(i){return Wr(hn(t,i))},r}var v=Wr(mn);v.Axios=H;v.CanceledError=B();v.CancelToken=Mr();v.isCancel=Re();v.VERSION=Se().version;v.toFormData=ve();v.AxiosError=A();v.Cancel=v.CanceledError;v.all=function(e){return Promise.all(e)};v.spread=Hr();v.isAxiosError=Qr();qe.exports=v;qe.exports.default=v});var Gr=l((Wn,Yr)=>{Yr.exports=Xr()});var et=l((yi,Zr)=>{Zr.exports=typeof self=="object"?self.FormData:window.FormData});var yn={};ft(yn,{BaseEndpoints:()=>p,Client:()=>Te,FlowEngineError:()=>C});var tt=je(Gr());var C=class extends Error{constructor(r,n=null,i=500){super(r||"Unknown Error");Object.setPrototypeOf(this,C.prototype),this.statusCode=i,this.error=n}};var p=class{constructor(e,r){this.client=e;this.resourcePath=r}get resourceEndpoint(){return`/api/v1/${this.resourcePath}`}list(e){if(e!=null&&e.filter){let r=e.filter;Object.keys(r).forEach(n=>{e[`filter[${n}]`]=r[n]}),delete e.filter}return this.client._get(this.resourceEndpoint,{params:e})}get(e,r={}){return this.client._get(`${this.resourceEndpoint}/${e}`,{params:r})}create(e,r={}){return this.client._post(`${this.resourceEndpoint}`,e,{params:r})}update(e,r,n={}){return this.client._put(`${this.resourceEndpoint}/${e}`,r,{params:n})}delete(e,r={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:r})}getMetadata(e,r,n={}){let i=r?`${this.resourceEndpoint}/${e}/metadata/${r}`:`${this.resourceEndpoint}/${e}/metadata`;return this.client._get(i,{params:n})}setMetadata(e,r,n,i={}){return(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&(n={value:n}),this.client._put(`${this.resourceEndpoint}/${e}/metadata/${r}`,n,{headers:{"Content-Type":"application/json"},params:i})}deleteMetadata(e,r,n={}){return this.client._delete(`${this.resourceEndpoint}/${e}/metadata/${r}`,{headers:{"Content-Type":"application/json"},params:n})}};var z=class extends p{constructor(e){super(e,"auth/users")}me(e){return this.client._get(`${this.resourceEndpoint}/me`,{headers:{Authorization:`Bearer ${e}`}})}};var Q=class{constructor(e){this.client=e;this.users=new z(this.client)}login(e,r,n){return this.client._post("/api/v1/auth/login",{email:e,password:r,applicationId:n})}logout(e,r){return this.client._post("/api/v1/auth/logout",{refreshToken:r},{headers:{Authorization:`Bearer ${e}`}})}refresh(e,r){return this.client._post("/api/v1/auth/refresh",{refreshToken:e,applicationId:r})}changePassword(e,r,n){return this.client._post("/api/v1/auth/changepassword",{password:e,newPassword:r},{headers:{Authorization:`Bearer ${n}`}})}signUp(e,r,n,i,s,o){return this.client._post("/api/v1/auth/signup",{firstName:e,lastName:r,email:n,password:i,applicationId:s,confirmUrl:`${this.client.baseUrl}/api/v1/auth/confirmsignup`,redirectUrl:o})}requestPasswordReset(e,r,n){return this.client._post("/api/v1/auth/requestpasswordreset",{email:e,applicationId:r,redirectUrl:n})}resetPassword(e,r,n,i){return this.client._post("/api/v1/auth/resetpassword",{email:e,password:r,applicationId:n,token:i})}};var V=class{constructor(e){this.client=e}getTileSpec(e,r={}){return this.client._get(`/tiles/${e}/index.json`,{params:r})}getPreviewStyle(e,r={}){return this.client._get(`/tiles/${e}/style.json`,{params:r})}};var W=class extends p{constructor(e){super(e,"styles")}};var X=class{constructor(e){this.client=e}get(e,r={}){return this.client._get(`/maps/${e}.json`,{params:r})}};var Y=class extends p{constructor(e){super(e,"apikeys")}};var G=class extends p{constructor(e){super(e,"applications")}};var Z=class extends p{constructor(e){super(e,"databases")}drivers(){return this.client._get("/api/v1/databases/drivers").catch(e=>{if(e.status===404)return["postgis","postgis-mapnik"]})}};var ee=class extends p{constructor(e){super(e,"datasets")}query(e,r={},n={}){return typeof e=="object"&&(n=ae(x({},e.params),{format:e.format||"json"}),r=e,e=r.datasetId,delete r.datasetId,delete r.format),typeof n=="string"&&(n={format:n}),this.client._post(`/api/v1/datasets/${e}/query`,r,{params:ae(x({},n),{format:n.format||"json",explain:n.explain||!1})}).catch(i=>{throw i.message==="Network Error"?new Error("Query timed out"):i})}getExportUrl(e,r){let n=this.client.accessToken?`accesstoken=${this.client.accessToken}`:`apikey=${this.client.apiKey}`;return`${this.client.baseUrl}/api/v1/datasets/${e}/export?format=${r}&${n}`}};var re=class extends p{constructor(e){super(e,"tilesources")}drivers(){return this.client._get("/api/v1/tilesources/drivers").catch(e=>{if(e.statusCode===404)return["tilelive","dataset"]})}};var rt=je(et()),te=class extends p{constructor(e){super(e,"uploads")}async upload(e,r={}){let n=new rt.default;return e.datasetName&&n.append("name",e.datasetName),e.datasetDescription&&n.append("description",e.datasetDescription),e.attribution&&n.append("attribution",e.attribution),e.datasetId&&n.append("datasetId",e.datasetId),e.sourceSrid&&n.append("sourceSrid",e.sourceSrid),e.targetSrid&&n.append("targetSrid",e.targetSrid),e.schema&&n.append("schema",e.schema),n.append("file",e.data,e.filename),await this.client._post(this.resourceEndpoint,n,{headers:n.getHeaders(),params:r,onUploadProgress:e.progress})}};var ne=class{constructor(e){this.client=e}get resourceEndpoint(){return"/api/v1/appconfig"}get(e,r={}){return this.client._get(e?`${this.resourceEndpoint}/${e}`:this.resourceEndpoint,{params:r})}set(e,r,n={}){return(typeof r=="string"||typeof r=="number"||typeof r=="boolean"||Array.isArray(r))&&(r={value:r}),this.client._put(`${this.resourceEndpoint}/${e}`,r,{headers:{"Content-Type":"application/json"},params:n})}delete(e,r={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:r})}};var ie=class extends p{constructor(e){super(e,"jobs")}submit(e){return this.client._post("/api/v1/jobs/submit",e)}getStatus(e){return this.client._get(`/api/v1/jobs/${e}/status`)}setStatus(e,r){return this.client._post(`/api/v1/jobs/${e}/status`,r)}cancel(e){return this.client._post(`/api/v1/jobs/${e}/cancel`,{})}request(e){return this.client._post("/api/v1/jobs/request",{type:e})}};var Te=class{constructor(e,r=null){this.baseUrl=e;this.apiKey=r;this.accessToken=null;this.auth=new Q(this);this.tiles=new V(this);this.maps=new X(this);this.apiKeys=new Y(this);this.applications=new G(this);this.appconfig=new ne(this);this.databases=new Z(this);this.datasets=new ee(this);this.styles=new W(this);this.tileSources=new re(this);this.uploads=new te(this);this.jobs=new ie(this);this.axios=tt.default.create({baseURL:e,maxContentLength:524288e3})}config(){return this._get("/api/v1/config")}_get(e,r={}){var n;return(n=r.params)!=null&&n.apiKey&&(r.apiKey=r.params.apiKey,delete r.params.apiKey),this.axios(x(x({method:"get",url:e},r),this.headers(r))).then(i=>i.data).catch(this.handleError)}_post(e,r,n={}){var i;return(i=n.params)!=null&&i.apiKey&&(n.apiKey=n.params.apiKey,delete n.params.apiKey),this.axios(x(x({method:"post",url:e,data:r,maxContentLength:1/0,maxBodyLength:1/0},n),this.headers(n))).then(s=>s.data).catch(this.handleError)}_put(e,r,n={}){var i;return(i=n.params)!=null&&i.apiKey&&(n.apiKey=n.params.apiKey,delete n.params.apiKey),this.axios(x(x({method:"put",url:e,data:r},n),this.headers(n))).then(s=>s.data).catch(this.handleError)}_delete(e,r={}){var n;return(n=r.params)!=null&&n.apiKey&&(r.apiKey=r.params.apiKey,delete r.params.apiKey),this.axios(x(x({method:"delete",url:e},r),this.headers(r))).then(i=>i.data).catch(this.handleError)}handleError(e){if(e.response&&e.response.data){if(typeof e.response.data=="object"){let n=e.response.data;throw new C(n.message||n.error,n.error,e.response.status)}else if(typeof e.response.data=="string")throw new C(e.response.data,null,e.response.status)}let r=e;throw delete r.config,delete r.request,delete r.response,new C(r.message,r)}headers(e){let r=e.headers||{};return(e.apiKey||this.apiKey)&&(r["X-Api-Key"]=e.apiKey||this.apiKey),this.accessToken&&(r.Authorization=r.Authorization||`Bearer ${this.accessToken}`),{headers:r}}};return pt(yn);})();
1
+ "use strict";var FlowEngineClient=(()=>{var Ls=Object.create;var se=Object.defineProperty,Is=Object.defineProperties,Ds=Object.getOwnPropertyDescriptor,Us=Object.getOwnPropertyDescriptors,Ms=Object.getOwnPropertyNames,Nt=Object.getOwnPropertySymbols,$s=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable;var Ft=(r,e,t)=>e in r?se(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,O=(r,e)=>{for(var t in e||(e={}))qt.call(e,t)&&Ft(r,t,e[t]);if(Nt)for(var t of Nt(e))js.call(e,t)&&Ft(r,t,e[t]);return r},Xe=(r,e)=>Is(r,Us(e));var p=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Lt=(r,e)=>{for(var t in e)se(r,t,{get:e[t],enumerable:!0})},It=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ms(e))!qt.call(r,n)&&n!==t&&se(r,n,{get:()=>e[n],enumerable:!(s=Ds(e,n))||s.enumerable});return r};var ye=(r,e,t)=>(t=r!=null?Ls($s(r)):{},It(e||!r||!r.__esModule?se(t,"default",{value:r,enumerable:!0}):t,r)),Ws=r=>It(se({},"__esModule",{value:!0}),r);var Qe=p((Pi,Dt)=>{"use strict";Dt.exports=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return e.apply(t,n)}}});var v=p((Bi,$t)=>{"use strict";var Ks=Qe(),Ze=Object.prototype.toString,et=function(r){return function(e){var t=Ze.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function U(r){return r=r.toLowerCase(),function(t){return et(t)===r}}function tt(r){return Array.isArray(r)}function be(r){return typeof r>"u"}function Hs(r){return r!==null&&!be(r)&&r.constructor!==null&&!be(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Ut=U("ArrayBuffer");function Vs(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Ut(r.buffer),e}function Js(r){return typeof r=="string"}function zs(r){return typeof r=="number"}function Mt(r){return r!==null&&typeof r=="object"}function ge(r){if(et(r)!=="object")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}var Ys=U("Date"),Xs=U("File"),Qs=U("Blob"),Gs=U("FileList");function rt(r){return Ze.call(r)==="[object Function]"}function Zs(r){return Mt(r)&&rt(r.pipe)}function en(r){var e="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||Ze.call(r)===e||rt(r.toString)&&r.toString()===e)}var tn=U("URLSearchParams");function rn(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function sn(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function st(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),tt(r))for(var t=0,s=r.length;t<s;t++)e.call(null,r[t],t,r);else for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.call(null,r[n],n,r)}function Ge(){var r={};function e(n,i){ge(r[i])&&ge(n)?r[i]=Ge(r[i],n):ge(n)?r[i]=Ge({},n):tt(n)?r[i]=n.slice():r[i]=n}for(var t=0,s=arguments.length;t<s;t++)st(arguments[t],e);return r}function nn(r,e,t){return st(e,function(n,i){t&&typeof n=="function"?r[i]=Ks(n,t):r[i]=n}),r}function on(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function an(r,e,t,s){r.prototype=Object.create(e.prototype,s),r.prototype.constructor=r,t&&Object.assign(r.prototype,t)}function cn(r,e,t){var s,n,i,o={};e=e||{};do{for(s=Object.getOwnPropertyNames(r),n=s.length;n-- >0;)i=s[n],o[i]||(e[i]=r[i],o[i]=!0);r=Object.getPrototypeOf(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e}function un(r,e,t){r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;var s=r.indexOf(e,t);return s!==-1&&s===t}function hn(r){if(!r)return null;var e=r.length;if(be(e))return null;for(var t=new Array(e);e-- >0;)t[e]=r[e];return t}var ln=function(r){return function(e){return r&&e instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));$t.exports={isArray:tt,isArrayBuffer:Ut,isBuffer:Hs,isFormData:en,isArrayBufferView:Vs,isString:Js,isNumber:zs,isObject:Mt,isPlainObject:ge,isUndefined:be,isDate:Ys,isFile:Xs,isBlob:Qs,isFunction:rt,isStream:Zs,isURLSearchParams:tn,isStandardBrowserEnv:sn,forEach:st,merge:Ge,extend:nn,trim:rn,stripBOM:on,inherits:an,toFlatObject:cn,kindOf:et,kindOfTest:U,endsWith:un,toArray:hn,isTypedArray:ln,isFileList:Gs}});var nt=p((Ni,Wt)=>{"use strict";var H=v();function jt(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Wt.exports=function(e,t,s){if(!t)return e;var n;if(s)n=s(t);else if(H.isURLSearchParams(t))n=t.toString();else{var i=[];H.forEach(t,function(h,m){h===null||typeof h>"u"||(H.isArray(h)?m=m+"[]":h=[h],H.forEach(h,function(u){H.isDate(u)?u=u.toISOString():H.isObject(u)&&(u=JSON.stringify(u)),i.push(jt(m)+"="+jt(u))}))}),n=i.join("&")}if(n){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}});var Ht=p((Fi,Kt)=>{"use strict";var fn=v();function ve(){this.handlers=[]}ve.prototype.use=function(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};ve.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};ve.prototype.forEach=function(e){fn.forEach(this.handlers,function(s){s!==null&&e(s)})};Kt.exports=ve});var Jt=p((qi,Vt)=>{"use strict";var pn=v();Vt.exports=function(e,t){pn.forEach(e,function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])})}});var M=p((Li,Qt)=>{"use strict";var zt=v();function V(r,e,t,s,n){Error.call(this),this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),n&&(this.response=n)}zt.inherits(V,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Yt=V.prototype,Xt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){Xt[r]={value:r}});Object.defineProperties(V,Xt);Object.defineProperty(Yt,"isAxiosError",{value:!0});V.from=function(r,e,t,s,n,i){var o=Object.create(Yt);return zt.toFlatObject(r,o,function(h){return h!==Error.prototype}),V.call(o,r.message,e,t,s,n),o.name=r.name,i&&Object.assign(o,i),o};Qt.exports=V});var it=p((Ii,Gt)=>{"use strict";Gt.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var ot=p((Di,Zt)=>{"use strict";var B=v();function dn(r,e){e=e||new FormData;var t=[];function s(i){return i===null?"":B.isDate(i)?i.toISOString():B.isArrayBuffer(i)||B.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function n(i,o){if(B.isPlainObject(i)||B.isArray(i)){if(t.indexOf(i)!==-1)throw Error("Circular reference detected in "+o);t.push(i),B.forEach(i,function(h,m){if(!B.isUndefined(h)){var a=o?o+"."+m:m,u;if(h&&!o&&typeof h=="object"){if(B.endsWith(m,"{}"))h=JSON.stringify(h);else if(B.endsWith(m,"[]")&&(u=B.toArray(h))){u.forEach(function(l){!B.isUndefined(l)&&e.append(a,s(l))});return}}n(h,a)}}),t.pop()}else e.append(o,s(i))}return n(r),e}Zt.exports=dn});var tr=p((Ui,er)=>{"use strict";var at=M();er.exports=function(e,t,s){var n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):t(new at("Request failed with status code "+s.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}});var sr=p((Mi,rr)=>{"use strict";var we=v();rr.exports=we.isStandardBrowserEnv()?function(){return{write:function(t,s,n,i,o,c){var h=[];h.push(t+"="+encodeURIComponent(s)),we.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),we.isString(i)&&h.push("path="+i),we.isString(o)&&h.push("domain="+o),c===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(t){var s=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var ir=p(($i,nr)=>{"use strict";nr.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}});var ar=p((ji,or)=>{"use strict";or.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}});var ct=p((Wi,cr)=>{"use strict";var mn=ir(),yn=ar();cr.exports=function(e,t){return e&&!mn(t)?yn(e,t):t}});var hr=p((Ki,ur)=>{"use strict";var ut=v(),gn=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];ur.exports=function(e){var t={},s,n,i;return e&&ut.forEach(e.split(`
2
+ `),function(c){if(i=c.indexOf(":"),s=ut.trim(c.substr(0,i)).toLowerCase(),n=ut.trim(c.substr(i+1)),s){if(t[s]&&gn.indexOf(s)>=0)return;s==="set-cookie"?t[s]=(t[s]?t[s]:[]).concat([n]):t[s]=t[s]?t[s]+", "+n:n}}),t}});var pr=p((Hi,fr)=>{"use strict";var lr=v();fr.exports=lr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),s;function n(i){var o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=n(window.location.href),function(o){var c=lr.isString(o)?n(o):o;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}()});var ne=p((Vi,mr)=>{"use strict";var ht=M(),bn=v();function dr(r){ht.call(this,r==null?"canceled":r,ht.ERR_CANCELED),this.name="CanceledError"}bn.inherits(dr,ht,{__CANCEL__:!0});mr.exports=dr});var gr=p((Ji,yr)=>{"use strict";yr.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}});var lt=p((zi,br)=>{"use strict";var ie=v(),vn=tr(),wn=sr(),En=nt(),Cn=ct(),xn=hr(),Sn=pr(),Rn=it(),q=M(),kn=ne(),An=gr();br.exports=function(e){return new Promise(function(s,n){var i=e.data,o=e.headers,c=e.responseType,h;function m(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}ie.isFormData(i)&&ie.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",l=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+l)}var g=Cn(e.baseURL,e.url);a.open(e.method.toUpperCase(),En(g,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function re(){if(a){var b="getAllResponseHeaders"in a?xn(a.getAllResponseHeaders()):null,P=!c||c==="text"||c==="json"?a.responseText:a.response,F={data:P,status:a.status,statusText:a.statusText,headers:b,config:e,request:a};vn(function(me){s(me),m()},function(me){n(me),m()},F),a=null}}if("onloadend"in a?a.onloadend=re:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(re)},a.onabort=function(){a&&(n(new q("Request aborted",q.ECONNABORTED,e,a)),a=null)},a.onerror=function(){n(new q("Network Error",q.ERR_NETWORK,e,a,a)),a=null},a.ontimeout=function(){var P=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",F=e.transitional||Rn;e.timeoutErrorMessage&&(P=e.timeoutErrorMessage),n(new q(P,F.clarifyTimeoutError?q.ETIMEDOUT:q.ECONNABORTED,e,a)),a=null},ie.isStandardBrowserEnv()){var x=(e.withCredentials||Sn(g))&&e.xsrfCookieName?wn.read(e.xsrfCookieName):void 0;x&&(o[e.xsrfHeaderName]=x)}"setRequestHeader"in a&&ie.forEach(o,function(P,F){typeof i>"u"&&F.toLowerCase()==="content-type"?delete o[F]:a.setRequestHeader(F,P)}),ie.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),c&&c!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(b){a&&(n(!b||b&&b.type?new kn:b),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),i||(i=null);var E=An(g);if(E&&["http","https","file"].indexOf(E)===-1){n(new q("Unsupported protocol "+E+":",q.ERR_BAD_REQUEST,e));return}a.send(i)})}});var wr=p((Yi,vr)=>{vr.exports=null});var Ce=p((Xi,Sr)=>{"use strict";var w=v(),Er=Jt(),Cr=M(),On=it(),_n=ot(),Tn={"Content-Type":"application/x-www-form-urlencoded"};function xr(r,e){!w.isUndefined(r)&&w.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Pn(){var r;return typeof XMLHttpRequest<"u"?r=lt():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=lt()),r}function Bn(r,e,t){if(w.isString(r))try{return(e||JSON.parse)(r),w.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}var Ee={transitional:On,adapter:Pn(),transformRequest:[function(e,t){if(Er(t,"Accept"),Er(t,"Content-Type"),w.isFormData(e)||w.isArrayBuffer(e)||w.isBuffer(e)||w.isStream(e)||w.isFile(e)||w.isBlob(e))return e;if(w.isArrayBufferView(e))return e.buffer;if(w.isURLSearchParams(e))return xr(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=w.isObject(e),n=t&&t["Content-Type"],i;if((i=w.isFileList(e))||s&&n==="multipart/form-data"){var o=this.env&&this.env.FormData;return _n(i?{"files[]":e}:e,o&&new o)}else if(s||n==="application/json")return xr(t,"application/json"),Bn(e);return e}],transformResponse:[function(e){var t=this.transitional||Ee.transitional,s=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!s&&this.responseType==="json";if(i||n&&w.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?Cr.from(o,Cr.ERR_BAD_RESPONSE,this,null,this.response):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:wr()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};w.forEach(["delete","get","head"],function(e){Ee.headers[e]={}});w.forEach(["post","put","patch"],function(e){Ee.headers[e]=w.merge(Tn)});Sr.exports=Ee});var kr=p((Qi,Rr)=>{"use strict";var Nn=v(),Fn=Ce();Rr.exports=function(e,t,s){var n=this||Fn;return Nn.forEach(s,function(o){e=o.call(n,e,t)}),e}});var ft=p((Gi,Ar)=>{"use strict";Ar.exports=function(e){return!!(e&&e.__CANCEL__)}});var Tr=p((Zi,_r)=>{"use strict";var Or=v(),pt=kr(),qn=ft(),Ln=Ce(),In=ne();function dt(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new In}_r.exports=function(e){dt(e),e.headers=e.headers||{},e.data=pt.call(e,e.data,e.headers,e.transformRequest),e.headers=Or.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Or.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||Ln.adapter;return t(e).then(function(n){return dt(e),n.data=pt.call(e,n.data,n.headers,e.transformResponse),n},function(n){return qn(n)||(dt(e),n&&n.response&&(n.response.data=pt.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var mt=p((eo,Pr)=>{"use strict";var S=v();Pr.exports=function(e,t){t=t||{};var s={};function n(a,u){return S.isPlainObject(a)&&S.isPlainObject(u)?S.merge(a,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function i(a){if(S.isUndefined(t[a])){if(!S.isUndefined(e[a]))return n(void 0,e[a])}else return n(e[a],t[a])}function o(a){if(!S.isUndefined(t[a]))return n(void 0,t[a])}function c(a){if(S.isUndefined(t[a])){if(!S.isUndefined(e[a]))return n(void 0,e[a])}else return n(void 0,t[a])}function h(a){if(a in t)return n(e[a],t[a]);if(a in e)return n(void 0,e[a])}var m={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:h};return S.forEach(Object.keys(e).concat(Object.keys(t)),function(u){var l=m[u]||i,g=l(u);S.isUndefined(g)&&l!==h||(s[u]=g)}),s}});var yt=p((to,Br)=>{Br.exports={version:"0.27.2"}});var qr=p((ro,Fr)=>{"use strict";var Dn=yt().version,D=M(),gt={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){gt[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var Nr={};gt.transitional=function(e,t,s){function n(i,o){return"[Axios v"+Dn+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return function(i,o,c){if(e===!1)throw new D(n(o," has been removed"+(t?" in "+t:"")),D.ERR_DEPRECATED);return t&&!Nr[o]&&(Nr[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,c):!0}};function Un(r,e,t){if(typeof r!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(r),n=s.length;n-- >0;){var i=s[n],o=e[i];if(o){var c=r[i],h=c===void 0||o(c,i,r);if(h!==!0)throw new D("option "+i+" must be "+h,D.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}}Fr.exports={assertOptions:Un,validators:gt}});var $r=p((so,Mr)=>{"use strict";var Dr=v(),Mn=nt(),Lr=Ht(),Ir=Tr(),xe=mt(),$n=ct(),Ur=qr(),J=Ur.validators;function z(r){this.defaults=r,this.interceptors={request:new Lr,response:new Lr}}z.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=xe(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&Ur.assertOptions(s,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(i=i&&g.synchronous,n.unshift(g.fulfilled,g.rejected))});var o=[];this.interceptors.response.forEach(function(g){o.push(g.fulfilled,g.rejected)});var c;if(!i){var h=[Ir,void 0];for(Array.prototype.unshift.apply(h,n),h=h.concat(o),c=Promise.resolve(t);h.length;)c=c.then(h.shift(),h.shift());return c}for(var m=t;n.length;){var a=n.shift(),u=n.shift();try{m=a(m)}catch(l){u(l);break}}try{c=Ir(m)}catch(l){return Promise.reject(l)}for(;o.length;)c=c.then(o.shift(),o.shift());return c};z.prototype.getUri=function(e){e=xe(this.defaults,e);var t=$n(e.baseURL,e.url);return Mn(t,e.params,e.paramsSerializer)};Dr.forEach(["delete","get","head","options"],function(e){z.prototype[e]=function(t,s){return this.request(xe(s||{},{method:e,url:t,data:(s||{}).data}))}});Dr.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,c){return this.request(xe(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}z.prototype[e]=t(),z.prototype[e+"Form"]=t(!0)});Mr.exports=z});var Wr=p((no,jr)=>{"use strict";var jn=ne();function Y(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var t=this;this.promise.then(function(s){if(t._listeners){var n,i=t._listeners.length;for(n=0;n<i;n++)t._listeners[n](s);t._listeners=null}}),this.promise.then=function(s){var n,i=new Promise(function(o){t.subscribe(o),n=o}).then(s);return i.cancel=function(){t.unsubscribe(n)},i},r(function(n){t.reason||(t.reason=new jn(n),e(t.reason))})}Y.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Y.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};Y.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}};Y.source=function(){var e,t=new Y(function(n){e=n});return{token:t,cancel:e}};jr.exports=Y});var Hr=p((io,Kr)=>{"use strict";Kr.exports=function(e){return function(s){return e.apply(null,s)}}});var Jr=p((oo,Vr)=>{"use strict";var Wn=v();Vr.exports=function(e){return Wn.isObject(e)&&e.isAxiosError===!0}});var Xr=p((ao,bt)=>{"use strict";var zr=v(),Kn=Qe(),Se=$r(),Hn=mt(),Vn=Ce();function Yr(r){var e=new Se(r),t=Kn(Se.prototype.request,e);return zr.extend(t,Se.prototype,e),zr.extend(t,e),t.create=function(n){return Yr(Hn(r,n))},t}var C=Yr(Vn);C.Axios=Se;C.CanceledError=ne();C.CancelToken=Wr();C.isCancel=ft();C.VERSION=yt().version;C.toFormData=ot();C.AxiosError=M();C.Cancel=C.CanceledError;C.all=function(e){return Promise.all(e)};C.spread=Hr();C.isAxiosError=Jr();bt.exports=C;bt.exports.default=C});var Gr=p((co,Qr)=>{Qr.exports=Xr()});var es=p((uo,Zr)=>{var X=1e3,Q=X*60,G=Q*60,$=G*24,Jn=$*7,zn=$*365.25;Zr.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return Yn(r);if(t==="number"&&isFinite(r))return e.long?Qn(r):Xn(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Yn(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return t*zn;case"weeks":case"week":case"w":return t*Jn;case"days":case"day":case"d":return t*$;case"hours":case"hour":case"hrs":case"hr":case"h":return t*G;case"minutes":case"minute":case"mins":case"min":case"m":return t*Q;case"seconds":case"second":case"secs":case"sec":case"s":return t*X;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Xn(r){var e=Math.abs(r);return e>=$?Math.round(r/$)+"d":e>=G?Math.round(r/G)+"h":e>=Q?Math.round(r/Q)+"m":e>=X?Math.round(r/X)+"s":r+"ms"}function Qn(r){var e=Math.abs(r);return e>=$?Re(r,e,$,"day"):e>=G?Re(r,e,G,"hour"):e>=Q?Re(r,e,Q,"minute"):e>=X?Re(r,e,X,"second"):r+" ms"}function Re(r,e,t,s){var n=e>=t*1.5;return Math.round(r/t)+" "+s+(n?"s":"")}});var rs=p((ho,ts)=>{function Gn(r){t.debug=t,t.default=t,t.coerce=h,t.disable=i,t.enable=n,t.enabled=o,t.humanize=es(),t.destroy=m,Object.keys(r).forEach(a=>{t[a]=r[a]}),t.names=[],t.skips=[],t.formatters={};function e(a){let u=0;for(let l=0;l<a.length;l++)u=(u<<5)-u+a.charCodeAt(l),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(a){let u,l=null,g,re;function x(...E){if(!x.enabled)return;let b=x,P=Number(new Date),F=P-(u||P);b.diff=F,b.prev=u,b.curr=P,u=P,E[0]=t.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let K=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(Ye,Fs)=>{if(Ye==="%%")return"%";K++;let Bt=t.formatters[Fs];if(typeof Bt=="function"){let qs=E[K];Ye=Bt.call(b,qs),E.splice(K,1),K--}return Ye}),t.formatArgs.call(b,E),(b.log||t.log).apply(b,E)}return x.namespace=a,x.useColors=t.useColors(),x.color=t.selectColor(a),x.extend=s,x.destroy=t.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==t.namespaces&&(g=t.namespaces,re=t.enabled(a)),re),set:E=>{l=E}}),typeof t.init=="function"&&t.init(x),x}function s(a,u){let l=t(this.namespace+(typeof u>"u"?":":u)+a);return l.log=this.log,l}function n(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let u,l=(typeof a=="string"?a:"").split(/[\s,]+/),g=l.length;for(u=0;u<g;u++)l[u]&&(a=l[u].replace(/\*/g,".*?"),a[0]==="-"?t.skips.push(new RegExp("^"+a.slice(1)+"$")):t.names.push(new RegExp("^"+a+"$")))}function i(){let a=[...t.names.map(c),...t.skips.map(c).map(u=>"-"+u)].join(",");return t.enable(""),a}function o(a){if(a[a.length-1]==="*")return!0;let u,l;for(u=0,l=t.skips.length;u<l;u++)if(t.skips[u].test(a))return!1;for(u=0,l=t.names.length;u<l;u++)if(t.names[u].test(a))return!0;return!1}function c(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function h(a){return a instanceof Error?a.stack||a.message:a}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}ts.exports=Gn});var vt=p((R,ke)=>{R.formatArgs=ei;R.save=ti;R.load=ri;R.useColors=Zn;R.storage=si();R.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();R.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Zn(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ei(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+ke.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,s=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(s=t))}),r.splice(s,0,e)}R.log=console.debug||console.log||(()=>{});function ti(r){try{r?R.storage.setItem("debug",r):R.storage.removeItem("debug")}catch(e){}}function ri(){let r;try{r=R.storage.getItem("debug")}catch(e){}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function si(){try{return localStorage}catch(r){}}ke.exports=rs()(R);var{formatters:ni}=ke.exports;ni.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ns=p((Lo,ss)=>{ss.exports=typeof self=="object"?self.FormData:window.FormData});var _i={};Lt(_i,{BaseEndpoints:()=>y,Client:()=>Pt,FlowEngineError:()=>L});var Bs=ye(Gr()),Ns=ye(vt());var y=class{constructor(e,t){this.client=e;this.resourcePath=t}get resourceEndpoint(){return`/api/v1/${this.resourcePath}`}list(e){if(e!=null&&e.filter){let t=e.filter;Object.keys(t).forEach(s=>{e[`filter[${s}]`]=t[s]}),delete e.filter}return this.client._get(this.resourceEndpoint,{params:e})}get(e,t={}){return this.client._get(`${this.resourceEndpoint}/${e}`,{params:t})}create(e,t={}){return this.client._post(`${this.resourceEndpoint}`,e,{params:t})}update(e,t,s={}){return this.client._put(`${this.resourceEndpoint}/${e}`,t,{params:s})}delete(e,t={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:t})}getMetadata(e,t,s={}){let n=t?`${this.resourceEndpoint}/${e}/metadata/${t}`:`${this.resourceEndpoint}/${e}/metadata`;return this.client._get(n,{params:s})}setMetadata(e,t,s,n={}){return(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&(s={value:s}),this.client._put(`${this.resourceEndpoint}/${e}/metadata/${t}`,s,{headers:{"Content-Type":"application/json"},params:n})}deleteMetadata(e,t,s={}){return this.client._delete(`${this.resourceEndpoint}/${e}/metadata/${t}`,{headers:{"Content-Type":"application/json"},params:s})}};var Ae=class extends y{constructor(e){super(e,"apikeys")}};var Oe=class{constructor(e){this.client=e}get resourceEndpoint(){return"/api/v1/appconfig"}get(e,t={}){return this.client._get(e?`${this.resourceEndpoint}/${e}`:this.resourceEndpoint,{params:t})}set(e,t,s={}){return(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||Array.isArray(t))&&(t={value:t}),this.client._put(`${this.resourceEndpoint}/${e}`,t,{headers:{"Content-Type":"application/json"},params:s})}delete(e,t={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:t})}subscribe(e){return this.client._subscribe("appconfig",e)}};var _e=class extends y{constructor(e){super(e,"applications")}};var Te=class extends y{constructor(e){super(e,"auth/users")}me(e){return this.client._get(`${this.resourceEndpoint}/me`,{headers:{Authorization:`Bearer ${e}`}})}};var Pe=class{constructor(e){this.client=e;this.users=new Te(this.client)}login(e,t,s){return this.client._post("/api/v1/auth/login",{email:e,password:t,applicationId:s})}logout(e,t){return this.client._post("/api/v1/auth/logout",{refreshToken:t},{headers:{Authorization:`Bearer ${e}`}})}refresh(e,t){return this.client._post("/api/v1/auth/refresh",{refreshToken:e,applicationId:t})}changePassword(e,t,s){return this.client._post("/api/v1/auth/changepassword",{password:e,newPassword:t},{headers:{Authorization:`Bearer ${s}`}})}signUp(e,t,s,n,i,o){return this.client._post("/api/v1/auth/signup",{firstName:e,lastName:t,email:s,password:n,applicationId:i,confirmUrl:`${this.client.baseUrl}/api/v1/auth/confirmsignup`,redirectUrl:o})}requestPasswordReset(e,t,s){return this.client._post("/api/v1/auth/requestpasswordreset",{email:e,applicationId:t,redirectUrl:s})}resetPassword(e,t,s,n){return this.client._post("/api/v1/auth/resetpassword",{email:e,password:t,applicationId:s,token:n})}};var Be=class extends y{constructor(e){super(e,"databases")}drivers(){return this.client._get("/api/v1/databases/drivers").catch(e=>{if(e.status===404)return["postgis","postgis-mapnik"]})}};var Ne=class extends y{constructor(e){super(e,"datasets")}query(e,t={},s={}){return typeof e=="object"&&(s=Xe(O({},e.params),{format:e.format||"json"}),t=e,e=t.datasetId,delete t.datasetId,delete t.format),typeof s=="string"&&(s={format:s}),this.client._post(`/api/v1/datasets/${e}/query`,t,{params:Xe(O({},s),{format:s.format||"json",explain:s.explain||!1})}).catch(n=>{throw n.message==="Network Error"?new Error("Query timed out"):n})}getExportUrl(e,t){let s=this.client.accessToken?`accesstoken=${this.client.accessToken}`:`apikey=${this.client.apiKey}`;return`${this.client.baseUrl}/api/v1/datasets/${e}/export?format=${t}&${s}`}subscribe(e,t){return this.client._subscribe(`dataset-${e}`,t)}};var L=class extends Error{constructor(t,s=null,n=500){super(t||"Unknown Error");Object.setPrototypeOf(this,L.prototype),this.statusCode=n,this.error=s}};var Fe=class extends y{constructor(e){super(e,"jobs")}submit(e){return this.client._post("/api/v1/jobs/submit",e)}getStatus(e){return this.client._get(`/api/v1/jobs/${e}/status`)}setStatus(e,t){return this.client._post(`/api/v1/jobs/${e}/status`,t)}cancel(e){return this.client._post(`/api/v1/jobs/${e}/cancel`,{})}request(e){return this.client._post("/api/v1/jobs/request",{type:e})}};var qe=class{constructor(e){this.client=e}get(e,t={}){return this.client._get(`/maps/${e}.json`,{params:t})}};var Le=class extends y{constructor(e){super(e,"styles")}};var Ie=class extends y{constructor(e){super(e,"tilesources")}drivers(){return this.client._get("/api/v1/tilesources/drivers").catch(e=>{if(e.statusCode===404)return["tilelive","dataset"]})}};var De=class{constructor(e){this.client=e}getTileSpec(e,t={}){return this.client._get(`/tiles/${e}/index.json`,{params:t})}getPreviewStyle(e,t={}){return this.client._get(`/tiles/${e}/style.json`,{params:t})}};var is=ye(ns()),Ue=class extends y{constructor(e){super(e,"uploads")}async upload(e,t={}){let s=new is.default;return e.datasetName&&s.append("name",e.datasetName),e.datasetDescription&&s.append("description",e.datasetDescription),e.attribution&&s.append("attribution",e.attribution),e.datasetId&&s.append("datasetId",e.datasetId),e.sourceSrid&&s.append("sourceSrid",e.sourceSrid),e.targetSrid&&s.append("targetSrid",e.targetSrid),e.schema&&s.append("schema",e.schema),s.append("file",e.data,e.filename),await this.client._post(this.resourceEndpoint,s,{headers:s.getHeaders(),params:t,onUploadProgress:e.progress})}};var Ps=ye(vt());var N=Object.create(null);N.open="0";N.close="1";N.ping="2";N.pong="3";N.message="4";N.upgrade="5";N.noop="6";var oe=Object.create(null);Object.keys(N).forEach(r=>{oe[N[r]]=r});var os={type:"error",data:"parser error"};var ii=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",oi=typeof ArrayBuffer=="function",ai=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ci=({type:r,data:e},t,s)=>ii&&e instanceof Blob?t?s(e):as(e,s):oi&&(e instanceof ArrayBuffer||ai(e))?t?s(e):as(new Blob([e]),s):s(N[r]+(e||"")),as=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)},Me=ci;var cs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ae=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<cs.length;r++)ae[cs.charCodeAt(r)]=r;var us=r=>{let e=r.length*.75,t=r.length,s,n=0,i,o,c,h;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),a=new Uint8Array(m);for(s=0;s<t;s+=4)i=ae[r.charCodeAt(s)],o=ae[r.charCodeAt(s+1)],c=ae[r.charCodeAt(s+2)],h=ae[r.charCodeAt(s+3)],a[n++]=i<<2|o>>4,a[n++]=(o&15)<<4|c>>2,a[n++]=(c&3)<<6|h&63;return m};var ui=typeof ArrayBuffer=="function",hi=(r,e)=>{if(typeof r!="string")return{type:"message",data:hs(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:li(r.substring(1),e)}:oe[t]?r.length>1?{type:oe[t],data:r.substring(1)}:{type:oe[t]}:os},li=(r,e)=>{if(ui){let t=us(r);return hs(t,e)}else return{base64:!0,data:r}},hs=(r,e)=>{switch(e){case"blob":return r instanceof ArrayBuffer?new Blob([r]):r;case"arraybuffer":default:return r}},$e=hi;var ls=String.fromCharCode(30),fs=(r,e)=>{let t=r.length,s=new Array(t),n=0;r.forEach((i,o)=>{Me(i,!1,c=>{s[o]=c,++n===t&&e(s.join(ls))})})},ps=(r,e)=>{let t=r.split(ls),s=[];for(let n=0;n<t.length;n++){let i=$e(t[n],e);if(s.push(i),i.type==="error")break}return s},wt=4;function d(r){if(r)return fi(r)}function fi(r){for(var e in d.prototype)r[e]=d.prototype[e];return r}d.prototype.on=d.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};d.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,n=0;n<t.length;n++)if(s=t[n],s===e||s.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+r],this};d.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,n=t.length;s<n;++s)t[s].apply(this,e)}return this};d.prototype.emitReserved=d.prototype.emit;d.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};d.prototype.hasListeners=function(r){return!!this.listeners(r).length};var _=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function je(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var pi=setTimeout,di=clearTimeout;function I(r,e){e.useNativeTimers?(r.setTimeoutFn=pi.bind(_),r.clearTimeoutFn=di.bind(_)):(r.setTimeoutFn=setTimeout.bind(_),r.clearTimeoutFn=clearTimeout.bind(_))}var mi=1.33;function ds(r){return typeof r=="string"?yi(r):Math.ceil((r.byteLength||r.size)*mi)}function yi(r){let e=0,t=0;for(let s=0,n=r.length;s<n;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}var Et=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},j=class extends d{constructor(e){super(),this.writable=!1,I(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,s){return super.emitReserved("error",new Et(e,t,s)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(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)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=$e(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}};var bs="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ct=64,gi={},ms=0,We=0,ys;function gs(r){let e="";do e=bs[r%Ct]+e,r=Math.floor(r/Ct);while(r>0);return e}function Ke(){let r=gs(+new Date);return r!==ys?(ms=0,ys=r):r+"."+gs(ms++)}for(;We<Ct;We++)gi[bs[We]]=We;function He(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function vs(r){let e={},t=r.split("&");for(let s=0,n=t.length;s<n;s++){let i=t[s].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}var ws=!1;try{ws=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(r){}var Es=ws;function xt(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Es))return new XMLHttpRequest}catch(t){}if(!e)try{return new _[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function bi(){}var vi=function(){return new xt({xdomain:!1}).responseType!=null}(),Ve=class extends j{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){let s=location.protocol==="https:",n=location.port;n||(n=s?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==s}let t=e&&e.forceBase64;this.supportsBinary=vi&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let s=0;this.polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};ps(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,fs(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{},t=this.opts.secure?"https":"http",s="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Ke()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(t==="https"&&Number(this.opts.port)!==443||t==="http"&&Number(this.opts.port)!==80)&&(s=":"+this.opts.port);let n=He(e),i=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(n.length?"?"+n:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new T(this.uri(),e)}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(n,i)=>{this.onError("xhr post error",n,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},T=class extends d{constructor(e,t){super(),I(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.create()}create(){let e=je(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;let t=this.xhr=new xt(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&t.setRequestHeader(s,this.opts.extraHeaders[s])}}catch(s){}if(this.method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{t.setRequestHeader("Accept","*/*")}catch(s){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{t.readyState===4&&(t.status===200||t.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof t.status=="number"?t.status:0)},0))},t.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(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>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=bi,e)try{this.xhr.abort()}catch(t){}typeof document<"u"&&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()}};T.requestsCount=0;T.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Cs);else if(typeof addEventListener=="function"){let r="onpagehide"in _?"pagehide":"unload";addEventListener(r,Cs,!1)}}function Cs(){for(let r in T.requests)T.requests.hasOwnProperty(r)&&T.requests[r].abort()}var ce=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),ue=_.WebSocket||_.MozWebSocket,Je=!0,xs="arraybuffer";var Ss=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ze=class extends j{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let e=this.uri(),t=this.opts.protocols,s=Ss?{}:je(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=Je&&!Ss?t?new ue(e,t):new ue(e):new ue(e,t,s)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType||xs,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],n=t===e.length-1;Me(s,this.supportsBinary,i=>{let o={};Je||(s.options&&(o.compress=s.options.compress),this.opts.perMessageDeflate&&(typeof i=="string"?Buffer.byteLength(i):i.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{Je?this.ws.send(i):this.ws.send(i,o)}catch(c){}n&&ce(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{},t=this.opts.secure?"wss":"ws",s="";this.opts.port&&(t==="wss"&&Number(this.opts.port)!==443||t==="ws"&&Number(this.opts.port)!==80)&&(s=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Ke()),this.supportsBinary||(e.b64=1);let n=He(e),i=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(n.length?"?"+n:"")}check(){return!!ue}};var St={websocket:ze,polling:Ve};var wi=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ei=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Z(r){let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let n=wi.exec(r||""),i={},o=14;for(;o--;)i[Ei[o]]=n[o]||"";return t!=-1&&s!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Ci(i,i.path),i.queryKey=xi(i,i.query),i}function Ci(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function xi(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,n,i){n&&(t[n]=i)}),t}var k=class extends d{constructor(e,t={}){super(),e&&typeof e=="object"&&(t=e,e=null),e?(e=Z(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Z(t.host).host),I(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=vs(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=wt,t.transport=e,this.id&&(t.sid=this.id);let s=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new St[e](s)}open(){let e;if(this.opts.rememberUpgrade&&k.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch(t){this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),s=!1;k.priorWebsocketSuccess=!1;let n=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",u=>{if(!s)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;k.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(a(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let l=new Error("probe error");l.transport=t.name,this.emitReserved("upgradeError",l)}}))};function i(){s||(s=!0,a(),t.close(),t=null)}let o=u=>{let l=new Error("probe error: "+u);l.transport=t.name,i(),this.emitReserved("upgradeError",l)};function c(){o("transport closed")}function h(){o("socket closed")}function m(u){t&&u.name!==t.name&&i()}let a=()=>{t.removeListener("open",n),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",m)};t.once("open",n),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",m),t.open()}onOpen(){if(this.readyState="open",k.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0,t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":let t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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();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 t=1;for(let s=0;s<this.writeBuffer.length;s++){let n=this.writeBuffer[s].data;if(n&&(t+=ds(n)),s>0&&t>this.maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}write(e,t,s){return this.sendPacket("message",e,t,s),this}send(e,t,s){return this.sendPacket("message",e,t,s),this}sendPacket(e,t,s,n){if(typeof t=="function"&&(n=t,t=void 0),typeof s=="function"&&(n=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;let i={type:e,data:t,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}onError(e){k.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){let t=[],s=0,n=e.length;for(;s<n;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}};k.protocol=wt;var Ua=k.protocol;function Rs(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=Z(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let i=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+e,s.href=s.protocol+"://"+i+(t&&t.port===s.port?"":":"+s.port),s}var _t={};Lt(_t,{Decoder:()=>fe,Encoder:()=>At,PacketType:()=>f,protocol:()=>_s});var Si=typeof ArrayBuffer=="function",Ri=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,ks=Object.prototype.toString,ki=typeof Blob=="function"||typeof Blob<"u"&&ks.call(Blob)==="[object BlobConstructor]",Ai=typeof File=="function"||typeof File<"u"&&ks.call(File)==="[object FileConstructor]";function le(r){return Si&&(r instanceof ArrayBuffer||Ri(r))||ki&&r instanceof Blob||Ai&&r instanceof File}function he(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(he(r[t]))return!0;return!1}if(le(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return he(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&he(r[t]))return!0;return!1}function As(r){let e=[],t=r.data,s=r;return s.data=Rt(t,e),s.attachments=e.length,{packet:s,buffers:e}}function Rt(r,e){if(!r)return r;if(le(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=Rt(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=Rt(r[s],e));return t}return r}function Os(r,e){return r.data=kt(r.data,e),delete r.attachments,r}function kt(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=kt(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=kt(r[t],e));return r}var _s=5,f;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(f||(f={}));var At=class{constructor(e){this.replacer=e}encode(e){return(e.type===f.EVENT||e.type===f.ACK)&&he(e)?this.encodeAsBinary({type:e.type===f.EVENT?f.BINARY_EVENT:f.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===f.BINARY_EVENT||e.type===f.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=As(e),s=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(s),n}},fe=class extends d{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===f.BINARY_EVENT;s||t.type===f.BINARY_ACK?(t.type=s?f.EVENT:f.ACK,this.reconstructor=new Ot(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(le(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(f[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===f.BINARY_EVENT||s.type===f.BINARY_ACK){let i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(i,t)}else s.nsp="/";let n=e.charAt(t+1);if(n!==""&&Number(n)==n){let i=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){let i=this.tryParse(e.substr(t));if(fe.isPayloadValid(s.type,i))s.data=i;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case f.CONNECT:return typeof t=="object";case f.DISCONNECT:return t===void 0;case f.CONNECT_ERROR:return typeof t=="string"||typeof t=="object";case f.EVENT:case f.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case f.ACK:case f.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Ot=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 t=Os(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function A(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var Oi=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),ee=class extends d{constructor(e,t,s){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[A(e,"open",this.onopen.bind(this)),A(e,"packet",this.onpacket.bind(this)),A(e,"error",this.onerror.bind(this)),A(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,...t){if(Oi.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);let s={type:f.EVENT,data:t};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let o=this.ids++,c=t.pop();this._registerAckCallback(o,c),s.id=o}let n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!n||!this.connected)||(this.connected?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){let s=this.flags.timeout;if(s===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);t.call(this,new Error("operation has timed out"))},s);this.acks[e]=(...i)=>{this.io.clearTimeoutFn(n),t.apply(this,[null,...i])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:f.CONNECT,data:e})}):this.packet({type:f.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case f.CONNECT:if(e.data&&e.data.sid){let n=e.data.sid;this.onconnect(n)}else 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 f.EVENT:case f.BINARY_EVENT:this.onevent(e);break;case f.ACK:case f.BINARY_ACK:this.onack(e);break;case f.DISCONNECT:this.ondisconnect();break;case f.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e)}ack(e){let t=this,s=!1;return function(...n){s||(s=!0,t.packet({type:f.ACK,id:e,data:n}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),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(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:f.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 t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,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 t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function W(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}W.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};W.prototype.reset=function(){this.attempts=0};W.prototype.setMin=function(r){this.ms=r};W.prototype.setMax=function(r){this.max=r};W.prototype.setJitter=function(r){this.jitter=r};var te=class extends d{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,I(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new W({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let n=t.parser||_t;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.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(~this._readyState.indexOf("open"))return this;this.engine=new k(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let n=A(t,"open",function(){s.onopen(),e&&e()}),i=A(t,"error",o=>{s.cleanup(),s._readyState="closed",this.emitReserved("error",o),e?e(o):s.maybeReconnectOnOpen()});if(this._timeout!==!1){let o=this._timeout;o===0&&n();let c=this.setTimeoutFn(()=>{n(),t.close(),t.emit("error",new Error("timeout"))},o);this.opts.autoUnref&&c.unref(),this.subs.push(function(){clearTimeout(c)})}return this.subs.push(n),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(A(e,"ping",this.onping.bind(this)),A(e,"data",this.ondata.bind(this)),A(e,"error",this.onerror.bind(this)),A(e,"close",this.onclose.bind(this)),A(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){ce(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s||(s=new ee(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var pe={};function de(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Rs(r,e.path||"/socket.io"),s=t.source,n=t.id,i=t.path,o=pe[n]&&i in pe[n].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,h;return c?h=new te(s,e):(pe[n]||(pe[n]=new te(s,e)),h=pe[n]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(de,{Manager:te,Socket:ee,io:de,connect:de});var Ts=(0,Ps.debug)("flow-engine-client");function Tt(r,e){let t={};r.apiKey&&(t["x-api-key"]=r.apiKey),r.accessToken&&(t.Authorization=`Bearer ${r.accessToken}`);let s=de(r.baseUrl,{withCredentials:!0,extraHeaders:t});return s.on("connect",()=>{Ts(`Socket connected: ${s.id}`)}),s.on("disconnect",()=>{Ts(`Socket disconnected: ${s.id}`)}),s}var Pt=class{constructor(e,t=null){this.baseUrl=e;this.apiKey=t;this.debug=(0,Ns.debug)("flow-engine-client");this.accessToken=null;this.auth=new Pe(this);this.tiles=new De(this);this.maps=new qe(this);this.apiKeys=new Ae(this);this.applications=new _e(this);this.appconfig=new Oe(this);this.databases=new Be(this);this.datasets=new Ne(this);this.styles=new Le(this);this.tileSources=new Ie(this);this.uploads=new Ue(this);this.jobs=new Fe(this);this.axios=Bs.default.create({baseURL:e,maxContentLength:524288e3})}config(){return this._get("/api/v1/config")}_get(e,t={}){var s;return(s=t.params)!=null&&s.apiKey&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(O(O({method:"get",url:e},t),this.headers(t))).then(n=>n.data).catch(this.handleError)}_post(e,t,s={}){var n;return(n=s.params)!=null&&n.apiKey&&(s.apiKey=s.params.apiKey,delete s.params.apiKey),this.axios(O(O({method:"post",url:e,data:t,maxContentLength:1/0,maxBodyLength:1/0},s),this.headers(s))).then(i=>i.data).catch(this.handleError)}_put(e,t,s={}){var n;return(n=s.params)!=null&&n.apiKey&&(s.apiKey=s.params.apiKey,delete s.params.apiKey),this.axios(O(O({method:"put",url:e,data:t},s),this.headers(s))).then(i=>i.data).catch(this.handleError)}_delete(e,t={}){var s;return(s=t.params)!=null&&s.apiKey&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(O(O({method:"delete",url:e},t),this.headers(t))).then(n=>n.data).catch(this.handleError)}_subscribe(e,t){this.webSocketGateway||(this.webSocketGateway=Tt(this)),this.debug(`Subscribing to channel '${e}`);let s=i=>{i.channel===e&&t(null,i)},n=i=>{this.webSocketGateway.off("message",s),this._unsubscribe(e,i)};return this.webSocketGateway.emit("subscribe",{channel:"appconfig"},i=>{if(i.status==="error")return this.debug(`Error subscribed to channel '${e}`,i),t(new Error(i.message));this.debug(`Subscribed to channel '${e}`),this.webSocketGateway.on("message",s)}),n}_unsubscribe(e,t){this.webSocketGateway||(this.webSocketGateway=Tt(this)),this.debug(`Unsubscribing from channel '${e}`),this.webSocketGateway.emit("unsubscribe",{channel:e},s=>{s.status==="error"?(this.debug(`Error unsubscribing from channel '${e}`,s),t&&t(new Error(s.message))):(this.debug(`Unsubscribed from channel '${e}`),t&&t(null))})}handleError(e){if(e.response&&e.response.data){if(typeof e.response.data=="object"){let s=e.response.data;throw new L(s.message||s.error,s.error,e.response.status)}else if(typeof e.response.data=="string")throw new L(e.response.data,null,e.response.status)}let t=e;throw delete t.config,delete t.request,delete t.response,new L(t.message,t)}headers(e){let t=e.headers||{};return(e.apiKey||this.apiKey)&&(t["X-Api-Key"]=e.apiKey||this.apiKey),this.accessToken&&(t.Authorization=t.Authorization||`Bearer ${this.accessToken}`),{headers:t}}};return Ws(_i);})();
3
3
  //# sourceMappingURL=bundle.js.map