Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@absinthe/socket

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@absinthe/socket - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

2

compat/cjs/cancel.js

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

"use strict";function _interopDefault(i){return i&&"object"==typeof i&&"default"in i?i.default:i}var _extends=_interopDefault(require("babel-runtime/helpers/extends")),_newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsArray=require("@jumpn/utils-array"),utilsComposite=require("@jumpn/utils-composite");require("phoenix");var _this$2=void 0,findIndex=function(i,e,r){return _newArrowCheck(this,_this$2),i.findIndex(utilsComposite.hasIn([e],r))}.bind(void 0),_this$1=void 0,refresh=function(i){return _newArrowCheck(this,_this$1),function(e){return _newArrowCheck(this,_this$1),utilsArray.replace(findIndex(e,"request",i.request),[i],e)}.bind(this)}.bind(void 0),_this$4=void 0,getNotifier=function(i,e){return _newArrowCheck(this,_this$4),function(r){return _newArrowCheck(this,_this$4),r[i]&&r[i](e)}.bind(this)}.bind(void 0),getHandlerName=function(i){return _newArrowCheck(this,_this$4),"on"+String(i)}.bind(void 0),notify=function(i,e,r){return _newArrowCheck(this,_this$4),i.observers.forEach(getNotifier(getHandlerName(e),r))}.bind(void 0),_this$5=void 0,remove$1=function(i){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),utilsArray.remove(findIndex(e,"request",i.request),1,e)}.bind(this)}.bind(void 0),_this$6=void 0,updateNotifiers=function(i,e){return _newArrowCheck(this,_this$6),i.notifiers=e(i.notifiers),i}.bind(void 0),_this$3=void 0,cancelNotifier=function(i,e){_newArrowCheck(this,_this$3),updateNotifiers(i,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),_this$9=void 0,find=function(i,e,r){return _newArrowCheck(this,_this$9),i.find(utilsComposite.hasIn([e],r))}.bind(void 0),_this$8=void 0,createEventHandler=function(i,e){return _newArrowCheck(this,_this$8),function(r){return _newArrowCheck(this,_this$8),function(){for(var n=arguments.length,t=Array(n),o=0;o<n;o++)t[o]=arguments[o];_newArrowCheck(this,_this$8);var s=find(i.notifiers,"request",e);s&&r.apply(void 0,[i,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(i,e,r){return _newArrowCheck(this,_this$8),utilsComposite.map(createEventHandler(e,r),i)}.bind(void 0),_this$10=void 0,handlePush=function(i,e){return _newArrowCheck(this,_this$10),i.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$7=void 0,onError=function(i,e,r){_newArrowCheck(this,_this$7),unsubscribe(i,e),notify(e,"Error","unsubscribe: "+String(r))}.bind(void 0),onTimeout=function(i,e){return _newArrowCheck(this,_this$7),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:cancelNotifier},unsubscribe=function(i,e){return _newArrowCheck(this,_this$7),handlePush(i.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,i,e.request))}.bind(void 0),_this=void 0,cancelSubscription=function(i,e){_newArrowCheck(this,_this),updateNotifiers(i,refresh(_extends({},e,{cancelled:!0}))),e.subscriptionId&&unsubscribe(i,e)}.bind(void 0),cancel=function(i,e){return _newArrowCheck(this,_this),"subscription"===e.operationType?cancelSubscription(i,e):cancelNotifier(i,e),i}.bind(void 0);module.exports=cancel;
"use strict";function _interopDefault(i){return i&&"object"==typeof i&&"default"in i?i.default:i}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsComposite=require("@jumpn/utils-composite");require("phoenix");var utilsArray=require("@jumpn/utils-array"),_this$2=void 0,find=function(i,e,r){return _newArrowCheck(this,_this$2),i.find(utilsComposite.hasIn([e],r))}.bind(void 0),_this$1=void 0,createEventHandler=function(i,e){return _newArrowCheck(this,_this$1),function(r){return _newArrowCheck(this,_this$1),function(){for(var n=arguments.length,t=Array(n),o=0;o<n;o++)t[o]=arguments[o];_newArrowCheck(this,_this$1);var s=find(i.notifiers,"request",e);s&&r.apply(void 0,[i,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(i,e,r){return _newArrowCheck(this,_this$1),utilsComposite.map(createEventHandler(e,r),i)}.bind(void 0),_this$3=void 0,handlePush=function(i,e){return _newArrowCheck(this,_this$3),i.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(i,e){return _newArrowCheck(this,_this$4),function(r){return _newArrowCheck(this,_this$4),r[i]&&r[i](e)}.bind(this)}.bind(void 0),getHandlerName=function(i){return _newArrowCheck(this,_this$4),"on"+String(i)}.bind(void 0),notify=function(i,e,r){return _newArrowCheck(this,_this$4),i.observers.forEach(getNotifier(getHandlerName(e),r))}.bind(void 0),_this$6=void 0,findIndex=function(i,e,r){return _newArrowCheck(this,_this$6),i.findIndex(utilsComposite.hasIn([e],r))}.bind(void 0),_this$5=void 0,remove$1=function(i){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),utilsArray.remove(findIndex(e,"request",i.request),1,e)}.bind(this)}.bind(void 0),_this$7=void 0,updateNotifiers=function(i,e){return _newArrowCheck(this,_this$7),i.notifiers=e(i.notifiers),i}.bind(void 0),_this=void 0,removeNotifiers=function(i,e){_newArrowCheck(this,_this),updateNotifiers(i,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),onError=function(i,e,r){_newArrowCheck(this,_this),unsubscribe(i,e),notify(e,"Error","unsubscribe: "+String(r))}.bind(void 0),onTimeout=function(i,e){return _newArrowCheck(this,_this),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:removeNotifiers},unsubscribe=function(i,e){return _newArrowCheck(this,_this),handlePush(i.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,i,e.request))}.bind(void 0),cancel=function(i,e){return _newArrowCheck(this,_this),"subscription"===e.operationType?unsubscribe(i,e):removeNotifiers(i,e),i}.bind(void 0);module.exports=cancel;
//# sourceMappingURL=cancel.js.map

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

"use strict";function _interopDefault(n){return n&&"object"==typeof n&&"default"in n?n.default:n}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck"));require("phoenix");var _extends=_interopDefault(require("babel-runtime/helpers/extends")),utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite"),utilsArray=require("@jumpn/utils-array"),_this$2=void 0,handlePush=function(n,i){return _newArrowCheck(this,_this$2),n.receive("ok",i.onSucceed).receive("error",i.onError).receive("timeout",i.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(n,i){return _newArrowCheck(this,_this$4),function(e){return _newArrowCheck(this,_this$4),e[n]&&e[n](i)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,i,e){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(i),e))}.bind(void 0),_this$3=void 0,notifyall=function(n,i,e){return _newArrowCheck(this,_this$3),n.forEach(function(n){return _newArrowCheck(this,_this$3),notify(n,i,e)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(n,i,e){return _newArrowCheck(this,_this$7),n.find(utilsComposite.hasIn([i],e))}.bind(void 0),_this$6=void 0,createEventHandler=function(n,i){return _newArrowCheck(this,_this$6),function(e){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(n.notifiers,"request",i);s&&e.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,i,e){return _newArrowCheck(this,_this$6),utilsComposite.map(createEventHandler(i,e),n)}.bind(void 0),_this$9=void 0,findIndex=function(n,i,e){return _newArrowCheck(this,_this$9),n.findIndex(utilsComposite.hasIn([i],e))}.bind(void 0),_this$8=void 0,remove$1=function(n){return _newArrowCheck(this,_this$8),function(i){return _newArrowCheck(this,_this$8),utilsArray.remove(findIndex(i,"request",n.request),1,i)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(n){return _newArrowCheck(this,_this$10),function(i){return _newArrowCheck(this,_this$10),utilsArray.replace(findIndex(i,"request",n.request),[n],i)}.bind(this)}.bind(void 0),_this$13=void 0,updateNotifiers=function(n,i){return _newArrowCheck(this,_this$13),n.notifiers=i(n.notifiers),n}.bind(void 0),_this$12=void 0,cancelNotifier=function(n,i){_newArrowCheck(this,_this$12),updateNotifiers(n,remove$1(i)),notify(i,"Cancel",i)}.bind(void 0),_this$11=void 0,onError$1=function(n,i,e){_newArrowCheck(this,_this$11),unsubscribe(n,i),notify(i,"Error","unsubscribe: "+String(e))}.bind(void 0),onTimeout$1=function(n,i){return _newArrowCheck(this,_this$11),notify(i,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(n,i){return _newArrowCheck(this,_this$11),handlePush(n.channel.push("unsubscribe",{subscriptionId:i.subscriptionId}),createPushHandler(notifierPushHandler,n,i.request))}.bind(void 0),_this$5=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$5),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,i,e){var r=e.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},i,{subscriptionId:r});updateNotifiers(n,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(n,t)}.bind(void 0),abortRequest=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Abort",e)}.bind(void 0),onError=function(n,i,e){return _newArrowCheck(this,_this$5),abortRequest(n,i,new Error(e))}.bind(void 0),onSubscriptionResponse=function(n,i,e){_newArrowCheck(this,_this$5),e.errors?onError(n,i,utilsGraphql.errorsToString(e.errors)):onSubscriptionSucceed(n,i,e)}.bind(void 0),onQueryOrMutationResponse=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Result",e)}.bind(void 0),onTimeout=function(n,i){return _newArrowCheck(this,_this$5),notify(i,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(n,i,e){return _newArrowCheck(this,_this$5),handlePush(n.channel.push("doc",utilsGraphql.requestToCompat(i)),createPushHandler(e,n,i))}.bind(void 0),pushRequest=function(n,i){_newArrowCheck(this,_this$5),"subscription"===i.operationType?send(n,i.request,subcriptionHandler):(notifyStart(i),send(n,i.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$1),{onError:function(i){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: "+String(i)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),n.notifiers.forEach(function(i){return _newArrowCheck(this,_this$1),pushRequest(n,i)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$1),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(n,i){_newArrowCheck(this,_this),updateNotifiers(n,remove$1(i)),notify(i,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"mutation"===i.operationType?mutationOnConnectionClose(n,i):notify(i,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(n){return _newArrowCheck(this,_this),function(){return _newArrowCheck(this,_this),n.notifiers.forEach(notifierOnConnectionClose(n))}.bind(this)}.bind(void 0),onSubscriptionData=function(n,i){var e=i.payload;_newArrowCheck(this,_this);var r=find(n.notifiers,"subscriptionId",e.subscriptionId);r&&notify(r,"Result",e.result)}.bind(void 0),onMessage=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"subscription:data"===i.event&&onSubscriptionData(n,i)}.bind(this)}.bind(void 0),shouldJoinChannel=function(n){return _newArrowCheck(this,_this),!n.channelJoinCreated&&n.notifiers.length>0}.bind(void 0),onConnectionOpen=function(n){return _newArrowCheck(this,_this),function(){_newArrowCheck(this,_this),shouldJoinChannel(n)&&joinChannel(n)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(n){_newArrowCheck(this,_this);var i={phoenixSocket:n,channel:n.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return n.onOpen(onConnectionOpen(i)),n.onMessage(onMessage(i)),n.onClose(onConnectionClose(i)),i}.bind(void 0);module.exports=create;
"use strict";function _interopDefault(n){return n&&"object"==typeof n&&"default"in n?n.default:n}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck"));require("phoenix");var _extends=_interopDefault(require("babel-runtime/helpers/extends")),utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite"),utilsArray=require("@jumpn/utils-array"),_this$2=void 0,handlePush=function(n,i){return _newArrowCheck(this,_this$2),n.receive("ok",i.onSucceed).receive("error",i.onError).receive("timeout",i.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(n,i){return _newArrowCheck(this,_this$4),function(e){return _newArrowCheck(this,_this$4),e[n]&&e[n](i)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,i,e){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(i),e))}.bind(void 0),_this$3=void 0,notifyall=function(n,i,e){return _newArrowCheck(this,_this$3),n.forEach(function(n){return _newArrowCheck(this,_this$3),notify(n,i,e)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(n,i,e){return _newArrowCheck(this,_this$7),n.find(utilsComposite.hasIn([i],e))}.bind(void 0),_this$6=void 0,createEventHandler=function(n,i){return _newArrowCheck(this,_this$6),function(e){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(n.notifiers,"request",i);s&&e.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,i,e){return _newArrowCheck(this,_this$6),utilsComposite.map(createEventHandler(i,e),n)}.bind(void 0),_this$9=void 0,findIndex=function(n,i,e){return _newArrowCheck(this,_this$9),n.findIndex(utilsComposite.hasIn([i],e))}.bind(void 0),_this$8=void 0,remove$1=function(n){return _newArrowCheck(this,_this$8),function(i){return _newArrowCheck(this,_this$8),utilsArray.remove(findIndex(i,"request",n.request),1,i)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(n){return _newArrowCheck(this,_this$10),function(i){return _newArrowCheck(this,_this$10),utilsArray.replace(findIndex(i,"request",n.request),[n],i)}.bind(this)}.bind(void 0),_this$11=void 0,updateNotifiers=function(n,i){return _newArrowCheck(this,_this$11),n.notifiers=i(n.notifiers),n}.bind(void 0),_this$5=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$5),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,i,e){var r=e.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},i,{subscriptionId:r});updateNotifiers(n,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Abort",e)}.bind(void 0),onError=function(n,i,e){return _newArrowCheck(this,_this$5),abortRequest(n,i,new Error(e))}.bind(void 0),onSubscriptionResponse=function(n,i,e){_newArrowCheck(this,_this$5),e.errors?onError(n,i,utilsGraphql.errorsToString(e.errors)):onSubscriptionSucceed(n,i,e)}.bind(void 0),onQueryOrMutationResponse=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Result",e)}.bind(void 0),onTimeout=function(n,i){return _newArrowCheck(this,_this$5),notify(i,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(n,i,e){return _newArrowCheck(this,_this$5),handlePush(n.channel.push("doc",utilsGraphql.requestToCompat(i)),createPushHandler(e,n,i))}.bind(void 0),pushRequest=function(n,i){_newArrowCheck(this,_this$5),"subscription"===i.operationType?send(n,i.request,subcriptionHandler):(notifyStart(i),send(n,i.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$1),{onError:function(i){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: "+String(i)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),n.notifiers.forEach(function(i){return _newArrowCheck(this,_this$1),pushRequest(n,i)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$1),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(n,i){_newArrowCheck(this,_this),updateNotifiers(n,remove$1(i)),notify(i,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"mutation"===i.operationType?mutationOnConnectionClose(n,i):notify(i,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(n){return _newArrowCheck(this,_this),function(){return _newArrowCheck(this,_this),n.notifiers.forEach(notifierOnConnectionClose(n))}.bind(this)}.bind(void 0),onSubscriptionData=function(n,i){var e=i.payload;_newArrowCheck(this,_this);var r=find(n.notifiers,"subscriptionId",e.subscriptionId);r&&notify(r,"Result",e.result)}.bind(void 0),onMessage=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"subscription:data"===i.event&&onSubscriptionData(n,i)}.bind(this)}.bind(void 0),shouldJoinChannel=function(n){return _newArrowCheck(this,_this),!n.channelJoinCreated&&n.notifiers.length>0}.bind(void 0),onConnectionOpen=function(n){return _newArrowCheck(this,_this),function(){_newArrowCheck(this,_this),shouldJoinChannel(n)&&joinChannel(n)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(n){_newArrowCheck(this,_this);var i={phoenixSocket:n,channel:n.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return n.onOpen(onConnectionOpen(i)),n.onMessage(onMessage(i)),n.onClose(onConnectionClose(i)),i}.bind(void 0);module.exports=create;
//# sourceMappingURL=create.js.map

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

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=_interopDefault(require("babel-runtime/helpers/extends")),_newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsArray=require("@jumpn/utils-array"),utilsComposite=require("@jumpn/utils-composite");require("phoenix");var utilsGraphql=require("@jumpn/utils-graphql"),_toConsumableArray=_interopDefault(require("babel-runtime/helpers/toConsumableArray")),_objectWithoutProperties=_interopDefault(require("babel-runtime/helpers/objectWithoutProperties")),Observable=_interopDefault(require("zen-observable")),_this$2=void 0,findIndex=function(e,n,i){return _newArrowCheck(this,_this$2),e.findIndex(utilsComposite.hasIn([n],i))}.bind(void 0),_this$1=void 0,refresh=function(e){return _newArrowCheck(this,_this$1),function(n){return _newArrowCheck(this,_this$1),utilsArray.replace(findIndex(n,"request",e.request),[e],n)}.bind(this)}.bind(void 0),_this$4=void 0,getNotifier=function(e,n){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[e]&&i[e](n)}.bind(this)}.bind(void 0),getHandlerName=function(e){return _newArrowCheck(this,_this$4),"on"+String(e)}.bind(void 0),notify=function(e,n,i){return _newArrowCheck(this,_this$4),e.observers.forEach(getNotifier(getHandlerName(n),i))}.bind(void 0),_this$5=void 0,remove$1=function(e){return _newArrowCheck(this,_this$5),function(n){return _newArrowCheck(this,_this$5),utilsArray.remove(findIndex(n,"request",e.request),1,n)}.bind(this)}.bind(void 0),_this$6=void 0,updateNotifiers=function(e,n){return _newArrowCheck(this,_this$6),e.notifiers=n(e.notifiers),e}.bind(void 0),_this$3=void 0,cancelNotifier=function(e,n){_newArrowCheck(this,_this$3),updateNotifiers(e,remove$1(n)),notify(n,"Cancel",n)}.bind(void 0),_this$9=void 0,find=function(e,n,i){return _newArrowCheck(this,_this$9),e.find(utilsComposite.hasIn([n],i))}.bind(void 0),_this$8=void 0,createEventHandler=function(e,n){return _newArrowCheck(this,_this$8),function(i){return _newArrowCheck(this,_this$8),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$8);var s=find(e.notifiers,"request",n);s&&i.apply(void 0,[e,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(e,n,i){return _newArrowCheck(this,_this$8),utilsComposite.map(createEventHandler(n,i),e)}.bind(void 0),_this$10=void 0,handlePush=function(e,n){return _newArrowCheck(this,_this$10),e.receive("ok",n.onSucceed).receive("error",n.onError).receive("timeout",n.onTimeout)}.bind(void 0),_this$7=void 0,onError=function(e,n,i){_newArrowCheck(this,_this$7),unsubscribe(e,n),notify(n,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout=function(e,n){return _newArrowCheck(this,_this$7),notify(n,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:cancelNotifier},unsubscribe=function(e,n){return _newArrowCheck(this,_this$7),handlePush(e.channel.push("unsubscribe",{subscriptionId:n.subscriptionId}),createPushHandler(notifierPushHandler,e,n.request))}.bind(void 0),_this=void 0,cancelSubscription=function(e,n){_newArrowCheck(this,_this),updateNotifiers(e,refresh(_extends({},n,{cancelled:!0}))),n.subscriptionId&&unsubscribe(e,n)}.bind(void 0),cancel=function(e,n){return _newArrowCheck(this,_this),"subscription"===n.operationType?cancelSubscription(e,n):cancelNotifier(e,n),e}.bind(void 0),_this$13=void 0,notifyall=function(e,n,i){return _newArrowCheck(this,_this$13),e.forEach(function(e){return _newArrowCheck(this,_this$13),notify(e,n,i)}.bind(this))}.bind(void 0),_this$14=void 0,notifyStart=function(e){return _newArrowCheck(this,_this$14),notify(e,"Start",e)}.bind(void 0),onSubscriptionSucceed=function(e,n,i){var r=i.subscriptionId;_newArrowCheck(this,_this$14);var t=_extends({},n,{subscriptionId:r});updateNotifiers(e,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(e,t)}.bind(void 0),abortRequest=function(e,n,i){_newArrowCheck(this,_this$14),updateNotifiers(e,remove$1(n)),notify(n,"Abort",i)}.bind(void 0),onError$1=function(e,n,i){return _newArrowCheck(this,_this$14),abortRequest(e,n,new Error(i))}.bind(void 0),onSubscriptionResponse=function(e,n,i){_newArrowCheck(this,_this$14),i.errors?onError$1(e,n,utilsGraphql.errorsToString(i.errors)):onSubscriptionSucceed(e,n,i)}.bind(void 0),onQueryOrMutationResponse=function(e,n,i){_newArrowCheck(this,_this$14),updateNotifiers(e,remove$1(n)),notify(n,"Result",i)}.bind(void 0),onTimeout$1=function(e,n){return _newArrowCheck(this,_this$14),notify(n,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onSubscriptionResponse},send=function(e,n,i){return _newArrowCheck(this,_this$14),handlePush(e.channel.push("doc",utilsGraphql.requestToCompat(n)),createPushHandler(i,e,n))}.bind(void 0),pushRequest=function(e,n){_newArrowCheck(this,_this$14),"subscription"===n.operationType?send(e,n.request,subcriptionHandler):(notifyStart(n),send(e,n.request,queryOrMutationHandler))}.bind(void 0),_this$12=void 0,createChannelJoinHandler=function(e){return _newArrowCheck(this,_this$12),{onError:function(n){return _newArrowCheck(this,_this$12),notifyall(e.notifiers,"Error",new Error("channel join: "+String(n)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$12),e.notifiers.forEach(function(n){return _newArrowCheck(this,_this$12),pushRequest(e,n)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$12),notifyall(e.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(e){return _newArrowCheck(this,_this$12),handlePush(e.channel.join(),createChannelJoinHandler(e)),e.channelJoinCreated=!0,e}.bind(void 0),_this$11=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this$11),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(e,n){_newArrowCheck(this,_this$11),updateNotifiers(e,remove$1(n)),notify(n,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(e){return _newArrowCheck(this,_this$11),function(n){_newArrowCheck(this,_this$11),"mutation"===n.operationType?mutationOnConnectionClose(e,n):notify(n,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(e){return _newArrowCheck(this,_this$11),function(){return _newArrowCheck(this,_this$11),e.notifiers.forEach(notifierOnConnectionClose(e))}.bind(this)}.bind(void 0),onSubscriptionData=function(e,n){var i=n.payload;_newArrowCheck(this,_this$11);var r=find(e.notifiers,"subscriptionId",i.subscriptionId);r&&notify(r,"Result",i.result)}.bind(void 0),onMessage=function(e){return _newArrowCheck(this,_this$11),function(n){_newArrowCheck(this,_this$11),"subscription:data"===n.event&&onSubscriptionData(e,n)}.bind(this)}.bind(void 0),shouldJoinChannel=function(e){return _newArrowCheck(this,_this$11),!e.channelJoinCreated&&e.notifiers.length>0}.bind(void 0),onConnectionOpen=function(e){return _newArrowCheck(this,_this$11),function(){_newArrowCheck(this,_this$11),shouldJoinChannel(e)&&joinChannel(e)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(e){_newArrowCheck(this,_this$11);var n={phoenixSocket:e,channel:e.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return e.onOpen(onConnectionOpen(n)),e.onMessage(onMessage(n)),e.onClose(onConnectionClose(n)),n}.bind(void 0),_this$16=void 0,observe$2=function(e,n){_newArrowCheck(this,_this$16);var i=e.observers,r=_objectWithoutProperties(e,["observers"]);return _extends({},r,{observers:[].concat(_toConsumableArray(i),[n])})}.bind(void 0),_this$15=void 0,observe=function(e,n,i){return _newArrowCheck(this,_this$15),updateNotifiers(e,refresh(observe$2(n,i)))}.bind(void 0),_this$18=void 0,create$2=function(e){return _newArrowCheck(this,_this$18),{request:e,cancelled:!1,observers:[],operationType:utilsGraphql.getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0),_this$17=void 0,connectOrJoinChannel=function(e){_newArrowCheck(this,_this$17),e.phoenixSocket.isConnected()?joinChannel(e):e.phoenixSocket.connect()}.bind(void 0),sendNew=function(e,n){_newArrowCheck(this,_this$17);var i=create$2(n);return updateNotifiers(e,utilsArray.append([i])),e.channelJoinCreated?pushRequest(e,i):connectOrJoinChannel(e),i}.bind(void 0),uncancel=function(e,n){_newArrowCheck(this,_this$17);var i=n.prevStatus,r=_extends({},n,{status:i,prevStatus:n.status});return updateNotifiers(e,notifierRefresh(updateNotifiers)),r}.bind(void 0),uncancelIfNeeded=function(e,n){return _newArrowCheck(this,_this$17),"cancelling"===n.status?uncancel(e,n):n}.bind(void 0),send$1=function(e,n){_newArrowCheck(this,_this$17);var i=find(e.notifiers,"request",n);return i?uncancelIfNeeded(e,i):sendNew(e,n)}.bind(void 0),_this$19=void 0,onResult=function(e,n){return _newArrowCheck(this,_this$19),function(i){_newArrowCheck(this,_this$19),n.next(i),"subscription"!==e.operationType&&n.complete()}.bind(this)}.bind(void 0),toObservable=function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.onError,t=i.onStart,o=i.unsubscribe;return _newArrowCheck(this,_this$19),new Observable(function(i){return _newArrowCheck(this,_this$19),observe(e,n,{onError:r,onStart:t,onAbort:i.error,onResult:onResult(n,i)}),o}.bind(this))}.bind(void 0),_this$21=void 0,unobserve$2=function(e,n){_newArrowCheck(this,_this$21);var i=e.observers,r=_objectWithoutProperties(e,["observers"]);return _extends({},r,{observers:utilsArray.remove(i.indexOf(n),1,i)})}.bind(void 0),_this$20=void 0,unobserve=function(e,n,i){return _newArrowCheck(this,_this$20),updateNotifiers(e,refresh(unobserve$2(n,i))),e}.bind(void 0);exports.cancel=cancel,exports.create=create,exports.observe=observe,exports.send=send$1,exports.toObservable=toObservable,exports.unobserve=unobserve;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsComposite=require("@jumpn/utils-composite");require("phoenix");var utilsArray=require("@jumpn/utils-array"),_extends=_interopDefault(require("babel-runtime/helpers/extends")),utilsGraphql=require("@jumpn/utils-graphql"),_toConsumableArray=_interopDefault(require("babel-runtime/helpers/toConsumableArray")),_objectWithoutProperties=_interopDefault(require("babel-runtime/helpers/objectWithoutProperties")),Observable=_interopDefault(require("zen-observable")),_this$2=void 0,find=function(e,n,i){return _newArrowCheck(this,_this$2),e.find(utilsComposite.hasIn([n],i))}.bind(void 0),_this$1=void 0,createEventHandler=function(e,n){return _newArrowCheck(this,_this$1),function(i){return _newArrowCheck(this,_this$1),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$1);var s=find(e.notifiers,"request",n);s&&i.apply(void 0,[e,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(e,n,i){return _newArrowCheck(this,_this$1),utilsComposite.map(createEventHandler(n,i),e)}.bind(void 0),_this$3=void 0,handlePush=function(e,n){return _newArrowCheck(this,_this$3),e.receive("ok",n.onSucceed).receive("error",n.onError).receive("timeout",n.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(e,n){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[e]&&i[e](n)}.bind(this)}.bind(void 0),getHandlerName=function(e){return _newArrowCheck(this,_this$4),"on"+String(e)}.bind(void 0),notify=function(e,n,i){return _newArrowCheck(this,_this$4),e.observers.forEach(getNotifier(getHandlerName(n),i))}.bind(void 0),_this$6=void 0,findIndex=function(e,n,i){return _newArrowCheck(this,_this$6),e.findIndex(utilsComposite.hasIn([n],i))}.bind(void 0),_this$5=void 0,remove$1=function(e){return _newArrowCheck(this,_this$5),function(n){return _newArrowCheck(this,_this$5),utilsArray.remove(findIndex(n,"request",e.request),1,n)}.bind(this)}.bind(void 0),_this$7=void 0,updateNotifiers=function(e,n){return _newArrowCheck(this,_this$7),e.notifiers=n(e.notifiers),e}.bind(void 0),_this=void 0,removeNotifiers=function(e,n){_newArrowCheck(this,_this),updateNotifiers(e,remove$1(n)),notify(n,"Cancel",n)}.bind(void 0),onError=function(e,n,i){_newArrowCheck(this,_this),unsubscribe(e,n),notify(n,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout=function(e,n){return _newArrowCheck(this,_this),notify(n,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:removeNotifiers},unsubscribe=function(e,n){return _newArrowCheck(this,_this),handlePush(e.channel.push("unsubscribe",{subscriptionId:n.subscriptionId}),createPushHandler(notifierPushHandler,e,n.request))}.bind(void 0),cancel=function(e,n){return _newArrowCheck(this,_this),"subscription"===n.operationType?unsubscribe(e,n):removeNotifiers(e,n),e}.bind(void 0),_this$10=void 0,notifyall=function(e,n,i){return _newArrowCheck(this,_this$10),e.forEach(function(e){return _newArrowCheck(this,_this$10),notify(e,n,i)}.bind(this))}.bind(void 0),_this$12=void 0,refresh=function(e){return _newArrowCheck(this,_this$12),function(n){return _newArrowCheck(this,_this$12),utilsArray.replace(findIndex(n,"request",e.request),[e],n)}.bind(this)}.bind(void 0),_this$11=void 0,notifyStart=function(e){return _newArrowCheck(this,_this$11),notify(e,"Start",e)}.bind(void 0),onSubscriptionSucceed=function(e,n,i){var r=i.subscriptionId;_newArrowCheck(this,_this$11);var t=_extends({},n,{subscriptionId:r});updateNotifiers(e,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(e,n,i){_newArrowCheck(this,_this$11),updateNotifiers(e,remove$1(n)),notify(n,"Abort",i)}.bind(void 0),onError$1=function(e,n,i){return _newArrowCheck(this,_this$11),abortRequest(e,n,new Error(i))}.bind(void 0),onSubscriptionResponse=function(e,n,i){_newArrowCheck(this,_this$11),i.errors?onError$1(e,n,utilsGraphql.errorsToString(i.errors)):onSubscriptionSucceed(e,n,i)}.bind(void 0),onQueryOrMutationResponse=function(e,n,i){_newArrowCheck(this,_this$11),updateNotifiers(e,remove$1(n)),notify(n,"Result",i)}.bind(void 0),onTimeout$1=function(e,n){return _newArrowCheck(this,_this$11),notify(n,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onSubscriptionResponse},send=function(e,n,i){return _newArrowCheck(this,_this$11),handlePush(e.channel.push("doc",utilsGraphql.requestToCompat(n)),createPushHandler(i,e,n))}.bind(void 0),pushRequest=function(e,n){_newArrowCheck(this,_this$11),"subscription"===n.operationType?send(e,n.request,subcriptionHandler):(notifyStart(n),send(e,n.request,queryOrMutationHandler))}.bind(void 0),_this$9=void 0,createChannelJoinHandler=function(e){return _newArrowCheck(this,_this$9),{onError:function(n){return _newArrowCheck(this,_this$9),notifyall(e.notifiers,"Error",new Error("channel join: "+String(n)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$9),e.notifiers.forEach(function(n){return _newArrowCheck(this,_this$9),pushRequest(e,n)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$9),notifyall(e.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(e){return _newArrowCheck(this,_this$9),handlePush(e.channel.join(),createChannelJoinHandler(e)),e.channelJoinCreated=!0,e}.bind(void 0),_this$8=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this$8),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(e,n){_newArrowCheck(this,_this$8),updateNotifiers(e,remove$1(n)),notify(n,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(e){return _newArrowCheck(this,_this$8),function(n){_newArrowCheck(this,_this$8),"mutation"===n.operationType?mutationOnConnectionClose(e,n):notify(n,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(e){return _newArrowCheck(this,_this$8),function(){return _newArrowCheck(this,_this$8),e.notifiers.forEach(notifierOnConnectionClose(e))}.bind(this)}.bind(void 0),onSubscriptionData=function(e,n){var i=n.payload;_newArrowCheck(this,_this$8);var r=find(e.notifiers,"subscriptionId",i.subscriptionId);r&&notify(r,"Result",i.result)}.bind(void 0),onMessage=function(e){return _newArrowCheck(this,_this$8),function(n){_newArrowCheck(this,_this$8),"subscription:data"===n.event&&onSubscriptionData(e,n)}.bind(this)}.bind(void 0),shouldJoinChannel=function(e){return _newArrowCheck(this,_this$8),!e.channelJoinCreated&&e.notifiers.length>0}.bind(void 0),onConnectionOpen=function(e){return _newArrowCheck(this,_this$8),function(){_newArrowCheck(this,_this$8),shouldJoinChannel(e)&&joinChannel(e)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(e){_newArrowCheck(this,_this$8);var n={phoenixSocket:e,channel:e.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return e.onOpen(onConnectionOpen(n)),e.onMessage(onMessage(n)),e.onClose(onConnectionClose(n)),n}.bind(void 0),_this$14=void 0,observe$2=function(e,n){_newArrowCheck(this,_this$14);var i=e.observers,r=_objectWithoutProperties(e,["observers"]);return _extends({},r,{observers:[].concat(_toConsumableArray(i),[n])})}.bind(void 0),_this$13=void 0,observe=function(e,n,i){return _newArrowCheck(this,_this$13),updateNotifiers(e,refresh(observe$2(n,i)))}.bind(void 0),_this$16=void 0,create$2=function(e){return _newArrowCheck(this,_this$16),{request:e,observers:[],operationType:utilsGraphql.getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0),_this$15=void 0,connectOrJoinChannel=function(e){_newArrowCheck(this,_this$15),e.phoenixSocket.isConnected()?joinChannel(e):e.phoenixSocket.connect()}.bind(void 0),sendNew=function(e,n){_newArrowCheck(this,_this$15);var i=create$2(n);return updateNotifiers(e,utilsArray.append([i])),e.channelJoinCreated?pushRequest(e,i):connectOrJoinChannel(e),i}.bind(void 0),send$1=function(e,n){return _newArrowCheck(this,_this$15),find(e.notifiers,"request",n)||sendNew(e,n)}.bind(void 0),_this$17=void 0,onResult=function(e,n){return _newArrowCheck(this,_this$17),function(i){_newArrowCheck(this,_this$17),n.next(i),"subscription"!==e.operationType&&n.complete()}.bind(this)}.bind(void 0),toObservable=function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.onError,t=i.onStart,o=i.unsubscribe;return _newArrowCheck(this,_this$17),new Observable(function(i){return _newArrowCheck(this,_this$17),observe(e,n,{onError:r,onStart:t,onAbort:i.error,onResult:onResult(n,i)}),o}.bind(this))}.bind(void 0),_this$19=void 0,unobserve$2=function(e,n){_newArrowCheck(this,_this$19);var i=e.observers,r=_objectWithoutProperties(e,["observers"]);return _extends({},r,{observers:utilsArray.remove(i.indexOf(n),1,i)})}.bind(void 0),_this$18=void 0,unobserve=function(e,n,i){return _newArrowCheck(this,_this$18),updateNotifiers(e,refresh(unobserve$2(n,i))),e}.bind(void 0);exports.cancel=cancel,exports.create=create,exports.observe=observe,exports.send=send$1,exports.toObservable=toObservable,exports.unobserve=unobserve;
//# sourceMappingURL=index.js.map

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

"use strict";function _interopDefault(i){return i&&"object"==typeof i&&"default"in i?i.default:i}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck"));require("phoenix");var _extends=_interopDefault(require("babel-runtime/helpers/extends")),utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite"),utilsArray=require("@jumpn/utils-array"),_this$1=void 0,handlePush=function(i,r){return _newArrowCheck(this,_this$1),i.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),_this$3=void 0,getNotifier=function(i,r){return _newArrowCheck(this,_this$3),function(n){return _newArrowCheck(this,_this$3),n[i]&&n[i](r)}.bind(this)}.bind(void 0),getHandlerName=function(i){return _newArrowCheck(this,_this$3),"on"+String(i)}.bind(void 0),notify=function(i,r,n){return _newArrowCheck(this,_this$3),i.observers.forEach(getNotifier(getHandlerName(r),n))}.bind(void 0),_this$2=void 0,notifyall=function(i,r,n){return _newArrowCheck(this,_this$2),i.forEach(function(i){return _newArrowCheck(this,_this$2),notify(i,r,n)}.bind(this))}.bind(void 0),_this$6=void 0,find=function(i,r,n){return _newArrowCheck(this,_this$6),i.find(utilsComposite.hasIn([r],n))}.bind(void 0),_this$5=void 0,createEventHandler=function(i,r){return _newArrowCheck(this,_this$5),function(n){return _newArrowCheck(this,_this$5),function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];_newArrowCheck(this,_this$5);var s=find(i.notifiers,"request",r);s&&n.apply(void 0,[i,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(i,r,n){return _newArrowCheck(this,_this$5),utilsComposite.map(createEventHandler(r,n),i)}.bind(void 0),_this$8=void 0,findIndex=function(i,r,n){return _newArrowCheck(this,_this$8),i.findIndex(utilsComposite.hasIn([r],n))}.bind(void 0),_this$7=void 0,remove$1=function(i){return _newArrowCheck(this,_this$7),function(r){return _newArrowCheck(this,_this$7),utilsArray.remove(findIndex(r,"request",i.request),1,r)}.bind(this)}.bind(void 0),_this$9=void 0,refresh=function(i){return _newArrowCheck(this,_this$9),function(r){return _newArrowCheck(this,_this$9),utilsArray.replace(findIndex(r,"request",i.request),[i],r)}.bind(this)}.bind(void 0),_this$12=void 0,updateNotifiers=function(i,r){return _newArrowCheck(this,_this$12),i.notifiers=r(i.notifiers),i}.bind(void 0),_this$11=void 0,cancelNotifier=function(i,r){_newArrowCheck(this,_this$11),updateNotifiers(i,remove$1(r)),notify(r,"Cancel",r)}.bind(void 0),_this$10=void 0,onError$1=function(i,r,n){_newArrowCheck(this,_this$10),unsubscribe(i,r),notify(r,"Error","unsubscribe: "+String(n))}.bind(void 0),onTimeout$1=function(i,r){return _newArrowCheck(this,_this$10),notify(r,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(i,r){return _newArrowCheck(this,_this$10),handlePush(i.channel.push("unsubscribe",{subscriptionId:r.subscriptionId}),createPushHandler(notifierPushHandler,i,r.request))}.bind(void 0),_this$4=void 0,notifyStart=function(i){return _newArrowCheck(this,_this$4),notify(i,"Start",i)}.bind(void 0),onSubscriptionSucceed=function(i,r,n){var e=n.subscriptionId;_newArrowCheck(this,_this$4);var t=_extends({},r,{subscriptionId:e});updateNotifiers(i,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(i,t)}.bind(void 0),abortRequest=function(i,r,n){_newArrowCheck(this,_this$4),updateNotifiers(i,remove$1(r)),notify(r,"Abort",n)}.bind(void 0),onError=function(i,r,n){return _newArrowCheck(this,_this$4),abortRequest(i,r,new Error(n))}.bind(void 0),onSubscriptionResponse=function(i,r,n){_newArrowCheck(this,_this$4),n.errors?onError(i,r,utilsGraphql.errorsToString(n.errors)):onSubscriptionSucceed(i,r,n)}.bind(void 0),onQueryOrMutationResponse=function(i,r,n){_newArrowCheck(this,_this$4),updateNotifiers(i,remove$1(r)),notify(r,"Result",n)}.bind(void 0),onTimeout=function(i,r){return _newArrowCheck(this,_this$4),notify(r,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(i,r,n){return _newArrowCheck(this,_this$4),handlePush(i.channel.push("doc",utilsGraphql.requestToCompat(r)),createPushHandler(n,i,r))}.bind(void 0),pushRequest=function(i,r){_newArrowCheck(this,_this$4),"subscription"===r.operationType?send(i,r.request,subcriptionHandler):(notifyStart(r),send(i,r.request,queryOrMutationHandler))}.bind(void 0),_this=void 0,createChannelJoinHandler=function(i){return _newArrowCheck(this,_this),{onError:function(r){return _newArrowCheck(this,_this),notifyall(i.notifiers,"Error",new Error("channel join: "+String(r)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this),i.notifiers.forEach(function(r){return _newArrowCheck(this,_this),pushRequest(i,r)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this),notifyall(i.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(i){return _newArrowCheck(this,_this),handlePush(i.channel.join(),createChannelJoinHandler(i)),i.channelJoinCreated=!0,i}.bind(void 0);module.exports=joinChannel;
"use strict";function _interopDefault(i){return i&&"object"==typeof i&&"default"in i?i.default:i}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck"));require("phoenix");var _extends=_interopDefault(require("babel-runtime/helpers/extends")),utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite"),utilsArray=require("@jumpn/utils-array"),_this$1=void 0,handlePush=function(i,r){return _newArrowCheck(this,_this$1),i.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),_this$3=void 0,getNotifier=function(i,r){return _newArrowCheck(this,_this$3),function(e){return _newArrowCheck(this,_this$3),e[i]&&e[i](r)}.bind(this)}.bind(void 0),getHandlerName=function(i){return _newArrowCheck(this,_this$3),"on"+String(i)}.bind(void 0),notify=function(i,r,e){return _newArrowCheck(this,_this$3),i.observers.forEach(getNotifier(getHandlerName(r),e))}.bind(void 0),_this$2=void 0,notifyall=function(i,r,e){return _newArrowCheck(this,_this$2),i.forEach(function(i){return _newArrowCheck(this,_this$2),notify(i,r,e)}.bind(this))}.bind(void 0),_this$6=void 0,find=function(i,r,e){return _newArrowCheck(this,_this$6),i.find(utilsComposite.hasIn([r],e))}.bind(void 0),_this$5=void 0,createEventHandler=function(i,r){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),function(){for(var n=arguments.length,t=Array(n),o=0;o<n;o++)t[o]=arguments[o];_newArrowCheck(this,_this$5);var s=find(i.notifiers,"request",r);s&&e.apply(void 0,[i,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(i,r,e){return _newArrowCheck(this,_this$5),utilsComposite.map(createEventHandler(r,e),i)}.bind(void 0),_this$8=void 0,findIndex=function(i,r,e){return _newArrowCheck(this,_this$8),i.findIndex(utilsComposite.hasIn([r],e))}.bind(void 0),_this$7=void 0,remove$1=function(i){return _newArrowCheck(this,_this$7),function(r){return _newArrowCheck(this,_this$7),utilsArray.remove(findIndex(r,"request",i.request),1,r)}.bind(this)}.bind(void 0),_this$9=void 0,refresh=function(i){return _newArrowCheck(this,_this$9),function(r){return _newArrowCheck(this,_this$9),utilsArray.replace(findIndex(r,"request",i.request),[i],r)}.bind(this)}.bind(void 0),_this$10=void 0,updateNotifiers=function(i,r){return _newArrowCheck(this,_this$10),i.notifiers=r(i.notifiers),i}.bind(void 0),_this$4=void 0,notifyStart=function(i){return _newArrowCheck(this,_this$4),notify(i,"Start",i)}.bind(void 0),onSubscriptionSucceed=function(i,r,e){var n=e.subscriptionId;_newArrowCheck(this,_this$4);var t=_extends({},r,{subscriptionId:n});updateNotifiers(i,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(i,r,e){_newArrowCheck(this,_this$4),updateNotifiers(i,remove$1(r)),notify(r,"Abort",e)}.bind(void 0),onError=function(i,r,e){return _newArrowCheck(this,_this$4),abortRequest(i,r,new Error(e))}.bind(void 0),onSubscriptionResponse=function(i,r,e){_newArrowCheck(this,_this$4),e.errors?onError(i,r,utilsGraphql.errorsToString(e.errors)):onSubscriptionSucceed(i,r,e)}.bind(void 0),onQueryOrMutationResponse=function(i,r,e){_newArrowCheck(this,_this$4),updateNotifiers(i,remove$1(r)),notify(r,"Result",e)}.bind(void 0),onTimeout=function(i,r){return _newArrowCheck(this,_this$4),notify(r,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(i,r,e){return _newArrowCheck(this,_this$4),handlePush(i.channel.push("doc",utilsGraphql.requestToCompat(r)),createPushHandler(e,i,r))}.bind(void 0),pushRequest=function(i,r){_newArrowCheck(this,_this$4),"subscription"===r.operationType?send(i,r.request,subcriptionHandler):(notifyStart(r),send(i,r.request,queryOrMutationHandler))}.bind(void 0),_this=void 0,createChannelJoinHandler=function(i){return _newArrowCheck(this,_this),{onError:function(r){return _newArrowCheck(this,_this),notifyall(i.notifiers,"Error",new Error("channel join: "+String(r)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this),i.notifiers.forEach(function(r){return _newArrowCheck(this,_this),pushRequest(i,r)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this),notifyall(i.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(i){return _newArrowCheck(this,_this),handlePush(i.channel.join(),createChannelJoinHandler(i)),i.channelJoinCreated=!0,i}.bind(void 0);module.exports=joinChannel;
//# sourceMappingURL=joinChannel.js.map

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

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsGraphql=require("@jumpn/utils-graphql"),_this=void 0,create=function(e){return _newArrowCheck(this,_this),{request:e,cancelled:!1,observers:[],operationType:utilsGraphql.getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0);module.exports=create;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsGraphql=require("@jumpn/utils-graphql"),_this=void 0,create=function(e){return _newArrowCheck(this,_this),{request:e,observers:[],operationType:utilsGraphql.getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0);module.exports=create;
//# sourceMappingURL=create.js.map

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

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _extends=_interopDefault(require("babel-runtime/helpers/extends")),_newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite");require("phoenix");var utilsArray=require("@jumpn/utils-array"),_this$2=void 0,find=function(e,r,i){return _newArrowCheck(this,_this$2),e.find(utilsComposite.hasIn([r],i))}.bind(void 0),_this$1=void 0,createEventHandler=function(e,r){return _newArrowCheck(this,_this$1),function(i){return _newArrowCheck(this,_this$1),function(){for(var n=arguments.length,t=Array(n),o=0;o<n;o++)t[o]=arguments[o];_newArrowCheck(this,_this$1);var s=find(e.notifiers,"request",r);s&&i.apply(void 0,[e,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(e,r,i){return _newArrowCheck(this,_this$1),utilsComposite.map(createEventHandler(r,i),e)}.bind(void 0),_this$3=void 0,handlePush=function(e,r){return _newArrowCheck(this,_this$3),e.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(e,r){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[e]&&i[e](r)}.bind(this)}.bind(void 0),getHandlerName=function(e){return _newArrowCheck(this,_this$4),"on"+String(e)}.bind(void 0),notify=function(e,r,i){return _newArrowCheck(this,_this$4),e.observers.forEach(getNotifier(getHandlerName(r),i))}.bind(void 0),_this$6=void 0,findIndex=function(e,r,i){return _newArrowCheck(this,_this$6),e.findIndex(utilsComposite.hasIn([r],i))}.bind(void 0),_this$5=void 0,remove$1=function(e){return _newArrowCheck(this,_this$5),function(r){return _newArrowCheck(this,_this$5),utilsArray.remove(findIndex(r,"request",e.request),1,r)}.bind(this)}.bind(void 0),_this$7=void 0,refresh=function(e){return _newArrowCheck(this,_this$7),function(r){return _newArrowCheck(this,_this$7),utilsArray.replace(findIndex(r,"request",e.request),[e],r)}.bind(this)}.bind(void 0),_this$10=void 0,updateNotifiers=function(e,r){return _newArrowCheck(this,_this$10),e.notifiers=r(e.notifiers),e}.bind(void 0),_this$9=void 0,cancelNotifier=function(e,r){_newArrowCheck(this,_this$9),updateNotifiers(e,remove$1(r)),notify(r,"Cancel",r)}.bind(void 0),_this$8=void 0,onError$1=function(e,r,i){_newArrowCheck(this,_this$8),unsubscribe(e,r),notify(r,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout$1=function(e,r){return _newArrowCheck(this,_this$8),notify(r,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(e,r){return _newArrowCheck(this,_this$8),handlePush(e.channel.push("unsubscribe",{subscriptionId:r.subscriptionId}),createPushHandler(notifierPushHandler,e,r.request))}.bind(void 0),_this=void 0,notifyStart=function(e){return _newArrowCheck(this,_this),notify(e,"Start",e)}.bind(void 0),onSubscriptionSucceed=function(e,r,i){var n=i.subscriptionId;_newArrowCheck(this,_this);var t=_extends({},r,{subscriptionId:n});updateNotifiers(e,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(e,t)}.bind(void 0),abortRequest=function(e,r,i){_newArrowCheck(this,_this),updateNotifiers(e,remove$1(r)),notify(r,"Abort",i)}.bind(void 0),onError=function(e,r,i){return _newArrowCheck(this,_this),abortRequest(e,r,new Error(i))}.bind(void 0),onSubscriptionResponse=function(e,r,i){_newArrowCheck(this,_this),i.errors?onError(e,r,utilsGraphql.errorsToString(i.errors)):onSubscriptionSucceed(e,r,i)}.bind(void 0),onQueryOrMutationResponse=function(e,r,i){_newArrowCheck(this,_this),updateNotifiers(e,remove$1(r)),notify(r,"Result",i)}.bind(void 0),onTimeout=function(e,r){return _newArrowCheck(this,_this),notify(r,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(e,r,i){return _newArrowCheck(this,_this),handlePush(e.channel.push("doc",utilsGraphql.requestToCompat(r)),createPushHandler(i,e,r))}.bind(void 0),pushRequest=function(e,r){_newArrowCheck(this,_this),"subscription"===r.operationType?send(e,r.request,subcriptionHandler):(notifyStart(r),send(e,r.request,queryOrMutationHandler))}.bind(void 0);module.exports=pushRequest;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _extends=_interopDefault(require("babel-runtime/helpers/extends")),_newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite");require("phoenix");var utilsArray=require("@jumpn/utils-array"),_this$2=void 0,find=function(e,r,i){return _newArrowCheck(this,_this$2),e.find(utilsComposite.hasIn([r],i))}.bind(void 0),_this$1=void 0,createEventHandler=function(e,r){return _newArrowCheck(this,_this$1),function(i){return _newArrowCheck(this,_this$1),function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];_newArrowCheck(this,_this$1);var s=find(e.notifiers,"request",r);s&&i.apply(void 0,[e,s].concat(n))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(e,r,i){return _newArrowCheck(this,_this$1),utilsComposite.map(createEventHandler(r,i),e)}.bind(void 0),_this$3=void 0,handlePush=function(e,r){return _newArrowCheck(this,_this$3),e.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(e,r){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[e]&&i[e](r)}.bind(this)}.bind(void 0),getHandlerName=function(e){return _newArrowCheck(this,_this$4),"on"+String(e)}.bind(void 0),notify=function(e,r,i){return _newArrowCheck(this,_this$4),e.observers.forEach(getNotifier(getHandlerName(r),i))}.bind(void 0),_this$6=void 0,findIndex=function(e,r,i){return _newArrowCheck(this,_this$6),e.findIndex(utilsComposite.hasIn([r],i))}.bind(void 0),_this$5=void 0,remove$1=function(e){return _newArrowCheck(this,_this$5),function(r){return _newArrowCheck(this,_this$5),utilsArray.remove(findIndex(r,"request",e.request),1,r)}.bind(this)}.bind(void 0),_this$7=void 0,refresh=function(e){return _newArrowCheck(this,_this$7),function(r){return _newArrowCheck(this,_this$7),utilsArray.replace(findIndex(r,"request",e.request),[e],r)}.bind(this)}.bind(void 0),_this$8=void 0,updateNotifiers=function(e,r){return _newArrowCheck(this,_this$8),e.notifiers=r(e.notifiers),e}.bind(void 0),_this=void 0,notifyStart=function(e){return _newArrowCheck(this,_this),notify(e,"Start",e)}.bind(void 0),onSubscriptionSucceed=function(e,r,i){var t=i.subscriptionId;_newArrowCheck(this,_this);var n=_extends({},r,{subscriptionId:t});updateNotifiers(e,refresh(n)),notifyStart(n)}.bind(void 0),abortRequest=function(e,r,i){_newArrowCheck(this,_this),updateNotifiers(e,remove$1(r)),notify(r,"Abort",i)}.bind(void 0),onError=function(e,r,i){return _newArrowCheck(this,_this),abortRequest(e,r,new Error(i))}.bind(void 0),onSubscriptionResponse=function(e,r,i){_newArrowCheck(this,_this),i.errors?onError(e,r,utilsGraphql.errorsToString(i.errors)):onSubscriptionSucceed(e,r,i)}.bind(void 0),onQueryOrMutationResponse=function(e,r,i){_newArrowCheck(this,_this),updateNotifiers(e,remove$1(r)),notify(r,"Result",i)}.bind(void 0),onTimeout=function(e,r){return _newArrowCheck(this,_this),notify(r,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(e,r,i){return _newArrowCheck(this,_this),handlePush(e.channel.push("doc",utilsGraphql.requestToCompat(r)),createPushHandler(i,e,r))}.bind(void 0),pushRequest=function(e,r){_newArrowCheck(this,_this),"subscription"===r.operationType?send(e,r.request,subcriptionHandler):(notifyStart(r),send(e,r.request,queryOrMutationHandler))}.bind(void 0);module.exports=pushRequest;
//# sourceMappingURL=pushRequest.js.map

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

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _extends=_interopDefault(require("babel-runtime/helpers/extends")),_newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsArray=require("@jumpn/utils-array");require("phoenix");var utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite"),_this$2=void 0,handlePush=function(e,n){return _newArrowCheck(this,_this$2),e.receive("ok",n.onSucceed).receive("error",n.onError).receive("timeout",n.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(e,n){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[e]&&i[e](n)}.bind(this)}.bind(void 0),getHandlerName=function(e){return _newArrowCheck(this,_this$4),"on"+String(e)}.bind(void 0),notify=function(e,n,i){return _newArrowCheck(this,_this$4),e.observers.forEach(getNotifier(getHandlerName(n),i))}.bind(void 0),_this$3=void 0,notifyall=function(e,n,i){return _newArrowCheck(this,_this$3),e.forEach(function(e){return _newArrowCheck(this,_this$3),notify(e,n,i)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(e,n,i){return _newArrowCheck(this,_this$7),e.find(utilsComposite.hasIn([n],i))}.bind(void 0),_this$6=void 0,createEventHandler=function(e,n){return _newArrowCheck(this,_this$6),function(i){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(e.notifiers,"request",n);s&&i.apply(void 0,[e,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(e,n,i){return _newArrowCheck(this,_this$6),utilsComposite.map(createEventHandler(n,i),e)}.bind(void 0),_this$9=void 0,findIndex=function(e,n,i){return _newArrowCheck(this,_this$9),e.findIndex(utilsComposite.hasIn([n],i))}.bind(void 0),_this$8=void 0,remove$1=function(e){return _newArrowCheck(this,_this$8),function(n){return _newArrowCheck(this,_this$8),utilsArray.remove(findIndex(n,"request",e.request),1,n)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(e){return _newArrowCheck(this,_this$10),function(n){return _newArrowCheck(this,_this$10),utilsArray.replace(findIndex(n,"request",e.request),[e],n)}.bind(this)}.bind(void 0),_this$13=void 0,updateNotifiers=function(e,n){return _newArrowCheck(this,_this$13),e.notifiers=n(e.notifiers),e}.bind(void 0),_this$12=void 0,cancelNotifier=function(e,n){_newArrowCheck(this,_this$12),updateNotifiers(e,remove$1(n)),notify(n,"Cancel",n)}.bind(void 0),_this$11=void 0,onError$1=function(e,n,i){_newArrowCheck(this,_this$11),unsubscribe(e,n),notify(n,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout$1=function(e,n){return _newArrowCheck(this,_this$11),notify(n,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(e,n){return _newArrowCheck(this,_this$11),handlePush(e.channel.push("unsubscribe",{subscriptionId:n.subscriptionId}),createPushHandler(notifierPushHandler,e,n.request))}.bind(void 0),_this$5=void 0,notifyStart=function(e){return _newArrowCheck(this,_this$5),notify(e,"Start",e)}.bind(void 0),onSubscriptionSucceed=function(e,n,i){var r=i.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},n,{subscriptionId:r});updateNotifiers(e,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(e,t)}.bind(void 0),abortRequest=function(e,n,i){_newArrowCheck(this,_this$5),updateNotifiers(e,remove$1(n)),notify(n,"Abort",i)}.bind(void 0),onError=function(e,n,i){return _newArrowCheck(this,_this$5),abortRequest(e,n,new Error(i))}.bind(void 0),onSubscriptionResponse=function(e,n,i){_newArrowCheck(this,_this$5),i.errors?onError(e,n,utilsGraphql.errorsToString(i.errors)):onSubscriptionSucceed(e,n,i)}.bind(void 0),onQueryOrMutationResponse=function(e,n,i){_newArrowCheck(this,_this$5),updateNotifiers(e,remove$1(n)),notify(n,"Result",i)}.bind(void 0),onTimeout=function(e,n){return _newArrowCheck(this,_this$5),notify(n,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send$2=function(e,n,i){return _newArrowCheck(this,_this$5),handlePush(e.channel.push("doc",utilsGraphql.requestToCompat(n)),createPushHandler(i,e,n))}.bind(void 0),pushRequest=function(e,n){_newArrowCheck(this,_this$5),"subscription"===n.operationType?send$2(e,n.request,subcriptionHandler):(notifyStart(n),send$2(e,n.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(e){return _newArrowCheck(this,_this$1),{onError:function(n){return _newArrowCheck(this,_this$1),notifyall(e.notifiers,"Error",new Error("channel join: "+String(n)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),e.notifiers.forEach(function(n){return _newArrowCheck(this,_this$1),pushRequest(e,n)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(e.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(e){return _newArrowCheck(this,_this$1),handlePush(e.channel.join(),createChannelJoinHandler(e)),e.channelJoinCreated=!0,e}.bind(void 0),_this$14=void 0,create=function(e){return _newArrowCheck(this,_this$14),{request:e,cancelled:!1,observers:[],operationType:utilsGraphql.getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0),_this=void 0,connectOrJoinChannel=function(e){_newArrowCheck(this,_this),e.phoenixSocket.isConnected()?joinChannel(e):e.phoenixSocket.connect()}.bind(void 0),sendNew=function(e,n){_newArrowCheck(this,_this);var i=create(n);return updateNotifiers(e,utilsArray.append([i])),e.channelJoinCreated?pushRequest(e,i):connectOrJoinChannel(e),i}.bind(void 0),uncancel=function(e,n){_newArrowCheck(this,_this);var i=n.prevStatus,r=_extends({},n,{status:i,prevStatus:n.status});return updateNotifiers(e,notifierRefresh(updateNotifiers)),r}.bind(void 0),uncancelIfNeeded=function(e,n){return _newArrowCheck(this,_this),"cancelling"===n.status?uncancel(e,n):n}.bind(void 0),send=function(e,n){_newArrowCheck(this,_this);var i=find(e.notifiers,"request",n);return i?uncancelIfNeeded(e,i):sendNew(e,n)}.bind(void 0);module.exports=send;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),utilsArray=require("@jumpn/utils-array");require("phoenix");var _extends=_interopDefault(require("babel-runtime/helpers/extends")),utilsGraphql=require("@jumpn/utils-graphql"),utilsComposite=require("@jumpn/utils-composite"),_this$2=void 0,handlePush=function(e,n){return _newArrowCheck(this,_this$2),e.receive("ok",n.onSucceed).receive("error",n.onError).receive("timeout",n.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(e,n){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[e]&&i[e](n)}.bind(this)}.bind(void 0),getHandlerName=function(e){return _newArrowCheck(this,_this$4),"on"+String(e)}.bind(void 0),notify=function(e,n,i){return _newArrowCheck(this,_this$4),e.observers.forEach(getNotifier(getHandlerName(n),i))}.bind(void 0),_this$3=void 0,notifyall=function(e,n,i){return _newArrowCheck(this,_this$3),e.forEach(function(e){return _newArrowCheck(this,_this$3),notify(e,n,i)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(e,n,i){return _newArrowCheck(this,_this$7),e.find(utilsComposite.hasIn([n],i))}.bind(void 0),_this$6=void 0,createEventHandler=function(e,n){return _newArrowCheck(this,_this$6),function(i){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(e.notifiers,"request",n);s&&i.apply(void 0,[e,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(e,n,i){return _newArrowCheck(this,_this$6),utilsComposite.map(createEventHandler(n,i),e)}.bind(void 0),_this$9=void 0,findIndex=function(e,n,i){return _newArrowCheck(this,_this$9),e.findIndex(utilsComposite.hasIn([n],i))}.bind(void 0),_this$8=void 0,remove$1=function(e){return _newArrowCheck(this,_this$8),function(n){return _newArrowCheck(this,_this$8),utilsArray.remove(findIndex(n,"request",e.request),1,n)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(e){return _newArrowCheck(this,_this$10),function(n){return _newArrowCheck(this,_this$10),utilsArray.replace(findIndex(n,"request",e.request),[e],n)}.bind(this)}.bind(void 0),_this$11=void 0,updateNotifiers=function(e,n){return _newArrowCheck(this,_this$11),e.notifiers=n(e.notifiers),e}.bind(void 0),_this$5=void 0,notifyStart=function(e){return _newArrowCheck(this,_this$5),notify(e,"Start",e)}.bind(void 0),onSubscriptionSucceed=function(e,n,i){var r=i.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},n,{subscriptionId:r});updateNotifiers(e,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(e,n,i){_newArrowCheck(this,_this$5),updateNotifiers(e,remove$1(n)),notify(n,"Abort",i)}.bind(void 0),onError=function(e,n,i){return _newArrowCheck(this,_this$5),abortRequest(e,n,new Error(i))}.bind(void 0),onSubscriptionResponse=function(e,n,i){_newArrowCheck(this,_this$5),i.errors?onError(e,n,utilsGraphql.errorsToString(i.errors)):onSubscriptionSucceed(e,n,i)}.bind(void 0),onQueryOrMutationResponse=function(e,n,i){_newArrowCheck(this,_this$5),updateNotifiers(e,remove$1(n)),notify(n,"Result",i)}.bind(void 0),onTimeout=function(e,n){return _newArrowCheck(this,_this$5),notify(n,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send$2=function(e,n,i){return _newArrowCheck(this,_this$5),handlePush(e.channel.push("doc",utilsGraphql.requestToCompat(n)),createPushHandler(i,e,n))}.bind(void 0),pushRequest=function(e,n){_newArrowCheck(this,_this$5),"subscription"===n.operationType?send$2(e,n.request,subcriptionHandler):(notifyStart(n),send$2(e,n.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(e){return _newArrowCheck(this,_this$1),{onError:function(n){return _newArrowCheck(this,_this$1),notifyall(e.notifiers,"Error",new Error("channel join: "+String(n)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),e.notifiers.forEach(function(n){return _newArrowCheck(this,_this$1),pushRequest(e,n)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(e.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(e){return _newArrowCheck(this,_this$1),handlePush(e.channel.join(),createChannelJoinHandler(e)),e.channelJoinCreated=!0,e}.bind(void 0),_this$12=void 0,create=function(e){return _newArrowCheck(this,_this$12),{request:e,observers:[],operationType:utilsGraphql.getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0),_this=void 0,connectOrJoinChannel=function(e){_newArrowCheck(this,_this),e.phoenixSocket.isConnected()?joinChannel(e):e.phoenixSocket.connect()}.bind(void 0),sendNew=function(e,n){_newArrowCheck(this,_this);var i=create(n);return updateNotifiers(e,utilsArray.append([i])),e.channelJoinCreated?pushRequest(e,i):connectOrJoinChannel(e),i}.bind(void 0),send=function(e,n){return _newArrowCheck(this,_this),find(e.notifiers,"request",n)||sendNew(e,n)}.bind(void 0);module.exports=send;
//# sourceMappingURL=send.js.map

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

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.AbsintheSocket={})}(this,function(t){"use strict";function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,n){return n={exports:{}},t(n,n.exports),n.exports}"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var r=e(function(t){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)}),i=e(function(t){var n=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)}),o=(i.version,function(t,n,e){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,i){return t.call(n,e,r,i)}}return function(){return t.apply(n,arguments)}}),u=function(t){return"object"==typeof t?null!==t:"function"==typeof t},s=function(t){if(!u(t))throw TypeError(t+" is not an object!");return t},c=function(t){try{return!!t()}catch(t){return!0}},a=!c(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),f=r.document,l=u(f)&&u(f.createElement),h=function(t){return l?f.createElement(t):{}},d=!a&&!c(function(){return 7!=Object.defineProperty(h("div"),"a",{get:function(){return 7}}).a}),v=function(t,n){if(!u(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!u(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!u(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!u(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")},p=Object.defineProperty,b={f:a?Object.defineProperty:function(t,n,e){if(s(t),n=v(n,!0),s(e),d)try{return p(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},y=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},m=a?function(t,n,e){return b.f(t,n,y(1,e))}:function(t,n,e){return t[n]=e,t},g=function(t,n,e){var u,s,c,a=t&g.F,f=t&g.G,l=t&g.S,h=t&g.P,d=t&g.B,v=t&g.W,p=f?i:i[n]||(i[n]={}),b=p.prototype,y=f?r:l?r[n]:(r[n]||{}).prototype;f&&(e=n);for(u in e)(s=!a&&y&&void 0!==y[u])&&u in p||(c=s?y[u]:e[u],p[u]=f&&"function"!=typeof y[u]?e[u]:d&&s?o(c,r):v&&y[u]==c?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(c):h&&"function"==typeof c?o(Function.call,c):c,h&&((p.virtual||(p.virtual={}))[u]=c,t&g.R&&b&&!b[u]&&m(b,u,c)))};g.F=1,g.G=2,g.S=4,g.P=8,g.B=16,g.W=32,g.U=64,g.R=128;var w=g,k={}.hasOwnProperty,j=function(t,n){return k.call(t,n)},S={}.toString,_=function(t){return S.call(t).slice(8,-1)},O=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==_(t)?t.split(""):Object(t)},E=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},T=function(t){return O(E(t))},x=Math.ceil,P=Math.floor,A=function(t){return isNaN(t=+t)?0:(t>0?P:x)(t)},C=Math.min,M=function(t){return t>0?C(A(t),9007199254740991):0},R=Math.max,L=Math.min,I=r["__core-js_shared__"]||(r["__core-js_shared__"]={}),N=function(t){return I[t]||(I[t]={})},q=0,J=Math.random(),F=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++q+J).toString(36))},H=N("keys"),D=function(t){return H[t]||(H[t]=F(t))},B=function(t){return function(n,e,r){var i,o=T(n),u=M(o.length),s=function(t,n){return(t=A(t))<0?R(t+n,0):L(t,n)}(r,u);if(t&&e!=e){for(;u>s;)if((i=o[s++])!=i)return!0}else for(;u>s;s++)if((t||s in o)&&o[s]===e)return t||s||0;return!t&&-1}}(!1),U=D("IE_PROTO"),G=function(t,n){var e,r=T(t),i=0,o=[];for(e in r)e!=U&&j(r,e)&&o.push(e);for(;n.length>i;)j(r,e=n[i++])&&(~B(o,e)||o.push(e));return o},z="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),W=Object.keys||function(t){return G(t,z)},V={f:Object.getOwnPropertySymbols},X={f:{}.propertyIsEnumerable},K=function(t){return Object(E(t))},Y=Object.assign,Q=!Y||c(function(){var t={},n={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(t){n[t]=t}),7!=Y({},t)[e]||Object.keys(Y({},n)).join("")!=r})?function(t,n){for(var e=K(t),r=arguments.length,i=1,o=V.f,u=X.f;r>i;)for(var s,c=O(arguments[i++]),a=o?W(c).concat(o(c)):W(c),f=a.length,l=0;f>l;)u.call(c,s=a[l++])&&(e[s]=c[s]);return e}:Y;w(w.S+w.F,"Object",{assign:Q});var $=i.Object.assign,Z=e(function(t){t.exports={default:$,__esModule:!0}});n(Z);var tt=e(function(t,n){n.__esModule=!0;var e=function(t){return t&&t.__esModule?t:{default:t}}(Z);n.default=e.default||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t}}),nt=n(tt),et=n(e(function(t,n){n.__esModule=!0,n.default=function(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}})),rt=m,it={},ot=a?Object.defineProperties:function(t,n){s(t);for(var e,r=W(n),i=r.length,o=0;i>o;)b.f(t,e=r[o++],n[e]);return t},ut=r.document,st=ut&&ut.documentElement,ct=D("IE_PROTO"),at=function(){},ft=function(){var t,n=h("iframe"),e=z.length;for(n.style.display="none",st.appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),ft=t.F;e--;)delete ft.prototype[z[e]];return ft()},lt=Object.create||function(t,n){var e;return null!==t?(at.prototype=s(t),e=new at,at.prototype=null,e[ct]=t):e=ft(),void 0===n?e:ot(e,n)},ht=e(function(t){var n=N("wks"),e=r.Symbol,i="function"==typeof e;(t.exports=function(t){return n[t]||(n[t]=i&&e[t]||(i?e:F)("Symbol."+t))}).store=n}),dt=b.f,vt=ht("toStringTag"),pt=function(t,n,e){t&&!j(t=e?t:t.prototype,vt)&&dt(t,vt,{configurable:!0,value:n})},bt={};m(bt,ht("iterator"),function(){return this});var yt=function(t,n,e){t.prototype=lt(bt,{next:y(1,e)}),pt(t,n+" Iterator")},mt=D("IE_PROTO"),gt=Object.prototype,wt=Object.getPrototypeOf||function(t){return t=K(t),j(t,mt)?t[mt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?gt:null},kt=ht("iterator"),jt=!([].keys&&"next"in[].keys()),St=function(){return this},_t=function(t,n,e,r,i,o,u){yt(e,n,r);var s,c,a,f=function(t){if(!jt&&t in v)return v[t];switch(t){case"keys":case"values":return function(){return new e(this,t)}}return function(){return new e(this,t)}},l=n+" Iterator",h="values"==i,d=!1,v=t.prototype,p=v[kt]||v["@@iterator"]||i&&v[i],b=p||f(i),y=i?h?f("entries"):b:void 0,g="Array"==n?v.entries||p:p;if(g&&(a=wt(g.call(new t)))!==Object.prototype&&a.next&&pt(a,l,!0),h&&p&&"values"!==p.name&&(d=!0,b=function(){return p.call(this)}),u&&(jt||d||!v[kt])&&m(v,kt,b),it[n]=b,it[l]=St,i)if(s={values:h?b:f("values"),keys:o?b:f("keys"),entries:y},u)for(c in s)c in v||rt(v,c,s[c]);else w(w.P+w.F*(jt||d),n,s);return s},Ot=function(t){return function(n,e){var r,i,o=String(E(n)),u=A(e),s=o.length;return u<0||u>=s?t?"":void 0:(r=o.charCodeAt(u))<55296||r>56319||u+1===s||(i=o.charCodeAt(u+1))<56320||i>57343?t?o.charAt(u):r:t?o.slice(u,u+2):i-56320+(r-55296<<10)+65536}}(!0);_t(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,e=this._i;return e>=n.length?{value:void 0,done:!0}:(t=Ot(n,e),this._i+=t.length,{value:t,done:!1})});var Et=ht("iterator"),Tt=Array.prototype,xt=function(t,n,e){n in t?b.f(t,n,y(0,e)):t[n]=e},Pt=ht("toStringTag"),At="Arguments"==_(function(){return arguments}()),Ct=function(t){var n,e,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),Pt))?e:At?_(n):"Object"==(r=_(n))&&"function"==typeof n.callee?"Arguments":r},Mt=ht("iterator"),Rt=i.getIteratorMethod=function(t){if(void 0!=t)return t[Mt]||t["@@iterator"]||it[Ct(t)]},Lt=ht("iterator"),It=!1;try{[7][Lt]().return=function(){It=!0}}catch(t){}w(w.S+w.F*!function(t,n){if(!n&&!It)return!1;var e=!1;try{var r=[7],i=r[Lt]();i.next=function(){return{done:e=!0}},r[Lt]=function(){return i},t(r)}catch(t){}return e}(function(t){}),"Array",{from:function(t){var n,e,r,i,u=K(t),c="function"==typeof this?this:Array,a=arguments.length,f=a>1?arguments[1]:void 0,l=void 0!==f,h=0,d=Rt(u);if(l&&(f=o(f,a>2?arguments[2]:void 0,2)),void 0==d||c==Array&&function(t){return void 0!==t&&(it.Array===t||Tt[Et]===t)}(d))for(e=new c(n=M(u.length));n>h;h++)xt(e,h,l?f(u[h],h):u[h]);else for(i=d.call(u),e=new c;!(r=i.next()).done;h++)xt(e,h,l?function(t,n,e,r){try{return r?n(s(e)[0],e[1]):n(e)}catch(n){var i=t.return;throw void 0!==i&&s(i.call(t)),n}}(i,f,[r.value,h],!0):r.value);return e.length=h,e}});var Nt=i.Array.from,qt=e(function(t){t.exports={default:Nt,__esModule:!0}}),Jt=n(qt),Ft=n(e(function(t,n){n.__esModule=!0;var e=function(t){return t&&t.__esModule?t:{default:t}}(qt);n.default=function(t){if(Array.isArray(t)){for(var n=0,r=Array(t.length);n<t.length;n++)r[n]=t[n];return r}return e.default(t)}})),Ht=e(function(t,n){function e(t,n,r){return function(){var i=r.concat(Array.prototype.slice.call(arguments));return i.length>=n?t.apply(this,i):e(t,n,i)}}Object.defineProperty(n,"__esModule",{value:!0}),n.flip=function(t){return function(n,e){return t(e,n)}},n.constant=function(t){return function(){return t}},n.on=function(t,n){return function(e,r){return t(n(e),n(r))}},n.compose=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=i;o>-1;o--)r=e[o].call(t,r);return r}},n.pipe=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=0;o<=i;o++)r=e[o].call(t,r);return r}},n.curry=function(t){return e(t,t.length,[])}});n(Ht);Ht.flip,Ht.constant,Ht.on,Ht.compose,Ht.pipe;var Dt=Ht.curry;!function(t,n){var e=(i.Object||{})[t]||Object[t],r={};r[t]=n(e),w(w.S+w.F*c(function(){e(1)}),"Object",r)}("keys",function(){return function(t){return W(K(t))}});var Bt=i.Object.keys,Ut=n(e(function(t){t.exports={default:Bt,__esModule:!0}})),Gt=Math.floor;w(w.S,"Number",{isInteger:function(t){return!u(t)&&isFinite(t)&&Gt(t)===t}});var zt=i.Number.isInteger,Wt=n(e(function(t){t.exports={default:zt,__esModule:!0}})),Vt=n(e(function(t,n){n.__esModule=!0,n.default=function(t,n){var e={};for(var r in t)n.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}})),Xt=Dt(function(t,n){return et(this,void 0),[].concat(Ft(n),Ft(t))}.bind(void 0)),Kt=(function(t){return et(this,void 0),Array.isArray(t)?t:[t]}.bind(void 0),function(t,n){return et(this,void 0),n===t.length-1}.bind(void 0)),Yt=Dt(Kt),Qt=(Dt(function(t,n){return et(this,void 0),Yt(t,n)?0:n+1}.bind(void 0)),function(t){return et(this,void 0),Math.max.apply(Math,Ft(Ut(t)))+1}.bind(void 0)),$t=(function(t){return et(this,void 0),Jt("length"in t?t:nt({},t,{length:Qt(t)}))}.bind(void 0),Dt(function(t,n,e){return et(this,void 0),[].concat(Ft(e.slice(0,t)),Ft(n),Ft(e.slice(t+1)))}.bind(void 0)),function(t,n){return et(this,void 0),Wt(t)&&t>=n}.bind(void 0)),Zt=function(t){return et(this,void 0),$t(Number(t),0)}.bind(void 0),tn=(function(t){t.length;var n=Vt(t,["length"]);return et(this,void 0),Ut(n).every(Zt)}.bind(void 0),Dt(function(t,n){return et(this,void 0),[].concat(Ft(t),Ft(n))}.bind(void 0)),Dt(function(t,n,e,r){return et(this,void 0),r.reduce(function(e,r,i){return et(this,void 0),t(r,i,e)?n(e,r,i):e}.bind(this),e)}.bind(void 0)),Dt(function(t,n,e,r){et(this,void 0);var i=e;return r.every(function(e,r){et(this,void 0);var o=t(e,r,i);return o&&(i=n(i,e,r)),o}.bind(this)),i}.bind(void 0)),function(t,n,e){return et(this,void 0),[].concat(Ft(e.slice(0,t)),Ft(e.slice(t+n)))}.bind(void 0)),nn=Dt(tn),en=(Dt(function(t,n){return et(this,void 0),[].concat(Ft(Array(t))).map(function(){return et(this,void 0),n}.bind(this))}.bind(void 0)),Dt(function(t,n,e){return et(this,void 0),[].concat(Ft(e.slice(0,t)),Ft(n),Ft(e.slice(t+n.length)))}.bind(void 0))),rn=(Dt(function(t,n){return et(this,void 0),n<0?t.length-n:n}.bind(void 0)),e(function(t,n){function e(t,n,r){return function(){var i=r.concat(Array.prototype.slice.call(arguments));return i.length>=n?t.apply(this,i):e(t,n,i)}}Object.defineProperty(n,"__esModule",{value:!0}),n.flip=function(t){return function(n,e){return t(e,n)}},n.constant=function(t){return function(){return t}},n.on=function(t,n){return function(e,r){return t(n(e),n(r))}},n.compose=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=i;o>-1;o--)r=e[o].call(t,r);return r}},n.pipe=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=0;o<=i;o++)r=e[o].call(t,r);return r}},n.curry=function(t){return e(t,t.length,[])}}));n(rn);rn.flip,rn.constant,rn.on,rn.compose,rn.pipe;var on=rn.curry;w(w.S+w.F*!a,"Object",{defineProperty:b.f});var un=i.Object,sn=e(function(t){t.exports={default:function(t,n,e){return un.defineProperty(t,n,e)},__esModule:!0}});n(sn);var cn=n(e(function(t,n){n.__esModule=!0;var e=function(t){return t&&t.__esModule?t:{default:t}}(sn);n.default=function(t,n,r){return n in t?e.default(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}})),an=function(t,n){return{value:n,done:!!t}};_t(Array,"Array",function(t,n){this._t=T(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,an(1)):"keys"==n?an(0,e):"values"==n?an(0,t[e]):an(0,[e,t[e]])},"values");it.Arguments=it.Array;for(var fn=ht("toStringTag"),ln="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),hn=0;hn<ln.length;hn++){var dn=ln[hn],vn=r[dn],pn=vn&&vn.prototype;pn&&!pn[fn]&&m(pn,fn,dn),it[dn]=it.Array}var bn=ht("iterator"),yn=i.isIterable=function(t){var n=Object(t);return void 0!==n[bn]||"@@iterator"in n||it.hasOwnProperty(Ct(n))},mn=e(function(t){t.exports={default:yn,__esModule:!0}});n(mn);var gn=i.getIterator=function(t){var n=Rt(t);if("function"!=typeof n)throw TypeError(t+" is not iterable!");return s(n.call(t))},wn=e(function(t){t.exports={default:gn,__esModule:!0}});n(wn);var kn=n(e(function(t,n){function e(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var r=e(mn),i=e(wn);n.default=function(){return function(t,n){if(Array.isArray(t))return t;if(r.default(Object(t)))return function(t,n){var e=[],r=!0,o=!1,u=void 0;try{for(var s,c=i.default(t);!(r=(s=c.next()).done)&&(e.push(s.value),!n||e.length!==n);r=!0);}catch(t){o=!0,u=t}finally{try{!r&&c.return&&c.return()}finally{if(o)throw u}}return e}(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()})),jn=X.f,Sn=function(t){return function(n){for(var e,r=T(n),i=W(r),o=i.length,u=0,s=[];o>u;)jn.call(r,e=i[u++])&&s.push(t?[e,r[e]]:r[e]);return s}}(!0);w(w.S,"Object",{entries:function(t){return Sn(t)}});var _n=i.Object.entries,On=n(e(function(t){t.exports={default:_n,__esModule:!0}})),En=e(function(t){var n=F("meta"),e=b.f,r=0,i=Object.isExtensible||function(){return!0},o=!c(function(){return i(Object.preventExtensions({}))}),s=function(t){e(t,n,{value:{i:"O"+ ++r,w:{}}})},a=t.exports={KEY:n,NEED:!1,fastKey:function(t,e){if(!u(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!j(t,n)){if(!i(t))return"F";if(!e)return"E";s(t)}return t[n].i},getWeak:function(t,e){if(!j(t,n)){if(!i(t))return!0;if(!e)return!1;s(t)}return t[n].w},onFreeze:function(t){return o&&a.NEED&&i(t)&&!j(t,n)&&s(t),t}}}),Tn=(En.KEY,En.NEED,En.fastKey,En.getWeak,En.onFreeze,{f:ht}),xn=b.f,Pn=function(t){var n=i.Symbol||(i.Symbol={});"_"==t.charAt(0)||t in n||xn(n,t,{value:Tn.f(t)})},An=Array.isArray||function(t){return"Array"==_(t)},Cn=z.concat("length","prototype"),Mn={f:Object.getOwnPropertyNames||function(t){return G(t,Cn)}},Rn=Mn.f,Ln={}.toString,In="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Nn={f:function(t){return In&&"[object Window]"==Ln.call(t)?function(t){try{return Rn(t)}catch(t){return In.slice()}}(t):Rn(T(t))}},qn=Object.getOwnPropertyDescriptor,Jn={f:a?qn:function(t,n){if(t=T(t),n=v(n,!0),d)try{return qn(t,n)}catch(t){}if(j(t,n))return y(!X.f.call(t,n),t[n])}},Fn=En.KEY,Hn=Jn.f,Dn=b.f,Bn=Nn.f,Un=r.Symbol,Gn=r.JSON,zn=Gn&&Gn.stringify,Wn=ht("_hidden"),Vn=ht("toPrimitive"),Xn={}.propertyIsEnumerable,Kn=N("symbol-registry"),Yn=N("symbols"),Qn=N("op-symbols"),$n=Object.prototype,Zn="function"==typeof Un,te=r.QObject,ne=!te||!te.prototype||!te.prototype.findChild,ee=a&&c(function(){return 7!=lt(Dn({},"a",{get:function(){return Dn(this,"a",{value:7}).a}})).a})?function(t,n,e){var r=Hn($n,n);r&&delete $n[n],Dn(t,n,e),r&&t!==$n&&Dn($n,n,r)}:Dn,re=function(t){var n=Yn[t]=lt(Un.prototype);return n._k=t,n},ie=Zn&&"symbol"==typeof Un.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Un},oe=function(t,n,e){return t===$n&&oe(Qn,n,e),s(t),n=v(n,!0),s(e),j(Yn,n)?(e.enumerable?(j(t,Wn)&&t[Wn][n]&&(t[Wn][n]=!1),e=lt(e,{enumerable:y(0,!1)})):(j(t,Wn)||Dn(t,Wn,y(1,{})),t[Wn][n]=!0),ee(t,n,e)):Dn(t,n,e)},ue=function(t,n){s(t);for(var e,r=function(t){var n=W(t),e=V.f;if(e)for(var r,i=e(t),o=X.f,u=0;i.length>u;)o.call(t,r=i[u++])&&n.push(r);return n}(n=T(n)),i=0,o=r.length;o>i;)oe(t,e=r[i++],n[e]);return t},se=function(t){var n=Xn.call(this,t=v(t,!0));return!(this===$n&&j(Yn,t)&&!j(Qn,t))&&(!(n||!j(this,t)||!j(Yn,t)||j(this,Wn)&&this[Wn][t])||n)},ce=function(t,n){if(t=T(t),n=v(n,!0),t!==$n||!j(Yn,n)||j(Qn,n)){var e=Hn(t,n);return!e||!j(Yn,n)||j(t,Wn)&&t[Wn][n]||(e.enumerable=!0),e}},ae=function(t){for(var n,e=Bn(T(t)),r=[],i=0;e.length>i;)j(Yn,n=e[i++])||n==Wn||n==Fn||r.push(n);return r},fe=function(t){for(var n,e=t===$n,r=Bn(e?Qn:T(t)),i=[],o=0;r.length>o;)!j(Yn,n=r[o++])||e&&!j($n,n)||i.push(Yn[n]);return i};Zn||(rt((Un=function(){if(this instanceof Un)throw TypeError("Symbol is not a constructor!");var t=F(arguments.length>0?arguments[0]:void 0),n=function(e){this===$n&&n.call(Qn,e),j(this,Wn)&&j(this[Wn],t)&&(this[Wn][t]=!1),ee(this,t,y(1,e))};return a&&ne&&ee($n,t,{configurable:!0,set:n}),re(t)}).prototype,"toString",function(){return this._k}),Jn.f=ce,b.f=oe,Mn.f=Nn.f=ae,X.f=se,V.f=fe,Tn.f=function(t){return re(ht(t))}),w(w.G+w.W+w.F*!Zn,{Symbol:Un});for(var le="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),he=0;le.length>he;)ht(le[he++]);for(var de=W(ht.store),ve=0;de.length>ve;)Pn(de[ve++]);w(w.S+w.F*!Zn,"Symbol",{for:function(t){return j(Kn,t+="")?Kn[t]:Kn[t]=Un(t)},keyFor:function(t){if(!ie(t))throw TypeError(t+" is not a symbol!");for(var n in Kn)if(Kn[n]===t)return n},useSetter:function(){ne=!0},useSimple:function(){ne=!1}}),w(w.S+w.F*!Zn,"Object",{create:function(t,n){return void 0===n?lt(t):ue(lt(t),n)},defineProperty:oe,defineProperties:ue,getOwnPropertyDescriptor:ce,getOwnPropertyNames:ae,getOwnPropertySymbols:fe}),Gn&&w(w.S+w.F*(!Zn||c(function(){var t=Un();return"[null]"!=zn([t])||"{}"!=zn({a:t})||"{}"!=zn(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!ie(t)){for(var n,e,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);return"function"==typeof(n=r[1])&&(e=n),!e&&An(n)||(n=function(t,n){if(e&&(n=e.call(this,t,n)),!ie(n))return n}),r[1]=n,zn.apply(Gn,r)}}}),Un.prototype[Vn]||m(Un.prototype,Vn,Un.prototype.valueOf),pt(Un,"Symbol"),pt(Math,"Math",!0),pt(r.JSON,"JSON",!0),Pn("asyncIterator"),Pn("observable");var pe=i.Symbol,be=n(e(function(t){t.exports={default:pe,__esModule:!0}})),ye=function(t,n){return et(this,ir),n[t]}.bind(void 0),me=(on(ye),on(function(t,n){return et(this,void 0),Object.prototype.hasOwnProperty.call(n,t)}.bind(void 0))),ge=function(t,n,e){return et(this,Ue),Kt(n,t)?ye(n[t],e):me(n[t],e)?ge(t+1,n,ye(n[t],e)):void 0}.bind(void 0),we=on(function(t,n){return et(this,Ue),0===t.length?void 0:ge(0,t,n)}.bind(void 0)),ke=function(t){return et(this,void 0),Array.isArray(t)?[].concat(Ft(t.keys())):Ut(t)}.bind(void 0),je=on(function(t,n,e){return et(this,void 0),isDeepEqual(we(t,e),n)}.bind(void 0)),Se=on(function(t,n){et(this,void 0);var e=ke(t);return e.length===ke(n).length&&e.every(function(e){return et(this,void 0),me(e,n)&&ye(e,t)===ye(e,n)}.bind(this))}.bind(void 0)),_e=function(t,n){return et(this,void 0),On(n).reduce(function(e,r){var i=kn(r,2),o=i[0],u=i[1];return et(this,void 0),tt({},e,cn({},o,t(u,o,n)))}.bind(this),{})}.bind(void 0),Oe=on(function(t,n){return et(this,void 0),Array.isArray(n)?n.map(t):_e(t,n)}.bind(void 0)),Ee=function(t,n){n[t];var e=Vt(n,[t]);return et(this,void 0),e}.bind(void 0),Te=on(function(t,n){return et(this,void 0),Array.isArray(n)?tn(t,1,n):Ee(t,n)}.bind(void 0)),xe=function(t){return et(this,void 0),Array.isArray(t)?[].concat(Ft(t)):tt({},t)}.bind(void 0),Pe=function(t){et(this,void 0);var n=xe(t);return{origin:n,previous:void 0,current:n}}.bind(void 0),Ae=function(t){return et(this,void 0),"number"==typeof t?[]:{}}.bind(void 0),Ce=function(t,n,e){return et(this,void 0),me(t,e)?xe(ye(t,e)):Ae(n)}.bind(void 0),Me=function(t,n,e,r){return et(this,void 0),Kt(t,e)?n(ye(t[e],r)):Ce(t[e],t[e+1],r)}.bind(void 0),Re=function(t,n,e){return et(this,void 0),e[t]=n,ye(t,e)}.bind(void 0),Le=function(t,n,e,r){return et(this,void 0),tt({},r,{current:Re(t[n],e,r.current)})}.bind(void 0),Ie=function(t,n,e){et(this,void 0);var r=Te(t[n],e.current);return 0===n?nt({},e,{current:r,origin:r}):nt({},e,{previous:Re(t[n-1],r,e.previous)})}.bind(void 0),Ne=be("composite.updateIn.removeAction"),qe=function(t,n,e,r){return et(this,void 0),e===Ne?Ie(t,n,r):Le(t,n,e,r)}.bind(void 0),Je=function(t,n){return et(this,void 0),function(e,r,i){return et(this,void 0),qe(t,i,Me(t,n,i,e.current),e)}.bind(this)}.bind(void 0),Fe=on(function(t,n,e){return et(this,void 0),0===t.length?e:t.reduce(Je(t,n),Pe(e)).origin}.bind(void 0));Fe.remove=Ne;var He=function(){return et(this,void 0),Fe.remove}.bind(void 0),De=(on(function(t,n){return et(this,void 0),Fe(t,He,n)}.bind(void 0)),on(function(t,n,e){et(this,void 0);var r=xe(e);return r[t]=n,r}.bind(void 0)),on(function(t,n,e){return et(this,void 0),Fe(t,function(){return et(this,void 0),n}.bind(this),e)}.bind(void 0)),function(t,n){return et(this,void 0),Boolean(Number(t)^Number(n))}.bind(void 0)),Be=(on(function(t,n){return et(this,void 0),t===n||!De(Array.isArray(t),Array.isArray(n))&&Se(t,n)}.bind(void 0)),function(t,n,e){return et(this,void 0),t.findIndex(je([n],e))}.bind(void 0)),Ue=void 0,Ge=function(t){return et(this,Ue),function(n){return et(this,Ue),en(Be(n,"request",t.request),[t],n)}.bind(this)}.bind(void 0),ze=function(t,n){return et(this,void 0),function(e){return et(this,void 0),e[t]&&e[t](n)}.bind(this)}.bind(void 0),We=function(t){return et(this,void 0),"on"+String(t)}.bind(void 0),Ve=function(t,n,e){return et(this,void 0),t.observers.forEach(ze(We(n),e))}.bind(void 0),Xe=function(t){return et(this,void 0),function(n){return et(this,void 0),nn(Be(n,"request",t.request),1,n)}.bind(this)}.bind(void 0),Ke=function(t,n){return et(this,void 0),t.notifiers=n(t.notifiers),t}.bind(void 0),Ye=function(t,n){et(this,void 0),Ke(t,Xe(n)),Ve(n,"Cancel",n)}.bind(void 0),Qe=function(t,n,e){return et(this,void 0),t.find(je([n],e))}.bind(void 0),$e=function(t,n){return et(this,void 0),function(e){return et(this,void 0),function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];et(this,void 0);var u=Qe(t.notifiers,"request",n);u&&e.apply(void 0,[t,u].concat(i))}.bind(this)}.bind(this)}.bind(void 0),Ze=function(t,n,e){return et(this,void 0),Oe($e(n,e),t)}.bind(void 0),tr=e(function(t,n){!function(t){function n(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var u,s=t[Symbol.iterator]();!(r=(u=s.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return e}(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}();var o={connecting:0,open:1,closing:2,closed:3},u=1e4,s={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},c={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},a=[c.close,c.error,c.join,c.reply,c.leave],f={longpoll:"longpoll",websocket:"websocket"},l=function(){function t(e,r,i,o){n(this,t),this.channel=e,this.event=r,this.payload=i||{},this.receivedResp=null,this.timeout=o,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}return i(t,[{key:"resend",value:function(t){this.timeout=t,this.reset(),this.send()}},{key:"send",value:function(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel.joinRef()}))}},{key:"receive",value:function(t,n){return this.hasReceived(t)&&n(this.receivedResp.response),this.recHooks.push({status:t,callback:n}),this}},{key:"reset",value:function(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}},{key:"matchReceive",value:function(t){var n=t.status,e=t.response;t.ref;this.recHooks.filter(function(t){return t.status===n}).forEach(function(t){return t.callback(e)})}},{key:"cancelRefEvent",value:function(){this.refEvent&&this.channel.off(this.refEvent)}},{key:"cancelTimeout",value:function(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}},{key:"startTimeout",value:function(){var t=this;this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,function(n){t.cancelRefEvent(),t.cancelTimeout(),t.receivedResp=n,t.matchReceive(n)}),this.timeoutTimer=setTimeout(function(){t.trigger("timeout",{})},this.timeout)}},{key:"hasReceived",value:function(t){return this.receivedResp&&this.receivedResp.status===t}},{key:"trigger",value:function(t,n){this.channel.trigger(this.refEvent,{status:t,response:n})}}]),t}(),h=t.Channel=function(){function t(e,r,i){var o=this;n(this,t),this.state=s.closed,this.topic=e,this.params=r||{},this.socket=i,this.bindings=[],this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new l(this,c.join,this.params,this.timeout),this.pushBuffer=[],this.rejoinTimer=new b(function(){return o.rejoinUntilConnected()},this.socket.reconnectAfterMs),this.joinPush.receive("ok",function(){o.state=s.joined,o.rejoinTimer.reset(),o.pushBuffer.forEach(function(t){return t.send()}),o.pushBuffer=[]}),this.onClose(function(){o.rejoinTimer.reset(),o.socket.log("channel","close "+o.topic+" "+o.joinRef()),o.state=s.closed,o.socket.remove(o)}),this.onError(function(t){o.isLeaving()||o.isClosed()||(o.socket.log("channel","error "+o.topic,t),o.state=s.errored,o.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",function(){if(o.isJoining()){o.socket.log("channel","timeout "+o.topic+" ("+o.joinRef()+")",o.joinPush.timeout);new l(o,c.leave,{},o.timeout).send(),o.state=s.errored,o.joinPush.reset(),o.rejoinTimer.scheduleTimeout()}}),this.on(c.reply,function(t,n){o.trigger(o.replyEventName(n),t)})}return i(t,[{key:"rejoinUntilConnected",value:function(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}},{key:"join",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;if(this.joinedOnce)throw"tried to join multiple times. 'join' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(t),this.joinPush}},{key:"onClose",value:function(t){this.on(c.close,t)}},{key:"onError",value:function(t){this.on(c.error,function(n){return t(n)})}},{key:"on",value:function(t,n){this.bindings.push({event:t,callback:n})}},{key:"off",value:function(t){this.bindings=this.bindings.filter(function(n){return n.event!==t})}},{key:"canPush",value:function(){return this.socket.isConnected()&&this.isJoined()}},{key:"push",value:function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeout;if(!this.joinedOnce)throw"tried to push '"+t+"' to '"+this.topic+"' before joining. Use channel.join() before pushing events";var r=new l(this,t,n,e);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}},{key:"leave",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.state=s.leaving;var e=function(){t.socket.log("channel","leave "+t.topic),t.trigger(c.close,"leave")},r=new l(this,c.leave,{},n);return r.receive("ok",function(){return e()}).receive("timeout",function(){return e()}),r.send(),this.canPush()||r.trigger("ok",{}),r}},{key:"onMessage",value:function(t,n,e){return n}},{key:"isMember",value:function(t,n,e,r){if(this.topic!==t)return!1;var i=a.indexOf(n)>=0;return!r||!i||r===this.joinRef()||(this.socket.log("channel","dropping outdated message",{topic:t,event:n,payload:e,joinRef:r}),!1)}},{key:"joinRef",value:function(){return this.joinPush.ref}},{key:"sendJoin",value:function(t){this.state=s.joining,this.joinPush.resend(t)}},{key:"rejoin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.isLeaving()||this.sendJoin(t)}},{key:"trigger",value:function(t,n,e,r){var i=this,o=this.onMessage(t,n,e,r);if(n&&!o)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter(function(n){return n.event===t}).map(function(t){return t.callback(o,e,r||i.joinRef())})}},{key:"replyEventName",value:function(t){return"chan_reply_"+t}},{key:"isClosed",value:function(){return this.state===s.closed}},{key:"isErrored",value:function(){return this.state===s.errored}},{key:"isJoined",value:function(){return this.state===s.joined}},{key:"isJoining",value:function(){return this.state===s.joining}},{key:"isLeaving",value:function(){return this.state===s.leaving}}]),t}(),d={encode:function(t,n){var e=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(e))},decode:function(t,n){var e=JSON.parse(t),i=r(e,5),o=i[0],u=i[1],s=i[2],c=i[3],a=i[4];return n({join_ref:o,ref:u,topic:s,event:c,payload:a})}},v=(t.Socket=function(){function t(e){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,t),this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=i.timeout||u,this.transport=i.transport||window.WebSocket||v,this.defaultEncoder=d.encode,this.defaultDecoder=d.decode,this.transport!==v?(this.encode=i.encode||this.defaultEncoder,this.decode=i.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder),this.heartbeatIntervalMs=i.heartbeatIntervalMs||3e4,this.reconnectAfterMs=i.reconnectAfterMs||function(t){return[1e3,2e3,5e3,1e4][t-1]||1e4},this.logger=i.logger||function(){},this.longpollerTimeout=i.longpollerTimeout||2e4,this.params=i.params||{},this.endPoint=e+"/"+f.websocket,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new b(function(){r.disconnect(function(){return r.connect()})},this.reconnectAfterMs)}return i(t,[{key:"protocol",value:function(){return location.protocol.match(/^https/)?"wss":"ws"}},{key:"endPointURL",value:function(){var t=p.appendParams(p.appendParams(this.endPoint,this.params),{vsn:"2.0.0"});return"/"!==t.charAt(0)?t:"/"===t.charAt(1)?this.protocol()+":"+t:this.protocol()+"://"+location.host+t}},{key:"disconnect",value:function(t,n,e){this.conn&&(this.conn.onclose=function(){},n?this.conn.close(n,e||""):this.conn.close(),this.conn=null),t&&t()}},{key:"connect",value:function(t){var n=this;t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=t),this.conn||(this.conn=new this.transport(this.endPointURL()),this.conn.timeout=this.longpollerTimeout,this.conn.onopen=function(){return n.onConnOpen()},this.conn.onerror=function(t){return n.onConnError(t)},this.conn.onmessage=function(t){return n.onConnMessage(t)},this.conn.onclose=function(t){return n.onConnClose(t)})}},{key:"log",value:function(t,n,e){this.logger(t,n,e)}},{key:"onOpen",value:function(t){this.stateChangeCallbacks.open.push(t)}},{key:"onClose",value:function(t){this.stateChangeCallbacks.close.push(t)}},{key:"onError",value:function(t){this.stateChangeCallbacks.error.push(t)}},{key:"onMessage",value:function(t){this.stateChangeCallbacks.message.push(t)}},{key:"onConnOpen",value:function(){var t=this;this.log("transport","connected to "+this.endPointURL()),this.flushSendBuffer(),this.reconnectTimer.reset(),this.conn.skipHeartbeat||(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(function(){return t.sendHeartbeat()},this.heartbeatIntervalMs)),this.stateChangeCallbacks.open.forEach(function(t){return t()})}},{key:"onConnClose",value:function(t){this.log("transport","close",t),this.triggerChanError(),clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(function(n){return n(t)})}},{key:"onConnError",value:function(t){this.log("transport",t),this.triggerChanError(),this.stateChangeCallbacks.error.forEach(function(n){return n(t)})}},{key:"triggerChanError",value:function(){this.channels.forEach(function(t){return t.trigger(c.error)})}},{key:"connectionState",value:function(){switch(this.conn&&this.conn.readyState){case o.connecting:return"connecting";case o.open:return"open";case o.closing:return"closing";default:return"closed"}}},{key:"isConnected",value:function(){return"open"===this.connectionState()}},{key:"remove",value:function(t){this.channels=this.channels.filter(function(n){return n.joinRef()!==t.joinRef()})}},{key:"channel",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=new h(t,n,this);return this.channels.push(e),e}},{key:"push",value:function(t){var n=this,e=t.topic,r=t.event,i=t.payload,o=t.ref,u=t.join_ref,s=function(){n.encode(t,function(t){n.conn.send(t)})};this.log("push",e+" "+r+" ("+u+", "+o+")",i),this.isConnected()?s():this.sendBuffer.push(s)}},{key:"makeRef",value:function(){var t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}},{key:"sendHeartbeat",value:function(){if(this.isConnected()){if(this.pendingHeartbeatRef)return this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),void this.conn.close(1e3,"hearbeat timeout");this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef})}}},{key:"flushSendBuffer",value:function(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(function(t){return t()}),this.sendBuffer=[])}},{key:"onConnMessage",value:function(t){var n=this;this.decode(t.data,function(t){var e=t.topic,r=t.event,i=t.payload,o=t.ref,u=t.join_ref;o&&o===n.pendingHeartbeatRef&&(n.pendingHeartbeatRef=null),n.log("receive",(i.status||"")+" "+e+" "+r+" "+(o&&"("+o+")"||""),i),n.channels.filter(function(t){return t.isMember(e,r,i,u)}).forEach(function(t){return t.trigger(r,i,o,u)}),n.stateChangeCallbacks.message.forEach(function(n){return n(t)})})}}]),t}(),t.LongPoll=function(){function t(e){n(this,t),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=o.connecting,this.poll()}return i(t,[{key:"normalizeEndpoint",value:function(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+f.websocket),"$1/"+f.longpoll)}},{key:"endpointURL",value:function(){return p.appendParams(this.pollEndpoint,{token:this.token})}},{key:"closeAndRetry",value:function(){this.close(),this.readyState=o.connecting}},{key:"ontimeout",value:function(){this.onerror("timeout"),this.closeAndRetry()}},{key:"poll",value:function(){var t=this;this.readyState!==o.open&&this.readyState!==o.connecting||p.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),function(n){if(n){var e=n.status,r=n.token,i=n.messages;t.token=r}else e=0;switch(e){case 200:i.forEach(function(n){return t.onmessage({data:n})}),t.poll();break;case 204:t.poll();break;case 410:t.readyState=o.open,t.onopen(),t.poll();break;case 0:case 500:t.onerror(),t.closeAndRetry();break;default:throw"unhandled poll status "+e}})}},{key:"send",value:function(t){var n=this;p.request("POST",this.endpointURL(),"application/json",t,this.timeout,this.onerror.bind(this,"timeout"),function(t){t&&200===t.status||(n.onerror(t&&t.status),n.closeAndRetry())})}},{key:"close",value:function(t,n){this.readyState=o.closed,this.onclose()}}]),t}()),p=t.Ajax=function(){function t(){n(this,t)}return i(t,null,[{key:"request",value:function(t,n,e,r,i,o,u){if(window.XDomainRequest){var s=new XDomainRequest;this.xdomainRequest(s,t,n,r,i,o,u)}else{var c=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");this.xhrRequest(c,t,n,e,r,i,o,u)}}},{key:"xdomainRequest",value:function(t,n,e,r,i,o,u){var s=this;t.timeout=i,t.open(n,e),t.onload=function(){var n=s.parseJSON(t.responseText);u&&u(n)},o&&(t.ontimeout=o),t.onprogress=function(){},t.send(r)}},{key:"xhrRequest",value:function(t,n,e,r,i,o,u,s){var c=this;t.open(n,e,!0),t.timeout=o,t.setRequestHeader("Content-Type",r),t.onerror=function(){s&&s(null)},t.onreadystatechange=function(){if(t.readyState===c.states.complete&&s){var n=c.parseJSON(t.responseText);s(n)}},u&&(t.ontimeout=u),t.send(i)}},{key:"parseJSON",value:function(t){if(!t||""===t)return null;try{return JSON.parse(t)}catch(n){return console&&console.log("failed to parse JSON response",t),null}}},{key:"serialize",value:function(t,n){var r=[];for(var i in t)if(t.hasOwnProperty(i)){var o=n?n+"["+i+"]":i,u=t[i];"object"===(void 0===u?"undefined":e(u))?r.push(this.serialize(u,o)):r.push(encodeURIComponent(o)+"="+encodeURIComponent(u))}return r.join("&")}},{key:"appendParams",value:function(t,n){if(0===Object.keys(n).length)return t;var e=t.match(/\?/)?"&":"?";return""+t+e+this.serialize(n)}}]),t}();p.states={complete:4};t.Presence={syncState:function(t,n,e,r){var i=this,o=this.clone(t),u={},s={};return this.map(o,function(t,e){n[t]||(s[t]=e)}),this.map(n,function(t,n){var e=o[t];if(e){var r=n.metas.map(function(t){return t.phx_ref}),c=e.metas.map(function(t){return t.phx_ref}),a=n.metas.filter(function(t){return c.indexOf(t.phx_ref)<0}),f=e.metas.filter(function(t){return r.indexOf(t.phx_ref)<0});a.length>0&&(u[t]=n,u[t].metas=a),f.length>0&&(s[t]=i.clone(e),s[t].metas=f)}else u[t]=n}),this.syncDiff(o,{joins:u,leaves:s},e,r)},syncDiff:function(t,n,e,r){var i=n.joins,o=n.leaves,u=this.clone(t);return e||(e=function(){}),r||(r=function(){}),this.map(i,function(t,n){var r=u[t];if(u[t]=n,r){var i;(i=u[t].metas).unshift.apply(i,function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)}(r.metas))}e(t,r,n)}),this.map(o,function(t,n){var e=u[t];if(e){var i=n.metas.map(function(t){return t.phx_ref});e.metas=e.metas.filter(function(t){return i.indexOf(t.phx_ref)<0}),r(t,e,n),0===e.metas.length&&delete u[t]}}),u},list:function(t,n){return n||(n=function(t,n){return n}),this.map(t,function(t,e){return n(t,e)})},map:function(t,n){return Object.getOwnPropertyNames(t).map(function(e){return n(e,t[e])})},clone:function(t){return JSON.parse(JSON.stringify(t))}};var b=function(){function t(e,r){n(this,t),this.callback=e,this.timerCalc=r,this.timer=null,this.tries=0}return i(t,[{key:"reset",value:function(){this.tries=0,clearTimeout(this.timer)}},{key:"scheduleTimeout",value:function(){var t=this;clearTimeout(this.timer),this.timer=setTimeout(function(){t.tries=t.tries+1,t.callback()},this.timerCalc(this.tries+1))}}]),t}()}(n)});n(tr);tr.Channel,tr.Push,tr.Socket;var nr=function(t,n){return et(this,void 0),t.receive("ok",n.onSucceed).receive("error",n.onError).receive("timeout",n.onTimeout)}.bind(void 0),er={onError:function(t,n,e){et(this,void 0),rr(t,n),Ve(n,"Error","unsubscribe: "+String(e))}.bind(void 0),onTimeout:function(t,n){return et(this,void 0),Ve(n,"Error","unsubscribe: timeout")}.bind(void 0),onSucceed:Ye},rr=function(t,n){return et(this,void 0),nr(t.channel.push("unsubscribe",{subscriptionId:n.subscriptionId}),Ze(er,t,n.request))}.bind(void 0),ir=void 0,or=function(t,n){et(this,ir),Ke(t,Ge(nt({},n,{cancelled:!0}))),n.subscriptionId&&rr(t,n)}.bind(void 0),ur=function(t,n){return et(this,ir),"subscription"===n.operationType?or(t,n):Ye(t,n),t}.bind(void 0),sr=function(t,n,e){return et(this,void 0),t.forEach(function(t){return et(this,void 0),Ve(t,n,e)}.bind(this))}.bind(void 0),cr=function(t){return et(this,void 0),t.map(function(t){var n=t.column,e=t.line;return et(this,void 0),String(e)+":"+String(n)}.bind(this)).join("; ")}.bind(void 0),ar=function(t){var n=t.message,e=t.locations;return et(this,void 0),n+(e?" ("+String(cr(e))+")":"")}.bind(void 0),fr=function(t){return et(this,void 0),t.map(ar).join("\n")}.bind(void 0),lr=/^\s*(query|mutation|subscription|\{)/,hr=function(t){return et(this,void 0),"{"===t?"query":t}.bind(void 0),dr=function(t){et(this,void 0);var n=t.match(lr);if(!n)throw new TypeError("Invalid operation:\n"+String(t));return hr(n[1])}.bind(void 0),vr=function(t){return et(this,void 0),"OperationDefinition"===t.kind&&"subscription"===t.operation}.bind(void 0),pr=(function(t){return et(this,void 0),t.definitions.some(vr)}.bind(void 0),function(t){var n=t.query,e=t.variables;return et(this,void 0),e?{operation:n,variables:e}:{operation:n}}.bind(void 0),function(t){var n=t.operation,e=t.variables;return et(this,void 0),e?{query:n,variables:e}:{query:n}}.bind(void 0)),br=function(t){return et(this,void 0),Ve(t,"Start",t)}.bind(void 0),yr=function(t,n,e){var r=e.subscriptionId;et(this,void 0);var i=nt({},n,{subscriptionId:r});Ke(t,Ge(i)),br(i),i.cancelled&&rr(t,i)}.bind(void 0),mr=function(t,n,e){et(this,void 0),Ke(t,Xe(n)),Ve(n,"Abort",e)}.bind(void 0),gr=function(t,n,e){return et(this,void 0),mr(t,n,new Error(e))}.bind(void 0),wr=function(t,n,e){et(this,void 0),e.errors?gr(t,n,fr(e.errors)):yr(t,n,e)}.bind(void 0),kr=function(t,n,e){et(this,void 0),Ke(t,Xe(n)),Ve(n,"Result",e)}.bind(void 0),jr=function(t,n){return et(this,void 0),Ve(n,"Error",new Error("request: timeout"))}.bind(void 0),Sr={onError:gr,onTimeout:jr,onSucceed:kr},_r={onError:gr,onTimeout:jr,onSucceed:wr},Or=function(t,n,e){return et(this,void 0),nr(t.channel.push("doc",pr(n)),Ze(e,t,n))}.bind(void 0),Er=function(t,n){et(this,void 0),"subscription"===n.operationType?Or(t,n.request,_r):(br(n),Or(t,n.request,Sr))}.bind(void 0),Tr=function(t){return et(this,void 0),{onError:function(n){return et(this,void 0),sr(t.notifiers,"Error",new Error("channel join: "+String(n)))}.bind(this),onSucceed:function(){return et(this,void 0),t.notifiers.forEach(function(n){return et(this,void 0),Er(t,n)}.bind(this))}.bind(this),onTimeout:function(){return et(this,void 0),sr(t.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),xr=function(t){return et(this,void 0),nr(t.channel.join(),Tr(t)),t.channelJoinCreated=!0,t}.bind(void 0),Pr=function(){return et(this,void 0),new Error("connection: close")}.bind(void 0),Ar=function(t,n){et(this,void 0),Ke(t,Xe(n)),Ve(n,"Abort",Pr())}.bind(void 0),Cr=function(t){return et(this,void 0),function(n){et(this,void 0),"mutation"===n.operationType?Ar(t,n):Ve(n,"Error",Pr())}.bind(this)}.bind(void 0),Mr=function(t){return et(this,void 0),function(){return et(this,void 0),t.notifiers.forEach(Cr(t))}.bind(this)}.bind(void 0),Rr=function(t,n){var e=n.payload;et(this,void 0);var r=Qe(t.notifiers,"subscriptionId",e.subscriptionId);r&&Ve(r,"Result",e.result)}.bind(void 0),Lr=function(t){return et(this,void 0),function(n){et(this,void 0),"subscription:data"===n.event&&Rr(t,n)}.bind(this)}.bind(void 0),Ir=function(t){return et(this,void 0),!t.channelJoinCreated&&t.notifiers.length>0}.bind(void 0),Nr=function(t){return et(this,void 0),function(){et(this,void 0),Ir(t)&&xr(t)}.bind(this)}.bind(void 0),qr=function(t){et(this,void 0);var n={phoenixSocket:t,channel:t.channel("__absinthe__:control"),channelJoinCreated:!1,notifiers:[]};return t.onOpen(Nr(n)),t.onMessage(Lr(n)),t.onClose(Mr(n)),n}.bind(void 0),Jr=function(t,n){et(this,void 0);var e=t.observers,r=Vt(t,["observers"]);return nt({},r,{observers:[].concat(Ft(e),[n])})}.bind(void 0),Fr=function(t,n,e){return et(this,void 0),Ke(t,Ge(Jr(n,e)))}.bind(void 0),Hr=function(t){return et(this,void 0),{request:t,cancelled:!1,observers:[],operationType:dr(t.operation),subscriptionId:void 0}}.bind(void 0),Dr=function(t){et(this,void 0),t.phoenixSocket.isConnected()?xr(t):t.phoenixSocket.connect()}.bind(void 0),Br=function(t,n){et(this,void 0);var e=Hr(n);return Ke(t,Xt([e])),t.channelJoinCreated?Er(t,e):Dr(t),e}.bind(void 0),Ur=function(t,n){et(this,void 0);var e=n.prevStatus,r=nt({},n,{status:e,prevStatus:n.status});return Ke(t,notifierRefresh(Ke)),r}.bind(void 0),Gr=function(t,n){return et(this,void 0),"cancelling"===n.status?Ur(t,n):n}.bind(void 0),zr=function(t,n){et(this,void 0);var e=Qe(t.notifiers,"request",n);return e?Gr(t,e):Br(t,n)}.bind(void 0),Wr=e(function(t,n){!function(t,n){function e(t){return"function"==typeof Symbol&&Boolean(Symbol[t])}function r(t){return e(t)?Symbol[t]:"@@"+t}function i(t,n){var e=t[n];if(null!=e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}}function o(t){var n=t.constructor;return void 0!==n&&null===(n=n[r("species")])&&(n=void 0),void 0!==n?n:l}function u(t,n){Object.keys(n).forEach(function(e){var r=Object.getOwnPropertyDescriptor(n,e);r.enumerable=!1,Object.defineProperty(t,e,r)})}function s(t){var n=t._cleanup;n&&(t._cleanup=void 0,n())}function c(t){return void 0===t._observer}function a(t,n){if(Object(t)!==t)throw new TypeError("Observer must be an object");this._cleanup=void 0,this._observer=t;var e=i(t,"start");if(e&&e.call(t,this),!c(this)){t=new f(this);try{var r=n.call(void 0,t);if(null!=r){if("function"==typeof r.unsubscribe)r=function(t){return function(){t.unsubscribe()}}(r);else if("function"!=typeof r)throw new TypeError(r+" is not a function");this._cleanup=r}}catch(n){return void t.error(n)}c(this)&&s(this)}}function f(t){this._subscription=t}function l(t){if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}"function"!=typeof Symbol||Symbol.observable||(Symbol.observable=Symbol("observable"));u(a.prototype={},{get closed(){return c(this)},unsubscribe:function(){!function(t){if(c(t))return;t._observer=void 0,s(t)}(this)}});u(f.prototype={},{get closed(){return c(this._subscription)},next:function(t){var n=this._subscription;if(!c(n)){var e=n._observer,r=i(e,"next");if(r)return r.call(e,t)}},error:function(t){var n=this._subscription;if(c(n))throw t;var e=n._observer;n._observer=void 0;try{var r=i(e,"error");if(!r)throw t;t=r.call(e,t)}catch(t){try{s(n)}finally{throw t}}return s(n),t},complete:function(t){var n=this._subscription;if(!c(n)){var e=n._observer;n._observer=void 0;try{var r=i(e,"complete");t=r?r.call(e,t):void 0}catch(t){try{s(n)}finally{throw t}}return s(n),t}}});u(l.prototype,{subscribe:function(t){for(var n=[],e=1;e<arguments.length;++e)n.push(arguments[e]);return"function"==typeof t&&(t={next:t,error:n[0],complete:n[1]}),new a(t,this._subscriber)},forEach:function(t){var n=this;return new Promise(function(e,r){if("function"!=typeof t)return Promise.reject(new TypeError(t+" is not a function"));n.subscribe({_subscription:null,start:function(t){if(Object(t)!==t)throw new TypeError(t+" is not an object");this._subscription=t},next:function(n){var e=this._subscription;if(!e.closed)try{return t(n)}catch(t){r(t),e.unsubscribe()}},error:r,complete:e})})},map:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(o(this))(function(e){return n.subscribe({next:function(n){if(!e.closed){try{n=t(n)}catch(t){return e.error(t)}return e.next(n)}},error:function(t){return e.error(t)},complete:function(t){return e.complete(t)}})})},filter:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(o(this))(function(e){return n.subscribe({next:function(n){if(!e.closed){try{if(!t(n))return}catch(t){return e.error(t)}return e.next(n)}},error:function(t){return e.error(t)},complete:function(){return e.complete()}})})},reduce:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=o(this),r=arguments.length>1,i=!1,u=arguments[1];return new e(function(e){return n.subscribe({next:function(n){if(!e.closed){var o=!i;if(i=!0,!o||r)try{u=t(u,n)}catch(t){return e.error(t)}else u=n}},error:function(t){e.error(t)},complete:function(){i||r?(e.next(u),e.complete()):e.error(new TypeError("Cannot reduce an empty sequence"))}})})},flatMap:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(o(this))(function(e){function r(){i&&0===o.length&&e.complete()}var i=!1,o=[],u=n.subscribe({next:function(n){if(t)try{n=t(n)}catch(t){return void e.error(t)}l.from(n).subscribe({_subscription:null,start:function(t){o.push(this._subscription=t)},next:function(t){e.next(t)},error:function(t){e.error(t)},complete:function(){var t=o.indexOf(this._subscription);t>=0&&o.splice(t,1),r()}})},error:function(t){return e.error(t)},complete:function(){i=!0,r()}});return function(){o.forEach(function(t){return t.unsubscribe()}),u.unsubscribe()}})}}),Object.defineProperty(l.prototype,r("observable"),{value:function(){return this},writable:!0,configurable:!0}),u(l,{from:function(t){var n="function"==typeof this?this:l;if(null==t)throw new TypeError(t+" is not an object");var o=i(t,r("observable"));if(o){var u=o.call(t);if(Object(u)!==u)throw new TypeError(u+" is not an object");return u.constructor===n?u:new n(function(t){return u.subscribe(t)})}if(e("iterator")&&(o=i(t,r("iterator"))))return new n(function(n){for(var e,r=o.call(t)[Symbol.iterator]();!(e=r.next()).done;){var i=e.value;if(n.next(i),n.closed)return}n.complete()});if(Array.isArray(t))return new n(function(n){for(var e=0;e<t.length;++e)if(n.next(t[e]),n.closed)return;n.complete()});throw new TypeError(t+" is not observable")},of:function(){for(var t=[],n=0;n<arguments.length;++n)t.push(arguments[n]);return new("function"==typeof this?this:l)(function(n){for(var e=0;e<t.length;++e)if(n.next(t[e]),n.closed)return;n.complete()})}}),Object.defineProperty(l,r("species"),{get:function(){return this},configurable:!0}),t.Observable=l}(n)}).Observable,Vr=function(t,n){return et(this,void 0),function(e){et(this,void 0),n.next(e),"subscription"!==t.operationType&&n.complete()}.bind(this)}.bind(void 0),Xr=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.onError,i=e.onStart,o=e.unsubscribe;return et(this,void 0),new Wr(function(e){return et(this,void 0),Fr(t,n,{onError:r,onStart:i,onAbort:e.error,onResult:Vr(n,e)}),o}.bind(this))}.bind(void 0),Kr=function(t,n){et(this,void 0);var e=t.observers,r=Vt(t,["observers"]);return nt({},r,{observers:nn(e.indexOf(n),1,e)})}.bind(void 0),Yr=function(t,n,e){return et(this,void 0),Ke(t,Ge(Kr(n,e))),t}.bind(void 0);t.cancel=ur,t.create=qr,t.observe=Fr,t.send=zr,t.toObservable=Xr,t.unobserve=Yr,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.AbsintheSocket={})}(this,function(t){"use strict";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,n){return t(n={exports:{}},n.exports),n.exports}var r=n(e(function(t,n){n.__esModule=!0,n.default=function(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}})),i=e(function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.flip=function(t){return function(n,e){return t(e,n)}},n.constant=function(t){return function(){return t}},n.on=function(t,n){return function(e,r){return t(n(e),n(r))}},n.compose=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=i;o>-1;o--)r=e[o].call(t,r);return r}},n.pipe=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=0;o<=i;o++)r=e[o].call(t,r);return r}},n.curry=function(t){return function t(n,e,r){return function(){var i=r.concat(Array.prototype.slice.call(arguments));return i.length>=e?n.apply(this,i):t(n,e,i)}}(t,t.length,[])}});n(i);i.flip,i.constant,i.on,i.compose,i.pipe;var o=i.curry,u=Math.ceil,s=Math.floor,c=function(t){return isNaN(t=+t)?0:(t>0?s:u)(t)},a=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},f=e(function(t){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)}),l=e(function(t){var n=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)}),h=(l.version,function(t,n,e){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,i){return t.call(n,e,r,i)}}return function(){return t.apply(n,arguments)}}),d=function(t){return"object"==typeof t?null!==t:"function"==typeof t},v=function(t){if(!d(t))throw TypeError(t+" is not an object!");return t},p=function(t){try{return!!t()}catch(t){return!0}},b=!p(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),y=f.document,m=d(y)&&d(y.createElement),g=function(t){return m?y.createElement(t):{}},w=!b&&!p(function(){return 7!=Object.defineProperty(g("div"),"a",{get:function(){return 7}}).a}),k=function(t,n){if(!d(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!d(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!d(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!d(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")},j=Object.defineProperty,O={f:b?Object.defineProperty:function(t,n,e){if(v(t),n=k(n,!0),v(e),w)try{return j(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},S=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},_=b?function(t,n,e){return O.f(t,n,S(1,e))}:function(t,n,e){return t[n]=e,t},E="prototype",T=function(t,n,e){var r,i,o,u=t&T.F,s=t&T.G,c=t&T.S,a=t&T.P,d=t&T.B,v=t&T.W,p=s?l:l[n]||(l[n]={}),b=p[E],y=s?f:c?f[n]:(f[n]||{})[E];s&&(e=n);for(r in e)(i=!u&&y&&void 0!==y[r])&&r in p||(o=i?y[r]:e[r],p[r]=s&&"function"!=typeof y[r]?e[r]:d&&i?h(o,f):v&&y[r]==o?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n[E]=t[E],n}(o):a&&"function"==typeof o?h(Function.call,o):o,a&&((p.virtual||(p.virtual={}))[r]=o,t&T.R&&b&&!b[r]&&_(b,r,o)))};T.F=1,T.G=2,T.S=4,T.P=8,T.B=16,T.W=32,T.U=64,T.R=128;var x,A=T,P=_,C={}.hasOwnProperty,M=function(t,n){return C.call(t,n)},R={},L={}.toString,I=function(t){return L.call(t).slice(8,-1)},N=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==I(t)?t.split(""):Object(t)},q=function(t){return N(a(t))},J=Math.min,F=function(t){return t>0?J(c(t),9007199254740991):0},H=Math.max,D=Math.min,B="__core-js_shared__",U=f[B]||(f[B]={}),G=function(t){return U[t]||(U[t]={})},z=0,W=Math.random(),V=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++z+W).toString(36))},X=G("keys"),K=function(t){return X[t]||(X[t]=V(t))},Y=(x=!1,function(t,n,e){var r,i,o,u=q(t),s=F(u.length),a=(r=e,i=s,(r=c(r))<0?H(r+i,0):D(r,i));if(x&&n!=n){for(;s>a;)if((o=u[a++])!=o)return!0}else for(;s>a;a++)if((x||a in u)&&u[a]===n)return x||a||0;return!x&&-1}),Q=K("IE_PROTO"),$=function(t,n){var e,r=q(t),i=0,o=[];for(e in r)e!=Q&&M(r,e)&&o.push(e);for(;n.length>i;)M(r,e=n[i++])&&(~Y(o,e)||o.push(e));return o},Z="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),tt=Object.keys||function(t){return $(t,Z)},nt=b?Object.defineProperties:function(t,n){v(t);for(var e,r=tt(n),i=r.length,o=0;i>o;)O.f(t,e=r[o++],n[e]);return t},et=f.document,rt=et&&et.documentElement,it=K("IE_PROTO"),ot=function(){},ut="prototype",st=function(){var t,n=g("iframe"),e=Z.length;for(n.style.display="none",rt.appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),st=t.F;e--;)delete st[ut][Z[e]];return st()},ct=Object.create||function(t,n){var e;return null!==t?(ot[ut]=v(t),e=new ot,ot[ut]=null,e[it]=t):e=st(),void 0===n?e:nt(e,n)},at=e(function(t){var n=G("wks"),e=f.Symbol,r="function"==typeof e;(t.exports=function(t){return n[t]||(n[t]=r&&e[t]||(r?e:V)("Symbol."+t))}).store=n}),ft=O.f,lt=at("toStringTag"),ht=function(t,n,e){t&&!M(t=e?t:t.prototype,lt)&&ft(t,lt,{configurable:!0,value:n})},dt={};_(dt,at("iterator"),function(){return this});var vt,pt=function(t){return Object(a(t))},bt=K("IE_PROTO"),yt=Object.prototype,mt=Object.getPrototypeOf||function(t){return t=pt(t),M(t,bt)?t[bt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?yt:null},gt=at("iterator"),wt=!([].keys&&"next"in[].keys()),kt="values",jt=function(){return this},Ot=function(t,n,e,r,i,o,u){c=n,a=r,(s=e).prototype=ct(dt,{next:S(1,a)}),ht(s,c+" Iterator");var s,c,a,f,l,h,d=function(t){if(!wt&&t in y)return y[t];switch(t){case"keys":case kt:return function(){return new e(this,t)}}return function(){return new e(this,t)}},v=n+" Iterator",p=i==kt,b=!1,y=t.prototype,m=y[gt]||y["@@iterator"]||i&&y[i],g=m||d(i),w=i?p?d("entries"):g:void 0,k="Array"==n?y.entries||m:m;if(k&&(h=mt(k.call(new t)))!==Object.prototype&&h.next&&ht(h,v,!0),p&&m&&m.name!==kt&&(b=!0,g=function(){return m.call(this)}),u&&(wt||b||!y[gt])&&_(y,gt,g),R[n]=g,R[v]=jt,i)if(f={values:p?g:d(kt),keys:o?g:d("keys"),entries:w},u)for(l in f)l in y||P(y,l,f[l]);else A(A.P+A.F*(wt||b),n,f);return f},St=(vt=!0,function(t,n){var e,r,i=String(a(t)),o=c(n),u=i.length;return o<0||o>=u?vt?"":void 0:(e=i.charCodeAt(o))<55296||e>56319||o+1===u||(r=i.charCodeAt(o+1))<56320||r>57343?vt?i.charAt(o):e:vt?i.slice(o,o+2):r-56320+(e-55296<<10)+65536});Ot(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,e=this._i;return e>=n.length?{value:void 0,done:!0}:(t=St(n,e),this._i+=t.length,{value:t,done:!1})});var _t=function(t,n,e,r){try{return r?n(v(e)[0],e[1]):n(e)}catch(n){var i=t.return;throw void 0!==i&&v(i.call(t)),n}},Et=at("iterator"),Tt=Array.prototype,xt=function(t,n,e){n in t?O.f(t,n,S(0,e)):t[n]=e},At=at("toStringTag"),Pt="Arguments"==I(function(){return arguments}()),Ct=function(t){var n,e,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),At))?e:Pt?I(n):"Object"==(r=I(n))&&"function"==typeof n.callee?"Arguments":r},Mt=at("iterator"),Rt=l.getIteratorMethod=function(t){if(void 0!=t)return t[Mt]||t["@@iterator"]||R[Ct(t)]},Lt=at("iterator"),It=!1;try{[7][Lt]().return=function(){It=!0}}catch(t){}A(A.S+A.F*!function(t,n){if(!n&&!It)return!1;var e=!1;try{var r=[7],i=r[Lt]();i.next=function(){return{done:e=!0}},r[Lt]=function(){return i},t(r)}catch(t){}return e}(function(t){}),"Array",{from:function(t){var n,e,r,i,o=pt(t),u="function"==typeof this?this:Array,s=arguments.length,c=s>1?arguments[1]:void 0,a=void 0!==c,f=0,l=Rt(o);if(a&&(c=h(c,s>2?arguments[2]:void 0,2)),void 0!=l&&(u!=Array||(d=l,void 0===d||R.Array!==d&&Tt[Et]!==d)))for(i=l.call(o),e=new u;!(r=i.next()).done;f++)xt(e,f,a?_t(i,c,[r.value,f],!0):r.value);else for(e=new u(n=F(o.length));n>f;f++)xt(e,f,a?c(o[f],f):o[f]);var d;return e.length=f,e}});var Nt=l.Array.from,qt=e(function(t){t.exports={default:Nt,__esModule:!0}}),Jt=n(qt),Ft=n(e(function(t,n){n.__esModule=!0;var e,r=(e=qt,e&&e.__esModule?e:{default:e});n.default=function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return(0,r.default)(t)}})),Ht=e(function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.flip=function(t){return function(n,e){return t(e,n)}},n.constant=function(t){return function(){return t}},n.on=function(t,n){return function(e,r){return t(n(e),n(r))}},n.compose=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=i;o>-1;o--)r=e[o].call(t,r);return r}},n.pipe=function(){for(var t=this,n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var i=e.length-1;return function(n){for(var r=n,o=0;o<=i;o++)r=e[o].call(t,r);return r}},n.curry=function(t){return function t(n,e,r){return function(){var i=r.concat(Array.prototype.slice.call(arguments));return i.length>=e?n.apply(this,i):t(n,e,i)}}(t,t.length,[])}});n(Ht);Ht.flip,Ht.constant,Ht.on,Ht.compose,Ht.pipe;var Dt=Ht.curry,Bt={f:Object.getOwnPropertySymbols},Ut={f:{}.propertyIsEnumerable},Gt=Object.assign,zt=!Gt||p(function(){var t={},n={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(t){n[t]=t}),7!=Gt({},t)[e]||Object.keys(Gt({},n)).join("")!=r})?function(t,n){for(var e=pt(t),r=arguments.length,i=1,o=Bt.f,u=Ut.f;r>i;)for(var s,c=N(arguments[i++]),a=o?tt(c).concat(o(c)):tt(c),f=a.length,l=0;f>l;)u.call(c,s=a[l++])&&(e[s]=c[s]);return e}:Gt;A(A.S+A.F,"Object",{assign:zt});var Wt=l.Object.assign,Vt=e(function(t){t.exports={default:Wt,__esModule:!0}});n(Vt);var Xt=n(e(function(t,n){n.__esModule=!0;var e,r=(e=Vt,e&&e.__esModule?e:{default:e});n.default=r.default||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t}}));!function(t,n){var e=(l.Object||{})[t]||Object[t],r={};r[t]=n(e),A(A.S+A.F*p(function(){e(1)}),"Object",r)}("keys",function(){return function(t){return tt(pt(t))}});var Kt=l.Object.keys,Yt=n(e(function(t){t.exports={default:Kt,__esModule:!0}})),Qt=Math.floor;A(A.S,"Number",{isInteger:function(t){return!d(t)&&isFinite(t)&&Qt(t)===t}});var $t=l.Number.isInteger,Zt=n(e(function(t){t.exports={default:$t,__esModule:!0}})),tn=n(e(function(t,n){n.__esModule=!0,n.default=function(t,n){var e={};for(var r in t)n.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}})),nn=Dt(function(t,n){return r(this,void 0),[].concat(Ft(n),Ft(t))}.bind(void 0)),en=(function(t){return r(this,void 0),Array.isArray(t)?t:[t]}.bind(void 0),Dt(function(t,n){return r(this,void 0),n===t.length-1}.bind(void 0))),rn=(Dt(function(t,n){return r(this,void 0),en(t,n)?0:n+1}.bind(void 0)),function(t){return r(this,void 0),Math.max.apply(Math,Ft(Yt(t)))+1}.bind(void 0)),on=(function(t){return r(this,void 0),Jt("length"in t?t:Xt({},t,{length:rn(t)}))}.bind(void 0),Dt(function(t,n,e){return r(this,void 0),[].concat(Ft(e.slice(0,t)),Ft(n),Ft(e.slice(t+1)))}.bind(void 0)),function(t,n){return r(this,void 0),Zt(t)&&t>=n}.bind(void 0)),un=function(t){return r(this,void 0),on(Number(t),0)}.bind(void 0),sn=(function(t){t.length;var n=tn(t,["length"]);return r(this,void 0),Yt(n).every(un)}.bind(void 0),Dt(function(t,n){return r(this,void 0),[].concat(Ft(t),Ft(n))}.bind(void 0)),Dt(function(t,n,e,i){return r(this,void 0),i.reduce(function(e,i,o){return r(this,void 0),t(i,o,e)?n(e,i,o):e}.bind(this),e)}.bind(void 0)),Dt(function(t,n,e,i){r(this,void 0);var o=e;return i.every(function(e,i){r(this,void 0);var u=t(e,i,o);return u&&(o=n(o,e,i)),u}.bind(this)),o}.bind(void 0)),Dt(function(t,n,e){return r(this,void 0),[].concat(Ft(e.slice(0,t)),Ft(e.slice(t+n)))}.bind(void 0))),cn=(Dt(function(t,n){return r(this,void 0),[].concat(Ft(Array(t))).map(function(){return r(this,void 0),n}.bind(this))}.bind(void 0)),Dt(function(t,n,e){return r(this,void 0),[].concat(Ft(e.slice(0,t)),Ft(n),Ft(e.slice(t+n.length)))}.bind(void 0)));Dt(function(t,n){return r(this,void 0),n<0?t.length-n:n}.bind(void 0));A(A.S+A.F*!b,"Object",{defineProperty:O.f});var an=l.Object,fn=function(t,n,e){return an.defineProperty(t,n,e)},ln=e(function(t){t.exports={default:fn,__esModule:!0}});n(ln);var hn=n(e(function(t,n){n.__esModule=!0;var e,r=(e=ln,e&&e.__esModule?e:{default:e});n.default=function(t,n,e){return n in t?(0,r.default)(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}})),dn=function(t,n){return{value:n,done:!!t}};Ot(Array,"Array",function(t,n){this._t=q(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,dn(1)):dn(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])},"values");R.Arguments=R.Array;for(var vn=at("toStringTag"),pn="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),bn=0;bn<pn.length;bn++){var yn=pn[bn],mn=f[yn],gn=mn&&mn.prototype;gn&&!gn[vn]&&_(gn,vn,yn),R[yn]=R.Array}var wn=at("iterator"),kn=l.isIterable=function(t){var n=Object(t);return void 0!==n[wn]||"@@iterator"in n||R.hasOwnProperty(Ct(n))},jn=e(function(t){t.exports={default:kn,__esModule:!0}});n(jn);var On=l.getIterator=function(t){var n=Rt(t);if("function"!=typeof n)throw TypeError(t+" is not iterable!");return v(n.call(t))},Sn=e(function(t){t.exports={default:On,__esModule:!0}});n(Sn);var _n,En=n(e(function(t,n){n.__esModule=!0;var e=i(jn),r=i(Sn);function i(t){return t&&t.__esModule?t:{default:t}}n.default=function(){return function(t,n){if(Array.isArray(t))return t;if((0,e.default)(Object(t)))return function(t,n){var e=[],i=!0,o=!1,u=void 0;try{for(var s,c=(0,r.default)(t);!(i=(s=c.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){o=!0,u=t}finally{try{!i&&c.return&&c.return()}finally{if(o)throw u}}return e}(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()})),Tn=Ut.f,xn=(_n=!0,function(t){for(var n,e=q(t),r=tt(e),i=r.length,o=0,u=[];i>o;)Tn.call(e,n=r[o++])&&u.push(_n?[n,e[n]]:e[n]);return u});A(A.S,"Object",{entries:function(t){return xn(t)}});var An=l.Object.entries,Pn=n(e(function(t){t.exports={default:An,__esModule:!0}})),Cn=e(function(t){var n=V("meta"),e=O.f,r=0,i=Object.isExtensible||function(){return!0},o=!p(function(){return i(Object.preventExtensions({}))}),u=function(t){e(t,n,{value:{i:"O"+ ++r,w:{}}})},s=t.exports={KEY:n,NEED:!1,fastKey:function(t,e){if(!d(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!M(t,n)){if(!i(t))return"F";if(!e)return"E";u(t)}return t[n].i},getWeak:function(t,e){if(!M(t,n)){if(!i(t))return!0;if(!e)return!1;u(t)}return t[n].w},onFreeze:function(t){return o&&s.NEED&&i(t)&&!M(t,n)&&u(t),t}}}),Mn=(Cn.KEY,Cn.NEED,Cn.fastKey,Cn.getWeak,Cn.onFreeze,{f:at}),Rn=O.f,Ln=function(t){var n=l.Symbol||(l.Symbol={});"_"==t.charAt(0)||t in n||Rn(n,t,{value:Mn.f(t)})},In=Array.isArray||function(t){return"Array"==I(t)},Nn=Z.concat("length","prototype"),qn={f:Object.getOwnPropertyNames||function(t){return $(t,Nn)}},Jn=qn.f,Fn={}.toString,Hn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Dn={f:function(t){return Hn&&"[object Window]"==Fn.call(t)?function(t){try{return Jn(t)}catch(t){return Hn.slice()}}(t):Jn(q(t))}},Bn=Object.getOwnPropertyDescriptor,Un={f:b?Bn:function(t,n){if(t=q(t),n=k(n,!0),w)try{return Bn(t,n)}catch(t){}if(M(t,n))return S(!Ut.f.call(t,n),t[n])}},Gn=Cn.KEY,zn=Un.f,Wn=O.f,Vn=Dn.f,Xn=f.Symbol,Kn=f.JSON,Yn=Kn&&Kn.stringify,Qn="prototype",$n=at("_hidden"),Zn=at("toPrimitive"),te={}.propertyIsEnumerable,ne=G("symbol-registry"),ee=G("symbols"),re=G("op-symbols"),ie=Object[Qn],oe="function"==typeof Xn,ue=f.QObject,se=!ue||!ue[Qn]||!ue[Qn].findChild,ce=b&&p(function(){return 7!=ct(Wn({},"a",{get:function(){return Wn(this,"a",{value:7}).a}})).a})?function(t,n,e){var r=zn(ie,n);r&&delete ie[n],Wn(t,n,e),r&&t!==ie&&Wn(ie,n,r)}:Wn,ae=function(t){var n=ee[t]=ct(Xn[Qn]);return n._k=t,n},fe=oe&&"symbol"==typeof Xn.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Xn},le=function(t,n,e){return t===ie&&le(re,n,e),v(t),n=k(n,!0),v(e),M(ee,n)?(e.enumerable?(M(t,$n)&&t[$n][n]&&(t[$n][n]=!1),e=ct(e,{enumerable:S(0,!1)})):(M(t,$n)||Wn(t,$n,S(1,{})),t[$n][n]=!0),ce(t,n,e)):Wn(t,n,e)},he=function(t,n){v(t);for(var e,r=function(t){var n=tt(t),e=Bt.f;if(e)for(var r,i=e(t),o=Ut.f,u=0;i.length>u;)o.call(t,r=i[u++])&&n.push(r);return n}(n=q(n)),i=0,o=r.length;o>i;)le(t,e=r[i++],n[e]);return t},de=function(t){var n=te.call(this,t=k(t,!0));return!(this===ie&&M(ee,t)&&!M(re,t))&&(!(n||!M(this,t)||!M(ee,t)||M(this,$n)&&this[$n][t])||n)},ve=function(t,n){if(t=q(t),n=k(n,!0),t!==ie||!M(ee,n)||M(re,n)){var e=zn(t,n);return!e||!M(ee,n)||M(t,$n)&&t[$n][n]||(e.enumerable=!0),e}},pe=function(t){for(var n,e=Vn(q(t)),r=[],i=0;e.length>i;)M(ee,n=e[i++])||n==$n||n==Gn||r.push(n);return r},be=function(t){for(var n,e=t===ie,r=Vn(e?re:q(t)),i=[],o=0;r.length>o;)!M(ee,n=r[o++])||e&&!M(ie,n)||i.push(ee[n]);return i};oe||(P((Xn=function(){if(this instanceof Xn)throw TypeError("Symbol is not a constructor!");var t=V(arguments.length>0?arguments[0]:void 0),n=function(e){this===ie&&n.call(re,e),M(this,$n)&&M(this[$n],t)&&(this[$n][t]=!1),ce(this,t,S(1,e))};return b&&se&&ce(ie,t,{configurable:!0,set:n}),ae(t)})[Qn],"toString",function(){return this._k}),Un.f=ve,O.f=le,qn.f=Dn.f=pe,Ut.f=de,Bt.f=be,Mn.f=function(t){return ae(at(t))}),A(A.G+A.W+A.F*!oe,{Symbol:Xn});for(var ye="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),me=0;ye.length>me;)at(ye[me++]);for(var ge=tt(at.store),we=0;ge.length>we;)Ln(ge[we++]);A(A.S+A.F*!oe,"Symbol",{for:function(t){return M(ne,t+="")?ne[t]:ne[t]=Xn(t)},keyFor:function(t){if(!fe(t))throw TypeError(t+" is not a symbol!");for(var n in ne)if(ne[n]===t)return n},useSetter:function(){se=!0},useSimple:function(){se=!1}}),A(A.S+A.F*!oe,"Object",{create:function(t,n){return void 0===n?ct(t):he(ct(t),n)},defineProperty:le,defineProperties:he,getOwnPropertyDescriptor:ve,getOwnPropertyNames:pe,getOwnPropertySymbols:be}),Kn&&A(A.S+A.F*(!oe||p(function(){var t=Xn();return"[null]"!=Yn([t])||"{}"!=Yn({a:t})||"{}"!=Yn(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!fe(t)){for(var n,e,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);return"function"==typeof(n=r[1])&&(e=n),!e&&In(n)||(n=function(t,n){if(e&&(n=e.call(this,t,n)),!fe(n))return n}),r[1]=n,Yn.apply(Kn,r)}}}),Xn[Qn][Zn]||_(Xn[Qn],Zn,Xn[Qn].valueOf),ht(Xn,"Symbol"),ht(Math,"Math",!0),ht(f.JSON,"JSON",!0),Ln("asyncIterator"),Ln("observable");var ke=l.Symbol,je=n(e(function(t){t.exports={default:ke,__esModule:!0}})),Oe=o(function(t,n){return r(this,void 0),n[t]}.bind(void 0)),Se=o(function(t,n){return r(this,void 0),Object.prototype.hasOwnProperty.call(n,t)}.bind(void 0)),_e=function(t,n,e){return r(this,void 0),en(n,t)?Oe(n[t],e):Se(n[t],e)?_e(t+1,n,Oe(n[t],e)):void 0}.bind(void 0),Ee=o(function(t,n){return r(this,void 0),0===t.length?void 0:_e(0,t,n)}.bind(void 0)),Te=function(t){return r(this,void 0),Array.isArray(t)?[].concat(Ft(t.keys())):Yt(t)}.bind(void 0),xe=o(function(t,n,e){return r(this,void 0),function t(n,e){if(n===e)return!0;var r,i=Array.isArray(n),o=Array.isArray(e);if(i&&o){if(n.length!=e.length)return!1;for(r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}if(i!=o)return!1;if(n&&e&&"object"==typeof n&&"object"==typeof e){var u=Object.keys(n);if(u.length!==Object.keys(e).length)return!1;var s=n instanceof Date,c=e instanceof Date;if(s&&c)return n.getTime()==e.getTime();if(s!=c)return!1;var a=n instanceof RegExp,f=e instanceof RegExp;if(a&&f)return n.toString()==e.toString();if(a!=f)return!1;for(r=0;r<u.length;r++)if(!Object.prototype.hasOwnProperty.call(e,u[r]))return!1;for(r=0;r<u.length;r++)if(!t(n[u[r]],e[u[r]]))return!1;return!0}return!1}(Ee(t,e),n)}.bind(void 0)),Ae=o(function(t,n){r(this,void 0);var e=Te(t);return e.length===Te(n).length&&e.every(function(e){return r(this,void 0),Se(e,n)&&Oe(e,t)===Oe(e,n)}.bind(this))}.bind(void 0)),Pe=function(t,n){return r(this,void 0),Pn(n).reduce(function(e,i){var o=En(i,2),u=o[0],s=o[1];return r(this,void 0),Xt({},e,hn({},u,t(s,u,n)))}.bind(this),{})}.bind(void 0),Ce=o(function(t,n){return r(this,void 0),Array.isArray(n)?n.map(t):Pe(t,n)}.bind(void 0)),Me=function(t,n){n[t];var e=tn(n,[t]);return r(this,void 0),e}.bind(void 0),Re=o(function(t,n){return r(this,void 0),Array.isArray(n)?sn(t,1,n):Me(t,n)}.bind(void 0)),Le=function(t){return r(this,void 0),Array.isArray(t)?[].concat(Ft(t)):Xt({},t)}.bind(void 0),Ie=function(t){r(this,void 0);var n=Le(t);return{origin:n,previous:void 0,current:n}}.bind(void 0),Ne=function(t){return r(this,void 0),"number"==typeof t?[]:{}}.bind(void 0),qe=function(t,n,e){return r(this,void 0),Se(t,e)?Le(Oe(t,e)):Ne(n)}.bind(void 0),Je=function(t,n,e,i){return r(this,void 0),en(t,e)?n(Oe(t[e],i)):qe(t[e],t[e+1],i)}.bind(void 0),Fe=function(t,n,e){return r(this,void 0),e[t]=n,Oe(t,e)}.bind(void 0),He=function(t,n,e,i){return r(this,void 0),Xt({},i,{current:Fe(t[n],e,i.current)})}.bind(void 0),De=function(t,n,e){r(this,void 0);var i=Re(t[n],e.current);return Xt({},e,0===n?{current:i,origin:i}:{previous:Fe(t[n-1],i,e.previous)})}.bind(void 0),Be=je("composite.updateIn.removeAction"),Ue=function(t,n,e,i){return r(this,void 0),e===Be?De(t,n,i):He(t,n,e,i)}.bind(void 0),Ge=function(t,n){return r(this,void 0),function(e,i,o){return r(this,void 0),Ue(t,o,Je(t,n,o,e.current),e)}.bind(this)}.bind(void 0),ze=o(function(t,n,e){return r(this,void 0),0===t.length?e:t.reduce(Ge(t,n),Ie(e)).origin}.bind(void 0));ze.remove=Be;var We=function(){return r(this,void 0),ze.remove}.bind(void 0),Ve=(o(function(t,n){return r(this,void 0),ze(t,We,n)}.bind(void 0)),o(function(t,n,e){r(this,void 0);var i=Le(e);return i[t]=n,i}.bind(void 0)),o(function(t,n,e){return r(this,void 0),ze(t,function(){return r(this,void 0),n}.bind(this),e)}.bind(void 0)),function(t,n){return r(this,void 0),Boolean(Number(t)^Number(n))}.bind(void 0)),Xe=(o(function(t,n){return r(this,void 0),t===n||!Ve(Array.isArray(t),Array.isArray(n))&&Ae(t,n)}.bind(void 0)),function(t,n,e){return r(this,void 0),t.find(xe([n],e))}.bind(void 0)),Ke=function(t,n){return r(this,void 0),function(e){return r(this,void 0),function(){for(var i=arguments.length,o=Array(i),u=0;u<i;u++)o[u]=arguments[u];r(this,void 0);var s=Xe(t.notifiers,"request",n);s&&e.apply(void 0,[t,s].concat(o))}.bind(this)}.bind(this)}.bind(void 0),Ye=function(t,n,e){return r(this,void 0),Ce(Ke(n,e),t)}.bind(void 0),Qe=e(function(t,n){!function(t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var u,s=t[Symbol.iterator]();!(r=(u=s.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return e}(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}();function i(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var o={connecting:0,open:1,closing:2,closed:3},u=1e4,s={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},c={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},a=[c.close,c.error,c.join,c.reply,c.leave],f={longpoll:"longpoll",websocket:"websocket"},l=function(){function t(n,e,r,o){i(this,t),this.channel=n,this.event=e,this.payload=r||{},this.receivedResp=null,this.timeout=o,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}return r(t,[{key:"resend",value:function(t){this.timeout=t,this.reset(),this.send()}},{key:"send",value:function(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel.joinRef()}))}},{key:"receive",value:function(t,n){return this.hasReceived(t)&&n(this.receivedResp.response),this.recHooks.push({status:t,callback:n}),this}},{key:"reset",value:function(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}},{key:"matchReceive",value:function(t){var n=t.status,e=t.response;t.ref,this.recHooks.filter(function(t){return t.status===n}).forEach(function(t){return t.callback(e)})}},{key:"cancelRefEvent",value:function(){this.refEvent&&this.channel.off(this.refEvent)}},{key:"cancelTimeout",value:function(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}},{key:"startTimeout",value:function(){var t=this;this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,function(n){t.cancelRefEvent(),t.cancelTimeout(),t.receivedResp=n,t.matchReceive(n)}),this.timeoutTimer=setTimeout(function(){t.trigger("timeout",{})},this.timeout)}},{key:"hasReceived",value:function(t){return this.receivedResp&&this.receivedResp.status===t}},{key:"trigger",value:function(t,n){this.channel.trigger(this.refEvent,{status:t,response:n})}}]),t}(),h=t.Channel=function(){function t(n,e,r){var o=this;i(this,t),this.state=s.closed,this.topic=n,this.params=e||{},this.socket=r,this.bindings=[],this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new l(this,c.join,this.params,this.timeout),this.pushBuffer=[],this.rejoinTimer=new b(function(){return o.rejoinUntilConnected()},this.socket.reconnectAfterMs),this.joinPush.receive("ok",function(){o.state=s.joined,o.rejoinTimer.reset(),o.pushBuffer.forEach(function(t){return t.send()}),o.pushBuffer=[]}),this.onClose(function(){o.rejoinTimer.reset(),o.socket.log("channel","close "+o.topic+" "+o.joinRef()),o.state=s.closed,o.socket.remove(o)}),this.onError(function(t){o.isLeaving()||o.isClosed()||(o.socket.log("channel","error "+o.topic,t),o.state=s.errored,o.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",function(){if(o.isJoining()){o.socket.log("channel","timeout "+o.topic+" ("+o.joinRef()+")",o.joinPush.timeout);var t=new l(o,c.leave,{},o.timeout);t.send(),o.state=s.errored,o.joinPush.reset(),o.rejoinTimer.scheduleTimeout()}}),this.on(c.reply,function(t,n){o.trigger(o.replyEventName(n),t)})}return r(t,[{key:"rejoinUntilConnected",value:function(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}},{key:"join",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;if(this.joinedOnce)throw"tried to join multiple times. 'join' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(t),this.joinPush}},{key:"onClose",value:function(t){this.on(c.close,t)}},{key:"onError",value:function(t){this.on(c.error,function(n){return t(n)})}},{key:"on",value:function(t,n){this.bindings.push({event:t,callback:n})}},{key:"off",value:function(t){this.bindings=this.bindings.filter(function(n){return n.event!==t})}},{key:"canPush",value:function(){return this.socket.isConnected()&&this.isJoined()}},{key:"push",value:function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeout;if(!this.joinedOnce)throw"tried to push '"+t+"' to '"+this.topic+"' before joining. Use channel.join() before pushing events";var r=new l(this,t,n,e);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}},{key:"leave",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.state=s.leaving;var e=function(){t.socket.log("channel","leave "+t.topic),t.trigger(c.close,"leave")},r=new l(this,c.leave,{},n);return r.receive("ok",function(){return e()}).receive("timeout",function(){return e()}),r.send(),this.canPush()||r.trigger("ok",{}),r}},{key:"onMessage",value:function(t,n,e){return n}},{key:"isMember",value:function(t,n,e,r){if(this.topic!==t)return!1;var i=a.indexOf(n)>=0;return!r||!i||r===this.joinRef()||(this.socket.log("channel","dropping outdated message",{topic:t,event:n,payload:e,joinRef:r}),!1)}},{key:"joinRef",value:function(){return this.joinPush.ref}},{key:"sendJoin",value:function(t){this.state=s.joining,this.joinPush.resend(t)}},{key:"rejoin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.isLeaving()||this.sendJoin(t)}},{key:"trigger",value:function(t,n,e,r){var i=this,o=this.onMessage(t,n,e,r);if(n&&!o)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter(function(n){return n.event===t}).map(function(t){return t.callback(o,e,r||i.joinRef())})}},{key:"replyEventName",value:function(t){return"chan_reply_"+t}},{key:"isClosed",value:function(){return this.state===s.closed}},{key:"isErrored",value:function(){return this.state===s.errored}},{key:"isJoined",value:function(){return this.state===s.joined}},{key:"isJoining",value:function(){return this.state===s.joining}},{key:"isLeaving",value:function(){return this.state===s.leaving}}]),t}(),d={encode:function(t,n){var e=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(e))},decode:function(t,n){var r=JSON.parse(t),i=e(r,5),o=i[0],u=i[1],s=i[2],c=i[3],a=i[4];return n({join_ref:o,ref:u,topic:s,event:c,payload:a})}},v=(t.Socket=function(){function t(n){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=r.timeout||u,this.transport=r.transport||window.WebSocket||v,this.defaultEncoder=d.encode,this.defaultDecoder=d.decode,this.transport!==v?(this.encode=r.encode||this.defaultEncoder,this.decode=r.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder),this.heartbeatIntervalMs=r.heartbeatIntervalMs||3e4,this.reconnectAfterMs=r.reconnectAfterMs||function(t){return[1e3,2e3,5e3,1e4][t-1]||1e4},this.logger=r.logger||function(){},this.longpollerTimeout=r.longpollerTimeout||2e4,this.params=r.params||{},this.endPoint=n+"/"+f.websocket,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new b(function(){e.disconnect(function(){return e.connect()})},this.reconnectAfterMs)}return r(t,[{key:"protocol",value:function(){return location.protocol.match(/^https/)?"wss":"ws"}},{key:"endPointURL",value:function(){var t=p.appendParams(p.appendParams(this.endPoint,this.params),{vsn:"2.0.0"});return"/"!==t.charAt(0)?t:"/"===t.charAt(1)?this.protocol()+":"+t:this.protocol()+"://"+location.host+t}},{key:"disconnect",value:function(t,n,e){this.conn&&(this.conn.onclose=function(){},n?this.conn.close(n,e||""):this.conn.close(),this.conn=null),t&&t()}},{key:"connect",value:function(t){var n=this;t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=t),this.conn||(this.conn=new this.transport(this.endPointURL()),this.conn.timeout=this.longpollerTimeout,this.conn.onopen=function(){return n.onConnOpen()},this.conn.onerror=function(t){return n.onConnError(t)},this.conn.onmessage=function(t){return n.onConnMessage(t)},this.conn.onclose=function(t){return n.onConnClose(t)})}},{key:"log",value:function(t,n,e){this.logger(t,n,e)}},{key:"onOpen",value:function(t){this.stateChangeCallbacks.open.push(t)}},{key:"onClose",value:function(t){this.stateChangeCallbacks.close.push(t)}},{key:"onError",value:function(t){this.stateChangeCallbacks.error.push(t)}},{key:"onMessage",value:function(t){this.stateChangeCallbacks.message.push(t)}},{key:"onConnOpen",value:function(){var t=this;this.log("transport","connected to "+this.endPointURL()),this.flushSendBuffer(),this.reconnectTimer.reset(),this.conn.skipHeartbeat||(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(function(){return t.sendHeartbeat()},this.heartbeatIntervalMs)),this.stateChangeCallbacks.open.forEach(function(t){return t()})}},{key:"onConnClose",value:function(t){this.log("transport","close",t),this.triggerChanError(),clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(function(n){return n(t)})}},{key:"onConnError",value:function(t){this.log("transport",t),this.triggerChanError(),this.stateChangeCallbacks.error.forEach(function(n){return n(t)})}},{key:"triggerChanError",value:function(){this.channels.forEach(function(t){return t.trigger(c.error)})}},{key:"connectionState",value:function(){switch(this.conn&&this.conn.readyState){case o.connecting:return"connecting";case o.open:return"open";case o.closing:return"closing";default:return"closed"}}},{key:"isConnected",value:function(){return"open"===this.connectionState()}},{key:"remove",value:function(t){this.channels=this.channels.filter(function(n){return n.joinRef()!==t.joinRef()})}},{key:"channel",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=new h(t,n,this);return this.channels.push(e),e}},{key:"push",value:function(t){var n=this,e=t.topic,r=t.event,i=t.payload,o=t.ref,u=t.join_ref,s=function(){n.encode(t,function(t){n.conn.send(t)})};this.log("push",e+" "+r+" ("+u+", "+o+")",i),this.isConnected()?s():this.sendBuffer.push(s)}},{key:"makeRef",value:function(){var t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}},{key:"sendHeartbeat",value:function(){if(this.isConnected()){if(this.pendingHeartbeatRef)return this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),void this.conn.close(1e3,"hearbeat timeout");this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef})}}},{key:"flushSendBuffer",value:function(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(function(t){return t()}),this.sendBuffer=[])}},{key:"onConnMessage",value:function(t){var n=this;this.decode(t.data,function(t){var e=t.topic,r=t.event,i=t.payload,o=t.ref,u=t.join_ref;o&&o===n.pendingHeartbeatRef&&(n.pendingHeartbeatRef=null),n.log("receive",(i.status||"")+" "+e+" "+r+" "+(o&&"("+o+")"||""),i),n.channels.filter(function(t){return t.isMember(e,r,i,u)}).forEach(function(t){return t.trigger(r,i,o,u)}),n.stateChangeCallbacks.message.forEach(function(n){return n(t)})})}}]),t}(),t.LongPoll=function(){function t(n){i(this,t),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(n),this.readyState=o.connecting,this.poll()}return r(t,[{key:"normalizeEndpoint",value:function(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+f.websocket),"$1/"+f.longpoll)}},{key:"endpointURL",value:function(){return p.appendParams(this.pollEndpoint,{token:this.token})}},{key:"closeAndRetry",value:function(){this.close(),this.readyState=o.connecting}},{key:"ontimeout",value:function(){this.onerror("timeout"),this.closeAndRetry()}},{key:"poll",value:function(){var t=this;this.readyState!==o.open&&this.readyState!==o.connecting||p.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),function(n){if(n){var e=n.status,r=n.token,i=n.messages;t.token=r}else var e=0;switch(e){case 200:i.forEach(function(n){return t.onmessage({data:n})}),t.poll();break;case 204:t.poll();break;case 410:t.readyState=o.open,t.onopen(),t.poll();break;case 0:case 500:t.onerror(),t.closeAndRetry();break;default:throw"unhandled poll status "+e}})}},{key:"send",value:function(t){var n=this;p.request("POST",this.endpointURL(),"application/json",t,this.timeout,this.onerror.bind(this,"timeout"),function(t){t&&200===t.status||(n.onerror(t&&t.status),n.closeAndRetry())})}},{key:"close",value:function(t,n){this.readyState=o.closed,this.onclose()}}]),t}()),p=t.Ajax=function(){function t(){i(this,t)}return r(t,null,[{key:"request",value:function(t,n,e,r,i,o,u){if(window.XDomainRequest){var s=new XDomainRequest;this.xdomainRequest(s,t,n,r,i,o,u)}else{var c=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");this.xhrRequest(c,t,n,e,r,i,o,u)}}},{key:"xdomainRequest",value:function(t,n,e,r,i,o,u){var s=this;t.timeout=i,t.open(n,e),t.onload=function(){var n=s.parseJSON(t.responseText);u&&u(n)},o&&(t.ontimeout=o),t.onprogress=function(){},t.send(r)}},{key:"xhrRequest",value:function(t,n,e,r,i,o,u,s){var c=this;t.open(n,e,!0),t.timeout=o,t.setRequestHeader("Content-Type",r),t.onerror=function(){s&&s(null)},t.onreadystatechange=function(){if(t.readyState===c.states.complete&&s){var n=c.parseJSON(t.responseText);s(n)}},u&&(t.ontimeout=u),t.send(i)}},{key:"parseJSON",value:function(t){if(!t||""===t)return null;try{return JSON.parse(t)}catch(n){return console&&console.log("failed to parse JSON response",t),null}}},{key:"serialize",value:function(t,e){var r=[];for(var i in t)if(t.hasOwnProperty(i)){var o=e?e+"["+i+"]":i,u=t[i];"object"===(void 0===u?"undefined":n(u))?r.push(this.serialize(u,o)):r.push(encodeURIComponent(o)+"="+encodeURIComponent(u))}return r.join("&")}},{key:"appendParams",value:function(t,n){if(0===Object.keys(n).length)return t;var e=t.match(/\?/)?"&":"?";return""+t+e+this.serialize(n)}}]),t}();p.states={complete:4},t.Presence={syncState:function(t,n,e,r){var i=this,o=this.clone(t),u={},s={};return this.map(o,function(t,e){n[t]||(s[t]=e)}),this.map(n,function(t,n){var e=o[t];if(e){var r=n.metas.map(function(t){return t.phx_ref}),c=e.metas.map(function(t){return t.phx_ref}),a=n.metas.filter(function(t){return c.indexOf(t.phx_ref)<0}),f=e.metas.filter(function(t){return r.indexOf(t.phx_ref)<0});a.length>0&&(u[t]=n,u[t].metas=a),f.length>0&&(s[t]=i.clone(e),s[t].metas=f)}else u[t]=n}),this.syncDiff(o,{joins:u,leaves:s},e,r)},syncDiff:function(t,n,e,r){var i=n.joins,o=n.leaves,u=this.clone(t);return e||(e=function(){}),r||(r=function(){}),this.map(i,function(t,n){var r=u[t];if(u[t]=n,r){var i;(i=u[t].metas).unshift.apply(i,function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)}(r.metas))}e(t,r,n)}),this.map(o,function(t,n){var e=u[t];if(e){var i=n.metas.map(function(t){return t.phx_ref});e.metas=e.metas.filter(function(t){return i.indexOf(t.phx_ref)<0}),r(t,e,n),0===e.metas.length&&delete u[t]}}),u},list:function(t,n){return n||(n=function(t,n){return n}),this.map(t,function(t,e){return n(t,e)})},map:function(t,n){return Object.getOwnPropertyNames(t).map(function(e){return n(e,t[e])})},clone:function(t){return JSON.parse(JSON.stringify(t))}};var b=function(){function t(n,e){i(this,t),this.callback=n,this.timerCalc=e,this.timer=null,this.tries=0}return r(t,[{key:"reset",value:function(){this.tries=0,clearTimeout(this.timer)}},{key:"scheduleTimeout",value:function(){var t=this;clearTimeout(this.timer),this.timer=setTimeout(function(){t.tries=t.tries+1,t.callback()},this.timerCalc(this.tries+1))}}]),t}()}(n)});n(Qe);Qe.Ajax,Qe.Channel,Qe.LongPoll,Qe.Presence,Qe.Socket;var $e=function(t,n){return r(this,void 0),t.receive("ok",n.onSucceed).receive("error",n.onError).receive("timeout",n.onTimeout)}.bind(void 0),Ze=function(t,n){return r(this,void 0),function(e){return r(this,void 0),e[t]&&e[t](n)}.bind(this)}.bind(void 0),tr=function(t){return r(this,void 0),"on"+String(t)}.bind(void 0),nr=function(t,n,e){return r(this,void 0),t.observers.forEach(Ze(tr(n),e))}.bind(void 0),er=function(t,n,e){return r(this,void 0),t.findIndex(xe([n],e))}.bind(void 0),rr=function(t){return r(this,void 0),function(n){return r(this,void 0),sn(er(n,"request",t.request),1,n)}.bind(this)}.bind(void 0),ir=function(t,n){return r(this,void 0),t.notifiers=n(t.notifiers),t}.bind(void 0),or=function(t,n){r(this,void 0),ir(t,rr(n)),nr(n,"Cancel",n)}.bind(void 0),ur={onError:function(t,n,e){r(this,void 0),sr(t,n),nr(n,"Error","unsubscribe: "+String(e))}.bind(void 0),onTimeout:function(t,n){return r(this,void 0),nr(n,"Error","unsubscribe: timeout")}.bind(void 0),onSucceed:or},sr=function(t,n){return r(this,void 0),$e(t.channel.push("unsubscribe",{subscriptionId:n.subscriptionId}),Ye(ur,t,n.request))}.bind(void 0),cr=function(t,n){return r(this,void 0),"subscription"===n.operationType?sr(t,n):or(t,n),t}.bind(void 0),ar=function(t,n,e){return r(this,void 0),t.forEach(function(t){return r(this,void 0),nr(t,n,e)}.bind(this))}.bind(void 0),fr=function(t){return r(this,void 0),t.map(function(t){var n=t.column,e=t.line;return r(this,void 0),String(e)+":"+String(n)}.bind(this)).join("; ")}.bind(void 0),lr=function(t){var n=t.message,e=t.locations;return r(this,void 0),n+(e?" ("+String(fr(e))+")":"")}.bind(void 0),hr=function(t){return r(this,void 0),t.map(lr).join("\n")}.bind(void 0),dr=/^\s*(query|mutation|subscription|\{)/,vr=function(t){return r(this,void 0),"{"===t?"query":t}.bind(void 0),pr=function(t){r(this,void 0);var n=t.match(dr);if(!n)throw new TypeError("Invalid operation:\n"+String(t));return vr(n[1])}.bind(void 0),br=function(t){return r(this,void 0),"OperationDefinition"===t.kind&&"subscription"===t.operation}.bind(void 0),yr=(function(t){return r(this,void 0),t.definitions.some(br)}.bind(void 0),function(t){var n=t.query,e=t.variables;return r(this,void 0),e?{operation:n,variables:e}:{operation:n}}.bind(void 0),function(t){var n=t.operation,e=t.variables;return r(this,void 0),e?{query:n,variables:e}:{query:n}}.bind(void 0)),mr=function(t){return r(this,void 0),function(n){return r(this,void 0),cn(er(n,"request",t.request),[t],n)}.bind(this)}.bind(void 0),gr=function(t){return r(this,void 0),nr(t,"Start",t)}.bind(void 0),wr=function(t,n,e){var i=e.subscriptionId;r(this,void 0);var o=Xt({},n,{subscriptionId:i});ir(t,mr(o)),gr(o)}.bind(void 0),kr=function(t,n,e){r(this,void 0),ir(t,rr(n)),nr(n,"Abort",e)}.bind(void 0),jr=function(t,n,e){return r(this,void 0),kr(t,n,new Error(e))}.bind(void 0),Or=function(t,n,e){r(this,void 0),e.errors?jr(t,n,hr(e.errors)):wr(t,n,e)}.bind(void 0),Sr=function(t,n,e){r(this,void 0),ir(t,rr(n)),nr(n,"Result",e)}.bind(void 0),_r=function(t,n){return r(this,void 0),nr(n,"Error",new Error("request: timeout"))}.bind(void 0),Er={onError:jr,onTimeout:_r,onSucceed:Sr},Tr={onError:jr,onTimeout:_r,onSucceed:Or},xr=function(t,n,e){return r(this,void 0),$e(t.channel.push("doc",yr(n)),Ye(e,t,n))}.bind(void 0),Ar=function(t,n){r(this,void 0),"subscription"===n.operationType?xr(t,n.request,Tr):(gr(n),xr(t,n.request,Er))}.bind(void 0),Pr=function(t){return r(this,void 0),{onError:function(n){return r(this,void 0),ar(t.notifiers,"Error",new Error("channel join: "+String(n)))}.bind(this),onSucceed:function(){return r(this,void 0),t.notifiers.forEach(function(n){return r(this,void 0),Ar(t,n)}.bind(this))}.bind(this),onTimeout:function(){return r(this,void 0),ar(t.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),Cr=function(t){return r(this,void 0),$e(t.channel.join(),Pr(t)),t.channelJoinCreated=!0,t}.bind(void 0),Mr=function(){return r(this,void 0),new Error("connection: close")}.bind(void 0),Rr=function(t,n){r(this,void 0),ir(t,rr(n)),nr(n,"Abort",Mr())}.bind(void 0),Lr=function(t){return r(this,void 0),function(n){r(this,void 0),"mutation"===n.operationType?Rr(t,n):nr(n,"Error",Mr())}.bind(this)}.bind(void 0),Ir=function(t){return r(this,void 0),function(){return r(this,void 0),t.notifiers.forEach(Lr(t))}.bind(this)}.bind(void 0),Nr=function(t,n){var e=n.payload;r(this,void 0);var i=Xe(t.notifiers,"subscriptionId",e.subscriptionId);i&&nr(i,"Result",e.result)}.bind(void 0),qr=function(t){return r(this,void 0),function(n){r(this,void 0),"subscription:data"===n.event&&Nr(t,n)}.bind(this)}.bind(void 0),Jr=function(t){return r(this,void 0),!t.channelJoinCreated&&t.notifiers.length>0}.bind(void 0),Fr=function(t){return r(this,void 0),function(){r(this,void 0),Jr(t)&&Cr(t)}.bind(this)}.bind(void 0),Hr=function(t){r(this,void 0);var n={phoenixSocket:t,channel:t.channel("__absinthe__:control"),channelJoinCreated:!1,notifiers:[]};return t.onOpen(Fr(n)),t.onMessage(qr(n)),t.onClose(Ir(n)),n}.bind(void 0),Dr=function(t,n){r(this,void 0);var e=t.observers,i=tn(t,["observers"]);return Xt({},i,{observers:[].concat(Ft(e),[n])})}.bind(void 0),Br=function(t,n,e){return r(this,void 0),ir(t,mr(Dr(n,e)))}.bind(void 0),Ur=function(t){return r(this,void 0),{request:t,observers:[],operationType:pr(t.operation),subscriptionId:void 0}}.bind(void 0),Gr=function(t){r(this,void 0),t.phoenixSocket.isConnected()?Cr(t):t.phoenixSocket.connect()}.bind(void 0),zr=function(t,n){r(this,void 0);var e=Ur(n);return ir(t,nn([e])),t.channelJoinCreated?Ar(t,e):Gr(t),e}.bind(void 0),Wr=function(t,n){return r(this,void 0),Xe(t.notifiers,"request",n)||zr(t,n)}.bind(void 0),Vr=e(function(t,n){!function(t,n){function e(t){return"function"==typeof Symbol&&Boolean(Symbol[t])}function r(t){return e(t)?Symbol[t]:"@@"+t}"function"!=typeof Symbol||Symbol.observable||(Symbol.observable=Symbol("observable"));function i(t,n){var e=t[n];if(null!=e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}}function o(t){var n=t.constructor;return void 0!==n&&null===(n=n[r("species")])&&(n=void 0),void 0!==n?n:l}function u(t,n){Object.keys(n).forEach(function(e){var r=Object.getOwnPropertyDescriptor(n,e);r.enumerable=!1,Object.defineProperty(t,e,r)})}function s(t){var n=t._cleanup;n&&(t._cleanup=void 0,n())}function c(t){return void 0===t._observer}function a(t,n){if(Object(t)!==t)throw new TypeError("Observer must be an object");this._cleanup=void 0,this._observer=t;var e=i(t,"start");if(e&&e.call(t,this),!c(this)){t=new f(this);try{var r=n.call(void 0,t);if(null!=r){if("function"==typeof r.unsubscribe)o=r,r=function(){o.unsubscribe()};else if("function"!=typeof r)throw new TypeError(r+" is not a function");this._cleanup=r}}catch(n){return void t.error(n)}var o;c(this)&&s(this)}}u(a.prototype={},{get closed(){return c(this)},unsubscribe:function(){!function(t){c(t)||(t._observer=void 0,s(t))}(this)}});function f(t){this._subscription=t}u(f.prototype={},{get closed(){return c(this._subscription)},next:function(t){var n=this._subscription;if(!c(n)){var e=n._observer,r=i(e,"next");if(r)return r.call(e,t)}},error:function(t){var n=this._subscription;if(c(n))throw t;var e=n._observer;n._observer=void 0;try{var r=i(e,"error");if(!r)throw t;t=r.call(e,t)}catch(t){try{s(n)}finally{throw t}}return s(n),t},complete:function(t){var n=this._subscription;if(!c(n)){var e=n._observer;n._observer=void 0;try{var r=i(e,"complete");t=r?r.call(e,t):void 0}catch(t){try{s(n)}finally{throw t}}return s(n),t}}});function l(t){if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}u(l.prototype,{subscribe:function(t){for(var n=[],e=1;e<arguments.length;++e)n.push(arguments[e]);return"function"==typeof t&&(t={next:t,error:n[0],complete:n[1]}),new a(t,this._subscriber)},forEach:function(t){var n=this;return new Promise(function(e,r){if("function"!=typeof t)return Promise.reject(new TypeError(t+" is not a function"));n.subscribe({_subscription:null,start:function(t){if(Object(t)!==t)throw new TypeError(t+" is not an object");this._subscription=t},next:function(n){var e=this._subscription;if(!e.closed)try{return t(n)}catch(t){r(t),e.unsubscribe()}},error:r,complete:e})})},map:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=o(this);return new e(function(e){return n.subscribe({next:function(n){if(!e.closed){try{n=t(n)}catch(t){return e.error(t)}return e.next(n)}},error:function(t){return e.error(t)},complete:function(t){return e.complete(t)}})})},filter:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=o(this);return new e(function(e){return n.subscribe({next:function(n){if(!e.closed){try{if(!t(n))return}catch(t){return e.error(t)}return e.next(n)}},error:function(t){return e.error(t)},complete:function(){return e.complete()}})})},reduce:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=o(this),r=arguments.length>1,i=!1,u=arguments[1],s=u;return new e(function(e){return n.subscribe({next:function(n){if(!e.closed){var o=!i;if(i=!0,!o||r)try{s=t(s,n)}catch(t){return e.error(t)}else s=n}},error:function(t){e.error(t)},complete:function(){i||r?(e.next(s),e.complete()):e.error(new TypeError("Cannot reduce an empty sequence"))}})})},flatMap:function(t){var n=this;if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=o(this);return new e(function(e){var r=!1,i=[],o=n.subscribe({next:function(n){if(t)try{n=t(n)}catch(t){return void e.error(t)}l.from(n).subscribe({_subscription:null,start:function(t){i.push(this._subscription=t)},next:function(t){e.next(t)},error:function(t){e.error(t)},complete:function(){var t=i.indexOf(this._subscription);t>=0&&i.splice(t,1),u()}})},error:function(t){return e.error(t)},complete:function(){r=!0,u()}});function u(){r&&0===i.length&&e.complete()}return function(){i.forEach(function(t){return t.unsubscribe()}),o.unsubscribe()}})}}),Object.defineProperty(l.prototype,r("observable"),{value:function(){return this},writable:!0,configurable:!0}),u(l,{from:function(t){var n="function"==typeof this?this:l;if(null==t)throw new TypeError(t+" is not an object");var o=i(t,r("observable"));if(o){var u=o.call(t);if(Object(u)!==u)throw new TypeError(u+" is not an object");return u.constructor===n?u:new n(function(t){return u.subscribe(t)})}if(e("iterator")&&(o=i(t,r("iterator"))))return new n(function(n){for(var e,r=o.call(t)[Symbol.iterator]();e=r.next(),!e.done;){var i=e.value;if(n.next(i),n.closed)return}n.complete()});if(Array.isArray(t))return new n(function(n){for(var e=0;e<t.length;++e)if(n.next(t[e]),n.closed)return;n.complete()});throw new TypeError(t+" is not observable")},of:function(){for(var t=[],n=0;n<arguments.length;++n)t.push(arguments[n]);var e="function"==typeof this?this:l;return new e(function(n){for(var e=0;e<t.length;++e)if(n.next(t[e]),n.closed)return;n.complete()})}}),Object.defineProperty(l,r("species"),{get:function(){return this},configurable:!0}),t.Observable=l}(n)}).Observable,Xr=function(t,n){return r(this,void 0),function(e){r(this,void 0),n.next(e),"subscription"!==t.operationType&&n.complete()}.bind(this)}.bind(void 0),Kr=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e.onError,o=e.onStart,u=e.unsubscribe;return r(this,void 0),new Vr(function(e){return r(this,void 0),Br(t,n,{onError:i,onStart:o,onAbort:e.error,onResult:Xr(n,e)}),u}.bind(this))}.bind(void 0),Yr=function(t,n){r(this,void 0);var e=t.observers,i=tn(t,["observers"]);return Xt({},i,{observers:sn(e.indexOf(n),1,e)})}.bind(void 0),Qr=function(t,n,e){return r(this,void 0),ir(t,mr(Yr(n,e))),t}.bind(void 0);t.cancel=cr,t.create=Hr,t.observe=Br,t.send=Wr,t.toObservable=Kr,t.unobserve=Qr,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=index.js.map

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

import _extends from"babel-runtime/helpers/extends";import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{remove,replace}from"@jumpn/utils-array";import{hasIn,map}from"@jumpn/utils-composite";import"phoenix";var _this$2=void 0,findIndex=function(i,e,n){return _newArrowCheck(this,_this$2),i.findIndex(hasIn([e],n))}.bind(void 0),_this$1=void 0,refresh=function(i){return _newArrowCheck(this,_this$1),function(e){return _newArrowCheck(this,_this$1),replace(findIndex(e,"request",i.request),[i],e)}.bind(this)}.bind(void 0),_this$4=void 0,getNotifier=function(i,e){return _newArrowCheck(this,_this$4),function(n){return _newArrowCheck(this,_this$4),n[i]&&n[i](e)}.bind(this)}.bind(void 0),getHandlerName=function(i){return _newArrowCheck(this,_this$4),"on"+String(i)}.bind(void 0),notify=function(i,e,n){return _newArrowCheck(this,_this$4),i.observers.forEach(getNotifier(getHandlerName(e),n))}.bind(void 0),_this$5=void 0,remove$1=function(i){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),remove(findIndex(e,"request",i.request),1,e)}.bind(this)}.bind(void 0),_this$6=void 0,updateNotifiers=function(i,e){return _newArrowCheck(this,_this$6),i.notifiers=e(i.notifiers),i}.bind(void 0),_this$3=void 0,cancelNotifier=function(i,e){_newArrowCheck(this,_this$3),updateNotifiers(i,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),_this$9=void 0,find=function(i,e,n){return _newArrowCheck(this,_this$9),i.find(hasIn([e],n))}.bind(void 0),_this$8=void 0,createEventHandler=function(i,e){return _newArrowCheck(this,_this$8),function(n){return _newArrowCheck(this,_this$8),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$8);var s=find(i.notifiers,"request",e);s&&n.apply(void 0,[i,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(i,e,n){return _newArrowCheck(this,_this$8),map(createEventHandler(e,n),i)}.bind(void 0),_this$10=void 0,handlePush=function(i,e){return _newArrowCheck(this,_this$10),i.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$7=void 0,onError=function(i,e,n){_newArrowCheck(this,_this$7),unsubscribe(i,e),notify(e,"Error","unsubscribe: "+String(n))}.bind(void 0),onTimeout=function(i,e){return _newArrowCheck(this,_this$7),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:cancelNotifier},unsubscribe=function(i,e){return _newArrowCheck(this,_this$7),handlePush(i.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,i,e.request))}.bind(void 0),_this=void 0,cancelSubscription=function(i,e){_newArrowCheck(this,_this),updateNotifiers(i,refresh(_extends({},e,{cancelled:!0}))),e.subscriptionId&&unsubscribe(i,e)}.bind(void 0),cancel=function(i,e){return _newArrowCheck(this,_this),"subscription"===e.operationType?cancelSubscription(i,e):cancelNotifier(i,e),i}.bind(void 0);export default cancel;
import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{hasIn,map}from"@jumpn/utils-composite";import"phoenix";import{remove}from"@jumpn/utils-array";var _this$2=void 0,find=function(i,e,r){return _newArrowCheck(this,_this$2),i.find(hasIn([e],r))}.bind(void 0),_this$1=void 0,createEventHandler=function(i,e){return _newArrowCheck(this,_this$1),function(r){return _newArrowCheck(this,_this$1),function(){for(var n=arguments.length,t=Array(n),o=0;o<n;o++)t[o]=arguments[o];_newArrowCheck(this,_this$1);var s=find(i.notifiers,"request",e);s&&r.apply(void 0,[i,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(i,e,r){return _newArrowCheck(this,_this$1),map(createEventHandler(e,r),i)}.bind(void 0),_this$3=void 0,handlePush=function(i,e){return _newArrowCheck(this,_this$3),i.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(i,e){return _newArrowCheck(this,_this$4),function(r){return _newArrowCheck(this,_this$4),r[i]&&r[i](e)}.bind(this)}.bind(void 0),getHandlerName=function(i){return _newArrowCheck(this,_this$4),"on"+String(i)}.bind(void 0),notify=function(i,e,r){return _newArrowCheck(this,_this$4),i.observers.forEach(getNotifier(getHandlerName(e),r))}.bind(void 0),_this$6=void 0,findIndex=function(i,e,r){return _newArrowCheck(this,_this$6),i.findIndex(hasIn([e],r))}.bind(void 0),_this$5=void 0,remove$1=function(i){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),remove(findIndex(e,"request",i.request),1,e)}.bind(this)}.bind(void 0),_this$7=void 0,updateNotifiers=function(i,e){return _newArrowCheck(this,_this$7),i.notifiers=e(i.notifiers),i}.bind(void 0),_this=void 0,removeNotifiers=function(i,e){_newArrowCheck(this,_this),updateNotifiers(i,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),onError=function(i,e,r){_newArrowCheck(this,_this),unsubscribe(i,e),notify(e,"Error","unsubscribe: "+String(r))}.bind(void 0),onTimeout=function(i,e){return _newArrowCheck(this,_this),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:removeNotifiers},unsubscribe=function(i,e){return _newArrowCheck(this,_this),handlePush(i.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,i,e.request))}.bind(void 0),cancel=function(i,e){return _newArrowCheck(this,_this),"subscription"===e.operationType?unsubscribe(i,e):removeNotifiers(i,e),i}.bind(void 0);export default cancel;
//# sourceMappingURL=cancel.js.map

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

import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import"phoenix";import _extends from"babel-runtime/helpers/extends";import{errorsToString,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";import{remove,replace}from"@jumpn/utils-array";var _this$2=void 0,handlePush=function(n,i){return _newArrowCheck(this,_this$2),n.receive("ok",i.onSucceed).receive("error",i.onError).receive("timeout",i.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(n,i){return _newArrowCheck(this,_this$4),function(e){return _newArrowCheck(this,_this$4),e[n]&&e[n](i)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,i,e){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(i),e))}.bind(void 0),_this$3=void 0,notifyall=function(n,i,e){return _newArrowCheck(this,_this$3),n.forEach(function(n){return _newArrowCheck(this,_this$3),notify(n,i,e)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(n,i,e){return _newArrowCheck(this,_this$7),n.find(hasIn([i],e))}.bind(void 0),_this$6=void 0,createEventHandler=function(n,i){return _newArrowCheck(this,_this$6),function(e){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(n.notifiers,"request",i);s&&e.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,i,e){return _newArrowCheck(this,_this$6),map(createEventHandler(i,e),n)}.bind(void 0),_this$9=void 0,findIndex=function(n,i,e){return _newArrowCheck(this,_this$9),n.findIndex(hasIn([i],e))}.bind(void 0),_this$8=void 0,remove$1=function(n){return _newArrowCheck(this,_this$8),function(i){return _newArrowCheck(this,_this$8),remove(findIndex(i,"request",n.request),1,i)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(n){return _newArrowCheck(this,_this$10),function(i){return _newArrowCheck(this,_this$10),replace(findIndex(i,"request",n.request),[n],i)}.bind(this)}.bind(void 0),_this$13=void 0,updateNotifiers=function(n,i){return _newArrowCheck(this,_this$13),n.notifiers=i(n.notifiers),n}.bind(void 0),_this$12=void 0,cancelNotifier=function(n,i){_newArrowCheck(this,_this$12),updateNotifiers(n,remove$1(i)),notify(i,"Cancel",i)}.bind(void 0),_this$11=void 0,onError$1=function(n,i,e){_newArrowCheck(this,_this$11),unsubscribe(n,i),notify(i,"Error","unsubscribe: "+String(e))}.bind(void 0),onTimeout$1=function(n,i){return _newArrowCheck(this,_this$11),notify(i,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(n,i){return _newArrowCheck(this,_this$11),handlePush(n.channel.push("unsubscribe",{subscriptionId:i.subscriptionId}),createPushHandler(notifierPushHandler,n,i.request))}.bind(void 0),_this$5=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$5),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,i,e){var r=e.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},i,{subscriptionId:r});updateNotifiers(n,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(n,t)}.bind(void 0),abortRequest=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Abort",e)}.bind(void 0),onError=function(n,i,e){return _newArrowCheck(this,_this$5),abortRequest(n,i,new Error(e))}.bind(void 0),onSubscriptionResponse=function(n,i,e){_newArrowCheck(this,_this$5),e.errors?onError(n,i,errorsToString(e.errors)):onSubscriptionSucceed(n,i,e)}.bind(void 0),onQueryOrMutationResponse=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Result",e)}.bind(void 0),onTimeout=function(n,i){return _newArrowCheck(this,_this$5),notify(i,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(n,i,e){return _newArrowCheck(this,_this$5),handlePush(n.channel.push("doc",requestToCompat(i)),createPushHandler(e,n,i))}.bind(void 0),pushRequest=function(n,i){_newArrowCheck(this,_this$5),"subscription"===i.operationType?send(n,i.request,subcriptionHandler):(notifyStart(i),send(n,i.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$1),{onError:function(i){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: "+String(i)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),n.notifiers.forEach(function(i){return _newArrowCheck(this,_this$1),pushRequest(n,i)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$1),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(n,i){_newArrowCheck(this,_this),updateNotifiers(n,remove$1(i)),notify(i,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"mutation"===i.operationType?mutationOnConnectionClose(n,i):notify(i,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(n){return _newArrowCheck(this,_this),function(){return _newArrowCheck(this,_this),n.notifiers.forEach(notifierOnConnectionClose(n))}.bind(this)}.bind(void 0),onSubscriptionData=function(n,i){var e=i.payload;_newArrowCheck(this,_this);var r=find(n.notifiers,"subscriptionId",e.subscriptionId);r&&notify(r,"Result",e.result)}.bind(void 0),onMessage=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"subscription:data"===i.event&&onSubscriptionData(n,i)}.bind(this)}.bind(void 0),shouldJoinChannel=function(n){return _newArrowCheck(this,_this),!n.channelJoinCreated&&n.notifiers.length>0}.bind(void 0),onConnectionOpen=function(n){return _newArrowCheck(this,_this),function(){_newArrowCheck(this,_this),shouldJoinChannel(n)&&joinChannel(n)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(n){_newArrowCheck(this,_this);var i={phoenixSocket:n,channel:n.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return n.onOpen(onConnectionOpen(i)),n.onMessage(onMessage(i)),n.onClose(onConnectionClose(i)),i}.bind(void 0);export default create;
import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import"phoenix";import _extends from"babel-runtime/helpers/extends";import{errorsToString,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";import{remove,replace}from"@jumpn/utils-array";var _this$2=void 0,handlePush=function(n,i){return _newArrowCheck(this,_this$2),n.receive("ok",i.onSucceed).receive("error",i.onError).receive("timeout",i.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(n,i){return _newArrowCheck(this,_this$4),function(e){return _newArrowCheck(this,_this$4),e[n]&&e[n](i)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,i,e){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(i),e))}.bind(void 0),_this$3=void 0,notifyall=function(n,i,e){return _newArrowCheck(this,_this$3),n.forEach(function(n){return _newArrowCheck(this,_this$3),notify(n,i,e)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(n,i,e){return _newArrowCheck(this,_this$7),n.find(hasIn([i],e))}.bind(void 0),_this$6=void 0,createEventHandler=function(n,i){return _newArrowCheck(this,_this$6),function(e){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(n.notifiers,"request",i);s&&e.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,i,e){return _newArrowCheck(this,_this$6),map(createEventHandler(i,e),n)}.bind(void 0),_this$9=void 0,findIndex=function(n,i,e){return _newArrowCheck(this,_this$9),n.findIndex(hasIn([i],e))}.bind(void 0),_this$8=void 0,remove$1=function(n){return _newArrowCheck(this,_this$8),function(i){return _newArrowCheck(this,_this$8),remove(findIndex(i,"request",n.request),1,i)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(n){return _newArrowCheck(this,_this$10),function(i){return _newArrowCheck(this,_this$10),replace(findIndex(i,"request",n.request),[n],i)}.bind(this)}.bind(void 0),_this$11=void 0,updateNotifiers=function(n,i){return _newArrowCheck(this,_this$11),n.notifiers=i(n.notifiers),n}.bind(void 0),_this$5=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$5),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,i,e){var r=e.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},i,{subscriptionId:r});updateNotifiers(n,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Abort",e)}.bind(void 0),onError=function(n,i,e){return _newArrowCheck(this,_this$5),abortRequest(n,i,new Error(e))}.bind(void 0),onSubscriptionResponse=function(n,i,e){_newArrowCheck(this,_this$5),e.errors?onError(n,i,errorsToString(e.errors)):onSubscriptionSucceed(n,i,e)}.bind(void 0),onQueryOrMutationResponse=function(n,i,e){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(i)),notify(i,"Result",e)}.bind(void 0),onTimeout=function(n,i){return _newArrowCheck(this,_this$5),notify(i,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(n,i,e){return _newArrowCheck(this,_this$5),handlePush(n.channel.push("doc",requestToCompat(i)),createPushHandler(e,n,i))}.bind(void 0),pushRequest=function(n,i){_newArrowCheck(this,_this$5),"subscription"===i.operationType?send(n,i.request,subcriptionHandler):(notifyStart(i),send(n,i.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$1),{onError:function(i){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: "+String(i)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),n.notifiers.forEach(function(i){return _newArrowCheck(this,_this$1),pushRequest(n,i)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$1),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(n,i){_newArrowCheck(this,_this),updateNotifiers(n,remove$1(i)),notify(i,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"mutation"===i.operationType?mutationOnConnectionClose(n,i):notify(i,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(n){return _newArrowCheck(this,_this),function(){return _newArrowCheck(this,_this),n.notifiers.forEach(notifierOnConnectionClose(n))}.bind(this)}.bind(void 0),onSubscriptionData=function(n,i){var e=i.payload;_newArrowCheck(this,_this);var r=find(n.notifiers,"subscriptionId",e.subscriptionId);r&&notify(r,"Result",e.result)}.bind(void 0),onMessage=function(n){return _newArrowCheck(this,_this),function(i){_newArrowCheck(this,_this),"subscription:data"===i.event&&onSubscriptionData(n,i)}.bind(this)}.bind(void 0),shouldJoinChannel=function(n){return _newArrowCheck(this,_this),!n.channelJoinCreated&&n.notifiers.length>0}.bind(void 0),onConnectionOpen=function(n){return _newArrowCheck(this,_this),function(){_newArrowCheck(this,_this),shouldJoinChannel(n)&&joinChannel(n)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(n){_newArrowCheck(this,_this);var i={phoenixSocket:n,channel:n.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return n.onOpen(onConnectionOpen(i)),n.onMessage(onMessage(i)),n.onClose(onConnectionClose(i)),i}.bind(void 0);export default create;
//# sourceMappingURL=create.js.map

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

import _extends from"babel-runtime/helpers/extends";import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{append,remove,replace}from"@jumpn/utils-array";import{hasIn,map}from"@jumpn/utils-composite";import"phoenix";import{errorsToString,getOperationType,requestToCompat}from"@jumpn/utils-graphql";import _toConsumableArray from"babel-runtime/helpers/toConsumableArray";import _objectWithoutProperties from"babel-runtime/helpers/objectWithoutProperties";import Observable from"zen-observable";var _this$2=void 0,findIndex=function(n,e,i){return _newArrowCheck(this,_this$2),n.findIndex(hasIn([e],i))}.bind(void 0),_this$1=void 0,refresh=function(n){return _newArrowCheck(this,_this$1),function(e){return _newArrowCheck(this,_this$1),replace(findIndex(e,"request",n.request),[n],e)}.bind(this)}.bind(void 0),_this$4=void 0,getNotifier=function(n,e){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[n]&&i[n](e)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,e,i){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(e),i))}.bind(void 0),_this$5=void 0,remove$1=function(n){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),remove(findIndex(e,"request",n.request),1,e)}.bind(this)}.bind(void 0),_this$6=void 0,updateNotifiers=function(n,e){return _newArrowCheck(this,_this$6),n.notifiers=e(n.notifiers),n}.bind(void 0),_this$3=void 0,cancelNotifier=function(n,e){_newArrowCheck(this,_this$3),updateNotifiers(n,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),_this$9=void 0,find=function(n,e,i){return _newArrowCheck(this,_this$9),n.find(hasIn([e],i))}.bind(void 0),_this$8=void 0,createEventHandler=function(n,e){return _newArrowCheck(this,_this$8),function(i){return _newArrowCheck(this,_this$8),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$8);var s=find(n.notifiers,"request",e);s&&i.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,e,i){return _newArrowCheck(this,_this$8),map(createEventHandler(e,i),n)}.bind(void 0),_this$10=void 0,handlePush=function(n,e){return _newArrowCheck(this,_this$10),n.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$7=void 0,onError=function(n,e,i){_newArrowCheck(this,_this$7),unsubscribe(n,e),notify(e,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout=function(n,e){return _newArrowCheck(this,_this$7),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:cancelNotifier},unsubscribe=function(n,e){return _newArrowCheck(this,_this$7),handlePush(n.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,n,e.request))}.bind(void 0),_this=void 0,cancelSubscription=function(n,e){_newArrowCheck(this,_this),updateNotifiers(n,refresh(_extends({},e,{cancelled:!0}))),e.subscriptionId&&unsubscribe(n,e)}.bind(void 0),cancel=function(n,e){return _newArrowCheck(this,_this),"subscription"===e.operationType?cancelSubscription(n,e):cancelNotifier(n,e),n}.bind(void 0),_this$13=void 0,notifyall=function(n,e,i){return _newArrowCheck(this,_this$13),n.forEach(function(n){return _newArrowCheck(this,_this$13),notify(n,e,i)}.bind(this))}.bind(void 0),_this$14=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$14),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,e,i){var r=i.subscriptionId;_newArrowCheck(this,_this$14);var t=_extends({},e,{subscriptionId:r});updateNotifiers(n,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(n,t)}.bind(void 0),abortRequest=function(n,e,i){_newArrowCheck(this,_this$14),updateNotifiers(n,remove$1(e)),notify(e,"Abort",i)}.bind(void 0),onError$1=function(n,e,i){return _newArrowCheck(this,_this$14),abortRequest(n,e,new Error(i))}.bind(void 0),onSubscriptionResponse=function(n,e,i){_newArrowCheck(this,_this$14),i.errors?onError$1(n,e,errorsToString(i.errors)):onSubscriptionSucceed(n,e,i)}.bind(void 0),onQueryOrMutationResponse=function(n,e,i){_newArrowCheck(this,_this$14),updateNotifiers(n,remove$1(e)),notify(e,"Result",i)}.bind(void 0),onTimeout$1=function(n,e){return _newArrowCheck(this,_this$14),notify(e,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onSubscriptionResponse},send=function(n,e,i){return _newArrowCheck(this,_this$14),handlePush(n.channel.push("doc",requestToCompat(e)),createPushHandler(i,n,e))}.bind(void 0),pushRequest=function(n,e){_newArrowCheck(this,_this$14),"subscription"===e.operationType?send(n,e.request,subcriptionHandler):(notifyStart(e),send(n,e.request,queryOrMutationHandler))}.bind(void 0),_this$12=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$12),{onError:function(e){return _newArrowCheck(this,_this$12),notifyall(n.notifiers,"Error",new Error("channel join: "+String(e)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$12),n.notifiers.forEach(function(e){return _newArrowCheck(this,_this$12),pushRequest(n,e)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$12),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$12),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this$11=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this$11),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(n,e){_newArrowCheck(this,_this$11),updateNotifiers(n,remove$1(e)),notify(e,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(n){return _newArrowCheck(this,_this$11),function(e){_newArrowCheck(this,_this$11),"mutation"===e.operationType?mutationOnConnectionClose(n,e):notify(e,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(n){return _newArrowCheck(this,_this$11),function(){return _newArrowCheck(this,_this$11),n.notifiers.forEach(notifierOnConnectionClose(n))}.bind(this)}.bind(void 0),onSubscriptionData=function(n,e){var i=e.payload;_newArrowCheck(this,_this$11);var r=find(n.notifiers,"subscriptionId",i.subscriptionId);r&&notify(r,"Result",i.result)}.bind(void 0),onMessage=function(n){return _newArrowCheck(this,_this$11),function(e){_newArrowCheck(this,_this$11),"subscription:data"===e.event&&onSubscriptionData(n,e)}.bind(this)}.bind(void 0),shouldJoinChannel=function(n){return _newArrowCheck(this,_this$11),!n.channelJoinCreated&&n.notifiers.length>0}.bind(void 0),onConnectionOpen=function(n){return _newArrowCheck(this,_this$11),function(){_newArrowCheck(this,_this$11),shouldJoinChannel(n)&&joinChannel(n)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(n){_newArrowCheck(this,_this$11);var e={phoenixSocket:n,channel:n.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return n.onOpen(onConnectionOpen(e)),n.onMessage(onMessage(e)),n.onClose(onConnectionClose(e)),e}.bind(void 0),_this$16=void 0,observe$2=function(n,e){_newArrowCheck(this,_this$16);var i=n.observers,r=_objectWithoutProperties(n,["observers"]);return _extends({},r,{observers:[].concat(_toConsumableArray(i),[e])})}.bind(void 0),_this$15=void 0,observe=function(n,e,i){return _newArrowCheck(this,_this$15),updateNotifiers(n,refresh(observe$2(e,i)))}.bind(void 0),_this$18=void 0,create$2=function(n){return _newArrowCheck(this,_this$18),{request:n,cancelled:!1,observers:[],operationType:getOperationType(n.operation),subscriptionId:void 0}}.bind(void 0),_this$17=void 0,connectOrJoinChannel=function(n){_newArrowCheck(this,_this$17),n.phoenixSocket.isConnected()?joinChannel(n):n.phoenixSocket.connect()}.bind(void 0),sendNew=function(n,e){_newArrowCheck(this,_this$17);var i=create$2(e);return updateNotifiers(n,append([i])),n.channelJoinCreated?pushRequest(n,i):connectOrJoinChannel(n),i}.bind(void 0),uncancel=function(n,e){_newArrowCheck(this,_this$17);var i=e.prevStatus,r=_extends({},e,{status:i,prevStatus:e.status});return updateNotifiers(n,notifierRefresh(updateNotifiers)),r}.bind(void 0),uncancelIfNeeded=function(n,e){return _newArrowCheck(this,_this$17),"cancelling"===e.status?uncancel(n,e):e}.bind(void 0),send$1=function(n,e){_newArrowCheck(this,_this$17);var i=find(n.notifiers,"request",e);return i?uncancelIfNeeded(n,i):sendNew(n,e)}.bind(void 0),_this$19=void 0,onResult=function(n,e){return _newArrowCheck(this,_this$19),function(i){_newArrowCheck(this,_this$19),e.next(i),"subscription"!==n.operationType&&e.complete()}.bind(this)}.bind(void 0),toObservable=function(n,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.onError,t=i.onStart,o=i.unsubscribe;return _newArrowCheck(this,_this$19),new Observable(function(i){return _newArrowCheck(this,_this$19),observe(n,e,{onError:r,onStart:t,onAbort:i.error,onResult:onResult(e,i)}),o}.bind(this))}.bind(void 0),_this$21=void 0,unobserve$2=function(n,e){_newArrowCheck(this,_this$21);var i=n.observers,r=_objectWithoutProperties(n,["observers"]);return _extends({},r,{observers:remove(i.indexOf(e),1,i)})}.bind(void 0),_this$20=void 0,unobserve=function(n,e,i){return _newArrowCheck(this,_this$20),updateNotifiers(n,refresh(unobserve$2(e,i))),n}.bind(void 0);export{cancel,create,observe,send$1 as send,toObservable,unobserve};
import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{hasIn,map}from"@jumpn/utils-composite";import"phoenix";import{append,remove,replace}from"@jumpn/utils-array";import _extends from"babel-runtime/helpers/extends";import{errorsToString,getOperationType,requestToCompat}from"@jumpn/utils-graphql";import _toConsumableArray from"babel-runtime/helpers/toConsumableArray";import _objectWithoutProperties from"babel-runtime/helpers/objectWithoutProperties";import Observable from"zen-observable";var _this$2=void 0,find=function(n,e,i){return _newArrowCheck(this,_this$2),n.find(hasIn([e],i))}.bind(void 0),_this$1=void 0,createEventHandler=function(n,e){return _newArrowCheck(this,_this$1),function(i){return _newArrowCheck(this,_this$1),function(){for(var r=arguments.length,o=Array(r),t=0;t<r;t++)o[t]=arguments[t];_newArrowCheck(this,_this$1);var s=find(n.notifiers,"request",e);s&&i.apply(void 0,[n,s].concat(o))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,e,i){return _newArrowCheck(this,_this$1),map(createEventHandler(e,i),n)}.bind(void 0),_this$3=void 0,handlePush=function(n,e){return _newArrowCheck(this,_this$3),n.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(n,e){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[n]&&i[n](e)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,e,i){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(e),i))}.bind(void 0),_this$6=void 0,findIndex=function(n,e,i){return _newArrowCheck(this,_this$6),n.findIndex(hasIn([e],i))}.bind(void 0),_this$5=void 0,remove$1=function(n){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),remove(findIndex(e,"request",n.request),1,e)}.bind(this)}.bind(void 0),_this$7=void 0,updateNotifiers=function(n,e){return _newArrowCheck(this,_this$7),n.notifiers=e(n.notifiers),n}.bind(void 0),_this=void 0,removeNotifiers=function(n,e){_newArrowCheck(this,_this),updateNotifiers(n,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),onError=function(n,e,i){_newArrowCheck(this,_this),unsubscribe(n,e),notify(e,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout=function(n,e){return _newArrowCheck(this,_this),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError,onTimeout:onTimeout,onSucceed:removeNotifiers},unsubscribe=function(n,e){return _newArrowCheck(this,_this),handlePush(n.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,n,e.request))}.bind(void 0),cancel=function(n,e){return _newArrowCheck(this,_this),"subscription"===e.operationType?unsubscribe(n,e):removeNotifiers(n,e),n}.bind(void 0),_this$10=void 0,notifyall=function(n,e,i){return _newArrowCheck(this,_this$10),n.forEach(function(n){return _newArrowCheck(this,_this$10),notify(n,e,i)}.bind(this))}.bind(void 0),_this$12=void 0,refresh=function(n){return _newArrowCheck(this,_this$12),function(e){return _newArrowCheck(this,_this$12),replace(findIndex(e,"request",n.request),[n],e)}.bind(this)}.bind(void 0),_this$11=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$11),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,e,i){var r=i.subscriptionId;_newArrowCheck(this,_this$11);var o=_extends({},e,{subscriptionId:r});updateNotifiers(n,refresh(o)),notifyStart(o)}.bind(void 0),abortRequest=function(n,e,i){_newArrowCheck(this,_this$11),updateNotifiers(n,remove$1(e)),notify(e,"Abort",i)}.bind(void 0),onError$1=function(n,e,i){return _newArrowCheck(this,_this$11),abortRequest(n,e,new Error(i))}.bind(void 0),onSubscriptionResponse=function(n,e,i){_newArrowCheck(this,_this$11),i.errors?onError$1(n,e,errorsToString(i.errors)):onSubscriptionSucceed(n,e,i)}.bind(void 0),onQueryOrMutationResponse=function(n,e,i){_newArrowCheck(this,_this$11),updateNotifiers(n,remove$1(e)),notify(e,"Result",i)}.bind(void 0),onTimeout$1=function(n,e){return _newArrowCheck(this,_this$11),notify(e,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:onSubscriptionResponse},send=function(n,e,i){return _newArrowCheck(this,_this$11),handlePush(n.channel.push("doc",requestToCompat(e)),createPushHandler(i,n,e))}.bind(void 0),pushRequest=function(n,e){_newArrowCheck(this,_this$11),"subscription"===e.operationType?send(n,e.request,subcriptionHandler):(notifyStart(e),send(n,e.request,queryOrMutationHandler))}.bind(void 0),_this$9=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$9),{onError:function(e){return _newArrowCheck(this,_this$9),notifyall(n.notifiers,"Error",new Error("channel join: "+String(e)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$9),n.notifiers.forEach(function(e){return _newArrowCheck(this,_this$9),pushRequest(n,e)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$9),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$9),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this$8=void 0,createConnectionCloseError=function(){return _newArrowCheck(this,_this$8),new Error("connection: close")}.bind(void 0),mutationOnConnectionClose=function(n,e){_newArrowCheck(this,_this$8),updateNotifiers(n,remove$1(e)),notify(e,"Abort",createConnectionCloseError())}.bind(void 0),notifierOnConnectionClose=function(n){return _newArrowCheck(this,_this$8),function(e){_newArrowCheck(this,_this$8),"mutation"===e.operationType?mutationOnConnectionClose(n,e):notify(e,"Error",createConnectionCloseError())}.bind(this)}.bind(void 0),onConnectionClose=function(n){return _newArrowCheck(this,_this$8),function(){return _newArrowCheck(this,_this$8),n.notifiers.forEach(notifierOnConnectionClose(n))}.bind(this)}.bind(void 0),onSubscriptionData=function(n,e){var i=e.payload;_newArrowCheck(this,_this$8);var r=find(n.notifiers,"subscriptionId",i.subscriptionId);r&&notify(r,"Result",i.result)}.bind(void 0),onMessage=function(n){return _newArrowCheck(this,_this$8),function(e){_newArrowCheck(this,_this$8),"subscription:data"===e.event&&onSubscriptionData(n,e)}.bind(this)}.bind(void 0),shouldJoinChannel=function(n){return _newArrowCheck(this,_this$8),!n.channelJoinCreated&&n.notifiers.length>0}.bind(void 0),onConnectionOpen=function(n){return _newArrowCheck(this,_this$8),function(){_newArrowCheck(this,_this$8),shouldJoinChannel(n)&&joinChannel(n)}.bind(this)}.bind(void 0),absintheChannelName="__absinthe__:control",create=function(n){_newArrowCheck(this,_this$8);var e={phoenixSocket:n,channel:n.channel(absintheChannelName),channelJoinCreated:!1,notifiers:[]};return n.onOpen(onConnectionOpen(e)),n.onMessage(onMessage(e)),n.onClose(onConnectionClose(e)),e}.bind(void 0),_this$14=void 0,observe$2=function(n,e){_newArrowCheck(this,_this$14);var i=n.observers,r=_objectWithoutProperties(n,["observers"]);return _extends({},r,{observers:[].concat(_toConsumableArray(i),[e])})}.bind(void 0),_this$13=void 0,observe=function(n,e,i){return _newArrowCheck(this,_this$13),updateNotifiers(n,refresh(observe$2(e,i)))}.bind(void 0),_this$16=void 0,create$2=function(n){return _newArrowCheck(this,_this$16),{request:n,observers:[],operationType:getOperationType(n.operation),subscriptionId:void 0}}.bind(void 0),_this$15=void 0,connectOrJoinChannel=function(n){_newArrowCheck(this,_this$15),n.phoenixSocket.isConnected()?joinChannel(n):n.phoenixSocket.connect()}.bind(void 0),sendNew=function(n,e){_newArrowCheck(this,_this$15);var i=create$2(e);return updateNotifiers(n,append([i])),n.channelJoinCreated?pushRequest(n,i):connectOrJoinChannel(n),i}.bind(void 0),send$1=function(n,e){return _newArrowCheck(this,_this$15),find(n.notifiers,"request",e)||sendNew(n,e)}.bind(void 0),_this$17=void 0,onResult=function(n,e){return _newArrowCheck(this,_this$17),function(i){_newArrowCheck(this,_this$17),e.next(i),"subscription"!==n.operationType&&e.complete()}.bind(this)}.bind(void 0),toObservable=function(n,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.onError,o=i.onStart,t=i.unsubscribe;return _newArrowCheck(this,_this$17),new Observable(function(i){return _newArrowCheck(this,_this$17),observe(n,e,{onError:r,onStart:o,onAbort:i.error,onResult:onResult(e,i)}),t}.bind(this))}.bind(void 0),_this$19=void 0,unobserve$2=function(n,e){_newArrowCheck(this,_this$19);var i=n.observers,r=_objectWithoutProperties(n,["observers"]);return _extends({},r,{observers:remove(i.indexOf(e),1,i)})}.bind(void 0),_this$18=void 0,unobserve=function(n,e,i){return _newArrowCheck(this,_this$18),updateNotifiers(n,refresh(unobserve$2(e,i))),n}.bind(void 0);export{cancel,create,observe,send$1 as send,toObservable,unobserve};
//# sourceMappingURL=index.js.map

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

import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import"phoenix";import _extends from"babel-runtime/helpers/extends";import{errorsToString,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";import{remove,replace}from"@jumpn/utils-array";var _this$1=void 0,handlePush=function(n,r){return _newArrowCheck(this,_this$1),n.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),_this$3=void 0,getNotifier=function(n,r){return _newArrowCheck(this,_this$3),function(i){return _newArrowCheck(this,_this$3),i[n]&&i[n](r)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$3),"on"+String(n)}.bind(void 0),notify=function(n,r,i){return _newArrowCheck(this,_this$3),n.observers.forEach(getNotifier(getHandlerName(r),i))}.bind(void 0),_this$2=void 0,notifyall=function(n,r,i){return _newArrowCheck(this,_this$2),n.forEach(function(n){return _newArrowCheck(this,_this$2),notify(n,r,i)}.bind(this))}.bind(void 0),_this$6=void 0,find=function(n,r,i){return _newArrowCheck(this,_this$6),n.find(hasIn([r],i))}.bind(void 0),_this$5=void 0,createEventHandler=function(n,r){return _newArrowCheck(this,_this$5),function(i){return _newArrowCheck(this,_this$5),function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];_newArrowCheck(this,_this$5);var s=find(n.notifiers,"request",r);s&&i.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,r,i){return _newArrowCheck(this,_this$5),map(createEventHandler(r,i),n)}.bind(void 0),_this$8=void 0,findIndex=function(n,r,i){return _newArrowCheck(this,_this$8),n.findIndex(hasIn([r],i))}.bind(void 0),_this$7=void 0,remove$1=function(n){return _newArrowCheck(this,_this$7),function(r){return _newArrowCheck(this,_this$7),remove(findIndex(r,"request",n.request),1,r)}.bind(this)}.bind(void 0),_this$9=void 0,refresh=function(n){return _newArrowCheck(this,_this$9),function(r){return _newArrowCheck(this,_this$9),replace(findIndex(r,"request",n.request),[n],r)}.bind(this)}.bind(void 0),_this$12=void 0,updateNotifiers=function(n,r){return _newArrowCheck(this,_this$12),n.notifiers=r(n.notifiers),n}.bind(void 0),_this$11=void 0,cancelNotifier=function(n,r){_newArrowCheck(this,_this$11),updateNotifiers(n,remove$1(r)),notify(r,"Cancel",r)}.bind(void 0),_this$10=void 0,onError$1=function(n,r,i){_newArrowCheck(this,_this$10),unsubscribe(n,r),notify(r,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout$1=function(n,r){return _newArrowCheck(this,_this$10),notify(r,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(n,r){return _newArrowCheck(this,_this$10),handlePush(n.channel.push("unsubscribe",{subscriptionId:r.subscriptionId}),createPushHandler(notifierPushHandler,n,r.request))}.bind(void 0),_this$4=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$4),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,r,i){var e=i.subscriptionId;_newArrowCheck(this,_this$4);var t=_extends({},r,{subscriptionId:e});updateNotifiers(n,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(n,t)}.bind(void 0),abortRequest=function(n,r,i){_newArrowCheck(this,_this$4),updateNotifiers(n,remove$1(r)),notify(r,"Abort",i)}.bind(void 0),onError=function(n,r,i){return _newArrowCheck(this,_this$4),abortRequest(n,r,new Error(i))}.bind(void 0),onSubscriptionResponse=function(n,r,i){_newArrowCheck(this,_this$4),i.errors?onError(n,r,errorsToString(i.errors)):onSubscriptionSucceed(n,r,i)}.bind(void 0),onQueryOrMutationResponse=function(n,r,i){_newArrowCheck(this,_this$4),updateNotifiers(n,remove$1(r)),notify(r,"Result",i)}.bind(void 0),onTimeout=function(n,r){return _newArrowCheck(this,_this$4),notify(r,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(n,r,i){return _newArrowCheck(this,_this$4),handlePush(n.channel.push("doc",requestToCompat(r)),createPushHandler(i,n,r))}.bind(void 0),pushRequest=function(n,r){_newArrowCheck(this,_this$4),"subscription"===r.operationType?send(n,r.request,subcriptionHandler):(notifyStart(r),send(n,r.request,queryOrMutationHandler))}.bind(void 0),_this=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this),{onError:function(r){return _newArrowCheck(this,_this),notifyall(n.notifiers,"Error",new Error("channel join: "+String(r)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this),n.notifiers.forEach(function(r){return _newArrowCheck(this,_this),pushRequest(n,r)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0);export default joinChannel;
import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import"phoenix";import _extends from"babel-runtime/helpers/extends";import{errorsToString,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";import{remove,replace}from"@jumpn/utils-array";var _this$1=void 0,handlePush=function(n,r){return _newArrowCheck(this,_this$1),n.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),_this$3=void 0,getNotifier=function(n,r){return _newArrowCheck(this,_this$3),function(i){return _newArrowCheck(this,_this$3),i[n]&&i[n](r)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$3),"on"+String(n)}.bind(void 0),notify=function(n,r,i){return _newArrowCheck(this,_this$3),n.observers.forEach(getNotifier(getHandlerName(r),i))}.bind(void 0),_this$2=void 0,notifyall=function(n,r,i){return _newArrowCheck(this,_this$2),n.forEach(function(n){return _newArrowCheck(this,_this$2),notify(n,r,i)}.bind(this))}.bind(void 0),_this$6=void 0,find=function(n,r,i){return _newArrowCheck(this,_this$6),n.find(hasIn([r],i))}.bind(void 0),_this$5=void 0,createEventHandler=function(n,r){return _newArrowCheck(this,_this$5),function(i){return _newArrowCheck(this,_this$5),function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];_newArrowCheck(this,_this$5);var s=find(n.notifiers,"request",r);s&&i.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,r,i){return _newArrowCheck(this,_this$5),map(createEventHandler(r,i),n)}.bind(void 0),_this$8=void 0,findIndex=function(n,r,i){return _newArrowCheck(this,_this$8),n.findIndex(hasIn([r],i))}.bind(void 0),_this$7=void 0,remove$1=function(n){return _newArrowCheck(this,_this$7),function(r){return _newArrowCheck(this,_this$7),remove(findIndex(r,"request",n.request),1,r)}.bind(this)}.bind(void 0),_this$9=void 0,refresh=function(n){return _newArrowCheck(this,_this$9),function(r){return _newArrowCheck(this,_this$9),replace(findIndex(r,"request",n.request),[n],r)}.bind(this)}.bind(void 0),_this$10=void 0,updateNotifiers=function(n,r){return _newArrowCheck(this,_this$10),n.notifiers=r(n.notifiers),n}.bind(void 0),_this$4=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$4),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,r,i){var e=i.subscriptionId;_newArrowCheck(this,_this$4);var t=_extends({},r,{subscriptionId:e});updateNotifiers(n,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(n,r,i){_newArrowCheck(this,_this$4),updateNotifiers(n,remove$1(r)),notify(r,"Abort",i)}.bind(void 0),onError=function(n,r,i){return _newArrowCheck(this,_this$4),abortRequest(n,r,new Error(i))}.bind(void 0),onSubscriptionResponse=function(n,r,i){_newArrowCheck(this,_this$4),i.errors?onError(n,r,errorsToString(i.errors)):onSubscriptionSucceed(n,r,i)}.bind(void 0),onQueryOrMutationResponse=function(n,r,i){_newArrowCheck(this,_this$4),updateNotifiers(n,remove$1(r)),notify(r,"Result",i)}.bind(void 0),onTimeout=function(n,r){return _newArrowCheck(this,_this$4),notify(r,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(n,r,i){return _newArrowCheck(this,_this$4),handlePush(n.channel.push("doc",requestToCompat(r)),createPushHandler(i,n,r))}.bind(void 0),pushRequest=function(n,r){_newArrowCheck(this,_this$4),"subscription"===r.operationType?send(n,r.request,subcriptionHandler):(notifyStart(r),send(n,r.request,queryOrMutationHandler))}.bind(void 0),_this=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this),{onError:function(r){return _newArrowCheck(this,_this),notifyall(n.notifiers,"Error",new Error("channel join: "+String(r)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this),n.notifiers.forEach(function(r){return _newArrowCheck(this,_this),pushRequest(n,r)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0);export default joinChannel;
//# sourceMappingURL=joinChannel.js.map

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

import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{getOperationType}from"@jumpn/utils-graphql";var _this=void 0,create=function(e){return _newArrowCheck(this,_this),{request:e,cancelled:!1,observers:[],operationType:getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0);export default create;
import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{getOperationType}from"@jumpn/utils-graphql";var _this=void 0,create=function(e){return _newArrowCheck(this,_this),{request:e,observers:[],operationType:getOperationType(e.operation),subscriptionId:void 0}}.bind(void 0);export default create;
//# sourceMappingURL=create.js.map

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

import _extends from"babel-runtime/helpers/extends";import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{errorsToString,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";import"phoenix";import{remove,replace}from"@jumpn/utils-array";var _this$2=void 0,find=function(r,e,i){return _newArrowCheck(this,_this$2),r.find(hasIn([e],i))}.bind(void 0),_this$1=void 0,createEventHandler=function(r,e){return _newArrowCheck(this,_this$1),function(i){return _newArrowCheck(this,_this$1),function(){for(var n=arguments.length,t=Array(n),o=0;o<n;o++)t[o]=arguments[o];_newArrowCheck(this,_this$1);var s=find(r.notifiers,"request",e);s&&i.apply(void 0,[r,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(r,e,i){return _newArrowCheck(this,_this$1),map(createEventHandler(e,i),r)}.bind(void 0),_this$3=void 0,handlePush=function(r,e){return _newArrowCheck(this,_this$3),r.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(r,e){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[r]&&i[r](e)}.bind(this)}.bind(void 0),getHandlerName=function(r){return _newArrowCheck(this,_this$4),"on"+String(r)}.bind(void 0),notify=function(r,e,i){return _newArrowCheck(this,_this$4),r.observers.forEach(getNotifier(getHandlerName(e),i))}.bind(void 0),_this$6=void 0,findIndex=function(r,e,i){return _newArrowCheck(this,_this$6),r.findIndex(hasIn([e],i))}.bind(void 0),_this$5=void 0,remove$1=function(r){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),remove(findIndex(e,"request",r.request),1,e)}.bind(this)}.bind(void 0),_this$7=void 0,refresh=function(r){return _newArrowCheck(this,_this$7),function(e){return _newArrowCheck(this,_this$7),replace(findIndex(e,"request",r.request),[r],e)}.bind(this)}.bind(void 0),_this$10=void 0,updateNotifiers=function(r,e){return _newArrowCheck(this,_this$10),r.notifiers=e(r.notifiers),r}.bind(void 0),_this$9=void 0,cancelNotifier=function(r,e){_newArrowCheck(this,_this$9),updateNotifiers(r,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),_this$8=void 0,onError$1=function(r,e,i){_newArrowCheck(this,_this$8),unsubscribe(r,e),notify(e,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout$1=function(r,e){return _newArrowCheck(this,_this$8),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(r,e){return _newArrowCheck(this,_this$8),handlePush(r.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,r,e.request))}.bind(void 0),_this=void 0,notifyStart=function(r){return _newArrowCheck(this,_this),notify(r,"Start",r)}.bind(void 0),onSubscriptionSucceed=function(r,e,i){var n=i.subscriptionId;_newArrowCheck(this,_this);var t=_extends({},e,{subscriptionId:n});updateNotifiers(r,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(r,t)}.bind(void 0),abortRequest=function(r,e,i){_newArrowCheck(this,_this),updateNotifiers(r,remove$1(e)),notify(e,"Abort",i)}.bind(void 0),onError=function(r,e,i){return _newArrowCheck(this,_this),abortRequest(r,e,new Error(i))}.bind(void 0),onSubscriptionResponse=function(r,e,i){_newArrowCheck(this,_this),i.errors?onError(r,e,errorsToString(i.errors)):onSubscriptionSucceed(r,e,i)}.bind(void 0),onQueryOrMutationResponse=function(r,e,i){_newArrowCheck(this,_this),updateNotifiers(r,remove$1(e)),notify(e,"Result",i)}.bind(void 0),onTimeout=function(r,e){return _newArrowCheck(this,_this),notify(e,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(r,e,i){return _newArrowCheck(this,_this),handlePush(r.channel.push("doc",requestToCompat(e)),createPushHandler(i,r,e))}.bind(void 0),pushRequest=function(r,e){_newArrowCheck(this,_this),"subscription"===e.operationType?send(r,e.request,subcriptionHandler):(notifyStart(e),send(r,e.request,queryOrMutationHandler))}.bind(void 0);export default pushRequest;
import _extends from"babel-runtime/helpers/extends";import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{errorsToString,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";import"phoenix";import{remove,replace}from"@jumpn/utils-array";var _this$2=void 0,find=function(r,e,i){return _newArrowCheck(this,_this$2),r.find(hasIn([e],i))}.bind(void 0),_this$1=void 0,createEventHandler=function(r,e){return _newArrowCheck(this,_this$1),function(i){return _newArrowCheck(this,_this$1),function(){for(var n=arguments.length,t=Array(n),o=0;o<n;o++)t[o]=arguments[o];_newArrowCheck(this,_this$1);var s=find(r.notifiers,"request",e);s&&i.apply(void 0,[r,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(r,e,i){return _newArrowCheck(this,_this$1),map(createEventHandler(e,i),r)}.bind(void 0),_this$3=void 0,handlePush=function(r,e){return _newArrowCheck(this,_this$3),r.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(r,e){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[r]&&i[r](e)}.bind(this)}.bind(void 0),getHandlerName=function(r){return _newArrowCheck(this,_this$4),"on"+String(r)}.bind(void 0),notify=function(r,e,i){return _newArrowCheck(this,_this$4),r.observers.forEach(getNotifier(getHandlerName(e),i))}.bind(void 0),_this$6=void 0,findIndex=function(r,e,i){return _newArrowCheck(this,_this$6),r.findIndex(hasIn([e],i))}.bind(void 0),_this$5=void 0,remove$1=function(r){return _newArrowCheck(this,_this$5),function(e){return _newArrowCheck(this,_this$5),remove(findIndex(e,"request",r.request),1,e)}.bind(this)}.bind(void 0),_this$7=void 0,refresh=function(r){return _newArrowCheck(this,_this$7),function(e){return _newArrowCheck(this,_this$7),replace(findIndex(e,"request",r.request),[r],e)}.bind(this)}.bind(void 0),_this$8=void 0,updateNotifiers=function(r,e){return _newArrowCheck(this,_this$8),r.notifiers=e(r.notifiers),r}.bind(void 0),_this=void 0,notifyStart=function(r){return _newArrowCheck(this,_this),notify(r,"Start",r)}.bind(void 0),onSubscriptionSucceed=function(r,e,i){var n=i.subscriptionId;_newArrowCheck(this,_this);var t=_extends({},e,{subscriptionId:n});updateNotifiers(r,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(r,e,i){_newArrowCheck(this,_this),updateNotifiers(r,remove$1(e)),notify(e,"Abort",i)}.bind(void 0),onError=function(r,e,i){return _newArrowCheck(this,_this),abortRequest(r,e,new Error(i))}.bind(void 0),onSubscriptionResponse=function(r,e,i){_newArrowCheck(this,_this),i.errors?onError(r,e,errorsToString(i.errors)):onSubscriptionSucceed(r,e,i)}.bind(void 0),onQueryOrMutationResponse=function(r,e,i){_newArrowCheck(this,_this),updateNotifiers(r,remove$1(e)),notify(e,"Result",i)}.bind(void 0),onTimeout=function(r,e){return _newArrowCheck(this,_this),notify(e,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send=function(r,e,i){return _newArrowCheck(this,_this),handlePush(r.channel.push("doc",requestToCompat(e)),createPushHandler(i,r,e))}.bind(void 0),pushRequest=function(r,e){_newArrowCheck(this,_this),"subscription"===e.operationType?send(r,e.request,subcriptionHandler):(notifyStart(e),send(r,e.request,queryOrMutationHandler))}.bind(void 0);export default pushRequest;
//# sourceMappingURL=pushRequest.js.map

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

import _extends from"babel-runtime/helpers/extends";import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{append,remove,replace}from"@jumpn/utils-array";import"phoenix";import{errorsToString,getOperationType,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";var _this$2=void 0,handlePush=function(n,e){return _newArrowCheck(this,_this$2),n.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(n,e){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[n]&&i[n](e)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,e,i){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(e),i))}.bind(void 0),_this$3=void 0,notifyall=function(n,e,i){return _newArrowCheck(this,_this$3),n.forEach(function(n){return _newArrowCheck(this,_this$3),notify(n,e,i)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(n,e,i){return _newArrowCheck(this,_this$7),n.find(hasIn([e],i))}.bind(void 0),_this$6=void 0,createEventHandler=function(n,e){return _newArrowCheck(this,_this$6),function(i){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(n.notifiers,"request",e);s&&i.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,e,i){return _newArrowCheck(this,_this$6),map(createEventHandler(e,i),n)}.bind(void 0),_this$9=void 0,findIndex=function(n,e,i){return _newArrowCheck(this,_this$9),n.findIndex(hasIn([e],i))}.bind(void 0),_this$8=void 0,remove$1=function(n){return _newArrowCheck(this,_this$8),function(e){return _newArrowCheck(this,_this$8),remove(findIndex(e,"request",n.request),1,e)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(n){return _newArrowCheck(this,_this$10),function(e){return _newArrowCheck(this,_this$10),replace(findIndex(e,"request",n.request),[n],e)}.bind(this)}.bind(void 0),_this$13=void 0,updateNotifiers=function(n,e){return _newArrowCheck(this,_this$13),n.notifiers=e(n.notifiers),n}.bind(void 0),_this$12=void 0,cancelNotifier=function(n,e){_newArrowCheck(this,_this$12),updateNotifiers(n,remove$1(e)),notify(e,"Cancel",e)}.bind(void 0),_this$11=void 0,onError$1=function(n,e,i){_newArrowCheck(this,_this$11),unsubscribe(n,e),notify(e,"Error","unsubscribe: "+String(i))}.bind(void 0),onTimeout$1=function(n,e){return _newArrowCheck(this,_this$11),notify(e,"Error","unsubscribe: timeout")}.bind(void 0),notifierPushHandler={onError:onError$1,onTimeout:onTimeout$1,onSucceed:cancelNotifier},unsubscribe=function(n,e){return _newArrowCheck(this,_this$11),handlePush(n.channel.push("unsubscribe",{subscriptionId:e.subscriptionId}),createPushHandler(notifierPushHandler,n,e.request))}.bind(void 0),_this$5=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$5),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,e,i){var r=i.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},e,{subscriptionId:r});updateNotifiers(n,refresh(t)),notifyStart(t),t.cancelled&&unsubscribe(n,t)}.bind(void 0),abortRequest=function(n,e,i){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(e)),notify(e,"Abort",i)}.bind(void 0),onError=function(n,e,i){return _newArrowCheck(this,_this$5),abortRequest(n,e,new Error(i))}.bind(void 0),onSubscriptionResponse=function(n,e,i){_newArrowCheck(this,_this$5),i.errors?onError(n,e,errorsToString(i.errors)):onSubscriptionSucceed(n,e,i)}.bind(void 0),onQueryOrMutationResponse=function(n,e,i){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(e)),notify(e,"Result",i)}.bind(void 0),onTimeout=function(n,e){return _newArrowCheck(this,_this$5),notify(e,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send$2=function(n,e,i){return _newArrowCheck(this,_this$5),handlePush(n.channel.push("doc",requestToCompat(e)),createPushHandler(i,n,e))}.bind(void 0),pushRequest=function(n,e){_newArrowCheck(this,_this$5),"subscription"===e.operationType?send$2(n,e.request,subcriptionHandler):(notifyStart(e),send$2(n,e.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$1),{onError:function(e){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: "+String(e)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),n.notifiers.forEach(function(e){return _newArrowCheck(this,_this$1),pushRequest(n,e)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$1),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this$14=void 0,create=function(n){return _newArrowCheck(this,_this$14),{request:n,cancelled:!1,observers:[],operationType:getOperationType(n.operation),subscriptionId:void 0}}.bind(void 0),_this=void 0,connectOrJoinChannel=function(n){_newArrowCheck(this,_this),n.phoenixSocket.isConnected()?joinChannel(n):n.phoenixSocket.connect()}.bind(void 0),sendNew=function(n,e){_newArrowCheck(this,_this);var i=create(e);return updateNotifiers(n,append([i])),n.channelJoinCreated?pushRequest(n,i):connectOrJoinChannel(n),i}.bind(void 0),uncancel=function(n,e){_newArrowCheck(this,_this);var i=e.prevStatus,r=_extends({},e,{status:i,prevStatus:e.status});return updateNotifiers(n,notifierRefresh(updateNotifiers)),r}.bind(void 0),uncancelIfNeeded=function(n,e){return _newArrowCheck(this,_this),"cancelling"===e.status?uncancel(n,e):e}.bind(void 0),send=function(n,e){_newArrowCheck(this,_this);var i=find(n.notifiers,"request",e);return i?uncancelIfNeeded(n,i):sendNew(n,e)}.bind(void 0);export default send;
import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{append,remove,replace}from"@jumpn/utils-array";import"phoenix";import _extends from"babel-runtime/helpers/extends";import{errorsToString,getOperationType,requestToCompat}from"@jumpn/utils-graphql";import{hasIn,map}from"@jumpn/utils-composite";var _this$2=void 0,handlePush=function(n,e){return _newArrowCheck(this,_this$2),n.receive("ok",e.onSucceed).receive("error",e.onError).receive("timeout",e.onTimeout)}.bind(void 0),_this$4=void 0,getNotifier=function(n,e){return _newArrowCheck(this,_this$4),function(i){return _newArrowCheck(this,_this$4),i[n]&&i[n](e)}.bind(this)}.bind(void 0),getHandlerName=function(n){return _newArrowCheck(this,_this$4),"on"+String(n)}.bind(void 0),notify=function(n,e,i){return _newArrowCheck(this,_this$4),n.observers.forEach(getNotifier(getHandlerName(e),i))}.bind(void 0),_this$3=void 0,notifyall=function(n,e,i){return _newArrowCheck(this,_this$3),n.forEach(function(n){return _newArrowCheck(this,_this$3),notify(n,e,i)}.bind(this))}.bind(void 0),_this$7=void 0,find=function(n,e,i){return _newArrowCheck(this,_this$7),n.find(hasIn([e],i))}.bind(void 0),_this$6=void 0,createEventHandler=function(n,e){return _newArrowCheck(this,_this$6),function(i){return _newArrowCheck(this,_this$6),function(){for(var r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];_newArrowCheck(this,_this$6);var s=find(n.notifiers,"request",e);s&&i.apply(void 0,[n,s].concat(t))}.bind(this)}.bind(this)}.bind(void 0),createPushHandler=function(n,e,i){return _newArrowCheck(this,_this$6),map(createEventHandler(e,i),n)}.bind(void 0),_this$9=void 0,findIndex=function(n,e,i){return _newArrowCheck(this,_this$9),n.findIndex(hasIn([e],i))}.bind(void 0),_this$8=void 0,remove$1=function(n){return _newArrowCheck(this,_this$8),function(e){return _newArrowCheck(this,_this$8),remove(findIndex(e,"request",n.request),1,e)}.bind(this)}.bind(void 0),_this$10=void 0,refresh=function(n){return _newArrowCheck(this,_this$10),function(e){return _newArrowCheck(this,_this$10),replace(findIndex(e,"request",n.request),[n],e)}.bind(this)}.bind(void 0),_this$11=void 0,updateNotifiers=function(n,e){return _newArrowCheck(this,_this$11),n.notifiers=e(n.notifiers),n}.bind(void 0),_this$5=void 0,notifyStart=function(n){return _newArrowCheck(this,_this$5),notify(n,"Start",n)}.bind(void 0),onSubscriptionSucceed=function(n,e,i){var r=i.subscriptionId;_newArrowCheck(this,_this$5);var t=_extends({},e,{subscriptionId:r});updateNotifiers(n,refresh(t)),notifyStart(t)}.bind(void 0),abortRequest=function(n,e,i){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(e)),notify(e,"Abort",i)}.bind(void 0),onError=function(n,e,i){return _newArrowCheck(this,_this$5),abortRequest(n,e,new Error(i))}.bind(void 0),onSubscriptionResponse=function(n,e,i){_newArrowCheck(this,_this$5),i.errors?onError(n,e,errorsToString(i.errors)):onSubscriptionSucceed(n,e,i)}.bind(void 0),onQueryOrMutationResponse=function(n,e,i){_newArrowCheck(this,_this$5),updateNotifiers(n,remove$1(e)),notify(e,"Result",i)}.bind(void 0),onTimeout=function(n,e){return _newArrowCheck(this,_this$5),notify(e,"Error",new Error("request: timeout"))}.bind(void 0),queryOrMutationHandler={onError:onError,onTimeout:onTimeout,onSucceed:onQueryOrMutationResponse},subcriptionHandler={onError:onError,onTimeout:onTimeout,onSucceed:onSubscriptionResponse},send$2=function(n,e,i){return _newArrowCheck(this,_this$5),handlePush(n.channel.push("doc",requestToCompat(e)),createPushHandler(i,n,e))}.bind(void 0),pushRequest=function(n,e){_newArrowCheck(this,_this$5),"subscription"===e.operationType?send$2(n,e.request,subcriptionHandler):(notifyStart(e),send$2(n,e.request,queryOrMutationHandler))}.bind(void 0),_this$1=void 0,createChannelJoinHandler=function(n){return _newArrowCheck(this,_this$1),{onError:function(e){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: "+String(e)))}.bind(this),onSucceed:function(){return _newArrowCheck(this,_this$1),n.notifiers.forEach(function(e){return _newArrowCheck(this,_this$1),pushRequest(n,e)}.bind(this))}.bind(this),onTimeout:function(){return _newArrowCheck(this,_this$1),notifyall(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),joinChannel=function(n){return _newArrowCheck(this,_this$1),handlePush(n.channel.join(),createChannelJoinHandler(n)),n.channelJoinCreated=!0,n}.bind(void 0),_this$12=void 0,create=function(n){return _newArrowCheck(this,_this$12),{request:n,observers:[],operationType:getOperationType(n.operation),subscriptionId:void 0}}.bind(void 0),_this=void 0,connectOrJoinChannel=function(n){_newArrowCheck(this,_this),n.phoenixSocket.isConnected()?joinChannel(n):n.phoenixSocket.connect()}.bind(void 0),sendNew=function(n,e){_newArrowCheck(this,_this);var i=create(e);return updateNotifiers(n,append([i])),n.channelJoinCreated?pushRequest(n,i):connectOrJoinChannel(n),i}.bind(void 0),send=function(n,e){return _newArrowCheck(this,_this),find(n.notifiers,"request",e)||sendNew(n,e)}.bind(void 0);export default send;
//# sourceMappingURL=send.js.map
{
"name": "@absinthe/socket",
"version": "0.1.9",
"version": "0.1.10",
"description": "Absinthe Socket",

@@ -10,3 +10,3 @@ "module": "dist/index.js",

"version": "nps version",
"prepublishOnly": "nps prepublishOnly"
"prepublish": "nps prepublish"
},

@@ -13,0 +13,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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