PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/rpc-websockets/dist

Просмотр файла: index.browser-bundle.js

"use strict";var RPCWebsocket=(()=>{var et=Object.create;var je=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty;var O=(r,e)=>()=>(r&&(e=r(r=0)),e);var N=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var it=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of rt(e))!ot.call(r,s)&&s!==n&&je(r,s,{get:()=>e[s],enumerable:!(t=tt(e,s))||t.enumerable});return r};var ct=(r,e,n)=>(n=r!=null?et(nt(r)):{},it(e||!r||!r.__esModule?je(n,"default",{value:r,enumerable:!0}):n,r));function j(r){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(r)}var J=O(()=>{});function de(r,e){if(j(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,e||"default");if(j(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Le=O(()=>{J()});function H(r){var e=de(r,"string");return j(e)=="symbol"?e:e+""}var ve=O(()=>{J();Le()});function Se(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,H(t.key),t)}}function C(r,e,n){return e&&Se(r.prototype,e),n&&Se(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}var Q=O(()=>{ve()});function R(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var U=O(()=>{});function ye(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var Ce=O(()=>{});function F(r,e){if(e&&(j(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ye(r)}var ne=O(()=>{J();Ce()});function L(r){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},L(r)}var oe=O(()=>{});function V(r,e){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},V(r,e)}var Re=O(()=>{});function $(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&V(r,e)}var ie=O(()=>{Re()});function g(r,e,n){return e=H(e),e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}var me=O(()=>{ve()});var ge=N((zt,_e)=>{"use strict";var at=Object.prototype.hasOwnProperty,k="~";function X(){}Object.create&&(X.prototype=Object.create(null),new X().__proto__||(k=!1));function ut(r,e,n){this.fn=r,this.context=e,this.once=n||!1}function qe(r,e,n,t,s){if(typeof n!="function")throw new TypeError("The listener must be a function");var o=new ut(n,t||r,s),a=k?k+e:e;return r._events[a]?r._events[a].fn?r._events[a]=[r._events[a],o]:r._events[a].push(o):(r._events[a]=o,r._eventsCount++),r}function ce(r,e){--r._eventsCount===0?r._events=new X:delete r._events[e]}function b(){this._events=new X,this._eventsCount=0}b.prototype.eventNames=function(){var e=[],n,t;if(this._eventsCount===0)return e;for(t in n=this._events)at.call(n,t)&&e.push(k?t.slice(1):t);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(n)):e};b.prototype.listeners=function(e){var n=k?k+e:e,t=this._events[n];if(!t)return[];if(t.fn)return[t.fn];for(var s=0,o=t.length,a=new Array(o);s<o;s++)a[s]=t[s].fn;return a};b.prototype.listenerCount=function(e){var n=k?k+e:e,t=this._events[n];return t?t.fn?1:t.length:0};b.prototype.emit=function(e,n,t,s,o,a){var l=k?k+e:e;if(!this._events[l])return!1;var c=this._events[l],v=arguments.length,m,y;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),v){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,n),!0;case 3:return c.fn.call(c.context,n,t),!0;case 4:return c.fn.call(c.context,n,t,s),!0;case 5:return c.fn.call(c.context,n,t,s,o),!0;case 6:return c.fn.call(c.context,n,t,s,o,a),!0}for(y=1,m=new Array(v-1);y<v;y++)m[y-1]=arguments[y];c.fn.apply(c.context,m)}else{var E=c.length,S;for(y=0;y<E;y++)switch(c[y].once&&this.removeListener(e,c[y].fn,void 0,!0),v){case 1:c[y].fn.call(c[y].context);break;case 2:c[y].fn.call(c[y].context,n);break;case 3:c[y].fn.call(c[y].context,n,t);break;case 4:c[y].fn.call(c[y].context,n,t,s);break;default:if(!m)for(S=1,m=new Array(v-1);S<v;S++)m[S-1]=arguments[S];c[y].fn.apply(c[y].context,m)}}return!0};b.prototype.on=function(e,n,t){return qe(this,e,n,t,!1)};b.prototype.once=function(e,n,t){return qe(this,e,n,t,!0)};b.prototype.removeListener=function(e,n,t,s){var o=k?k+e:e;if(!this._events[o])return this;if(!n)return ce(this,o),this;var a=this._events[o];if(a.fn)a.fn===n&&(!s||a.once)&&(!t||a.context===t)&&ce(this,o);else{for(var l=0,c=[],v=a.length;l<v;l++)(a[l].fn!==n||s&&!a[l].once||t&&a[l].context!==t)&&c.push(a[l]);c.length?this._events[o]=c.length===1?c[0]:c:ce(this,o)}return this};b.prototype.removeAllListeners=function(e){var n;return e?(n=k?k+e:e,this._events[n]&&ce(this,n)):(this._events=new X,this._eventsCount=0),this};b.prototype.off=b.prototype.removeListener;b.prototype.addListener=b.prototype.on;b.prefixed=k;b.EventEmitter=b;typeof _e<"u"&&(_e.exports=b)});var Me=N(be=>{"use strict";U();Q();ne();oe();ie();me();function st(r,e,n){return e=L(e),F(r,Te()?Reflect.construct(e,n||[],L(r).constructor):e.apply(r,n))}function Te(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Te=function(){return!!r})()}Object.defineProperty(be,"__esModule",{value:!0});var ft=ge(),lt=function(r){function e(n,t,s){var o;return R(this,e),o=st(this,e),g(o,"socket",void 0),o.socket=new window.WebSocket(n,s),o.socket.onopen=function(){return o.emit("open")},o.socket.onmessage=function(a){return o.emit("message",a.data)},o.socket.onerror=function(a){return o.emit("error",a)},o.socket.onclose=function(a){o.emit("close",a.code,a.reason)},o}return $(e,r),C(e,[{key:"send",value:function(t,s,o){var a=o||s;try{this.socket.send(t),a()}catch(l){a(l)}}},{key:"close",value:function(t,s){this.socket.close(t,s)}},{key:"addEventListener",value:function(t,s,o){this.socket.addEventListener(t,s,o)}}])}(ft.EventEmitter);function pt(r,e){return new lt(r,e)}be.default=pt});function Ie(r,e,n,t,s,o,a){try{var l=r[o](a),c=l.value}catch(v){n(v);return}l.done?e(c):Promise.resolve(c).then(t,s)}function K(r){return function(){var e=this,n=arguments;return new Promise(function(t,s){var o=r.apply(e,n);function a(c){Ie(o,t,s,a,l,"next",c)}function l(c){Ie(o,t,s,a,l,"throw",c)}a(void 0)})}}var Ne=O(()=>{});function we(r,e){if(r==null)return{};var n={},t=Object.keys(r),s,o;for(o=0;o<t.length;o++)s=t[o],!(e.indexOf(s)>=0)&&(n[s]=r[s]);return n}var De=O(()=>{});function ke(r,e){if(r==null)return{};var n=we(r,e),t,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(s=0;s<o.length;s++)t=o[s],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}var Ge=O(()=>{De()});var Ae=N((or,q)=>{function xe(r){"@babel/helpers - typeof";return q.exports=xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q.exports.__esModule=!0,q.exports.default=q.exports,xe(r)}q.exports=xe,q.exports.__esModule=!0,q.exports.default=q.exports});var Be=N((ir,T)=>{var Fe=Ae().default;function $e(){"use strict";T.exports=$e=function(){return e},T.exports.__esModule=!0,T.exports.default=T.exports;var r,e={},n=Object.prototype,t=n.hasOwnProperty,s=Object.defineProperty||function(f,i,u){f[i]=u.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function v(f,i,u){return Object.defineProperty(f,i,{value:u,enumerable:!0,configurable:!0,writable:!0}),f[i]}try{v({},"")}catch{v=function(u,p,d){return u[p]=d}}function m(f,i,u,p){var d=i&&i.prototype instanceof ue?i:ue,h=Object.create(d.prototype),_=new pe(p||[]);return s(h,"_invoke",{value:Xe(f,u,_)}),h}function y(f,i,u){try{return{type:"normal",arg:f.call(i,u)}}catch(p){return{type:"throw",arg:p}}}e.wrap=m;var E="suspendedStart",S="suspendedYield",Z="executing",B="completed",P={};function ue(){}function ee(){}function D(){}var se={};v(se,a,function(){return this});var fe=Object.getPrototypeOf,te=fe&&fe(fe(he([])));te&&te!==n&&t.call(te,a)&&(se=te);var W=D.prototype=ue.prototype=Object.create(se);function Pe(f){["next","throw","return"].forEach(function(i){v(f,i,function(u){return this._invoke(i,u)})})}function re(f,i){function u(d,h,_,w){var x=y(f[d],f,h);if(x.type!=="throw"){var G=x.arg,I=G.value;return I&&Fe(I)=="object"&&t.call(I,"__await")?i.resolve(I.__await).then(function(A){u("next",A,_,w)},function(A){u("throw",A,_,w)}):i.resolve(I).then(function(A){G.value=A,_(G)},function(A){return u("throw",A,_,w)})}w(x.arg)}var p;s(this,"_invoke",{value:function(h,_){function w(){return new i(function(x,G){u(h,_,x,G)})}return p=p?p.then(w,w):w()}})}function Xe(f,i,u){var p=E;return function(d,h){if(p===Z)throw Error("Generator is already running");if(p===B){if(d==="throw")throw h;return{value:r,done:!0}}for(u.method=d,u.arg=h;;){var _=u.delegate;if(_){var w=Ee(_,u);if(w){if(w===P)continue;return w}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(p===E)throw p=B,u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);p=Z;var x=y(f,i,u);if(x.type==="normal"){if(p=u.done?B:S,x.arg===P)continue;return{value:x.arg,done:u.done}}x.type==="throw"&&(p=B,u.method="throw",u.arg=x.arg)}}}function Ee(f,i){var u=i.method,p=f.iterator[u];if(p===r)return i.delegate=null,u==="throw"&&f.iterator.return&&(i.method="return",i.arg=r,Ee(f,i),i.method==="throw")||u!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+u+"' method")),P;var d=y(p,f.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,P;var h=d.arg;return h?h.done?(i[f.resultName]=h.value,i.next=f.nextLoc,i.method!=="return"&&(i.method="next",i.arg=r),i.delegate=null,P):h:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,P)}function Ze(f){var i={tryLoc:f[0]};1 in f&&(i.catchLoc=f[1]),2 in f&&(i.finallyLoc=f[2],i.afterLoc=f[3]),this.tryEntries.push(i)}function le(f){var i=f.completion||{};i.type="normal",delete i.arg,f.completion=i}function pe(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(Ze,this),this.reset(!0)}function he(f){if(f||f===""){var i=f[a];if(i)return i.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var u=-1,p=function d(){for(;++u<f.length;)if(t.call(f,u))return d.value=f[u],d.done=!1,d;return d.value=r,d.done=!0,d};return p.next=p}}throw new TypeError(Fe(f)+" is not iterable")}return ee.prototype=D,s(W,"constructor",{value:D,configurable:!0}),s(D,"constructor",{value:ee,configurable:!0}),ee.displayName=v(D,c,"GeneratorFunction"),e.isGeneratorFunction=function(f){var i=typeof f=="function"&&f.constructor;return!!i&&(i===ee||(i.displayName||i.name)==="GeneratorFunction")},e.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,D):(f.__proto__=D,v(f,c,"GeneratorFunction")),f.prototype=Object.create(W),f},e.awrap=function(f){return{__await:f}},Pe(re.prototype),v(re.prototype,l,function(){return this}),e.AsyncIterator=re,e.async=function(f,i,u,p,d){d===void 0&&(d=Promise);var h=new re(m(f,i,u,p),d);return e.isGeneratorFunction(i)?h:h.next().then(function(_){return _.done?_.value:h.next()})},Pe(W),v(W,c,"Generator"),v(W,a,function(){return this}),v(W,"toString",function(){return"[object Generator]"}),e.keys=function(f){var i=Object(f),u=[];for(var p in i)u.push(p);return u.reverse(),function d(){for(;u.length;){var h=u.pop();if(h in i)return d.value=h,d.done=!1,d}return d.done=!0,d}},e.values=he,pe.prototype={constructor:pe,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(le),!i)for(var u in this)u.charAt(0)==="t"&&t.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=r)},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var u=this;function p(G,I){return _.type="throw",_.arg=i,u.next=G,I&&(u.method="next",u.arg=r),!!I}for(var d=this.tryEntries.length-1;d>=0;--d){var h=this.tryEntries[d],_=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var w=t.call(h,"catchLoc"),x=t.call(h,"finallyLoc");if(w&&x){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(w){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!x)throw Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(i,u){for(var p=this.tryEntries.length-1;p>=0;--p){var d=this.tryEntries[p];if(d.tryLoc<=this.prev&&t.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var h=d;break}}h&&(i==="break"||i==="continue")&&h.tryLoc<=u&&u<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=i,_.arg=u,h?(this.method="next",this.next=h.finallyLoc,P):this.complete(_)},complete:function(i,u){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&u&&(this.next=u),P},finish:function(i){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===i)return this.complete(p.completion,p.afterLoc),le(p),P}},catch:function(i){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===i){var d=p.completion;if(d.type==="throw"){var h=d.arg;le(p)}return h}}throw Error("illegal catch attempt")},delegateYield:function(i,u,p){return this.delegate={iterator:he(i),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=r),P}},e}T.exports=$e,T.exports.__esModule=!0,T.exports.default=T.exports});var Ke=N((cr,We)=>{var ae=Be()();We.exports=ae;try{regeneratorRuntime=ae}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=ae:Function("r","regeneratorRuntime = r")(ae)}});var Ye=N(Y=>{"use strict";U();Q();Object.defineProperty(Y,"__esModule",{value:!0});Y.createError=Y.DefaultDataPack=void 0;var ht=new Map([[-32e3,"Event not provided"],[-32600,"Invalid Request"],[-32601,"Method not found"],[-32602,"Invalid params"],[-32603,"Internal error"],[-32604,"Params not found"],[-32605,"Method forbidden"],[-32606,"Event forbidden"],[-32700,"Parse error"]]),dt=function(){function r(){R(this,r)}return C(r,[{key:"encode",value:function(n){return JSON.stringify(n)}},{key:"decode",value:function(n){return JSON.parse(n)}}])}();Y.DefaultDataPack=dt;function vt(r,e){var n={code:r,message:ht.get(r)||"Internal Server Error"};return e&&(n.data=e),n}Y.createError=vt});var Qe=N(Oe=>{"use strict";Ne();J();Ge();U();Q();ne();oe();ie();me();var M=ct(Ke()),yt=["autoconnect","reconnect","reconnect_interval","max_reconnects"];function ze(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),n.push.apply(n,t)}return n}function Je(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ze(Object(n),!0).forEach(function(t){g(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function mt(r,e,n){return e=L(e),F(r,He()?Reflect.construct(e,n||[],L(r).constructor):e.apply(r,n))}function He(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(He=function(){return!!r})()}Object.defineProperty(Oe,"__esModule",{value:!0});var _t=ge(),gt=Ye(),bt=function(r){function e(n){var t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"ws://localhost:8080",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.autoconnect,l=a===void 0?!0:a,c=o.reconnect,v=c===void 0?!0:c,m=o.reconnect_interval,y=m===void 0?1e3:m,E=o.max_reconnects,S=E===void 0?5:E,Z=ke(o,yt),B=arguments.length>3?arguments[3]:void 0,P=arguments.length>4?arguments[4]:void 0;return R(this,e),t=mt(this,e),g(t,"address",void 0),g(t,"rpc_id",void 0),g(t,"queue",void 0),g(t,"options",void 0),g(t,"autoconnect",void 0),g(t,"ready",void 0),g(t,"reconnect",void 0),g(t,"reconnect_timer_id",void 0),g(t,"reconnect_interval",void 0),g(t,"max_reconnects",void 0),g(t,"rest_options",void 0),g(t,"current_reconnects",void 0),g(t,"generate_request_id",void 0),g(t,"socket",void 0),g(t,"webSocketFactory",void 0),g(t,"dataPack",void 0),t.webSocketFactory=n,t.queue={},t.rpc_id=0,t.address=s,t.autoconnect=l,t.ready=!1,t.reconnect=v,t.reconnect_timer_id=void 0,t.reconnect_interval=y,t.max_reconnects=S,t.rest_options=Z,t.current_reconnects=0,t.generate_request_id=B||function(){return++t.rpc_id},P?t.dataPack=P:t.dataPack=new gt.DefaultDataPack,t.autoconnect&&t._connect(t.address,Je({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return $(e,r),C(e,[{key:"connect",value:function(){this.socket||this._connect(this.address,Je({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(t,s,o,a){var l=this;return!a&&j(o)==="object"&&(a=o,o=null),new Promise(function(c,v){if(!l.ready)return v(new Error("socket not ready"));var m=l.generate_request_id(t,s),y={jsonrpc:"2.0",method:t,params:s||void 0,id:m};l.socket.send(l.dataPack.encode(y),a,function(E){if(E)return v(E);l.queue[m]={promise:[c,v]},o&&(l.queue[m].timeout=setTimeout(function(){delete l.queue[m],v(new Error("reply timeout"))},o))})})}},{key:"login",value:function(){var n=K(M.default.mark(function s(o){var a;return M.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.call("rpc.login",o);case 2:if(a=c.sent,a){c.next=5;break}throw new Error("authentication failed");case 5:return c.abrupt("return",a);case 6:case"end":return c.stop()}},s,this)}));function t(s){return n.apply(this,arguments)}return t}()},{key:"listMethods",value:function(){var n=K(M.default.mark(function s(){return M.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.call("__listMethods");case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}},s,this)}));function t(){return n.apply(this,arguments)}return t}()},{key:"notify",value:function(t,s){var o=this;return new Promise(function(a,l){if(!o.ready)return l(new Error("socket not ready"));var c={jsonrpc:"2.0",method:t,params:s};o.socket.send(o.dataPack.encode(c),function(v){if(v)return l(v);a()})})}},{key:"subscribe",value:function(){var n=K(M.default.mark(function s(o){var a;return M.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return typeof o=="string"&&(o=[o]),c.next=3,this.call("rpc.on",o);case 3:if(a=c.sent,!(typeof o=="string"&&a[o]!=="ok")){c.next=6;break}throw new Error("Failed subscribing to an event '"+o+"' with: "+a[o]);case 6:return c.abrupt("return",a);case 7:case"end":return c.stop()}},s,this)}));function t(s){return n.apply(this,arguments)}return t}()},{key:"unsubscribe",value:function(){var n=K(M.default.mark(function s(o){var a;return M.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return typeof o=="string"&&(o=[o]),c.next=3,this.call("rpc.off",o);case 3:if(a=c.sent,!(typeof o=="string"&&a[o]!=="ok")){c.next=6;break}throw new Error("Failed unsubscribing from an event with: "+a);case 6:return c.abrupt("return",a);case 7:case"end":return c.stop()}},s,this)}));function t(s){return n.apply(this,arguments)}return t}()},{key:"close",value:function(t,s){this.socket.close(t||1e3,s)}},{key:"setAutoReconnect",value:function(t){this.reconnect=t}},{key:"setReconnectInterval",value:function(t){this.reconnect_interval=t}},{key:"setMaxReconnects",value:function(t){this.max_reconnects=t}},{key:"_connect",value:function(t,s){var o=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,s),this.socket.addEventListener("open",function(){o.ready=!0,o.emit("open"),o.current_reconnects=0}),this.socket.addEventListener("message",function(a){var l=a.data;l instanceof ArrayBuffer&&(l=Buffer.from(l).toString());try{l=o.dataPack.decode(l)}catch{return}if(l.notification&&o.listeners(l.notification).length){if(!Object.keys(l.params).length)return o.emit(l.notification);var c=[l.notification];if(l.params.constructor===Object)c.push(l.params);else for(var v=0;v<l.params.length;v++)c.push(l.params[v]);return Promise.resolve().then(function(){o.emit.apply(o,c)})}if(!o.queue[l.id])return l.method?Promise.resolve().then(function(){var m;o.emit(l.method,(m=l)===null||m===void 0?void 0:m.params)}):void 0;"error"in l=="result"in l&&o.queue[l.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),o.queue[l.id].timeout&&clearTimeout(o.queue[l.id].timeout),l.error?o.queue[l.id].promise[1](l.error):o.queue[l.id].promise[0](l.result),delete o.queue[l.id]}),this.socket.addEventListener("error",function(a){return o.emit("error",a)}),this.socket.addEventListener("close",function(a){var l=a.code,c=a.reason;o.ready&&setTimeout(function(){return o.emit("close",l,c)},0),o.ready=!1,o.socket=void 0,l!==1e3&&(o.current_reconnects++,o.reconnect&&(o.max_reconnects>o.current_reconnects||o.max_reconnects===0)&&(o.reconnect_timer_id=setTimeout(function(){return o._connect(t,s)},o.reconnect_interval)))})}}])}(_t.EventEmitter);Oe.default=bt});var Pt=N(z=>{Q();U();ne();oe();ie();function wt(r,e,n){return e=L(e),F(r,Ue()?Reflect.construct(e,n||[],L(r).constructor):e.apply(r,n))}function Ue(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ue=function(){return!!r})()}var Ve=z&&z.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(z,"__esModule",{value:!0});z.Client=void 0;var kt=Ve(Me()),xt=Ve(Qe()),Ot=function(r){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ws://localhost:8080",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.autoconnect,o=s===void 0?!0:s,a=t.reconnect,l=a===void 0?!0:a,c=t.reconnect_interval,v=c===void 0?1e3:c,m=t.max_reconnects,y=m===void 0?5:m,E=arguments.length>2?arguments[2]:void 0;return R(this,e),wt(this,e,[kt.default,n,{autoconnect:o,reconnect:l,reconnect_interval:v,max_reconnects:y},E])}return $(e,r),C(e)}(xt.default);z.Client=Ot});return Pt();})();
/*! Bundled license information:

@babel/runtime/helpers/regeneratorRuntime.js:
  (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
*/

Выполнить команду


Для локальной разработки. Не используйте в интернете!