@voidwalkers/void-client
Advanced tools
Comparing version 0.1.15 to 0.1.16
/*! For license information please see index.browser.js.LICENSE.txt */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ololoepepe/api-wrapper"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","axios"],t):"object"==typeof exports?exports.voidClient=t(require("@ololoepepe/api-wrapper"),require("axios")):e.voidClient=t(e["@ololoepepe/api-wrapper"],e.axios)}(self,((e,t)=>(()=>{var n={187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=undefined,i.prototype._eventsCount=0,i.prototype._maxListeners=undefined;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return e._maxListeners===undefined?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a,c;if(u(n),(i=e._events)===undefined?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==undefined&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),a===undefined)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:undefined,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(r===undefined)return[];var o=r[t];return o===undefined?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(t!==undefined){var n=t[e];if("function"==typeof n)return 1;if(n!==undefined)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){this._events!==undefined&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||undefined},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(i!==undefined)o=o&&i.error===undefined;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[e];if(s===undefined)return!1;if("function"==typeof s)r(s,this,t);else{var c=s.length,l=d(s,c);for(n=0;n<c;++n)r(l[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(u(t),(r=this._events)===undefined)return this;if((n=r[e])===undefined)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),r.removeListener!==undefined&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if((n=this._events)===undefined)return this;if(n.removeListener===undefined)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):n[e]!==undefined&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t!==undefined)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},22:t=>{"use strict";t.exports=e},300:e=>{"use strict";e.exports=t},61:(e,t,n)=>{var r=n(698)["default"];function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports["default"]=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new D(r||[]);return u(i,"_invoke",{value:L(e,n,a)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var v="suspendedStart",y="suspendedYield",w="executing",b="completed",m={};function g(){}function k(){}function x(){}var O={};p(O,c,(function(){return this}));var j=Object.getPrototypeOf,S=j&&j(j(R([])));S&&S!==i&&a.call(S,c)&&(O=S);var E=x.prototype=g.prototype=Object.create(O);function _(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function W(e,t){function n(o,i,u,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,u,s)}),(function(e){n("throw",e,u,s)})):t.resolve(f).then((function(e){l.value=e,u(l)}),(function(e){return n("throw",e,u,s)}))}s(c.arg)}var o;u(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function L(e,n,r){var o=v;return function(i,a){if(o===w)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var s=M(u,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=w;var c=d(e,n,r);if("normal"===c.type){if(o=r.done?b:y,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=b,r.method="throw",r.arg=c.arg)}}}function M(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator["return"]&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function R(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return k.prototype=x,u(E,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:k,configurable:!0}),k.displayName=p(x,f,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===k||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,p(e,f,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},_(W.prototype),p(W.prototype,l,(function(){return this})),n.AsyncIterator=W,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new W(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(E),p(E,f,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function o(){for(;n.length;){var e=n.pop();if(e in t)return o.value=e,o.done=!1,o}return o.done=!0,o}},n.values=R,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},n}e.exports=o,e.exports.__esModule=!0,e.exports["default"]=e.exports},698:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports["default"]=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports["default"]=e.exports},687:(e,t,n)=>{var r=n(61)();e.exports=r;try{regeneratorRuntime=r}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={};function o(e){var t=r[e];if(t!==undefined)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}o.r(i),o.d(i,{StorageDriver:()=>s,StorageDriverLocalStorage:()=>x,VoidClient:()=>Xt});var u,s=function(){function t(){e(this,t)}return a(t,[{key:"load",value:function(){throw new Error("[StorageDriver.load] Method not implemented")}},{key:"save",value:function(){throw new Error("[StorageDriver.save] Method not implemented")}}],[{key:"StorageKey",get:function(){return{CurrentUser:"current_user",Session:"session"}}}]),t}();function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function p(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function v(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,d(e,t,"get"))}function y(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,d(e,t,"set"),n),n}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function b(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function m(e,t,n){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),n}var g=new WeakMap,k=new WeakMap,x=function(t){f(r,t);var n=w(r);function r(){var t,o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=o.prefix,a=void 0===i?"void":i,u=o.storageType,s=void 0===u?r.StorageType.LocalStorage:u;return e(this,r),b(c(t=n.call(this)),g,{writable:!0,value:null}),b(c(t),k,{writable:!0,value:null}),y(c(t),g,a),y(c(t),k,m(r,r,O).call(r,s)),t}return a(r,[{key:"load",value:function(e){var t=v(this,k).getItem("".concat(v(this,g),"/").concat(e));return null===t?null:JSON.parse(t)}},{key:"save",value:function(e,t){v(this,k).setItem("".concat(v(this,g),"/").concat(e),JSON.stringify(t))}}],[{key:"StorageType",get:function(){return{LocalStorage:"localStorage",SessionStorage:"sessionStorage"}}}]),r}(s);function O(e){switch(e){case u.StorageType.LocalStorage:return window.localStorage;case u.StorageType.SessionStorage:return window.sessionStorage;default:return null}}u=x;var j=o(22);function S(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,o)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){E(i,r,o,a,u,"next",e)}function u(e){E(i,r,o,a,u,"throw",e)}a(undefined)}))}}var W=o(687);function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function T(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var D=new WeakMap,R=function(t){f(u,t);var n,r,o,i=P(u);function u(t){var n,r=t.storageDriver;return e(this,u),T(c(n=i.call(this)),D,{writable:!0,value:null}),y(c(n),D,r),n}return a(u,[{key:"authenticate",value:(o=_(W.mark((function l(e,t){var n,r,o,i;return W.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t){a.next=2;break}return a.abrupt("return",null);case 2:return n=t.id,r=t.token_refresh,a.next=5,e.callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/refresh"}});case 5:return o=a.sent,i=o.data,a.abrupt("return",M(M({},t),{},{id:n,token_access:i.token_access}));case 8:case"end":return a.stop()}}),l)}))),function(e,t){return o.apply(this,arguments)})},{key:"loadAuthenticationData",value:(r=_(W.mark((function p(){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,D).load(s.StorageKey.Session);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return r.apply(this,arguments)})},{key:"saveAuthenticationData",value:(n=_(W.mark((function h(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e!==undefined){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,v(this,D).save(s.StorageKey.Session,e);case 4:case"end":return t.stop()}}),h,this)}))),function(e){return n.apply(this,arguments)})}]),u}(j.ApiAuthenticator);function C(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n["return"]&&(a=n["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U="authenticate",F="register",I="create",B="delete",z="list",q="update",G="undefined"!=typeof window&&"undefined"!=typeof window.document,K="https://void.void-walkers.com";function J(e){return Object.keys(e).map((function(t){var n=e[t];return Array.isArray(n)?n.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):"".concat(t,"=").concat(encodeURIComponent(n))})).join("&")}var V=["resumeToken"];function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(u)throw i}}}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function Z(e,t){te(e,t),t.add(e)}function ee(e,t,n){te(e,t),t.set(e,n)}function te(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ne(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function re(e){var t=e.collectionName,n=e.databaseName,r=e.filter,o=e.options,i=void 0===o?{}:o,a=e.projectSlug,u=J({filter:JSON.stringify(r),options:JSON.stringify(i)});return"".concat(a,"/").concat(n,"/").concat(t).concat(u?"?".concat(u):"")}function oe(e){return"undefined"!=typeof WebSocket?new WebSocket(e):null}var ie=new WeakMap,ae=new WeakMap,ue=new WeakMap,se=new WeakMap,ce=new WeakMap,le=new WeakMap,fe=new WeakMap,pe=new WeakSet,he=new WeakSet,de=new WeakSet,ve=new WeakSet,ye=function(t){f(r,t);var n=Q(r);function r(t){var o,i=t.createWebsocket,a=t.project;e(this,r),Z(c(o=n.call(this)),ve),Z(c(o),de),Z(c(o),he),Z(c(o),pe),ee(c(o),ie,{writable:!0,value:new Set}),ee(c(o),ae,{writable:!0,value:null}),ee(c(o),ue,{writable:!0,value:null}),ee(c(o),se,{writable:!0,value:new Map}),ee(c(o),ce,{writable:!0,value:null}),ee(c(o),le,{writable:!0,value:null}),ee(c(o),fe,{writable:!0,value:null});var u=a.slug,s=a.tokenPublic;return y(c(o),ae,i||oe),y(c(o),ue,u),y(c(o),ce,s),o}return a(r,[{key:"connect",value:function(e){var t=this,n=e.onConnect,r=e.onDisconnect,o=e.wrapper;if(!v(this,ae))throw new Error('WebSocket factory not specified ("createWebsocket" param)');var i=new URL(K),a=i.host,u=i.protocol,s=v(this,ae).call(this,"".concat(["https:","wss:"].includes(u)?"wss":"ws","://").concat(a,"/realtime"));s.onclose=function(e){r(e.code>1e3?new Error("WebSocket close with code: ".concat(e.code)):null);var n,o=$(v(t,se));try{for(o.s();!(n=o.n()).done;){var i=N(n.value,2)[1].onUnsubscribe;i&&i()}}catch(a){o.e(a)}finally{o.f()}v(t,se).clear(),y(t,le,null)},s.onerror=function(e){console.warn("ws err:",e)},s.onmessage=function(e){return ne(t,he,be).call(t,e)},s.onopen=function(){return n()},y(this,le,o),y(this,fe,s)}},{key:"disconnect",value:function(){var e;null===(e=v(this,fe))||void 0===e||e.close(1e3),y(this,le,null),y(this,fe,null)}},{key:"subscribe",value:function(e){var t=e.callbacks,n=e.isPrivate,r=e.onSubscribe,o=e.onUnsubscribe,i=e.subscriptionData,a=ne(this,pe,we).call(this,i);v(this,se).set(re(a),{callbacks:t,isPrivate:n,onSubscribe:r,onUnsubscribe:o,originalSubscriptionData:i,subscriptionData:a}),ne(this,ve,ge).call(this,a,n)}},{key:"unsubscribe",value:function(e){var t,n=e.subscriptionData,r=ne(this,pe,we).call(this,n),o=re(r),i=v(this,se).get(o);v(this,se)["delete"](o),null===(t=v(this,fe))||void 0===t||t.send(JSON.stringify({data:r,type:"unsubscribe"})),null==i||i.onUnsubscribe()}}]),r}(j.ApiRealtimeTransport);function we(e){e.resumeToken;return Y(Y({},C(e,V)),{},{projectSlug:v(this,ue)})}function be(e){var t,n,r=JSON.parse(e.data),o=r.data,i=r.error,a=r.success,u=r.type;if("subscribe"!==u)if("notification"===u){var s=v(this,se).get(re(o.subscriptionData));s&&(s.originalSubscriptionData.resumeToken=o.resumeToken,null===(t=s.callbacks)||void 0===t||null===(n=t.onChange)||void 0===n||n.call(t,o.data))}else["unsubscribe"].includes(u)||console.warn("ws unknown message:",u,o);else ne(this,de,me).call(this,{data:o,error:i,success:a})}function me(e){var t=e.data,n=e.error,r=e.success,o=re(t),i=v(this,se).get(o);if(i){var a=i.isPrivate,u=i.onSubscribe,s=i.subscriptionData;r||!a||401!==n.code?u():ne(this,ve,ge).call(this,s,!v(this,ie).has(o)&&a,!0)}}function ge(e,t){var n=this,r=arguments.length>2&&arguments[2]!==undefined&&arguments[2];_(W.mark((function o(){var i,a,u,s,c,l,f,p,h;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=re(e),u=v(n,se).get(a)){o.next=4;break}return o.abrupt("return");case 4:if(r?v(n,ie).add(a):v(n,ie)["delete"](a),s=null,!t){o.next=24;break}if(o.prev=7,!r){o.next=14;break}return o.next=11,null===(c=v(n,le))||void 0===c?void 0:c.authenticate();case 11:o.t0=o.sent,o.next=17;break;case 14:return o.next=16,null===(l=v(n,le))||void 0===l?void 0:l.getAuthenticationData();case 16:o.t0=o.sent;case 17:f=o.t0,s=(null==f?void 0:f.token_access)||null,o.next=24;break;case 21:o.prev=21,o.t1=o["catch"](7),console.warn("ws failed to authenticate:",o.t1);case 24:p=(null===(i=u.originalSubscriptionData)||void 0===i?void 0:i.resumeToken)||null,v(n,fe)&&(h={resumeToken:p,data:e,type:"subscribe"},s&&(h.auth={data:{tokenAccess:s,tokenPublic:v(n,ce)},type:"public"}),v(n,fe).send(JSON.stringify(h)));case 26:case"end":return o.stop()}}),o,null,[[7,21]])})))()}var ke=o(300);function xe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function je(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function Se(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Ee(e,t,n){var r,o,i,a=e.apiWrapperOptions,u=e.methodData,s=e.payload,c=u.actionName,l=u.method;return[null==s?void 0:s[t],null==a||null===(r=a[c])||void 0===r?void 0:r[t],null==a||null===(o=a[l])||void 0===o?void 0:o[t],null==a||null===(i=a["default"])||void 0===i?void 0:i[t],n].find((function(e){return e!==undefined}))}var _e=new WeakMap,We=new WeakMap,Le=new WeakMap,Me=function(t){f(o,t);var n,r=je(o);function o(t){var n,i=t.getExtraRequestData,a=t.project;e(this,o),Se(c(n=r.call(this)),_e,{writable:!0,value:null}),Se(c(n),We,{writable:!0,value:null}),Se(c(n),Le,{writable:!0,value:null});var u=a.slug,s=a.tokenPublic;return y(c(n),_e,ke.create({baseURL:K,headers:{Authorization:"Bearer ".concat(s)},timeout:3e4})),y(c(n),We,i),y(c(n),Le,u),n}return a(o,[{key:"callMethod",value:(n=_(W.mark((function i(e){var t,n,r,o,a,u,s,c,l,f,p,h,d,y;return W.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.authenticationData,n=e.methodData,r=e.requestData,o=r.apiWrapperOptions,a=r.payload,u=Ee({apiWrapperOptions:o,methodData:n,payload:a},"data"),s=Ee({apiWrapperOptions:o,methodData:n,payload:a},"headers",{}),c=Ee({apiWrapperOptions:o,methodData:n,payload:a},"method",n.method),l=Ee({apiWrapperOptions:o,methodData:n,payload:a},"prefix","/projects/".concat(v(this,Le))),f=Ee({apiWrapperOptions:o,methodData:n,payload:a},"timeout",3e4),p=Ee({apiWrapperOptions:o,methodData:n,payload:a},"url"),h=v(this,We).call(this),d="function"==typeof s?s(a,h):s,y=null!=t&&t.token_access?Oe({"X-Void-Auth":t.token_access},d):d,i.prev=11,i.next=14,v(this,_e).request({timeout:f,data:"function"==typeof u?u(a,h):u,headers:y,method:"function"==typeof c?c(a,h):c,url:l+("function"==typeof p?p(a,h):p)});case 14:return i.abrupt("return",i.sent);case 17:throw i.prev=17,i.t0=i["catch"](11),console.warn(i.t0,i.t0.response),i.t0;case 21:case"end":return i.stop()}}),i,this,[[11,17]])}))),function(e){return n.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){return{actionName:"create",method:"post"}}},{key:"getDeleteMethodData",value:function(){return{actionName:"delete",method:"delete"}}},{key:"getReadMethodData",value:function(){return{actionName:"read",method:"get"}}},{key:"getUpdateMethodData",value:function(){return{actionName:"update",method:"patch"}}},{key:"isAuthenticationFailedError",value:function(e){var t;return 403===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}},{key:"isSessionExpiredError",value:function(e){var t;return 401===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}}]),o}(j.ApiTransport);function Pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var Te={delay:1e3,delayFactor:2,maxDelay:4e3},De=function(t){f(r,t);var n=Pe(r);function r(t){var o=t.config,i=void 0===o?{}:o,a=t.createWebsocket,u=t.project,s=t.storageDriver;return e(this,r),n.call(this,{authenticator:new R({storageDriver:s}),realtimeTransport:new ye({createWebsocket:a,project:u}),reconnectConfig:(null==i?void 0:i.reconnectConfig)||Te,transport:new Me({project:u,getExtraRequestData:(null==i?void 0:i.getExtraRequestData)||function(){return{}}})})}return a(r)}(j.ApiWrapper),Re=o(187);function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function Ae(e,t){Ue(e,t),t.add(e)}function Ne(e,t,n){Ue(e,t),t.set(e,n)}function Ue(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fe(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Ie=new WeakMap,Be=new WeakMap,ze=new WeakSet,qe=new WeakSet,Ge=new WeakSet,Ke=function(t){f(l,t);var n,r,o,i,u=Ce(l);function l(t){var n,r=t.apiWrapper,o=t.storageDriver;return e(this,l),Ae(c(n=u.call(this)),Ge),Ae(c(n),qe),Ae(c(n),ze),Ne(c(n),Ie,{writable:!0,value:null}),Ne(c(n),Be,{writable:!0,value:null}),y(c(n),Ie,r),y(c(n),Be,o),n}return a(l,[{key:"getCurrentUser",value:(i=_(W.mark((function p(){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Be).load(s.StorageKey.CurrentUser);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return i.apply(this,arguments)})},{key:"signInCustom",value:(o=_(W.mark((function h(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Fe(this,ze,Je).call(this,U,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),h,this)}))),function(e){return o.apply(this,arguments)})},{key:"signOut",value:(r=_(W.mark((function d(){var e,t,n,r,o=arguments;return W.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=o.length>0&&o[0]!==undefined&&o[0],i.next=3,v(this,Ie).getAuthenticator().loadAuthenticationData();case 3:return t=i.sent,n=t.id,r=t.token_refresh,i.prev=6,i.next=9,v(this,Ie).callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/deauthenticate"}});case 9:i.next=16;break;case 11:if(i.prev=11,i.t0=i["catch"](6),e){i.next=15;break}throw i.t0;case 15:console.warn(i.t0);case 16:return i.next=18,Fe(this,qe,Xe).call(this,null);case 18:return i.next=20,Fe(this,Ge,$e).call(this,null);case 20:case"end":return i.stop()}}),d,this,[[6,11]])}))),function(){return r.apply(this,arguments)})},{key:"signUpCustom",value:(n=_(W.mark((function w(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Fe(this,ze,Je).call(this,F,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return n.apply(this,arguments)})}]),l}(Re);function Je(e,t){return Ve.apply(this,arguments)}function Ve(){return(Ve=_(W.mark((function e(t,n){var r,o,i,a;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Ie).callMethod({method:"post"},{payload:{data:{payload:n},url:"/auth/users/".concat(t)}});case 2:return r=e.sent,o=r.data,i=o.session,a=o.user,e.next=7,Fe(this,Ge,$e).call(this,i);case 7:return e.next=9,Fe(this,qe,Xe).call(this,a);case 9:return e.abrupt("return",{session:i,user:a});case 10:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Xe(e){return Ye.apply(this,arguments)}function Ye(){return(Ye=_(W.mark((function e(t){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Be).save(s.StorageKey.CurrentUser,t);case 2:this.emit("currentUserChange",t);case 3:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function $e(e){return He.apply(this,arguments)}function He(){return(He=_(W.mark((function e(t){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Be).save(s.StorageKey.Session,t);case 2:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Qe(e,t,n){Ze(e,t),t.set(e,n)}function Ze(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}var et=new WeakMap,tt=new WeakMap,nt=new WeakSet,rt=function(){function t(n){var r,o,i=n.apiWrapper;e(this,t),Ze(r=this,o=nt),o.add(r),Qe(this,et,{writable:!0,value:null}),Qe(this,tt,{writable:!0,value:new Map}),y(this,et,i)}return a(t,[{key:"getFunction",value:function(e){var t=this,n=v(this,tt).get(e);return n||(n=function(){for(var n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}(t,nt,ot)).call.apply(n,[t,e].concat(o))},v(this,tt).set(e,n)),n}}]),t}();function ot(e,t){return it.apply(this,arguments)}function it(){return(it=_(W.mark((function e(t,n){var r;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,et).callMethod({method:"post"},{payload:{data:n,url:"/functions/".concat(t)}},!0);case 2:return r=e.sent,e.abrupt("return",r.data);case 4:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function at(e,t,n){ut(e,t),t.set(e,n)}function ut(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function st(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var ct=new WeakMap,lt=new WeakMap,ft=new WeakMap,pt=new WeakSet,ht=function(){function t(n){var r,o,i=n.apiWrapper,a=n.database,u=n.name;e(this,t),ut(r=this,o=pt),o.add(r),at(this,ct,{writable:!0,value:null}),at(this,lt,{writable:!0,value:null}),at(this,ft,{writable:!0,value:null}),y(this,ct,i),y(this,lt,a),y(this,ft,u)}var n,r,o,i,u,s,c,l,f,p;return a(t,[{key:"deleteMany",value:(p=_(W.mark((function h(){var e,t=arguments;return W.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,st(this,pt,dt).call(this,"deleteMany",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),h,this)}))),function(){return p.apply(this,arguments)})},{key:"deleteOne",value:(f=_(W.mark((function d(){var e,t=arguments;return W.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,st(this,pt,dt).call(this,"deleteOne",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),d,this)}))),function(){return f.apply(this,arguments)})},{key:"find",value:(l=_(W.mark((function w(){var e,t,n=arguments;return W.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=n.length>0&&n[0]!==undefined?n[0]:{},t=n.length>1&&n[1]!==undefined?n[1]:{},r.next=4,st(this,pt,dt).call(this,"find",{filter:e,options:t});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),w,this)}))),function(){return l.apply(this,arguments)})},{key:"findOne",value:(c=_(W.mark((function b(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,st(this,pt,dt).call(this,"findOne",{filter:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),b,this)}))),function(e){return c.apply(this,arguments)})},{key:"findOneAndUpdate",value:(s=_(W.mark((function m(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"findOneAndUpdate",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),m,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"insertMany",value:(u=_(W.mark((function g(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,st(this,pt,dt).call(this,"insertMany",{docs:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),g,this)}))),function(e){return u.apply(this,arguments)})},{key:"insertOne",value:(i=_(W.mark((function k(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,st(this,pt,dt).call(this,"insertOne",{doc:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),k,this)}))),function(e){return i.apply(this,arguments)})},{key:"replaceOne",value:(o=_(W.mark((function x(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"replaceOne",{filter:e,options:n,replacement:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),x,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateMany",value:(r=_(W.mark((function O(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"updateMany",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),O,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"updateOne",value:(n=_(W.mark((function j(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"updateOne",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),j,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"watch",value:function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return v(this,ct).subscribe({filter:e,options:n,collectionName:v(this,ft),databaseName:v(this,lt).name},{onChange:t},!0)}}]),t}();function dt(e){return vt.apply(this,arguments)}function vt(){return vt=_(W.mark((function e(t){var n,r,o=arguments;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&o[1]!==undefined?o[1]:{},e.next=3,v(this,ct).callMethod({method:"post"},{payload:{data:{method:t,params:n,collection:v(this,ft)},url:"/mongo/".concat(v(this,lt).name,"/query")}},!0);case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),vt.apply(this,arguments)}function yt(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var wt=new WeakMap,bt=new WeakMap,mt=new WeakMap,gt=function(){function t(n){var r=n.apiWrapper,o=n.name;e(this,t),yt(this,wt,{writable:!0,value:null}),yt(this,bt,{writable:!0,value:new Map}),yt(this,mt,{writable:!0,value:null}),y(this,wt,r),y(this,mt,o)}return a(t,[{key:"collection",value:function(e){var t=v(this,bt).get(e);return t||(t=new ht({name:e,apiWrapper:v(this,wt),database:this}),v(this,bt).set(e,t)),t}},{key:"name",get:function(){return v(this,mt)}}]),t}();function kt(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var xt=new WeakMap,Ot=new WeakMap,jt=function(){function t(n){var r=n.apiWrapper;e(this,t),kt(this,xt,{writable:!0,value:null}),kt(this,Ot,{writable:!0,value:new Map}),y(this,xt,r)}return a(t,[{key:"collection",value:function(e){return this.db().collection(e)}},{key:"db",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default",t=v(this,Ot).get(e);return t||(t=new gt({name:e,apiWrapper:v(this,xt)}),v(this,Ot).set(e,t)),t}}]),t}();function St(e,t){_t(e,t),t.add(e)}function Et(e,t,n){_t(e,t),t.set(e,n)}function _t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wt(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Lt=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,Tt=new WeakSet,Dt=new WeakSet,Rt=function(){function t(n){var r=n.apiWrapper,o=n.name;e(this,t),St(this,Dt),St(this,Tt),Et(this,Lt,{writable:!0,value:null}),Et(this,Mt,{writable:!0,value:null}),Et(this,Pt,{writable:!0,value:null}),y(this,Lt,r),y(this,Mt,ke.create({baseURL:"".concat(K,"/cdn/buckets/").concat(o),timeout:12e4})),y(this,Pt,o)}var n,r,o,i;return a(t,[{key:"createFile",value:(i=_(W.mark((function u(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:[],o.next=3,Wt(this,Tt,Ct).call(this,I,e,t,n);case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),u,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"deleteFile",value:(o=_(W.mark((function s(e){var t,n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return t=r.length>1&&r[1]!==undefined?r[1]:[],o.next=3,Wt(this,Dt,Nt).call(this,B,e,t);case 3:return n=o.sent,o.next=6,v(this,Mt)["delete"]("/files",{file:{name:e,prefix:t}},{"X-Void-Bucket-Token":n});case 6:case"end":return o.stop()}}),s,this)}))),function(e){return o.apply(this,arguments)})},{key:"listFiles",value:(r=_(W.mark((function c(){var e,t,n,r,o,i,a,u,s,l,f,p=arguments;return W.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return e=p.length>0&&p[0]!==undefined?p[0]:{},t=e.limit,n=void 0===t?50:t,r=e.offset,o=void 0===r?0:r,i=e.prefix,a=void 0===i?[]:i,c.next=3,Wt(this,Dt,Nt).call(this,z,null,a);case 3:return u=c.sent,s=J({limit:n,offset:o,prefix:a}),c.next=7,v(this,Mt).get("/files?".concat(s),{"X-Void-Bucket-Token":u});case 7:return l=c.sent,f=l.data,c.abrupt("return",f.items);case 10:case"end":return c.stop()}}),c,this)}))),function(){return r.apply(this,arguments)})},{key:"name",get:function(){return v(this,Pt)}},{key:"updateFile",value:(n=_(W.mark((function l(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:[],o.next=3,Wt(this,Tt,Ct).call(this,q,e,t,n);case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),l,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}();function Ct(e,t,n){return At.apply(this,arguments)}function At(){return At=_(W.mark((function e(t,n,r){var o,i,a,u,s=arguments;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&s[3]!==undefined?s[3]:[],e.next=3,Wt(this,Dt,Nt).call(this,t,r,o);case 3:return i=e.sent,e.next=6,v(this,Mt).post("/files",{file:n,name:r,prefix:o},{"Content-Type":"multipart/form-data","X-Void-Bucket-Token":i});case 6:return a=e.sent,u=a.data,e.abrupt("return",u.item);case 9:case"end":return e.stop()}}),e,this)}))),At.apply(this,arguments)}function Nt(e,t){return Ut.apply(this,arguments)}function Ut(){return Ut=_(W.mark((function e(t,n){var r,o,i,a=arguments;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&a[2]!==undefined?a[2]:[],e.next=3,v(this,Lt).callMethod({method:"post"},{payload:{data:{file:{name:n,prefix:r},operation_type:t},url:"auth/buckets/".concat(v(this,Pt),"/create-token")}});case 3:return o=e.sent,i=o.data,e.abrupt("return",i.token);case 6:case"end":return e.stop()}}),e,this)}))),Ut.apply(this,arguments)}function Ft(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var It=new WeakMap,Bt=new WeakMap,zt=function(){function t(n){var r=n.apiWrapper;e(this,t),Ft(this,It,{writable:!0,value:null}),Ft(this,Bt,{writable:!0,value:new Map}),y(this,It,r)}return a(t,[{key:"bucket",value:function(e){var t=v(this,Bt).get(e);return t||(t=new Rt({name:e,apiWrapper:v(this,It)}),v(this,Bt).set(e,t)),t}}]),t}();function qt(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Gt=new WeakMap,Kt=new WeakMap,Jt=new WeakMap,Vt=new WeakMap,Xt=function(){function t(n){var r=this,o=n.apiWrapperConfig,i=void 0===o?{}:o,a=n.project,u=n.storageDriver;e(this,t),qt(this,Gt,{writable:!0,value:null}),qt(this,Kt,{writable:!0,value:null}),qt(this,Jt,{writable:!0,value:null}),qt(this,Vt,{writable:!0,value:null}),u||(u=G?new x:null);var s=new De({project:a,storageDriver:u,config:i});s.on("error",(function(e){if(e.code===j.ApiErrorCode.AuthenticationFailed)v(r,Gt).signOut(!0)["catch"]((function(e){return console.error(e)}));else if(e.code===j.ApiErrorCode.RealtimeTransport)console.error("realtime error:",e);else{var t;console.error("api error",e,"Status code:",null==e||null===(t=e.response)||void 0===t?void 0:t.status)}})),y(this,Gt,new Ke({apiWrapper:s,storageDriver:u})),y(this,Kt,new rt({apiWrapper:s})),y(this,Jt,new jt({apiWrapper:s})),y(this,Vt,new zt({apiWrapper:s}))}return a(t,[{key:"auth",get:function(){return v(this,Gt)}},{key:"function",value:function(e){return v(this,Kt).getFunction(e)}},{key:"mongo",get:function(){return v(this,Jt)}},{key:"storage",get:function(){return v(this,Vt)}}]),t}()})(),i})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ololoepepe/api-wrapper"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","axios"],t):"object"==typeof exports?exports.voidClient=t(require("@ololoepepe/api-wrapper"),require("axios")):e.voidClient=t(e["@ololoepepe/api-wrapper"],e.axios)}(self,((e,t)=>(()=>{var n={187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=undefined,i.prototype._eventsCount=0,i.prototype._maxListeners=undefined;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return e._maxListeners===undefined?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a,c;if(u(n),(i=e._events)===undefined?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==undefined&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),a===undefined)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:undefined,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(r===undefined)return[];var o=r[t];return o===undefined?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(t!==undefined){var n=t[e];if("function"==typeof n)return 1;if(n!==undefined)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){this._events!==undefined&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||undefined},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(i!==undefined)o=o&&i.error===undefined;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[e];if(s===undefined)return!1;if("function"==typeof s)r(s,this,t);else{var c=s.length,l=d(s,c);for(n=0;n<c;++n)r(l[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(u(t),(r=this._events)===undefined)return this;if((n=r[e])===undefined)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),r.removeListener!==undefined&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if((n=this._events)===undefined)return this;if(n.removeListener===undefined)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):n[e]!==undefined&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t!==undefined)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},22:t=>{"use strict";t.exports=e},300:e=>{"use strict";e.exports=t},61:(e,t,n)=>{var r=n(698)["default"];function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports["default"]=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new D(r||[]);return u(i,"_invoke",{value:L(e,n,a)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var v="suspendedStart",y="suspendedYield",w="executing",b="completed",m={};function g(){}function k(){}function x(){}var O={};p(O,c,(function(){return this}));var j=Object.getPrototypeOf,S=j&&j(j(R([])));S&&S!==i&&a.call(S,c)&&(O=S);var E=x.prototype=g.prototype=Object.create(O);function _(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function W(e,t){function n(o,i,u,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,u,s)}),(function(e){n("throw",e,u,s)})):t.resolve(f).then((function(e){l.value=e,u(l)}),(function(e){return n("throw",e,u,s)}))}s(c.arg)}var o;u(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function L(e,n,r){var o=v;return function(i,a){if(o===w)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var s=M(u,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=w;var c=d(e,n,r);if("normal"===c.type){if(o=r.done?b:y,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=b,r.method="throw",r.arg=c.arg)}}}function M(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator["return"]&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function R(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return k.prototype=x,u(E,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:k,configurable:!0}),k.displayName=p(x,f,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===k||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,p(e,f,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},_(W.prototype),p(W.prototype,l,(function(){return this})),n.AsyncIterator=W,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new W(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(E),p(E,f,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function o(){for(;n.length;){var e=n.pop();if(e in t)return o.value=e,o.done=!1,o}return o.done=!0,o}},n.values=R,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},n}e.exports=o,e.exports.__esModule=!0,e.exports["default"]=e.exports},698:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports["default"]=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports["default"]=e.exports},687:(e,t,n)=>{var r=n(61)();e.exports=r;try{regeneratorRuntime=r}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={};function o(e){var t=r[e];if(t!==undefined)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}o.r(i),o.d(i,{StorageDriver:()=>s,StorageDriverLocalStorage:()=>x,VoidClient:()=>Xt});var u,s=function(){function t(){e(this,t)}return a(t,[{key:"load",value:function(){throw new Error("[StorageDriver.load] Method not implemented")}},{key:"save",value:function(){throw new Error("[StorageDriver.save] Method not implemented")}}],[{key:"StorageKey",get:function(){return{CurrentUser:"current_user",Session:"session"}}}]),t}();function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function p(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function v(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,d(e,t,"get"))}function y(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,d(e,t,"set"),n),n}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function b(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function m(e,t,n){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),n}var g=new WeakMap,k=new WeakMap,x=function(t){f(r,t);var n=w(r);function r(){var t,o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=o.prefix,a=void 0===i?"void":i,u=o.storageType,s=void 0===u?r.StorageType.LocalStorage:u;return e(this,r),b(c(t=n.call(this)),g,{writable:!0,value:null}),b(c(t),k,{writable:!0,value:null}),y(c(t),g,a),y(c(t),k,m(r,r,O).call(r,s)),t}return a(r,[{key:"load",value:function(e){var t=v(this,k).getItem("".concat(v(this,g),"/").concat(e));return null===t?null:JSON.parse(t)}},{key:"save",value:function(e,t){v(this,k).setItem("".concat(v(this,g),"/").concat(e),JSON.stringify(t))}}],[{key:"StorageType",get:function(){return{LocalStorage:"localStorage",SessionStorage:"sessionStorage"}}}]),r}(s);function O(e){switch(e){case u.StorageType.LocalStorage:return window.localStorage;case u.StorageType.SessionStorage:return window.sessionStorage;default:return null}}u=x;var j=o(22);function S(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,o)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){E(i,r,o,a,u,"next",e)}function u(e){E(i,r,o,a,u,"throw",e)}a(undefined)}))}}var W=o(687);function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function T(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var D=new WeakMap,R=function(t){f(u,t);var n,r,o,i=P(u);function u(t){var n,r=t.storageDriver;return e(this,u),T(c(n=i.call(this)),D,{writable:!0,value:null}),y(c(n),D,r),n}return a(u,[{key:"authenticate",value:(o=_(W.mark((function l(e,t){var n,r,o,i;return W.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t){a.next=2;break}return a.abrupt("return",null);case 2:return n=t.id,r=t.token_refresh,a.next=5,e.callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/refresh"}});case 5:return o=a.sent,i=o.data,a.abrupt("return",M(M({},t),{},{id:n,token_access:i.token_access}));case 8:case"end":return a.stop()}}),l)}))),function(e,t){return o.apply(this,arguments)})},{key:"loadAuthenticationData",value:(r=_(W.mark((function p(){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,D).load(s.StorageKey.Session);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return r.apply(this,arguments)})},{key:"saveAuthenticationData",value:(n=_(W.mark((function h(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e!==undefined){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,v(this,D).save(s.StorageKey.Session,e);case 4:case"end":return t.stop()}}),h,this)}))),function(e){return n.apply(this,arguments)})}]),u}(j.ApiAuthenticator);function C(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n["return"]&&(a=n["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U="authenticate",F="register",I="create",B="delete",z="list",q="update",G="undefined"!=typeof window&&"undefined"!=typeof window.document,K="https://void.void-walkers.com";function J(e){return Object.keys(e).map((function(t){var n=e[t];return Array.isArray(n)?n.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):"".concat(t,"=").concat(encodeURIComponent(n))})).join("&")}var V=["resumeToken"];function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(u)throw i}}}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function Z(e,t){te(e,t),t.add(e)}function ee(e,t,n){te(e,t),t.set(e,n)}function te(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ne(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function re(e){var t=e.collectionName,n=e.databaseName,r=e.filter,o=e.options,i=void 0===o?{}:o,a=e.projectSlug,u=J({filter:JSON.stringify(r),options:JSON.stringify(i)});return"".concat(a,"/").concat(n,"/").concat(t).concat(u?"?".concat(u):"")}function oe(e){return"undefined"!=typeof WebSocket?new WebSocket(e):null}var ie=new WeakMap,ae=new WeakMap,ue=new WeakMap,se=new WeakMap,ce=new WeakMap,le=new WeakMap,fe=new WeakMap,pe=new WeakSet,he=new WeakSet,de=new WeakSet,ve=new WeakSet,ye=function(t){f(r,t);var n=Q(r);function r(t){var o,i=t.createWebsocket,a=t.project;e(this,r),Z(c(o=n.call(this)),ve),Z(c(o),de),Z(c(o),he),Z(c(o),pe),ee(c(o),ie,{writable:!0,value:new Set}),ee(c(o),ae,{writable:!0,value:null}),ee(c(o),ue,{writable:!0,value:null}),ee(c(o),se,{writable:!0,value:new Map}),ee(c(o),ce,{writable:!0,value:null}),ee(c(o),le,{writable:!0,value:null}),ee(c(o),fe,{writable:!0,value:null});var u=a.slug,s=a.tokenPublic;return y(c(o),ae,i||oe),y(c(o),ue,u),y(c(o),ce,s),o}return a(r,[{key:"connect",value:function(e){var t=this,n=e.onConnect,r=e.onDisconnect,o=e.wrapper;if(!v(this,ae))throw new Error('WebSocket factory not specified ("createWebsocket" param)');var i=new URL(K),a=i.host,u=i.protocol,s=v(this,ae).call(this,"".concat(["https:","wss:"].includes(u)?"wss":"ws","://").concat(a,"/realtime"));s.onclose=function(e){r(e.code>1e3?new Error("WebSocket close with code: ".concat(e.code)):null);var n,o=$(v(t,se));try{for(o.s();!(n=o.n()).done;){var i=N(n.value,2)[1].onUnsubscribe;i&&i()}}catch(a){o.e(a)}finally{o.f()}v(t,se).clear(),y(t,le,null)},s.onerror=function(e){console.warn("ws err:",e)},s.onmessage=function(e){return ne(t,he,be).call(t,e)},s.onopen=function(){return n()},y(this,le,o),y(this,fe,s)}},{key:"disconnect",value:function(){var e;null===(e=v(this,fe))||void 0===e||e.close(1e3),y(this,le,null),y(this,fe,null)}},{key:"subscribe",value:function(e){var t=e.callbacks,n=e.isPrivate,r=e.onSubscribe,o=e.onUnsubscribe,i=e.subscriptionData,a=ne(this,pe,we).call(this,i);v(this,se).set(re(a),{callbacks:t,isPrivate:n,onSubscribe:r,onUnsubscribe:o,originalSubscriptionData:i,subscriptionData:a}),ne(this,ve,ge).call(this,a,n)}},{key:"unsubscribe",value:function(e){var t,n=e.subscriptionData,r=ne(this,pe,we).call(this,n),o=re(r),i=v(this,se).get(o);v(this,se)["delete"](o),null===(t=v(this,fe))||void 0===t||t.send(JSON.stringify({data:r,type:"unsubscribe"})),null==i||i.onUnsubscribe()}}]),r}(j.ApiRealtimeTransport);function we(e){e.resumeToken;return Y(Y({},C(e,V)),{},{projectSlug:v(this,ue)})}function be(e){var t,n,r=JSON.parse(e.data),o=r.data,i=r.error,a=r.success,u=r.type;if("subscribe"!==u)if("notification"===u){var s=v(this,se).get(re(o.subscriptionData));s&&(s.originalSubscriptionData.resumeToken=o.resumeToken,null===(t=s.callbacks)||void 0===t||null===(n=t.onChange)||void 0===n||n.call(t,o.data))}else["unsubscribe"].includes(u)||console.warn("ws unknown message:",u,o);else ne(this,de,me).call(this,{data:o,error:i,success:a})}function me(e){var t=e.data,n=e.error,r=e.success,o=re(t),i=v(this,se).get(o);if(i){var a=i.isPrivate,u=i.onSubscribe,s=i.subscriptionData;r||!a||401!==n.code?u():ne(this,ve,ge).call(this,s,!v(this,ie).has(o)&&a,!0)}}function ge(e,t){var n=this,r=arguments.length>2&&arguments[2]!==undefined&&arguments[2];_(W.mark((function o(){var i,a,u,s,c,l,f,p,h;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=re(e),u=v(n,se).get(a)){o.next=4;break}return o.abrupt("return");case 4:if(r?v(n,ie).add(a):v(n,ie)["delete"](a),s=null,!t){o.next=24;break}if(o.prev=7,!r){o.next=14;break}return o.next=11,null===(c=v(n,le))||void 0===c?void 0:c.authenticate();case 11:o.t0=o.sent,o.next=17;break;case 14:return o.next=16,null===(l=v(n,le))||void 0===l?void 0:l.getAuthenticationData();case 16:o.t0=o.sent;case 17:f=o.t0,s=(null==f?void 0:f.token_access)||null,o.next=24;break;case 21:o.prev=21,o.t1=o["catch"](7),console.warn("ws failed to authenticate:",o.t1);case 24:p=(null===(i=u.originalSubscriptionData)||void 0===i?void 0:i.resumeToken)||null,v(n,fe)&&(h={resumeToken:p,data:e,type:"subscribe"},s&&(h.auth={data:{tokenAccess:s,tokenPublic:v(n,ce)},type:"public"}),v(n,fe).send(JSON.stringify(h)));case 26:case"end":return o.stop()}}),o,null,[[7,21]])})))()}var ke=o(300);function xe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function je(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function Se(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Ee(e,t,n){var r,o,i,a=e.apiWrapperOptions,u=e.methodData,s=e.payload,c=u.actionName,l=u.method;return[null==s?void 0:s[t],null==a||null===(r=a[c])||void 0===r?void 0:r[t],null==a||null===(o=a[l])||void 0===o?void 0:o[t],null==a||null===(i=a["default"])||void 0===i?void 0:i[t],n].find((function(e){return e!==undefined}))}var _e=new WeakMap,We=new WeakMap,Le=new WeakMap,Me=function(t){f(o,t);var n,r=je(o);function o(t){var n,i=t.getExtraRequestData,a=t.project;e(this,o),Se(c(n=r.call(this)),_e,{writable:!0,value:null}),Se(c(n),We,{writable:!0,value:null}),Se(c(n),Le,{writable:!0,value:null});var u=a.slug,s=a.tokenPublic;return y(c(n),_e,ke.create({baseURL:K,headers:{Authorization:"Bearer ".concat(s)},timeout:3e4})),y(c(n),We,i),y(c(n),Le,u),n}return a(o,[{key:"callMethod",value:(n=_(W.mark((function i(e){var t,n,r,o,a,u,s,c,l,f,p,h,d,y;return W.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.authenticationData,n=e.methodData,r=e.requestData,o=r.apiWrapperOptions,a=r.payload,u=Ee({apiWrapperOptions:o,methodData:n,payload:a},"data"),s=Ee({apiWrapperOptions:o,methodData:n,payload:a},"headers",{}),c=Ee({apiWrapperOptions:o,methodData:n,payload:a},"method",n.method),l=Ee({apiWrapperOptions:o,methodData:n,payload:a},"prefix","/projects/".concat(v(this,Le))),f=Ee({apiWrapperOptions:o,methodData:n,payload:a},"timeout",3e4),p=Ee({apiWrapperOptions:o,methodData:n,payload:a},"url"),h=v(this,We).call(this),d="function"==typeof s?s(a,h):s,y=null!=t&&t.token_access?Oe({"X-Void-Auth":t.token_access},d):d,i.prev=11,i.next=14,v(this,_e).request({timeout:f,data:"function"==typeof u?u(a,h):u,headers:y,method:"function"==typeof c?c(a,h):c,url:l+("function"==typeof p?p(a,h):p)});case 14:return i.abrupt("return",i.sent);case 17:throw i.prev=17,i.t0=i["catch"](11),console.warn(i.t0,i.t0.response),i.t0;case 21:case"end":return i.stop()}}),i,this,[[11,17]])}))),function(e){return n.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){return{actionName:"create",method:"post"}}},{key:"getDeleteMethodData",value:function(){return{actionName:"delete",method:"delete"}}},{key:"getReadMethodData",value:function(){return{actionName:"read",method:"get"}}},{key:"getUpdateMethodData",value:function(){return{actionName:"update",method:"patch"}}},{key:"isAuthenticationFailedError",value:function(e){var t;return 403===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}},{key:"isSessionExpiredError",value:function(e){var t;return 401===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}}]),o}(j.ApiTransport);function Pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var Te={delay:1e3,delayFactor:2,maxDelay:4e3},De=function(t){f(r,t);var n=Pe(r);function r(t){var o=t.config,i=void 0===o?{}:o,a=t.createWebsocket,u=t.project,s=t.storageDriver;return e(this,r),n.call(this,{authenticator:new R({storageDriver:s}),realtimeTransport:new ye({createWebsocket:a,project:u}),reconnectConfig:(null==i?void 0:i.reconnectConfig)||Te,transport:new Me({project:u,getExtraRequestData:(null==i?void 0:i.getExtraRequestData)||function(){return{}}})})}return a(r)}(j.ApiWrapper),Re=o(187);function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function Ae(e,t){Ue(e,t),t.add(e)}function Ne(e,t,n){Ue(e,t),t.set(e,n)}function Ue(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fe(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Ie=new WeakMap,Be=new WeakMap,ze=new WeakSet,qe=new WeakSet,Ge=new WeakSet,Ke=function(t){f(l,t);var n,r,o,i,u=Ce(l);function l(t){var n,r=t.apiWrapper,o=t.storageDriver;return e(this,l),Ae(c(n=u.call(this)),Ge),Ae(c(n),qe),Ae(c(n),ze),Ne(c(n),Ie,{writable:!0,value:null}),Ne(c(n),Be,{writable:!0,value:null}),y(c(n),Ie,r),y(c(n),Be,o),n}return a(l,[{key:"getCurrentUser",value:(i=_(W.mark((function p(){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Be).load(s.StorageKey.CurrentUser);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return i.apply(this,arguments)})},{key:"signInCustom",value:(o=_(W.mark((function h(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Fe(this,ze,Je).call(this,U,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),h,this)}))),function(e){return o.apply(this,arguments)})},{key:"signOut",value:(r=_(W.mark((function d(){var e,t,n,r,o=arguments;return W.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=o.length>0&&o[0]!==undefined&&o[0],i.next=3,v(this,Ie).getAuthenticator().loadAuthenticationData();case 3:return t=i.sent,n=t.id,r=t.token_refresh,i.prev=6,i.next=9,v(this,Ie).callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/deauthenticate"}});case 9:i.next=16;break;case 11:if(i.prev=11,i.t0=i["catch"](6),e){i.next=15;break}throw i.t0;case 15:console.warn(i.t0);case 16:return i.next=18,Fe(this,qe,Xe).call(this,null);case 18:return i.next=20,Fe(this,Ge,$e).call(this,null);case 20:case"end":return i.stop()}}),d,this,[[6,11]])}))),function(){return r.apply(this,arguments)})},{key:"signUpCustom",value:(n=_(W.mark((function w(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Fe(this,ze,Je).call(this,F,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return n.apply(this,arguments)})}]),l}(Re);function Je(e,t){return Ve.apply(this,arguments)}function Ve(){return(Ve=_(W.mark((function e(t,n){var r,o,i,a;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Ie).callMethod({method:"post"},{payload:{data:{payload:n},url:"/auth/users/".concat(t)}});case 2:return r=e.sent,o=r.data,i=o.session,a=o.user,e.next=7,Fe(this,Ge,$e).call(this,i);case 7:return e.next=9,Fe(this,qe,Xe).call(this,a);case 9:return e.abrupt("return",{session:i,user:a});case 10:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Xe(e){return Ye.apply(this,arguments)}function Ye(){return(Ye=_(W.mark((function e(t){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Be).save(s.StorageKey.CurrentUser,t);case 2:this.emit("currentUserChange",t);case 3:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function $e(e){return He.apply(this,arguments)}function He(){return(He=_(W.mark((function e(t){return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,Be).save(s.StorageKey.Session,t);case 2:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Qe(e,t,n){Ze(e,t),t.set(e,n)}function Ze(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}var et=new WeakMap,tt=new WeakMap,nt=new WeakSet,rt=function(){function t(n){var r,o,i=n.apiWrapper;e(this,t),Ze(r=this,o=nt),o.add(r),Qe(this,et,{writable:!0,value:null}),Qe(this,tt,{writable:!0,value:new Map}),y(this,et,i)}return a(t,[{key:"getFunction",value:function(e){var t=this,n=v(this,tt).get(e);return n||(n=function(){for(var n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}(t,nt,ot)).call.apply(n,[t,e].concat(o))},v(this,tt).set(e,n)),n}}]),t}();function ot(e,t){return it.apply(this,arguments)}function it(){return(it=_(W.mark((function e(t,n){var r;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,et).callMethod({method:"post"},{payload:{data:n,url:"/functions/".concat(t)}},!0);case 2:return r=e.sent,e.abrupt("return",r.data);case 4:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function at(e,t,n){ut(e,t),t.set(e,n)}function ut(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function st(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var ct=new WeakMap,lt=new WeakMap,ft=new WeakMap,pt=new WeakSet,ht=function(){function t(n){var r,o,i=n.apiWrapper,a=n.database,u=n.name;e(this,t),ut(r=this,o=pt),o.add(r),at(this,ct,{writable:!0,value:null}),at(this,lt,{writable:!0,value:null}),at(this,ft,{writable:!0,value:null}),y(this,ct,i),y(this,lt,a),y(this,ft,u)}var n,r,o,i,u,s,c,l,f,p;return a(t,[{key:"deleteMany",value:(p=_(W.mark((function h(){var e,t=arguments;return W.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,st(this,pt,dt).call(this,"deleteMany",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),h,this)}))),function(){return p.apply(this,arguments)})},{key:"deleteOne",value:(f=_(W.mark((function d(){var e,t=arguments;return W.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,st(this,pt,dt).call(this,"deleteOne",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),d,this)}))),function(){return f.apply(this,arguments)})},{key:"find",value:(l=_(W.mark((function w(){var e,t,n=arguments;return W.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=n.length>0&&n[0]!==undefined?n[0]:{},t=n.length>1&&n[1]!==undefined?n[1]:{},r.next=4,st(this,pt,dt).call(this,"find",{filter:e,options:t});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),w,this)}))),function(){return l.apply(this,arguments)})},{key:"findOne",value:(c=_(W.mark((function b(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,st(this,pt,dt).call(this,"findOne",{filter:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),b,this)}))),function(e){return c.apply(this,arguments)})},{key:"findOneAndUpdate",value:(s=_(W.mark((function m(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"findOneAndUpdate",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),m,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"insertMany",value:(u=_(W.mark((function g(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,st(this,pt,dt).call(this,"insertMany",{docs:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),g,this)}))),function(e){return u.apply(this,arguments)})},{key:"insertOne",value:(i=_(W.mark((function k(e){return W.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,st(this,pt,dt).call(this,"insertOne",{doc:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),k,this)}))),function(e){return i.apply(this,arguments)})},{key:"replaceOne",value:(o=_(W.mark((function x(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"replaceOne",{filter:e,options:n,replacement:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),x,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateMany",value:(r=_(W.mark((function O(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"updateMany",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),O,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"updateOne",value:(n=_(W.mark((function j(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,st(this,pt,dt).call(this,"updateOne",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),j,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"watch",value:function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return v(this,ct).subscribe({filter:e,options:n,collectionName:v(this,ft),databaseName:v(this,lt).name},{onChange:t},!0)}}]),t}();function dt(e){return vt.apply(this,arguments)}function vt(){return vt=_(W.mark((function e(t){var n,r,o=arguments;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&o[1]!==undefined?o[1]:{},e.next=3,v(this,ct).callMethod({method:"post"},{payload:{data:{method:t,params:n,collection:v(this,ft)},url:"/mongo/".concat(v(this,lt).name,"/query")}},!0);case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),vt.apply(this,arguments)}function yt(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var wt=new WeakMap,bt=new WeakMap,mt=new WeakMap,gt=function(){function t(n){var r=n.apiWrapper,o=n.name;e(this,t),yt(this,wt,{writable:!0,value:null}),yt(this,bt,{writable:!0,value:new Map}),yt(this,mt,{writable:!0,value:null}),y(this,wt,r),y(this,mt,o)}return a(t,[{key:"collection",value:function(e){var t=v(this,bt).get(e);return t||(t=new ht({name:e,apiWrapper:v(this,wt),database:this}),v(this,bt).set(e,t)),t}},{key:"name",get:function(){return v(this,mt)}}]),t}();function kt(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var xt=new WeakMap,Ot=new WeakMap,jt=function(){function t(n){var r=n.apiWrapper;e(this,t),kt(this,xt,{writable:!0,value:null}),kt(this,Ot,{writable:!0,value:new Map}),y(this,xt,r)}return a(t,[{key:"collection",value:function(e){return this.db().collection(e)}},{key:"db",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default",t=v(this,Ot).get(e);return t||(t=new gt({name:e,apiWrapper:v(this,xt)}),v(this,Ot).set(e,t)),t}}]),t}();function St(e,t){_t(e,t),t.add(e)}function Et(e,t,n){_t(e,t),t.set(e,n)}function _t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wt(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Lt=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,Tt=new WeakSet,Dt=new WeakSet,Rt=function(){function t(n){var r=n.apiWrapper,o=n.name;e(this,t),St(this,Dt),St(this,Tt),Et(this,Lt,{writable:!0,value:null}),Et(this,Mt,{writable:!0,value:null}),Et(this,Pt,{writable:!0,value:null}),y(this,Lt,r),y(this,Mt,ke.create({baseURL:"".concat(K,"/cdn/buckets/").concat(o),timeout:12e4})),y(this,Pt,o)}var n,r,o,i;return a(t,[{key:"createFile",value:(i=_(W.mark((function u(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:[],o.next=3,Wt(this,Tt,Ct).call(this,I,e,t,n);case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),u,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"deleteFile",value:(o=_(W.mark((function s(e){var t,n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return t=r.length>1&&r[1]!==undefined?r[1]:[],o.next=3,Wt(this,Dt,Nt).call(this,B,e,t);case 3:return n=o.sent,o.next=6,v(this,Mt)["delete"]("/files",{file:{name:e,prefix:t}},{"X-Void-Bucket-Token":n});case 6:case"end":return o.stop()}}),s,this)}))),function(e){return o.apply(this,arguments)})},{key:"listFiles",value:(r=_(W.mark((function c(){var e,t,n,r,o,i,a,u,s,l,f,p=arguments;return W.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return e=p.length>0&&p[0]!==undefined?p[0]:{},t=e.limit,n=void 0===t?50:t,r=e.offset,o=void 0===r?0:r,i=e.prefix,a=void 0===i?[]:i,c.next=3,Wt(this,Dt,Nt).call(this,z,null,a);case 3:return u=c.sent,s=J({limit:n,offset:o,prefix:a}),c.next=7,v(this,Mt).get("/files?".concat(s),{"X-Void-Bucket-Token":u});case 7:return l=c.sent,f=l.data,c.abrupt("return",f.items);case 10:case"end":return c.stop()}}),c,this)}))),function(){return r.apply(this,arguments)})},{key:"name",get:function(){return v(this,Pt)}},{key:"updateFile",value:(n=_(W.mark((function l(e,t){var n,r=arguments;return W.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:[],o.next=3,Wt(this,Tt,Ct).call(this,q,e,t,n);case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),l,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}();function Ct(e,t,n){return At.apply(this,arguments)}function At(){return At=_(W.mark((function e(t,n,r){var o,i,a,u,s=arguments;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&s[3]!==undefined?s[3]:[],e.next=3,Wt(this,Dt,Nt).call(this,t,r,o);case 3:return i=e.sent,e.next=6,v(this,Mt).post("/files",{file:n,name:r,prefix:o},{"Content-Type":"multipart/form-data","X-Void-Bucket-Token":i});case 6:return a=e.sent,u=a.data,e.abrupt("return",u.item);case 9:case"end":return e.stop()}}),e,this)}))),At.apply(this,arguments)}function Nt(e,t){return Ut.apply(this,arguments)}function Ut(){return Ut=_(W.mark((function e(t,n){var r,o,i,a=arguments;return W.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&a[2]!==undefined?a[2]:[],e.next=3,v(this,Lt).callMethod({method:"post"},{payload:{data:{file:{name:n,prefix:r},operation_type:t},url:"/auth/buckets/".concat(v(this,Pt),"/create-token")}});case 3:return o=e.sent,i=o.data,e.abrupt("return",i.token);case 6:case"end":return e.stop()}}),e,this)}))),Ut.apply(this,arguments)}function Ft(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var It=new WeakMap,Bt=new WeakMap,zt=function(){function t(n){var r=n.apiWrapper;e(this,t),Ft(this,It,{writable:!0,value:null}),Ft(this,Bt,{writable:!0,value:new Map}),y(this,It,r)}return a(t,[{key:"bucket",value:function(e){var t=v(this,Bt).get(e);return t||(t=new Rt({name:e,apiWrapper:v(this,It)}),v(this,Bt).set(e,t)),t}}]),t}();function qt(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Gt=new WeakMap,Kt=new WeakMap,Jt=new WeakMap,Vt=new WeakMap,Xt=function(){function t(n){var r=this,o=n.apiWrapperConfig,i=void 0===o?{}:o,a=n.project,u=n.storageDriver;e(this,t),qt(this,Gt,{writable:!0,value:null}),qt(this,Kt,{writable:!0,value:null}),qt(this,Jt,{writable:!0,value:null}),qt(this,Vt,{writable:!0,value:null}),u||(u=G?new x:null);var s=new De({project:a,storageDriver:u,config:i});s.on("error",(function(e){if(e.code===j.ApiErrorCode.AuthenticationFailed)v(r,Gt).signOut(!0)["catch"]((function(e){return console.error(e)}));else if(e.code===j.ApiErrorCode.RealtimeTransport)console.error("realtime error:",e);else{var t;console.error("api error",e,"Status code:",null==e||null===(t=e.response)||void 0===t?void 0:t.status)}})),y(this,Gt,new Ke({apiWrapper:s,storageDriver:u})),y(this,Kt,new rt({apiWrapper:s})),y(this,Jt,new jt({apiWrapper:s})),y(this,Vt,new zt({apiWrapper:s}))}return a(t,[{key:"auth",get:function(){return v(this,Gt)}},{key:"function",value:function(e){return v(this,Kt).getFunction(e)}},{key:"mongo",get:function(){return v(this,Jt)}},{key:"storage",get:function(){return v(this,Vt)}}]),t}()})(),i})())); | ||
//# sourceMappingURL=index.browser.js.map |
{ | ||
"name": "@voidwalkers/void-client", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"description": "Client lib for Void Walkers Void", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -75,3 +75,3 @@ import axios from 'axios'; | ||
}, | ||
url: `auth/buckets/${this.#name}/create-token` | ||
url: `/auth/buckets/${this.#name}/create-token` | ||
} | ||
@@ -78,0 +78,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
205772