Created
November 10, 2017 17:10
-
-
Save guilherme-teodoro/0ffe51019b854238509c8992142e9635 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@jumpn/utils-composite"),require("phoenix"),require("@jumpn/utils-array"),require("@jumpn/utils-graphql"),require("zen-observable")):"function"==typeof define&&define.amd?define(["exports","@jumpn/utils-composite","phoenix","@jumpn/utils-array","@jumpn/utils-graphql","zen-observable"],t):t(n.AbsintheSocket={},n.utilsComposite,n.phoenix,n.utilsArray,n.utilsGraphql,n.Observable)}(this,function(n,t,r,i,e,o){"use strict";function u(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function c(n,t){return t={exports:{}},n(t,t.exports),t.exports}o=o&&o.hasOwnProperty("default")?o.default:o;var s=u(c(function(n,t){t.__esModule=!0,t.default=function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function")}})),f=function(n,r,i){return s(this,void 0),n.find(t.hasIn([r],i))}.bind(void 0),d=function(n,t){return s(this,void 0),function(r){return s(this,void 0),function(){for(var i=arguments.length,e=Array(i),o=0;o<i;o++)e[o]=arguments[o];s(this,void 0);var u=f(n.notifiers,"request",t);u&&r.apply(void 0,[n,u].concat(e))}.bind(this)}.bind(this)}.bind(void 0),a=function(n,r,i){return s(this,void 0),t.map(d(r,i),n)}.bind(void 0),v=function(n,t){return s(this,void 0),n.receive("ok",t.onSucceed).receive("error",t.onError).receive("timeout",t.onTimeout)}.bind(void 0),l=function(n,t){return s(this,void 0),function(r){return s(this,void 0),r[n]&&r[n](t)}.bind(this)}.bind(void 0),h=function(n){return s(this,void 0),"on"+String(n)}.bind(void 0),p=function(n,t,r){return s(this,void 0),n.observers.forEach(l(h(t),r))}.bind(void 0),b=function(n,r,i){return s(this,void 0),n.findIndex(t.hasIn([r],i))}.bind(void 0),y=function(n){return s(this,void 0),function(t){return s(this,void 0),i.remove(b(t,"request",n.request),1,t)}.bind(this)}.bind(void 0),g=function(n,t){return s(this,void 0),n.notifiers=t(n.notifiers),n}.bind(void 0),m=function(n,t){s(this,void 0),g(n,y(t)),p(t,"Cancel",t)}.bind(void 0),_={onError:function(n,t,r){s(this,void 0),O(n,t),p(t,"Error","unsubscribe: "+String(r))}.bind(void 0),onTimeout:function(n,t){return s(this,void 0),p(t,"Error","unsubscribe: timeout")}.bind(void 0),onSucceed:m},O=function(n,t){return s(this,void 0),v(n.channel.push("unsubscribe",{subscriptionId:t.subscriptionId}),a(_,n,t.request))}.bind(void 0),j=function(n,t){return s(this,void 0),"subscription"===t.operationType?O(n,t):m(n,t),n}.bind(void 0),w=function(n,t,r){return s(this,void 0),n.forEach(function(n){return s(this,void 0),p(n,t,r)}.bind(this))}.bind(void 0),E=c(function(n){var t=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),S=c(function(n){var t=n.exports={version:"2.5.1"};"number"==typeof __e&&(__e=t)}),x=(S.version,function(n,t,r){if(function(n){if("function"!=typeof n)throw TypeError(n+" is not a function!")}(n),void 0===t)return n;switch(r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,i){return n.call(t,r,i)};case 3:return function(r,i,e){return n.call(t,r,i,e)}}return function(){return n.apply(t,arguments)}}),T=function(n){return"object"==typeof n?null!==n:"function"==typeof n},q=function(n){if(!T(n))throw TypeError(n+" is not an object!");return n},A=function(n){try{return!!n()}catch(n){return!0}},M=!A(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),P=E.document,I=T(P)&&T(P.createElement),k=function(n){return I?P.createElement(n):{}},C=!M&&!A(function(){return 7!=Object.defineProperty(k("div"),"a",{get:function(){return 7}}).a}),F=Object.defineProperty,R={f:M?Object.defineProperty:function(n,t,r){if(q(n),t=function(n,t){if(!T(n))return n;var r,i;if(t&&"function"==typeof(r=n.toString)&&!T(i=r.call(n)))return i;if("function"==typeof(r=n.valueOf)&&!T(i=r.call(n)))return i;if(!t&&"function"==typeof(r=n.toString)&&!T(i=r.call(n)))return i;throw TypeError("Can't convert object to primitive value")}(t,!0),q(r),C)try{return F(n,t,r)}catch(n){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(n[t]=r.value),n}},J=function(n,t){return{enumerable:!(1&n),configurable:!(2&n),writable:!(4&n),value:t}},z=M?function(n,t,r){return R.f(n,t,J(1,r))}:function(n,t,r){return n[t]=r,n},G=function(n,t,r){var i,e,o,u=n&G.F,c=n&G.G,s=n&G.S,f=n&G.P,d=n&G.B,a=n&G.W,v=c?S:S[t]||(S[t]={}),l=v.prototype,h=c?E:s?E[t]:(E[t]||{}).prototype;c&&(r=t);for(i in r)(e=!u&&h&&void 0!==h[i])&&i in v||(o=e?h[i]:r[i],v[i]=c&&"function"!=typeof h[i]?r[i]:d&&e?x(o,E):a&&h[i]==o?function(n){var t=function(t,r,i){if(this instanceof n){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,r)}return new n(t,r,i)}return n.apply(this,arguments)};return t.prototype=n.prototype,t}(o):f&&"function"==typeof o?x(Function.call,o):o,f&&((v.virtual||(v.virtual={}))[i]=o,n&G.R&&l&&!l[i]&&z(l,i,o)))};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 N=G,W={}.hasOwnProperty,B=function(n,t){return W.call(n,t)},U={}.toString,L=function(n){return U.call(n).slice(8,-1)},D=Object("z").propertyIsEnumerable(0)?Object:function(n){return"String"==L(n)?n.split(""):Object(n)},H=function(n){if(void 0==n)throw TypeError("Can't call method on "+n);return n},K=function(n){return D(H(n))},Q=Math.ceil,V=Math.floor,X=function(n){return isNaN(n=+n)?0:(n>0?V:Q)(n)},Y=Math.min,Z=function(n){return n>0?Y(X(n),9007199254740991):0},$=Math.max,nn=Math.min,tn=E["__core-js_shared__"]||(E["__core-js_shared__"]={}),rn=function(n){return tn[n]||(tn[n]={})},en=0,on=Math.random(),un=function(n){return"Symbol(".concat(void 0===n?"":n,")_",(++en+on).toString(36))},cn=rn("keys"),sn=function(n){return cn[n]||(cn[n]=un(n))},fn=function(n){return function(t,r,i){var e,o=K(t),u=Z(o.length),c=function(n,t){return(n=X(n))<0?$(n+t,0):nn(n,t)}(i,u);if(n&&r!=r){for(;u>c;)if((e=o[c++])!=e)return!0}else for(;u>c;c++)if((n||c in o)&&o[c]===r)return n||c||0;return!n&&-1}}(!1),dn=sn("IE_PROTO"),an="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),vn=Object.keys||function(n){return function(n,t){var r,i=K(n),e=0,o=[];for(r in i)r!=dn&&B(i,r)&&o.push(r);for(;t.length>e;)B(i,r=t[e++])&&(~fn(o,r)||o.push(r));return o}(n,an)},ln={f:Object.getOwnPropertySymbols},hn={f:{}.propertyIsEnumerable},pn=function(n){return Object(H(n))},bn=Object.assign,yn=!bn||A(function(){var n={},t={},r=Symbol(),i="abcdefghijklmnopqrst";return n[r]=7,i.split("").forEach(function(n){t[n]=n}),7!=bn({},n)[r]||Object.keys(bn({},t)).join("")!=i})?function(n,t){for(var r=pn(n),i=arguments.length,e=1,o=ln.f,u=hn.f;i>e;)for(var c,s=D(arguments[e++]),f=o?vn(s).concat(o(s)):vn(s),d=f.length,a=0;d>a;)u.call(s,c=f[a++])&&(r[c]=s[c]);return r}:bn;N(N.S+N.F,"Object",{assign:yn});var gn=S.Object.assign,mn=c(function(n){n.exports={default:gn,__esModule:!0}});u(mn);var _n=u(c(function(n,t){t.__esModule=!0;var r=function(n){return n&&n.__esModule?n:{default:n}}(mn);t.default=r.default||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n}})),On=function(n){return s(this,void 0),function(t){return s(this,void 0),i.replace(b(t,"request",n.request),[n],t)}.bind(this)}.bind(void 0),jn=function(n){return s(this,void 0),p(n,"Start",n)}.bind(void 0),wn=function(n,t,r){var i=r.subscriptionId;s(this,void 0);var e=_n({},t,{subscriptionId:i});g(n,On(e)),jn(e)}.bind(void 0),En=function(n,t,r){s(this,void 0),g(n,y(t)),p(t,"Abort",r)}.bind(void 0),Sn=function(n,t,r){return s(this,void 0),En(n,t,new Error(r))}.bind(void 0),xn=function(n,t,r){s(this,void 0),r.errors?Sn(n,t,e.errorsToString(r.errors)):wn(n,t,r)}.bind(void 0),Tn=function(n,t,r){s(this,void 0),g(n,y(t)),p(t,"Result",r)}.bind(void 0),qn=function(n,t){return s(this,void 0),p(t,"Error",new Error("request: timeout"))}.bind(void 0),An={onError:Sn,onTimeout:qn,onSucceed:Tn},Mn={onError:Sn,onTimeout:qn,onSucceed:xn},Pn=function(n){var t=n.operation,r=n.variables;return s(this,void 0),r?{query:t,variables:r}:{query:t}}.bind(void 0),In=function(n,t,r){return s(this,void 0),v(n.channel.push("doc",Pn(t)),a(r,n,t))}.bind(void 0),kn=function(n,t){s(this,void 0),"subscription"===t.operationType?In(n,t.request,Mn):(jn(t),In(n,t.request,An))}.bind(void 0),Cn=function(n){return s(this,void 0),{onError:function(t){return s(this,void 0),w(n.notifiers,"Error",new Error("channel join: "+String(t)))}.bind(this),onSucceed:function(){return s(this,void 0),n.notifiers.forEach(function(t){return s(this,void 0),kn(n,t)}.bind(this))}.bind(this),onTimeout:function(){return s(this,void 0),w(n.notifiers,"Error",new Error("channel join: timeout"))}.bind(this)}}.bind(void 0),Fn=function(n){return s(this,void 0),v(n.channel.join(),Cn(n)),n.channelJoinCreated=!0,n}.bind(void 0),Rn=function(){return s(this,void 0),new Error("connection: close")}.bind(void 0),Jn=function(n,t){s(this,void 0),g(n,y(t)),p(t,"Abort",Rn())}.bind(void 0),zn=function(n){return s(this,void 0),function(t){s(this,void 0),"mutation"===t.operationType?Jn(n,t):p(t,"Error",Rn())}.bind(this)}.bind(void 0),Gn=function(n){return s(this,void 0),function(){return s(this,void 0),n.notifiers.forEach(zn(n))}.bind(this)}.bind(void 0),Nn=function(n,t){var r=t.payload;s(this,void 0);var i=f(n.notifiers,"subscriptionId",r.subscriptionId);i&&p(i,"Result",r.result)}.bind(void 0),Wn=function(n){return s(this,void 0),function(t){s(this,void 0),"subscription:data"===t.event&&Nn(n,t)}.bind(this)}.bind(void 0),Bn=function(n){return s(this,void 0),!n.channelJoinCreated&&n.notifiers.length>0}.bind(void 0),Un=function(n){return s(this,void 0),function(){s(this,void 0),Bn(n)&&Fn(n)}.bind(this)}.bind(void 0),Ln=function(n){s(this,void 0);var t={phoenixSocket:n,channel:n.channel("__absinthe__:control"),channelJoinCreated:!1,notifiers:[]};return n.onOpen(Un(t)),n.onMessage(Wn(t)),n.onClose(Gn(t)),t}.bind(void 0),Dn=z,Hn={},Kn=M?Object.defineProperties:function(n,t){q(n);for(var r,i=vn(t),e=i.length,o=0;e>o;)R.f(n,r=i[o++],t[r]);return n},Qn=E.document,Vn=Qn&&Qn.documentElement,Xn=sn("IE_PROTO"),Yn=function(){},Zn=function(){var n,t=k("iframe"),r=an.length;for(t.style.display="none",Vn.appendChild(t),t.src="javascript:",(n=t.contentWindow.document).open(),n.write("<script>document.F=Object<\/script>"),n.close(),Zn=n.F;r--;)delete Zn.prototype[an[r]];return Zn()},$n=Object.create||function(n,t){var r;return null!==n?(Yn.prototype=q(n),r=new Yn,Yn.prototype=null,r[Xn]=n):r=Zn(),void 0===t?r:Kn(r,t)},nt=c(function(n){var t=rn("wks"),r=E.Symbol,i="function"==typeof r;(n.exports=function(n){return t[n]||(t[n]=i&&r[n]||(i?r:un)("Symbol."+n))}).store=t}),tt=R.f,rt=nt("toStringTag"),it=function(n,t,r){n&&!B(n=r?n:n.prototype,rt)&&tt(n,rt,{configurable:!0,value:t})},et={};z(et,nt("iterator"),function(){return this});var ot=function(n,t,r){n.prototype=$n(et,{next:J(1,r)}),it(n,t+" Iterator")},ut=sn("IE_PROTO"),ct=Object.prototype,st=Object.getPrototypeOf||function(n){return n=pn(n),B(n,ut)?n[ut]:"function"==typeof n.constructor&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?ct:null},ft=nt("iterator"),dt=!([].keys&&"next"in[].keys()),at=function(){return this},vt=function(n){return function(t,r){var i,e,o=String(H(t)),u=X(r),c=o.length;return u<0||u>=c?n?"":void 0:(i=o.charCodeAt(u))<55296||i>56319||u+1===c||(e=o.charCodeAt(u+1))<56320||e>57343?n?o.charAt(u):i:n?o.slice(u,u+2):e-56320+(i-55296<<10)+65536}}(!0);!function(n,t,r,i,e,o,u){ot(r,t,i);var c,s,f,d=function(n){if(!dt&&n in h)return h[n];switch(n){case"keys":case"values":return function(){return new r(this,n)}}return function(){return new r(this,n)}},a=t+" Iterator",v="values"==e,l=!1,h=n.prototype,p=h[ft]||h["@@iterator"]||e&&h[e],b=p||d(e),y=e?v?d("entries"):b:void 0,g="Array"==t?h.entries||p:p;if(g&&(f=st(g.call(new n)))!==Object.prototype&&f.next&&it(f,a,!0),v&&p&&"values"!==p.name&&(l=!0,b=function(){return p.call(this)}),u&&(dt||l||!h[ft])&&z(h,ft,b),Hn[t]=b,Hn[a]=at,e)if(c={values:v?b:d("values"),keys:o?b:d("keys"),entries:y},u)for(s in c)s in h||Dn(h,s,c[s]);else N(N.P+N.F*(dt||l),t,c)}(String,"String",function(n){this._t=String(n),this._i=0},function(){var n,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(n=vt(t,r),this._i+=n.length,{value:n,done:!1})});var lt=nt("iterator"),ht=Array.prototype,pt=function(n,t,r){t in n?R.f(n,t,J(0,r)):n[t]=r},bt=nt("toStringTag"),yt="Arguments"==L(function(){return arguments}()),gt=nt("iterator"),mt=S.getIteratorMethod=function(n){if(void 0!=n)return n[gt]||n["@@iterator"]||Hn[function(n){var t,r,i;return void 0===n?"Undefined":null===n?"Null":"string"==typeof(r=function(n,t){try{return n[t]}catch(n){}}(t=Object(n),bt))?r:yt?L(t):"Object"==(i=L(t))&&"function"==typeof t.callee?"Arguments":i}(n)]},_t=nt("iterator"),Ot=!1;try{[7][_t]().return=function(){Ot=!0}}catch(n){}N(N.S+N.F*!function(n,t){if(!t&&!Ot)return!1;var r=!1;try{var i=[7],e=i[_t]();e.next=function(){return{done:r=!0}},i[_t]=function(){return e},n(i)}catch(n){}return r}(function(n){}),"Array",{from:function(n){var t,r,i,e,o=pn(n),u="function"==typeof this?this:Array,c=arguments.length,s=c>1?arguments[1]:void 0,f=void 0!==s,d=0,a=mt(o);if(f&&(s=x(s,c>2?arguments[2]:void 0,2)),void 0==a||u==Array&&function(n){return void 0!==n&&(Hn.Array===n||ht[lt]===n)}(a))for(r=new u(t=Z(o.length));t>d;d++)pt(r,d,f?s(o[d],d):o[d]);else for(e=a.call(o),r=new u;!(i=e.next()).done;d++)pt(r,d,f?function(n,t,r,i){try{return i?t(q(r)[0],r[1]):t(r)}catch(t){var e=n.return;throw void 0!==e&&q(e.call(n)),t}}(e,s,[i.value,d],!0):i.value);return r.length=d,r}});var jt=S.Array.from,wt=c(function(n){n.exports={default:jt,__esModule:!0}});u(wt);var Et=u(c(function(n,t){t.__esModule=!0;var r=function(n){return n&&n.__esModule?n:{default:n}}(wt);t.default=function(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return r.default(n)}})),St=u(c(function(n,t){t.__esModule=!0,t.default=function(n,t){var r={};for(var i in n)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r}})),xt=function(n,t){s(this,void 0);var r=n.observers,i=St(n,["observers"]);return _n({},i,{observers:[].concat(Et(r),[t])})}.bind(void 0),Tt=function(n,t,r){return s(this,void 0),g(n,On(xt(t,r)))}.bind(void 0),qt=function(n){return s(this,void 0),{request:n,observers:[],operationType:e.getOperationType(n.operation),subscriptionId:void 0}}.bind(void 0),At=function(n){s(this,void 0),n.phoenixSocket.isConnected()?Fn(n):n.phoenixSocket.connect()}.bind(void 0),Mt=function(n,t){s(this,void 0);var r=qt(t);return g(n,i.append([r])),n.channelJoinCreated?kn(n,r):At(n),r}.bind(void 0),Pt=function(n,t){return s(this,void 0),f(n.notifiers,"request",t)||Mt(n,t)}.bind(void 0),It=function(n,t){return s(this,void 0),function(r){s(this,void 0),t.next(r),"subscription"!==n.operationType&&t.complete()}.bind(this)}.bind(void 0),kt=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.onError,e=r.onStart,u=r.unsubscribe;return s(this,void 0),new o(function(r){return s(this,void 0),Tt(n,t,{onError:i,onStart:e,onAbort:r.error,onResult:It(t,r)}),u}.bind(this))}.bind(void 0),Ct=function(n,t){s(this,void 0);var r=n.observers,e=St(n,["observers"]);return _n({},e,{observers:i.remove(r.indexOf(t),1,r)})}.bind(void 0),Ft=function(n,t,r){return s(this,void 0),g(n,On(Ct(t,r))),n}.bind(void 0);n.cancel=j,n.create=Ln,n.observe=Tt,n.send=Pt,n.toObservable=kt,n.unobserve=Ft,Object.defineProperty(n,"__esModule",{value:!0})}); | |
//# sourceMappingURL=index.js.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment