New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blockv/sdk

Package Overview
Dependencies
Maintainers
4
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockv/sdk - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

lib/client/Discover.js

4

dist/blockv-sdk.min.js

@@ -1,2 +0,2 @@

var Blockv=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}([function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){(function(t){function n(){}function o(){h.log.apply(h,arguments)}function i(){h.log.apply(h,arguments)}function s(){h.warn.apply(h,arguments)}function u(e){g[e]=y()}function a(e){var t=g[e];if(!t)throw new Error("No such label: "+e);var r=y()-t;h.log(e+": "+r+"ms")}function c(){var e=new Error;e.name="Trace",e.message=p.format.apply(null,arguments),h.error(e.stack)}function f(e){h.log(p.inspect(e)+"\n")}function l(e){if(!e){var t=v.call(arguments,1);d.ok(!1,p.format.apply(null,t))}}var h,p=r(11),d=r(13),y=r(23),v=Array.prototype.slice,g={};h=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var m=[[n,"log"],[o,"info"],[i,"warn"],[s,"error"],[u,"time"],[a,"timeEnd"],[c,"trace"],[f,"dir"],[l,"assert"]],b=0;b<m.length;b++){var w=m[b],k=w[0],O=w[1];h[O]||(h[O]=k)}e.exports=h}).call(t,r(0))},function(e,t,r){"use strict";function n(e){var t=e.toLowerCase();return"referrer"===t?"referer":t}function o(e){return null==e?null:e.split(/ *; */,1)[0]}function i(e,t){return null==e?t:Array.isArray(e)?e.concat(t):[e,t]}Object.defineProperty(t,"__esModule",{value:!0});var s=r(39),u=r(4),a=r(10),c=function(){function e(e){var t=e.url,r=e.headers,n=e.rawHeaders,o=e.query;if(this.Url={},this.rawHeaders=[],null!=t&&(this.url=t),null!=o&&(this.query=Object.assign(this.query,"string"==typeof o?u.parse(o):o)),n){if(n.length%2==1)throw new TypeError("Expected raw headers length to be even, was "+n.length);this.rawHeaders=n.slice(0)}else this.headers=r}return Object.defineProperty(e.prototype,"url",{get:function(){return s.format(this.Url)},set:function(e){this.Url=s.parse(e,!0,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.Url.query},set:function(e){this.Url.query="string"==typeof e?u.parse(e):e,this.Url.search=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){for(var e={},t=0;t<this.rawHeaders.length;t+=2){var r=n(this.rawHeaders[t]),o=i(e[r],this.rawHeaders[t+1]);e[r]=o}return e},set:function(e){if(this.rawHeaders=[],e)for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];this.append(n,e[n])}},enumerable:!0,configurable:!0}),e.prototype.toHeaders=function(){for(var e={},t=0;t<this.rawHeaders.length;t+=2){var r=this.rawHeaders[t],n=i(e[r],this.rawHeaders[t+1]);e[r]=n}return e},e.prototype.set=function(e,t){return this.remove(e),this.append(e,t),this},e.prototype.append=function(e,t){if(Array.isArray(t))for(var r=0,n=t;r<n.length;r++){var o=n[r];null!=o&&this.rawHeaders.push(e,o)}else null!=t&&this.rawHeaders.push(e,t);return this},e.prototype.name=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)if(n(this.rawHeaders[r])===t)return this.rawHeaders[r]},e.prototype.get=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)if(n(this.rawHeaders[r])===t)return this.rawHeaders[r+1]},e.prototype.getAll=function(e){for(var t=n(e),r=[],o=0;o<this.rawHeaders.length;o+=2)n(this.rawHeaders[o])===t&&r.push(this.rawHeaders[o+1]);return r},e.prototype.remove=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)n(this.rawHeaders[r])===t&&a.splice(this.rawHeaders,r,2);return this},e.prototype.type=function(e){return 0===arguments.length?o(this.get("Content-Type")):this.set("Content-Type",e)},e}();t.Base=c},function(e,t,r){"use strict";e.exports=FormData},function(e,t,r){"use strict";t.decode=t.parse=r(37),t.encode=t.stringify=r(38)},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=r(27),i=function(e){function t(t,r,n,o){var i=e.call(this,t,n)||this;return i.name="PopsicleError",i.code=r,i.popsicle=o,i}return n(t,e),t}(o.BaseError);t.default=i},function(e,t,r){"use strict";function n(e){var t=new o;return e&&Object.keys(e).forEach(function(r){t.append(r,e[r])}),t}Object.defineProperty(t,"__esModule",{value:!0});var o=r(3);t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(33))},function(e,t,r){"use strict";function n(e,t,r){var n=!1,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n||(n=!0,e.off(t,r),0===o.length?r.call(e):r.apply(e,o))};return o.listener=r,o}function o(e){function t(n){if(n<=r)throw new TypeError("`next()` called multiple times");if(e.aborted)return Promise.reject(e.error("Request aborted","EABORT"));r=n;var o=e.middleware[n]||function(){return e.handle()};return new Promise(function(r){return r(o(e,function(){return t(n+1)}))})}var r=-1;return t(0)}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),u=r(10),a=r(5),c=function(e){function t(t){var r=e.call(this,t)||this;return r.middleware=[],r.opened=!1,r.aborted=!1,r.uploaded=0,r.downloaded=0,r.timeout=0|t.timeout,r.method=(t.method||"GET").toUpperCase(),r.body=t.body,r.events=t.events||Object.create(null),r.transport=Object.assign({},t.transport),r.use(t.use||r.transport.use),r._promise=Promise.resolve().then(function(){return o(r)}),r.once("abort",function(){1!==r.completed&&(r.aborted=!0)}),r}return i(t,e),t.prototype.error=function(e,t,r){return new a.default(e,t,r,this)},t.prototype.then=function(e,t){return this._promise.then(e,t)},t.prototype.catch=function(e){return this._promise.then(null,e)},t.prototype.exec=function(e){this.then(function(t){return e(null,t)},e)},t.prototype.toOptions=function(){return{url:this.url,method:this.method,body:this.body,transport:this.transport,timeout:this.timeout,rawHeaders:this.rawHeaders,use:this.middleware,events:this.events}},t.prototype.toJSON=function(){return{url:this.url,method:this.method,headers:this.headers,body:this.body,timeout:this.timeout}},t.prototype.clone=function(){return new t(this.toOptions())},t.prototype.use=function(e){return Array.isArray(e)?(t=this.middleware).push.apply(t,e):this.middleware.push(e),this;var t},t.prototype.on=function(e,t){return Object.prototype.hasOwnProperty.call(this.events,e)?this.events[e].push(t):this.events[e]=[t],this},t.prototype.off=function(e,t){if(Object.prototype.hasOwnProperty.call(this.events,e)){for(var r=this.events[e],n=-1,o=0;o<r.length;o++)if(r[o]===t||r[o].listener===t){n=o;break}n>-1&&(1===r.length?delete this.events[e]:u.splice(this.events[e],n))}return this},t.prototype.once=function(e,t){return this.on(e,n(this,e,t))},t.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!Object.prototype.hasOwnProperty.call(this.events,e))return this;var n=this.events[e];if(1===n.length)0===t.length?n[0].call(this):n[0].apply(this,t);else for(var o=0,i=n.slice();o<i.length;o++){var s=i[o];0===t.length?s.call(this):s.apply(this,t)}return this},t.prototype.abort=function(){return this.emit("abort")},t.prototype.handle=function(){var e=this;if(this.opened=!0,/^https?\:\/*(?:[~#\\\?;\:]|$)/.test(this.url))return Promise.reject(this.error('Refused to connect to invalid URL "'+this.url+'"',"EINVALID"));var t,r=this.timeout,n=new Promise(function(n,o){r>0&&(t=setTimeout(function(){o(e.error("Timeout of "+r+"ms exceeded","ETIMEOUT")),e.abort()},r)),e.once("abort",function(){e.emit("progress"),o(e.error("Request aborted","EABORT")),e.transport.abort&&e.transport.abort(e)}),Promise.resolve(e.transport.open(e)).then(function(e){return n(e)},function(e){return o(e)})});return r>0&&n.then(function(){return clearTimeout(t)},function(){return clearTimeout(t)}),n},Object.defineProperty(t.prototype,"completed",{get:function(){return(this.uploaded+this.downloaded)/2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"completedBytes",{get:function(){return this.uploadedBytes+this.downloadedBytes},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this.uploadLength+this.downloadLength},enumerable:!0,configurable:!0}),t.prototype._setUploadedBytes=function(e,t){e!==this.uploadedBytes&&(this.uploaded=t||e/this.uploadLength,this.uploadedBytes=e,this.emit("progress"))},t.prototype._setDownloadedBytes=function(e,t){e!==this.downloadedBytes&&(this.downloaded=t||e/this.downloadLength,this.downloadedBytes=e,this.emit("progress"))},t}(s.Base);t.Request=c},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),i=function(e){function t(t){var r=e.call(this,t)||this;return r.body=t.body,r.status=t.status,r.statusText=t.statusText,r}return n(t,e),t.prototype.statusType=function(){return~~(this.status/100)},t.prototype.toJSON=function(){return{url:this.url,headers:this.headers,body:this.body,status:this.status,statusText:this.statusText}},t}(o.Base);t.Response=i},function(e,t,r){"use strict";function n(e,t,r){void 0===r&&(r=1);for(var n=t;n<e.length-r;n++)e[n]=e[n+r];e.length-=r}Object.defineProperty(t,"__esModule",{value:!0}),t.splice=n},function(e,t,r){(function(e,n,o){function i(e,r){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),v(r)?n.showHidden=r:r&&t._extend(n,r),O(n.showHidden)&&(n.showHidden=!1),O(n.depth)&&(n.depth=2),O(n.colors)&&(n.colors=!1),O(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function u(e,t){return e}function a(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function c(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return w(o)||(o=c(e,o,n)),o}var i=f(e,r);if(i)return i;var s=Object.keys(r),u=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(E(r)){var v=r.name?": "+r.name:"";return e.stylize("[Function"+v+"]","special")}if(T(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return l(r)}var g="",m=!1,b=["{","}"];if(y(r)&&(m=!0,b=["[","]"]),E(r)){g=" [Function"+(r.name?": "+r.name:"")+"]"}if(T(r)&&(g=" "+RegExp.prototype.toString.call(r)),_(r)&&(g=" "+Date.prototype.toUTCString.call(r)),A(r)&&(g=" "+l(r)),0===s.length&&(!m||0==r.length))return b[0]+g+b[1];if(n<0)return T(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var k;return k=m?h(e,r,n,u,s):s.map(function(t){return p(e,r,n,u,t,m)}),e.seen.pop(),d(k,g,b)}function f(e,t){if(O(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,o){for(var i=[],s=0,u=t.length;s<u;++s)q(t,String(s))?i.push(p(e,t,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}function p(e,t,r,n,o,i){var s,u,a;if(a=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},a.get?u=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(u=e.stylize("[Setter]","special")),q(n,o)||(s="["+o+"]"),u||(e.seen.indexOf(a.value)<0?(u=g(r)?c(e,a.value,null):c(e,a.value,r-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),O(s)){if(i&&o.match(/^\d+$/))return u;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function d(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function y(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return null==e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function k(e){return"symbol"==typeof e}function O(e){return void 0===e}function T(e){return j(e)&&"[object RegExp]"===P(e)}function j(e){return"object"==typeof e&&null!==e}function _(e){return j(e)&&"[object Date]"===P(e)}function A(e){return j(e)&&("[object Error]"===P(e)||e instanceof Error)}function E(e){return"function"==typeof e}function x(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function P(e){return Object.prototype.toString.call(e)}function U(e){return e<10?"0"+e.toString(10):e.toString(10)}function S(){var e=new Date,t=[U(e.getHours()),U(e.getMinutes()),U(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var C=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(e).replace(C,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])g(u)||!j(u)?s+=" "+u:s+=" "+i(u);return s},t.deprecate=function(r,i){function s(){if(!u){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?o.trace(i):o.error(i),u=!0}return r.apply(this,arguments)}if(O(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var u=!1;return s};var I,R={};t.debuglog=function(e){if(O(I)&&(I=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(new RegExp("\\b"+e+"\\b","i").test(I)){var r=n.pid;R[e]=function(){var n=t.format.apply(t,arguments);o.error("%s %d: %s",e,r,n)}}else R[e]=function(){};return R[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=y,t.isBoolean=v,t.isNull=g,t.isNullOrUndefined=m,t.isNumber=b,t.isString=w,t.isSymbol=k,t.isUndefined=O,t.isRegExp=T,t.isObject=j,t.isDate=_,t.isError=A,t.isFunction=E,t.isPrimitive=x,t.isBuffer=r(42);var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){o.log("%s - %s",S(),t.format.apply(t,arguments))},t.inherits=r(41),t._extend=function(e,t){if(!t||!j(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,r(0),r(35),r(1))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=r(21),s=n(i),u=r(14),a=n(u),c=r(18),f=n(c),l=r(19),h=n(l),p=r(15),d=n(p),y=r(17),v=n(y),g=function e(t){o(this,e);var r=t.prefix||t.appID;this.store=new s.default(r),this.store.appID=t.appID,this.store.server=t.server,this.store.websocketAddress=t.websocketAddress;var n=new v.default(this.store),i=new f.default(n,this.store),u=new h.default(n);this.UserManager=new a.default(i,this.store),this.Vatoms=new d.default(u)};t.default=g},function(e,t,r){"use strict";(function(t){/*!
var Blockv=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=20)}([function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){(function(t){function n(){}function o(){h.log.apply(h,arguments)}function i(){h.log.apply(h,arguments)}function s(){h.warn.apply(h,arguments)}function a(e){g[e]=v()}function u(e){var t=g[e];if(!t)throw new Error("No such label: "+e);var r=v()-t;h.log(e+": "+r+"ms")}function c(){var e=new Error;e.name="Trace",e.message=p.format.apply(null,arguments),h.error(e.stack)}function l(e){h.log(p.inspect(e)+"\n")}function f(e){if(!e){var t=y.call(arguments,1);d.ok(!1,p.format.apply(null,t))}}var h,p=r(13),d=r(16),v=r(26),y=Array.prototype.slice,g={};h=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var m=[[n,"log"],[o,"info"],[i,"warn"],[s,"error"],[a,"time"],[u,"timeEnd"],[c,"trace"],[l,"dir"],[f,"assert"]],b=0;b<m.length;b++){var w=m[b],k=w[0],O=w[1];h[O]||(h[O]=k)}e.exports=h}).call(t,r(0))},function(e,t,r){"use strict";function n(e){var t=e.toLowerCase();return"referrer"===t?"referer":t}function o(e){return null==e?null:e.split(/ *; */,1)[0]}function i(e,t){return null==e?t:Array.isArray(e)?e.concat(t):[e,t]}Object.defineProperty(t,"__esModule",{value:!0});var s=r(41),a=r(4),u=r(12),c=function(){function e(e){var t=e.url,r=e.headers,n=e.rawHeaders,o=e.query;if(this.Url={},this.rawHeaders=[],null!=t&&(this.url=t),null!=o&&(this.query=Object.assign(this.query,"string"==typeof o?a.parse(o):o)),n){if(n.length%2==1)throw new TypeError("Expected raw headers length to be even, was "+n.length);this.rawHeaders=n.slice(0)}else this.headers=r}return Object.defineProperty(e.prototype,"url",{get:function(){return s.format(this.Url)},set:function(e){this.Url=s.parse(e,!0,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this.Url.query},set:function(e){this.Url.query="string"==typeof e?a.parse(e):e,this.Url.search=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){for(var e={},t=0;t<this.rawHeaders.length;t+=2){var r=n(this.rawHeaders[t]),o=i(e[r],this.rawHeaders[t+1]);e[r]=o}return e},set:function(e){if(this.rawHeaders=[],e)for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];this.append(n,e[n])}},enumerable:!0,configurable:!0}),e.prototype.toHeaders=function(){for(var e={},t=0;t<this.rawHeaders.length;t+=2){var r=this.rawHeaders[t],n=i(e[r],this.rawHeaders[t+1]);e[r]=n}return e},e.prototype.set=function(e,t){return this.remove(e),this.append(e,t),this},e.prototype.append=function(e,t){if(Array.isArray(t))for(var r=0,n=t;r<n.length;r++){var o=n[r];null!=o&&this.rawHeaders.push(e,o)}else null!=t&&this.rawHeaders.push(e,t);return this},e.prototype.name=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)if(n(this.rawHeaders[r])===t)return this.rawHeaders[r]},e.prototype.get=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)if(n(this.rawHeaders[r])===t)return this.rawHeaders[r+1]},e.prototype.getAll=function(e){for(var t=n(e),r=[],o=0;o<this.rawHeaders.length;o+=2)n(this.rawHeaders[o])===t&&r.push(this.rawHeaders[o+1]);return r},e.prototype.remove=function(e){for(var t=n(e),r=0;r<this.rawHeaders.length;r+=2)n(this.rawHeaders[r])===t&&u.splice(this.rawHeaders,r,2);return this},e.prototype.type=function(e){return 0===arguments.length?o(this.get("Content-Type")):this.set("Content-Type",e)},e}();t.Base=c},function(e,t,r){"use strict";e.exports=FormData},function(e,t,r){"use strict";t.decode=t.parse=r(39),t.encode=t.stringify=r(40)},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(33),a=r(6),u=n(a),c=r(23),l=n(c),f=function(){function t(e){o(this,t),this.store=e}return i(t,[{key:"request",value:function(e,t,r,n,o){var i=this;return!0===n?this.checkToken().then(function(n){return i._request(e,t,r,o)}):this._request(e,t,r,o)}},{key:"_request",value:function(t,r,n,o){return o=Object.assign({"App-Id":this.store.appID,Authorization:"Bearer "+this.store.token,"Content-Type":"application/json"},o),(0,s.request)({method:t,url:this.store.server+r,body:n,headers:o}).use(s.plugins.parse("json")).then(function(e){return Object.assign(new l.default,e.body)}).then(function(t){if(e.log(t),!t.payload){var r={2:"Blank App ID",11:"Problem with payload",17:"invalid App ID",401:"Token has Expired",516:"Invalid Payload",517:"Invalid Payload",521:"Token Unavailable",527:"Invalid Date Format",1004:"Invalid Request Payload",1701:"vAtom Unrecognized",2030:"No user found, Please register an account first.",2031:"Authentication Failed",2032:"Login Failed, Please try again",2034:"Invalid Token",2037:"Upload Avatar Failed",2049:"Refresh Token Expired / Not Whitelisted",2051:"Too many login attempts, Please try again later.",2552:"Unable To Retrieve Token",2553:"Token ID Invalid",2562:"Cannot Delete Primary Token",2563:"Token Already Confirmed",2564:"Invalid Verification Code",2566:"Token Already Confirmed",2567:"Invalid Verification Code",2569:"Invalid Token Type",2571:"Invalid Email",2572:"Invalid Phone Number"};if(2051===t.error){var n=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g.exec(t.message);t.lockedUntil=new Date(n);var o=t.lockedUntil.getTime()-Date.now();o<2e3&&(o=2e3);var i=Math.floor(o/1e3),s=Math.floor(o/1e3/60);i<=90?t.error=t.message.replace("%DURATION%",1==i?"1 second":i+" seconds"):t.message=t.message.replace("%DURATION%",1==s?"1 minute":s+" minutes");var a=new Error("Too many login attempts, Try again at : "+t.lockedUntil);throw a.code=t.error||0,a}var a=new Error(r[t.error]||"An unknown server error occurred.");throw a.code=t.error||0,a}return t.payload})}},{key:"refreshToken",value:function(){var e=this,t={Authorization:"Bearer "+this.store.refreshToken};return this.request("POST","/v1/access_token","",!1,t).then(function(t){e.store.token=t.access_token.token})}},{key:"checkToken",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]&&arguments[0],void 0),t=void 0,r=void 0,n=void 0;if("undefined"==(n=this.store.token)||""==n)this.refreshToken();else try{return e=(0,u.default)(this.store.token),r=1e3*e.exp,t=Date.now(),t-3e4>r?this.refreshToken():Promise.resolve(!0)}catch(e){return this.refreshToken()}}}]),t}();t.default=f}).call(t,r(1))},function(e,t,r){"use strict";function n(e){this.message=e}var o=r(28);n.prototype=new Error,n.prototype.name="InvalidTokenError",e.exports=function(e,t){if("string"!=typeof e)throw new n("Invalid token specified");t=t||{};var r=!0===t.header?0:1;try{return JSON.parse(o(e.split(".")[r]))}catch(e){throw new n("Invalid token specified: "+e.message)}},e.exports.InvalidTokenError=n},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=r(29),i=function(e){function t(t,r,n,o){var i=e.call(this,t,n)||this;return i.name="PopsicleError",i.code=r,i.popsicle=o,i}return n(t,e),t}(o.BaseError);t.default=i},function(e,t,r){"use strict";function n(e){var t=new o;return e&&Object.keys(e).forEach(function(r){t.append(r,e[r])}),t}Object.defineProperty(t,"__esModule",{value:!0});var o=r(3);t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(35))},function(e,t,r){"use strict";function n(e,t,r){var n=!1,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n||(n=!0,e.off(t,r),0===o.length?r.call(e):r.apply(e,o))};return o.listener=r,o}function o(e){function t(n){if(n<=r)throw new TypeError("`next()` called multiple times");if(e.aborted)return Promise.reject(e.error("Request aborted","EABORT"));r=n;var o=e.middleware[n]||function(){return e.handle()};return new Promise(function(r){return r(o(e,function(){return t(n+1)}))})}var r=-1;return t(0)}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),a=r(12),u=r(7),c=function(e){function t(t){var r=e.call(this,t)||this;return r.middleware=[],r.opened=!1,r.aborted=!1,r.uploaded=0,r.downloaded=0,r.timeout=0|t.timeout,r.method=(t.method||"GET").toUpperCase(),r.body=t.body,r.events=t.events||Object.create(null),r.transport=Object.assign({},t.transport),r.use(t.use||r.transport.use),r._promise=Promise.resolve().then(function(){return o(r)}),r.once("abort",function(){1!==r.completed&&(r.aborted=!0)}),r}return i(t,e),t.prototype.error=function(e,t,r){return new u.default(e,t,r,this)},t.prototype.then=function(e,t){return this._promise.then(e,t)},t.prototype.catch=function(e){return this._promise.then(null,e)},t.prototype.exec=function(e){this.then(function(t){return e(null,t)},e)},t.prototype.toOptions=function(){return{url:this.url,method:this.method,body:this.body,transport:this.transport,timeout:this.timeout,rawHeaders:this.rawHeaders,use:this.middleware,events:this.events}},t.prototype.toJSON=function(){return{url:this.url,method:this.method,headers:this.headers,body:this.body,timeout:this.timeout}},t.prototype.clone=function(){return new t(this.toOptions())},t.prototype.use=function(e){return Array.isArray(e)?(t=this.middleware).push.apply(t,e):this.middleware.push(e),this;var t},t.prototype.on=function(e,t){return Object.prototype.hasOwnProperty.call(this.events,e)?this.events[e].push(t):this.events[e]=[t],this},t.prototype.off=function(e,t){if(Object.prototype.hasOwnProperty.call(this.events,e)){for(var r=this.events[e],n=-1,o=0;o<r.length;o++)if(r[o]===t||r[o].listener===t){n=o;break}n>-1&&(1===r.length?delete this.events[e]:a.splice(this.events[e],n))}return this},t.prototype.once=function(e,t){return this.on(e,n(this,e,t))},t.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!Object.prototype.hasOwnProperty.call(this.events,e))return this;var n=this.events[e];if(1===n.length)0===t.length?n[0].call(this):n[0].apply(this,t);else for(var o=0,i=n.slice();o<i.length;o++){var s=i[o];0===t.length?s.call(this):s.apply(this,t)}return this},t.prototype.abort=function(){return this.emit("abort")},t.prototype.handle=function(){var e=this;if(this.opened=!0,/^https?\:\/*(?:[~#\\\?;\:]|$)/.test(this.url))return Promise.reject(this.error('Refused to connect to invalid URL "'+this.url+'"',"EINVALID"));var t,r=this.timeout,n=new Promise(function(n,o){r>0&&(t=setTimeout(function(){o(e.error("Timeout of "+r+"ms exceeded","ETIMEOUT")),e.abort()},r)),e.once("abort",function(){e.emit("progress"),o(e.error("Request aborted","EABORT")),e.transport.abort&&e.transport.abort(e)}),Promise.resolve(e.transport.open(e)).then(function(e){return n(e)},function(e){return o(e)})});return r>0&&n.then(function(){return clearTimeout(t)},function(){return clearTimeout(t)}),n},Object.defineProperty(t.prototype,"completed",{get:function(){return(this.uploaded+this.downloaded)/2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"completedBytes",{get:function(){return this.uploadedBytes+this.downloadedBytes},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this.uploadLength+this.downloadLength},enumerable:!0,configurable:!0}),t.prototype._setUploadedBytes=function(e,t){e!==this.uploadedBytes&&(this.uploaded=t||e/this.uploadLength,this.uploadedBytes=e,this.emit("progress"))},t.prototype._setDownloadedBytes=function(e,t){e!==this.downloadedBytes&&(this.downloaded=t||e/this.downloadLength,this.downloadedBytes=e,this.emit("progress"))},t}(s.Base);t.Request=c},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),i=function(e){function t(t){var r=e.call(this,t)||this;return r.body=t.body,r.status=t.status,r.statusText=t.statusText,r}return n(t,e),t.prototype.statusType=function(){return~~(this.status/100)},t.prototype.toJSON=function(){return{url:this.url,headers:this.headers,body:this.body,status:this.status,statusText:this.statusText}},t}(o.Base);t.Response=i},function(e,t,r){"use strict";function n(e,t,r){void 0===r&&(r=1);for(var n=t;n<e.length-r;n++)e[n]=e[n+r];e.length-=r}Object.defineProperty(t,"__esModule",{value:!0}),t.splice=n},function(e,t,r){(function(e,n,o){function i(e,r){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),O(n.showHidden)&&(n.showHidden=!1),O(n.depth)&&(n.depth=2),O(n.colors)&&(n.colors=!1),O(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function a(e,t){return e}function u(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function c(e,r,n){if(e.customInspect&&r&&P(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return w(o)||(o=c(e,o,n)),o}var i=l(e,r);if(i)return i;var s=Object.keys(r),a=u(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),j(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(r);if(0===s.length){if(P(r)){var y=r.name?": "+r.name:"";return e.stylize("[Function"+y+"]","special")}if(T(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(j(r))return f(r)}var g="",m=!1,b=["{","}"];if(v(r)&&(m=!0,b=["[","]"]),P(r)){g=" [Function"+(r.name?": "+r.name:"")+"]"}if(T(r)&&(g=" "+RegExp.prototype.toString.call(r)),_(r)&&(g=" "+Date.prototype.toUTCString.call(r)),j(r)&&(g=" "+f(r)),0===s.length&&(!m||0==r.length))return b[0]+g+b[1];if(n<0)return T(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var k;return k=m?h(e,r,n,a,s):s.map(function(t){return p(e,r,n,a,t,m)}),e.seen.pop(),d(k,g,b)}function l(e,t){if(O(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,o){for(var i=[],s=0,a=t.length;s<a;++s)q(t,String(s))?i.push(p(e,t,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}function p(e,t,r,n,o,i){var s,a,u;if(u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},u.get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),q(n,o)||(s="["+o+"]"),a||(e.seen.indexOf(u.value)<0?(a=g(r)?c(e,u.value,null):c(e,u.value,r-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),O(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function d(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function v(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return null==e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function k(e){return"symbol"==typeof e}function O(e){return void 0===e}function T(e){return A(e)&&"[object RegExp]"===x(e)}function A(e){return"object"==typeof e&&null!==e}function _(e){return A(e)&&"[object Date]"===x(e)}function j(e){return A(e)&&("[object Error]"===x(e)||e instanceof Error)}function P(e){return"function"==typeof e}function E(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function x(e){return Object.prototype.toString.call(e)}function U(e){return e<10?"0"+e.toString(10):e.toString(10)}function S(){var e=new Date,t=[U(e.getHours()),U(e.getMinutes()),U(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var I=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(e).replace(I,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<o;a=n[++r])g(a)||!A(a)?s+=" "+a:s+=" "+i(a);return s},t.deprecate=function(r,i){function s(){if(!a){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?o.trace(i):o.error(i),a=!0}return r.apply(this,arguments)}if(O(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var a=!1;return s};var C,D={};t.debuglog=function(e){if(O(C)&&(C=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!D[e])if(new RegExp("\\b"+e+"\\b","i").test(C)){var r=n.pid;D[e]=function(){var n=t.format.apply(t,arguments);o.error("%s %d: %s",e,r,n)}}else D[e]=function(){};return D[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=v,t.isBoolean=y,t.isNull=g,t.isNullOrUndefined=m,t.isNumber=b,t.isString=w,t.isSymbol=k,t.isUndefined=O,t.isRegExp=T,t.isObject=A,t.isDate=_,t.isError=j,t.isFunction=P,t.isPrimitive=E,t.isBuffer=r(44);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){o.log("%s - %s",S(),t.format.apply(t,arguments))},t.inherits=r(43),t._extend=function(e,t){if(!t||!A(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,r(0),r(37),r(1))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=r(24),s=n(i),a=r(17),u=n(a),c=r(21),l=n(c),f=r(22),h=n(f),p=r(18),d=n(p),v=r(5),y=n(v),g=r(19),m=n(g),b=function e(t){o(this,e);var r=t.prefix||t.appID;this.store=new s.default(r),this.store.appID=t.appID,this.store.server=t.server||"https://api.blockv.io",this.store.websocketAddress=t.websocketAddress||"wss://ws.blockv.io",this.client=new y.default(this.store);var n=new l.default(this.client,this.store),i=new h.default(this.client);this.WebSockets=new m.default(this.store),this.UserManager=new u.default(n,this.store),this.Vatoms=new d.default(i)};t.default=b},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(5),s=(function(e){e&&e.__esModule}(i),function(){function e(t,r){n(this,e),this.bv=t,this.overridePayload=r,this.filters=[],this.groupBy=[e.FieldTemplateVariation],this.scope=null,this.setScopeToOwnedVatomsOnly(),this.samples=0}return o(e,[{key:"appendFilter",value:function(t,r,n,o){this.filters.push({field:t,filter_op:n||e.FilterOperation.Equal,value:r,bool_op:o||e.CombineOperation.And})}},{key:"setScopeToPublisherFQDN",value:function(t){this.scope={key:e.FieldPublisherFqdn,value:t}}},{key:"setScopeToOwnedVatomsOnly",value:function(){this.scope={key:e.FieldOwner,value:"$currentuser"}}},{key:"setScope",value:function(e,t){this.scope={key:e,value:t}}},{key:"getPayload",value:function(){if(this.overridePayload)return this.overridePayload;if(!this.scope)throw new Error("Vatomic SDK: No scope set for discover filter!");var e={};return e.scope=this.scope,this.samples>0&&this.groupBy.length>0&&(e.sample=this.samples,e.group_by=this.groupBy),this.filters.length>0&&(e.filters=[{filter_elems:this.filters}]),e.return={type:"*",fields:[]},e}},{key:"execute",value:function(){return this.bv.client.request("POST","/v1/vatom/discover",this.getPayload(),!0).then(function(e){return e})}},{key:"count",value:function(){var e=this.getPayload();return e.return.type="count",this.bv.client.request("POST","/v1/vatom/discover",e,!0).then(function(e){return e.count||0})}}]),e}());t.default=s,s.FilterOperation={Equal:"Eq",GreaterThan:"Gt",GreaterOrEqual:"Ge",LessThan:"Lt",LessOrEqual:"Le",NotEqual:"Ne",Match:"Match"},s.CombineOperation={And:"And",Or:"Or"},s.FieldAcquireable="vAtom::vAtomType.acquireable",s.FieldPrivateName="private.name",s.FieldID="id",s.FieldPublisherFqdn="vAtom::vAtomType.publisher_fqdn",s.FieldTemplate="vAtom::vAtomType.template",s.FieldTemplateVariation="vAtom::vAtomType.template_variation",s.FieldVisibilityType="vAtom::vAtomType.visibility.type",s.FieldOwner="vAtom::vAtomType.owner",s.FieldParentID="vAtom::vAtomType.parent_id"},function(e,t,r){"use strict";(function(t){/*!
* The buffer module from node.js, for the browser.

@@ -7,3 +7,3 @@ *

*/
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function i(e){return Object.prototype.toString.call(e)}function s(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function u(e){if(w.isFunction(e)){if(T)return e.name;var t=e.toString(),r=t.match(_);return r&&r[1]}}function a(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function c(e){if(T||!w.isFunction(e))return w.inspect(e);var t=u(e);return"[Function"+(t?": "+t:"")+"]"}function f(e){return a(c(e.actual),128)+" "+e.operator+" "+a(c(e.expected),128)}function l(e,t,r,n,o){throw new j.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:o})}function h(e,t){e||l(e,!0,t,"==",j.ok)}function p(e,t,r,u){if(e===t)return!0;if(o(e)&&o(t))return 0===n(e,t);if(w.isDate(e)&&w.isDate(t))return e.getTime()===t.getTime();if(w.isRegExp(e)&&w.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(s(e)&&s(t)&&i(e)===i(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;u=u||{actual:[],expected:[]};var a=u.actual.indexOf(e);return-1!==a&&a===u.expected.indexOf(t)||(u.actual.push(e),u.expected.push(t),y(e,t,r,u))}return r?e===t:e==t}function d(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function y(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(w.isPrimitive(e)||w.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=d(e),i=d(t);if(o&&!i||!o&&i)return!1;if(o)return e=O.call(e),t=O.call(t),p(e,t,r);var s,u,a=A(e),c=A(t);if(a.length!==c.length)return!1;for(a.sort(),c.sort(),u=a.length-1;u>=0;u--)if(a[u]!==c[u])return!1;for(u=a.length-1;u>=0;u--)if(s=a[u],!p(e[s],t[s],r,n))return!1;return!0}function v(e,t,r){p(e,t,!0)&&l(e,t,r,"notDeepStrictEqual",v)}function g(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function m(e){var t;try{e()}catch(e){t=e}return t}function b(e,t,r,n){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=m(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!o&&l(o,r,"Missing expected exception"+n);var i="string"==typeof n,s=!e&&w.isError(o),u=!e&&o&&!r;if((s&&i&&g(o,r)||u)&&l(o,r,"Got unwanted exception"+n),e&&o&&r&&!g(o,r)||!e&&o)throw o}var w=r(11),k=Object.prototype.hasOwnProperty,O=Array.prototype.slice,T=function(){return"foo"===function(){}.name}(),j=e.exports=h,_=/\s*function\s+([^\(\s]*)\s*/;j.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var t=e.stackStartFunction||l;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,o=u(t),i=n.indexOf("\n"+o);if(i>=0){var s=n.indexOf("\n",i+1);n=n.substring(s+1)}this.stack=n}}},w.inherits(j.AssertionError,Error),j.fail=l,j.ok=h,j.equal=function(e,t,r){e!=t&&l(e,t,r,"==",j.equal)},j.notEqual=function(e,t,r){e==t&&l(e,t,r,"!=",j.notEqual)},j.deepEqual=function(e,t,r){p(e,t,!1)||l(e,t,r,"deepEqual",j.deepEqual)},j.deepStrictEqual=function(e,t,r){p(e,t,!0)||l(e,t,r,"deepStrictEqual",j.deepStrictEqual)},j.notDeepEqual=function(e,t,r){p(e,t,!1)&&l(e,t,r,"notDeepEqual",j.notDeepEqual)},j.notDeepStrictEqual=v,j.strictEqual=function(e,t,r){e!==t&&l(e,t,r,"===",j.strictEqual)},j.notStrictEqual=function(e,t,r){e===t&&l(e,t,r,"!==",j.notStrictEqual)},j.throws=function(e,t,r){b(!0,e,t,r)},j.doesNotThrow=function(e,t,r){b(!1,e,t,r)},j.ifError=function(e){if(e)throw e};var A=Object.keys||function(e){var t=[];for(var r in e)k.call(e,r)&&t.push(r);return t}}).call(t,r(0))},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t,r){n(this,e),this.UserApi=t,this.store=r}return o(e,[{key:"register",value:function(e,t,r,n,o,i,s,u){return this.UserApi.register(new RegisterRequest(e,t,r,n,o,i,s,u))}},{key:"register",value:function(e){return this.UserApi.register(e)}},{key:"login",value:function(e,t,r){return this.UserApi.login(e,t,r)}},{key:"loginGuest",value:function(e){return this.UserApi.loginGuest(e)}},{key:"logout",value:function(){return this.UserApi.logout()}},{key:"getCurrentUser",value:function(){return this.UserApi.getCurrentUser()}},{key:"getCurrentUserTokens",value:function(){return this.UserApi.getUserTokens()}},{key:"uploadAvatar",value:function(e){this.UserApi.uploadAvatar(e)}},{key:"updateUser",value:function(e){return this.UserApi.updateUser(e)}},{key:"getAccessToken",value:function(){return this.UserApi.getAccessToken()}},{key:"encodeAssetProvider",value:function(e){return this.UserApi.encodeAssetProvider(e)}},{key:"sendTokenVerification",value:function(e,t){return this.UserApi.sendTokenVerification(e,t)}},{key:"getRefreshToken",value:function(){return this.UserApi.getRefreshToken()}},{key:"setRefreshToken",value:function(e){return this.UserApi.setRefreshToken(e)}},{key:"verifyUserToken",value:function(e){return this.UserApi.verifyUserToken(e)}},{key:"addUserToken",value:function(e){return this.UserApi.addUserToken(e)}},{key:"deleteUserToken",value:function(e){return this.UserApi.deleteUserToken(e)}},{key:"getGuestToken",value:function(){return this.UserApi.getGuestToken()}},{key:"resetPassword",value:function(e,t){return this.UserApi.resetPassword(e,t)}},{key:"addRedeemable",value:function(e){return this.UserApi.addRedeemable(e)}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.vatomApi=t}return o(e,[{key:"performAction",value:function(e,t,r){return r=r||{},r["this.id"]=e,this.vatomApi.performAction(t,r)}},{key:"getUserInventory",value:function(){var e={parent_id:".",page:1,limit:1e3};return this.vatomApi.getUserInventory(e)}},{key:"getUserVatoms",value:function(e){var t={ids:[e]};return this.vatomApi.getUserVatoms(t)}}]),e}();t.default=i},function(e,t,r){"use strict";var n=r(12),o=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=o.default},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(31),u=r(26),a=n(u),c=r(20),f=n(c),l=function(){function t(e){o(this,t),this.store=e}return i(t,[{key:"request",value:function(e,t,r,n,o){var i=this;return!0===n?this.checkToken().then(function(n){return i._request(e,t,r,o)}):this._request(e,t,r,o)}},{key:"_request",value:function(t,r,n,o){return o=Object.assign({"App-Id":this.store.appID,Authorization:"Bearer "+this.store.token,"Content-Type":"application/json"},o),(0,s.request)({method:t,url:this.store.server+r,body:n,headers:o}).use(s.plugins.parse("json")).then(function(e){return Object.assign(new f.default,e.body)}).then(function(t){if(e.log(t),!t.payload){var r={11:"Problem with payload",401:"Token has Expired",516:"Invalid Payload",521:"Token Unavailable",527:"Invalid Date Format",2030:"No user found, Please register an account first.",2031:"Authentication Failed",2032:"Login Failed, Please try again",2034:"Invalid Token",2051:"Too many login attempts, Please try again later.",2552:"Unable To Retrieve Token",2563:"Token Already Confirmed",2564:"Invalid Verification Code",2569:"Invalid Phone Number"};if(2051===t.error){var n=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g.exec(t.message);t.lockedUntil=new Date(n);var o=t.lockedUntil.getTime()-Date.now();o<2e3&&(o=2e3);var i=Math.floor(o/1e3),s=Math.floor(o/1e3/60);i<=90?t.error=t.message.replace("%DURATION%",1==i?"1 second":i+" seconds"):t.message=t.message.replace("%DURATION%",1==s?"1 minute":s+" minutes");var u=new Error("Too many login attempts, Try again at : "+t.lockedUntil);throw u.code=t.error||0,u}var u=new Error(r[t.error]||"An unknown server error occurred.");throw u.code=t.error||0,u}return t.payload})}},{key:"refreshToken",value:function(){var e=this,t={Authorization:"Bearer "+this.store.refreshToken};return this.request("POST","/v1/access_token","",!1,t).then(function(t){e.store.token=t.access_token.token})}},{key:"checkToken",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]&&arguments[0],void 0),t=void 0;if("undefined"==(t=this.store.token)||""==t)this.refreshToken();else try{return e=(0,a.default)(this.store.token),1e3*e.exp,Date.now(),this.refreshToken()}catch(e){return this.refreshToken()}}}]),t}();t.default=l}).call(t,r(1))},function(e,t,r){"use strict";(function(e){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(22),s=function(e){return e&&e.__esModule?e:{default:e}}(i),u=function(){function t(e,r){n(this,t),this.client=e,this.store=r}return o(t,[{key:"getAccessToken",value:function(){return this.store.token}},{key:"setAccessToken",value:function(e){this.store.token="",this.store.token=e}},{key:"getRefreshToken",value:function(){return this.store.refreshToken}},{key:"setRefreshToken",value:function(e){this.store.token="",this.store.refreshToken=e}},{key:"register",value:function(e){var t=this;return this.client.request("POST","/v1/users",e,!1).then(function(e){return t.store.token=e.access_token.token,t.store.refreshToken=e.refresh_token.token,e}).then(function(e){return new s.default(e)})}},{key:"login",value:function(e,t,r){var n=this,o={token:e,token_type:t,auth_data:{password:r}};return this.client.request("POST","/v1/user/login",o,!1).then(function(e){if(r)return n.store.token=e.access_token.token,n.store.refreshToken=e.refresh_token.token,n.store.assetProvider=e.asset_provider,n.store.userID=e.user.id,e;var t=new Error("Login Failed, Password Reset");throw t.code="PASSWORD_RESET",t}).then(function(e){return new s.default(e)})}},{key:"loginGuest",value:function(t){var r=this,n={token:t,token_type:"guest_id"};return this.client.request("POST","/v1/user/login",n,!1).then(function(t){return e.log(t),r.store.token=t.access_token.token,r.store.refreshToken=t.refresh_token.token,r.store.assetProvider=t.asset_provider,t}).then(function(e){return new s.default(e)})}},{key:"loginOAuth",value:function(e,t){}},{key:"uploadAvatar",value:function(e){var t={"Content-Type":"multipart/form-data"};this.client.request("POST","/v1/user/avatar",e,!0,t)}},{key:"getCurrentUser",value:function(t){return this.client.request("GET","/v1/user",t,!0).then(function(t){return e.log(t),t})}},{key:"updateUser",value:function(e){return this.client.request("PATCH","/v1/user",e,!0)}},{key:"getUserTokens",value:function(){return this.client.request("GET","/v1/user/tokens","",!0)}},{key:"verifyUserToken",value:function(e){return this.client.request("POST","/v1/user/verify_token",e,!0)}},{key:"resetPassword",value:function(e,t){var r={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token",r,!1)}},{key:"sendTokenVerification",value:function(e,t){var r={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token_verification",r,!1)}},{key:"getGuestToken",value:function(){return this.client.request("POST","/v1/user/guest","",!1).then(function(e){return e.properties.guest_id})}},{key:"logout",value:function(t){this.client.request("POST","/v1/user/logout",t,!0).then(function(){e.log("User has been logged out!"),this.store.token="",this.store.refreshToken=""})}},{key:"extractHostname",value:function(e){var t;return t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t=t.split("?")[0]}},{key:"encodeAssetProvider",value:function(e){for(var t=this.store.assetProvider,r=t.length,n=this.extractHostname(e),o=0;o<r;o++){if(n===this.extractHostname(t[o].uri)){var i=0;for(var s in t[o].descriptor)e+=0===i?"?"+s+"="+t[o].descriptor[s]:"&"+s+"="+t[o].descriptor[s],i++}}return e}},{key:"addUserToken",value:function(e){return this.client.request("POST","/v1/user/tokens",e,!0)}},{key:"deleteUserToken",value:function(e){return this.cliet.request("DELETE","/v1/user/tokens/"+e,null,!0)}},{key:"addRedeemable",value:function(e){var t=this.store.userID;return this.client.request("POST","/v1/users/"+t+"/redeemables",e,!0)}}]),t}();t.default=u}).call(t,r(1))},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.client=t}return o(e,[{key:"performAction",value:function(e,t){return this.client.request("POST","/v1/user/vatom/action/"+e,t,!0).then(function(e){e.main.output})}},{key:"getUserInventory",value:function(e){return this.client.request("POST","/v1/user/vatom/inventory",e,!0).then(function(e){return e.vatoms})}},{key:"getUserVatoms",value:function(e){return this.client.request("POST","/v1/user/vatom/get",e,!0).then(function(e){return e})}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,r,o,i){n(this,e),this.status=i,this.error=t,this.message=r,this.payload=o};t.default=o},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.prefix=t}return o(e,[{key:"server",get:function(){return this.serverAddress},set:function(e){this.serverAddress=e}},{key:"userID",set:function(e){this.USERID=e},get:function(){return this.USERID}},{key:"appID",get:function(){return this.APPID},set:function(e){this.APPID=e}},{key:"websocketAddress",get:function(){return this.wssocketAddress},set:function(e){this.wssocketAddress=e}},{key:"token",set:function(e){this.accessToken=e},get:function(){return this.accessToken}},{key:"refreshToken",set:function(e){localStorage.setItem(this.prefix+"_refresh",e)},get:function(){return localStorage.getItem(this.prefix+"_refresh")}},{key:"assetProvider",set:function(e){localStorage.setItem(this.prefix+"_asset_provider",JSON.stringify(e))},get:function(){return JSON.parse(localStorage.getItem(this.prefix+"_asset_provider")||"undefined")}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t){n(this,e),this.id=t.user.id,this.firstName=t.user.properties.first_name,this.lastName=t.user.properties.last_name,this.avatarUri=t.user.properties.avatar_uri,this.birthday=t.user.properties.birthday,this.language=t.user.properties.language};t.default=o},function(e,t){function r(){return(new Date).getTime()}e.exports=r},function(e,t){function r(e){this.message=e}function n(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,u=0,a="";i=t.charAt(u++);~i&&(n=s%4?64*n+i:i,s++%4)?a+=String.fromCharCode(255&n>>(-2*s&6)):0)i=o.indexOf(i);return a}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.name="InvalidCharacterError",e.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||n},function(e,t,r){function n(e){return decodeURIComponent(o(e).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}var o=r(24);e.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return n(t)}catch(e){return o(t)}}},function(e,t,r){"use strict";function n(e){this.message=e}var o=r(25);n.prototype=new Error,n.prototype.name="InvalidTokenError",e.exports=function(e,t){if("string"!=typeof e)throw new n("Invalid token specified");t=t||{};var r=!0===t.header?0:1;try{return JSON.parse(o(e.split(".")[r]))}catch(e){throw new n("Invalid token specified: "+e.message)}},e.exports.InvalidTokenError=n},function(e,t,r){"use strict";function n(e,t){return void 0===t&&(t=n.BaseError),i(e,t)}var n,o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(28);!function(e){var t=function(e){function t(t,r){e.call(this,t),this.cause=r}return o(t,e),t.prototype.toString=function(){return e.prototype.toString.call(this)+(this.cause?"\nCaused by: "+this.cause.toString():"")},t}(i.BaseError);e.BaseError=t}(n||(n={})),e.exports=n},function(e,t,r){"use strict";function n(e){void 0!==e&&s(this,"message",{configurable:!0,value:e,writable:!0});var t=this.constructor.name;void 0!==t&&t!==this.name&&s(this,"name",{configurable:!0,value:t,writable:!0}),u(this,this.constructor)}function o(e,t){if(null==t||t===Error)t=n;else if("function"!=typeof t)throw new TypeError("super_ should be a function");var r;if("string"==typeof e)r=e,e=void 0!==i?function(){return i(t,arguments,this.constructor)}:function(){t.apply(this,arguments)},void 0!==a&&(a(e,r),r=void 0);else if("function"!=typeof e)throw new TypeError("constructor should be either a string or a function");e.super_=e.super=t;var o={constructor:{configurable:!0,value:e,writable:!0}};return void 0!==r&&(o.name={configurable:!0,value:r,writable:!0}),e.prototype=Object.create(t.prototype,o),e}var i="undefined"!=typeof Reflect?Reflect.construct:void 0,s=Object.defineProperty,u=Error.captureStackTrace;void 0===u&&(u=function(e){var t=new Error;s(e,"stack",{configurable:!0,get:function(){var e=t.stack;return s(this,"stack",{configurable:!0,value:e,writable:!0}),e},set:function(t){s(e,"stack",{configurable:!0,value:t,writable:!0})}})}),n.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:n,writable:!0}});var a=function(){function e(e,t){return s(e,"name",{configurable:!0,value:t})}try{var t=function(){};if(e(t,"foo"),"foo"===t.name)return e}catch(e){}}();t=e.exports=o,t.BaseError=n},function(e,t,r){"use strict";function n(e){return{use:c,abort:i,open:function(t){return o(t,e)}}}function o(e,t){return new Promise(function(r,n){function o(){return new Promise(function(e){return e(new u.Response({status:1223===f.status?204:f.status,statusText:f.statusText,rawHeaders:s(f.getAllResponseHeaders()),body:"text"===i?f.responseText:f.response,url:f.responseURL}))})}var i=t.type||"text",a=e.url,c=e.method;if("https:"===window.location.protocol&&/^http\:/.test(a))return n(e.error('The request to "'+a+'" was blocked',"EBLOCKED"));var f=e._raw=new XMLHttpRequest;f.onload=function(){return r(o())},f.onabort=function(){return r(o())},f.onerror=function(){return n(e.error('Unable to connect to "'+e.url+'"',"EUNAVAILABLE"))},f.onprogress=function(t){t.lengthComputable&&(e.downloadLength=t.total),e._setDownloadedBytes(t.loaded)},f.upload.onloadend=function(){return e.downloaded=1},"GET"!==c&&"HEAD"!==c&&f.upload?(f.upload.onprogress=function(t){t.lengthComputable&&(e.uploadLength=t.total),e._setUploadedBytes(t.loaded)},f.upload.onloadend=function(){return e.uploaded=1}):(e.uploadLength=0,e._setUploadedBytes(0,1));try{f.open(c,a)}catch(t){return n(e.error('Refused to connect to "'+a+'"',"ECSP",t))}if(t.withCredentials&&(f.withCredentials=!0),t.overrideMimeType&&f.overrideMimeType(t.overrideMimeType),"text"!==i)try{f.responseType=i}finally{if(f.responseType!==i)return n(e.error("Unsupported type: "+i,"ETYPE"))}for(var l=0;l<e.rawHeaders.length;l+=2)f.setRequestHeader(e.rawHeaders[l],e.rawHeaders[l+1]);f.send(e.body)})}function i(e){e._raw.abort()}function s(e){for(var t=[],r=e.split(/\r?\n/),n=0,o=r;n<o.length;n++){var i=o[n];if(i){var s=i.indexOf(":"),u=i.substr(0,s).trim(),a=i.substr(s+1).trim();t.push(u,a)}}return t}Object.defineProperty(t,"__esModule",{value:!0});var u=r(9),a=r(7);t.createTransport=n;var c=[a.stringify(),a.headers()]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){throw new TypeError("Cookie jars are not available in browsers")}return e}();t.CookieJar=n},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function o(e){var t=l.createTransport({type:"text"}),r=Object.assign({},{transport:t},e);return function(e){var t=Object.assign({},r,"string"==typeof e?{url:e}:e);if("string"!=typeof t.url)throw new TypeError("The URL must be a string");return new s.Request(t)}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(3);t.FormData=i;var s=r(8),u=r(7);t.plugins=u;var a=r(6);t.form=a.default;var c=r(32);t.jar=c.default;var f=r(5);t.PopsicleError=f.default;var l=r(29);t.createTransport=l.createTransport,t.defaults=o,t.request=o({}),t.get=o({method:"get"}),t.post=o({method:"post"}),t.put=o({method:"put"}),t.patch=o({method:"patch"}),t.del=o({method:"delete"}),t.head=o({method:"head"}),n(r(2)),n(r(8)),n(r(9)),t.default=t.request},function(e,t,r){"use strict";function n(e){return new o.CookieJar(e)}Object.defineProperty(t,"__esModule",{value:!0});var o=r(30);t.default=n},function(e,t,r){"use strict";function n(e){return function(){return e}}function o(e,t){for(var r=Array.isArray(e)?e:[e],n=0,o=r;n<o.length;n++){var i=o[n];if("json"!==i&&"urlencoded"!==i)throw new TypeError("Unexpected parse type: "+i)}return function(e,n){return n().then(function(n){var o=n.body,i=n.type();if(null==o||""===o)return n.body=null,n;if(null==i)throw e.error("Unable to parse empty response content type","EPARSE");if("string"!=typeof o)throw e.error("Unable to parse non-string response body","EPARSE");for(var u=0,a=r;u<a.length;u++){var l=a[u];if("json"===l&&c.test(i)){try{n.body=JSON.parse(o.replace(h,""))}catch(t){throw e.error("Unable to parse response body: "+t.message,"EPARSE",t)}return n}if("urlencoded"===l&&f.test(i))return n.body=s.parse(o),n}if(!1!==t)throw e.error("Unhandled response type: "+i,"EPARSE");return n})}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),s=r(4),u=r(34),a=r(6),c=/^application\/(?:[\w!#\$%&\*`\-\.\^~]*\+)?json$/i,f=/^application\/x-www-form-urlencoded$/i,l=/^multipart\/form-data$/i,h=/^\)\]\}',?\n/;t.wrap=n,t.headers=n(function(e,t){return e.get("Accept")||e.set("Accept","*/*"),e.remove("Host"),t()}),t.stringify=n(function(e,t){var r=e.body;if(Object(r)!==r)return e.body=null==r?null:String(r),t();if(u.default(r))return t();var n=e.type();n||(n="application/json",e.type(n));try{c.test(n)?e.body=JSON.stringify(r):l.test(n)?e.body=a.default(r):f.test(n)&&(e.body=s.stringify(r))}catch(t){return Promise.reject(e.error("Unable to stringify request body: "+t.message,"ESTRINGIFY",t))}return e.body instanceof i&&e.remove("Content-Type"),t()}),t.parse=o},function(e,t,r){"use strict";function n(e){switch(Object.prototype.toString.call(e)){case"[object File]":case"[object Blob]":case"[object FormData]":case"[object ArrayBuffer]":return!0;default:return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function s(){y&&p&&(y=!1,p.length?d=p.concat(d):v=-1,d.length&&u())}function u(){if(!y){var e=o(s);y=!0;for(var t=d.length;t;){for(p=d,d=[];++v<t;)p&&p[v].run();v=-1,t=d.length}p=null,y=!1,i(e)}}function a(e,t){this.fun=e,this.array=t}function c(){}var f,l,h=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(e){f=r}try{l="function"==typeof clearTimeout?clearTimeout:n}catch(e){l=n}}();var p,d=[],y=!1,v=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new a(e,t)),1!==d.length||y||o(u)},a.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){(function(e,n){var o;!function(i){function s(e){throw new RangeError(q[e])}function u(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function a(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(S,"."),n+u(e.split("."),t).join(".")}function c(e){for(var t,r,n=[],o=0,i=e.length;o<i;)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<i?(r=e.charCodeAt(o++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--)):n.push(t);return n}function f(e){return u(e,function(e){var t="";return e>65535&&(e-=65536,t+=R(e>>>10&1023|55296),e=56320|1023&e),t+=R(e)}).join("")}function l(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:k}function h(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?I(e/_):e>>1,e+=I(e/t);e>C*T>>1;n+=k)e=I(e/C);return I(n+(C+1)*e/(e+j))}function d(e){var t,r,n,o,i,u,a,c,h,d,y=[],v=e.length,g=0,m=E,b=A;for(r=e.lastIndexOf(x),r<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&s("not-basic"),y.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<v;){for(i=g,u=1,a=k;o>=v&&s("invalid-input"),c=l(e.charCodeAt(o++)),(c>=k||c>I((w-g)/u))&&s("overflow"),g+=c*u,h=a<=b?O:a>=b+T?T:a-b,!(c<h);a+=k)d=k-h,u>I(w/d)&&s("overflow"),u*=d;t=y.length+1,b=p(g-i,t,0==i),I(g/t)>w-m&&s("overflow"),m+=I(g/t),g%=t,y.splice(g++,0,m)}return f(y)}function y(e){var t,r,n,o,i,u,a,f,l,d,y,v,g,m,b,j=[];for(e=c(e),v=e.length,t=E,r=0,i=A,u=0;u<v;++u)(y=e[u])<128&&j.push(R(y));for(n=o=j.length,o&&j.push(x);n<v;){for(a=w,u=0;u<v;++u)(y=e[u])>=t&&y<a&&(a=y);for(g=n+1,a-t>I((w-r)/g)&&s("overflow"),r+=(a-t)*g,t=a,u=0;u<v;++u)if(y=e[u],y<t&&++r>w&&s("overflow"),y==t){for(f=r,l=k;d=l<=i?O:l>=i+T?T:l-i,!(f<d);l+=k)b=f-d,m=k-d,j.push(R(h(d+b%m,0))),f=I(b/m);j.push(R(h(f,0))),i=p(r,g,n==o),r=0,++n}++r,++t}return j.join("")}function v(e){return a(e,function(e){return P.test(e)?d(e.slice(4).toLowerCase()):e})}function g(e){return a(e,function(e){return U.test(e)?"xn--"+y(e):e})}var m=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof n&&n);var b,w=2147483647,k=36,O=1,T=26,j=38,_=700,A=72,E=128,x="-",P=/^xn--/,U=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=k-O,I=Math.floor,R=String.fromCharCode;b={version:"1.4.1",ucs2:{decode:c,encode:f},decode:d,encode:y,toASCII:g,toUnicode:v},void 0!==(o=function(){return b}.call(t,r,t,e))&&(e.exports=o)}()}).call(t,r(43)(e),r(0))},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,i){t=t||"&",r=r||"=";var s={};if("string"!=typeof e||0===e.length)return s;var u=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var f=0;f<c;++f){var l,h,p,d,y=e[f].replace(u,"%20"),v=y.indexOf(r);v>=0?(l=y.substr(0,v),h=y.substr(v+1)):(l=y,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),n(s,p)?o(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,u){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?n(s(e),function(s){var u=encodeURIComponent(o(s))+r;return i(e[s])?n(e[s],function(e){return u+encodeURIComponent(o(e))}).join(t):u+encodeURIComponent(o(e[s]))}).join(t):u?encodeURIComponent(o(u))+r+encodeURIComponent(o(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(e,t,r){if(e&&c.isObject(e)&&e instanceof n)return e;var o=new n;return o.parse(e,t,r),o}function i(e){return c.isString(e)&&(e=o(e)),e instanceof n?e.format():n.prototype.format.call(e)}function s(e,t){return o(e,!1,!0).resolve(t)}function u(e,t){return e?o(e,!1,!0).resolveObject(t):t}var a=r(36),c=r(40);t.parse=o,t.resolve=s,t.resolveObject=u,t.format=i,t.Url=n;var f=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(p),y=["'"].concat(d),v=["%","/","?",";","#"].concat(y),g=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=r(4);n.prototype.parse=function(e,t,r){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),o=-1!==n&&n<e.indexOf("#")?"?":"#",i=e.split(o),s=/\\/g;i[0]=i[0].replace(s,"/"),e=i.join(o);var u=e;if(u=u.trim(),!r&&1===e.split("#").length){var l=h.exec(u);if(l)return this.path=u,this.href=u,this.pathname=l[1],l[2]?(this.search=l[2],this.query=t?T.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var p=f.exec(u);if(p){p=p[0];var d=p.toLowerCase();this.protocol=d,u=u.substr(p.length)}if(r||p||u.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===u.substr(0,2);!j||p&&k[p]||(u=u.substr(2),this.slashes=!0)}if(!k[p]&&(j||p&&!O[p])){for(var _=-1,A=0;A<g.length;A++){var E=u.indexOf(g[A]);-1!==E&&(-1===_||E<_)&&(_=E)}var x,P;P=-1===_?u.lastIndexOf("@"):u.lastIndexOf("@",_),-1!==P&&(x=u.slice(0,P),u=u.slice(P+1),this.auth=decodeURIComponent(x)),_=-1;for(var A=0;A<v.length;A++){var E=u.indexOf(v[A]);-1!==E&&(-1===_||E<_)&&(_=E)}-1===_&&(_=u.length),this.host=u.slice(0,_),u=u.slice(_),this.parseHost(),this.hostname=this.hostname||"";var U="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!U)for(var S=this.hostname.split(/\./),A=0,q=S.length;A<q;A++){var C=S[A];if(C&&!C.match(m)){for(var I="",R=0,D=C.length;R<D;R++)C.charCodeAt(R)>127?I+="x":I+=C[R];if(!I.match(m)){var H=S.slice(0,A),M=S.slice(A+1),B=C.match(b);B&&(H.push(B[1]),M.unshift(B[2])),M.length&&(u="/"+M.join(".")+u),this.hostname=H.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=a.toASCII(this.hostname));var N=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+N,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!w[d])for(var A=0,q=y.length;A<q;A++){var F=y[A];if(-1!==u.indexOf(F)){var z=encodeURIComponent(F);z===F&&(z=escape(F)),u=u.split(F).join(z)}}var G=u.indexOf("#");-1!==G&&(this.hash=u.substr(G),u=u.slice(0,G));var J=u.indexOf("?");if(-1!==J?(this.search=u.substr(J),this.query=u.substr(J+1),t&&(this.query=T.parse(this.query)),u=u.slice(0,J)):t&&(this.search="",this.query={}),u&&(this.pathname=u),O[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var N=this.pathname||"",$=this.search||"";this.path=N+$}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(i=T.stringify(this.query));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||O[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+o+r+s+n},n.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(c.isString(e)){var t=new n;t.parse(e,!1,!0),e=t}for(var r=new n,o=Object.keys(this),i=0;i<o.length;i++){var s=o[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),a=0;a<u.length;a++){var f=u[a];"protocol"!==f&&(r[f]=e[f])}return O[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!O[e.protocol]){for(var l=Object.keys(e),h=0;h<l.length;h++){var p=l[h];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||k[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",v=r.search||"";r.path=y+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=m||g||r.host&&e.pathname,w=b,T=r.pathname&&r.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],j=r.protocol&&!O[r.protocol];if(j&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),b=b&&(""===d[0]||""===T[0])),m)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=e.search,r.query=e.query;else if(!c.isNullOrUndefined(e.search)){if(j){r.hostname=r.host=T.shift();var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return r.search=e.search,r.query=e.query,c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=T.slice(-1)[0],E=(r.host||e.host||T.length>1)&&("."===A||".."===A)||""===A,x=0,P=T.length;P>=0;P--)A=T[P],"."===A?T.splice(P,1):".."===A?(T.splice(P,1),x++):x&&(T.splice(P,1),x--);if(!b&&!w)for(;x--;x)T.unshift("..");!b||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),E&&"/"!==T.join("/").substr(-1)&&T.push("");var U=""===T[0]||T[0]&&"/"===T[0].charAt(0);if(j){r.hostname=r.host=U?"":T.length?T.shift():"";var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return b=b||r.host&&T.length,b&&!U&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}]);
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function i(e){return Object.prototype.toString.call(e)}function s(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function a(e){if(w.isFunction(e)){if(T)return e.name;var t=e.toString(),r=t.match(_);return r&&r[1]}}function u(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function c(e){if(T||!w.isFunction(e))return w.inspect(e);var t=a(e);return"[Function"+(t?": "+t:"")+"]"}function l(e){return u(c(e.actual),128)+" "+e.operator+" "+u(c(e.expected),128)}function f(e,t,r,n,o){throw new A.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:o})}function h(e,t){e||f(e,!0,t,"==",A.ok)}function p(e,t,r,a){if(e===t)return!0;if(o(e)&&o(t))return 0===n(e,t);if(w.isDate(e)&&w.isDate(t))return e.getTime()===t.getTime();if(w.isRegExp(e)&&w.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(s(e)&&s(t)&&i(e)===i(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;a=a||{actual:[],expected:[]};var u=a.actual.indexOf(e);return-1!==u&&u===a.expected.indexOf(t)||(a.actual.push(e),a.expected.push(t),v(e,t,r,a))}return r?e===t:e==t}function d(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function v(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(w.isPrimitive(e)||w.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=d(e),i=d(t);if(o&&!i||!o&&i)return!1;if(o)return e=O.call(e),t=O.call(t),p(e,t,r);var s,a,u=j(e),c=j(t);if(u.length!==c.length)return!1;for(u.sort(),c.sort(),a=u.length-1;a>=0;a--)if(u[a]!==c[a])return!1;for(a=u.length-1;a>=0;a--)if(s=u[a],!p(e[s],t[s],r,n))return!1;return!0}function y(e,t,r){p(e,t,!0)&&f(e,t,r,"notDeepStrictEqual",y)}function g(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function m(e){var t;try{e()}catch(e){t=e}return t}function b(e,t,r,n){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=m(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!o&&f(o,r,"Missing expected exception"+n);var i="string"==typeof n,s=!e&&w.isError(o),a=!e&&o&&!r;if((s&&i&&g(o,r)||a)&&f(o,r,"Got unwanted exception"+n),e&&o&&r&&!g(o,r)||!e&&o)throw o}var w=r(13),k=Object.prototype.hasOwnProperty,O=Array.prototype.slice,T=function(){return"foo"===function(){}.name}(),A=e.exports=h,_=/\s*function\s+([^\(\s]*)\s*/;A.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=l(this),this.generatedMessage=!0);var t=e.stackStartFunction||f;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,o=a(t),i=n.indexOf("\n"+o);if(i>=0){var s=n.indexOf("\n",i+1);n=n.substring(s+1)}this.stack=n}}},w.inherits(A.AssertionError,Error),A.fail=f,A.ok=h,A.equal=function(e,t,r){e!=t&&f(e,t,r,"==",A.equal)},A.notEqual=function(e,t,r){e==t&&f(e,t,r,"!=",A.notEqual)},A.deepEqual=function(e,t,r){p(e,t,!1)||f(e,t,r,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(e,t,r){p(e,t,!0)||f(e,t,r,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(e,t,r){p(e,t,!1)&&f(e,t,r,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=y,A.strictEqual=function(e,t,r){e!==t&&f(e,t,r,"===",A.strictEqual)},A.notStrictEqual=function(e,t,r){e===t&&f(e,t,r,"!==",A.notStrictEqual)},A.throws=function(e,t,r){b(!0,e,t,r)},A.doesNotThrow=function(e,t,r){b(!1,e,t,r)},A.ifError=function(e){if(e)throw e};var j=Object.keys||function(e){var t=[];for(var r in e)k.call(e,r)&&t.push(r);return t}}).call(t,r(0))},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(6),s=function(e){return e&&e.__esModule?e:{default:e}}(i),a=function(){function e(t,r){n(this,e),this.UserApi=t,this.store=r}return o(e,[{key:"register",value:function(e,t,r,n,o,i,s,a){return this.UserApi.register(new RegisterRequest(e,t,r,n,o,i,s,a))}},{key:"register",value:function(e){return this.UserApi.register(e)}},{key:"login",value:function(e,t,r){return this.UserApi.login(e,t,r)}},{key:"loginGuest",value:function(e){return this.UserApi.loginGuest(e)}},{key:"logout",value:function(){return this.UserApi.logout()}},{key:"getCurrentUser",value:function(){return this.UserApi.getCurrentUser()}},{key:"getCurrentUserTokens",value:function(){return this.UserApi.getUserTokens()}},{key:"uploadAvatar",value:function(e){this.UserApi.uploadAvatar(e)}},{key:"updateUser",value:function(e){return this.UserApi.updateUser(e)}},{key:"getAccessToken",value:function(){return this.UserApi.getAccessToken()}},{key:"encodeAssetProvider",value:function(e){return this.UserApi.encodeAssetProvider(e)}},{key:"sendTokenVerification",value:function(e,t){return this.UserApi.sendTokenVerification(e,t)}},{key:"getRefreshToken",value:function(){return this.UserApi.getRefreshToken()}},{key:"setRefreshToken",value:function(e){return this.UserApi.setRefreshToken(e)}},{key:"verifyUserToken",value:function(e){return this.UserApi.verifyUserToken(e)}},{key:"addUserToken",value:function(e){return this.UserApi.addUserToken(e)}},{key:"setDefaultToken",value:function(e){return this.UserApi.setDefaultToken(e)}},{key:"deleteUserToken",value:function(e){return this.UserApi.deleteUserToken(e)}},{key:"getGuestToken",value:function(){return this.UserApi.getGuestToken()}},{key:"resetPassword",value:function(e,t){return this.UserApi.resetPassword(e,t)}},{key:"getPublicUserProfile",value:function(e){return this.UserApi.getPublicUserProfile(e)}},{key:"addRedeemable",value:function(e){return this.UserApi.addRedeemable(e)}},{key:"isLoggedIn",get:function(){var e=void 0,t=void 0;if(!this.store.refreshToken)return!1;try{return e=(0,s.default)(this.store.refreshToken),t=1e3*e.exp,!(Date.now()-3e4>t)}catch(e){return!1}}}]),e}();t.default=a},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.vatomApi=t}return o(e,[{key:"getActions",value:function(e){return this.vatomApi.getActions(e)}},{key:"performAction",value:function(e,t,r){return r=r||{},r["this.id"]=e,this.vatomApi.performAction(t,r)}},{key:"getUserInventory",value:function(){var e={parent_id:".",page:1,limit:1e3};return this.vatomApi.getUserInventory(e)}},{key:"getUserVatoms",value:function(e){var t={ids:e};return this.vatomApi.getUserVatoms(t)}},{key:"geoDiscover",value:function(e,t,r){r=r||"vatoms";var n={bottom_left:{lat:e.lat,lon:e.lon},top_right:{lat:t.lat,lon:t.lon},filter:r};return this.vatomApi.geoDiscover(n)}},{key:"geoDiscoverGroups",value:function(e,t,r,n){n=n||"all";var o={bottom_left:{lat:e.lat,lon:e.lon},top_right:{lat:t.lat,lon:t.lon},precision:r,filter:n};return this.vatomApi.geoDiscoverGroups(o)}}]),e}();t.default=i},function(e,t,r){"use strict";(function(e){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function t(e){r(this,t),this.store=e,this.socketserver=this.store.websocketAddress}return n(t,[{key:"start",value:function(){var t=this;e.log("starting the web sockets....");var r=new WebSocket(this.socketserver);r.onopen=function(){var n={action:"login",appID:t.store.appID,token:"Bearer "+t.store.token};e.log(n),r.send(JSON.stringify(n))},r.onerror=function(t){e.log("WebSocket Error "+t)},r.onmessage=function(t){e.log("Server: "+t.data)}}},{key:"close",value:function(){this.connection.close()}}]),t}();t.default=o}).call(t,r(1))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=r(14),i=n(o),s=r(15),a=n(s);e.exports=i.default,e.exports.Discover=a.default},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(25),s=function(e){return e&&e.__esModule?e:{default:e}}(i),a=function(){function e(t,r){n(this,e),this.client=t,this.store=r}return o(e,[{key:"getAccessToken",value:function(){return this.store.token}},{key:"setAccessToken",value:function(e){this.store.token="",this.store.token=e}},{key:"getRefreshToken",value:function(){return this.store.refreshToken}},{key:"setRefreshToken",value:function(e){this.store.token="",this.store.refreshToken=e}},{key:"register",value:function(e){var t=this;return this.client.request("POST","/v1/users",e,!1).then(function(e){return t.store.token=e.access_token.token,t.store.refreshToken=e.refresh_token.token,e}).then(function(e){return new s.default(e)})}},{key:"login",value:function(e,t,r){var n=this,o={token:e,token_type:t,auth_data:{password:r}};return this.client.request("POST","/v1/user/login",o,!1).then(function(e){if(r)return n.store.token=e.access_token.token,n.store.refreshToken=e.refresh_token.token,n.store.assetProvider=e.asset_provider,n.store.userID=e.user.id,e;var t=new Error("Login Failed, Password Reset");throw t.code="PASSWORD_RESET",t}).then(function(e){return new s.default(e)})}},{key:"loginGuest",value:function(e){var t=this,r={token:e,token_type:"guest_id"};return this.client.request("POST","/v1/user/login",r,!1).then(function(e){return t.store.token=e.access_token.token,t.store.refreshToken=e.refresh_token.token,t.store.assetProvider=e.asset_provider,e}).then(function(e){return new s.default(e)})}},{key:"loginOAuth",value:function(e,t){}},{key:"uploadAvatar",value:function(e){var t={"Content-Type":"multipart/form-data"};this.client.request("POST","/v1/user/avatar",e,!0,t)}},{key:"getCurrentUser",value:function(e){return this.client.request("GET","/v1/user",e,!0).then(function(e){return e})}},{key:"updateUser",value:function(e){return this.client.request("PATCH","/v1/user",e,!0)}},{key:"getUserTokens",value:function(){return this.client.request("GET","/v1/user/tokens","",!0)}},{key:"verifyUserToken",value:function(e){return this.client.request("POST","/v1/user/verify_token",e,!0)}},{key:"resetPassword",value:function(e,t){var r={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token",r,!1)}},{key:"sendTokenVerification",value:function(e,t){var r={token:e,token_type:t};return this.client.request("POST","/v1/user/reset_token_verification",r,!1)}},{key:"getGuestToken",value:function(){return this.client.request("POST","/v1/user/guest","",!1).then(function(e){return e.properties.guest_id})}},{key:"logout",value:function(e){this.client.request("POST","/v1/user/logout",e,!0).then(function(){this.store.token="",this.store.refreshToken=""})}},{key:"extractHostname",value:function(e){var t;return t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t=t.split("?")[0]}},{key:"encodeAssetProvider",value:function(e){for(var t=this.store.assetProvider,r=t.length,n=this.extractHostname(e),o=0;o<r;o++){if(n===this.extractHostname(t[o].uri)){var i=0;for(var s in t[o].descriptor)e+=0===i?"?"+s+"="+t[o].descriptor[s]:"&"+s+"="+t[o].descriptor[s],i++}}return e}},{key:"addUserToken",value:function(e){return this.client.request("POST","/v1/user/tokens",e,!0)}},{key:"setDefaultToken",value:function(e){return this.client.request("PUT","/v1/user/tokens/"+e+"/default",null,!0)}},{key:"deleteUserToken",value:function(e){return this.client.request("DELETE","/v1/user/tokens/"+e,null,!0)}},{key:"addRedeemable",value:function(e){var t=this.store.userID;return this.client.request("POST","/v1/users/"+t+"/redeemables",e,!0)}},{key:"getPublicUserProfile",value:function(e){return this.client.request("GET","/v1/users/"+e,{},!0)}}]),e}();t.default=a},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.client=t}return o(e,[{key:"getActions",value:function(e){return this.client.request("GET","/v1/user/actions/"+e,{},!0).then(function(e){for(var t=e.length,r=[],n=0;n<t;n++){var o=e[n].name.split("::Action::");r.push({template_id:o[0],action:o[1]})}return r})}},{key:"performAction",value:function(e,t){return this.client.request("POST","/v1/user/vatom/action/"+e,t,!0).then(function(e){e.main.output})}},{key:"getUserInventory",value:function(e){return this.client.request("POST","/v1/user/vatom/inventory",e,!0).then(function(e){return e.vatoms})}},{key:"getUserVatoms",value:function(e){return this.client.request("POST","/v1/user/vatom/get",e,!0).then(function(e){return e})}},{key:"geoDiscover",value:function(e){return this.client.request("POST","/v1/vatom/geodiscover",e,!0).then(function(e){return e})}},{key:"geoDiscoverGroups",value:function(e){return this.client.request("POST","/v1/vatom/geodiscovergroups",e,!0).then(function(e){return e})}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,r,o,i){n(this,e),this.status=i,this.error=t,this.message=r,this.payload=o};t.default=o},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){n(this,e),this.prefix=t}return o(e,[{key:"server",get:function(){return this.serverAddress},set:function(e){this.serverAddress=e}},{key:"userID",set:function(e){this.USERID=e},get:function(){return this.USERID}},{key:"appID",get:function(){return this.APPID},set:function(e){this.APPID=e}},{key:"websocketAddress",get:function(){return this.wssocketAddress},set:function(e){this.wssocketAddress=e}},{key:"token",set:function(e){this.accessToken=e},get:function(){return this.accessToken}},{key:"refreshToken",set:function(e){localStorage.setItem(this.prefix+"_refresh",e)},get:function(){return localStorage.getItem(this.prefix+"_refresh")}},{key:"assetProvider",set:function(e){localStorage.setItem(this.prefix+"_asset_provider",JSON.stringify(e))},get:function(){return JSON.parse(localStorage.getItem(this.prefix+"_asset_provider")||"undefined")}}]),e}();t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t){n(this,e),this.id=t.user.id,this.firstName=t.user.properties.first_name,this.lastName=t.user.properties.last_name,this.avatarUri=t.user.properties.avatar_uri,this.birthday=t.user.properties.birthday,this.language=t.user.properties.language};t.default=o},function(e,t){function r(){return(new Date).getTime()}e.exports=r},function(e,t){function r(e){this.message=e}function n(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,a=0,u="";i=t.charAt(a++);~i&&(n=s%4?64*n+i:i,s++%4)?u+=String.fromCharCode(255&n>>(-2*s&6)):0)i=o.indexOf(i);return u}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.name="InvalidCharacterError",e.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||n},function(e,t,r){function n(e){return decodeURIComponent(o(e).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}var o=r(27);e.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return n(t)}catch(e){return o(t)}}},function(e,t,r){"use strict";function n(e,t){return void 0===t&&(t=n.BaseError),i(e,t)}var n,o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(30);!function(e){var t=function(e){function t(t,r){e.call(this,t),this.cause=r}return o(t,e),t.prototype.toString=function(){return e.prototype.toString.call(this)+(this.cause?"\nCaused by: "+this.cause.toString():"")},t}(i.BaseError);e.BaseError=t}(n||(n={})),e.exports=n},function(e,t,r){"use strict";function n(e){void 0!==e&&s(this,"message",{configurable:!0,value:e,writable:!0});var t=this.constructor.name;void 0!==t&&t!==this.name&&s(this,"name",{configurable:!0,value:t,writable:!0}),a(this,this.constructor)}function o(e,t){if(null==t||t===Error)t=n;else if("function"!=typeof t)throw new TypeError("super_ should be a function");var r;if("string"==typeof e)r=e,e=void 0!==i?function(){return i(t,arguments,this.constructor)}:function(){t.apply(this,arguments)},void 0!==u&&(u(e,r),r=void 0);else if("function"!=typeof e)throw new TypeError("constructor should be either a string or a function");e.super_=e.super=t;var o={constructor:{configurable:!0,value:e,writable:!0}};return void 0!==r&&(o.name={configurable:!0,value:r,writable:!0}),e.prototype=Object.create(t.prototype,o),e}var i="undefined"!=typeof Reflect?Reflect.construct:void 0,s=Object.defineProperty,a=Error.captureStackTrace;void 0===a&&(a=function(e){var t=new Error;s(e,"stack",{configurable:!0,get:function(){var e=t.stack;return s(this,"stack",{configurable:!0,value:e,writable:!0}),e},set:function(t){s(e,"stack",{configurable:!0,value:t,writable:!0})}})}),n.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:n,writable:!0}});var u=function(){function e(e,t){return s(e,"name",{configurable:!0,value:t})}try{var t=function(){};if(e(t,"foo"),"foo"===t.name)return e}catch(e){}}();t=e.exports=o,t.BaseError=n},function(e,t,r){"use strict";function n(e){return{use:c,abort:i,open:function(t){return o(t,e)}}}function o(e,t){return new Promise(function(r,n){function o(){return new Promise(function(e){return e(new a.Response({status:1223===l.status?204:l.status,statusText:l.statusText,rawHeaders:s(l.getAllResponseHeaders()),body:"text"===i?l.responseText:l.response,url:l.responseURL}))})}var i=t.type||"text",u=e.url,c=e.method;if("https:"===window.location.protocol&&/^http\:/.test(u))return n(e.error('The request to "'+u+'" was blocked',"EBLOCKED"));var l=e._raw=new XMLHttpRequest;l.onload=function(){return r(o())},l.onabort=function(){return r(o())},l.onerror=function(){return n(e.error('Unable to connect to "'+e.url+'"',"EUNAVAILABLE"))},l.onprogress=function(t){t.lengthComputable&&(e.downloadLength=t.total),e._setDownloadedBytes(t.loaded)},l.upload.onloadend=function(){return e.downloaded=1},"GET"!==c&&"HEAD"!==c&&l.upload?(l.upload.onprogress=function(t){t.lengthComputable&&(e.uploadLength=t.total),e._setUploadedBytes(t.loaded)},l.upload.onloadend=function(){return e.uploaded=1}):(e.uploadLength=0,e._setUploadedBytes(0,1));try{l.open(c,u)}catch(t){return n(e.error('Refused to connect to "'+u+'"',"ECSP",t))}if(t.withCredentials&&(l.withCredentials=!0),t.overrideMimeType&&l.overrideMimeType(t.overrideMimeType),"text"!==i)try{l.responseType=i}finally{if(l.responseType!==i)return n(e.error("Unsupported type: "+i,"ETYPE"))}for(var f=0;f<e.rawHeaders.length;f+=2)l.setRequestHeader(e.rawHeaders[f],e.rawHeaders[f+1]);l.send(e.body)})}function i(e){e._raw.abort()}function s(e){for(var t=[],r=e.split(/\r?\n/),n=0,o=r;n<o.length;n++){var i=o[n];if(i){var s=i.indexOf(":"),a=i.substr(0,s).trim(),u=i.substr(s+1).trim();t.push(a,u)}}return t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(11),u=r(9);t.createTransport=n;var c=[u.stringify(),u.headers()]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){throw new TypeError("Cookie jars are not available in browsers")}return e}();t.CookieJar=n},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function o(e){var t=f.createTransport({type:"text"}),r=Object.assign({},{transport:t},e);return function(e){var t=Object.assign({},r,"string"==typeof e?{url:e}:e);if("string"!=typeof t.url)throw new TypeError("The URL must be a string");return new s.Request(t)}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(3);t.FormData=i;var s=r(10),a=r(9);t.plugins=a;var u=r(8);t.form=u.default;var c=r(34);t.jar=c.default;var l=r(7);t.PopsicleError=l.default;var f=r(31);t.createTransport=f.createTransport,t.defaults=o,t.request=o({}),t.get=o({method:"get"}),t.post=o({method:"post"}),t.put=o({method:"put"}),t.patch=o({method:"patch"}),t.del=o({method:"delete"}),t.head=o({method:"head"}),n(r(2)),n(r(10)),n(r(11)),t.default=t.request},function(e,t,r){"use strict";function n(e){return new o.CookieJar(e)}Object.defineProperty(t,"__esModule",{value:!0});var o=r(32);t.default=n},function(e,t,r){"use strict";function n(e){return function(){return e}}function o(e,t){for(var r=Array.isArray(e)?e:[e],n=0,o=r;n<o.length;n++){var i=o[n];if("json"!==i&&"urlencoded"!==i)throw new TypeError("Unexpected parse type: "+i)}return function(e,n){return n().then(function(n){var o=n.body,i=n.type();if(null==o||""===o)return n.body=null,n;if(null==i)throw e.error("Unable to parse empty response content type","EPARSE");if("string"!=typeof o)throw e.error("Unable to parse non-string response body","EPARSE");for(var a=0,u=r;a<u.length;a++){var f=u[a];if("json"===f&&c.test(i)){try{n.body=JSON.parse(o.replace(h,""))}catch(t){throw e.error("Unable to parse response body: "+t.message,"EPARSE",t)}return n}if("urlencoded"===f&&l.test(i))return n.body=s.parse(o),n}if(!1!==t)throw e.error("Unhandled response type: "+i,"EPARSE");return n})}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),s=r(4),a=r(36),u=r(8),c=/^application\/(?:[\w!#\$%&\*`\-\.\^~]*\+)?json$/i,l=/^application\/x-www-form-urlencoded$/i,f=/^multipart\/form-data$/i,h=/^\)\]\}',?\n/;t.wrap=n,t.headers=n(function(e,t){return e.get("Accept")||e.set("Accept","*/*"),e.remove("Host"),t()}),t.stringify=n(function(e,t){var r=e.body;if(Object(r)!==r)return e.body=null==r?null:String(r),t();if(a.default(r))return t();var n=e.type();n||(n="application/json",e.type(n));try{c.test(n)?e.body=JSON.stringify(r):f.test(n)?e.body=u.default(r):l.test(n)&&(e.body=s.stringify(r))}catch(t){return Promise.reject(e.error("Unable to stringify request body: "+t.message,"ESTRINGIFY",t))}return e.body instanceof i&&e.remove("Content-Type"),t()}),t.parse=o},function(e,t,r){"use strict";function n(e){switch(Object.prototype.toString.call(e)){case"[object File]":case"[object Blob]":case"[object FormData]":case"[object ArrayBuffer]":return!0;default:return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function s(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&a())}function a(){if(!v){var e=o(s);v=!0;for(var t=d.length;t;){for(p=d,d=[];++y<t;)p&&p[y].run();y=-1,t=d.length}p=null,v=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var l,f,h=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{f="function"==typeof clearTimeout?clearTimeout:n}catch(e){f=n}}();var p,d=[],v=!1,y=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new u(e,t)),1!==d.length||v||o(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){(function(e,n){var o;!function(i){function s(e){throw new RangeError(q[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function u(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(S,"."),n+a(e.split("."),t).join(".")}function c(e){for(var t,r,n=[],o=0,i=e.length;o<i;)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<i?(r=e.charCodeAt(o++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--)):n.push(t);return n}function l(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=D(e>>>10&1023|55296),e=56320|1023&e),t+=D(e)}).join("")}function f(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:k}function h(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?C(e/_):e>>1,e+=C(e/t);e>I*T>>1;n+=k)e=C(e/I);return C(n+(I+1)*e/(e+A))}function d(e){var t,r,n,o,i,a,u,c,h,d,v=[],y=e.length,g=0,m=P,b=j;for(r=e.lastIndexOf(E),r<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&s("not-basic"),v.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<y;){for(i=g,a=1,u=k;o>=y&&s("invalid-input"),c=f(e.charCodeAt(o++)),(c>=k||c>C((w-g)/a))&&s("overflow"),g+=c*a,h=u<=b?O:u>=b+T?T:u-b,!(c<h);u+=k)d=k-h,a>C(w/d)&&s("overflow"),a*=d;t=v.length+1,b=p(g-i,t,0==i),C(g/t)>w-m&&s("overflow"),m+=C(g/t),g%=t,v.splice(g++,0,m)}return l(v)}function v(e){var t,r,n,o,i,a,u,l,f,d,v,y,g,m,b,A=[];for(e=c(e),y=e.length,t=P,r=0,i=j,a=0;a<y;++a)(v=e[a])<128&&A.push(D(v));for(n=o=A.length,o&&A.push(E);n<y;){for(u=w,a=0;a<y;++a)(v=e[a])>=t&&v<u&&(u=v);for(g=n+1,u-t>C((w-r)/g)&&s("overflow"),r+=(u-t)*g,t=u,a=0;a<y;++a)if(v=e[a],v<t&&++r>w&&s("overflow"),v==t){for(l=r,f=k;d=f<=i?O:f>=i+T?T:f-i,!(l<d);f+=k)b=l-d,m=k-d,A.push(D(h(d+b%m,0))),l=C(b/m);A.push(D(h(l,0))),i=p(r,g,n==o),r=0,++n}++r,++t}return A.join("")}function y(e){return u(e,function(e){return x.test(e)?d(e.slice(4).toLowerCase()):e})}function g(e){return u(e,function(e){return U.test(e)?"xn--"+v(e):e})}var m=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof n&&n);var b,w=2147483647,k=36,O=1,T=26,A=38,_=700,j=72,P=128,E="-",x=/^xn--/,U=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=k-O,C=Math.floor,D=String.fromCharCode;b={version:"1.4.1",ucs2:{decode:c,encode:l},decode:d,encode:v,toASCII:g,toUnicode:y},void 0!==(o=function(){return b}.call(t,r,t,e))&&(e.exports=o)}()}).call(t,r(45)(e),r(0))},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,i){t=t||"&",r=r||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var f,h,p,d,v=e[l].replace(a,"%20"),y=v.indexOf(r);y>=0?(f=v.substr(0,y),h=v.substr(y+1)):(f=v,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),n(s,p)?o(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?n(s(e),function(s){var a=encodeURIComponent(o(s))+r;return i(e[s])?n(e[s],function(e){return a+encodeURIComponent(o(e))}).join(t):a+encodeURIComponent(o(e[s]))}).join(t):a?encodeURIComponent(o(a))+r+encodeURIComponent(o(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(e,t,r){if(e&&c.isObject(e)&&e instanceof n)return e;var o=new n;return o.parse(e,t,r),o}function i(e){return c.isString(e)&&(e=o(e)),e instanceof n?e.format():n.prototype.format.call(e)}function s(e,t){return o(e,!1,!0).resolve(t)}function a(e,t){return e?o(e,!1,!0).resolveObject(t):t}var u=r(38),c=r(42);t.parse=o,t.resolve=s,t.resolveObject=a,t.format=i,t.Url=n;var l=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(p),v=["'"].concat(d),y=["%","/","?",";","#"].concat(v),g=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=r(4);n.prototype.parse=function(e,t,r){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),o=-1!==n&&n<e.indexOf("#")?"?":"#",i=e.split(o),s=/\\/g;i[0]=i[0].replace(s,"/"),e=i.join(o);var a=e;if(a=a.trim(),!r&&1===e.split("#").length){var f=h.exec(a);if(f)return this.path=a,this.href=a,this.pathname=f[1],f[2]?(this.search=f[2],this.query=t?T.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var p=l.exec(a);if(p){p=p[0];var d=p.toLowerCase();this.protocol=d,a=a.substr(p.length)}if(r||p||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var A="//"===a.substr(0,2);!A||p&&k[p]||(a=a.substr(2),this.slashes=!0)}if(!k[p]&&(A||p&&!O[p])){for(var _=-1,j=0;j<g.length;j++){var P=a.indexOf(g[j]);-1!==P&&(-1===_||P<_)&&(_=P)}var E,x;x=-1===_?a.lastIndexOf("@"):a.lastIndexOf("@",_),-1!==x&&(E=a.slice(0,x),a=a.slice(x+1),this.auth=decodeURIComponent(E)),_=-1;for(var j=0;j<y.length;j++){var P=a.indexOf(y[j]);-1!==P&&(-1===_||P<_)&&(_=P)}-1===_&&(_=a.length),this.host=a.slice(0,_),a=a.slice(_),this.parseHost(),this.hostname=this.hostname||"";var U="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!U)for(var S=this.hostname.split(/\./),j=0,q=S.length;j<q;j++){var I=S[j];if(I&&!I.match(m)){for(var C="",D=0,R=I.length;D<R;D++)I.charCodeAt(D)>127?C+="x":C+=I[D];if(!C.match(m)){var M=S.slice(0,j),B=S.slice(j+1),H=I.match(b);H&&(M.push(H[1]),B.unshift(H[2])),B.length&&(a="/"+B.join(".")+a),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=u.toASCII(this.hostname));var F=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+F,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!w[d])for(var j=0,q=v.length;j<q;j++){var L=v[j];if(-1!==a.indexOf(L)){var z=encodeURIComponent(L);z===L&&(z=escape(L)),a=a.split(L).join(z)}}var G=a.indexOf("#");-1!==G&&(this.hash=a.substr(G),a=a.slice(0,G));var V=a.indexOf("?");if(-1!==V?(this.search=a.substr(V),this.query=a.substr(V+1),t&&(this.query=T.parse(this.query)),a=a.slice(0,V)):t&&(this.search="",this.query={}),a&&(this.pathname=a),O[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",J=this.search||"";this.path=F+J}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(i=T.stringify(this.query));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||O[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+o+r+s+n},n.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(c.isString(e)){var t=new n;t.parse(e,!1,!0),e=t}for(var r=new n,o=Object.keys(this),i=0;i<o.length;i++){var s=o[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),u=0;u<a.length;u++){var l=a[u];"protocol"!==l&&(r[l]=e[l])}return O[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!O[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var p=f[h];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||k[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var v=r.pathname||"",y=r.search||"";r.path=v+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=m||g||r.host&&e.pathname,w=b,T=r.pathname&&r.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],A=r.protocol&&!O[r.protocol];if(A&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),b=b&&(""===d[0]||""===T[0])),m)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=e.search,r.query=e.query;else if(!c.isNullOrUndefined(e.search)){if(A){r.hostname=r.host=T.shift();var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return r.search=e.search,r.query=e.query,c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=T.slice(-1)[0],P=(r.host||e.host||T.length>1)&&("."===j||".."===j)||""===j,E=0,x=T.length;x>=0;x--)j=T[x],"."===j?T.splice(x,1):".."===j?(T.splice(x,1),E++):E&&(T.splice(x,1),E--);if(!b&&!w)for(;E--;E)T.unshift("..");!b||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),P&&"/"!==T.join("/").substr(-1)&&T.push("");var U=""===T[0]||T[0]&&"/"===T[0].charAt(0);if(A){r.hostname=r.host=U?"":T.length?T.shift():"";var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return b=b||r.host&&T.length,b&&!U&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=f.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}]);
//# sourceMappingURL=blockv-sdk.min.js.map

@@ -31,2 +31,6 @@ 'use strict';

var _WebSockets = require('./manager/WebSockets');
var _WebSockets2 = _interopRequireDefault(_WebSockets);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -56,10 +60,10 @@

this.store.appID = payload.appID;
this.store.server = payload.server;
this.store.websocketAddress = payload.websocketAddress;
this.store.server = payload.server || "https://api.blockv.io";
this.store.websocketAddress = payload.websocketAddress || "wss://ws.blockv.io";
this.client = new _Client2.default(this.store);
var client = new _Client2.default(this.store);
var userApi = new _UserApi2.default(this.client, this.store);
var vatomApi = new _VatomApi2.default(this.client);
var userApi = new _UserApi2.default(client, this.store);
var vatomApi = new _VatomApi2.default(client);
this.WebSockets = new _WebSockets2.default(this.store);
this.UserManager = new _UserManager2.default(userApi, this.store);

@@ -66,0 +70,0 @@ this.Vatoms = new _Vatoms2.default(vatomApi);

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -7,7 +7,3 @@ Object.defineProperty(exports, "__esModule", {

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
//
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); //
// BlockV AG. Copyright (c) 2018, all rights reserved.

@@ -24,2 +20,10 @@ //

var _jwtDecode = require('jwt-decode');
var _jwtDecode2 = _interopRequireDefault(_jwtDecode);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var UserManager = function () {

@@ -33,59 +37,155 @@ function UserManager(UserApi, store) {

/**
* Allows a user to be registered on the BlockV system.
* @param {String} firstName Users First Name
* @param {String} lastName Users Last Name
* @param {String} birthday Users Birthday, Format : YYYY-MM-DD
* @param {String} language The user's preferred language. Two letter language code according to ISO 639-1.
* @param {String} password A password for the user to login with
* @param {[Array]} tokens A list of user tokens to identify the user.
* At least one token is needed to register a user.
* [
* {
* token : "someone@blockv.org",
* token_type : "email"
* }
* ]
* @param {Bool} namePublic TRUE / FALSE
* @param {Bool} avatarPublic TRUE / FALSE
* @return {Promise<Object>} Returns a success Object containing users specific information.
*/
_createClass(UserManager, [{
key: "register",
key: 'register',
value: function register(firstName, lastName, birthday, language, password, tokens, namePublic, avatarPublic) {
return this.UserApi.register(new RegisterRequest(firstName, lastName, birthday, language, password, tokens, namePublic, avatarPublic));
}
/**
* An Alternate version of the register function, It contains an obect instead of inline parameters
* @param {Object} registration An Object containing all the information required to register a user.
* @return {Promise<Object>} returns a success Object containing user specific information
*/
}, {
key: "register",
key: 'register',
value: function register(registration) {
return this.UserApi.register(registration);
}
/**
* Allows the user to login to the platform
* @param {String} token Email / Phone Number of the user
* @param {String} tokenType Description of the token : ie. "phone_number" or "email"
* @param {String} password The password that the user has set
* @return {Promise<Object>} returns a object containing the information for the user that has logged in.
*/
}, {
key: "login",
key: 'login',
value: function login(token, tokenType, password) {
return this.UserApi.login(token, tokenType, password);
}
/**
* Login with an Account without registering. A unique login string is generated by the server.
* @param {String} guestId A String generated by the server used to login.
* A Guest account can be made into a registered account by patching
* @return {Promise<Object>} A Object that contains specific information about the guest user that was logged in.
*/
}, {
key: "loginGuest",
key: 'loginGuest',
value: function loginGuest(guestId) {
return this.UserApi.loginGuest(guestId);
}
/**
* Logs out the currently logged in user.
* @return {Promise<Object>} Logout success message
*/
}, {
key: "logout",
key: 'logout',
value: function logout() {
return this.UserApi.logout();
}
/**
* Gets information about the currently logged in user.
* @return {Promise<Object>} Contains the users information such as ID, Avatar, Name etc.
*/
}, {
key: "getCurrentUser",
key: 'getCurrentUser',
value: function getCurrentUser() {
return this.UserApi.getCurrentUser();
}
/**
* Returns a list of user tokens
* @return {Promise<Object>} An Object containing a list of Email Address's and Phone Number's for the user.
*/
}, {
key: "getCurrentUserTokens",
key: 'getCurrentUserTokens',
value: function getCurrentUserTokens() {
return this.UserApi.getUserTokens();
}
/**
* Allows the uploading of a new avatar for the user.
* @param {FormData} formData Uploads the FormData containing the new avatar for the user
* @return {Promise<Object>} An Object containing a upload success message
*/
}, {
key: "uploadAvatar",
key: 'uploadAvatar',
value: function uploadAvatar(formData) {
this.UserApi.uploadAvatar(formData);
}
/**
* Allows the user to be edited
* @param {Object} payload A payload containg the fields to be changed for the user. eg.{"first_name" : "John"}
* @return {Promise<Object>} returns a user Object containing the users info with the current changed fields.
*/
}, {
key: "updateUser",
key: 'updateUser',
value: function updateUser(payload) {
return this.UserApi.updateUser(payload);
}
/**
* Returns the Access Token
* @return {Promise<Object>} Returns a Object containing the Access Token String.
*/
}, {
key: "getAccessToken",
key: 'getAccessToken',
value: function getAccessToken() {
return this.UserApi.getAccessToken();
}
/**
* Automatically Encodes the Asset Provides URI's
* @param {String} url The URL that needs to be encoded
*/
}, {
key: "encodeAssetProvider",
key: 'encodeAssetProvider',
value: function encodeAssetProvider(url) {
return this.UserApi.encodeAssetProvider(url);
}
/**
* Sends a Verification Token to verify the token is valid
* @param {String} token Phone Number / Email Address
* @param {String} token_type Description of the Token above ie. "phone_number" / "email"
* @return {} An Email / SMS will be sent to the token with a verification code.
*/
}, {
key: "sendTokenVerification",
key: 'sendTokenVerification',
value: function sendTokenVerification(token, token_type) {

@@ -95,3 +195,3 @@ return this.UserApi.sendTokenVerification(token, token_type);

}, {
key: "getRefreshToken",
key: 'getRefreshToken',
value: function getRefreshToken() {

@@ -101,18 +201,51 @@ return this.UserApi.getRefreshToken();

}, {
key: "setRefreshToken",
key: 'setRefreshToken',
value: function setRefreshToken(token) {
return this.UserApi.setRefreshToken(token);
}
/**
* Verify a users Token
* @param {Object} verify An Object containing the token, token_type and the verification code.
* {"token" : "someone@blockv.org", "token_type" : "email", "verify_code" : "00000" }
* @return {Promise<Object>} An Object containing the outcome of the verification of the token.
*/
}, {
key: "verifyUserToken",
key: 'verifyUserToken',
value: function verifyUserToken(verify) {
return this.UserApi.verifyUserToken(verify);
}
/**
* Allows additional tokens to be added to the user
* @param {Object} payload An Object containing the tokens that need to be added to the users profile.
* @return {Promise<Object>} An Object with the updated user profile.
*/
}, {
key: "addUserToken",
key: 'addUserToken',
value: function addUserToken(payload) {
return this.UserApi.addUserToken(payload);
}
/**
* Sets the token to be the primary option
* @param {[type]} tokenID id of the token that needs to be set as the defualt
*/
}, {
key: "deleteUserToken",
key: 'setDefaultToken',
value: function setDefaultToken(tokenID) {
return this.UserApi.setDefaultToken(tokenID);
}
/**
* Removes a Token from the user's profile.
* @param {String} tokenId ID of the token that needs to be deleted
* @return {Promise<Object>} A Success / Faile object with the outcome of the deletion.
*/
}, {
key: 'deleteUserToken',
value: function deleteUserToken(tokenId) {

@@ -122,16 +255,67 @@ return this.UserApi.deleteUserToken(tokenId);

}, {
key: "getGuestToken",
key: 'getGuestToken',
value: function getGuestToken() {
return this.UserApi.getGuestToken();
}
/**
* Sends a verification token to the token that was supplied... NB! this will remove the current users password.
* @param {String} token The Token that needs to be reset (Phone Number / Email Address)
* @param {String} token_type Description of the Token to be reset
*/
}, {
key: "resetPassword",
key: 'resetPassword',
value: function resetPassword(token, token_type) {
return this.UserApi.resetPassword(token, token_type);
}
/**
* Returns a Public User Profile
* @param {String} userID Public User ID
* @return {Promise<Object>} Returns a Public User Object
*/
}, {
key: "addRedeemable",
key: 'getPublicUserProfile',
value: function getPublicUserProfile(userID) {
return this.UserApi.getPublicUserProfile(userID);
}
}, {
key: 'addRedeemable',
value: function addRedeemable(payload) {
return this.UserApi.addRedeemable(payload);
}
/**
* Checked to see if the refresh token is valid
* @return {Boolean} returns True / False if the refresh token is valid
*/
}, {
key: 'isLoggedIn',
get: function get() {
//define our vars
var decodedToken = void 0,
nowDate = void 0,
expirationTime = void 0,
refreshToken = void 0;
refreshToken = this.store.refreshToken;
// if no refreshToken
if (!refreshToken) return false;
try {
//decode token
decodedToken = (0, _jwtDecode2.default)(this.store.refreshToken);
expirationTime = decodedToken.exp * 1000;
nowDate = Date.now();
//quick calc to determine if the token has expired
if (nowDate - 30000 > expirationTime) return false;else return true;
} catch (e) {
//decoding fails
return false;
}
}
}]);

@@ -138,0 +322,0 @@

@@ -31,10 +31,22 @@ "use strict";

/**
* [performAction description]
* @param {String} vatomId id of the vatom to perform action
* @param {String} action can be either of the following : Drop, Pickup , Transfer , Require
* @param {Object} payload contains geo-coordianates or anything else sent along with vatomid
* @return {JSON} json payload nested
* Returns a list of actions that can be performed on a template
* @param {[String]} templateID Template ID is the vAtom template iD
* @return {[Promise<Object>]} returns a object containing a list of available actions
*/
_createClass(Vatoms, [{
key: "getActions",
value: function getActions(templateID) {
return this.vatomApi.getActions(templateID);
}
/**
* [performAction description]
* @param {String} vatomId id of the vatom to perform action
* @param {String} action can be either of the following : Drop, Pickup , Transfer , Require
* @param {Object} payload contains geo-coordianates or anything else sent along with vatomid
* @return {Promise<Object>} json payload nested
*/
}, {
key: "performAction",

@@ -50,2 +62,9 @@ value: function performAction(vatomId, action, payload) {

}
/**
* Gets the current users vAtom inventory
* @return {Promise<Object>} return a list of JSON Objects that contain the users inventory
* No parameters are required for this call
*/
}, {

@@ -62,2 +81,9 @@ key: "getUserInventory",

}
/**
* Gets a vAtom based on the vAtom ID
* @param {[String]} vatomId ID of the vAtom that is being searched for
* @return {[Promise<Object>} returns a JSON Object containing the vAtom.
*/
}, {

@@ -67,3 +93,3 @@ key: "getUserVatoms",

var payload = {
"ids": [vatomId]
"ids": vatomId
};

@@ -73,2 +99,59 @@

}
/**
* Gets a list of vAtoms based on the coordinates.
* @param {[Object]} bottomLeft containing a "lat" and "lon" coordinate
* @param {[Object]} topRight containing a "lat" and "lon" coordinate
* @param {[String]} filter defaults to "all"
* @return {[Promise<Object>} returns a list of vAtoms, faces and actions
*/
}, {
key: "geoDiscover",
value: function geoDiscover(bottomLeft, topRight, filter) {
filter = filter || "vatoms";
var payload = {
"bottom_left": {
"lat": bottomLeft.lat,
"lon": bottomLeft.lon
},
"top_right": {
"lat": topRight.lat,
"lon": topRight.lon
},
"filter": filter
};
return this.vatomApi.geoDiscover(payload);
}
/**
* Discover groups of vAtoms with Keys
* @param {Object} bottomLeft contains a lat and lon coordinate. Coordinate must be integers and not strings
* @param {Object} topRight contains a lat and lon coordinate. Coordinate must be integers and not strings
* @param {Integer} precision 1 - 12 defines the accuracy of the combination.
* @param {String} filter defaults to all
* @return {Promise<Object>} Returns a list of groups
*/
}, {
key: "geoDiscoverGroups",
value: function geoDiscoverGroups(bottomLeft, topRight, precision, filter) {
filter = filter || "all";
var payload = {
"bottom_left": {
"lat": bottomLeft.lat,
"lon": bottomLeft.lon
},
"top_right": {
"lat": topRight.lat,
"lon": topRight.lon
},
"precision": precision,
"filter": filter
};
return this.vatomApi.geoDiscoverGroups(payload);
}
}]);

@@ -75,0 +158,0 @@

@@ -7,5 +7,9 @@ "use strict";

var _Discover = require("./client/Discover");
var _Discover2 = _interopRequireDefault(_Discover);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = _Blockv2.default; //
//
// BlockV AG. Copyright (c) 2018, all rights reserved.

@@ -19,2 +23,4 @@ //

// governing permissions and limitations under the License.
//
//
module.exports = _Blockv2.default;
module.exports.Discover = _Discover2.default;

@@ -79,7 +79,12 @@ 'use strict';

var ErrorCodes = {
11: "Problem with payload",
2: 'Blank App ID',
11: 'Problem with payload',
17: 'invalid App ID',
401: 'Token has Expired',
516: 'Invalid Payload',
517: 'Invalid Payload',
521: 'Token Unavailable',
527: 'Invalid Date Format',
1004: 'Invalid Request Payload',
1701: 'vAtom Unrecognized',
2030: 'No user found, Please register an account first.',

@@ -89,7 +94,15 @@ 2031: 'Authentication Failed',

2034: 'Invalid Token',
2037: 'Upload Avatar Failed',
2049: 'Refresh Token Expired / Not Whitelisted',
2051: 'Too many login attempts, Please try again later.',
2552: 'Unable To Retrieve Token',
2553: 'Token ID Invalid',
2562: 'Cannot Delete Primary Token',
2563: 'Token Already Confirmed',
2564: 'Invalid Verification Code',
2569: 'Invalid Phone Number'
2566: 'Token Already Confirmed',
2567: 'Invalid Verification Code',
2569: 'Invalid Token Type',
2571: 'Invalid Email',
2572: 'Invalid Phone Number'
};

@@ -172,6 +185,3 @@

//quick calc to determine if the token has expired
//if ((nowDate - 30000) > expirationTime)
return this.refreshToken();
//else
// return Promise.resolve(true)
if (nowDate - 30000 > expirationTime) return this.refreshToken();else return Promise.resolve(true);
} catch (e) {

@@ -178,0 +188,0 @@ return this.refreshToken();

@@ -137,3 +137,2 @@ 'use strict';

console.log(data);
_this3.store.token = data.access_token.token;

@@ -188,3 +187,3 @@ _this3.store.refreshToken = data.refresh_token.token;

return this.client.request('GET', '/v1/user', payload, true).then(function (data) {
console.log(data);
return data;

@@ -305,3 +304,3 @@ });

this.client.request('POST', '/v1/user/logout', params, true).then(function () {
console.log('User has been logged out!');
this.store.token = '';

@@ -368,7 +367,26 @@ this.store.refreshToken = '';

}, {
key: 'setDefaultToken',
value: function setDefaultToken(tokenId) {
return this.client.request('PUT', '/v1/user/tokens/' + tokenId + '/default', null, true);
}
/**
* Deletes a Users Token
* @param {String} tokenId
* @return {Promise<Object>} returns a success
*/
}, {
key: 'deleteUserToken',
value: function deleteUserToken(tokenId) {
return this.cliet.request('DELETE', '/v1/user/tokens/' + tokenId, null, true);
return this.client.request('DELETE', '/v1/user/tokens/' + tokenId, null, true);
}
/**
* Adds a redeemable the users account
* @param {Object} payload Object containing the redeemable information
* @return {Promise<Object>} returns a Object containing the new redeemable
*/
}, {

@@ -380,2 +398,7 @@ key: 'addRedeemable',

}
}, {
key: 'getPublicUserProfile',
value: function getPublicUserProfile(userID) {
return this.client.request('GET', '/v1/users/' + userID, {}, true);
}
}]);

@@ -382,0 +405,0 @@

@@ -30,2 +30,20 @@ 'use strict';

_createClass(VatomApi, [{
key: 'getActions',
value: function getActions(templateID) {
return this.client.request('GET', '/v1/user/actions/' + templateID, {}, true).then(function (data) {
var len = data.length;
var actions = [];
for (var i = 0; i < len; i++) {
var action = data[i].name.split('::Action::');
actions.push({
"template_id": action[0],
"action": action[1]
});
}
return actions;
});
}
}, {
key: 'performAction',

@@ -52,2 +70,16 @@ value: function performAction(action, payload) {

}
}, {
key: 'geoDiscover',
value: function geoDiscover(payload) {
return this.client.request('POST', '/v1/vatom/geodiscover', payload, true).then(function (data) {
return data;
});
}
}, {
key: 'geoDiscoverGroups',
value: function geoDiscoverGroups(payload) {
return this.client.request('POST', '/v1/vatom/geodiscovergroups', payload, true).then(function (data) {
return data;
});
}
}]);

@@ -54,0 +86,0 @@

{
"name": "@blockv/sdk",
"version": "1.1.0",
"version": "1.2.0",
"description": "Allows web apps to display and interact with vatoms.",

@@ -9,2 +9,3 @@ "main": "lib/index.js",

"test": "npm run build",
"mocha": "mocha",
"build": "concurrently \"npm run build-min\" \"npm run build-lib\"",

@@ -54,3 +55,3 @@ "build-min": "webpack -p",

"lodash": "^4.17.4",
"mocha": "^5.0.4",
"mocha": "^5.2.0",
"popsicle": "^10.0.1"

@@ -57,0 +58,0 @@ },

@@ -305,2 +305,23 @@ # BLOCKv SDK for JavaScript

## vAtom Inventory
Retrieves a list of the current vAtoms in the users inventory
```javascript
bv.Vatoms.getUserInventory().then(data =>{
//do something with the returned inventory
}).catch(err => {
console.error(err.message);
})
```
## Discover
```javascript
let filter = new Blockv.Discover(bv);
filter.setScope("vAtom::vAtomType.owner", "$currentuser");
filter.appendFilter("vAtom::vAtomType.template", "vatomic::v1::vAtom::Avatar", "Match", "And");
filter.execute();
```
## Security Disclosure

@@ -307,0 +328,0 @@

@@ -17,3 +17,5 @@ //

import Client from '../internal/net/Client'
import WebSockets from './manager/WebSockets'
/**

@@ -29,13 +31,14 @@ * Created by LordCheddar on 2018/03/05.

this.store.appID = payload.appID;
this.store.server = payload.server;
this.store.websocketAddress = payload.websocketAddress;
this.store.server = payload.server || "https://api.blockv.io";
this.store.websocketAddress = payload.websocketAddress || "wss://ws.blockv.io";
this.client = new Client(this.store);
let userApi = new UserApi(this.client, this.store);
let vatomApi = new VatomApi(this.client);
let client = new Client(this.store);
let userApi = new UserApi(client, this.store);
let vatomApi = new VatomApi(client);
this.WebSockets = new WebSockets(this.store);
this.UserManager = new UserManager(userApi,this.store);
this.Vatoms = new Vatoms(vatomApi);
}

@@ -42,0 +45,0 @@

@@ -11,4 +11,4 @@ //

//
import jwt_decode from 'jwt-decode'
class UserManager {

@@ -21,2 +21,22 @@

/**
* Allows a user to be registered on the BlockV system.
* @param {String} firstName Users First Name
* @param {String} lastName Users Last Name
* @param {String} birthday Users Birthday, Format : YYYY-MM-DD
* @param {String} language The user's preferred language. Two letter language code according to ISO 639-1.
* @param {String} password A password for the user to login with
* @param {[Array]} tokens A list of user tokens to identify the user.
* At least one token is needed to register a user.
* [
* {
* token : "someone@blockv.org",
* token_type : "email"
* }
* ]
* @param {Bool} namePublic TRUE / FALSE
* @param {Bool} avatarPublic TRUE / FALSE
* @return {Promise<Object>} Returns a success Object containing users specific information.
*/
register(firstName,lastName, birthday, language, password, tokens, namePublic, avatarPublic){

@@ -26,2 +46,7 @@ return this.UserApi.register(new RegisterRequest(firstName,lastName, birthday, language, password, tokens, namePublic, avatarPublic));

/**
* An Alternate version of the register function, It contains an obect instead of inline parameters
* @param {Object} registration An Object containing all the information required to register a user.
* @return {Promise<Object>} returns a success Object containing user specific information
*/
register(registration){

@@ -31,2 +56,10 @@ return this.UserApi.register(registration);

/**
* Allows the user to login to the platform
* @param {String} token Email / Phone Number of the user
* @param {String} tokenType Description of the token : ie. "phone_number" or "email"
* @param {String} password The password that the user has set
* @return {Promise<Object>} returns a object containing the information for the user that has logged in.
*/
login(token, tokenType, password){

@@ -36,2 +69,8 @@ return this.UserApi.login(token, tokenType, password);

/**
* Login with an Account without registering. A unique login string is generated by the server.
* @param {String} guestId A String generated by the server used to login.
* A Guest account can be made into a registered account by patching
* @return {Promise<Object>} A Object that contains specific information about the guest user that was logged in.
*/
loginGuest(guestId){

@@ -41,2 +80,6 @@ return this.UserApi.loginGuest(guestId);

/**
* Logs out the currently logged in user.
* @return {Promise<Object>} Logout success message
*/
logout(){

@@ -46,2 +89,6 @@ return this.UserApi.logout();

/**
* Gets information about the currently logged in user.
* @return {Promise<Object>} Contains the users information such as ID, Avatar, Name etc.
*/
getCurrentUser(){

@@ -51,2 +98,6 @@ return this.UserApi.getCurrentUser();

/**
* Returns a list of user tokens
* @return {Promise<Object>} An Object containing a list of Email Address's and Phone Number's for the user.
*/
getCurrentUserTokens(){

@@ -56,2 +107,7 @@ return this.UserApi.getUserTokens();

/**
* Allows the uploading of a new avatar for the user.
* @param {FormData} formData Uploads the FormData containing the new avatar for the user
* @return {Promise<Object>} An Object containing a upload success message
*/
uploadAvatar(formData){

@@ -61,2 +117,7 @@ this.UserApi.uploadAvatar(formData);

/**
* Allows the user to be edited
* @param {Object} payload A payload containg the fields to be changed for the user. eg.{"first_name" : "John"}
* @return {Promise<Object>} returns a user Object containing the users info with the current changed fields.
*/
updateUser(payload){

@@ -66,2 +127,6 @@ return this.UserApi.updateUser(payload);

/**
* Returns the Access Token
* @return {Promise<Object>} Returns a Object containing the Access Token String.
*/
getAccessToken(){

@@ -71,3 +136,6 @@ return this.UserApi.getAccessToken();

/**
* Automatically Encodes the Asset Provides URI's
* @param {String} url The URL that needs to be encoded
*/
encodeAssetProvider(url){

@@ -77,2 +145,8 @@ return this.UserApi.encodeAssetProvider(url);

/**
* Sends a Verification Token to verify the token is valid
* @param {String} token Phone Number / Email Address
* @param {String} token_type Description of the Token above ie. "phone_number" / "email"
* @return {} An Email / SMS will be sent to the token with a verification code.
*/
sendTokenVerification(token, token_type){

@@ -82,2 +156,3 @@ return this.UserApi.sendTokenVerification(token, token_type);

getRefreshToken(){

@@ -91,2 +166,8 @@ return this.UserApi.getRefreshToken();

/**
* Verify a users Token
* @param {Object} verify An Object containing the token, token_type and the verification code.
* {"token" : "someone@blockv.org", "token_type" : "email", "verify_code" : "00000" }
* @return {Promise<Object>} An Object containing the outcome of the verification of the token.
*/
verifyUserToken(verify){

@@ -96,2 +177,7 @@ return this.UserApi.verifyUserToken(verify);

/**
* Allows additional tokens to be added to the user
* @param {Object} payload An Object containing the tokens that need to be added to the users profile.
* @return {Promise<Object>} An Object with the updated user profile.
*/
addUserToken(payload){

@@ -101,2 +187,15 @@ return this.UserApi.addUserToken(payload);

/**
* Sets the token to be the primary option
* @param {[type]} tokenID id of the token that needs to be set as the defualt
*/
setDefaultToken(tokenID){
return this.UserApi.setDefaultToken(tokenID);
}
/**
* Removes a Token from the user's profile.
* @param {String} tokenId ID of the token that needs to be deleted
* @return {Promise<Object>} A Success / Faile object with the outcome of the deletion.
*/
deleteUserToken(tokenId){

@@ -110,2 +209,7 @@ return this.UserApi.deleteUserToken(tokenId);

/**
* Sends a verification token to the token that was supplied... NB! this will remove the current users password.
* @param {String} token The Token that needs to be reset (Phone Number / Email Address)
* @param {String} token_type Description of the Token to be reset
*/
resetPassword(token, token_type){

@@ -115,2 +219,12 @@ return this.UserApi.resetPassword(token, token_type);

/**
* Returns a Public User Profile
* @param {String} userID Public User ID
* @return {Promise<Object>} Returns a Public User Object
*/
getPublicUserProfile(userID){
return this.UserApi.getPublicUserProfile(userID);
}
addRedeemable(payload){

@@ -120,6 +234,37 @@ return this.UserApi.addRedeemable(payload);

/**
* Checked to see if the refresh token is valid
* @return {Boolean} returns True / False if the refresh token is valid
*/
get isLoggedIn(){
//define our vars
let decodedToken, nowDate, expirationTime, refreshToken;
refreshToken = this.store.refreshToken;
// if no refreshToken
if(!refreshToken)
return false;
try{
//decode token
decodedToken = jwt_decode(this.store.refreshToken);
expirationTime = (decodedToken.exp * 1000);
nowDate = Date.now();
//quick calc to determine if the token has expired
if ((nowDate - 30000) > expirationTime)
return false
else
return true
}catch(e){
//decoding fails
return false
}
}
}
export default UserManager;

@@ -18,3 +18,15 @@ //

/**
* Returns a list of actions that can be performed on a template
* @param {[String]} templateID Template ID is the vAtom template iD
* @return {[Promise<Object>]} returns a object containing a list of available actions
*/
getActions(templateID){
return this.vatomApi.getActions(templateID)
}
/**
* [performAction description]

@@ -24,3 +36,3 @@ * @param {String} vatomId id of the vatom to perform action

* @param {Object} payload contains geo-coordianates or anything else sent along with vatomid
* @return {JSON} json payload nested
* @return {Promise<Object>} json payload nested
*/

@@ -40,2 +52,8 @@

/**
* Gets the current users vAtom inventory
* @return {Promise<Object>} return a list of JSON Objects that contain the users inventory
* No parameters are required for this call
*/
getUserInventory(){

@@ -53,8 +71,10 @@ let payload = {

/**
* Gets a vAtom based on the vAtom ID
* @param {[String]} vatomId ID of the vAtom that is being searched for
* @return {[Promise<Object>} returns a JSON Object containing the vAtom.
*/
getUserVatoms(vatomId){
let payload = {
"ids": [
vatomId
]
"ids": vatomId
}

@@ -65,5 +85,66 @@

/**
* Gets a list of vAtoms based on the coordinates.
* @param {[Object]} bottomLeft containing a "lat" and "lon" coordinate
* @param {[Object]} topRight containing a "lat" and "lon" coordinate
* @param {[String]} filter defaults to "all"
* @return {[Promise<Object>} returns a list of vAtoms, faces and actions
*/
geoDiscover(bottomLeft, topRight, filter){
filter = filter || "vatoms";
let payload = {
"bottom_left": {
"lat":bottomLeft.lat,
"lon": bottomLeft.lon
},
"top_right": {
"lat": topRight.lat,
"lon": topRight.lon
},
"filter": filter
}
return this.vatomApi.geoDiscover(payload);
}
/**
* Discover groups of vAtoms with Keys
* @param {Object} bottomLeft contains a lat and lon coordinate. Coordinate must be integers and not strings
* @param {Object} topRight contains a lat and lon coordinate. Coordinate must be integers and not strings
* @param {Integer} precision 1 - 12 defines the accuracy of the combination.
* @param {String} filter defaults to all
* @return {Promise<Object>} Returns a list of groups
*/
geoDiscoverGroups(bottomLeft, topRight, precision, filter){
filter = filter || "all";
let payload = {
"bottom_left" : {
"lat" : bottomLeft.lat,
"lon" : bottomLeft.lon
},
"top_right" : {
"lat" : topRight.lat,
"lon" : topRight.lon
},
"precision" : precision,
"filter" : filter
}
return this.vatomApi.geoDiscoverGroups(payload);
}
}
export default Vatoms;

@@ -12,3 +12,5 @@ //

import Blockv from "./client/Blockv"
import Discover from "./client/Discover"
module.exports = Blockv;
module.exports.Discover = Discover;

@@ -62,7 +62,12 @@ //

const ErrorCodes = {
11 : "Problem with payload",
2 : 'Blank App ID',
11 : 'Problem with payload',
17 : 'invalid App ID',
401: 'Token has Expired',
516: 'Invalid Payload',
517: 'Invalid Payload',
521: 'Token Unavailable',
527: 'Invalid Date Format',
1004: 'Invalid Request Payload',
1701: 'vAtom Unrecognized',
2030: 'No user found, Please register an account first.',

@@ -72,9 +77,18 @@ 2031: 'Authentication Failed',

2034: 'Invalid Token',
2037: 'Upload Avatar Failed',
2049: 'Refresh Token Expired / Not Whitelisted',
2051 : 'Too many login attempts, Please try again later.',
2552: 'Unable To Retrieve Token',
2553: 'Token ID Invalid',
2562: 'Cannot Delete Primary Token',
2563: 'Token Already Confirmed',
2564: 'Invalid Verification Code',
2569: 'Invalid Phone Number'
2566: 'Token Already Confirmed',
2567: 'Invalid Verification Code',
2569: 'Invalid Token Type',
2571: 'Invalid Email',
2572: 'Invalid Phone Number'
}
if(response.error === 2051){

@@ -160,6 +174,6 @@ // Check for the special login locked error

//quick calc to determine if the token has expired
//if ((nowDate - 30000) > expirationTime)
if ((nowDate - 30000) > expirationTime)
return this.refreshToken();
//else
// return Promise.resolve(true)
else
return Promise.resolve(true)
}catch(e){

@@ -166,0 +180,0 @@ return this.refreshToken();

@@ -119,3 +119,3 @@ //

console.log(data);
this.store.token = data.access_token.token;

@@ -173,3 +173,3 @@ this.store.refreshToken = data.refresh_token.token;

data => {
console.log(data);
return data;

@@ -282,3 +282,3 @@ });

this.client.request('POST', '/v1/user/logout', params, true).then(function(){
console.log('User has been logged out!');
this.store.token = '';

@@ -347,10 +347,23 @@ this.store.refreshToken = '';

setDefaultToken(tokenId){
return this.client.request('PUT', '/v1/user/tokens/'+tokenId+'/default', null, true);
}
/**
* Deletes a Users Token
* @param {String} tokenId
* @return {Promise<Object>} returns a success
*/
deleteUserToken(tokenId){
return this.cliet.request('DELETE', '/v1/user/tokens/'+tokenId, null, true);
return this.client.request('DELETE', '/v1/user/tokens/'+tokenId, null, true);
}
/**
* Adds a redeemable the users account
* @param {Object} payload Object containing the redeemable information
* @return {Promise<Object>} returns a Object containing the new redeemable
*/
addRedeemable(payload){

@@ -361,3 +374,7 @@ let U = this.store.userID;

getPublicUserProfile(userID){
return this.client.request('GET', '/v1/users/'+userID, {}, true);
}
}

@@ -18,3 +18,23 @@ //

getActions(templateID){
return this.client.request('GET', '/v1/user/actions/'+templateID, {}, true)
.then(data => {
let len = data.length;
let actions = [];
for (var i=0; i<len;i++){
let action = data[i].name.split('::Action::');
actions.push(
{
"template_id" : action[0],
"action" : action[1]
})
}
return actions;
})
}
performAction(action, payload){

@@ -30,3 +50,2 @@

getUserVatoms(payload){

@@ -36,5 +55,11 @@ return this.client.request('POST', '/v1/user/vatom/get', payload, true).then(data => data)

geoDiscover(payload){
return this.client.request('POST', '/v1/vatom/geodiscover', payload, true).then(data => data)
}
geoDiscoverGroups(payload){
return this.client.request('POST', '/v1/vatom/geodiscovergroups', payload, true).then(data => data);
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc