altair-static 4.4.1 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/dist/873.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[873],{6873:(C,l,r)=>{"use strict";r.r(l),r.d(l,{WebsocketSubscriptionProvider:()=>y});var a=r(71251),O=r(27148),w=r(82475);class y extends a.q{createClient(){var s;this.client=new O.SubscriptionClient(this.subscriptionUrl,{reconnect:!0,connectionParams:this.connectionParams,connectionCallback:null==(s=this.extraOptions)?void 0:s.onConnected})}execute(s){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new w.y(u=>this.client.request({query:s.query,variables:s.variables,operationName:s.operationName}).subscribe({next:(...f)=>u.next(...f),error:(...f)=>u.error(...f),complete:()=>u.complete()}))}close(){var s,u;null==(s=this.client)||s.unsubscribeAll(),null==(u=this.client)||u.close(),this.client=void 0}}},26214:C=>{function l(r){this.ms=(r=r||{}).min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}C.exports=l,l.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),O=Math.floor(a*this.jitter*r);r=0==(1&Math.floor(10*a))?r-O:r+O}return 0|Math.min(r,this.max)},l.prototype.reset=function(){this.attempts=0},l.prototype.setMin=function(r){this.ms=r},l.prototype.setMax=function(r){this.max=r},l.prototype.setJitter=function(r){this.jitter=r}},35769:C=>{"use strict";var l=Object.prototype.hasOwnProperty,r="~";function a(){}function O(d,s,u){this.fn=d,this.context=s,this.once=u||!1}function A(d,s,u,f,g){if("function"!=typeof u)throw new TypeError("The listener must be a function");var I=new O(u,f||d,g),b=r?r+s:s;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],I]:d._events[b].push(I):(d._events[b]=I,d._eventsCount++),d}function w(d,s){0==--d._eventsCount?d._events=new a:delete d._events[s]}function y(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(r=!1)),y.prototype.eventNames=function(){var u,f,s=[];if(0===this._eventsCount)return s;for(f in u=this._events)l.call(u,f)&&s.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(u)):s},y.prototype.listeners=function(s){var f=this._events[r?r+s:s];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,I=f.length,b=new Array(I);g<I;g++)b[g]=f[g].fn;return b},y.prototype.listenerCount=function(s){var f=this._events[r?r+s:s];return f?f.fn?1:f.length:0},y.prototype.emit=function(s,u,f,g,I,b){var M=r?r+s:s;if(!this._events[M])return!1;var _,T,p=this._events[M],S=arguments.length;if(p.fn){switch(p.once&&this.removeListener(s,p.fn,void 0,!0),S){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,u),!0;case 3:return p.fn.call(p.context,u,f),!0;case 4:return p.fn.call(p.context,u,f,g),!0;case 5:return p.fn.call(p.context,u,f,g,I),!0;case 6:return p.fn.call(p.context,u,f,g,I,b),!0}for(T=1,_=new Array(S-1);T<S;T++)_[T-1]=arguments[T];p.fn.apply(p.context,_)}else{var t,c=p.length;for(T=0;T<c;T++)switch(p[T].once&&this.removeListener(s,p[T].fn,void 0,!0),S){case 1:p[T].fn.call(p[T].context);break;case 2:p[T].fn.call(p[T].context,u);break;case 3:p[T].fn.call(p[T].context,u,f);break;case 4:p[T].fn.call(p[T].context,u,f,g);break;default:if(!_)for(t=1,_=new Array(S-1);t<S;t++)_[t-1]=arguments[t];p[T].fn.apply(p[T].context,_)}}return!0},y.prototype.on=function(s,u,f){return A(this,s,u,f,!1)},y.prototype.once=function(s,u,f){return A(this,s,u,f,!0)},y.prototype.removeListener=function(s,u,f,g){var I=r?r+s:s;if(!this._events[I])return this;if(!u)return w(this,I),this;var b=this._events[I];if(b.fn)b.fn===u&&(!g||b.once)&&(!f||b.context===f)&&w(this,I);else{for(var M=0,p=[],S=b.length;M<S;M++)(b[M].fn!==u||g&&!b[M].once||f&&b[M].context!==f)&&p.push(b[M]);p.length?this._events[I]=1===p.length?p[0]:p:w(this,I)}return this},y.prototype.removeAllListeners=function(s){var u;return s?this._events[u=r?r+s:s]&&w(this,u):(this._events=new a,this._eventsCount=0),this},y.prototype.off=y.prototype.removeListener,y.prototype.addListener=y.prototype.on,y.prefixed=r,y.EventEmitter=y,C.exports=y},27148:function(C,l,r){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(c){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(c[o]=t[o]);return c}).apply(this,arguments)},O=this&&this.__awaiter||function(c,t,e,n){return new(e||(e=Promise))(function(i,v){function E(m){try{h(n.next(m))}catch(R){v(R)}}function N(m){try{h(n.throw(m))}catch(R){v(R)}}function h(m){m.done?i(m.value):function(i){return i instanceof e?i:new e(function(v){v(i)})}(m.value).then(E,N)}h((n=n.apply(c,t||[])).next())})},A=this&&this.__generator||function(c,t){var n,o,i,v,e={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return v={next:E(0),throw:E(1),return:E(2)},"function"==typeof Symbol&&(v[Symbol.iterator]=function(){return this}),v;function E(h){return function(m){return function(h){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(i=2&h[0]?o.return:h[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,h[1])).done)return i;switch(o=0,i&&(h=[2&h[0],i.value]),h[0]){case 0:case 1:i=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,o=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(!(i=(i=e.trys).length>0&&i[i.length-1])&&(6===h[0]||2===h[0])){e=0;continue}if(3===h[0]&&(!i||h[1]>i[0]&&h[1]<i[3])){e.label=h[1];break}if(6===h[0]&&e.label<i[1]){e.label=i[1],i=h;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(h);break}i[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(c,e)}catch(m){h=[6,m],o=0}finally{n=i=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([h,m])}}},w=this&&this.__spreadArrays||function(){for(var c=0,t=0,e=arguments.length;t<e;t++)c+=arguments[t].length;var n=Array(c),o=0;for(t=0;t<e;t++)for(var i=arguments[t],v=0,E=i.length;v<E;v++,o++)n[o]=i[v];return n};Object.defineProperty(l,"__esModule",{value:!0}),l.SubscriptionClient=void 0;var y="undefined"!=typeof global?global:"undefined"!=typeof window?window:{},d=y.WebSocket||y.MozWebSocket,s=r(26214),u=r(35769),f=r(94505),g=r(59185),I=r(71352),b=r(69251),M=r(23850),p=r(2745),S=r(17387),_=r(55906),T=function(){function c(t,e,n,o){var i=e||{},v=i.connectionCallback,E=void 0===v?void 0:v,N=i.connectionParams,h=void 0===N?{}:N,m=i.minTimeout,R=void 0===m?S.MIN_WS_TIMEOUT:m,P=i.timeout,U=void 0===P?S.WS_TIMEOUT:P,L=i.reconnect,j=void 0!==L&&L,k=i.reconnectionAttempts,W=void 0===k?1/0:k,x=i.lazy,B=void 0!==x&&x,G=i.inactivityTimeout,D=void 0===G?0:G,Q=i.wsOptionArguments,K=void 0===Q?[]:Q;if(this.wsImpl=n||d,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=o||p.GRAPHQL_WS,this.connectionCallback=E,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=R,this.wsTimeout=U,this.unsentMessagesQueue=[],this.reconnect=j,this.reconnecting=!1,this.reconnectionAttempts=W,this.lazy=!!B,this.inactivityTimeout=D,this.closedByUser=!1,this.backoff=new s({jitter:.5}),this.eventEmitter=new u.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(h),this.wsOptionArguments=K,this.lazy||this.connect()}return Object.defineProperty(c.prototype,"status",{get:function(){return null===this.client?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),c.prototype.close=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.clearInactivityTimeout(),null!==this.client&&(this.closedByUser=e,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,_.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},c.prototype.request=function(t){var e,v,n=this.getObserver.bind(this),o=this.executeOperation.bind(this),i=this.unsubscribe.bind(this);return this.clearInactivityTimeout(),(e={})[M.default]=function(){return this},e.subscribe=function(E,N,h){var m=n(E,N,h);return v=o(t,function(R,P){null===R&&null===P?m.complete&&m.complete():R?m.error&&m.error(R[0]):m.next&&m.next(P)}),{unsubscribe:function(){v&&(i(v),v=null)}}},e},c.prototype.on=function(t,e,n){var o=this.eventEmitter.on(t,e,n);return function(){o.off(t,e,n)}},c.prototype.onConnected=function(t,e){return this.on("connected",t,e)},c.prototype.onConnecting=function(t,e){return this.on("connecting",t,e)},c.prototype.onDisconnected=function(t,e){return this.on("disconnected",t,e)},c.prototype.onReconnected=function(t,e){return this.on("reconnected",t,e)},c.prototype.onReconnecting=function(t,e){return this.on("reconnecting",t,e)},c.prototype.onError=function(t,e){return this.on("error",t,e)},c.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(e){t.unsubscribe(e)})},c.prototype.applyMiddlewares=function(t){var e=this;return new Promise(function(n,o){var v,E,N;v=w(e.middlewares),E=e,(N=function(h){if(h)o(h);else if(v.length>0){var m=v.shift();m&&m.applyMiddleware.apply(E,[t,N])}else n(t)})()})},c.prototype.use=function(t){var e=this;return t.map(function(n){if("function"!=typeof n.applyMiddleware)throw new Error("Middleware must implement the applyMiddleware function.");e.middlewares.push(n)}),this},c.prototype.getConnectionParams=function(t){return function(){return new Promise(function(e,n){if("function"==typeof t)try{return e(t.call(null))}catch(o){return n(o)}e(t)})}},c.prototype.executeOperation=function(t,e){var n=this;null===this.client&&this.connect();var o=this.generateOperationId();return this.operations[o]={options:t,handler:e},this.applyMiddlewares(t).then(function(i){n.checkOperationOptions(i,e),n.operations[o]&&(n.operations[o]={options:i,handler:e},n.sendMessage(o,_.default.GQL_START,i))}).catch(function(i){n.unsubscribe(o),e(n.formatErrors(i))}),o},c.prototype.getObserver=function(t,e,n){return"function"==typeof t?{next:function(o){return t(o)},error:function(o){return e&&e(o)},complete:function(){return n&&n()}}:t},c.prototype.createMaxConnectTimeGenerator=function(){return new s({min:this.minWsTimeout,max:this.wsTimeout,factor:1.2})},c.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},c.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},c.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},c.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},c.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&0===Object.keys(this.operations).length&&(this.inactivityTimeoutId=setTimeout(function(){0===Object.keys(t.operations).length&&t.close()},this.inactivityTimeout))},c.prototype.checkOperationOptions=function(t,e){var n=t.query,o=t.variables,i=t.operationName;if(!n)throw new Error("Must provide a query.");if(!e)throw new Error("Must provide an handler.");if(!f.default(n)&&!b.getOperationAST(n,i)||i&&!f.default(i)||o&&!g.default(o))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},c.prototype.buildMessage=function(t,e,n){return{id:t,type:e,payload:n&&n.query?a(a({},n),{query:"string"==typeof n.query?n.query:I.print(n.query)}):n}},c.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},c.prototype.sendMessage=function(t,e,n){this.sendMessageRaw(this.buildMessage(t,e,n))},c.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var e=JSON.stringify(t);try{JSON.parse(e)}catch(n){this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(e);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},c.prototype.generateOperationId=function(){return String(++this.nextOperationId)},c.prototype.tryReconnect=function(){var t=this;if(this.reconnect&&!(this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,_.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var e=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},e)}},c.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(e){t.sendMessageRaw(e)}),this.unsentMessagesQueue=[]},c.prototype.checkConnection=function(){this.wasKeepAliveReceived?this.wasKeepAliveReceived=!1:this.reconnecting||this.close(!1,!0)},c.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},c.prototype.connect=function(){var t,e=this;this.client=new((t=this.wsImpl).bind.apply(t,w([void 0,this.url,this.wsProtocols],this.wsOptionArguments))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return O(e,void 0,void 0,function(){var n,o;return A(this,function(i){switch(i.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=i.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return o=i.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_ERROR,o),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){e.closedByUser||e.close(!1,!1)},this.client.onerror=function(n){e.eventEmitter.emit("error",n)},this.client.onmessage=function(n){e.processReceivedData(n.data)}},c.prototype.processReceivedData=function(t){var e,n;try{n=(e=JSON.parse(t)).id}catch(E){throw new Error("Message must be JSON-parseable. Got: "+t)}if(-1===[_.default.GQL_DATA,_.default.GQL_COMPLETE,_.default.GQL_ERROR].indexOf(e.type)||this.operations[n])switch(e.type){case _.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(e.payload);break;case _.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",e.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case _.default.GQL_COMPLETE:var o=this.operations[n].handler;delete this.operations[n],o.call(this,null,null);break;case _.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(e.payload),null),delete this.operations[n];break;case _.default.GQL_DATA:var i=e.payload.errors?a(a({},e.payload),{errors:this.formatErrors(e.payload.errors)}):e.payload;this.operations[n].handler(null,i);break;case _.default.GQL_CONNECTION_KEEP_ALIVE:var v=void 0===this.wasKeepAliveReceived;this.wasKeepAliveReceived=!0,v&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}else this.unsubscribe(n)},c.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,_.default.GQL_STOP,void 0))},c}();l.SubscriptionClient=T},17387:(C,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.WS_TIMEOUT=l.MIN_WS_TIMEOUT=void 0,l.MIN_WS_TIMEOUT=1e3,l.WS_TIMEOUT=3e4},55906:(C,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var r=function(){function a(){throw new Error("Static Class")}return a.GQL_CONNECTION_INIT="connection_init",a.GQL_CONNECTION_ACK="connection_ack",a.GQL_CONNECTION_ERROR="connection_error",a.GQL_CONNECTION_KEEP_ALIVE="ka",a.GQL_CONNECTION_TERMINATE="connection_terminate",a.GQL_START="start",a.GQL_DATA="data",a.GQL_ERROR="error",a.GQL_COMPLETE="complete",a.GQL_STOP="stop",a.SUBSCRIPTION_START="subscription_start",a.SUBSCRIPTION_DATA="subscription_data",a.SUBSCRIPTION_SUCCESS="subscription_success",a.SUBSCRIPTION_FAIL="subscription_fail",a.SUBSCRIPTION_END="subscription_end",a.INIT="init",a.INIT_SUCCESS="init_success",a.INIT_FAIL="init_fail",a.KEEP_ALIVE="keepalive",a}();l.default=r},2745:(C,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.GRAPHQL_SUBSCRIPTIONS=l.GRAPHQL_WS=void 0,l.GRAPHQL_WS="graphql-ws",l.GRAPHQL_SUBSCRIPTIONS="graphql-subscriptions"},59185:(C,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(a){return null!==a&&"object"==typeof a}},94505:(C,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(a){return"string"==typeof a}},23850:(C,l,r)=>{"use strict";var d,s;r.r(l),r.d(l,{default:()=>w}),C=r.hmd(C);const w=("function"==typeof(s=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:C).Symbol)?s.observable?d=s.observable:(d=s("observable"),s.observable=d):d="@@observable",d)}}]);
1
+ (self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[873],{6873:(C,f,r)=>{"use strict";r.r(f),r.d(f,{WebsocketSubscriptionProvider:()=>y});var a=r(71251),O=r(27148),w=r(82475);class y extends a.q{createClient(){var s;this.client=new O.SubscriptionClient(this.subscriptionUrl,{reconnect:!0,connectionParams:this.connectionParams,connectionCallback:null==(s=this.extraOptions)?void 0:s.onConnected})}execute(s){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new w.y(u=>{const l=this.client.request({query:s.query,variables:s.variables,operationName:s.operationName}).subscribe({next:(...I)=>u.next(...I),error:(...I)=>u.error(...I),complete:()=>u.complete()});this.cleanup=l.unsubscribe})}close(){var s,u,l;null==(s=this.cleanup)||s.call(this),this.cleanup=void 0,null==(u=this.client)||u.unsubscribeAll(),null==(l=this.client)||l.close(),this.client=void 0}}},26214:C=>{function f(r){this.ms=(r=r||{}).min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}C.exports=f,f.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),O=Math.floor(a*this.jitter*r);r=0==(1&Math.floor(10*a))?r-O:r+O}return 0|Math.min(r,this.max)},f.prototype.reset=function(){this.attempts=0},f.prototype.setMin=function(r){this.ms=r},f.prototype.setMax=function(r){this.max=r},f.prototype.setJitter=function(r){this.jitter=r}},35769:C=>{"use strict";var f=Object.prototype.hasOwnProperty,r="~";function a(){}function O(d,s,u){this.fn=d,this.context=s,this.once=u||!1}function A(d,s,u,l,I){if("function"!=typeof u)throw new TypeError("The listener must be a function");var g=new O(u,l||d,I),b=r?r+s:s;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],g]:d._events[b].push(g):(d._events[b]=g,d._eventsCount++),d}function w(d,s){0==--d._eventsCount?d._events=new a:delete d._events[s]}function y(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(r=!1)),y.prototype.eventNames=function(){var u,l,s=[];if(0===this._eventsCount)return s;for(l in u=this._events)f.call(u,l)&&s.push(r?l.slice(1):l);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(u)):s},y.prototype.listeners=function(s){var l=this._events[r?r+s:s];if(!l)return[];if(l.fn)return[l.fn];for(var I=0,g=l.length,b=new Array(g);I<g;I++)b[I]=l[I].fn;return b},y.prototype.listenerCount=function(s){var l=this._events[r?r+s:s];return l?l.fn?1:l.length:0},y.prototype.emit=function(s,u,l,I,g,b){var M=r?r+s:s;if(!this._events[M])return!1;var _,T,p=this._events[M],S=arguments.length;if(p.fn){switch(p.once&&this.removeListener(s,p.fn,void 0,!0),S){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,u),!0;case 3:return p.fn.call(p.context,u,l),!0;case 4:return p.fn.call(p.context,u,l,I),!0;case 5:return p.fn.call(p.context,u,l,I,g),!0;case 6:return p.fn.call(p.context,u,l,I,g,b),!0}for(T=1,_=new Array(S-1);T<S;T++)_[T-1]=arguments[T];p.fn.apply(p.context,_)}else{var t,c=p.length;for(T=0;T<c;T++)switch(p[T].once&&this.removeListener(s,p[T].fn,void 0,!0),S){case 1:p[T].fn.call(p[T].context);break;case 2:p[T].fn.call(p[T].context,u);break;case 3:p[T].fn.call(p[T].context,u,l);break;case 4:p[T].fn.call(p[T].context,u,l,I);break;default:if(!_)for(t=1,_=new Array(S-1);t<S;t++)_[t-1]=arguments[t];p[T].fn.apply(p[T].context,_)}}return!0},y.prototype.on=function(s,u,l){return A(this,s,u,l,!1)},y.prototype.once=function(s,u,l){return A(this,s,u,l,!0)},y.prototype.removeListener=function(s,u,l,I){var g=r?r+s:s;if(!this._events[g])return this;if(!u)return w(this,g),this;var b=this._events[g];if(b.fn)b.fn===u&&(!I||b.once)&&(!l||b.context===l)&&w(this,g);else{for(var M=0,p=[],S=b.length;M<S;M++)(b[M].fn!==u||I&&!b[M].once||l&&b[M].context!==l)&&p.push(b[M]);p.length?this._events[g]=1===p.length?p[0]:p:w(this,g)}return this},y.prototype.removeAllListeners=function(s){var u;return s?this._events[u=r?r+s:s]&&w(this,u):(this._events=new a,this._eventsCount=0),this},y.prototype.off=y.prototype.removeListener,y.prototype.addListener=y.prototype.on,y.prefixed=r,y.EventEmitter=y,C.exports=y},27148:function(C,f,r){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(c){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(c[o]=t[o]);return c}).apply(this,arguments)},O=this&&this.__awaiter||function(c,t,e,n){return new(e||(e=Promise))(function(i,v){function E(m){try{h(n.next(m))}catch(R){v(R)}}function N(m){try{h(n.throw(m))}catch(R){v(R)}}function h(m){m.done?i(m.value):function(i){return i instanceof e?i:new e(function(v){v(i)})}(m.value).then(E,N)}h((n=n.apply(c,t||[])).next())})},A=this&&this.__generator||function(c,t){var n,o,i,v,e={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return v={next:E(0),throw:E(1),return:E(2)},"function"==typeof Symbol&&(v[Symbol.iterator]=function(){return this}),v;function E(h){return function(m){return function(h){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(i=2&h[0]?o.return:h[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,h[1])).done)return i;switch(o=0,i&&(h=[2&h[0],i.value]),h[0]){case 0:case 1:i=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,o=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(!(i=(i=e.trys).length>0&&i[i.length-1])&&(6===h[0]||2===h[0])){e=0;continue}if(3===h[0]&&(!i||h[1]>i[0]&&h[1]<i[3])){e.label=h[1];break}if(6===h[0]&&e.label<i[1]){e.label=i[1],i=h;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(h);break}i[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(c,e)}catch(m){h=[6,m],o=0}finally{n=i=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([h,m])}}},w=this&&this.__spreadArrays||function(){for(var c=0,t=0,e=arguments.length;t<e;t++)c+=arguments[t].length;var n=Array(c),o=0;for(t=0;t<e;t++)for(var i=arguments[t],v=0,E=i.length;v<E;v++,o++)n[o]=i[v];return n};Object.defineProperty(f,"__esModule",{value:!0}),f.SubscriptionClient=void 0;var y="undefined"!=typeof global?global:"undefined"!=typeof window?window:{},d=y.WebSocket||y.MozWebSocket,s=r(26214),u=r(35769),l=r(94505),I=r(59185),g=r(71352),b=r(69251),M=r(23850),p=r(2745),S=r(17387),_=r(55906),T=function(){function c(t,e,n,o){var i=e||{},v=i.connectionCallback,E=void 0===v?void 0:v,N=i.connectionParams,h=void 0===N?{}:N,m=i.minTimeout,R=void 0===m?S.MIN_WS_TIMEOUT:m,P=i.timeout,U=void 0===P?S.WS_TIMEOUT:P,L=i.reconnect,j=void 0!==L&&L,k=i.reconnectionAttempts,W=void 0===k?1/0:k,x=i.lazy,B=void 0!==x&&x,G=i.inactivityTimeout,D=void 0===G?0:G,Q=i.wsOptionArguments,K=void 0===Q?[]:Q;if(this.wsImpl=n||d,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=o||p.GRAPHQL_WS,this.connectionCallback=E,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=R,this.wsTimeout=U,this.unsentMessagesQueue=[],this.reconnect=j,this.reconnecting=!1,this.reconnectionAttempts=W,this.lazy=!!B,this.inactivityTimeout=D,this.closedByUser=!1,this.backoff=new s({jitter:.5}),this.eventEmitter=new u.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(h),this.wsOptionArguments=K,this.lazy||this.connect()}return Object.defineProperty(c.prototype,"status",{get:function(){return null===this.client?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),c.prototype.close=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.clearInactivityTimeout(),null!==this.client&&(this.closedByUser=e,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,_.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},c.prototype.request=function(t){var e,v,n=this.getObserver.bind(this),o=this.executeOperation.bind(this),i=this.unsubscribe.bind(this);return this.clearInactivityTimeout(),(e={})[M.default]=function(){return this},e.subscribe=function(E,N,h){var m=n(E,N,h);return v=o(t,function(R,P){null===R&&null===P?m.complete&&m.complete():R?m.error&&m.error(R[0]):m.next&&m.next(P)}),{unsubscribe:function(){v&&(i(v),v=null)}}},e},c.prototype.on=function(t,e,n){var o=this.eventEmitter.on(t,e,n);return function(){o.off(t,e,n)}},c.prototype.onConnected=function(t,e){return this.on("connected",t,e)},c.prototype.onConnecting=function(t,e){return this.on("connecting",t,e)},c.prototype.onDisconnected=function(t,e){return this.on("disconnected",t,e)},c.prototype.onReconnected=function(t,e){return this.on("reconnected",t,e)},c.prototype.onReconnecting=function(t,e){return this.on("reconnecting",t,e)},c.prototype.onError=function(t,e){return this.on("error",t,e)},c.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(e){t.unsubscribe(e)})},c.prototype.applyMiddlewares=function(t){var e=this;return new Promise(function(n,o){var v,E,N;v=w(e.middlewares),E=e,(N=function(h){if(h)o(h);else if(v.length>0){var m=v.shift();m&&m.applyMiddleware.apply(E,[t,N])}else n(t)})()})},c.prototype.use=function(t){var e=this;return t.map(function(n){if("function"!=typeof n.applyMiddleware)throw new Error("Middleware must implement the applyMiddleware function.");e.middlewares.push(n)}),this},c.prototype.getConnectionParams=function(t){return function(){return new Promise(function(e,n){if("function"==typeof t)try{return e(t.call(null))}catch(o){return n(o)}e(t)})}},c.prototype.executeOperation=function(t,e){var n=this;null===this.client&&this.connect();var o=this.generateOperationId();return this.operations[o]={options:t,handler:e},this.applyMiddlewares(t).then(function(i){n.checkOperationOptions(i,e),n.operations[o]&&(n.operations[o]={options:i,handler:e},n.sendMessage(o,_.default.GQL_START,i))}).catch(function(i){n.unsubscribe(o),e(n.formatErrors(i))}),o},c.prototype.getObserver=function(t,e,n){return"function"==typeof t?{next:function(o){return t(o)},error:function(o){return e&&e(o)},complete:function(){return n&&n()}}:t},c.prototype.createMaxConnectTimeGenerator=function(){return new s({min:this.minWsTimeout,max:this.wsTimeout,factor:1.2})},c.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},c.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},c.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},c.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},c.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&0===Object.keys(this.operations).length&&(this.inactivityTimeoutId=setTimeout(function(){0===Object.keys(t.operations).length&&t.close()},this.inactivityTimeout))},c.prototype.checkOperationOptions=function(t,e){var n=t.query,o=t.variables,i=t.operationName;if(!n)throw new Error("Must provide a query.");if(!e)throw new Error("Must provide an handler.");if(!l.default(n)&&!b.getOperationAST(n,i)||i&&!l.default(i)||o&&!I.default(o))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},c.prototype.buildMessage=function(t,e,n){return{id:t,type:e,payload:n&&n.query?a(a({},n),{query:"string"==typeof n.query?n.query:g.print(n.query)}):n}},c.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},c.prototype.sendMessage=function(t,e,n){this.sendMessageRaw(this.buildMessage(t,e,n))},c.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var e=JSON.stringify(t);try{JSON.parse(e)}catch(n){this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(e);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},c.prototype.generateOperationId=function(){return String(++this.nextOperationId)},c.prototype.tryReconnect=function(){var t=this;if(this.reconnect&&!(this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,_.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var e=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},e)}},c.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(e){t.sendMessageRaw(e)}),this.unsentMessagesQueue=[]},c.prototype.checkConnection=function(){this.wasKeepAliveReceived?this.wasKeepAliveReceived=!1:this.reconnecting||this.close(!1,!0)},c.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},c.prototype.connect=function(){var t,e=this;this.client=new((t=this.wsImpl).bind.apply(t,w([void 0,this.url,this.wsProtocols],this.wsOptionArguments))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return O(e,void 0,void 0,function(){var n,o;return A(this,function(i){switch(i.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=i.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return o=i.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_ERROR,o),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){e.closedByUser||e.close(!1,!1)},this.client.onerror=function(n){e.eventEmitter.emit("error",n)},this.client.onmessage=function(n){e.processReceivedData(n.data)}},c.prototype.processReceivedData=function(t){var e,n;try{n=(e=JSON.parse(t)).id}catch(E){throw new Error("Message must be JSON-parseable. Got: "+t)}if(-1===[_.default.GQL_DATA,_.default.GQL_COMPLETE,_.default.GQL_ERROR].indexOf(e.type)||this.operations[n])switch(e.type){case _.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(e.payload);break;case _.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",e.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case _.default.GQL_COMPLETE:var o=this.operations[n].handler;delete this.operations[n],o.call(this,null,null);break;case _.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(e.payload),null),delete this.operations[n];break;case _.default.GQL_DATA:var i=e.payload.errors?a(a({},e.payload),{errors:this.formatErrors(e.payload.errors)}):e.payload;this.operations[n].handler(null,i);break;case _.default.GQL_CONNECTION_KEEP_ALIVE:var v=void 0===this.wasKeepAliveReceived;this.wasKeepAliveReceived=!0,v&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}else this.unsubscribe(n)},c.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,_.default.GQL_STOP,void 0))},c}();f.SubscriptionClient=T},17387:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.WS_TIMEOUT=f.MIN_WS_TIMEOUT=void 0,f.MIN_WS_TIMEOUT=1e3,f.WS_TIMEOUT=3e4},55906:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});var r=function(){function a(){throw new Error("Static Class")}return a.GQL_CONNECTION_INIT="connection_init",a.GQL_CONNECTION_ACK="connection_ack",a.GQL_CONNECTION_ERROR="connection_error",a.GQL_CONNECTION_KEEP_ALIVE="ka",a.GQL_CONNECTION_TERMINATE="connection_terminate",a.GQL_START="start",a.GQL_DATA="data",a.GQL_ERROR="error",a.GQL_COMPLETE="complete",a.GQL_STOP="stop",a.SUBSCRIPTION_START="subscription_start",a.SUBSCRIPTION_DATA="subscription_data",a.SUBSCRIPTION_SUCCESS="subscription_success",a.SUBSCRIPTION_FAIL="subscription_fail",a.SUBSCRIPTION_END="subscription_end",a.INIT="init",a.INIT_SUCCESS="init_success",a.INIT_FAIL="init_fail",a.KEEP_ALIVE="keepalive",a}();f.default=r},2745:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.GRAPHQL_SUBSCRIPTIONS=f.GRAPHQL_WS=void 0,f.GRAPHQL_WS="graphql-ws",f.GRAPHQL_SUBSCRIPTIONS="graphql-subscriptions"},59185:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=function(a){return null!==a&&"object"==typeof a}},94505:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=function(a){return"string"==typeof a}},23850:(C,f,r)=>{"use strict";var d,s;r.r(f),r.d(f,{default:()=>w}),C=r.hmd(C);const w=("function"==typeof(s=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:C).Symbol)?s.observable?d=s.observable:(d=s("observable"),s.observable=d):d="@@observable",d)}}]);