altair-static 4.3.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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[100],{22100:(se,Q,S)=>{S.r(Q),S.d(Q,{GraphQLWsSubscriptionProvider:()=>_});var H=S(71251),J=S(82475),h=S(8239);const E=Object.prototype.hasOwnProperty;function C(e){return"object"==typeof e&&null!==e}function O(e,n){return E.call(e,n)}function A(e,n){return E.call(e,n)&&C(e[n])}function w(e,n){return E.call(e,n)&&"string"==typeof e[n]}const K="graphql-transport-ws";var s=(()=>{return(e=s||(s={})).ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete",s;var e})();function G(e){if(C(e)){if(!w(e,"type"))return!1;switch(e.type){case s.ConnectionInit:return!O(e,"payload")||void 0===e.payload||C(e.payload);case s.ConnectionAck:case s.Ping:case s.Pong:return!O(e,"payload")||void 0===e.payload||C(e.payload);case s.Subscribe:return w(e,"id")&&A(e,"payload")&&(!O(e.payload,"operationName")||null==e.payload.operationName||"string"==typeof e.payload.operationName)&&w(e.payload,"query")&&(!O(e.payload,"variables")||null==e.payload.variables||A(e.payload,"variables"))&&(!O(e.payload,"extensions")||null==e.payload.extensions||A(e.payload,"extensions"));case s.Next:return w(e,"id")&&A(e,"payload");case s.Error:return w(e,"id")&&function(e){return Array.isArray(e)&&e.length>0&&e.every(n=>"message"in n)}(e.payload);case s.Complete:return w(e,"id");default:return!1}}return!1}function V(e,n){if(G(e))return e;if("string"!=typeof e)throw new Error("Message not parsable");const c=JSON.parse(e,n);if(!G(c))throw new Error("Invalid message");return c}function N(e,n){if(!G(e))throw new Error("Cannot stringify invalid message");return JSON.stringify(e,n)}function v(e){return C(e)&&"code"in e&&"reason"in e}class _ extends H.q{createClient(){this.client=function(e){const{url:n,connectionParams:c,lazy:y=!0,onNonLazyError:R=console.error,lazyCloseTimeout:M=0,keepAlive:T=0,disablePong:ee,retryAttempts:q=5,retryWait:ne=function(){var t=(0,h.Z)(function*(a){let i=1e3;for(let o=0;o<a;o++)i*=2;yield new Promise(o=>setTimeout(o,i+Math.floor(2700*Math.random()+300)))});return function(a){return t.apply(this,arguments)}}(),isFatalConnectionProblem:te=(t=>!v(t)),on:r,webSocketImpl:Z,generateID:re=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,u=>{const a=16*Math.random()|0;return("x"==u?a:3&a|8).toString(16)})},jsonMessageReplacer:z,jsonMessageReviver:oe}=e;let b;if(Z){if(!function(e){return"function"==typeof e&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}(Z))throw new Error("Invalid WebSocket implementation provided");b=Z}else"undefined"!=typeof WebSocket?b=WebSocket:"undefined"!=typeof global?b=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing");const k=b,p=(()=>{const t=(()=>{const a={};return{on:(i,o)=>(a[i]=o,()=>{delete a[i]}),emit(i){var o;"id"in i&&(null===(o=a[i.id])||void 0===o||o.call(a,i))}}})(),u={connecting:(null==r?void 0:r.connecting)?[r.connecting]:[],connected:(null==r?void 0:r.connected)?[r.connected]:[],ping:(null==r?void 0:r.ping)?[r.ping]:[],pong:(null==r?void 0:r.pong)?[r.pong]:[],message:(null==r?void 0:r.message)?[t.emit,r.message]:[t.emit],closed:(null==r?void 0:r.closed)?[r.closed]:[],error:(null==r?void 0:r.error)?[r.error]:[]};return{onMessage:t.on,on(a,i){const o=u[a];return o.push(i),()=>{o.splice(o.indexOf(i),1)}},emit(a,...i){for(const o of u[a])o(...i)}}})();let m,g=0,F=!1,I=0,U=!1;function j(){return D.apply(this,arguments)}function D(){return(D=(0,h.Z)(function*(){const[t,u]=yield null!=m?m:m=new Promise((o,x)=>(0,h.Z)(function*(){if(F){if(yield ne(I),!g)return m=void 0,x({code:1e3,reason:"All Subscriptions Gone"});I++}p.emit("connecting");const l=new k("function"==typeof n?yield n():n,K);let P;function W(){isFinite(T)&&T>0&&(clearTimeout(P),P=setTimeout(()=>{l.readyState===k.OPEN&&(l.send(N({type:s.Ping})),p.emit("ping",!1,void 0))},T))}l.onerror=f=>{p.emit("error",f)},l.onclose=f=>{m=void 0,clearTimeout(P),p.emit("closed",f),x(f)},l.onopen=(0,h.Z)(function*(){try{l.send(N({type:s.ConnectionInit,payload:"function"==typeof c?yield c():c},z)),W()}catch(f){l.close(4400,f instanceof Error?f.message:new Error(f).message)}});let L=!1;l.onmessage=({data:f})=>{try{const d=V(f,oe);if(p.emit("message",d),"ping"===d.type||"pong"===d.type)return p.emit(d.type,!0,d.payload),void("pong"===d.type?W():ee||(l.send(N(d.payload?{type:s.Pong,payload:d.payload}:{type:s.Pong})),p.emit("pong",!1,d.payload)));if(L)return;if(d.type!==s.ConnectionAck)throw new Error(`First message cannot be of type ${d.type}`);L=!0,p.emit("connected",l,d.payload),F=!1,I=0,o([l,new Promise((le,ie)=>l.addEventListener("close",ie))])}catch(d){l.close(4400,d instanceof Error?d.message:new Error(d).message)}}})());t.readyState===k.CLOSING&&(yield u);let a=()=>{};const i=new Promise(o=>a=o);return[t,a,Promise.race([i.then(()=>{if(!g){const o=()=>t.close(1e3,"Normal Closure");isFinite(M)&&M>0?setTimeout(()=>{!g&&t.readyState===k.OPEN&&o()},M):o()}}),u])]})).apply(this,arguments)}function B(t){if(v(t)&&[1002,1011,4400,4401,4409,4429].includes(t.code))throw t;if(U)return!1;if(v(t)&&1e3===t.code)return g>0;if(!q||I>=q||te(t))throw t;return F=!0}return y||(0,h.Z)(function*(){for(g++;;)try{const[,,t]=yield j();yield t}catch(t){try{if(!B(t))return}catch(u){return null==R?void 0:R(u)}}})(),{on:p.on,subscribe(t,u){const a=re();let i=!1,o=!1,x=()=>{g--,i=!0};return(0,h.Z)(function*(){for(g++;;)try{const[l,P,W]=yield j();if(i)return P();const L=p.onMessage(a,f=>{switch(f.type){case s.Next:return void u.next(f.payload);case s.Error:return o=!0,i=!0,u.error(f.payload),void x();case s.Complete:return i=!0,void x()}});return l.send(N({id:a,type:s.Subscribe,payload:t},z)),x=()=>{!i&&l.readyState===k.OPEN&&l.send(N({id:a,type:s.Complete},z)),g--,i=!0,P()},void(yield W.finally(L))}catch(l){if(!B(l))return}})().catch(u.error).then(()=>{o||u.complete()}),()=>{i||x()}},dispose:()=>(0,h.Z)(function*(){if(U=!0,m){const[t]=yield m;t.close(1e3,"Normal Closure")}})()}}({url:this.subscriptionUrl,connectionParams:this.connectionParams,on:{connected:()=>{var n,c;null==(c=null==(n=this.extraOptions)?void 0:n.onConnected)||c.call(n,void 0,void 0)},error:n=>{var c,y;null==(y=null==(c=this.extraOptions)?void 0:c.onConnected)||y.call(c,n,void 0)}}})}execute(n){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new J.y(c=>{this.cleanup=this.client.subscribe({query:n.query,variables:n.variables,operationName:n.operationName},{next:(...y)=>c.next(...y),error:(...y)=>c.error(...y),complete:()=>c.complete()})})}close(){var n,c;null==(n=this.cleanup)||n.call(this),this.cleanup=void 0,null==(c=this.client)||c.dispose(),this.client=void 0}}}}]);