@rtsdk/topia 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -16,4 +16,4 @@ ta=sa,aa=sa.exports,function(){var e,n="Expected a function",i="__lodash_hash_un
16
16
  * Copyright(c) 2015 Douglas Christopher Wilson
17
17
  * MIT Licensed
18
18
  */
19
- function(e){var n,i,t,o=xo.exports,s=a.extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var n=r.exec(e),i=n&&o[n[1].toLowerCase()];return i&&i.charset?i.charset:!(!n||!c.test(n[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(n){if(!n||"string"!=typeof n)return!1;var i=-1===n.indexOf("/")?e.lookup(n):n;if(!i)return!1;if(-1===i.indexOf("charset")){var t=e.charset(i);t&&(i+="; charset="+t.toLowerCase())}return i},e.extension=function(n){if(!n||"string"!=typeof n)return!1;var i=r.exec(n),t=i&&e.extensions[i[1].toLowerCase()];if(!t||!t.length)return!1;return t[0]},e.extensions=Object.create(null),e.lookup=function(n){if(!n||"string"!=typeof n)return!1;var i=s("x."+n).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),n=e.extensions,i=e.types,t=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var a=o[e],s=a.extensions;if(s&&s.length){n[e]=s;for(var r=0;r<s.length;r++){var c=s[r];if(i[c]){var p=t.indexOf(o[i[c]].source),l=t.indexOf(a.source);if("application/octet-stream"!==i[c]&&(p>l||p===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}}))}(vo);var go=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},bo=function(e){var n=!1;return go((function(){n=!0})),function(i,t){n?e(i,t):go((function(){e(i,t)}))}};var yo=function(e){Object.keys(e.jobs).forEach(wo.bind(e)),e.jobs={}};function wo(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var _o=bo,Eo=yo,jo=function(e,n,i,t){var a=i.keyedList?i.keyedList[i.index]:i.index;i.jobs[a]=function(e,n,i,t){var a;a=2==e.length?e(i,_o(t)):e(i,n,_o(t));return a}(n,a,e[a],(function(e,n){a in i.jobs&&(delete i.jobs[a],e?Eo(i):i.results[a]=n,t(e,i.results))}))};var ko=function(e,n){var i=!Array.isArray(e),t={index:0,keyedList:i||n?Object.keys(e):null,jobs:{},results:i?{}:[],size:i?Object.keys(e).length:e.length};n&&t.keyedList.sort(i?n:function(i,t){return n(e[i],e[t])});return t};var So=yo,Ro=bo,Oo=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,So(this),Ro(e)(null,this.results)};var Ao=jo,To=ko,Co=Oo,Io=function(e,n,i){var t=To(e);for(;t.index<(t.keyedList||e).length;)Ao(e,n,t,(function(e,n){e?i(e,n):0!==Object.keys(t.jobs).length||i(null,t.results)})),t.index++;return Co.bind(t,i)};var Lo={exports:{}},No=jo,$o=ko,zo=Oo;function Po(e,n){return e<n?-1:e>n?1:0}Lo.exports=function(e,n,i,t){var a=$o(e,i);return No(e,n,a,(function i(o,s){o?t(o,s):(a.index++,a.index<(a.keyedList||e).length?No(e,n,a,i):t(null,a.results))})),zo.bind(a,t)},Lo.exports.ascending=Po,Lo.exports.descending=function(e,n){return-1*Po(e,n)};var Bo=Lo.exports,Fo=function(e,n,i){return Bo(e,n,null,i)};var Do={parallel:Io,serial:Fo,serialOrdered:Lo.exports},Uo=fo,qo=i,Mo=a,Vo=o,Ko=s,Go=r.parse,Wo=c,Ho=n.Stream,Xo=vo,Jo=Do,Zo=function(e,n){return Object.keys(n).forEach((function(i){e[i]=e[i]||n[i]})),e},Yo=Qo;function Qo(e){if(!(this instanceof Qo))return new Qo(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Uo.call(this),e=e||{})this[n]=e[n]}function es(e){return to.isPlainObject(e)||to.isArray(e)}function ns(e){return to.endsWith(e,"[]")?e.slice(0,-2):e}function is(e,n,i){return e?e.concat(n).map((function(e,n){return e=ns(e),!i&&n?"["+e+"]":e})).join(i?".":""):n}qo.inherits(Qo,Uo),Qo.LINE_BREAK="\r\n",Qo.DEFAULT_CONTENT_TYPE="application/octet-stream",Qo.prototype.append=function(e,n,i){"string"==typeof(i=i||{})&&(i={filename:i});var t=Uo.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),qo.isArray(n))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,n,i),o=this._multiPartFooter();t(a),t(n),t(o),this._trackLength(a,n,i)}},Qo.prototype._trackLength=function(e,n,i){var t=0;null!=i.knownLength?t+=+i.knownLength:Buffer.isBuffer(n)?t=n.length:"string"==typeof n&&(t=Buffer.byteLength(n)),this._valueLength+=t,this._overheadLength+=Buffer.byteLength(e)+Qo.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof Ho)&&(i.knownLength||this._valuesToMeasure.push(n))},Qo.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):Wo.stat(e.path,(function(i,t){var a;i?n(i):(a=t.size-(e.start?e.start:0),n(null,a))})):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(i){e.pause(),n(null,+i.headers["content-length"])})),e.resume()):n("Unknown stream")},Qo.prototype._multiPartHeader=function(e,n,i){if("string"==typeof i.header)return i.header;var t,a=this._getContentDisposition(n,i),o=this._getContentType(n,i),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),"Content-Type":[].concat(o||[])};for(var c in"object"==typeof i.header&&Zo(r,i.header),r)r.hasOwnProperty(c)&&null!=(t=r[c])&&(Array.isArray(t)||(t=[t]),t.length&&(s+=c+": "+t.join("; ")+Qo.LINE_BREAK));return"--"+this.getBoundary()+Qo.LINE_BREAK+s+Qo.LINE_BREAK},Qo.prototype._getContentDisposition=function(e,n){var i,t;return"string"==typeof n.filepath?i=Mo.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?i=Mo.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(i=Mo.basename(e.client._httpMessage.path||"")),i&&(t='filename="'+i+'"'),t},Qo.prototype._getContentType=function(e,n){var i=n.contentType;return!i&&e.name&&(i=Xo.lookup(e.name)),!i&&e.path&&(i=Xo.lookup(e.path)),!i&&e.readable&&e.hasOwnProperty("httpVersion")&&(i=e.headers["content-type"]),i||!n.filepath&&!n.filename||(i=Xo.lookup(n.filepath||n.filename)),i||"object"!=typeof e||(i=Qo.DEFAULT_CONTENT_TYPE),i},Qo.prototype._multiPartFooter=function(){return function(e){var n=Qo.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},Qo.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Qo.LINE_BREAK},Qo.prototype.getHeaders=function(e){var n,i={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(i[n.toLowerCase()]=e[n]);return i},Qo.prototype.setBoundary=function(e){this._boundary=e},Qo.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Qo.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),i=0,t=this._streams.length;i<t;i++)"function"!=typeof this._streams[i]&&(e=Buffer.isBuffer(this._streams[i])?Buffer.concat([e,this._streams[i]]):Buffer.concat([e,Buffer.from(this._streams[i])]),"string"==typeof this._streams[i]&&this._streams[i].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(Qo.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Qo.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Qo.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Qo.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Qo.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?Jo.parallel(this._valuesToMeasure,this._lengthRetriever,(function(i,t){i?e(i):(t.forEach((function(e){n+=e})),e(null,n))})):process.nextTick(e.bind(this,null,n))},Qo.prototype.submit=function(e,n){var i,t,a={method:"post"};return"string"==typeof e?(e=Go(e),t=Zo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},a)):(t=Zo(e,a)).port||(t.port="https:"==t.protocol?443:80),t.headers=this.getHeaders(e.headers),i="https:"==t.protocol?Ko.request(t):Vo.request(t),this.getLength(function(e,t){if(e&&"Unknown stream"!==e)this._error(e);else if(t&&i.setHeader("Content-Length",t),this.pipe(i),n){var a,o=function(e,t){return i.removeListener("error",o),i.removeListener("response",a),n.call(this,e,t)};a=o.bind(this,null),i.on("error",o),i.on("response",a)}}.bind(this)),i},Qo.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Qo.prototype.toString=function(){return"[object FormData]"};const ts=to.toFlatObject(to,{},null,(function(e){return/^is[A-Z]/.test(e)}));function as(e,n,i){if(!to.isObject(e))throw new TypeError("target must be an object");n=n||new(Yo||FormData);const t=(i=to.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,n){return!to.isUndefined(n[e])}))).metaTokens,a=i.visitor||l,o=i.dots,s=i.indexes,r=(i.Blob||"undefined"!=typeof Blob&&Blob)&&((c=n)&&to.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!to.isFunction(a))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(to.isDate(e))return e.toISOString();if(!r&&to.isBlob(e))throw new ao("Blob is not supported. Use a Buffer instead.");return to.isArrayBuffer(e)||to.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,i,a){let r=e;if(e&&!a&&"object"==typeof e)if(to.endsWith(i,"{}"))i=t?i:i.slice(0,-2),e=JSON.stringify(e);else if(to.isArray(e)&&function(e){return to.isArray(e)&&!e.some(es)}(e)||to.isFileList(e)||to.endsWith(i,"[]")&&(r=to.toArray(e)))return i=ns(i),r.forEach((function(e,t){!to.isUndefined(e)&&null!==e&&n.append(!0===s?is([i],t,o):null===s?i:i+"[]",p(e))})),!1;return!!es(e)||(n.append(is(a,i,o),p(e)),!1)}const u=[],d=Object.assign(ts,{defaultVisitor:l,convertValue:p,isVisitable:es});if(!to.isObject(e))throw new TypeError("data must be an object");return function e(i,t){if(!to.isUndefined(i)){if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+t.join("."));u.push(i),to.forEach(i,(function(i,o){!0===(!(to.isUndefined(i)||null===i)&&a.call(n,i,to.isString(o)?o.trim():o,t,d))&&e(i,t?t.concat(o):[o])})),u.pop()}}(e),n}function os(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return n[e]}))}function ss(e,n){this._pairs=[],e&&as(e,this,n)}const rs=ss.prototype;function cs(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ps(e,n,i){if(!n)return e;const t=i&&i.encode||cs,a=i&&i.serialize;let o;if(o=a?a(n,i):to.isURLSearchParams(n)?n.toString():new ss(n,i).toString(t),o){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}rs.append=function(e,n){this._pairs.push([e,n])},rs.toString=function(e){const n=e?function(n){return e.call(this,n,os)}:os;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};class ls{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){to.forEach(this.handlers,(function(n){null!==n&&e(n)}))}}var us={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ds={isNode:!0,classes:{URLSearchParams:r.URLSearchParams,FormData:Yo,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function ms(e){function n(e,i,t,a){let o=e[a++];const s=Number.isFinite(+o),r=a>=e.length;if(o=!o&&to.isArray(t)?t.length:o,r)return to.hasOwnProp(t,o)?t[o]=[t[o],i]:t[o]=i,!s;t[o]&&to.isObject(t[o])||(t[o]=[]);return n(e,i,t[o],a)&&to.isArray(t[o])&&(t[o]=function(e){const n={},i=Object.keys(e);let t;const a=i.length;let o;for(t=0;t<a;t++)o=i[t],n[o]=e[o];return n}(t[o])),!s}if(to.isFormData(e)&&to.isFunction(e.entries)){const i={};return to.forEachEntry(e,((e,t)=>{n(function(e){return to.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),t,i,0)})),i}return null}function fs(e,n,i){const t=i.config.validateStatus;i.status&&t&&!t(i.status)?n(new ao("Request failed with status code "+i.status,[ao.ERR_BAD_REQUEST,ao.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}function hs(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}var vs=r.parse,xs={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},gs=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function bs(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var ys,ws,_s,Es,js,ks=function(e){var n="string"==typeof e?vs(e):e||{},i=n.protocol,t=n.host,a=n.port;if("string"!=typeof t||!t||"string"!=typeof i)return"";if(i=i.split(":",1)[0],!function(e,n){var i=(bs("npm_config_no_proxy")||bs("no_proxy")).toLowerCase();if(!i)return!0;if("*"===i)return!1;return i.split(/[,\s]/).every((function(i){if(!i)return!0;var t=i.match(/^(.+):(\d+)$/),a=t?t[1]:i,o=t?parseInt(t[2]):0;return!(!o||o===n)||(/^[.*]/.test(a)?("*"===a.charAt(0)&&(a=a.slice(1)),!gs.call(e,a)):e!==a)}))}(t=t.replace(/:\d*$/,""),a=parseInt(a)||xs[i]||0))return"";var o=bs("npm_config_"+i+"_proxy")||bs(i+"_proxy")||bs("npm_config_proxy")||bs("all_proxy");return o&&-1===o.indexOf("://")&&(o=i+"://"+o),o},Ss={exports:{}},Rs={exports:{}},Os={exports:{}};function As(){if(ws)return ys;ws=1;var e=1e3,n=60*e,i=60*n,t=24*i,a=7*t,o=365.25*t;function s(e,n,i,t){var a=n>=1.5*i;return Math.round(e/i)+" "+t+(a?"s":"")}return ys=function(r,c){c=c||{};var p=typeof r;if("string"===p&&r.length>0)return function(s){if((s=String(s)).length>100)return;var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!r)return;var c=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*t;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(r);if("number"===p&&isFinite(r))return c.long?function(a){var o=Math.abs(a);if(o>=t)return s(a,o,t,"day");if(o>=i)return s(a,o,i,"hour");if(o>=n)return s(a,o,n,"minute");if(o>=e)return s(a,o,e,"second");return a+" ms"}(r):function(a){var o=Math.abs(a);if(o>=t)return Math.round(a/t)+"d";if(o>=i)return Math.round(a/i)+"h";if(o>=n)return Math.round(a/n)+"m";if(o>=e)return Math.round(a/e)+"s";return a+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))}}function Ts(){if(Es)return _s;return Es=1,_s=function(e){function n(e){let t,a,o,s=null;function r(...e){if(!r.enabled)return;const i=r,a=Number(new Date),o=a-(t||a);i.diff=o,i.prev=t,i.curr=a,t=a,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,a)=>{if("%%"===t)return"%";s++;const o=n.formatters[a];if("function"==typeof o){const n=e[s];t=o.call(i,n),e.splice(s,1),s--}return t})),n.formatArgs.call(i,e);(i.log||n.log).apply(i,e)}return r.namespace=e,r.useColors=n.useColors(),r.color=n.selectColor(e),r.extend=i,r.destroy=n.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o),set:e=>{s=e}}),"function"==typeof n.init&&n.init(r),r}function i(e,i){const t=n(this.namespace+(void 0===i?":":i)+e);return t.log=this.log,t}function t(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(t),...n.skips.map(t).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let i;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const t=("string"==typeof e?e:"").split(/[\s,]+/),a=t.length;for(i=0;i<a;i++)t[i]&&("-"===(e=t[i].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let i,t;for(i=0,t=n.skips.length;i<t;i++)if(n.skips[i].test(e))return!1;for(i=0,t=n.names.length;i<t;i++)if(n.names[i].test(e))return!0;return!1},n.humanize=As(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((i=>{n[i]=e[i]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let i=0;for(let n=0;n<e.length;n++)i=(i<<5)-i+e.charCodeAt(n),i|=0;return n.colors[Math.abs(i)%n.colors.length]},n.enable(n.load()),n},_s}var Cs,Is,Ls,Ns,$s,zs,Ps,Bs={exports:{}};function Fs(){return Is?Cs:(Is=1,Cs=(e,n=process.argv)=>{const i=e.startsWith("-")?"":1===e.length?"-":"--",t=n.indexOf(i+e),a=n.indexOf("--");return-1!==t&&(-1===a||t<a)})}function Ds(){return $s||($s=1,function(e,n){const t=l,a=i;n.init=function(e){e.inspectOpts={};const i=Object.keys(n.inspectOpts);for(let t=0;t<i.length;t++)e.inspectOpts[i[t]]=n.inspectOpts[i[t]]},n.log=function(...e){return process.stderr.write(a.format(...e)+"\n")},n.formatArgs=function(i){const{namespace:t,useColors:a}=this;if(a){const n=this.color,a="[3"+(n<8?n:"8;5;"+n),o=` ${a};1m${t} `;i[0]=o+i[0].split("\n").join("\n"+o),i.push(a+"m+"+e.exports.humanize(this.diff)+"")}else i[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+t+" "+i[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):t.isatty(process.stderr.fd)},n.destroy=a.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const e=function(){if(Ns)return Ls;Ns=1;const e=u,n=l,i=Fs(),{env:t}=process;let a;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(n,o){if(0===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(n&&!o&&void 0===a)return 0;const s=a||0;if("dumb"===t.TERM)return s;if("win32"===process.platform){const n=e.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in t))||"codeship"===t.CI_NAME?1:s;if("TEAMCITY_VERSION"in t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(t.TEAMCITY_VERSION)?1:0;if("truecolor"===t.COLORTERM)return 3;if("TERM_PROGRAM"in t){const e=parseInt((t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(t.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(t.TERM)||"COLORTERM"in t?1:s}return i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),"FORCE_COLOR"in t&&(a="true"===t.FORCE_COLOR?1:"false"===t.FORCE_COLOR?0:0===t.FORCE_COLOR.length?1:Math.min(parseInt(t.FORCE_COLOR,10),3)),Ls={supportsColor:function(e){return o(s(e,e&&e.isTTY))},stdout:o(s(!0,n.isatty(1))),stderr:o(s(!0,n.isatty(2)))},Ls}();e&&(e.stderr||e).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,n)=>{const i=n.substring(6).toLowerCase().replace(/_([a-z])/g,((e,n)=>n.toUpperCase()));let t=process.env[n];return t=!!/^(yes|on|true|enabled)$/i.test(t)||!/^(no|off|false|disabled)$/i.test(t)&&("null"===t?null:Number(t)),e[i]=t,e}),{}),e.exports=Ts()(n);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts)}}(Bs,Bs.exports)),Bs.exports}function Us(){return zs||(zs=1,function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=(js||(js=1,function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;n.splice(1,0,i,"color: inherit");let t=0,a=0;n[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(t++,"%c"===e&&(a=t))})),n.splice(a,0,i)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),n.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"],n.log=console.debug||console.log||(()=>{}),e.exports=Ts()(n);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Os,Os.exports)),Os.exports):e.exports=Ds()}(Rs)),Rs.exports}var qs=r,Ms=qs.URL,Vs=o,Ks=s,Gs=n.Writable,Ws=p,Hs=function(){if(!Ps){try{Ps=Us()("follow-redirects")}catch(e){}"function"!=typeof Ps&&(Ps=function(){})}Ps.apply(null,arguments)},Xs=["abort","aborted","connect","error","socket","timeout"],Js=Object.create(null);Xs.forEach((function(e){Js[e]=function(n,i,t){this._redirectable.emit(e,n,i,t)}}));var Zs=rr("ERR_INVALID_URL","Invalid URL",TypeError),Ys=rr("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Qs=rr("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),er=rr("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),nr=rr("ERR_STREAM_WRITE_AFTER_END","write after end");function ir(e,n){Gs.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var i=this;this._onNativeResponse=function(e){i._processResponse(e)},this._performRequest()}function tr(e){var n={maxRedirects:21,maxBodyLength:10485760},i={};return Object.keys(e).forEach((function(t){var a=t+":",o=i[a]=e[t],s=n[t]=Object.create(o);Object.defineProperties(s,{request:{value:function(e,t,o){if(pr(e)){var s;try{s=or(new Ms(e))}catch(n){s=qs.parse(e)}if(!pr(s.protocol))throw new Zs({input:e});e=s}else Ms&&e instanceof Ms?e=or(e):(o=t,t=e,e={protocol:a});return lr(t)&&(o=t,t=null),(t=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,t)).nativeProtocols=i,pr(t.host)||pr(t.hostname)||(t.hostname="::1"),Ws.equal(t.protocol,a,"protocol mismatch"),Hs("options",t),new ir(t,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,i){var t=s.request(e,n,i);return t.end(),t},configurable:!0,enumerable:!0,writable:!0}})})),n}function ar(){}function or(e){var n={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(n.port=Number(e.port)),n}function sr(e,n){var i;for(var t in n)e.test(t)&&(i=n[t],delete n[t]);return null==i?void 0:String(i).trim()}function rr(e,n,i){function t(i){Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return t.prototype=new(i||Error),t.prototype.constructor=t,t.prototype.name="Error ["+e+"]",t}function cr(e){for(var n of Xs)e.removeListener(n,Js[n]);e.on("error",ar),e.abort()}function pr(e){return"string"==typeof e||e instanceof String}function lr(e){return"function"==typeof e}ir.prototype=Object.create(Gs.prototype),ir.prototype.abort=function(){cr(this._currentRequest),this.emit("abort")},ir.prototype.write=function(e,n,i){if(this._ending)throw new nr;if(!pr(e)&&("object"!=typeof(t=e)||!("length"in t)))throw new TypeError("data should be a string, Buffer or Uint8Array");var t;lr(n)&&(i=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,i)):(this.emit("error",new er),this.abort()):i&&i()},ir.prototype.end=function(e,n,i){if(lr(e)?(i=e,e=n=null):lr(n)&&(i=n,n=null),e){var t=this,a=this._currentRequest;this.write(e,n,(function(){t._ended=!0,a.end(null,null,i)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,i)},ir.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},ir.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},ir.prototype.setTimeout=function(e,n){var i=this;function t(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function a(n){i._timeout&&clearTimeout(i._timeout),i._timeout=setTimeout((function(){i.emit("timeout"),o()}),e),t(n)}function o(){i._timeout&&(clearTimeout(i._timeout),i._timeout=null),i.removeListener("abort",o),i.removeListener("error",o),i.removeListener("response",o),n&&i.removeListener("timeout",n),i.socket||i._currentRequest.removeListener("socket",a)}return n&&this.on("timeout",n),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",t),this.on("abort",o),this.on("error",o),this.on("response",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){ir.prototype[e]=function(n,i){return this._currentRequest[e](n,i)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(ir.prototype,e,{get:function(){return this._currentRequest[e]}})})),ir.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},ir.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(n){if(this._options.agents){var i=e.slice(0,-1);this._options.agent=this._options.agents[i]}var t=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var a of(t._redirectable=this,Xs))t.on(a,Js[a]);if(this._currentUrl=/^\//.test(this._options.path)?qs.format(this._options):this._options.path,this._isRedirect){var o=0,s=this,r=this._requestBodyBuffers;!function e(n){if(t===s._currentRequest)if(n)s.emit("error",n);else if(o<r.length){var i=r[o++];t.finished||t.write(i.data,i.encoding,e)}else s._ended&&t.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},ir.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var i=e.headers.location;if(!i||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(cr(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new Qs);else{var t,a=this._options.beforeRedirect;a&&(t=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],sr(/^content-/i,this._options.headers));var s,r=sr(/^host$/i,this._options.headers),c=qs.parse(this._currentUrl),p=r||c.host,l=/^\w+:/.test(i)?this._currentUrl:qs.format(Object.assign(c,{host:p}));try{s=qs.resolve(l,i)}catch(e){return void this.emit("error",new Ys({cause:e}))}Hs("redirecting to",s),this._isRedirect=!0;var u=qs.parse(s);if(Object.assign(this._options,u),(u.protocol!==c.protocol&&"https:"!==u.protocol||u.host!==p&&!function(e,n){Ws(pr(e)&&pr(n));var i=e.length-n.length-1;return i>0&&"."===e[i]&&e.endsWith(n)}(u.host,p))&&sr(/^(?:authorization|cookie)$/i,this._options.headers),lr(a)){var d={headers:e.headers,statusCode:n},m={url:l,method:o,headers:t};try{a(this._options,d,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new Ys({cause:e}))}}},Ss.exports=tr({http:Vs,https:Ks}),Ss.exports.wrap=tr;const ur="1.1.3";function dr(e,n,i){ao.call(this,null==e?"canceled":e,ao.ERR_CANCELED,n,i),this.name="CanceledError"}function mr(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}to.inherits(dr,ao,{__CANCEL__:!0});const fr=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;const hr=to.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const vr=Symbol("internals"),xr=Symbol("defaults");function gr(e){return e&&String(e).trim().toLowerCase()}function br(e){return!1===e||null==e?e:to.isArray(e)?e.map(br):String(e)}function yr(e,n,i,t){return to.isFunction(t)?t.call(this,n,i):to.isString(n)?to.isString(t)?-1!==n.indexOf(t):to.isRegExp(t)?t.test(n):void 0:void 0}function wr(e,n){n=n.toLowerCase();const i=Object.keys(e);let t,a=i.length;for(;a-- >0;)if(t=i[a],n===t.toLowerCase())return t;return null}function _r(e,n){e&&this.set(e),this[xr]=n||null}function Er(e,n){e=e||10;const i=new Array(e),t=new Array(e);let a,o=0,s=0;return n=void 0!==n?n:1e3,function(r){const c=Date.now(),p=t[s];a||(a=c),i[o]=r,t[o]=c;let l=s,u=0;for(;l!==o;)u+=i[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-a<n)return;const d=p&&c-p;return d?Math.round(1e3*u/d):void 0}}Object.assign(_r.prototype,{set:function(e,n,i){const t=this;function a(e,n,i){const a=gr(n);if(!a)throw new Error("header name must be a non-empty string");const o=wr(t,a);(!o||!0===i||!1!==t[o]&&!1!==i)&&(t[o||n]=br(e))}return to.isPlainObject(e)?to.forEach(e,((e,i)=>{a(e,i,n)})):a(n,e,i),this},get:function(e,n){if(!(e=gr(e)))return;const i=wr(this,e);if(i){const e=this[i];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let t;for(;t=i.exec(e);)n[t[1]]=t[2];return n}(e);if(to.isFunction(n))return n.call(this,e,i);if(to.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,n){if(e=gr(e)){const i=wr(this,e);return!(!i||n&&!yr(0,this[i],i,n))}return!1},delete:function(e,n){const i=this;let t=!1;function a(e){if(e=gr(e)){const a=wr(i,e);!a||n&&!yr(0,i[a],a,n)||(delete i[a],t=!0)}}return to.isArray(e)?e.forEach(a):a(e),t},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const n=this,i={};return to.forEach(this,((t,a)=>{const o=wr(i,a);if(o)return n[o]=br(t),void delete n[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,n,i)=>n.toUpperCase()+i))}(a):String(a).trim();s!==a&&delete n[a],n[s]=br(t),i[s]=!0})),this},toJSON:function(e){const n=Object.create(null);return to.forEach(Object.assign({},this[xr]||null,this),((i,t)=>{null!=i&&!1!==i&&(n[t]=e&&to.isArray(i)?i.join(", "):i)})),n}}),Object.assign(_r,{from:function(e){return to.isString(e)?new this((e=>{const n={};let i,t,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),i=e.substring(0,a).trim().toLowerCase(),t=e.substring(a+1).trim(),!i||n[i]&&hr[i]||("set-cookie"===i?n[i]?n[i].push(t):n[i]=[t]:n[i]=n[i]?n[i]+", "+t:t)})),n})(e)):e instanceof this?e:new this(e)},accessor:function(e){const n=(this[vr]=this[vr]={accessors:{}}).accessors,i=this.prototype;function t(e){const t=gr(e);n[t]||(!function(e,n){const i=to.toCamelCase(" "+n);["get","set","has"].forEach((t=>{Object.defineProperty(e,t+i,{value:function(e,i,a){return this[t].call(this,n,e,i,a)},configurable:!0})}))}(i,e),n[t]=!0)}return to.isArray(e)?e.forEach(t):t(e),this}}),_r.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),to.freezeMethods(_r.prototype),to.freezeMethods(_r);const jr=Symbol("internals");class kr extends n.Transform{constructor(e){super({readableHighWaterMark:(e=to.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,n)=>!to.isUndefined(n[e])))).chunkSize});const n=this,i=this[jr]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},t=Er(i.ticksRate*e.samplesCount,i.timeWindow);this.on("newListener",(e=>{"progress"===e&&(i.isCaptured||(i.isCaptured=!0))}));let a=0;i.updateProgress=function(e,n){let i=0;const t=1e3/n;let a=null;return function(n,o){const s=Date.now();if(n||s-i>t)return a&&(clearTimeout(a),a=null),i=s,e.apply(null,o);a||(a=setTimeout((()=>(a=null,i=Date.now(),e.apply(null,o))),t-(s-i)))}}((function(){const e=i.length,o=i.bytesSeen,s=o-a;if(!s||n.destroyed)return;const r=t(s);a=o,process.nextTick((()=>{n.emit("progress",{loaded:o,total:e,progress:e?o/e:void 0,bytes:s,rate:r||void 0,estimated:r&&e&&o<=e?(e-o)/r:void 0})}))}),i.ticksRate);const o=()=>{i.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){const n=this[jr];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,i){const t=this,a=this[jr],o=a.maxRate,s=this.readableHighWaterMark,r=a.timeWindow,c=o/(1e3/r),p=!1!==a.minChunkSize?Math.max(a.minChunkSize,.01*c):0;const l=(e,n)=>{const i=Buffer.byteLength(e);let l,u=null,d=s,m=0;if(o){const e=Date.now();(!a.ts||(m=e-a.ts)>=r)&&(a.ts=e,l=c-a.bytes,a.bytes=l<0?-l:0,m=0),l=c-a.bytes}if(o){if(l<=0)return setTimeout((()=>{n(null,e)}),r-m);l<d&&(d=l)}d&&i>d&&i-d>p&&(u=e.subarray(d),e=e.subarray(0,d)),function(e,n){const i=Buffer.byteLength(e);a.bytesSeen+=i,a.bytes+=i,a.isCaptured&&a.updateProgress(),t.push(e)?process.nextTick(n):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(n)}}(e,u?()=>{process.nextTick(n,null,u)}:n)};l(e,(function e(n,t){if(n)return i(n);t?l(t,e):i(null)}))}setLength(e){return this[jr].length=+e,this}}const Sr=to.isFunction(d.createBrotliDecompress),{http:Rr,https:Or}=Ss.exports,Ar=/https:?/,Tr=ds.protocols.map((e=>e+":"));function Cr(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Ir(e,n,i){let t=n;if(!t&&!1!==t){const e=ks(i);e&&(t=new URL(e))}if(t){if(t.username&&(t.auth=(t.username||"")+":"+(t.password||"")),t.auth){(t.auth.username||t.auth.password)&&(t.auth=(t.auth.username||"")+":"+(t.auth.password||""));const n=Buffer.from(t.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=t.hostname||t.host;e.hostname=n,e.host=n,e.port=t.port,e.path=i,t.protocol&&(e.protocol=t.protocol.includes(":")?t.protocol:`${t.protocol}:`)}e.beforeRedirects.proxy=function(e){Ir(e,n,e.href)}}var Lr=ds.isStandardBrowserEnv?{write:function(e,n,i,t,a,o){const s=[];s.push(e+"="+encodeURIComponent(n)),to.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),to.isString(t)&&s.push("path="+t),to.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Nr=ds.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function t(i){let t=i;return e&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return i=t(window.location.href),function(e){const n=to.isString(e)?t(e):e;return n.protocol===i.protocol&&n.host===i.host}}():function(){return!0};function $r(e,n){let i=0;const t=Er(50,250);return a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,r=o-i,c=t(r);i=o;const p={loaded:o,total:s,progress:s?o/s:void 0,bytes:r,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0};p[n?"download":"upload"]=!0,e(p)}}const zr={http:function(e){return new Promise((function(i,t){let a=e.data;const r=e.responseType,c=e.responseEncoding,p=e.method.toUpperCase();let l,u,f,h=!1;const v=new m;function x(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),v.removeAllListeners())}function g(e,n){u||(u=!0,n&&(h=!0,x()),n?t(e):i(e))}const b=function(e){g(e)},y=function(e){g(e,!0)};function w(n){v.emit("abort",!n||n.type?new dr(null,e,f):n)}v.once("abort",y),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));const _=hs(e.baseURL,e.url),E=new URL(_),j=E.protocol||Tr[0];if("data:"===j){let i;if("GET"!==p)return fs(b,y,{status:405,statusText:"method not allowed",headers:{},config:e});try{i=function(e,n,i){const t=i&&i.Blob||ds.classes.Blob,a=mr(e);if(void 0===n&&t&&(n=!0),"data"===a){e=a.length?e.slice(a.length+1):e;const i=fr.exec(e);if(!i)throw new ao("Invalid URL",ao.ERR_INVALID_URL);const o=i[1],s=i[2],r=i[3],c=Buffer.from(decodeURIComponent(r),s?"base64":"utf8");if(n){if(!t)throw new ao("Blob is not supported",ao.ERR_NOT_SUPPORT);return new t([c],{type:o})}return c}throw new ao("Unsupported protocol "+a,ao.ERR_NOT_SUPPORT)}(e.url,"blob"===r,{Blob:e.env&&e.env.Blob})}catch(n){throw ao.from(n,ao.ERR_BAD_REQUEST,e)}return"text"===r?(i=i.toString(c),c&&"utf8"!==c||(a=to.stripBOM(i))):"stream"===r&&(i=n.Readable.from(i)),fs(b,y,{data:i,status:200,statusText:"OK",headers:{},config:e})}if(-1===Tr.indexOf(j))return y(new ao("Unsupported protocol "+j,ao.ERR_BAD_REQUEST,e));const k=_r.from(e.headers).normalize();k.set("User-Agent","axios/"+ur,!1);const S=e.onDownloadProgress,R=e.onUploadProgress,O=e.maxRate;let A,T;if(to.isFormData(a)&&to.isFunction(a.getHeaders))k.set(a.getHeaders());else if(a&&!to.isStream(a)){if(Buffer.isBuffer(a));else if(to.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else{if(!to.isString(a))return y(new ao("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",ao.ERR_BAD_REQUEST,e));a=Buffer.from(a,"utf-8")}if(k.set("Content-Length",a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return y(new ao("Request body larger than maxBodyLength limit",ao.ERR_BAD_REQUEST,e))}const C=+k.getContentLength();let I,L;if(to.isArray(O)?(A=O[0],T=O[1]):A=T=O,a&&(R||A)&&(to.isStream(a)||(a=n.Readable.from(a,{objectMode:!1})),a=n.pipeline([a,new kr({length:to.toFiniteNumber(C),maxRate:to.toFiniteNumber(A)})],to.noop),R&&a.on("progress",(e=>{R(Object.assign(e,{upload:!0}))}))),e.auth){I=(e.auth.username||"")+":"+(e.auth.password||"")}if(!I&&E.username){I=E.username+":"+E.password}I&&k.delete("authorization");try{L=ps(E.pathname+E.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const i=new Error(n.message);return i.config=e,i.url=e.url,i.exists=!0,y(i)}k.set("Accept-Encoding","gzip, deflate, br",!1);const N={path:L,method:p,headers:k.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:I,protocol:j,beforeRedirect:Cr,beforeRedirects:{}};let $;e.socketPath?N.socketPath=e.socketPath:(N.hostname=E.hostname,N.port=E.port,Ir(N,e.proxy,j+"//"+E.hostname+(E.port?":"+E.port:"")+N.path));const z=Ar.test(N.protocol);if(N.agent=z?e.httpsAgent:e.httpAgent,e.transport?$=e.transport:0===e.maxRedirects?$=z?s:o:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),e.beforeRedirect&&(N.beforeRedirects.config=e.beforeRedirect),$=z?Or:Rr),e.maxBodyLength>-1?N.maxBodyLength=e.maxBodyLength:N.maxBodyLength=1/0,e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser),f=$.request(N,(function(i){if(f.destroyed)return;const t=[i];let o=i;const s=i.req||f;if(!1!==e.decompress)switch(a&&0===a.length&&i.headers["content-encoding"]&&delete i.headers["content-encoding"],i.headers["content-encoding"]){case"gzip":case"compress":case"deflate":t.push(d.createUnzip()),delete i.headers["content-encoding"];break;case"br":Sr&&(t.push(d.createBrotliDecompress()),delete i.headers["content-encoding"])}if(S){const e=+i.headers["content-length"],n=new kr({length:to.toFiniteNumber(e),maxRate:to.toFiniteNumber(T)});S&&n.on("progress",(e=>{S(Object.assign(e,{download:!0}))})),t.push(n)}o=t.length>1?n.pipeline(t,to.noop):t[0];const p=n.finished(o,(()=>{p(),x()})),l={status:i.statusCode,statusText:i.statusMessage,headers:new _r(i.headers),config:e,request:s};if("stream"===r)l.data=o,fs(b,y,l);else{const n=[];let i=0;o.on("data",(function(t){n.push(t),i+=t.length,e.maxContentLength>-1&&i>e.maxContentLength&&(h=!0,o.destroy(),y(new ao("maxContentLength size of "+e.maxContentLength+" exceeded",ao.ERR_BAD_RESPONSE,e,s)))})),o.on("aborted",(function(){if(h)return;const n=new ao("maxContentLength size of "+e.maxContentLength+" exceeded",ao.ERR_BAD_RESPONSE,e,s);o.destroy(n),y(n)})),o.on("error",(function(n){f.destroyed||y(ao.from(n,null,e,s))})),o.on("end",(function(){try{let e=1===n.length?n[0]:Buffer.concat(n);"arraybuffer"!==r&&(e=e.toString(c),c&&"utf8"!==c||(e=to.stripBOM(e))),l.data=e}catch(n){y(ao.from(n,null,e,l.request,l))}fs(b,y,l)}))}v.once("abort",(e=>{o.destroyed||(o.emit("error",e),o.destroy())}))})),v.once("abort",(e=>{y(e),f.destroy(e)})),f.on("error",(function(n){y(ao.from(n,null,e,f))})),f.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const n=parseInt(e.timeout,10);if(isNaN(n))return void y(new ao("error trying to parse `config.timeout` to int",ao.ERR_BAD_OPTION_VALUE,e,f));f.setTimeout(n,(function(){if(u)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||us;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),y(new ao(n,i.clarifyTimeoutError?ao.ETIMEDOUT:ao.ECONNABORTED,e,f)),w()}))}if(to.isStream(a)){let n=!1,i=!1;a.on("end",(()=>{n=!0})),a.once("error",(e=>{i=!0,f.destroy(e)})),a.on("close",(()=>{n||i||w(new dr("Request stream has been aborted",e,f))})),a.pipe(f)}else f.end(a)}))},xhr:function(e){return new Promise((function(n,i){let t=e.data;const a=_r.from(e.headers).normalize(),o=e.responseType;let s;function r(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}to.isFormData(t)&&ds.isStandardBrowserEnv&&a.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const n=e.auth.username||"",i=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(n+":"+i))}const p=hs(e.baseURL,e.url);function l(){if(!c)return;const t=_r.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());fs((function(e){n(e),r()}),(function(e){i(e),r()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:t,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),ps(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(i(new ao("Request aborted",ao.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new ao("Network Error",ao.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const t=e.transitional||us;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),i(new ao(n,t.clarifyTimeoutError?ao.ETIMEDOUT:ao.ECONNABORTED,e,c)),c=null},ds.isStandardBrowserEnv){const n=(e.withCredentials||Nr(p))&&e.xsrfCookieName&&Lr.read(e.xsrfCookieName);n&&a.set(e.xsrfHeaderName,n)}void 0===t&&a.setContentType(null),"setRequestHeader"in c&&to.forEach(a.toJSON(),(function(e,n){c.setRequestHeader(n,e)})),to.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",$r(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",$r(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=n=>{c&&(i(!n||n.type?new dr(null,e,c):n),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const u=mr(p);u&&-1===ds.protocols.indexOf(u)?i(new ao("Unsupported protocol "+u+":",ao.ERR_BAD_REQUEST,e)):c.send(t||null)}))}};var Pr=e=>{if(to.isString(e)){const n=zr[e];if(!e)throw Error(to.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return n}if(!to.isFunction(e))throw new TypeError("adapter is not a function");return e};const Br={"Content-Type":"application/x-www-form-urlencoded"};const Fr={transitional:us,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=Pr("xhr"):"undefined"!=typeof process&&"process"===to.kindOf(process)&&(e=Pr("http")),e}(),transformRequest:[function(e,n){const i=n.getContentType()||"",t=i.indexOf("application/json")>-1,a=to.isObject(e);a&&to.isHTMLForm(e)&&(e=new FormData(e));if(to.isFormData(e))return t&&t?JSON.stringify(ms(e)):e;if(to.isArrayBuffer(e)||to.isBuffer(e)||to.isStream(e)||to.isFile(e)||to.isBlob(e))return e;if(to.isArrayBufferView(e))return e.buffer;if(to.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return as(e,new ds.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,t){return to.isBuffer(e)?(this.append(n,e.toString("base64")),!1):t.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((o=to.isFileList(e))||i.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return as(o?{"files[]":e}:e,n&&new n,this.formSerializer)}}return a||t?(n.setContentType("application/json",!1),function(e,n,i){if(to.isString(e))try{return(n||JSON.parse)(e),to.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||Fr.transitional,i=n&&n.forcedJSONParsing,t="json"===this.responseType;if(e&&to.isString(e)&&(i&&!this.responseType||t)){const i=!(n&&n.silentJSONParsing)&&t;try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw ao.from(e,ao.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ds.classes.FormData,Blob:ds.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};function Dr(e,n){const i=this||Fr,t=n||i,a=_r.from(t.headers);let o=t.data;return to.forEach(e,(function(e){o=e.call(i,o,a.normalize(),n?n.status:void 0)})),a.normalize(),o}function Ur(e){return!(!e||!e.__CANCEL__)}function qr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new dr}function Mr(e){qr(e),e.headers=_r.from(e.headers),e.data=Dr.call(e,e.transformRequest);return(e.adapter||Fr.adapter)(e).then((function(n){return qr(e),n.data=Dr.call(e,e.transformResponse,n),n.headers=_r.from(n.headers),n}),(function(n){return Ur(n)||(qr(e),n&&n.response&&(n.response.data=Dr.call(e,e.transformResponse,n.response),n.response.headers=_r.from(n.response.headers))),Promise.reject(n)}))}function Vr(e,n){n=n||{};const i={};function t(e,n){return to.isPlainObject(e)&&to.isPlainObject(n)?to.merge(e,n):to.isPlainObject(n)?to.merge({},n):to.isArray(n)?n.slice():n}function a(i){return to.isUndefined(n[i])?to.isUndefined(e[i])?void 0:t(void 0,e[i]):t(e[i],n[i])}function o(e){if(!to.isUndefined(n[e]))return t(void 0,n[e])}function s(i){return to.isUndefined(n[i])?to.isUndefined(e[i])?void 0:t(void 0,e[i]):t(void 0,n[i])}function r(i){return i in n?t(e[i],n[i]):i in e?t(void 0,e[i]):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:r};return to.forEach(Object.keys(e).concat(Object.keys(n)),(function(e){const n=c[e]||a,t=n(e);to.isUndefined(t)&&n!==r||(i[e]=t)})),i}to.forEach(["delete","get","head"],(function(e){Fr.headers[e]={}})),to.forEach(["post","put","patch"],(function(e){Fr.headers[e]=to.merge(Br)}));const Kr={};["object","boolean","number","function","string","symbol"].forEach(((e,n)=>{Kr[e]=function(i){return typeof i===e||"a"+(n<1?"n ":" ")+e}}));const Gr={};Kr.transitional=function(e,n,i){function t(e,n){return"[Axios v1.1.3] Transitional option '"+e+"'"+n+(i?". "+i:"")}return(i,a,o)=>{if(!1===e)throw new ao(t(a," has been removed"+(n?" in "+n:"")),ao.ERR_DEPRECATED);return n&&!Gr[a]&&(Gr[a]=!0,console.warn(t(a," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(i,a,o)}};var Wr={assertOptions:function(e,n,i){if("object"!=typeof e)throw new ao("options must be an object",ao.ERR_BAD_OPTION_VALUE);const t=Object.keys(e);let a=t.length;for(;a-- >0;){const o=t[a],s=n[o];if(s){const n=e[o],i=void 0===n||s(n,o,e);if(!0!==i)throw new ao("option "+o+" must be "+i,ao.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new ao("Unknown option "+o,ao.ERR_BAD_OPTION)}},validators:Kr};const Hr=Wr.validators;let Xr=class{constructor(e){this.defaults=e,this.interceptors={request:new ls,response:new ls}}request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=Vr(this.defaults,n);const{transitional:i,paramsSerializer:t}=n;void 0!==i&&Wr.assertOptions(i,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),void 0!==t&&Wr.assertOptions(t,{encode:Hr.function,serialize:Hr.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();const a=n.headers&&to.merge(n.headers.common,n.headers[n.method]);a&&to.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete n.headers[e]})),n.headers=new _r(n.headers,a);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const r=[];let c;this.interceptors.response.forEach((function(e){r.push(e.fulfilled,e.rejected)}));let p,l=0;if(!s){const e=[Mr.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,r),p=e.length,c=Promise.resolve(n);l<p;)c=c.then(e[l++],e[l++]);return c}p=o.length;let u=n;for(l=0;l<p;){const e=o[l++],n=o[l++];try{u=e(u)}catch(e){n.call(this,e);break}}try{c=Mr.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,p=r.length;l<p;)c=c.then(r[l++],r[l++]);return c}getUri(e){return ps(hs((e=Vr(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};to.forEach(["delete","get","head","options"],(function(e){Xr.prototype[e]=function(n,i){return this.request(Vr(i||{},{method:e,url:n,data:(i||{}).data}))}})),to.forEach(["post","put","patch"],(function(e){function n(n){return function(i,t,a){return this.request(Vr(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:t}))}}Xr.prototype[e]=n(),Xr.prototype[e+"Form"]=n(!0)}));let Jr=class{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise((function(e){n=e}));const i=this;this.promise.then((e=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](e);i._listeners=null})),this.promise.then=e=>{let n;const t=new Promise((e=>{i.subscribe(e),n=e})).then(e);return t.cancel=function(){i.unsubscribe(n)},t},e((function(e,t,a){i.reason||(i.reason=new dr(e,t,a),n(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new Jr((function(n){e=n})),cancel:e}}};const Zr=function e(n){const i=new Xr(n),t=Ta(Xr.prototype.request,i);return to.extend(t,Xr.prototype,i,{allOwnKeys:!0}),to.extend(t,i,null,{allOwnKeys:!0}),t.create=function(i){return e(Vr(n,i))},t}(Fr);Zr.Axios=Xr,Zr.CanceledError=dr,Zr.CancelToken=Jr,Zr.isCancel=Ur,Zr.VERSION=ur,Zr.toFormData=as,Zr.AxiosError=ao,Zr.Cancel=Zr.CanceledError,Zr.all=function(e){return Promise.all(e)},Zr.spread=function(e){return function(n){return e.apply(null,n)}},Zr.isAxiosError=function(e){return to.isObject(e)&&!0===e.isAxiosError},Zr.formToJSON=e=>ms(to.isHTMLForm(e)?new FormData(e):e);const{Axios:Yr,AxiosError:Qr,CanceledError:ec,isCancel:nc,CancelToken:ic,VERSION:tc,all:ac,Cancel:oc,isAxiosError:sc,spread:rc,toFormData:cc}=Zr,pc=({error:e,message:n="Something went wrong. Please try again or contact support."})=>{var i;console.log("🚀 ~ file: getErrorResponse.ts:15 ~ error",e);let t=n;if(e instanceof Error)t=(null==e?void 0:e.message)||n,t&&console.error(t);else if(e instanceof Qr){t=(null==e?void 0:e.message)||n;const a=(null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.status)||"unknown";t&&console.error(a,t)}return console.error("Please surround your use of the RTSDK with a try/catch block."),{success:!1,message:t}},lc=(e,n)=>{const i=e-n,t=e+n;return Math.floor(Math.random()*(t-i)+i)};class uc extends Aa{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),this.id=n,Object.assign(this,i.attributes)}fetchPlatformAssets(){return f(this,void 0,void 0,(function*(){try{return(yield this.topia.axios.get("/assets/topia-assets",this.requestOptions)).data}catch(e){throw pc({error:e})}}))}}var dc,mc,fc,hc;class vc extends uc{constructor(e,n,i,t={attributes:{text:""},credentials:{}}){var a;super(e,n,t),dc.set(this,((e,n)=>f(this,void 0,void 0,(function*(){try{yield this.topia.axios.put(`/world/${this.urlSlug}/assets/${this.id}/${n}`,Object.assign({},e),this.requestOptions)}catch(e){throw pc({error:e})}})))),this.id=n,this.text=null===(a=t.attributes)||void 0===a?void 0:a.text,this.urlSlug=i,Object.assign(this,t.attributes)}fetchDroppedAssetById(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions);Object.assign(this,e.data)}catch(e){throw pc({error:e})}}))}deleteDroppedAsset(){return f(this,void 0,void 0,(function*(){try{yield this.topia.axios.delete(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions)}catch(e){throw pc({error:e})}}))}fetchDroppedAssetDataObject(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/assets/${this.id}/data-object`,this.requestOptions);this.dataObject=e.data}catch(e){throw pc({error:e})}}))}setDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topia.axios.put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw pc({error:e})}}))}updateDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topia.axios.put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw pc({error:e})}}))}updateBroadcast({assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i}){try{return h(this,dc,"f").call(this,{assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i},"set-asset-broadcast")}catch(e){throw pc({error:e})}}updateClickType({clickType:e,clickableLink:n,clickableLinkTitle:i,portalName:t,position:a}){try{return h(this,dc,"f").call(this,{clickType:e,clickableLink:n,clickableLinkTitle:i,portalName:t,position:a},"change-click-type")}catch(e){throw pc({error:e})}}updateCustomTextAsset(e,n){try{return h(this,dc,"f").call(this,{style:e,text:n},"set-custom-text")}catch(e){throw pc({error:e})}}updateMediaType({audioRadius:e,audioVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:s,syncUserMedia:r}){try{return h(this,dc,"f").call(this,{audioRadius:e,audioVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:s,syncUserMedia:r},"change-media-type")}catch(e){throw pc({error:e})}}updateMuteZone(e){try{return h(this,dc,"f").call(this,{isMutezone:e},"set-mute-zone")}catch(e){throw pc({error:e})}}updatePosition(e,n){try{return h(this,dc,"f").call(this,{x:e,y:n},"set-position")}catch(e){throw pc({error:e})}}updatePrivateZone({isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i}){try{return h(this,dc,"f").call(this,{isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i},"set-private-zone")}catch(e){throw pc({error:e})}}updateScale(e){try{return h(this,dc,"f").call(this,{assetScale:e},"change-scale")}catch(e){throw pc({error:e})}}updateUploadedMediaSelected(e){try{return h(this,dc,"f").call(this,{mediaId:e},"change-uploaded-media-selected")}catch(e){throw pc({error:e})}}updateWebImageLayers(e,n){try{return h(this,dc,"f").call(this,{bottom:e,top:n},"set-webimage-layers")}catch(e){throw pc({error:e})}}}dc=new WeakMap;class xc extends Aa{constructor(e,n,i,t={attributes:{},credentials:{}}){super(e,t.credentials),Object.assign(this,t.attributes),this.id=n,this.urlSlug=i,this.moveVisitor}moveVisitor({shouldTeleportVisitor:e,x:n,y:i}){return f(this,void 0,void 0,(function*(){try{yield this.topia.axios.put(`/world/${this.urlSlug}/visitors/${this.id}/move`,{moveTo:{x:n,y:i},teleport:e},this.requestOptions)}catch(e){throw pc({error:e})}}))}}class gc extends Aa{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),mc.set(this,void 0),fc.set(this,void 0),Object.assign(this,i.attributes),v(this,mc,{},"f"),v(this,fc,{},"f"),this.urlSlug=n}get droppedAssets(){return h(this,mc,"f")}get visitors(){return h(this,fc,"f")}fetchDetails(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/world-details`,this.requestOptions);Object.assign(this,e.data),console.log("🚀 ~ file: World.ts:64 ~ World ~ fetchDetails ~ response.data",e.data)}catch(e){throw console.log("🚀 ~ file: World.ts:65 ~ World ~ fetchDetails ~ error",e),pc({error:e})}}))}updateDetails({controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:s}){return f(this,void 0,void 0,(function*(){const r={controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:s};try{yield this.topia.axios.put(`/world/${this.urlSlug}/world-details`,r,this.requestOptions);const e=(c=r,Object.keys(c).forEach((e=>{void 0===c[e]&&delete c[e]})),c);Object.assign(this,e)}catch(e){throw pc({error:e})}var c}))}fetchVisitors(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/visitors`,this.requestOptions),n={};for(const i in e.data)n[i]=new xc(this.topia,e.data[i].playerId,this.urlSlug,{attributes:e.data[i]});v(this,fc,n,"f")}catch(e){throw pc({error:e})}}))}currentVisitors(){return f(this,void 0,void 0,(function*(){try{return yield this.fetchVisitors(),this.visitors}catch(e){return e}}))}moveAllVisitors({shouldFetchVisitors:e=!0,shouldTeleportVisitors:n=!0,scatterVisitorsBy:i=0,x:t,y:a}){return f(this,void 0,void 0,(function*(){e&&(yield this.fetchVisitors());const o=[];if(!this.visitors)return;Object.keys(this.visitors).forEach((e=>o.push(h(this,fc,"f")[e].moveVisitor({shouldTeleportVisitor:n,x:lc(t,i),y:lc(a,i)}))));return yield Promise.allSettled(o)}))}moveVisitors(e){return f(this,void 0,void 0,(function*(){const n=[];e.forEach((e=>{n.push(e.visitorObj.moveVisitor({shouldTeleportVisitor:e.shouldTeleportVisitor,x:e.x,y:e.y}))}));return yield Promise.allSettled(n)}))}fetchDroppedAssets(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/assets`,this.requestOptions),n={};for(const i in e.data)n[i]=new vc(this.topia,e.data[i].id,this.urlSlug,{attributes:e.data[i]});v(this,mc,n,"f")}catch(e){throw pc({error:e})}}))}updateCustomTextDroppedAssets(e,n){return f(this,void 0,void 0,(function*(){const i=[];e.forEach((e=>{i.push(e.updateCustomTextAsset(n,e.text))}));return yield Promise.allSettled(i)}))}replaceScene(e){return f(this,void 0,void 0,(function*(){try{yield this.topia.axios.put(`/world/${this.urlSlug}/change-scene`,{sceneId:e},this.requestOptions)}catch(e){throw pc({error:e})}}))}}mc=new WeakMap,fc=new WeakMap;class bc extends Aa{constructor(e,n,i={credentials:{}}){super(e,i.credentials),hc.set(this,void 0),v(this,hc,{},"f"),this.email=n}get worlds(){return h(this,hc,"f")}fetchAssetsByEmail(e){return f(this,void 0,void 0,(function*(){try{return(yield this.topia.axios.get(`/assets/my-assets?email=${e}`,this.requestOptions)).data}catch(e){throw pc({error:e})}}))}fetchScenesByEmail(){return f(this,void 0,void 0,(function*(){try{if(!this.email)throw pc({message:"There is no email associated with this user."});return(yield this.topia.axios.get(`/scenes/my-scenes?email=${this.email}`,this.requestOptions)).data}catch(e){throw pc({error:e})}}))}fetchWorldsByKey(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get("/user/worlds",this.requestOptions),n={};for(const i in e.data){const t=e.data[i];n[t.urlSlug]=new gc(this.topia,t.urlSlug,{attributes:t})}v(this,hc,n,"f")}catch(e){throw pc({error:e})}}))}}hc=new WeakMap;class yc{constructor({apiKey:e,apiDomain:n,interactiveKey:i,interactiveSecret:t}){"undefined"!=typeof window&&console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application."),this.apiKey=e,this.apiDomain=n||"api.topia.io",this.interactiveSecret=t;const a={"Content-Type":"application/json"};e&&(a.Authorization=e),i&&(a.Publickey=i),this.axios=Zr.create({baseURL:`https://${this.apiDomain}/api`,headers:a})}}class wc{constructor(e){this.topia=e,this.create}create(e,n){return new uc(this.topia,e,n)}}class _c{constructor(e){this.topia=e}create(e,n,i){return new vc(this.topia,e,n,i)}get(e,n,i){return f(this,void 0,void 0,(function*(){const t=new vc(this.topia,e,n,i);return yield t.fetchDroppedAssetById(),t}))}}class Ec{constructor(e){this.topia=e}create(e,n){return new bc(this.topia,e,n)}}class jc{constructor(e){this.topia=e}create(e,n,i){return new xc(this.topia,e,n,i)}}class kc{constructor(e){this.topia=e}create(e,n){return new gc(this.topia,e,n)}}export{wc as AssetFactory,_c as DroppedAssetFactory,yc as Topia,Ec as UserFactory,jc as VisitorFactory,kc as WorldFactory};
19
+ function(e){var n,i,t,o=xo.exports,s=a.extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var n=r.exec(e),i=n&&o[n[1].toLowerCase()];return i&&i.charset?i.charset:!(!n||!c.test(n[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(n){if(!n||"string"!=typeof n)return!1;var i=-1===n.indexOf("/")?e.lookup(n):n;if(!i)return!1;if(-1===i.indexOf("charset")){var t=e.charset(i);t&&(i+="; charset="+t.toLowerCase())}return i},e.extension=function(n){if(!n||"string"!=typeof n)return!1;var i=r.exec(n),t=i&&e.extensions[i[1].toLowerCase()];if(!t||!t.length)return!1;return t[0]},e.extensions=Object.create(null),e.lookup=function(n){if(!n||"string"!=typeof n)return!1;var i=s("x."+n).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),n=e.extensions,i=e.types,t=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var a=o[e],s=a.extensions;if(s&&s.length){n[e]=s;for(var r=0;r<s.length;r++){var c=s[r];if(i[c]){var p=t.indexOf(o[i[c]].source),l=t.indexOf(a.source);if("application/octet-stream"!==i[c]&&(p>l||p===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}}))}(vo);var go=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},bo=function(e){var n=!1;return go((function(){n=!0})),function(i,t){n?e(i,t):go((function(){e(i,t)}))}};var yo=function(e){Object.keys(e.jobs).forEach(wo.bind(e)),e.jobs={}};function wo(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var _o=bo,Eo=yo,jo=function(e,n,i,t){var a=i.keyedList?i.keyedList[i.index]:i.index;i.jobs[a]=function(e,n,i,t){var a;a=2==e.length?e(i,_o(t)):e(i,n,_o(t));return a}(n,a,e[a],(function(e,n){a in i.jobs&&(delete i.jobs[a],e?Eo(i):i.results[a]=n,t(e,i.results))}))};var ko=function(e,n){var i=!Array.isArray(e),t={index:0,keyedList:i||n?Object.keys(e):null,jobs:{},results:i?{}:[],size:i?Object.keys(e).length:e.length};n&&t.keyedList.sort(i?n:function(i,t){return n(e[i],e[t])});return t};var So=yo,Ro=bo,Oo=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,So(this),Ro(e)(null,this.results)};var Ao=jo,To=ko,Co=Oo,Io=function(e,n,i){var t=To(e);for(;t.index<(t.keyedList||e).length;)Ao(e,n,t,(function(e,n){e?i(e,n):0!==Object.keys(t.jobs).length||i(null,t.results)})),t.index++;return Co.bind(t,i)};var Lo={exports:{}},No=jo,$o=ko,zo=Oo;function Po(e,n){return e<n?-1:e>n?1:0}Lo.exports=function(e,n,i,t){var a=$o(e,i);return No(e,n,a,(function i(o,s){o?t(o,s):(a.index++,a.index<(a.keyedList||e).length?No(e,n,a,i):t(null,a.results))})),zo.bind(a,t)},Lo.exports.ascending=Po,Lo.exports.descending=function(e,n){return-1*Po(e,n)};var Bo=Lo.exports,Fo=function(e,n,i){return Bo(e,n,null,i)};var Do={parallel:Io,serial:Fo,serialOrdered:Lo.exports},Uo=fo,qo=i,Mo=a,Vo=o,Ko=s,Go=r.parse,Wo=c,Ho=n.Stream,Xo=vo,Jo=Do,Zo=function(e,n){return Object.keys(n).forEach((function(i){e[i]=e[i]||n[i]})),e},Yo=Qo;function Qo(e){if(!(this instanceof Qo))return new Qo(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Uo.call(this),e=e||{})this[n]=e[n]}function es(e){return to.isPlainObject(e)||to.isArray(e)}function ns(e){return to.endsWith(e,"[]")?e.slice(0,-2):e}function is(e,n,i){return e?e.concat(n).map((function(e,n){return e=ns(e),!i&&n?"["+e+"]":e})).join(i?".":""):n}qo.inherits(Qo,Uo),Qo.LINE_BREAK="\r\n",Qo.DEFAULT_CONTENT_TYPE="application/octet-stream",Qo.prototype.append=function(e,n,i){"string"==typeof(i=i||{})&&(i={filename:i});var t=Uo.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),qo.isArray(n))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,n,i),o=this._multiPartFooter();t(a),t(n),t(o),this._trackLength(a,n,i)}},Qo.prototype._trackLength=function(e,n,i){var t=0;null!=i.knownLength?t+=+i.knownLength:Buffer.isBuffer(n)?t=n.length:"string"==typeof n&&(t=Buffer.byteLength(n)),this._valueLength+=t,this._overheadLength+=Buffer.byteLength(e)+Qo.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof Ho)&&(i.knownLength||this._valuesToMeasure.push(n))},Qo.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):Wo.stat(e.path,(function(i,t){var a;i?n(i):(a=t.size-(e.start?e.start:0),n(null,a))})):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(i){e.pause(),n(null,+i.headers["content-length"])})),e.resume()):n("Unknown stream")},Qo.prototype._multiPartHeader=function(e,n,i){if("string"==typeof i.header)return i.header;var t,a=this._getContentDisposition(n,i),o=this._getContentType(n,i),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),"Content-Type":[].concat(o||[])};for(var c in"object"==typeof i.header&&Zo(r,i.header),r)r.hasOwnProperty(c)&&null!=(t=r[c])&&(Array.isArray(t)||(t=[t]),t.length&&(s+=c+": "+t.join("; ")+Qo.LINE_BREAK));return"--"+this.getBoundary()+Qo.LINE_BREAK+s+Qo.LINE_BREAK},Qo.prototype._getContentDisposition=function(e,n){var i,t;return"string"==typeof n.filepath?i=Mo.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?i=Mo.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(i=Mo.basename(e.client._httpMessage.path||"")),i&&(t='filename="'+i+'"'),t},Qo.prototype._getContentType=function(e,n){var i=n.contentType;return!i&&e.name&&(i=Xo.lookup(e.name)),!i&&e.path&&(i=Xo.lookup(e.path)),!i&&e.readable&&e.hasOwnProperty("httpVersion")&&(i=e.headers["content-type"]),i||!n.filepath&&!n.filename||(i=Xo.lookup(n.filepath||n.filename)),i||"object"!=typeof e||(i=Qo.DEFAULT_CONTENT_TYPE),i},Qo.prototype._multiPartFooter=function(){return function(e){var n=Qo.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},Qo.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Qo.LINE_BREAK},Qo.prototype.getHeaders=function(e){var n,i={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(i[n.toLowerCase()]=e[n]);return i},Qo.prototype.setBoundary=function(e){this._boundary=e},Qo.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Qo.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),i=0,t=this._streams.length;i<t;i++)"function"!=typeof this._streams[i]&&(e=Buffer.isBuffer(this._streams[i])?Buffer.concat([e,this._streams[i]]):Buffer.concat([e,Buffer.from(this._streams[i])]),"string"==typeof this._streams[i]&&this._streams[i].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(Qo.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Qo.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Qo.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Qo.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Qo.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?Jo.parallel(this._valuesToMeasure,this._lengthRetriever,(function(i,t){i?e(i):(t.forEach((function(e){n+=e})),e(null,n))})):process.nextTick(e.bind(this,null,n))},Qo.prototype.submit=function(e,n){var i,t,a={method:"post"};return"string"==typeof e?(e=Go(e),t=Zo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},a)):(t=Zo(e,a)).port||(t.port="https:"==t.protocol?443:80),t.headers=this.getHeaders(e.headers),i="https:"==t.protocol?Ko.request(t):Vo.request(t),this.getLength(function(e,t){if(e&&"Unknown stream"!==e)this._error(e);else if(t&&i.setHeader("Content-Length",t),this.pipe(i),n){var a,o=function(e,t){return i.removeListener("error",o),i.removeListener("response",a),n.call(this,e,t)};a=o.bind(this,null),i.on("error",o),i.on("response",a)}}.bind(this)),i},Qo.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Qo.prototype.toString=function(){return"[object FormData]"};const ts=to.toFlatObject(to,{},null,(function(e){return/^is[A-Z]/.test(e)}));function as(e,n,i){if(!to.isObject(e))throw new TypeError("target must be an object");n=n||new(Yo||FormData);const t=(i=to.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,n){return!to.isUndefined(n[e])}))).metaTokens,a=i.visitor||l,o=i.dots,s=i.indexes,r=(i.Blob||"undefined"!=typeof Blob&&Blob)&&((c=n)&&to.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!to.isFunction(a))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(to.isDate(e))return e.toISOString();if(!r&&to.isBlob(e))throw new ao("Blob is not supported. Use a Buffer instead.");return to.isArrayBuffer(e)||to.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,i,a){let r=e;if(e&&!a&&"object"==typeof e)if(to.endsWith(i,"{}"))i=t?i:i.slice(0,-2),e=JSON.stringify(e);else if(to.isArray(e)&&function(e){return to.isArray(e)&&!e.some(es)}(e)||to.isFileList(e)||to.endsWith(i,"[]")&&(r=to.toArray(e)))return i=ns(i),r.forEach((function(e,t){!to.isUndefined(e)&&null!==e&&n.append(!0===s?is([i],t,o):null===s?i:i+"[]",p(e))})),!1;return!!es(e)||(n.append(is(a,i,o),p(e)),!1)}const u=[],d=Object.assign(ts,{defaultVisitor:l,convertValue:p,isVisitable:es});if(!to.isObject(e))throw new TypeError("data must be an object");return function e(i,t){if(!to.isUndefined(i)){if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+t.join("."));u.push(i),to.forEach(i,(function(i,o){!0===(!(to.isUndefined(i)||null===i)&&a.call(n,i,to.isString(o)?o.trim():o,t,d))&&e(i,t?t.concat(o):[o])})),u.pop()}}(e),n}function os(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return n[e]}))}function ss(e,n){this._pairs=[],e&&as(e,this,n)}const rs=ss.prototype;function cs(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ps(e,n,i){if(!n)return e;const t=i&&i.encode||cs,a=i&&i.serialize;let o;if(o=a?a(n,i):to.isURLSearchParams(n)?n.toString():new ss(n,i).toString(t),o){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}rs.append=function(e,n){this._pairs.push([e,n])},rs.toString=function(e){const n=e?function(n){return e.call(this,n,os)}:os;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};class ls{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){to.forEach(this.handlers,(function(n){null!==n&&e(n)}))}}var us={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ds={isNode:!0,classes:{URLSearchParams:r.URLSearchParams,FormData:Yo,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function ms(e){function n(e,i,t,a){let o=e[a++];const s=Number.isFinite(+o),r=a>=e.length;if(o=!o&&to.isArray(t)?t.length:o,r)return to.hasOwnProp(t,o)?t[o]=[t[o],i]:t[o]=i,!s;t[o]&&to.isObject(t[o])||(t[o]=[]);return n(e,i,t[o],a)&&to.isArray(t[o])&&(t[o]=function(e){const n={},i=Object.keys(e);let t;const a=i.length;let o;for(t=0;t<a;t++)o=i[t],n[o]=e[o];return n}(t[o])),!s}if(to.isFormData(e)&&to.isFunction(e.entries)){const i={};return to.forEachEntry(e,((e,t)=>{n(function(e){return to.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),t,i,0)})),i}return null}function fs(e,n,i){const t=i.config.validateStatus;i.status&&t&&!t(i.status)?n(new ao("Request failed with status code "+i.status,[ao.ERR_BAD_REQUEST,ao.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}function hs(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}var vs=r.parse,xs={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},gs=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function bs(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var ys,ws,_s,Es,js,ks=function(e){var n="string"==typeof e?vs(e):e||{},i=n.protocol,t=n.host,a=n.port;if("string"!=typeof t||!t||"string"!=typeof i)return"";if(i=i.split(":",1)[0],!function(e,n){var i=(bs("npm_config_no_proxy")||bs("no_proxy")).toLowerCase();if(!i)return!0;if("*"===i)return!1;return i.split(/[,\s]/).every((function(i){if(!i)return!0;var t=i.match(/^(.+):(\d+)$/),a=t?t[1]:i,o=t?parseInt(t[2]):0;return!(!o||o===n)||(/^[.*]/.test(a)?("*"===a.charAt(0)&&(a=a.slice(1)),!gs.call(e,a)):e!==a)}))}(t=t.replace(/:\d*$/,""),a=parseInt(a)||xs[i]||0))return"";var o=bs("npm_config_"+i+"_proxy")||bs(i+"_proxy")||bs("npm_config_proxy")||bs("all_proxy");return o&&-1===o.indexOf("://")&&(o=i+"://"+o),o},Ss={exports:{}},Rs={exports:{}},Os={exports:{}};function As(){if(ws)return ys;ws=1;var e=1e3,n=60*e,i=60*n,t=24*i,a=7*t,o=365.25*t;function s(e,n,i,t){var a=n>=1.5*i;return Math.round(e/i)+" "+t+(a?"s":"")}return ys=function(r,c){c=c||{};var p=typeof r;if("string"===p&&r.length>0)return function(s){if((s=String(s)).length>100)return;var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!r)return;var c=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*t;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(r);if("number"===p&&isFinite(r))return c.long?function(a){var o=Math.abs(a);if(o>=t)return s(a,o,t,"day");if(o>=i)return s(a,o,i,"hour");if(o>=n)return s(a,o,n,"minute");if(o>=e)return s(a,o,e,"second");return a+" ms"}(r):function(a){var o=Math.abs(a);if(o>=t)return Math.round(a/t)+"d";if(o>=i)return Math.round(a/i)+"h";if(o>=n)return Math.round(a/n)+"m";if(o>=e)return Math.round(a/e)+"s";return a+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))}}function Ts(){if(Es)return _s;return Es=1,_s=function(e){function n(e){let t,a,o,s=null;function r(...e){if(!r.enabled)return;const i=r,a=Number(new Date),o=a-(t||a);i.diff=o,i.prev=t,i.curr=a,t=a,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,a)=>{if("%%"===t)return"%";s++;const o=n.formatters[a];if("function"==typeof o){const n=e[s];t=o.call(i,n),e.splice(s,1),s--}return t})),n.formatArgs.call(i,e);(i.log||n.log).apply(i,e)}return r.namespace=e,r.useColors=n.useColors(),r.color=n.selectColor(e),r.extend=i,r.destroy=n.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o),set:e=>{s=e}}),"function"==typeof n.init&&n.init(r),r}function i(e,i){const t=n(this.namespace+(void 0===i?":":i)+e);return t.log=this.log,t}function t(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(t),...n.skips.map(t).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let i;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const t=("string"==typeof e?e:"").split(/[\s,]+/),a=t.length;for(i=0;i<a;i++)t[i]&&("-"===(e=t[i].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let i,t;for(i=0,t=n.skips.length;i<t;i++)if(n.skips[i].test(e))return!1;for(i=0,t=n.names.length;i<t;i++)if(n.names[i].test(e))return!0;return!1},n.humanize=As(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((i=>{n[i]=e[i]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let i=0;for(let n=0;n<e.length;n++)i=(i<<5)-i+e.charCodeAt(n),i|=0;return n.colors[Math.abs(i)%n.colors.length]},n.enable(n.load()),n},_s}var Cs,Is,Ls,Ns,$s,zs,Ps,Bs={exports:{}};function Fs(){return Is?Cs:(Is=1,Cs=(e,n=process.argv)=>{const i=e.startsWith("-")?"":1===e.length?"-":"--",t=n.indexOf(i+e),a=n.indexOf("--");return-1!==t&&(-1===a||t<a)})}function Ds(){return $s||($s=1,function(e,n){const t=l,a=i;n.init=function(e){e.inspectOpts={};const i=Object.keys(n.inspectOpts);for(let t=0;t<i.length;t++)e.inspectOpts[i[t]]=n.inspectOpts[i[t]]},n.log=function(...e){return process.stderr.write(a.format(...e)+"\n")},n.formatArgs=function(i){const{namespace:t,useColors:a}=this;if(a){const n=this.color,a="[3"+(n<8?n:"8;5;"+n),o=` ${a};1m${t} `;i[0]=o+i[0].split("\n").join("\n"+o),i.push(a+"m+"+e.exports.humanize(this.diff)+"")}else i[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+t+" "+i[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):t.isatty(process.stderr.fd)},n.destroy=a.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const e=function(){if(Ns)return Ls;Ns=1;const e=u,n=l,i=Fs(),{env:t}=process;let a;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(n,o){if(0===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(n&&!o&&void 0===a)return 0;const s=a||0;if("dumb"===t.TERM)return s;if("win32"===process.platform){const n=e.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in t))||"codeship"===t.CI_NAME?1:s;if("TEAMCITY_VERSION"in t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(t.TEAMCITY_VERSION)?1:0;if("truecolor"===t.COLORTERM)return 3;if("TERM_PROGRAM"in t){const e=parseInt((t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(t.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(t.TERM)||"COLORTERM"in t?1:s}return i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),"FORCE_COLOR"in t&&(a="true"===t.FORCE_COLOR?1:"false"===t.FORCE_COLOR?0:0===t.FORCE_COLOR.length?1:Math.min(parseInt(t.FORCE_COLOR,10),3)),Ls={supportsColor:function(e){return o(s(e,e&&e.isTTY))},stdout:o(s(!0,n.isatty(1))),stderr:o(s(!0,n.isatty(2)))},Ls}();e&&(e.stderr||e).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,n)=>{const i=n.substring(6).toLowerCase().replace(/_([a-z])/g,((e,n)=>n.toUpperCase()));let t=process.env[n];return t=!!/^(yes|on|true|enabled)$/i.test(t)||!/^(no|off|false|disabled)$/i.test(t)&&("null"===t?null:Number(t)),e[i]=t,e}),{}),e.exports=Ts()(n);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts)}}(Bs,Bs.exports)),Bs.exports}function Us(){return zs||(zs=1,function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=(js||(js=1,function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;n.splice(1,0,i,"color: inherit");let t=0,a=0;n[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(t++,"%c"===e&&(a=t))})),n.splice(a,0,i)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),n.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"],n.log=console.debug||console.log||(()=>{}),e.exports=Ts()(n);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Os,Os.exports)),Os.exports):e.exports=Ds()}(Rs)),Rs.exports}var qs=r,Ms=qs.URL,Vs=o,Ks=s,Gs=n.Writable,Ws=p,Hs=function(){if(!Ps){try{Ps=Us()("follow-redirects")}catch(e){}"function"!=typeof Ps&&(Ps=function(){})}Ps.apply(null,arguments)},Xs=["abort","aborted","connect","error","socket","timeout"],Js=Object.create(null);Xs.forEach((function(e){Js[e]=function(n,i,t){this._redirectable.emit(e,n,i,t)}}));var Zs=rr("ERR_INVALID_URL","Invalid URL",TypeError),Ys=rr("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Qs=rr("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),er=rr("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),nr=rr("ERR_STREAM_WRITE_AFTER_END","write after end");function ir(e,n){Gs.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var i=this;this._onNativeResponse=function(e){i._processResponse(e)},this._performRequest()}function tr(e){var n={maxRedirects:21,maxBodyLength:10485760},i={};return Object.keys(e).forEach((function(t){var a=t+":",o=i[a]=e[t],s=n[t]=Object.create(o);Object.defineProperties(s,{request:{value:function(e,t,o){if(pr(e)){var s;try{s=or(new Ms(e))}catch(n){s=qs.parse(e)}if(!pr(s.protocol))throw new Zs({input:e});e=s}else Ms&&e instanceof Ms?e=or(e):(o=t,t=e,e={protocol:a});return lr(t)&&(o=t,t=null),(t=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,t)).nativeProtocols=i,pr(t.host)||pr(t.hostname)||(t.hostname="::1"),Ws.equal(t.protocol,a,"protocol mismatch"),Hs("options",t),new ir(t,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,i){var t=s.request(e,n,i);return t.end(),t},configurable:!0,enumerable:!0,writable:!0}})})),n}function ar(){}function or(e){var n={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(n.port=Number(e.port)),n}function sr(e,n){var i;for(var t in n)e.test(t)&&(i=n[t],delete n[t]);return null==i?void 0:String(i).trim()}function rr(e,n,i){function t(i){Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return t.prototype=new(i||Error),t.prototype.constructor=t,t.prototype.name="Error ["+e+"]",t}function cr(e){for(var n of Xs)e.removeListener(n,Js[n]);e.on("error",ar),e.abort()}function pr(e){return"string"==typeof e||e instanceof String}function lr(e){return"function"==typeof e}ir.prototype=Object.create(Gs.prototype),ir.prototype.abort=function(){cr(this._currentRequest),this.emit("abort")},ir.prototype.write=function(e,n,i){if(this._ending)throw new nr;if(!pr(e)&&("object"!=typeof(t=e)||!("length"in t)))throw new TypeError("data should be a string, Buffer or Uint8Array");var t;lr(n)&&(i=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,i)):(this.emit("error",new er),this.abort()):i&&i()},ir.prototype.end=function(e,n,i){if(lr(e)?(i=e,e=n=null):lr(n)&&(i=n,n=null),e){var t=this,a=this._currentRequest;this.write(e,n,(function(){t._ended=!0,a.end(null,null,i)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,i)},ir.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},ir.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},ir.prototype.setTimeout=function(e,n){var i=this;function t(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function a(n){i._timeout&&clearTimeout(i._timeout),i._timeout=setTimeout((function(){i.emit("timeout"),o()}),e),t(n)}function o(){i._timeout&&(clearTimeout(i._timeout),i._timeout=null),i.removeListener("abort",o),i.removeListener("error",o),i.removeListener("response",o),n&&i.removeListener("timeout",n),i.socket||i._currentRequest.removeListener("socket",a)}return n&&this.on("timeout",n),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",t),this.on("abort",o),this.on("error",o),this.on("response",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){ir.prototype[e]=function(n,i){return this._currentRequest[e](n,i)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(ir.prototype,e,{get:function(){return this._currentRequest[e]}})})),ir.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},ir.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(n){if(this._options.agents){var i=e.slice(0,-1);this._options.agent=this._options.agents[i]}var t=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var a of(t._redirectable=this,Xs))t.on(a,Js[a]);if(this._currentUrl=/^\//.test(this._options.path)?qs.format(this._options):this._options.path,this._isRedirect){var o=0,s=this,r=this._requestBodyBuffers;!function e(n){if(t===s._currentRequest)if(n)s.emit("error",n);else if(o<r.length){var i=r[o++];t.finished||t.write(i.data,i.encoding,e)}else s._ended&&t.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},ir.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var i=e.headers.location;if(!i||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(cr(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new Qs);else{var t,a=this._options.beforeRedirect;a&&(t=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],sr(/^content-/i,this._options.headers));var s,r=sr(/^host$/i,this._options.headers),c=qs.parse(this._currentUrl),p=r||c.host,l=/^\w+:/.test(i)?this._currentUrl:qs.format(Object.assign(c,{host:p}));try{s=qs.resolve(l,i)}catch(e){return void this.emit("error",new Ys({cause:e}))}Hs("redirecting to",s),this._isRedirect=!0;var u=qs.parse(s);if(Object.assign(this._options,u),(u.protocol!==c.protocol&&"https:"!==u.protocol||u.host!==p&&!function(e,n){Ws(pr(e)&&pr(n));var i=e.length-n.length-1;return i>0&&"."===e[i]&&e.endsWith(n)}(u.host,p))&&sr(/^(?:authorization|cookie)$/i,this._options.headers),lr(a)){var d={headers:e.headers,statusCode:n},m={url:l,method:o,headers:t};try{a(this._options,d,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new Ys({cause:e}))}}},Ss.exports=tr({http:Vs,https:Ks}),Ss.exports.wrap=tr;const ur="1.1.3";function dr(e,n,i){ao.call(this,null==e?"canceled":e,ao.ERR_CANCELED,n,i),this.name="CanceledError"}function mr(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}to.inherits(dr,ao,{__CANCEL__:!0});const fr=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;const hr=to.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const vr=Symbol("internals"),xr=Symbol("defaults");function gr(e){return e&&String(e).trim().toLowerCase()}function br(e){return!1===e||null==e?e:to.isArray(e)?e.map(br):String(e)}function yr(e,n,i,t){return to.isFunction(t)?t.call(this,n,i):to.isString(n)?to.isString(t)?-1!==n.indexOf(t):to.isRegExp(t)?t.test(n):void 0:void 0}function wr(e,n){n=n.toLowerCase();const i=Object.keys(e);let t,a=i.length;for(;a-- >0;)if(t=i[a],n===t.toLowerCase())return t;return null}function _r(e,n){e&&this.set(e),this[xr]=n||null}function Er(e,n){e=e||10;const i=new Array(e),t=new Array(e);let a,o=0,s=0;return n=void 0!==n?n:1e3,function(r){const c=Date.now(),p=t[s];a||(a=c),i[o]=r,t[o]=c;let l=s,u=0;for(;l!==o;)u+=i[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-a<n)return;const d=p&&c-p;return d?Math.round(1e3*u/d):void 0}}Object.assign(_r.prototype,{set:function(e,n,i){const t=this;function a(e,n,i){const a=gr(n);if(!a)throw new Error("header name must be a non-empty string");const o=wr(t,a);(!o||!0===i||!1!==t[o]&&!1!==i)&&(t[o||n]=br(e))}return to.isPlainObject(e)?to.forEach(e,((e,i)=>{a(e,i,n)})):a(n,e,i),this},get:function(e,n){if(!(e=gr(e)))return;const i=wr(this,e);if(i){const e=this[i];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let t;for(;t=i.exec(e);)n[t[1]]=t[2];return n}(e);if(to.isFunction(n))return n.call(this,e,i);if(to.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,n){if(e=gr(e)){const i=wr(this,e);return!(!i||n&&!yr(0,this[i],i,n))}return!1},delete:function(e,n){const i=this;let t=!1;function a(e){if(e=gr(e)){const a=wr(i,e);!a||n&&!yr(0,i[a],a,n)||(delete i[a],t=!0)}}return to.isArray(e)?e.forEach(a):a(e),t},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const n=this,i={};return to.forEach(this,((t,a)=>{const o=wr(i,a);if(o)return n[o]=br(t),void delete n[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,n,i)=>n.toUpperCase()+i))}(a):String(a).trim();s!==a&&delete n[a],n[s]=br(t),i[s]=!0})),this},toJSON:function(e){const n=Object.create(null);return to.forEach(Object.assign({},this[xr]||null,this),((i,t)=>{null!=i&&!1!==i&&(n[t]=e&&to.isArray(i)?i.join(", "):i)})),n}}),Object.assign(_r,{from:function(e){return to.isString(e)?new this((e=>{const n={};let i,t,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),i=e.substring(0,a).trim().toLowerCase(),t=e.substring(a+1).trim(),!i||n[i]&&hr[i]||("set-cookie"===i?n[i]?n[i].push(t):n[i]=[t]:n[i]=n[i]?n[i]+", "+t:t)})),n})(e)):e instanceof this?e:new this(e)},accessor:function(e){const n=(this[vr]=this[vr]={accessors:{}}).accessors,i=this.prototype;function t(e){const t=gr(e);n[t]||(!function(e,n){const i=to.toCamelCase(" "+n);["get","set","has"].forEach((t=>{Object.defineProperty(e,t+i,{value:function(e,i,a){return this[t].call(this,n,e,i,a)},configurable:!0})}))}(i,e),n[t]=!0)}return to.isArray(e)?e.forEach(t):t(e),this}}),_r.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),to.freezeMethods(_r.prototype),to.freezeMethods(_r);const jr=Symbol("internals");class kr extends n.Transform{constructor(e){super({readableHighWaterMark:(e=to.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,n)=>!to.isUndefined(n[e])))).chunkSize});const n=this,i=this[jr]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},t=Er(i.ticksRate*e.samplesCount,i.timeWindow);this.on("newListener",(e=>{"progress"===e&&(i.isCaptured||(i.isCaptured=!0))}));let a=0;i.updateProgress=function(e,n){let i=0;const t=1e3/n;let a=null;return function(n,o){const s=Date.now();if(n||s-i>t)return a&&(clearTimeout(a),a=null),i=s,e.apply(null,o);a||(a=setTimeout((()=>(a=null,i=Date.now(),e.apply(null,o))),t-(s-i)))}}((function(){const e=i.length,o=i.bytesSeen,s=o-a;if(!s||n.destroyed)return;const r=t(s);a=o,process.nextTick((()=>{n.emit("progress",{loaded:o,total:e,progress:e?o/e:void 0,bytes:s,rate:r||void 0,estimated:r&&e&&o<=e?(e-o)/r:void 0})}))}),i.ticksRate);const o=()=>{i.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){const n=this[jr];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,i){const t=this,a=this[jr],o=a.maxRate,s=this.readableHighWaterMark,r=a.timeWindow,c=o/(1e3/r),p=!1!==a.minChunkSize?Math.max(a.minChunkSize,.01*c):0;const l=(e,n)=>{const i=Buffer.byteLength(e);let l,u=null,d=s,m=0;if(o){const e=Date.now();(!a.ts||(m=e-a.ts)>=r)&&(a.ts=e,l=c-a.bytes,a.bytes=l<0?-l:0,m=0),l=c-a.bytes}if(o){if(l<=0)return setTimeout((()=>{n(null,e)}),r-m);l<d&&(d=l)}d&&i>d&&i-d>p&&(u=e.subarray(d),e=e.subarray(0,d)),function(e,n){const i=Buffer.byteLength(e);a.bytesSeen+=i,a.bytes+=i,a.isCaptured&&a.updateProgress(),t.push(e)?process.nextTick(n):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(n)}}(e,u?()=>{process.nextTick(n,null,u)}:n)};l(e,(function e(n,t){if(n)return i(n);t?l(t,e):i(null)}))}setLength(e){return this[jr].length=+e,this}}const Sr=to.isFunction(d.createBrotliDecompress),{http:Rr,https:Or}=Ss.exports,Ar=/https:?/,Tr=ds.protocols.map((e=>e+":"));function Cr(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Ir(e,n,i){let t=n;if(!t&&!1!==t){const e=ks(i);e&&(t=new URL(e))}if(t){if(t.username&&(t.auth=(t.username||"")+":"+(t.password||"")),t.auth){(t.auth.username||t.auth.password)&&(t.auth=(t.auth.username||"")+":"+(t.auth.password||""));const n=Buffer.from(t.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=t.hostname||t.host;e.hostname=n,e.host=n,e.port=t.port,e.path=i,t.protocol&&(e.protocol=t.protocol.includes(":")?t.protocol:`${t.protocol}:`)}e.beforeRedirects.proxy=function(e){Ir(e,n,e.href)}}var Lr=ds.isStandardBrowserEnv?{write:function(e,n,i,t,a,o){const s=[];s.push(e+"="+encodeURIComponent(n)),to.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),to.isString(t)&&s.push("path="+t),to.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Nr=ds.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function t(i){let t=i;return e&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return i=t(window.location.href),function(e){const n=to.isString(e)?t(e):e;return n.protocol===i.protocol&&n.host===i.host}}():function(){return!0};function $r(e,n){let i=0;const t=Er(50,250);return a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,r=o-i,c=t(r);i=o;const p={loaded:o,total:s,progress:s?o/s:void 0,bytes:r,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0};p[n?"download":"upload"]=!0,e(p)}}const zr={http:function(e){return new Promise((function(i,t){let a=e.data;const r=e.responseType,c=e.responseEncoding,p=e.method.toUpperCase();let l,u,f,h=!1;const v=new m;function x(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),v.removeAllListeners())}function g(e,n){u||(u=!0,n&&(h=!0,x()),n?t(e):i(e))}const b=function(e){g(e)},y=function(e){g(e,!0)};function w(n){v.emit("abort",!n||n.type?new dr(null,e,f):n)}v.once("abort",y),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));const _=hs(e.baseURL,e.url),E=new URL(_),j=E.protocol||Tr[0];if("data:"===j){let i;if("GET"!==p)return fs(b,y,{status:405,statusText:"method not allowed",headers:{},config:e});try{i=function(e,n,i){const t=i&&i.Blob||ds.classes.Blob,a=mr(e);if(void 0===n&&t&&(n=!0),"data"===a){e=a.length?e.slice(a.length+1):e;const i=fr.exec(e);if(!i)throw new ao("Invalid URL",ao.ERR_INVALID_URL);const o=i[1],s=i[2],r=i[3],c=Buffer.from(decodeURIComponent(r),s?"base64":"utf8");if(n){if(!t)throw new ao("Blob is not supported",ao.ERR_NOT_SUPPORT);return new t([c],{type:o})}return c}throw new ao("Unsupported protocol "+a,ao.ERR_NOT_SUPPORT)}(e.url,"blob"===r,{Blob:e.env&&e.env.Blob})}catch(n){throw ao.from(n,ao.ERR_BAD_REQUEST,e)}return"text"===r?(i=i.toString(c),c&&"utf8"!==c||(a=to.stripBOM(i))):"stream"===r&&(i=n.Readable.from(i)),fs(b,y,{data:i,status:200,statusText:"OK",headers:{},config:e})}if(-1===Tr.indexOf(j))return y(new ao("Unsupported protocol "+j,ao.ERR_BAD_REQUEST,e));const k=_r.from(e.headers).normalize();k.set("User-Agent","axios/"+ur,!1);const S=e.onDownloadProgress,R=e.onUploadProgress,O=e.maxRate;let A,T;if(to.isFormData(a)&&to.isFunction(a.getHeaders))k.set(a.getHeaders());else if(a&&!to.isStream(a)){if(Buffer.isBuffer(a));else if(to.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else{if(!to.isString(a))return y(new ao("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",ao.ERR_BAD_REQUEST,e));a=Buffer.from(a,"utf-8")}if(k.set("Content-Length",a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return y(new ao("Request body larger than maxBodyLength limit",ao.ERR_BAD_REQUEST,e))}const C=+k.getContentLength();let I,L;if(to.isArray(O)?(A=O[0],T=O[1]):A=T=O,a&&(R||A)&&(to.isStream(a)||(a=n.Readable.from(a,{objectMode:!1})),a=n.pipeline([a,new kr({length:to.toFiniteNumber(C),maxRate:to.toFiniteNumber(A)})],to.noop),R&&a.on("progress",(e=>{R(Object.assign(e,{upload:!0}))}))),e.auth){I=(e.auth.username||"")+":"+(e.auth.password||"")}if(!I&&E.username){I=E.username+":"+E.password}I&&k.delete("authorization");try{L=ps(E.pathname+E.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const i=new Error(n.message);return i.config=e,i.url=e.url,i.exists=!0,y(i)}k.set("Accept-Encoding","gzip, deflate, br",!1);const N={path:L,method:p,headers:k.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:I,protocol:j,beforeRedirect:Cr,beforeRedirects:{}};let $;e.socketPath?N.socketPath=e.socketPath:(N.hostname=E.hostname,N.port=E.port,Ir(N,e.proxy,j+"//"+E.hostname+(E.port?":"+E.port:"")+N.path));const z=Ar.test(N.protocol);if(N.agent=z?e.httpsAgent:e.httpAgent,e.transport?$=e.transport:0===e.maxRedirects?$=z?s:o:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),e.beforeRedirect&&(N.beforeRedirects.config=e.beforeRedirect),$=z?Or:Rr),e.maxBodyLength>-1?N.maxBodyLength=e.maxBodyLength:N.maxBodyLength=1/0,e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser),f=$.request(N,(function(i){if(f.destroyed)return;const t=[i];let o=i;const s=i.req||f;if(!1!==e.decompress)switch(a&&0===a.length&&i.headers["content-encoding"]&&delete i.headers["content-encoding"],i.headers["content-encoding"]){case"gzip":case"compress":case"deflate":t.push(d.createUnzip()),delete i.headers["content-encoding"];break;case"br":Sr&&(t.push(d.createBrotliDecompress()),delete i.headers["content-encoding"])}if(S){const e=+i.headers["content-length"],n=new kr({length:to.toFiniteNumber(e),maxRate:to.toFiniteNumber(T)});S&&n.on("progress",(e=>{S(Object.assign(e,{download:!0}))})),t.push(n)}o=t.length>1?n.pipeline(t,to.noop):t[0];const p=n.finished(o,(()=>{p(),x()})),l={status:i.statusCode,statusText:i.statusMessage,headers:new _r(i.headers),config:e,request:s};if("stream"===r)l.data=o,fs(b,y,l);else{const n=[];let i=0;o.on("data",(function(t){n.push(t),i+=t.length,e.maxContentLength>-1&&i>e.maxContentLength&&(h=!0,o.destroy(),y(new ao("maxContentLength size of "+e.maxContentLength+" exceeded",ao.ERR_BAD_RESPONSE,e,s)))})),o.on("aborted",(function(){if(h)return;const n=new ao("maxContentLength size of "+e.maxContentLength+" exceeded",ao.ERR_BAD_RESPONSE,e,s);o.destroy(n),y(n)})),o.on("error",(function(n){f.destroyed||y(ao.from(n,null,e,s))})),o.on("end",(function(){try{let e=1===n.length?n[0]:Buffer.concat(n);"arraybuffer"!==r&&(e=e.toString(c),c&&"utf8"!==c||(e=to.stripBOM(e))),l.data=e}catch(n){y(ao.from(n,null,e,l.request,l))}fs(b,y,l)}))}v.once("abort",(e=>{o.destroyed||(o.emit("error",e),o.destroy())}))})),v.once("abort",(e=>{y(e),f.destroy(e)})),f.on("error",(function(n){y(ao.from(n,null,e,f))})),f.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const n=parseInt(e.timeout,10);if(isNaN(n))return void y(new ao("error trying to parse `config.timeout` to int",ao.ERR_BAD_OPTION_VALUE,e,f));f.setTimeout(n,(function(){if(u)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||us;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),y(new ao(n,i.clarifyTimeoutError?ao.ETIMEDOUT:ao.ECONNABORTED,e,f)),w()}))}if(to.isStream(a)){let n=!1,i=!1;a.on("end",(()=>{n=!0})),a.once("error",(e=>{i=!0,f.destroy(e)})),a.on("close",(()=>{n||i||w(new dr("Request stream has been aborted",e,f))})),a.pipe(f)}else f.end(a)}))},xhr:function(e){return new Promise((function(n,i){let t=e.data;const a=_r.from(e.headers).normalize(),o=e.responseType;let s;function r(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}to.isFormData(t)&&ds.isStandardBrowserEnv&&a.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const n=e.auth.username||"",i=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(n+":"+i))}const p=hs(e.baseURL,e.url);function l(){if(!c)return;const t=_r.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());fs((function(e){n(e),r()}),(function(e){i(e),r()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:t,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),ps(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(i(new ao("Request aborted",ao.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new ao("Network Error",ao.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const t=e.transitional||us;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),i(new ao(n,t.clarifyTimeoutError?ao.ETIMEDOUT:ao.ECONNABORTED,e,c)),c=null},ds.isStandardBrowserEnv){const n=(e.withCredentials||Nr(p))&&e.xsrfCookieName&&Lr.read(e.xsrfCookieName);n&&a.set(e.xsrfHeaderName,n)}void 0===t&&a.setContentType(null),"setRequestHeader"in c&&to.forEach(a.toJSON(),(function(e,n){c.setRequestHeader(n,e)})),to.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",$r(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",$r(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=n=>{c&&(i(!n||n.type?new dr(null,e,c):n),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const u=mr(p);u&&-1===ds.protocols.indexOf(u)?i(new ao("Unsupported protocol "+u+":",ao.ERR_BAD_REQUEST,e)):c.send(t||null)}))}};var Pr=e=>{if(to.isString(e)){const n=zr[e];if(!e)throw Error(to.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return n}if(!to.isFunction(e))throw new TypeError("adapter is not a function");return e};const Br={"Content-Type":"application/x-www-form-urlencoded"};const Fr={transitional:us,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=Pr("xhr"):"undefined"!=typeof process&&"process"===to.kindOf(process)&&(e=Pr("http")),e}(),transformRequest:[function(e,n){const i=n.getContentType()||"",t=i.indexOf("application/json")>-1,a=to.isObject(e);a&&to.isHTMLForm(e)&&(e=new FormData(e));if(to.isFormData(e))return t&&t?JSON.stringify(ms(e)):e;if(to.isArrayBuffer(e)||to.isBuffer(e)||to.isStream(e)||to.isFile(e)||to.isBlob(e))return e;if(to.isArrayBufferView(e))return e.buffer;if(to.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return as(e,new ds.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,t){return to.isBuffer(e)?(this.append(n,e.toString("base64")),!1):t.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((o=to.isFileList(e))||i.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return as(o?{"files[]":e}:e,n&&new n,this.formSerializer)}}return a||t?(n.setContentType("application/json",!1),function(e,n,i){if(to.isString(e))try{return(n||JSON.parse)(e),to.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||Fr.transitional,i=n&&n.forcedJSONParsing,t="json"===this.responseType;if(e&&to.isString(e)&&(i&&!this.responseType||t)){const i=!(n&&n.silentJSONParsing)&&t;try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw ao.from(e,ao.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ds.classes.FormData,Blob:ds.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};function Dr(e,n){const i=this||Fr,t=n||i,a=_r.from(t.headers);let o=t.data;return to.forEach(e,(function(e){o=e.call(i,o,a.normalize(),n?n.status:void 0)})),a.normalize(),o}function Ur(e){return!(!e||!e.__CANCEL__)}function qr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new dr}function Mr(e){qr(e),e.headers=_r.from(e.headers),e.data=Dr.call(e,e.transformRequest);return(e.adapter||Fr.adapter)(e).then((function(n){return qr(e),n.data=Dr.call(e,e.transformResponse,n),n.headers=_r.from(n.headers),n}),(function(n){return Ur(n)||(qr(e),n&&n.response&&(n.response.data=Dr.call(e,e.transformResponse,n.response),n.response.headers=_r.from(n.response.headers))),Promise.reject(n)}))}function Vr(e,n){n=n||{};const i={};function t(e,n){return to.isPlainObject(e)&&to.isPlainObject(n)?to.merge(e,n):to.isPlainObject(n)?to.merge({},n):to.isArray(n)?n.slice():n}function a(i){return to.isUndefined(n[i])?to.isUndefined(e[i])?void 0:t(void 0,e[i]):t(e[i],n[i])}function o(e){if(!to.isUndefined(n[e]))return t(void 0,n[e])}function s(i){return to.isUndefined(n[i])?to.isUndefined(e[i])?void 0:t(void 0,e[i]):t(void 0,n[i])}function r(i){return i in n?t(e[i],n[i]):i in e?t(void 0,e[i]):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:r};return to.forEach(Object.keys(e).concat(Object.keys(n)),(function(e){const n=c[e]||a,t=n(e);to.isUndefined(t)&&n!==r||(i[e]=t)})),i}to.forEach(["delete","get","head"],(function(e){Fr.headers[e]={}})),to.forEach(["post","put","patch"],(function(e){Fr.headers[e]=to.merge(Br)}));const Kr={};["object","boolean","number","function","string","symbol"].forEach(((e,n)=>{Kr[e]=function(i){return typeof i===e||"a"+(n<1?"n ":" ")+e}}));const Gr={};Kr.transitional=function(e,n,i){function t(e,n){return"[Axios v1.1.3] Transitional option '"+e+"'"+n+(i?". "+i:"")}return(i,a,o)=>{if(!1===e)throw new ao(t(a," has been removed"+(n?" in "+n:"")),ao.ERR_DEPRECATED);return n&&!Gr[a]&&(Gr[a]=!0,console.warn(t(a," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(i,a,o)}};var Wr={assertOptions:function(e,n,i){if("object"!=typeof e)throw new ao("options must be an object",ao.ERR_BAD_OPTION_VALUE);const t=Object.keys(e);let a=t.length;for(;a-- >0;){const o=t[a],s=n[o];if(s){const n=e[o],i=void 0===n||s(n,o,e);if(!0!==i)throw new ao("option "+o+" must be "+i,ao.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new ao("Unknown option "+o,ao.ERR_BAD_OPTION)}},validators:Kr};const Hr=Wr.validators;let Xr=class{constructor(e){this.defaults=e,this.interceptors={request:new ls,response:new ls}}request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=Vr(this.defaults,n);const{transitional:i,paramsSerializer:t}=n;void 0!==i&&Wr.assertOptions(i,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),void 0!==t&&Wr.assertOptions(t,{encode:Hr.function,serialize:Hr.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();const a=n.headers&&to.merge(n.headers.common,n.headers[n.method]);a&&to.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete n.headers[e]})),n.headers=new _r(n.headers,a);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const r=[];let c;this.interceptors.response.forEach((function(e){r.push(e.fulfilled,e.rejected)}));let p,l=0;if(!s){const e=[Mr.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,r),p=e.length,c=Promise.resolve(n);l<p;)c=c.then(e[l++],e[l++]);return c}p=o.length;let u=n;for(l=0;l<p;){const e=o[l++],n=o[l++];try{u=e(u)}catch(e){n.call(this,e);break}}try{c=Mr.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,p=r.length;l<p;)c=c.then(r[l++],r[l++]);return c}getUri(e){return ps(hs((e=Vr(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};to.forEach(["delete","get","head","options"],(function(e){Xr.prototype[e]=function(n,i){return this.request(Vr(i||{},{method:e,url:n,data:(i||{}).data}))}})),to.forEach(["post","put","patch"],(function(e){function n(n){return function(i,t,a){return this.request(Vr(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:t}))}}Xr.prototype[e]=n(),Xr.prototype[e+"Form"]=n(!0)}));let Jr=class{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise((function(e){n=e}));const i=this;this.promise.then((e=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](e);i._listeners=null})),this.promise.then=e=>{let n;const t=new Promise((e=>{i.subscribe(e),n=e})).then(e);return t.cancel=function(){i.unsubscribe(n)},t},e((function(e,t,a){i.reason||(i.reason=new dr(e,t,a),n(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new Jr((function(n){e=n})),cancel:e}}};const Zr=function e(n){const i=new Xr(n),t=Ta(Xr.prototype.request,i);return to.extend(t,Xr.prototype,i,{allOwnKeys:!0}),to.extend(t,i,null,{allOwnKeys:!0}),t.create=function(i){return e(Vr(n,i))},t}(Fr);Zr.Axios=Xr,Zr.CanceledError=dr,Zr.CancelToken=Jr,Zr.isCancel=Ur,Zr.VERSION=ur,Zr.toFormData=as,Zr.AxiosError=ao,Zr.Cancel=Zr.CanceledError,Zr.all=function(e){return Promise.all(e)},Zr.spread=function(e){return function(n){return e.apply(null,n)}},Zr.isAxiosError=function(e){return to.isObject(e)&&!0===e.isAxiosError},Zr.formToJSON=e=>ms(to.isHTMLForm(e)?new FormData(e):e);const{Axios:Yr,AxiosError:Qr,CanceledError:ec,isCancel:nc,CancelToken:ic,VERSION:tc,all:ac,Cancel:oc,isAxiosError:sc,spread:rc,toFormData:cc}=Zr,pc=({error:e,message:n="Something went wrong. Please try again or contact support."})=>{var i,t;let a=n;if(e instanceof Qr){a=(null==e?void 0:e.message)||n;const o=(null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.status)||"unknown";a&&console.error(o,a,null===(t=e.config)||void 0===t?void 0:t.url)}else e instanceof Error&&(a=(null==e?void 0:e.message)||n,a&&console.error(a));return console.log("Please surround your use of the RTSDK with a try/catch block."),console.trace(),{success:!1,message:a}},lc=(e,n)=>{const i=e-n,t=e+n;return Math.floor(Math.random()*(t-i)+i)};class uc extends Aa{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),this.id=n,Object.assign(this,i.attributes)}fetchPlatformAssets(){return f(this,void 0,void 0,(function*(){try{return(yield this.topia.axios.get("/assets/topia-assets",this.requestOptions)).data}catch(e){throw pc({error:e})}}))}drop({position:{x:e,y:n},uniqueName:i,urlSlug:t}){return f(this,void 0,void 0,(function*(){try{const a=yield this.topia.axios.post(`/world/${t}/assets`,{assetId:this.id,position:{x:e,y:n},uniqueName:i},this.requestOptions),{id:o}=a.data;return new vc(this.topia,o,t,{credentials:this.credentials})}catch(e){throw pc({error:e})}}))}}var dc,mc,fc,hc;class vc extends uc{constructor(e,n,i,t={attributes:{text:""},credentials:{}}){var a;super(e,n,t),dc.set(this,((e,n)=>f(this,void 0,void 0,(function*(){try{yield this.topia.axios.put(`/world/${this.urlSlug}/assets/${this.id}/${n}`,Object.assign({},e),this.requestOptions)}catch(e){throw pc({error:e})}})))),this.id=n,this.text=null===(a=t.attributes)||void 0===a?void 0:a.text,this.urlSlug=i,Object.assign(this,t.attributes)}fetchDroppedAssetById(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions);Object.assign(this,e.data)}catch(e){throw pc({error:e})}}))}deleteDroppedAsset(){return f(this,void 0,void 0,(function*(){try{yield this.topia.axios.delete(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions)}catch(e){throw pc({error:e})}}))}fetchDroppedAssetDataObject(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/assets/${this.id}/data-object`,this.requestOptions);this.dataObject=e.data}catch(e){throw pc({error:e})}}))}setDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topia.axios.put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw pc({error:e})}}))}updateDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topia.axios.put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw pc({error:e})}}))}updateBroadcast({assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i}){try{return h(this,dc,"f").call(this,{assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i},"set-asset-broadcast")}catch(e){throw pc({error:e})}}updateClickType({clickType:e,clickableLink:n,clickableLinkTitle:i,portalName:t,position:a}){try{return h(this,dc,"f").call(this,{clickType:e,clickableLink:n,clickableLinkTitle:i,portalName:t,position:a},"change-click-type")}catch(e){throw pc({error:e})}}updateCustomTextAsset(e,n){try{return h(this,dc,"f").call(this,{style:e,text:n},"set-custom-text")}catch(e){throw pc({error:e})}}updateMediaType({audioRadius:e,audioVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:s,syncUserMedia:r}){try{return h(this,dc,"f").call(this,{audioRadius:e,audioVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:s,syncUserMedia:r},"change-media-type")}catch(e){throw pc({error:e})}}updateMuteZone(e){try{return h(this,dc,"f").call(this,{isMutezone:e},"set-mute-zone")}catch(e){throw pc({error:e})}}updatePosition(e,n){try{return h(this,dc,"f").call(this,{x:e,y:n},"set-position")}catch(e){throw pc({error:e})}}updatePrivateZone({isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i}){try{return h(this,dc,"f").call(this,{isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i},"set-private-zone")}catch(e){throw pc({error:e})}}updateScale(e){try{return h(this,dc,"f").call(this,{assetScale:e},"change-scale")}catch(e){throw pc({error:e})}}updateUploadedMediaSelected(e){try{return h(this,dc,"f").call(this,{mediaId:e},"change-uploaded-media-selected")}catch(e){throw pc({error:e})}}updateWebImageLayers(e,n){try{return h(this,dc,"f").call(this,{bottom:e,top:n},"set-webimage-layers")}catch(e){throw pc({error:e})}}addWebhook({assetId:e,dataObject:n,description:i,isUniqueOnly:t,title:a,type:o,url:s}){return f(this,void 0,void 0,(function*(){try{yield this.topia.axios.post(`/world/${this.urlSlug}/webhooks`,{active:!0,assetId:e,dataObject:n,description:i,enteredBy:"",isUniqueOnly:t,title:a,type:o,url:s,urlSlug:this.urlSlug},this.requestOptions)}catch(e){throw pc({error:e})}}))}}dc=new WeakMap;class xc extends Aa{constructor(e,n,i,t={attributes:{},credentials:{}}){super(e,t.credentials),Object.assign(this,t.attributes),this.id=n,this.urlSlug=i,this.moveVisitor}moveVisitor({shouldTeleportVisitor:e,x:n,y:i}){return f(this,void 0,void 0,(function*(){try{yield this.topia.axios.put(`/world/${this.urlSlug}/visitors/${this.id}/move`,{moveTo:{x:n,y:i},teleport:e},this.requestOptions)}catch(e){throw pc({error:e})}}))}}class gc extends Aa{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),mc.set(this,void 0),fc.set(this,void 0),Object.assign(this,i.attributes),v(this,mc,{},"f"),v(this,fc,{},"f"),this.urlSlug=n}get droppedAssets(){return h(this,mc,"f")}get visitors(){return h(this,fc,"f")}fetchDetails(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/world-details`,this.requestOptions);Object.assign(this,e.data)}catch(e){throw pc({error:e})}}))}updateDetails({controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:s}){return f(this,void 0,void 0,(function*(){const r={controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:s};try{yield this.topia.axios.put(`/world/${this.urlSlug}/world-details`,r,this.requestOptions);const e=(c=r,Object.keys(c).forEach((e=>{void 0===c[e]&&delete c[e]})),c);Object.assign(this,e)}catch(e){throw pc({error:e})}var c}))}fetchVisitors(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/visitors`,this.requestOptions),n={};for(const i in e.data)n[i]=new xc(this.topia,e.data[i].playerId,this.urlSlug,{attributes:e.data[i]});v(this,fc,n,"f")}catch(e){throw pc({error:e})}}))}currentVisitors(){return f(this,void 0,void 0,(function*(){try{return yield this.fetchVisitors(),this.visitors}catch(e){return e}}))}moveAllVisitors({shouldFetchVisitors:e=!0,shouldTeleportVisitors:n=!0,scatterVisitorsBy:i=0,x:t,y:a}){return f(this,void 0,void 0,(function*(){e&&(yield this.fetchVisitors());const o=[];if(!this.visitors)return;Object.keys(this.visitors).forEach((e=>o.push(h(this,fc,"f")[e].moveVisitor({shouldTeleportVisitor:n,x:lc(t,i),y:lc(a,i)}))));return yield Promise.all(o)}))}moveVisitors(e){return f(this,void 0,void 0,(function*(){const n=[];e.forEach((e=>{n.push(e.visitorObj.moveVisitor({shouldTeleportVisitor:e.shouldTeleportVisitor,x:e.x,y:e.y}))}));return yield Promise.all(n)}))}fetchDroppedAssets(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get(`/world/${this.urlSlug}/assets`,this.requestOptions),n={};for(const i in e.data)n[i]=new vc(this.topia,e.data[i].id,this.urlSlug,{attributes:e.data[i]});v(this,mc,n,"f")}catch(e){throw pc({error:e})}}))}updateCustomTextDroppedAssets(e,n){return f(this,void 0,void 0,(function*(){const i=[];e.forEach((e=>{i.push(e.updateCustomTextAsset(n,e.text))}));return yield Promise.all(i)}))}replaceScene(e){return f(this,void 0,void 0,(function*(){try{yield this.topia.axios.put(`/world/${this.urlSlug}/change-scene`,{sceneId:e},this.requestOptions)}catch(e){throw pc({error:e})}}))}fetchDroppedAssetsWithUniqueName({uniqueName:e,isPartial:n=!1,isReversed:i=!1}){return f(this,void 0,void 0,(function*(){try{const t=yield this.topia.axios.get(`/world/${this.urlSlug}/assets-with-unique-name/${e}?${n?`partial=${n}&`:""}${i?`reversed=${i}`:""}`,this.requestOptions),a=[];for(const e of t.data.assets)a.push(new vc(this.topia,e.id,this.urlSlug,{attributes:e}));return a}catch(e){throw pc({error:e})}}))}}mc=new WeakMap,fc=new WeakMap;class bc extends Aa{constructor(e,n,i={credentials:{}}){super(e,i.credentials),hc.set(this,void 0),v(this,hc,{},"f"),this.email=n}get worlds(){return h(this,hc,"f")}fetchAssetsByEmail(e){return f(this,void 0,void 0,(function*(){try{return(yield this.topia.axios.get(`/assets/my-assets?email=${e}`,this.requestOptions)).data}catch(e){throw pc({error:e})}}))}fetchScenesByEmail(){return f(this,void 0,void 0,(function*(){try{if(!this.email)throw pc({message:"There is no email associated with this user."});return(yield this.topia.axios.get(`/scenes/my-scenes?email=${this.email}`,this.requestOptions)).data}catch(e){throw pc({error:e})}}))}fetchWorldsByKey(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topia.axios.get("/user/worlds",this.requestOptions),n={};for(const i in e.data){const t=e.data[i];n[t.urlSlug]=new gc(this.topia,t.urlSlug,{attributes:t})}v(this,hc,n,"f")}catch(e){throw pc({error:e})}}))}}hc=new WeakMap;class yc{constructor({apiKey:e,apiDomain:n,interactiveKey:i,interactiveSecret:t}){"undefined"!=typeof window&&console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application."),this.apiKey=e,this.apiDomain=n||"api.topia.io",this.interactiveSecret=t;const a={"Content-Type":"application/json","Accept-Encoding":""};e&&(a.Authorization=e),i&&(a.Publickey=i),this.axios=Zr.create({baseURL:`https://${this.apiDomain}/api`,headers:a})}}class wc{constructor(e){this.topia=e,this.create}create(e,n){return new uc(this.topia,e,n)}}class _c{constructor(e){this.topia=e}create(e,n,i){return new vc(this.topia,e,n,i)}get(e,n,i){return f(this,void 0,void 0,(function*(){const t=new vc(this.topia,e,n,i);return yield t.fetchDroppedAssetById(),t}))}}class Ec{constructor(e){this.topia=e}create(e,n){return new bc(this.topia,e,n)}}class jc{constructor(e){this.topia=e}create(e,n,i){return new xc(this.topia,e,n,i)}}class kc{constructor(e){this.topia=e}create(e,n){return new gc(this.topia,e,n)}}export{wc as AssetFactory,_c as DroppedAssetFactory,yc as Topia,Ec as UserFactory,jc as VisitorFactory,kc as WorldFactory};
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  import { SDKController } from "controllers/SDKController";
12
12
  // utils
13
13
  import { getErrorResponse } from "utils";
14
+ import { DroppedAsset } from "controllers";
14
15
  /**
15
16
  * Create an instance of Asset class with a given asset id and optional attributes and session credentials.
16
17
  *
@@ -35,5 +36,21 @@ export class Asset extends SDKController {
35
36
  }
36
37
  });
37
38
  }
39
+ drop({ position: { x, y }, uniqueName, urlSlug, }) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ try {
42
+ const response = yield this.topia.axios.post(`/world/${urlSlug}/assets`, {
43
+ assetId: this.id,
44
+ position: { x, y },
45
+ uniqueName,
46
+ }, this.requestOptions);
47
+ const { id } = response.data;
48
+ return new DroppedAsset(this.topia, id, urlSlug, { credentials: this.credentials });
49
+ }
50
+ catch (error) {
51
+ throw getErrorResponse({ error });
52
+ }
53
+ });
54
+ }
38
55
  }
39
56
  export default Asset;
@@ -353,6 +353,47 @@ export class DroppedAsset extends Asset {
353
353
  throw getErrorResponse({ error });
354
354
  }
355
355
  }
356
+ /**
357
+ * @summary
358
+ * Add a webhook to a dropped asset
359
+ *
360
+ * @usage
361
+ * ```ts
362
+ * await droppedAsset.addWebhook({
363
+ * active: true,
364
+ * assetId: "id",
365
+ * dataObject: {},
366
+ * description: "Webhook desc",
367
+ * enteredBy: "you",
368
+ * isUniqueOnly: false,
369
+ * title: "title",
370
+ * type: "type",
371
+ * url: "https://url.com",
372
+ * urlSlug: "world",
373
+ * });
374
+ * ```
375
+ */
376
+ addWebhook({ assetId, dataObject, description, isUniqueOnly, title, type, url, }) {
377
+ return __awaiter(this, void 0, void 0, function* () {
378
+ try {
379
+ yield this.topia.axios.post(`/world/${this.urlSlug}/webhooks`, {
380
+ active: true,
381
+ assetId,
382
+ dataObject,
383
+ description,
384
+ enteredBy: "",
385
+ isUniqueOnly,
386
+ title,
387
+ type,
388
+ url,
389
+ urlSlug: this.urlSlug,
390
+ }, this.requestOptions);
391
+ }
392
+ catch (error) {
393
+ throw getErrorResponse({ error });
394
+ }
395
+ });
396
+ }
356
397
  }
357
398
  _DroppedAsset_updateDroppedAsset = new WeakMap();
358
399
  export default DroppedAsset;
@@ -21,6 +21,7 @@ export class Topia {
21
21
  this.interactiveSecret = interactiveSecret;
22
22
  const headers = {
23
23
  "Content-Type": "application/json",
24
+ "Accept-Encoding": "",
24
25
  };
25
26
  if (apiKey)
26
27
  headers.Authorization = apiKey;
@@ -64,10 +64,8 @@ export class World extends SDKController {
64
64
  try {
65
65
  const response = yield this.topia.axios.get(`/world/${this.urlSlug}/world-details`, this.requestOptions);
66
66
  Object.assign(this, response.data);
67
- console.log("🚀 ~ file: World.ts:64 ~ World ~ fetchDetails ~ response.data", response.data);
68
67
  }
69
68
  catch (error) {
70
- console.log("🚀 ~ file: World.ts:65 ~ World ~ fetchDetails ~ error", error);
71
69
  throw getErrorResponse({ error });
72
70
  }
73
71
  });
@@ -187,7 +185,7 @@ export class World extends SDKController {
187
185
  x: scatterVisitors(x, scatterVisitorsBy),
188
186
  y: scatterVisitors(y, scatterVisitorsBy),
189
187
  })));
190
- const outcomes = yield Promise.allSettled(allPromises);
188
+ const outcomes = yield Promise.all(allPromises);
191
189
  return outcomes;
192
190
  });
193
191
  }
@@ -222,7 +220,7 @@ export class World extends SDKController {
222
220
  visitorsToMove.forEach((v) => {
223
221
  allPromises.push(v.visitorObj.moveVisitor({ shouldTeleportVisitor: v.shouldTeleportVisitor, x: v.x, y: v.y }));
224
222
  });
225
- const outcomes = yield Promise.allSettled(allPromises);
223
+ const outcomes = yield Promise.all(allPromises);
226
224
  return outcomes;
227
225
  });
228
226
  }
@@ -282,7 +280,7 @@ export class World extends SDKController {
282
280
  droppedAssetsToUpdate.forEach((a) => {
283
281
  allPromises.push(a.updateCustomTextAsset(style, a.text));
284
282
  });
285
- const outcomes = yield Promise.allSettled(allPromises);
283
+ const outcomes = yield Promise.all(allPromises);
286
284
  return outcomes;
287
285
  });
288
286
  }
@@ -314,6 +312,35 @@ export class World extends SDKController {
314
312
  }
315
313
  });
316
314
  }
315
+ /**
316
+ * @summary
317
+ * Retrieve all assets dropped in a world matching uniqueName.
318
+ *
319
+ * @usage
320
+ * ```ts
321
+ * await world.fetchDroppedAssets();
322
+ * const assets = world.droppedAssets;
323
+ * ```
324
+ */
325
+ // dropped assets
326
+ fetchDroppedAssetsWithUniqueName({ uniqueName, isPartial = false, isReversed = false, }) {
327
+ return __awaiter(this, void 0, void 0, function* () {
328
+ try {
329
+ const response = yield this.topia.axios.get(`/world/${this.urlSlug}/assets-with-unique-name/${uniqueName}?${isPartial ? `partial=${isPartial}&` : ""}${isReversed ? `reversed=${isReversed}` : ""}`, this.requestOptions);
330
+ // create temp map and then update private property only once
331
+ const droppedAssets = [];
332
+ for (const asset of response.data.assets) {
333
+ droppedAssets.push(new DroppedAsset(this.topia, asset.id, this.urlSlug, {
334
+ attributes: asset,
335
+ }));
336
+ }
337
+ return droppedAssets;
338
+ }
339
+ catch (error) {
340
+ throw getErrorResponse({ error });
341
+ }
342
+ });
343
+ }
317
344
  }
318
345
  _World_droppedAssetsMap = new WeakMap(), _World_visitorsMap = new WeakMap();
319
346
  export default World;
@@ -51,6 +51,7 @@ describe("World Class", () => {
51
51
  it("should move all visitors within a world to a single set of coordinates", () => __awaiter(void 0, void 0, void 0, function* () {
52
52
  mock.onGet(`${BASE_URL}/visitors`).reply(200, visitors);
53
53
  mock.onPut(`${BASE_URL}/visitors/1/move`).reply(200);
54
+ mock.onPut(`${BASE_URL}/visitors/2/move`).reply(200);
54
55
  const attributes = {
55
56
  shouldFetchVisitors: true,
56
57
  shouldTeleportVisitors: true,
@@ -68,6 +69,7 @@ describe("World Class", () => {
68
69
  }));
69
70
  it("should move a list of visitors to uniquely specified coordinates", () => __awaiter(void 0, void 0, void 0, function* () {
70
71
  mock.onPut(`${BASE_URL}/visitors/1/move`).reply(200);
72
+ mock.onPut(`${BASE_URL}/visitors/2/move`).reply(200);
71
73
  const v1 = new Visitor(topia, visitors["1"].playerId, urlSlug, { attributes: visitors["1"] });
72
74
  const v2 = new Visitor(topia, visitors["2"].playerId, urlSlug, { attributes: visitors["2"] });
73
75
  const testVisitors = [
@@ -3,18 +3,18 @@
3
3
  */
4
4
  import { AxiosError } from "axios";
5
5
  export const getErrorResponse = ({ error, message = "Something went wrong. Please try again or contact support.", }) => {
6
- var _a;
7
- console.log("🚀 ~ file: getErrorResponse.ts:15 ~ error", error);
6
+ var _a, _b;
8
7
  let errorMessage = message;
9
- if (error instanceof Error) {
8
+ if (error instanceof AxiosError) {
10
9
  errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
11
- errorMessage && console.error(errorMessage);
10
+ const status = ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) || "unknown";
11
+ errorMessage && console.error(status, errorMessage, (_b = error.config) === null || _b === void 0 ? void 0 : _b.url);
12
12
  }
13
- else if (error instanceof AxiosError) {
13
+ else if (error instanceof Error) {
14
14
  errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
15
- const status = ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) || "unknown";
16
- errorMessage && console.error(status, errorMessage);
15
+ errorMessage && console.error(errorMessage);
17
16
  }
18
- console.error("Please surround your use of the RTSDK with a try/catch block.");
17
+ console.log("Please surround your use of the RTSDK with a try/catch block.");
18
+ console.trace();
19
19
  return { success: false, message: errorMessage };
20
20
  };
package/package.json CHANGED
@@ -56,5 +56,5 @@
56
56
  "local-publish": "yarn build && yalc publish --push --no-scripts"
57
57
  },
58
58
  "type": "module",
59
- "version": "0.0.12"
59
+ "version": "0.0.13"
60
60
  }