@enface/js
Version:
Biometric researches
16 lines (14 loc) • 173 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Enface=t():e.Enface=t()}(this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=42)}([function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return M}),n.d(t,"b",function(){return h}),n.d(t,"c",function(){return I}),n.d(t,"d",function(){return B}),n.d(t,"e",function(){return G}),n.d(t,"f",function(){return z}),n.d(t,"g",function(){return A}),n.d(t,"h",function(){return C}),n.d(t,"i",function(){return g}),n.d(t,"j",function(){return N}),n.d(t,"k",function(){return k}),n.d(t,"l",function(){return R}),n.d(t,"m",function(){return j}),n.d(t,"n",function(){return _}),n.d(t,"o",function(){return x}),n.d(t,"p",function(){return f}),n.d(t,"q",function(){return H}),n.d(t,"r",function(){return w}),n.d(t,"s",function(){return E}),n.d(t,"t",function(){return d}),n.d(t,"u",function(){return y}),n.d(t,"v",function(){return v}),n.d(t,"w",function(){return m}),n.d(t,"x",function(){return Y}),n.d(t,"y",function(){return W}),n.d(t,"z",function(){return X}),n.d(t,"A",function(){return ee}),n.d(t,"B",function(){return te}),n.d(t,"C",function(){return U}),n.d(t,"D",function(){return V}),n.d(t,"E",function(){return p}),n.d(t,"F",function(){return O}),n.d(t,"G",function(){return c}),n.d(t,"H",function(){return b}),n.d(t,"I",function(){return $});var r=n(5),i=n(2),o=n(1),a=n(27),s=n.n(a);n(21);function u(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var o={};n.fields.map(function(e){return u(o,e.name,e.value,r)}),e[t.value]=o}else if(function(e){return"Variable"===e.kind}(n)){var a=(r||{})[n.name.value];e[t.value]=a}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map(function(e){var n={};return u(n,t,e,r),n[t.value]});else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw new i.a(17);e[t.value]=null}}function c(e,t){var n=null;e.directives&&(n={},e.directives.forEach(function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach(function(r){var i=r.name,o=r.value;return u(n[e.name.value],i,o,t)})}));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(function(e){var n=e.name,i=e.value;return u(r,n,i,t)})),f(e.name.value,r,n)}var l=["connection","include","skip","client","rest","export"];function f(e,t,n){if(n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i=t,o={};return r.forEach(function(e){o[e]=i[e]}),n.connection.key+"("+JSON.stringify(o)+")"}return n.connection.key}var a=e;if(t){var u=s()(t);a+="("+u+")"}return n&&Object.keys(n).forEach(function(e){-1===l.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@"+e+"("+JSON.stringify(n[e])+")":a+="@"+e)}),a}function h(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach(function(e){var r=e.name,i=e.value;return u(n,r,i,t)}),n}return null}function p(e){return e.alias?e.alias.value:e.name.value}function d(e){return"Field"===e.kind}function v(e){return"InlineFragment"===e.kind}function y(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function b(e,t){return void 0===t&&(t=!1),Object(o.a)({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function m(e){return null!=e&&"object"==typeof e&&"json"===e.type}function g(e,t){if(e.directives&&e.directives.length){var n={};return e.directives.forEach(function(e){n[e.name.value]=h(e,t)}),n}return null}function O(e,t){return void 0===t&&(t={}),(n=e.directives,n?n.filter(S).map(function(e){var t=e.arguments;e.name.value,Object(i.b)(t&&1===t.length,4);var n=t[0];Object(i.b)(n.name&&"if"===n.name.value,5);var r=n.value;return Object(i.b)(r&&("Variable"===r.kind||"BooleanValue"===r.kind),6),{directive:e,ifArgument:n}}):[]).every(function(e){var n=e.directive,r=e.ifArgument,o=!1;return"Variable"===r.value.kind?(o=t[r.value.name.value],Object(i.b)(void 0!==o,3)):o=r.value.value,"skip"===n.name.value?!o:o});var n}function E(e,t){return function(e){var t=[];return Object(r.b)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some(function(t){return e.indexOf(t)>-1})}function w(e){return e&&E(["client"],e)&&E(["export"],e)}function S(e){var t=e.name.value;return"skip"===t||"include"===t}function k(e,t){var n=t,r=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new i.a(1);"FragmentDefinition"===e.kind&&r.push(e)}),void 0===n&&(Object(i.b)(1===r.length,2),n=r[0].name.value),Object(o.a)({},e,{definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}].concat(e.definitions)})}function I(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach(function(t){null!=t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function T(e){Object(i.b)(e&&"Document"===e.kind,8);var t=e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new i.a(9);return e});return Object(i.b)(t.length<=1,10),e}function j(e){return T(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function _(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null}function N(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function x(e){var t=j(e);return Object(i.b)(t&&"query"===t.operation,12),t}function R(e){var t;T(e);for(var n=0,r=e.definitions;n<r.length;n++){var o=r[n];if("OperationDefinition"===o.kind){var a=o.operation;if("query"===a||"mutation"===a||"subscription"===a)return o}"FragmentDefinition"!==o.kind||t||(t=o)}if(t)return t;throw new i.a(16)}function A(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function C(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,n=e.defaultValue,r={};return u(r,t.name,n),r});return I.apply(void 0,[{}].concat(t))}return{}}function P(e,t,n){var r=0;return e.forEach(function(n,i){t.call(this,n,i,e)&&(e[r++]=n)},n),e.length=r,e}var L={kind:"Field",name:{kind:"Name",value:"__typename"}};function F(e){return function e(t,n){return t.selectionSet.selections.every(function(t){return"FragmentSpread"===t.kind&&e(n[t.name.value],n)})}(j(e)||function(e){Object(i.b)("Document"===e.kind,13),Object(i.b)(e.definitions.length<=1,14);var t=e.definitions[0];return Object(i.b)("FragmentDefinition"===t.kind,15),t}(e),A(N(e)))?null:e}function D(e){return function(t){return e.some(function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)})}}function Q(e,t){var n=Object.create(null),i=[],a=Object.create(null),s=[],u=F(Object(r.b)(t,{Variable:{enter:function(e,t,r){"VariableDefinition"!==r.kind&&(n[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some(function(e){return e.remove})&&t.directives&&t.directives.some(D(e))))return t.arguments&&t.arguments.forEach(function(e){"Variable"===e.value.kind&&i.push({name:e.value.name.value})}),t.selectionSet&&function e(t){var n=[];t.selections.forEach(function(t){(d(t)||v(t))&&t.selectionSet?e(t.selectionSet).forEach(function(e){return n.push(e)}):"FragmentSpread"===t.kind&&n.push(t)});return n}(t.selectionSet).forEach(function(e){s.push({name:e.name.value})}),null}},FragmentSpread:{enter:function(e){a[e.name.value]=!0}},Directive:{enter:function(t){if(D(e)(t))return null}}}));return u&&P(i,function(e){return!n[e.name]}).length&&(u=function(e,t){var n=function(e){return function(t){return e.some(function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))})}}(e);return F(Object(r.b)(t,{OperationDefinition:{enter:function(t){return Object(o.a)({},t,{variableDefinitions:t.variableDefinitions.filter(function(t){return!e.some(function(e){return e.name===t.variable.name.value})})})}},Field:{enter:function(t){var r=e.some(function(e){return e.remove});if(r){var i=0;if(t.arguments.forEach(function(e){n(e)&&(i+=1)}),1===i)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(i,u)),u&&P(s,function(e){return!a[e.name]}).length&&(u=function(e,t){function n(t){if(e.some(function(e){return e.name===t.name.value}))return null}return F(Object(r.b)(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(s,u)),u}function M(e){return Object(r.b)(T(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r)if(!r.some(function(e){return d(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))})){var i=n;if(!(d(i)&&i.directives&&i.directives.some(function(e){return"export"===e.name.value})))return Object(o.a)({},e,{selections:r.concat([L])})}}}}})}var q={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some(function(e){return"key"===e.name.value})),t}};function V(e){return Q([q],T(e))}function B(e){return"query"===R(e).operation?e:Object(r.b)(e,{OperationDefinition:{enter:function(e){return Object(o.a)({},e,{operation:"query"})}}})}function U(e){T(e);var t=Q([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Object(r.b)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every(function(e){return d(e)&&"__typename"===e.name.value}))return null}}})),t}var G="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),K=Object.prototype.toString;function z(e){return function e(t,n){switch(K.call(t)){case"[object Array]":if(n.has(t))return n.get(t);var r=t.slice(0);return n.set(t,r),r.forEach(function(t,i){r[i]=e(t,n)}),r;case"[object Object]":if(n.has(t))return n.get(t);var i=Object.create(Object.getPrototypeOf(t));return n.set(t,i),Object.keys(t).forEach(function(r){i[r]=e(t[r],n)}),i;default:return t}}(e,new Map)}function J(t){return(void 0!==e?"production":"development")===t}function Y(){return!0===J("production")}function W(){return!0===J("test")}function $(e){try{return e()}catch(e){console.error&&console.error(e)}}function H(e){return e.errors&&e.errors.length}function X(e){if((!0===J("development")||W())&&!("function"==typeof Symbol&&"string"==typeof Symbol("")))return function e(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(n){null===t[n]||"object"!=typeof t[n]&&"function"!=typeof t[n]||Object.isFrozen(t[n])||e(t[n])}),t}(e);return e}var Z=Object.prototype.hasOwnProperty;function ee(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return te(e)}function te(e){var t=e[0]||{},n=e.length;if(n>1){var r=[];t=ie(t,r);for(var i=1;i<n;++i)t=re(t,e[i],r)}return t}function ne(e){return null!==e&&"object"==typeof e}function re(e,t,n){return ne(t)&&ne(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=ie(e,n)),Object.keys(t).forEach(function(r){var i=t[r];if(Z.call(e,r)){var o=e[r];i!==o&&(e[r]=re(ie(o,n),i,n))}else e[r]=i}),e):t}function ie(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):Object(o.a)({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}Object.create({})}).call(this,n(15))},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return s});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function s(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return s}),n.d(t,"b",function(){return u});var r=n(1),i="Invariant Violation",o=Object.setPrototypeOf,a=void 0===o?function(e,t){return e.__proto__=t,e}:o,s=function(e){function t(n){void 0===n&&(n=i);var r=e.call(this,"number"==typeof n?i+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=i,a(r,t.prototype),r}return Object(r.c)(t,e),t}(Error);function u(e,t){if(!e)throw new s(t)}function c(e){return function(){return console[e].apply(console,arguments)}}!function(e){e.warn=c("warn"),e.error=c("error")}(u||(u={}));var l={env:{}};if("object"==typeof e)l=e;else try{Function("stub","process = stub")(l)}catch(e){}}).call(this,n(15))},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"})},function(e,t,n){"use strict";var r=n(26),i=n.n(r).a;t.a=i},function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a});var r=n(13),i={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},o=Object.freeze({});function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i,a=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,v=void 0,y=[],b=[],m=e;do{var g=++f===l.length,O=g&&0!==h.length;if(g){if(d=0===b.length?void 0:y[y.length-1],p=v,v=b.pop(),O){if(c)p=p.slice();else{for(var E={},w=0,S=Object.keys(p);w<S.length;w++){var k=S[w];E[k]=p[k]}p=E}for(var I=0,T=0;T<h.length;T++){var j=h[T][0],_=h[T][1];c&&(j-=I),c&&null===_?(p.splice(j,1),I++):p[j]=_}}f=a.index,l=a.keys,h=a.edits,c=a.inArray,a=a.prev}else{if(d=v?c?f:l[f]:void 0,null==(p=v?v[d]:m))continue;v&&y.push(d)}var N=void 0;if(!Array.isArray(p)){if(!s(p))throw new Error("Invalid AST Node: "+Object(r.a)(p));var x=u(t,p.kind,g);if(x){if((N=x.call(t,p,d,v,y,b))===o)break;if(!1===N){if(!g){y.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!g)){if(!s(N)){y.pop();continue}p=N}}}void 0===N&&O&&h.push([d,p]),g?y.pop():(a={inArray:c,index:f,keys:l,edits:h,prev:a},l=(c=Array.isArray(p))?p:n[p.kind]||[],f=-1,h=[],v&&b.push(v),v=p)}while(void 0!==a);return 0!==h.length&&(m=h[h.length-1][1]),m}function s(e){return Boolean(e&&"string"==typeof e.kind)}function u(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var i=n?r.leave:r.enter;if("function"==typeof i)return i}else{var o=n?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[t];if("function"==typeof a)return a}}}},function(e,t,n){e.exports=n(29)},function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},function(e,t,n){var r=n(43).parse;function i(e){return e.replace(/[\s,]+/g," ").trim()}var o={},a={};var s=!0;var u=!1;function c(e){var t=i(e);if(o[t])return o[t];var n=r(e,{experimentalFragmentVariables:u});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");return n=function e(t,n){var r=Object.prototype.toString.call(t);if("[object Array]"===r)return t.map(function(t){return e(t,n)});if("[object Object]"!==r)throw new Error("Unexpected input.");n&&t.loc&&delete t.loc,t.loc&&(delete t.loc.startToken,delete t.loc.endToken);var i,o,a,s=Object.keys(t);for(i in s)s.hasOwnProperty(i)&&(o=t[s[i]],"[object Object]"!==(a=Object.prototype.toString.call(o))&&"[object Array]"!==a||(t[s[i]]=e(o,!0)));return t}(n=function(e){for(var t,n={},r=[],o=0;o<e.definitions.length;o++){var u=e.definitions[o];if("FragmentDefinition"===u.kind){var c=u.name.value,l=i((t=u.loc).source.body.substring(t.start,t.end));a.hasOwnProperty(c)&&!a[c][l]?(s&&console.warn("Warning: fragment with name "+c+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"),a[c][l]=!0):a.hasOwnProperty(c)||(a[c]={},a[c][l]=!0),n[l]||(n[l]=!0,r.push(u))}else r.push(u)}return e.definitions=r,e}(n),!1),o[t]=n,n}function l(){for(var e=Array.prototype.slice.call(arguments),t=e[0],n="string"==typeof t?t:t[0],r=1;r<e.length;r++)e[r]&&e[r].kind&&"Document"===e[r].kind?n+=e[r].loc.source.body:n+=e[r],n+=t[r];return c(n)}l.default=l,l.resetCaches=function(){o={},a={}},l.disableFragmentWarnings=function(){s=!1},l.enableExperimentalFragmentVariables=function(){u=!0},l.disableExperimentalFragmentVariables=function(){u=!1},e.exports=l},function(e,t,n){"use strict";(function(e){n.d(t,"d",function(){return f}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return p}),n.d(t,"b",function(){return v});var r=n(6),i=n.n(r),o=n(11),a=n.n(o),s=n(19),u=n.n(s),c="object"===(void 0===e?"undefined":u()(e))&&"object"===u()(e.versions)&&void 0!==e.versions.node,l=function(){var e=a()(i.a.mark(function e(t){return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=new FileReader;r.onload=function(t){e(t.target.result)},r.onerror=function(e){n(e)},r.readAsArrayBuffer(t)}));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),f=function(e){return e.map(function(e,t){return e.name="".concat(t,".jpg"),e})},h=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)},p=function(){var e=a()(i.a.mark(function e(t,n,r){return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&Array.isArray(t)&&n===t.length){e.next=2;break}throw new Error("images array of length ".concat(n," required"));case 2:return e.abrupt("return",Promise.all(t.map(function(){var e=a()(i.a.mark(function e(t,n){return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t instanceof Uint8Array&&(t=t.buffer),t instanceof ArrayBuffer){e.next=9;break}if(c||!(t instanceof File)){e.next=8;break}return e.next=5,l(t);case 5:t=e.sent,e.next=9;break;case 8:throw new Error("image [".concat(n,"] is not an instance of ArrayBuffer"));case 9:if(!(t.byteLength<r)){e.next=11;break}throw new Error("image [".concat(n,"] is too small"));case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}())));case 3:case"end":return e.stop()}},e)}));return function(t,n,r){return e.apply(this,arguments)}}(),d=function(e){return e===Object(e)},v=function e(t,n){for(var r=0,i=Object.keys(t);r<i.length;r++){var o=i[r];delete t[n],d(t[o])&&(t[o]=e(t[o],n))}return t}}).call(this,n(15))},function(e,t,n){"use strict";n.r(t),n.d(t,"ApolloLink",function(){return g}),n.d(t,"concat",function(){return m}),n.d(t,"createOperation",function(){return h}),n.d(t,"empty",function(){return v}),n.d(t,"execute",function(){return O}),n.d(t,"from",function(){return y}),n.d(t,"fromError",function(){return f}),n.d(t,"fromPromise",function(){return l}),n.d(t,"makePromise",function(){return c}),n.d(t,"split",function(){return b}),n.d(t,"toPromise",function(){return u});var r=n(4);n.d(t,"Observable",function(){return r.a});var i=n(2),o=n(1),a=n(0);n.d(t,"getOperationName",function(){return a.n});!function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}Object(o.c)(t,e)}(Error);function s(e){return e.request.length<=1}function u(e){var t=!1;return new Promise(function(n,r){e.subscribe({next:function(e){t||(t=!0,n(e))},error:r})})}var c=u;function l(e){return new r.a(function(t){e.then(function(e){t.next(e),t.complete()}).catch(t.error.bind(t))})}function f(e){return new r.a(function(t){t.error(e)})}function h(e,t){var n=Object(o.a)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n="function"==typeof e?Object(o.a)({},n,e(n)):Object(o.a)({},n,e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Object(o.a)({},n)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,n=e.variables,r=e.operationName;return JSON.stringify([r,t,n])}(t)}}),t}function p(e,t){return t?t(e):r.a.of()}function d(e){return"function"==typeof e?new g(e):e}function v(){return new g(function(){return r.a.of()})}function y(e){return 0===e.length?v():e.map(d).reduce(function(e,t){return e.concat(t)})}function b(e,t,n){var i=d(t),o=d(n||new g(p));return s(i)&&s(o)?new g(function(t){return e(t)?i.request(t)||r.a.of():o.request(t)||r.a.of()}):new g(function(t,n){return e(t)?i.request(t,n)||r.a.of():o.request(t,n)||r.a.of()})}var m=function(e,t){var n=d(e);if(s(n))return n;var i=d(t);return s(i)?new g(function(e){return n.request(e,function(e){return i.request(e)||r.a.of()})||r.a.of()}):new g(function(e,t){return n.request(e,function(e){return i.request(e,t)||r.a.of()})||r.a.of()})},g=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,n,r){return this.concat(b(t,n,r||new e(p)))},e.prototype.concat=function(e){return m(this,e)},e.prototype.request=function(e,t){throw new i.a(1)},e.empty=v,e.from=y,e.split=b,e.execute=O,e}();function O(e,t){return e.request(h(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Object(a.n)(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(t.indexOf(o)<0)throw new i.a(2)}return e}(t))))||r.a.of()}},function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.a=r},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(12);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=10,a=2;function s(e){return u(e,[])}function u(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),i=function(e){var t=e[String(r.a)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var s=i.call(e);if(s!==e)return"string"==typeof s?s:u(s,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>a)return"[Array]";for(var n=Math.min(o,e.length),r=e.length-n,i=[],s=0;s<n;++s)i.push(u(e[s],t));1===r?i.push("... 1 more item"):r>1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>a)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n)return n}return t}(e)+"]";return"{ "+n.map(function(n){var r=u(e[n],t);return n+": "+r}).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}},function(e,t,n){"use strict";function r(e){var t=e.split(/\r\n|[\n\r]/g),n=function(e){for(var t=null,n=1;n<e.length;n++){var r=e[n],o=i(r);if(o!==r.length&&((null===t||o<t)&&0===(t=o)))break}return null===t?0:t}(t);if(0!==n)for(var r=1;r<t.length;r++)t[r]=t[r].slice(n);for(;t.length>0&&o(t[0]);)t.shift();for(;t.length>0&&o(t[t.length-1]);)t.pop();return t.join("\n")}function i(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function o(e){return i(e)===e.length}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a=!r||o||n,s="";return!a||r&&i||(s+="\n"+t),s+=t?e.replace(/\n/g,"\n"+t):e,a&&(s+="\n"),'"""'+s.replace(/"""/g,'\\"""')+'"""'}n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a})},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"print",function(){return o});var r=n(5),i=n(14);function o(e){return Object(r.b)(e,{leave:a})}var a={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return u(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=l("(",u(e.variableDefinitions,", "),")"),i=u(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?u([t,u([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+l(" = ",r)+l(" ",u(i," "))},SelectionSet:function(e){return c(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet;return u([l("",t,": ")+n+l("(",u(r,", "),")"),u(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+l(" ",u(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return u(["...",l("on ",t),u(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(l("(",u(r,", "),")")," ")+"on ".concat(n," ").concat(l("",u(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?Object(i.b)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+u(e.values,", ")+"]"},ObjectValue:function(e){return"{"+u(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+l("(",u(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var t=e.directives,n=e.operationTypes;return u(["schema",u(t," "),c(n)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:s(function(e){return u(["scalar",e.name,u(e.directives," ")]," ")}),ObjectTypeDefinition:s(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return u(["type",t,l("implements ",u(n," & ")),u(r," "),c(i)]," ")}),FieldDefinition:s(function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(p(n)?l("(\n",f(u(n,"\n")),"\n)"):l("(",u(n,", "),")"))+": "+r+l(" ",u(i," "))}),InputValueDefinition:s(function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return u([t+": "+n,l("= ",r),u(i," ")]," ")}),InterfaceTypeDefinition:s(function(e){var t=e.name,n=e.directives,r=e.fields;return u(["interface",t,u(n," "),c(r)]," ")}),UnionTypeDefinition:s(function(e){var t=e.name,n=e.directives,r=e.types;return u(["union",t,u(n," "),r&&0!==r.length?"= "+u(r," | "):""]," ")}),EnumTypeDefinition:s(function(e){var t=e.name,n=e.directives,r=e.values;return u(["enum",t,u(n," "),c(r)]," ")}),EnumValueDefinition:s(function(e){return u([e.name,u(e.directives," ")]," ")}),InputObjectTypeDefinition:s(function(e){var t=e.name,n=e.directives,r=e.fields;return u(["input",t,u(n," "),c(r)]," ")}),DirectiveDefinition:s(function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(p(n)?l("(\n",f(u(n,"\n")),"\n)"):l("(",u(n,", "),")"))+(r?" repeatable":"")+" on "+u(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return u(["extend schema",u(t," "),c(n)]," ")},ScalarTypeExtension:function(e){return u(["extend scalar",e.name,u(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return u(["extend type",t,l("implements ",u(n," & ")),u(r," "),c(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return u(["extend interface",t,u(n," "),c(r)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return u(["extend union",t,u(n," "),r&&0!==r.length?"= "+u(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return u(["extend enum",t,u(n," "),c(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return u(["extend input",t,u(n," "),c(r)]," ")}};function s(e){return function(t){return u([t.description,e(t)],"\n")}}function u(e,t){return e?e.filter(function(e){return e}).join(t||""):""}function c(e){return e&&0!==e.length?"{\n"+f(u(e,"\n"))+"\n}":""}function l(e,t,n){return t?e+t+(n||""):""}function f(e){return e&&" "+e.replace(/\n/g,"\n ")}function h(e){return-1!==e.indexOf("\n")}function p(e){return e&&e.some(h)}},function(e,t,n){"use strict";n.r(t),function(e,r){var i,o=n(28);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(o.a)(i);t.default=a}.call(this,n(16),n(38)(e))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t,n){"use strict";(function(e){var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=void 0!==e?e:"undefined"!=typeof window?window:{},s=a.WebSocket||a.MozWebSocket,u=n(33),c=n(34),l=n(35),f=n(36),h=n(17),p=n(37),d=n(18),v=n(39),y=n(40),b=n(41),m=function(){function e(e,t,n,r){var i=t||{},o=i.connectionCallback,a=void 0===o?void 0:o,l=i.connectionParams,f=void 0===l?{}:l,h=i.timeout,p=void 0===h?y.WS_TIMEOUT:h,d=i.reconnect,b=void 0!==d&&d,m=i.reconnectionAttempts,g=void 0===m?1/0:m,O=i.lazy,E=void 0!==O&&O,w=i.inactivityTimeout,S=void 0===w?0:w;if(this.wsImpl=n||s,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=r||v.GRAPHQL_WS,this.connectionCallback=a,this.url=e,this.operations={},this.nextOperationId=0,this.wsTimeout=p,this.unsentMessagesQueue=[],this.reconnect=b,this.reconnecting=!1,this.reconnectionAttempts=g,this.lazy=!!E,this.inactivityTimeout=S,this.closedByUser=!1,this.backoff=new u({jitter:.5}),this.eventEmitter=new c.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(f),this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return null===this.client?this.wsImpl.CLOSED:this.client.readyState},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0),this.clearInactivityTimeout(),null!==this.client&&(this.closedByUser=t,e&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,b.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client=null,this.eventEmitter.emit("disconnected"),e||this.tryReconnect())},e.prototype.request=function(e){var t,n,r=this.getObserver.bind(this),i=this.executeOperation.bind(this),o=this.unsubscribe.bind(this);return this.clearInactivityTimeout(),(t={})[d.default]=function(){return this},t.subscribe=function(t,a,s){var u=r(t,a,s);return n=i(e,function(e,t){null===e&&null===t?u.complete&&u.complete():e?u.error&&u.error(e[0]):u.next&&u.next(t)}),{unsubscribe:function(){n&&(o(n),n=null)}}},t},e.prototype.on=function(e,t,n){var r=this.eventEmitter.on(e,t,n);return function(){r.off(e,t,n)}},e.prototype.onConnected=function(e,t){return this.on("connected",e,t)},e.prototype.onConnecting=function(e,t){return this.on("connecting",e,t)},e.prototype.onDisconnected=function(e,t){return this.on("disconnected",e,t)},e.prototype.onReconnected=function(e,t){return this.on("reconnected",e,t)},e.prototype.onReconnecting=function(e,t){return this.on("reconnecting",e,t)},e.prototype.onError=function(e,t){return this.on("error",e,t)},e.prototype.unsubscribeAll=function(){var e=this;Object.keys(this.operations).forEach(function(t){e.unsubscribe(t)})},e.prototype.applyMiddlewares=function(e){var t=this;return new Promise(function(n,r){var i,o,a;i=t.middlewares.slice(),o=t,(a=function(t){if(t)r(t);else if(i.length>0){var s=i.shift();s&&s.applyMiddleware.apply(o,[e,a])}else n(e)})()})},e.prototype.use=function(e){var t=this;return e.map(function(e){if("function"!=typeof e.applyMiddleware)throw new Error("Middleware must implement the applyMiddleware function.");t.middlewares.push(e)}),this},e.prototype.getConnectionParams=function(e){return function(){return new Promise(function(t,n){if("function"==typeof e)try{return t(e.call(null))}catch(e){return n(e)}t(e)})}},e.prototype.executeOperation=function(e,t){var n=this;null===this.client&&this.connect();var r=this.generateOperationId();return this.operations[r]={options:e,handler:t},this.applyMiddlewares(e).then(function(e){n.checkOperationOptions(e,t),n.operations[r]&&(n.operations[r]={options:e,handler:t},n.sendMessage(r,b.default.GQL_START,e))}).catch(function(e){n.unsubscribe(r),t(n.formatErrors(e))}),r},e.prototype.getObserver=function(e,t,n){return"function"==typeof e?{next:function(t){return e(t)},error:function(e){return t&&t(e)},complete:function(){return n&&n()}}:e},e.prototype.createMaxConnectTimeGenerator=function(){var e=this.wsTimeout;return new u({min:1e3,max:e,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var e=this;this.inactivityTimeout>0&&0===Object.keys(this.operations).length&&(this.inactivityTimeoutId=setTimeout(function(){0===Object.keys(e.operations).length&&e.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(e,t){var n=e.query,r=e.variables,i=e.operationName;if(!n)throw new Error("Must provide a query.");if(!t)throw new Error("Must provide an handler.");if(!l.default(n)&&!p.getOperationAST(n,i)||i&&!l.default(i)||r&&!f.default(r))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(e,t,n){return{id:e,type:t,payload:n&&n.query?r({},n,{query:"string"==typeof n.query?n.query:h.print(n.query)}):n}},e.prototype.formatErrors=function(e){return Array.isArray(e)?e:e&&e.errors?this.formatErrors(e.errors):e&&e.message?[e]:[{name:"FormatedError",message:"Unknown error",originalError:e}]},e.prototype.sendMessage=function(e,t,n){this.sendMessageRaw(this.buildMessage(e,t,n))},e.prototype.sendMessageRaw=function(e){switch(this.status){case this.wsImpl.OPEN:var t=JSON.stringify(e);try{JSON.parse(t)}catch(t){this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+e))}this.client.send(t);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(e);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(e)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var e=this;if(this.reconnect&&!(this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(t){e.unsentMessagesQueue.push(e.buildMessage(t,b.default.GQL_START,e.operations[t].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var t=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){e.connect()},t)}},e.prototype.flushUnsentMessagesQueue=function(){var e=this;this.unsentMessagesQueue.forEach(function(t){e.sendMessageRaw(t)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){this.wasKeepAliveReceived?this.wasKeepAliveReceived=!1:this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var e=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){e.status!==e.wsImpl.OPEN&&(e.reconnecting=!0,e.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var e=this;this.client=new this.wsImpl(this.url,this.wsProtocols),this.checkMaxConnectTimeout(),this.client.onopen=function(){return i(e,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return e=n.sent(),this.sendMessage(void 0,b.default.GQL_CONNECTION_INIT,e),this.flushUnsentMessagesQueue(),[3,4];case 3:return t=n.sent(),this.sendMessage(void 0,b.default.GQL_CONNECTION_ERROR,t),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){e.closedByUser||e.close(!1,!1)},this.client.onerror=function(t){e.eventEmitter.emit("error",t)},this.client.onmessage=function(t){var n=t.data;e.processReceivedData(n)}},e.prototype.processReceivedData=function(e){var t,n;try{n=(t=JSON.parse(e)).id}catch(t){throw new Error("Message must be JSON-parseable. Got: "+e)}if(-1===[b.default.GQL_DATA,b.default.GQL_COMPLETE,b.default.GQL_ERROR].indexOf(t.type)||this.operations[n])switch(t.type){case b.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(t.payload);break;case b.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected"),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case b.default.GQL_COMPLETE:this.operations[n].handler(null,null),delete this.operations[n];break;case b.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(t.payload),null),delete this.operations[n];break;case b.default.GQL_DATA:var i=t.payload.errors?r({},t.payload,{errors:this.formatErrors(t.payload.errors)}):t.payload;this.operations[n].handler(null,i);break;case b.default.GQL_CONNECTION_KEEP_ALIVE:var o=void 0===this.wasKeepAliveReceived;this.wasKeepAliveReceived=!0,o&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}else this.unsubscribe(n)},e.prototype.unsubscribe=function(e){this.operations[e]&&(delete this.operations[e],this.setInactivityTimeout(),this.sendMessage(e,b.default.GQL_STOP,void 0))},e}();t.SubscriptionClient=m}).call(this,n(16))},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=Object.prototype,i=r.toString,o=r.hasOwnProperty,a=new Map;function s(e,t){try{return function e(t,n){if(t===n)return!0;var r=i.call(t);var a=i.call(n);if(r!==a)return!1;switch(r){case"[object Array]":if(t.length!==n.length)return!1;case"[object Object]":if(u(t,n))return!0;var s=Object.keys(t),c=Object.keys