{"version":3,"sources":["webpack:///./node_modules/apollo-link/lib/bundle.esm.js"],"names":["validateOperation","operation","OPERATION_FIELDS","_i","_a","Object","keys","length","key","indexOf","_super","LinkError","message","link","_this","call","this","Error","isTerminating","request","toPromise","observable","completed","Promise","resolve","reject","subscribe","next","data","error","makePromise","fromPromise","promise","observer","then","value","complete","catch","bind","fromError","errorValue","transformOperation","transformedOperation","variables","extensions","operationName","query","createOperation","starting","context","setContext","getContext","defineProperty","enumerable","getKey","JSON","stringify","passthrough","op","forward","of","toLink","handler","ApolloLink","empty","from","links","map","reduce","x","y","concat","split","test","left","right","leftLink","rightLink","first","second","firstLink","nextLink","prototype","execute"],"mappings":"0HAAA,sjBAOA,SAASA,EAAkBC,GAQvB,IAPA,IAAIC,EAAmB,CACnB,QACA,gBACA,YACA,aACA,WAEKC,EAAK,EAAGC,EAAKC,OAAOC,KAAKL,GAAYE,EAAKC,EAAGG,OAAQJ,IAAM,CAChE,IAAIK,EAAMJ,EAAGD,GACb,GAAID,EAAiBO,QAAQD,GAAO,EAChC,MAA8C,IAAI,OAAe,GAGzE,OAAOP,EArBX,sEAuBiB,SAAUS,GAEvB,SAASC,EAAUC,EAASC,GACxB,IAAIC,EAAQJ,EAAOK,KAAKC,KAAMJ,IAAYI,KAE1C,OADAF,EAAMD,KAAOA,EACNC,EAJX,uBAAUH,EAAWD,IADT,CAQdO,OACF,SAASC,EAAcL,GACnB,OAAOA,EAAKM,QAAQZ,QAAU,EAElC,SAASa,EAAUC,GACf,IAAIC,GAAY,EAChB,OAAO,IAAIC,SAAQ,SAAUC,EAASC,GAClCJ,EAAWK,UAAU,CACjBC,KAAM,SAAUC,GACRN,IAIAA,GAAY,EACZE,EAAQI,KAGhBC,MAAOJ,OAInB,IAAIK,EAAcV,EAClB,SAASW,EAAYC,GACjB,OAAO,IAAI,QAAW,SAAUC,GAC5BD,EACKE,MAAK,SAAUC,GAChBF,EAASN,KAAKQ,GACdF,EAASG,cAERC,MAAMJ,EAASJ,MAAMS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,OAAe,IAErEI,EAAWC,MAAQA,EACnBD,EAAWE,KAAOA,EAClBF,EAAWS,MAAQA,EACnBT,EAAWoB,QAAUA,EACdpB,EAlBM,GAoBjB,SAASoB,EAAQtE,EAAMZ,GACnB,OAAQY,EAAKM,QAAQ4B,EAAgB9C,EAAUgD,QAASR,EAAmBzC,EAAkBC,OAAiB,OAAW2D","file":"js/npm.apollo-link~41678a58.302f94f3.js","sourcesContent":["import Observable from 'zen-observable-ts';\nexport { default as Observable } from 'zen-observable-ts';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { __extends, __assign } from 'tslib';\nimport { getOperationName } from 'apollo-utilities';\nexport { getOperationName } from 'apollo-utilities';\n\nfunction validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(2) : new InvariantError(\"illegal argument: \" + key);\n }\n }\n return operation;\n}\nvar LinkError = (function (_super) {\n __extends(LinkError, _super);\n function LinkError(message, link) {\n var _this = _super.call(this, message) || this;\n _this.link = link;\n return _this;\n }\n return LinkError;\n}(Error));\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nfunction toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\nvar makePromise = toPromise;\nfunction fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\nfunction fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\nfunction transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n return transformedOperation;\n}\nfunction createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign({}, context, next(context));\n }\n else {\n context = __assign({}, context, next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: function () { return getKey(operation); },\n });\n return operation;\n}\nfunction getKey(operation) {\n var query = operation.query, variables = operation.variables, operationName = operation.operationName;\n return JSON.stringify([operationName, query, variables]);\n}\n\nfunction passthrough(op, forward) {\n return forward ? forward(op) : Observable.of();\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction empty() {\n return new ApolloLink(function () { return Observable.of(); });\n}\nfunction from(links) {\n if (links.length === 0)\n return empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n}\nfunction split(test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}\nvar concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n process.env.NODE_ENV === \"production\" || invariant.warn(new LinkError(\"You are calling concat on a terminating link, which will have no effect\", firstLink));\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n};\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(1) : new InvariantError('request is not implemented');\n };\n ApolloLink.empty = empty;\n ApolloLink.from = from;\n ApolloLink.split = split;\n ApolloLink.execute = execute;\n return ApolloLink;\n}());\nfunction execute(link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n}\n\nexport { ApolloLink, concat, createOperation, empty, execute, from, fromError, fromPromise, makePromise, split, toPromise };\n//# sourceMappingURL=bundle.esm.js.map\n"],"sourceRoot":""}