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.3.1 to 1.4.0

sample-app/package.json

2

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=17)}([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 s(e,t){return null==e?t:Array.isArray(e)?e.concat(t):[e,t]}Object.defineProperty(t,"__esModule",{value:!0});var i=r(42),a=r(2),u=r(9),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 i.format(this.Url)},set:function(e){this.Url=i.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=s(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=s(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(37),t.encode=t.stringify=r(38)},function(e,t,r){"use strict";function n(e){this.message=e}var o=r(27);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(28),s=function(e){function t(t,r,n,o){var s=e.call(this,t,n)||this;return s.name="PopsicleError",s.code=r,s.popsicle=o,s}return n(t,e),t}(o.BaseError);t.default=s},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(1);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(34))},function(e,t,r){"use strict";function n(e,t,r){var n=!1,o=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];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 s=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 i=r(0),a=r(9),u=r(4),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 s(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,s=n.slice();o<s.length;o++){var i=s[o];0===t.length?i.call(this):i.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}(i.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(0),s=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=s},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){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){"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 s=r(24),i=n(s),a=r(14),u=n(a),c=r(21),l=n(c),h=r(22),f=n(h),p=r(15),d=n(p),v=r(13),y=n(v),m=r(20),g=n(m),b=r(19),k=n(b),w=r(16),O=n(w),T=function e(t){o(this,e);var r=t.prefix||t.appID;this.store=new i.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 k.default(this.store);var n=new l.default(this.client,this.store),s=new f.default(this.client),a=new g.default(this.client);this.Activity=new y.default(a),this.WebSockets=new O.default(this.store,this.client),this.UserManager=new u.default(n,this.store),this.Vatoms=new d.default(s)};t.default=T},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}}(),s=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,value:r,filter_op:n||e.FilterOperation.Equal,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 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}}(),s=function(){function e(t){n(this,e),this.activityApi=t}return o(e,[{key:"myThreads",value:function(){return this.activityApi.threads()}},{key:"myThreadMessages",value:function(e){return this.activityApi.threadMessages(e)}},{key:"sendMessage",value:function(e,t){return this.activityApi.sendMessage(e,t)}}]),e}();t.default=s},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}}(),s=r(3),i=function(e){return e&&e.__esModule?e:{default:e}}(s),a=function(){function e(t,r){n(this,e),this.UserApi=t,this.store=r}return o(e,[{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){return 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,r=this.store.refreshToken;if(!r)return!1;try{return e=(0,i.default)(r),t=1e3*e.exp,Date.now()<t-3e4}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}}(),s=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||{})["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){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vatoms",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){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",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)}},{key:"deleteVatom",value:function(e){return this.vatomApi.deleteVatom(e)}}]),e}();t.default=s},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}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}}(),a=r(18),u=function(e){return e&&e.__esModule?e:{default:e}}(a),c=function(e){function t(e,r){n(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s.store=e,s.client=r,s.socket=null,s.isOpen=!1,s.delayTime=1e3,s}return s(t,e),i(t,[{key:"connect",value:function(){var e=this;return this.socket&&3!==this.socket.readyState?Promise.resolve(this):this.client.checkToken(this.store.accessToken).then(function(){var t=e.store.wssocketAddress+"/ws?app_id="+encodeURIComponent(e.store.appID)+"&token="+encodeURIComponent(e.store.token);return e.socket=new WebSocket(t),e.isOpen=!0,e.socket.addEventListener("open",e.handleConnected.bind(e)),e.socket.addEventListener("message",e.handleMessage.bind(e)),e.socket.addEventListener("close",e.handleClose.bind(e)),e}).catch(function(){return e.retryConnection()})}},{key:"handleMessage",value:function(e){var t=JSON.parse(e.data);"state_update"===t.msg_type&&this.trigger("stateUpdate",t),"inventory"===t.msg_type&&this.trigger("inventory",t),"my_events"===t.msg_type&&this.trigger("activity",t),"info"===t.msg_type&&this.trigger("info",t),t&&this.trigger("all",t)}},{key:"handleConnected",value:function(e){this.delayTime=1e3,this.trigger("connected",e)}},{key:"retryConnection",value:function(){var e=this;setTimeout(function(){e.isOpen&&3===e.socket.readyState&&e.connect()},this.delayTime),this.delayTime<8e3&&(this.delayTime*=2)}},{key:"handleClose",value:function(){this.retryConnection()}},{key:"close",value:function(){this.socket&&(this.isOpen=!1,this.socket.close(),this.socket=null)}}]),t}(u.default);t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=r(11),s=n(o),i=r(12),a=n(i);e.exports=s.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}}(),s=function(){function e(){n(this,e)}return o(e,[{key:"when",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.privateEventListeners=this.privateEventListeners||{},this.privateEventListeners[e]=this.privateEventListeners[e]||[],r?(this.privateEventListeners[e].push(r),null):new Promise(function(r){r.removeAfterCall=!0,t.privateEventListeners[e].push(r)})}},{key:"on",value:function(){return this.when.apply(this,arguments)}},{key:"addEventListener",value:function(){return this.when.apply(this,arguments)}},{key:"removeEventListener",value:function(e,t){this.privateEventListeners=this.privateEventListeners||{},this.privateEventListeners[e]=this.privateEventListeners[e]||[];for(var r=0;r<this.privateEventListeners[e];r+=1)this.privateEventListeners[e][r]===t&&(this.privateEventListeners[e].splice(r,1),r-=1)}},{key:"off",value:function(){return this.removeEventListener.apply(this,arguments)}},{key:"emit",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=this.privateEventListeners&&this.privateEventListeners[e]||[];o.forEach(function(e){e.apply(void 0,r)});for(var s=0;s<o.length;s+=1)o[s].removeAfterCall&&(o.splice(s,1),s-=1)}},{key:"trigger",value:function(){return this.emit.apply(this,arguments)}},{key:"triggerEvent",value:function(){return this.emit.apply(this,arguments)}}]),e}();t.default=s,s.mixin=function(e){for(var t in s.prototype)s.prototype.hasOwnProperty(t)&&(e[t]=s.prototype[t])}},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 s=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(32),a=r(3),u=n(a),c=r(23),l=n(c),h=function(){function e(t){o(this,e),this.store=t}return s(e,[{key:"request",value:function(e,t,r,n,o){var s=this;return n?this.checkToken().then(function(){return s.authRequest(e,t,r,o)}):this.authRequest(e,t,r,o)}},{key:"authRequest",value:function(e,t,r,n){var o=Object.assign({"App-Id":this.store.appID,Authorization:"Bearer "+this.store.token,"Content-Type":"application/json"},n);return(0,i.request)({method:e,url:this.store.server+t,body:r,headers:o}).use(i.plugins.parse("json")).then(function(e){var t=Object.assign(new l.default,e.body);return t.httpStatus=e.status,t}).then(function(e){if(!e.payload){var t={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===e.error){var r=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g.exec(e.message);e.lockedUntil=new Date(r);var n=e.lockedUntil.getTime()-Date.now();n<2e3&&(n=2e3);var o=Math.floor(n/1e3),s=Math.floor(n/1e3/60);o<=90?e.error=e.message.replace("%DURATION%",1===o?"1 second":o+" seconds"):e.message=e.message.replace("%DURATION%",1===s?"1 minute":s+" minutes");var i=new Error("Too many login attempts, Try again at : "+e.lockedUntil);throw i.code=e.error||0,i}var a=new Error(t[e.error]||"An unknown server error occurred.");throw a.code=e.error||e.httpStatus||0,a.httpStatus=e.httpStatus,a}return e.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=void 0,t=void 0,r=void 0,n=this.store.token;if("undefined"===n||""===n)return this.refreshToken(),!1;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()}}}]),e}();t.default=h},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}}(),s=function(){function e(t){n(this,e),this.client=t}return o(e,[{key:"threads",value:function(){return this.client.request("POST","/v1/activity/mythreads",{},!0).then(function(e){return e.threads})}},{key:"threadMessages",value:function(e){var t={name:e,cursor:"",count:100};return this.client.request("POST","/v1/activity/mythreadmessages",t,!0).then(function(e){return e})}},{key:"sendMessage",value:function(e,t){var r={message:t,id:e};return this.client.request("POST","/v1/user/message",r,!0).then(function(e){return e})}}]),e}();t.default=s},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 s=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(41),a=n(i),u=r(25),c=n(u),l=function(){function e(t,r){o(this,e),this.client=t,this.store=r}return s(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 c.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 c.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 c.default(e)})}},{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){var t=this;return this.client.request("POST","/v1/user/logout",e,!0).then(function(){t.store.token="",t.store.refreshToken=""})}},{key:"encodeAssetProvider",value:function(t){for(var r=this.store.assetProvider,n=r.length,o=(0,a.default)(t),s=0;s<n;s+=1){var i=(0,a.default)(r[s].uri);if(o.hostname===i.hostname){return t+"?"+e.mapString(r[s].descriptor)}}return t}},{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)}}],[{key:"mapString",value:function(e){Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")}}]),e}();t.default=l},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}}(),s=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;){var o=e[n].name.split("::Action::");r.push({template_id:o[0],action:o[1]}),n+=1}return r})}},{key:"performAction",value:function(e,t){return this.client.request("POST","/v1/user/vatom/action/"+e,t,!0).then(function(e){return 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})}},{key:"deleteVatom",value:function(e){var t={"this.id":e};return this.client.request("POST","/v1/user/vatom/trash",t,!0).then(function(e){return e})}}]),e}();t.default=s},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,s){n(this,e),this.status=s,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}}(),s=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){this.privateRefreshToken=e,"undefined"!=typeof localStorage&&localStorage.setItem(this.prefix+"_refresh",e)},get:function(){if(this.privateRefreshToken)return this.privateRefreshToken;if("undefined"!=typeof localStorage){var e=localStorage.getItem(this.prefix+"_refresh");if(e)return e}return null}},{key:"assetProvider",set:function(e){this.privateAssetProvider=e,"undefined"!=typeof localStorage&&localStorage.setItem(this.prefix+"_asset_provider",JSON.stringify(e))},get:function(){if(this.privateAssetProvider)return this.privateAssetProvider;if("undefined"!=typeof localStorage){var e=JSON.parse(localStorage.getItem(this.prefix+"_asset_provider")||"undefined");if(e)return e}return null}}]),e}();t.default=s},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(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,s,i=0,a=0,u="";s=t.charAt(a++);~s&&(n=i%4?64*n+s:s,i++%4)?u+=String.fromCharCode(255&n>>(-2*i&6)):0)s=o.indexOf(s);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(26);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),s(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)},s=r(29);!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}(s.BaseError);e.BaseError=t}(n||(n={})),e.exports=n},function(e,t,r){"use strict";function n(e){void 0!==e&&i(this,"message",{configurable:!0,value:e,writable:!0});var t=this.constructor.name;void 0!==t&&t!==this.name&&i(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!==s?function(){return s(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 s="undefined"!=typeof Reflect?Reflect.construct:void 0,i=Object.defineProperty,a=Error.captureStackTrace;void 0===a&&(a=function(e){var t=new Error;i(e,"stack",{configurable:!0,get:function(){var e=t.stack;return i(this,"stack",{configurable:!0,value:e,writable:!0}),e},set:function(t){i(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 i(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:s,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:i(l.getAllResponseHeaders()),body:"text"===s?l.responseText:l.response,url:l.responseURL}))})}var s=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"!==s)try{l.responseType=s}finally{if(l.responseType!==s)return n(e.error("Unsupported type: "+s,"ETYPE"))}for(var h=0;h<e.rawHeaders.length;h+=2)l.setRequestHeader(e.rawHeaders[h],e.rawHeaders[h+1]);l.send(e.body)})}function s(e){e._raw.abort()}function i(e){for(var t=[],r=e.split(/\r?\n/),n=0,o=r;n<o.length;n++){var s=o[n];if(s){var i=s.indexOf(":"),a=s.substr(0,i).trim(),u=s.substr(i+1).trim();t.push(a,u)}}return t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(8),u=r(6);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=h.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 i.Request(t)}}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1);t.FormData=s;var i=r(7),a=r(6);t.plugins=a;var u=r(5);t.form=u.default;var c=r(33);t.jar=c.default;var l=r(4);t.PopsicleError=l.default;var h=r(30);t.createTransport=h.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(0)),n(r(7)),n(r(8)),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(31);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 s=o[n];if("json"!==s&&"urlencoded"!==s)throw new TypeError("Unexpected parse type: "+s)}return function(e,n){return n().then(function(n){var o=n.body,s=n.type();if(null==o||""===o)return n.body=null,n;if(null==s)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 h=u[a];if("json"===h&&c.test(s)){try{n.body=JSON.parse(o.replace(f,""))}catch(t){throw e.error("Unable to parse response body: "+t.message,"EPARSE",t)}return n}if("urlencoded"===h&&l.test(s))return n.body=i.parse(o),n}if(!1!==t)throw e.error("Unhandled response type: "+s,"EPARSE");return n})}}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),i=r(2),a=r(35),u=r(5),c=/^application\/(?:[\w!#\$%&\*`\-\.\^~]*\+)?json$/i,l=/^application\/x-www-form-urlencoded$/i,h=/^multipart\/form-data$/i,f=/^\)\]\}',?\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):h.test(n)?e.body=u.default(r):l.test(n)&&(e.body=i.stringify(r))}catch(t){return Promise.reject(e.error("Unable to stringify request body: "+t.message,"ESTRINGIFY",t))}return e.body instanceof s&&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,r){(function(e,n){var o;!function(s){function i(e){throw new RangeError(C[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(x,"."),n+a(e.split("."),t).join(".")}function c(e){for(var t,r,n=[],o=0,s=e.length;o<s;)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<s?(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+=R(e>>>10&1023|55296),e=56320|1023&e),t+=R(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:w}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?I(e/P):e>>1,e+=I(e/t);e>S*T>>1;n+=w)e=I(e/S);return I(n+(S+1)*e/(e+_))}function d(e){var t,r,n,o,s,a,u,c,f,d,v=[],y=e.length,m=0,g=j,b=A;for(r=e.lastIndexOf(E),r<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&i("not-basic"),v.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<y;){for(s=m,a=1,u=w;o>=y&&i("invalid-input"),c=h(e.charCodeAt(o++)),(c>=w||c>I((k-m)/a))&&i("overflow"),m+=c*a,f=u<=b?O:u>=b+T?T:u-b,!(c<f);u+=w)d=w-f,a>I(k/d)&&i("overflow"),a*=d;t=v.length+1,b=p(m-s,t,0==s),I(m/t)>k-g&&i("overflow"),g+=I(m/t),m%=t,v.splice(m++,0,g)}return l(v)}function v(e){var t,r,n,o,s,a,u,l,h,d,v,y,m,g,b,_=[];for(e=c(e),y=e.length,t=j,r=0,s=A,a=0;a<y;++a)(v=e[a])<128&&_.push(R(v));for(n=o=_.length,o&&_.push(E);n<y;){for(u=k,a=0;a<y;++a)(v=e[a])>=t&&v<u&&(u=v);for(m=n+1,u-t>I((k-r)/m)&&i("overflow"),r+=(u-t)*m,t=u,a=0;a<y;++a)if(v=e[a],v<t&&++r>k&&i("overflow"),v==t){for(l=r,h=w;d=h<=s?O:h>=s+T?T:h-s,!(l<d);h+=w)b=l-d,g=w-d,_.push(R(f(d+b%g,0))),l=I(b/g);_.push(R(f(l,0))),s=p(r,m,n==o),r=0,++n}++r,++t}return _.join("")}function y(e){return u(e,function(e){return U.test(e)?d(e.slice(4).toLowerCase()):e})}function m(e){return u(e,function(e){return q.test(e)?"xn--"+v(e):e})}var g=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof n&&n);var b,k=2147483647,w=36,O=1,T=26,_=38,P=700,A=72,j=128,E="-",U=/^xn--/,q=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=w-O,I=Math.floor,R=String.fromCharCode;b={version:"1.4.1",ucs2:{decode:c,encode:l},decode:d,encode:v,toASCII:m,toUnicode:y},void 0!==(o=function(){return b}.call(t,r,t,e))&&(e.exports=o)}()}).call(t,r(44)(e),r(10))},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,s){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var u=1e3;s&&"number"==typeof s.maxKeys&&(u=s.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var h,f,p,d,v=e[l].replace(a,"%20"),y=v.indexOf(r);y>=0?(h=v.substr(0,y),f=v.substr(y+1)):(h=v,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),n(i,p)?o(i[p])?i[p].push(d):i[p]=[i[p],d]:i[p]=d}return i};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(i(e),function(i){var a=encodeURIComponent(o(i))+r;return s(e[i])?n(e[i],function(e){return a+encodeURIComponent(o(e))}).join(t):a+encodeURIComponent(o(e[i]))}).join(t):a?encodeURIComponent(o(a))+r+encodeURIComponent(o(e)):""};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=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(e){return decodeURIComponent(e.replace(/\+/g," "))}function o(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);){var s=n(t[1]),i=n(t[2]);s in o||(o[s]=i)}return o}function s(e,t){t=t||"";var r=[];"string"!=typeof t&&(t="?");for(var n in e)i.call(e,n)&&r.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return r.length?t+r.join("&"):""}var i=Object.prototype.hasOwnProperty;t.stringify=s,t.parse=o},function(e,t,r){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,r){"use strict";(function(t){function n(e){var r=t&&t.location||{};e=e||r;var n,o={},s=typeof e;if("blob:"===e.protocol)o=new i(unescape(e.pathname),{});else if("string"===s){o=new i(e,{});for(n in d)delete o[n]}else if("object"===s){for(n in e)n in d||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=f.test(e.href))}return o}function o(e){var t=h.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,i=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),i++):i&&(0===n&&(s=!0),r.splice(n,1),i--);return s&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var a,u,h,f,d,v,y=p.slice(),m=typeof t,g=this,b=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=l.parse),t=n(t),u=o(e||""),a=!u.protocol&&!u.slashes,g.slashes=u.slashes||a&&t.slashes,g.protocol=u.protocol||t.protocol||"",e=u.rest,u.slashes||(y[2]=[/(.*)/,"pathname"]);b<y.length;b++)f=y[b],h=f[0],v=f[1],h!==h?g[v]=e:"string"==typeof h?~(d=e.indexOf(h))&&("number"==typeof f[2]?(g[v]=e.slice(0,d),e=e.slice(d+f[2])):(g[v]=e.slice(d),e=e.slice(0,d))):(d=h.exec(e))&&(g[v]=d[1],e=e.slice(0,d.index)),g[v]=g[v]||(a&&f[3]?t[v]||"":""),f[4]&&(g[v]=g[v].toLowerCase());r&&(g.query=r(g.query)),a&&t.slashes&&"/"!==g.pathname.charAt(0)&&(""!==g.pathname||""!==t.pathname)&&(g.pathname=s(g.pathname,t.pathname)),c(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(f=g.auth.split(":"),g.username=f[0]||"",g.password=f[1]||""),g.origin=g.protocol&&g.host&&"file:"!==g.protocol?g.protocol+"//"+g.host:"null",g.href=g.toString()}function a(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||l.parse)(t)),n[e]=t;break;case"port":n[e]=t,c(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var o="pathname"===e?"/":"#";n[e]=t.charAt(0)!==o?o+t:t}else n[e]=t;break;default:n[e]=t}for(var s=0;s<p.length;s++){var i=p[s];i[4]&&(n[i[1]]=n[i[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function u(e){e&&"function"==typeof e||(e=l.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var o=n+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,t="object"==typeof r.query?e(r.query):r.query,t&&(o+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(o+=r.hash),o}var c=r(40),l=r(39),h=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,f=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,p=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};i.prototype={set:a,toString:u},i.extractProtocol=o,i.location=n,i.qs=l,e.exports=i}).call(t,r(10))},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 s(e){return c.isString(e)&&(e=o(e)),e instanceof n?e.format():n.prototype.format.call(e)}function i(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(36),c=r(43);t.parse=o,t.resolve=i,t.resolveObject=a,t.format=s,t.Url=n;var l=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(p),v=["'"].concat(d),y=["%","/","?",";","#"].concat(v),m=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,k={javascript:!0,"javascript:":!0},w={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(2);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("#")?"?":"#",s=e.split(o),i=/\\/g;s[0]=s[0].replace(i,"/"),e=s.join(o);var a=e;if(a=a.trim(),!r&&1===e.split("#").length){var h=f.exec(a);if(h)return this.path=a,this.href=a,this.pathname=h[1],h[2]?(this.search=h[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.substr(0,2);!_||p&&w[p]||(a=a.substr(2),this.slashes=!0)}if(!w[p]&&(_||p&&!O[p])){for(var P=-1,A=0;A<m.length;A++){var j=a.indexOf(m[A]);-1!==j&&(-1===P||j<P)&&(P=j)}var E,U;U=-1===P?a.lastIndexOf("@"):a.lastIndexOf("@",P),-1!==U&&(E=a.slice(0,U),a=a.slice(U+1),this.auth=decodeURIComponent(E)),P=-1;for(var A=0;A<y.length;A++){var j=a.indexOf(y[A]);-1!==j&&(-1===P||j<P)&&(P=j)}-1===P&&(P=a.length),this.host=a.slice(0,P),a=a.slice(P),this.parseHost(),this.hostname=this.hostname||"";var q="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!q)for(var x=this.hostname.split(/\./),A=0,C=x.length;A<C;A++){var S=x[A];if(S&&!S.match(g)){for(var I="",R=0,M=S.length;R<M;R++)S.charCodeAt(R)>127?I+="x":I+=S[R];if(!I.match(g)){var L=x.slice(0,A),D=x.slice(A+1),H=S.match(b);H&&(L.push(H[1]),D.unshift(H[2])),D.length&&(a="/"+D.join(".")+a),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=u.toASCII(this.hostname));var B=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+B,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!k[d])for(var A=0,C=v.length;A<C;A++){var N=v[A];if(-1!==a.indexOf(N)){var G=encodeURIComponent(N);G===N&&(G=escape(N)),a=a.split(N).join(G)}}var V=a.indexOf("#");-1!==V&&(this.hash=a.substr(V),a=a.slice(0,V));var $=a.indexOf("?");if(-1!==$?(this.search=a.substr($),this.query=a.substr($+1),t&&(this.query=T.parse(this.query)),a=a.slice(0,$)):t&&(this.search="",this.query={}),a&&(this.pathname=a),O[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var B=this.pathname||"",z=this.search||"";this.path=B+z}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,s="";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&&(s=T.stringify(this.query));var i=this.search||s&&"?"+s||"";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),i&&"?"!==i.charAt(0)&&(i="?"+i),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),i=i.replace("#","%23"),t+o+r+i+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),s=0;s<o.length;s++){var i=o[s];r[i]=this[i]}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 h=Object.keys(e),f=0;f<h.length;f++){var p=h[f];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||w[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 m=r.pathname&&"/"===r.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=g||m||r.host&&e.pathname,k=b,T=r.pathname&&r.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],_=r.protocol&&!O[r.protocol];if(_&&(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])),g)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(_){r.hostname=r.host=T.shift();var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.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],j=(r.host||e.host||T.length>1)&&("."===A||".."===A)||""===A,E=0,U=T.length;U>=0;U--)A=T[U],"."===A?T.splice(U,1):".."===A?(T.splice(U,1),E++):E&&(T.splice(U,1),E--);if(!b&&!k)for(;E--;E)T.unshift("..");!b||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),j&&"/"!==T.join("/").substr(-1)&&T.push("");var q=""===T[0]||T[0]&&"/"===T[0].charAt(0);if(_){r.hostname=r.host=q?"":T.length?T.shift():"";var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&T.length,b&&!q&&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=h.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){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}}]);
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=17)}([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 s(e,t){return null==e?t:Array.isArray(e)?e.concat(t):[e,t]}Object.defineProperty(t,"__esModule",{value:!0});var i=r(42),a=r(2),u=r(9),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 i.format(this.Url)},set:function(e){this.Url=i.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=s(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=s(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(37),t.encode=t.stringify=r(38)},function(e,t,r){"use strict";function n(e){this.message=e}var o=r(27);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(28),s=function(e){function t(t,r,n,o){var s=e.call(this,t,n)||this;return s.name="PopsicleError",s.code=r,s.popsicle=o,s}return n(t,e),t}(o.BaseError);t.default=s},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(1);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(34))},function(e,t,r){"use strict";function n(e,t,r){var n=!1,o=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];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 s=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 i=r(0),a=r(9),u=r(4),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 s(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,s=n.slice();o<s.length;o++){var i=s[o];0===t.length?i.call(this):i.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}(i.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(0),s=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=s},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){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){"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 s=r(24),i=n(s),a=r(14),u=n(a),c=r(21),l=n(c),h=r(22),f=n(h),p=r(15),d=n(p),v=r(13),y=n(v),m=r(20),g=n(m),b=r(19),k=n(b),w=r(16),O=n(w),T=function e(t){o(this,e);var r=t.prefix||t.appID;this.store=new i.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 k.default(this.store);var n=new l.default(this.client,this.store),s=new f.default(this.client),a=new g.default(this.client);this.Activity=new y.default(a),this.WebSockets=new O.default(this.store,this.client),this.UserManager=new u.default(n,this.store),this.Vatoms=new d.default(s)};t.default=T},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}}(),s=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,value:r,filter_op:n||e.FilterOperation.Equal,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 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}}(),s=function(){function e(t){n(this,e),this.activityApi=t}return o(e,[{key:"myThreads",value:function(){return this.activityApi.threads()}},{key:"myThreadMessages",value:function(e){return this.activityApi.threadMessages(e)}},{key:"sendMessage",value:function(e,t){return this.activityApi.sendMessage(e,t)}}]),e}();t.default=s},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}}(),s=r(3),i=function(e){return e&&e.__esModule?e:{default:e}}(s),a=function(){function e(t,r){n(this,e),this.UserApi=t,this.store=r}return o(e,[{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){return 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,r=this.store.refreshToken;if(!r)return!1;try{return e=(0,i.default)(r),t=1e3*e.exp,Date.now()<t-3e4}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}}(),s=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||{})["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){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vatoms",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){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",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)}},{key:"deleteVatom",value:function(e){return this.vatomApi.deleteVatom(e)}}]),e}();t.default=s},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}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}}(),a=r(18),u=function(e){return e&&e.__esModule?e:{default:e}}(a),c=function(e){function t(e,r){n(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s.store=e,s.client=r,s.socket=null,s.isOpen=!1,s.delayTime=1e3,s}return s(t,e),i(t,[{key:"connect",value:function(){var e=this;return this.socket&&3!==this.socket.readyState?Promise.resolve(this):this.client.checkToken(this.store.accessToken).then(function(){var t=e.store.wssocketAddress+"/ws?app_id="+encodeURIComponent(e.store.appID)+"&token="+encodeURIComponent(e.store.token);return e.socket=new WebSocket(t),e.isOpen=!0,e.socket.addEventListener("open",e.handleConnected.bind(e)),e.socket.addEventListener("message",e.handleMessage.bind(e)),e.socket.addEventListener("close",e.handleClose.bind(e)),e}).catch(function(){return e.retryConnection()})}},{key:"handleMessage",value:function(e){var t=JSON.parse(e.data);"state_update"===t.msg_type&&this.trigger("stateUpdate",t),"inventory"===t.msg_type&&this.trigger("inventory",t),"my_events"===t.msg_type&&this.trigger("activity",t),"info"===t.msg_type&&this.trigger("info",t),t&&this.trigger("all",t)}},{key:"handleConnected",value:function(e){this.delayTime=1e3,this.trigger("connected",e)}},{key:"retryConnection",value:function(){var e=this;setTimeout(function(){e.isOpen&&3===e.socket.readyState&&e.connect()},this.delayTime),this.delayTime<8e3&&(this.delayTime*=2)}},{key:"handleClose",value:function(){this.retryConnection()}},{key:"close",value:function(){this.socket&&(this.isOpen=!1,this.socket.close(),this.socket=null)}}]),t}(u.default);t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=r(11),s=n(o),i=r(12),a=n(i);e.exports=s.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}}(),s=function(){function e(){n(this,e)}return o(e,[{key:"when",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.privateEventListeners=this.privateEventListeners||{},this.privateEventListeners[e]=this.privateEventListeners[e]||[],r?(this.privateEventListeners[e].push(r),null):new Promise(function(r){r.removeAfterCall=!0,t.privateEventListeners[e].push(r)})}},{key:"on",value:function(){return this.when.apply(this,arguments)}},{key:"addEventListener",value:function(){return this.when.apply(this,arguments)}},{key:"removeEventListener",value:function(e,t){this.privateEventListeners=this.privateEventListeners||{},this.privateEventListeners[e]=this.privateEventListeners[e]||[];for(var r=0;r<this.privateEventListeners[e];r+=1)this.privateEventListeners[e][r]===t&&(this.privateEventListeners[e].splice(r,1),r-=1)}},{key:"off",value:function(){return this.removeEventListener.apply(this,arguments)}},{key:"emit",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=this.privateEventListeners&&this.privateEventListeners[e]||[];o.forEach(function(e){e.apply(void 0,r)});for(var s=0;s<o.length;s+=1)o[s].removeAfterCall&&(o.splice(s,1),s-=1)}},{key:"trigger",value:function(){return this.emit.apply(this,arguments)}},{key:"triggerEvent",value:function(){return this.emit.apply(this,arguments)}}]),e}();t.default=s,s.mixin=function(e){for(var t in s.prototype)s.prototype.hasOwnProperty(t)&&(e[t]=s.prototype[t])}},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 s=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(32),a=r(3),u=n(a),c=r(23),l=n(c),h=function(){function e(t){o(this,e),this.store=t}return s(e,[{key:"request",value:function(e,t,r,n,o){var s=this;return n?this.checkToken().then(function(){return s.authRequest(e,t,r,o)}):this.authRequest(e,t,r,o)}},{key:"authRequest",value:function(e,t,r,n){var o=Object.assign({"App-Id":this.store.appID,Authorization:"Bearer "+this.store.token,"Content-Type":"application/json"},n);return(0,i.request)({method:e,url:this.store.server+t,body:r,headers:o}).use(i.plugins.parse("json")).then(function(e){var t=Object.assign(new l.default,e.body);return t.httpStatus=e.status,t}).then(function(e){if(!e.payload){var t={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===e.error){var r=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g.exec(e.message);e.lockedUntil=new Date(r);var n=e.lockedUntil.getTime()-Date.now();n<2e3&&(n=2e3);var o=Math.floor(n/1e3),s=Math.floor(n/1e3/60);o<=90?e.error=e.message.replace("%DURATION%",1===o?"1 second":o+" seconds"):e.message=e.message.replace("%DURATION%",1===s?"1 minute":s+" minutes");var i=new Error("Too many login attempts, Try again at : "+e.lockedUntil);throw i.code=e.error||0,i}var a=new Error(t[e.error]||"An unknown server error occurred.");throw a.code=e.error||e.httpStatus||0,a.httpStatus=e.httpStatus,a}return e.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=void 0,t=void 0,r=void 0,n=this.store.token;if("undefined"===n||""===n)return this.refreshToken(),!1;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()}}}]),e}();t.default=h},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}}(),s=function(){function e(t){n(this,e),this.client=t}return o(e,[{key:"threads",value:function(){return this.client.request("POST","/v1/activity/mythreads",{},!0).then(function(e){return e.threads})}},{key:"threadMessages",value:function(e){var t={name:e,cursor:"",count:100};return this.client.request("POST","/v1/activity/mythreadmessages",t,!0).then(function(e){return e})}},{key:"sendMessage",value:function(e,t){var r={message:t,id:e};return this.client.request("POST","/v1/user/message",r,!0).then(function(e){return e})}}]),e}();t.default=s},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 s=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(41),a=n(i),u=r(25),c=n(u),l=function(){function e(t,r){o(this,e),this.client=t,this.store=r}return s(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 c.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 c.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 c.default(e)})}},{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 new c.default(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){var t=this;return this.client.request("POST","/v1/user/logout",e,!0).then(function(){t.store.token="",t.store.refreshToken=""})}},{key:"encodeAssetProvider",value:function(t){for(var r=this.store.assetProvider,n=r.length,o=(0,a.default)(t),s=0;s<n;s+=1){var i=(0,a.default)(r[s].uri);if(o.hostname===i.hostname){return t+"?"+e.mapString(r[s].descriptor)}}return t}},{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)}}],[{key:"mapString",value:function(e){return Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")}}]),e}();t.default=l},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}}(),s=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;){var o=e[n].name.split("::Action::");r.push({template_id:o[0],action:o[1]}),n+=1}return r})}},{key:"performAction",value:function(e,t){return this.client.request("POST","/v1/user/vatom/action/"+e,t,!0).then(function(e){return e.main.output})}},{key:"getUserInventory",value:function(e){return this.client.request("POST","/v1/user/vatom/inventory",e,!0).then(function(e){return e})}},{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})}},{key:"deleteVatom",value:function(e){var t={"this.id":e};return this.client.request("POST","/v1/user/vatom/trash",t,!0).then(function(e){return e})}}]),e}();t.default=s},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,s){n(this,e),this.status=s,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}}(),s=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){this.privateRefreshToken=e,"undefined"!=typeof localStorage&&localStorage.setItem(this.prefix+"_refresh",e)},get:function(){if(this.privateRefreshToken)return this.privateRefreshToken;if("undefined"!=typeof localStorage){var e=localStorage.getItem(this.prefix+"_refresh");if(e)return e}return null}},{key:"assetProvider",set:function(e){this.privateAssetProvider=e,"undefined"!=typeof localStorage&&localStorage.setItem(this.prefix+"_asset_provider",JSON.stringify(e))},get:function(){if(this.privateAssetProvider)return this.privateAssetProvider;if("undefined"!=typeof localStorage){var e=JSON.parse(localStorage.getItem(this.prefix+"_asset_provider")||"undefined");if(e)return e}return null}}]),e}();t.default=s},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.namePublic=t.user.properties.name_public,this.avatarUri=t.user.properties.avatar_uri,this.avatarPublic=t.user.properties.avatar_public,this.birthday=t.user.properties.birthday,this.language=t.user.properties.language,this.nonPushNotification=t.user.properties.nonpush_notification};t.default=o},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,s,i=0,a=0,u="";s=t.charAt(a++);~s&&(n=i%4?64*n+s:s,i++%4)?u+=String.fromCharCode(255&n>>(-2*i&6)):0)s=o.indexOf(s);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(26);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),s(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)},s=r(29);!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}(s.BaseError);e.BaseError=t}(n||(n={})),e.exports=n},function(e,t,r){"use strict";function n(e){void 0!==e&&i(this,"message",{configurable:!0,value:e,writable:!0});var t=this.constructor.name;void 0!==t&&t!==this.name&&i(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!==s?function(){return s(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 s="undefined"!=typeof Reflect?Reflect.construct:void 0,i=Object.defineProperty,a=Error.captureStackTrace;void 0===a&&(a=function(e){var t=new Error;i(e,"stack",{configurable:!0,get:function(){var e=t.stack;return i(this,"stack",{configurable:!0,value:e,writable:!0}),e},set:function(t){i(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 i(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:s,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:i(l.getAllResponseHeaders()),body:"text"===s?l.responseText:l.response,url:l.responseURL}))})}var s=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"!==s)try{l.responseType=s}finally{if(l.responseType!==s)return n(e.error("Unsupported type: "+s,"ETYPE"))}for(var h=0;h<e.rawHeaders.length;h+=2)l.setRequestHeader(e.rawHeaders[h],e.rawHeaders[h+1]);l.send(e.body)})}function s(e){e._raw.abort()}function i(e){for(var t=[],r=e.split(/\r?\n/),n=0,o=r;n<o.length;n++){var s=o[n];if(s){var i=s.indexOf(":"),a=s.substr(0,i).trim(),u=s.substr(i+1).trim();t.push(a,u)}}return t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(8),u=r(6);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=h.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 i.Request(t)}}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1);t.FormData=s;var i=r(7),a=r(6);t.plugins=a;var u=r(5);t.form=u.default;var c=r(33);t.jar=c.default;var l=r(4);t.PopsicleError=l.default;var h=r(30);t.createTransport=h.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(0)),n(r(7)),n(r(8)),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(31);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 s=o[n];if("json"!==s&&"urlencoded"!==s)throw new TypeError("Unexpected parse type: "+s)}return function(e,n){return n().then(function(n){var o=n.body,s=n.type();if(null==o||""===o)return n.body=null,n;if(null==s)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 h=u[a];if("json"===h&&c.test(s)){try{n.body=JSON.parse(o.replace(f,""))}catch(t){throw e.error("Unable to parse response body: "+t.message,"EPARSE",t)}return n}if("urlencoded"===h&&l.test(s))return n.body=i.parse(o),n}if(!1!==t)throw e.error("Unhandled response type: "+s,"EPARSE");return n})}}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),i=r(2),a=r(35),u=r(5),c=/^application\/(?:[\w!#\$%&\*`\-\.\^~]*\+)?json$/i,l=/^application\/x-www-form-urlencoded$/i,h=/^multipart\/form-data$/i,f=/^\)\]\}',?\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):h.test(n)?e.body=u.default(r):l.test(n)&&(e.body=i.stringify(r))}catch(t){return Promise.reject(e.error("Unable to stringify request body: "+t.message,"ESTRINGIFY",t))}return e.body instanceof s&&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,r){(function(e,n){var o;!function(s){function i(e){throw new RangeError(C[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(x,"."),n+a(e.split("."),t).join(".")}function c(e){for(var t,r,n=[],o=0,s=e.length;o<s;)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<s?(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+=R(e>>>10&1023|55296),e=56320|1023&e),t+=R(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:w}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?I(e/P):e>>1,e+=I(e/t);e>S*T>>1;n+=w)e=I(e/S);return I(n+(S+1)*e/(e+_))}function d(e){var t,r,n,o,s,a,u,c,f,d,v=[],y=e.length,m=0,g=j,b=A;for(r=e.lastIndexOf(E),r<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&i("not-basic"),v.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<y;){for(s=m,a=1,u=w;o>=y&&i("invalid-input"),c=h(e.charCodeAt(o++)),(c>=w||c>I((k-m)/a))&&i("overflow"),m+=c*a,f=u<=b?O:u>=b+T?T:u-b,!(c<f);u+=w)d=w-f,a>I(k/d)&&i("overflow"),a*=d;t=v.length+1,b=p(m-s,t,0==s),I(m/t)>k-g&&i("overflow"),g+=I(m/t),m%=t,v.splice(m++,0,g)}return l(v)}function v(e){var t,r,n,o,s,a,u,l,h,d,v,y,m,g,b,_=[];for(e=c(e),y=e.length,t=j,r=0,s=A,a=0;a<y;++a)(v=e[a])<128&&_.push(R(v));for(n=o=_.length,o&&_.push(E);n<y;){for(u=k,a=0;a<y;++a)(v=e[a])>=t&&v<u&&(u=v);for(m=n+1,u-t>I((k-r)/m)&&i("overflow"),r+=(u-t)*m,t=u,a=0;a<y;++a)if(v=e[a],v<t&&++r>k&&i("overflow"),v==t){for(l=r,h=w;d=h<=s?O:h>=s+T?T:h-s,!(l<d);h+=w)b=l-d,g=w-d,_.push(R(f(d+b%g,0))),l=I(b/g);_.push(R(f(l,0))),s=p(r,m,n==o),r=0,++n}++r,++t}return _.join("")}function y(e){return u(e,function(e){return U.test(e)?d(e.slice(4).toLowerCase()):e})}function m(e){return u(e,function(e){return q.test(e)?"xn--"+v(e):e})}var g=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof n&&n);var b,k=2147483647,w=36,O=1,T=26,_=38,P=700,A=72,j=128,E="-",U=/^xn--/,q=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=w-O,I=Math.floor,R=String.fromCharCode;b={version:"1.4.1",ucs2:{decode:c,encode:l},decode:d,encode:v,toASCII:m,toUnicode:y},void 0!==(o=function(){return b}.call(t,r,t,e))&&(e.exports=o)}()}).call(t,r(44)(e),r(10))},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,s){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var u=1e3;s&&"number"==typeof s.maxKeys&&(u=s.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var h,f,p,d,v=e[l].replace(a,"%20"),y=v.indexOf(r);y>=0?(h=v.substr(0,y),f=v.substr(y+1)):(h=v,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),n(i,p)?o(i[p])?i[p].push(d):i[p]=[i[p],d]:i[p]=d}return i};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(i(e),function(i){var a=encodeURIComponent(o(i))+r;return s(e[i])?n(e[i],function(e){return a+encodeURIComponent(o(e))}).join(t):a+encodeURIComponent(o(e[i]))}).join(t):a?encodeURIComponent(o(a))+r+encodeURIComponent(o(e)):""};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=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(e){return decodeURIComponent(e.replace(/\+/g," "))}function o(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);){var s=n(t[1]),i=n(t[2]);s in o||(o[s]=i)}return o}function s(e,t){t=t||"";var r=[];"string"!=typeof t&&(t="?");for(var n in e)i.call(e,n)&&r.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return r.length?t+r.join("&"):""}var i=Object.prototype.hasOwnProperty;t.stringify=s,t.parse=o},function(e,t,r){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,r){"use strict";(function(t){function n(e){var r=t&&t.location||{};e=e||r;var n,o={},s=typeof e;if("blob:"===e.protocol)o=new i(unescape(e.pathname),{});else if("string"===s){o=new i(e,{});for(n in d)delete o[n]}else if("object"===s){for(n in e)n in d||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=f.test(e.href))}return o}function o(e){var t=h.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function s(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,i=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),i++):i&&(0===n&&(s=!0),r.splice(n,1),i--);return s&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var a,u,h,f,d,v,y=p.slice(),m=typeof t,g=this,b=0;for("object"!==m&&"string"!==m&&(r=t,t=null),r&&"function"!=typeof r&&(r=l.parse),t=n(t),u=o(e||""),a=!u.protocol&&!u.slashes,g.slashes=u.slashes||a&&t.slashes,g.protocol=u.protocol||t.protocol||"",e=u.rest,u.slashes||(y[2]=[/(.*)/,"pathname"]);b<y.length;b++)f=y[b],h=f[0],v=f[1],h!==h?g[v]=e:"string"==typeof h?~(d=e.indexOf(h))&&("number"==typeof f[2]?(g[v]=e.slice(0,d),e=e.slice(d+f[2])):(g[v]=e.slice(d),e=e.slice(0,d))):(d=h.exec(e))&&(g[v]=d[1],e=e.slice(0,d.index)),g[v]=g[v]||(a&&f[3]?t[v]||"":""),f[4]&&(g[v]=g[v].toLowerCase());r&&(g.query=r(g.query)),a&&t.slashes&&"/"!==g.pathname.charAt(0)&&(""!==g.pathname||""!==t.pathname)&&(g.pathname=s(g.pathname,t.pathname)),c(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(f=g.auth.split(":"),g.username=f[0]||"",g.password=f[1]||""),g.origin=g.protocol&&g.host&&"file:"!==g.protocol?g.protocol+"//"+g.host:"null",g.href=g.toString()}function a(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||l.parse)(t)),n[e]=t;break;case"port":n[e]=t,c(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var o="pathname"===e?"/":"#";n[e]=t.charAt(0)!==o?o+t:t}else n[e]=t;break;default:n[e]=t}for(var s=0;s<p.length;s++){var i=p[s];i[4]&&(n[i[1]]=n[i[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function u(e){e&&"function"==typeof e||(e=l.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var o=n+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,t="object"==typeof r.query?e(r.query):r.query,t&&(o+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(o+=r.hash),o}var c=r(40),l=r(39),h=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,f=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,p=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};i.prototype={set:a,toString:u},i.extractProtocol=o,i.location=n,i.qs=l,e.exports=i}).call(t,r(10))},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 s(e){return c.isString(e)&&(e=o(e)),e instanceof n?e.format():n.prototype.format.call(e)}function i(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(36),c=r(43);t.parse=o,t.resolve=i,t.resolveObject=a,t.format=s,t.Url=n;var l=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(p),v=["'"].concat(d),y=["%","/","?",";","#"].concat(v),m=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,k={javascript:!0,"javascript:":!0},w={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(2);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("#")?"?":"#",s=e.split(o),i=/\\/g;s[0]=s[0].replace(i,"/"),e=s.join(o);var a=e;if(a=a.trim(),!r&&1===e.split("#").length){var h=f.exec(a);if(h)return this.path=a,this.href=a,this.pathname=h[1],h[2]?(this.search=h[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.substr(0,2);!_||p&&w[p]||(a=a.substr(2),this.slashes=!0)}if(!w[p]&&(_||p&&!O[p])){for(var P=-1,A=0;A<m.length;A++){var j=a.indexOf(m[A]);-1!==j&&(-1===P||j<P)&&(P=j)}var E,U;U=-1===P?a.lastIndexOf("@"):a.lastIndexOf("@",P),-1!==U&&(E=a.slice(0,U),a=a.slice(U+1),this.auth=decodeURIComponent(E)),P=-1;for(var A=0;A<y.length;A++){var j=a.indexOf(y[A]);-1!==j&&(-1===P||j<P)&&(P=j)}-1===P&&(P=a.length),this.host=a.slice(0,P),a=a.slice(P),this.parseHost(),this.hostname=this.hostname||"";var q="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!q)for(var x=this.hostname.split(/\./),A=0,C=x.length;A<C;A++){var S=x[A];if(S&&!S.match(g)){for(var I="",R=0,M=S.length;R<M;R++)S.charCodeAt(R)>127?I+="x":I+=S[R];if(!I.match(g)){var L=x.slice(0,A),D=x.slice(A+1),H=S.match(b);H&&(L.push(H[1]),D.unshift(H[2])),D.length&&(a="/"+D.join(".")+a),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=u.toASCII(this.hostname));var N=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+N,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!k[d])for(var A=0,C=v.length;A<C;A++){var F=v[A];if(-1!==a.indexOf(F)){var G=encodeURIComponent(F);G===F&&(G=escape(F)),a=a.split(F).join(G)}}var V=a.indexOf("#");-1!==V&&(this.hash=a.substr(V),a=a.slice(0,V));var $=a.indexOf("?");if(-1!==$?(this.search=a.substr($),this.query=a.substr($+1),t&&(this.query=T.parse(this.query)),a=a.slice(0,$)):t&&(this.search="",this.query={}),a&&(this.pathname=a),O[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var N=this.pathname||"",z=this.search||"";this.path=N+z}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,s="";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&&(s=T.stringify(this.query));var i=this.search||s&&"?"+s||"";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),i&&"?"!==i.charAt(0)&&(i="?"+i),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),i=i.replace("#","%23"),t+o+r+i+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),s=0;s<o.length;s++){var i=o[s];r[i]=this[i]}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 h=Object.keys(e),f=0;f<h.length;f++){var p=h[f];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||w[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 m=r.pathname&&"/"===r.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=g||m||r.host&&e.pathname,k=b,T=r.pathname&&r.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],_=r.protocol&&!O[r.protocol];if(_&&(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])),g)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(_){r.hostname=r.host=T.shift();var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.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],j=(r.host||e.host||T.length>1)&&("."===A||".."===A)||""===A,E=0,U=T.length;U>=0;U--)A=T[U],"."===A?T.splice(U,1):".."===A?(T.splice(U,1),E++):E&&(T.splice(U,1),E--);if(!b&&!k)for(;E--;E)T.unshift("..");!b||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),j&&"/"!==T.join("/").substr(-1)&&T.push("");var q=""===T[0]||T[0]&&"/"===T[0].charAt(0);if(_){r.hostname=r.host=q?"":T.length?T.shift():"";var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&T.length,b&&!q&&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=h.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){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

@@ -170,3 +170,3 @@ 'use strict';

return this.client.request('GET', '/v1/user', payload, true).then(function (data) {
return data;
return new _User2.default(data);
});

@@ -286,3 +286,2 @@ }

var compare = (0, _urlParse2.default)(url);
for (var i = 0; i < aPlen; i += 1) {

@@ -350,3 +349,3 @@ var comparethis = (0, _urlParse2.default)(aP[i].uri);

value: function mapString(o) {
Object.keys(o).map(function (key) {
return Object.keys(o).map(function (key) {
return key + '=' + o[key];

@@ -353,0 +352,0 @@ }).join('&');

@@ -57,3 +57,3 @@ 'use strict';

return this.client.request('POST', '/v1/user/vatom/inventory', payload, true).then(function (data) {
return data.vatoms;
return data;
});

@@ -60,0 +60,0 @@ }

@@ -25,7 +25,10 @@ "use strict";

this.lastName = userData.user.properties.last_name;
this.namePublic = userData.user.properties.name_public;
this.avatarUri = userData.user.properties.avatar_uri;
this.avatarPublic = userData.user.properties.avatar_public;
this.birthday = userData.user.properties.birthday;
this.language = userData.user.properties.language;
this.nonPushNotification = userData.user.properties.nonpush_notification;
};
exports.default = User;
{
"name": "@blockv/sdk",
"version": "1.3.1",
"version": "1.4.0",
"description": "Allows web apps to display and interact with vatoms.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -301,7 +301,10 @@ # BLOCKv SDK for JavaScript (Beta)

Retrieves a list of the current vAtoms in the users inventory
Retrieves a list of the current vAtoms, actions and faces in the users inventory
```javascript
bv.Vatoms.getUserInventory().then(data =>{
//do something with the returned inventory
// do something with the returned inventory
// data.vatoms (array of vatoms)
// data.faces (array of faces)
// data.actions (array of actions)
}).catch(err => {

@@ -308,0 +311,0 @@ console.error(err.message);

@@ -134,3 +134,3 @@ //

// get the current authenticated in user
return this.client.request('GET', '/v1/user', payload, true).then(data => data);
return this.client.request('GET', '/v1/user', payload, true).then(data => new User(data));
}

@@ -222,3 +222,3 @@

static mapString(o) {
Object.keys(o).map(key => `${key}=${o[key]}`).join('&');
return Object.keys(o).map(key => `${key}=${o[key]}`).join('&');
}

@@ -230,3 +230,2 @@

const compare = urlParse(url);
for (let i = 0; i < aPlen; i += 1) {

@@ -233,0 +232,0 @@ const comparethis = urlParse(aP[i].uri);

@@ -41,3 +41,3 @@ //

getUserInventory(payload) {
return this.client.request('POST', '/v1/user/vatom/inventory', payload, true).then(data => data.vatoms);
return this.client.request('POST', '/v1/user/vatom/inventory', payload, true).then(data => data);
}

@@ -44,0 +44,0 @@

@@ -16,6 +16,9 @@ //

this.lastName = userData.user.properties.last_name;
this.namePublic = userData.user.properties.name_public;
this.avatarUri = userData.user.properties.avatar_uri;
this.avatarPublic = userData.user.properties.avatar_public;
this.birthday = userData.user.properties.birthday;
this.language = userData.user.properties.language;
this.nonPushNotification = userData.user.properties.nonpush_notification;
}
}

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