{"version":3,"sources":["webpack:///./node_modules/recoil/es/recoil.js"],"names":["_marked","mark","concatIterables","_marked2","filterIterable","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","from","test","_unsupportedIterableToArray","length","i","F","s","done","value","e","_e","f","TypeError","err","normalCompletion","didErr","step","next","_e2","return","arr","len","arr2","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","arguments","source","forEach","key","getOwnPropertyDescriptors","defineProperties","defineProperty","_createSuper","Derived","hasNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","result","Super","NewTarget","this","gks","Map","Recoil_gkx","gk","_gks$get","get","setPass","set","setFail","Recoil_gkx_1","Recoil_mapMap","map","callback","Recoil_nullthrows","x","message","Error","Recoil_recoverableViolation","projectName","_ref2","undefined","error","Recoil_Tracing","trace","node","fn","wrap","Recoil_CopyOnWrite","v","Set","add","k","delete","ks","Recoil_expectationViolation","format","_defineProperty","obj","configurable","writable","AbstractRecoilValue","newKey","RecoilState","_AbstractRecoilValue","_super","RecoilValueReadOnly","_AbstractRecoilValue2","_super2","Recoil_RecoilValue","isRecoilValue","Recoil_RecoilValue_1","Recoil_RecoilValue_2","Recoil_RecoilValue_3","Recoil_RecoilValue_4","Recoil_RecoilValue$1","freeze","__proto__","DefaultValue","DEFAULT_VALUE","RecoilValueNotReady","_Error","_super3","concat","nodes","recoilValues","NodeMissingError","_Error2","_super4","Recoil_Node","registerNode","has","console","warn","recoilValue","getNode","getNodeMaybe","mapByDeletingFromMap$1","mapBySettingInMap$1","setByAddingToSet$1","getNode$1","getNodeMaybe$1","emptySet","ReadOnlyRecoilValueError","_Error3","_super5","Recoil_FunctionalCore","store","state","peek","newValue","cleanUp","_node$invalidate","invalidate","atomValues","nonvalidatedAtoms","dirtyAtoms","visitedNodes","visitingNodes","graph","getGraph","version","pop","_graph$nodeToNodeSubs","_step","_iterator","nodeToNodeSubscriptions","downstreamNode","Recoil_differenceSets","ret","_len3","setsWithValuesToRemove","_key3","_step2","_iterator2","FIRST","_step3","_iterator3","otherSet","mergeDependencyMapIntoGraph","deps","olderGraph","nodeDeps","upstreams","downstream","existingUpstreams","upstream","existing","size","Recoil_Graph","dependencyMap","into","upstreamDeps","dep","_storeState$nextTree","_storeState$previousT","_storeState$previousT2","_storeState$previousT3","storeState","getState","currentTree","nextTree","previousTree","_storeState$nextTree2","nextVersion","getDownstreamNodes$1","getNodeLoadable$1","setNodeValue$1","saveDependencyMapToStore$1","getNodeMaybe$2","DefaultValue$1","RecoilValueNotReady$1","AbstractRecoilValue$1","RecoilState$1","RecoilValueReadOnly$1","isRecoilValue$1","applyAction","action","type","_ref4","valueOrUpdater","current","contents","valueFromValueOrUpdater","_setNodeValue$","_setNodeValue$2","depMap","writes","_step4","_iterator4","entries","_step4$value","writeLoadableToTreeState","loadable","_key5","_key6","unvalidatedValue","applyActionsToStore","actions","replaceState","_step5","newState","copyTreeState","_iterator5","invalidateDownstreams","queueOrPerformStateUpdate","batchStack","actionsByStore","_step7","_iterator7","_getNodeMaybe","_getNodeMaybe$invalid","setRecoilValue","subscriptionID","Recoil_RecoilValueInterface","getRecoilValueAsLoadable","_ref3","treeState","_getNodeLoadable$","_getNodeLoadable$2","setRecoilValueLoadable","markRecoilValueModified","setUnvalidatedRecoilValue","subscribeToRecoilValue","_ref5","componentDebugName","subID","nodeToComponentSubscriptions","release","subs","applyAtomValueWrites","batchStart","_step6","_iterator6","_loop","_step6$value","invalidateDownstreams_FOR_TESTING","unstable_batchedUpdates","batchStart$1","batcher","Recoil_Batching","newBatcher","batchEnd","Recoil_Queue","enqueueExecution","iters","_iterator8","_step8","iter","_iterator9","_step9","val","_context","prev","t0","finish","t1","stop","Recoil_concatIterables","iterable","predicate","index","_iterator10","_step10","_context2","Recoil_filterIterable","Recoil_mapIterable","_callee","_iterator11","_step11","_context3","graph$1","nextTreeStateVersion","getNextTreeStateVersion","makeEmptyTreeState","stateID","transactionMetadata","Recoil_State","knownAtoms","knownSelectors","transactionSubscriptions","nodeTransactionSubscriptions","queuedComponentCallbacks_DEPRECATED","suspendedComponentResolvers","graphsByVersion","versionsUsedByComponent","batchUpdates$1","getDownstreamNodes$2","peekNodeLoadable$1","graph$2","DEFAULT_VALUE$1","recoilValues$1","getRecoilValueAsLoadable$1","setRecoilValue$1","getNextTreeStateVersion$1","makeEmptyStoreState$1","recoilValuesForKeys","Snapshot","_this","_store","getLoadable","toPromise","opt","isModified","isInitialized","values","_ref6","_ref7","nodeKey","_graph$nodeDeps$get","isActive","isSet","subscribers","getSubscribers_UNSTABLE","mapper","mutableSnapshot","MutableSnapshot","cloneSnapshot","getStore_INTERNAL","_ref8","_callee2","_context4","abrupt","_x","replacer","graphs","newGraph","subscribeToTransactions","addTransactionMetadata","getID_INTERNAL","cloneStoreState","bumpVersion","_Snapshot","_super6","snapshot","_this2","recoilState","newValueOrUpdater","Recoil_Snapshot","freshSnapshot","initializeState","Recoil_Snapshot_1","Recoil_Snapshot_2","Recoil_Snapshot_3","Recoil_Snapshot_4","Recoil_Snapshot$1","Recoil_unionSets","_len4","sets","_key7","_i","_sets","_step12","_iterator12","useContext","useEffect","useMemo","useRef","useState","cleanUpNode$1","getDownstreamNodes$3","setNodeValue$2","setUnvalidatedAtomValue_DEPRECATED$1","graph$3","saveDependencyMapToStore$2","cloneGraph$1","applyAtomValueWrites$1","freshSnapshot$1","getNextTreeStateVersion$2","makeEmptyStoreState$2","mapByDeletingMultipleFromMap$1","notInAContext","defaultStore","stateReplacerIsBeingExecuted","startNextTreeIfNeeded","AppContext","createContext","useStoreRef","MutableSourceContext","sendEndOfBatchNotifications","_step13","_iterator13","_step13$value","subscriptions","_step16","_iterator16","_step16$value","subscription","_step14","_iterator14","_step14$value","_subscription","_step15","_iterator15","_key8","comps","_step17","_iterator17","_step17$value","_step17$value$","cb","splice","Batcher","props","storeRef","_useState","_useState2","setState","setNotifyBatcherOfChange","discardedVersion","nextID","Recoil_RecoilRoot_react","_ref9","_createMutableSource","initializeState_DEPRECATED","storeProp","store_INTERNAL","children","notifyBatcherOfChange","createMutableSource","unstable_createMutableSource","replaced","id","_id2","metadata","_i2","_Object$keys","initial","atom","_setNodeValue$3","_setNodeValue$4","writtenNodes","setUnvalidatedAtomValues","initialStoreState_DEPRECATED","initialStoreState","mutableSource","_step18","_iterator18","atomKey","createElement","Provider","Recoil_filterMap","_step19","_iterator19","_step19$value","Recoil_filterSet","_step20","_iterator20","Recoil_invariant","condition","_useMutableSource","Recoil_mergeMaps","_len5","maps","_key9","nextKey","useMutableSource","unstable_useMutableSource","Recoil_mutableSource","mutableSourceExists","window","$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE","useRef$1","Recoil_useComponentName","useCallback","useEffect$1","useState$1","batchUpdates$2","DEFAULT_VALUE$2","getNode$2","nodes$1","useRecoilMutableSource$1","useStoreRef$1","AbstractRecoilValue$2","getRecoilValueAsLoadable$2","setRecoilValue$2","setRecoilValueLoadable$1","setUnvalidatedRecoilValue$1","subscribeToRecoilValue$1","cloneSnapshot$1","mutableSourceExists$1","useMutableSource$1","handleLoadable","Promise","resolve","useRecoilValueLoadable","getValue","componentName","subscribe","_something","sub","useRecoilValueLoadable_MUTABLESOURCE","_useState$3","_useState$4","forceUpdate","_state","useRecoilValueLoadable_LEGACY","useRecoilValue","useSetRecoilState","useTransactionSubscription","externallyVisibleAtomValuesInState","persistedAtomContentsValues","persistence","persistence_UNSTABLE","useGotoRecoilSnapshot","keysToUpdate","_i3","_arr","_step22","_iterator22","_prev$atomValues$get","_next$atomValues$get","shouldRestoreFromSnapshots","Sentinel","SENTINEL","Recoil_Hooks","gotoSnapshot","_len6","args","_key10","reset","_useState$5","_useState$6","setSnapshot","previousSnapshot","previousAtomValues","atomInfo","_node$persistence_UNS","_node$persistence_UNS2","_node$persistence_UNS3","_node$persistence_UNS4","backButton","modifiedAtoms","useMemo$2","RecoilRoot$1","useStoreRef$2","Recoil_useRecoilBridgeAcrossReactRoots","_ref10","Recoil_isPromise","p","then","loadableAccessors","_ref11","__value","reject","_ref12","valueMaybe","valueOrThrow","errorMaybe","errorOrThrow","promiseMaybe","_ref13","promiseOrThrow","_ref14","_map","_this3","loadableWithPromise","loadableWithValue","loadableWithError","catch","promise","Recoil_Loadable","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","DataView","navigator","product","Recoil_cacheMostRecent","mostRecentKey","mostRecentValue","cache","LEAF","emptyMap","Recoil_ArrayKeyedMap_1","ArrayKeyedMap","_step24","_iterator24","_step24$value","_step25","_iterator25","_step25$value","_k","_v","_base","_map$get","answer","recurse","level","prefix","ArrayKeyedMap$1","Recoil_cacheWithReferenceEquality","stringify","includes","String","JSON","allowFunctions","_JSON$stringify","toJSON","_step26","_iterator26","_step26$value","sort","a","b","localeCompare","join","Recoil_stableStringify","Recoil_cacheWithValueEquality","Recoil_nodeCacheMostRecent","mostRecent","getNodeValue","handlers","_step27","_iterator27","route","_handlers$onCacheHit","_step27$value","nodeValue","onCacheHit","getRoot","Recoil_TreeNodeCache","setInTreeCache","root","_route","path","rest","_path","branches","_route2","_path2","_rest","_path3","_nodeKey","_value","getFromTreeCache","getFromTreeCache$1","setInTreeCache$1","Recoil_treeCacheReferenceEquality","treeRoot","getFromTreeCache$2","setInTreeCache$2","Recoil_treeCacheValueEquality","_ref15","_ref16","executionId","Recoil_PerformanceTimings","_id","loadableWithError$1","loadableWithPromise$1","loadableWithValue$1","getNodeLoadable$2","peekNodeLoadable$2","setNodeValue$3","saveDependencyMapToStore$3","DEFAULT_VALUE$3","RecoilValueNotReady$2","registerNode$1","isRecoilValue$3","AbstractRecoilValue$3","setRecoilValueLoadable$2","startPerfBlock$1","emptySet$1","dependencyStack","waitingStores","getNewExecutionId","Recoil_selector_NEW","options","cacheImplementation","cacheImplementation_UNSTABLE","executionInfo","depValuesDiscoveredSoFarDuringAsyncWork","latestLoadable","latestExecutionId","stateVersion","initSelector","notifyStoreWhenAsyncSettles","stores","getCachedNodeLoadable","_getNodeLoadable$3","isKeyPointingToSelector","wrapPendingDependencyPromise","existingDeps","resolvedDep","resolvedDepKey","__key","depValue","_evaluateSelectorGett","evaluateSelectorGetter","_evaluateSelectorGett2","depValues","isLatestExecution","updateExecutionInfoDepValues","maybeFreezeLoadableContents","setCache","depValuesToDepRoute","setLoadableInStoreToNotifyDeps","maybeFreezeValue","setExecutionInfo","newLoadable","_step28","_iterator28","notifyStoresOfSettledAsync","setDepsInStore","_store$getState","_store$getState$curre","_store$getState2","_store$getState2$next","_store$getState$nextT","_store$getState3","_store$getState3$next","setNewDepInStore","newDepKey","endPerfBlock","getRecoilValue","depKey","_getCachedNodeLoadabl","depLoadable","errorOrPromise","wrapPendingPromise","finally","errorOrDepPromise","_ref17","_ref18","getValFromRunningNewExecutionAndUpdatedDeps","newExecutionId","_evaluateSelectorGett3","_evaluateSelectorGett4","newDepValues","depRoute","maybeSetCacheWithLoadable","getSelectorValAndUpdatedDeps","cachedVal","_store$getGraph$nodeD","_getCachedNodeLoadabl3","getValFromCacheAndUpdatedDownstreamDeps","_executionInfo$depVal","_mapOfCheckedVersions","oldDepValues","cachedDepValuesCheckedForThisVersion","mapOfCheckedVersions","isCachedVersionSame","every","_ref19","_ref20","nodeVal","some","_ref21","_ref22","oldVal","_getCachedNodeLoadabl5","haveAsyncDepsChanged","asyncWorkIsInProgressAndDepsDiscoveredHaveNotChanged","cacheRoute","detectCircularDependencies","indexOf","myPeek","myGet","_ref23","_getCachedNodeLoadabl7","setRecoilState","_setNodeValue$5","dangerouslyAllowMutability","loadableWithError$2","loadableWithPromise$2","loadableWithValue$2","getNodeLoadable$3","peekNodeLoadable$3","setNodeValue$4","addToDependencyMap$1","mergeDepsIntoDependencyMap$1","saveDependencyMapToStore$4","DEFAULT_VALUE$4","RecoilValueNotReady$3","registerNode$2","AbstractRecoilValue$4","getRecoilValueAsLoadable$3","isRecoilValue$4","setRecoilValueLoadable$3","startPerfBlock$2","emptySet$2","cacheKeyFromDepValues","_step29","_iterator29","waitingStores$1","Recoil_selector_OLD","letStoreBeNotifiedWhenAsyncSettles","originalLoadable","_step30","_iterator30","getFromCacheOrEvaluate","currentDeps","cacheKey","_getNodeLoadable$5","_getNodeLoadable$6","cached","_evaluateSelectorFunc","_ref24","_getNodeLoadable$7","_getNodeLoadable$8","output","_loadable2","evaluateSelectorFunction","_evaluateSelectorFunc2","newCacheKey","putIntoCache","_store$getGraph$nodeD2","_step31","cacheDepValues","_iterator31","_step31$value","_ref25","_getNodeLoadable$9","_getNodeLoadable$10","_setNodeValue$7","_setNodeValue$8","upstreamWrites","Recoil_selector","loadableWithError$3","loadableWithPromise$3","loadableWithValue$3","DEFAULT_VALUE$5","DefaultValue$2","registerNode$3","isRecoilValue$5","markRecoilValueModified$1","setRecoilValue$3","setRecoilValueLoadable$4","baseAtom","defaultLoadable","default","cachedAnswerForUnvalidatedValue","cleanupEffectsByStore","initAtom","initState","trigger","notifyDefaultSubscribers","_store$getState$nextT3","initValue","pendingSetSelf","effects_UNSTABLE","_step32","duringInit","setSelf","effect","currentValue","resetSelf","onSet","handler","currentStore","_pendingSetSelf3","_currentStore$getStat","_previousTree$atomVal","_pendingSetSelf","_pendingSetSelf2","oldLoadable","oldValue","_iterator32","_options$effects_UNST","cleanup","wrappedPromise","_state$atomValues$get","_store$getState$nextT2","_state$atomValues$get2","_ref","_state$atomValues$get3","_cachedAnswerForUnval","nonvalidatedValue","validatorResult","validator","validatedValueLoadable","_cleanupEffectsByStor","optionsDefault","restOptions","base","storedValue","_ref26","baseValue","_get","_ref27","_set","atomWithFallback","Recoil_atom","nextIndex","Recoil_selectorFamily","_options$cacheImpleme","_options$cacheImpleme2","selectorCache","cacheImplementationForParams_UNSTABLE","params","_stableStringify","_options$cacheImpleme3","cachedSelector","newSelector","myKey","callbacks","myCacheImplementation","DEFAULT_VALUE$6","DefaultValue$3","Recoil_atomFamily","legacyAtom","atomCache","legacyAtomOptions","atomFamilyDefault","param","_ref28","legacyValue","cachedAtom","newAtom","constantSelector","constant","Recoil_constSelector","throwingSelector","Recoil_errorSelector","Recoil_readOnlySelector","loadableWithError$4","loadableWithPromise$4","loadableWithValue$4","concurrentRequests","_step33","results","fill","exceptions","_iterator33","_step33$value","isError","exp","unwrapDependencies","dependencies","getOwnPropertyNames","getValueFromLoadablePromiseResult","hasOwnProperty","wrapResults","reduce","out","idx","wrapLoadables","exception","Recoil_WaitFor","waitForNone","_ref29","_concurrentRequests","_concurrentRequests2","waitForAny","_ref30","_concurrentRequests3","_concurrentRequests4","find","_step34","_iterator34","_loop2","_step34$value","_step35","_iterator35","_loop3","_step35$value","waitForAll","_ref31","_concurrentRequests5","_concurrentRequests6","all","exceptionResults","syncResults","asyncResults","noWait","dependency","_ref32","batchUpdates$3","setBatcher$1","DefaultValue$4","RecoilRoot$2","isRecoilValue$6","freshSnapshot$2","Recoil_index","RecoilRoot","useRecoilBridgeAcrossReactRoots_UNSTABLE","selector","atomFamily","selectorFamily","constSelector","errorSelector","readOnlySelector","useRecoilState","useRecoilStateLoadable","useResetRecoilState","useRecoilCallback","useRecoilSnapshot","useRecoilTransactionObserver_UNSTABLE","useTransactionObservation_UNSTABLE","useSetUnvalidatedAtomValues_UNSTABLE","batchUpdates","setBatcher","snapshot_UNSTABLE","Recoil_index_2","Recoil_index_4","Recoil_index_13"],"mappings":"4FAAA,8VAiBIA,EAAuB,IAAoBC,KAAKC,IAChDC,EAAwB,IAAoBF,KAAKG,IAErD,SAASC,EAA2BC,EAAGC,GAAkB,IAAIC,EAAuB,oBAAXC,QAA0BH,EAAEG,OAAOC,WAAaJ,EAAE,cAAe,IAAKE,EAAI,CAAE,GAAIG,MAAMC,QAAQN,KAAOE,EAE9K,SAAqCF,EAAGO,GAAU,IAAKP,EAAG,OAAQ,GAAiB,iBAANA,EAAgB,OAAOQ,EAAkBR,EAAGO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eC,YAkCjCI,WAnCiBL,GAAeK,WAoChCa,WArCiBlB,GAAekB,WAuChC53B,cAAe24B,GAEfmB,aAAcvB,GACdwB,WAAYvB,GAEZwB,kBAAmBpB,IAGjBqB,GAAiBpB,GAAaC,WAE9BoB,GAAiBrB,GAAaviB,KAS9B6jB,GAAkBtB,GAAaS","file":"0a301732-4f082570d1c5918d07c6.js","sourcesContent":["import \"core-js/modules/es.promise.finally\";\nimport _objectWithoutProperties from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _toArray from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/toArray\";\nimport _toConsumableArray from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport _assertThisInitialized from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _asyncToGenerator from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _createClass from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport _regeneratorRuntime from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/regenerator\";\nimport \"regenerator-runtime/runtime\";\nimport _slicedToArray from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/slicedToArray\";\nimport _defineProperty2 from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport _wrapNativeSuper from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper\";\nimport _inherits from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _classCallCheck from \"/home/vsts/work/1/s/packages/website/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\n\nvar _marked = /*#__PURE__*/_regeneratorRuntime.mark(concatIterables),\n _marked2 = /*#__PURE__*/_regeneratorRuntime.mark(filterIterable);\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nimport reactDom from 'react-dom';\nimport react from 'react';\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nvar gks = new Map();\n\nfunction Recoil_gkx(gk) {\n var _gks$get;\n\n return (_gks$get = gks.get(gk)) !== null && _gks$get !== void 0 ? _gks$get : false;\n}\n\nRecoil_gkx.setPass = function (gk) {\n gks.set(gk, true);\n};\n\nRecoil_gkx.setFail = function (gk) {\n gks.set(gk, false);\n};\n\nvar Recoil_gkx_1 = Recoil_gkx; // @oss-only\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n/**\n * Returns a new Map object with the same keys as the original, but with the\n * values replaced with the output of the given callback function.\n */\n\nfunction mapMap(map, callback) {\n var result = new Map();\n map.forEach(function (value, key) {\n result.set(key, callback(value, key));\n });\n return result;\n}\n\nvar Recoil_mapMap = mapMap;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction nullthrows(x, message) {\n if (x != null) {\n return x;\n }\n\n throw new Error(message !== null && message !== void 0 ? message : 'Got unexpected null or undefined');\n}\n\nvar Recoil_nullthrows = nullthrows;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction recoverableViolation(message, projectName) {\n var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n error = _ref2.error;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(message, error);\n }\n\n return null;\n}\n\nvar recoverableViolation_1 = recoverableViolation; // @oss-only\n\nvar Recoil_recoverableViolation = recoverableViolation_1;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Interface for `scheduler/tracing` to aid in profiling Recoil and Recoil apps.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n// flowlint-next-line untyped-import:off\n// @fb-only: const SchedulerTracing = require('SchedulerTracing');\n\nfunction trace(message, node, fn) {\n // prettier-ignore\n // @fb-only: if (__DEV__) {\n // prettier-ignore\n // @fb-only: if (\n // prettier-ignore\n // @fb-only: SchedulerTracing.unstable_trace !== undefined &&\n // prettier-ignore\n // @fb-only: window.performance !== undefined\n // prettier-ignore\n // @fb-only: ) {\n // prettier-ignore\n // @fb-only: return SchedulerTracing.unstable_trace(\n // prettier-ignore\n // @fb-only: `Recoil: ${message} for node: ${\n // prettier-ignore\n // @fb-only: typeof node === 'string' ? node : node.key\n // prettier-ignore\n // @fb-only: }`,\n // prettier-ignore\n // @fb-only: window.performance.now(),\n // prettier-ignore\n // @fb-only: fn,\n // prettier-ignore\n // @fb-only: );\n // prettier-ignore\n // @fb-only: }\n // prettier-ignore\n // @fb-only: }\n return fn();\n}\n\nfunction wrap(fn) {\n // prettier-ignore\n // @fb-only: if (__DEV__) {\n // prettier-ignore\n // @fb-only: if (SchedulerTracing.unstable_wrap !== undefined) {\n // prettier-ignore\n // @fb-only: return SchedulerTracing.unstable_wrap(fn);\n // prettier-ignore\n // @fb-only: }\n // prettier-ignore\n // @fb-only: }\n return fn;\n}\n\nvar Recoil_Tracing = {\n trace: trace,\n wrap: wrap\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Utilities for working with built-in Maps and Sets without mutating them.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction setByAddingToSet(set, v) {\n var next = new Set(set);\n next.add(v);\n return next;\n}\n\nfunction setByDeletingFromSet(set, v) {\n var next = new Set(set);\n next.delete(v);\n return next;\n}\n\nfunction mapBySettingInMap(map, k, v) {\n var next = new Map(map);\n next.set(k, v);\n return next;\n}\n\nfunction mapByUpdatingInMap(map, k, updater) {\n var next = new Map(map);\n next.set(k, updater(next.get(k)));\n return next;\n}\n\nfunction mapByDeletingFromMap(map, k) {\n var next = new Map(map);\n next.delete(k);\n return next;\n}\n\nfunction mapByDeletingMultipleFromMap(map, ks) {\n var next = new Map(map);\n ks.forEach(function (k) {\n return next.delete(k);\n });\n return next;\n}\n\nvar Recoil_CopyOnWrite = {\n setByAddingToSet: setByAddingToSet,\n setByDeletingFromSet: setByDeletingFromSet,\n mapBySettingInMap: mapBySettingInMap,\n mapByUpdatingInMap: mapByUpdatingInMap,\n mapByDeletingFromMap: mapByDeletingFromMap,\n mapByDeletingMultipleFromMap: mapByDeletingMultipleFromMap\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction sprintf(format) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var index = 0;\n return format.replace(/%s/g, function () {\n return String(args[index++]);\n });\n}\n\nvar sprintf_1 = sprintf;\n\nfunction expectationViolation(format) {\n if (process.env.NODE_ENV !== \"production\") {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n var message = sprintf_1.call.apply(sprintf_1, [null, format].concat(args));\n var error = new Error(message);\n error.name = 'Expectation Violation';\n console.error(error);\n }\n}\n\nvar expectationViolation_1 = expectationViolation; // @oss-only\n\nvar Recoil_expectationViolation = expectationViolation_1;\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n// eslint-disable-next-line no-unused-vars\n\n\nvar AbstractRecoilValue = function AbstractRecoilValue(newKey) {\n _classCallCheck(this, AbstractRecoilValue);\n\n _defineProperty(this, \"key\", void 0);\n\n this.key = newKey;\n};\n\nvar RecoilState = /*#__PURE__*/function (_AbstractRecoilValue) {\n _inherits(RecoilState, _AbstractRecoilValue);\n\n var _super = _createSuper(RecoilState);\n\n function RecoilState() {\n _classCallCheck(this, RecoilState);\n\n return _super.apply(this, arguments);\n }\n\n return RecoilState;\n}(AbstractRecoilValue);\n\nvar RecoilValueReadOnly = /*#__PURE__*/function (_AbstractRecoilValue2) {\n _inherits(RecoilValueReadOnly, _AbstractRecoilValue2);\n\n var _super2 = _createSuper(RecoilValueReadOnly);\n\n function RecoilValueReadOnly() {\n _classCallCheck(this, RecoilValueReadOnly);\n\n return _super2.apply(this, arguments);\n }\n\n return RecoilValueReadOnly;\n}(AbstractRecoilValue);\n\nfunction isRecoilValue(x) {\n return x instanceof RecoilState || x instanceof RecoilValueReadOnly;\n}\n\nvar Recoil_RecoilValue = {\n AbstractRecoilValue: AbstractRecoilValue,\n RecoilState: RecoilState,\n RecoilValueReadOnly: RecoilValueReadOnly,\n isRecoilValue: isRecoilValue\n};\nvar Recoil_RecoilValue_1 = Recoil_RecoilValue.AbstractRecoilValue;\nvar Recoil_RecoilValue_2 = Recoil_RecoilValue.RecoilState;\nvar Recoil_RecoilValue_3 = Recoil_RecoilValue.RecoilValueReadOnly;\nvar Recoil_RecoilValue_4 = Recoil_RecoilValue.isRecoilValue;\nvar Recoil_RecoilValue$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n AbstractRecoilValue: Recoil_RecoilValue_1,\n RecoilState: Recoil_RecoilValue_2,\n RecoilValueReadOnly: Recoil_RecoilValue_3,\n isRecoilValue: Recoil_RecoilValue_4\n});\n\nvar DefaultValue = function DefaultValue() {\n _classCallCheck(this, DefaultValue);\n};\n\nvar DEFAULT_VALUE = new DefaultValue();\n\nvar RecoilValueNotReady = /*#__PURE__*/function (_Error) {\n _inherits(RecoilValueNotReady, _Error);\n\n var _super3 = _createSuper(RecoilValueNotReady);\n\n function RecoilValueNotReady(key) {\n _classCallCheck(this, RecoilValueNotReady);\n\n return _super3.call(this, \"Tried to set the value of Recoil selector \".concat(key, \" using an updater function, but it is an async selector in a pending or error state; this is not supported.\"));\n }\n\n return RecoilValueNotReady;\n}( /*#__PURE__*/_wrapNativeSuper(Error)); // flowlint-next-line unclear-type:off\n\n\nvar nodes = new Map(); // flowlint-next-line unclear-type:off\n\nvar recoilValues = new Map();\n/* eslint-disable no-redeclare */\n\nfunction registerNode(node) {\n if (nodes.has(node.key)) {\n var message = \"Duplicate atom key \\\"\".concat(node.key, \"\\\". This is a FATAL ERROR in\\n production. But it is safe to ignore this warning if it occurred because of\\n hot module replacement.\"); // TODO Need to figure out if there is a standard/open-source equivalent to see if hot module replacement is happening:\n // prettier-ignore\n // @fb-only: if (__DEV__) {\n // @fb-only: const isAcceptingUpdate = require('__debug').isAcceptingUpdate;\n // prettier-ignore\n // @fb-only: if (typeof isAcceptingUpdate !== 'function' || !isAcceptingUpdate()) {\n // @fb-only: expectationViolation(message, 'recoil');\n // @fb-only: }\n // prettier-ignore\n // @fb-only: } else {\n // @fb-only: recoverableViolation(message, 'recoil');\n // @fb-only: }\n\n console.warn(message); // @oss-only\n }\n\n nodes.set(node.key, node);\n var recoilValue = node.set == null ? new Recoil_RecoilValue$1.RecoilValueReadOnly(node.key) : new Recoil_RecoilValue$1.RecoilState(node.key);\n recoilValues.set(node.key, recoilValue);\n return recoilValue;\n}\n/* eslint-enable no-redeclare */\n\n\nvar NodeMissingError = /*#__PURE__*/function (_Error2) {\n _inherits(NodeMissingError, _Error2);\n\n var _super4 = _createSuper(NodeMissingError);\n\n function NodeMissingError() {\n _classCallCheck(this, NodeMissingError);\n\n return _super4.apply(this, arguments);\n }\n\n return NodeMissingError;\n}( /*#__PURE__*/_wrapNativeSuper(Error)); // flowlint-next-line unclear-type:off\n\n\nfunction getNode(key) {\n var node = nodes.get(key);\n\n if (node == null) {\n throw new NodeMissingError(\"Missing definition for RecoilValue: \\\"\".concat(key, \"\\\"\\\"\"));\n }\n\n return node;\n} // flowlint-next-line unclear-type:off\n\n\nfunction getNodeMaybe(key) {\n return nodes.get(key);\n}\n\nvar Recoil_Node = {\n nodes: nodes,\n recoilValues: recoilValues,\n registerNode: registerNode,\n getNode: getNode,\n getNodeMaybe: getNodeMaybe,\n NodeMissingError: NodeMissingError,\n DefaultValue: DefaultValue,\n DEFAULT_VALUE: DEFAULT_VALUE,\n RecoilValueNotReady: RecoilValueNotReady\n};\nvar mapByDeletingFromMap$1 = Recoil_CopyOnWrite.mapByDeletingFromMap,\n mapBySettingInMap$1 = Recoil_CopyOnWrite.mapBySettingInMap,\n setByAddingToSet$1 = Recoil_CopyOnWrite.setByAddingToSet;\nvar getNode$1 = Recoil_Node.getNode,\n getNodeMaybe$1 = Recoil_Node.getNodeMaybe; // flowlint-next-line unclear-type:off\n\nvar emptySet = Object.freeze(new Set());\n\nvar ReadOnlyRecoilValueError = /*#__PURE__*/function (_Error3) {\n _inherits(ReadOnlyRecoilValueError, _Error3);\n\n var _super5 = _createSuper(ReadOnlyRecoilValueError);\n\n function ReadOnlyRecoilValueError() {\n _classCallCheck(this, ReadOnlyRecoilValueError);\n\n return _super5.apply(this, arguments);\n }\n\n return ReadOnlyRecoilValueError;\n}( /*#__PURE__*/_wrapNativeSuper(Error)); // Get the current value loadable of a node and update the state.\n// Update dependencies and subscriptions for selectors.\n// Update saved value validation for atoms.\n\n\nfunction getNodeLoadable(store, state, key) {\n return getNode$1(key).get(store, state);\n} // Peek at the current value loadable for a node without any evaluation or state change\n\n\nfunction peekNodeLoadable(store, state, key) {\n return getNode$1(key).peek(store, state);\n} // Write value directly to state bypassing the Node interface as the node\n// definitions may not have been loaded yet when processing the initial snapshot.\n\n\nfunction setUnvalidatedAtomValue_DEPRECATED(state, key, newValue) {\n var _node$invalidate;\n\n var node = getNodeMaybe$1(key);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n return _objectSpread(_objectSpread({}, state), {}, {\n atomValues: mapByDeletingFromMap$1(state.atomValues, key),\n nonvalidatedAtoms: mapBySettingInMap$1(state.nonvalidatedAtoms, key, newValue),\n dirtyAtoms: setByAddingToSet$1(state.dirtyAtoms, key)\n });\n} // Return the discovered dependencies and values to be written by setting\n// a node value. (Multiple values may be written due to selectors getting to\n// set upstreams; deps may be discovered because of reads in updater functions.)\n\n\nfunction setNodeValue(store, state, key, newValue) {\n var node = getNode$1(key);\n\n if (node.set == null) {\n throw new ReadOnlyRecoilValueError(\"Attempt to set read-only RecoilValue: \".concat(key));\n }\n\n return node.set(store, state, newValue);\n}\n\nfunction cleanUpNode(store, key) {\n var node = getNode$1(key);\n node.cleanUp(store);\n} // Find all of the recursively dependent nodes\n\n\nfunction getDownstreamNodes(store, state, keys) {\n var visitedNodes = new Set();\n var visitingNodes = Array.from(keys);\n var graph = store.getGraph(state.version);\n\n for (var key = visitingNodes.pop(); key; key = visitingNodes.pop()) {\n var _graph$nodeToNodeSubs;\n\n visitedNodes.add(key);\n var subscribedNodes = (_graph$nodeToNodeSubs = graph.nodeToNodeSubscriptions.get(key)) !== null && _graph$nodeToNodeSubs !== void 0 ? _graph$nodeToNodeSubs : emptySet;\n\n var _iterator = _createForOfIteratorHelper(subscribedNodes),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var downstreamNode = _step.value;\n\n if (!visitedNodes.has(downstreamNode)) {\n visitingNodes.push(downstreamNode);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n return visitedNodes;\n}\n\nvar Recoil_FunctionalCore = {\n getNodeLoadable: getNodeLoadable,\n peekNodeLoadable: peekNodeLoadable,\n setNodeValue: setNodeValue,\n cleanUpNode: cleanUpNode,\n setUnvalidatedAtomValue_DEPRECATED: setUnvalidatedAtomValue_DEPRECATED,\n getDownstreamNodes: getDownstreamNodes\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n/**\n * Returns a set containing all of the values from the first set that are not\n * present in any of the subsequent sets.\n *\n * Note: this is written procedurally (i.e., without filterSet) for performant\n * use in tight loops.\n */\n\nfunction differenceSets(set) {\n var ret = new Set();\n\n for (var _len3 = arguments.length, setsWithValuesToRemove = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n setsWithValuesToRemove[_key3 - 1] = arguments[_key3];\n }\n\n var _iterator2 = _createForOfIteratorHelper(set),\n _step2;\n\n try {\n FIRST: for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var value = _step2.value;\n\n var _iterator3 = _createForOfIteratorHelper(setsWithValuesToRemove),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var otherSet = _step3.value;\n\n if (otherSet.has(value)) {\n continue FIRST;\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n ret.add(value);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return ret;\n}\n\nvar Recoil_differenceSets = differenceSets;\n\nfunction graph() {\n return {\n nodeDeps: new Map(),\n nodeToNodeSubscriptions: new Map()\n };\n}\n\nfunction cloneGraph(graph) {\n return {\n nodeDeps: Recoil_mapMap(graph.nodeDeps, function (s) {\n return new Set(s);\n }),\n nodeToNodeSubscriptions: Recoil_mapMap(graph.nodeToNodeSubscriptions, function (s) {\n return new Set(s);\n })\n };\n} // Note that this overwrites the deps of existing nodes, rather than unioning\n// the new deps with the old deps.\n\n\nfunction mergeDependencyMapIntoGraph(deps, graph, // If olderGraph is given then we will not overwrite changes made to the given\n// graph compared with olderGraph:\nolderGraph) {\n var nodeDeps = graph.nodeDeps,\n nodeToNodeSubscriptions = graph.nodeToNodeSubscriptions;\n deps.forEach(function (upstreams, downstream) {\n var existingUpstreams = nodeDeps.get(downstream);\n\n if (existingUpstreams && olderGraph && existingUpstreams !== olderGraph.nodeDeps.get(downstream)) {\n return;\n } // Update nodeDeps:\n\n\n nodeDeps.set(downstream, new Set(upstreams)); // Add new deps to nodeToNodeSubscriptions:\n\n var addedUpstreams = existingUpstreams == null ? upstreams : Recoil_differenceSets(upstreams, existingUpstreams);\n addedUpstreams.forEach(function (upstream) {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n nodeToNodeSubscriptions.set(upstream, new Set());\n }\n\n var existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.add(downstream);\n }); // Remove removed deps from nodeToNodeSubscriptions:\n\n if (existingUpstreams) {\n var removedUpstreams = Recoil_differenceSets(existingUpstreams, upstreams);\n removedUpstreams.forEach(function (upstream) {\n if (!nodeToNodeSubscriptions.has(upstream)) {\n return;\n }\n\n var existing = Recoil_nullthrows(nodeToNodeSubscriptions.get(upstream));\n existing.delete(downstream);\n\n if (existing.size === 0) {\n nodeToNodeSubscriptions.delete(upstream);\n }\n });\n }\n });\n}\n\nfunction saveDependencyMapToStore(dependencyMap, store, version) {\n var _storeState$nextTree, _storeState$previousT, _storeState$previousT2, _storeState$previousT3;\n\n var storeState = store.getState();\n\n if (!(version === storeState.currentTree.version || version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to save dependencies to a discarded tree');\n } // Merge the dependencies discovered into the store's dependency map\n // for the version that was read:\n\n\n var graph = store.getGraph(version);\n mergeDependencyMapIntoGraph(dependencyMap, graph); // If this version is not the latest version, also write these dependencies\n // into later versions if they don't already have their own:\n\n if (version === ((_storeState$previousT2 = storeState.previousTree) === null || _storeState$previousT2 === void 0 ? void 0 : _storeState$previousT2.version)) {\n var currentGraph = store.getGraph(storeState.currentTree.version);\n mergeDependencyMapIntoGraph(dependencyMap, currentGraph, graph);\n }\n\n if (version === ((_storeState$previousT3 = storeState.previousTree) === null || _storeState$previousT3 === void 0 ? void 0 : _storeState$previousT3.version) || version === storeState.currentTree.version) {\n var _storeState$nextTree2;\n\n var nextVersion = (_storeState$nextTree2 = storeState.nextTree) === null || _storeState$nextTree2 === void 0 ? void 0 : _storeState$nextTree2.version;\n\n if (nextVersion !== undefined) {\n var nextGraph = store.getGraph(nextVersion);\n mergeDependencyMapIntoGraph(dependencyMap, nextGraph, graph);\n }\n }\n}\n\nfunction mergeDepsIntoDependencyMap(from, into) {\n from.forEach(function (upstreamDeps, downstreamNode) {\n if (!into.has(downstreamNode)) {\n into.set(downstreamNode, new Set());\n }\n\n var deps = Recoil_nullthrows(into.get(downstreamNode));\n upstreamDeps.forEach(function (dep) {\n return deps.add(dep);\n });\n });\n}\n\nfunction addToDependencyMap(downstream, upstream, dependencyMap) {\n if (!dependencyMap.has(downstream)) {\n dependencyMap.set(downstream, new Set());\n }\n\n Recoil_nullthrows(dependencyMap.get(downstream)).add(upstream);\n}\n\nvar Recoil_Graph = {\n addToDependencyMap: addToDependencyMap,\n cloneGraph: cloneGraph,\n graph: graph,\n mergeDepsIntoDependencyMap: mergeDepsIntoDependencyMap,\n saveDependencyMapToStore: saveDependencyMapToStore\n};\nvar getDownstreamNodes$1 = Recoil_FunctionalCore.getDownstreamNodes,\n getNodeLoadable$1 = Recoil_FunctionalCore.getNodeLoadable,\n setNodeValue$1 = Recoil_FunctionalCore.setNodeValue;\nvar saveDependencyMapToStore$1 = Recoil_Graph.saveDependencyMapToStore;\nvar getNodeMaybe$2 = Recoil_Node.getNodeMaybe;\nvar DefaultValue$1 = Recoil_Node.DefaultValue,\n RecoilValueNotReady$1 = Recoil_Node.RecoilValueNotReady;\nvar AbstractRecoilValue$1 = Recoil_RecoilValue$1.AbstractRecoilValue,\n RecoilState$1 = Recoil_RecoilValue$1.RecoilState,\n RecoilValueReadOnly$1 = Recoil_RecoilValue$1.RecoilValueReadOnly,\n isRecoilValue$1 = Recoil_RecoilValue$1.isRecoilValue;\n\nfunction getRecoilValueAsLoadable(store, _ref3) {\n var key = _ref3.key;\n var treeState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : store.getState().currentTree;\n\n var _storeState$nextTree, _storeState$previousT; // Reading from an older tree can cause bugs because the dependencies that we\n // discover during the read are lost.\n\n\n var storeState = store.getState();\n\n if (!(treeState.version === storeState.currentTree.version || treeState.version === ((_storeState$nextTree = storeState.nextTree) === null || _storeState$nextTree === void 0 ? void 0 : _storeState$nextTree.version) || treeState.version === ((_storeState$previousT = storeState.previousTree) === null || _storeState$previousT === void 0 ? void 0 : _storeState$previousT.version))) {\n Recoil_recoverableViolation('Tried to read from a discarded tree');\n }\n\n var _getNodeLoadable$ = getNodeLoadable$1(store, treeState, key),\n _getNodeLoadable$2 = _slicedToArray(_getNodeLoadable$, 2),\n dependencyMap = _getNodeLoadable$2[0],\n loadable = _getNodeLoadable$2[1];\n\n if (!Recoil_gkx_1('recoil_async_selector_refactor')) {\n /**\n * In selector_NEW, we take care of updating state deps within the selector\n */\n saveDependencyMapToStore$1(dependencyMap, store, treeState.version);\n }\n\n return loadable;\n}\n\nfunction applyAtomValueWrites(atomValues, writes) {\n var result = Recoil_mapMap(atomValues, function (v) {\n return v;\n });\n writes.forEach(function (v, k) {\n if (v.state === 'hasValue' && v.contents instanceof DefaultValue$1) {\n result.delete(k);\n } else {\n result.set(k, v);\n }\n });\n return result;\n}\n\nfunction valueFromValueOrUpdater(store, state, _ref4, valueOrUpdater) {\n var key = _ref4.key;\n\n if (typeof valueOrUpdater === 'function') {\n // Updater form: pass in the current value. Throw if the current value\n // is unavailable (namely when updating an async selector that's\n // pending or errored):\n // NOTE: This will evaluate node, but not update state with node subscriptions!\n var current = getNodeLoadable$1(store, state, key)[1];\n\n if (current.state === 'loading') {\n throw new RecoilValueNotReady$1(key);\n } else if (current.state === 'hasError') {\n throw current.contents;\n } // T itself may be a function, so our refinement is not sufficient:\n\n\n return valueOrUpdater(current.contents); // flowlint-line unclear-type:off\n } else {\n return valueOrUpdater;\n }\n}\n\nfunction applyAction(store, state, action) {\n if (action.type === 'set') {\n var recoilValue = action.recoilValue,\n valueOrUpdater = action.valueOrUpdater;\n var newValue = valueFromValueOrUpdater(store, state, recoilValue, valueOrUpdater);\n\n var _setNodeValue$ = setNodeValue$1(store, state, recoilValue.key, newValue),\n _setNodeValue$2 = _slicedToArray(_setNodeValue$, 2),\n depMap = _setNodeValue$2[0],\n writes = _setNodeValue$2[1];\n\n saveDependencyMapToStore$1(depMap, store, state.version);\n\n var _iterator4 = _createForOfIteratorHelper(writes.entries()),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var _step4$value = _slicedToArray(_step4.value, 2),\n key = _step4$value[0],\n loadable = _step4$value[1];\n\n writeLoadableToTreeState(state, key, loadable);\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n } else if (action.type === 'setLoadable') {\n var _key4 = action.recoilValue.key,\n _loadable = action.loadable;\n writeLoadableToTreeState(state, _key4, _loadable);\n } else if (action.type === 'markModified') {\n var _key5 = action.recoilValue.key;\n state.dirtyAtoms.add(_key5);\n } else if (action.type === 'setUnvalidated') {\n var _node$invalidate; // Write value directly to state bypassing the Node interface as the node\n // definitions may not have been loaded yet when processing the initial snapshot.\n\n\n var _key6 = action.recoilValue.key,\n unvalidatedValue = action.unvalidatedValue;\n var node = getNodeMaybe$2(_key6);\n node === null || node === void 0 ? void 0 : (_node$invalidate = node.invalidate) === null || _node$invalidate === void 0 ? void 0 : _node$invalidate.call(node, state);\n state.atomValues.delete(_key6);\n state.nonvalidatedAtoms.set(_key6, unvalidatedValue);\n state.dirtyAtoms.add(_key6);\n } else {\n Recoil_recoverableViolation(\"Unknown action \".concat(action.type));\n }\n}\n\nfunction writeLoadableToTreeState(state, key, loadable) {\n if (loadable.state === 'hasValue' && loadable.contents instanceof DefaultValue$1) {\n state.atomValues.delete(key);\n } else {\n state.atomValues.set(key, loadable);\n }\n\n state.dirtyAtoms.add(key);\n state.nonvalidatedAtoms.delete(key);\n}\n\nfunction applyActionsToStore(store, actions) {\n store.replaceState(function (state) {\n var newState = copyTreeState(state);\n\n var _iterator5 = _createForOfIteratorHelper(actions),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var action = _step5.value;\n applyAction(store, newState, action);\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n invalidateDownstreams(store, newState);\n return newState;\n });\n}\n\nfunction queueOrPerformStateUpdate(store, action, key, message) {\n if (batchStack.length) {\n var actionsByStore = batchStack[batchStack.length - 1];\n var actions = actionsByStore.get(store);\n\n if (!actions) {\n actionsByStore.set(store, actions = []);\n }\n\n actions.push(action);\n } else {\n Recoil_Tracing.trace(message, key, function () {\n return applyActionsToStore(store, [action]);\n });\n }\n}\n\nvar batchStack = [];\n\nfunction batchStart() {\n var actionsByStore = new Map();\n batchStack.push(actionsByStore);\n return function () {\n var _iterator6 = _createForOfIteratorHelper(actionsByStore),\n _step6;\n\n try {\n var _loop = function _loop() {\n var _step6$value = _slicedToArray(_step6.value, 2),\n store = _step6$value[0],\n actions = _step6$value[1];\n\n Recoil_Tracing.trace('Recoil batched updates', '-', function () {\n return applyActionsToStore(store, actions);\n });\n };\n\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n var popped = batchStack.pop();\n\n if (popped !== actionsByStore) {\n Recoil_recoverableViolation('Incorrect order of batch popping');\n }\n };\n}\n\nfunction copyTreeState(state) {\n return _objectSpread(_objectSpread({}, state), {}, {\n atomValues: new Map(state.atomValues),\n nonvalidatedAtoms: new Map(state.nonvalidatedAtoms),\n dirtyAtoms: new Set(state.dirtyAtoms)\n });\n}\n\nfunction invalidateDownstreams(store, state) {\n // Inform any nodes that were changed or downstream of changes so that they\n // can clear out any caches as needed due to the update:\n var downstreams = getDownstreamNodes$1(store, state, state.dirtyAtoms);\n\n var _iterator7 = _createForOfIteratorHelper(downstreams),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var key = _step7.value;\n\n var _getNodeMaybe, _getNodeMaybe$invalid;\n\n (_getNodeMaybe = getNodeMaybe$2(key)) === null || _getNodeMaybe === void 0 ? void 0 : (_getNodeMaybe$invalid = _getNodeMaybe.invalidate) === null || _getNodeMaybe$invalid === void 0 ? void 0 : _getNodeMaybe$invalid.call(_getNodeMaybe, state);\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n}\n\nfunction setRecoilValue(store, recoilValue, valueOrUpdater) {\n queueOrPerformStateUpdate(store, {\n type: 'set',\n recoilValue: recoilValue,\n valueOrUpdater: valueOrUpdater\n }, recoilValue.key, 'set Recoil value');\n}\n\nfunction setRecoilValueLoadable(store, recoilValue, loadable) {\n if (loadable instanceof DefaultValue$1) {\n return setRecoilValue(store, recoilValue, loadable);\n }\n\n queueOrPerformStateUpdate(store, {\n type: 'setLoadable',\n recoilValue: recoilValue,\n loadable: loadable\n }, recoilValue.key, 'set Recoil value');\n}\n\nfunction markRecoilValueModified(store, recoilValue) {\n queueOrPerformStateUpdate(store, {\n type: 'markModified',\n recoilValue: recoilValue\n }, recoilValue.key, 'mark RecoilValue modified');\n}\n\nfunction setUnvalidatedRecoilValue(store, recoilValue, unvalidatedValue) {\n queueOrPerformStateUpdate(store, {\n type: 'setUnvalidated',\n recoilValue: recoilValue,\n unvalidatedValue: unvalidatedValue\n }, recoilValue.key, 'set Recoil value');\n}\n\nvar subscriptionID = 0;\n\nfunction subscribeToRecoilValue(store, _ref5, callback) {\n var key = _ref5.key;\n var componentDebugName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var subID = subscriptionID++;\n var storeState = store.getState();\n\n if (!storeState.nodeToComponentSubscriptions.has(key)) {\n storeState.nodeToComponentSubscriptions.set(key, new Map());\n }\n\n Recoil_nullthrows(storeState.nodeToComponentSubscriptions.get(key)).set(subID, [componentDebugName !== null && componentDebugName !== void 0 ? componentDebugName : '', callback]);\n return {\n release: function release() {\n var storeState = store.getState();\n var subs = storeState.nodeToComponentSubscriptions.get(key);\n\n if (subs === undefined || !subs.has(subID)) {\n Recoil_recoverableViolation(\"Subscription missing at release time for atom \".concat(key, \". This is a bug in Recoil.\"));\n return;\n }\n\n subs.delete(subID);\n\n if (subs.size === 0) {\n storeState.nodeToComponentSubscriptions.delete(key);\n }\n }\n };\n}\n\nvar Recoil_RecoilValueInterface = {\n RecoilValueReadOnly: RecoilValueReadOnly$1,\n AbstractRecoilValue: AbstractRecoilValue$1,\n RecoilState: RecoilState$1,\n getRecoilValueAsLoadable: getRecoilValueAsLoadable,\n setRecoilValue: setRecoilValue,\n setRecoilValueLoadable: setRecoilValueLoadable,\n markRecoilValueModified: markRecoilValueModified,\n setUnvalidatedRecoilValue: setUnvalidatedRecoilValue,\n subscribeToRecoilValue: subscribeToRecoilValue,\n isRecoilValue: isRecoilValue$1,\n applyAtomValueWrites: applyAtomValueWrites,\n // TODO Remove export when deprecating initialStoreState_DEPRECATED in RecoilRoot\n batchStart: batchStart,\n invalidateDownstreams_FOR_TESTING: invalidateDownstreams\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is to export esstiential functions from react-dom\n * for our web build\n */\n\nvar unstable_batchedUpdates = reactDom.unstable_batchedUpdates; // @oss-only\n// @fb-only: const {unstable_batchedUpdates} = require('ReactDOMComet');\n\nvar Recoil_ReactBatchedUpdates = {\n unstable_batchedUpdates: unstable_batchedUpdates\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nvar batchStart$1 = Recoil_RecoilValueInterface.batchStart;\nvar unstable_batchedUpdates$1 = Recoil_ReactBatchedUpdates.unstable_batchedUpdates;\nvar batcher = unstable_batchedUpdates$1; // flowlint-next-line unclear-type:off\n\n/**\n * Sets the provided batcher function as the batcher function used by Recoil.\n *\n * Set the batcher to a custom batcher for your renderer,\n * if you use a renderer other than React DOM or React Native.\n */\n\nvar setBatcher = function setBatcher(newBatcher) {\n batcher = newBatcher;\n};\n/**\n * Returns the current batcher function.\n */\n\n\nvar getBatcher = function getBatcher() {\n return batcher;\n};\n/**\n * Calls the current batcher function and passes the\n * provided callback function.\n */\n\n\nvar batchUpdates = function batchUpdates(callback) {\n batcher(function () {\n var batchEnd = function batchEnd() {\n return undefined;\n };\n\n try {\n batchEnd = batchStart$1();\n callback();\n } finally {\n batchEnd();\n }\n });\n};\n\nvar Recoil_Batching = {\n getBatcher: getBatcher,\n setBatcher: setBatcher,\n batchUpdates: batchUpdates\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction enqueueExecution(s, f) {\n f();\n}\n\nvar Recoil_Queue = {\n enqueueExecution: enqueueExecution\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n/**\n * Combines multiple Iterables into a single Iterable.\n * Traverses the input Iterables in the order provided and maintains the order\n * of their elements.\n *\n * Example:\n * ```\n * const r = Array.from(concatIterables(['a', 'b'], ['c'], ['d', 'e', 'f']));\n * r == ['a', 'b', 'c', 'd', 'e', 'f'];\n * ```\n */\n\nfunction concatIterables(iters) {\n var _iterator8, _step8, iter, _iterator9, _step9, val;\n\n return _regeneratorRuntime.wrap(function concatIterables$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _iterator8 = _createForOfIteratorHelper(iters);\n _context.prev = 1;\n\n _iterator8.s();\n\n case 3:\n if ((_step8 = _iterator8.n()).done) {\n _context.next = 24;\n break;\n }\n\n iter = _step8.value;\n _iterator9 = _createForOfIteratorHelper(iter);\n _context.prev = 6;\n\n _iterator9.s();\n\n case 8:\n if ((_step9 = _iterator9.n()).done) {\n _context.next = 14;\n break;\n }\n\n val = _step9.value;\n _context.next = 12;\n return val;\n\n case 12:\n _context.next = 8;\n break;\n\n case 14:\n _context.next = 19;\n break;\n\n case 16:\n _context.prev = 16;\n _context.t0 = _context[\"catch\"](6);\n\n _iterator9.e(_context.t0);\n\n case 19:\n _context.prev = 19;\n\n _iterator9.f();\n\n return _context.finish(19);\n\n case 22:\n _context.next = 3;\n break;\n\n case 24:\n _context.next = 29;\n break;\n\n case 26:\n _context.prev = 26;\n _context.t1 = _context[\"catch\"](1);\n\n _iterator8.e(_context.t1);\n\n case 29:\n _context.prev = 29;\n\n _iterator8.f();\n\n return _context.finish(29);\n\n case 32:\n case \"end\":\n return _context.stop();\n }\n }\n }, _marked, null, [[1, 26, 29, 32], [6, 16, 19, 22]]);\n}\n\nvar Recoil_concatIterables = concatIterables;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the filter function.\n */\n\nfunction filterIterable(iterable, predicate) {\n var index, _iterator10, _step10, value;\n\n return _regeneratorRuntime.wrap(function filterIterable$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n // Use generator to create iterable/iterator\n index = 0;\n _iterator10 = _createForOfIteratorHelper(iterable);\n _context2.prev = 2;\n\n _iterator10.s();\n\n case 4:\n if ((_step10 = _iterator10.n()).done) {\n _context2.next = 11;\n break;\n }\n\n value = _step10.value;\n\n if (!predicate(value, index++)) {\n _context2.next = 9;\n break;\n }\n\n _context2.next = 9;\n return value;\n\n case 9:\n _context2.next = 4;\n break;\n\n case 11:\n _context2.next = 16;\n break;\n\n case 13:\n _context2.prev = 13;\n _context2.t0 = _context2[\"catch\"](2);\n\n _iterator10.e(_context2.t0);\n\n case 16:\n _context2.prev = 16;\n\n _iterator10.f();\n\n return _context2.finish(16);\n\n case 19:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _marked2, null, [[2, 13, 16, 19]]);\n}\n\nvar Recoil_filterIterable = filterIterable;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n/**\n * Creates a new iterable whose output is generated by passing the input\n * iterable's values through the mapper function.\n */\n\nfunction mapIterable(iterable, callback) {\n // Use generator to create iterable/iterator\n return /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var index, _iterator11, _step11, value;\n\n return _regeneratorRuntime.wrap(function _callee$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n index = 0;\n _iterator11 = _createForOfIteratorHelper(iterable);\n _context3.prev = 2;\n\n _iterator11.s();\n\n case 4:\n if ((_step11 = _iterator11.n()).done) {\n _context3.next = 10;\n break;\n }\n\n value = _step11.value;\n _context3.next = 8;\n return callback(value, index++);\n\n case 8:\n _context3.next = 4;\n break;\n\n case 10:\n _context3.next = 15;\n break;\n\n case 12:\n _context3.prev = 12;\n _context3.t0 = _context3[\"catch\"](2);\n\n _iterator11.e(_context3.t0);\n\n case 15:\n _context3.prev = 15;\n\n _iterator11.f();\n\n return _context3.finish(15);\n\n case 18:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee, null, [[2, 12, 15, 18]]);\n })();\n}\n\nvar Recoil_mapIterable = mapIterable;\nvar graph$1 = Recoil_Graph.graph; // flowlint-next-line unclear-type:off\n\nvar nextTreeStateVersion = 0;\n\nvar getNextTreeStateVersion = function getNextTreeStateVersion() {\n return nextTreeStateVersion++;\n};\n\nfunction makeEmptyTreeState() {\n var version = getNextTreeStateVersion();\n return {\n version: version,\n stateID: version,\n transactionMetadata: {},\n dirtyAtoms: new Set(),\n atomValues: new Map(),\n nonvalidatedAtoms: new Map()\n };\n}\n\nfunction makeEmptyStoreState() {\n var currentTree = makeEmptyTreeState();\n return {\n currentTree: currentTree,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(),\n knownSelectors: new Set(),\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(currentTree.version, graph$1()),\n versionsUsedByComponent: new Map()\n };\n}\n\nvar Recoil_State = {\n makeEmptyTreeState: makeEmptyTreeState,\n makeEmptyStoreState: makeEmptyStoreState,\n getNextTreeStateVersion: getNextTreeStateVersion\n};\nvar batchUpdates$1 = Recoil_Batching.batchUpdates;\nvar getDownstreamNodes$2 = Recoil_FunctionalCore.getDownstreamNodes,\n peekNodeLoadable$1 = Recoil_FunctionalCore.peekNodeLoadable;\nvar graph$2 = Recoil_Graph.graph;\nvar DEFAULT_VALUE$1 = Recoil_Node.DEFAULT_VALUE,\n recoilValues$1 = Recoil_Node.recoilValues;\nvar getRecoilValueAsLoadable$1 = Recoil_RecoilValueInterface.getRecoilValueAsLoadable,\n setRecoilValue$1 = Recoil_RecoilValueInterface.setRecoilValue;\nvar getNextTreeStateVersion$1 = Recoil_State.getNextTreeStateVersion,\n makeEmptyStoreState$1 = Recoil_State.makeEmptyStoreState; // Opaque at this surface because it's part of the public API from here.\n\nfunction recoilValuesForKeys(keys) {\n return Recoil_mapIterable(keys, function (key) {\n return Recoil_nullthrows(recoilValues$1.get(key));\n });\n} // A \"Snapshot\" is \"read-only\" and captures a specific set of values of atoms.\n// However, the data-flow-graph and selector values may evolve as selector\n// evaluation functions are executed and async selectors resolve.\n\n\nvar Snapshot = /*#__PURE__*/function () {\n function Snapshot(storeState) {\n var _this = this;\n\n _classCallCheck(this, Snapshot);\n\n _defineProperty(this, \"_store\", void 0);\n\n _defineProperty(this, \"getLoadable\", function (recoilValue) {\n return (// $FlowFixMe[escaped-generic]\n getRecoilValueAsLoadable$1(_this._store, recoilValue)\n );\n });\n\n _defineProperty(this, \"getPromise\", function (recoilValue) {\n return (// $FlowFixMe[escaped-generic]\n _this.getLoadable(recoilValue).toPromise()\n );\n });\n\n _defineProperty(this, \"getNodes_UNSTABLE\", function (opt) {\n // TODO Deal with modified selectors\n if ((opt === null || opt === void 0 ? void 0 : opt.isModified) === true) {\n if ((opt === null || opt === void 0 ? void 0 : opt.isInitialized) === false) {\n return [];\n }\n\n var state = _this._store.getState().currentTree;\n\n return recoilValuesForKeys(state.dirtyAtoms);\n }\n\n var knownAtoms = _this._store.getState().knownAtoms;\n\n var knownSelectors = _this._store.getState().knownSelectors;\n\n return (opt === null || opt === void 0 ? void 0 : opt.isInitialized) == null ? recoilValues$1.values() : opt.isInitialized === true ? recoilValuesForKeys(Recoil_concatIterables([_this._store.getState().knownAtoms, _this._store.getState().knownSelectors])) : Recoil_filterIterable(recoilValues$1.values(), function (_ref6) {\n var key = _ref6.key;\n return !knownAtoms.has(key) && !knownSelectors.has(key);\n });\n });\n\n _defineProperty(this, \"getDeps_UNSTABLE\", function (recoilValue) {\n _this.getLoadable(recoilValue); // Evaluate node to ensure deps are up-to-date\n\n\n var deps = _this._store.getGraph(_this._store.getState().currentTree.version).nodeDeps.get(recoilValue.key);\n\n return recoilValuesForKeys(deps !== null && deps !== void 0 ? deps : []);\n });\n\n _defineProperty(this, \"getSubscribers_UNSTABLE\", function (_ref7) {\n var key = _ref7.key;\n\n var state = _this._store.getState().currentTree;\n\n var downstreamNodes = Recoil_filterIterable(getDownstreamNodes$2(_this._store, state, new Set([key])), function (nodeKey) {\n return nodeKey !== key;\n });\n return {\n nodes: recoilValuesForKeys(downstreamNodes)\n };\n });\n\n _defineProperty(this, \"getInfo_UNSTABLE\", function (recoilValue) {\n var _graph$nodeDeps$get;\n\n var key = recoilValue.key;\n\n var state = _this._store.getState().currentTree;\n\n var graph = _this._store.getGraph(state.version);\n\n var type = _this._store.getState().knownAtoms.has(key) ? 'atom' : _this._store.getState().knownSelectors.has(key) ? 'selector' : undefined;\n return {\n loadable: peekNodeLoadable$1(_this._store, state, key),\n isActive: _this._store.getState().knownAtoms.has(key) || _this._store.getState().knownSelectors.has(key),\n isSet: type === 'selector' ? false : state.atomValues.has(key),\n isModified: state.dirtyAtoms.has(key),\n type: type,\n // Don't use this.getDeps() as it will evaluate the node and we are only peeking\n deps: recoilValuesForKeys((_graph$nodeDeps$get = graph.nodeDeps.get(key)) !== null && _graph$nodeDeps$get !== void 0 ? _graph$nodeDeps$get : []),\n subscribers: _this.getSubscribers_UNSTABLE(recoilValue)\n };\n });\n\n _defineProperty(this, \"map\", function (mapper) {\n var mutableSnapshot = new MutableSnapshot(_this);\n mapper(mutableSnapshot); // if removing batchUpdates from `set` add it here\n\n return cloneSnapshot(mutableSnapshot.getStore_INTERNAL());\n });\n\n _defineProperty(this, \"asyncMap\", /*#__PURE__*/function () {\n var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(mapper) {\n var mutableSnapshot;\n return _regeneratorRuntime.wrap(function _callee2$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n mutableSnapshot = new MutableSnapshot(_this);\n _context4.next = 3;\n return mapper(mutableSnapshot);\n\n case 3:\n return _context4.abrupt(\"return\", cloneSnapshot(mutableSnapshot.getStore_INTERNAL()));\n\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x) {\n return _ref8.apply(this, arguments);\n };\n }());\n\n this._store = {\n getState: function getState() {\n return storeState;\n },\n replaceState: function replaceState(replacer) {\n storeState.currentTree = replacer(storeState.currentTree); // no batching so nextTree is never active\n },\n getGraph: function getGraph(version) {\n var graphs = storeState.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n var newGraph = graph$2();\n graphs.set(version, newGraph);\n return newGraph;\n },\n subscribeToTransactions: function subscribeToTransactions() {\n return {\n release: function release() {}\n };\n },\n addTransactionMetadata: function addTransactionMetadata() {\n throw new Error('Cannot subscribe to Snapshots');\n }\n };\n }\n\n _createClass(Snapshot, [{\n key: \"getStore_INTERNAL\",\n value: function getStore_INTERNAL() {\n return this._store;\n }\n }, {\n key: \"getID\",\n value: function getID() {\n return this.getID_INTERNAL();\n }\n }, {\n key: \"getID_INTERNAL\",\n value: function getID_INTERNAL() {\n return this._store.getState().currentTree.stateID;\n }\n }]);\n\n return Snapshot;\n}();\n\nfunction cloneStoreState(store, treeState) {\n var bumpVersion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var storeState = store.getState();\n var version = bumpVersion ? getNextTreeStateVersion$1() : treeState.version;\n return {\n currentTree: bumpVersion ? {\n // TODO snapshots shouldn't really have versions because a new version number\n // is always assigned when the snapshot is gone to.\n version: version,\n stateID: version,\n transactionMetadata: _objectSpread({}, treeState.transactionMetadata),\n dirtyAtoms: new Set(treeState.dirtyAtoms),\n atomValues: new Map(treeState.atomValues),\n nonvalidatedAtoms: new Map(treeState.nonvalidatedAtoms)\n } : treeState,\n nextTree: null,\n previousTree: null,\n knownAtoms: new Set(storeState.knownAtoms),\n // FIXME here's a copy\n knownSelectors: new Set(storeState.knownSelectors),\n // FIXME here's a copy\n transactionSubscriptions: new Map(),\n nodeTransactionSubscriptions: new Map(),\n nodeToComponentSubscriptions: new Map(),\n queuedComponentCallbacks_DEPRECATED: [],\n suspendedComponentResolvers: new Set(),\n graphsByVersion: new Map().set(version, store.getGraph(treeState.version)),\n versionsUsedByComponent: new Map()\n };\n} // Factory to build a fresh snapshot\n\n\nfunction freshSnapshot(initializeState) {\n var snapshot = new Snapshot(makeEmptyStoreState$1());\n return initializeState != null ? snapshot.map(initializeState) : snapshot;\n} // Factory to clone a snapahot state\n\n\nfunction cloneSnapshot(store) {\n var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'current';\n var storeState = store.getState();\n var treeState = version === 'current' ? storeState.currentTree : Recoil_nullthrows(storeState.previousTree);\n return new Snapshot(cloneStoreState(store, treeState));\n}\n\nvar MutableSnapshot = /*#__PURE__*/function (_Snapshot) {\n _inherits(MutableSnapshot, _Snapshot);\n\n var _super6 = _createSuper(MutableSnapshot);\n\n function MutableSnapshot(snapshot) {\n var _this2;\n\n _classCallCheck(this, MutableSnapshot);\n\n _this2 = _super6.call(this, cloneStoreState(snapshot.getStore_INTERNAL(), snapshot.getStore_INTERNAL().getState().currentTree, true));\n\n _defineProperty(_assertThisInitialized(_this2), \"set\", function (recoilState, newValueOrUpdater) {\n var store = _this2.getStore_INTERNAL(); // This batchUpdates ensures this `set` is applied immediately and you can\n // read the written value after calling `set`. I would like to remove this\n // behavior and only batch in `Snapshot.map`, but this would be a breaking\n // change potentially.\n\n\n batchUpdates$1(function () {\n setRecoilValue$1(store, recoilState, newValueOrUpdater);\n });\n });\n\n _defineProperty(_assertThisInitialized(_this2), \"reset\", function (recoilState) {\n return (// See note at `set` about batched updates.\n batchUpdates$1(function () {\n return setRecoilValue$1(_this2.getStore_INTERNAL(), recoilState, DEFAULT_VALUE$1);\n })\n );\n });\n\n return _this2;\n } // We want to allow the methods to be destructured and used as accessors\n // eslint-disable-next-line fb-www/extra-arrow-initializer\n\n\n return MutableSnapshot;\n}(Snapshot);\n\nvar Recoil_Snapshot = {\n Snapshot: Snapshot,\n MutableSnapshot: MutableSnapshot,\n freshSnapshot: freshSnapshot,\n cloneSnapshot: cloneSnapshot\n};\nvar Recoil_Snapshot_1 = Recoil_Snapshot.Snapshot;\nvar Recoil_Snapshot_2 = Recoil_Snapshot.MutableSnapshot;\nvar Recoil_Snapshot_3 = Recoil_Snapshot.freshSnapshot;\nvar Recoil_Snapshot_4 = Recoil_Snapshot.cloneSnapshot;\nvar Recoil_Snapshot$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Snapshot: Recoil_Snapshot_1,\n MutableSnapshot: Recoil_Snapshot_2,\n freshSnapshot: Recoil_Snapshot_3,\n cloneSnapshot: Recoil_Snapshot_4\n});\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction unionSets() {\n var result = new Set();\n\n for (var _len4 = arguments.length, sets = new Array(_len4), _key7 = 0; _key7 < _len4; _key7++) {\n sets[_key7] = arguments[_key7];\n }\n\n for (var _i = 0, _sets = sets; _i < _sets.length; _i++) {\n var set = _sets[_i];\n\n var _iterator12 = _createForOfIteratorHelper(set),\n _step12;\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var value = _step12.value;\n result.add(value);\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n }\n\n return result;\n}\n\nvar Recoil_unionSets = unionSets;\nvar useContext = react.useContext,\n useEffect = react.useEffect,\n useMemo = react.useMemo,\n useRef = react.useRef,\n useState = react.useState; // @fb-only: const RecoilusagelogEvent = require('RecoilusagelogEvent');\n// @fb-only: const RecoilUsageLogFalcoEvent = require('RecoilUsageLogFalcoEvent');\n// @fb-only: const URI = require('URI');\n\nvar cleanUpNode$1 = Recoil_FunctionalCore.cleanUpNode,\n getDownstreamNodes$3 = Recoil_FunctionalCore.getDownstreamNodes,\n setNodeValue$2 = Recoil_FunctionalCore.setNodeValue,\n setUnvalidatedAtomValue_DEPRECATED$1 = Recoil_FunctionalCore.setUnvalidatedAtomValue_DEPRECATED;\nvar graph$3 = Recoil_Graph.graph,\n saveDependencyMapToStore$2 = Recoil_Graph.saveDependencyMapToStore;\nvar cloneGraph$1 = Recoil_Graph.cloneGraph;\nvar applyAtomValueWrites$1 = Recoil_RecoilValueInterface.applyAtomValueWrites;\nvar freshSnapshot$1 = Recoil_Snapshot$1.freshSnapshot;\nvar getNextTreeStateVersion$2 = Recoil_State.getNextTreeStateVersion,\n makeEmptyStoreState$2 = Recoil_State.makeEmptyStoreState;\nvar mapByDeletingMultipleFromMap$1 = Recoil_CopyOnWrite.mapByDeletingMultipleFromMap; // @fb-only: const recoverableViolation = require('../util/Recoil_recoverableViolation');\n// @fb-only: const gkx = require('gkx');\n\nfunction notInAContext() {\n throw new Error('This component must be used inside a component.');\n}\n\nvar defaultStore = Object.freeze({\n getState: notInAContext,\n replaceState: notInAContext,\n getGraph: notInAContext,\n subscribeToTransactions: notInAContext,\n addTransactionMetadata: notInAContext\n});\nvar stateReplacerIsBeingExecuted = false;\n\nfunction startNextTreeIfNeeded(storeState) {\n if (stateReplacerIsBeingExecuted) {\n throw new Error('An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.');\n }\n\n if (storeState.nextTree === null) {\n var version = storeState.currentTree.version;\n var nextVersion = getNextTreeStateVersion$2();\n storeState.nextTree = _objectSpread(_objectSpread({}, storeState.currentTree), {}, {\n version: nextVersion,\n stateID: nextVersion,\n dirtyAtoms: new Set(),\n transactionMetadata: {}\n });\n storeState.graphsByVersion.set(nextVersion, cloneGraph$1(Recoil_nullthrows(storeState.graphsByVersion.get(version))));\n }\n}\n\nvar AppContext = react.createContext({\n current: defaultStore\n});\n\nvar useStoreRef = function useStoreRef() {\n return useContext(AppContext);\n};\n\nvar MutableSourceContext = react.createContext(null); // TODO T2710559282599660\n\nvar useRecoilMutableSource = function useRecoilMutableSource() {\n return useContext(MutableSourceContext);\n};\n\nfunction sendEndOfBatchNotifications(store) {\n var storeState = store.getState();\n var treeState = storeState.currentTree; // Inform transaction subscribers of the transaction:\n\n var dirtyAtoms = treeState.dirtyAtoms;\n\n if (dirtyAtoms.size) {\n // Execute Node-specific subscribers before global subscribers\n var _iterator13 = _createForOfIteratorHelper(storeState.nodeTransactionSubscriptions),\n _step13;\n\n try {\n for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {\n var _step13$value = _slicedToArray(_step13.value, 2),\n key = _step13$value[0],\n subscriptions = _step13$value[1];\n\n if (dirtyAtoms.has(key)) {\n var _iterator16 = _createForOfIteratorHelper(subscriptions),\n _step16;\n\n try {\n for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {\n var _step16$value = _slicedToArray(_step16.value, 2),\n _ = _step16$value[0],\n subscription = _step16$value[1];\n\n subscription(store);\n }\n } catch (err) {\n _iterator16.e(err);\n } finally {\n _iterator16.f();\n }\n }\n }\n } catch (err) {\n _iterator13.e(err);\n } finally {\n _iterator13.f();\n }\n\n var _iterator14 = _createForOfIteratorHelper(storeState.transactionSubscriptions),\n _step14;\n\n try {\n for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {\n var _step14$value = _slicedToArray(_step14.value, 2),\n _2 = _step14$value[0],\n _subscription = _step14$value[1];\n\n _subscription(store);\n } // Components that are subscribed to the dirty atom:\n\n } catch (err) {\n _iterator14.e(err);\n } finally {\n _iterator14.f();\n }\n\n var dependentNodes = getDownstreamNodes$3(store, treeState, dirtyAtoms);\n\n var _iterator15 = _createForOfIteratorHelper(dependentNodes),\n _step15;\n\n try {\n for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {\n var _key8 = _step15.value;\n var comps = storeState.nodeToComponentSubscriptions.get(_key8);\n\n if (comps) {\n var _iterator17 = _createForOfIteratorHelper(comps),\n _step17;\n\n try {\n for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {\n var _step17$value = _slicedToArray(_step17.value, 2),\n _subID = _step17$value[0],\n _step17$value$ = _slicedToArray(_step17$value[1], 2),\n _debugName = _step17$value$[0],\n callback = _step17$value$[1];\n\n callback(treeState);\n }\n } catch (err) {\n _iterator17.e(err);\n } finally {\n _iterator17.f();\n }\n }\n } // Wake all suspended components so the right one(s) can try to re-render.\n // We need to wake up components not just when some asynchronous selector\n // resolved, but also when changing synchronous values because this may cause\n // a selector to change from asynchronous to synchronous, in which case there\n // would be no follow-up asynchronous resolution to wake us up.\n // TODO OPTIMIZATION Only wake up related downstream components\n\n } catch (err) {\n _iterator15.e(err);\n } finally {\n _iterator15.f();\n }\n\n var nodeNames = '[available in dev build]';\n\n if (process.env.NODE_ENV !== \"production\") {\n nodeNames = Array.from(dirtyAtoms).join(', ');\n }\n\n storeState.suspendedComponentResolvers.forEach(function (cb) {\n return Recoil_Tracing.trace('value became available, waking components', nodeNames, cb);\n });\n } // Special behavior ONLY invoked by useInterface.\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n\n\n storeState.queuedComponentCallbacks_DEPRECATED.forEach(function (cb) {\n return cb(treeState);\n });\n storeState.queuedComponentCallbacks_DEPRECATED.splice(0, storeState.queuedComponentCallbacks_DEPRECATED.length);\n}\n/*\n * The purpose of the Batcher is to observe when React batches end so that\n * Recoil state changes can be batched. Whenever Recoil state changes, we call\n * setState on the batcher. Then we wait for that change to be committed, which\n * signifies the end of the batch. That's when we respond to the Recoil change.\n */\n\n\nfunction Batcher(props) {\n var storeRef = useStoreRef();\n\n var _useState = useState([]),\n _useState2 = _slicedToArray(_useState, 2),\n _ = _useState2[0],\n setState = _useState2[1];\n\n props.setNotifyBatcherOfChange(function () {\n return setState({});\n });\n useEffect(function () {\n // enqueueExecution runs this function immediately; it is only used to\n // manipulate the order of useEffects during tests, since React seems to\n // call useEffect in an unpredictable order sometimes.\n Recoil_Queue.enqueueExecution('Batcher', function () {\n var storeState = storeRef.current.getState();\n var nextTree = storeState.nextTree; // Ignore commits that are not because of Recoil transactions -- namely,\n // because something above RecoilRoot re-rendered:\n\n if (nextTree === null) {\n return;\n } // nextTree is now committed -- note that copying and reset occurs when\n // a transaction begins, in startNextTreeIfNeeded:\n\n\n storeState.previousTree = storeState.currentTree;\n storeState.currentTree = nextTree;\n storeState.nextTree = null;\n sendEndOfBatchNotifications(storeRef.current);\n var discardedVersion = Recoil_nullthrows(storeState.previousTree).version;\n storeState.graphsByVersion.delete(discardedVersion);\n storeState.previousTree = null;\n });\n });\n return null;\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined' && !window.$recoilDebugStates) {\n window.$recoilDebugStates = [];\n }\n} // When removing this deprecated function, remove stateBySettingRecoilValue\n// which will no longer be needed.\n\n\nfunction initialStoreState_DEPRECATED(store, initializeState) {\n var initial = makeEmptyStoreState$2();\n initializeState({\n // $FlowFixMe[escaped-generic]\n set: function set(atom, value) {\n var state = initial.currentTree;\n\n var _setNodeValue$3 = setNodeValue$2(store, state, atom.key, value),\n _setNodeValue$4 = _slicedToArray(_setNodeValue$3, 2),\n depMap = _setNodeValue$4[0],\n writes = _setNodeValue$4[1];\n\n var writtenNodes = new Set(writes.keys());\n saveDependencyMapToStore$2(depMap, store, state.version);\n var nonvalidatedAtoms = mapByDeletingMultipleFromMap$1(state.nonvalidatedAtoms, writtenNodes);\n initial.currentTree = _objectSpread(_objectSpread({}, state), {}, {\n dirtyAtoms: Recoil_unionSets(state.dirtyAtoms, writtenNodes),\n atomValues: applyAtomValueWrites$1(state.atomValues, writes),\n // NB: PLEASE un-export applyAtomValueWrites when deleting this code\n nonvalidatedAtoms: nonvalidatedAtoms\n });\n },\n setUnvalidatedAtomValues: function setUnvalidatedAtomValues(atomValues) {\n // FIXME replace this with a mutative loop\n atomValues.forEach(function (v, k) {\n initial.currentTree = setUnvalidatedAtomValue_DEPRECATED$1(initial.currentTree, k, v);\n });\n }\n });\n return initial;\n}\n\nfunction initialStoreState(initializeState) {\n var snapshot = freshSnapshot$1().map(initializeState);\n return snapshot.getStore_INTERNAL().getState();\n}\n\nvar nextID = 0;\n\nfunction RecoilRoot(_ref9) {\n var initializeState_DEPRECATED = _ref9.initializeState_DEPRECATED,\n initializeState = _ref9.initializeState,\n storeProp = _ref9.store_INTERNAL,\n children = _ref9.children;\n\n var _createMutableSource; // prettier-ignore\n // @fb-only: useEffect(() => {\n // @fb-only: if (gkx('recoil_usage_logging')) {\n // @fb-only: try {\n // @fb-only: RecoilUsageLogFalcoEvent.log(() => ({\n // @fb-only: type: RecoilusagelogEvent.RECOIL_ROOT_MOUNTED,\n // @fb-only: path: URI.getRequestURI().getPath(),\n // @fb-only: }));\n // @fb-only: } catch {\n // @fb-only: recoverableViolation(\n // @fb-only: 'Error when logging Recoil Usage event',\n // @fb-only: 'recoil',\n // @fb-only: );\n // @fb-only: }\n // @fb-only: }\n // @fb-only: }, []);\n\n\n var storeState; // eslint-disable-line prefer-const\n\n var getGraph = function getGraph(version) {\n var graphs = storeState.current.graphsByVersion;\n\n if (graphs.has(version)) {\n return Recoil_nullthrows(graphs.get(version));\n }\n\n var newGraph = graph$3();\n graphs.set(version, newGraph);\n return newGraph;\n };\n\n var subscribeToTransactions = function subscribeToTransactions(callback, key) {\n if (key == null) {\n // Global transaction subscriptions\n var _storeRef$current$get = storeRef.current.getState(),\n transactionSubscriptions = _storeRef$current$get.transactionSubscriptions;\n\n var id = nextID++;\n transactionSubscriptions.set(id, callback);\n return {\n release: function release() {\n transactionSubscriptions.delete(id);\n }\n };\n } else {\n // Node-specific transaction subscriptions:\n var _storeRef$current$get2 = storeRef.current.getState(),\n nodeTransactionSubscriptions = _storeRef$current$get2.nodeTransactionSubscriptions;\n\n if (!nodeTransactionSubscriptions.has(key)) {\n nodeTransactionSubscriptions.set(key, new Map());\n }\n\n var _id2 = nextID++;\n\n Recoil_nullthrows(nodeTransactionSubscriptions.get(key)).set(_id2, callback);\n return {\n release: function release() {\n var subs = nodeTransactionSubscriptions.get(key);\n\n if (subs) {\n subs.delete(_id2);\n\n if (subs.size === 0) {\n nodeTransactionSubscriptions.delete(key);\n }\n }\n }\n };\n }\n };\n\n var addTransactionMetadata = function addTransactionMetadata(metadata) {\n startNextTreeIfNeeded(storeRef.current.getState());\n\n for (var _i2 = 0, _Object$keys = Object.keys(metadata); _i2 < _Object$keys.length; _i2++) {\n var k = _Object$keys[_i2];\n Recoil_nullthrows(storeRef.current.getState().nextTree).transactionMetadata[k] = metadata[k];\n }\n };\n\n var replaceState = function replaceState(replacer) {\n var storeState = storeRef.current.getState();\n startNextTreeIfNeeded(storeState); // Use replacer to get the next state:\n\n var nextTree = Recoil_nullthrows(storeState.nextTree);\n var replaced;\n\n try {\n stateReplacerIsBeingExecuted = true;\n replaced = replacer(nextTree);\n } finally {\n stateReplacerIsBeingExecuted = false;\n }\n\n if (replaced === nextTree) {\n return;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n window.$recoilDebugStates.push(replaced); // TODO this shouldn't happen here because it's not batched\n }\n } // Save changes to nextTree and schedule a React update:\n\n\n storeState.nextTree = replaced;\n Recoil_nullthrows(notifyBatcherOfChange.current)();\n };\n\n var notifyBatcherOfChange = useRef(null);\n\n function setNotifyBatcherOfChange(x) {\n notifyBatcherOfChange.current = x;\n } // FIXME T2710559282599660\n\n\n var createMutableSource = (_createMutableSource = react.createMutableSource) !== null && _createMutableSource !== void 0 ? _createMutableSource : // flowlint-line unclear-type:off\n react.unstable_createMutableSource; // flowlint-line unclear-type:off\n\n var store = storeProp !== null && storeProp !== void 0 ? storeProp : {\n getState: function getState() {\n return storeState.current;\n },\n replaceState: replaceState,\n getGraph: getGraph,\n subscribeToTransactions: subscribeToTransactions,\n addTransactionMetadata: addTransactionMetadata\n };\n var storeRef = useRef(store);\n storeState = useRef(initializeState_DEPRECATED != null ? initialStoreState_DEPRECATED(store, initializeState_DEPRECATED) : initializeState != null ? initialStoreState(initializeState) : makeEmptyStoreState$2());\n var mutableSource = useMemo(function () {\n return createMutableSource ? createMutableSource(storeState, function () {\n return storeState.current.currentTree.version;\n }) : null;\n }, [createMutableSource, storeState]); // Cleanup when the is unmounted\n\n useEffect(function () {\n return function () {\n var _iterator18 = _createForOfIteratorHelper(storeRef.current.getState().knownAtoms),\n _step18;\n\n try {\n for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {\n var atomKey = _step18.value;\n cleanUpNode$1(storeRef.current, atomKey);\n }\n } catch (err) {\n _iterator18.e(err);\n } finally {\n _iterator18.f();\n }\n };\n }, []);\n return /*#__PURE__*/react.createElement(AppContext.Provider, {\n value: storeRef\n }, /*#__PURE__*/react.createElement(MutableSourceContext.Provider, {\n value: mutableSource\n }, /*#__PURE__*/react.createElement(Batcher, {\n setNotifyBatcherOfChange: setNotifyBatcherOfChange\n }), children));\n}\n\nvar Recoil_RecoilRoot_react = {\n useStoreRef: useStoreRef,\n useRecoilMutableSource: useRecoilMutableSource,\n RecoilRoot: RecoilRoot,\n sendEndOfBatchNotifications_FOR_TESTING: sendEndOfBatchNotifications\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n/**\n * Returns a map containing all of the keys + values from the original map where\n * the given callback returned true.\n */\n\nfunction filterMap(map, callback) {\n var result = new Map();\n\n var _iterator19 = _createForOfIteratorHelper(map),\n _step19;\n\n try {\n for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {\n var _step19$value = _slicedToArray(_step19.value, 2),\n key = _step19$value[0],\n value = _step19$value[1];\n\n if (callback(value, key)) {\n result.set(key, value);\n }\n }\n } catch (err) {\n _iterator19.e(err);\n } finally {\n _iterator19.f();\n }\n\n return result;\n}\n\nvar Recoil_filterMap = filterMap;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\n/**\n * Returns a set containing all of the values from the original set where\n * the given callback returned true.\n */\n\nfunction filterSet(set, callback) {\n var result = new Set();\n\n var _iterator20 = _createForOfIteratorHelper(set),\n _step20;\n\n try {\n for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {\n var value = _step20.value;\n\n if (callback(value)) {\n result.add(value);\n }\n }\n } catch (err) {\n _iterator20.e(err);\n } finally {\n _iterator20.f();\n }\n\n return result;\n}\n\nvar Recoil_filterSet = filterSet;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n\nvar invariant_1 = invariant; // @oss-only\n\nvar Recoil_invariant = invariant_1;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction mergeMaps() {\n var result = new Map();\n\n for (var _len5 = arguments.length, maps = new Array(_len5), _key9 = 0; _key9 < _len5; _key9++) {\n maps[_key9] = arguments[_key9];\n }\n\n for (var i = 0; i < maps.length; i++) {\n var iterator = maps[i].keys();\n var nextKey = void 0;\n\n while (!(nextKey = iterator.next()).done) {\n // $FlowFixMe[incompatible-call] - map/iterator knows nothing about flow types\n result.set(nextKey.value, maps[i].get(nextKey.value));\n }\n }\n /* $FlowFixMe[incompatible-return] (>=0.66.0 site=www,mobile) This comment\n * suppresses an error found when Flow v0.66 was deployed. To see the error\n * delete this comment and run Flow. */\n\n\n return result;\n}\n\nvar Recoil_mergeMaps = mergeMaps;\n\nvar _useMutableSource; // FIXME T2710559282599660\n\n\nvar useMutableSource = // flowlint-line unclear-type:off\n(_useMutableSource = react.useMutableSource) !== null && _useMutableSource !== void 0 ? _useMutableSource : react.unstable_useMutableSource; // flowlint-line unclear-type:off\n\nfunction mutableSourceExists() {\n return useMutableSource && !(typeof window !== 'undefined' && window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE);\n}\n\nvar Recoil_mutableSource = {\n mutableSourceExists: mutableSourceExists,\n useMutableSource: useMutableSource\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * MIT License\n *\n * Copyright (c) 2014-2019 Georg Tavonius\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nvar UNKNOWN_FUNCTION = '';\n/**\n * This parses the different stack traces and puts them into one format\n * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit)\n */\n\nfunction stackTraceParser(stackString) {\n var lines = stackString.split('\\n');\n return lines.reduce(function (stack, line) {\n var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);\n\n if (parseResult) {\n stack.push(parseResult);\n }\n\n return stack;\n }, []);\n}\n\nvar chromeRe = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nvar chromeEvalRe = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nfunction parseChrome(line) {\n var parts = chromeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n\n var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n var submatch = chromeEvalRe.exec(parts[2]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n\n parts[3] = submatch[2]; // line\n\n parts[4] = submatch[3]; // column\n }\n\n return {\n file: !isNative ? parts[2] : null,\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: isNative ? [parts[2]] : [],\n lineNumber: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar winjsRe = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseWinjs(line) {\n var parts = winjsRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar geckoRe = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar geckoEvalRe = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nfunction parseGecko(line) {\n var parts = geckoRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n var submatch = geckoEvalRe.exec(parts[3]);\n\n if (isEval && submatch != null) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: parts[2] ? parts[2].split(',') : [],\n lineNumber: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null\n };\n}\n\nvar javaScriptCoreRe = /^\\s*(?:([^@]*)(?:\\((.*?)\\))?@)?(\\S.*?):(\\d+)(?::(\\d+))?\\s*$/i;\n\nfunction parseJSC(line) {\n var parts = javaScriptCoreRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[3],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[4],\n column: parts[5] ? +parts[5] : null\n };\n}\n\nvar nodeRe = /^\\s*at (?:((?:\\[object object\\])?[^\\\\/]+(?: \\[as \\S+\\])?) )?\\(?(.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseNode(line) {\n var parts = nodeRe.exec(line);\n\n if (!parts) {\n return null;\n }\n\n return {\n file: parts[2],\n methodName: parts[1] || UNKNOWN_FUNCTION,\n arguments: [],\n lineNumber: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n}\n\nvar Recoil_stackTraceParser = stackTraceParser;\nvar useRef$1 = react.useRef;\n\nfunction useComponentName() {\n var nameRef = useRef$1();\n\n if (process.env.NODE_ENV !== \"production\") {\n if (Recoil_gkx_1('recoil_infer_component_names')) {\n var _nameRef$current;\n\n if (nameRef.current === undefined) {\n // There is no blessed way to determine the calling React component from\n // within a hook. This hack uses the fact that hooks must start with 'use'\n // and that hooks are either called by React Components or other hooks. It\n // follows therefore, that to find the calling component, you simply need\n // to look down the stack and find the first function which doesn't start\n // with 'use'. We are only enabling this in dev for now, since once the\n // codebase is minified, the naming assumptions no longer hold true.\n var frames = Recoil_stackTraceParser(new Error().stack);\n\n var _iterator21 = _createForOfIteratorHelper(frames),\n _step21;\n\n try {\n for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {\n var methodName = _step21.value.methodName;\n\n // I observed cases where the frame was of the form 'Object.useXXX'\n // hence why I'm searching for hooks following a word boundary\n if (!methodName.match(/\\buse[^\\b]+$/)) {\n return nameRef.current = methodName;\n }\n }\n } catch (err) {\n _iterator21.e(err);\n } finally {\n _iterator21.f();\n }\n\n nameRef.current = null;\n }\n\n return (_nameRef$current = nameRef.current) !== null && _nameRef$current !== void 0 ? _nameRef$current : '';\n }\n } // @fb-only: return \"\";\n\n\n return ''; // @oss-only\n}\n\nvar Recoil_useComponentName = useComponentName;\nvar useCallback = react.useCallback,\n useEffect$1 = react.useEffect,\n useMemo$1 = react.useMemo,\n useRef$2 = react.useRef,\n useState$1 = react.useState;\nvar batchUpdates$2 = Recoil_Batching.batchUpdates;\nvar DEFAULT_VALUE$2 = Recoil_Node.DEFAULT_VALUE,\n getNode$2 = Recoil_Node.getNode,\n nodes$1 = Recoil_Node.nodes;\nvar useRecoilMutableSource$1 = Recoil_RecoilRoot_react.useRecoilMutableSource,\n useStoreRef$1 = Recoil_RecoilRoot_react.useStoreRef;\nvar isRecoilValue$2 = Recoil_RecoilValue$1.isRecoilValue;\nvar AbstractRecoilValue$2 = Recoil_RecoilValueInterface.AbstractRecoilValue,\n getRecoilValueAsLoadable$2 = Recoil_RecoilValueInterface.getRecoilValueAsLoadable,\n setRecoilValue$2 = Recoil_RecoilValueInterface.setRecoilValue,\n setRecoilValueLoadable$1 = Recoil_RecoilValueInterface.setRecoilValueLoadable,\n setUnvalidatedRecoilValue$1 = Recoil_RecoilValueInterface.setUnvalidatedRecoilValue,\n subscribeToRecoilValue$1 = Recoil_RecoilValueInterface.subscribeToRecoilValue;\nvar Snapshot$1 = Recoil_Snapshot$1.Snapshot,\n cloneSnapshot$1 = Recoil_Snapshot$1.cloneSnapshot;\nvar setByAddingToSet$2 = Recoil_CopyOnWrite.setByAddingToSet;\nvar mutableSourceExists$1 = Recoil_mutableSource.mutableSourceExists,\n useMutableSource$1 = Recoil_mutableSource.useMutableSource;\n\nfunction handleLoadable(loadable, atom, storeRef) {\n // We can't just throw the promise we are waiting on to Suspense. If the\n // upstream dependencies change it may produce a state in which the component\n // can render, but it would still be suspended on a Promise that may never resolve.\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n var promise = new Promise(function (resolve) {\n storeRef.current.getState().suspendedComponentResolvers.add(resolve);\n });\n throw promise;\n } else if (loadable.state === 'hasError') {\n throw loadable.contents;\n } else {\n throw new Error(\"Invalid value of loadable atom \\\"\".concat(atom.key, \"\\\"\"));\n }\n}\n\nfunction validateRecoilValue(recoilValue, hookName) {\n if (!isRecoilValue$2(recoilValue)) {\n throw new Error(\"Invalid argument to \".concat(hookName, \": expected an atom or selector but got \").concat(String(recoilValue)));\n }\n}\n\nfunction useRecoilInterface_DEPRECATED() {\n var storeRef = useStoreRef$1();\n\n var _useState$ = useState$1([]),\n _useState$2 = _slicedToArray(_useState$, 2),\n _ = _useState$2[0],\n forceUpdate = _useState$2[1];\n\n var recoilValuesUsed = useRef$2(new Set());\n recoilValuesUsed.current = new Set(); // Track the RecoilValues used just during this render\n\n var previousSubscriptions = useRef$2(new Set());\n var subscriptions = useRef$2(new Map());\n var unsubscribeFrom = useCallback(function (key) {\n var sub = subscriptions.current.get(key);\n\n if (sub) {\n sub.release(storeRef.current);\n subscriptions.current.delete(key);\n }\n }, [storeRef, subscriptions]);\n var componentName = Recoil_useComponentName();\n useEffect$1(function () {\n var store = storeRef.current;\n\n function updateState(_state, key) {\n if (!subscriptions.current.has(key)) {\n return;\n }\n\n forceUpdate([]);\n }\n\n Recoil_differenceSets(recoilValuesUsed.current, previousSubscriptions.current).forEach(function (key) {\n if (subscriptions.current.has(key)) {\n Recoil_expectationViolation(\"Double subscription to RecoilValue \\\"\".concat(key, \"\\\"\"));\n return;\n }\n\n var sub = subscribeToRecoilValue$1(store, new AbstractRecoilValue$2(key), function (state) {\n Recoil_Tracing.trace('RecoilValue subscription fired', key, function () {\n updateState(state, key);\n });\n }, componentName);\n subscriptions.current.set(key, sub);\n Recoil_Tracing.trace('initial update on subscribing', key, function () {\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n // FIXME delete queuedComponentCallbacks_DEPRECATED when deleting useInterface.\n var state = store.getState();\n\n if (state.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(Recoil_Tracing.wrap(function () {\n updateState(store.getState(), key);\n }));\n } else {\n updateState(store.getState(), key);\n }\n });\n });\n Recoil_differenceSets(previousSubscriptions.current, recoilValuesUsed.current).forEach(function (key) {\n unsubscribeFrom(key);\n });\n previousSubscriptions.current = recoilValuesUsed.current;\n });\n useEffect$1(function () {\n var subs = subscriptions.current;\n return function () {\n return subs.forEach(function (_, key) {\n return unsubscribeFrom(key);\n });\n };\n }, [unsubscribeFrom]);\n return useMemo$1(function () {\n function useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n return function (newValueOrUpdater) {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n };\n }\n\n function useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n return function () {\n return setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n };\n }\n\n function useRecoilValueLoadable(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n if (!recoilValuesUsed.current.has(recoilValue.key)) {\n recoilValuesUsed.current = setByAddingToSet$2(recoilValuesUsed.current, recoilValue.key);\n } // TODO Restore optimization to memoize lookup\n\n\n return getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n }\n\n function useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n var loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n }\n\n function useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n }\n\n function useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n }\n\n return {\n getRecoilValue: useRecoilValue,\n getRecoilValueLoadable: useRecoilValueLoadable,\n getRecoilState: useRecoilState,\n getRecoilStateLoadable: useRecoilStateLoadable,\n getSetRecoilState: useSetRecoilState,\n getResetRecoilState: useResetRecoilState\n };\n }, [recoilValuesUsed, storeRef]);\n}\n\nvar recoilComponentGetRecoilValueCount_FOR_TESTING = {\n current: 0\n};\n\nfunction useRecoilValueLoadable_MUTABLESOURCE(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n var storeRef = useStoreRef$1();\n var getValue = useCallback(function () {\n if (process.env.NODE_ENV !== \"production\") {\n recoilComponentGetRecoilValueCount_FOR_TESTING.current++;\n }\n\n return getRecoilValueAsLoadable$2(storeRef.current, recoilValue, storeRef.current.getState().currentTree);\n }, [storeRef, recoilValue]);\n var componentName = Recoil_useComponentName();\n var subscribe = useCallback(function (_something, callback) {\n var store = storeRef.current;\n var sub = subscribeToRecoilValue$1(store, recoilValue, function () {\n Recoil_Tracing.trace('RecoilValue subscription fired', recoilValue.key, function () {\n callback();\n });\n }, componentName);\n return function () {\n return sub.release(store);\n };\n }, [recoilValue, storeRef, componentName]);\n return useMutableSource$1(useRecoilMutableSource$1(), getValue, subscribe);\n}\n\nfunction useRecoilValueLoadable_LEGACY(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValueLoadable');\n }\n\n var storeRef = useStoreRef$1();\n\n var _useState$3 = useState$1([]),\n _useState$4 = _slicedToArray(_useState$3, 2),\n _ = _useState$4[0],\n forceUpdate = _useState$4[1];\n\n var componentName = Recoil_useComponentName();\n useEffect$1(function () {\n var store = storeRef.current;\n var sub = subscribeToRecoilValue$1(store, recoilValue, function (_state) {\n Recoil_Tracing.trace('RecoilValue subscription fired', recoilValue.key, function () {\n forceUpdate([]);\n });\n }, componentName);\n Recoil_Tracing.trace('initial update on subscribing', recoilValue.key, function () {\n /**\n * Since we're subscribing in an effect we need to update to the latest\n * value of the atom since it may have changed since we rendered. We can\n * go ahead and do that now, unless we're in the middle of a batch --\n * in which case we should do it at the end of the batch, due to the\n * following edge case: Suppose an atom is updated in another useEffect\n * of this same component. Then the following sequence of events occur:\n * 1. Atom is updated and subs fired (but we may not be subscribed\n * yet depending on order of effects, so we miss this) Updated value\n * is now in nextTree, but not currentTree.\n * 2. This effect happens. We subscribe and update.\n * 3. From the update we re-render and read currentTree, with old value.\n * 4. Batcher's effect sets currentTree to nextTree.\n * In this sequence we miss the update. To avoid that, add the update\n * to queuedComponentCallback if a batch is in progress.\n */\n var state = store.getState();\n\n if (state.nextTree) {\n store.getState().queuedComponentCallbacks_DEPRECATED.push(Recoil_Tracing.wrap(function () {\n forceUpdate([]);\n }));\n } else {\n forceUpdate([]);\n }\n });\n return function () {\n return sub.release(store);\n };\n }, [recoilValue, storeRef]);\n return getRecoilValueAsLoadable$2(storeRef.current, recoilValue);\n}\n/**\n Like useRecoilValue(), but either returns the value if available or\n just undefined if not available for any reason, such as pending or error.\n*/\n\n\nfunction useRecoilValueLoadable(recoilValue) {\n if (mutableSourceExists$1()) {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_MUTABLESOURCE(recoilValue);\n } else {\n // eslint-disable-next-line fb-www/react-hooks\n return useRecoilValueLoadable_LEGACY(recoilValue);\n }\n}\n/**\n Returns the value represented by the RecoilValue.\n If the value is pending, it will throw a Promise to suspend the component,\n if the value is an error it will throw it for the nearest React error boundary.\n This will also subscribe the component for any updates in the value.\n */\n\n\nfunction useRecoilValue(recoilValue) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilValue, 'useRecoilValue');\n }\n\n var storeRef = useStoreRef$1();\n var loadable = useRecoilValueLoadable(recoilValue); // $FlowFixMe[escaped-generic]\n\n return handleLoadable(loadable, recoilValue, storeRef);\n}\n/**\n Returns a function that allows the value of a RecoilState to be updated, but does\n not subscribe the component to changes to that RecoilState.\n*/\n\n\nfunction useSetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useSetRecoilState');\n }\n\n var storeRef = useStoreRef$1();\n return useCallback(function (newValueOrUpdater) {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }, [storeRef, recoilState]);\n}\n/**\n Returns a function that will reset the value of a RecoilState to its default\n*/\n\n\nfunction useResetRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useResetRecoilState');\n }\n\n var storeRef = useStoreRef$1();\n return useCallback(function () {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }, [storeRef, recoilState]);\n}\n/**\n Equivalent to useState(). Allows the value of the RecoilState to be read and written.\n Subsequent updates to the RecoilState will cause the component to re-render. If the\n RecoilState is pending, this will suspend the component and initiate the\n retrieval of the value. If evaluating the RecoilState resulted in an error, this will\n throw the error so that the nearest React error boundary can catch it.\n*/\n\n\nfunction useRecoilState(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilState');\n }\n\n return [useRecoilValue(recoilState), useSetRecoilState(recoilState)];\n}\n/**\n Like useRecoilState(), but does not cause Suspense or React error handling. Returns\n an object that indicates whether the RecoilState is available, pending, or\n unavailable due to an error.\n*/\n\n\nfunction useRecoilStateLoadable(recoilState) {\n if (process.env.NODE_ENV !== \"production\") {\n // $FlowFixMe[escaped-generic]\n validateRecoilValue(recoilState, 'useRecoilStateLoadable');\n }\n\n return [useRecoilValueLoadable(recoilState), useSetRecoilState(recoilState)];\n}\n\nfunction useTransactionSubscription(callback) {\n var storeRef = useStoreRef$1();\n useEffect$1(function () {\n var sub = storeRef.current.subscribeToTransactions(callback);\n return sub.release;\n }, [callback, storeRef]);\n}\n\nfunction externallyVisibleAtomValuesInState(state) {\n var atomValues = state.atomValues;\n var persistedAtomContentsValues = Recoil_mapMap(Recoil_filterMap(atomValues, function (v, k) {\n var node = getNode$2(k);\n var persistence = node.persistence_UNSTABLE;\n return persistence != null && persistence.type !== 'none' && v.state === 'hasValue';\n }), function (v) {\n return v.contents;\n }); // Merge in nonvalidated atoms; we may not have defs for them but they will\n // all have persistence on or they wouldn't be there in the first place.\n\n return Recoil_mergeMaps(state.nonvalidatedAtoms, persistedAtomContentsValues);\n}\n/**\n Calls the given callback after any atoms have been modified and the consequent\n component re-renders have been committed. This is intended for persisting\n the values of the atoms to storage. The stored values can then be restored\n using the useSetUnvalidatedAtomValues hook.\n\n The callback receives the following info:\n\n atomValues: The current value of every atom that is both persistable (persistence\n type not set to 'none') and whose value is available (not in an\n error or loading state).\n\n previousAtomValues: The value of every persistable and available atom before\n the transaction began.\n\n atomInfo: A map containing the persistence settings for each atom. Every key\n that exists in atomValues will also exist in atomInfo.\n\n modifiedAtoms: The set of atoms that were written to during the transaction.\n\n transactionMetadata: Arbitrary information that was added via the\n useSetUnvalidatedAtomValues hook. Useful for ignoring the useSetUnvalidatedAtomValues\n transaction, to avoid loops.\n*/\n\n\nfunction useTransactionObservation_DEPRECATED(callback) {\n useTransactionSubscription(useCallback(function (store) {\n var previousTree = store.getState().previousTree;\n var currentTree = store.getState().currentTree;\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil');\n previousTree = store.getState().currentTree; // attempt to trundle on\n }\n\n var atomValues = externallyVisibleAtomValuesInState(currentTree);\n var previousAtomValues = externallyVisibleAtomValuesInState(previousTree);\n var atomInfo = Recoil_mapMap(nodes$1, function (node) {\n var _node$persistence_UNS, _node$persistence_UNS2, _node$persistence_UNS3, _node$persistence_UNS4;\n\n return {\n persistence_UNSTABLE: {\n type: (_node$persistence_UNS = (_node$persistence_UNS2 = node.persistence_UNSTABLE) === null || _node$persistence_UNS2 === void 0 ? void 0 : _node$persistence_UNS2.type) !== null && _node$persistence_UNS !== void 0 ? _node$persistence_UNS : 'none',\n backButton: (_node$persistence_UNS3 = (_node$persistence_UNS4 = node.persistence_UNSTABLE) === null || _node$persistence_UNS4 === void 0 ? void 0 : _node$persistence_UNS4.backButton) !== null && _node$persistence_UNS3 !== void 0 ? _node$persistence_UNS3 : false\n }\n };\n }); // Filter on existance in atomValues so that externally-visible rules\n // are also applied to modified atoms (specifically exclude selectors):\n\n var modifiedAtoms = Recoil_filterSet(currentTree.dirtyAtoms, function (k) {\n return atomValues.has(k) || previousAtomValues.has(k);\n });\n callback({\n atomValues: atomValues,\n previousAtomValues: previousAtomValues,\n atomInfo: atomInfo,\n modifiedAtoms: modifiedAtoms,\n transactionMetadata: _objectSpread({}, currentTree.transactionMetadata)\n });\n }, [callback]));\n}\n\nfunction useRecoilTransactionObserver(callback) {\n useTransactionSubscription(useCallback(function (store) {\n callback({\n snapshot: cloneSnapshot$1(store, 'current'),\n previousSnapshot: cloneSnapshot$1(store, 'previous')\n });\n }, [callback]));\n} // Return a snapshot of the current state and subscribe to all state changes\n\n\nfunction useRecoilSnapshot() {\n var storeRef = useStoreRef$1();\n\n var _useState$5 = useState$1(function () {\n return cloneSnapshot$1(storeRef.current);\n }),\n _useState$6 = _slicedToArray(_useState$5, 2),\n snapshot = _useState$6[0],\n setSnapshot = _useState$6[1];\n\n useTransactionSubscription(useCallback(function (store) {\n return setSnapshot(cloneSnapshot$1(store));\n }, []));\n return snapshot;\n}\n\nfunction useGotoRecoilSnapshot() {\n var storeRef = useStoreRef$1();\n return useCallback(function (snapshot) {\n var _storeState$nextTree;\n\n var storeState = storeRef.current.getState();\n var prev = (_storeState$nextTree = storeState.nextTree) !== null && _storeState$nextTree !== void 0 ? _storeState$nextTree : storeState.currentTree;\n var next = snapshot.getStore_INTERNAL().getState().currentTree;\n batchUpdates$2(function () {\n var keysToUpdate = new Set();\n\n for (var _i3 = 0, _arr = [prev.atomValues.keys(), next.atomValues.keys()]; _i3 < _arr.length; _i3++) {\n var keys = _arr[_i3];\n\n var _iterator22 = _createForOfIteratorHelper(keys),\n _step22;\n\n try {\n for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {\n var key = _step22.value;\n\n var _prev$atomValues$get, _next$atomValues$get;\n\n if (((_prev$atomValues$get = prev.atomValues.get(key)) === null || _prev$atomValues$get === void 0 ? void 0 : _prev$atomValues$get.contents) !== ((_next$atomValues$get = next.atomValues.get(key)) === null || _next$atomValues$get === void 0 ? void 0 : _next$atomValues$get.contents) && getNode$2(key).shouldRestoreFromSnapshots) {\n keysToUpdate.add(key);\n }\n }\n } catch (err) {\n _iterator22.e(err);\n } finally {\n _iterator22.f();\n }\n }\n\n keysToUpdate.forEach(function (key) {\n setRecoilValueLoadable$1(storeRef.current, new AbstractRecoilValue$2(key), next.atomValues.has(key) ? Recoil_nullthrows(next.atomValues.get(key)) : DEFAULT_VALUE$2);\n });\n storeRef.current.replaceState(function (state) {\n return _objectSpread(_objectSpread({}, state), {}, {\n stateID: snapshot.getID_INTERNAL()\n });\n });\n });\n }, [storeRef]);\n}\n\nfunction useSetUnvalidatedAtomValues() {\n var storeRef = useStoreRef$1();\n return function (values) {\n var transactionMetadata = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n batchUpdates$2(function () {\n storeRef.current.addTransactionMetadata(transactionMetadata);\n values.forEach(function (value, key) {\n return setUnvalidatedRecoilValue$1(storeRef.current, new AbstractRecoilValue$2(key), value);\n });\n });\n };\n}\n\nvar Sentinel = function Sentinel() {\n _classCallCheck(this, Sentinel);\n};\n\nvar SENTINEL = new Sentinel();\n\nfunction useRecoilCallback(fn, deps) {\n var storeRef = useStoreRef$1();\n var gotoSnapshot = useGotoRecoilSnapshot();\n return useCallback(function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key10 = 0; _key10 < _len6; _key10++) {\n args[_key10] = arguments[_key10];\n }\n\n // Use currentTree for the snapshot to show the currently committed state\n var snapshot = cloneSnapshot$1(storeRef.current);\n\n function set(recoilState, newValueOrUpdater) {\n setRecoilValue$2(storeRef.current, recoilState, newValueOrUpdater);\n }\n\n function reset(recoilState) {\n setRecoilValue$2(storeRef.current, recoilState, DEFAULT_VALUE$2);\n }\n\n var ret = SENTINEL;\n batchUpdates$2(function () {\n // flowlint-next-line unclear-type:off\n ret = fn({\n set: set,\n reset: reset,\n snapshot: snapshot,\n gotoSnapshot: gotoSnapshot\n }).apply(void 0, args);\n });\n !!(ret instanceof Sentinel) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'batchUpdates should return immediately') : Recoil_invariant(false) : void 0;\n return ret;\n }, deps != null ? [].concat(_toConsumableArray(deps), [storeRef]) : undefined // eslint-disable-line fb-www/react-hooks-deps\n );\n}\n\nvar Recoil_Hooks = {\n recoilComponentGetRecoilValueCount_FOR_TESTING: recoilComponentGetRecoilValueCount_FOR_TESTING,\n useGotoRecoilSnapshot: useGotoRecoilSnapshot,\n useRecoilCallback: useRecoilCallback,\n useRecoilInterface: useRecoilInterface_DEPRECATED,\n useRecoilSnapshot: useRecoilSnapshot,\n useRecoilState: useRecoilState,\n useRecoilStateLoadable: useRecoilStateLoadable,\n useRecoilTransactionObserver: useRecoilTransactionObserver,\n useRecoilValue: useRecoilValue,\n useRecoilValueLoadable: useRecoilValueLoadable,\n useResetRecoilState: useResetRecoilState,\n useSetRecoilState: useSetRecoilState,\n useSetUnvalidatedAtomValues: useSetUnvalidatedAtomValues,\n useTransactionObservation_DEPRECATED: useTransactionObservation_DEPRECATED,\n useTransactionSubscription_DEPRECATED: useTransactionSubscription\n};\nvar useMemo$2 = react.useMemo;\nvar RecoilRoot$1 = Recoil_RecoilRoot_react.RecoilRoot,\n useStoreRef$2 = Recoil_RecoilRoot_react.useStoreRef;\n\nfunction useRecoilBridgeAcrossReactRoots() {\n var store = useStoreRef$2().current;\n return useMemo$2(function () {\n function RecoilBridge(_ref10) {\n var children = _ref10.children;\n return /*#__PURE__*/react.createElement(RecoilRoot$1, {\n store_INTERNAL: store\n }, children);\n }\n\n return RecoilBridge;\n }, [store]);\n}\n\nvar Recoil_useRecoilBridgeAcrossReactRoots = useRecoilBridgeAcrossReactRoots;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n// Split declaration and implementation to allow this function to pretend to\n// check for actual instance of Promise instead of something with a `then`\n// method.\n// eslint-disable-next-line no-redeclare\n\nfunction isPromise(p) {\n return !!p && typeof p.then === 'function';\n}\n\nvar Recoil_isPromise = isPromise; // TODO Convert Loadable to a Class to allow for runtime type detection.\n// Containing static factories of withValue(), withError(), withPromise(), and all()\n\nvar loadableAccessors = {\n /**\n * if loadable has a value (state === 'hasValue'), return that value.\n * Otherwise, throw the (unwrapped) promise or the error.\n */\n getValue: function getValue() {\n if (this.state === 'loading' && Recoil_gkx_1('recoil_async_selector_refactor')) {\n throw this.contents.then(function (_ref11) {\n var __value = _ref11.__value;\n return __value;\n });\n }\n\n if (this.state !== 'hasValue') {\n throw this.contents;\n }\n\n return this.contents;\n },\n toPromise: function toPromise() {\n return this.state === 'hasValue' ? Promise.resolve(this.contents) : this.state === 'hasError' ? Promise.reject(this.contents) : Recoil_gkx_1('recoil_async_selector_refactor') ? this.contents.then(function (_ref12) {\n var __value = _ref12.__value;\n return __value;\n }) : this.contents;\n },\n valueMaybe: function valueMaybe() {\n return this.state === 'hasValue' ? this.contents : undefined;\n },\n valueOrThrow: function valueOrThrow() {\n if (this.state !== 'hasValue') {\n throw new Error(\"Loadable expected value, but in \\\"\".concat(this.state, \"\\\" state\"));\n }\n\n return this.contents;\n },\n errorMaybe: function errorMaybe() {\n return this.state === 'hasError' ? this.contents : undefined;\n },\n errorOrThrow: function errorOrThrow() {\n if (this.state !== 'hasError') {\n throw new Error(\"Loadable expected error, but in \\\"\".concat(this.state, \"\\\" state\"));\n }\n\n return this.contents;\n },\n promiseMaybe: function promiseMaybe() {\n return this.state === 'loading' ? Recoil_gkx_1('recoil_async_selector_refactor') ? this.contents.then(function (_ref13) {\n var __value = _ref13.__value;\n return __value;\n }) : this.contents : undefined;\n },\n promiseOrThrow: function promiseOrThrow() {\n if (this.state !== 'loading') {\n throw new Error(\"Loadable expected promise, but in \\\"\".concat(this.state, \"\\\" state\"));\n }\n\n return Recoil_gkx_1('recoil_async_selector_refactor') ? this.contents.then(function (_ref14) {\n var __value = _ref14.__value;\n return __value;\n }) : this.contents;\n },\n // TODO Unit tests\n // TODO Convert Loadable to a Class to better support chaining\n // by returning a Loadable from a map function\n map: function map(_map) {\n var _this3 = this;\n\n if (this.state === 'hasError') {\n return this;\n }\n\n if (this.state === 'hasValue') {\n try {\n var next = _map(this.contents); // TODO if next instanceof Loadable, then return next\n\n\n return Recoil_isPromise(next) ? loadableWithPromise(next) : loadableWithValue(next);\n } catch (e) {\n return Recoil_isPromise(e) ? // If we \"suspended\", then try again.\n // errors and subsequent retries will be handled in 'loading' case\n loadableWithPromise(e.next(function () {\n return _map(_this3.contents);\n })) : loadableWithError(e);\n }\n }\n\n if (this.state === 'loading') {\n return loadableWithPromise(this.contents // TODO if map returns a loadable, then return the value or promise or throw the error\n .then(_map).catch(function (e) {\n if (Recoil_isPromise(e)) {\n // we were \"suspended,\" try again\n return e.then(function () {\n return _map(_this3.contents);\n });\n }\n\n throw e;\n }));\n }\n\n throw new Error('Invalid Loadable state');\n }\n};\n\nfunction loadableWithValue(value) {\n // Build objects this way since Flow doesn't support disjoint unions for class properties\n return Object.freeze(_objectSpread({\n state: 'hasValue',\n contents: value\n }, loadableAccessors));\n}\n\nfunction loadableWithError(error) {\n return Object.freeze(_objectSpread({\n state: 'hasError',\n contents: error\n }, loadableAccessors));\n}\n\nfunction loadableWithPromise(promise) {\n return Object.freeze(_objectSpread({\n state: 'loading',\n contents: promise\n }, loadableAccessors));\n}\n\nfunction loadableLoading() {\n return loadableWithPromise(new Promise(function () {}));\n}\n\nfunction loadableAll(inputs) {\n return inputs.every(function (i) {\n return i.state === 'hasValue';\n }) ? loadableWithValue(inputs.map(function (i) {\n return i.contents;\n })) : inputs.some(function (i) {\n return i.state === 'hasError';\n }) ? loadableWithError( // $FlowIssue[incompatible-call] #44070740 Array.find should refine parameter\n Recoil_nullthrows(inputs.find(function (i) {\n return i.state === 'hasError';\n }), 'Invalid loadable passed to loadableAll').contents) : loadableWithPromise(Recoil_gkx_1('recoil_async_selector_refactor') ? Promise.all(inputs.map(function (i) {\n return i.contents;\n })).then(function (value) {\n return {\n __value: value\n };\n }) : Promise.all(inputs.map(function (i) {\n return i.contents;\n })));\n}\n\nvar Recoil_Loadable = {\n loadableWithValue: loadableWithValue,\n loadableWithError: loadableWithError,\n loadableWithPromise: loadableWithPromise,\n loadableLoading: loadableLoading,\n loadableAll: loadableAll\n};\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nvar ARRAY_BUFFER_VIEW_TYPES = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, DataView];\n\nfunction isArrayBufferView(value) {\n var _iterator23 = _createForOfIteratorHelper(ARRAY_BUFFER_VIEW_TYPES),\n _step23;\n\n try {\n for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {\n var type = _step23.value;\n\n if (value instanceof type) {\n return true;\n }\n }\n } catch (err) {\n _iterator23.e(err);\n } finally {\n _iterator23.f();\n }\n\n return false;\n}\n\nvar Recoil_isArrayBufferView = isArrayBufferView;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction isNode(object) {\n var _ownerDocument, _doc$defaultView;\n\n if (typeof window === 'undefined') {\n return false;\n }\n\n var doc = object != null ? (_ownerDocument = object.ownerDocument) !== null && _ownerDocument !== void 0 ? _ownerDocument : object : document;\n var defaultView = (_doc$defaultView = doc.defaultView) !== null && _doc$defaultView !== void 0 ? _doc$defaultView : window;\n return !!(object != null && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nvar Recoil_isNode = isNode;\nvar isSSR = typeof window === 'undefined';\nvar isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative'; // eslint-disable-line fb-www/typeof-undefined\n\nfunction shouldNotBeFrozen(value) {\n // Primitives and functions:\n if (value === null || typeof value !== 'object') {\n return true;\n } // React elements:\n\n\n switch (typeof value.$$typeof) {\n case 'symbol':\n return true;\n\n case 'number':\n return true;\n } // Immutable structures:\n\n\n if (value['@@__IMMUTABLE_ITERABLE__@@'] != null || value['@@__IMMUTABLE_KEYED__@@'] != null || value['@@__IMMUTABLE_INDEXED__@@'] != null || value['@@__IMMUTABLE_ORDERED__@@'] != null || value['@@__IMMUTABLE_RECORD__@@'] != null) {\n return true;\n } // DOM nodes:\n\n\n if (Recoil_isNode(value)) {\n return true;\n }\n\n if (Recoil_isPromise(value)) {\n return true;\n }\n\n if (Recoil_isArrayBufferView(value)) {\n return true;\n } // Some environments, just as Jest, don't work with the instanceof check\n\n\n if (!isSSR && !isReactNative && ( // $FlowFixMe Window does not have a FlowType definition https://github.com/facebook/flow/issues/6709\n value === window || value instanceof Window)) {\n return true;\n }\n\n return false;\n} // Recursively freeze a value to enforce it is read-only.\n// This may also have minimal performance improvements for enumerating\n// objects (based on browser implementations, of course)\n\n\nfunction deepFreezeValue(value) {\n if (typeof value !== 'object' || shouldNotBeFrozen(value)) {\n return;\n }\n\n Object.freeze(value); // Make all properties read-only\n\n for (var key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n var prop = value[key]; // Prevent infinite recurssion for circular references.\n\n if (typeof prop === 'object' && prop != null && !Object.isFrozen(prop)) {\n deepFreezeValue(prop);\n }\n }\n }\n\n Object.seal(value); // This also makes existing properties non-configurable.\n}\n\nvar Recoil_deepFreezeValue = deepFreezeValue;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n// cache implementation that only stores the most recent entry\n// based on key reference equality\n\nfunction cacheMostRecent() {\n var mostRecentKey;\n var mostRecentValue;\n var cache = {\n get: function get(key) {\n return key === mostRecentKey ? mostRecentValue : undefined;\n },\n set: function set(key, value) {\n mostRecentKey = key;\n mostRecentValue = value;\n return cache;\n }\n };\n return cache;\n}\n\nvar Recoil_cacheMostRecent = cacheMostRecent;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Implements (a subset of) the interface of built-in Map but supports arrays as\n * keys. Two keys are equal if corresponding elements are equal according to the\n * equality semantics of built-in Map. Operations are at worst O(n*b) where n is\n * the array length and b is the complexity of the built-in operation.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nvar LEAF = Symbol('ArrayKeyedMap');\nvar emptyMap = new Map();\n\nvar ArrayKeyedMap = /*#__PURE__*/function () {\n function ArrayKeyedMap(existing) {\n _classCallCheck(this, ArrayKeyedMap);\n\n _defineProperty(this, \"_base\", new Map());\n\n if (existing instanceof ArrayKeyedMap) {\n var _iterator24 = _createForOfIteratorHelper(existing.entries()),\n _step24;\n\n try {\n for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {\n var _step24$value = _slicedToArray(_step24.value, 2),\n k = _step24$value[0],\n v = _step24$value[1];\n\n this.set(k, v);\n }\n } catch (err) {\n _iterator24.e(err);\n } finally {\n _iterator24.f();\n }\n } else if (existing) {\n var _iterator25 = _createForOfIteratorHelper(existing),\n _step25;\n\n try {\n for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {\n var _step25$value = _slicedToArray(_step25.value, 2),\n _k = _step25$value[0],\n _v = _step25$value[1];\n\n this.set(_k, _v);\n }\n } catch (err) {\n _iterator25.e(err);\n } finally {\n _iterator25.f();\n }\n }\n\n return this;\n }\n\n _createClass(ArrayKeyedMap, [{\n key: \"get\",\n value: function get(key) {\n var ks = Array.isArray(key) ? key : [key];\n var map = this._base;\n ks.forEach(function (k) {\n var _map$get;\n\n map = (_map$get = map.get(k)) !== null && _map$get !== void 0 ? _map$get : emptyMap;\n });\n return map === undefined ? undefined : map.get(LEAF);\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n var ks = Array.isArray(key) ? key : [key];\n var map = this._base;\n var next = map;\n ks.forEach(function (k) {\n next = map.get(k);\n\n if (!next) {\n next = new Map();\n map.set(k, next);\n }\n\n map = next;\n });\n next.set(LEAF, value);\n return this;\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n var ks = Array.isArray(key) ? key : [key];\n var map = this._base;\n var next = map;\n ks.forEach(function (k) {\n next = map.get(k);\n\n if (!next) {\n next = new Map();\n map.set(k, next);\n }\n\n map = next;\n });\n next.delete(LEAF); // TODO We could cleanup empty maps\n\n return this;\n }\n }, {\n key: \"entries\",\n value: function entries() {\n var answer = [];\n\n function recurse(level, prefix) {\n level.forEach(function (v, k) {\n if (k === LEAF) {\n answer.push([prefix, v]);\n } else {\n recurse(v, prefix.concat(k));\n }\n });\n }\n\n recurse(this._base, []);\n return answer.values();\n }\n }, {\n key: \"toBuiltInMap\",\n value: function toBuiltInMap() {\n return new Map(this.entries());\n }\n }]);\n\n return ArrayKeyedMap;\n}();\n\nvar Recoil_ArrayKeyedMap = {\n ArrayKeyedMap: ArrayKeyedMap\n};\nvar Recoil_ArrayKeyedMap_1 = Recoil_ArrayKeyedMap.ArrayKeyedMap;\nvar Recoil_ArrayKeyedMap$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ArrayKeyedMap: Recoil_ArrayKeyedMap_1\n});\nvar ArrayKeyedMap$1 = Recoil_ArrayKeyedMap$1.ArrayKeyedMap;\n\nfunction cacheWithReferenceEquality() {\n return new ArrayKeyedMap$1();\n}\n\nvar Recoil_cacheWithReferenceEquality = cacheWithReferenceEquality;\nvar TIME_WARNING_THRESHOLD_MS = 15;\n\nfunction stringify(x, opt, key) {\n // A optimization to avoid the more expensive JSON.stringify() for simple strings\n // This may lose protection for u2028 and u2029, though.\n if (typeof x === 'string' && !x.includes('\"') && !x.includes('\\\\')) {\n return \"\\\"\".concat(x, \"\\\"\");\n } // Handle primitive types\n\n\n switch (typeof x) {\n case 'undefined':\n return '';\n // JSON.stringify(undefined) returns undefined, but we always want to return a string\n\n case 'boolean':\n return x ? 'true' : 'false';\n\n case 'number':\n case 'symbol':\n // case 'bigint': // BigInt is not supported in www\n return String(x);\n\n case 'string':\n // Add surrounding quotes and escape internal quotes\n return JSON.stringify(x);\n\n case 'function':\n if ((opt === null || opt === void 0 ? void 0 : opt.allowFunctions) !== true) {\n throw new Error('Attempt to serialize function in a Recoil cache key');\n }\n\n return \"__FUNCTION(\".concat(x.name, \")__\");\n }\n\n if (x === null) {\n return 'null';\n } // Fallback case for unknown types\n\n\n if (typeof x !== 'object') {\n var _JSON$stringify;\n\n return (_JSON$stringify = JSON.stringify(x)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : '';\n } // Deal with all promises as equivalent for now.\n\n\n if (Recoil_isPromise(x)) {\n return '__PROMISE__';\n } // Arrays handle recursive stringification\n\n\n if (Array.isArray(x)) {\n return \"[\".concat(x.map(function (v, i) {\n return stringify(v, opt, i.toString());\n }), \"]\");\n } // If an object defines a toJSON() method, then use that to override the\n // serialization. This matches the behavior of JSON.stringify().\n // Pass the key for compatibility.\n // Immutable.js collections define this method to allow us to serialize them.\n\n\n if (typeof x.toJSON === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(x.toJSON(key), opt, key);\n } // For built-in Maps, sort the keys in a stable order instead of the\n // default insertion order. Support non-string keys.\n\n\n if (x instanceof Map) {\n var obj = {};\n\n var _iterator26 = _createForOfIteratorHelper(x),\n _step26;\n\n try {\n for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {\n var _step26$value = _slicedToArray(_step26.value, 2),\n k = _step26$value[0],\n v = _step26$value[1];\n\n // Stringify will escape any nested quotes\n obj[typeof k === 'string' ? k : stringify(k, opt)] = v;\n }\n } catch (err) {\n _iterator26.e(err);\n } finally {\n _iterator26.f();\n }\n\n return stringify(obj, opt, key);\n } // For built-in Sets, sort the keys in a stable order instead of the\n // default insertion order.\n\n\n if (x instanceof Set) {\n return stringify(Array.from(x).sort(function (a, b) {\n return stringify(a, opt).localeCompare(stringify(b, opt));\n }), opt, key);\n } // Anything else that is iterable serialize as an Array.\n\n\n if (x[Symbol.iterator] != null && typeof x[Symbol.iterator] === 'function') {\n // flowlint-next-line unclear-type: off\n return stringify(Array.from(x), opt, key);\n } // For all other Objects, sort the keys in a stable order.\n\n\n return \"{\".concat(Object.keys(x).filter(function (key) {\n return x[key] !== undefined;\n }).sort() // stringify the key to add quotes and escape any nested slashes or quotes.\n .map(function (key) {\n return \"\".concat(stringify(key, opt), \":\").concat(stringify(x[key], opt, key));\n }).join(','), \"}\");\n} // Utility similar to JSON.stringify() except:\n// * Serialize built-in Sets as an Array\n// * Serialize built-in Maps as an Object. Supports non-string keys.\n// * Serialize other iterables as arrays\n// * Sort the keys of Objects and Maps to have a stable order based on string conversion.\n// This overrides their default insertion order.\n// * Still uses toJSON() of any object to override serialization\n// * Support Symbols (though don't guarantee uniqueness)\n// * We could support BigInt, but Flow doesn't seem to like it.\n// See Recoil_stableStringify-test.js for examples\n\n\nfunction stableStringify(x) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n allowFunctions: false\n };\n\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== 'undefined') {\n var startTime = window.performance ? window.performance.now() : 0;\n var str = stringify(x, opt);\n var endTime = window.performance ? window.performance.now() : 0;\n\n if (endTime - startTime > TIME_WARNING_THRESHOLD_MS) {\n /* eslint-disable fb-www/no-console */\n console.groupCollapsed(\"Recoil: Spent \".concat(endTime - startTime, \"ms computing a cache key\"));\n console.warn(x, str);\n console.groupEnd();\n /* eslint-enable fb-www/no-console */\n }\n\n return str;\n }\n }\n\n return stringify(x, opt);\n}\n\nvar Recoil_stableStringify = stableStringify; // If we do profile and find the key equality check is expensive,\n// we could always try to optimize.. Something that comes to mind is having\n// each check assign an incrementing index to each reference that maps to the\n// value equivalency. Then, if an object already has an index, the comparison\n// check/lookup would be trivial and the string serialization would only need\n// to be done once per object instance. Just a thought..\n// Cache implementation to use value equality for keys instead of the default\n// reference equality. This allows different instances of dependency values to\n// be used. Normally this is not needed, as dependent atoms/selectors will\n// themselves be cached and always return the same instance. However, if\n// different params or upstream values for those dependencies could produce\n// equivalent values or they have a custom cache implementation, then this\n// implementation may be needed. The downside with this approach is that it\n// takes longer to compute the value equivalence vs simple reference equality.\n\nfunction cacheWithValueEquality() {\n var map = new Map();\n var cache = {\n get: function get(key) {\n return map.get(Recoil_stableStringify(key));\n },\n set: function set(key, value) {\n map.set(Recoil_stableStringify(key), value);\n return cache;\n },\n map: map // For debugging\n\n };\n return cache;\n}\n\nvar Recoil_cacheWithValueEquality = cacheWithValueEquality;\n/**\n * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction nodeCacheMostRecent() {\n var mostRecent;\n return {\n get: function get(getNodeValue, handlers) {\n if (mostRecent === undefined) {\n return undefined;\n }\n\n var _iterator27 = _createForOfIteratorHelper(mostRecent.route),\n _step27;\n\n try {\n for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {\n var _step27$value = _slicedToArray(_step27.value, 2),\n nodeKey = _step27$value[0],\n nodeValue = _step27$value[1];\n\n var _handlers$onCacheHit;\n\n if (getNodeValue(nodeKey) !== nodeValue) {\n return undefined;\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onCacheHit = handlers.onCacheHit) === null || _handlers$onCacheHit === void 0 ? void 0 : _handlers$onCacheHit.call(handlers, nodeKey);\n }\n } catch (err) {\n _iterator27.e(err);\n } finally {\n _iterator27.f();\n }\n\n return mostRecent.value;\n },\n set: function set(route, value) {\n mostRecent = {\n route: route,\n value: value\n };\n },\n getRoot: function getRoot() {\n return mostRecent;\n }\n };\n}\n\nvar Recoil_nodeCacheMostRecent = nodeCacheMostRecent;\n\nfunction setInTreeCache(root, route, result) {\n if (root == null) {\n if (route.length === 0) {\n return {\n type: 'result',\n result: result\n };\n } else {\n var _route = _toArray(route),\n path = _route[0],\n rest = _route.slice(1);\n\n var _path = _slicedToArray(path, 2),\n nodeKey = _path[0],\n value = _path[1];\n\n var ret = {\n type: 'branch',\n nodeKey: nodeKey,\n branches: new Map([[value, setInTreeCache(null, rest, result)]])\n };\n return ret;\n }\n } else {\n if (route.length === 0) {\n !(root.type === 'result') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Existing cache must have a result type node at the end of the route') : Recoil_invariant(false) : void 0;\n\n if (root.result && root.result.state === 'loading') {\n var _ret = {\n type: 'result',\n result: result\n };\n return _ret;\n } else {\n !(root.result === result) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Existing cache must have the same result at the end of the route') : Recoil_invariant(false) : void 0;\n var _ret2 = root;\n return _ret2;\n }\n } else {\n var _route2 = _toArray(route),\n _path2 = _route2[0],\n _rest = _route2.slice(1);\n\n var _path3 = _slicedToArray(_path2, 2),\n _nodeKey = _path3[0],\n _value = _path3[1];\n\n !(root.type === 'branch') ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Existing cache must have a branch midway through the route') : Recoil_invariant(false) : void 0;\n !(root.nodeKey === _nodeKey) ? process.env.NODE_ENV !== \"production\" ? Recoil_invariant(false, 'Existing cache must have a branch for the same nodeKey midway through the route') : Recoil_invariant(false) : void 0;\n root.branches.set(_value, setInTreeCache(root.branches.get(_value), _rest, result));\n return root;\n }\n }\n}\n\nfunction getFromTreeCache(root, getNodeValue, handlers) {\n var _handlers$onCacheHit;\n\n if (root == null) {\n return undefined;\n }\n\n if (root.type === 'result') {\n return root.result;\n }\n\n handlers === null || handlers === void 0 ? void 0 : (_handlers$onCacheHit = handlers.onCacheHit) === null || _handlers$onCacheHit === void 0 ? void 0 : _handlers$onCacheHit.call(handlers, root.nodeKey);\n var nodeValue = getNodeValue(root.nodeKey);\n return getFromTreeCache(root.branches.get(nodeValue), getNodeValue, handlers);\n}\n\nvar Recoil_TreeNodeCache = {\n setInTreeCache: setInTreeCache,\n getFromTreeCache: getFromTreeCache\n};\nvar getFromTreeCache$1 = Recoil_TreeNodeCache.getFromTreeCache,\n setInTreeCache$1 = Recoil_TreeNodeCache.setInTreeCache;\n\nfunction treeCacheReferenceEquality() {\n var treeRoot;\n return {\n get: function get(getNodeValue, handlers) {\n return getFromTreeCache$1(treeRoot, getNodeValue, handlers);\n },\n set: function set(route, result) {\n treeRoot = setInTreeCache$1(treeRoot, route, result);\n },\n getRoot: function getRoot() {\n return treeRoot;\n }\n };\n}\n\nvar Recoil_treeCacheReferenceEquality = treeCacheReferenceEquality;\nvar getFromTreeCache$2 = Recoil_TreeNodeCache.getFromTreeCache,\n setInTreeCache$2 = Recoil_TreeNodeCache.setInTreeCache;\n\nfunction treeCacheValueEquality() {\n var treeRoot;\n return {\n get: function get(getNodeValue, handlers) {\n return getFromTreeCache$2(treeRoot, function (nodeKey) {\n return Recoil_stableStringify(getNodeValue(nodeKey));\n }, handlers);\n },\n set: function set(route, result) {\n treeRoot = setInTreeCache$2(treeRoot, route.map(function (_ref15) {\n var _ref16 = _slicedToArray(_ref15, 2),\n nodeKey = _ref16[0],\n nodeValue = _ref16[1];\n\n return [nodeKey, Recoil_stableStringify(nodeValue)];\n }), result);\n },\n getRoot: function getRoot() {\n return treeRoot;\n }\n };\n}\n\nvar Recoil_treeCacheValueEquality = treeCacheValueEquality;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails oncall+recoil\n * \n * @format\n *\n * This is a stub for some integration into FB internal stuff\n */\n\nfunction startPerfBlock(_id) {\n return function () {\n return null;\n };\n}\n\nvar Recoil_PerformanceTimings = {\n startPerfBlock: startPerfBlock\n};\nvar loadableWithError$1 = Recoil_Loadable.loadableWithError,\n loadableWithPromise$1 = Recoil_Loadable.loadableWithPromise,\n loadableWithValue$1 = Recoil_Loadable.loadableWithValue;\nvar getNodeLoadable$2 = Recoil_FunctionalCore.getNodeLoadable,\n peekNodeLoadable$2 = Recoil_FunctionalCore.peekNodeLoadable,\n setNodeValue$3 = Recoil_FunctionalCore.setNodeValue;\nvar saveDependencyMapToStore$3 = Recoil_Graph.saveDependencyMapToStore;\nvar DEFAULT_VALUE$3 = Recoil_Node.DEFAULT_VALUE,\n RecoilValueNotReady$2 = Recoil_Node.RecoilValueNotReady,\n registerNode$1 = Recoil_Node.registerNode;\nvar isRecoilValue$3 = Recoil_RecoilValue$1.isRecoilValue;\nvar AbstractRecoilValue$3 = Recoil_RecoilValue$1.AbstractRecoilValue;\nvar setRecoilValueLoadable$2 = Recoil_RecoilValueInterface.setRecoilValueLoadable;\nvar startPerfBlock$1 = Recoil_PerformanceTimings.startPerfBlock; // flowlint-next-line unclear-type:off\n\nvar emptySet$1 = Object.freeze(new Set());\nvar dependencyStack = []; // for detecting circular dependencies.\n\nvar waitingStores = new Map();\n/* eslint-disable no-redeclare */\n\nvar getNewExecutionId = function () {\n var executionId = 0;\n return function () {\n return executionId++;\n };\n}();\n\nfunction getInitialExecutionInfo() {\n return {\n depValuesDiscoveredSoFarDuringAsyncWork: null,\n latestLoadable: null,\n latestExecutionId: null,\n stateVersion: null\n };\n}\n\nfunction selector(options) {\n var key = options.key,\n get = options.get,\n cacheImplementation = options.cacheImplementation_UNSTABLE;\n var set = options.set != null ? options.set : undefined; // flow\n\n /**\n * HACK: doing this as a way to map given cache to corresponding tree cache\n */\n\n var cache = cacheImplementation === Recoil_cacheWithReferenceEquality ? Recoil_treeCacheReferenceEquality() : cacheImplementation === Recoil_cacheWithValueEquality ? Recoil_treeCacheValueEquality() : cacheImplementation === Recoil_cacheMostRecent ? Recoil_nodeCacheMostRecent() : Recoil_treeCacheReferenceEquality();\n var executionInfo = getInitialExecutionInfo();\n\n function initSelector(store) {\n store.getState().knownSelectors.add(key);\n }\n\n function notifyStoreWhenAsyncSettles(store, loadable, executionId) {\n if (loadable.state === 'loading') {\n var stores = waitingStores.get(executionId);\n\n if (stores == null) {\n waitingStores.set(executionId, stores = new Set());\n }\n\n stores.add(store);\n }\n }\n /**\n * FIXME: we should keep track of latest execution id _per store_ and update\n * the stores accordingly.\n */\n\n\n function notifyStoresOfSettledAsync(newLoadable, executionId) {\n var stores = waitingStores.get(executionId);\n\n if (stores !== undefined) {\n var _iterator28 = _createForOfIteratorHelper(stores),\n _step28;\n\n try {\n for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {\n var store = _step28.value;\n setRecoilValueLoadable$2(store, new AbstractRecoilValue$3(key), newLoadable);\n }\n } catch (err) {\n _iterator28.e(err);\n } finally {\n _iterator28.f();\n }\n\n waitingStores.delete(executionId);\n }\n }\n\n function getCachedNodeLoadable(store, state, key) {\n if (state.atomValues.has(key)) {\n return [new Map(), Recoil_nullthrows(state.atomValues.get(key))];\n }\n\n var _getNodeLoadable$3 = getNodeLoadable$2(store, state, key),\n _getNodeLoadable$4 = _slicedToArray(_getNodeLoadable$3, 2),\n loadable = _getNodeLoadable$4[1];\n\n var isKeyPointingToSelector = store.getState().knownSelectors.has(key);\n\n if (loadable.state !== 'loading' && isKeyPointingToSelector) {\n state.atomValues.set(key, loadable);\n }\n\n return [new Map(), loadable];\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * returned from a selector's get() (either explicitly or implicitly by\n * running a function that uses the \"async\" keyword). If a selector's get()\n * returns a promise, we have two possibilities:\n *\n * 1. The promise will resolve, in which case it will have completely finished\n * executing without any remaining pending dependencies. No more retries\n * are needed and we can proceed with updating the cache and notifying\n * subscribers (if it is the latest execution, otherwise only the cache\n * will be updated and subscriptions will not be fired). This is the case\n * handled by the attached then() handler.\n *\n * 2. The promise will throw because it either has an error or it came across\n * an async dependency that has not yet resolved, in which case we will\n * call wrapDepdencyPromise(), whose responsibility is to handle dependency\n * promises. This case is handled by the attached catch() handler.\n *\n * Both branches will eventually resolve to the final result of the selector\n * (or an error if a real error occurred).\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was thrown--AKA a\n * dependency promise. Dependency promises should be passed to\n * wrapPendingDependencyPromise()).\n */\n\n\n function wrapPendingPromise(store, promise, state, depValues, executionId) {\n return promise.then(function (value) {\n var loadable = loadableWithValue$1(value);\n maybeFreezeValue(value);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setLoadableInStoreToNotifyDeps(loadable, executionId);\n return {\n __value: value,\n __key: key\n };\n }).catch(function (errorOrPromise) {\n if (isLatestExecution(executionId)) {\n updateExecutionInfoDepValues(depValues, executionId);\n }\n\n if (Recoil_isPromise(errorOrPromise)) {\n return wrapPendingDependencyPromise(store, errorOrPromise, state, depValues, executionId);\n }\n\n var loadable = loadableWithError$1(errorOrPromise);\n maybeFreezeValue(errorOrPromise);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setLoadableInStoreToNotifyDeps(loadable, executionId);\n throw errorOrPromise;\n });\n }\n /**\n * This function attaches a then() and a catch() to a promise that was\n * thrown from a selector's get(). If a selector's get() throws a promise,\n * we have two possibilities:\n *\n * 1. The promise will resolve, meaning one of our selector's dependencies is\n * now available and we should \"retry\" our get() by running it again. This\n * is the case handled by the attached then() handler.\n *\n * 2. The promise will throw because something went wrong with the dependency\n * promise (in other words a real error occurred). This case is handled by\n * the attached catch() handler. If the dependency promise throws, it is\n * _always_ a real error and not another dependency promise (any dependency\n * promises would have been handled upstream).\n *\n * The then() branch will eventually resolve to the final result of the\n * selector (or an error if a real error occurs), and the catch() will always\n * resolve to an error because the dependency promise is a promise that was\n * wrapped upstream, meaning it will only resolve to its real value or to a\n * real error.\n *\n * The execution will run to completion even if it is stale, and its value\n * will be cached. But stale executions will not update global state or update\n * executionInfo as that is the responsibility of the 'latest' execution.\n *\n * Note this function should not be passed a promise that was returned from\n * get(). The intention is that this function is only passed promises that\n * were thrown due to a pending dependency. Promises returned by get() should\n * be passed to wrapPendingPromise() instead.\n */\n\n\n function wrapPendingDependencyPromise(store, promise, state, existingDeps, executionId) {\n return promise.then(function (resolvedDep) {\n var resolvedDepKey = resolvedDep.__key,\n depValue = resolvedDep.__value;\n\n if (resolvedDepKey != null) {\n /**\n * Note for async atoms, this means we are changing the atom's value\n * in the store for the given version. This should be alright because\n * the version of state is now stale and a new version will have\n * already been triggered by the atom being resolved (see this logic\n * in Recoil_atom.js)\n */\n state.atomValues.set(resolvedDepKey, loadableWithValue$1(depValue));\n }\n\n var _evaluateSelectorGett = evaluateSelectorGetter(store, state, executionId),\n _evaluateSelectorGett2 = _slicedToArray(_evaluateSelectorGett, 2),\n loadable = _evaluateSelectorGett2[0],\n depValues = _evaluateSelectorGett2[1];\n\n if (isLatestExecution(executionId)) {\n updateExecutionInfoDepValues(depValues, executionId);\n }\n\n maybeFreezeLoadableContents(loadable);\n\n if (loadable.state !== 'loading') {\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setLoadableInStoreToNotifyDeps(loadable, executionId);\n }\n\n if (loadable.state === 'hasError') {\n throw loadable.contents;\n }\n\n if (loadable.state === 'hasValue') {\n return {\n __value: loadable.contents,\n __key: key\n };\n }\n /**\n * Returning promise here without wrapping as the wrapepr logic was\n * already done when we called evaluateSelectorGetter() to get this\n * loadable\n */\n\n\n return loadable.contents;\n }).catch(function (error) {\n var loadable = loadableWithError$1(error);\n maybeFreezeValue(error);\n setCache(state, depValuesToDepRoute(existingDeps), loadableWithError$1(error));\n setLoadableInStoreToNotifyDeps(loadable, executionId);\n throw error;\n });\n }\n\n function setLoadableInStoreToNotifyDeps(loadable, executionId) {\n if (isLatestExecution(executionId)) {\n setExecutionInfo(loadable);\n notifyStoresOfSettledAsync(loadable, executionId);\n }\n }\n\n function setDepsInStore(store, state, deps, executionId) {\n var _store$getState, _store$getState$curre, _store$getState2, _store$getState2$next;\n\n if (isLatestExecution(executionId) || state.version === ((_store$getState = store.getState()) === null || _store$getState === void 0 ? void 0 : (_store$getState$curre = _store$getState.currentTree) === null || _store$getState$curre === void 0 ? void 0 : _store$getState$curre.version) || state.version === ((_store$getState2 = store.getState()) === null || _store$getState2 === void 0 ? void 0 : (_store$getState2$next = _store$getState2.nextTree) === null || _store$getState2$next === void 0 ? void 0 : _store$getState2$next.version)) {\n var _store$getState$nextT, _store$getState3, _store$getState3$next;\n\n saveDependencyMapToStore$3(new Map([[key, deps]]), store, (_store$getState$nextT = (_store$getState3 = store.getState()) === null || _store$getState3 === void 0 ? void 0 : (_store$getState3$next = _store$getState3.nextTree) === null || _store$getState3$next === void 0 ? void 0 : _store$getState3$next.version) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree.version);\n }\n }\n\n function setNewDepInStore(store, state, deps, newDepKey, executionId) {\n deps.add(newDepKey);\n setDepsInStore(store, state, deps, executionId);\n }\n\n function evaluateSelectorGetter(store, state, executionId) {\n var endPerfBlock = startPerfBlock$1(key); // TODO T63965866: use execution ID here\n\n var result;\n var loadable;\n var depValues = new Map();\n /**\n * Starting a fresh set of deps that we'll be using to update state. We're\n * starting a new set versus adding it in existing state deps because\n * the version of state that we update deps for may be a more recent version\n * than the version the selector was called with. This is because the latest\n * execution will update the deps of the current/latest version of state (\n * this is safe to do because the fact that the selector is the latest\n * execution means the deps we discover below are our best guess at the\n * deps for the current/latest state in the store)\n */\n\n var deps = new Set();\n setDepsInStore(store, state, deps, executionId);\n\n function getRecoilValue(recoilValue) {\n var depKey = recoilValue.key;\n setNewDepInStore(store, state, deps, depKey, executionId);\n\n var _getCachedNodeLoadabl = getCachedNodeLoadable(store, state, depKey),\n _getCachedNodeLoadabl2 = _slicedToArray(_getCachedNodeLoadabl, 2),\n depLoadable = _getCachedNodeLoadabl2[1];\n\n depValues.set(depKey, depLoadable);\n\n if (depLoadable.state === 'hasValue') {\n return depLoadable.contents;\n }\n\n throw depLoadable.contents;\n }\n\n try {\n result = get({\n get: getRecoilValue\n });\n result = isRecoilValue$3(result) ? getRecoilValue(result) : result;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingPromise(store, result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n endPerfBlock();\n }\n } catch (errorOrDepPromise) {\n result = errorOrDepPromise;\n\n if (Recoil_isPromise(result)) {\n result = wrapPendingDependencyPromise(store, result, state, depValues, executionId).finally(endPerfBlock);\n } else {\n endPerfBlock();\n }\n }\n\n if (result instanceof Error) {\n loadable = loadableWithError$1(result);\n } else if (Recoil_isPromise(result)) {\n loadable = loadableWithPromise$1(result);\n } else {\n loadable = loadableWithValue$1(result);\n }\n\n maybeFreezeLoadableContents(loadable);\n return [loadable, depValues];\n }\n\n function getValFromCacheAndUpdatedDownstreamDeps(store, state) {\n var _store$getGraph$nodeD;\n\n if (state.atomValues.has(key)) {\n return state.atomValues.get(key);\n }\n\n var deps = new Set((_store$getGraph$nodeD = store.getGraph(state.version).nodeDeps.get(key)) !== null && _store$getGraph$nodeD !== void 0 ? _store$getGraph$nodeD : emptySet$1);\n setDepsInStore(store, state, deps, executionInfo.latestExecutionId);\n var cachedVal = cache.get(function (nodeKey) {\n var _getCachedNodeLoadabl3 = getCachedNodeLoadable(store, state, nodeKey),\n _getCachedNodeLoadabl4 = _slicedToArray(_getCachedNodeLoadabl3, 2),\n loadable = _getCachedNodeLoadabl4[1];\n\n return loadable.contents;\n }, {\n onCacheHit: function onCacheHit(nodeKey) {\n if (nodeKey !== key) {\n setNewDepInStore(store, state, deps, nodeKey, executionInfo.latestExecutionId);\n }\n }\n });\n return cachedVal;\n }\n /**\n * FIXME: dep keys should take into account the state of the loadable to\n * prevent the edge case where a loadable with an error and a loadable with\n * an error as a value are treated as the same thing incorrectly. For example\n * these two should be treated differently:\n *\n * selector({key: '', get: () => new Error('hi')});\n * selector({key: '', get () => {throw new Error('hi')}});\n *\n * With current implementation they are treated the same\n */\n\n\n function depValuesToDepRoute(depValues) {\n return Array.from(depValues.entries()).map(function (_ref17) {\n var _ref18 = _slicedToArray(_ref17, 2),\n key = _ref18[0],\n valLoadable = _ref18[1];\n\n return [key, valLoadable.contents];\n });\n }\n\n function getValFromRunningNewExecutionAndUpdatedDeps(store, state) {\n var newExecutionId = getNewExecutionId();\n\n var _evaluateSelectorGett3 = evaluateSelectorGetter(store, state, newExecutionId),\n _evaluateSelectorGett4 = _slicedToArray(_evaluateSelectorGett3, 2),\n loadable = _evaluateSelectorGett4[0],\n newDepValues = _evaluateSelectorGett4[1];\n\n setExecutionInfo(loadable, newDepValues, newExecutionId, state);\n maybeSetCacheWithLoadable(state, depValuesToDepRoute(newDepValues), loadable);\n notifyStoreWhenAsyncSettles(store, loadable, newExecutionId);\n return loadable;\n }\n /**\n * Given a tree state, this function returns the \"selector result\", which is\n * defined as a size-2 tuple of [DependencyMap, Loadable].\n *\n * The selector's get() function will only be re-evaluated if _both_ of the\n * following statements are true:\n *\n * 1. The current dep values from the given state produced a cache key that\n * was not found in the cache.\n * 2. There is no currently running async execution OR there is an\n * async execution that is running, but after comparing the dep values in\n * the given state with the dep values that the execution has discovered so\n * far we find that at least one dep value has changed, in which case we\n * start a new execution (the previously running execution will continue to\n * run to completion, but only the new execution will be deemed the\n * 'latest' execution, meaning it will be the only execution that will\n * update global state when it is finished. Any non-latest executions will\n * run to completion and update the selector cache but not global state).\n */\n\n\n function getSelectorValAndUpdatedDeps(store, state) {\n var cachedVal = getValFromCacheAndUpdatedDownstreamDeps(store, state);\n\n if (cachedVal != null) {\n setExecutionInfo(cachedVal);\n return cachedVal;\n } // FIXME: this won't work with custom caching b/c it uses separate cache\n\n\n if (asyncWorkIsInProgressAndDepsDiscoveredHaveNotChanged(store, state)) {\n notifyStoreWhenAsyncSettles(store, Recoil_nullthrows(executionInfo.latestLoadable), Recoil_nullthrows(executionInfo.latestExecutionId)); // FIXME: check after the fact to see if we made the right choice by waiting\n\n return Recoil_nullthrows(executionInfo.latestLoadable);\n }\n\n return getValFromRunningNewExecutionAndUpdatedDeps(store, state);\n }\n\n function asyncWorkIsInProgressAndDepsDiscoveredHaveNotChanged(store, state) {\n return executionInfo.latestLoadable != null && executionInfo.latestExecutionId != null && !haveAsyncDepsChanged(store, state);\n }\n\n var mapOfCheckedVersions = new Map();\n\n function haveAsyncDepsChanged(store, state) {\n var _executionInfo$depVal, _mapOfCheckedVersions;\n\n var oldDepValues = (_executionInfo$depVal = executionInfo.depValuesDiscoveredSoFarDuringAsyncWork) !== null && _executionInfo$depVal !== void 0 ? _executionInfo$depVal : new Map();\n var cachedDepValuesCheckedForThisVersion = Array(((_mapOfCheckedVersions = mapOfCheckedVersions.get(state.version)) !== null && _mapOfCheckedVersions !== void 0 ? _mapOfCheckedVersions : new Map()).entries());\n var isCachedVersionSame = mapOfCheckedVersions.has(state.version) && cachedDepValuesCheckedForThisVersion.length === oldDepValues.size && cachedDepValuesCheckedForThisVersion.every(function (_ref19) {\n var _ref20 = _slicedToArray(_ref19, 2),\n nodeKey = _ref20[0],\n nodeVal = _ref20[1];\n\n return oldDepValues.get(nodeKey) === nodeVal;\n });\n\n if (oldDepValues == null || state.version === executionInfo.stateVersion || isCachedVersionSame) {\n return false;\n }\n\n mapOfCheckedVersions.set(state.version, new Map(oldDepValues));\n return Array.from(oldDepValues).some(function (_ref21) {\n var _ref22 = _slicedToArray(_ref21, 2),\n nodeKey = _ref22[0],\n oldVal = _ref22[1];\n\n var _getCachedNodeLoadabl5 = getCachedNodeLoadable(store, state, nodeKey),\n _getCachedNodeLoadabl6 = _slicedToArray(_getCachedNodeLoadabl5, 2),\n loadable = _getCachedNodeLoadabl6[1];\n\n return loadable.contents !== oldVal.contents &&\n /**\n * FIXME: in the condition below we're making the assumption that a\n * dependency that goes from loading to having a value is always because\n * the dependency resolved to that value, so we don't count it as a dep\n * change as the normal retry loop will handle retrying in response to a\n * resolved async dep. This is an incorrect assumption for the edge case\n * where there is an async selector that is loading, and while it is\n * loading one of its dependencies changes, triggering a new execution,\n * and that new execution produces a value synchronously (we don't make\n * that assumption for asynchronous work b/c it's guaranteed that a\n * loadable that goes from 'loading' to 'loading' in a new loadable is\n * a dep change).\n */\n !(oldVal.state === 'loading' && loadable.state !== 'loading');\n });\n }\n /**\n * This function will update the selector's execution info when the selector\n * has either finished running an execution or has started a new execution. If\n * the given loadable is in a 'loading' state, the intention is that a new\n * execution has started. Otherwise, the intention is that an execution has\n * just finished.\n */\n\n\n function setExecutionInfo(loadable, depValues, newExecutionId, state) {\n if (loadable.state === 'loading') {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n executionInfo.latestExecutionId = newExecutionId;\n executionInfo.latestLoadable = loadable;\n executionInfo.stateVersion = state === null || state === void 0 ? void 0 : state.version;\n } else {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = null;\n executionInfo.latestExecutionId = null;\n executionInfo.latestLoadable = null;\n executionInfo.stateVersion = null;\n }\n }\n /**\n * Conditionally updates the cache with a given loadable.\n *\n * We only cache loadables that are not loading because our cache keys are\n * based on dep values, which are in an unfinished state for loadables that\n * have a 'loading' state (new deps may be discovered while the selector\n * runs its async code). We never want to cache partial dependencies b/c it\n * could lead to errors, such as prematurely returning the result based on a\n * partial list of deps-- we need the full list of deps to ensure that we\n * are returning the correct result from cache.\n */\n\n\n function maybeSetCacheWithLoadable(state, depRoute, loadable) {\n if (loadable.state !== 'loading') {\n setCache(state, depRoute, loadable);\n }\n }\n\n function updateExecutionInfoDepValues(depValues, executionId) {\n if (isLatestExecution(executionId)) {\n executionInfo.depValuesDiscoveredSoFarDuringAsyncWork = depValues;\n }\n }\n\n function isLatestExecution(executionId) {\n return executionId === executionInfo.latestExecutionId;\n }\n\n function maybeFreezeLoadableContents(loadable) {\n if (loadable.state !== 'loading') {\n maybeFreezeValue(loadable.contents);\n }\n }\n\n function maybeFreezeValue(val) {\n if (process.env.NODE_ENV !== \"production\") {\n if (Boolean(options.dangerouslyAllowMutability) === false) {\n Recoil_deepFreezeValue(val);\n }\n }\n }\n\n function setCache(state, cacheRoute, loadable) {\n state.atomValues.set(key, loadable);\n cache.set(cacheRoute, loadable);\n }\n\n function detectCircularDependencies(fn) {\n if (dependencyStack.includes(key)) {\n var message = \"Recoil selector has circular dependencies: \".concat(dependencyStack.slice(dependencyStack.indexOf(key)).join(\" \\u2192 \"));\n return loadableWithError$1(new Error(message));\n }\n\n dependencyStack.push(key);\n\n try {\n return fn();\n } finally {\n dependencyStack.pop();\n }\n }\n\n function myPeek(store, state) {\n var cacheVal = cache.get(function (nodeKey) {\n var peek = peekNodeLoadable$2(store, state, nodeKey);\n return peek === null || peek === void 0 ? void 0 : peek.contents;\n });\n return cacheVal;\n }\n\n function myGet(store, state) {\n initSelector(store);\n return [new Map(), detectCircularDependencies(function () {\n return getSelectorValAndUpdatedDeps(store, state);\n })];\n }\n\n function invalidate(state) {\n state.atomValues.delete(key);\n }\n\n if (set != null) {\n var mySet = function mySet(store, state, newValue) {\n initSelector(store);\n var dependencyMap = new Map();\n var writes = new Map();\n\n function getRecoilValue(_ref23) {\n var key = _ref23.key;\n\n var _getCachedNodeLoadabl7 = getCachedNodeLoadable(store, state, key),\n _getCachedNodeLoadabl8 = _slicedToArray(_getCachedNodeLoadabl7, 2),\n loadable = _getCachedNodeLoadabl8[1];\n\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n throw new RecoilValueNotReady$2(key);\n } else {\n throw loadable.contents;\n }\n }\n\n function setRecoilState(recoilState, valueOrUpdater) {\n var newValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict type S from being a function itself without losing support for opaque types\n // flowlint-next-line unclear-type:off\n valueOrUpdater(getRecoilValue(recoilState)) : valueOrUpdater;\n\n var _setNodeValue$5 = setNodeValue$3(store, state, recoilState.key, newValue),\n _setNodeValue$6 = _slicedToArray(_setNodeValue$5, 2),\n upstreamWrites = _setNodeValue$6[1];\n\n upstreamWrites.forEach(function (v, k) {\n return writes.set(k, v);\n });\n }\n\n function resetRecoilState(recoilState) {\n setRecoilState(recoilState, DEFAULT_VALUE$3);\n }\n\n set({\n set: setRecoilState,\n get: getRecoilValue,\n reset: resetRecoilState\n }, newValue);\n return [dependencyMap, writes];\n };\n\n return registerNode$1({\n key: key,\n peek: myPeek,\n get: myGet,\n set: mySet,\n cleanUp: function cleanUp() {},\n invalidate: invalidate,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false\n });\n } else {\n return registerNode$1({\n key: key,\n peek: myPeek,\n get: myGet,\n cleanUp: function cleanUp() {},\n invalidate: invalidate,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false\n });\n }\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selector_NEW = selector;\nvar loadableWithError$2 = Recoil_Loadable.loadableWithError,\n loadableWithPromise$2 = Recoil_Loadable.loadableWithPromise,\n loadableWithValue$2 = Recoil_Loadable.loadableWithValue;\nvar getNodeLoadable$3 = Recoil_FunctionalCore.getNodeLoadable,\n peekNodeLoadable$3 = Recoil_FunctionalCore.peekNodeLoadable,\n setNodeValue$4 = Recoil_FunctionalCore.setNodeValue;\nvar addToDependencyMap$1 = Recoil_Graph.addToDependencyMap,\n mergeDepsIntoDependencyMap$1 = Recoil_Graph.mergeDepsIntoDependencyMap,\n saveDependencyMapToStore$4 = Recoil_Graph.saveDependencyMapToStore;\nvar DEFAULT_VALUE$4 = Recoil_Node.DEFAULT_VALUE,\n RecoilValueNotReady$3 = Recoil_Node.RecoilValueNotReady,\n registerNode$2 = Recoil_Node.registerNode;\nvar AbstractRecoilValue$4 = Recoil_RecoilValue$1.AbstractRecoilValue;\nvar getRecoilValueAsLoadable$3 = Recoil_RecoilValueInterface.getRecoilValueAsLoadable,\n isRecoilValue$4 = Recoil_RecoilValueInterface.isRecoilValue,\n setRecoilValueLoadable$3 = Recoil_RecoilValueInterface.setRecoilValueLoadable;\nvar startPerfBlock$2 = Recoil_PerformanceTimings.startPerfBlock; // flowlint-next-line unclear-type:off\n\nvar emptySet$2 = Object.freeze(new Set());\n\nfunction cacheKeyFromDepValues(depValues) {\n var answer = [];\n\n var _iterator29 = _createForOfIteratorHelper(Array.from(depValues.keys()).sort()),\n _step29;\n\n try {\n for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {\n var key = _step29.value;\n var loadable = Recoil_nullthrows(depValues.get(key));\n answer.push(key);\n answer.push(loadable.state);\n answer.push(loadable.contents);\n }\n } catch (err) {\n _iterator29.e(err);\n } finally {\n _iterator29.f();\n }\n\n return answer;\n}\n\nvar dependencyStack$1 = []; // for detecting circular dependencies.\n\nvar waitingStores$1 = new Map();\n/* eslint-disable no-redeclare */\n\nfunction selector$1(options) {\n var key = options.key,\n get = options.get,\n cacheImplementation = options.cacheImplementation_UNSTABLE;\n var set = options.set != null ? options.set : undefined; // flow\n\n var cache = cacheImplementation !== null && cacheImplementation !== void 0 ? cacheImplementation : Recoil_cacheWithReferenceEquality();\n\n function initSelector(store) {\n store.getState().knownSelectors.add(key);\n }\n\n function letStoreBeNotifiedWhenAsyncSettles(store, loadable) {\n if (loadable.state === 'loading') {\n var stores = waitingStores$1.get(loadable);\n\n if (stores === undefined) {\n waitingStores$1.set(loadable, stores = new Set());\n }\n\n stores.add(store);\n }\n }\n\n function notifyStoresOfSettledAsync(originalLoadable, newLoadable) {\n var stores = waitingStores$1.get(originalLoadable);\n\n if (stores !== undefined) {\n var _iterator30 = _createForOfIteratorHelper(stores),\n _step30;\n\n try {\n for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {\n var store = _step30.value;\n setRecoilValueLoadable$3(store, new AbstractRecoilValue$4(key), newLoadable);\n }\n } catch (err) {\n _iterator30.e(err);\n } finally {\n _iterator30.f();\n }\n\n waitingStores$1.delete(originalLoadable);\n }\n }\n\n function putIntoCache(state, cacheKey, loadable) {\n if (loadable.state !== 'loading') {\n // Synchronous result\n if (process.env.NODE_ENV !== \"production\") {\n if (!options.dangerouslyAllowMutability === true) {\n Recoil_deepFreezeValue(loadable.contents);\n }\n }\n } else {\n // Asynchronous result\n // When the promise resolves, we need to replace the loading state in the\n // cache and fire any external subscriptions to re-render with the new value.\n loadable.contents.then(function (result) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!options.dangerouslyAllowMutability === true) {\n Recoil_deepFreezeValue(result);\n }\n }\n\n var newLoadable = loadableWithValue$2(result); // If the value is now resolved, then update the cache with the new value\n\n cache = cache.set(cacheKey, newLoadable); // TODO Potential optimization: I think this is updating the cache\n // with a cacheKey of the dep when it wasn't ready yet. We could also\n // theoretically put the result in the cache for a cacheKey with the\n // dep resolved. If we had some way of figuring out what that cacheKey was..\n // Note that this optimization would change the user visible behavior slightly,\n // see the unit test \"useRecoilState - selector catching promise 2\".\n // If the user catches and handles pending async dependencies, then returns\n // a promise that resolves when they are available there is a question if\n // the result of that promise should be the value of the selector, or if\n // the selector should re-evaluate when the dependency is available.\n // If the promise returned and the pending dependency resolve at different\n // times, then the behaviour is better defined, as in the unit test,\n // \"useRecoilState - selector catching promise and resolving asynchronously\"\n // Fire subscriptions to re-render any subscribed components with the new value.\n // The store uses the CURRENT state, not the old state from which\n // this was called. That state likely doesn't have the subscriptions saved yet.\n // Note that we have to set the value for this key, not just notify\n // components, so that there will be a new version for useMutableSource.\n\n notifyStoresOfSettledAsync(loadable, newLoadable);\n return result;\n }).catch(function (error) {\n // TODO Figure out why we are catching promises here versus evaluateSelectorFunction\n // OH, I see why. Ok, work on this.\n if (Recoil_isPromise(error)) {\n return error;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!options.dangerouslyAllowMutability === true) {\n Recoil_deepFreezeValue(error);\n }\n } // The async value was rejected with an error. Update the cache with\n // the error and fire subscriptions to re-render.\n\n\n var newLoadable = loadableWithError$2(error);\n cache = cache.set(cacheKey, newLoadable);\n notifyStoresOfSettledAsync(loadable, newLoadable);\n return error;\n });\n }\n\n cache = cache.set(cacheKey, loadable);\n\n if (loadable.state !== 'loading') {\n state.atomValues.set(key, loadable);\n }\n }\n\n function getFromCacheOrEvaluate(store, state) {\n var _store$getGraph$nodeD;\n\n var dependencyMap = new Map(); // First, get the current deps for this selector\n\n var currentDeps = (_store$getGraph$nodeD = store.getGraph(state.version).nodeDeps.get(key)) !== null && _store$getGraph$nodeD !== void 0 ? _store$getGraph$nodeD : emptySet$2;\n var depValues = new Map(Array.from(currentDeps).sort().map(function (depKey) {\n var _getNodeLoadable$5 = getNodeLoadable$3(store, state, depKey),\n _getNodeLoadable$6 = _slicedToArray(_getNodeLoadable$5, 2),\n deps = _getNodeLoadable$6[0],\n loadable = _getNodeLoadable$6[1];\n\n mergeDepsIntoDependencyMap$1(deps, dependencyMap);\n saveDependencyMapToStore$4(dependencyMap, store, state.version);\n return [depKey, loadable];\n })); // Always cache and evaluate a selector\n // It may provide a result even when not all deps are available.\n\n var cacheKey = cacheKeyFromDepValues(depValues);\n var cached = cache.get(cacheKey);\n\n if (cached != null) {\n letStoreBeNotifiedWhenAsyncSettles(store, cached);\n return [dependencyMap, cached];\n } // Cache miss, compute the value\n\n\n var _evaluateSelectorFunc = evaluateSelectorFunction(store, state),\n _evaluateSelectorFunc2 = _slicedToArray(_evaluateSelectorFunc, 3),\n deps = _evaluateSelectorFunc2[0],\n loadable = _evaluateSelectorFunc2[1],\n newDepValues = _evaluateSelectorFunc2[2];\n\n mergeDepsIntoDependencyMap$1(deps, dependencyMap);\n saveDependencyMapToStore$4(dependencyMap, store, state.version); // Save result in cache\n\n var newCacheKey = cacheKeyFromDepValues(newDepValues);\n letStoreBeNotifiedWhenAsyncSettles(store, loadable);\n putIntoCache(state, newCacheKey, loadable);\n return [dependencyMap, loadable];\n }\n\n function evaluateSelectorFunction(store, state) {\n var endPerfBlock = startPerfBlock$2(key);\n var depValues = new Map(); // key -> value for our deps\n\n var dependencyMap = new Map(); // node -> nodes, part of overall dep map.\n\n function getRecoilValue(_ref24) {\n var depKey = _ref24.key;\n addToDependencyMap$1(key, depKey, dependencyMap);\n\n var _getNodeLoadable$7 = getNodeLoadable$3(store, state, depKey),\n _getNodeLoadable$8 = _slicedToArray(_getNodeLoadable$7, 2),\n deps = _getNodeLoadable$8[0],\n loadable = _getNodeLoadable$8[1];\n\n depValues.set(depKey, loadable);\n mergeDepsIntoDependencyMap$1(deps, dependencyMap);\n saveDependencyMapToStore$4(dependencyMap, store, state.version);\n\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else {\n throw loadable.contents; // Promise or error\n }\n }\n\n try {\n // The big moment!\n var output = get({\n get: getRecoilValue\n }); // TODO Allow user to also return Loadables for improved composability\n\n var result = isRecoilValue$4(output) ? getRecoilValue(output) : output;\n var loadable;\n\n if (!Recoil_isPromise(result)) {\n // The selector returned a simple synchronous value, so let's use it!\n endPerfBlock();\n loadable = loadableWithValue$2(result);\n } else {\n // The user returned a promise for an asynchronous selector. This will\n // resolve to the proper value of the selector when available.\n loadable = loadableWithPromise$2(result.finally(endPerfBlock));\n }\n\n return [dependencyMap, loadable, depValues];\n } catch (errorOrDepPromise) {\n // XXX why was this changed to not use isPromise?\n var isP = errorOrDepPromise.then !== undefined;\n\n var _loadable2;\n\n if (!isP) {\n // There was a synchronous error in the evaluation\n endPerfBlock();\n _loadable2 = loadableWithError$2(errorOrDepPromise);\n } else {\n // If an asynchronous dependency was not ready, then return a promise that\n // will resolve when we finally do have a real value or error for the selector.\n _loadable2 = loadableWithPromise$2(errorOrDepPromise.then(function () {\n // Now that its deps are ready, re-evaluate the selector (and\n // record any newly-discovered dependencies in the Store):\n var loadable = getRecoilValueAsLoadable$3(store, new AbstractRecoilValue$4(key));\n\n if (loadable.state === 'hasError') {\n throw loadable.contents;\n } // Either the re-try provided a value, which we will use, or it\n // got blocked again. In that case this is a promise and we'll try again.\n\n\n return loadable.contents;\n }).finally(endPerfBlock));\n }\n\n return [dependencyMap, _loadable2, depValues];\n }\n }\n\n function detectCircularDependencies(fn) {\n if (dependencyStack$1.includes(key)) {\n var message = \"Recoil selector has circular dependencies: \".concat(dependencyStack$1.slice(dependencyStack$1.indexOf(key)).join(\" \\u2192 \"));\n return [new Map(), loadableWithError$2(new Error(message))];\n }\n\n dependencyStack$1.push(key);\n\n try {\n return fn();\n } finally {\n dependencyStack$1.pop();\n }\n }\n\n function myPeek(store, state) {\n var _store$getGraph$nodeD2; // First, get the current deps for this selector\n\n\n var currentDeps = (_store$getGraph$nodeD2 = store.getGraph(state.version).nodeDeps.get(key)) !== null && _store$getGraph$nodeD2 !== void 0 ? _store$getGraph$nodeD2 : emptySet$2;\n var depValues = new Map(Array.from(currentDeps).sort().map(function (depKey) {\n return [depKey, peekNodeLoadable$3(store, state, depKey)];\n }));\n var cacheDepValues = new Map();\n\n var _iterator31 = _createForOfIteratorHelper(depValues.entries()),\n _step31;\n\n try {\n for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {\n var _step31$value = _slicedToArray(_step31.value, 2),\n depKey = _step31$value[0],\n depValue = _step31$value[1];\n\n if (depValue == null) {\n return undefined;\n }\n\n cacheDepValues.set(depKey, depValue);\n } // Always cache and evaluate a selector\n // It may provide a result even when not all deps are available.\n\n } catch (err) {\n _iterator31.e(err);\n } finally {\n _iterator31.f();\n }\n\n var cacheKey = cacheKeyFromDepValues(cacheDepValues);\n return cache.get(cacheKey);\n }\n\n function invalidate(state) {\n state.atomValues.delete(key);\n }\n\n function myGet(store, state) {\n initSelector(store); // First-level cache: Have we already evaluated the selector since being\n // invalidated due to a dependency changing?\n\n var cached = state.atomValues.get(key);\n\n if (cached !== undefined) {\n return [new Map(), cached];\n } // Second-level cache based on looking up current dependencies in a map\n // and evaluating selector if missing.\n\n\n if (process.env.NODE_ENV !== \"production\") {\n return detectCircularDependencies(function () {\n return getFromCacheOrEvaluate(store, state);\n });\n } else {\n return getFromCacheOrEvaluate(store, state);\n }\n }\n\n if (set != null) {\n var mySet = function mySet(store, state, newValue) {\n initSelector(store);\n var dependencyMap = new Map();\n var writes = new Map();\n\n function getRecoilValue(_ref25) {\n var key = _ref25.key;\n\n var _getNodeLoadable$9 = getNodeLoadable$3(store, state, key),\n _getNodeLoadable$10 = _slicedToArray(_getNodeLoadable$9, 2),\n deps = _getNodeLoadable$10[0],\n loadable = _getNodeLoadable$10[1];\n\n mergeDepsIntoDependencyMap$1(deps, dependencyMap);\n\n if (loadable.state === 'hasValue') {\n return loadable.contents;\n } else if (loadable.state === 'loading') {\n throw new RecoilValueNotReady$3(key);\n } else {\n throw loadable.contents;\n }\n }\n\n function setRecoilState(recoilState, valueOrUpdater) {\n var newValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict type S from being a function itself without losing support for opaque types\n // flowlint-next-line unclear-type:off\n valueOrUpdater(getRecoilValue(recoilState)) : valueOrUpdater;\n\n var _setNodeValue$7 = setNodeValue$4(store, state, recoilState.key, newValue),\n _setNodeValue$8 = _slicedToArray(_setNodeValue$7, 2),\n deps = _setNodeValue$8[0],\n upstreamWrites = _setNodeValue$8[1];\n\n mergeDepsIntoDependencyMap$1(deps, dependencyMap);\n upstreamWrites.forEach(function (v, k) {\n return writes.set(k, v);\n });\n }\n\n function resetRecoilState(recoilState) {\n setRecoilState(recoilState, DEFAULT_VALUE$4);\n }\n\n set({\n set: setRecoilState,\n get: getRecoilValue,\n reset: resetRecoilState\n }, newValue);\n return [dependencyMap, writes];\n };\n\n return registerNode$2({\n key: key,\n peek: myPeek,\n get: myGet,\n set: mySet,\n invalidate: invalidate,\n cleanUp: function cleanUp() {},\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false\n });\n } else {\n return registerNode$2({\n key: key,\n peek: myPeek,\n get: myGet,\n invalidate: invalidate,\n cleanUp: function cleanUp() {},\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n shouldRestoreFromSnapshots: false\n });\n }\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selector_OLD = selector$1;\nvar selector$2 = Recoil_gkx_1('recoil_async_selector_refactor') ? Recoil_selector_NEW : Recoil_selector_OLD;\nvar Recoil_selector = selector$2; // @fb-only: const {scopedAtom} = require('Recoil_ScopedAtom');\n\nvar loadableWithError$3 = Recoil_Loadable.loadableWithError,\n loadableWithPromise$3 = Recoil_Loadable.loadableWithPromise,\n loadableWithValue$3 = Recoil_Loadable.loadableWithValue;\nvar DEFAULT_VALUE$5 = Recoil_Node.DEFAULT_VALUE,\n DefaultValue$2 = Recoil_Node.DefaultValue,\n registerNode$3 = Recoil_Node.registerNode;\nvar isRecoilValue$5 = Recoil_RecoilValue$1.isRecoilValue;\nvar markRecoilValueModified$1 = Recoil_RecoilValueInterface.markRecoilValueModified,\n setRecoilValue$3 = Recoil_RecoilValueInterface.setRecoilValue,\n setRecoilValueLoadable$4 = Recoil_RecoilValueInterface.setRecoilValueLoadable;\n\nfunction baseAtom(options) {\n var key = options.key,\n persistence = options.persistence_UNSTABLE;\n var defaultLoadable = Recoil_isPromise(options.default) ? loadableWithPromise$3(options.default.then(function (value) {\n defaultLoadable = loadableWithValue$3(value); // TODO Temporary disable Flow due to pending selector_NEW refactor\n\n var promiseInfo = {\n __key: key,\n __value: value\n };\n return promiseInfo;\n }).catch(function (error) {\n defaultLoadable = loadableWithError$3(error);\n throw error;\n })) : loadableWithValue$3(options.default);\n var cachedAnswerForUnvalidatedValue = undefined; // Cleanup handlers for this atom\n // Rely on stable reference equality of the store to use it as a key per \n\n var cleanupEffectsByStore = new Map();\n\n function wrapPendingPromise(store, promise) {\n var wrappedPromise = promise.then(function (value) {\n var _store$getState$nextT, _state$atomValues$get;\n\n var state = (_store$getState$nextT = store.getState().nextTree) !== null && _store$getState$nextT !== void 0 ? _store$getState$nextT : store.getState().currentTree;\n\n if (((_state$atomValues$get = state.atomValues.get(key)) === null || _state$atomValues$get === void 0 ? void 0 : _state$atomValues$get.contents) === wrappedPromise) {\n setRecoilValue$3(store, node, value);\n }\n\n return {\n __key: key,\n __value: value\n };\n }).catch(function (error) {\n var _store$getState$nextT2, _state$atomValues$get2;\n\n var state = (_store$getState$nextT2 = store.getState().nextTree) !== null && _store$getState$nextT2 !== void 0 ? _store$getState$nextT2 : store.getState().currentTree;\n\n if (((_state$atomValues$get2 = state.atomValues.get(key)) === null || _state$atomValues$get2 === void 0 ? void 0 : _state$atomValues$get2.contents) === wrappedPromise) {\n setRecoilValueLoadable$4(store, node, loadableWithError$3(error));\n }\n\n throw error;\n });\n return wrappedPromise;\n }\n\n function initAtom(store, initState, trigger) {\n if (store.getState().knownAtoms.has(key)) {\n return;\n }\n\n store.getState().knownAtoms.add(key); // Setup async defaults to notify subscribers when they resolve\n\n if (defaultLoadable.state === 'loading') {\n var notifyDefaultSubscribers = function notifyDefaultSubscribers() {\n var _store$getState$nextT3;\n\n var state = (_store$getState$nextT3 = store.getState().nextTree) !== null && _store$getState$nextT3 !== void 0 ? _store$getState$nextT3 : store.getState().currentTree;\n\n if (!state.atomValues.has(key)) {\n markRecoilValueModified$1(store, node);\n }\n };\n\n defaultLoadable.contents.then(notifyDefaultSubscribers).catch(notifyDefaultSubscribers);\n } // Run Atom Effects\n // This state is scoped by Store, since this is in the initAtom() closure\n\n\n var initValue = DEFAULT_VALUE$5;\n var pendingSetSelf = null;\n\n if (options.effects_UNSTABLE != null) {\n var duringInit = true;\n\n var setSelf = function setSelf(effect) {\n return function (valueOrUpdater) {\n if (duringInit) {\n var currentValue = initValue instanceof DefaultValue$2 || Recoil_isPromise(initValue) ? defaultLoadable.state === 'hasValue' ? defaultLoadable.contents : DEFAULT_VALUE$5 : initValue;\n initValue = typeof valueOrUpdater === 'function' ? // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue) // flowlint-line unclear-type:off\n : valueOrUpdater;\n } else {\n if (Recoil_isPromise(valueOrUpdater)) {\n throw new Error('Setting atoms to async values is not implemented.');\n }\n\n if (typeof valueOrUpdater !== 'function') {\n pendingSetSelf = {\n effect: effect,\n value: valueOrUpdater\n };\n }\n\n setRecoilValue$3(store, node, typeof valueOrUpdater === 'function' ? function (currentValue) {\n var newValue = // cast to any because we can't restrict T from being a function without losing support for opaque types\n valueOrUpdater(currentValue); // flowlint-line unclear-type:off\n\n pendingSetSelf = {\n effect: effect,\n value: newValue\n };\n return newValue;\n } : valueOrUpdater);\n }\n };\n };\n\n var resetSelf = function resetSelf(effect) {\n return function () {\n return setSelf(effect)(DEFAULT_VALUE$5);\n };\n };\n\n var onSet = function onSet(effect) {\n return function (handler) {\n store.subscribeToTransactions(function (currentStore) {\n var _pendingSetSelf3; // eslint-disable-next-line prefer-const\n\n\n var _currentStore$getStat = currentStore.getState(),\n currentTree = _currentStore$getStat.currentTree,\n previousTree = _currentStore$getStat.previousTree;\n\n if (!previousTree) {\n Recoil_recoverableViolation('Transaction subscribers notified without a next tree being present -- this is a bug in Recoil');\n previousTree = currentTree; // attempt to trundle on\n }\n\n var newLoadable = currentTree.atomValues.get(key);\n\n if (newLoadable == null || newLoadable.state === 'hasValue') {\n var _previousTree$atomVal, _pendingSetSelf, _pendingSetSelf2;\n\n var newValue = newLoadable != null ? newLoadable.contents : DEFAULT_VALUE$5;\n var oldLoadable = (_previousTree$atomVal = previousTree.atomValues.get(key)) !== null && _previousTree$atomVal !== void 0 ? _previousTree$atomVal : defaultLoadable;\n var oldValue = oldLoadable.state === 'hasValue' ? oldLoadable.contents : DEFAULT_VALUE$5; // TODO This isn't actually valid, use as a placeholder for now.\n // Ignore atom value changes that were set via setSelf() in the same effect.\n // We will still properly call the handler if there was a subsequent\n // set from something other than an atom effect which was batched\n // with the `setSelf()` call. However, we may incorrectly ignore\n // the handler if the subsequent batched call happens to set the\n // atom to the exact same value as the `setSelf()`. But, in that\n // case, it was kind of a noop, so the semantics are debatable..\n\n if (((_pendingSetSelf = pendingSetSelf) === null || _pendingSetSelf === void 0 ? void 0 : _pendingSetSelf.effect) !== effect || ((_pendingSetSelf2 = pendingSetSelf) === null || _pendingSetSelf2 === void 0 ? void 0 : _pendingSetSelf2.value) !== newValue) {\n handler(newValue, oldValue);\n }\n }\n\n if (((_pendingSetSelf3 = pendingSetSelf) === null || _pendingSetSelf3 === void 0 ? void 0 : _pendingSetSelf3.effect) === effect) {\n pendingSetSelf = null;\n }\n }, key);\n };\n };\n\n var _iterator32 = _createForOfIteratorHelper((_options$effects_UNST = options.effects_UNSTABLE) !== null && _options$effects_UNST !== void 0 ? _options$effects_UNST : []),\n _step32;\n\n try {\n for (_iterator32.s(); !(_step32 = _iterator32.n()).done;) {\n var effect = _step32.value;\n\n var _options$effects_UNST;\n\n var cleanup = effect({\n node: node,\n trigger: trigger,\n setSelf: setSelf(effect),\n resetSelf: resetSelf(effect),\n onSet: onSet(effect)\n });\n\n if (cleanup != null) {\n cleanupEffectsByStore.set(store, cleanup);\n }\n }\n } catch (err) {\n _iterator32.e(err);\n } finally {\n _iterator32.f();\n }\n\n duringInit = false;\n } // Mutate initial state in place since we know there are no other subscribers\n // since we are the ones initializing on first use.\n\n\n if (!(initValue instanceof DefaultValue$2)) {\n initState.atomValues.set(key, Recoil_isPromise(initValue) ? loadableWithPromise$3(wrapPendingPromise(store, initValue)) : loadableWithValue$3(initValue));\n }\n }\n\n function myPeek(_store, state) {\n var _ref, _state$atomValues$get3, _cachedAnswerForUnval;\n\n return (_ref = (_state$atomValues$get3 = state.atomValues.get(key)) !== null && _state$atomValues$get3 !== void 0 ? _state$atomValues$get3 : (_cachedAnswerForUnval = cachedAnswerForUnvalidatedValue) === null || _cachedAnswerForUnval === void 0 ? void 0 : _cachedAnswerForUnval[1]) !== null && _ref !== void 0 ? _ref : defaultLoadable;\n }\n\n function myGet(store, state) {\n initAtom(store, state, 'get');\n\n if (state.atomValues.has(key)) {\n // Atom value is stored in state:\n return [new Map(), Recoil_nullthrows(state.atomValues.get(key))];\n } else if (state.nonvalidatedAtoms.has(key)) {\n // Atom value is stored but needs validation before use.\n // We might have already validated it and have a cached validated value:\n if (cachedAnswerForUnvalidatedValue != null) {\n return cachedAnswerForUnvalidatedValue;\n }\n\n if (persistence == null) {\n Recoil_expectationViolation(\"Tried to restore a persisted value for atom \".concat(key, \" but it has no persistence settings.\"));\n return [new Map(), defaultLoadable];\n }\n\n var nonvalidatedValue = state.nonvalidatedAtoms.get(key);\n var validatorResult = persistence.validator(nonvalidatedValue, DEFAULT_VALUE$5);\n var validatedValueLoadable = validatorResult instanceof DefaultValue$2 ? defaultLoadable : loadableWithValue$3(validatorResult);\n cachedAnswerForUnvalidatedValue = [new Map(), validatedValueLoadable];\n return cachedAnswerForUnvalidatedValue;\n } else {\n return [new Map(), defaultLoadable];\n }\n }\n\n function myCleanup(store) {\n var _cleanupEffectsByStor;\n\n (_cleanupEffectsByStor = cleanupEffectsByStore.get(store)) === null || _cleanupEffectsByStor === void 0 ? void 0 : _cleanupEffectsByStor();\n cleanupEffectsByStore.delete(store);\n }\n\n function invalidate() {\n cachedAnswerForUnvalidatedValue = undefined;\n }\n\n function mySet(store, state, newValue) {\n initAtom(store, state, 'set'); // Bail out if we're being set to the existing value, or if we're being\n // reset but have no stored value (validated or unvalidated) to reset from:\n\n if (state.atomValues.has(key)) {\n var existing = Recoil_nullthrows(state.atomValues.get(key));\n\n if (existing.state === 'hasValue' && newValue === existing.contents) {\n return [new Map(), new Map()];\n }\n } else if (!state.nonvalidatedAtoms.has(key) && newValue instanceof DefaultValue$2) {\n return [new Map(), new Map()];\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (options.dangerouslyAllowMutability !== true) {\n Recoil_deepFreezeValue(newValue);\n }\n }\n\n cachedAnswerForUnvalidatedValue = undefined; // can be released now if it was previously in use\n\n return [new Map(), new Map().set(key, loadableWithValue$3(newValue))];\n }\n\n var node = registerNode$3({\n key: key,\n peek: myPeek,\n get: myGet,\n set: mySet,\n cleanUp: myCleanup,\n invalidate: invalidate,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability,\n persistence_UNSTABLE: options.persistence_UNSTABLE ? {\n type: options.persistence_UNSTABLE.type,\n backButton: options.persistence_UNSTABLE.backButton\n } : undefined,\n shouldRestoreFromSnapshots: true\n });\n return node;\n} // prettier-ignore\n\n\nfunction atom(options) {\n var optionsDefault = options.default,\n restOptions = _objectWithoutProperties(options, [\"default\"]);\n\n if (isRecoilValue$5(optionsDefault) // Continue to use atomWithFallback for promise defaults for scoped atoms\n // for now, since scoped atoms don't support async defaults\n // @fb-only: || (isPromise(optionsDefault) && scopeRules_APPEND_ONLY_READ_THE_DOCS)\n ) {\n return atomWithFallback(_objectSpread(_objectSpread({}, restOptions), {}, {\n default: optionsDefault // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n\n })); // @fb-only: } else if (scopeRules_APPEND_ONLY_READ_THE_DOCS && !isPromise(optionsDefault)) {\n // @fb-only: return scopedAtom({\n // @fb-only: ...restOptions,\n // @fb-only: default: optionsDefault,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n } else {\n return baseAtom(_objectSpread(_objectSpread({}, restOptions), {}, {\n default: optionsDefault\n }));\n }\n}\n\nfunction atomWithFallback(options) {\n var base = atom(_objectSpread(_objectSpread({}, options), {}, {\n default: DEFAULT_VALUE$5,\n persistence_UNSTABLE: options.persistence_UNSTABLE === undefined ? undefined : _objectSpread(_objectSpread({}, options.persistence_UNSTABLE), {}, {\n validator: function validator(storedValue) {\n return storedValue instanceof DefaultValue$2 ? storedValue : Recoil_nullthrows(options.persistence_UNSTABLE).validator(storedValue, DEFAULT_VALUE$5);\n }\n }),\n // TODO Hack for now.\n // flowlint-next-line unclear-type: off\n effects_UNSTABLE: options.effects_UNSTABLE\n }));\n return Recoil_selector({\n key: \"\".concat(options.key, \"__withFallback\"),\n get: function get(_ref26) {\n var _get = _ref26.get;\n\n var baseValue = _get(base);\n\n return baseValue instanceof DefaultValue$2 ? options.default : baseValue;\n },\n set: function set(_ref27, newValue) {\n var _set = _ref27.set;\n return _set(base, newValue);\n },\n dangerouslyAllowMutability: options.dangerouslyAllowMutability\n });\n}\n\nvar Recoil_atom = atom; // Keep in mind the parameter needs to be serializable as a cahche key\n// using Recoil_stableStringify\n// Add a unique index to each selector in case the cache implementation allows\n// duplicate keys based on equivalent stringified parameters\n\nvar nextIndex = 0;\n/* eslint-disable no-redeclare */\n// Return a function that returns members of a family of selectors of the same type\n// E.g.,\n//\n// const s = selectorFamily(...);\n// s({a: 1}) => a selector\n// s({a: 2}) => a different selector\n//\n// By default, the selectors are distinguished by distinct values of the\n// parameter based on value equality, not reference equality. This allows using\n// object literals or other equivalent objects at callsites to not create\n// duplicate cache entries. This behavior may be overridden with the\n// cacheImplementationForParams option.\n\nfunction selectorFamily(options) {\n var _options$cacheImpleme, _options$cacheImpleme2;\n\n var selectorCache = (_options$cacheImpleme = (_options$cacheImpleme2 = options.cacheImplementationForParams_UNSTABLE) === null || _options$cacheImpleme2 === void 0 ? void 0 : _options$cacheImpleme2.call(options)) !== null && _options$cacheImpleme !== void 0 ? _options$cacheImpleme : Recoil_cacheWithValueEquality();\n return function (params) {\n var _stableStringify, _options$cacheImpleme3;\n\n var cachedSelector = selectorCache.get(params);\n\n if (cachedSelector != null) {\n return cachedSelector;\n }\n\n var myKey = \"\".concat(options.key, \"__selectorFamily/\").concat((_stableStringify = Recoil_stableStringify(params, {\n // It is possible to use functions in parameters if the user uses\n // a cache with reference equality thanks to the incrementing index.\n allowFunctions: true\n })) !== null && _stableStringify !== void 0 ? _stableStringify : 'void', \"/\").concat(nextIndex++); // Append index in case values serialize to the same key string\n\n var myGet = function myGet(callbacks) {\n return options.get(params)(callbacks);\n };\n\n var myCacheImplementation = (_options$cacheImpleme3 = options.cacheImplementation_UNSTABLE) === null || _options$cacheImpleme3 === void 0 ? void 0 : _options$cacheImpleme3.call(options);\n var newSelector;\n\n if (options.set != null) {\n var set = options.set;\n\n var mySet = function mySet(callbacks, newValue) {\n return set(params)(callbacks, newValue);\n };\n\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n set: mySet,\n cacheImplementation_UNSTABLE: myCacheImplementation,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability\n });\n } else {\n newSelector = Recoil_selector({\n key: myKey,\n get: myGet,\n cacheImplementation_UNSTABLE: myCacheImplementation,\n dangerouslyAllowMutability: options.dangerouslyAllowMutability\n });\n }\n\n selectorCache = selectorCache.set(params, newSelector);\n return newSelector;\n };\n}\n/* eslint-enable no-redeclare */\n\n\nvar Recoil_selectorFamily = selectorFamily; // @fb-only: const {parameterizedScopedAtomLegacy} = require('Recoil_ScopedAtom');\n\nvar DEFAULT_VALUE$6 = Recoil_Node.DEFAULT_VALUE,\n DefaultValue$3 = Recoil_Node.DefaultValue;\n/*\nA function which returns an atom based on the input parameter.\n\nEach unique parameter returns a unique atom. E.g.,\n\n const f = atomFamily(...);\n f({a: 1}) => an atom\n f({a: 2}) => a different atom\n\nThis allows components to persist local, private state using atoms. Each\ninstance of the component may have a different key, which it uses as the\nparameter for a family of atoms; in this way, each component will have\nits own atom not shared by other instances. These state keys may be composed\ninto children's state keys as well.\n*/\n\nfunction atomFamily(options) {\n var atomCache = Recoil_cacheWithValueEquality(); // An atom to represent any legacy atoms that we can upgrade to an atomFamily\n\n var legacyAtomOptions = {\n key: options.key,\n // Legacy atoms just used the plain key directly\n default: DEFAULT_VALUE$6,\n persistence_UNSTABLE: options.persistence_UNSTABLE\n };\n var legacyAtom; // prettier-ignore\n // @fb-only: if (\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS\n // @fb-only: ) {\n // @fb-only: legacyAtom = parameterizedScopedAtomLegacy({\n // @fb-only: ...legacyAtomOptions,\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS:\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: });\n // @fb-only: } else {\n\n legacyAtom = Recoil_atom(legacyAtomOptions); // @fb-only: }\n // Selector to calculate the default value based on any persisted legacy atoms\n // that were upgraded to a atomFamily\n\n var atomFamilyDefault = Recoil_selectorFamily({\n key: \"\".concat(options.key, \"__atomFamily/Default\"),\n get: function get(param) {\n return function (_ref28) {\n var get = _ref28.get;\n var legacyValue = get(typeof legacyAtom === 'function' ? legacyAtom(param) : legacyAtom); // Atom was upgraded from a non-parameterized atom\n\n if (!(legacyValue instanceof DefaultValue$3)) {\n return legacyValue;\n } // There's no legacy atom value, so use the user-specified default\n\n\n return typeof options.default === 'function' ? // The default was parameterized\n // Flow doesn't know that T isn't a function, so we need to case to any\n options.default(param) // flowlint-line unclear-type:off\n : // Default may be a static value, promise, or RecoilValue\n options.default;\n };\n },\n dangerouslyAllowMutability: options.dangerouslyAllowMutability\n }); // Simple atomFamily implementation to cache individual atoms based\n // on the parameter value equality.\n\n return function (params) {\n var _stableStringify;\n\n var cachedAtom = atomCache.get(params);\n\n if (cachedAtom != null) {\n return cachedAtom;\n }\n\n var newAtom = Recoil_atom(_objectSpread(_objectSpread({}, options), {}, {\n key: \"\".concat(options.key, \"__\").concat((_stableStringify = Recoil_stableStringify(params)) !== null && _stableStringify !== void 0 ? _stableStringify : 'void'),\n default: atomFamilyDefault(params),\n effects_UNSTABLE: typeof options.effects_UNSTABLE === 'function' ? options.effects_UNSTABLE(params) : options.effects_UNSTABLE // prettier-ignore\n // @fb-only: scopeRules_APPEND_ONLY_READ_THE_DOCS: mapScopeRules(\n // @fb-only: options.scopeRules_APPEND_ONLY_READ_THE_DOCS,\n // @fb-only: params,\n // @fb-only: )\n\n }));\n atomCache = atomCache.set(params, newAtom);\n return newAtom;\n };\n}\n\nvar Recoil_atomFamily = atomFamily; // flowlint-next-line unclear-type:off\n\nvar constantSelector = Recoil_selectorFamily({\n key: '__constant',\n get: function get(constant) {\n return function () {\n return constant;\n };\n },\n cacheImplementationForParams_UNSTABLE: Recoil_cacheWithReferenceEquality\n}); // Function that returns a selector which always produces the\n// same constant value. It may be called multiple times with the\n// same value, based on reference equality, and will provide the\n// same selector.\n\nfunction constSelector(constant) {\n return constantSelector(constant);\n}\n\nvar Recoil_constSelector = constSelector; // flowlint-next-line unclear-type:off\n\nvar throwingSelector = Recoil_selectorFamily({\n key: '__error',\n get: function get(message) {\n return function () {\n throw new Error(message);\n };\n },\n cacheImplementationForParams_UNSTABLE: Recoil_cacheWithReferenceEquality\n}); // Function that returns a selector which always throws an error\n// with the provided message.\n\nfunction errorSelector(message) {\n return throwingSelector(message);\n}\n\nvar Recoil_errorSelector = errorSelector;\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * Wraps another recoil value and prevents writing to it.\n *\n * @emails oncall+recoil\n * \n * @format\n */\n\nfunction readOnlySelector(atom) {\n // flowlint-next-line unclear-type: off\n return atom;\n}\n\nvar Recoil_readOnlySelector = readOnlySelector;\nvar loadableWithError$4 = Recoil_Loadable.loadableWithError,\n loadableWithPromise$4 = Recoil_Loadable.loadableWithPromise,\n loadableWithValue$4 = Recoil_Loadable.loadableWithValue; /////////////////\n// TRUTH TABLE\n/////////////////\n// Dependencies waitForNone waitForAny waitForAll\n// [loading, loading] [Promise, Promise] Promise Promise\n// [value, loading] [value, Promise] [value, Promise] Promise\n// [value, value] [value, value] [value, value] [value, value]\n//\n// [error, loading] [Error, Promise] Promise Error\n// [error, error] [Error, Error] Error Error\n// [value, error] [value, Error] [value, Error] Error\n// Issue parallel requests for all dependencies and return the current\n// status if they have results, have some error, or are still pending.\n\nfunction concurrentRequests(getRecoilValue, deps) {\n var results = Array(deps.length).fill(undefined);\n var exceptions = Array(deps.length).fill(undefined);\n\n var _iterator33 = _createForOfIteratorHelper(deps.entries()),\n _step33;\n\n try {\n for (_iterator33.s(); !(_step33 = _iterator33.n()).done;) {\n var _step33$value = _slicedToArray(_step33.value, 2),\n i = _step33$value[0],\n dep = _step33$value[1];\n\n try {\n results[i] = getRecoilValue(dep);\n } catch (e) {\n // exceptions can either be Promises of pending results or real errors\n exceptions[i] = e;\n }\n }\n } catch (err) {\n _iterator33.e(err);\n } finally {\n _iterator33.f();\n }\n\n return [results, exceptions];\n}\n\nfunction isError(exp) {\n return exp != null && !Recoil_isPromise(exp);\n}\n\nfunction unwrapDependencies(dependencies) {\n return Array.isArray(dependencies) ? dependencies : Object.getOwnPropertyNames(dependencies).map(function (key) {\n return dependencies[key];\n });\n}\n\nfunction getValueFromLoadablePromiseResult(result) {\n if (result != null && typeof result === 'object' && result.hasOwnProperty('__value')) {\n return result.__value;\n }\n\n return result;\n}\n\nfunction wrapResults(dependencies, results) {\n return Array.isArray(dependencies) ? results : // Object.getOwnPropertyNames() has consistent key ordering with ES6\n Object.getOwnPropertyNames(dependencies).reduce(function (out, key, idx) {\n return _objectSpread(_objectSpread({}, out), {}, _defineProperty2({}, key, results[idx]));\n }, {});\n}\n\nfunction wrapLoadables(dependencies, results, exceptions) {\n var output = exceptions.map(function (exception, idx) {\n return exception == null ? loadableWithValue$4(results[idx]) : Recoil_isPromise(exception) ? loadableWithPromise$4(exception) : loadableWithError$4(exception);\n });\n return wrapResults(dependencies, output);\n}\n\nfunction combineAsyncResultsWithSyncResults(syncResults, asyncResults) {\n return asyncResults.map(function (result, idx) {\n return (\n /**\n * it's important we use === undefined as opposed to == null, because the\n * resolved value of the async promise could be `null`, in which case we\n * don't want to use syncResults[idx], which would be undefined. If async\n * promise resolves to `undefined`, that's ok because `syncResults[idx]`\n * will also be `undefined`. That's a little hacky, but it works.\n */\n result === undefined ? syncResults[idx] : result\n );\n });\n} // Selector that requests all dependencies in parallel and immediately returns\n// current results without waiting.\n\n\nvar waitForNone = Recoil_selectorFamily({\n key: '__waitForNone',\n get: function get(dependencies) {\n return function (_ref29) {\n var get = _ref29.get;\n // Issue requests for all dependencies in parallel.\n var deps = unwrapDependencies(dependencies);\n\n var _concurrentRequests = concurrentRequests(get, deps),\n _concurrentRequests2 = _slicedToArray(_concurrentRequests, 2),\n results = _concurrentRequests2[0],\n exceptions = _concurrentRequests2[1]; // Always return the current status of the results; never block.\n\n\n return wrapLoadables(dependencies, results, exceptions);\n };\n }\n}); // Selector that requests all dependencies in parallel and waits for at least\n// one to be available before returning results. It will only error if all\n// dependencies have errors.\n\nvar waitForAny = Recoil_selectorFamily({\n key: '__waitForAny',\n get: function get(dependencies) {\n return function (_ref30) {\n var get = _ref30.get;\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n var deps = unwrapDependencies(dependencies);\n\n var _concurrentRequests3 = concurrentRequests(get, deps),\n _concurrentRequests4 = _slicedToArray(_concurrentRequests3, 2),\n results = _concurrentRequests4[0],\n exceptions = _concurrentRequests4[1]; // If any results are available, return the current status\n\n\n if (exceptions.some(function (exp) {\n return exp == null;\n })) {\n return wrapLoadables(dependencies, results, exceptions);\n } // Since we are waiting for any results, only throw an error if all\n // dependencies have an error. Then, throw the first one.\n\n\n if (exceptions.every(isError)) {\n throw exceptions.find(isError);\n }\n\n if (Recoil_gkx_1('recoil_async_selector_refactor')) {\n // Otherwise, return a promise that will resolve when the next result is\n // available, whichever one happens to be next. But, if all pending\n // dependencies end up with errors, then reject the promise.\n return new Promise(function (resolve, reject) {\n var _iterator34 = _createForOfIteratorHelper(exceptions.entries()),\n _step34;\n\n try {\n var _loop2 = function _loop2() {\n var _step34$value = _slicedToArray(_step34.value, 2),\n i = _step34$value[0],\n exp = _step34$value[1];\n\n if (Recoil_isPromise(exp)) {\n exp.then(function (result) {\n results[i] = getValueFromLoadablePromiseResult(result);\n exceptions[i] = null;\n resolve(wrapLoadables(dependencies, results, exceptions));\n }).catch(function (error) {\n exceptions[i] = error;\n\n if (exceptions.every(isError)) {\n reject(exceptions[0]);\n }\n });\n }\n };\n\n for (_iterator34.s(); !(_step34 = _iterator34.n()).done;) {\n _loop2();\n }\n } catch (err) {\n _iterator34.e(err);\n } finally {\n _iterator34.f();\n }\n });\n } else {\n throw new Promise(function (resolve, reject) {\n var _iterator35 = _createForOfIteratorHelper(exceptions.entries()),\n _step35;\n\n try {\n var _loop3 = function _loop3() {\n var _step35$value = _slicedToArray(_step35.value, 2),\n i = _step35$value[0],\n exp = _step35$value[1];\n\n if (Recoil_isPromise(exp)) {\n exp.then(function (result) {\n results[i] = result;\n exceptions[i] = null;\n resolve(wrapLoadables(dependencies, results, exceptions));\n }).catch(function (error) {\n exceptions[i] = error;\n\n if (exceptions.every(isError)) {\n reject(exceptions[0]);\n }\n });\n }\n };\n\n for (_iterator35.s(); !(_step35 = _iterator35.n()).done;) {\n _loop3();\n }\n } catch (err) {\n _iterator35.e(err);\n } finally {\n _iterator35.f();\n }\n });\n }\n };\n }\n}); // Selector that requests all dependencies in parallel and waits for all to be\n// available before returning a value. It will error if any dependencies error.\n\nvar waitForAll = Recoil_selectorFamily({\n key: '__waitForAll',\n get: function get(dependencies) {\n return function (_ref31) {\n var get = _ref31.get;\n // Issue requests for all dependencies in parallel.\n // Exceptions can either be Promises of pending results or real errors\n var deps = unwrapDependencies(dependencies);\n\n var _concurrentRequests5 = concurrentRequests(get, deps),\n _concurrentRequests6 = _slicedToArray(_concurrentRequests5, 2),\n results = _concurrentRequests6[0],\n exceptions = _concurrentRequests6[1]; // If all results are available, return the results\n\n\n if (exceptions.every(function (exp) {\n return exp == null;\n })) {\n return wrapResults(dependencies, results);\n } // If we have any errors, throw the first error\n\n\n var error = exceptions.find(isError);\n\n if (error != null) {\n throw error;\n }\n\n if (Recoil_gkx_1('recoil_async_selector_refactor')) {\n // Otherwise, return a promise that will resolve when all results are available\n return Promise.all(exceptions).then(function (exceptionResults) {\n return wrapResults(dependencies, combineAsyncResultsWithSyncResults(results, exceptionResults).map(getValueFromLoadablePromiseResult));\n });\n } else {\n throw Promise.all(exceptions).then(function (results) {\n return wrapResults(dependencies, results);\n });\n }\n };\n }\n});\nvar noWait = Recoil_selectorFamily({\n key: '__noWait',\n get: function get(dependency) {\n return function (_ref32) {\n var get = _ref32.get;\n\n try {\n return loadableWithValue$4(get(dependency));\n } catch (exception) {\n return Recoil_isPromise(exception) ? loadableWithPromise$4(exception) : loadableWithError$4(exception);\n }\n };\n }\n});\nvar Recoil_WaitFor = {\n waitForNone: waitForNone,\n waitForAny: waitForAny,\n waitForAll: waitForAll,\n noWait: noWait\n};\nvar batchUpdates$3 = Recoil_Batching.batchUpdates,\n setBatcher$1 = Recoil_Batching.setBatcher;\nvar DefaultValue$4 = Recoil_Node.DefaultValue;\nvar RecoilRoot$2 = Recoil_RecoilRoot_react.RecoilRoot;\nvar isRecoilValue$6 = Recoil_RecoilValue$1.isRecoilValue;\nvar freshSnapshot$2 = Recoil_Snapshot$1.freshSnapshot;\nvar useGotoRecoilSnapshot$1 = Recoil_Hooks.useGotoRecoilSnapshot,\n useRecoilCallback$1 = Recoil_Hooks.useRecoilCallback,\n useRecoilSnapshot$1 = Recoil_Hooks.useRecoilSnapshot,\n useRecoilState$1 = Recoil_Hooks.useRecoilState,\n useRecoilStateLoadable$1 = Recoil_Hooks.useRecoilStateLoadable,\n useRecoilTransactionObserver$1 = Recoil_Hooks.useRecoilTransactionObserver,\n useRecoilValue$1 = Recoil_Hooks.useRecoilValue,\n useRecoilValueLoadable$1 = Recoil_Hooks.useRecoilValueLoadable,\n useResetRecoilState$1 = Recoil_Hooks.useResetRecoilState,\n useSetRecoilState$1 = Recoil_Hooks.useSetRecoilState,\n useSetUnvalidatedAtomValues$1 = Recoil_Hooks.useSetUnvalidatedAtomValues,\n useTransactionObservation_DEPRECATED$1 = Recoil_Hooks.useTransactionObservation_DEPRECATED;\nvar noWait$1 = Recoil_WaitFor.noWait,\n waitForAll$1 = Recoil_WaitFor.waitForAll,\n waitForAny$1 = Recoil_WaitFor.waitForAny,\n waitForNone$1 = Recoil_WaitFor.waitForNone;\nvar Recoil_index = {\n // Types\n DefaultValue: DefaultValue$4,\n // Components\n RecoilRoot: RecoilRoot$2,\n useRecoilBridgeAcrossReactRoots_UNSTABLE: Recoil_useRecoilBridgeAcrossReactRoots,\n // RecoilValues\n atom: Recoil_atom,\n selector: Recoil_selector,\n // Convenience RecoilValues\n atomFamily: Recoil_atomFamily,\n selectorFamily: Recoil_selectorFamily,\n constSelector: Recoil_constSelector,\n errorSelector: Recoil_errorSelector,\n readOnlySelector: Recoil_readOnlySelector,\n // Hooks that accept RecoilValues\n useRecoilValue: useRecoilValue$1,\n useRecoilValueLoadable: useRecoilValueLoadable$1,\n useRecoilState: useRecoilState$1,\n useRecoilStateLoadable: useRecoilStateLoadable$1,\n useSetRecoilState: useSetRecoilState$1,\n useResetRecoilState: useResetRecoilState$1,\n // Hooks for asynchronous Recoil\n useRecoilCallback: useRecoilCallback$1,\n // Hooks for Snapshots\n useGotoRecoilSnapshot: useGotoRecoilSnapshot$1,\n useRecoilSnapshot: useRecoilSnapshot$1,\n useRecoilTransactionObserver_UNSTABLE: useRecoilTransactionObserver$1,\n useTransactionObservation_UNSTABLE: useTransactionObservation_DEPRECATED$1,\n useSetUnvalidatedAtomValues_UNSTABLE: useSetUnvalidatedAtomValues$1,\n // Concurrency Helpers\n noWait: noWait$1,\n waitForNone: waitForNone$1,\n waitForAny: waitForAny$1,\n waitForAll: waitForAll$1,\n // Other functions\n isRecoilValue: isRecoilValue$6,\n // Batching\n batchUpdates: batchUpdates$3,\n setBatcher: setBatcher$1,\n // Snapshot Utils\n snapshot_UNSTABLE: freshSnapshot$2\n};\nvar Recoil_index_1 = Recoil_index.DefaultValue;\nvar Recoil_index_2 = Recoil_index.RecoilRoot;\nvar Recoil_index_3 = Recoil_index.useRecoilBridgeAcrossReactRoots_UNSTABLE;\nvar Recoil_index_4 = Recoil_index.atom;\nvar Recoil_index_5 = Recoil_index.selector;\nvar Recoil_index_6 = Recoil_index.atomFamily;\nvar Recoil_index_7 = Recoil_index.selectorFamily;\nvar Recoil_index_8 = Recoil_index.constSelector;\nvar Recoil_index_9 = Recoil_index.errorSelector;\nvar Recoil_index_10 = Recoil_index.readOnlySelector;\nvar Recoil_index_11 = Recoil_index.useRecoilValue;\nvar Recoil_index_12 = Recoil_index.useRecoilValueLoadable;\nvar Recoil_index_13 = Recoil_index.useRecoilState;\nvar Recoil_index_14 = Recoil_index.useRecoilStateLoadable;\nvar Recoil_index_15 = Recoil_index.useSetRecoilState;\nvar Recoil_index_16 = Recoil_index.useResetRecoilState;\nvar Recoil_index_17 = Recoil_index.useRecoilCallback;\nvar Recoil_index_18 = Recoil_index.useGotoRecoilSnapshot;\nvar Recoil_index_19 = Recoil_index.useRecoilSnapshot;\nvar Recoil_index_20 = Recoil_index.useRecoilTransactionObserver_UNSTABLE;\nvar Recoil_index_21 = Recoil_index.useTransactionObservation_UNSTABLE;\nvar Recoil_index_22 = Recoil_index.useSetUnvalidatedAtomValues_UNSTABLE;\nvar Recoil_index_23 = Recoil_index.noWait;\nvar Recoil_index_24 = Recoil_index.waitForNone;\nvar Recoil_index_25 = Recoil_index.waitForAny;\nvar Recoil_index_26 = Recoil_index.waitForAll;\nvar Recoil_index_27 = Recoil_index.isRecoilValue;\nvar Recoil_index_28 = Recoil_index.batchUpdates;\nvar Recoil_index_29 = Recoil_index.setBatcher;\nvar Recoil_index_30 = Recoil_index.snapshot_UNSTABLE;\nexport default Recoil_index;\nexport { Recoil_index_1 as DefaultValue, Recoil_index_2 as RecoilRoot, Recoil_index_4 as atom, Recoil_index_6 as atomFamily, Recoil_index_28 as batchUpdates, Recoil_index_8 as constSelector, Recoil_index_9 as errorSelector, Recoil_index_27 as isRecoilValue, Recoil_index_23 as noWait, Recoil_index_10 as readOnlySelector, Recoil_index_5 as selector, Recoil_index_7 as selectorFamily, Recoil_index_29 as setBatcher, Recoil_index_30 as snapshot_UNSTABLE, Recoil_index_18 as useGotoRecoilSnapshot, Recoil_index_3 as useRecoilBridgeAcrossReactRoots_UNSTABLE, Recoil_index_17 as useRecoilCallback, Recoil_index_19 as useRecoilSnapshot, Recoil_index_13 as useRecoilState, Recoil_index_14 as useRecoilStateLoadable, Recoil_index_20 as useRecoilTransactionObserver_UNSTABLE, Recoil_index_11 as useRecoilValue, Recoil_index_12 as useRecoilValueLoadable, Recoil_index_16 as useResetRecoilState, Recoil_index_15 as useSetRecoilState, Recoil_index_22 as useSetUnvalidatedAtomValues_UNSTABLE, Recoil_index_21 as useTransactionObservation_UNSTABLE, Recoil_index_26 as waitForAll, Recoil_index_25 as waitForAny, Recoil_index_24 as waitForNone };"],"sourceRoot":""}