relay-runtime 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +16 -26
- package/index.js +3 -6
- package/lib/ConvertToExecuteFunction.js +73 -0
- package/lib/RelayConcreteNode.js +31 -14
- package/lib/RelayConcreteVariables.js +11 -6
- package/lib/RelayConnectionHandler.js +2 -4
- package/lib/RelayConnectionInterface.js +3 -5
- package/lib/RelayCore.js +4 -6
- package/lib/RelayDataLoader.js +2 -4
- package/lib/RelayDeclarativeMutationConfig.js +316 -0
- package/lib/RelayDefaultHandleKey.js +2 -4
- package/lib/RelayDefaultHandlerProvider.js +2 -4
- package/lib/RelayError.js +2 -6
- package/lib/RelayInMemoryRecordSource.js +2 -4
- package/lib/RelayInternalTypes.js +2 -5
- package/lib/RelayInternals.js +2 -5
- package/lib/RelayMarkSweepStore.js +22 -5
- package/lib/RelayMetricsRecorder.js +9 -9
- package/lib/RelayMockRenderer.js +3 -8
- package/lib/RelayModernEnvironment.js +120 -135
- package/lib/RelayModernFragmentSpecResolver.js +81 -55
- package/lib/RelayModernGraphQLTag.js +8 -17
- package/lib/RelayModernOperationSelector.js +8 -8
- package/lib/RelayModernRecord.js +8 -8
- package/lib/RelayModernSelector.js +54 -43
- package/lib/RelayNetwork.js +9 -11
- package/lib/RelayNetworkDebug.js +4 -7
- package/lib/RelayNetworkLogger.js +2 -4
- package/lib/RelayNetworkLoggerTransaction.js +18 -20
- package/lib/RelayNetworkTypes.js +2 -4
- package/lib/RelayObservable.js +193 -120
- package/lib/RelayProfiler.js +7 -7
- package/lib/RelayPublishQueue.js +17 -9
- package/lib/RelayQueryCaching.js +2 -5
- package/lib/RelayQueryResponseCache.js +3 -5
- package/lib/RelayReader.js +18 -8
- package/lib/RelayRecordProxy.js +12 -11
- package/lib/RelayRecordSourceMutator.js +9 -9
- package/lib/RelayRecordSourceProxy.js +15 -13
- package/lib/RelayRecordSourceSelectorProxy.js +2 -4
- package/lib/RelayRecordState.js +2 -4
- package/lib/RelayReferenceMarker.js +2 -4
- package/lib/RelayResponseNormalizer.js +34 -25
- package/lib/RelayRuntime.js +25 -14
- package/lib/RelayRuntimeTypes.js +22 -0
- package/lib/RelayShallowMock.js +4 -7
- package/lib/RelayStoreTypes.js +2 -4
- package/lib/RelayStoreUtils.js +66 -26
- package/lib/RelayTaskQueue.js +2 -5
- package/lib/RelayTypes.js +2 -5
- package/lib/RelayViewerHandler.js +4 -5
- package/lib/applyRelayModernOptimisticMutation.js +9 -8
- package/lib/cloneRelayHandleSourceField.js +4 -11
- package/lib/commitLocalUpdate.js +2 -4
- package/lib/commitRelayModernMutation.js +24 -22
- package/lib/createRelayNetworkLogger.js +25 -27
- package/lib/dedent.js +2 -5
- package/lib/deepFreeze.js +3 -5
- package/lib/deferrableFragmentKey.js +21 -0
- package/lib/fetchRelayModernQuery.js +13 -21
- package/lib/generateRelayClientID.js +2 -4
- package/lib/getRelayHandleKey.js +2 -4
- package/lib/hasOverlappingIDs.js +2 -4
- package/lib/isCompatibleRelayFragmentType.js +2 -5
- package/lib/isPromise.js +2 -5
- package/lib/isRelayModernEnvironment.js +2 -4
- package/lib/isScalarAndEqual.js +3 -5
- package/lib/normalizePayload.js +10 -13
- package/lib/normalizeRelayPayload.js +8 -5
- package/lib/recycleNodesInto.js +2 -4
- package/lib/relayUnstableBatchedUpdates.js +2 -5
- package/lib/relayUnstableBatchedUpdates.native.js +2 -5
- package/lib/requestRelaySubscription.js +20 -34
- package/lib/simpleClone.js +2 -4
- package/lib/stableCopy.js +35 -0
- package/lib/testEditDistance.js +2 -5
- package/lib/throwFailedPromise.js +2 -5
- package/package.json +4 -5
- package/relay-runtime.js +2307 -2665
- package/relay-runtime.min.js +6 -9
- package/ARCHITECTURE.md +0 -232
- package/PATENTS +0 -33
- package/lib/ConvertToObserveFunction.js +0 -39
- package/lib/RelayDebugger.js +0 -199
- package/lib/RelayRecordSourceInspector.js +0 -289
- package/lib/RelayStoreProxyDebugger.js +0 -44
- package/lib/formatStorageKey.js +0 -37
- package/lib/prettyStringify.js +0 -35
- package/lib/setRelayModernMutationConfigs.js +0 -302
- package/lib/stableJSONStringify.js +0 -45
package/relay-runtime.min.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Relay v1.
|
|
2
|
+
* Relay v1.5.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5
|
-
* All rights reserved.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the BSD-style license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
9
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
10
5
|
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
8
|
*/
|
|
12
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fbjs/lib/invariant"),require("babel-runtime/helpers/classCallCheck"),require("fbjs/lib/warning"),require("fbjs/lib/forEachObject"),require("babel-runtime/helpers/extends"),require("fbjs/lib/areEqual"),require("fbjs/lib/emptyFunction"),require("fbjs/lib/removeFromArray"),require("babel-runtime/helpers/defineProperty"),require("babel-runtime/helpers/toConsumableArray"),require("fbjs/lib/resolveImmediate"),require("fbjs/lib/sprintf")):"function"==typeof define&&define.amd?define(["fbjs/lib/invariant","babel-runtime/helpers/classCallCheck","fbjs/lib/warning","fbjs/lib/forEachObject","babel-runtime/helpers/extends","fbjs/lib/areEqual","fbjs/lib/emptyFunction","fbjs/lib/removeFromArray","babel-runtime/helpers/defineProperty","babel-runtime/helpers/toConsumableArray","fbjs/lib/resolveImmediate","fbjs/lib/sprintf"],t):"object"==typeof exports?exports.RelayRuntime=t(require("fbjs/lib/invariant"),require("babel-runtime/helpers/classCallCheck"),require("fbjs/lib/warning"),require("fbjs/lib/forEachObject"),require("babel-runtime/helpers/extends"),require("fbjs/lib/areEqual"),require("fbjs/lib/emptyFunction"),require("fbjs/lib/removeFromArray"),require("babel-runtime/helpers/defineProperty"),require("babel-runtime/helpers/toConsumableArray"),require("fbjs/lib/resolveImmediate"),require("fbjs/lib/sprintf")):e.RelayRuntime=t(e["fbjs/lib/invariant"],e["babel-runtime/helpers/classCallCheck"],e["fbjs/lib/warning"],e["fbjs/lib/forEachObject"],e["babel-runtime/helpers/extends"],e["fbjs/lib/areEqual"],e["fbjs/lib/emptyFunction"],e["fbjs/lib/removeFromArray"],e["babel-runtime/helpers/defineProperty"],e["babel-runtime/helpers/toConsumableArray"],e["fbjs/lib/resolveImmediate"],e["fbjs/lib/sprintf"])}(this,function(e,t,r,n,o,i,a,s,u,c,l,d){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";e.exports={Environment:r(42),Network:r(45),Observable:r(19),QueryResponseCache:r(47),RecordSource:r(13),Store:r(41),areEqualSelectors:r(9).areEqualSelectors,createFragmentSpecResolver:r(9).createFragmentSpecResolver,createOperationSelector:r(9).createOperationSelector,getDataIDsFromObject:r(9).getDataIDsFromObject,getFragment:r(17).getFragment,getOperation:r(17).getOperation,getSelector:r(9).getSelector,getSelectorList:r(9).getSelectorList,getSelectorsFromObject:r(9).getSelectorsFromObject,getVariablesFromObject:r(9).getVariablesFromObject,graphql:r(17).graphql,ConnectionHandler:r(10),ViewerHandler:r(34),applyOptimisticMutation:r(51),commitLocalUpdate:r(52),commitMutation:r(53),fetchQuery:r(55),isRelayModernEnvironment:r(24),requestSubscription:r(60),ConnectionInterface:r(11)}},function(t,r){t.exports=e},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return(0,v.default)({},e)}function i(e,t){r(7)(e,function(e,r){r!==m&&r!==S&&(t[r]=e)})}function a(e,t){var r={};return r[m]=e,r[S]=t,r}function s(e){return e[m]}function u(e){return e[S]}function c(e,t){var n=e[t];return n&&"object"==typeof n&&r(1)(!n.hasOwnProperty(R)&&!n.hasOwnProperty(E),"RelayModernRecord.getValue(): Expected a scalar (non-link) value for `%s.%s` but found %s.",e[m],t,n.hasOwnProperty(R)?"a linked record":"plural linked records"),n}function l(e,t){var n=e[t];return null==n?n:(r(1)("object"==typeof n&&n&&"string"==typeof n[R],"RelayModernRecord.getLinkedRecordID(): Expected `%s.%s` to be a linked ID, was `%s`.",e[m],t,n),n[R])}function d(e,t){var n=e[t];return null==n?n:(r(1)("object"==typeof n&&Array.isArray(n[E]),"RelayModernRecord.getLinkedRecordIDs(): Expected `%s.%s` to contain an array of linked IDs, got `%s`.",e[m],t,JSON.stringify(n)),n[E])}function p(e,t){var n,o,i=void 0,a=Object.keys(t);for(n=0;n<a.length;n++)o=a[n],!i&&r(27)(e[o],t[o])||(i=i||(0,v.default)({},e),t[o]!==k?i[o]=t[o]:delete i[o]);return i||e}function f(e,t){return Object.assign({},e,t)}function h(e){r(54)(e)}function _(e,t,r){e[t]=r}function y(e,t,r){var n={};n[R]=r,e[t]=n}function g(e,t,r){var n={};n[E]=r,e[t]=n}var v=n(r(14)),b=r(4),m=b.ID_KEY,R=b.REF_KEY,E=b.REFS_KEY,S=b.TYPENAME_KEY,k=b.UNPUBLISH_FIELD_SENTINEL;e.exports={clone:o,copyFields:i,create:a,freeze:h,getDataID:s,getLinkedRecordID:l,getLinkedRecordIDs:d,getType:u,getValue:c,merge:f,setValue:_,setLinkedRecordID:y,setLinkedRecordIDs:g,update:p}},function(e,t){"use strict";var r={CONDITION:"Condition",FRAGMENT:"Fragment",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",LINKED_FIELD:"LinkedField",LINKED_HANDLE:"LinkedHandle",LITERAL:"Literal",LOCAL_ARGUMENT:"LocalArgument",ROOT:"Root",ROOT_ARGUMENT:"RootArgument",SCALAR_FIELD:"ScalarField",SCALAR_HANDLE:"ScalarHandle",VARIABLE:"Variable"};e.exports=r},function(e,t,r){"use strict";function n(e,t){var r={};return e.forEach(function(e){e.kind===s?r[e.name]=a(e.variableName,t):r[e.name]=e.value}),r}function o(e,t,r){var o=e.filter(function(e){return t.indexOf(e.name)>-1});return n(o,r)}function i(e,t){var n,o,i;return e.storageKey?e.storageKey:(n=e.args,o=e.name,n&&n.length?(i=[],n.forEach(function(e){var n=void 0;n=e.kind===s?a(e.variableName,t):e.value,null!=n&&i.push('"'+e.name+'":'+r(26)(n))}),i.length?e.name+("{"+i.join(",")+"}"):e.name):o)}function a(e,t){return r(1)(t.hasOwnProperty(e),"getVariableValue(): Undefined variable `%s`.",e),t[e]}var s=r(3).VARIABLE,u={FRAGMENTS_KEY:"__fragments",ID_KEY:"__id",REF_KEY:"__ref",REFS_KEY:"__refs",ROOT_ID:"client:root",ROOT_TYPE:"__Root",TYPENAME_KEY:"__typename",UNPUBLISH_RECORD_SENTINEL:Object.freeze({__UNPUBLISH_RECORD_SENTINEL:!0}),UNPUBLISH_FIELD_SENTINEL:Object.freeze({__UNPUBLISH_FIELD_SENTINEL:!0}),getArgumentValues:n,getStorageKey:i,getHandleFilterValues:o};e.exports=u},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t,r){"use strict";function n(e,t){if(!t)return e;var n=null;return r(7)(t,function(e,t){null!=e&&(n||(n={}),n[t]=e)}),e+(n?r(26)(n):"")}e.exports=n},function(e,t,r){"use strict";function n(e,t,n,o,i){return new(r(43))(e,n,o,i)}var o=r(17),i=o.getFragment,a=o.getOperation,s=r(44),u=s.createOperationSelector,c=r(32),l=c.areEqualSelectors,d=c.getDataIDsFromObject,p=c.getSelector,f=c.getSelectorList,h=c.getSelectorsFromObject,_=c.getVariablesFromObject;e.exports={areEqualSelectors:l,createFragmentSpecResolver:n,createOperationSelector:u,getDataIDsFromObject:d,getFragment:i,getOperation:a,getSelector:p,getSelectorList:f,getSelectorsFromObject:h,getVariablesFromObject:_}},function(e,t,r){"use strict";function n(e,t){var n,o,i,a,s,u,d,f,h,_,y,g,v,b,m,R,E,S,k,D,x,I,N,L,O=e.get(t.dataID);if(O){if(n=r(11).get(),o=n.EDGES,i=n.END_CURSOR,a=n.HAS_NEXT_PAGE,s=n.HAS_PREV_PAGE,u=n.PAGE_INFO,d=n.PAGE_INFO_TYPE,f=n.START_CURSOR,h=O.getLinkedRecord(t.fieldKey),_=h&&h.getLinkedRecord(u),!h)return void O.setValue(null,t.handleKey);if(y=O.getLinkedRecord(t.handleKey),g=y&&y.getLinkedRecord(u),y){if(m=y,R=h.getLinkedRecords(o),R&&(R=R.map(function(t){return c(e,m,t)})),E=m.getLinkedRecords(o),S=m.getLinkedRecord(u),m.copyFieldsFrom(h),E&&m.setLinkedRecords(E,o),S&&m.setLinkedRecord(S,u),k=[],D=t.args,E&&R)if(null!=D.after){if(!g||D.after!==g.getValue(i))return void r(6)(!1,"RelayConnectionHandler: Unexpected after cursor `%s`, edges must be fetched from the end of the list (`%s`).",D.after,g&&g.getValue(i));x=new Set,l(E,k,x),l(R,k,x)}else if(null!=D.before){if(!g||D.before!==g.getValue(f))return void r(6)(!1,"RelayConnectionHandler: Unexpected before cursor `%s`, edges must be fetched from the beginning of the list (`%s`).",D.before,g&&g.getValue(f));I=new Set,l(R,k,I),l(E,k,I)}else k=R;else k=R?R:E;null!=k&&k!==E&&m.setLinkedRecords(k,o),g&&_&&(null!=D.before||null==D.after&&D.last?(g.setValue(!!_.getValue(s),s),N=_.getValue(f),"string"==typeof N&&g.setValue(N,f)):(null!=D.after||null==D.before&&D.first)&&(g.setValue(!!_.getValue(a),a),L=_.getValue(i),"string"==typeof L&&g.setValue(L,i)))}else v=e.create(r(12)(O.getDataID(),t.handleKey),h.getType()),v.setValue(0,p),v.copyFieldsFrom(h),b=h.getLinkedRecords(o),b&&(b=b.map(function(t){return c(e,v,t)}),v.setLinkedRecords(b,o)),O.setLinkedRecord(v,t.handleKey),g=e.create(r(12)(v.getDataID(),u),d),g.setValue(!1,a),g.setValue(!1,s),g.setValue(null,i),g.setValue(null,f),_&&g.copyFieldsFrom(_),v.setLinkedRecord(g,u)}}function o(e,t,n){var o=r(23)(d,t,null);return e.getLinkedRecord(o,n)}function i(e,t,n){var o,i,a,s,u,c=r(11).get(),l=c.CURSOR,d=c.EDGES,p=e.getLinkedRecords(d);if(!p)return void e.setLinkedRecords([t],d);if(o=void 0,null==n)o=p.concat(t);else{for(o=[],i=!1,a=0;a<p.length;a++)s=p[a],o.push(s),null!=s&&(u=s.getValue(l),n===u&&(o.push(t),i=!0));i||o.push(t)}e.setLinkedRecords(o,d)}function a(e,t,n,o){var i=r(11).get(),a=i.NODE,s=r(12)(t.getDataID(),n.getDataID()),u=e.get(s);return u||(u=e.create(s,o)),u.setLinkedRecord(n,a),u}function s(e,t,n){var o,i,a,s,u,c=r(11).get(),l=c.CURSOR,d=c.EDGES,p=e.getLinkedRecords(d);if(!p)return void e.setLinkedRecords([t],d);if(o=void 0,null==n)o=[t].concat(p);else{for(o=[],i=!1,a=0;a<p.length;a++)s=p[a],null!=s&&(u=s.getValue(l),n===u&&(o.push(t),i=!0)),o.push(s);i||o.unshift(t)}e.setLinkedRecords(o,d)}function u(e,t){var n,o,i,a,s=r(11).get(),u=s.EDGES,c=s.NODE,l=e.getLinkedRecords(u);if(l){for(n=void 0,o=0;o<l.length;o++)i=l[o],a=i&&i.getLinkedRecord(c),null!=a&&a.getDataID()===t?void 0===n&&(n=l.slice(0,o)):void 0!==n&&n.push(i);void 0!==n&&e.setLinkedRecords(n,u)}}function c(e,t,n){var o,i,a,s,u;return null==n?n:(o=r(11).get(),i=o.EDGES,a=t.getValue(p),r(1)("number"==typeof a,"RelayConnectionHandler: Expected %s to be a number, got `%s`.",p,a),s=r(12)(t.getDataID(),i,a),u=e.create(s,n.getType()),u.copyFieldsFrom(n),t.setValue(a+1,p),u)}function l(e,t,n){var o,i,a,s,u=r(11).get(),c=u.NODE;for(o=0;o<e.length;o++)if(i=e[o]){if(a=i.getLinkedRecord(c),s=a&&a.getValue("id")){if(n.has(s))continue;n.add(s)}t.push(i)}}var d="connection",p="__connection_next_edge_index";e.exports={buildConnectionEdge:c,createEdge:a,deleteNode:u,getConnection:o,insertEdgeAfter:i,insertEdgeBefore:s,update:n}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=n(r(61)),i={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},a={find:!0,first:!0,last:!0},s={CLIENT_MUTATION_ID:"clientMutationId",CURSOR:"cursor",EDGES_HAVE_SOURCE_FIELD:!1,EDGES:"edges",END_CURSOR:"endCursor",HAS_NEXT_PAGE:"hasNextPage",HAS_PREV_PAGE:"hasPreviousPage",NODE:"node",PAGE_INFO_TYPE:"PageInfo",PAGE_INFO:"pageInfo",START_CURSOR:"startCursor"},u={inject:function(e){s=e},get:function(){return s},isConnectionCall:function(e){return i.hasOwnProperty(e.name)},hasRangeCalls:function(e){return e.some(function(e){return a.hasOwnProperty(e.name)})},getDefaultPageInfo:function(){var e;return e={},(0,o.default)(e,s.END_CURSOR,void 0),(0,o.default)(e,s.HAS_NEXT_PAGE,!1),(0,o.default)(e,s.HAS_PREV_PAGE,!1),(0,o.default)(e,s.START_CURSOR,void 0),e}};e.exports=u},function(e,t){"use strict";function r(e,t,r){var o=e+":"+t;return null!=r&&(o+=":"+r),0!==o.indexOf(n)&&(o=n+o),o}var n="client:";e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=n(r(5)),i=r(15).EXISTENT,a=r(15).NONEXISTENT,s=r(15).UNKNOWN,u=function(){function e(t){(0,o.default)(this,e),this._records=t||{}}return e.prototype.clear=function(){this._records={}},e.prototype.delete=function(e){this._records[e]=null},e.prototype.get=function(e){return this._records[e]},e.prototype.getRecordIDs=function(){return Object.keys(this._records)},e.prototype.getStatus=function(e){return this._records.hasOwnProperty(e)?null==this._records[e]?a:i:s},e.prototype.has=function(e){return this._records.hasOwnProperty(e)},e.prototype.load=function(e,t){t(null,this.get(e))},e.prototype.remove=function(e){delete this._records[e]},e.prototype.set=function(e,t){this._records[e]=t},e.prototype.size=function(){return Object.keys(this._records).length},e.prototype.toJSON=function(){return this._records},e}();e.exports=u},function(e,t){e.exports=o},function(e,t){"use strict";var r={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"};e.exports=r},function(e,t,r){"use strict";function n(e,t,n){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{handleStrippedNulls:!1},u=new(r(13));return u.set(i,r(2).create(i,a)),o=r(50).normalize(u,e,t,s),{errors:n,fieldPayloads:o,source:u}}var o=r(4),i=o.ROOT_ID,a=o.ROOT_TYPE;e.exports=n},function(e,t,r){"use strict";function n(e){r(1)(!1,"graphql: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`.")}function o(e){var t="function"==typeof e?e:e.modern;return"function"!=typeof t?e:t()}function i(e){var t=o(e);return r(1)("object"==typeof t&&null!==t&&"Fragment"===t.kind,"RelayModernGraphQLTag: Expected a fragment, got `%s`.",JSON.stringify(t)),t}function a(e){var t=o(e);return r(1)("object"==typeof t&&null!==t&&"Batch"===t.kind,"RelayModernGraphQLTag: Expected an operation, got `%s`.",JSON.stringify(t)),t}n.experimental=function(e){r(1)(!1,"graphql.experimental: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`.")},e.exports={getFragment:i,getOperation:a,graphql:n}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=n(r(14)),i=n(r(5)),a=r(15),s=a.EXISTENT,u=r(4),c=u.UNPUBLISH_FIELD_SENTINEL,l=u.UNPUBLISH_RECORD_SENTINEL,d=function(){function e(t,r,n){(0,i.default)(this,e),this._backup=n,this._base=t,this._sink=r,this.__sources=[r,t]}return e.prototype._createBackupRecord=function(e){var t,r=this._backup;r&&!r.has(e)&&(t=this._base.get(e),null!=t?r.set(e,t):null===t&&r.delete(e))},e.prototype._setSentinelFieldsInBackupRecord=function(e,t){var n,i,a=this._backup;a&&(n=a.get(e),n&&n!==l&&(i=null,r(7)(t,function(e,t){t in n||(i=i||(0,o.default)({},n),i[t]=c)}),a.set(e,i||n)))},e.prototype._setSentinelFieldInBackupRecord=function(e,t){var n,i,a=this._backup;a&&(n=a.get(e),!n||n===l||t in n||(i=(0,o.default)({},n),r(2).setValue(i,t,c),a.set(e,i)))},e.prototype._getSinkRecord=function(e){var t,n=this._sink.get(e);return n||(t=this._base.get(e),r(1)(t,"RelayRecordSourceMutator: Cannot modify non-existent record `%s`.",e),n=r(2).create(e,r(2).getType(t)),this._sink.set(e,n)),n},e.prototype.copyFields=function(e,t){var n,o=this._sink.get(e),i=this._base.get(e);r(1)(o||i,"RelayRecordSourceMutator#copyFields(): Cannot copy fields from non-existent record `%s`.",e),this._createBackupRecord(t),n=this._getSinkRecord(t),i&&r(2).copyFields(i,n),o&&r(2).copyFields(o,n),this._setSentinelFieldsInBackupRecord(t,n)},e.prototype.copyFieldsFromRecord=function(e,t){this.copyFields(r(2).getDataID(e),t);var n=this._getSinkRecord(t);r(2).copyFields(e,n),this._setSentinelFieldsInBackupRecord(t,n)},e.prototype.create=function(e,t){r(1)(this._base.getStatus(e)!==s&&this._sink.getStatus(e)!==s,"RelayRecordSourceMutator#create(): Cannot create a record with id `%s`, this record already exists.",e),this._backup&&this._backup.set(e,l);var n=r(2).create(e,t);this._sink.set(e,n)},e.prototype.delete=function(e){this._createBackupRecord(e),this._sink.delete(e)},e.prototype.getStatus=function(e){return this._sink.has(e)?this._sink.getStatus(e):this._base.getStatus(e)},e.prototype.getType=function(e){var t,n;for(t=0;t<this.__sources.length;t++){if(n=this.__sources[t].get(e))return r(2).getType(n);if(null===n)return null}},e.prototype.getValue=function(e,t){var n,o,i;for(n=0;n<this.__sources.length;n++)if(o=this.__sources[n].get(e)){if(i=r(2).getValue(o,t),void 0!==i)return i}else if(null===o)return null},e.prototype.setValue=function(e,t,n){this._createBackupRecord(e);var o=this._getSinkRecord(e);r(2).setValue(o,t,n),this._setSentinelFieldInBackupRecord(e,t)},e.prototype.getLinkedRecordID=function(e,t){var n,o,i;for(n=0;n<this.__sources.length;n++)if(o=this.__sources[n].get(e)){if(i=r(2).getLinkedRecordID(o,t),void 0!==i)return i}else if(null===o)return null},e.prototype.setLinkedRecordID=function(e,t,n){this._createBackupRecord(e);var o=this._getSinkRecord(e);r(2).setLinkedRecordID(o,t,n),this._setSentinelFieldInBackupRecord(e,t)},e.prototype.getLinkedRecordIDs=function(e,t){var n,o,i;for(n=0;n<this.__sources.length;n++)if(o=this.__sources[n].get(e)){if(i=r(2).getLinkedRecordIDs(o,t),void 0!==i)return i}else if(null===o)return null},e.prototype.setLinkedRecordIDs=function(e,t,n){this._createBackupRecord(e);var o=this._getSinkRecord(e);r(2).setLinkedRecordIDs(o,t,n),this._setSentinelFieldInBackupRecord(e,t)},e}();e.exports=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"object"==typeof e&&null!==e&&"function"==typeof e.subscribe}function i(e){return e instanceof f?e:new f(function(t){return e.subscribe(t)})}function a(e){return new f(function(t){e.then(function(e){t.next(e),t.complete()},t.error)})}function s(e){return new f(function(t){t.next(e),t.complete()})}function u(e){return new f(function(t){t.error(e)})}function c(e){p&&p(e)}function l(e,t){function r(){if(i){if(i.unsubscribe)i.unsubscribe();else try{i()}catch(e){c(e)}i=void 0}}var n,o=!1,i=void 0,a={unsubscribe:function(){if(!o){o=!0;try{t.unsubscribe&&t.unsubscribe(a)}catch(e){c(e)}finally{r()}}}};try{t.start&&t.start(a)}catch(s){c(s)}if(o)return a;n={next:function(e){if(!o&&t.next)try{t.next(e)}catch(r){c(r)}},error:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){try{if(o)throw e;if(o=!0,!t.error)throw e;t.error(e)}catch(n){c(n)}finally{r()}}),complete:function(){if(!o){o=!0;try{t.complete&&t.complete()}catch(e){c(e)}finally{r()}}}};try{i=e(n)}catch(s){n.error(s)}return o&&r(),a}var d=n(r(5)),p=void 0,f=function(){function e(t){(0,d.default)(this,e),this._source=t}return e.onUnhandledError=function(e){p=e},e.from=function(e){return o(e)?i(e):r(57)(e)?a(e):e instanceof Error?u(e):s(e)},e.fromLegacy=function(t){return new e(function(e){var r=t({onNext:e.next,onError:e.error,onCompleted:e.complete});return o(r)?r.subscribe(e):function(){return r.dispose()}})},e.prototype.catch=function(t){var r=this;return new e(function(e){var n=void 0;return r.subscribe({start:function(e){n=e},next:e.next,complete:e.complete,error:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(r){try{t(r).subscribe({start:function(e){n=e},next:e.next,complete:e.complete,error:e.error})}catch(o){e.error(o)}})}),function(){return n.unsubscribe()}})},e.prototype.do=function(t){var r=this;return new e(function(e){var n=function(r){return function(){try{t[r]&&t[r].apply(t,arguments)}catch(n){c(n)}e[r]&&e[r].apply(e,arguments)}};return r.subscribe({start:n("start"),next:n("next"),error:n("error"),complete:n("complete"),unsubscribe:n("unsubscribe")})})},e.prototype.ifEmpty=function(t){var r=this;return new e(function(e){var n=!1,o=r.subscribe({next:function(t){n=!0,e.next(t)},error:e.error,complete:function(){n?e.complete():o=t.subscribe(e)}});return function(){o.unsubscribe()}})},e.prototype.subscribe=function(e){return l(this._source,e)},e.prototype.subscribeLegacy=function(e){var t=this.subscribe({next:e.onNext,error:e.onError,complete:e.onCompleted});return{dispose:t.unsubscribe}},e.prototype.map=function(e){return this.concatMap(function(t){return s(e(t))})},e.prototype.concatMap=function(t){var r=this;return new e(function(n){function o(r){if(s)u.push(r);else try{e.from(t(r)).subscribe({start:function(e){s=e},next:n.next,error:n.error,complete:function(){s=void 0,0!==u.length?o(u.shift()):i&&n.complete()}})}catch(a){n.error(a)}}var i=!1,a=void 0,s=void 0,u=[];return r.subscribe({start:function(e){a=e},next:o,error:n.error,complete:function(){i=!0,s||n.complete()}}),function(){s&&(s.unsubscribe(),s=void 0),a.unsubscribe(),u.length=0}})},e.prototype.poll=function(t){var r=this;return new e(function(e){var n=void 0,o=void 0,i=function a(){n=r.subscribe({next:e.next,error:e.error,complete:function(){o=setTimeout(a,t)}})};return i(),function(){clearTimeout(o),n.unsubscribe()}})},e.prototype.toPromise=function(){var e=this;return new Promise(function(t,r){var n=void 0;e.subscribe({start:function(e){n=e},next:function(e){t(e),n.unsubscribe()},error:r,complete:t})})},e}();e.exports=f},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=t.dataID,n=t.node,o=t.variables,i=new _(e,o);return i.read(n,r)}var i=n(r(5)),a=r(3).CONDITION,s=r(3).FRAGMENT_SPREAD,u=r(3).INLINE_FRAGMENT,c=r(3).LINKED_FIELD,l=r(3).SCALAR_FIELD,d=r(4).FRAGMENTS_KEY,p=r(4).ID_KEY,f=r(4).getArgumentValues,h=r(4).getStorageKey,_=function(){function e(t,r){(0,i.default)(this,e),this._recordSource=t,this._seenRecords={},this._variables=r}return e.prototype.read=function(e,t){var r=this._traverse(e,t,null);return{data:r,dataID:t,node:e,seenRecords:this._seenRecords,variables:this._variables}},e.prototype._traverse=function(e,t,r){var n,o=this._recordSource.get(t);return this._seenRecords[t]=o,null==o?o:(n=r||{},this._traverseSelections(e.selections,o,n),n)},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayReader(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._traverseSelections=function(e,t,n){var o=this;e.forEach(function(e){var i,d;e.kind===l?o._readScalar(e,t,n):e.kind===c?e.plural?o._readPluralLink(e,t,n):o._readLink(e,t,n):e.kind===a?(i=o._getVariableValue(e.condition),i===e.passingValue&&o._traverseSelections(e.selections,t,n)):e.kind===u?(d=r(2).getType(t),null!=d&&d===e.type&&o._traverseSelections(e.selections,t,n)):e.kind===s?o._createFragmentPointer(e,t,n):r(1)(!1,"RelayReader(): Unexpected ast kind `%s`.",e.kind)})},e.prototype._readScalar=function(e,t,n){var o=e.alias||e.name,i=h(e,this._variables),a=r(2).getValue(t,i);n[o]=a},e.prototype._readLink=function(e,t,n){var o,i=e.alias||e.name,a=h(e,this._variables),s=r(2).getLinkedRecordID(t,a);return null==s?void(n[i]=s):(o=n[i],r(1)(null==o||"object"==typeof o,"RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.",i,r(2).getDataID(t),o),void(n[i]=this._traverse(e,s,o)))},e.prototype._readPluralLink=function(e,t,n){var o,i,a=this,s=e.alias||e.name,u=h(e,this._variables),c=r(2).getLinkedRecordIDs(t,u);return null==c?void(n[s]=c):(o=n[s],r(1)(null==o||Array.isArray(o),"RelayReader(): Expected data for field `%s` on record `%s` to be an array, got `%s`.",s,r(2).getDataID(t),o),i=o||[],c.forEach(function(n,o){var u,c;return null==n?void(i[o]=n):(u=i[o],r(1)(null==u||"object"==typeof u,"RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.",s,r(2).getDataID(t),u),c=a._traverse(e,n,u),void(i[o]=c))}),void(n[s]=i))},e.prototype._createFragmentPointer=function(e,t,n){var o,i=n[d];i||(i=n[d]={}),r(1)("object"==typeof i&&i,"RelayReader: Expected fragment spread data to be an object, got `%s`.",i),n[p]=n[p]||r(2).getDataID(t),o=e.args?f(e.args,this._variables):{},i[e.name]=o},e}();e.exports={read:o}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=n(r(5)),i=r(15),a=i.EXISTENT,s=i.NONEXISTENT,u=r(4),c=u.ROOT_ID,l=u.ROOT_TYPE,d=function(){function e(t,r){(0,o.default)(this,e),this.__mutator=t,this._handlerProvider=r||null,this._proxies={}}return e.prototype.commitPayload=function(e,t){var n,o,i,u,c=this;return t?(n=r(16)(e.root,t),o=n.source,i=n.fieldPayloads,u=o.getRecordIDs(),u.forEach(function(e){var t,n=o.getStatus(e);n===a?(t=o.get(e),t&&(c.__mutator.getStatus(e)!==a&&c.create(e,r(2).getType(t)),c.__mutator.copyFieldsFromRecord(t,e),delete c._proxies[e])):n===s&&c.delete(e)}),i&&i.length&&i.forEach(function(e){var t=c._handlerProvider&&c._handlerProvider(e.handle);r(1)(t,"RelayModernEnvironment: Expected a handler to be provided for handle `%s`.",e.handle),t.update(c,e)}),new(r(22))(this,e.fragment)):new(r(22))(this,e.fragment)},e.prototype.create=function(e,t){this.__mutator.create(e,t),delete this._proxies[e];var n=this.get(e);return r(1)(n,"RelayRecordSourceProxy#create(): Expected the created record to exist."),n},e.prototype.delete=function(e){r(1)(e!==c,"RelayRecordSourceProxy#delete(): Cannot delete the root record."),delete this._proxies[e],this.__mutator.delete(e)},e.prototype.get=function(e){if(!this._proxies.hasOwnProperty(e)){var t=this.__mutator.getStatus(e);t===a?this._proxies[e]=new(r(48))(this,this.__mutator,e):this._proxies[e]=t===s?null:void 0}return this._proxies[e]},e.prototype.getRoot=function(){var e=this.get(c);return e||(e=this.create(c,l)),r(1)(e&&e.getType()===l,"RelayRecordSourceProxy#getRoot(): Expected the source to contain a root record."),e},e}();e.exports=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=n(r(5)),i=r(4),a=i.getStorageKey,s=function(){function e(t,r){(0,o.default)(this,e),this.__recordSource=t,this._readSelector=r}return e.prototype.create=function(e,t){return this.__recordSource.create(e,t)},e.prototype.delete=function(e){this.__recordSource.delete(e)},e.prototype.get=function(e){return this.__recordSource.get(e)},e.prototype.getRoot=function(){return this.__recordSource.getRoot()},e.prototype._getRootField=function(e,t,n){var o=e.node.selections.find(function(e){return"LinkedField"===e.kind&&e.name===t});return r(1)(o&&"LinkedField"===o.kind,"RelayRecordSourceSelectorProxy#getRootField(): Cannot find root field `%s`, no such field is defined on GraphQL document `%s`.",t,e.node.name),r(1)(o.plural===n,"RelayRecordSourceSelectorProxy#getRootField(): Expected root field `%s` to be %s.",t,n?"plural":"singular"),o},e.prototype.getRootField=function(e){var t=this._getRootField(this._readSelector,e,!1),r=a(t,this._readSelector.variables);return this.getRoot().getLinkedRecord(r)},e.prototype.getPluralRootField=function(e){var t=this._getRootField(this._readSelector,e,!0),r=a(t,this._readSelector.variables);return this.getRoot().getLinkedRecords(r)},e}();e.exports=s},function(e,t,r){"use strict";function n(e,t,n){return t&&t!==i?"__"+t+"_"+e:(r(1)(null!=n,"getRelayHandleKey: Expected either `fieldName` or `key` in `handle` to be provided"),"__"+n+"_"+e)}var o=r(38),i=o.DEFAULT_HANDLE_KEY;e.exports=n},function(e,t){"use strict";function r(e){return Boolean(e&&e["@@RelayModernEnvironment"])}e.exports=r},function(e,t,r){"use strict";function n(e,t,r,n){var s=r?[r]:[],u=n?[n]:[];return e.forEach(function(e){var r,n,c;switch(e.type){case"NODE_DELETE":r=o(e,t),r&&(s.push(r),u.push(r));break;case"RANGE_ADD":n=i(e,t),n&&(s.push(n),u.push(n));break;case"RANGE_DELETE":c=a(e,t),c&&(s.push(c),u.push(c))}}),r=function(e,t){s.forEach(function(r){r(e,t)})},n=function(e,t){u.forEach(function(r){r(e,t)})},{optimisticUpdater:r,updater:n}}function o(e,t){var r,n,o=void 0;if("NODE_DELETE"===e.type)return r=e.deletedIDFieldName,n=u(t),n&&(o=function(e,t){var o,i,a=e.getRootField(n);a&&(o=a.getValue(r),i=Array.isArray(o)?o:[o],i.forEach(function(t){t&&"string"==typeof t&&e.delete(t)}))}),o}function i(e,t){var n,o,i,a,s=void 0;if("RANGE_ADD"===e.type)return n=e.parentID,o=e.connectionInfo,i=e.edgeName,n?(a=u(t),o&&a&&(s=function(e,t){var s,u,c,l,d,p,f,h,_,y,g=e.get(n);if(g){if(s=e.getRootField(a),!s)return;u=s.getLinkedRecord(i),c=!0,l=!1,d=void 0;try{for(p=o[Symbol.iterator]();!(c=(f=p.next()).done);c=!0)if(h=f.value,u){if(_=r(10).getConnection(g,h.key,h.filters),!_)return;if(y=r(10).buildConnectionEdge(e,_,u),!y)return;switch(h.rangeBehavior){case"append":r(10).insertEdgeAfter(_,y);break;case"ignore":break;case"prepend":r(10).insertEdgeBefore(_,y);break;default:r(6)(!1,"setRelayModernMutationConfigs: RANGE_ADD range behavior "+("'"+h.rangeBehavior+"' will not work as expected in RelayModern, ")+"supported range behaviors are 'append', 'prepend', and 'ignore'")}}}catch(v){l=!0,d=v}finally{try{!c&&p.return&&p.return()}finally{if(l)throw d}}}}),s):void r(6)(!1,"setRelayModernMutationConfigs: For mutation config RANGE_ADD to work you must include a parentID")}function a(e,t){var n,o,i,a,c,l=void 0;if("RANGE_DELETE"===e.type)return n=e.parentID,o=e.connectionKeys,i=e.pathToConnection,a=e.deletedIDFieldName,n?(c=u(t),c&&(l=function(e,t){var r,u,l,d,p,f,h,_;if(t){if(r=[],u=t[c],u&&Array.isArray(a)){l=!0,d=!1,p=void 0;try{for(f=a[Symbol.iterator]();!(l=(h=f.next()).done);l=!0)_=h.value,u&&"object"==typeof u&&(u=u[_])}catch(y){d=!0,p=y}finally{try{!l&&f.return&&f.return()}finally{if(d)throw p}}Array.isArray(u)?u.forEach(function(e){e&&e.id&&"object"==typeof e&&"string"==typeof e.id&&r.push(e.id)}):u&&u.id&&"string"==typeof u.id&&r.push(u.id)}else u&&"string"==typeof a&&"object"==typeof u&&(u=u[a],"string"==typeof u?r.push(u):Array.isArray(u)&&u.forEach(function(e){"string"==typeof e&&r.push(e)}));s(n,o,i,e,r)}}),l):void r(6)(!1,"setRelayModernMutationConfigs: For mutation config RANGE_DELETE to work you must include a parentID")}function s(e,t,n,o,i){var a,s,u,c,l,d,p,f,h,_;if(r(6)(t,"setRelayModernMutationConfigs: RANGE_DELETE must provide a connectionKeys"),a=o.get(e))if(n.length>=2){for(s=a,u=1;u<n.length-1;u++)s&&(s=s.getLinkedRecord(n[u]));if(t&&s){c=!0,l=!1,d=void 0;try{for(p=function(){var e=h.value,t=r(10).getConnection(s,e.key,e.filters);if(t)return i.forEach(function(e){r(10).deleteNode(t,e)}),"break"},f=t[Symbol.iterator]();!(c=(h=f.next()).done)&&(_=p(),"break"!==_);c=!0);}catch(y){l=!0,d=y}finally{try{!c&&f.return&&f.return()}finally{if(l)throw d}}}else r(6)(!1,"setRelayModernMutationConfigs: RANGE_DELETE pathToConnection is incorrect. Unable to find connection with parentID: %s and path: %s",e,n.toString())}else r(6)(!1,"setRelayModernMutationConfigs: RANGE_DELETE pathToConnection must include at least parent and connection")}function u(e){var t=void 0;return e.fragment&&e.fragment.selections&&e.fragment.selections.length>0&&"LinkedField"===e.fragment.selections[0].kind&&(t=e.fragment.selections[0].name),t}e.exports=n},function(e,t){"use strict";function r(e){var t,n,o,i,a,s,u,c;if(Array.isArray(e)){for(t=[],n=0;n<e.length;n++)o=void 0!==e[n]?e[n]:null,t.push(r(o));return"["+t.join(",")+"]"}if("object"==typeof e&&e){for(i=[],a=Object.keys(e),a.sort(),s=0;s<a.length;s++)u=a[s],c=r(e[u]),i.push('"'+u+'":'+c);return"{"+i.join(",")+"}"}return JSON.stringify(e)}e.exports=r},function(e,t){e.exports=i},function(e,t){e.exports=a},function(e,t){e.exports=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var o=void 0;return e.argumentDefinitions.forEach(function(i){if(!n.hasOwnProperty(i.name))switch(o=o||(0,a.default)({},n),i.kind){case"LocalArgument":o[i.name]=i.defaultValue;break;case"RootArgument":r(1)(t.hasOwnProperty(i.name),"RelayConcreteVariables: Expected a defined query variable for `$%s` in fragment `%s`.",i.name,e.name),o[i.name]=t[i.name];break;default:r(1)(!1,"RelayConcreteVariables: Unexpected node kind `%s` in fragment `%s`.",i.kind,e.name)}}),o||n}function i(e,t){var r={};return e.query.argumentDefinitions.forEach(function(e){var n=e.defaultValue;null!=t[e.name]&&(n=t[e.name]),r[e.name]=n}),r}var a=n(r(14));e.exports={getFragmentVariables:o,getOperationVariables:i}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r,n){var o=r.dataID,i=r.node,a=r.variables,s=new y(e,t,a,n);return s.check(i,o)}var i=n(r(5)),a=r(15),s=a.EXISTENT,u=a.UNKNOWN,c=r(3).CONDITION,l=r(3).INLINE_FRAGMENT,d=r(3).LINKED_FIELD,p=r(3).LINKED_HANDLE,f=r(3).SCALAR_FIELD,h=r(4).getStorageKey,_=r(4).getArgumentValues,y=function(){function e(t,n,o,a){(0,i.default)(this,e),this._source=t,this._variables=o,this._recordWasMissing=!1,this._handlers=a,this._mutator=new(r(18))(t,n)}return e.prototype.check=function(e,t){return this._traverse(e,t),
|
|
13
|
-
!this._recordWasMissing},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayAsyncLoader(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._handleMissing=function(){this._recordWasMissing=!0},e.prototype._getDataForHandlers=function(e,t){return{args:e.args?_(e.args,this._variables):{},record:this._source.get(t)}},e.prototype._handleMissingScalarField=function(e,t){var r,n,o,i,a=this._getDataForHandlers(e,t),s=a.args,u=a.record,c=!0,l=!1,d=void 0;try{for(r=this._handlers[Symbol.iterator]();!(c=(n=r.next()).done);c=!0)if(o=n.value,"scalar"===o.kind&&(i=o.handle(e,u,s),void 0!==i))return i}catch(p){l=!0,d=p}finally{try{!c&&r.return&&r.return()}finally{if(l)throw d}}this._handleMissing()},e.prototype._handleMissingLinkField=function(e,t){var r,n,o,i,a=this._getDataForHandlers(e,t),u=a.args,c=a.record,l=!0,d=!1,p=void 0;try{for(r=this._handlers[Symbol.iterator]();!(l=(n=r.next()).done);l=!0)if(o=n.value,"linked"===o.kind&&(i=o.handle(e,c,u),null!=i&&this._mutator.getStatus(i)===s))return i}catch(f){d=!0,p=f}finally{try{!l&&r.return&&r.return()}finally{if(d)throw p}}this._handleMissing()},e.prototype._handleMissingPluralLinkField=function(e,t){var r,n,o,i,a=this,u=this._getDataForHandlers(e,t),c=u.args,l=u.record,d=!0,p=!1,f=void 0;try{for(r=this._handlers[Symbol.iterator]();!(d=(n=r.next()).done);d=!0)if(o=n.value,"pluralLinked"===o.kind&&(i=o.handle(e,l,c),null!=i))return i.filter(function(e){return null!=e&&a._mutator.getStatus(e)===s})}catch(h){p=!0,f=h}finally{try{!d&&r.return&&r.return()}finally{if(p)throw f}}this._handleMissing()},e.prototype._traverse=function(e,t){var r=this._mutator.getStatus(t);r===u&&this._handleMissing(),r===s&&this._traverseSelections(e.selections,t)},e.prototype._traverseSelections=function(e,t){var n=this;e.every(function(o){var i,a,s;switch(o.kind){case f:n._prepareScalar(o,t);break;case d:o.plural?n._preparePluralLink(o,t):n._prepareLink(o,t);break;case c:i=n._getVariableValue(o.condition),i===o.passingValue&&n._traverseSelections(o.selections,t);break;case l:a=n._mutator.getType(t),null!=a&&a===o.type&&n._traverseSelections(o.selections,t);break;case p:s=r(35)(o,e,n._variables),s.plural?n._preparePluralLink(s,t):n._prepareLink(s,t);break;default:r(1)(o.kind===f,"RelayAsyncLoader(): Unexpected ast kind `%s`.",o.kind)}return!n._done})},e.prototype._prepareScalar=function(e,t){var r=h(e,this._variables),n=this._mutator.getValue(t,r);void 0===n&&(n=this._handleMissingScalarField(e,t),void 0!==n&&this._mutator.setValue(t,r,n))},e.prototype._prepareLink=function(e,t){var r=h(e,this._variables),n=this._mutator.getLinkedRecordID(t,r);void 0===n&&(n=this._handleMissingLinkField(e,t),null!=n&&this._mutator.setLinkedRecordID(t,r,n)),null!=n&&this._traverse(e,n)},e.prototype._preparePluralLink=function(e,t){var r=this,n=h(e,this._variables),o=this._mutator.getLinkedRecordIDs(t,n);void 0===o&&(o=this._handleMissingPluralLinkField(e,t),null!=o&&this._mutator.setLinkedRecordIDs(t,n,o)),o&&o.forEach(function(t){null!=t&&r._traverse(e,t)})},e}();e.exports={check:o}},function(e,t,r){"use strict";function n(e,t,n){var o,i,a,s;return r(1)("object"==typeof n&&null!==n&&!Array.isArray(n),"RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.",t.name,JSON.stringify(n)),o=n[y],i=n[_],"string"==typeof o&&"object"==typeof i&&null!==i&&"object"==typeof i[t.name]&&null!==i[t.name]?(a=i[t.name],s=f(t,e,a),{dataID:o,node:t,variables:s}):(r(6)(!1,"RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`.",t.name,JSON.stringify(n),t.name),null)}function o(e,t,r){var o=null;return r.forEach(function(r){var i=null!=r?n(e,t,r):null;null!=i&&(o=o||[],o.push(i))}),o}function i(e,t,i){var a={};return r(7)(t,function(t,s){var u=i[s];null==u?a[s]=u:t.metadata&&t.metadata.plural===!0?(r(1)(Array.isArray(u),"RelayModernSelector: Expected value for key `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.",s,JSON.stringify(u),t.name),a[s]=o(e,t,u)):(r(1)(!Array.isArray(u),"RelayModernFragmentSpecResolver: Expected value for key `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.",s,JSON.stringify(u),t.name),a[s]=n(e,t,u))}),a}function a(e,t){var n={};return r(7)(e,function(e,o){var i=t[o];null==i?n[o]=i:e.metadata&&e.metadata.plural===!0?(r(1)(Array.isArray(i),"RelayModernSelector: Expected value for key `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.",o,JSON.stringify(i),e.name),n[o]=s(e,i)):(r(1)(!Array.isArray(i),"RelayModernFragmentSpecResolver: Expected value for key `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.",o,JSON.stringify(i),e.name),n[o]=u(e,i))}),n}function s(e,t){var r=void 0;return t.forEach(function(t){var n=null!=t?u(e,t):null;null!=n&&(r=r||[],r.push(n))}),r||null}function u(e,t){r(1)("object"==typeof t&&null!==t&&!Array.isArray(t),"RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.",e.name,JSON.stringify(t));var n=t[y];return"string"==typeof n?n:(r(6)(!1,"RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`.",e.name,JSON.stringify(t),e.name),null)}function c(e,t,n){var o={};return r(7)(t,function(t,i){var a,s=n[i];null!=s&&(t.metadata&&t.metadata.plural===!0?(r(1)(Array.isArray(s),"RelayModernSelector: Expected value for key `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.",i,JSON.stringify(s),t.name),s.forEach(function(r){if(null!=r){var n=l(e,t,r);n&&Object.assign(o,n)}})):(r(1)(!Array.isArray(s),"RelayModernFragmentSpecResolver: Expected value for key `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.",i,JSON.stringify(s),t.name),a=l(e,t,s),a&&Object.assign(o,a)))}),o}function l(e,t,r){var o=n(e,t,r);return o?o.variables:null}function d(e,t){return e.dataID===t.dataID&&e.node===t.node&&r(27)(e.variables,t.variables)}var p=r(30),f=p.getFragmentVariables,h=r(4),_=h.FRAGMENTS_KEY,y=h.ID_KEY;e.exports={areEqualSelectors:d,getDataIDsFromObject:a,getSelector:n,getSelectorList:o,getSelectorsFromObject:i,getVariablesFromObject:c}},function(e,t,r){"use strict";var n={"*":[]},o={"*":[]},i={},a={stop:r(28)},s=function(e){return"@"!==e.charAt(0)},u={instrumentMethods:function(e,t){r(7)(t,function(t,r){e[r]=u.instrument(t,e[r])})},instrument:function(e,t){var o,a,u,c,l,d;return s(e)?(n.hasOwnProperty(e)||(n[e]=[]),o=n["*"],a=n[e],u=[],c=[],l=function p(){var r=c[c.length-1];r[0]?(r[0]--,o[r[0]](e,p)):r[1]?(r[1]--,a[r[1]](e,p)):r[2]?(r[2]--,u[r[2]](e,p)):r[5]=t.apply(r[3],r[4])},d=function(){var e,r=void 0;if(0===a.length&&0===u.length&&0===o.length)r=t.apply(this,arguments);else if(c.push([o.length,a.length,u.length,this,arguments,i]),l(),e=c.pop(),r=e[5],r===i)throw new Error("RelayProfiler: Handler did not invoke original function.");return r},d.attachHandler=function(e){u.push(e)},d.detachHandler=function(e){r(29)(u,e)},d.displayName="(instrumented "+e+")",d):(t.attachHandler=r(28),t.detachHandler=r(28),t)},attachAggregateHandler:function(e,t){s(e)&&(n.hasOwnProperty(e)||(n[e]=[]),n[e].push(t))},detachAggregateHandler:function(e,t){s(e)&&n.hasOwnProperty(e)&&r(29)(n[e],t)},profile:function(e,t){var r,n,i,s,u,c=o["*"].length>0,l=o.hasOwnProperty(e);if(l||c){for(r=l&&c?o[e].concat(o["*"]):l?o[e]:o["*"],n=void 0,i=r.length-1;i>=0;i--)s=r[i],u=s(e,t),n=n||[],n.unshift(u);return{stop:function(){n&&n.forEach(function(e){return e()})}}}return a},attachProfileHandler:function(e,t){s(e)&&(o.hasOwnProperty(e)||(o[e]=[]),o[e].push(t))},detachProfileHandler:function(e,t){s(e)&&o.hasOwnProperty(e)&&r(29)(o[e],t)}};e.exports=u},function(e,t,r){"use strict";function n(e,t){var r,n,o,i=e.get(t.dataID);if(i){if(r=i.getLinkedRecord(t.fieldKey),!r)return void i.setValue(null,t.handleKey);if(r.getDataID()===a)return i.setValue(null,t.fieldKey),void i.setLinkedRecord(r,t.handleKey);n=e.get(a)||e.create(a,s),n.copyFieldsFrom(r),i.setValue(null,t.fieldKey),i.setLinkedRecord(n,t.handleKey),o=e.getRoot(),o.setLinkedRecord(n,t.handleKey)}}var o=r(4),i=o.ROOT_ID,a=r(12)(i,"viewer"),s="Viewer";e.exports={VIEWER_ID:a,update:n}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var o,a,c,l=t.find(function(t){return t.kind===u&&t.name===e.name&&t.alias===e.alias&&r(27)(t.args,e.args)});return r(1)(l&&l.kind===u,"cloneRelayHandleSourceField: Expected a corresponding source field for handle `%s`.",e.handle),o=r(23)(e.handle,e.key,e.name),e.filters&&e.filters.length>0&&(a=s(e.args||[],e.filters,n),o=r(8)(o,a)),c=(0,i.default)({},l,{args:null,name:o,storageKey:o})}var i=n(r(14)),a=r(4),s=a.getHandleFilterValues,u=r(3).LINKED_FIELD;e.exports=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var o,a=n.data,u=n.errors;if(null!=a)return r(16)({dataID:s,node:e.query,variables:n.rerunVariables?(0,i.default)({},t,n.rerunVariables):t},a,u,{handleStrippedNulls:!0});throw o=r(40).create("RelayNetwork","No data returned for operation `%s`, got error(s):\n%s\n\nSee the error `source` property for more information.",e.name,u?u.map(function(e){var t=e.message;return t}).join("\n"):"(No errors)"),o.source={errors:u,operation:e,variables:t},o}var i=n(r(14)),a=r(4),s=a.ROOT_ID;e.exports=o},function(e,t,r){"use strict";function n(e){return function(t,n,o,i){return r(19).from(e(t,n,o,i))}}function o(e){return function(t,n,o){return r(19).fromLegacy(function(r){return e(t,n,o,r)})}}e.exports={convertFetch:n,convertSubscribe:o}},function(e,t){"use strict";e.exports={DEFAULT_HANDLE_KEY:""}},function(e,t,r){"use strict";function n(e){switch(e){case"connection":return r(10);case"viewer":return r(34)}r(1)(!1,"RelayDefaultHandlerProvider: No handler provided for `%s`.",e)}e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n,o){var a=new Error(r(64).apply(void 0,[n].concat((0,i.default)(o))));return a.name=t,a.type=e,a.framesToPop=2,a}var i=n(r(62)),a={create:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return o("mustfix",e,t,n)},createWarning:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return o("warn",e,t,n)}};e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var o,i,a,s,c,l=t.getRecordIDs();for(o=0;o<l.length;o++)i=l[o],a=t.get(i),s=e.get(i),a===u?(e.remove(i),n[i]=!0):a&&s?(c=r(2).update(s,a),c!==s&&(n[i]=!0,e.set(i,c))):null===a?(e.delete(i),null!==s&&(n[i]=!0)):a&&(e.set(i,a),n[i]=!0)}var i=n(r(14)),a=n(r(5)),s=r(4),u=s.UNPUBLISH_RECORD_SENTINEL,c=function(){function e(t){(0,a.default)(this,e),this._hasScheduledGC=!1,this._index=0,this._recordSource=t,this._roots=new Map,this._subscriptions=new Set,this._updatedRecordIDs={}}return e.prototype.getSource=function(){return this._recordSource},e.prototype.check=function(e){return r(31).check(this._recordSource,this._recordSource,e,[])},e.prototype.retain=function(e){var t=this,r=this._index++,n=function(){t._roots.delete(r),t._scheduleGC()};return this._roots.set(r,e),{dispose:n}},e.prototype.lookup=function(e){var t=r(20).read(this._recordSource,e);return t},e.prototype.notify=function(){var e=this;this._subscriptions.forEach(function(t){e._updateSubscription(t)}),this._updatedRecordIDs={}},e.prototype.publish=function(e){o(this._recordSource,e,this._updatedRecordIDs)},e.prototype.subscribe=function(e,t){var r=this,n={callback:t,snapshot:e},o=function(){r._subscriptions.delete(n)};return this._subscriptions.add(n),{dispose:o}},e.prototype._updateSubscription=function(e){var t,n,o,a,s,u=e.callback,c=e.snapshot;r(56)(c,this._updatedRecordIDs)&&(t=r(20).read(this._recordSource,c),n=t.data,o=t.seenRecords,a=r(59)(c.data,n),s=(0,i.default)({},c,{data:a,seenRecords:o}),e.snapshot=s,s.data!==c.data&&u(s))},e.prototype._scheduleGC=function(){var e=this;this._hasScheduledGC||(this._hasScheduledGC=!0,r(63)(function(){e._gc(),e._hasScheduledGC=!1}))},e.prototype._gc=function(){var e,t,n,o=this,i=new Set;if(this._roots.forEach(function(e){r(49).mark(o._recordSource,e,i)}),!i.size)return void this._recordSource.clear();for(e=this._recordSource.getRecordIDs(),t=0;t<e.length;t++)n=e[t],i.has(n)||this._recordSource.remove(n)},e}();r(33).instrumentMethods(c.prototype,{lookup:"RelayMarkSweepStore.prototype.lookup",notify:"RelayMarkSweepStore.prototype.notify",publish:"RelayMarkSweepStore.prototype.publish",retain:"RelayMarkSweepStore.prototype.retain",subscribe:"RelayMarkSweepStore.prototype.subscribe"}),e.exports=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){return u+s++}var i=n(r(5)),a=function(){function e(t){var n,o=this;(0,i.default)(this,e),this.configName=t.configName,n=t.handlerProvider?t.handlerProvider:r(39),this._network=t.network,this._publishQueue=new(r(46))(t.store,n),this._store=t.store,this.unstable_internal=r(9),this.__setNet=function(e){return o._network=e},this._debugger=null}return e.prototype.getStore=function(){return this._store},e.prototype.getDebugger=function(){return this._debugger},e.prototype.applyUpdate=function(e){var t=this,r=function(){t._publishQueue.revertUpdate(e),t._publishQueue.run()};return this._publishQueue.applyUpdate(e),this._publishQueue.run(),{dispose:r}},e.prototype.revertUpdate=function(e){this._publishQueue.revertUpdate(e),this._publishQueue.run()},e.prototype.replaceUpdate=function(e,t){this._publishQueue.revertUpdate(e),this._publishQueue.applyUpdate(t),this._publishQueue.run()},e.prototype.applyMutation=function(e){var t=e.operation,r=e.optimisticResponse,n=e.optimisticUpdater;return this.applyUpdate({operation:t,selectorStoreUpdater:n,response:r||null})},e.prototype.check=function(e){return this._store.check(e)},e.prototype.commitPayload=function(e,t){var n=r(16)(e.root,t);this._publishQueue.commitPayload(e,n),this._publishQueue.run()},e.prototype.commitUpdate=function(e){this._publishQueue.commitUpdate(e),this._publishQueue.run()},e.prototype.lookup=function(e){return this._store.lookup(e)},e.prototype.subscribe=function(e,t){return this._store.subscribe(e,t)},e.prototype.retain=function(e){return this._store.retain(e)},e.prototype.observe=function(e){var t=this,n=e.operation,o=e.cacheConfig,i=e.updater,a=n.node,s=n.variables;return this._network.observe(a,s,o||{}).map(function(e){return r(36)(a,s,e)}).do({next:function(e){t._publishQueue.commitPayload(n,e,i),t._publishQueue.run()}})},e.prototype.observeMutation=function(e){var t=this,n=e.operation,i=e.optimisticResponse,a=e.optimisticUpdater,s=e.updater,u=e.uploadables,c=n.node,l=n.variables,d=o(),p=void 0;return(i||a)&&(p={operation:n,selectorStoreUpdater:a,response:i||null}),this._network.observe(c,l,{force:!0},u).map(function(e){return r(36)(c,l,e)}).do({start:function(){p&&t._recordDebuggerEvent({eventName:"optimistic_update",mutationUid:d,operation:n,fn:function(){p&&t._publishQueue.applyUpdate(p),t._publishQueue.run()}})},next:function(e){t._recordDebuggerEvent({eventName:"request_commit",mutationUid:d,operation:n,payload:e,fn:function(){p&&(t._publishQueue.revertUpdate(p),p=void 0),t._publishQueue.commitPayload(n,e,s),t._publishQueue.run()}})},error:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){t._recordDebuggerEvent({eventName:"request_error",mutationUid:d,operation:n,payload:e,fn:function(){p&&t._publishQueue.revertUpdate(p),t._publishQueue.run()}})}),unsubscribe:function(){p&&t._recordDebuggerEvent({eventName:"optimistic_revert",mutationUid:d,operation:n,fn:function(){p&&t._publishQueue.revertUpdate(p),t._publishQueue.run()}})}})},e.prototype.sendQuery=function(e){var t=e.cacheConfig,r=e.onCompleted,n=e.onError,o=e.onNext,i=e.operation;return this.observe({operation:i,cacheConfig:t}).subscribeLegacy({onNext:o,onError:n,onCompleted:r})},e.prototype.streamQuery=function(e){var t=e.cacheConfig,r=e.onCompleted,n=e.onError,o=e.onNext,i=e.operation;return this.observe({operation:i,cacheConfig:t}).subscribeLegacy({onNext:o,onError:n,onCompleted:r})},e.prototype.sendMutation=function(e){var t=e.onCompleted,r=e.onError,n=e.operation,o=e.optimisticResponse,i=e.optimisticUpdater,a=e.updater,s=e.uploadables;return this.observeMutation({operation:n,optimisticResponse:o,optimisticUpdater:i,updater:a,uploadables:s}).subscribeLegacy({onNext:function(e){e.errors&&t&&t(e.errors)},onError:r,onCompleted:t})},e.prototype.sendSubscription=function(e){var t=e.onCompleted,r=e.onNext,n=e.onError,o=e.operation,i=e.updater;return this.observe({operation:o,updater:i,cacheConfig:{force:!0}}).subscribeLegacy({onNext:r,onError:n,onCompleted:t})},e.prototype._recordDebuggerEvent=function(e){var t=e.eventName,r=e.mutationUid,n=e.operation,o=e.payload,i=e.fn;this._debugger?this._debugger.recordMutationEvent({eventName:t,payload:o,fn:i,mutation:n,seriesId:r}):i()},e.prototype.checkSelectorAndUpdateStore=function(e,t){var n=new(r(13)),o=r(31).check(this._store.getSource(),n,e,t);return n.size()>0&&(this._publishQueue.commitSource(n),this._publishQueue.run()),o},e}(),s=0,u=Math.random().toString();a.prototype["@@RelayModernEnvironment"]=!0,e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){e&&e.dispose()}var i=n(r(14)),a=n(r(5)),s=r(32),u=s.areEqualSelectors,c=s.getSelectorsFromObject,l=function(){function e(t,r,n,o){var i=this;(0,a.default)(this,e),this._onChange=function(){i._stale=!0,i._callback()},this._callback=o,this._context=t,this._data={},this._fragments=r,this._props=n,this._resolvers={},this._stale=!1,this.setProps(n)}return e.prototype.dispose=function(){r(7)(this._resolvers,o)},e.prototype.resolve=function(){var e,t,n=this;return this._stale&&(e=this._data,t=void 0,r(7)(this._resolvers,function(o,a){var s,u,c,l=e[a];o?(s=o.resolve(),(t||s!==l)&&(t=t||(0,i.default)({},e),t[a]=s)):(u=n._props[a],c=void 0!==u?u:null,!t&&r(58)(c,l)||(t=t||(0,i.default)({},e),t[a]=c))}),this._data=t||e,this._stale=!1),this._data},e.prototype.setProps=function(e){var t=this,n=c(this._context.variables,this._fragments,e);r(7)(n,function(e,n){var o=t._resolvers[n];null==e?(null!=o&&o.dispose(),o=null):Array.isArray(e)?null==o?o=new f(t._context.environment,e,t._onChange):(r(1)(o instanceof f,"RelayModernFragmentSpecResolver: Expected prop `%s` to always be an array.",n),o.setSelectors(e)):null==o?o=new d(t._context.environment,e,t._onChange):(r(1)(o instanceof d,"RelayModernFragmentSpecResolver: Expected prop `%s` to always be an object.",n),o.setSelector(e)),t._resolvers[n]=o}),this._props=e,this._stale=!0},e.prototype.setVariables=function(e){r(7)(this._resolvers,function(t){t&&t.setVariables(e)}),this._stale=!0},e}(),d=function(){function e(t,r,n){(0,a.default)(this,e),p.call(this);var o=t.lookup(r);this._callback=n,this._data=o.data,this._environment=t,this._selector=r,this._subscription=t.subscribe(o,this._onChange)}return e.prototype.dispose=function(){this._subscription&&(this._subscription.dispose(),this._subscription=null)},e.prototype.resolve=function(){return this._data},e.prototype.setSelector=function(e){if(null==this._subscription||!u(e,this._selector)){this.dispose();var t=this._environment.lookup(e);this._data=t.data,this._selector=e,this._subscription=this._environment.subscribe(t,this._onChange)}},e.prototype.setVariables=function(e){var t=(0,i.default)({},this._selector,{variables:e});this.setSelector(t)},e}(),p=function(){var e=this;this._onChange=function(t){e._data=t.data,e._callback()}},f=function(){function e(t,r,n){var o=this;(0,a.default)(this,e),this._onChange=function(e){o._stale=!0,o._callback()},this._callback=n,this._data=[],this._environment=t,this._resolvers=[],this._stale=!0,this.setSelectors(r)}return e.prototype.dispose=function(){this._resolvers.forEach(o)},e.prototype.resolve=function(){var e,t,r,n,o;if(this._stale){for(e=this._data,t=void 0,r=0;r<this._resolvers.length;r++)n=e[r],o=this._resolvers[r].resolve(),(t||o!==n)&&(t=t||e.slice(0,r),t.push(o));t||this._resolvers.length===e.length||(t=e.slice(0,this._resolvers.length)),this._data=t||e,this._stale=!1}return this._data},e.prototype.setSelectors=function(e){for(var t,r;this._resolvers.length>e.length;)t=this._resolvers.pop(),t.dispose();for(r=0;r<e.length;r++)r<this._resolvers.length?this._resolvers[r].setSelector(e[r]):this._resolvers[r]=new d(this._environment,e[r],this._onChange);this._stale=!0},e.prototype.setVariables=function(e){this._resolvers.forEach(function(t){return t.setVariables(e)}),this._stale=!0},e}();e.exports=l},function(e,t,r){"use strict";function n(e,t){var r=i(e,t),n=s;return{fragment:{dataID:n,node:e.fragment,variables:r},node:e,root:{dataID:n,node:e.query,variables:r},variables:r}}var o=r(30),i=o.getOperationVariables,a=r(4),s=a.ROOT_ID;e.exports={createOperationSelector:n}},function(e,t,r){"use strict";function n(e,t){function n(e,t,n,i){if("subscription"===e.query.operation)return r(1)(s,"RelayNetwork: This network layer does not support Subscriptions. To use Subscriptions, provide a custom network layer."),r(1)(!i,"RelayNetwork: Cannot provide uploadables while subscribing."),s(e,t,n);var a=n.poll;return null!=a?(r(1)(!i,"RelayNetwork: Cannot provide uploadables while polling."),o(e,t,{force:!0}).poll(a)):o(e,t,n,i)}var o=i(e),s=t?a(t):void 0;return{observe:n}}var o=r(37),i=o.convertFetch,a=o.convertSubscribe;e.exports={create:n}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=r(20).read(e,t).data;return n}var i=n(r(5)),a=function(){function e(t,n){(0,i.default)(this,e),this._backup=new(r(13)),this._handlerProvider=n||null,this._pendingBackupRebase=!1,this._pendingUpdaters=new Set,this._pendingData=new Set,this._pendingOptimisticUpdates=new Set,this._store=t,this._appliedOptimisticUpdates=new Set}return e.prototype.applyUpdate=function(e){r(1)(!this._appliedOptimisticUpdates.has(e)&&!this._pendingOptimisticUpdates.has(e),"RelayPublishQueue: Cannot apply the same update function more than once concurrently."),this._pendingOptimisticUpdates.add(e)},e.prototype.revertUpdate=function(e){this._pendingOptimisticUpdates.has(e)?this._pendingOptimisticUpdates.delete(e):this._appliedOptimisticUpdates.has(e)&&(this._pendingBackupRebase=!0,this._appliedOptimisticUpdates.delete(e))},e.prototype.revertAll=function(){this._pendingBackupRebase=!0,this._pendingOptimisticUpdates.clear(),this._appliedOptimisticUpdates.clear()},e.prototype.commitPayload=function(e,t,r){var n=t.fieldPayloads,o=t.source;this._pendingBackupRebase=!0,this._pendingData.add({kind:"payload",payload:{fieldPayloads:n,operation:e,source:o,updater:r}})},e.prototype.commitUpdate=function(e){this._pendingBackupRebase=!0,this._pendingUpdaters.add(e)},e.prototype.commitSource=function(e){this._pendingBackupRebase=!0,this._pendingData.add({kind:"source",source:e})},e.prototype.run=function(){this._pendingBackupRebase&&this._backup.size()&&(this._store.publish(this._backup),this._backup=new(r(13))),this._commitData(),this._commitUpdaters(),this._applyUpdates(),this._pendingBackupRebase=!1,this._store.notify()},e.prototype._getSourceFromPayload=function(e){var t,n=this,i=e.fieldPayloads,a=e.operation,s=e.source,u=e.updater,c=new(r(18))(this._store.getSource(),s),l=new(r(21))(c),d=new(r(22))(l,a.fragment);return i&&i.length&&i.forEach(function(e){var t=n._handlerProvider&&n._handlerProvider(e.handle);r(1)(t,"RelayModernEnvironment: Expected a handler to be provided for handle `%s`.",e.handle),t.update(l,e)}),u&&(t=o(s,a.fragment),u(d,t)),s},e.prototype._commitData=function(){var e=this;this._pendingData.size&&(this._pendingData.forEach(function(t){var r=void 0;r="payload"===t.kind?e._getSourceFromPayload(t.payload):t.source,e._store.publish(r)}),this._pendingData.clear())},e.prototype._commitUpdaters=function(){var e,t=this;this._pendingUpdaters.size&&(e=new(r(13)),this._pendingUpdaters.forEach(function(n){var o=new(r(18))(t._store.getSource(),e),i=new(r(21))(o);n(i)}),this._store.publish(e),this._pendingUpdaters.clear())},e.prototype._applyUpdates=function(){var e,t,n,i=this;(this._pendingOptimisticUpdates.size||this._pendingBackupRebase&&this._appliedOptimisticUpdates.size)&&(e=new(r(13)),t=new(r(18))(this._store.getSource(),e,this._backup),n=new(r(21))(t,this._handlerProvider),this._pendingBackupRebase&&this._appliedOptimisticUpdates.size&&this._appliedOptimisticUpdates.forEach(function(e){var t,i,a,s,u,c,l,d;e.operation?(t=e.selectorStoreUpdater,i=e.operation,a=e.response,s=n.commitPayload(i,a),u=void 0,c=void 0,a&&(l=r(16)(i.root,a),c=l.source,u=o(c,i.fragment)),t&&t(s,u)):(d=e.storeUpdater)(n)}),this._pendingOptimisticUpdates.size&&(this._pendingOptimisticUpdates.forEach(function(e){var t,a,s,u,c,l,d,p;e.operation?(t=e.selectorStoreUpdater,a=e.operation,s=e.response,u=n.commitPayload(a,s),c=void 0,l=void 0,s&&(d=r(16)(a.root,s),l=d.source,c=o(l,a.fragment)),t&&t(u,c)):(p=e.storeUpdater)(n),i._appliedOptimisticUpdates.add(e)}),this._pendingOptimisticUpdates.clear()),this._store.publish(e))},e}();e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return r(26)({queryID:e,variables:t})}function i(e,t){return e+t>=Date.now()}var a=n(r(5)),s=function(){function e(t){var n=t.size,o=t.ttl;(0,a.default)(this,e),r(1)(n>0,"RelayQueryResponseCache: Expected the max cache size to be > 0, got `%s`.",n),r(1)(o>0,"RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.",o),this._responses=new Map,this._size=n,this._ttl=o}return e.prototype.clear=function(){this._responses.clear()},e.prototype.get=function(e,t){var r,n=this,a=o(e,t);return this._responses.forEach(function(e,t){i(e.fetchTime,n._ttl)||n._responses.delete(t)}),r=this._responses.get(a),null!=r?r.payload:null},e.prototype.set=function(e,t,r){var n,i=Date.now(),a=o(e,t);this._responses.delete(a),this._responses.set(a,{fetchTime:i,payload:r}),this._responses.size>this._size&&(n=this._responses.keys().next(),n.done||this._responses.delete(n.value))},e}();e.exports=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||"object"!=typeof e||Array.isArray(e)&&e.every(o)}var i=n(r(5)),a=function(){function e(t,r,n){(0,i.default)(this,e),this._dataID=n,this._mutator=r,this._source=t}return e.prototype.copyFieldsFrom=function(e){this._mutator.copyFields(e.getDataID(),this._dataID)},e.prototype.getDataID=function(){return this._dataID},e.prototype.getType=function(){var e=this._mutator.getType(this._dataID);return r(1)(null!=e,"RelayRecordProxy: Cannot get the type of deleted record `%s`.",this._dataID),e},e.prototype.getValue=function(e,t){var n=t?r(8)(e,t):e;return this._mutator.getValue(this._dataID,n)},e.prototype.setValue=function(e,t,n){r(1)(o(e),"RelayRecordProxy#setValue(): Expected a scalar or array of scalars, got `%s`.",JSON.stringify(e));var i=n?r(8)(t,n):t;return this._mutator.setValue(this._dataID,i,e),this},e.prototype.getLinkedRecord=function(e,t){var n=t?r(8)(e,t):e,o=this._mutator.getLinkedRecordID(this._dataID,n);return null!=o?this._source.get(o):o},e.prototype.setLinkedRecord=function(t,n,o){var i,a;return r(1)(t instanceof e,"RelayRecordProxy#setLinkedRecord(): Expected a record, got `%s`.",t),i=o?r(8)(n,o):n,a=t.getDataID(),this._mutator.setLinkedRecordID(this._dataID,i,a),this},e.prototype.getOrCreateLinkedRecord=function(e,t,n){var o,i,a=this.getLinkedRecord(e,n);return a||(o=n?r(8)(e,n):e,i=r(12)(this.getDataID(),o),a=this._source.create(i,t),this.setLinkedRecord(a,e,n)),a},e.prototype.getLinkedRecords=function(e,t){var n=this,o=t?r(8)(e,t):e,i=this._mutator.getLinkedRecordIDs(this._dataID,o);return null==i?i:i.map(function(e){return null!=e?n._source.get(e):e})},e.prototype.setLinkedRecords=function(e,t,n){var o,i;return r(1)(Array.isArray(e),"RelayRecordProxy#setLinkedRecords(): Expected records to be an array, got `%s`.",e),o=n?r(8)(t,n):t,i=e.map(function(e){return e&&e.getDataID()}),this._mutator.setLinkedRecordIDs(this._dataID,o,i),this},e}();e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){var n=t.dataID,o=t.node,i=t.variables,a=new h(e,i,r);a.mark(o,n)}var i=n(r(5)),a=r(3).CONDITION,s=r(3).FRAGMENT_SPREAD,u=r(3).INLINE_FRAGMENT,c=r(3).LINKED_FIELD,l=r(3).LINKED_HANDLE,d=r(3).SCALAR_FIELD,p=r(3).SCALAR_HANDLE,f=r(4).getStorageKey,h=function(){function e(t,r,n){(0,i.default)(this,e),this._references=n,this._recordSource=t,this._variables=r}return e.prototype.mark=function(e,t){this._traverse(e,t)},e.prototype._traverse=function(e,t){this._references.add(t);var r=this._recordSource.get(t);null!=r&&this._traverseSelections(e.selections,r)},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayReferenceMarker(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._traverseSelections=function(e,t){var n=this;e.forEach(function(o){var i,f,h;o.kind===c?o.plural?n._traversePluralLink(o,t):n._traverseLink(o,t):o.kind===a?(i=n._getVariableValue(o.condition),i===o.passingValue&&n._traverseSelections(o.selections,t)):o.kind===u?(f=r(2).getType(t),null!=f&&f===o.type&&n._traverseSelections(o.selections,t)):o.kind===s?r(1)(!1,"RelayReferenceMarker(): Unexpected fragment spread `...%s`, expected all fragments to be inlined.",o.name):o.kind===l?(h=r(35)(o,e,n._variables),h.plural?n._traversePluralLink(h,t):n._traverseLink(h,t)):r(1)(o.kind===d||o.kind===p,"RelayReferenceMarker(): Unexpected ast kind `%s`.",o.kind)})},e.prototype._traverseLink=function(e,t){var n=f(e,this._variables),o=r(2).getLinkedRecordID(t,n);null!=o&&this._traverse(e,o)},e.prototype._traversePluralLink=function(e,t){var n=this,o=f(e,this._variables),i=r(2).getLinkedRecordIDs(t,o);null!=i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},e}();e.exports={mark:o}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{handleStrippedNulls:!1},o=t.dataID,i=t.node,a=t.variables,s=new g(e,a,n);return s.normalizeResponse(i,o,r)}var i=n(r(5)),a=r(4),s=a.getHandleFilterValues,u=a.getArgumentValues,c=a.getStorageKey,l=a.TYPENAME_KEY,d=r(3).CONDITION,p=r(3).INLINE_FRAGMENT,f=r(3).LINKED_FIELD,h=r(3).LINKED_HANDLE,_=r(3).SCALAR_FIELD,y=r(3).SCALAR_HANDLE,g=function(){function e(t,r,n){(0,i.default)(this,e),this._handleFieldPayloads=[],this._recordSource=t,this._variables=r,this._handleStrippedNulls=n.handleStrippedNulls}return e.prototype.normalizeResponse=function(e,t,n){var o=this._recordSource.get(t);return r(1)(o,"RelayResponseNormalizer(): Expected root record `%s` to exist.",t),this._traverseSelections(e.selections,o,n),this._handleFieldPayloads},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayResponseNormalizer(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._getRecordType=function(e){var t=e[l];return r(1)(null!=t,"RelayResponseNormalizer(): Expected a typename for record `%s`.",JSON.stringify(e,null,2)),t},e.prototype._traverseSelections=function(e,t,n){var o=this;e.forEach(function(e){var i,a,c,l,g,v;e.kind===_||e.kind===f?o._normalizeField(e,t,n):e.kind===d?(i=o._getVariableValue(e.condition),i===e.passingValue&&o._traverseSelections(e.selections,t,n)):e.kind===p?(a=r(2).getType(t),a===e.type&&o._traverseSelections(e.selections,t,n)):e.kind===h||e.kind===y?(c=e.args?u(e.args,o._variables):{},
|
|
14
|
-
l=r(8)(e.name,c),g=r(23)(e.handle,e.key,e.name),e.filters&&(v=s(e.args||[],e.filters,o._variables),g=r(8)(g,v)),o._handleFieldPayloads.push({args:c,dataID:r(2).getDataID(t),fieldKey:l,handle:e.handle,handleKey:g})):r(1)(!1,"RelayResponseNormalizer(): Unexpected ast kind `%s`.",e.kind)})},e.prototype._normalizeField=function(e,t,n){var o,i,a;if(r(1)("object"==typeof n&&n,"writeField(): Expected data for field `%s` to be an object.",e.name),o=e.alias||e.name,i=c(e,this._variables),a=n[o],null==a){if(void 0===a&&!this._handleStrippedNulls)return;return void r(2).setValue(t,i,null)}e.kind===_?r(2).setValue(t,i,a):e.plural?this._normalizePluralLink(e,t,i,a):this._normalizeLink(e,t,i,a)},e.prototype._normalizeLink=function(e,t,n,o){var i,a,s;r(1)("object"==typeof o&&o,"RelayResponseNormalizer: Expected data for field `%s` to be an object.",n),i=o.id||r(2).getLinkedRecordID(t,n)||r(12)(r(2).getDataID(t),n),r(1)("string"==typeof i,"RelayResponseNormalizer: Expected id on field `%s` to be a string.",n),r(2).setLinkedRecordID(t,n,i),a=this._recordSource.get(i),a||(s=e.concreteType||this._getRecordType(o),a=r(2).create(i,s),this._recordSource.set(i,a)),this._traverseSelections(e.selections,a,o)},e.prototype._normalizePluralLink=function(e,t,n,o){var i,a,s=this;r(1)(Array.isArray(o),"RelayResponseNormalizer: Expected data for field `%s` to be an array of objects.",n),i=r(2).getLinkedRecordIDs(t,n),a=[],o.forEach(function(o,u){var c,l,d;return null==o?void a.push(o):(r(1)("object"==typeof o,"RelayResponseNormalizer: Expected elements for field `%s` to be objects.",n),c=o.id||i&&i[u]||r(12)(r(2).getDataID(t),n,u),r(1)("string"==typeof c,"RelayResponseNormalizer: Expected id of elements of field `%s` to be strings.",n),a.push(c),l=s._recordSource.get(c),l||(d=e.concreteType||s._getRecordType(o),l=r(2).create(c,d),s._recordSource.set(c,l)),void s._traverseSelections(e.selections,l,o))}),r(2).setLinkedRecordIDs(t,n,a)},e.prototype._validateRecordType=function(e,t,n){var o=t.concreteType||this._getRecordType(n);r(6)(r(2).getType(e)===o,"RelayResponseNormalizer: Invalid record `%s`. Expected %s to be be consistent, but the record was assigned conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.",r(2).getDataID(e),l,r(2).getType(e),o)},e}();o=r(33).instrument("RelayResponseNormalizer.normalize",o),e.exports={normalize:o}},function(e,t,r){"use strict";function n(e,t){var n,o,i,a,s,u,c,l,d,p;return r(1)(r(24)(e),"commitRelayModernMutation: expect `environment` to be an instance of `RelayModernEnvironment`."),n=e.unstable_internal,o=n.createOperationSelector,i=n.getOperation,a=i(t.mutation),s=t.optimisticUpdater,u=t.configs,c=t.optimisticResponse,l=t.variables,d=o(a,l),u&&(p=r(25)(u,a,s),s=p.optimisticUpdater),e.applyUpdate({operation:d,selectorStoreUpdater:s,response:c})}e.exports=n},function(e,t){"use strict";function r(e,t){e.commitUpdate(t)}e.exports=r},function(e,t,r){"use strict";function n(e,t){var n,o,i,a,s,u,c,l,d,p,f,h,_,y,g;return r(1)(r(24)(e),"commitRelayModernMutation: expect `environment` to be an instance of `RelayModernEnvironment`."),n=e.unstable_internal,o=n.createOperationSelector,i=n.getOperation,a=i(t.mutation),s=t.optimisticResponse,u=t.optimisticUpdater,c=t.updater,l=t.configs,d=t.onError,p=t.variables,f=t.uploadables,h=o(a,p),"function"==typeof s&&(s=s(),r(6)(!1,"commitRelayModernMutation: Expected `optimisticResponse` to be an object, received a function.")),s&&a.query.selections&&1===a.query.selections.length&&"LinkedField"===a.query.selections[0].kind&&(_=a.query.selections[0].name,r(6)(s[_],"commitRelayModernMutation: Expected `optimisticResponse` to be wrapped in mutation name `%s`",_)),l&&(y=r(25)(l,a,u,c),u=y.optimisticUpdater,c=y.updater),g=void 0,e.observeMutation({operation:h,optimisticResponse:s,optimisticUpdater:u,updater:c,uploadables:f}).subscribeLegacy({onNext:function(e){g=e.errors},onError:d,onCompleted:function v(){var r,v=t.onCompleted;v&&(r=e.lookup(h.fragment),v(r.data,g))}})}e.exports=n},function(e,t){"use strict";function r(e){return Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var n=e[t];n&&"object"==typeof n&&!Object.isFrozen(n)&&r(n)}),e}e.exports=r},function(e,t,r){"use strict";function n(e,t,n,o){var i,a,s,u,c;return r(1)(e.unstable_internal,"fetchRelayModernQuery: Expected a valid Relay environment, got `%s`.",e),i=e.unstable_internal,a=i.createOperationSelector,s=i.getOperation,u=s(t),c=a(u,n),new Promise(function(t,r){e.sendQuery({cacheConfig:o,onError:r,onCompleted:function(){try{var n=e.lookup(c.fragment);t(n.data)}catch(o){r(o)}},operation:c})})}e.exports=n},function(e,t){"use strict";function r(e,t){var r,n=Object.keys(e.seenRecords);for(r=0;r<n.length;r++)if(t.hasOwnProperty(n[r]))return!0;return!1}e.exports=r},function(e,t){"use strict";function r(e){return!!e&&"function"==typeof e.then}e.exports=r},function(e,t){"use strict";function r(e,t){return e===t&&(null===e||"object"!=typeof e)}e.exports=r},function(e,t){"use strict";function r(e,t){var n,o,i,a,s,u,c;return e!==t&&"object"==typeof e&&e&&"object"==typeof t&&t?(n=!1,o=Array.isArray(e)?e:null,i=Array.isArray(t)?t:null,o&&i?n=i.reduce(function(e,t,n){var a=o[n],s=r(a,t);return s!==i[n]&&(i[n]=s),e&&i[n]===o[n]},!0)&&o.length===i.length:o||i||(a=e,s=t,u=Object.keys(a),c=Object.keys(s),n=c.reduce(function(e,t){var n=a[t],o=r(n,s[t]);return o!==s[t]&&(s[t]=o),e&&s[t]===a[t]},!0)&&u.length===c.length),n?e:t):t}e.exports=r},function(e,t,r){"use strict";function n(e,t){var n,o=e.unstable_internal,i=o.createOperationSelector,a=o.getOperation,s=a(t.subscription),u=t.configs,c=t.onCompleted,l=t.onError,d=t.onNext,p=t.variables,f=t.updater,h=i(s,p);return r(6)(!(f&&u),"requestRelaySubscription: Expected only one of `updater` and `configs` to be provided"),u&&(n=r(25)(u,s,null,f),f=n.updater),e.sendSubscription({onCompleted:c,onError:l,onNext:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(t){if(d){var r=e.lookup(h.fragment);d(r.data)}}),updater:f,operation:h})}e.exports=n},function(e,t){e.exports=u},function(e,t){e.exports=c},function(e,t){e.exports=l},function(e,t){e.exports=d}])});
|
|
9
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fbjs/lib/invariant"),require("fbjs/lib/warning"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/extends"),require("babel-runtime/helpers/defineProperty"),require("fbjs/lib/areEqual"),require("fbjs/lib/emptyFunction"),require("fbjs/lib/removeFromArray"),require("babel-runtime/helpers/toConsumableArray"),require("fbjs/lib/mapObject"),require("fbjs/lib/resolveImmediate"),require("fbjs/lib/sprintf")):"function"==typeof define&&define.amd?define(["fbjs/lib/invariant","fbjs/lib/warning","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/extends","babel-runtime/helpers/defineProperty","fbjs/lib/areEqual","fbjs/lib/emptyFunction","fbjs/lib/removeFromArray","babel-runtime/helpers/toConsumableArray","fbjs/lib/mapObject","fbjs/lib/resolveImmediate","fbjs/lib/sprintf"],t):"object"==typeof exports?exports.RelayRuntime=t(require("fbjs/lib/invariant"),require("fbjs/lib/warning"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/extends"),require("babel-runtime/helpers/defineProperty"),require("fbjs/lib/areEqual"),require("fbjs/lib/emptyFunction"),require("fbjs/lib/removeFromArray"),require("babel-runtime/helpers/toConsumableArray"),require("fbjs/lib/mapObject"),require("fbjs/lib/resolveImmediate"),require("fbjs/lib/sprintf")):e.RelayRuntime=t(e["fbjs/lib/invariant"],e["fbjs/lib/warning"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/extends"],e["babel-runtime/helpers/defineProperty"],e["fbjs/lib/areEqual"],e["fbjs/lib/emptyFunction"],e["fbjs/lib/removeFromArray"],e["babel-runtime/helpers/toConsumableArray"],e["fbjs/lib/mapObject"],e["fbjs/lib/resolveImmediate"],e["fbjs/lib/sprintf"])}(this,function(e,t,r,n,o,i,a,s,u,c,l,d){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";e.exports={Environment:r(44),Network:r(46),Observable:r(17),QueryResponseCache:r(48),RecordSource:r(12),Store:r(43),areEqualSelectors:r(7).areEqualSelectors,createFragmentSpecResolver:r(7).createFragmentSpecResolver,createOperationSelector:r(7).createOperationSelector,getDataIDsFromObject:r(7).getDataIDsFromObject,getFragment:r(15).getFragment,getRequest:r(15).getRequest,getOperation:function(){return r(15).getRequest.apply(null,arguments)},getSelector:r(7).getSelector,getSelectorList:r(7).getSelectorList,getSelectorsFromObject:r(7).getSelectorsFromObject,getStorageKey:r(4).getStorageKey,getVariablesFromObject:r(7).getVariablesFromObject,graphql:r(15).graphql,MutationTypes:r(14).MutationTypes,RangeOperations:r(14).RangeOperations,ConnectionHandler:r(8),ViewerHandler:r(34),applyOptimisticMutation:r(52),commitLocalUpdate:r(53),commitMutation:r(54),fetchQuery:r(56),isRelayModernEnvironment:r(24),requestSubscription:r(60),ConnectionInterface:r(9),RelayProfiler:r(19),recycleNodesInto:r(38),simpleClone:r(61),ROOT_ID:r(4).ROOT_ID,RelayConcreteNode:r(3)}},function(t,r){t.exports=e},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return(0,b.default)({},e)}function i(e,t){for(var r in e)e.hasOwnProperty(r)&&r!==m&&r!==S&&(t[r]=e[r])}function a(e,t){var r={};return r[m]=e,r[S]=t,r}function s(e){return e[m]}function u(e){return e[S]}function c(e,t){var n=e[t];return n&&"object"==typeof n&&r(1)(!n.hasOwnProperty(R)&&!n.hasOwnProperty(E),"RelayModernRecord.getValue(): Expected a scalar (non-link) value for `%s.%s` but found %s.",e[m],t,n.hasOwnProperty(R)?"a linked record":"plural linked records"),n}function l(e,t){var n=e[t];return null==n?n:(r(1)("object"==typeof n&&n&&"string"==typeof n[R],"RelayModernRecord.getLinkedRecordID(): Expected `%s.%s` to be a linked ID, was `%s`.",e[m],t,n),n[R])}function d(e,t){var n=e[t];return null==n?n:(r(1)("object"==typeof n&&Array.isArray(n[E]),"RelayModernRecord.getLinkedRecordIDs(): Expected `%s.%s` to contain an array of linked IDs, got `%s`.",e[m],t,JSON.stringify(n)),n[E])}function p(e,t){var n,o,i=void 0,a=Object.keys(t);for(n=0;n<a.length;n++)o=a[n],!i&&r(27)(e[o],t[o])||(i=i||(0,b.default)({},e),t[o]!==k?i[o]=t[o]:delete i[o]);return i||e}function f(e,t){return Object.assign({},e,t)}function h(e){r(55)(e)}function _(e,t,r){e[t]=r}function y(e,t,r){var n={};n[R]=r,e[t]=n}function g(e,t,r){var n={};n[E]=r,e[t]=n}var b=n(r(11)),v=r(4),m=v.ID_KEY,R=v.REF_KEY,E=v.REFS_KEY,S=v.TYPENAME_KEY,k=v.UNPUBLISH_FIELD_SENTINEL;e.exports={clone:o,copyFields:i,create:a,freeze:h,getDataID:s,getLinkedRecordID:l,getLinkedRecordIDs:d,getType:u,getValue:c,merge:f,setValue:_,setLinkedRecordID:y,setLinkedRecordIDs:g,update:p}},function(e,t){"use strict";var r={BATCH_REQUEST:"BatchRequest",CONDITION:"Condition",DEFERRABLE_FRAGMENT_SPREAD:"DeferrableFragmentSpread",DEFERRABLE_OPERATION:"DeferrableOperation",FRAGMENT:"Fragment",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",LINKED_FIELD:"LinkedField",LINKED_HANDLE:"LinkedHandle",LITERAL:"Literal",LOCAL_ARGUMENT:"LocalArgument",OPERATION:"Operation",ROOT_ARGUMENT:"RootArgument",REQUEST:"Request",SCALAR_FIELD:"ScalarField",SCALAR_HANDLE:"ScalarHandle",VARIABLE:"Variable"};e.exports=r},function(e,t,r){"use strict";function n(e,t){var r={};return e.forEach(function(e){e.kind===c?r[e.name]=u(e.variableName,t):r[e.name]=e.value}),r}function o(e,t){var o,i=e.handle,a=e.key,u=e.name,c=e.args,l=e.filters,d=r(36)(i,a,u);return c&&l&&0!==c.length&&0!==l.length?(o=c.filter(function(e){return l.indexOf(e.name)>-1}),s(d,n(o,t))):d}function i(e,t){if(e.storageKey)return e.storageKey;var r=e.args,o=e.name;return r&&0!==r.length?s(o,n(r,t)):o}function a(e,t){return s(e,r(25)(t))}function s(e,t){var r,n,o;if(!t)return e;r=[];for(n in t)t.hasOwnProperty(n)&&(o=t[n],null!=o&&r.push(n+":"+JSON.stringify(o)));return 0===r.length?e:e+("("+r.join(",")+")")}function u(e,t){return r(1)(t.hasOwnProperty(e),"getVariableValue(): Undefined variable `%s`.",e),r(25)(t[e])}var c=r(3).VARIABLE,l={FRAGMENTS_KEY:"__fragments",ID_KEY:"__id",REF_KEY:"__ref",REFS_KEY:"__refs",ROOT_ID:"client:root",ROOT_TYPE:"__Root",TYPENAME_KEY:"__typename",UNPUBLISH_RECORD_SENTINEL:Object.freeze({__UNPUBLISH_RECORD_SENTINEL:!0}),UNPUBLISH_FIELD_SENTINEL:Object.freeze({__UNPUBLISH_FIELD_SENTINEL:!0}),getArgumentValues:n,getHandleStorageKey:o,getStorageKey:i,getStableStorageKey:a};e.exports=l},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t,r){"use strict";function n(e,t,n,o,i){return new(r(45))(e,n,o,i)}var o=r(15),i=o.getFragment,a=o.getRequest,s=r(32),u=s.createOperationSelector,c=r(33),l=c.areEqualSelectors,d=c.getDataIDsFromObject,p=c.getSelector,f=c.getSelectorList,h=c.getSelectorsFromObject,_=c.getVariablesFromObject;e.exports={areEqualSelectors:l,createFragmentSpecResolver:n,createOperationSelector:u,getDataIDsFromObject:d,getFragment:i,getRequest:a,getSelector:p,getSelectorList:f,getSelectorsFromObject:h,getVariablesFromObject:_}},function(e,t,r){"use strict";function n(e,t){var n,o,i,a,s,u,d,f,h,_,y,g,b,v,m,R,E,S,k,D,x,I,L,N,O=e.get(t.dataID);if(O){if(n=r(9).get(),o=n.EDGES,i=n.END_CURSOR,a=n.HAS_NEXT_PAGE,s=n.HAS_PREV_PAGE,u=n.PAGE_INFO,d=n.PAGE_INFO_TYPE,f=n.START_CURSOR,h=O.getLinkedRecord(t.fieldKey),_=h&&h.getLinkedRecord(u),!h)return void O.setValue(null,t.handleKey);if(y=O.getLinkedRecord(t.handleKey),g=y&&y.getLinkedRecord(u),y){if(m=y,R=h.getLinkedRecords(o),R&&(R=R.map(function(t){return c(e,m,t)})),E=m.getLinkedRecords(o),S=m.getLinkedRecord(u),m.copyFieldsFrom(h),E&&m.setLinkedRecords(E,o),S&&m.setLinkedRecord(S,u),k=[],D=t.args,E&&R)if(null!=D.after){if(!g||D.after!==g.getValue(i))return void r(5)(!1,"RelayConnectionHandler: Unexpected after cursor `%s`, edges must be fetched from the end of the list (`%s`).",D.after,g&&g.getValue(i));x=new Set,l(E,k,x),l(R,k,x)}else if(null!=D.before){if(!g||D.before!==g.getValue(f))return void r(5)(!1,"RelayConnectionHandler: Unexpected before cursor `%s`, edges must be fetched from the beginning of the list (`%s`).",D.before,g&&g.getValue(f));I=new Set,l(R,k,I),l(E,k,I)}else k=R;else k=R?R:E;null!=k&&k!==E&&m.setLinkedRecords(k,o),g&&_&&(null!=D.before||null==D.after&&D.last?(g.setValue(!!_.getValue(s),s),L=_.getValue(f),"string"==typeof L&&g.setValue(L,f)):(null!=D.after||null==D.before&&D.first)&&(g.setValue(!!_.getValue(a),a),N=_.getValue(i),"string"==typeof N&&g.setValue(N,i)))}else b=e.create(r(10)(O.getDataID(),t.handleKey),h.getType()),b.setValue(0,p),b.copyFieldsFrom(h),v=h.getLinkedRecords(o),v&&(v=v.map(function(t){return c(e,b,t)}),b.setLinkedRecords(v,o)),O.setLinkedRecord(b,t.handleKey),g=e.create(r(10)(b.getDataID(),u),d),g.setValue(!1,a),g.setValue(!1,s),g.setValue(null,i),g.setValue(null,f),_&&g.copyFieldsFrom(_),b.setLinkedRecord(g,u)}}function o(e,t,n){var o=r(36)(d,t,null);return e.getLinkedRecord(o,n)}function i(e,t,n){var o,i,a,s,u,c=r(9).get(),l=c.CURSOR,d=c.EDGES,p=e.getLinkedRecords(d);if(!p)return void e.setLinkedRecords([t],d);if(o=void 0,null==n)o=p.concat(t);else{for(o=[],i=!1,a=0;a<p.length;a++)s=p[a],o.push(s),null!=s&&(u=s.getValue(l),n===u&&(o.push(t),i=!0));i||o.push(t)}e.setLinkedRecords(o,d)}function a(e,t,n,o){var i=r(9).get(),a=i.NODE,s=r(10)(t.getDataID(),n.getDataID()),u=e.get(s);return u||(u=e.create(s,o)),u.setLinkedRecord(n,a),u}function s(e,t,n){var o,i,a,s,u,c=r(9).get(),l=c.CURSOR,d=c.EDGES,p=e.getLinkedRecords(d);if(!p)return void e.setLinkedRecords([t],d);if(o=void 0,null==n)o=[t].concat(p);else{for(o=[],i=!1,a=0;a<p.length;a++)s=p[a],null!=s&&(u=s.getValue(l),n===u&&(o.push(t),i=!0)),o.push(s);i||o.unshift(t)}e.setLinkedRecords(o,d)}function u(e,t){var n,o,i,a,s=r(9).get(),u=s.EDGES,c=s.NODE,l=e.getLinkedRecords(u);if(l){for(n=void 0,o=0;o<l.length;o++)i=l[o],a=i&&i.getLinkedRecord(c),null!=a&&a.getDataID()===t?void 0===n&&(n=l.slice(0,o)):void 0!==n&&n.push(i);void 0!==n&&e.setLinkedRecords(n,u)}}function c(e,t,n){var o,i,a,s,u;return null==n?n:(o=r(9).get(),i=o.EDGES,a=t.getValue(p),r(1)("number"==typeof a,"RelayConnectionHandler: Expected %s to be a number, got `%s`.",p,a),s=r(10)(t.getDataID(),i,a),u=e.create(s,n.getType()),u.copyFieldsFrom(n),t.setValue(a+1,p),u)}function l(e,t,n){var o,i,a,s,u=r(9).get(),c=u.NODE;for(o=0;o<e.length;o++)if(i=e[o]){if(a=i.getLinkedRecord(c),s=a&&a.getValue("id")){if(n.has(s))continue;n.add(s)}t.push(i)}}var d="connection",p="__connection_next_edge_index";e.exports={buildConnectionEdge:c,createEdge:a,deleteNode:u,getConnection:o,insertEdgeAfter:i,insertEdgeBefore:s,update:n}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=n(r(26)),i={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},a={find:!0,first:!0,last:!0},s={CLIENT_MUTATION_ID:"clientMutationId",CURSOR:"cursor",EDGES_HAVE_SOURCE_FIELD:!1,EDGES:"edges",END_CURSOR:"endCursor",HAS_NEXT_PAGE:"hasNextPage",HAS_PREV_PAGE:"hasPreviousPage",NODE:"node",PAGE_INFO_TYPE:"PageInfo",PAGE_INFO:"pageInfo",START_CURSOR:"startCursor"},u={inject:function(e){s=e},get:function(){return s},isConnectionCall:function(e){return i.hasOwnProperty(e.name)},hasRangeCalls:function(e){return e.some(function(e){return a.hasOwnProperty(e.name)})},getDefaultPageInfo:function(){var e;return e={},(0,o.default)(e,s.END_CURSOR,null),(0,o.default)(e,s.HAS_NEXT_PAGE,!1),(0,o.default)(e,s.HAS_PREV_PAGE,!1),(0,o.default)(e,s.START_CURSOR,null),e}};e.exports=u},function(e,t){"use strict";function r(e,t,r){var o=e+":"+t;return null!=r&&(o+=":"+r),0!==o.indexOf(n)&&(o=n+o),o}var n="client:";e.exports=r},function(e,t){e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=n(r(6)),i=r(13).EXISTENT,a=r(13).NONEXISTENT,s=r(13).UNKNOWN,u=function(){function e(t){(0,o.default)(this,e),this._records=t||{}}return e.prototype.clear=function(){this._records={}},e.prototype.delete=function(e){this._records[e]=null},e.prototype.get=function(e){return this._records[e]},e.prototype.getRecordIDs=function(){return Object.keys(this._records)},e.prototype.getStatus=function(e){return this._records.hasOwnProperty(e)?null==this._records[e]?a:i:s},e.prototype.has=function(e){return this._records.hasOwnProperty(e)},e.prototype.load=function(e,t){t(null,this.get(e))},e.prototype.remove=function(e){delete this._records[e]},e.prototype.set=function(e,t){this._records[e]=t},e.prototype.size=function(){return Object.keys(this._records).length},e.prototype.toJSON=function(){return this._records},e}();e.exports=u},function(e,t){"use strict";var r={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"};e.exports=r},function(e,t,r){"use strict";function n(e,t,r,n){var s=r?[r]:[],u=n?[n]:[];return e.forEach(function(e){var r,n,c;switch(e.type){case"NODE_DELETE":r=o(e,t),r&&(s.push(r),u.push(r));break;case"RANGE_ADD":n=i(e,t),n&&(s.push(n),u.push(n));break;case"RANGE_DELETE":c=a(e,t),c&&(s.push(c),u.push(c))}}),{optimisticUpdater:function(e,t){s.forEach(function(r){r(e,t)})},updater:function(e,t){u.forEach(function(r){r(e,t)})}}}function o(e,t){var r=e.deletedIDFieldName,n=u(t);return n?function(e,t){var o,i,a=e.getRootField(n);a&&(o=a.getValue(r),i=Array.isArray(o)?o:[o],i.forEach(function(t){t&&"string"==typeof t&&e.delete(t)}))}:null}function i(e,t){var n,o=e.parentID,i=e.connectionInfo,a=e.edgeName;return o?(n=u(t),i&&n?function(e,t){var s,u,c,l,d,p,f,h,_,y,g=e.get(o);if(g&&(s=e.getRootField(n))){u=s.getLinkedRecord(a),c=!0,l=!1,d=void 0;try{for(p=i[Symbol.iterator]();!(c=(f=p.next()).done);c=!0)if(h=f.value,u&&(_=r(8).getConnection(g,h.key,h.filters),_&&(y=r(8).buildConnectionEdge(e,_,u))))switch(h.rangeBehavior){case"append":r(8).insertEdgeAfter(_,y);break;case"ignore":break;case"prepend":r(8).insertEdgeBefore(_,y);break;default:r(5)(!1,"RelayDeclarativeMutationConfig: RANGE_ADD range behavior `%s` will not work as expected in RelayModern, supported range behaviors are 'append', 'prepend', and 'ignore'.",h.rangeBehavior)}}catch(e){l=!0,d=e}finally{try{!c&&p.return&&p.return()}finally{if(l)throw d}}}}:null):(r(5)(!1,"RelayDeclarativeMutationConfig: For mutation config RANGE_ADD to work you must include a parentID"),null)}function a(e,t){var n,o=e.parentID,i=e.connectionKeys,a=e.pathToConnection,c=e.deletedIDFieldName;return o?(n=u(t),n?function(e,t){var r,u,l,d,p,f,h,_;if(t){if(r=[],u=t[n],u&&Array.isArray(c)){l=!0,d=!1,p=void 0;try{for(f=c[Symbol.iterator]();!(l=(h=f.next()).done);l=!0)_=h.value,u&&"object"==typeof u&&(u=u[_])}catch(e){d=!0,p=e}finally{try{!l&&f.return&&f.return()}finally{if(d)throw p}}Array.isArray(u)?u.forEach(function(e){e&&e.id&&"object"==typeof e&&"string"==typeof e.id&&r.push(e.id)}):u&&u.id&&"string"==typeof u.id&&r.push(u.id)}else u&&"string"==typeof c&&"object"==typeof u&&(u=u[c],"string"==typeof u?r.push(u):Array.isArray(u)&&u.forEach(function(e){"string"==typeof e&&r.push(e)}));s(o,i,a,e,r)}}:null):(r(5)(!1,"RelayDeclarativeMutationConfig: For mutation config RANGE_DELETE to work you must include a parentID"),null)}function s(e,t,n,o,i){var a,s,u,c,l,d,p,f,h;if(r(5)(t,"RelayDeclarativeMutationConfig: RANGE_DELETE must provide a connectionKeys"),a=o.get(e)){if(n.length<2)return void r(5)(!1,"RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection must include at least parent and connection");for(s=a,u=1;u<n.length-1;u++)s&&(s=s.getLinkedRecord(n[u]));if(!t||!s)return void r(5)(!1,"RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection is incorrect. Unable to find connection with parentID: %s and path: %s",e,n.toString());c=!0,l=!1,d=void 0;try{for(p=function(){var e=h.value,t=r(8).getConnection(s,e.key,e.filters);t&&i.forEach(function(e){r(8).deleteNode(t,e)})},f=t[Symbol.iterator]();!(c=(h=f.next()).done);c=!0)p()}catch(e){l=!0,d=e}finally{try{!c&&f.return&&f.return()}finally{if(l)throw d}}}}function u(e){return e.fragment.selections&&e.fragment.selections.length>0&&"LinkedField"===e.fragment.selections[0].kind?e.fragment.selections[0].name:null}var c=Object.freeze({RANGE_ADD:"RANGE_ADD",RANGE_DELETE:"RANGE_DELETE",NODE_DELETE:"NODE_DELETE",FIELDS_CHANGE:"FIELDS_CHANGE",REQUIRED_CHILDREN:"REQUIRED_CHILDREN"}),l=Object.freeze({APPEND:"append",IGNORE:"ignore",PREPEND:"prepend",REFETCH:"refetch",REMOVE:"remove"});e.exports={MutationTypes:c,RangeOperations:l,convert:n}},function(e,t,r){"use strict";function n(e){r(1)(!1,"graphql: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`.")}function o(e){var t="function"==typeof e?e:e.modern;return"function"!=typeof t?e:t()}function i(e){var t=o(e);return r(1)("object"==typeof t&&null!==t&&t.kind===r(3).FRAGMENT,"RelayModernGraphQLTag: Expected a fragment, got `%s`.",JSON.stringify(t)),t}function a(e){var t=o(e);return r(1)("object"==typeof t&&null!==t&&(t.kind===r(3).REQUEST||t.kind===r(3).BATCH_REQUEST),"RelayModernGraphQLTag: Expected an request, got `%s`.",JSON.stringify(t)),t}e.exports={getFragment:i,getRequest:a,graphql:n}},function(e,t,r){"use strict";function n(e,t,n){var o,s,u,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{handleStrippedNulls:!1},l=new(r(12));return l.set(i,r(2).create(i,a)),o=r(51).normalize(l,e,t,c),s=o.fieldPayloads,u=o.deferrableSelections,{errors:n,fieldPayloads:s,deferrableSelections:u,source:l}}var o=r(4),i=o.ROOT_ID,a=o.ROOT_TYPE;e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return"object"==typeof e&&null!==e&&"function"==typeof e.subscribe}function i(e){return e instanceof p?e:p.create(function(t){return e.subscribe(t)})}function a(e){return p.create(function(t){e.then(function(e){t.next(e),t.complete()},t.error)})}function s(e){return p.create(function(t){t.next(e),t.complete()})}function u(e,t){function r(){if(i){if(i.unsubscribe)i.unsubscribe();else try{i()}catch(e){d(e,!0)}i=void 0}}var n,o=!1,i=void 0,a=function(e){return Object.defineProperty(e,"closed",{get:function(){return o}})},s=a({unsubscribe:function(){if(!o){o=!0;try{t.unsubscribe&&t.unsubscribe(s)}catch(e){d(e,!0)}finally{r()}}}});try{t.start&&t.start(s)}catch(e){d(e,!0)}if(o)return s;n=a({next:function(e){if(!o&&t.next)try{t.next(e)}catch(e){d(e,!0)}},error:function(e){function t(t,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,n){if(o||!t.error)o=!0,d(e,n||!1),r();else{o=!0;try{t.error(e)}catch(e){d(e,!0)}finally{r()}}}),complete:function(){if(!o){o=!0;try{t.complete&&t.complete()}catch(e){d(e,!0)}finally{r()}}}});try{i=e(n)}catch(e){n.error(e,!0)}return o&&r(),s}function c(e,t){}var l=n(r(6)),d=c,p=function(){function e(t){(0,l.default)(this,e),this._source=t}return e.create=function(t){return new e(t)},e.onUnhandledError=function(e){d=e},e.from=function(e){return o(e)?i(e):r(58)(e)?a(e):s(e)},e.fromLegacy=function(t){return e.create(function(e){var r=t({onNext:e.next,onError:e.error,onCompleted:e.complete});return o(r)?r.subscribe(e):function(){return r.dispose()}})},e.prototype.catch=function(t){var r=this;return e.create(function(e){var n=void 0;return r.subscribe({start:function(e){n=e},next:e.next,complete:e.complete,error:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(r){try{t(r).subscribe({start:function(e){n=e},next:e.next,complete:e.complete,error:e.error})}catch(t){e.error(t,!0)}})}),function(){return n.unsubscribe()}})},e.prototype.do=function(t){var r=this;return e.create(function(e){var n=function(r){return function(){try{t[r]&&t[r].apply(t,arguments)}catch(e){d(e,!0)}e[r]&&e[r].apply(e,arguments)}};return r.subscribe({start:n("start"),next:n("next"),error:n("error"),complete:n("complete"),unsubscribe:n("unsubscribe")})})},e.prototype.finally=function(t){var r=this;return e.create(function(e){var n=r.subscribe(e);return function(){n.unsubscribe(),t()}})},e.prototype.ifEmpty=function(t){var r=this;return e.create(function(e){var n=!1,o=r.subscribe({next:function(t){n=!0,e.next(t)},error:e.error,complete:function(){n?e.complete():o=t.subscribe(e)}});return function(){o.unsubscribe()}})},e.prototype.subscribe=function(e){return u(this._source,e)},e.prototype.subscribeLegacy=function(e){var t=this.subscribe({next:e.onNext,error:e.onError,complete:e.onCompleted});return{dispose:t.unsubscribe}},e.prototype.map=function(e){return this.mergeMap(function(t){return s(e(t))})},e.prototype.mergeMap=function(t){var r=this;return e.create(function(n){function o(e){this._sub=e,a.push(e)}function i(){a.splice(a.indexOf(this._sub),1),0===a.length&&n.complete()}var a=[];return r.subscribe({start:o,next:function(r){try{n.closed||e.from(t(r)).subscribe({start:o,next:n.next,error:n.error,complete:i})}catch(e){n.error(e,!0)}},error:n.error,complete:i}),function(){a.forEach(function(e){return e.unsubscribe()}),a.length=0}})},e.prototype.poll=function(t){var r=this;return e.create(function(e){var n=void 0,o=void 0,i=function i(){n=r.subscribe({next:e.next,error:e.error,complete:function(){o=setTimeout(i,t)}})};return i(),function(){clearTimeout(o),n.unsubscribe()}})},e.prototype.toPromise=function(){var e=this;return new Promise(function(t,r){var n=void 0;e.subscribe({start:function(e){n=e},next:function(e){t(e),n.unsubscribe()},error:r,complete:t})})},e}();e.exports=p},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=n(r(11)),i=n(r(6)),a=r(13),s=a.EXISTENT,u=r(4),c=u.UNPUBLISH_FIELD_SENTINEL,l=u.UNPUBLISH_RECORD_SENTINEL,d=function(){function e(t,r,n){(0,i.default)(this,e),this._backup=n,this._base=t,this._sink=r,this.__sources=[r,t]}return e.prototype._createBackupRecord=function(e){var t,r=this._backup;r&&!r.has(e)&&(t=this._base.get(e),null!=t?r.set(e,t):null===t&&r.delete(e))},e.prototype._setSentinelFieldsInBackupRecord=function(e,t){var r,n,i,a=this._backup;if(a&&(r=a.get(e),r&&r!==l)){n=null;for(i in t)t.hasOwnProperty(i)&&(i in r||(n=n||(0,o.default)({},r),n[i]=c));a.set(e,n||r)}},e.prototype._setSentinelFieldInBackupRecord=function(e,t){var n,i,a=this._backup;a&&(n=a.get(e),!n||n===l||t in n||(i=(0,o.default)({},n),r(2).setValue(i,t,c),a.set(e,i)))},e.prototype._getSinkRecord=function(e){var t,n=this._sink.get(e);return n||(t=this._base.get(e),r(1)(t,"RelayRecordSourceMutator: Cannot modify non-existent record `%s`.",e),n=r(2).create(e,r(2).getType(t)),this._sink.set(e,n)),n},e.prototype.copyFields=function(e,t){var n,o=this._sink.get(e),i=this._base.get(e);r(1)(o||i,"RelayRecordSourceMutator#copyFields(): Cannot copy fields from non-existent record `%s`.",e),this._createBackupRecord(t),n=this._getSinkRecord(t),i&&r(2).copyFields(i,n),o&&r(2).copyFields(o,n),this._setSentinelFieldsInBackupRecord(t,n)},e.prototype.copyFieldsFromRecord=function(e,t){this.copyFields(r(2).getDataID(e),t);var n=this._getSinkRecord(t);r(2).copyFields(e,n),this._setSentinelFieldsInBackupRecord(t,n)},e.prototype.create=function(e,t){r(1)(this._base.getStatus(e)!==s&&this._sink.getStatus(e)!==s,"RelayRecordSourceMutator#create(): Cannot create a record with id `%s`, this record already exists.",e),this._backup&&this._backup.set(e,l);var n=r(2).create(e,t);this._sink.set(e,n)},e.prototype.delete=function(e){this._createBackupRecord(e),this._sink.delete(e)},e.prototype.getStatus=function(e){return this._sink.has(e)?this._sink.getStatus(e):this._base.getStatus(e)},e.prototype.getType=function(e){var t,n;for(t=0;t<this.__sources.length;t++){if(n=this.__sources[t].get(e))return r(2).getType(n);if(null===n)return null}},e.prototype.getValue=function(e,t){var n,o,i;for(n=0;n<this.__sources.length;n++)if(o=this.__sources[n].get(e)){if(i=r(2).getValue(o,t),void 0!==i)return i}else if(null===o)return null},e.prototype.setValue=function(e,t,n){this._createBackupRecord(e);var o=this._getSinkRecord(e);r(2).setValue(o,t,n),this._setSentinelFieldInBackupRecord(e,t)},e.prototype.getLinkedRecordID=function(e,t){var n,o,i;for(n=0;n<this.__sources.length;n++)if(o=this.__sources[n].get(e)){if(i=r(2).getLinkedRecordID(o,t),void 0!==i)return i}else if(null===o)return null},e.prototype.setLinkedRecordID=function(e,t,n){this._createBackupRecord(e);var o=this._getSinkRecord(e);r(2).setLinkedRecordID(o,t,n),this._setSentinelFieldInBackupRecord(e,t)},e.prototype.getLinkedRecordIDs=function(e,t){var n,o,i;for(n=0;n<this.__sources.length;n++)if(o=this.__sources[n].get(e)){if(i=r(2).getLinkedRecordIDs(o,t),void 0!==i)return i}else if(null===o)return null},e.prototype.setLinkedRecordIDs=function(e,t,n){this._createBackupRecord(e);var o=this._getSinkRecord(e);r(2).setLinkedRecordIDs(o,t,n),this._setSentinelFieldInBackupRecord(e,t)},e}();e.exports=d},function(e,t,r){"use strict";var n={"*":[]},o={"*":[]},i={},a={stop:r(28)},s=function(e){return"@"!==e.charAt(0)},u={instrumentMethods:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=u.instrument(t[r],e[r]))},instrument:function(e,t){var o,a,u,c,l,d;return s(e)?(n.hasOwnProperty(e)||(n[e]=[]),o=n["*"],a=n[e],u=[],c=[],l=function r(){var n=c[c.length-1];n[0]?(n[0]--,o[n[0]](e,r)):n[1]?(n[1]--,a[n[1]](e,r)):n[2]?(n[2]--,u[n[2]](e,r)):n[5]=t.apply(n[3],n[4])},d=function(){var e,r=void 0;if(0===a.length&&0===u.length&&0===o.length)r=t.apply(this,arguments);else if(c.push([o.length,a.length,u.length,this,arguments,i]),l(),e=c.pop(),r=e[5],r===i)throw new Error("RelayProfiler: Handler did not invoke original function.");return r},d.attachHandler=function(e){u.push(e)},d.detachHandler=function(e){r(29)(u,e)},d.displayName="(instrumented "+e+")",d):(t.attachHandler=r(28),t.detachHandler=r(28),t)},attachAggregateHandler:function(e,t){s(e)&&(n.hasOwnProperty(e)||(n[e]=[]),n[e].push(t))},detachAggregateHandler:function(e,t){s(e)&&n.hasOwnProperty(e)&&r(29)(n[e],t)},profile:function(e,t){var r,n,i,s,u,c=o["*"].length>0,l=o.hasOwnProperty(e);if(l||c){for(r=l&&c?o[e].concat(o["*"]):l?o[e]:o["*"],n=void 0,i=r.length-1;i>=0;i--)s=r[i],u=s(e,t),n=n||[],n.unshift(u);return{stop:function(){n&&n.forEach(function(e){return e()})}}}return a},attachProfileHandler:function(e,t){s(e)&&(o.hasOwnProperty(e)||(o[e]=[]),o[e].push(t))},detachProfileHandler:function(e,t){s(e)&&o.hasOwnProperty(e)&&r(29)(o[e],t)}};e.exports=u},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r=t.dataID,n=t.node,o=t.variables,i=new b(e,o);return i.read(n,r)}var i=n(r(26)),a=n(r(11)),s=n(r(6)),u=r(3).CONDITION,c=r(3).DEFERRABLE_FRAGMENT_SPREAD,l=r(3).FRAGMENT_SPREAD,d=r(3).INLINE_FRAGMENT,p=r(3).LINKED_FIELD,f=r(3).SCALAR_FIELD,h=r(4).FRAGMENTS_KEY,_=r(4).ID_KEY,y=r(4).getArgumentValues,g=r(4).getStorageKey,b=function(){function e(t,r){(0,s.default)(this,e),this._recordSource=t,this._seenRecords={},this._variables=r}return e.prototype.read=function(e,t){var r=this._traverse(e,t,null);return{data:r,dataID:t,node:e,seenRecords:this._seenRecords,variables:this._variables}},e.prototype._traverse=function(e,t,r){var n,o=this._recordSource.get(t);return this._seenRecords[t]=o,null==o?o:(n=r||{},this._traverseSelections(e.selections,o,n),n)},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayReader(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._traverseSelections=function(e,t,n){var o=this;e.forEach(function(e){var i,a;e.kind===f?o._readScalar(e,t,n):e.kind===p?e.plural?o._readPluralLink(e,t,n):o._readLink(e,t,n):e.kind===u?(i=o._getVariableValue(e.condition),i===e.passingValue&&o._traverseSelections(e.selections,t,n)):e.kind===d?(a=r(2).getType(t),null!=a&&a===e.type&&o._traverseSelections(e.selections,t,n)):e.kind===l?o._createFragmentPointer(e,t,n,o._variables):e.kind===c?o._createDeferrableFragmentPointer(e,t,n):r(1)(!1,"RelayReader(): Unexpected ast kind `%s`.",e.kind)})},e.prototype._readScalar=function(e,t,n){var o=e.alias||e.name,i=g(e,this._variables),a=r(2).getValue(t,i);n[o]=a},e.prototype._readLink=function(e,t,n){var o,i=e.alias||e.name,a=g(e,this._variables),s=r(2).getLinkedRecordID(t,a);return null==s?void(n[i]=s):(o=n[i],r(1)(null==o||"object"==typeof o,"RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.",i,r(2).getDataID(t),o),void(n[i]=this._traverse(e,s,o)))},e.prototype._readPluralLink=function(e,t,n){var o,i,a=this,s=e.alias||e.name,u=g(e,this._variables),c=r(2).getLinkedRecordIDs(t,u);return null==c?void(n[s]=c):(o=n[s],r(1)(null==o||Array.isArray(o),"RelayReader(): Expected data for field `%s` on record `%s` to be an array, got `%s`.",s,r(2).getDataID(t),o),i=o||[],c.forEach(function(n,o){var u,c;return null==n?void(i[o]=n):(u=i[o],r(1)(null==u||"object"==typeof u,"RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.",s,r(2).getDataID(t),u),c=a._traverse(e,n,u),void(i[o]=c))}),void(n[s]=i))},e.prototype._createFragmentPointer=function(e,t,n,o){var i=n[h];i||(i=n[h]={}),r(1)("object"==typeof i&&i,"RelayReader: Expected fragment spread data to be an object, got `%s`.",i),n[_]=n[_]||r(2).getDataID(t),i[e.name]=e.args?y(e.args,o):{}},e.prototype._createDeferrableFragmentPointer=function(e,t,n){var o=r(2).getValue(t,e.storageKey),s=(0,a.default)({},this._variables,(0,i.default)({},e.rootFieldVariable,o));this._createFragmentPointer(e,t,n,s)},e}();e.exports={read:o}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=n(r(6)),i=r(13),a=i.EXISTENT,s=i.NONEXISTENT,u=r(4),c=u.ROOT_ID,l=u.ROOT_TYPE,d=function(){function e(t,r){(0,o.default)(this,e),this.__mutator=t,this._handlerProvider=r||null,this._proxies={}}return e.prototype.publishSource=function(e,t){var n=this,o=e.getRecordIDs();o.forEach(function(t){var o,i=e.getStatus(t);i===a?(o=e.get(t),o&&(n.__mutator.getStatus(t)!==a&&n.create(t,r(2).getType(o)),n.__mutator.copyFieldsFromRecord(o,t),delete n._proxies[t])):i===s&&n.delete(t)}),t&&t.length&&t.forEach(function(e){var t=n._handlerProvider&&n._handlerProvider(e.handle);r(1)(t,"RelayModernEnvironment: Expected a handler to be provided for handle `%s`.",e.handle),t.update(n,e)})},e.prototype.commitPayload=function(e,t){if(!t)return new(r(22))(this,e.fragment);var n=r(16)(e.root,t),o=n.source,i=n.fieldPayloads;return this.publishSource(o,i),new(r(22))(this,e.fragment)},e.prototype.create=function(e,t){this.__mutator.create(e,t),delete this._proxies[e];var n=this.get(e);return r(1)(n,"RelayRecordSourceProxy#create(): Expected the created record to exist."),n},e.prototype.delete=function(e){r(1)(e!==c,"RelayRecordSourceProxy#delete(): Cannot delete the root record."),delete this._proxies[e],this.__mutator.delete(e)},e.prototype.get=function(e){if(!this._proxies.hasOwnProperty(e)){var t=this.__mutator.getStatus(e);t===a?this._proxies[e]=new(r(49))(this,this.__mutator,e):this._proxies[e]=t===s?null:void 0}return this._proxies[e]},e.prototype.getRoot=function(){var e=this.get(c);return e||(e=this.create(c,l)),r(1)(e&&e.getType()===l,"RelayRecordSourceProxy#getRoot(): Expected the source to contain a root record."),e},e}();e.exports=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=n(r(6)),i=r(4),a=i.getStorageKey,s=function(){function e(t,r){(0,o.default)(this,e),this.__recordSource=t,this._readSelector=r}return e.prototype.create=function(e,t){return this.__recordSource.create(e,t)},e.prototype.delete=function(e){this.__recordSource.delete(e)},e.prototype.get=function(e){return this.__recordSource.get(e)},e.prototype.getRoot=function(){return this.__recordSource.getRoot()},e.prototype._getRootField=function(e,t,n){var o=e.node.selections.find(function(e){return"LinkedField"===e.kind&&e.name===t});return r(1)(o&&"LinkedField"===o.kind,"RelayRecordSourceSelectorProxy#getRootField(): Cannot find root field `%s`, no such field is defined on GraphQL document `%s`.",t,e.node.name),r(1)(o.plural===n,"RelayRecordSourceSelectorProxy#getRootField(): Expected root field `%s` to be %s.",t,n?"plural":"singular"),o},e.prototype.getRootField=function(e){
|
|
10
|
+
var t=this._getRootField(this._readSelector,e,!1),r=a(t,this._readSelector.variables);return this.getRoot().getLinkedRecord(r)},e.prototype.getPluralRootField=function(e){var t=this._getRootField(this._readSelector,e,!0),r=a(t,this._readSelector.variables);return this.getRoot().getLinkedRecords(r)},e}();e.exports=s},function(e,t){"use strict";function r(e,t,r){var n=Object.keys(r).reduce(function(e,t){return""+e+(e?",":"")+t+":"+r[t]},"");return"dataID:"+e+",fragment:"+t+",variables:"+n}e.exports=r},function(e,t){"use strict";function r(e){return Boolean(e&&e["@@RelayModernEnvironment"])}e.exports=r},function(e,t){"use strict";function r(e){var t,n,o;if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(r);for(t=Object.keys(e).sort(),n={},o=0;o<t.length;o++)n[t[o]]=r(e[t[o]]);return n}e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=i},function(e,t){e.exports=a},function(e,t){e.exports=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var o=void 0;return e.argumentDefinitions.forEach(function(i){if(!n.hasOwnProperty(i.name))switch(o=o||(0,a.default)({},n),i.kind){case"LocalArgument":o[i.name]=i.defaultValue;break;case"RootArgument":if(!t.hasOwnProperty(i.name))break;o[i.name]=t[i.name];break;default:r(1)(!1,"RelayConcreteVariables: Unexpected node kind `%s` in fragment `%s`.",i.kind,e.name)}}),o||n}function i(e,t){var r={};return e.argumentDefinitions.forEach(function(e){var n=e.defaultValue;null!=t[e.name]&&(n=t[e.name]),r[e.name]=n}),r}var a=n(r(11));e.exports={getFragmentVariables:o,getOperationVariables:i}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r,n){var o=r.dataID,i=r.node,a=r.variables,s=new y(e,t,a,n);return s.check(i,o)}var i=n(r(6)),a=r(13),s=a.EXISTENT,u=a.UNKNOWN,c=r(3).CONDITION,l=r(3).INLINE_FRAGMENT,d=r(3).LINKED_FIELD,p=r(3).LINKED_HANDLE,f=r(3).SCALAR_FIELD,h=r(4).getStorageKey,_=r(4).getArgumentValues,y=function(){function e(t,n,o,a){(0,i.default)(this,e),this._source=t,this._variables=o,this._recordWasMissing=!1,this._handlers=a,this._mutator=new(r(18))(t,n)}return e.prototype.check=function(e,t){return this._traverse(e,t),!this._recordWasMissing},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayAsyncLoader(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._handleMissing=function(){this._recordWasMissing=!0},e.prototype._getDataForHandlers=function(e,t){return{args:e.args?_(e.args,this._variables):{},record:this._source.get(t)}},e.prototype._handleMissingScalarField=function(e,t){var r,n,o,i,a=this._getDataForHandlers(e,t),s=a.args,u=a.record,c=!0,l=!1,d=void 0;try{for(r=this._handlers[Symbol.iterator]();!(c=(n=r.next()).done);c=!0)if(o=n.value,"scalar"===o.kind&&(i=o.handle(e,u,s),void 0!==i))return i}catch(e){l=!0,d=e}finally{try{!c&&r.return&&r.return()}finally{if(l)throw d}}this._handleMissing()},e.prototype._handleMissingLinkField=function(e,t){var r,n,o,i,a=this._getDataForHandlers(e,t),u=a.args,c=a.record,l=!0,d=!1,p=void 0;try{for(r=this._handlers[Symbol.iterator]();!(l=(n=r.next()).done);l=!0)if(o=n.value,"linked"===o.kind&&(i=o.handle(e,c,u),null!=i&&this._mutator.getStatus(i)===s))return i}catch(e){d=!0,p=e}finally{try{!l&&r.return&&r.return()}finally{if(d)throw p}}this._handleMissing()},e.prototype._handleMissingPluralLinkField=function(e,t){var r,n,o,i,a=this,u=this._getDataForHandlers(e,t),c=u.args,l=u.record,d=!0,p=!1,f=void 0;try{for(r=this._handlers[Symbol.iterator]();!(d=(n=r.next()).done);d=!0)if(o=n.value,"pluralLinked"===o.kind&&(i=o.handle(e,l,c),null!=i))return i.filter(function(e){return null!=e&&a._mutator.getStatus(e)===s})}catch(e){p=!0,f=e}finally{try{!d&&r.return&&r.return()}finally{if(p)throw f}}this._handleMissing()},e.prototype._traverse=function(e,t){var r=this._mutator.getStatus(t);r===u&&this._handleMissing(),r===s&&this._traverseSelections(e.selections,t)},e.prototype._traverseSelections=function(e,t){var n=this;e.every(function(o){var i,a,s;switch(o.kind){case f:n._prepareScalar(o,t);break;case d:o.plural?n._preparePluralLink(o,t):n._prepareLink(o,t);break;case c:i=n._getVariableValue(o.condition),i===o.passingValue&&n._traverseSelections(o.selections,t);break;case l:a=n._mutator.getType(t),null!=a&&a===o.type&&n._traverseSelections(o.selections,t);break;case p:s=r(35)(o,e,n._variables),s.plural?n._preparePluralLink(s,t):n._prepareLink(s,t);break;default:r(1)(o.kind===f,"RelayAsyncLoader(): Unexpected ast kind `%s`.",o.kind)}return!n._done})},e.prototype._prepareScalar=function(e,t){var r=h(e,this._variables),n=this._mutator.getValue(t,r);void 0===n&&(n=this._handleMissingScalarField(e,t),void 0!==n&&this._mutator.setValue(t,r,n))},e.prototype._prepareLink=function(e,t){var r=h(e,this._variables),n=this._mutator.getLinkedRecordID(t,r);void 0===n&&(n=this._handleMissingLinkField(e,t),null!=n&&this._mutator.setLinkedRecordID(t,r,n)),null!=n&&this._traverse(e,n)},e.prototype._preparePluralLink=function(e,t){var r=this,n=h(e,this._variables),o=this._mutator.getLinkedRecordIDs(t,n);void 0===o&&(o=this._handleMissingPluralLinkField(e,t),null!=o&&this._mutator.setLinkedRecordIDs(t,n,o)),o&&o.forEach(function(t){null!=t&&r._traverse(e,t)})},e}();e.exports={check:o}},function(e,t,r){"use strict";function n(e,t,n){var o=n||(e.kind===r(3).BATCH_REQUEST?e.requests[0].operation:e.operation),a=i(o,t),u=s;return{fragment:{dataID:u,node:e.fragment,variables:a},node:e,root:{dataID:u,node:o,variables:a},variables:a}}var o=r(30),i=o.getOperationVariables,a=r(4),s=a.ROOT_ID;e.exports={createOperationSelector:n}},function(e,t,r){"use strict";function n(e,t,n){var o,i,a,s;return r(1)("object"==typeof n&&null!==n&&!Array.isArray(n),"RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.",t.name,JSON.stringify(n)),o=n[y],i=n[_],"string"==typeof o&&"object"==typeof i&&null!==i&&"object"==typeof i[t.name]&&null!==i[t.name]?(a=i[t.name],s=f(t,e,a),{dataID:o,node:t,variables:s}):(r(5)(!1,"RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`.",t.name,JSON.stringify(n),t.name),null)}function o(e,t,r){var o=null;return r.forEach(function(r){var i=null!=r?n(e,t,r):null;null!=i&&(o=o||[],o.push(i))}),o}function i(e,t,i){var a,s,u,c={};for(a in t)t.hasOwnProperty(a)&&(s=t[a],u=i[a],null==u?c[a]=u:s.metadata&&s.metadata.plural===!0?(r(1)(Array.isArray(u),"RelayModernSelector: Expected value for key `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.",a,JSON.stringify(u),s.name),c[a]=o(e,s,u)):(r(1)(!Array.isArray(u),"RelayModernFragmentSpecResolver: Expected value for key `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.",a,JSON.stringify(u),s.name),c[a]=n(e,s,u)));return c}function a(e,t){var n,o,i,a={};for(n in e)e.hasOwnProperty(n)&&(o=e[n],i=t[n],null==i?a[n]=i:o.metadata&&o.metadata.plural===!0?(r(1)(Array.isArray(i),"RelayModernSelector: Expected value for key `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.",n,JSON.stringify(i),o.name),a[n]=s(o,i)):(r(1)(!Array.isArray(i),"RelayModernFragmentSpecResolver: Expected value for key `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.",n,JSON.stringify(i),o.name),a[n]=u(o,i)));return a}function s(e,t){var r=void 0;return t.forEach(function(t){var n=null!=t?u(e,t):null;null!=n&&(r=r||[],r.push(n))}),r||null}function u(e,t){r(1)("object"==typeof t&&null!==t&&!Array.isArray(t),"RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.",e.name,JSON.stringify(t));var n=t[y];return"string"==typeof n?n:(r(5)(!1,"RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`.",e.name,JSON.stringify(t),e.name),null)}function c(e,t,n){var o,i,a={};for(o in t)!t.hasOwnProperty(o)||(i=function(){var i,s=t[o],u=n[o];return null==u?"continue":void(s.metadata&&s.metadata.plural===!0?(r(1)(Array.isArray(u),"RelayModernSelector: Expected value for key `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.",o,JSON.stringify(u),s.name),u.forEach(function(t){if(null!=t){var r=l(e,s,t);r&&Object.assign(a,r)}})):(r(1)(!Array.isArray(u),"RelayModernFragmentSpecResolver: Expected value for key `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.",o,JSON.stringify(u),s.name),i=l(e,s,u),i&&Object.assign(a,i)))}(),"continue"!==i);return a}function l(e,t,r){var o=n(e,t,r);return o?o.variables:null}function d(e,t){return e.dataID===t.dataID&&e.node===t.node&&r(27)(e.variables,t.variables)}var p=r(30),f=p.getFragmentVariables,h=r(4),_=h.FRAGMENTS_KEY,y=h.ID_KEY;e.exports={areEqualSelectors:d,getDataIDsFromObject:a,getSelector:n,getSelectorList:o,getSelectorsFromObject:i,getVariablesFromObject:c}},function(e,t,r){"use strict";function n(e,t){var r,n,o,i=e.get(t.dataID);if(i&&(r=i.getLinkedRecord(t.fieldKey))){if(r.getDataID()===a)return i.setValue(null,t.fieldKey),void i.setLinkedRecord(r,t.handleKey);n=e.get(a)||e.create(a,s),n.copyFieldsFrom(r),i.setValue(null,t.fieldKey),i.setLinkedRecord(n,t.handleKey),o=e.getRoot(),o.setLinkedRecord(n,t.handleKey)}}var o=r(4),i=o.ROOT_ID,a=r(10)(i,"viewer"),s="Viewer";e.exports={VIEWER_ID:a,update:n}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var o,a,c=t.find(function(t){return t.kind===u&&t.name===e.name&&t.alias===e.alias&&r(27)(t.args,e.args)});return r(1)(c&&c.kind===u,"cloneRelayHandleSourceField: Expected a corresponding source field for handle `%s`.",e.handle),o=s(e,n),a=(0,i.default)({},c,{args:null,name:o,storageKey:o})}var i=n(r(11)),a=r(4),s=a.getHandleStorageKey,u=r(3).LINKED_FIELD;e.exports=o},function(e,t,r){"use strict";function n(e,t,n){return t&&t!==i?"__"+t+"_"+e:(r(1)(null!=n,"getRelayHandleKey: Expected either `fieldName` or `key` in `handle` to be provided"),"__"+n+"_"+e)}var o=r(40),i=o.DEFAULT_HANDLE_KEY;e.exports=n},function(e,t,r){"use strict";function n(e){var t,n=e.operation,o=e.variables,a=e.response,s=a.data,u=a.errors;if(null!=s)return r(16)({dataID:i,node:n,variables:o},s,u,{handleStrippedNulls:!0});throw t=r(42).create("RelayNetwork","No data returned for operation `%s`, got error(s):\n%s\n\nSee the error `source` property for more information.",n.name,u?u.map(function(e){var t=e.message;return t}).join("\n"):"(No errors)"),t.source={errors:u,operation:n,variables:o},t}var o=r(4),i=o.ROOT_ID;e.exports=n},function(e,t){"use strict";function r(e,t){var n,o,i,a,s,u,c;return e!==t&&"object"==typeof e&&e&&"object"==typeof t&&t?(n=!1,o=Array.isArray(e)?e:null,i=Array.isArray(t)?t:null,o&&i?n=i.reduce(function(e,t,n){var a=o[n],s=r(a,t);return s!==i[n]&&(i[n]=s),e&&i[n]===o[n]},!0)&&o.length===i.length:o||i||(a=e,s=t,u=Object.keys(a),c=Object.keys(s),n=c.reduce(function(e,t){var n=a[t],o=r(n,s[t]);return o!==s[t]&&(s[t]=o),e&&s[t]===a[t]},!0)&&u.length===c.length),n?e:t):t}e.exports=r},function(e,t,r){"use strict";function n(e){return function(t,n,o,a){var s=e(t,n,o,a);return s instanceof Error?r(17).create(function(e){return e.error(s)}):r(17).from(s).map(function(e){return i(t,n,e)})}}function o(e){return function(t,n,o){return r(17).fromLegacy(function(r){return e(t,n,o,r)}).map(function(e){return i(t,n,e)})}}function i(e,t,n){return n.data||n.errors||!n.response?a(e,t,n):n.operation?n:(r(5)(!1,"ConvertToExecuteFunction: execute payload contains response but is missing operation."),a(e,t,n.response))}function a(e,t,n){if(e.kind===r(3).BATCH_REQUEST)throw new Error("ConvertToExecuteFunction: Batch request must return ExecutePayload.");return{operation:e.operation,variables:t,response:n}}e.exports={convertFetch:n,convertSubscribe:o}},function(e,t){"use strict";e.exports={DEFAULT_HANDLE_KEY:""}},function(e,t,r){"use strict";function n(e){switch(e){case"connection":return r(8);case"viewer":return r(34)}r(1)(!1,"RelayDefaultHandlerProvider: No handler provided for `%s`.",e)}e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,o){var a=new Error(r(65).apply(void 0,[n].concat((0,i.default)(o))));return a.name=t,a.type=e,a.framesToPop=2,a}var i=n(r(62)),a={create:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return o("mustfix",e,t,n)},createWarning:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return o("warn",e,t,n)}};e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var o,i,a,s,c,l=t.getRecordIDs();for(o=0;o<l.length;o++)i=l[o],a=t.get(i),s=e.get(i),a===u?(e.remove(i),n[i]=!0):a&&s?(c=r(2).update(s,a),c!==s&&(n[i]=!0,e.set(i,c))):null===a?(e.delete(i),null!==s&&(n[i]=!0)):a&&(e.set(i,a),n[i]=!0)}var i=n(r(11)),a=n(r(6)),s=r(4),u=s.UNPUBLISH_RECORD_SENTINEL,c=function(){function e(t){(0,a.default)(this,e),this._gcEnabled=!0,this._hasScheduledGC=!1,this._index=0,this._recordSource=t,this._roots=new Map,this._subscriptions=new Set,this._updatedRecordIDs={}}return e.prototype.getSource=function(){return this._recordSource},e.prototype.check=function(e){return r(31).check(this._recordSource,this._recordSource,e,[])},e.prototype.retain=function(e){var t=this,r=this._index++,n=function(){t._roots.delete(r),t._scheduleGC()};return this._roots.set(r,e),{dispose:n}},e.prototype.lookup=function(e){var t=r(20).read(this._recordSource,e);return t},e.prototype.notify=function(){var e=this;this._subscriptions.forEach(function(t){e._updateSubscription(t)}),this._updatedRecordIDs={}},e.prototype.publish=function(e){o(this._recordSource,e,this._updatedRecordIDs)},e.prototype.subscribe=function(e,t){var r=this,n={callback:t,snapshot:e},o=function(){r._subscriptions.delete(n)};return this._subscriptions.add(n),{dispose:o}},e.prototype.__getUpdatedRecordIDs=function(){return this._updatedRecordIDs},e.prototype._updateSubscription=function(e){var t,n,o,a,s,u=e.callback,c=e.snapshot;r(57)(c,this._updatedRecordIDs)&&(t=r(20).read(this._recordSource,c),n=t.data,o=t.seenRecords,a=r(38)(c.data,n),s=(0,i.default)({},c,{data:a,seenRecords:o}),e.snapshot=s,s.data!==c.data&&u(s))},e.prototype._scheduleGC=function(){var e=this;this._gcEnabled&&!this._hasScheduledGC&&(this._hasScheduledGC=!0,r(64)(function(){e._gc(),e._hasScheduledGC=!1}))},e.prototype._gc=function(){var e,t,n,o=this,i=new Set;if(this._roots.forEach(function(e){r(50).mark(o._recordSource,e,i)}),!i.size)return void this._recordSource.clear();for(e=this._recordSource.getRecordIDs(),t=0;t<e.length;t++)n=e[t],i.has(n)||this._recordSource.remove(n)},e.prototype.__enableGC=function(){this._gcEnabled=!0},e.prototype.__disableGC=function(){this._gcEnabled=!1},e}();r(19).instrumentMethods(c.prototype,{lookup:"RelayMarkSweepStore.prototype.lookup",notify:"RelayMarkSweepStore.prototype.notify",publish:"RelayMarkSweepStore.prototype.publish",retain:"RelayMarkSweepStore.prototype.retain",subscribe:"RelayMarkSweepStore.prototype.subscribe"}),e.exports=c},function(e,t,r){(function(t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o=n(r(6)),i=r(32),a=i.createOperationSelector,s=function(){function e(n){var i,a,s,u=this;(0,o.default)(this,e),this._deferrableSelections=new Set,this.configName=n.configName,i=n.handlerProvider?n.handlerProvider:r(41),this._network=n.network,this._publishQueue=new(r(47))(n.store,i),this._store=n.store,this.unstable_internal=r(7),this.__setNet=function(e){return u._network=e},a="undefined"!=typeof t?t:"undefined"!=typeof window?window:void 0,s=a&&a.__RELAY_DEVTOOLS_HOOK__,s&&s.registerEnvironment(this)}return e.prototype.getStore=function(){return this._store},e.prototype.getNetwork=function(){return this._network},e.prototype.applyUpdate=function(e){var t=this,r=function(){t._publishQueue.revertUpdate(e),t._publishQueue.run()};return this._publishQueue.applyUpdate(e),this._publishQueue.run(),{dispose:r}},e.prototype.revertUpdate=function(e){this._publishQueue.revertUpdate(e),this._publishQueue.run()},e.prototype.replaceUpdate=function(e,t){this._publishQueue.revertUpdate(e),this._publishQueue.applyUpdate(t),this._publishQueue.run()},e.prototype.applyMutation=function(e){var t=e.operation,r=e.optimisticResponse,n=e.optimisticUpdater;return this.applyUpdate({operation:t,selectorStoreUpdater:n,response:r||null})},e.prototype.check=function(e){return this._store.check(e)},e.prototype.commitPayload=function(e,t){var n=r(16)(e.root,t);this._publishQueue.commitPayload(e,n),this._publishQueue.run()},e.prototype.commitUpdate=function(e){this._publishQueue.commitUpdate(e),this._publishQueue.run()},e.prototype.lookup=function(e){return this._store.lookup(e)},e.prototype.subscribe=function(e,t){return this._store.subscribe(e,t)},e.prototype.retain=function(e){return this._store.retain(e)},e.prototype.isSelectorLoading=function(e){var t=r(23)(e.dataID,e.node.name,e.variables);return this._deferrableSelections.has(t)},e.prototype.execute=function(e){var t=this,n=e.operation,o=e.cacheConfig,i=e.updater,s=void 0;return this._network.execute(n.node,n.variables,o||{}).do({next:function(e){var o,u,c,l,d,p=r(37)(e),f=p.source,h=p.fieldPayloads,_=p.deferrableSelections,y=!0,g=!1,b=void 0;try{for(o=(_||new Set)[Symbol.iterator]();!(y=(u=o.next()).done);y=!0)c=u.value,t._deferrableSelections.add(c)}catch(e){g=!0,b=e}finally{try{!y&&o.return&&o.return()}finally{if(g)throw b}}e.isOptimistic?(r(1)(null==s,"environment.execute: only support one optimistic respnose per execute."),s={source:f,fieldPayloads:h},t._publishQueue.applyUpdate(s),t._publishQueue.run()):(s&&(t._publishQueue.revertUpdate(s),s=void 0),l=a(n.node,e.variables,e.operation),"DeferrableOperation"===e.operation.kind&&(d=r(23)(e.variables[e.operation.rootFieldVariable],e.operation.fragmentName,e.variables),t._deferrableSelections.delete(d)),t._publishQueue.commitPayload(l,p,i),t._publishQueue.run())}}).finally(function(){s&&(t._publishQueue.revertUpdate(s),s=void 0,t._publishQueue.run())})},e.prototype.executeMutation=function(e){var t=this,n=e.operation,o=e.optimisticResponse,i=e.optimisticUpdater,a=e.updater,s=e.uploadables,u=void 0;return(o||i)&&(u={operation:n,selectorStoreUpdater:i,response:o||null}),this._network.execute(n.node,n.variables,{force:!0},s).do({start:function(){u&&(t._publishQueue.applyUpdate(u),t._publishQueue.run())},next:function(e){u&&(t._publishQueue.revertUpdate(u),u=void 0),t._publishQueue.commitPayload(n,r(37)(e),a),t._publishQueue.run()},error:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){u&&(t._publishQueue.revertUpdate(u),u=void 0,t._publishQueue.run())}),unsubscribe:function(){u&&(t._publishQueue.revertUpdate(u),u=void 0,t._publishQueue.run())}})},e.prototype.sendQuery=function(e){var t=e.cacheConfig,n=e.onCompleted,o=e.onError,i=e.onNext,a=e.operation;return r(5)(!1,"environment.sendQuery() is deprecated. Update to the latest version of react-relay, and use environment.execute()."),this.execute({operation:a,cacheConfig:t}).subscribeLegacy({onNext:i,onError:o,onCompleted:n})},e.prototype.streamQuery=function(e){var t=e.cacheConfig,n=e.onCompleted,o=e.onError,i=e.onNext,a=e.operation;return r(5)(!1,"environment.streamQuery() is deprecated. Update to the latest version of react-relay, and use environment.execute()."),this.execute({operation:a,cacheConfig:t}).subscribeLegacy({onNext:i,onError:o,onCompleted:n})},e.prototype.sendMutation=function(e){var t=e.onCompleted,n=e.onError,o=e.operation,i=e.optimisticResponse,a=e.optimisticUpdater,s=e.updater,u=e.uploadables;return r(5)(!1,"environment.sendMutation() is deprecated. Update to the latest version of react-relay, and use environment.executeMutation()."),this.executeMutation({operation:o,optimisticResponse:i,optimisticUpdater:a,updater:s,uploadables:u}).subscribeLegacy({onNext:function(e){t&&t(e.response.errors)},onError:n,onCompleted:t})},e.prototype.sendSubscription=function(e){var t=e.onCompleted,n=e.onNext,o=e.onError,i=e.operation,a=e.updater;return r(5)(!1,"environment.sendSubscription() is deprecated. Update to the latest version of react-relay, and use environment.execute()."),this.execute({operation:i,updater:a,cacheConfig:{force:!0}}).subscribeLegacy({onNext:n,onError:o,onCompleted:t})},e.prototype.checkSelectorAndUpdateStore=function(e,t){var n=new(r(12)),o=r(31).check(this._store.getSource(),n,e,t);return n.size()>0&&(this._publishQueue.commitSource(n),this._publishQueue.run()),o},e}();s.prototype["@@RelayModernEnvironment"]=!0,e.exports=s}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){e&&e.dispose()}var i=n(r(11)),a=n(r(6)),s=r(33),u=s.areEqualSelectors,c=s.getSelectorsFromObject,l=function(){function e(t,r,n,o){var i=this;(0,a.default)(this,e),this._onChange=function(){i._stale=!0,i._callback()},this._callback=o,this._context=t,this._data={},this._fragments=r,this._props=n,this._resolvers={},this._stale=!1,this.setProps(n)}return e.prototype.dispose=function(){for(var e in this._resolvers)this._resolvers.hasOwnProperty(e)&&o(this._resolvers[e])},e.prototype.resolve=function(){var e,t,n,o,a,s,u,c;if(this._stale){e=this._data,t=void 0;for(n in this._resolvers)this._resolvers.hasOwnProperty(n)&&(o=this._resolvers[n],a=e[n],o?(s=o.resolve(),(t||s!==a)&&(t=t||(0,i.default)({},e),t[n]=s)):(u=this._props[n],c=void 0!==u?u:null,!t&&r(59)(c,a)||(t=t||(0,i.default)({},e),t[n]=c)));this._data=t||e,this._stale=!1}return this._data},e.prototype.isLoading=function(){for(var e in this._resolvers)if(this._resolvers.hasOwnProperty(e)&&this._resolvers[e]&&this._resolvers[e].isLoading())return!0;return!1},e.prototype.setProps=function(e){var t,n,o,i=c(this._context.variables,this._fragments,e);for(t in i)i.hasOwnProperty(t)&&(n=i[t],o=this._resolvers[t],null==n?(null!=o&&o.dispose(),o=null):Array.isArray(n)?null==o?o=new f(this._context.environment,n,this._onChange):(r(1)(o instanceof f,"RelayModernFragmentSpecResolver: Expected prop `%s` to always be an array.",t),o.setSelectors(n)):null==o?o=new d(this._context.environment,n,this._onChange):(r(1)(o instanceof d,"RelayModernFragmentSpecResolver: Expected prop `%s` to always be an object.",t),o.setSelector(n)),this._resolvers[t]=o);this._props=e,this._stale=!0},e.prototype.setVariables=function(e){var t,r;for(t in this._resolvers)this._resolvers.hasOwnProperty(t)&&(r=this._resolvers[t],r&&r.setVariables(e));this._stale=!0},e}(),d=function(){function e(t,r,n){(0,a.default)(this,e),p.call(this);var o=t.lookup(r);this._callback=n,this._data=o.data,this._environment=t,this._selector=r,this._subscription=t.subscribe(o,this._onChange)}return e.prototype.dispose=function(){this._subscription&&(this._subscription.dispose(),this._subscription=null)},e.prototype.resolve=function(){return this._data},e.prototype.setSelector=function(e){if(null==this._subscription||!u(e,this._selector)){this.dispose();var t=this._environment.lookup(e);this._data=t.data,this._selector=e,this._subscription=this._environment.subscribe(t,this._onChange)}},e.prototype.setVariables=function(e){var t=(0,i.default)({},this._selector,{variables:e});this.setSelector(t)},e.prototype.isLoading=function(){return this._environment.isSelectorLoading(this._selector)},e}(),p=function(){var e=this;this._onChange=function(t){e._data=t.data,e._callback()}},f=function(){function e(t,r,n){var o=this;(0,a.default)(this,e),this._onChange=function(e){o._stale=!0,o._callback()},this._callback=n,this._data=[],this._environment=t,this._resolvers=[],this._stale=!0,this.setSelectors(r)}return e.prototype.dispose=function(){this._resolvers.forEach(o)},e.prototype.resolve=function(){var e,t,r,n,o;if(this._stale){for(e=this._data,t=void 0,r=0;r<this._resolvers.length;r++)n=e[r],o=this._resolvers[r].resolve(),(t||o!==n)&&(t=t||e.slice(0,r),t.push(o));t||this._resolvers.length===e.length||(t=e.slice(0,this._resolvers.length)),this._data=t||e,this._stale=!1}return this._data},e.prototype.setSelectors=function(e){for(var t,r;this._resolvers.length>e.length;)t=this._resolvers.pop(),t.dispose();for(r=0;r<e.length;r++)r<this._resolvers.length?this._resolvers[r].setSelector(e[r]):this._resolvers[r]=new d(this._environment,e[r],this._onChange);this._stale=!0},e.prototype.setVariables=function(e){this._resolvers.forEach(function(t){return t.setVariables(e)}),this._stale=!0},e.prototype.isLoading=function(){return this._resolvers.some(function(e){return e.isLoading()})},e}();e.exports=l},function(e,t,r){"use strict";function n(e,t){function n(e,t,n,i){if("subscription"===e.operationKind)return r(1)(s,"RelayNetwork: This network layer does not support Subscriptions. To use Subscriptions, provide a custom network layer."),r(1)(!i,"RelayNetwork: Cannot provide uploadables while subscribing."),s(e,t,n);var a=n.poll;return null!=a?(r(1)(!i,"RelayNetwork: Cannot provide uploadables while polling."),o(e,t,{force:!0}).poll(a)):o(e,t,n,i)}var o=i(e),s=t?a(t):void 0;return{execute:n}}var o=r(39),i=o.convertFetch,a=o.convertSubscribe;e.exports={create:n}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=r(20).read(e,t).data;return n}var i=n(r(6)),a=function(){function e(t,n){(0,i.default)(this,e),this._backup=new(r(12)),this._handlerProvider=n||null,this._pendingBackupRebase=!1,this._pendingUpdaters=new Set,this._pendingData=new Set,this._pendingOptimisticUpdates=new Set,this._store=t,this._appliedOptimisticUpdates=new Set}return e.prototype.applyUpdate=function(e){r(1)(!this._appliedOptimisticUpdates.has(e)&&!this._pendingOptimisticUpdates.has(e),"RelayPublishQueue: Cannot apply the same update function more than once concurrently."),this._pendingOptimisticUpdates.add(e)},e.prototype.revertUpdate=function(e){this._pendingOptimisticUpdates.has(e)?this._pendingOptimisticUpdates.delete(e):this._appliedOptimisticUpdates.has(e)&&(this._pendingBackupRebase=!0,this._appliedOptimisticUpdates.delete(e))},e.prototype.revertAll=function(){this._pendingBackupRebase=!0,this._pendingOptimisticUpdates.clear(),this._appliedOptimisticUpdates.clear()},e.prototype.commitPayload=function(e,t,r){var n=t.fieldPayloads,o=t.source;this._pendingBackupRebase=!0,this._pendingData.add({kind:"payload",payload:{fieldPayloads:n,operation:e,source:o,updater:r}})},e.prototype.commitUpdate=function(e){this._pendingBackupRebase=!0,this._pendingUpdaters.add(e)},e.prototype.commitSource=function(e){this._pendingBackupRebase=!0,this._pendingData.add({kind:"source",source:e})},e.prototype.run=function(){this._pendingBackupRebase&&this._backup.size()&&(this._store.publish(this._backup),this._backup=new(r(12))),this._commitData(),this._commitUpdaters(),this._applyUpdates(),this._pendingBackupRebase=!1,this._store.notify()},e.prototype._getSourceFromPayload=function(e){var t,n=this,i=e.fieldPayloads,a=e.operation,s=e.source,u=e.updater,c=new(r(18))(this._store.getSource(),s),l=new(r(21))(c),d=new(r(22))(l,a.fragment);return i&&i.length&&i.forEach(function(e){var t=n._handlerProvider&&n._handlerProvider(e.handle);r(1)(t,"RelayModernEnvironment: Expected a handler to be provided for handle `%s`.",e.handle),t.update(l,e)}),u&&(t=o(s,a.fragment),u(d,t)),s},e.prototype._commitData=function(){var e=this;this._pendingData.size&&(this._pendingData.forEach(function(t){var r=void 0;r="payload"===t.kind?e._getSourceFromPayload(t.payload):t.source,e._store.publish(r)}),this._pendingData.clear())},e.prototype._commitUpdaters=function(){var e,t=this;this._pendingUpdaters.size&&(e=new(r(12)),this._pendingUpdaters.forEach(function(n){var o=new(r(18))(t._store.getSource(),e),i=new(r(21))(o);n(i)}),this._store.publish(e),this._pendingUpdaters.clear())},e.prototype._applyUpdates=function(){var e,t,n,i=this;(this._pendingOptimisticUpdates.size||this._pendingBackupRebase&&this._appliedOptimisticUpdates.size)&&(e=new(r(12)),t=new(r(18))(this._store.getSource(),e,this._backup),n=new(r(21))(t,this._handlerProvider),this._pendingBackupRebase&&this._appliedOptimisticUpdates.size&&this._appliedOptimisticUpdates.forEach(function(e){var t,i,a,s,u,c,l,d,p,f;e.operation?(t=e.selectorStoreUpdater,i=e.operation,a=e.response,s=n.commitPayload(i,a),u=void 0,c=void 0,a&&(l=r(16)(i.root,a),c=l.source,u=o(c,i.fragment)),t&&t(s,u)):e.storeUpdater?(d=e.storeUpdater)(n):(p=e.source,f=e.fieldPayloads,n.publishSource(p,f))}),this._pendingOptimisticUpdates.size&&(this._pendingOptimisticUpdates.forEach(function(e){var t,a,s,u,c,l,d,p,f,h;e.operation?(t=e.selectorStoreUpdater,a=e.operation,s=e.response,u=n.commitPayload(a,s),c=void 0,l=void 0,s&&(d=r(16)(a.root,s),l=d.source,c=o(l,a.fragment)),t&&t(u,c)):e.storeUpdater?(p=e.storeUpdater)(n):(f=e.source,h=e.fieldPayloads,n.publishSource(f,h)),i._appliedOptimisticUpdates.add(e)}),this._pendingOptimisticUpdates.clear()),this._store.publish(e))},e}();e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return JSON.stringify(r(25)({queryID:e,variables:t}))}function i(e,t){return e+t>=Date.now()}var a=n(r(6)),s=function(){function e(t){var n=t.size,o=t.ttl;(0,a.default)(this,e),r(1)(n>0,"RelayQueryResponseCache: Expected the max cache size to be > 0, got `%s`.",n),r(1)(o>0,"RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.",o),this._responses=new Map,this._size=n,this._ttl=o}return e.prototype.clear=function(){this._responses.clear()},e.prototype.get=function(e,t){var r,n=this,a=o(e,t);return this._responses.forEach(function(e,t){i(e.fetchTime,n._ttl)||n._responses.delete(t)}),r=this._responses.get(a),null!=r?r.payload:null},e.prototype.set=function(e,t,r){var n,i=Date.now(),a=o(e,t);this._responses.delete(a),this._responses.set(a,{fetchTime:i,payload:r}),this._responses.size>this._size&&(n=this._responses.keys().next(),n.done||this._responses.delete(n.value))},e}();e.exports=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return null==e||"object"!=typeof e||Array.isArray(e)&&e.every(o)}var i=n(r(6)),a=r(4),s=a.getStableStorageKey,u=function(){function e(t,r,n){(0,i.default)(this,e),this._dataID=n,this._mutator=r,this._source=t}return e.prototype.copyFieldsFrom=function(e){this._mutator.copyFields(e.getDataID(),this._dataID)},e.prototype.getDataID=function(){return this._dataID},e.prototype.getType=function(){var e=this._mutator.getType(this._dataID);return r(1)(null!=e,"RelayRecordProxy: Cannot get the type of deleted record `%s`.",this._dataID),e},e.prototype.getValue=function(e,t){var r=s(e,t);return this._mutator.getValue(this._dataID,r)},e.prototype.setValue=function(e,t,n){r(1)(o(e),"RelayRecordProxy#setValue(): Expected a scalar or array of scalars, got `%s`.",JSON.stringify(e));var i=s(t,n);return this._mutator.setValue(this._dataID,i,e),this},e.prototype.getLinkedRecord=function(e,t){var r=s(e,t),n=this._mutator.getLinkedRecordID(this._dataID,r);return null!=n?this._source.get(n):n},e.prototype.setLinkedRecord=function(t,n,o){var i,a;return r(1)(t instanceof e,"RelayRecordProxy#setLinkedRecord(): Expected a record, got `%s`.",t),i=s(n,o),a=t.getDataID(),this._mutator.setLinkedRecordID(this._dataID,i,a),this},e.prototype.getOrCreateLinkedRecord=function(e,t,n){var o,i,a=this.getLinkedRecord(e,n);return a||(o=s(e,n),i=r(10)(this.getDataID(),o),a=this._source.create(i,t),this.setLinkedRecord(a,e,n)),a},e.prototype.getLinkedRecords=function(e,t){var r=this,n=s(e,t),o=this._mutator.getLinkedRecordIDs(this._dataID,n);
|
|
11
|
+
return null==o?o:o.map(function(e){return null!=e?r._source.get(e):e})},e.prototype.setLinkedRecords=function(e,t,n){var o,i;return r(1)(Array.isArray(e),"RelayRecordProxy#setLinkedRecords(): Expected records to be an array, got `%s`.",e),o=s(t,n),i=e.map(function(e){return e&&e.getDataID()}),this._mutator.setLinkedRecordIDs(this._dataID,o,i),this},e}();e.exports=u},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){var n=t.dataID,o=t.node,i=t.variables,a=new h(e,i,r);a.mark(o,n)}var i=n(r(6)),a=r(3).CONDITION,s=r(3).FRAGMENT_SPREAD,u=r(3).INLINE_FRAGMENT,c=r(3).LINKED_FIELD,l=r(3).LINKED_HANDLE,d=r(3).SCALAR_FIELD,p=r(3).SCALAR_HANDLE,f=r(4).getStorageKey,h=function(){function e(t,r,n){(0,i.default)(this,e),this._references=n,this._recordSource=t,this._variables=r}return e.prototype.mark=function(e,t){this._traverse(e,t)},e.prototype._traverse=function(e,t){this._references.add(t);var r=this._recordSource.get(t);null!=r&&this._traverseSelections(e.selections,r)},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayReferenceMarker(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._traverseSelections=function(e,t){var n=this;e.forEach(function(o){var i,f,h;o.kind===c?o.plural?n._traversePluralLink(o,t):n._traverseLink(o,t):o.kind===a?(i=n._getVariableValue(o.condition),i===o.passingValue&&n._traverseSelections(o.selections,t)):o.kind===u?(f=r(2).getType(t),null!=f&&f===o.type&&n._traverseSelections(o.selections,t)):o.kind===s?r(1)(!1,"RelayReferenceMarker(): Unexpected fragment spread `...%s`, expected all fragments to be inlined.",o.name):o.kind===l?(h=r(35)(o,e,n._variables),h.plural?n._traversePluralLink(h,t):n._traverseLink(h,t)):r(1)(o.kind===d||o.kind===p,"RelayReferenceMarker(): Unexpected ast kind `%s`.",o.kind)})},e.prototype._traverseLink=function(e,t){var n=f(e,this._variables),o=r(2).getLinkedRecordID(t,n);null!=o&&this._traverse(e,o)},e.prototype._traversePluralLink=function(e,t){var n=this,o=f(e,this._variables),i=r(2).getLinkedRecordIDs(t,o);null!=i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},e}();e.exports={mark:o}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{handleStrippedNulls:!1},o=t.dataID,i=t.node,a=t.variables,s=new m(e,a,n);return s.normalizeResponse(i,o,r)}var i=n(r(26)),a=n(r(11)),s=n(r(6)),u=r(4),c=u.getArgumentValues,l=u.getHandleStorageKey,d=u.getStorageKey,p=u.TYPENAME_KEY,f=r(3).CONDITION,h=r(3).INLINE_FRAGMENT,_=r(3).LINKED_FIELD,y=r(3).LINKED_HANDLE,g=r(3).SCALAR_FIELD,b=r(3).SCALAR_HANDLE,v=r(3).DEFERRABLE_FRAGMENT_SPREAD,m=function(){function e(t,r,n){(0,s.default)(this,e),this._handleFieldPayloads=[],this._deferrableSelections=new Set,this._recordSource=t,this._variables=r,this._handleStrippedNulls=n.handleStrippedNulls}return e.prototype.normalizeResponse=function(e,t,n){var o=this._recordSource.get(t);return r(1)(o,"RelayResponseNormalizer(): Expected root record `%s` to exist.",t),this._traverseSelections(e,o,n),{fieldPayloads:this._handleFieldPayloads,deferrableSelections:this._deferrableSelections}},e.prototype._getVariableValue=function(e){return r(1)(this._variables.hasOwnProperty(e),"RelayResponseNormalizer(): Undefined variable `%s`.",e),this._variables[e]},e.prototype._getRecordType=function(e){var t=e[p];return r(1)(null!=t,"RelayResponseNormalizer(): Expected a typename for record `%s`.",JSON.stringify(e,null,2)),t},e.prototype._traverseSelections=function(e,t,n){var o=this;e.selections.forEach(function(s){var u,p,m,R,E,S,k,D;s.kind===g||s.kind===_?o._normalizeField(e,s,t,n):s.kind===f?(u=o._getVariableValue(s.condition),u===s.passingValue&&o._traverseSelections(s,t,n)):s.kind===h?(p=r(2).getType(t),p===s.type&&o._traverseSelections(s,t,n)):s.kind===y||s.kind===b?(m=s.args?c(s.args,o._variables):{},R=d(s,o._variables),E=l(s,o._variables),o._handleFieldPayloads.push({args:m,dataID:r(2).getDataID(t),fieldKey:R,handle:s.handle,handleKey:E})):s.kind===v?(S=r(2).getValue(t,s.storageKey),r(1)("string"==typeof S,"expected ID at %s",s.storageKey),k=s.args?c(s.args,(0,a.default)({},o._variables,(0,i.default)({},s.rootFieldVariable,S))):{},D=r(23)(S,s.name,k),o._deferrableSelections.add(D)):r(1)(!1,"RelayResponseNormalizer(): Unexpected ast kind `%s`.",s.kind)})},e.prototype._normalizeField=function(e,t,n,o){var i,a,s;if(r(1)("object"==typeof o&&o,"writeField(): Expected data for field `%s` to be an object.",t.name),i=t.alias||t.name,a=d(t,this._variables),s=o[i],null==s){if(void 0===s&&!this._handleStrippedNulls)return;return void r(2).setValue(n,a,null)}t.kind===g?r(2).setValue(n,a,s):t.plural?this._normalizePluralLink(t,n,a,s):this._normalizeLink(t,n,a,s)},e.prototype._normalizeLink=function(e,t,n,o){var i,a,s;r(1)("object"==typeof o&&o,"RelayResponseNormalizer: Expected data for field `%s` to be an object.",n),i=o.id||r(2).getLinkedRecordID(t,n)||r(10)(r(2).getDataID(t),n),r(1)("string"==typeof i,"RelayResponseNormalizer: Expected id on field `%s` to be a string.",n),r(2).setLinkedRecordID(t,n,i),a=this._recordSource.get(i),a||(s=e.concreteType||this._getRecordType(o),a=r(2).create(i,s),this._recordSource.set(i,a)),this._traverseSelections(e,a,o)},e.prototype._normalizePluralLink=function(e,t,n,o){var i,a,s=this;r(1)(Array.isArray(o),"RelayResponseNormalizer: Expected data for field `%s` to be an array of objects.",n),i=r(2).getLinkedRecordIDs(t,n),a=[],o.forEach(function(o,u){var c,l,d;return null==o?void a.push(o):(r(1)("object"==typeof o,"RelayResponseNormalizer: Expected elements for field `%s` to be objects.",n),c=o.id||i&&i[u]||r(10)(r(2).getDataID(t),n,u),r(1)("string"==typeof c,"RelayResponseNormalizer: Expected id of elements of field `%s` to be strings.",n),a.push(c),l=s._recordSource.get(c),l||(d=e.concreteType||s._getRecordType(o),l=r(2).create(c,d),s._recordSource.set(c,l)),void s._traverseSelections(e,l,o))}),r(2).setLinkedRecordIDs(t,n,a)},e.prototype._validateRecordType=function(e,t,n){var o=t.concreteType||this._getRecordType(n);r(5)(r(2).getType(e)===o,"RelayResponseNormalizer: Invalid record `%s`. Expected %s to be be consistent, but the record was assigned conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.",r(2).getDataID(e),p,r(2).getType(e),o)},e}();o=r(19).instrument("RelayResponseNormalizer.normalize",o),e.exports={normalize:o}},function(e,t,r){"use strict";function n(e,t){var n,o,i,a,s,u,c,l,d,p;if(r(1)(r(24)(e),"commitRelayModernMutation: expect `environment` to be an instance of `RelayModernEnvironment`."),n=e.unstable_internal,o=n.createOperationSelector,i=n.getRequest,a=i(t.mutation),"mutation"!==a.operationKind)throw new Error("commitRelayModernMutation: Expected mutation operation");return s=t.optimisticUpdater,u=t.configs,c=t.optimisticResponse,l=t.variables,d=o(a,l),u&&(p=r(14).convert(u,a,s),s=p.optimisticUpdater),e.applyUpdate({operation:d,selectorStoreUpdater:s,response:c})}e.exports=n},function(e,t){"use strict";function r(e,t){e.commitUpdate(t)}e.exports=r},function(e,t,r){"use strict";function n(e,t){var n,o,i,a,s,u,c,l,d,p,f,h,_,y;if(r(1)(r(24)(e),"commitRelayModernMutation: expect `environment` to be an instance of `RelayModernEnvironment`."),n=e.unstable_internal,o=n.createOperationSelector,i=n.getRequest,a=i(t.mutation),"mutation"!==a.operationKind)throw new Error("commitRelayModernMutation: Expected mutation operation");return s=t.optimisticResponse,u=t.optimisticUpdater,c=t.updater,l=t.configs,d=t.onError,p=t.variables,f=t.uploadables,h=o(a,p),"function"==typeof s&&(s=s(),r(5)(!1,"commitRelayModernMutation: Expected `optimisticResponse` to be an object, received a function.")),s&&a.fragment.selections&&1===a.fragment.selections.length&&"LinkedField"===a.fragment.selections[0].kind&&(_=a.fragment.selections[0].name,r(5)(s[_],"commitRelayModernMutation: Expected `optimisticResponse` to be wrapped in mutation name `%s`",_)),l&&(y=r(14).convert(l,a,u,c),u=y.optimisticUpdater,c=y.updater),e.executeMutation({operation:h,optimisticResponse:s,optimisticUpdater:u,updater:c,uploadables:f}).subscribeLegacy({onNext:function(r){var n,o=t.onCompleted;o&&(n=e.lookup(h.fragment),o(n.data,r.response.errors))},onError:d})}e.exports=n},function(e,t){"use strict";function r(e){return Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var n=e[t];n&&"object"==typeof n&&!Object.isFrozen(n)&&r(n)}),e}e.exports=r},function(e,t,r){"use strict";function n(e,t,n,o){var i,a,s,u,c;if(r(1)(e.unstable_internal,"fetchRelayModernQuery: Expected a valid Relay environment, got `%s`.",e),i=e.unstable_internal,a=i.createOperationSelector,s=i.getRequest,u=s(t),u.kind===r(3).BATCH_REQUEST)throw new Error("fetchRelayModernQuery: Batch request not supported in this API.");if("query"!==u.operationKind)throw new Error("fetchRelayModernQuery: Expected query operation");return c=a(u,n),e.execute({operation:c,cacheConfig:o}).map(function(){return e.lookup(c.fragment).data}).toPromise()}e.exports=n},function(e,t){"use strict";function r(e,t){var r,n=Object.keys(e.seenRecords);for(r=0;r<n.length;r++)if(t.hasOwnProperty(n[r]))return!0;return!1}e.exports=r},function(e,t){"use strict";function r(e){return!!e&&"function"==typeof e.then}e.exports=r},function(e,t){"use strict";function r(e,t){return e===t&&(null===e||"object"!=typeof e)}e.exports=r},function(e,t,r){"use strict";function n(e,t){var n,o,i,a,s,u,c,l,d=e.unstable_internal,p=d.createOperationSelector,f=d.getRequest,h=f(t.subscription);if("subscription"!==h.operationKind)throw new Error("requestRelaySubscription: Must use Subscription operation");return n=t.configs,o=t.onCompleted,i=t.onError,a=t.onNext,s=t.variables,u=p(h,s),r(5)(!(t.updater&&n),"requestRelaySubscription: Expected only one of `updater` and `configs` to be provided"),c=n?r(14).convert(n,h,null,t.updater):t,l=c.updater,e.execute({operation:u,updater:l,cacheConfig:{force:!0}}).map(function(){return e.lookup(u.fragment).data}).subscribeLegacy({onNext:a,onError:i,onCompleted:o})}e.exports=n},function(e,t,r){"use strict";function n(e){return Array.isArray(e)?e.map(n):e&&"object"==typeof e?r(63)(e,n):e}e.exports=n},function(e,t){e.exports=u},function(e,t){e.exports=c},function(e,t){e.exports=l},function(e,t){e.exports=d}])});
|
package/ARCHITECTURE.md
DELETED
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
# Relay Runtime
|
|
2
|
-
|
|
3
|
-
The Relay runtime is a full-featured GraphQL client that is designed for high performance even on low-end mobile devices and is capable of scaling to large, complex apps. The runtime API is not intended to be used directly in product code, but rather to provide a foundation for building higher-level product APIs such as React/Relay. This foundation includes:
|
|
4
|
-
|
|
5
|
-
- A normalized, in-memory object graph/cache.
|
|
6
|
-
- An optimized "write" operation for updating the cache with the results of queries/mutations/subscriptions.
|
|
7
|
-
- A mechanism for reading data from the cache and subscribing for updates when these results change due to a mutation, subscription update, etc.
|
|
8
|
-
- Garbage collection to evict entries from the cache when they can no longer be referenced by any view.
|
|
9
|
-
- A generic mechanism for intercepting data prior to publishing it to the cache and either synthesizing new data or merging new and existing data together (which among other things enables the creation of a variety of pagination schemes).
|
|
10
|
-
- Mutations with optimistic updates and the ability to update the cache with arbitrary logic.
|
|
11
|
-
- Support for live queries where supported by the network/server.
|
|
12
|
-
- Core primitives to enable subscriptions.
|
|
13
|
-
- Core primitives for building offline/persisted caching.
|
|
14
|
-
|
|
15
|
-
## Comparison to Classic Relay
|
|
16
|
-
|
|
17
|
-
For users of classic Relay, note that the runtime makes as few assumptions as possible about GraphQL. Compared to earlier versions of Relay there is no concept of routes, there are no limitations on mutation input arguments or side-effects, arbitrary root fields just work, etc. At present, the main restriction from classic Relay that remains is the use of the `Node` interface and `id` field for object identification. However there is no fundamental reason that this restriction can't be relaxed (there is a single place in the codebase where object identity is determined), and we welcome feedback from the community about ways to support customizable object identity without negatively impacting performance.
|
|
18
|
-
|
|
19
|
-
## Data Types
|
|
20
|
-
|
|
21
|
-
(subsequent sections explain how these types are used in practice):
|
|
22
|
-
|
|
23
|
-
- `DataID` (type): A globally unique or client-generated identifier for a record, stored as a string.
|
|
24
|
-
- `Record` (type): A representation of a distinct data entity with an identity, type, and fields. Note that the actual runtime representation is opaque to the system: all accesses to `Record` objects (including record creation) is mediated through the `RelayModernRecord` module. This allows the representation itself to be changed in a single place (e.g. to use `Map`s or a custom class). It is important that other code does not assume that `Record`s will always be plain objects.
|
|
25
|
-
- `RecordSource` (type): A collection of records keyed by their data ID, used both to represent the cache and updates to it. For example the store's record cache is a `RecordSource` and the results of queries/mutations/subscriptions are normalized into `RecordSource`s that are published to a store. Sources also define methods for asynchronously loading records in order to (eventually) support offline use-cases. Currently the only implementation of this interface is `RelayInMemoryRecordSource`; future implementations may add support for loading records from disk.
|
|
26
|
-
- `Store` (type): The source of truth for an instance of `RelayRuntime`, holding the canonical set of records in the form of a `RecordSource` (though this is not required). Currently the only implementation is `RelayMarkSweepStore`, the naming of which derives from its approach to garbage collection.
|
|
27
|
-
- `Network` (type): Provides methods for fetching query data from and executing mutations against an external data source.
|
|
28
|
-
- `Environment` (type): Represents an encapsulated environment combining a `Store` and `Network`, providing a high-level API for interacting with both. This is the main public API of `RelayRuntime`.
|
|
29
|
-
|
|
30
|
-
Types for working with queries and their results include:
|
|
31
|
-
|
|
32
|
-
- `Selector` (type): A selector defines the starting point for a traversal into the graph for the purposes of targeting a subgraph, combining a GraphQL fragment, variables, and the Data ID for the root object from which traversal should progress. Intuitively, this "selects" a portion of the object graph.
|
|
33
|
-
- `Snapshot` (type): The (immutable) results of executing a `Selector` at a given point in time. This includes the selector itself, the results of executing it, and a list of the Data IDs from which data was retrieved (useful in determining when these results might change).
|
|
34
|
-
|
|
35
|
-
## Data Model
|
|
36
|
-
|
|
37
|
-
Relay Runtime is designed for use with GraphQL schemas that describe **object graphs** in which objects have a type, an identity, and a set of fields with values. Objects may reference each other, which is represented by fields whose values are one or more other objects in the graph [1]. To distinguish from JavaScript `Object`s, these units of data are referred to as `Record`s. Relay represents both its internal cache as well as query/mutation/etc results as a mapping of **data ID**s to **records**. The data ID is the unique (with respect to the cache) identifier for a record - it may be the value of an actual `id` field or based on the path to the record from the nearest object with an `id` (such path-based ids are called **client ids**). Each `Record` stores its data ID, type, and any fields that have been fetched. Multiple records are stored together as a `RecordSource`: a mapping of data IDs to `Record` instances.
|
|
38
|
-
|
|
39
|
-
For example, a user and their address might be represented as follows:
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
// GraphQL Fragment
|
|
43
|
-
fragment on User {
|
|
44
|
-
id
|
|
45
|
-
name
|
|
46
|
-
address {
|
|
47
|
-
city
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Response
|
|
52
|
-
{
|
|
53
|
-
id: '842472',
|
|
54
|
-
name: 'Joe',
|
|
55
|
-
address: {
|
|
56
|
-
city: 'Seattle',
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Normalized Representation
|
|
61
|
-
RecordSource {
|
|
62
|
-
'842472': Record {
|
|
63
|
-
__id: '842472',
|
|
64
|
-
__typename: 'User', // the type is known statically from the fragment
|
|
65
|
-
id: '842472',
|
|
66
|
-
name: 'Joe',
|
|
67
|
-
address: {__ref: 'client:842472:address'}, // link to another record
|
|
68
|
-
},
|
|
69
|
-
'client:842472:address': Record {
|
|
70
|
-
// A client ID, derived from the path from parent & parent's ID
|
|
71
|
-
__id: 'client:842472:address',
|
|
72
|
-
__typename: 'Address',
|
|
73
|
-
city: 'Seattle',
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
[1] Note that GraphQL itself does not impose this constraint, and Relay Runtime may also be used for schemas that do not conform to it. For example, both systems can be used to query a single denormalized table. However, many of the features that Relay Runtime provides, such as caching and normalization, work best when the data is represented as a normalized graph with stable identities for discrete pieces of information.
|
|
79
|
-
|
|
80
|
-
### Store Operations
|
|
81
|
-
|
|
82
|
-
The `Store` is the source of truth for application data and provides the following core operations.
|
|
83
|
-
|
|
84
|
-
- `lookup(selector: Selector): Snapshot`: Reads the results of a selector from the store, returning the value given the data currently in the store.
|
|
85
|
-
|
|
86
|
-
- `subscribe(snapshot: Snapshot, callback: (snapshot: Snapshot) => void): Disposable`: Subscribe to changes to the results of a selector. The callback is called when data has been published to the store that would cause the results of the snapshot's selector to change.
|
|
87
|
-
|
|
88
|
-
- `publish(source: RecordSource): void`: Update the store with new information. All updates to the store are expressed in this form, including the results of queries/mutation/subscriptions as well as optimistic mutation updates. All of those operations internally create a new `RecordSource` instance and ultimately publish it to the store. Note that `publish()` does *not* immediately update any `subscribe()`-ers. Internally, the store compares the new `RecordSource` with its internal source, updating it as necessary:
|
|
89
|
-
- Records that exist only in the published source are added to the store.
|
|
90
|
-
- Records that exist in both are merged into a new record (inputs unchanged), with the result added to the store.
|
|
91
|
-
- Records that are null in the published source are deleted (set to null) in the store.
|
|
92
|
-
- Records with a special sentinel value are removed from the store. This supports un-publishing optimistically created records.
|
|
93
|
-
|
|
94
|
-
- `notify(): void`: Calls any `subscribe()`-ers whose results have changed due to intervening `publish()`-es. Separating `publish()` and `notify()` allows for multiple payloads to be published before performing any downstream update logic (such as rendering).
|
|
95
|
-
|
|
96
|
-
- `retain(selector: Selector): Disposable`: Ensure that all the records necessary to fulfill the given selector are retained in-memory. The records will not be eligible for garbage collection until the returned reference is disposed.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### Example Data Flow: Fetching Query Data
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
┌───────────────────────┐
|
|
104
|
-
│ Query │
|
|
105
|
-
└───────────────────────┘
|
|
106
|
-
│
|
|
107
|
-
▼
|
|
108
|
-
┌ ─ ─ ─ ┐
|
|
109
|
-
fetch ◀────────────▶ Server
|
|
110
|
-
└ ─ ─ ─ ┘
|
|
111
|
-
│
|
|
112
|
-
┌─────┴───────┐
|
|
113
|
-
▼ ▼
|
|
114
|
-
┌──────────┐ ┌──────────┐
|
|
115
|
-
│ Query │ │ Response │
|
|
116
|
-
└──────────┘ └──────────┘
|
|
117
|
-
│ │
|
|
118
|
-
└─────┬───────┘
|
|
119
|
-
│
|
|
120
|
-
▼
|
|
121
|
-
normalize
|
|
122
|
-
│
|
|
123
|
-
▼
|
|
124
|
-
┌───────────────────────┐
|
|
125
|
-
│ RecordSource │
|
|
126
|
-
│ │
|
|
127
|
-
│┌──────┐┌──────┐┌─────┐│
|
|
128
|
-
││Record││Record││ ... ││
|
|
129
|
-
│└──────┘└──────┘└─────┘│
|
|
130
|
-
└───────────────────────┘
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
1. The query is fetched from the network.
|
|
134
|
-
2. The query and response are traversed together, extracting the results into `Record` objects which are added to a fresh `RecordSource`.
|
|
135
|
-
|
|
136
|
-
This fresh `RecordSource` would then be published to the store:
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
publish
|
|
140
|
-
│
|
|
141
|
-
▼
|
|
142
|
-
┌───────────────────────────┐
|
|
143
|
-
│ Store │
|
|
144
|
-
│ ┌───────────────────────┐ │
|
|
145
|
-
│ │ RecordSource │ │
|
|
146
|
-
│ │ │ │
|
|
147
|
-
│ │┌ ─ ─ ─ ┌ ─ ─ ─ ┌ ─ ─ ┐│ │
|
|
148
|
-
│ │ Record│ Record│ ... │ │ <--- records are updated
|
|
149
|
-
│ │└ ─ ─ ─ └ ─ ─ ─ └ ─ ─ ┘│ │
|
|
150
|
-
│ └───────────────────────┘ │
|
|
151
|
-
│ ┌───────────────────────┐ │
|
|
152
|
-
│ │ Subscriptions │ │
|
|
153
|
-
│ │ │ │
|
|
154
|
-
│ │┌──────┐┌──────┐┌─────┐│ │
|
|
155
|
-
│ ││ Sub. ││ Sub. ││ ... ││ │ <--- subscriptions do not fire yet
|
|
156
|
-
│ │└──────┘└──────┘└─────┘│ │
|
|
157
|
-
│ └───────────────────────┘ │
|
|
158
|
-
└───────────────────────────┘
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Publishing the results updates the store but does *not* immediately notify any subscribers. This is accomplished by calling `notify()`...
|
|
162
|
-
|
|
163
|
-
```
|
|
164
|
-
notify
|
|
165
|
-
│
|
|
166
|
-
▼
|
|
167
|
-
┌───────────────────────────┐
|
|
168
|
-
│ Store │
|
|
169
|
-
│ ┌───────────────────────┐ │
|
|
170
|
-
│ │ RecordSource │ │
|
|
171
|
-
│ │ │ │
|
|
172
|
-
│ │┌──────┐┌──────┐┌─────┐│ │
|
|
173
|
-
│ ││Record││Record││ ... ││ │
|
|
174
|
-
│ │└──────┘└──────┘└─────┘│ │
|
|
175
|
-
│ └───────────────────────┘ │
|
|
176
|
-
│ ┌───────────────────────┐ │
|
|
177
|
-
│ │ Subscriptions │ │
|
|
178
|
-
│ │ │ │
|
|
179
|
-
│ │┌ ─ ─ ─ ┌ ─ ─ ─ ┌ ─ ─ ┐│ │
|
|
180
|
-
│ │ Sub. │ Sub. │ ... │ │ <--- affected subscriptions fire
|
|
181
|
-
│ │└ ─│─ ─ └ ─│─ ─ └ ─│─ ┘│ │
|
|
182
|
-
│ └───┼───────┼───────┼───┘ │
|
|
183
|
-
└─────┼───────┼───────┼─────┘
|
|
184
|
-
│ │ │
|
|
185
|
-
▼ │ │
|
|
186
|
-
callback │ │
|
|
187
|
-
▼ │
|
|
188
|
-
callback │
|
|
189
|
-
▼
|
|
190
|
-
callback
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
...which calls the callbacks for any `subscribe()`-ers whose results have changed. Each subscription is checked as follows:
|
|
194
|
-
|
|
195
|
-
1. First, the list of data IDs that have changed since the last `notify()` is compared against data IDs listed in the subscription's latest `Snapshot`. If there is no overlap, the subscription's results cannot possibly have changed (if you imagine the graph visually, there is no overlap between the part of the graph that changed and the part that is selected). In this case the subscription is ignored, otherwise processing continues.
|
|
196
|
-
2. Second, any subscriptions that do have overlapping data IDs are re-read, and the new/previous results are compared. If the result has not changed, the subscription is ignored (this can occur if a field of a record changed that is not relevant to the subscription's selector), otherwise processing continues.
|
|
197
|
-
3. Finally, subscriptions whose data actually changed are notified via their callback.
|
|
198
|
-
|
|
199
|
-
### Example Data Flow: Reading and Observing the Store
|
|
200
|
-
|
|
201
|
-
Products access the store primarily via `lookup()` and `subscribe()`. Lookup reads the initial results of a fragment, and subscribe observes that result for any changes. Note that the output of `lookup()` - a `Snapshot` - is the input to `subscribe()`. This is important because the snapshot contains important information that can be used to optimize the subscription - if `subscribe()` accepted only a `Selector`, it would have to re-read the results in order to know what to subscribe to, which is less efficient.
|
|
202
|
-
|
|
203
|
-
Therefore a typical data flow is as follows - note that this flow is managed automatically by higher-level APIs such as React/Relay. First a component will lookup the results of a selector against a record source (e.g. the store's canonical source):
|
|
204
|
-
|
|
205
|
-
```
|
|
206
|
-
┌───────────────────────┐ ┌──────────────┐
|
|
207
|
-
│ RecordSource │ │ │
|
|
208
|
-
│ │ │ │
|
|
209
|
-
│┌──────┐┌──────┐┌─────┐│ │ Selector │
|
|
210
|
-
││Record││Record││ ... ││ │ │
|
|
211
|
-
│└──────┘└──────┘└─────┘│ │ │
|
|
212
|
-
└───────────────────────┘ └──────────────┘
|
|
213
|
-
│ │
|
|
214
|
-
│ │
|
|
215
|
-
└──────────────┬────────────┘
|
|
216
|
-
│
|
|
217
|
-
│ lookup
|
|
218
|
-
│ (read)
|
|
219
|
-
│
|
|
220
|
-
▼
|
|
221
|
-
┌─────────────┐
|
|
222
|
-
│ │
|
|
223
|
-
│ Snapshot │
|
|
224
|
-
│ │
|
|
225
|
-
└─────────────┘
|
|
226
|
-
│
|
|
227
|
-
│ render, etc
|
|
228
|
-
│
|
|
229
|
-
▼
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
Next, it will `subscribe()` using this snapshot in order to be notified of any changes - see the above diagram for `publish()` and `notify()`.
|