-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathvuex-orm-graphql.global.prod.js
More file actions
15 lines (13 loc) · 193 KB
/
vuex-orm-graphql.global.prod.js
File metadata and controls
15 lines (13 loc) · 193 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var VuexORMGraphQLPlugin=function(e){"use strict";
/*! *****************************************************************************
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 t=function(e,n){return(t=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,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=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 i(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){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function o(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=a.trys,(i=i.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 a(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}var s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function u(e){return(u="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 c(e){return l(e,[])}function l(e,t){switch(u(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]),r=function(e){var t=e[String(s)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:l(i,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,i=[],o=0;o<n;++o)i.push(l(e[o],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>2)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&&""!==n)return n}return t}(e)+"]";return"{ "+n.map((function(n){return n+": "+l(e[n],t)})).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function f(e,t){if(!Boolean(e))throw new Error(t)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.prototype.toString;e.prototype.toJSON=t,e.prototype.inspect=t,s&&(e.prototype[s]=t)}function h(e){return(h="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 d(e,t){for(var n,r=/\r\n|[\n\r]/g,i=1,o=t+1;(n=r.exec(e.body))&&n.index<t;)i+=1,o=t+1-(n.index+n[0].length);return{line:i,column:o}}function v(e){return y(e.source,d(e.source,e.start))}function y(e,t){var n=e.locationOffset.column-1,r=g(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,u=t.column+s,c="".concat(e.name,":").concat(a,":").concat(u,"\n"),l=r.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){for(var p=Math.floor(u/80),h=u%80,d=[],v=0;v<f.length;v+=80)d.push(f.slice(v,v+80));return c+m([["".concat(a),d[0]]].concat(d.slice(1,p+1).map((function(e){return["",e]})),[[" ",g(h-1)+"^"],["",d[p+1]]]))}return c+m([["".concat(a-1),l[i-1]],["".concat(a),f],["",g(u-1)+"^"],["".concat(a+1),l[i+1]]])}function m(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),n=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,r=e[0],i=e[1];return g(n-(t=r).length)+t+(i?" | "+i:" |")})).join("\n")}function g(e){return Array(e+1).join(" ")}function b(e,t,n,r,i,o,a){var s=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,u=n;if(!u&&s){var c=s[0];u=c&&c.loc&&c.loc.source}var l,f=r;!f&&s&&(f=s.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),f&&0===f.length&&(f=void 0),r&&n?l=r.map((function(e){return d(n,e)})):s&&(l=s.reduce((function(e,t){return t.loc&&e.push(d(t.loc.source,t.loc.start)),e}),[]));var p,v=a;if(null==v&&null!=o){var y=o.extensions;"object"==h(p=y)&&null!==p&&(v=y)}Object.defineProperties(this,{message:{value:e,enumerable:!0,writable:!0},locations:{value:l||void 0,enumerable:Boolean(l)},path:{value:i||void 0,enumerable:Boolean(i)},nodes:{value:s||void 0},source:{value:u||void 0},positions:{value:f||void 0},originalError:{value:o},extensions:{value:v||void 0,enumerable:Boolean(v)}}),o&&o.stack?Object.defineProperty(this,"stack",{value:o.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,b):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}function E(e,t,n){return new b("Syntax Error: ".concat(n),void 0,e,[t])}b.prototype=Object.create(Error.prototype,{constructor:{value:b},name:{value:"GraphQLError"},toString:{value:function(){return function(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n<r.length;n++){var i=r[n];i.loc&&(t+="\n\n"+v(i.loc))}else if(e.source&&e.locations)for(var o=0,a=e.locations;o<a.length;o++){var s=a[o];t+="\n\n"+y(e.source,s)}return t}(this)}}});var w=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"});var _,O=function(e,t,n){this.body=e,this.name=t||"GraphQL request",this.locationOffset=n||{line:1,column:1},this.locationOffset.line>0||f(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||f(0,"column in locationOffset is 1-indexed and must be positive")};function k(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],i=N(r);if(i!==r.length&&((null===t||i<t)&&0===(t=i)))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&&S(t[0]);)t.shift();for(;t.length>0&&S(t[t.length-1]);)t.pop();return t.join("\n")}function N(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function S(e){return N(e)===e.length}_=O,"function"==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(_.prototype,Symbol.toStringTag,{get:function(){return this.constructor.name}});var T=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function I(){return this.lastToken=this.token,this.token=this.lookahead()}function x(){var e=this.token;if(e.kind!==T.EOF)do{e=e.next||(e.next=R(this,e))}while(e.kind===T.COMMENT);return e}function D(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}function A(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function R(e,t){var n=e.source,r=n.body,i=r.length,o=function(e,t,n){var r=e.length,i=t;for(;i<r;){var o=e.charCodeAt(i);if(9===o||32===o||44===o||65279===o)++i;else if(10===o)++i,++n.line,n.lineStart=i;else{if(13!==o)break;10===e.charCodeAt(i+1)?i+=2:++i,++n.line,n.lineStart=i}}return i}(r,t.end,e),a=e.line,s=1+o-e.lineStart;if(o>=i)return new D(T.EOF,i,i,a,s,t);var u=r.charCodeAt(o);switch(u){case 33:return new D(T.BANG,o,o+1,a,s,t);case 35:return function(e,t,n,r,i){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new D(T.COMMENT,t,s,n,r,i,a.slice(t+1,s))}(n,o,a,s,t);case 36:return new D(T.DOLLAR,o,o+1,a,s,t);case 38:return new D(T.AMP,o,o+1,a,s,t);case 40:return new D(T.PAREN_L,o,o+1,a,s,t);case 41:return new D(T.PAREN_R,o,o+1,a,s,t);case 46:if(46===r.charCodeAt(o+1)&&46===r.charCodeAt(o+2))return new D(T.SPREAD,o,o+3,a,s,t);break;case 58:return new D(T.COLON,o,o+1,a,s,t);case 61:return new D(T.EQUALS,o,o+1,a,s,t);case 64:return new D(T.AT,o,o+1,a,s,t);case 91:return new D(T.BRACKET_L,o,o+1,a,s,t);case 93:return new D(T.BRACKET_R,o,o+1,a,s,t);case 123:return new D(T.BRACE_L,o,o+1,a,s,t);case 124:return new D(T.PIPE,o,o+1,a,s,t);case 125:return new D(T.BRACE_R,o,o+1,a,s,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,t,n,r,i){var o=e.body,a=o.length,s=t+1,u=0;for(;s!==a&&!isNaN(u=o.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new D(T.NAME,t,s,n,r,i,o.slice(t,s))}(n,o,a,s,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,i,o){var a=e.body,s=n,u=t,c=!1;45===s&&(s=a.charCodeAt(++u));if(48===s){if((s=a.charCodeAt(++u))>=48&&s<=57)throw E(e,u,"Invalid number, unexpected digit after 0: ".concat(A(s),"."))}else u=M(e,u,s),s=a.charCodeAt(u);46===s&&(c=!0,s=a.charCodeAt(++u),u=M(e,u,s),s=a.charCodeAt(u));69!==s&&101!==s||(c=!0,43!==(s=a.charCodeAt(++u))&&45!==s||(s=a.charCodeAt(++u)),u=M(e,u,s),s=a.charCodeAt(u));if(46===s||69===s||101===s)throw E(e,u,"Invalid number, expected digit but got: ".concat(A(s),"."));return new D(c?T.FLOAT:T.INT,t,u,r,i,o,a.slice(t,u))}(n,o,u,a,s,t);case 34:return 34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)?function(e,t,n,r,i,o){var a=e.body,s=t+3,u=s,c=0,l="";for(;s<a.length&&!isNaN(c=a.charCodeAt(s));){if(34===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return l+=a.slice(u,s),new D(T.BLOCK_STRING,t,s+3,n,r,i,k(l));if(c<32&&9!==c&&10!==c&&13!==c)throw E(e,s,"Invalid character within String: ".concat(A(c),"."));10===c?(++s,++o.line,o.lineStart=s):13===c?(10===a.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(l+=a.slice(u,s)+'"""',u=s+=4):++s}throw E(e,s,"Unterminated string.")}(n,o,a,s,t,e):function(e,t,n,r,i){var o=e.body,a=t+1,s=a,u=0,c="";for(;a<o.length&&!isNaN(u=o.charCodeAt(a))&&10!==u&&13!==u;){if(34===u)return c+=o.slice(s,a),new D(T.STRING,t,a+1,n,r,i,c);if(u<32&&9!==u)throw E(e,a,"Invalid character within String: ".concat(A(u),"."));if(++a,92===u){switch(c+=o.slice(s,a-1),u=o.charCodeAt(a)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=(p=o.charCodeAt(a+1),h=o.charCodeAt(a+2),d=o.charCodeAt(a+3),v=o.charCodeAt(a+4),F(p)<<12|F(h)<<8|F(d)<<4|F(v));if(l<0){var f=o.slice(a+1,a+5);throw E(e,a,"Invalid character escape sequence: \\u".concat(f,"."))}c+=String.fromCharCode(l),a+=4;break;default:throw E(e,a,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++a,s=a}}var p,h,d,v;throw E(e,a,"Unterminated string.")}(n,o,a,s,t)}throw E(n,o,function(e){if(e<32&&9!==e&&10!==e&&13!==e)return"Cannot contain the invalid character ".concat(A(e),".");if(39===e)return"Unexpected single quote character ('), did you mean to use a double quote (\")?";return"Cannot parse the unexpected character ".concat(A(e),".")}(u))}function M(e,t,n){var r=e.body,i=t,o=n;if(o>=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw E(e,i,"Invalid number, expected digit but got: ".concat(A(o),"."))}function F(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}p(D,(function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}));var j=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function C(e,t){return new Q(e,t).parseDocument()}var Q=function(){function e(e,t){var n="string"==typeof e?new O(e):e;n instanceof O||f(0,"Must provide Source. Received: ".concat(c(n))),this._lexer=function(e,t){var n=new D(T.SOF,0,0,0,0,null);return{source:e,options:t,lastToken:n,token:n,line:1,lineStart:0,advance:I,lookahead:x}}(n),this._options=t||{}}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:w.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:w.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:w.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:w.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:w.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:w.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:w.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(T.COLON)?(e=r,t=this.parseName()):t=r,{kind:w.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:w.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:w.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:w.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:w.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e=this._lexer.token;return this.expectKeyword("fragment"),this._options.experimentalFragmentVariables?{kind:w.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}:{kind:w.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:w.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:w.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:return"true"===t.value||"false"===t.value?(this._lexer.advance(),{kind:w.BOOLEAN,value:"true"===t.value,loc:this.loc(t)}):"null"===t.value?(this._lexer.advance(),{kind:w.NULL,loc:this.loc(t)}):(this._lexer.advance(),{kind:w.ENUM,value:t.value,loc:this.loc(t)});case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:w.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:w.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:w.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(T.COLON),{kind:w.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:w.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:w.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:w.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:w.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token;this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:w.SCHEMA_DEFINITION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var n=this.parseNamedType();return{kind:w.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:w.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:w.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e=[];if(this.expectOptionalKeyword("implements")){this.expectOptionalToken(T.AMP);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this._options.allowLegacySDLImplementsInterfaces&&this.peek(T.NAME))}return e},t.parseFieldsDefinition=function(){return this._options.allowLegacySDLEmptyFields&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:w.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(T.COLON);var r,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(r=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:w.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:w.INTERFACE_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:w.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){var e=[];if(this.expectOptionalToken(T.EQUALS)){this.expectOptionalToken(T.PIPE);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(T.PIPE))}return e},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:w.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:w.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:w.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:w.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:w.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:w.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:w.INTERFACE_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:w.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:w.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:w.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:w.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){this.expectOptionalToken(T.PIPE);var e=[];do{e.push(this.parseDirectiveLocation())}while(this.expectOptionalToken(T.PIPE));return e},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==j[t.value])return t;throw this.unexpected(e)},t.loc=function(e){if(!this._options.noLocation)return new q(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw E(this._lexer.source,t.start,"Expected ".concat(e,", found ").concat(P(t)))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw E(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(P(t)));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=e||this._lexer.token;return E(this._lexer.source,t.start,"Unexpected ".concat(P(t)))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},e}();function q(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function P(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind}p(q,(function(){return{start:this.start,end:this.end}}));var V=Object.freeze({__proto__:null,parse:C,parseValue:function(e,t){var n=new Q(e,t);n.expectToken(T.SOF);var r=n.parseValueLiteral(!1);return n.expectToken(T.EOF),r},parseType:function(e,t){var n=new Q(e,t);n.expectToken(T.SOF);var r=n.parseTypeReference();return n.expectToken(T.EOF),r}}),L={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"]},$=Object.freeze({});function B(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L,r=void 0,i=Array.isArray(e),o=[e],a=-1,s=[],u=void 0,l=void 0,f=void 0,p=[],h=[],d=e;do{var v=++a===o.length,y=v&&0!==s.length;if(v){if(l=0===h.length?void 0:p[p.length-1],u=f,f=h.pop(),y){if(i)u=u.slice();else{for(var m={},g=0,b=Object.keys(u);g<b.length;g++){var E=b[g];m[E]=u[E]}u=m}for(var w=0,_=0;_<s.length;_++){var O=s[_][0],k=s[_][1];i&&(O-=w),i&&null===k?(u.splice(O,1),w++):u[O]=k}}a=r.index,o=r.keys,s=r.edits,i=r.inArray,r=r.prev}else{if(l=f?i?a:o[a]:void 0,null==(u=f?f[l]:d))continue;f&&p.push(l)}var N=void 0;if(!Array.isArray(u)){if(!U(u))throw new Error("Invalid AST Node: "+c(u));var S=G(t,u.kind,v);if(S){if((N=S.call(t,u,l,f,p,h))===$)break;if(!1===N){if(!v){p.pop();continue}}else if(void 0!==N&&(s.push([l,N]),!v)){if(!U(N)){p.pop();continue}u=N}}}void 0===N&&y&&s.push([l,u]),v?p.pop():(r={inArray:i,index:a,keys:o,edits:s,prev:r},o=(i=Array.isArray(u))?u:n[u.kind]||[],a=-1,s=[],f&&h.push(f),f=u)}while(void 0!==r);return 0!==s.length&&(d=s[s.length-1][1]),d}function U(e){return Boolean(e&&"string"==typeof e.kind)}function G(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 z(e){return B(e,{leave:K})}var K={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return W(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=H("(",W(e.variableDefinitions,", "),")"),i=W(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?W([t,W([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+H(" = ",r)+H(" ",W(i," "))},SelectionSet:function(e){return J(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet;return W([H("",t,": ")+n+H("(",W(r,", "),")"),W(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+H(" ",W(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return W(["...",H("on ",t),W(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(H("(",W(r,", "),")")," ")+"on ".concat(n," ").concat(H("",W(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?function(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,"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"["+W(e.values,", ")+"]"},ObjectValue:function(e){return"{"+W(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+H("(",W(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 W(["schema",W(t," "),J(n)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:Y((function(e){return W(["scalar",e.name,W(e.directives," ")]," ")})),ObjectTypeDefinition:Y((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return W(["type",t,H("implements ",W(n," & ")),W(r," "),J(i)]," ")})),FieldDefinition:Y((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(ee(n)?H("(\n",X(W(n,"\n")),"\n)"):H("(",W(n,", "),")"))+": "+r+H(" ",W(i," "))})),InputValueDefinition:Y((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return W([t+": "+n,H("= ",r),W(i," ")]," ")})),InterfaceTypeDefinition:Y((function(e){var t=e.name,n=e.directives,r=e.fields;return W(["interface",t,W(n," "),J(r)]," ")})),UnionTypeDefinition:Y((function(e){var t=e.name,n=e.directives,r=e.types;return W(["union",t,W(n," "),r&&0!==r.length?"= "+W(r," | "):""]," ")})),EnumTypeDefinition:Y((function(e){var t=e.name,n=e.directives,r=e.values;return W(["enum",t,W(n," "),J(r)]," ")})),EnumValueDefinition:Y((function(e){return W([e.name,W(e.directives," ")]," ")})),InputObjectTypeDefinition:Y((function(e){var t=e.name,n=e.directives,r=e.fields;return W(["input",t,W(n," "),J(r)]," ")})),DirectiveDefinition:Y((function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(ee(n)?H("(\n",X(W(n,"\n")),"\n)"):H("(",W(n,", "),")"))+(r?" repeatable":"")+" on "+W(i," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return W(["extend schema",W(t," "),J(n)]," ")},ScalarTypeExtension:function(e){return W(["extend scalar",e.name,W(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return W(["extend type",t,H("implements ",W(n," & ")),W(r," "),J(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return W(["extend interface",t,W(n," "),J(r)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return W(["extend union",t,W(n," "),r&&0!==r.length?"= "+W(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return W(["extend enum",t,W(n," "),J(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return W(["extend input",t,W(n," "),J(r)]," ")}};function Y(e){return function(t){return W([t.description,e(t)],"\n")}}function W(e,t){return e?e.filter((function(e){return e})).join(t||""):""}function J(e){return e&&0!==e.length?"{\n"+X(W(e,"\n"))+"\n}":""}function H(e,t,n){return t?e+t+(n||""):""}function X(e){return e&&" "+e.replace(/\n/g,"\n ")}function Z(e){return-1!==e.indexOf("\n")}function ee(e){return e&&e.some(Z)}var te="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ne(e,t){return e(t={exports:{}},t.exports),t.exports}var re=ne((function(e,t){var n="[object Arguments]",r="[object Map]",i="[object Object]",o="[object Set]",a=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[n]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[r]=u["[object Number]"]=u[i]=u["[object RegExp]"]=u[o]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof te&&te&&te.Object===Object&&te,l="object"==typeof self&&self&&self.Object===Object&&self,f=c||l||Function("return this")(),p=t&&!t.nodeType&&t,h=p&&e&&!e.nodeType&&e,d=h&&h.exports===p,v=d&&c.process,y=function(){try{return v&&v.binding&&v.binding("util")}catch(e){}}(),m=y&&y.isTypedArray;function g(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function b(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function E(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var w,_,O,k=Array.prototype,N=Function.prototype,S=Object.prototype,T=f["__core-js_shared__"],I=N.toString,x=S.hasOwnProperty,D=(w=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",A=S.toString,R=RegExp("^"+I.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=d?f.Buffer:void 0,F=f.Symbol,j=f.Uint8Array,C=S.propertyIsEnumerable,Q=k.splice,q=F?F.toStringTag:void 0,P=Object.getOwnPropertySymbols,V=M?M.isBuffer:void 0,L=(_=Object.keys,O=Object,function(e){return _(O(e))}),$=me(f,"DataView"),B=me(f,"Map"),U=me(f,"Promise"),G=me(f,"Set"),z=me(f,"WeakMap"),K=me(Object,"create"),Y=we($),W=we(B),J=we(U),H=we(G),X=we(z),Z=F?F.prototype:void 0,ee=Z?Z.valueOf:void 0;function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ie(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ie;++t<n;)this.add(e[t])}function ae(e){var t=this.__data__=new re(e);this.size=t.size}function se(e,t){var n=ke(e),r=!n&&Oe(e),i=!n&&!r&&Ne(e),o=!n&&!r&&!i&&De(e),a=n||r||i||o,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=s.length;for(var c in e)!t&&!x.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ee(c,u))||s.push(c);return s}function ue(e,t){for(var n=e.length;n--;)if(_e(e[n][0],t))return n;return-1}function ce(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":q&&q in Object(e)?function(e){var t=x.call(e,q),n=e[q];try{e[q]=void 0;var r=!0}catch(e){}var i=A.call(e);r&&(t?e[q]=n:delete e[q]);return i}(e):function(e){return A.call(e)}(e)}function le(e){return xe(e)&&ce(e)==n}function fe(e,t,a,s,u){return e===t||(null==e||null==t||!xe(e)&&!xe(t)?e!=e&&t!=t:function(e,t,a,s,u,c){var l=ke(e),f=ke(t),p=l?"[object Array]":be(e),h=f?"[object Array]":be(t),d=(p=p==n?i:p)==i,v=(h=h==n?i:h)==i,y=p==h;if(y&&Ne(e)){if(!Ne(t))return!1;l=!0,d=!1}if(y&&!d)return c||(c=new ae),l||De(e)?de(e,t,a,s,u,c):function(e,t,n,i,a,s,u){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new j(e),new j(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return _e(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case r:var c=b;case o:var l=1&i;if(c||(c=E),e.size!=t.size&&!l)return!1;var f=u.get(e);if(f)return f==t;i|=2,u.set(e,t);var p=de(c(e),c(t),i,a,s,u);return u.delete(e),p;case"[object Symbol]":if(ee)return ee.call(e)==ee.call(t)}return!1}(e,t,p,a,s,u,c);if(!(1&a)){var m=d&&x.call(e,"__wrapped__"),g=v&&x.call(t,"__wrapped__");if(m||g){var w=m?e.value():e,_=g?t.value():t;return c||(c=new ae),u(w,_,a,s,c)}}if(!y)return!1;return c||(c=new ae),function(e,t,n,r,i,o){var a=1&n,s=ve(e),u=s.length,c=ve(t).length;if(u!=c&&!a)return!1;var l=u;for(;l--;){var f=s[l];if(!(a?f in t:x.call(t,f)))return!1}var p=o.get(e);if(p&&o.get(t))return p==t;var h=!0;o.set(e,t),o.set(t,e);var d=a;for(;++l<u;){f=s[l];var v=e[f],y=t[f];if(r)var m=a?r(y,v,f,t,e,o):r(v,y,f,e,t,o);if(!(void 0===m?v===y||i(v,y,n,r,o):m)){h=!1;break}d||(d="constructor"==f)}if(h&&!d){var g=e.constructor,b=t.constructor;g==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(h=!1)}return o.delete(e),o.delete(t),h}(e,t,a,s,u,c)}(e,t,a,s,fe,u))}function pe(e){return!(!Ie(e)||function(e){return!!D&&D in e}(e))&&(Se(e)?R:a).test(we(e))}function he(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||S,t!==r)return L(e);var t,n,r,i=[];for(var o in Object(e))x.call(e,o)&&"constructor"!=o&&i.push(o);return i}function de(e,t,n,r,i,o){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=o.get(e);if(c&&o.get(t))return c==t;var l=-1,f=!0,p=2&n?new oe:void 0;for(o.set(e,t),o.set(t,e);++l<s;){var h=e[l],d=t[l];if(r)var v=a?r(d,h,l,t,e,o):r(h,d,l,e,t,o);if(void 0!==v){if(v)continue;f=!1;break}if(p){if(!g(t,(function(e,t){if(a=t,!p.has(a)&&(h===e||i(h,e,n,r,o)))return p.push(t);var a}))){f=!1;break}}else if(h!==d&&!i(h,d,n,r,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function ve(e){return function(e,t,n){var r=t(e);return ke(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,Ae,ge)}function ye(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return pe(n)?n:void 0}ne.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return x.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:x.call(t,e)},ne.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=K&&void 0===t?"__lodash_hash_undefined__":t,this},re.prototype.clear=function(){this.__data__=[],this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():Q.call(t,n,1),--this.size,!0)},re.prototype.get=function(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]},re.prototype.has=function(e){return ue(this.__data__,e)>-1},re.prototype.set=function(e,t){var n=this.__data__,r=ue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ie.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(B||re),string:new ne}},ie.prototype.delete=function(e){var t=ye(this,e).delete(e);return this.size-=t?1:0,t},ie.prototype.get=function(e){return ye(this,e).get(e)},ie.prototype.has=function(e){return ye(this,e).has(e)},ie.prototype.set=function(e,t){var n=ye(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},oe.prototype.add=oe.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},oe.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.clear=function(){this.__data__=new re,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!B||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ie(r)}return n.set(e,t),this.size=n.size,this};var ge=P?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}(P(e),(function(t){return C.call(e,t)})))}:function(){return[]},be=ce;function Ee(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||s.test(e))&&e>-1&&e%1==0&&e<t}function we(e){if(null!=e){try{return I.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function _e(e,t){return e===t||e!=e&&t!=t}($&&"[object DataView]"!=be(new $(new ArrayBuffer(1)))||B&&be(new B)!=r||U&&"[object Promise]"!=be(U.resolve())||G&&be(new G)!=o||z&&"[object WeakMap]"!=be(new z))&&(be=function(e){var t=ce(e),n=t==i?e.constructor:void 0,a=n?we(n):"";if(a)switch(a){case Y:return"[object DataView]";case W:return r;case J:return"[object Promise]";case H:return o;case X:return"[object WeakMap]"}return t});var Oe=le(function(){return arguments}())?le:function(e){return xe(e)&&x.call(e,"callee")&&!C.call(e,"callee")},ke=Array.isArray;var Ne=V||function(){return!1};function Se(e){if(!Ie(e))return!1;var t=ce(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Te(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ie(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var De=m?function(e){return function(t){return e(t)}}(m):function(e){return xe(e)&&Te(e.length)&&!!u[ce(e)]};function Ae(e){return null!=(t=e)&&Te(t.length)&&!Se(t)?se(e):he(e);var t}e.exports=function(e,t){return fe(e,t)}})),ie=ne((function(e,t){var n="[object Arguments]",r="[object Function]",i="[object GeneratorFunction]",o="[object Map]",a="[object Set]",s=/\w*$/,u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l[n]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object DataView]"]=l["[object Boolean]"]=l["[object Date]"]=l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l[o]=l["[object Number]"]=l["[object Object]"]=l["[object RegExp]"]=l[a]=l["[object String]"]=l["[object Symbol]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l["[object Error]"]=l[r]=l["[object WeakMap]"]=!1;var f="object"==typeof te&&te&&te.Object===Object&&te,p="object"==typeof self&&self&&self.Object===Object&&self,h=f||p||Function("return this")(),d=t&&!t.nodeType&&t,v=d&&e&&!e.nodeType&&e,y=v&&v.exports===d;function m(e,t){return e.set(t[0],t[1]),e}function g(e,t){return e.add(t),e}function b(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function E(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function w(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function _(e,t){return function(n){return e(t(n))}}function O(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var k,N=Array.prototype,S=Function.prototype,T=Object.prototype,I=h["__core-js_shared__"],x=(k=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",D=S.toString,A=T.hasOwnProperty,R=T.toString,M=RegExp("^"+D.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=y?h.Buffer:void 0,j=h.Symbol,C=h.Uint8Array,Q=_(Object.getPrototypeOf,Object),q=Object.create,P=T.propertyIsEnumerable,V=N.splice,L=Object.getOwnPropertySymbols,$=F?F.isBuffer:void 0,B=_(Object.keys,Object),U=ye(h,"DataView"),G=ye(h,"Map"),z=ye(h,"Promise"),K=ye(h,"Set"),Y=ye(h,"WeakMap"),W=ye(Object,"create"),J=we(U),H=we(G),X=we(z),Z=we(K),ee=we(Y),ne=j?j.prototype:void 0,re=ne?ne.valueOf:void 0;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function se(e){this.__data__=new oe(e)}function ue(e,t){var r=Oe(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&ke(e)}(e)&&A.call(e,"callee")&&(!P.call(e,"callee")||R.call(e)==n)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],i=r.length,o=!!i;for(var a in e)!t&&!A.call(e,a)||o&&("length"==a||be(a,i))||r.push(a);return r}function ce(e,t,n){var r=e[t];A.call(e,t)&&_e(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function le(e,t){for(var n=e.length;n--;)if(_e(e[n][0],t))return n;return-1}function fe(e,t,u,c,f,p,h){var d;if(c&&(d=p?c(e,f,p,h):c(e)),void 0!==d)return d;if(!Te(e))return e;var v=Oe(e);if(v){if(d=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&A.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,d)}else{var y=ge(e),_=y==r||y==i;if(Ne(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if("[object Object]"==y||y==n||_&&!p){if(E(e))return p?e:{};if(d=function(e){return"function"!=typeof e.constructor||Ee(e)?{}:(t=Q(e),Te(t)?q(t):{});var t}(_?{}:e),!t)return function(e,t){return de(e,me(e),t)}(e,function(e,t){return e&&de(t,Ie(t),e)}(d,e))}else{if(!l[y])return p?e:{};d=function(e,t,n,r){var i=e.constructor;switch(t){case"[object ArrayBuffer]":return he(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?he(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?he(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case o:return function(e,t,n){return b(t?n(w(e),!0):w(e),m,new e.constructor)}(e,r,n);case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,s.exec(e));return t.lastIndex=e.lastIndex,t}(e);case a:return function(e,t,n){return b(t?n(O(e),!0):O(e),g,new e.constructor)}(e,r,n);case"[object Symbol]":return u=e,re?Object(re.call(u)):{}}var u}(e,y,fe,t)}}h||(h=new se);var k=h.get(e);if(k)return k;if(h.set(e,d),!v)var N=u?function(e){return function(e,t,n){var r=t(e);return Oe(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,Ie,me)}(e):Ie(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(N||e,(function(n,r){N&&(n=e[r=n]),ce(d,r,fe(n,t,u,c,r,e,h))})),d}function pe(e){return!(!Te(e)||(t=e,x&&x in t))&&(Se(e)||E(e)?M:u).test(we(e));var t}function he(e){var t=new e.constructor(e.byteLength);return new C(t).set(new C(e)),t}function de(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r?r(n[a],e[a],a,n,e):void 0;ce(n,a,void 0===s?e[a]:s)}return n}function ve(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ye(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return pe(n)?n:void 0}ie.prototype.clear=function(){this.__data__=W?W(null):{}},ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ie.prototype.get=function(e){var t=this.__data__;if(W){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return A.call(t,e)?t[e]:void 0},ie.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:A.call(t,e)},ie.prototype.set=function(e,t){return this.__data__[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this},oe.prototype.clear=function(){this.__data__=[]},oe.prototype.delete=function(e){var t=this.__data__,n=le(t,e);return!(n<0)&&(n==t.length-1?t.pop():V.call(t,n,1),!0)},oe.prototype.get=function(e){var t=this.__data__,n=le(t,e);return n<0?void 0:t[n][1]},oe.prototype.has=function(e){return le(this.__data__,e)>-1},oe.prototype.set=function(e,t){var n=this.__data__,r=le(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ae.prototype.clear=function(){this.__data__={hash:new ie,map:new(G||oe),string:new ie}},ae.prototype.delete=function(e){return ve(this,e).delete(e)},ae.prototype.get=function(e){return ve(this,e).get(e)},ae.prototype.has=function(e){return ve(this,e).has(e)},ae.prototype.set=function(e,t){return ve(this,e).set(e,t),this},se.prototype.clear=function(){this.__data__=new oe},se.prototype.delete=function(e){return this.__data__.delete(e)},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this;n=this.__data__=new ae(r)}return n.set(e,t),this};var me=L?_(L,Object):function(){return[]},ge=function(e){return R.call(e)};function be(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||c.test(e))&&e>-1&&e%1==0&&e<t}function Ee(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||T)}function we(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function _e(e,t){return e===t||e!=e&&t!=t}(U&&"[object DataView]"!=ge(new U(new ArrayBuffer(1)))||G&&ge(new G)!=o||z&&"[object Promise]"!=ge(z.resolve())||K&&ge(new K)!=a||Y&&"[object WeakMap]"!=ge(new Y))&&(ge=function(e){var t=R.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?we(n):void 0;if(r)switch(r){case J:return"[object DataView]";case H:return o;case X:return"[object Promise]";case Z:return a;case ee:return"[object WeakMap]"}return t});var Oe=Array.isArray;function ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!Se(e)}var Ne=$||function(){return!1};function Se(e){var t=Te(e)?R.call(e):"";return t==r||t==i}function Te(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ie(e){return ke(e)?ue(e):function(e){if(!Ee(e))return B(e);var t=[];for(var n in Object(e))A.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return fe(e,!1,!0)}})),oe=ne((function(e,t){!function(t,n){e.exports=n()}(0,(function(){var e=[],t=[],n={},r={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function u(e,t){return e.replace(t[0],(function(n,r){var i=s(t[1],arguments);return a(""===n?e[r-1]:n,i)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var i=r.length;i--;){var o=r[i];if(o[0].test(t))return u(t,o)}return t}function l(e,t,n){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?a(r,i):e.hasOwnProperty(i)?a(r,e[i]):c(i,r,n)}}function f(e,t,n,r){return function(r){var i=r.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&c(i,i,n)===i}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=l(i,r,e),p.isPlural=f(i,r,e),p.singular=l(r,i,t),p.isSingular=f(r,i,t),p.addPluralRule=function(t,n){e.push([o(t),n])},p.addSingularRule=function(e,n){t.push([o(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["whiskey","whiskies"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|tlas|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/(m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/(m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i,"$1"],[/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","alcohol","ammo","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","flounder","fun","gallows","garbage","graffiti","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","manga","news","pike","plankton","pliers","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","species","staff","swine","tennis","traffic","transporation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}))})),ae=oe.plural,se=oe.singular;function ue(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ce(e){return e.charAt(0).toLowerCase()+e.slice(1)}function le(e){return z(fe(e))}function fe(e){return"string"==typeof e?C(e):e}function pe(e){return e.loc.source.body}function he(e){return null!==e&&!(e instanceof Array)&&"object"==typeof e}function de(e,t){if(!e)return{};for(var n=-1,r=t.length,i={};++n<r;){var o=t[n];i[o]=e[o]}return i}function ve(e,t){return re(e,t)}function ye(e){return ie(e)}function me(e){return null===e?0:"string"!=typeof e||!e.startsWith("$uid")&&null===/[a-f0-9]{8}(?:-?[a-f0-9]{4}){3}-?[a-f0-9]{12}/i.exec(e)?parseInt(e.toString(),10):e}var ge=function(){function e(e){this.PREFIX=["%c Vuex-ORM: GraphQL Plugin %c","background: #35495e; padding: 1px 0; border-radius: 3px; color: #eee;","background: transparent;"],this.enabled=e,this.log("Logging is enabled.")}return e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(console.groupCollapsed?console.groupCollapsed.apply(console,a(this.PREFIX,e)):console.log.apply(console,a(this.PREFIX,e)))},e.prototype.groupEnd=function(){this.enabled&&console.groupEnd&&console.groupEnd()},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&console.log.apply(console,a(this.PREFIX,e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&console.warn.apply(console,a(this.PREFIX,e))},e.prototype.logQuery=function(e,t,n){if(this.enabled)try{var r="";r=he(e)&&e.loc?le(e.loc.source.body):le(e),this.group("Sending query:",r.split("\n")[1].replace("{","").trim()),console.log(r),t&&console.log("VARIABLES:",t),n&&console.log("FETCH POLICY:",n),this.groupEnd()}catch(t){console.error("[Vuex-ORM-Apollo] There is a syntax error in the query!",t,e)}},e}(),be=function(){function e(e){var t=this;this.fields=new Map,this.mocks={},this.baseModel=e,this.singularName=this.baseModel.singularName||se(this.baseModel.entity),this.pluralName=this.baseModel.pluralName||ae(this.baseModel.entity);var n=this.baseModel.fields();Object.keys(n).forEach((function(e){t.fields.set(e,n[e])}))}return e.isFieldNumber=function(e){if(!e)return!1;var t=_r.getInstance();return e instanceof t.components.Number||e instanceof t.components.Uid},e.isFieldAttribute=function(e){var t=_r.getInstance();return e instanceof t.components.Uid||e instanceof t.components.Attr||e instanceof t.components.String||e instanceof t.components.Number||e instanceof t.components.Boolean},e.isConnection=function(e){var t=_r.getInstance();return!(e instanceof t.components.BelongsTo||e instanceof t.components.HasOne||e instanceof t.components.MorphTo||e instanceof t.components.MorphOne)},e.augment=function(e){var t=e.baseModel;t.getFields(),t.cachedFields[t.entity].$isPersisted=t.boolean(!1)},e.getRelatedModel=function(e){if(void 0===e)return null;var t=_r.getInstance();if(e instanceof t.components.BelongsToMany||e instanceof t.components.HasMany||e instanceof t.components.HasManyThrough||e instanceof t.components.MorphedByMany||e instanceof t.components.MorphMany||e instanceof t.components.MorphOne||e instanceof t.components.MorphToMany||e instanceof t.components.HasOne)return t.getModel(e.related.entity,!0);if(e instanceof t.components.BelongsTo||e instanceof t.components.HasManyBy)return t.getModel(e.parent.entity,!0);if(e instanceof t.components.MorphTo)return t.getModel(e.type,!0);throw console.warn("Failed relation",typeof e,e),new Error("Can't find related model for relation of type "+typeof e+"!")},e.prototype.getQueryFields=function(){var t=this,n=[];return this.fields.forEach((function(r,i){e.isFieldAttribute(r)&&!t.skipField(i)&&n.push(i)})),n},e.prototype.skipField=function(e){if(e.startsWith("$"))return!0;if(this.baseModel.skipFields&&this.baseModel.skipFields.indexOf(e)>=0)return!0;var t=_r.getInstance(),n=!1;return this.getRelations().forEach((function(r){return!(r instanceof t.components.BelongsTo||r instanceof t.components.HasOne)||r.foreignKey!==e||(n=!0,!1)})),n},e.prototype.getRelations=function(){var t=new Map;return this.fields.forEach((function(n,r){e.isFieldAttribute(n)||t.set(r,n)})),t},e.prototype.isTypeFieldOfPolymorphicRelation=function(e){var t=this,n=_r.getInstance(),r=!1;return n.models.forEach((function(i){return!r&&(i.getRelations().forEach((function(i){if(i instanceof n.components.MorphMany||i instanceof n.components.MorphedByMany||i instanceof n.components.MorphOne||i instanceof n.components.MorphTo||i instanceof n.components.MorphToMany){var o=i.related;if(i.type===e&&o&&o.entity===t.baseModel.entity)return r=!0,!1}return!0})),!0)})),r},e.prototype.getRecordWithId=function(e){return this.baseModel.query().withAllRecursive().where("id",me(e)).first()},e.prototype.shouldEagerLoadRelation=function(e,t,n){var r=_r.getInstance();if(t instanceof r.components.HasOne||t instanceof r.components.BelongsTo||t instanceof r.components.MorphOne)return!0;var i=this.baseModel.eagerLoad||[];return Array.prototype.push.apply(i,this.baseModel.eagerSync||[]),void 0!==i.find((function(t){return t===n.singularName||t===n.pluralName||t===e}))},e.prototype.shouldEagerSaveRelation=function(e,t,n){if(t instanceof _r.getInstance().components.BelongsTo)return!0;var r=this.baseModel.eagerSave||[];return Array.prototype.push.apply(r,this.baseModel.eagerSync||[]),void 0!==r.find((function(t){return t===n.singularName||t===n.pluralName||t===e}))},e.prototype.$addMock=function(e){return!this.$findMock(e.action,e.options)&&(this.mocks[e.action]||(this.mocks[e.action]=[]),this.mocks[e.action].push(e),!0)},e.prototype.$findMock=function(e,t){return this.mocks[e]&&this.mocks[e].find((function(e){return!e.options||!t||ve(de(t,Object.keys(e.options)),e.options||{})}))||null},e.prototype.$mockHook=function(e,t){var n,r=null,i=this.$findMock(e,t);return i&&(r=i.returnValue instanceof Function?i.returnValue():i.returnValue||null),r?(r instanceof Array?r.forEach((function(e){return e.$isPersisted=!0})):r.$isPersisted=!0,(n={})[this.pluralName]=r,n):null},e}(),Ee=Object.setPrototypeOf,we=void 0===Ee?function(e,t){return e.__proto__=t,e}:Ee,_e=function(e){function t(n){void 0===n&&(n="Invariant Violation");var r=e.call(this,"number"==typeof n?"Invariant Violation: "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name="Invariant Violation",we(r,t.prototype),r}return n(t,e),t}(Error);function Oe(e,t){if(!e)throw new _e(t)}function ke(e){return function(){return console[e].apply(console,arguments)}}!function(e){e.warn=ke("warn"),e.error=ke("error")}(Oe||(Oe={}));var Ne={env:{}};if("object"==typeof process)Ne=process;else try{Function("stub","process = stub")(Ne)}catch(e){}var Se=Object.prototype,Te=Se.toString,Ie=Se.hasOwnProperty,xe=new Map;function De(e,t){try{return function e(t,n){if(t===n)return!0;var r=Te.call(t),i=Te.call(n);if(r!==i)return!1;switch(r){case"[object Array]":if(t.length!==n.length)return!1;case"[object Object]":if(Ae(t,n))return!0;var o=Object.keys(t),a=Object.keys(n),s=o.length;if(s!==a.length)return!1;for(var u=0;u<s;++u)if(!Ie.call(n,o[u]))return!1;for(u=0;u<s;++u){var c=o[u];if(!e(t[c],n[c]))return!1}return!0;case"[object Error]":return t.name===n.name&&t.message===n.message;case"[object Number]":if(t!=t)return n!=n;case"[object Boolean]":case"[object Date]":return+t==+n;case"[object RegExp]":case"[object String]":return t==""+n;case"[object Map]":case"[object Set]":if(t.size!==n.size)return!1;if(Ae(t,n))return!0;for(var l=t.entries(),f="[object Map]"===r;;){var p=l.next();if(p.done)break;var h=p.value,d=h[0],v=h[1];if(!n.has(d))return!1;if(f&&!e(v,n.get(d)))return!1}return!0}return!1}(e,t)}finally{xe.clear()}}function Ae(e,t){var n=xe.get(e);if(n){if(n.has(t))return!0}else xe.set(e,n=new Set);return n.add(t),!1}function Re(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 i={};n.fields.map((function(e){return Re(i,e.name,e.value,r)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(n)){var o=(r||{})[n.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return Re(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"production"===process.env.NODE_ENV?new _e(17):new _e('The inline argument "'+t.value+'" of kind "'+n.kind+'"is not supported. Use variables instead of inline arguments to overcome this limitation.');e[t.value]=null}}var Me=["connection","include","skip","client","rest","export"];function Fe(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 s=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n<t.length;n++)n&&(a+=","),a+=e(t[n])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(a="",n=0;n<u.length;n++){var c=u[n],l=e(t[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+a+"}"}}(e)}(t);a+="("+s+")"}return n&&Object.keys(n).forEach((function(e){-1===Me.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@"+e+"("+JSON.stringify(n[e])+")":a+="@"+e)})),a}function je(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return Re(n,r,i,t)})),n}return null}function Ce(e){return e.alias?e.alias.value:e.name.value}function Qe(e){return"Field"===e.kind}function qe(e){return"InlineFragment"===e.kind}function Pe(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function Ve(e,t){return void 0===t&&(t=!1),r({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function Le(e,t){if(e.directives&&e.directives.length){var n={};return e.directives.forEach((function(e){n[e.name.value]=je(e,t)})),n}return null}function $e(e,t){return void 0===t&&(t={}),(n=e.directives,n?n.filter(Ge).map((function(e){var t=e.arguments,n=e.name.value;"production"===process.env.NODE_ENV?Oe(t&&1===t.length,2):Oe(t&&1===t.length,"Incorrect number of arguments for the @"+n+" directive.");var r=t[0];"production"===process.env.NODE_ENV?Oe(r.name&&"if"===r.name.value,3):Oe(r.name&&"if"===r.name.value,"Invalid argument for the @"+n+" directive.");var i=r.value;return"production"===process.env.NODE_ENV?Oe(i&&("Variable"===i.kind||"BooleanValue"===i.kind),4):Oe(i&&("Variable"===i.kind||"BooleanValue"===i.kind),"Argument for the @"+n+" directive must be a variable or a boolean value."),{directive:e,ifArgument:r}})):[]).every((function(e){var n=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=t[r.value.name.value],"production"===process.env.NODE_ENV?Oe(void 0!==i,1):Oe(void 0!==i,"Invalid variable referenced in @"+n.name.value+" directive.")):i=r.value.value,"skip"===n.name.value?!i:i}));var n}function Be(e,t){return function(e){var t=[];return B(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function Ue(e){return e&&Be(["client"],e)&&Be(["export"],e)}function Ge(e){var t=e.name.value;return"skip"===t||"include"===t}function ze(e,t){var n=t,i=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw"production"===process.env.NODE_ENV?new _e(5):new _e("Found a "+e.operation+" operation"+(e.name?" named '"+e.name.value+"'":"")+". No operations are allowed when using a fragment as a query. Only fragments are allowed.");"FragmentDefinition"===e.kind&&i.push(e)})),void 0===n&&("production"===process.env.NODE_ENV?Oe(1===i.length,6):Oe(1===i.length,"Found "+i.length+" fragments. `fragmentName` must be provided when there is not exactly 1 fragment."),n=i[0].name.value),r(r({},e),{definitions:a([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions)})}function Ke(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 Ye(e){"production"===process.env.NODE_ENV?Oe(e&&"Document"===e.kind,8):Oe(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql');var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw"production"===process.env.NODE_ENV?new _e(9):new _e('Schema type definitions not allowed in queries. Found: "'+e.kind+'"');return e}));return"production"===process.env.NODE_ENV?Oe(t.length<=1,10):Oe(t.length<=1,"Ambiguous GraphQL document: contains "+t.length+" operations"),e}function We(e){return Ye(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Je(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function He(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Xe(e){var t;Ye(e);for(var n=0,r=e.definitions;n<r.length;n++){var i=r[n];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw"production"===process.env.NODE_ENV?new _e(16):new _e("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.")}function Ze(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function et(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 Re(r,t.name,n),r}));return Ke.apply(void 0,a([{}],t))}return{}}function tt(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 nt={kind:"Field",name:{kind:"Name",value:"__typename"}};function rt(e){return function e(t,n){return t.selectionSet.selections.every((function(t){return"FragmentSpread"===t.kind&&e(n[t.name.value],n)}))}(We(e)||function(e){"production"===process.env.NODE_ENV?Oe("Document"===e.kind,13):Oe("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'),"production"===process.env.NODE_ENV?Oe(e.definitions.length<=1,14):Oe(e.definitions.length<=1,"Fragment must have exactly one definition.");var t=e.definitions[0];return"production"===process.env.NODE_ENV?Oe("FragmentDefinition"===t.kind,15):Oe("FragmentDefinition"===t.kind,"Must be a fragment definition."),t}(e),Ze(He(e)))?null:e}function it(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function ot(e,t){var n=Object.create(null),i=[],o=Object.create(null),a=[],s=rt(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(it(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=[];return t.selections.forEach((function(t){(Qe(t)||qe(t))&&t.selectionSet?e(t.selectionSet).forEach((function(e){return n.push(e)})):"FragmentSpread"===t.kind&&n.push(t)})),n}(t.selectionSet).forEach((function(e){a.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){o[e.name.value]=!0}},Directive:{enter:function(t){if(it(e)(t))return null}}}));return s&&tt(i,(function(e){return!n[e.name]})).length&&(s=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 rt(B(t,{OperationDefinition:{enter:function(t){return r(r({},t),{variableDefinitions:t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))}))})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var r=0;if(t.arguments.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(i,s)),s&&tt(a,(function(e){return!o[e.name]})).length&&(s=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return rt(B(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(a,s)),s}var at={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||"production"===process.env.NODE_ENV||Oe.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function st(e){return"query"===Xe(e).operation?e:B(e,{OperationDefinition:{enter:function(e){return r(r({},e),{operation:"query"})}}})}var ut="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),ct=Object.prototype.toString;function lt(e){return function e(t,n){switch(ct.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 ft(e){return("undefined"!=typeof process&&process.env.NODE_ENV?process.env.NODE_ENV:"development")===e}function pt(){return!0===ft("test")}function ht(e){try{return e()}catch(e){console.error&&console.error(e)}}function dt(e){return e.errors&&e.errors.length}function vt(e){if((!0===ft("development")||pt())&&!("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 yt=Object.prototype.hasOwnProperty;function mt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return gt(e)}function gt(e){var t=e[0]||{},n=e.length;if(n>1){var r=[];t=wt(t,r);for(var i=1;i<n;++i)t=Et(t,e[i],r)}return t}function bt(e){return null!==e&&"object"==typeof e}function Et(e,t,n){return bt(t)&&bt(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=wt(e,n)),Object.keys(t).forEach((function(r){var i=t[r];if(yt.call(e,r)){var o=e[r];i!==o&&(e[r]=Et(wt(o,n),i,n))}else e[r]=i})),e):t}function wt(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):r({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}var _t,Ot=ne((function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var o=function(){return"function"==typeof Symbol},a=function(e){return o()&&Boolean(Symbol[e])},s=function(e){return a(e)?Symbol[e]:"@@"+e};o()&&!a("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function f(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function p(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:_}function h(e){return e instanceof _}function d(e){d.log?d.log(e):setTimeout((function(){throw e}))}function v(e){Promise.resolve().then((function(){try{e()}catch(e){d(e)}}))}function y(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=f(t,"unsubscribe");n&&n.call(t)}}catch(e){d(e)}}function m(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,n){e._state="running";var r=e._observer;try{var i=f(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(m(e),!i)throw n;i.call(r,n);break;case"complete":m(e),i&&i.call(r)}}catch(e){d(e)}"closed"===e._state?y(e):"running"===e._state&&(e._state="ready")}function b(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void v((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(g(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void g(e,t,n);e._queue.push({type:t,value:n})}}var E=function(){function e(t,r){n(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new w(this);try{this._cleanup=r.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(m(this),y(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),w=function(){function e(t){n(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),_=function(){function e(t){if(n(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new E(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(p(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(p(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=p(this),r=arguments.length>1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=p(this);return new i((function(t){var r,o=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=p(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=f(t,c);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return h(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(a("iterator")&&(r=f(t,u)))return new n((function(e){v((function(){if(!e.closed){var n=!0,i=!1,o=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){v((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i="function"==typeof this?this:e;return new i((function(e){v((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=_,o()&&Object.defineProperty(_,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})}));(_t=Ot)&&_t.__esModule&&Object.prototype.hasOwnProperty.call(_t,"default")&&_t.default;Ot.Observable;var kt=Ot.Observable;var Nt=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return n(t,e),t}(Error);function St(e){return e.request.length<=1}function Tt(e){return new kt((function(t){t.error(e)}))}function It(e,t){var n=r({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=r({},n,"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return r({},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 xt(e,t){return t?t(e):kt.of()}function Dt(e){return"function"==typeof e?new jt(e):e}function At(){return new jt((function(){return kt.of()}))}function Rt(e){return 0===e.length?At():e.map(Dt).reduce((function(e,t){return e.concat(t)}))}function Mt(e,t,n){var r=Dt(t),i=Dt(n||new jt(xt));return St(r)&&St(i)?new jt((function(t){return e(t)?r.request(t)||kt.of():i.request(t)||kt.of()})):new jt((function(t,n){return e(t)?r.request(t,n)||kt.of():i.request(t,n)||kt.of()}))}var Ft=function(e,t){var n=Dt(e);if(St(n))return"production"===process.env.NODE_ENV||Oe.warn(new Nt("You are calling concat on a terminating link, which will have no effect",n)),n;var r=Dt(t);return St(r)?new jt((function(e){return n.request(e,(function(e){return r.request(e)||kt.of()}))||kt.of()})):new jt((function(e,t){return n.request(e,(function(e){return r.request(e,t)||kt.of()}))||kt.of()}))},jt=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,n,r){return this.concat(Mt(t,n,r||new e(xt)))},e.prototype.concat=function(e){return Ft(this,e)},e.prototype.request=function(e,t){throw"production"===process.env.NODE_ENV?new _e(1):new _e("request is not implemented")},e.empty=At,e.from=Rt,e.split=Mt,e.execute=Ct,e}();function Ct(e,t){return e.request(It(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?Je(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw"production"===process.env.NODE_ENV?new _e(2):new _e("illegal argument: "+i)}return e}(t))))||kt.of()}var Qt,qt=function(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());function Pt(e){return e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Qt||(Qt={}));var Vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype[qt]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(kt);function Lt(e){return Array.isArray(e)&&e.length>0}var $t,Bt=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.networkError,s=n.errorMessage,u=n.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=o||[],c.networkError=a||null,c.message=s||(i="",Lt((r=c).graphQLErrors)&&r.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"})),r.networkError&&(i+="Network error: "+r.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return n(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}($t||($t={}));var Ut=function(e){function t(t){var n=t.queryManager,r=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,(function(e){return a.onSubscribe(e)}))||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=r,a.variables=r.variables||{},a.queryId=n.generateQueryId(),a.shouldSubscribe=o;var s=We(r.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=n,a}return n(t,e),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:Qt.error}}var t,n,i,o=this.queryManager.getCurrentQueryResult(this),a=o.data,s=o.partial,u=this.queryManager.queryStore.get(this.queryId),c=this.options.fetchPolicy,l="network-only"===c||"no-cache"===c;if(u){var f=u.networkStatus;if(n=u,void 0===(i=this.options.errorPolicy)&&(i="none"),n&&(n.networkError||"none"===i&&Lt(n.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:f,error:new Bt({graphQLErrors:u.graphQLErrors,networkError:u.networkError})};u.variables&&(this.options.variables=r(r({},this.options.variables),u.variables),this.variables=this.options.variables),t={data:a,loading:Pt(f),networkStatus:f},u.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=u.graphQLErrors)}else{var p=l||s&&"cache-only"!==c;t={data:a,loading:p,networkStatus:p?Qt.loading:Qt.ready}}return s||this.updateLastResult(r(r({},t),{stale:!1})),r(r({},t),{partial:s})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&De(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject("production"===process.env.NODE_ENV?new _e(3):new _e("cache-only fetchPolicy option should not be used together with query refetch.")):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),De(this.variables,e)||(this.variables=r(r({},this.variables),e)),De(this.options.variables,this.variables)||(this.options.variables=r(r({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,r(r({},this.options),{fetchPolicy:t}),$t.refetch))},t.prototype.fetchMore=function(e){var t=this;"production"===process.env.NODE_ENV?Oe(e.updateQuery,4):Oe(e.updateQuery,"updateQuery option is required. This function defines how to update the query data with the new results.");var n=r(r({},e.query?e:r(r(r({},this.options),e),{variables:r(r({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),i=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(i,n,$t.normal,this.queryId).then((function(r){return t.updateQuery((function(t){return e.updateQuery(t,{fetchMoreResult:r.data,variables:n.variables})})),t.queryManager.stopQuery(i),r}),(function(e){throw t.queryManager.stopQuery(i),e}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):"production"===process.env.NODE_ENV||Oe.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=r(r({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var n=e.fetchPolicy;return this.setVariables(this.options.variables,t!==n&&("cache-only"===t||"standby"===t||"network-only"===n),e.fetchResults)},t.prototype.setVariables=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!0),this.isTornDown=!1,e=e||this.variables,!t&&De(e,this.variables)?this.observers.size&&n?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=t.getQueryWithPreviousResult(this.queryId),r=n.previousResult,i=n.variables,o=n.document,a=ht((function(){return e(r,{variables:i})}));a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){Kt(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:lt(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var n=e._subscription._observer;n&&!n.error&&(n.error=Gt)}catch(e){}var r=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),r&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,n=this.queryId;this.shouldSubscribe&&t.addObservableQuery(n,this),this.options.pollInterval&&(Kt(this),t.startPollingQuery(this.options,n));var i=function(t){e.updateLastResult(r(r({},e.lastResult),{errors:t.graphQLErrors,networkStatus:Qt.error,loading:!1})),zt(e.observers,"error",e.lastError=t)};t.observeQuery(n,this.options,{next:function(n){if(e.lastError||e.isDifferentFromLastResult(n)){var r=e.updateLastResult(n),i=e.options,o=i.query,a=i.variables,s=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then((function(i){var a=e.variables;e.variables=e.options.variables=i,!n.loading&&r&&"cache-only"!==s&&t.transform(o).serverQuery&&!De(a,i)?e.refetch():zt(e.observers,"next",n)})):zt(e.observers,"next",n)}},error:i}).catch(i)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Vt);function Gt(e){"production"===process.env.NODE_ENV||Oe.error("Unhandled error",e.message,e.stack)}function zt(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Kt(e){var t=e.options.fetchPolicy;"production"===process.env.NODE_ENV?Oe("cache-first"!==t&&"cache-only"!==t,5):Oe("cache-first"!==t&&"cache-only"!==t,"Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.")}var Yt=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,n){this.store[e]={mutation:t,variables:n||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var n=this.store[e];n&&(n.loading=!1,n.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Wt=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];"production"===process.env.NODE_ENV?Oe(!t||t.document===e.document||De(t.document,e.document),19):Oe(!t||t.document===e.document||De(t.document,e.document),"Internal Error: may not update existing query string in store");var n,r=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==Qt.loading&&(De(t.variables,e.variables)||(r=!0,i=t.variables)),n=r?Qt.setVariables:e.isPoll?Qt.poll:e.isRefetch?Qt.refetch:Qt.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:n,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=Qt.fetchMore)},e.prototype.markQueryResult=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=Lt(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=Qt.ready,"string"==typeof n&&this.store[n]&&(this.store[n].networkStatus=Qt.ready))},e.prototype.markQueryError=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=Qt.error,"string"==typeof n&&this.markQueryResultClient(n,!0))},e.prototype.markQueryResultClient=function(e,t){var n=this.store&&this.store[e];n&&(n.networkError=null,n.previousVariables=null,t&&(n.networkStatus=Qt.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach((function(n){e.indexOf(n)<0?t.stopQuery(n):t.store[n].networkStatus=Qt.loading}))},e}();var Jt=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=mt(t.resolvers,e)})):this.resolvers=mt(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,a=e.context,s=e.variables,u=e.onlyRunForcedResolvers,c=void 0!==u&&u;return i(this,void 0,void 0,(function(){return o(this,(function(e){return t?[2,this.resolveDocument(t,n.data,a,s,this.fragmentMatcher,c).then((function(e){return r(r({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){if(Be(["client"],e)){if(this.resolvers)return e;"production"===process.env.NODE_ENV||Oe.warn("Found @client directives in a query but no ApolloClient resolvers were specified. This means ApolloClient local resolver handling has been disabled, and @client directives will be passed through to your link chain.")}return null},e.prototype.serverQuery=function(e){return this.resolvers?function(e){Ye(e);var t=ot([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=B(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return Qe(e)&&"__typename"===e.name.value})))return null}}})),t}(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return r(r({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);"production"===process.env.NODE_ENV?Oe(!1,6):Oe(!1,"To use context.getCacheKey, you need to use a cache that has a configurable dataIdFromObject, like apollo-cache-inmemory.")}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),i(this,void 0,void 0,(function(){return o(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return r(r({},t),e.exportedVariables)}))]:[2,r({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return B(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return $}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:st(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,a,s,u){return void 0===n&&(n={}),void 0===a&&(a={}),void 0===s&&(s=function(){return!0}),void 0===u&&(u=!1),i(this,void 0,void 0,(function(){var i,c,l,f,p,h,d,v,y;return o(this,(function(o){var m;return i=Xe(e),c=He(e),l=Ze(c),f=i.operation,p=f?(m=f).charAt(0).toUpperCase()+m.slice(1):"Query",d=(h=this).cache,v=h.client,y={fragmentMap:l,context:r(r({},n),{cache:d,client:v}),variables:a,fragmentMatcher:s,defaultOperationType:p,exportedVariables:{},onlyRunForcedResolvers:u},[2,this.resolveSelectionSet(i.selectionSet,t,y).then((function(e){return{result:e,exportedVariables:y.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return i(this,void 0,void 0,(function(){var r,a,s,u,c,l=this;return o(this,(function(f){return r=n.fragmentMap,a=n.context,s=n.variables,u=[t],c=function(e){return i(l,void 0,void 0,(function(){var i,c;return o(this,(function(o){return $e(e,s)?Qe(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&u.push(((n={})[Ce(e)]=t,n))}))]:(qe(e)?i=e:(i=r[e.name.value],"production"===process.env.NODE_ENV?Oe(i,7):Oe(i,"No fragment named "+e.name.value)),i&&i.typeCondition&&(c=i.typeCondition.name.value,n.fragmentMatcher(t,c,a))?[2,this.resolveSelectionSet(i.selectionSet,t,n).then((function(e){u.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(c)).then((function(){return gt(u)}))]}))}))},e.prototype.resolveField=function(e,t,n){return i(this,void 0,void 0,(function(){var r,i,a,s,u,c,l,f,p,h=this;return o(this,(function(o){return r=n.variables,i=e.name.value,a=Ce(e),s=i!==a,u=t[a]||t[i],c=Promise.resolve(u),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=t.__typename||n.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(p=f[s?i:a])&&(c=Promise.resolve(p(t,je(e,r),n.context,{field:e,fragmentMap:n.fragmentMap})))),[2,c.then((function(t){return void 0===t&&(t=u),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?h.resolveSubSelectedArray(e,t,n):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}();function Ht(e){var t=new Set,n=null;return new Vt((function(r){return t.add(r),n=n||e.subscribe({next:function(e){t.forEach((function(t){return t.next&&t.next(e)}))},error:function(e){t.forEach((function(t){return t.error&&t.error(e)}))},complete:function(){t.forEach((function(e){return e.complete&&e.complete()}))}}),function(){t.delete(r)&&!t.size&&n&&(n.unsubscribe(),n=null)}}))}var Xt=Object.prototype.hasOwnProperty,Zt=function(){function e(e){var t=e.link,n=e.queryDeduplication,r=void 0!==n&&n,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,p=e.assumeImmutableResults;this.mutationStore=new Yt,this.queryStore=new Wt,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(ut?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=r,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=l,this.localState=f||new Jt({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!p}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.fetchQueryRejectFns.forEach((function(e){e("production"===process.env.NODE_ENV?new _e(8):new _e("QueryManager stopped while query was in flight"))}))},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,a=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=void 0===u?[]:u,l=e.awaitRefetchQueries,f=void 0!==l&&l,p=e.update,h=e.errorPolicy,d=void 0===h?"none":h,v=e.fetchPolicy,y=e.context,m=void 0===y?{}:y;return i(this,void 0,void 0,(function(){var e,i,u,l=this;return o(this,(function(o){switch(o.label){case 0:return"production"===process.env.NODE_ENV?Oe(t,9):Oe(t,"mutation option is required. You must specify your GraphQL document in the mutation option."),"production"===process.env.NODE_ENV?Oe(!v||"no-cache"===v,10):Oe(!v||"no-cache"===v,"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,(function(){return{document:t}})),n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,m)]:[3,2];case 1:n=o.sent(),o.label=2;case 2:return i=function(){var e={};return s&&l.queries.forEach((function(t,n){var r=t.observableQuery;if(r){var i=r.queryName;i&&Xt.call(s,i)&&(e[n]={updater:s[i],query:l.queryStore.get(n)})}})),e},this.mutationStore.initMutation(e,t,n),this.dataStore.markMutationInit({mutationId:e,document:t,variables:n,updateQueries:i(),update:p,optimisticResponse:a}),this.broadcastQueries(),u=this,[2,new Promise((function(o,s){var l,h;u.getObservableFromLink(t,r(r({},m),{optimisticResponse:a}),n,!1).subscribe({next:function(r){dt(r)&&"none"===d?h=new Bt({graphQLErrors:r.errors}):(u.mutationStore.markMutationResult(e),"no-cache"!==v&&u.dataStore.markMutationResult({mutationId:e,result:r,document:t,variables:n,updateQueries:i(),update:p}),l=r)},error:function(t){u.mutationStore.markMutationError(e,t),u.dataStore.markMutationComplete({mutationId:e,optimisticResponse:a}),u.broadcastQueries(),u.setQuery(e,(function(){return{document:null}})),s(new Bt({networkError:t}))},complete:function(){if(h&&u.mutationStore.markMutationError(e,h),u.dataStore.markMutationComplete({mutationId:e,optimisticResponse:a}),u.broadcastQueries(),h)s(h);else{"function"==typeof c&&(c=c(l));var t=[];Lt(c)&&c.forEach((function(e){if("string"==typeof e)u.queries.forEach((function(n){var r=n.observableQuery;r&&r.queryName===e&&t.push(r.refetch())}));else{var n={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(n.context=e.context),t.push(u.query(n))}})),Promise.all(f?t:[]).then((function(){u.setQuery(e,(function(){return{document:null}})),"ignore"===d&&l&&dt(l)&&delete l.errors,o(l)}))}}})}))]}}))}))},e.prototype.fetchQuery=function(e,t,n,a){return i(this,void 0,void 0,(function(){var i,s,u,c,l,f,p,h,d,v,y,m,g,b,E,w,_,O,k=this;return o(this,(function(o){switch(o.label){case 0:return i=t.metadata,s=void 0===i?null:i,u=t.fetchPolicy,c=void 0===u?"cache-first":u,l=t.context,f=void 0===l?{}:l,p=this.transform(t.query).document,h=this.getVariables(p,t.variables),this.transform(p).hasClientExports?[4,this.localState.addExportedVariables(p,h,f)]:[3,2];case 1:h=o.sent(),o.label=2;case 2:if(t=r(r({},t),{variables:h}),y=v="network-only"===c||"no-cache"===c,v||(m=this.dataStore.getCache().diff({query:p,variables:h,returnPartialData:!0,optimistic:!1}),g=m.complete,b=m.result,y=!g||"cache-and-network"===c,d=b),E=y&&"cache-only"!==c&&"standby"!==c,Be(["live"],p)&&(E=!0),w=this.idCounter++,_="no-cache"!==c?this.updateQueryWatch(e,p,t):void 0,this.setQuery(e,(function(){return{document:p,lastRequestId:w,invalidated:!0,cancel:_}})),this.invalidate(a),this.queryStore.initQuery({queryId:e,document:p,storePreviousVariables:E,variables:h,isPoll:n===$t.poll,isRefetch:n===$t.refetch,metadata:s,fetchMoreForQueryId:a}),this.broadcastQueries(),E){if(O=this.fetchRequest({requestId:w,queryId:e,document:p,options:t,fetchMoreForQueryId:a}).catch((function(t){throw t.hasOwnProperty("graphQLErrors")?t:(w>=k.getQuery(e).lastRequestId&&(k.queryStore.markQueryError(e,t,a),k.invalidate(e),k.invalidate(a),k.broadcastQueries()),new Bt({networkError:t}))})),"cache-and-network"!==c)return[2,O];O.catch((function(){}))}return this.queryStore.markQueryResultClient(e,!E),this.invalidate(e),this.invalidate(a),this.transform(p).hasForcedResolvers?[2,this.localState.runResolvers({document:p,remoteResult:{data:d},context:f,variables:h,onlyRunForcedResolvers:!0}).then((function(n){return k.markQueryResult(e,n,t,a),k.broadcastQueries(),n}))]:(this.broadcastQueries(),[2,{data:d}])}}))}))},e.prototype.markQueryResult=function(e,t,n,r){var i=n.fetchPolicy,o=n.variables,a=n.errorPolicy;"no-cache"===i?this.setQuery(e,(function(){return{newData:{result:t.data,complete:!0}}})):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,r,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,n){var r=this;function i(e,t){if(n[e])try{n[e](t)}catch(e){"production"===process.env.NODE_ENV||Oe.error(e)}else"error"===e&&("production"===process.env.NODE_ENV||Oe.error(t))}return function(n,o){if(r.invalidate(e,!1),n){var a=r.getQuery(e),s=a.observableQuery,u=a.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=Pt(n.networkStatus),f=s&&s.getLastResult(),p=!(!f||f.networkStatus===n.networkStatus),h=t.returnPartialData||!o&&n.previousVariables||p&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||h){var d=Lt(n.graphQLErrors),v=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===v&&d||n.networkError)return i("error",new Bt({graphQLErrors:n.graphQLErrors,networkError:n.networkError}));try{var y=void 0,m=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&r.setQuery(e,(function(){return{newData:null}})),y=o.result,m=!o.complete;else{var g=s&&s.getLastError(),b="none"!==v&&(g&&g.graphQLErrors)!==n.graphQLErrors;if(f&&f.data&&!b)y=f.data,m=!1;else{var E=r.dataStore.getCache().diff({query:u,variables:n.previousVariables||n.variables,returnPartialData:!0,optimistic:!0});y=E.result,m=!E.complete}}var w=m&&!(t.returnPartialData||"cache-only"===c),_={data:w?f&&f.data:y,loading:l,networkStatus:n.networkStatus,stale:w};"all"===v&&d&&(_.errors=n.graphQLErrors),i("next",_)}catch(e){i("error",new Bt({networkError:e}))}}}}}},e.prototype.transform=function(e){var t,n=this.transformCache;if(!n.has(e)){var r=this.dataStore.getCache(),i=r.transformDocument(e),o=(t=r.transformForLink(i),ot([at],Ye(t))),a=this.localState.clientQuery(i),s=this.localState.serverQuery(o),u={document:i,hasClientExports:Ue(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:s,defaultVars:et(We(i))},c=function(e){e&&!n.has(e)&&n.set(e,u)};c(e),c(i),c(a),c(s)}return n.get(e)},e.prototype.getVariables=function(e,t){return r(r({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),"production"===process.env.NODE_ENV?Oe("standby"!==e.fetchPolicy,11):Oe("standby"!==e.fetchPolicy,'client.watchQuery cannot be called with fetchPolicy set to "standby"'),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=r({},e);return new Ut({queryManager:this,options:n,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return"production"===process.env.NODE_ENV?Oe(e.query,12):Oe(e.query,"query option is required. You must specify your GraphQL document in the query option."),"production"===process.env.NODE_ENV?Oe("Document"===e.query.kind,13):Oe("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'),"production"===process.env.NODE_ENV?Oe(!e.returnPartialData,14):Oe(!e.returnPartialData,"returnPartialData option only supported on watchQuery."),"production"===process.env.NODE_ENV?Oe(!e.pollInterval,15):Oe(!e.pollInterval,"pollInterval option only supported on watchQuery."),new Promise((function(n,r){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,r),i.result().then(n,r).then((function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,(function(e){return e.listeners.add(t),{invalidated:!1}}))},e.prototype.updateQueryWatch=function(e,t,n){var r=this,i=this.getQuery(e).cancel;i&&i();return this.dataStore.getCache().watch({query:t,variables:n.variables,optimistic:!0,previousResult:function(){var t=null,n=r.getQuery(e).observableQuery;if(n){var i=n.getLastResult();i&&(t=i.data)}return t},callback:function(t){r.setQuery(e,(function(){return{invalidated:!0,newData:t}}))}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,(function(){return{observableQuery:t}}))},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,(function(){return{observableQuery:null}})),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(e){e("production"===process.env.NODE_ENV?new _e(16):new _e("Store reset while query was in flight (not completed in link chain)"))}));var e=[];return this.queries.forEach((function(t,n){t.observableQuery&&e.push(n)})),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.queries.forEach((function(r,i){var o=r.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||n.push(o.refetch()),t.setQuery(i,(function(){return{newData:null}})),t.invalidate(i)}})),this.broadcastQueries(),Promise.all(n)},e.prototype.observeQuery=function(e,t,n){return this.addQueryListener(e,this.queryListenerForObserver(e,t,n)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,n){return"production"===process.env.NODE_ENV||Oe.warn("The QueryManager.startQuery method has been deprecated"),this.addQueryListener(e,n),this.fetchQuery(e,t).catch((function(){})),e},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.variables;n=this.transform(n).document,i=this.getVariables(n,i);var o=function(e){return t.getObservableFromLink(n,{},e,!1).map((function(i){if(r&&"no-cache"===r||(t.dataStore.markSubscriptionResult(i,n,e),t.broadcastQueries()),dt(i))throw new Bt({graphQLErrors:i.errors});return i}))};if(this.transform(n).hasClientExports){var a=this.localState.addExportedVariables(n,i).then(o);return new Vt((function(e){var t=null;return a.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach((function(e){return e.unsubscribe()})),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var n=e.options,r=n.variables,i=n.query,o=n.fetchPolicy,a=n.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:r,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,f=c.complete;return{data:f||a?l:void 0,partial:!f}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var n=this.getQuery(e).observableQuery;"production"===process.env.NODE_ENV?Oe(n,17):Oe(n,"ObservableQuery with this id doesn't exist: "+e),t=n}else t=e;var r=t.options,i=r.variables,o=r.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach((function(t,n){t.invalidated&&t.listeners.forEach((function(r){r&&r(e.queryStore.get(n),t.newData)}))}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,i){var o,a=this;void 0===i&&(i=this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var u=this.inFlightLinkObservables,c=this.link,l={query:s,variables:n,operationName:Je(s)||void 0,context:this.prepareContext(r(r({},t),{forceFetch:!i}))};if(t=l.context,i){var f=u.get(s)||new Map;u.set(s,f);var p=JSON.stringify(n);if(!(o=f.get(p))){f.set(p,o=Ht(Ct(c,l)));var h=function(){f.delete(p),f.size||u.delete(s),d.unsubscribe()},d=o.subscribe({next:h,error:h,complete:h})}}else o=Ht(Ct(c,l))}else o=Vt.of({data:{}}),t=this.prepareContext(t);var v=this.transform(e).clientQuery;return v&&(o=function(e,t){return new Vt((function(n){var r=n.next,i=n.error,o=n.complete,a=0,s=!1,u={next:function(e){++a,new Promise((function(n){n(t(e))})).then((function(e){--a,r&&r.call(n,e),s&&u.complete()}),(function(e){--a,i&&i.call(n,e)}))},error:function(e){i&&i.call(n,e)},complete:function(){s=!0,a||o&&o.call(n)}},c=e.subscribe(u);return function(){return c.unsubscribe()}}))}(o,(function(e){return a.localState.runResolvers({document:v,remoteResult:e,context:t,variables:n})}))),o},e.prototype.fetchRequest=function(e){var t,n,r=this,i=e.requestId,o=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,f=void 0===l?"none":l,p=s.fetchPolicy;return new Promise((function(e,l){var h=r.getObservableFromLink(a,s.context,c),d="fetchRequest:"+o;r.fetchQueryRejectFns.set(d,l);var v=function(){r.fetchQueryRejectFns.delete(d),r.setQuery(o,(function(e){e.subscriptions.delete(y)}))},y=h.map((function(e){if(i>=r.getQuery(o).lastRequestId&&(r.markQueryResult(o,e,s,u),r.queryStore.markQueryResult(o,e,u),r.invalidate(o),r.invalidate(u),r.broadcastQueries()),"none"===f&&Lt(e.errors))return l(new Bt({graphQLErrors:e.errors}));if("all"===f&&(n=e.errors),u||"no-cache"===p)t=e.data;else{var h=r.dataStore.getCache().diff({variables:c,query:a,optimistic:!1,returnPartialData:!0}),d=h.result;(h.complete||s.returnPartialData)&&(t=d)}})).subscribe({error:function(e){v(),l(e)},complete:function(){v(),e({data:t,errors:n,loading:!1,networkStatus:Qt.ready,stale:!1})}});r.setQuery(o,(function(e){e.subscriptions.add(y)}))}))},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var n=this.getQuery(e),i=r(r({},n),t(n));this.queries.set(e,i)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,(function(){return{invalidated:t}}))},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return r(r({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==Qt.ready&&t.networkStatus!==Qt.error},e.prototype.startPollingQuery=function(e,t,n){var i=this,o=e.pollInterval;if("production"===process.env.NODE_ENV?Oe(o,18):Oe(o,"Attempted to start a polling query without a polling interval."),!this.ssrMode){var a=this.pollingInfoByQueryId.get(t);a||this.pollingInfoByQueryId.set(t,a={}),a.interval=o,a.options=r(r({},e),{fetchPolicy:"network-only"});var s=function(){var e=i.pollingInfoByQueryId.get(t);e&&(i.checkInFlight(t)?u():i.fetchQuery(t,e.options,$t.poll).then(u,u))},u=function(){var e=i.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(s,e.interval))};n&&this.addQueryListener(t,n),u()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),en=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,n,r,i){void 0===i&&(i=!1);var o=!dt(e);i&&dt(e)&&e.data&&(o=!0),!r&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:n})},e.prototype.markSubscriptionResult=function(e,t,n){dt(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:n})},e.prototype.markMutationInit=function(e){var t,n=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction((function(r){var i=n.cache;n.cache=r;try{n.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{n.cache=i}}),e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!dt(e.result)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],r=e.updateQueries;r&&Object.keys(r).forEach((function(i){var o=r[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=ht((function(){return s(c,{mutationResult:e.result,queryName:Je(a.document)||void 0,queryVariables:a.variables})}));l&&n.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}})),this.cache.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&ht((function(){return r(t,e.result)}))}))}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,n){this.cache.write({result:n,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),tn=!1,nn=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.cache,r=e.ssrMode,i=void 0!==r&&r,o=e.ssrForceFetchDelay,a=void 0===o?0:o,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,f=e.assumeImmutableResults,p=void 0!==f&&f,h=e.resolvers,d=e.typeDefs,v=e.fragmentMatcher,y=e.name,m=e.version,g=e.link;if(!g&&h&&(g=jt.empty()),!g||!n)throw"production"===process.env.NODE_ENV?new _e(1):new _e("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\nThese options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\nFor more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup");this.link=g,this.cache=n,this.store=new en(n),this.disableNetworkFetches=i||a>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,a&&setTimeout((function(){return t.disableNetworkFetches=!1}),a),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);var b="production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&!window.__APOLLO_CLIENT__;(void 0===s?b:s&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),tn||"production"===process.env.NODE_ENV||(tn=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&void 0===window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("Chrome")>-1&&console.debug("Download the Apollo DevTools for a better development experience: https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm")),this.version="2.6.8",this.localState=new Jt({cache:n,client:this,resolvers:h,fragmentMatcher:v}),this.queryManager=new Zt({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:y,version:m},localState:this.localState,assumeImmutableResults:p,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=r(r({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=r(r({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=r(r({},this.defaultOptions.query),e)),"production"===process.env.NODE_ENV?Oe("cache-and-network"!==e.fetchPolicy,2):Oe("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=r(r({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=r(r({},this.defaultOptions.mutate),e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Ct(this.link,e)},e.prototype.initQueryManager=function(){return"production"===process.env.NODE_ENV||Oe.warn("Calling the initQueryManager method is no longer necessary, and it will be removed from ApolloClient in version 3.0."),this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}();function rn(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:on(e)}]}}function on(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return on(e[0]);var t=[];return Object.keys(e).forEach((function(n){var r={kind:"Field",name:{kind:"Name",value:n},selectionSet:on(e[n])||void 0};t.push(r)})),{kind:"SelectionSet",selections:t}}var an={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},sn=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:ze(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:ze(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,n,r=e.id,i=e.data;if(void 0!==r){var o=null;try{o=this.read({rootId:r,optimistic:!1,query:an})}catch(e){}var a=o&&o.__typename||"__ClientData",s=Object.assign({__typename:a},i);this.writeFragment({id:r,fragment:(t=s,n=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:n||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:on(t)}]}),data:s})}else this.writeQuery({query:rn(i),data:i})},e}(),un=null,cn={},ln=1,fn=Array,pn=fn["@wry/context:Slot"]||function(){var e=function(){function e(){this.id=["slot",ln++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=un;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===cn)break;return e!==un&&(un.slots[this.id]=t),!0}return un&&(un.slots[this.id]=cn),!1},e.prototype.getValue=function(){if(this.hasValue())return un.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=un;un={parent:a,slots:o};try{return t.apply(r,n)}finally{un=a}},e.bind=function(e){var t=un;return function(){var n=un;try{return un=t,e.apply(this,arguments)}finally{un=n}}},e.noContext=function(e,t,n){if(!un)return e.apply(n,t);var r=un;try{return un=null,e.apply(n,t)}finally{un=r}},e}();try{Object.defineProperty(fn,"@wry/context:Slot",{value:fn["@wry/context:Slot"]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();pn.bind,pn.noContext;function hn(){}var dn=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=hn),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getEntry(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),vn=new pn,yn=[],mn=[];function gn(e,t){if(!e)throw new Error(t||"assertion failure")}function bn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var En=function(){function e(t,n){this.fn=t,this.args=n,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(gn(!this.recomputing,"already recomputing"),function(e){var t=vn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),_n(e)?Nn(t,e):Sn(t,e),t}(this)||!In(this))return _n(this)?function(e){var t=xn(e);vn.withValue(e,wn,[e]),function(e){if("function"==typeof e.subscribe)try{An(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){if(e.dirty=!1,_n(e))return;kn(e)}(e);return t.forEach(In),bn(e.value)}(this):bn(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,On(this),An(this))},e.prototype.dispose=function(){var e=this;xn(this).forEach(In),An(this),this.parents.forEach((function(t){t.setDirty(),Dn(t,e)}))},e.count=0,e}();function wn(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function _n(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function On(e){e.parents.forEach((function(t){return Nn(t,e)}))}function kn(e){e.parents.forEach((function(t){return Sn(t,e)}))}function Nn(e,t){if(gn(e.childValues.has(t)),gn(_n(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=mn.pop()||new Set;e.dirtyChildren.add(t),On(e)}function Sn(e,t){gn(e.childValues.has(t)),gn(!_n(t));var n,r,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(n=o,r=t.value,(i=n.length)>0&&i===r.length&&n[i-1]===r[i-1]||e.setDirty()),Tn(e,t),_n(e)||kn(e)}function Tn(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(mn.length<100&&mn.push(n),e.dirtyChildren=null))}function In(e){return 0===e.parents.size&&"function"==typeof e.reportOrphan&&!0===e.reportOrphan()}function xn(e){var t=yn;return e.childValues.size>0&&(t=[],e.childValues.forEach((function(n,r){Dn(e,r),t.push(r)}))),gn(null===e.dirtyChildren),t}function Dn(e,t){t.parents.delete(e),e.childValues.delete(t),Tn(e,t)}function An(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Rn=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach((function(e){return t=t.getChildTrie(e)})),t.data||(t.data=Object.create(null))},e.prototype.getChildTrie=function(t){var n=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),r=n.get(t);return r||n.set(t,r=new e(this.weakness)),r},e}();var Mn=new Rn("function"==typeof WeakMap);function Fn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Mn.lookupArray(e)}var jn=new Set;function Cn(e,t){void 0===t&&(t=Object.create(null));var n=new dn(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=!!t.disposable,i=t.makeCacheKey||Fn;function o(){if(!r||vn.hasValue()){var o=i.apply(null,arguments);if(void 0===o)return e.apply(null,arguments);var a=Array.prototype.slice.call(arguments),s=n.get(o);s?s.args=a:(s=new En(e,a),n.set(o,s),s.subscribe=t.subscribe,r&&(s.reportOrphan=function(){return n.delete(o)}));var u=s.recompute();return n.set(o,s),jn.add(n),vn.hasValue()||(jn.forEach((function(e){return e.clean()})),jn.clear()),r?void 0:u}}return o.dirty=function(){var e=i.apply(null,arguments),t=void 0!==e&&n.get(e);t&&t.setDirty()},o}var Qn=!1;function qn(){var e=!Qn;return pt()||(Qn=!0),e}var Pn=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,n){var r=n.store.get(e.id),i="ROOT_QUERY"===e.id;if(!r)return i;var o=r.__typename,a=void 0===o?i&&"Query":o;return a?a===t||(qn()&&("production"===process.env.NODE_ENV||Oe.error("You are using the simple (heuristic) fragment matcher, but your queries contain union or interface types. Apollo Client will not be able to accurately map fragments. To make this error go away, use the `IntrospectionFragmentMatcher` as described in the docs: https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher")),"heuristic"):(qn()&&("production"===process.env.NODE_ENV||Oe.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."),"production"===process.env.NODE_ENV||Oe.warn("Could not find __typename on Fragment ",t,r),"production"===process.env.NODE_ENV||Oe.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.")),"heuristic")},e}(),Vn=Object.prototype.hasOwnProperty,Ln=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Cn((function(e){return t.data[e]}),{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Vn.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach((function(n){t.set(n,e[n])})),Object.keys(this.data).forEach((function(n){Vn.call(e,n)||t.delete(n)}))):Object.keys(this.data).forEach((function(e){t.delete(e)}))},e}();function $n(e){return new Ln(e)}var Bn=function(){function e(e){var t=this,n=void 0===e?{}:e,r=n.cacheKeyRoot,i=void 0===r?new Rn(ut):r,o=n.freezeResults,a=void 0!==o&&o,s=this.executeStoreQuery,u=this.executeSelectionSet,c=this.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Cn((function(e){return s.call(t,e)}),{makeCacheKey:function(e){var t=e.query,n=e.rootValue,r=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(r.store instanceof Ln)return i.lookup(r.store,t,a,JSON.stringify(o),n.id)}}),this.executeSelectionSet=Cn((function(e){return u.call(t,e)}),{makeCacheKey:function(e){var t=e.selectionSet,n=e.rootValue,r=e.execContext;if(r.contextValue.store instanceof Ln)return i.lookup(r.contextValue.store,t,r.fragmentMatcher,JSON.stringify(r.variableValues),n.id)}}),this.executeSubSelectedArray=Cn((function(e){return c.call(t,e)}),{makeCacheKey:function(e){var t=e.field,n=e.array,r=e.execContext;if(r.contextValue.store instanceof Ln)return i.lookup(r.contextValue.store,t,n,JSON.stringify(r.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(r(r({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,n=e.store,r=e.query,i=e.variables,o=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,f=e.config;i=Ke({},et((t=We(r),"production"===process.env.NODE_ENV?Oe(t&&"query"===t.operation,12):Oe(t&&"query"===t.operation,"Must contain a query definition."),t)),i);var p={store:n,dataIdFromObject:f&&f.dataIdFromObject,cacheRedirects:f&&f.cacheRedirects||{}},h=this.executeStoreQuery({query:r,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:p,variableValues:i,fragmentMatcher:l}),d=h.missing&&h.missing.length>0;return d&&!s&&h.missing.forEach((function(e){if(!e.tolerable)throw"production"===process.env.NODE_ENV?new _e(8):new _e("Can't find field "+e.fieldName+" on object "+JSON.stringify(e.object,null,2)+".")})),o&&De(o,h.result)&&(h.result=o),{result:h.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,n=e.rootValue,r=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?Gn:o,s=Xe(t),u={query:t,fragmentMap:Ze(He(t)),contextValue:r,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:n,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,n=e.selectionSet,i=e.rootValue,o=e.execContext,a=o.fragmentMap,s=o.contextValue,u=o.variableValues,c={result:null},l=[],f=s.store.get(i.id),p=f&&f.__typename||"ROOT_QUERY"===i.id&&"Query"||void 0;function h(e){var t;return e.missing&&(c.missing=c.missing||[],(t=c.missing).push.apply(t,e.missing)),e.result}return n.selections.forEach((function(e){var n;if($e(e,u))if(Qe(e)){var c=h(t.executeField(f,p,e,o));void 0!==c&&l.push(((n={})[Ce(e)]=c,n))}else{var d=void 0;if(qe(e))d=e;else if(!(d=a[e.name.value]))throw"production"===process.env.NODE_ENV?new _e(9):new _e("No fragment named "+e.name.value);var v=d.typeCondition&&d.typeCondition.name.value,y=!v||o.fragmentMatcher(i,v,s);if(y){var m=t.executeSelectionSet({selectionSet:d.selectionSet,rootValue:i,execContext:o});"heuristic"===y&&m.missing&&(m=r(r({},m),{missing:m.missing.map((function(e){return r(r({},e),{tolerable:!0})}))})),l.push(h(m))}}})),c.result=gt(l),this.freezeResults&&"production"!==process.env.NODE_ENV&&Object.freeze(c.result),c},e.prototype.executeField=function(e,t,n,r){var i=r.variableValues,o=r.contextValue,a=function(e,t,n,r,i,o){o.resultKey;var a=o.directives,s=n;(r||a)&&(s=Fe(s,r,a));var u=void 0;if(e&&void 0===(u=e[s])&&i.cacheRedirects&&"string"==typeof t){var c=i.cacheRedirects[t];if(c){var l=c[n];l&&(u=l(e,r,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Ve({id:t,typename:e.__typename})}}))}}if(void 0===u)return{result:u,missing:[{object:e,fieldName:s,tolerable:!1}]};f=u,null!=f&&"object"==typeof f&&"json"===f.type&&(u=u.json);var f;return{result:u}}(e,t,n.name.value,je(n,i),o,{resultKey:Ce(n),directives:Le(n,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:n,array:a.result,execContext:r})):n.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:n.selectionSet,rootValue:a.result,execContext:r})):(Un(n,a.result),this.freezeResults&&"production"!==process.env.NODE_ENV&&vt(a),a)},e.prototype.combineExecResults=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.forEach((function(t){t.missing&&(e=e||[]).push.apply(e,t.missing)})),{result:t.pop().result,missing:e}},e.prototype.executeSubSelectedArray=function(e){var t,n=this,r=e.field,i=e.array,o=e.execContext;function a(e){return e.missing&&(t=t||[]).push.apply(t,e.missing),e.result}return i=i.map((function(e){return null===e?null:Array.isArray(e)?a(n.executeSubSelectedArray({field:r,array:e,execContext:o})):r.selectionSet?a(n.executeSelectionSet({selectionSet:r.selectionSet,rootValue:e,execContext:o})):(Un(r,e),e)})),this.freezeResults&&"production"!==process.env.NODE_ENV&&Object.freeze(i),{result:i,missing:t}},e}();function Un(e,t){if(!e.selectionSet&&Pe(t))throw"production"===process.env.NODE_ENV?new _e(10):new _e("Missing selection set for object of type "+t.typename+" returned for query field "+e.name.value)}function Gn(){return!0}var zn=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),Kn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return n(t,e),t}(Error);var Yn=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,n=e.result,r=e.store,i=void 0===r?$n():r,o=e.variables,a=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:n,document:t,store:i,variables:o,dataIdFromObject:a,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,n=e.result,r=e.document,i=e.store,o=void 0===i?$n():i,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=We(r);try{return this.writeSelectionSetToStore({result:n,dataId:t,selectionSet:c.selectionSet,context:{store:o,processedData:{},variables:Ke({},et(c),a),dataIdFromObject:s,fragmentMap:Ze(He(r)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var n=new Kn("Error writing result to store for query:\n "+JSON.stringify(t));return n.message+="\n"+e.message,n.stack=e.stack,n}(e,r)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,n=e.result,r=e.dataId,i=e.selectionSet,o=e.context,a=o.variables,s=o.store,u=o.fragmentMap;return i.selections.forEach((function(e){var i;if($e(e,a))if(Qe(e)){var s=Ce(e),c=n[s];if(void 0!==c)t.writeFieldToStore({dataId:r,value:c,field:e,context:o});else{var l=!1,f=!1;e.directives&&e.directives.length&&(l=e.directives.some((function(e){return e.name&&"defer"===e.name.value})),f=e.directives.some((function(e){return e.name&&"client"===e.name.value}))),l||f||!o.fragmentMatcherFunction||"production"===process.env.NODE_ENV||Oe.warn("Missing field "+s+" in "+JSON.stringify(n,null,2).substring(0,100))}}else{var p=void 0;qe(e)?p=e:(p=(u||{})[e.name.value],"production"===process.env.NODE_ENV?Oe(p,4):Oe(p,"No fragment named "+e.name.value+"."));var h=!0;if(o.fragmentMatcherFunction&&p.typeCondition){var d=r||"self",v=Ve({id:d,typename:void 0}),y={store:new zn((i={},i[d]=n,i)),cacheRedirects:{}},m=o.fragmentMatcherFunction(v,p.typeCondition.name.value,y);!0!==ft("production")&&"heuristic"===m&&("production"===process.env.NODE_ENV||Oe.error("WARNING: heuristic fragment matching going on!")),h=!!m}h&&t.writeSelectionSetToStore({result:n,selectionSet:p.selectionSet,dataId:r,context:o})}})),s},e.prototype.writeFieldToStore=function(e){var t,n,i,o=e.field,a=e.value,s=e.dataId,u=e.context,c=u.variables,l=u.dataIdFromObject,f=u.store,p=function(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 Re(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 Re(r,n,i,t)}))),Fe(e.name.value,r,n)}(o,c);if(o.selectionSet&&null!==a)if(Array.isArray(a)){var h=s+"."+p;n=this.processArrayValue(a,h,o.selectionSet,u)}else{var d=s+"."+p,v=!0;if(Wn(d)||(d="$"+d),l){var y=l(a);"production"===process.env.NODE_ENV?Oe(!y||!Wn(y),5):Oe(!y||!Wn(y),'IDs returned by dataIdFromObject cannot begin with the "$" character.'),(y||"number"==typeof y&&0===y)&&(d=y,v=!1)}Jn(d,o,u.processedData)||this.writeSelectionSetToStore({dataId:d,result:a,selectionSet:o.selectionSet,context:u});var m=a.__typename;n=Ve({id:d,typename:m},v);var g=(i=f.get(s))&&i[p];if(g!==n&&Pe(g)){var b=void 0!==g.typename,E=void 0!==m,w=b&&E&&g.typename!==m;"production"===process.env.NODE_ENV?Oe(!v||g.generated||w,6):Oe(!v||g.generated||w,"Store error: the application attempted to write an object with no provided id but the store already contains an id of "+g.id+" for this object. The selectionSet that was trying to be written is:\n"+JSON.stringify(o)),"production"===process.env.NODE_ENV?Oe(!b||E,7):Oe(!b||E,"Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of "+g.typename+" for the object of id "+g.id+". The selectionSet that was trying to be written is:\n"+JSON.stringify(o)),g.generated&&(w?v||f.delete(g.id):function e(t,n,i){if(t===n)return!1;var o=i.get(t),a=i.get(n),s=!1;Object.keys(o).forEach((function(t){var n=o[t],r=a[t];Pe(n)&&Wn(n.id)&&Pe(r)&&!De(n,r)&&e(n.id,r.id,i)&&(s=!0)})),i.delete(t);var u=r(r({},o),a);if(De(u,a))return s;return i.set(n,u),!0}(g.id,n.id,f))}}else n=null!=a&&"object"==typeof a?{type:"json",json:a}:a;(i=f.get(s))&&De(n,i[p])||f.set(s,r(r({},i),((t={})[p]=n,t)))},e.prototype.processArrayValue=function(e,t,n,r){var i=this;return e.map((function(e,o){if(null===e)return null;var a=t+"."+o;if(Array.isArray(e))return i.processArrayValue(e,a,n,r);var s=!0;if(r.dataIdFromObject){var u=r.dataIdFromObject(e);u&&(a=u,s=!1)}return Jn(a,n,r.processedData)||i.writeSelectionSetToStore({dataId:a,result:e,selectionSet:n,context:r}),Ve({id:a,typename:e.__typename},s)}))},e}();function Wn(e){return"$"===e[0]}function Jn(e,t,n){if(!n)return!1;if(n[e]){if(n[e].indexOf(t)>=0)return!0;n[e].push(t)}else n[e]=[t];return!1}var Hn={fragmentMatcher:new Pn,dataIdFromObject:function(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null},addTypename:!0,resultCaching:!0,freezeResults:!1};var Xn=Object.prototype.hasOwnProperty,Zn=function(e){function t(t,n,r){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=n,i.transaction=r,i}return n(t,e),t.prototype.toObject=function(){return r(r({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return Xn.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(zn),er=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new Rn(ut),n.silenceBroadcast=!1,n.config=r(r({},Hn),t),n.config.customResolvers&&("production"===process.env.NODE_ENV||Oe.warn("customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version."),n.config.cacheRedirects=n.config.customResolvers),n.config.cacheResolvers&&("production"===process.env.NODE_ENV||Oe.warn("cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version."),n.config.cacheRedirects=n.config.cacheResolvers),n.addTypename=!!n.config.addTypename,n.data=n.config.resultCaching?new Ln:new zn,n.optimisticData=n.data,n.storeWriter=new Yn,n.storeReader=new Bn({cacheKeyRoot:n.cacheKeyRoot,freezeResults:t.freezeResults});var i=n,o=i.maybeBroadcastWatch;return n.maybeBroadcastWatch=Cn((function(e){return o.call(n,e)}),{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return i.data instanceof Ln?i.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),n}return n(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:n,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:n}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:n,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw"production"===process.env.NODE_ENV?new _e(1):new _e("eviction is not implemented on InMemory Cache")},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],n=0,r=this.optimisticData;r instanceof Zn;)r.optimisticId===e?++n:t.push(r),r=r.parent;if(n>0){for(this.optimisticData=r;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var n=this.data,r=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new Zn(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=r,this.data=n}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=B(Ye(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var i=e.selections;if(i&&!i.some((function(e){return Qe(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var o=n;if(!(Qe(o)&&o.directives&&o.directives.some((function(e){return"export"===e.name.value}))))return r(r({},e),{selections:a(i,[nt])})}}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach((function(t){return e.maybeBroadcastWatch(t)}))},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(sn),tr={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},nr=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},rr=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r="production"===process.env.NODE_ENV?new _e(2):new _e("Network request failed. "+t+" is not serializable: "+e.message);throw r.parseError=e,r}return n},ir=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,i=e.fetch,o=e.includeExtensions,a=e.useGETForQueries,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch){var t="unfetch";throw"undefined"==typeof window&&(t="node-fetch"),"production"===process.env.NODE_ENV?new _e(1):new _e("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/"+t+".\n\nFor example:\nimport fetch from '"+t+"';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });")}}(i),i||(i=fetch);var u={http:{includeExtensions:o},options:s.fetchOptions,credentials:s.credentials,headers:s.headers};return new jt((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),o=e.getContext(),s={};if(o.clientAwareness){var c=o.clientAwareness,l=c.name,f=c.version;l&&(s["apollographql-client-name"]=l),f&&(s["apollographql-client-version"]=f)}var p,h=r({},s,o.headers),d={http:o.http,options:o.fetchOptions,credentials:o.credentials,headers:h},v=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=r({},t.options,{headers:t.headers,credentials:t.credentials}),a=t.http;n.forEach((function(e){o=r({},o,e.options,{headers:r({},o.headers,e.headers)}),e.credentials&&(o.credentials=e.credentials),a=r({},a,e.http)}));var s=e.operationName,u=e.extensions,c=e.variables,l=e.query,f={operationName:s,variables:c};return a.includeExtensions&&(f.extensions=u),a.includeQuery&&(f.query=z(l)),{options:o,body:f}}(e,tr,u,d),y=v.options,m=v.body;if(!y.signal){var g=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),b=g.controller,E=g.signal;(p=b)&&(y.signal=E)}if(a&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(y.method="GET"),"GET"===y.method){var w=function(e,t){var n=[],r=function(e,t){n.push(e+"="+encodeURIComponent(t))};"query"in t&&r("query",t.query);t.operationName&&r("operationName",t.operationName);if(t.variables){var i=void 0;try{i=rr(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=rr(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+n.join("&")+a}}(t,m),_=w.newURI,O=w.parseError;if(O)return Tt(O);t=_}else try{y.body=rr(m,"Payload")}catch(O){return Tt(O)}return new kt((function(n){var r;return i(t,y).then((function(t){return e.setContext({response:t}),t})).then((r=e,function(e){return e.text().then((function(t){try{return JSON.parse(t)}catch(r){var n=r;return n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,Promise.reject(n)}})).then((function(t){return e.status>=300&&nr(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||nr(e,t,"Server response was missing for query '"+(Array.isArray(r)?r.map((function(e){return e.operationName})):r.operationName)+"'."),t}))})).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){p&&p.abort()}}))}))};var or,ar,sr=function(e){function t(t){return e.call(this,ir(t).request)||this}return n(t,e),t}(jt);(or=e.ConnectionMode||(e.ConnectionMode={}))[or.AUTO=0]="AUTO",or[or.PLAIN=1]="PLAIN",or[or.NODES=2]="NODES",or[or.EDGES=3]="EDGES",or[or.ITEMS=4]="ITEMS",(ar=e.ArgumentMode||(e.ArgumentMode={}))[ar.TYPE=0]="TYPE",ar[ar.LIST=1]="LIST";var ur,cr=function(){function t(){}return t.transformOutgoingData=function(e,t,n,r,i,o){var a=this,s=_r.getInstance(),u=e.getRelations(),c={};return void 0===i&&(i=new Map),void 0===o&&(o=!1),Object.keys(t).forEach((function(l){var f=t[l],p=e.getRelations().has(l);if(!(f instanceof Array?p&&a.isRecursion(i,f[0]):p&&a.isRecursion(i,f))&&a.shouldIncludeOutgoingField(o&&n,l,f,e,r)){var h=be.getRelatedModel(u.get(l));if(f instanceof Array){var d=s.getModel(se(l),!0);d?(a.addRecordForRecursionDetection(i,f[0]),c[l]=f.map((function(t){return a.transformOutgoingData(d||e,t,n,void 0,i,!0)}))):c[l]=f}else"object"==typeof f&&void 0!==f.$id?(h||(h=s.getModel(f.$self().entity)),a.addRecordForRecursionDetection(i,f),c[l]=a.transformOutgoingData(h,f,n,void 0,i,!0)):c[l]=f}})),c},t.transformIncomingData=function(t,n,r,i){var o=this;void 0===r&&(r=!1),void 0===i&&(i=!1);var a={},s=_r.getInstance();return i||(s.logger.group("Transforming incoming data"),s.logger.log("Raw data:",t)),Array.isArray(t)?a=t.map((function(e){return o.transformIncomingData(e,n,r,!0)})):Object.keys(t).forEach((function(u){if(void 0!==t[u]&&null!==t[u]&&u in t)if(he(t[u])){var c=s.getModel(u,!0)||n;if(t[u].nodes&&s.connectionMode===e.ConnectionMode.NODES)a[ae(u)]=o.transformIncomingData(t[u].nodes,c,r,!0);else if(t[u].edges&&s.connectionMode===e.ConnectionMode.EDGES)a[ae(u)]=o.transformIncomingData(t[u].edges,c,r,!0);else if(t.node&&s.connectionMode===e.ConnectionMode.EDGES)a=o.transformIncomingData(t.node,c,r,!0);else if(t[u].items&&s.connectionMode===e.ConnectionMode.ITEMS)a[ae(u)]=o.transformIncomingData(t[u].items,c,r,!0);else{var l=u;r&&!i&&(l=ce(l=t[u].nodes?c.pluralName:c.singularName)),a[l]=o.transformIncomingData(t[u],c,r,!0)}}else be.isFieldNumber(n.fields.get(u))?a[u]=parseFloat(t[u]):u.endsWith("Type")&&n.isTypeFieldOfPolymorphicRelation(u)?a[u]=ae(ce(t[u])):a[u]=t[u]})),i?a.$isPersisted=!0:(s.logger.log("Transformed data:",a),s.logger.groupEnd()),ye(a)},t.shouldIncludeOutgoingField=function(e,t,n,r,i){if(i&&i.includes(t))return!0;if(t.startsWith("$"))return!1;if("pivot"===t)return!1;if(null==n)return!1;if(!this.inputTypeContainsField(r,t))return!1;if(r.getRelations().has(t)){if(e)return!1;var o=r.getRelations().get(t),a=be.getRelatedModel(o);return!(!a||!r.shouldEagerSaveRelation(t,o,a))}return!0},t.inputTypeContainsField=function(e,t){var n=e.singularName+"Input",r=_r.getInstance().schema.getType(n,!1);if(null===r)throw new Error("Type "+r+" doesn't exist.");return void 0!==r.inputFields.find((function(e){return e.name===t}))},t.addRecordForRecursionDetection=function(e,t){var n=_r.getInstance();if(t)if(t.$self){var r=n.getModel(t.$self().entity),i=e.get(r.singularName)||[];i.push(t.$id),e.set(r.singularName,i)}else n.logger.warn("Seems like you're using non-model classes with plugin graphql. You shouldn't do that.");else n.logger.warn("Trying to add invalid record",t,"to recursion detection")},t.isRecursion=function(e,t){if(!t)return!1;if(!t.$self)return _r.getInstance().logger.warn("Seems like you're using non-model classes with plugin graphql. You shouldn't do that."),!1;var n=_r.getInstance().getModel(t.$self().entity);return(e.get(n.singularName)||[]).includes(t.$id)},t}(),lr=((ur=V)&&ur.default||ur).parse;function fr(e){return e.replace(/[\s,]+/g," ").trim()}var pr={},hr={};var dr=!0;var vr=!1;function yr(e){var t=fr(e);if(pr[t])return pr[t];var n=lr(e,{experimentalFragmentVariables:vr});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=[],i=0;i<e.definitions.length;i++){var o=e.definitions[i];if("FragmentDefinition"===o.kind){var a=o.name.value,s=fr((t=o.loc).source.body.substring(t.start,t.end));hr.hasOwnProperty(a)&&!hr[a][s]?(dr&&console.warn("Warning: fragment with name "+a+" 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"),hr[a][s]=!0):hr.hasOwnProperty(a)||(hr[a]={},hr[a][s]=!0),n[s]||(n[s]=!0,r.push(o))}else r.push(o)}return e.definitions=r,e}(n),!1),pr[t]=n,n}function mr(){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 yr(n)}mr.default=mr,mr.resetCaches=function(){pr={},hr={}},mr.disableFragmentWarnings=function(){dr=!1},mr.enableExperimentalFragmentVariables=function(){vr=!0},mr.disableExperimentalFragmentVariables=function(){vr=!1};var gr=mr,br=function(){function e(){var e=_r.getInstance();!e.options.apolloClient&&e.options.link?this.httpLink=e.options.link:this.httpLink=new sr({uri:e.options.url?e.options.url:"/graphql",credentials:e.options.credentials?e.options.credentials:"same-origin",useGETForQueries:Boolean(e.options.useGETForQueries)}),e.options.apolloClient?this.apolloClient=function(e){return e.options.apolloClient}(e):this.apolloClient=new nn({link:this.httpLink,cache:new er,connectToDevTools:e.debugMode})}return e.prototype.request=function(t,n,r,a,s){return void 0===a&&(a=!1),void 0===s&&(s=!1),i(this,void 0,void 0,(function(){var i,u,c;return o(this,(function(o){switch(o.label){case 0:return i=s?"network-only":"cache-first",_r.getInstance().logger.logQuery(n,r,i),u={headers:e.getHeaders()},a?[4,this.apolloClient.mutate({mutation:n,variables:r,context:u})]:[3,2];case 1:return c=o.sent(),[3,4];case 2:return[4,this.apolloClient.query({query:n,variables:r,fetchPolicy:i,context:u})];case 3:c=o.sent(),o.label=4;case 4:return[2,cr.transformIncomingData(c.data,t,a)]}}))}))},e.prototype.simpleQuery=function(t,n,r,a){return void 0===r&&(r=!1),i(this,void 0,void 0,(function(){var i;return o(this,(function(o){return i=r?"network-only":"cache-first",[2,this.apolloClient.query({query:gr(t),variables:n,fetchPolicy:i,context:{headers:e.getHeaders()}})]}))}))},e.prototype.simpleMutation=function(t,n,r){return i(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.apolloClient.mutate({mutation:gr(t),variables:n,context:{headers:e.getHeaders()}})]}))}))},e.getHeaders=function(){var e=_r.getInstance(),t=e.options.headers?e.options.headers:{};return"function"==typeof t&&(t=t(e)),t},e}(),Er=function(){function t(e){var t=this,n=_r.getInstance();this.schema=e,this.types=new Map,this.mutations=new Map,this.queries=new Map,this.schema.types.forEach((function(e){return t.types.set(e.name,e)})),this.getType(n.adapter.getRootQueryName()).fields.forEach((function(e){return t.queries.set(e.name,e)})),this.getType(n.adapter.getRootMutationName()).fields.forEach((function(e){return t.mutations.set(e.name,e)}))}return t.prototype.determineQueryMode=function(){var n=this,r=null;if(this.queries.forEach((function(e){var i=t.getTypeNameOfField(e);return!i.endsWith("Connection")||(r=n.getType(i),!1)})),!r)throw new Error("Can't determine the connection mode due to the fact that here are no connection types in the schema. Please set the connectionMode via Vuex-ORM-GraphQL options!");return r.fields.find((function(e){return"nodes"===e.name}))?e.ConnectionMode.NODES:r.fields.find((function(e){return"edges"===e.name}))?e.ConnectionMode.EDGES:r.fields.find((function(e){return"items"===e.name}))?e.ConnectionMode.ITEMS:e.ConnectionMode.PLAIN},t.prototype.getType=function(e,t){void 0===t&&(t=!1),e=_r.getInstance().adapter.prepareSchemaTypeName(e);var n=this.types.get(e);if(!t&&!n)throw new Error("Couldn't find Type of name "+e+" in the GraphQL Schema.");return n||null},t.prototype.getMutation=function(e,t){void 0===t&&(t=!1);var n=this.mutations.get(e);if(!t&&!n)throw new Error("Couldn't find Mutation of name "+e+" in the GraphQL Schema.");return n||null},t.prototype.getQuery=function(e,t){void 0===t&&(t=!1);var n=this.queries.get(e);if(!t&&!n)throw new Error("Couldn't find Query of name "+e+" in the GraphQL Schema.");return n||null},t.returnsConnection=function(e){return t.getTypeNameOfField(e).endsWith("Connection")},t.getRealType=function(e){return"NON_NULL"===e.kind?this.getRealType(e.ofType):e},t.getTypeNameOfField=function(e){var t=this.getRealType(e.type);if("LIST"===t.kind){for(;!t.name;)t=t.ofType;return"["+t.name+"]"}for(;!t.name;)t=t.ofType;if(!t.name)throw new Error("Can't find type name for field "+e.name);return t.name},t}(),wr=function(){function t(){}return t.prototype.getRootMutationName=function(){return"Mutation"},t.prototype.getRootQueryName=function(){return"Query"},t.prototype.getConnectionMode=function(){return e.ConnectionMode.NODES},t.prototype.getArgumentMode=function(){return e.ArgumentMode.TYPE},t.prototype.getFilterTypeName=function(e){return ue(e.singularName)+"Filter"},t.prototype.getInputTypeName=function(e,t){return ue(e.singularName)+"Input"},t.prototype.getNameForDestroy=function(e){return"delete"+ue(e.singularName)},t.prototype.getNameForFetch=function(e,t){return t?e.pluralName:e.singularName},t.prototype.getNameForPersist=function(e){return"create"+ue(e.singularName)},t.prototype.getNameForPush=function(e){return"update"+ue(e.singularName)},t.prototype.prepareSchemaTypeName=function(e){return ue(e)},t}(),_r=function(){function t(t,n){if(this.models=new Map,this.debugMode=!1,this.connectionMode=e.ConnectionMode.AUTO,this.globalMocks={},this.components=t,this.options=n,this.database=n.database,this.debugMode=Boolean(n.debug),this.logger=new ge(this.debugMode),this.adapter=n.adapter||new wr,!n.database)throw new Error("database param is required to initialize vuex-orm-graphql!")}return t.getInstance=function(){return this.instance},t.setup=function(e,n){return this.instance=new t(e,n),this.instance.apollo=new br,this.instance.collectModels(),this.instance.logger.group("Context setup"),this.instance.logger.log("components",this.instance.components),this.instance.logger.log("options",this.instance.options),this.instance.logger.log("database",this.instance.database),this.instance.logger.log("models",this.instance.models),this.instance.logger.groupEnd(),this.instance},t.prototype.loadSchema=function(){return i(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return this.schemaWillBeLoaded||(this.schemaWillBeLoaded=new Promise((function(t,n){return i(e,void 0,void 0,(function(){var e,r,i;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.logger.log("Fetching GraphQL Schema initially ..."),this.connectionMode=this.adapter.getConnectionMode(),e={headers:{"X-GraphQL-Introspection-Query":"true"}},[4,this.apollo.simpleQuery("\nquery Introspection {\n __schema {\n types {\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n inputFields {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}\n",{},!0,e)];case 1:return r=o.sent(),this.schema=new Er(r.data.__schema),this.logger.log("GraphQL Schema successful fetched",r),this.logger.log("Starting to process the schema ..."),this.processSchema(),this.logger.log("Schema procession done!"),t(this.schema),[3,3];case 2:return i=o.sent(),n(i),[3,3];case 3:return[2]}}))}))}))),[2,this.schemaWillBeLoaded]}))}))},t.prototype.processSchema=function(){var t=this;this.models.forEach((function(e){var n;try{n=t.schema.getType(e.singularName)}catch(n){return void t.logger.warn("Ignoring entity "+e.singularName+" because it's not in the schema.")}e.fields.forEach((function(r,i){n.fields.find((function(e){return e.name===i}))||(t.logger.warn("Ignoring field "+e.singularName+"."+i+" because it's not in the schema."),e.baseModel.skipFields=e.baseModel.skipFields?e.baseModel.skipFields:[],e.baseModel.skipFields.includes(i)||e.baseModel.skipFields.push(i))}))})),this.connectionMode===e.ConnectionMode.AUTO?(this.connectionMode=this.schema.determineQueryMode(),this.logger.log("Connection Query Mode is "+this.connectionMode+" by automatic detection")):this.logger.log("Connection Query Mode is "+this.connectionMode+" by config")},t.prototype.getModel=function(e,t){if(void 0===t&&(t=!1),"string"==typeof e){var n=se(ce(e));if(e=this.models.get(n),!t&&!e)throw new Error("No such model "+n+"!")}return e},t.prototype.addGlobalMock=function(e){return!this.findGlobalMock(e.action,e.options)&&(this.globalMocks[e.action]||(this.globalMocks[e.action]=[]),this.globalMocks[e.action].push(e),!0)},t.prototype.findGlobalMock=function(e,t){return this.globalMocks[e]&&this.globalMocks[e].find((function(e){return!e.options||!t||ve(de(t,Object.keys(e.options)),e.options||{})}))||null},t.prototype.globalMockHook=function(e,t){var n=null,r=this.findGlobalMock(e,t);return r&&(n=r.returnValue instanceof Function?r.returnValue():r.returnValue||null),n},t.prototype.collectModels=function(){var e=this;this.database.entities.forEach((function(t){var n=new be(t.model);e.models.set(n.singularName,n),be.augment(n)}))},t}(),Or=function(){function t(){}return t.buildField=function(t,n,r,i,o,a,s){void 0===n&&(n=!0),void 0===i&&(i=[]),void 0===a&&(a=!1),void 0===s&&(s=!1);var u=_r.getInstance();t=u.getModel(t),o=o||t.pluralName;var c=u.schema.getMutation(o,!0)||u.schema.getQuery(o,!0),l=this.buildArguments(t,r,!1,a,s,c);i=0===i.length?[t.singularName]:i;var f="\n "+t.getQueryFields().join(" ")+"\n "+this.buildRelationsQuery(t,i)+"\n ";if(n){var p=""+o+l;return u.connectionMode===e.ConnectionMode.NODES?"\n "+p+" {\n nodes {\n "+f+"\n }\n }\n ":u.connectionMode===e.ConnectionMode.EDGES?"\n "+p+" {\n edges {\n node {\n "+f+"\n }\n }\n }\n ":u.connectionMode===e.ConnectionMode.ITEMS?"\n "+p+" {\n items {\n "+f+"\n }\n }\n ":"\n "+p+" {\n "+f+"\n }\n "}return"\n "+(o||t.singularName)+l+" {\n "+f+"\n }\n "},t.buildQuery=function(e,t,n,r,i,o){var a=_r.getInstance();t=a.getModel(t),r=this.prepareArguments(r),i=void 0===i?!r.id:i,n||(n=i?t.pluralName:t.singularName);var s=a.schema.getMutation(n,!0)||a.schema.getQuery(n,!0),u=e+" "+ue(n)+this.buildArguments(t,r,!0,o,!0,s)+" {\n "+this.buildField(t,i,r,[],n,o,!0)+"\n}";return gr(u)},t.buildArguments=function(n,r,i,o,a,s){var u=this;void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===a&&(a=!0),void 0===s&&(s=null);var c=_r.getInstance();if(void 0===r)return"";var l="",f=!0;return r&&(Object.keys(r).forEach((function(e){var p=r[e],h=n.skipField(e),d=("id"===e||h)&&!a,v=u.findSchemaFieldForArgument(e,s,n,o),y=v&&Er.getTypeNameOfField(v).endsWith("Connection");if(p&&!d&&!y){var m="";if(i)if(he(p)&&p.__type)m=c.adapter.getInputTypeName(c.getModel(p.__type))+"!";else if(p instanceof Array&&s){var g=t.findSchemaFieldForArgument(e,s,n,o);if(!g)throw new Error("The argument "+e+" is of type array but it's not possible to determine the type, because it's not in the field "+s.name);m=Er.getTypeNameOfField(g)+"!"}else v&&Er.getTypeNameOfField(v)?m=Er.getTypeNameOfField(v)+"!":"id"===e||h?m="ID!":(m=u.determineAttributeType(n,e,p,s||void 0),m+="!");else m="$"+e;l=l+(f?"":", ")+(i?"$":"")+e+": "+m,f=!1}})),f||(!i&&o&&_r.getInstance().adapter.getArgumentMode()===e.ArgumentMode.TYPE&&(l="filter: { "+l+" }"),l="("+l+")")),l},t.determineAttributeType=function(e,t,n,r){var i,o=_r.getInstance(),a=e.fields.get(t);r?(i=r.args.find((function(e){return e.name===t})))||r.args.find((function(e){return"filter"===e.name}))&&(i=this.findSchemaFieldForArgument(t,null,e,!0)):i=o.schema.getType(e.singularName).fields.find((function(e){return e.name===t}));if(i&&Er.getTypeNameOfField(i))return Er.getTypeNameOfField(i);if(a instanceof o.components.String)return"String";if(a&&a instanceof o.components.Number)return"Int";if(a&&a instanceof o.components.Boolean)return"Boolean";if("number"==typeof n)return"Int";if("string"==typeof n)return"String";if("boolean"==typeof n)return"Boolean";throw new Error("Can't find suitable graphql type for field '"+e.singularName+"."+t+"'.")},t.findSchemaFieldForArgument=function(e,t,n,r){var i,o=_r.getInstance(),a=o.schema;if(t&&(i=t.args.find((function(t){return t.name===e}))))return i;var s=a.getType(r?o.adapter.getFilterTypeName(n):n.singularName,!0);return(i=s?(r?s.inputFields:s.fields).find((function(t){return t.name===e})):void 0)||_r.getInstance().logger.warn("Couldn't find the argument with name "+e+" for the mutation/query "+(t?t.name:"(?)")),i},t.buildRelationsQuery=function(e,t){var n=this;if(void 0===t&&(t=[]),null===e)return"";_r.getInstance();var r=[];return e.getRelations().forEach((function(i,o){var a=be.getRelatedModel(i),s=function(e,t){for(var n=-1;++n<e.length&&t(e[n],n,e););return e.slice(0,n)}(t.slice(0).reverse(),(function(e){return e===a.singularName})).length,u=s?s>5:t.includes(a.singularName);if(e.shouldEagerLoadRelation(o,i,a)&&!u){var c=t.slice(0);c.push(a.singularName),r.push(n.buildField(a,be.isConnection(i),void 0,c,o,!1))}})),r.join("\n")},t.prepareArguments=function(t){return t=t?ye(t):{},Object.keys(t).forEach((function(n){var r=t[n];r&&he(r)&&(_r.getInstance().adapter.getArgumentMode()===e.ArgumentMode.LIST?(Object.keys(r).forEach((function(e){t[e]=r[e]})),delete t[n]):t[n]={__type:ue(n)})})),t},t}(),kr=function(){function e(){}return e.insertData=function(e,t){return i(this,void 0,void 0,(function(){var n,r=this;return o(this,(function(a){switch(a.label){case 0:return n={},[4,Promise.all(Object.keys(e).map((function(a){return i(r,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return r=e[a],_r.getInstance().logger.log("Inserting records",r),[4,t("insertOrUpdate",{data:r})];case 1:return i=o.sent(),Object.keys(i).forEach((function(e){n[e]||(n[e]=[]),n[e]=n[e].concat(i[e])})),[2]}}))}))})))];case 1:return a.sent(),[2,n]}}))}))},e}(),Nr=function(){function e(){}return e.mutation=function(e,t,n,r){return i(this,void 0,void 0,(function(){var i,a,s,u,c,l,f,p,h;return o(this,(function(o){switch(o.label){case 0:return t?[4,(i=_r.getInstance()).loadSchema()]:[3,5];case 1:return a=o.sent(),s=Er.returnsConnection(a.getMutation(e)),u=Or.buildQuery("mutation",r,e,t,s),[4,i.apollo.request(r,u,t,!0)];case 2:return c=o.sent(),e===i.adapter.getNameForDestroy(r)?[3,4]:((c=c[Object.keys(c)[0]]).id=me(c.id),[4,kr.insertData((h={},h[r.pluralName]=c,h),n)]);case 3:return l=o.sent(),f=l[r.pluralName],(p=f[f.length-1])?[2,p]:(_r.getInstance().logger.log("Couldn't find the record of type '",r.pluralName,"' within",l,". Falling back to find()"),[2,r.baseModel.query().last()]);case 4:return[2,!0];case 5:return[2]}}))}))},e.getModelFromState=function(e){return _r.getInstance().getModel(e.$name)},e.prepareArgs=function(e,t){return e=e||{},t&&(e.id=t),e},e.addRecordToArgs=function(e,t,n){return e[t.singularName]=cr.transformOutgoingData(t,n,!1),e},e.transformArgs=function(e){var t=_r.getInstance();return Object.keys(e).forEach((function(n){var r=e[n];if(r instanceof t.components.Model){var i=t.getModel(se(r.$self().entity)),o=cr.transformOutgoingData(i,r,!1);t.logger.log("A",n,"model was found within the variables and will be transformed from",r,"to",o),e[n]=o}})),e},e}(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){var e=_r.getInstance(),n=e.components.Model.prototype;e.components.Actions.destroy=t.call.bind(t),n.$destroy=function(){return i(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.$dispatch("destroy",{id:me(this.$id)})]}))}))},n.$deleteAndDestroy=function(){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.$delete()];case 1:return e.sent(),[2,this.$destroy()]}}))}))}},t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.id,s=t.args;return i(this,void 0,void 0,(function(){var e,t,i;return o(this,(function(o){switch(o.label){case 0:return a?(e=this.getModelFromState(n),t=_r.getInstance().adapter.getNameForDestroy(e),(i=e.$mockHook("destroy",{id:a}))?[4,kr.insertData(i,r)]:[3,2]):[3,4];case 1:return o.sent(),[2,!0];case 2:return s=this.prepareArgs(s,a),[4,Nr.mutation(t,s,r,e)];case 3:return o.sent(),[2,!0];case 4:throw new Error("The destroy action requires the 'id' to be set")}}))}))},t}(Nr),Tr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){var e=_r.getInstance(),n=e.components.Model;e.components.Actions.fetch=t.call.bind(t),n.fetch=function(e,t){return void 0===t&&(t=!1),i(this,void 0,void 0,(function(){var n;return o(this,(function(r){return he(n=e)||(n={id:e}),[2,this.dispatch("fetch",{filter:n,bypassCache:t})]}))}))}},t.call=function(e,t){var n=e.state,r=e.dispatch;return i(this,void 0,void 0,(function(){var e,i,a,s,u,c,l,f,p;return o(this,(function(o){switch(o.label){case 0:return e=_r.getInstance(),i=this.getModelFromState(n),(a=i.$mockHook("fetch",{filter:t&&t.filter||{}}))?[2,kr.insertData(a,r)]:[4,e.loadSchema()];case 1:return o.sent(),s={},t&&t.filter&&(s=cr.transformOutgoingData(i,t.filter,!0,Object.keys(t.filter))),u=t&&t.bypassCache,c=!s.id,l=e.adapter.getNameForFetch(i,c),f=Or.buildQuery("query",i,l,s,c,c),[4,e.apollo.request(i,f,s,!1,u)];case 2:return p=o.sent(),[2,kr.insertData(p,r)]}}))}))},t}(Nr),Ir=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){var e=_r.getInstance(),n=e.components.Model,r=e.components.Model.prototype;e.components.Actions.mutate=t.call.bind(t),n.mutate=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.dispatch("mutate",e)]}))}))},r.$mutate=function(e){var t=e.name,n=e.args,r=e.multiple;return i(this,void 0,void 0,(function(){return o(this,(function(e){return(n=n||{}).id||(n.id=me(this.$id)),[2,this.$dispatch("mutate",{name:t,args:n,multiple:r})]}))}))}},t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.args,s=t.name;return i(this,void 0,void 0,(function(){var e,t,i;return o(this,(function(o){switch(o.label){case 0:return s?(e=_r.getInstance(),t=this.getModelFromState(n),(i=t.$mockHook("mutate",{name:s,args:a||{}}))?[2,kr.insertData(i,r)]:[4,e.loadSchema()]):[3,2];case 1:return o.sent(),a=this.prepareArgs(a),this.transformArgs(a),[2,Nr.mutation(s,a,r,t)];case 2:throw new Error("The mutate action requires the mutation name ('mutation') to be set")}}))}))},t}(Nr),xr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){var e=_r.getInstance(),n=e.components.Model.prototype;e.components.Actions.persist=t.call.bind(t),n.$persist=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.$dispatch("persist",{id:this.$id,args:e})]}))}))}},t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.id,s=t.args;return i(this,void 0,void 0,(function(){var e,t,i,u,c,l;return o(this,(function(o){switch(o.label){case 0:return a?(e=this.getModelFromState(n),t=_r.getInstance().adapter.getNameForPersist(e),i=e.getRecordWithId(a),(u=e.$mockHook("persist",{id:me(a),args:s||{}}))?[4,kr.insertData(u,r)]:[3,3]):[3,7];case 1:return c=o.sent(),[4,this.deleteObsoleteRecord(e,c,i)];case 2:return o.sent(),[2,c];case 3:return[4,_r.getInstance().loadSchema()];case 4:return o.sent(),s=this.prepareArgs(s),this.addRecordToArgs(s,e,i),[4,Nr.mutation(t,s,r,e)];case 5:return l=o.sent(),[4,this.deleteObsoleteRecord(e,l,i)];case 6:return o.sent(),[2,l];case 7:throw new Error("The persist action requires the 'id' to be set")}}))}))},t.deleteObsoleteRecord=function(e,t,n){return i(this,void 0,void 0,(function(){return o(this,(function(e){return t&&n&&t.id!==n.id?(_r.getInstance().logger.log("Dropping deprecated record",n),[2,n.$delete()]):[2,null]}))}))},t}(Nr),Dr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){var e=_r.getInstance(),n=e.components.Model.prototype;e.components.Actions.push=t.call.bind(t),n.$push=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.$dispatch("push",{data:this,args:e})]}))}))}},t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.data,s=t.args;return i(this,void 0,void 0,(function(){var e,t,i;return o(this,(function(o){switch(o.label){case 0:return a?(e=this.getModelFromState(n),t=_r.getInstance().adapter.getNameForPush(e),(i=e.$mockHook("push",{data:a,args:s||{}}))?[2,kr.insertData(i,r)]:[4,_r.getInstance().loadSchema()]):[3,2];case 1:return o.sent(),s=this.prepareArgs(s,a.id),this.addRecordToArgs(s,e,a),[2,Nr.mutation(t,s,r,e)];case 2:throw new Error("The persist action requires the 'data' to be set")}}))}))},t}(Nr),Ar=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){var e=_r.getInstance(),n=e.components.Model,r=e.components.Model.prototype;e.components.Actions.query=t.call.bind(t),n.customQuery=function(e){var t=e.name,n=e.filter,r=e.multiple,a=e.bypassCache;return i(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.dispatch("query",{name:t,filter:n,multiple:r,bypassCache:a})]}))}))},r.$customQuery=function(e){var t=e.name,n=e.filter,r=e.multiple,a=e.bypassCache;return i(this,void 0,void 0,(function(){return o(this,(function(e){return(n=n||{}).id||(n.id=me(this.$id)),[2,this.$dispatch("query",{name:t,filter:n,multiple:r,bypassCache:a})]}))}))}},t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.name,s=t.filter,u=t.bypassCache;return i(this,void 0,void 0,(function(){var e,t,i,c,l,f,p;return o(this,(function(o){switch(o.label){case 0:return a?(e=_r.getInstance(),t=this.getModelFromState(n),(i=t.$mockHook("query",{name:a,filter:s||{}}))?[2,kr.insertData(i,r)]:[4,e.loadSchema()]):[3,3];case 1:return c=o.sent(),s=s?cr.transformOutgoingData(t,s,!0):{},l=Er.returnsConnection(c.getQuery(a)),f=Or.buildQuery("query",t,a,s,l,!1),[4,e.apollo.request(t,f,s,!1,u)];case 2:return p=o.sent(),[2,kr.insertData(p,r)];case 3:throw new Error("The customQuery action requires the query name ('name') to be set")}}))}))},t}(Nr),Rr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){_r.getInstance().components.RootActions.simpleQuery=t.call.bind(t)},t.call=function(e,t){e.dispatch;var n=t.query,r=t.bypassCache,a=t.variables;return i(this,void 0,void 0,(function(){var e,t,i,s;return o(this,(function(o){switch(o.label){case 0:return e=_r.getInstance(),n?(t=fe(n),(i=e.globalMockHook("simpleQuery",{name:t.definitions[0].name.value,variables:a}))?[2,i]:(a=this.prepareArgs(a),[4,e.apollo.simpleQuery(pe(t),a,r)])):[3,2];case 1:return s=o.sent(),[2,(u=ye(s.data),JSON.parse(JSON.stringify(u)))];case 2:throw new Error("The simpleQuery action requires the 'query' to be set")}var u}))}))},t}(Nr),Mr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.setup=function(){_r.getInstance().components.RootActions.simpleMutation=t.call.bind(t)},t.call=function(e,t){e.dispatch;var n=t.query,r=t.variables;return i(this,void 0,void 0,(function(){var e,t,i;return o(this,(function(o){switch(o.label){case 0:return e=_r.getInstance(),n?(t=fe(n),(i=e.globalMockHook("simpleMutation",{name:t.definitions[0].name.value,variables:r}))?[2,i]:(r=this.prepareArgs(r),[4,e.apollo.simpleMutation(pe(t),r)])):[3,2];case 1:return[2,ye(o.sent().data)];case 2:throw new Error("The simpleMutation action requires the 'query' to be set")}}))}))},t}(Nr),Fr=function(){function e(t,n){_r.setup(t,n),e.setupActions()}return e.prototype.getContext=function(){return _r.getInstance()},e.setupActions=function(){Tr.setup(),xr.setup(),Dr.setup(),Sr.setup(),Ir.setup(),Ar.setup(),Rr.setup(),Mr.setup()},e}(),jr=function(){function e(){}return e.install=function(t,n){return e.instance=new Fr(t,n),e.instance},e}(),Cr=null;var Qr=function(){function e(e,t){this.action=e,this.options=t}return e.prototype.for=function(e){return this.modelClass=e,this},e.prototype.andReturn=function(e){return this.returnValue=e,this.installMock(),this},e.prototype.installMock=function(){"simpleQuery"===this.action||"simpleMutation"===this.action?Cr.addGlobalMock(this):Cr.getModel(this.modelClass.entity).$addMock(this)},e}();return e.DefaultAdapter=wr,e.Mock=Qr,e.Model=be,e.clearORMStore=function(){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!Cr)throw new Error("Please call setupTestUtils() before!");return[4,Cr.database.store.dispatch("entities/deleteAll")];case 1:return e.sent(),[2]}}))}))},e.default=jr,e.mock=function(e,t){if(!Cr)throw new Error("Please call setupTestUtils() before!");return new Qr(e,t)},e.setupTestUtils=function(e){if(!e.instance)throw new Error("Please call this function after setting up the store!");Cr=e.instance.getContext()},e}({});