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

@pubkeeper/client

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pubkeeper/client - npm Package Compare versions

Comparing version 4.0.0-rc.4 to 4.0.0

2

dist/index.js

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

module.exports=function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=o(r(1));e.PubkeeperClient=n.default},function(t,e,r){"use strict";var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},s=this&&this.__rest||function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&(r[o[n]]=t[o[n]])}return r},u=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,n,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},a=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=c(r(2)),p=c(r(3)),f=c(r(4)),_=r(5),d=r(8),v=c(r(9)),y=Symbol("event:failed"),h=Symbol("event:ready"),m=l.default("pk:client:info"),b=function(t){throw new Error(t)},w=0,E=function(t){function e(e){var r=t.call(this)||this;r._attempt=0,r._retryID=null,r._status=d.Status.DISCONNECTED,r._wsc=null,r._brewers=new Map,r._patrons=new Map,r._onOpen=function(t){var e=t.target;r.setStatus(d.Status.CONNECTED),m("connected"),r.emit("connected"),r._wsc=e,r._protocol&&(r._protocol.close(),r._protocol=void 0);var o={error:function(t){r.emit("error",t)},fail:function(t,e){t instanceof Error?r.emit("error",t):"string"==typeof t&&r.emit("error",new Error(t)),r.disconnect("number"==typeof t?t:e)},ready:function(){r.emit(h)},send:function(t){e.send(t)}};if(r._protocols.has(e.protocol)){var n=r._protocols.get(e.protocol);r._protocol=new n(r._protocolConfig,o),r._brewers.forEach(function(t,e){r._protocol.addBrewer(e,t,!1)}),r._patrons.forEach(function(t,e){r._protocol.addPatron(e,t,!1)}),r._wsc.addEventListener("message",r._protocol.onMessage),r._protocol.open()}else r._wsc.close(4999,"unacceptable protocol: '"+e.protocol+"'")},r._onClose=function(t){var e=t.target,o=t.code,n=t.reason;if(e.removeEventListener("open",r._onOpen),e.removeEventListener("close",r._onClose),r._protocol&&e.removeEventListener("close",r._protocol.onMessage),r._wsc=null,r.emit("closed"),1e3!==o&&1001!==o||(r._attempt=0),1e3===o)return r.setStatus(d.Status.DISCONNECTED),r._protocol&&(r._protocol.close(),r._protocol=void 0),r.emit(y),void m("closed");if(m("closed with unexpected code (%d): %j",o,n),r._attempt>r._maxRetries)return m("too many attempts, giving up"),r._attempt=0,r.setStatus(d.Status.DEAD),void r.emit(y);r.setStatus(d.Status.RECONNECTING);var i=r._attempt-1,s=Math.pow(2,i),u=Math.floor(f.default(0,r._maxTimeout,100*(s+Math.random()*s)));m("waiting "+u+"ms"),r._retryID=setTimeout(function(){r._retryID=null,r.tryConnect()},u)};var o=e.maxRetries,n=void 0===o?1/0:o,u=e.maxTimeout,c=void 0===u?1e4:u,l=e.protocols,p=void 0===l?new Map:l,v=e.server,w=void 0===v?b('"server" key is required in config'):v,E=e.WebSocket,O=void 0===E?WebSocket||b('"webSocket" key is required in config'):E,C=e.brews,N=void 0===C?[]:C,S=e.crypto,g=void 0===S?new Map:S,D=e.jwt,P=void 0===D?b('"jwt" key is required in config'):D,j=s(e,["maxRetries","maxTimeout","protocols","server","WebSocket","brews","crypto","jwt"]);return r._webSocket=O,r._maxTimeout=c,r._maxRetries=n,r._protocols=new Map(a(p.entries())),r._server=w,r._protocolConfig=i({brews:a(N),crypto:new Map(a(_.builtinCrypto.entries(),g.entries())),jwt:P},j),r}return n(e,t),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),e.prototype.connect=function(t){var e=this,r=(void 0===t?{}:t).wait,o=void 0===r||r;if(null!==this._wsc&&this._wsc.readyState<=1)return Promise.resolve(this);var n=o?new Promise(function(t,r){var o=function(){e.removeListener(h,t),r(new Error("unable to connect"))};e.once(h,function(){e.removeListener(y,o),t(e)}),e.once(y,o)}):Promise.resolve(this);return this.tryConnect(),n},e.prototype.disconnect=function(t){var e=this;void 0===t&&(t=1e3),null!==this._retryID&&(clearTimeout(this._retryID),this._retryID=null),this._protocol&&(this._brewers.forEach(function(t,r){return e._protocol.removeBrewer(r)}),this._patrons.forEach(function(t,r){return e._protocol.removePatron(r)})),null!==this._wsc&&this._wsc.close(t),1e3===t&&(this._attempt=0)},e.prototype.addBrewer=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=function(t){return Symbol("pk.brewer_"+w+++"["+t+"]")}(t),n=u(v.default(e),2),i=[t,n[0],n[1]];return this._brewers.set(o,i),this._status===d.Status.CONNECTED&&this._protocol.addBrewer(o,i,!0),o},e.prototype.removeBrewer=function(t){if(!this._brewers.delete(t))throw new Error("brewer wasn't registered");this._status===d.Status.CONNECTED&&this._protocol.removeBrewer(t)},e.prototype.addPatron=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=function(t){return Symbol("pk.patron_"+w+++"["+t+"]")}(t),n=u(v.default(e),2),i=[t,n[0],n[1]];return this._patrons.set(o,i),this._status===d.Status.CONNECTED&&this._protocol.addPatron(o,i,!0),o},e.prototype.removePatron=function(t){if(!this._patrons.delete(t))throw new Error("patron wasn't registered");this._status===d.Status.CONNECTED&&this._protocol.removePatron(t)},e.prototype.setStatus=function(t){this._status=t,this.emit("statuschange",{target:this,status:t})},e.prototype.tryConnect=function(){this._attempt+=1,m("attempting connection"),this.setStatus(d.Status.CONNECTING);var t=a(this._protocols.keys()),e=new this._webSocket(this._server,t);e.binaryType="arraybuffer",e.addEventListener("open",this._onOpen),e.addEventListener("close",this._onClose)},e.CONNECTING=d.Status.CONNECTING,e.CONNECTED=d.Status.CONNECTED,e.RECONNECTING=d.Status.RECONNECTING,e.DISCONNECTED=d.Status.DISCONNECTED,e.DEAD=d.Status.DEAD,e}(p.default);e.default=E},function(t,e){t.exports=require("debug")},function(t,e){t.exports=require("eventemitter3")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){return Math.max(t,Math.min(e,r))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=r(6),n=r(7);e.builtinCrypto=new Map([n.setDefault(o.PubkeeperNoneCrypto),o.PubkeeperNoneCrypto])},function(t,e){t.exports=require("@pubkeeper/crypto-none")},function(t,e){t.exports=require("@pubkeeper/default-cipher-helpers")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.DISCONNECTED="disconnected",t.DEAD="dead"}(e.Status||(e.Status={}))},function(t,e,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,n,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){void 0===e&&(e={});var r=e.options,i=void 0===r?{}:r,s=e.callback;if(0===t.length)return[i,s];if(1===t.length){var u=n(t,1)[0];return"function"==typeof u?[i,u]:"object"==typeof u?[o({},i,u),s]:[i,s]}var a=n(t.slice(0,2),2),c=a[0],l=a[1];return"object"!=typeof c?[i,s]:"function"!=typeof l?[i,s]:[o({},i,c),l]}}]);
module.exports=function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=o(r(1));e.PubkeeperClient=n.default},function(t,e,r){"use strict";var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},s=this&&this.__rest||function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&(r[o[n]]=t[o[n]])}return r},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,n,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},c=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=u(r(2)),f=u(r(3)),p=u(r(4)),_=r(5),d=u(r(6)),v=Symbol("event:failed"),h=Symbol("event:ready"),y=l.default("pk:client:info"),m=function(t){throw new Error(t)},b=0,w=function(t){function e(e){var r=t.call(this)||this;r._attempt=0,r._retryID=null,r._status=_.Status.DISCONNECTED,r._wsc=null,r._brewers=new Map,r._patrons=new Map,r._onOpen=function(t){var e=t.target;r.setStatus(_.Status.CONNECTED),y("connected"),r.emit("connected"),r._wsc=e,r._protocol&&(r._protocol.close(),r._protocol=void 0);var o={error:function(t){r.emit("error",t)},fail:function(t,e){t instanceof Error?r.emit("error",t):"string"==typeof t&&r.emit("error",new Error(t)),r.disconnect("number"==typeof t?t:e)},ready:function(){r.emit(h)},send:function(t){e.send(t)}};if(r._protocols.has(e.protocol)){var n=r._protocols.get(e.protocol);r._protocol=new n(r._protocolConfig,o),r._brewers.forEach(function(t,e){r._protocol.addBrewer(e,t,!1)}),r._patrons.forEach(function(t,e){r._protocol.addPatron(e,t,!1)}),r._wsc.addEventListener("message",r._protocol.onMessage),r._protocol.open()}else r._wsc.close(4999,"unacceptable protocol: '"+e.protocol+"'")},r._onClose=function(t){var e=t.target,o=t.code,n=t.reason;if(e.removeEventListener("open",r._onOpen),e.removeEventListener("close",r._onClose),r._protocol&&e.removeEventListener("close",r._protocol.onMessage),r._wsc=null,r.emit("closed"),1e3!==o&&1001!==o||(r._attempt=0),1e3===o)return r.setStatus(_.Status.DISCONNECTED),r._protocol&&(r._protocol.close(),r._protocol=void 0),r.emit(v),void y("closed");if(y("closed with unexpected code (%d): %j",o,n),r._attempt>r._maxRetries)return y("too many attempts, giving up"),r._attempt=0,r.setStatus(_.Status.DEAD),void r.emit(v);r.setStatus(_.Status.RECONNECTING);var i=r._attempt-1,s=Math.pow(2,i),a=Math.floor(p.default(0,r._maxTimeout,100*(s+Math.random()*s)));y("waiting "+a+"ms"),r._retryID=setTimeout(function(){r._retryID=null,r.tryConnect()},a)};var o=e.maxRetries,n=void 0===o?1/0:o,a=e.maxTimeout,u=void 0===a?1e4:a,l=e.protocols,f=void 0===l?new Map:l,d=e.server,b=void 0===d?m('"server" key is required in config'):d,w=e.WebSocket,E=void 0===w?WebSocket||m('"webSocket" key is required in config'):w,O=e.brews,C=void 0===O?[]:O,N=e.crypto,S=void 0===N?new Map:N,g=e.jwt,D=void 0===g?m('"jwt" key is required in config'):g,T=s(e,["maxRetries","maxTimeout","protocols","server","WebSocket","brews","crypto","jwt"]);return r._webSocket=E,r._maxTimeout=u,r._maxRetries=n,r._protocols=new Map(c(f.entries())),r._server=b,r._protocolConfig=i({brews:c(C),crypto:new Map(c(S.entries())),jwt:D},T),r}return n(e,t),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),e.prototype.connect=function(t){var e=this,r=(void 0===t?{}:t).wait,o=void 0===r||r;if(null!==this._wsc&&this._wsc.readyState<=1)return Promise.resolve(this);var n=o?new Promise(function(t,r){var o=function(){e.removeListener(h,t),r(new Error("unable to connect"))};e.once(h,function(){e.removeListener(v,o),t(e)}),e.once(v,o)}):Promise.resolve(this);return this.tryConnect(),n},e.prototype.disconnect=function(t){var e=this;void 0===t&&(t=1e3),null!==this._retryID&&(clearTimeout(this._retryID),this._retryID=null),this._protocol&&(this._brewers.forEach(function(t,r){return e._protocol.removeBrewer(r)}),this._patrons.forEach(function(t,r){return e._protocol.removePatron(r)})),null!==this._wsc&&this._wsc.close(t),1e3===t&&(this._attempt=0)},e.prototype.addBrewer=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=function(t){return Symbol("pk.brewer_"+b+++"["+t+"]")}(t),n=a(d.default(e),2),i=[t,n[0],n[1]];return this._brewers.set(o,i),this._status===_.Status.CONNECTED&&this._protocol.addBrewer(o,i,!0),o},e.prototype.removeBrewer=function(t){if(!this._brewers.delete(t))throw new Error("brewer wasn't registered");this._status===_.Status.CONNECTED&&this._protocol.removeBrewer(t)},e.prototype.addPatron=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=function(t){return Symbol("pk.patron_"+b+++"["+t+"]")}(t),n=a(d.default(e),2),i=[t,n[0],n[1]];return this._patrons.set(o,i),this._status===_.Status.CONNECTED&&this._protocol.addPatron(o,i,!0),o},e.prototype.removePatron=function(t){if(!this._patrons.delete(t))throw new Error("patron wasn't registered");this._status===_.Status.CONNECTED&&this._protocol.removePatron(t)},e.prototype.setStatus=function(t){this._status=t,this.emit("statuschange",{target:this,status:t})},e.prototype.tryConnect=function(){this._attempt+=1,y("attempting connection"),this.setStatus(_.Status.CONNECTING);var t=c(this._protocols.keys()),e=new this._webSocket(this._server,t);e.binaryType="arraybuffer",e.addEventListener("open",this._onOpen),e.addEventListener("close",this._onClose)},e.CONNECTING=_.Status.CONNECTING,e.CONNECTED=_.Status.CONNECTED,e.RECONNECTING=_.Status.RECONNECTING,e.DISCONNECTED=_.Status.DISCONNECTED,e.DEAD=_.Status.DEAD,e}(f.default);e.default=w},function(t,e){t.exports=require("debug")},function(t,e){t.exports=require("eventemitter3")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){return Math.max(t,Math.min(e,r))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.DISCONNECTED="disconnected",t.DEAD="dead"}(e.Status||(e.Status={}))},function(t,e,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,n,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){void 0===e&&(e={});var r=e.options,i=void 0===r?{}:r,s=e.callback;if(0===t.length)return[i,s];if(1===t.length){var a=n(t,1)[0];return"function"==typeof a?[i,a]:"object"==typeof a?[o({},i,a),s]:[i,s]}var c=n(t.slice(0,2),2),u=c[0],l=c[1];return"object"!=typeof u?[i,s]:"function"!=typeof l?[i,s]:[o({},i,u),l]}}]);
//# sourceMappingURL=index.js.map

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

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(e,t){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0}),t.PubkeeperNoneCrypto=["NONE",function(){return{get mode(){return"NONE"},get key(){return""},encrypt:function(e){return new Uint8Array(o(e))},decrypt:function(e){return new Uint8Array(o(e))}}}]}])},function(e,t,r){(function(n){var o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};t.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"object"==typeof console&&console.log&&console.log.apply(console,i(e))},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(5)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(4))},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function i(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function c(e,t,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new s(r,n||e,i),a=o?o+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],c]:e._events[a].push(c):(e._events[a]=c,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),u.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},u.prototype.listeners=function(e){var t=o?o+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,s=new Array(i);n<i;n++)s[n]=r[n].fn;return s},u.prototype.listenerCount=function(e){var t=o?o+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,n,i,s){var c=o?o+e:e;if(!this._events[c])return!1;var a,u,f=this._events[c],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,r),!0;case 4:return f.fn.call(f.context,t,r,n),!0;case 5:return f.fn.call(f.context,t,r,n,i),!0;case 6:return f.fn.call(f.context,t,r,n,i,s),!0}for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];f.fn.apply(f.context,a)}else{var p,d=f.length;for(u=0;u<d;u++)switch(f[u].once&&this.removeListener(e,f[u].fn,void 0,!0),l){case 1:f[u].fn.call(f[u].context);break;case 2:f[u].fn.call(f[u].context,t);break;case 3:f[u].fn.call(f[u].context,t,r);break;case 4:f[u].fn.call(f[u].context,t,r,n);break;default:if(!a)for(p=1,a=new Array(l-1);p<l;p++)a[p-1]=arguments[p];f[u].fn.apply(f[u].context,a)}}return!0},u.prototype.on=function(e,t,r){return c(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return c(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,r,n){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||a(this,i);else{for(var c=0,u=[],f=s.length;c<f;c++)(s[c].fn!==t||n&&!s[c].once||r&&s[c].context!==r)&&u.push(s[c]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=o,u.EventEmitter=u,e.exports=u},function(e,t){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CIPHER=Symbol.for("Pubkeeper.defaultCipher"),t.setDefault=function(e){var r=n(e,2)[1];return[t.DEFAULT_CIPHER,r]},t.getDefault=function(e){return e.get(t.DEFAULT_CIPHER)}}])},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,u=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?u=a.concat(u):l=-1,u.length&&d())}function d(){if(!f){var e=c(p);f=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||f||c(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e};e.exports=function(e){function t(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){var r;function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(o.enabled){var i=o,s=Number(new Date),c=s-(r||s);i.diff=c,i.prev=r,i.curr=s,r=s,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");var a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,function(t,r){if("%%"===t)return t;a++;var o=n.formatters[r];if("function"==typeof o){var s=e[a];t=o.call(i,s),e.splice(a,1),a--}return t}),n.formatArgs.call(i,e),(i.log||n.log).apply(i,e)}}return o.namespace=e,o.enabled=n.enabled(e),o.useColors=n.useColors(),o.color=t(e),o.destroy=i,o.extend=s,"function"==typeof n.init&&n.init(o),n.instances.push(o),o}function i(){var e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function s(e,t){var r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function c(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){var e=o(n.names.map(c),n.skips.map(c).map(function(e){return"-"+e})).join(",");return n.enable(""),e},n.enable=function(e){var t;n.save(e),n.names=[],n.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){var i=n.instances[t];i.enabled=n.enabled(i.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(6),Object.keys(e).forEach(function(t){n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,s=7*i,c=365.25*i;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*c;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return a(e,t,i,"day");if(t>=o)return a(e,t,o,"hour");if(t>=n)return a(e,t,n,"minute");if(t>=r)return a(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=o)return Math.round(e/o)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";r.r(t);var n,o=r(1),i=r.n(o),s=r(2),c=r.n(s),a=function(e,t,r){return Math.max(e,Math.min(t,r))},u=r(0),f=r(3),l=new Map([Object(f.setDefault)(u.PubkeeperNoneCrypto),u.PubkeeperNoneCrypto]);!function(e){e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.DISCONNECTED="disconnected",e.DEAD="dead"}(n||(n={}));var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},d=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};function h(e,t){void 0===t&&(t={});var r=t.options,n=void 0===r?{}:r,o=t.callback;if(0===e.length)return[n,o];if(1===e.length){var i=d(e,1)[0];return"function"==typeof i?[n,i]:"object"==typeof i?[p({},n,i),o]:[n,o]}var s=d(e.slice(0,2),2),c=s[0],a=s[1];return"object"!=typeof c?[n,o]:"function"!=typeof a?[n,o]:[p({},n,c),a]}var v,y=(v=function(e,t){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),m=function(){return(m=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},C=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(r[n[o]]=e[n[o]])}return r},_=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},b=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e},g=Symbol("event:failed"),w=Symbol("event:ready"),E=i()("pk:client:info"),O=function(e){throw new Error(e)},F=0,x=function(e){function t(t){var r=e.call(this)||this;r._attempt=0,r._retryID=null,r._status=n.DISCONNECTED,r._wsc=null,r._brewers=new Map,r._patrons=new Map,r._onOpen=function(e){var t=e.target;r.setStatus(n.CONNECTED),E("connected"),r.emit("connected"),r._wsc=t,r._protocol&&(r._protocol.close(),r._protocol=void 0);var o={error:function(e){r.emit("error",e)},fail:function(e,t){e instanceof Error?r.emit("error",e):"string"==typeof e&&r.emit("error",new Error(e)),r.disconnect("number"==typeof e?e:t)},ready:function(){r.emit(w)},send:function(e){t.send(e)}};if(r._protocols.has(t.protocol)){var i=r._protocols.get(t.protocol);r._protocol=new i(r._protocolConfig,o),r._brewers.forEach(function(e,t){r._protocol.addBrewer(t,e,!1)}),r._patrons.forEach(function(e,t){r._protocol.addPatron(t,e,!1)}),r._wsc.addEventListener("message",r._protocol.onMessage),r._protocol.open()}else r._wsc.close(4999,"unacceptable protocol: '"+t.protocol+"'")},r._onClose=function(e){var t=e.target,o=e.code,i=e.reason;if(t.removeEventListener("open",r._onOpen),t.removeEventListener("close",r._onClose),r._protocol&&t.removeEventListener("close",r._protocol.onMessage),r._wsc=null,r.emit("closed"),1e3!==o&&1001!==o||(r._attempt=0),1e3===o)return r.setStatus(n.DISCONNECTED),r._protocol&&(r._protocol.close(),r._protocol=void 0),r.emit(g),void E("closed");if(E("closed with unexpected code (%d): %j",o,i),r._attempt>r._maxRetries)return E("too many attempts, giving up"),r._attempt=0,r.setStatus(n.DEAD),void r.emit(g);r.setStatus(n.RECONNECTING);var s=r._attempt-1,c=Math.pow(2,s),u=Math.floor(a(0,r._maxTimeout,100*(c+Math.random()*c)));E("waiting "+u+"ms"),r._retryID=setTimeout(function(){r._retryID=null,r.tryConnect()},u)};var o=t.maxRetries,i=void 0===o?1/0:o,s=t.maxTimeout,c=void 0===s?1e4:s,u=t.protocols,f=void 0===u?new Map:u,p=t.server,d=void 0===p?O('"server" key is required in config'):p,h=t.WebSocket,v=void 0===h?WebSocket||O('"webSocket" key is required in config'):h,y=t.brews,_=void 0===y?[]:y,F=t.crypto,x=void 0===F?new Map:F,N=t.jwt,S=void 0===N?O('"jwt" key is required in config'):N,T=C(t,["maxRetries","maxTimeout","protocols","server","WebSocket","brews","crypto","jwt"]);return r._webSocket=v,r._maxTimeout=c,r._maxRetries=i,r._protocols=new Map(b(f.entries())),r._server=d,r._protocolConfig=m({brews:b(_),crypto:new Map(b(l.entries(),x.entries())),jwt:S},T),r}return y(t,e),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),t.prototype.connect=function(e){var t=this,r=(void 0===e?{}:e).wait,n=void 0===r||r;if(null!==this._wsc&&this._wsc.readyState<=1)return Promise.resolve(this);var o=n?new Promise(function(e,r){var n=function(){t.removeListener(w,e),r(new Error("unable to connect"))};t.once(w,function(){t.removeListener(g,n),e(t)}),t.once(g,n)}):Promise.resolve(this);return this.tryConnect(),o},t.prototype.disconnect=function(e){var t=this;void 0===e&&(e=1e3),null!==this._retryID&&(clearTimeout(this._retryID),this._retryID=null),this._protocol&&(this._brewers.forEach(function(e,r){return t._protocol.removeBrewer(r)}),this._patrons.forEach(function(e,r){return t._protocol.removePatron(r)})),null!==this._wsc&&this._wsc.close(e),1e3===e&&(this._attempt=0)},t.prototype.addBrewer=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.brewer_"+F+++"["+e+"]")}(e),i=_(h(t),2),s=[e,i[0],i[1]];return this._brewers.set(o,s),this._status===n.CONNECTED&&this._protocol.addBrewer(o,s,!0),o},t.prototype.removeBrewer=function(e){if(!this._brewers.delete(e))throw new Error("brewer wasn't registered");this._status===n.CONNECTED&&this._protocol.removeBrewer(e)},t.prototype.addPatron=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.patron_"+F+++"["+e+"]")}(e),i=_(h(t),2),s=[e,i[0],i[1]];return this._patrons.set(o,s),this._status===n.CONNECTED&&this._protocol.addPatron(o,s,!0),o},t.prototype.removePatron=function(e){if(!this._patrons.delete(e))throw new Error("patron wasn't registered");this._status===n.CONNECTED&&this._protocol.removePatron(e)},t.prototype.setStatus=function(e){this._status=e,this.emit("statuschange",{target:this,status:e})},t.prototype.tryConnect=function(){this._attempt+=1,E("attempting connection"),this.setStatus(n.CONNECTING);var e=b(this._protocols.keys()),t=new this._webSocket(this._server,e);t.binaryType="arraybuffer",t.addEventListener("open",this._onOpen),t.addEventListener("close",this._onClose)},t.CONNECTING=n.CONNECTING,t.CONNECTED=n.CONNECTED,t.RECONNECTING=n.RECONNECTING,t.DISCONNECTED=n.DISCONNECTED,t.DEAD=n.DEAD,t}(c.a);r.d(t,"PubkeeperClient",function(){return x})}])});
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){(function(n){var o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};t.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"object"==typeof console&&console.log&&console.log.apply(console,i(e))},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(3)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(2))},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function i(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function c(e,t,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new s(r,n||e,i),a=o?o+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],c]:e._events[a].push(c):(e._events[a]=c,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),u.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},u.prototype.listeners=function(e){var t=o?o+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,s=new Array(i);n<i;n++)s[n]=r[n].fn;return s},u.prototype.listenerCount=function(e){var t=o?o+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,n,i,s){var c=o?o+e:e;if(!this._events[c])return!1;var a,u,f=this._events[c],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,r),!0;case 4:return f.fn.call(f.context,t,r,n),!0;case 5:return f.fn.call(f.context,t,r,n,i),!0;case 6:return f.fn.call(f.context,t,r,n,i,s),!0}for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];f.fn.apply(f.context,a)}else{var p,h=f.length;for(u=0;u<h;u++)switch(f[u].once&&this.removeListener(e,f[u].fn,void 0,!0),l){case 1:f[u].fn.call(f[u].context);break;case 2:f[u].fn.call(f[u].context,t);break;case 3:f[u].fn.call(f[u].context,t,r);break;case 4:f[u].fn.call(f[u].context,t,r,n);break;default:if(!a)for(p=1,a=new Array(l-1);p<l;p++)a[p-1]=arguments[p];f[u].fn.apply(f[u].context,a)}}return!0},u.prototype.on=function(e,t,r){return c(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return c(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,r,n){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||a(this,i);else{for(var c=0,u=[],f=s.length;c<f;c++)(s[c].fn!==t||n&&!s[c].once||r&&s[c].context!==r)&&u.push(s[c]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=o,u.EventEmitter=u,e.exports=u},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,u=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!f){var e=c(p);f=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||f||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e};e.exports=function(e){function t(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){var r;function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(o.enabled){var i=o,s=Number(new Date),c=s-(r||s);i.diff=c,i.prev=r,i.curr=s,r=s,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");var a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,function(t,r){if("%%"===t)return t;a++;var o=n.formatters[r];if("function"==typeof o){var s=e[a];t=o.call(i,s),e.splice(a,1),a--}return t}),n.formatArgs.call(i,e),(i.log||n.log).apply(i,e)}}return o.namespace=e,o.enabled=n.enabled(e),o.useColors=n.useColors(),o.color=t(e),o.destroy=i,o.extend=s,"function"==typeof n.init&&n.init(o),n.instances.push(o),o}function i(){var e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function s(e,t){var r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function c(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){var e=o(n.names.map(c),n.skips.map(c).map(function(e){return"-"+e})).join(",");return n.enable(""),e},n.enable=function(e){var t;n.save(e),n.names=[],n.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){var i=n.instances[t];i.enabled=n.enabled(i.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(4),Object.keys(e).forEach(function(t){n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,s=7*i,c=365.25*i;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*c;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return a(e,t,i,"day");if(t>=o)return a(e,t,o,"hour");if(t>=n)return a(e,t,n,"minute");if(t>=r)return a(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=o)return Math.round(e/o)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";r.r(t);var n,o=r(0),i=r.n(o),s=r(1),c=r.n(s),a=function(e,t,r){return Math.max(e,Math.min(t,r))};!function(e){e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.DISCONNECTED="disconnected",e.DEAD="dead"}(n||(n={}));var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},f=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};function l(e,t){void 0===t&&(t={});var r=t.options,n=void 0===r?{}:r,o=t.callback;if(0===e.length)return[n,o];if(1===e.length){var i=f(e,1)[0];return"function"==typeof i?[n,i]:"object"==typeof i?[u({},n,i),o]:[n,o]}var s=f(e.slice(0,2),2),c=s[0],a=s[1];return"object"!=typeof c?[n,o]:"function"!=typeof a?[n,o]:[u({},n,c),a]}var p,h=(p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(r[n[o]]=e[n[o]])}return r},y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},C=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e},m=Symbol("event:failed"),_=Symbol("event:ready"),w=i()("pk:client:info"),g=function(e){throw new Error(e)},b=0,E=function(e){function t(t){var r=e.call(this)||this;r._attempt=0,r._retryID=null,r._status=n.DISCONNECTED,r._wsc=null,r._brewers=new Map,r._patrons=new Map,r._onOpen=function(e){var t=e.target;r.setStatus(n.CONNECTED),w("connected"),r.emit("connected"),r._wsc=t,r._protocol&&(r._protocol.close(),r._protocol=void 0);var o={error:function(e){r.emit("error",e)},fail:function(e,t){e instanceof Error?r.emit("error",e):"string"==typeof e&&r.emit("error",new Error(e)),r.disconnect("number"==typeof e?e:t)},ready:function(){r.emit(_)},send:function(e){t.send(e)}};if(r._protocols.has(t.protocol)){var i=r._protocols.get(t.protocol);r._protocol=new i(r._protocolConfig,o),r._brewers.forEach(function(e,t){r._protocol.addBrewer(t,e,!1)}),r._patrons.forEach(function(e,t){r._protocol.addPatron(t,e,!1)}),r._wsc.addEventListener("message",r._protocol.onMessage),r._protocol.open()}else r._wsc.close(4999,"unacceptable protocol: '"+t.protocol+"'")},r._onClose=function(e){var t=e.target,o=e.code,i=e.reason;if(t.removeEventListener("open",r._onOpen),t.removeEventListener("close",r._onClose),r._protocol&&t.removeEventListener("close",r._protocol.onMessage),r._wsc=null,r.emit("closed"),1e3!==o&&1001!==o||(r._attempt=0),1e3===o)return r.setStatus(n.DISCONNECTED),r._protocol&&(r._protocol.close(),r._protocol=void 0),r.emit(m),void w("closed");if(w("closed with unexpected code (%d): %j",o,i),r._attempt>r._maxRetries)return w("too many attempts, giving up"),r._attempt=0,r.setStatus(n.DEAD),void r.emit(m);r.setStatus(n.RECONNECTING);var s=r._attempt-1,c=Math.pow(2,s),u=Math.floor(a(0,r._maxTimeout,100*(c+Math.random()*c)));w("waiting "+u+"ms"),r._retryID=setTimeout(function(){r._retryID=null,r.tryConnect()},u)};var o=t.maxRetries,i=void 0===o?1/0:o,s=t.maxTimeout,c=void 0===s?1e4:s,u=t.protocols,f=void 0===u?new Map:u,l=t.server,p=void 0===l?g('"server" key is required in config'):l,h=t.WebSocket,y=void 0===h?WebSocket||g('"webSocket" key is required in config'):h,b=t.brews,E=void 0===b?[]:b,F=t.crypto,O=void 0===F?new Map:F,x=t.jwt,N=void 0===x?g('"jwt" key is required in config'):x,T=v(t,["maxRetries","maxTimeout","protocols","server","WebSocket","brews","crypto","jwt"]);return r._webSocket=y,r._maxTimeout=c,r._maxRetries=i,r._protocols=new Map(C(f.entries())),r._server=p,r._protocolConfig=d({brews:C(E),crypto:new Map(C(O.entries())),jwt:N},T),r}return h(t,e),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),t.prototype.connect=function(e){var t=this,r=(void 0===e?{}:e).wait,n=void 0===r||r;if(null!==this._wsc&&this._wsc.readyState<=1)return Promise.resolve(this);var o=n?new Promise(function(e,r){var n=function(){t.removeListener(_,e),r(new Error("unable to connect"))};t.once(_,function(){t.removeListener(m,n),e(t)}),t.once(m,n)}):Promise.resolve(this);return this.tryConnect(),o},t.prototype.disconnect=function(e){var t=this;void 0===e&&(e=1e3),null!==this._retryID&&(clearTimeout(this._retryID),this._retryID=null),this._protocol&&(this._brewers.forEach(function(e,r){return t._protocol.removeBrewer(r)}),this._patrons.forEach(function(e,r){return t._protocol.removePatron(r)})),null!==this._wsc&&this._wsc.close(e),1e3===e&&(this._attempt=0)},t.prototype.addBrewer=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.brewer_"+b+++"["+e+"]")}(e),i=y(l(t),2),s=[e,i[0],i[1]];return this._brewers.set(o,s),this._status===n.CONNECTED&&this._protocol.addBrewer(o,s,!0),o},t.prototype.removeBrewer=function(e){if(!this._brewers.delete(e))throw new Error("brewer wasn't registered");this._status===n.CONNECTED&&this._protocol.removeBrewer(e)},t.prototype.addPatron=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.patron_"+b+++"["+e+"]")}(e),i=y(l(t),2),s=[e,i[0],i[1]];return this._patrons.set(o,s),this._status===n.CONNECTED&&this._protocol.addPatron(o,s,!0),o},t.prototype.removePatron=function(e){if(!this._patrons.delete(e))throw new Error("patron wasn't registered");this._status===n.CONNECTED&&this._protocol.removePatron(e)},t.prototype.setStatus=function(e){this._status=e,this.emit("statuschange",{target:this,status:e})},t.prototype.tryConnect=function(){this._attempt+=1,w("attempting connection"),this.setStatus(n.CONNECTING);var e=C(this._protocols.keys()),t=new this._webSocket(this._server,e);t.binaryType="arraybuffer",t.addEventListener("open",this._onOpen),t.addEventListener("close",this._onClose)},t.CONNECTING=n.CONNECTING,t.CONNECTED=n.CONNECTED,t.RECONNECTING=n.RECONNECTING,t.DISCONNECTED=n.DISCONNECTED,t.DEAD=n.DEAD,t}(c.a);r.d(t,"PubkeeperClient",function(){return E})}])});
{
"name": "@pubkeeper/client",
"version": "4.0.0-rc.4",
"version": "4.0.0",
"description": "Pubkeeper javascript SDK",

@@ -52,5 +52,4 @@ "main": "./dist/index.js",

"dependencies": {
"@pubkeeper/crypto-none": "^2.0.0-rc.5",
"@pubkeeper/default-cipher-helpers": "^2.0.0-rc.4",
"@pubkeeper/types": "^1.0.0-rc.4",
"@pubkeeper/default-cipher-helpers": "^2.0.0",
"@pubkeeper/types": "^1.0.0",
"@types/debug": "^0.0.31",

@@ -57,0 +56,0 @@ "debug": "^4.0.1",

@@ -20,6 +20,2 @@ /* tslint:disable:unified-signatures */

import {
builtinCrypto,
} from './crypt';
import { Status } from './statuses';

@@ -108,3 +104,2 @@ import normalizeConfig from './util/normalize-config';

crypto: new Map<Crypto.Key, Crypto.Constructor>([
...builtinCrypto.entries(),
...crypto.entries(),

@@ -111,0 +106,0 @@ ]),

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc