From ce2ca11e94ee921f48cee3cfbdf3be23dabb9ec5 Mon Sep 17 00:00:00 2001 From: JATIN-RAGHAV Date: Wed, 5 Jun 2024 18:37:26 +0530 Subject: [PATCH] changed --- client/src/components/Users.tsx | 8 +++++--- .../assets/{index-BvdSJbYF.js => index-C4JDiitt.js} | 2 +- server/public/index.html | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) rename server/public/assets/{index-BvdSJbYF.js => index-C4JDiitt.js} (98%) diff --git a/client/src/components/Users.tsx b/client/src/components/Users.tsx index f5482cf..f4437d8 100644 --- a/client/src/components/Users.tsx +++ b/client/src/components/Users.tsx @@ -19,9 +19,11 @@ function Users() { const friendsResponse: FriendsResponse = await getFriends(); const sentFriendRequestResponse: sentFriendRequestsReponse = await getSentFriendRequests(); const receivedFriendRequestsResponse: receivedFriendRequestsResponse = await getReceivedFriendRequests(); - usersResponse.Users = usersResponse.Users.filter(user => !friendsResponse.friends.includes(user.username) && !sentFriendRequestResponse.sentFriendRequestsUsername.includes(user.username) && !receivedFriendRequestsResponse.receivedFriendRequestsUsername.includes(user.username)) - setUsers(usersResponse.Users) - setIsLoading(false) + if(usersResponse.Users){ + usersResponse.Users = usersResponse.Users.filter(user => !friendsResponse.friends.includes(user.username) && !sentFriendRequestResponse.sentFriendRequestsUsername.includes(user.username) && !receivedFriendRequestsResponse.receivedFriendRequestsUsername.includes(user.username)) + setUsers(usersResponse.Users) + setIsLoading(false) + }else{ console.dir(usersResponse) } } getAndSetUsers(); }, []); diff --git a/server/public/assets/index-BvdSJbYF.js b/server/public/assets/index-C4JDiitt.js similarity index 98% rename from server/public/assets/index-BvdSJbYF.js rename to server/public/assets/index-C4JDiitt.js index cb82cb4..9a2fd98 100644 --- a/server/public/assets/index-BvdSJbYF.js +++ b/server/public/assets/index-C4JDiitt.js @@ -240,4 +240,4 @@ Error generating stack: `+i.message+` animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; `),sA)),pA=S.forwardRef(function(t,n){const r=He({props:t,name:"MuiLinearProgress"}),{className:o,color:i="primary",value:s,valueBuffer:a,variant:l="indeterminate"}=r,u=he(r,oA),c=_({},r,{color:i,variant:l}),d=lA(c),p=H1(),y={},h={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&s!==void 0){y["aria-valuenow"]=Math.round(s),y["aria-valuemin"]=0,y["aria-valuemax"]=100;let m=s-100;p&&(m=-m),h.bar1.transform=`translateX(${m}%)`}if(l==="buffer"&&a!==void 0){let m=(a||0)-100;p&&(m=-m),h.bar2.transform=`translateX(${m}%)`}return w.jsxs(uA,_({className:xe(d.root,o),ownerState:c,role:"progressbar"},y,{ref:n},u,{children:[l==="buffer"?w.jsx(cA,{className:d.dashed,ownerState:c}):null,w.jsx(dA,{className:d.bar1,ownerState:c,style:h.bar1}),l==="determinate"?null:w.jsx(fA,{className:d.bar2,ownerState:c,style:h.bar2})]}))});oe(pA)(({theme:e})=>({height:10,borderRadius:5,[`&.${ev.colorPrimary}`]:{backgroundColor:e.palette.grey[e.palette.mode==="light"?200:800]},[`& .${ev.bar}`]:{borderRadius:5,backgroundColor:e.palette.mode==="light"?"#1a90ff":"#308fe8"}}));function Ys(){return w.jsxs(S.Fragment,{children:[w.jsx("svg",{width:0,height:0,children:w.jsx("defs",{children:w.jsxs("linearGradient",{id:"my_gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[w.jsx("stop",{offset:"0%",stopColor:"#e01cd5"}),w.jsx("stop",{offset:"100%",stopColor:"#1CB5E0"})]})})}),w.jsx(nA,{sx:{"svg circle":{stroke:"url(#my_gradient)"}}})]})}var wS={};function hA(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var mA=hA,ve=mA;function gA(e){return!!e&&typeof e.then=="function"}var Be=gA;function vA(e,t){if(e!=null)return e;throw ve(t??"Got unexpected null or undefined")}var Xe=vA;function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ku{getValue(){throw ve("BaseLoadable")}toPromise(){throw ve("BaseLoadable")}valueMaybe(){throw ve("BaseLoadable")}valueOrThrow(){throw ve(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw ve("BaseLoadable")}promiseOrThrow(){throw ve(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw ve("BaseLoadable")}errorOrThrow(){throw ve(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw ve("BaseLoadable")}}class yA extends Ku{constructor(t){super(),me(this,"state","hasValue"),me(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Be(n)?ao(n):oi(n)?n:Zs(n)}catch(n){return Be(n)?ao(n.next(()=>this.map(t))):qu(n)}}}class SA extends Ku{constructor(t){super(),me(this,"state","hasError"),me(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class bS extends Ku{constructor(t){super(),me(this,"state","loading"),me(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return ao(this.contents.then(n=>{const r=t(n);if(oi(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(Be(n))return n.then(()=>this.map(t).contents);throw n}))}}function Zs(e){return Object.freeze(new yA(e))}function qu(e){return Object.freeze(new SA(e))}function ao(e){return Object.freeze(new bS(e))}function RS(){return Object.freeze(new bS(new Promise(()=>{})))}function xA(e){return e.every(t=>t.state==="hasValue")?Zs(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?qu(Xe(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):ao(Promise.all(e.map(t=>t.contents)))}function ES(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>oi(o)?o:Be(o)?ao(o):Zs(o)),r=xA(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((i,s,a)=>({...i,[s]:o[a]}),{}))}function oi(e){return e instanceof Ku}const wA={of:e=>Be(e)?ao(e):oi(e)?e:Zs(e),error:e=>qu(e),loading:()=>RS(),all:ES,isLoadable:oi};var ho={loadableWithValue:Zs,loadableWithError:qu,loadableWithPromise:ao,loadableLoading:RS,loadableAll:ES,isLoadable:oi,RecoilLoadable:wA},bA=ho.loadableWithValue,RA=ho.loadableWithError,EA=ho.loadableWithPromise,_A=ho.loadableLoading,CA=ho.loadableAll,kA=ho.isLoadable,TA=ho.RecoilLoadable,Js=Object.freeze({__proto__:null,loadableWithValue:bA,loadableWithError:RA,loadableWithPromise:EA,loadableLoading:_A,loadableAll:CA,isLoadable:kA,RecoilLoadable:TA});const bf={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0,RECOIL_GKS_ENABLED:new Set(["recoil_hamt_2020","recoil_sync_external_store","recoil_suppress_rerender_in_callback","recoil_memory_managament_2020"])};function PA(e,t){var n,r;const o=(n=wS[e])===null||n===void 0||(r=n.toLowerCase())===null||r===void 0?void 0:r.trim();if(o==null||o==="")return;if(!["true","false"].includes(o))throw ve(`process.env.${e} value must be 'true', 'false', or empty: ${o}`);t(o==="true")}function NA(e,t){var n;const r=(n=wS[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function $A(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(PA("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{bf.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),NA("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{bf.RECOIL_GKS_ENABLED.add(n)})}))}$A();var bi=bf;function Gu(e){return bi.RECOIL_GKS_ENABLED.has(e)}Gu.setPass=e=>{bi.RECOIL_GKS_ENABLED.add(e)};Gu.setFail=e=>{bi.RECOIL_GKS_ENABLED.delete(e)};Gu.clear=()=>{bi.RECOIL_GKS_ENABLED.clear()};var Me=Gu;function AA(e,t,{error:n}={}){return null}var LA=AA,dh=LA,ed,td,nd;const OA=(ed=be.createMutableSource)!==null&&ed!==void 0?ed:be.unstable_createMutableSource,_S=(td=be.useMutableSource)!==null&&td!==void 0?td:be.unstable_useMutableSource,CS=(nd=be.useSyncExternalStore)!==null&&nd!==void 0?nd:be.unstable_useSyncExternalStore;function MA(){var e;const{ReactCurrentDispatcher:t,ReactCurrentOwner:n}=be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((e=t==null?void 0:t.current)!==null&&e!==void 0?e:n.currentDispatcher).useSyncExternalStore!=null}function IA(){return Me("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Me("recoil_sync_external_store")&&CS!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Me("recoil_mutable_source")&&_S!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Me("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Me("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function FA(){return!1}var ea={createMutableSource:OA,useMutableSource:_S,useSyncExternalStore:CS,currentRendererSupportsUseSyncExternalStore:MA,reactMode:IA,isFastRefreshEnabled:FA};class fh{constructor(t){me(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class kS extends fh{}class TS extends fh{}function jA(e){return e instanceof kS||e instanceof TS}var Xu={AbstractRecoilValue:fh,RecoilState:kS,RecoilValueReadOnly:TS,isRecoilValue:jA},zA=Xu.AbstractRecoilValue,DA=Xu.RecoilState,UA=Xu.RecoilValueReadOnly,BA=Xu.isRecoilValue,ii=Object.freeze({__proto__:null,AbstractRecoilValue:zA,RecoilState:DA,RecoilValueReadOnly:UA,isRecoilValue:BA});function VA(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var Qu=VA;class PS{}const WA=new PS,lo=new Map,ph=new Map;function HA(e){return Qu(e,t=>Xe(ph.get(t)))}function KA(e){if(lo.has(e)){const t=`Duplicate atom key "${e}". This is a FATAL ERROR in production. But it is safe to ignore this warning if it occurred because of - hot module replacement.`;console.warn(t)}}function qA(e){bi.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&KA(e.key),lo.set(e.key,e);const t=e.set==null?new ii.RecoilValueReadOnly(e.key):new ii.RecoilState(e.key);return ph.set(e.key,t),t}class NS extends Error{}function GA(e){const t=lo.get(e);if(t==null)throw new NS(`Missing definition for RecoilValue: "${e}""`);return t}function XA(e){return lo.get(e)}const Al=new Map;function QA(e){var t;if(!Me("recoil_memory_managament_2020"))return;const n=lo.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;lo.delete(e),(r=$S(e))===null||r===void 0||r(),Al.delete(e)}}function YA(e,t){Me("recoil_memory_managament_2020")&&(t===void 0?Al.delete(e):Al.set(e,t))}function $S(e){return Al.get(e)}var Vt={nodes:lo,recoilValues:ph,registerNode:qA,getNode:GA,getNodeMaybe:XA,deleteNodeConfigIfPossible:QA,setConfigDeletionHandler:YA,getConfigDeletionHandler:$S,recoilValuesForKeys:HA,NodeMissingError:NS,DefaultValue:PS,DEFAULT_VALUE:WA};function ZA(e,t){t()}var JA={enqueueExecution:ZA};function eL(e,t){return t={exports:{}},e(t,t.exports),t.exports}var tL=eL(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},n={},r=5,o=Math.pow(2,r),i=o-1,s=o/2,a=o/4,l={},u=function(k){return function(){return k}},c=n.hash=function(P){var k=typeof P>"u"?"undefined":t(P);if(k==="number")return P;k!=="string"&&(P+="");for(var I=0,G=0,X=P.length;G>1&1431655765,k=(k&858993459)+(k>>2&858993459),k=k+(k>>4)&252645135,k+=k>>8,k+=k>>16,k&127},p=function(k,I){return I>>>k&i},y=function(k){return 1<=I;)X[pe--]=X[pe];return X[I]=G,X}for(var ce=0,de=0,Se=new Array(te+1);ce>>=1;return pe[I]=G,K(k,de+1,pe)},B=function(k,I,G,X){for(var te=new Array(I-1),pe=0,ce=0,de=0,Se=X.length;de1?j(k,this.hash,Se):Se[0]}var Ke=X();return Ke===l?this:(++ce.value,H(k,G,this.hash,this,te,$(k,te,pe,Ke)))},F=function(k,I,G,X,te,pe,ce){var de=this.mask,Se=this.children,Ke=p(G,te),Mt=y(Ke),dt=h(de,Mt),nn=de&Mt,wn=nn?Se[dt]:T,go=wn._modify(k,I,G+r,X,te,pe,ce);if(wn===go)return this;var ia=Y(k,this),Ei=de,_i=void 0;if(nn&&E(go)){if(Ei&=~Mt,!Ei)return T;if(Se.length<=2&&Z(Se[dt^1]))return Se[dt^1];_i=b(ia,dt,Se)}else if(!nn&&!E(go)){if(Se.length>=s)return U(k,Ke,go,de,Se);Ei|=Mt,_i=g(ia,dt,go,Se)}else _i=m(ia,dt,go,Se);return ia?(this.mask=Ei,this.children=_i,this):A(k,Ei,_i)},J=function(k,I,G,X,te,pe,ce){var de=this.size,Se=this.children,Ke=p(G,te),Mt=Se[Ke],dt=(Mt||T)._modify(k,I,G+r,X,te,pe,ce);if(Mt===dt)return this;var nn=Y(k,this),wn=void 0;if(E(Mt)&&!E(dt))++de,wn=m(nn,Ke,dt,Se);else if(!E(Mt)&&E(dt)){if(--de,de<=a)return B(k,de,Ke,Se);wn=m(nn,Ke,T,Se)}else wn=m(nn,Ke,dt,Se);return nn?(this.size=de,this.children=wn,this):K(k,de,wn)};T._modify=function(P,k,I,G,X,te,pe){var ce=G();return ce===l?T:(++pe.value,$(P,X,te,ce))};function C(P,k,I,G,X){this._editable=P,this._edit=k,this._config=I,this._root=G,this._size=X}C.prototype.setTree=function(P,k){return this._editable?(this._root=P,this._size=k,this):P===this._root?this:new C(this._editable,this._edit,this._config,P,k)};var M=n.tryGetHash=function(P,k,I,G){for(var X=G._root,te=0,pe=G._config.keyEq;;)switch(X.type){case f:return pe(I,X.key)?X.value:P;case v:{if(k===X.hash)for(var ce=X.children,de=0,Se=ce.length;de{n.set(o,t(r,o))}),n}var Ll=aL;function lL(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function uL(e){return{nodeDeps:Ll(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:Ll(e.nodeToNodeSubscriptions,t=>new Set(t))}}function rd(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:i}=n,s=o.get(e);if(s&&r&&s!==r.nodeDeps.get(e))return;o.set(e,t);const a=s==null?t:cs(t,s);for(const l of a)i.has(l)||i.set(l,new Set),Xe(i.get(l)).add(e);if(s){const l=cs(s,t);for(const u of l){if(!i.has(u))return;const c=Xe(i.get(u));c.delete(e),c.size===0&&i.delete(u)}}}function cL(e,t,n,r){var o,i,s,a;const l=n.getState();r===l.currentTree.version||r===((o=l.nextTree)===null||o===void 0?void 0:o.version)||((i=l.previousTree)===null||i===void 0||i.version);const u=n.getGraph(r);if(rd(e,t,u),r===((s=l.previousTree)===null||s===void 0?void 0:s.version)){const d=n.getGraph(l.currentTree.version);rd(e,t,d,u)}if(r===((a=l.previousTree)===null||a===void 0?void 0:a.version)||r===l.currentTree.version){var c;const d=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(d!==void 0){const p=n.getGraph(d);rd(e,t,p,u)}}}var ta={cloneGraph:uL,graph:lL,saveDepsToStore:cL};let dL=0;const fL=()=>dL++;let pL=0;const hL=()=>pL++;let mL=0;const gL=()=>mL++;var Yu={getNextTreeStateVersion:fL,getNextStoreID:hL,getNextComponentID:gL};const{persistentMap:av}=iL,{graph:vL}=ta,{getNextTreeStateVersion:AS}=Yu;function LS(){const e=AS();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:av(),nonvalidatedAtoms:av()}}function yL(){const e=LS();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,vL()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var OS={makeEmptyTreeState:LS,makeEmptyStoreState:yL,getNextTreeStateVersion:AS};class MS{}function SL(){return new MS}var Zu={RetentionZone:MS,retentionZone:SL};function xL(e,t){const n=new Set(e);return n.add(t),n}function wL(e,t){const n=new Set(e);return n.delete(t),n}function bL(e,t,n){const r=new Map(e);return r.set(t,n),r}function RL(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function EL(e,t){const n=new Map(e);return n.delete(t),n}function _L(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var IS={setByAddingToSet:xL,setByDeletingFromSet:wL,mapBySettingInMap:bL,mapByUpdatingInMap:RL,mapByDeletingFromMap:EL,mapByDeletingMultipleFromMap:_L};function*CL(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var gh=CL;function kL(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var FS=kL;const{getNode:na,getNodeMaybe:TL,recoilValuesForKeys:lv}=Vt,{RetentionZone:uv}=Zu,{setByAddingToSet:PL}=IS,NL=Object.freeze(new Set);class $L extends Error{}function AL(e,t,n){if(!Me("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(i){let s=r.get(i);s||r.set(i,s=new Set),s.add(t)}if(n instanceof uv)o(n);else if(Array.isArray(n))for(const i of n)o(i);return()=>{if(!Me("recoil_memory_managament_2020"))return;const{retention:i}=e.getState();function s(a){const l=i.nodesRetainedByZone.get(a);l==null||l.delete(t),l&&l.size===0&&i.nodesRetainedByZone.delete(a)}if(n instanceof uv)s(n);else if(Array.isArray(n))for(const a of n)s(a)}}function vh(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=na(n),s=AL(e,n,i.retainedBy),a=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{a(),s()})}function LL(e,t,n){vh(e,e.getState().currentTree,t,n)}function OL(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function ML(e,t,n){return vh(e,t,n,"get"),na(n).get(e,t)}function jS(e,t,n){return na(n).peek(e,t)}function IL(e,t,n){var r;const o=TL(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:PL(e.dirtyAtoms,t)}}function FL(e,t,n,r){const o=na(n);if(o.set==null)throw new $L(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return vh(e,t,n,"set"),i(e,t,r)}function jL(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=na(n).nodeType;return FS({type:i},{loadable:()=>jS(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>i==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var s;return lv((s=o.nodeDeps.get(n))!==null&&s!==void 0?s:[])},subscribers:()=>{var s,a;return{nodes:lv(gh(zS(e,t,new Set([n])),l=>l!==n)),components:Qu((s=(a=r.nodeToComponentSubscriptions.get(n))===null||a===void 0?void 0:a.values())!==null&&s!==void 0?s:[],([l])=>({name:l}))}}})}function zS(e,t,n){const r=new Set,o=Array.from(n),i=e.getGraph(t.version);for(let a=o.pop();a;a=o.pop()){var s;r.add(a);const l=(s=i.nodeToNodeSubscriptions.get(a))!==null&&s!==void 0?s:NL;for(const u of l)r.has(u)||o.push(u)}return r}var Mr={getNodeLoadable:ML,peekNodeLoadable:jS,setNodeValue:FL,initializeNode:LL,cleanUpNode:OL,setUnvalidatedAtomValue_DEPRECATED:IL,peekNodeInfo:jL,getDownstreamNodes:zS};let DS=null;function zL(e){DS=e}function DL(){var e;(e=DS)===null||e===void 0||e()}var US={setInvalidateMemoizedSnapshot:zL,invalidateMemoizedSnapshot:DL};const{getDownstreamNodes:UL,getNodeLoadable:BS,setNodeValue:BL}=Mr,{getNextComponentID:VL}=Yu,{getNode:WL,getNodeMaybe:VS}=Vt,{DefaultValue:yh}=Vt,{reactMode:HL}=ea,{AbstractRecoilValue:KL,RecoilState:qL,RecoilValueReadOnly:GL,isRecoilValue:XL}=ii,{invalidateMemoizedSnapshot:QL}=US;function YL(e,{key:t},n=e.getState().currentTree){var r,o;const i=e.getState();n.version===i.currentTree.version||n.version===((r=i.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=i.previousTree)===null||o===void 0||o.version);const s=BS(e,n,t);return s.state==="loading"&&s.contents.catch(()=>{}),s}function ZL(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof yh?n.delete(o):n.set(o,r)}),n}function JL(e,t,{key:n},r){if(typeof r=="function"){const o=BS(e,t,n);if(o.state==="loading"){const i=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw ve(i)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function eO(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,s=JL(e,t,o,i),a=BL(e,t,o.key,s);for(const[l,u]of a.entries())Rf(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;Rf(t,o,i)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:i}=n,s=VS(o);s==null||(r=s.invalidate)===null||r===void 0||r.call(s,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,i),t.dirtyAtoms.add(o)}else dh(`Unknown action ${n.type}`)}function Rf(e,t,n){n.state==="hasValue"&&n.contents instanceof yh?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function WS(e,t){e.replaceState(n=>{const r=HS(n);for(const o of t)eO(e,r,o);return KS(e,r),QL(),r})}function Ju(e,t){if(ds.length){const n=ds[ds.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else WS(e,[t])}const ds=[];function tO(){const e=new Map;return ds.push(e),()=>{for(const[t,n]of e)WS(t,n);ds.pop()}}function HS(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function KS(e,t){const n=UL(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=VS(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function qS(e,t,n){Ju(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function nO(e,t,n){if(n instanceof yh)return qS(e,t,n);Ju(e,{type:"setLoadable",recoilValue:t,loadable:n})}function rO(e,t){Ju(e,{type:"markModified",recoilValue:t})}function oO(e,t,n){Ju(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function iO(e,{key:t},n,r=null){const o=VL(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),Xe(i.nodeToComponentSubscriptions.get(t)).set(o,[r??"",n]);const s=HL();if(s.early&&(s.mode==="LEGACY"||s.mode==="MUTABLE_SOURCE")){const a=e.getState().nextTree;a&&a.dirtyAtoms.has(t)&&n(a)}return{release:()=>{const a=e.getState(),l=a.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(o)||(l.delete(o),l.size===0&&a.nodeToComponentSubscriptions.delete(t))}}}function sO(e,t){var n;const{currentTree:r}=e.getState(),o=WL(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var Vn={RecoilValueReadOnly:GL,AbstractRecoilValue:KL,RecoilState:qL,getRecoilValueAsLoadable:YL,setRecoilValue:qS,setRecoilValueLoadable:nO,markRecoilValueModified:rO,setUnvalidatedRecoilValue:oO,subscribeToRecoilValue:iO,isRecoilValue:XL,applyAtomValueWrites:ZL,batchStart:tO,writeLoadableToTreeState:Rf,invalidateDownstreams:KS,copyTreeState:HS,refreshRecoilValue:sO};function aO(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const i=o.value;if(t.call(n,i[1],i[0],e))return!0;o=r.next()}return!1}var lO=aO;const{cleanUpNode:uO}=Mr,{deleteNodeConfigIfPossible:cO,getNode:GS}=Vt,{RetentionZone:XS}=Zu,dO=12e4,QS=new Set;function YS(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const s of t)if(s instanceof XS)for(const a of mO(n,s))o.add(a);else o.add(s);const i=fO(e,o);for(const s of i)hO(e,r,s)}function fO(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),i=new Set,s=new Set;return a(t),i;function a(l){const u=new Set,c=pO(e,r,l,i,s);for(const h of c){var d;if(GS(h).retainedBy==="recoilRoot"){s.add(h);continue}if(((d=n.retention.referenceCounts.get(h))!==null&&d!==void 0?d:0)>0){s.add(h);continue}if(ZS(h).some(b=>n.retention.referenceCounts.get(b))){s.add(h);continue}const m=o.nodeToNodeSubscriptions.get(h);if(m&&lO(m,b=>s.has(b))){s.add(h);continue}i.add(h),u.add(h)}const p=new Set;for(const h of u)for(const m of(y=o.nodeDeps.get(h))!==null&&y!==void 0?y:QS){var y;i.has(m)||p.add(m)}p.size&&a(p)}}function pO(e,t,n,r,o){const i=e.getGraph(t.version),s=[],a=new Set;for(;n.size>0;)l(Xe(n.values().next().value));return s;function l(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(a.has(u))return;const c=i.nodeToNodeSubscriptions.get(u);if(c)for(const d of c)l(d);a.add(u),n.delete(u),s.push(u)}}function hO(e,t,n){if(!Me("recoil_memory_managament_2020"))return;uO(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=ZS(n);for(const l of o){var i;(i=r.retention.nodesRetainedByZone.get(l))===null||i===void 0||i.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const s=r.graphsByVersion.get(t.version);if(s){const l=s.nodeDeps.get(n);if(l!==void 0){s.nodeDeps.delete(n);for(const u of l){var a;(a=s.nodeToNodeSubscriptions.get(u))===null||a===void 0||a.delete(n)}}s.nodeToNodeSubscriptions.delete(n)}cO(n)}function mO(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:QS}function ZS(e){const t=GS(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof XS?[t]:t}function gO(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):YS(e,new Set([t]))}function vO(e,t,n){var r;if(!Me("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,i=((r=o.get(t))!==null&&r!==void 0?r:0)+n;i===0?JS(e,t):o.set(t,i)}function JS(e,t){if(!Me("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),gO(e,t)}function yO(e){if(!Me("recoil_memory_managament_2020"))return;const t=e.getState();YS(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function SO(e){return e===void 0?"recoilRoot":e}var mo={SUSPENSE_TIMEOUT_MS:dO,updateRetainCount:vO,updateRetainCountToZero:JS,releaseScheduledRetainablesNow:yO,retainedByOptionWithDefault:SO};const{unstable_batchedUpdates:xO}=Xi;var wO={unstable_batchedUpdates:xO};const{unstable_batchedUpdates:bO}=wO;var RO={unstable_batchedUpdates:bO};const{batchStart:EO}=Vn,{unstable_batchedUpdates:_O}=RO;let Sh=_O||(e=>e());const CO=e=>{Sh=e},kO=()=>Sh,TO=e=>{Sh(()=>{let t=()=>{};try{t=EO(),e()}finally{t()}})};var ec={getBatcher:kO,setBatcher:CO,batchUpdates:TO};function*PO(e){for(const t of e)for(const n of t)yield n}var ex=PO;const tx=typeof Window>"u"||typeof window>"u",NO=e=>!tx&&(e===window||e instanceof Window),$O=typeof navigator<"u"&&navigator.product==="ReactNative";var tc={isSSR:tx,isReactNative:$O,isWindow:NO};function AO(e,t){let n;return(...r)=>{n||(n={});const o=t(...r);return Object.hasOwnProperty.call(n,o)||(n[o]=e(...r)),n[o]}}function LO(e,t){let n,r;return(...o)=>{const i=t(...o);return n===i||(n=i,r=e(...o)),r}}function OO(e,t){let n,r;return[(...s)=>{const a=t(...s);return n===a||(n=a,r=e(...s)),r},()=>{n=null}]}var MO={memoizeWithArgsHash:AO,memoizeOneWithArgsHash:LO,memoizeOneWithArgsHashAndInvalidation:OO};const{batchUpdates:Ef}=ec,{initializeNode:IO,peekNodeInfo:FO}=Mr,{graph:jO}=ta,{getNextStoreID:zO}=Yu,{DEFAULT_VALUE:DO,recoilValues:cv,recoilValuesForKeys:dv}=Vt,{AbstractRecoilValue:UO,getRecoilValueAsLoadable:BO,setRecoilValue:fv,setUnvalidatedRecoilValue:VO}=Vn,{updateRetainCount:Ya}=mo,{setInvalidateMemoizedSnapshot:WO}=US,{getNextTreeStateVersion:HO,makeEmptyStoreState:KO}=OS,{isSSR:qO}=tc,{memoizeOneWithArgsHashAndInvalidation:GO}=MO;class nc{constructor(t,n){me(this,"_store",void 0),me(this,"_refCount",1),me(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),BO(this._store,r))),me(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),me(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const s=this._store.getState().currentTree;return dv(s.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?cv.values():r.isInitialized===!0?dv(ex([o,i])):gh(cv.values(),({key:s})=>!o.has(s)&&!i.has(s))}),me(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),FO(this._store,this._store.getState().currentTree,r))),me(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new _f(this,Ef);return r(o),o}),me(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new _f(this,Ef);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:zO(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return Xe(o.get(r));const i=jO();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw ve("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)IO(this._store,r,"get"),Ya(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){qO||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!Me("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Me("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function nx(e,t,n=!1){const r=e.getState(),o=n?HO():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(Qu(r.nodeCleanupFunctions.entries(),([i])=>[i,()=>{}]))}}function XO(e){const t=new nc(KO());return e!=null?t.map(e):t}const[pv,rx]=GO((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Xe(r.previousTree);return new nc(nx(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});WO(rx);function QO(e,t="latest"){const n=pv(e,t);return n.isRetained()?n:(rx(),pv(e,t))}class _f extends nc{constructor(t,n){super(nx(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),me(this,"_batch",void 0),me(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Ya(i,r.key,1),fv(this.getStore_INTERNAL(),r,o)})}),me(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ya(o,r.key,1),fv(this.getStore_INTERNAL(),r,DO)})}),me(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();Ef(()=>{for(const[i,s]of r.entries())Ya(o,i,1),VO(o,new UO(i),s)})}),this._batch=n}}var rc={Snapshot:nc,MutableSnapshot:_f,freshSnapshot:XO,cloneSnapshot:QO},YO=rc.Snapshot,ZO=rc.MutableSnapshot,JO=rc.freshSnapshot,eM=rc.cloneSnapshot,oc=Object.freeze({__proto__:null,Snapshot:YO,MutableSnapshot:ZO,freshSnapshot:JO,cloneSnapshot:eM});function tM(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var nM=tM;const{useRef:rM}=be;function oM(e){const t=rM(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var hv=oM;const{getNextTreeStateVersion:iM,makeEmptyStoreState:ox}=OS,{cleanUpNode:sM,getDownstreamNodes:aM,initializeNode:lM,setNodeValue:uM,setUnvalidatedAtomValue_DEPRECATED:cM}=Mr,{graph:dM}=ta,{cloneGraph:fM}=ta,{getNextStoreID:ix}=Yu,{createMutableSource:od,reactMode:sx}=ea,{applyAtomValueWrites:pM}=Vn,{releaseScheduledRetainablesNow:ax}=mo,{freshSnapshot:hM}=oc,{useCallback:mM,useContext:lx,useEffect:Cf,useMemo:gM,useRef:vM,useState:yM}=be;function Di(){throw ve("This component must be used inside a component.")}const ux=Object.freeze({storeID:ix(),getState:Di,replaceState:Di,getGraph:Di,subscribeToTransactions:Di,addTransactionMetadata:Di});let kf=!1;function mv(e){if(kf)throw ve("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){Me("recoil_memory_managament_2020")&&Me("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&ax(e);const n=t.currentTree.version,r=iM();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,fM(Xe(t.graphsByVersion.get(n))))}}const cx=be.createContext({current:ux}),ic=()=>lx(cx),dx=be.createContext(null);function SM(){return lx(dx)}function xh(e,t,n){const r=aM(e,n,n.dirtyAtoms);for(const o of r){const i=t.nodeToComponentSubscriptions.get(o);if(i)for(const[s,[a,l]]of i)l(n)}}function fx(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,i]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[s,a]of i)a(e);for(const[o,i]of t.transactionSubscriptions)i(e);(!sx().early||t.suspendedComponentResolvers.size>0)&&(xh(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function xM(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,fx(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):dh("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Me("recoil_memory_managament_2020")&&n==null&&ax(e)}finally{t.commitDepth--}}function wM({setNotifyBatcherOfChange:e}){const t=ic(),[,n]=yM([]);return e(()=>n({})),Cf(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),Cf(()=>{JA.enqueueExecution("Batcher",()=>{xM(t.current)})}),null}function bM(e,t){const n=ox();return t({set:(r,o)=>{const i=n.currentTree,s=uM(e,i,r.key,o),a=new Set(s.keys()),l=i.nonvalidatedAtoms.clone();for(const u of a)l.delete(u);n.currentTree={...i,dirtyAtoms:nM(i.dirtyAtoms,a),atomValues:pM(i.atomValues,s),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=cM(n.currentTree,i,o)})}}),n}function RM(e){const t=hM(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let gv=0;function EM({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const i=y=>{const h=o.current.graphsByVersion;if(h.has(y))return Xe(h.get(y));const m=dM();return h.set(y,m),m},s=(y,h)=>{if(h==null){const{transactionSubscriptions:m}=d.current.getState(),b=gv++;return m.set(b,y),{release:()=>{m.delete(b)}}}else{const{nodeTransactionSubscriptions:m}=d.current.getState();m.has(h)||m.set(h,new Map);const b=gv++;return Xe(m.get(h)).set(b,y),{release:()=>{const g=m.get(h);g&&(g.delete(b),g.size===0&&m.delete(h))}}}},a=y=>{mv(d.current);for(const h of Object.keys(y))Xe(d.current.getState().nextTree).transactionMetadata[h]=y[h]},l=y=>{mv(d.current);const h=Xe(o.current.nextTree);let m;try{kf=!0,m=y(h)}finally{kf=!1}m!==h&&(o.current.nextTree=m,sx().early&&xh(d.current,o.current,m),Xe(u.current)())},u=vM(null),c=mM(y=>{u.current=y},[u]),d=hv(()=>n??{storeID:ix(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:s,addTransactionMetadata:a});n!=null&&(d.current=n),o=hv(()=>e!=null?bM(d.current,e):t!=null?RM(t):ox());const p=gM(()=>od==null?void 0:od(o,()=>o.current.currentTree.version),[o]);return Cf(()=>{const y=d.current;for(const h of new Set(y.getState().knownAtoms))lM(y,h,"get");return()=>{for(const h of y.getState().knownAtoms)sM(y,h)}},[d]),be.createElement(cx.Provider,{value:d},be.createElement(dx.Provider,{value:p},be.createElement(wM,{setNotifyBatcherOfChange:c}),r))}function _M(e){const{override:t,...n}=e,r=ic();return t===!1&&r.current!==ux?e.children:be.createElement(EM,n)}function CM(){return ic().current.storeID}var or={RecoilRoot:_M,useStoreRef:ic,useRecoilMutableSource:SM,useRecoilStoreID:CM,notifyComponents_FOR_TESTING:xh,sendEndOfBatchNotifications_FOR_TESTING:fx};function kM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var px=$M;const{useStoreRef:AM}=or,{SUSPENSE_TIMEOUT_MS:LM}=mo,{updateRetainCount:Ui}=mo,{RetentionZone:OM}=Zu,{useEffect:MM,useRef:IM}=be,{isSSR:vv}=tc;function FM(e){if(Me("recoil_memory_managament_2020"))return jM(e)}function jM(e){const n=(Array.isArray(e)?e:[e]).map(s=>s instanceof OM?s:s.key),r=AM();MM(()=>{if(!Me("recoil_memory_managament_2020"))return;const s=r.current;if(o.current&&!vv)window.clearTimeout(o.current),o.current=null;else for(const a of n)Ui(s,a,1);return()=>{for(const a of n)Ui(s,a,-1)}},[r,...n]);const o=IM(),i=px(n);if(!vv&&(i===void 0||!TM(i,n))){const s=r.current;for(const a of n)Ui(s,a,1);if(i)for(const a of i)Ui(s,a,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const a of n)Ui(s,a,-1)},LM)}}var wh=FM;function zM(){return""}var ra=zM;const{batchUpdates:DM}=ec,{DEFAULT_VALUE:hx}=Vt,{currentRendererSupportsUseSyncExternalStore:UM,reactMode:Ri,useMutableSource:BM,useSyncExternalStore:VM}=ea,{useRecoilMutableSource:WM,useStoreRef:Wn}=or,{AbstractRecoilValue:Tf,getRecoilValueAsLoadable:oa,setRecoilValue:Ol,setUnvalidatedRecoilValue:HM,subscribeToRecoilValue:si}=Vn,{useCallback:Ut,useEffect:ai,useMemo:mx,useRef:fs,useState:bh}=be,{setByAddingToSet:KM}=IS,{isSSR:qM}=tc;function Rh(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{const i=n.current.getState().suspendedComponentResolvers;i.add(o),qM&&Be(e.contents)&&e.contents.finally(()=>{i.delete(o)})}):e.state==="hasError"?e.contents:ve(`Invalid value of loadable atom "${t.key}"`)}function GM(){const e=ra(),t=Wn(),[,n]=bh([]),r=fs(new Set);r.current=new Set;const o=fs(new Set),i=fs(new Map),s=Ut(l=>{const u=i.current.get(l);u&&(u.release(),i.current.delete(l))},[i]),a=Ut((l,u)=>{i.current.has(u)&&n([])},[]);return ai(()=>{const l=t.current;cs(r.current,o.current).forEach(u=>{if(i.current.has(u))return;const c=si(l,new Tf(u),p=>a(p,u),e);i.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a(l.getState(),u)}):a(l.getState(),u)}),cs(o.current,r.current).forEach(u=>{s(u)}),o.current=r.current}),ai(()=>{const l=i.current;return cs(r.current,new Set(l.keys())).forEach(u=>{const c=si(t.current,new Tf(u),d=>a(d,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>s(c))},[e,t,s,a]),mx(()=>{function l(h){return m=>{Ol(t.current,h,m)}}function u(h){return()=>Ol(t.current,h,hx)}function c(h){var m;r.current.has(h.key)||(r.current=KM(r.current,h.key));const b=t.current.getState();return oa(t.current,h,Ri().early&&(m=b.nextTree)!==null&&m!==void 0?m:b.currentTree)}function d(h){const m=c(h);return Rh(m,h,t)}function p(h){return[d(h),l(h)]}function y(h){return[c(h),l(h)]}return{getRecoilValue:d,getRecoilValueLoadable:c,getRecoilState:p,getRecoilStateLoadable:y,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const XM={current:0};function QM(e){const t=Wn(),n=ra(),r=Ut(()=>{var a;const l=t.current,u=l.getState(),c=Ri().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return{loadable:oa(l,e,c),key:e.key}},[t,e]),o=Ut(a=>{let l;return()=>{var u,c;const d=a();return(u=l)!==null&&u!==void 0&&u.loadable.is(d.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===d.key?l:(l=d,d)}},[]),i=mx(()=>o(r),[r,o]),s=Ut(a=>{const l=t.current;return si(l,e,a,n).release},[t,e,n]);return VM(s,i,i).loadable}function YM(e){const t=Wn(),n=Ut(()=>{var u;const c=t.current,d=c.getState(),p=Ri().early&&(u=d.nextTree)!==null&&u!==void 0?u:d.currentTree;return oa(c,e,p)},[t,e]),r=Ut(()=>n(),[n]),o=ra(),i=Ut((u,c)=>{const d=t.current;return si(d,e,()=>{if(!Me("recoil_suppress_rerender_in_callback"))return c();const y=n();l.current.is(y)||c(),l.current=y},o).release},[t,e,o,n]),s=WM();if(s==null)throw ve("Recoil hooks must be used in components contained within a component.");const a=BM(s,r,i),l=fs(a);return ai(()=>{l.current=a}),a}function Pf(e){const t=Wn(),n=ra(),r=Ut(()=>{var l;const u=t.current,c=u.getState(),d=Ri().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return oa(u,e,d)},[t,e]),o=Ut(()=>({loadable:r(),key:e.key}),[r,e.key]),i=Ut(l=>{const u=o();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[o]);ai(()=>{const l=si(t.current,e,u=>{a(i)},n);return a(i),l.release},[n,e,t,i]);const[s,a]=bh(o);return s.key!==e.key?o().loadable:s.loadable}function ZM(e){const t=Wn(),[,n]=bh([]),r=ra(),o=Ut(()=>{var a;const l=t.current,u=l.getState(),c=Ri().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return oa(l,e,c)},[t,e]),i=o(),s=fs(i);return ai(()=>{s.current=i}),ai(()=>{const a=t.current,l=a.getState(),u=si(a,e,d=>{var p;if(!Me("recoil_suppress_rerender_in_callback"))return n([]);const y=o();(p=s.current)!==null&&p!==void 0&&p.is(y)||n(y),s.current=y},r);if(l.nextTree)a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s.current=null,n([])});else{var c;if(!Me("recoil_suppress_rerender_in_callback"))return n([]);const d=o();(c=s.current)!==null&&c!==void 0&&c.is(d)||n(d),s.current=d}return u.release},[r,o,e,t]),i}function Eh(e){return Me("recoil_memory_managament_2020")&&wh(e),{TRANSITION_SUPPORT:Pf,SYNC_EXTERNAL_STORE:UM()?QM:Pf,MUTABLE_SOURCE:YM,LEGACY:ZM}[Ri().mode](e)}function gx(e){const t=Wn(),n=Eh(e);return Rh(n,e,t)}function sc(e){const t=Wn();return Ut(n=>{Ol(t.current,e,n)},[t,e])}function JM(e){const t=Wn();return Ut(()=>{Ol(t.current,e,hx)},[t,e])}function eI(e){return[gx(e),sc(e)]}function tI(e){return[Eh(e),sc(e)]}function nI(){const e=Wn();return(t,n={})=>{DM(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>HM(e.current,new Tf(o),r))})}}function vx(e){return Me("recoil_memory_managament_2020")&&wh(e),Pf(e)}function yx(e){const t=Wn(),n=vx(e);return Rh(n,e,t)}function rI(e){return[yx(e),sc(e)]}var oI={recoilComponentGetRecoilValueCount_FOR_TESTING:XM,useRecoilInterface:GM,useRecoilState:eI,useRecoilStateLoadable:tI,useRecoilValue:gx,useRecoilValueLoadable:Eh,useResetRecoilState:JM,useSetRecoilState:sc,useSetUnvalidatedAtomValues:nI,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:vx,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:yx,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:rI};function iI(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var sI=iI;function aI(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var lI=aI;function uI(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function xv(e){const t=e.atomValues.toMap(),n=Ll(sI(t,(r,o)=>{const s=Sx(o).persistence_UNSTABLE;return s!=null&&s.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return cI(e.nonvalidatedAtoms.toMap(),n)}function yI(e){lc(ac(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=xv(r),i=xv(n),s=Ll(pI,l=>{var u,c,d,p;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(d=(p=l.persistence_UNSTABLE)===null||p===void 0?void 0:p.backButton)!==null&&d!==void 0?d:!1}}}),a=lI(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:s,modifiedAtoms:a,transactionMetadata:{...r.transactionMetadata}})},[e]))}function SI(e){lc(ac(t=>{const n=Ml(t,"latest"),r=Ml(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function xI(){const e=_h(),[t,n]=vI(()=>Ml(e.current)),r=px(t),o=yv(),i=yv();if(lc(ac(a=>n(Ml(a)),[])),xx(()=>{const a=t.retain();if(o.current&&!Sv){var l;window.clearTimeout(o.current),o.current=null,(l=i.current)===null||l===void 0||l.call(i),i.current=null}return()=>{window.setTimeout(a,10)}},[t]),r!==t&&!Sv){if(o.current){var s;window.clearTimeout(o.current),o.current=null,(s=i.current)===null||s===void 0||s.call(i),i.current=null}i.current=t.retain(),o.current=window.setTimeout(()=>{var a;o.current=null,(a=i.current)===null||a===void 0||a.call(i),i.current=null},gI)}return t}function wx(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,i=t.getStore_INTERNAL().getState().currentTree;dI(()=>{const s=new Set;for(const u of[o.atomValues.keys(),i.atomValues.keys()])for(const c of u){var a,l;((a=o.atomValues.get(c))===null||a===void 0?void 0:a.contents)!==((l=i.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&Sx(c).shouldRestoreFromSnapshots&&s.add(c)}s.forEach(u=>{mI(e,new hI(u),i.atomValues.has(u)?Xe(i.atomValues.get(u)):fI)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function wI(){const e=_h();return ac(t=>wx(e.current,t),[e])}var bx={useRecoilSnapshot:xI,gotoSnapshot:wx,useGotoRecoilSnapshot:wI,useRecoilTransactionObserver:SI,useTransactionObservation_DEPRECATED:yI,useTransactionSubscription_DEPRECATED:lc};const{peekNodeInfo:bI}=Mr,{useStoreRef:RI}=or;function EI(){const e=RI();return({key:t})=>bI(e.current,e.current.getState().currentTree,t)}var _I=EI;const{reactMode:CI}=ea,{RecoilRoot:kI,useStoreRef:TI}=or,{useMemo:PI}=be;function NI(){CI().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=TI().current;return PI(()=>{function t({children:n}){return be.createElement(kI,{store_INTERNAL:e},n)}return t},[e])}var $I=NI;const{loadableWithValue:AI}=Js,{initializeNode:LI}=Mr,{DEFAULT_VALUE:OI,getNode:MI}=Vt,{copyTreeState:II,getRecoilValueAsLoadable:FI,invalidateDownstreams:jI,writeLoadableToTreeState:zI}=Vn;function wv(e){return MI(e.key).nodeType==="atom"}class DI{constructor(t,n){me(this,"_store",void 0),me(this,"_treeState",void 0),me(this,"_changes",void 0),me(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!wv(r))throw ve("Reading selectors within atomicUpdate is not supported");const o=FI(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:ve(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),me(this,"set",(r,o)=>{if(!wv(r))throw ve("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const i=this.get(r);this._changes.set(r.key,o(i))}else LI(this._store,r.key,"set"),this._changes.set(r.key,o)}),me(this,"reset",r=>{this.set(r,OI)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=II(this._treeState);for(const[n,r]of this._changes)zI(t,n,AI(r));return jI(this._store,t),t}}function UI(e){return t=>{e.replaceState(n=>{const r=new DI(e,n);return t(r),r.newTreeState_INTERNAL()})}}var BI={atomicUpdater:UI},VI=BI.atomicUpdater,Rx=Object.freeze({__proto__:null,atomicUpdater:VI});function WI(e,t){if(!e)throw new Error(t)}var HI=WI,Yi=HI;const{atomicUpdater:KI}=Rx,{batchUpdates:qI}=ec,{DEFAULT_VALUE:GI}=Vt,{useStoreRef:XI}=or,{refreshRecoilValue:QI,setRecoilValue:bv}=Vn,{cloneSnapshot:YI}=oc,{gotoSnapshot:ZI}=bx,{useCallback:JI}=be;class Ex{}const e5=new Ex;function _x(e,t,n,r){let o=e5,i;if(qI(()=>{const a="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw ve(a);const l=FS({...r??{},set:(c,d)=>bv(e,c,d),reset:c=>bv(e,c,GI),refresh:c=>QI(e,c),gotoSnapshot:c=>ZI(e,c),transact_UNSTABLE:c=>KI(e)(c)},{snapshot:()=>{const c=YI(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw ve(a);o=u(...n)}),o instanceof Ex&&Yi(!1),Be(o))o=o.finally(()=>{var a;(a=i)===null||a===void 0||a()});else{var s;(s=i)===null||s===void 0||s()}return o}function t5(e,t){const n=XI();return JI((...r)=>_x(n.current,e,r),t!=null?[...t,n]:void 0)}var Cx={recoilCallback:_x,useRecoilCallback:t5};const{useStoreRef:n5}=or,{refreshRecoilValue:r5}=Vn,{useCallback:o5}=be;function i5(e){const t=n5();return o5(()=>{const n=t.current;r5(n,e)},[e,t])}var s5=i5;const{atomicUpdater:a5}=Rx,{useStoreRef:l5}=or,{useMemo:u5}=be;function c5(e,t){const n=l5();return u5(()=>(...r)=>{a5(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var d5=c5;class f5{constructor(t){me(this,"value",void 0),this.value=t}}var p5={WrappedValue:f5},h5=p5.WrappedValue,kx=Object.freeze({__proto__:null,WrappedValue:h5});const{isFastRefreshEnabled:m5}=ea;class Rv extends Error{}class g5{constructor(t){var n,r,o;me(this,"_name",void 0),me(this,"_numLeafs",void 0),me(this,"_root",void 0),me(this,"_onHit",void 0),me(this,"_onSet",void 0),me(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:i=>i}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var i,s,a,l;let u,c;for(const[b,g]of t){var d,p,y;const f=this._root;if((f==null?void 0:f.type)==="leaf")throw this.invalidCacheError();const v=u;if(u=v?v.branches.get(c):f,u=(d=u)!==null&&d!==void 0?d:{type:"branch",nodeKey:b,parent:v,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==b)throw this.invalidCacheError();v==null||v.branches.set(c,u),r==null||(p=r.onNodeVisit)===null||p===void 0||p.call(r,u),c=this._mapNodeValue(g),this._root=(y=this._root)!==null&&y!==void 0?y:u}const h=u?(i=u)===null||i===void 0?void 0:i.branches.get(c):this._root;if(h!=null&&(h.type!=="leaf"||h.branchKey!==c))throw this.invalidCacheError();const m={type:"leaf",value:n,parent:u,branchKey:c};(s=u)===null||s===void 0||s.branches.set(c,m),this._root=(a=this._root)!==null&&a!==void 0?a:m,this._numLeafs++,this._onSet(m),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,m)};try{o()}catch(i){if(i instanceof Rv)this.clear(),o();else throw i}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var i;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(i=r)===null||i===void 0?void 0:i.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=m5()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw dh(t+(this._name!=null?` - ${this._name}`:"")),new Rv}}var v5={TreeCache:g5},y5=v5.TreeCache,Tx=Object.freeze({__proto__:null,TreeCache:y5});class S5{constructor(t){var n;me(this,"_maxSize",void 0),me(this,"_size",void 0),me(this,"_head",void 0),me(this,"_tail",void 0),me(this,"_map",void 0),me(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const i=this.head(),s={key:t,right:i,left:null,value:n};i?i.left=s:this._tail=s,this._map.set(r,s),this._head=s,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Xe(this._map.get(n)),o=r.right,i=r.left;o&&(o.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=i),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var x5={LRUCache:S5},w5=x5.LRUCache,Px=Object.freeze({__proto__:null,LRUCache:w5});const{LRUCache:b5}=Px,{TreeCache:R5}=Tx;function E5({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new b5({maxSize:t}),o=new R5({name:e,mapNodeValue:n,onHit:i=>{r.set(i,!0)},onSet:i=>{const s=r.tail();r.set(i,!0),s&&o.size()>t&&o.delete(s.key)}});return o}var Ev=E5;function Rn(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw ve("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Be(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,i)=>Rn(o,t,i.toString()))}]`;if(typeof e.toJSON=="function")return Rn(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[i,s]of e)o[typeof i=="string"?i:Rn(i,t)]=s;return Rn(o,t,n)}return e instanceof Set?Rn(Array.from(e).sort((o,i)=>Rn(o,t).localeCompare(Rn(i,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?Rn(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${Rn(o,t)}:${Rn(e[o],t,o)}`).join(",")}}`}function _5(e,t={allowFunctions:!1}){return Rn(e,t)}var uc=_5;const{TreeCache:C5}=Tx,ka={equality:"reference",eviction:"keep-all",maxSize:1/0};function k5({equality:e=ka.equality,eviction:t=ka.eviction,maxSize:n=ka.maxSize}=ka,r){const o=T5(e);return P5(t,n,o,r)}function T5(e){switch(e){case"reference":return t=>t;case"value":return t=>uc(t)}throw ve(`Unrecognized equality policy ${e}`)}function P5(e,t,n,r){switch(e){case"keep-all":return new C5({name:r,mapNodeValue:n});case"lru":return Ev({name:r,maxSize:Xe(t),mapNodeValue:n});case"most-recent":return Ev({name:r,maxSize:1,mapNodeValue:n})}throw ve(`Unrecognized eviction policy ${e}`)}var N5=k5;function $5(e){return()=>null}var A5={startPerfBlock:$5};const{isLoadable:L5,loadableWithError:Ta,loadableWithPromise:O5,loadableWithValue:id}=Js,{WrappedValue:Nx}=kx,{getNodeLoadable:Pa,peekNodeLoadable:M5,setNodeValue:I5}=Mr,{saveDepsToStore:F5}=ta,{DEFAULT_VALUE:j5,getConfigDeletionHandler:z5,getNode:D5,registerNode:_v}=Vt,{isRecoilValue:U5}=ii,{markRecoilValueModified:Cv}=Vn,{retainedByOptionWithDefault:B5}=mo,{recoilCallback:V5}=Cx,{startPerfBlock:W5}=A5;class $x{}const Bi=new $x,Vi=[],Na=new Map,H5=(()=>{let e=0;return()=>e++})();function Ax(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,i=e.set!=null?e.set:void 0,s=new Set,a=N5(o??{equality:"reference",eviction:"keep-all"},n),l=B5(e.retainedBy_UNSTABLE),u=new Map;let c=0;function d(){return!Me("recoil_memory_managament_2020")||c>0}function p(C){return C.getState().knownSelectors.add(n),c++,()=>{c--}}function y(){return z5(n)!==void 0&&!d()}function h(C,M,L,Q,D){V(M,Q,D),m(C,L)}function m(C,M){B(C,M)&&U(C),g(M,!0)}function b(C,M){B(C,M)&&(Xe(A(C)).stateVersions.clear(),g(M,!1))}function g(C,M){const L=Na.get(C);if(L!=null){for(const Q of L)Cv(Q,Xe(t));M&&Na.delete(C)}}function f(C,M){let L=Na.get(M);L==null&&Na.set(M,L=new Set),L.add(C)}function v(C,M,L,Q,D,re){return M.then(ie=>{if(!d())throw U(C),Bi;const q=id(ie);return h(C,L,D,q,Q),ie}).catch(ie=>{if(!d())throw U(C),Bi;if(Be(ie))return x(C,ie,L,Q,D,re);const q=Ta(ie);throw h(C,L,D,q,Q),ie})}function x(C,M,L,Q,D,re){return M.then(ie=>{if(!d())throw U(C),Bi;re.loadingDepKey!=null&&re.loadingDepPromise===M?L.atomValues.set(re.loadingDepKey,id(ie)):C.getState().knownSelectors.forEach(se=>{L.atomValues.delete(se)});const q=E(C,L);if(q&&q.state!=="loading"){if((B(C,D)||A(C)==null)&&m(C,D),q.state==="hasValue")return q.contents;throw q.contents}if(!B(C,D)){const se=j(C,L);if(se!=null)return se.loadingLoadable.contents}const[ye,le]=T(C,L,D);if(ye.state!=="loading"&&h(C,L,D,ye,le),ye.state==="hasError")throw ye.contents;return ye.contents}).catch(ie=>{if(ie instanceof $x)throw Bi;if(!d())throw U(C),Bi;const q=Ta(ie);throw h(C,L,D,q,Q),ie})}function R(C,M,L,Q){var D,re,ie,q;if(B(C,Q)||M.version===((D=C.getState())===null||D===void 0||(re=D.currentTree)===null||re===void 0?void 0:re.version)||M.version===((ie=C.getState())===null||ie===void 0||(q=ie.nextTree)===null||q===void 0?void 0:q.version)){var ye,le,se;F5(n,L,C,(ye=(le=C.getState())===null||le===void 0||(se=le.nextTree)===null||se===void 0?void 0:se.version)!==null&&ye!==void 0?ye:C.getState().currentTree.version)}for(const ne of L)s.add(ne)}function T(C,M,L){const Q=W5(n);let D=!0,re=!0;const ie=()=>{Q(),re=!1};let q,ye=!1,le;const se={loadingDepKey:null,loadingDepPromise:null},ne=new Map;function ge({key:nt}){const Ie=Pa(C,M,nt);switch(ne.set(nt,Ie),D||(R(C,M,new Set(ne.keys()),L),b(C,L)),Ie.state){case"hasValue":return Ie.contents;case"hasError":throw Ie.contents;case"loading":throw se.loadingDepKey=nt,se.loadingDepPromise=Ie.contents,Ie.contents}throw ve("Invalid Loadable state")}const _e=nt=>(...Ie)=>{if(re)throw ve("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&Yi(!1),V5(C,nt,Ie,{node:t})};try{q=r({get:ge,getCallback:_e}),q=U5(q)?ge(q):q,L5(q)&&(q.state==="hasError"&&(ye=!0),q=q.contents),Be(q)?q=v(C,q,M,ne,L,se).finally(ie):ie(),q=q instanceof Nx?q.value:q}catch(nt){q=nt,Be(q)?q=x(C,q,M,ne,L,se).finally(ie):(ye=!0,ie())}return ye?le=Ta(q):Be(q)?le=O5(q):le=id(q),D=!1,Z(C,L,ne),R(C,M,new Set(ne.keys()),L),[le,ne]}function E(C,M){let L=M.atomValues.get(n);if(L!=null)return L;const Q=new Set;try{L=a.get(re=>(typeof re!="string"&&Yi(!1),Pa(C,M,re).contents),{onNodeVisit:re=>{re.type==="branch"&&re.nodeKey!==n&&Q.add(re.nodeKey)}})}catch(re){throw ve(`Problem with cache lookup for selector "${n}": ${re.message}`)}if(L){var D;M.atomValues.set(n,L),R(C,M,Q,(D=A(C))===null||D===void 0?void 0:D.executionID)}return L}function $(C,M){const L=E(C,M);if(L!=null)return U(C),L;const Q=j(C,M);if(Q!=null){var D;return((D=Q.loadingLoadable)===null||D===void 0?void 0:D.state)==="loading"&&f(C,Q.executionID),Q.loadingLoadable}const re=H5(),[ie,q]=T(C,M,re);return ie.state==="loading"?(K(C,re,ie,q,M),f(C,re)):(U(C),V(M,ie,q)),ie}function j(C,M){const L=ex([u.has(C)?[Xe(u.get(C))]:[],Qu(gh(u,([D])=>D!==C),([,D])=>D)]);function Q(D){for(const[re,ie]of D)if(!Pa(C,M,re).is(ie))return!0;return!1}for(const D of L){if(D.stateVersions.get(M.version)||!Q(D.depValuesDiscoveredSoFarDuringAsyncWork))return D.stateVersions.set(M.version,!0),D;D.stateVersions.set(M.version,!1)}}function A(C){return u.get(C)}function K(C,M,L,Q,D){u.set(C,{depValuesDiscoveredSoFarDuringAsyncWork:Q,executionID:M,loadingLoadable:L,stateVersions:new Map([[D.version,!0]])})}function Z(C,M,L){if(B(C,M)){const Q=A(C);Q!=null&&(Q.depValuesDiscoveredSoFarDuringAsyncWork=L)}}function U(C){u.delete(C)}function B(C,M){var L;return M===((L=A(C))===null||L===void 0?void 0:L.executionID)}function H(C){return Array.from(C.entries()).map(([M,L])=>[M,L.contents])}function V(C,M,L){C.atomValues.set(n,M);try{a.set(H(L),M)}catch(Q){throw ve(`Problem with setting cache for selector "${n}": ${Q.message}`)}}function Y(C){if(Vi.includes(n)){const M=`Recoil selector has circular dependencies: ${Vi.slice(Vi.indexOf(n)).join(" → ")}`;return Ta(ve(M))}Vi.push(n);try{return C()}finally{Vi.pop()}}function N(C,M){const L=M.atomValues.get(n);return L??a.get(Q=>{var D;return typeof Q!="string"&&Yi(!1),(D=M5(C,M,Q))===null||D===void 0?void 0:D.contents})}function W(C,M){return Y(()=>$(C,M))}function F(C){C.atomValues.delete(n)}function J(C,M){t==null&&Yi(!1);for(const Q of s){var L;const D=D5(Q);(L=D.clearCache)===null||L===void 0||L.call(D,C,M)}s.clear(),F(M),a.clear(),Cv(C,t)}return i!=null?t=_v({key:n,nodeType:"selector",peek:N,get:W,set:(M,L,Q)=>{let D=!1;const re=new Map;function ie({key:se}){if(D)throw ve("Recoil: Async selector sets are not currently supported.");const ne=Pa(M,L,se);if(ne.state==="hasValue")return ne.contents;if(ne.state==="loading"){const ge=`Getting value of asynchronous atom or selector "${se}" in a pending state while setting selector "${n}" is not yet supported.`;throw ve(ge)}else throw ne.contents}function q(se,ne){if(D)throw ve("Recoil: Async selector sets are not currently supported.");const ge=typeof ne=="function"?ne(ie(se)):ne;I5(M,L,se.key,ge).forEach((nt,Ie)=>re.set(Ie,nt))}function ye(se){q(se,j5)}const le=i({set:q,get:ie,reset:ye},Q);if(le!==void 0)throw Be(le)?ve("Recoil: Async selector sets are not currently supported."):ve("Recoil: selector set should be a void function.");return D=!0,re},init:p,invalidate:F,clearCache:J,shouldDeleteConfigOnRelease:y,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=_v({key:n,nodeType:"selector",peek:N,get:W,init:p,invalidate:F,clearCache:J,shouldDeleteConfigOnRelease:y,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}Ax.value=e=>new Nx(e);var li=Ax;const{isLoadable:K5,loadableWithError:sd,loadableWithPromise:ad,loadableWithValue:Eo}=Js,{WrappedValue:Lx}=kx,{peekNodeInfo:q5}=Mr,{DEFAULT_VALUE:Vr,DefaultValue:pr,getConfigDeletionHandler:Ox,registerNode:G5,setConfigDeletionHandler:X5}=Vt,{isRecoilValue:Q5}=ii,{getRecoilValueAsLoadable:Y5,markRecoilValueModified:Z5,setRecoilValue:kv,setRecoilValueLoadable:J5}=Vn,{retainedByOptionWithDefault:eF}=mo,Wi=e=>e instanceof Lx?e.value:e;function tF(e){const{key:t,persistence_UNSTABLE:n}=e,r=eF(e.retainedBy_UNSTABLE);let o=0;function i(f){return ad(f.then(v=>(s=Eo(v),v)).catch(v=>{throw s=sd(v),v}))}let s=Be(e.default)?i(e.default):K5(e.default)?e.default.state==="loading"?i(e.default.contents):e.default:Eo(Wi(e.default));s.contents;let a;const l=new Map;function u(f){return f}function c(f,v){const x=v.then(R=>{var T,E;return((E=((T=f.getState().nextTree)!==null&&T!==void 0?T:f.getState().currentTree).atomValues.get(t))===null||E===void 0?void 0:E.contents)===x&&kv(f,g,R),R}).catch(R=>{var T,E;throw((E=((T=f.getState().nextTree)!==null&&T!==void 0?T:f.getState().currentTree).atomValues.get(t))===null||E===void 0?void 0:E.contents)===x&&J5(f,g,sd(R)),R});return x}function d(f,v,x){var R;o++;const T=()=>{var A;o--,(A=l.get(f))===null||A===void 0||A.forEach(K=>K()),l.delete(f)};if(f.getState().knownAtoms.add(t),s.state==="loading"){const A=()=>{var K;((K=f.getState().nextTree)!==null&&K!==void 0?K:f.getState().currentTree).atomValues.has(t)||Z5(f,g)};s.contents.finally(A)}const E=(R=e.effects)!==null&&R!==void 0?R:e.effects_UNSTABLE;if(E!=null){let A=function(F){if(B&&F.key===t){const J=U;return J instanceof pr?p(f,v):Be(J)?ad(J.then(C=>C instanceof pr?s.toPromise():C)):Eo(J)}return Y5(f,F)},K=function(F){return A(F).toPromise()},Z=function(F){var J;const C=q5(f,(J=f.getState().nextTree)!==null&&J!==void 0?J:f.getState().currentTree,F.key);return B&&F.key===t&&!(U instanceof pr)?{...C,isSet:!0,loadable:A(F)}:C},U=Vr,B=!0,H=!1,V=null;const Y=F=>J=>{if(B){const C=A(g),M=C.state==="hasValue"?C.contents:Vr;U=typeof J=="function"?J(M):J,Be(U)&&(U=U.then(L=>(V={effect:F,value:L},L)))}else{if(Be(J))throw ve("Setting atoms to async values is not implemented.");typeof J!="function"&&(V={effect:F,value:Wi(J)}),kv(f,g,typeof J=="function"?C=>{const M=Wi(J(C));return V={effect:F,value:M},M}:Wi(J))}},N=F=>()=>Y(F)(Vr),W=F=>J=>{var C;const{release:M}=f.subscribeToTransactions(L=>{var Q;let{currentTree:D,previousTree:re}=L.getState();re||(re=D);const ie=(Q=D.atomValues.get(t))!==null&&Q!==void 0?Q:s;if(ie.state==="hasValue"){var q,ye,le,se;const ne=ie.contents,ge=(q=re.atomValues.get(t))!==null&&q!==void 0?q:s,_e=ge.state==="hasValue"?ge.contents:Vr;((ye=V)===null||ye===void 0?void 0:ye.effect)!==F||((le=V)===null||le===void 0?void 0:le.value)!==ne?J(ne,_e,!D.atomValues.has(t)):((se=V)===null||se===void 0?void 0:se.effect)===F&&(V=null)}},t);l.set(f,[...(C=l.get(f))!==null&&C!==void 0?C:[],M])};for(const F of E)try{const J=F({node:g,storeID:f.storeID,parentStoreID_UNSTABLE:f.parentStoreID,trigger:x,setSelf:Y(F),resetSelf:N(F),onSet:W(F),getPromise:K,getLoadable:A,getInfo_UNSTABLE:Z});if(J!=null){var $;l.set(f,[...($=l.get(f))!==null&&$!==void 0?$:[],J])}}catch(J){U=J,H=!0}if(B=!1,!(U instanceof pr)){var j;const F=H?sd(U):Be(U)?ad(c(f,U)):Eo(Wi(U));F.contents,v.atomValues.set(t,F),(j=f.getState().nextTree)===null||j===void 0||j.atomValues.set(t,F)}}return T}function p(f,v){var x,R;return(x=(R=v.atomValues.get(t))!==null&&R!==void 0?R:a)!==null&&x!==void 0?x:s}function y(f,v){if(v.atomValues.has(t))return Xe(v.atomValues.get(t));if(v.nonvalidatedAtoms.has(t)){if(a!=null)return a;if(n==null)return s;const x=v.nonvalidatedAtoms.get(t),R=n.validator(x,Vr);return a=R instanceof pr?s:Eo(R),a}else return s}function h(){a=void 0}function m(f,v,x){if(v.atomValues.has(t)){const R=Xe(v.atomValues.get(t));if(R.state==="hasValue"&&x===R.contents)return new Map}else if(!v.nonvalidatedAtoms.has(t)&&x instanceof pr)return new Map;return a=void 0,new Map().set(t,Eo(x))}function b(){return Ox(t)!==void 0&&o<=0}const g=G5({key:t,nodeType:"atom",peek:p,get:y,set:m,init:d,invalidate:h,shouldDeleteConfigOnRelease:b,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return g}function Ch(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return Q5(n)?nF({...t,default:n}):tF({...t,default:n})}function nF(e){const t=Ch({...e,default:Vr,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof pr?r:Xe(e.persistence_UNSTABLE).validator(r,Vr)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=li({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof pr?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return X5(n.key,Ox(e.key)),n}Ch.value=e=>new Lx(e);var Mx=Ch;class rF{constructor(t){var n;me(this,"_map",void 0),me(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var oF={MapCache:rF},iF=oF.MapCache,sF=Object.freeze({__proto__:null,MapCache:iF});const{LRUCache:Tv}=Px,{MapCache:aF}=sF,$a={equality:"reference",eviction:"none",maxSize:1/0};function lF({equality:e=$a.equality,eviction:t=$a.eviction,maxSize:n=$a.maxSize}=$a){const r=uF(e);return cF(t,n,r)}function uF(e){switch(e){case"reference":return t=>t;case"value":return t=>uc(t)}throw ve(`Unrecognized equality policy ${e}`)}function cF(e,t,n){switch(e){case"keep-all":return new aF({mapKey:n});case"lru":return new Tv({mapKey:n,maxSize:Xe(t)});case"most-recent":return new Tv({mapKey:n,maxSize:1})}throw ve(`Unrecognized eviction policy ${e}`)}var Ix=lF;const{setConfigDeletionHandler:dF}=Vt;function fF(e){var t,n;const r=Ix({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i,s;const a=r.get(o);if(a!=null)return a;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),d=Mx({...u,key:`${e.key}__${(i=uc(o))!==null&&i!==void 0?i:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(s=e.effects)!==null&&s!==void 0?s:e.effects_UNSTABLE});return r.set(o,d),dF(d.key,()=>{r.delete(o)}),d}}var pF=fF;const{setConfigDeletionHandler:hF}=Vt;let mF=0;function gF(e){var t,n;const r=Ix({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i;let s;try{s=r.get(o)}catch(p){throw ve(`Problem with cache lookup for selector ${e.key}: ${p.message}`)}if(s!=null)return s;const a=`${e.key}__selectorFamily/${(i=uc(o,{allowFunctions:!0}))!==null&&i!==void 0?i:"void"}/${mF++}`,l=p=>e.get(o)(p),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let d;if(e.set!=null){const p=e.set;d=li({key:a,get:l,set:(h,m)=>p(o)(h,m),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else d=li({key:a,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,d),hF(d.key,()=>{r.delete(o)}),d}}var Ir=gF;const vF=Ir({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function yF(e){return vF(e)}var SF=yF;const xF=Ir({key:"__error",get:e=>()=>{throw ve(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function wF(e){return xF(e)}var bF=wF;function RF(e){return e}var EF=RF;const{loadableWithError:Fx,loadableWithPromise:jx,loadableWithValue:zx}=Js;function cc(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,i]of t.entries())try{n[o]=e(i)}catch(s){r[o]=s}return[n,r]}function _F(e){return e!=null&&!Be(e)}function dc(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function Nf(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function qo(e,t,n){const r=n.map((o,i)=>o==null?zx(t[i]):Be(o)?jx(o):Fx(o));return Nf(e,r)}function CF(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const kF=Ir({key:"__waitForNone",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);return qo(e,r,o)},dangerouslyAllowMutability:!0}),TF=Ir({key:"__waitForAny",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);return o.some(i=>!Be(i))?qo(e,r,o):new Promise(i=>{for(const[s,a]of o.entries())Be(a)&&a.then(l=>{r[s]=l,o[s]=void 0,i(qo(e,r,o))}).catch(l=>{o[s]=l,i(qo(e,r,o))})})},dangerouslyAllowMutability:!0}),PF=Ir({key:"__waitForAll",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);if(o.every(s=>s==null))return Nf(e,r);const i=o.find(_F);if(i!=null)throw i;return Promise.all(o).then(s=>Nf(e,CF(r,s)))},dangerouslyAllowMutability:!0}),NF=Ir({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);return o.every(i=>!Be(i))?qo(e,r,o):Promise.all(o.map((i,s)=>Be(i)?i.then(a=>{r[s]=a,o[s]=void 0}).catch(a=>{r[s]=void 0,o[s]=a}):null)).then(()=>qo(e,r,o))},dangerouslyAllowMutability:!0}),$F=Ir({key:"__noWait",get:e=>({get:t})=>{try{return li.value(zx(t(e)))}catch(n){return li.value(Be(n)?jx(n):Fx(n))}},dangerouslyAllowMutability:!0});var AF={waitForNone:kF,waitForAny:TF,waitForAll:PF,waitForAllSettled:NF,noWait:$F};const{RecoilLoadable:LF}=Js,{DefaultValue:OF}=Vt,{RecoilRoot:MF,useRecoilStoreID:IF}=or,{isRecoilValue:FF}=ii,{retentionZone:jF}=Zu,{freshSnapshot:zF}=oc,{useRecoilState:DF,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:UF,useRecoilStateLoadable:BF,useRecoilValue:VF,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:WF,useRecoilValueLoadable:HF,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:KF,useResetRecoilState:qF,useSetRecoilState:GF}=oI,{useGotoRecoilSnapshot:XF,useRecoilSnapshot:QF,useRecoilTransactionObserver:YF}=bx,{useRecoilCallback:ZF}=Cx,{noWait:JF,waitForAll:e3,waitForAllSettled:t3,waitForAny:n3,waitForNone:r3}=AF;var kh={DefaultValue:OF,isRecoilValue:FF,RecoilLoadable:LF,RecoilEnv:bi,RecoilRoot:MF,useRecoilStoreID:IF,useRecoilBridgeAcrossReactRoots_UNSTABLE:$I,atom:Mx,selector:li,atomFamily:pF,selectorFamily:Ir,constSelector:SF,errorSelector:bF,readOnlySelector:EF,noWait:JF,waitForNone:r3,waitForAny:n3,waitForAll:e3,waitForAllSettled:t3,useRecoilValue:VF,useRecoilValueLoadable:HF,useRecoilState:DF,useRecoilStateLoadable:BF,useSetRecoilState:GF,useResetRecoilState:qF,useGetRecoilValueInfo_UNSTABLE:_I,useRecoilRefresher_UNSTABLE:s5,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:KF,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:WF,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:UF,useRecoilCallback:ZF,useRecoilTransaction_UNSTABLE:d5,useGotoRecoilSnapshot:XF,useRecoilSnapshot:QF,useRecoilTransactionObserver_UNSTABLE:YF,snapshot_UNSTABLE:zF,useRetain:wh,retentionZone:jF},o3=kh.RecoilRoot,i3=kh.atom,s3=kh.useRecoilState;const a3=i3({key:"userState",default:{username:null,isLoading:!0}});function l3(){const e=kp(),t=pi(),[n,r]=s3(a3),o=async()=>{console.log("from function"),await Te.get(yn+"/user/me",{headers:{authorization:"bearer "+localStorage.getItem("token")}}).then(s=>{console.log("data"+s.data),r({username:s.data.username,isLoading:!1})}).catch(s=>{console.log(s),r({username:"",isLoading:!1})})};S.useEffect(()=>{async function s(){await o(),console.log("pathname"),console.log(e.pathname),n.username&&["/signin","/"].includes(e.pathname)&&t("/users")}s()},[e]);const i=async()=>{localStorage.removeItem("token"),await o(),t("/signin")};return n.isLoading?w.jsx(w.Fragment,{children:w.jsxs(Tr,{style:{display:"flex",justifyContent:"space-between",height:50},children:[w.jsx("h3",{style:{margin:10},children:w.jsx(Pt,{onClick:()=>t("/"),children:"Kaizoku"})}),w.jsx(Ys,{})]})}):n.username?w.jsx(w.Fragment,{children:w.jsxs(Tr,{style:{display:"flex",justifyContent:"space-between",height:50},children:[w.jsx("h3",{style:{margin:10},children:w.jsx(Pt,{onClick:()=>t("/"),children:"Kaizoku"})}),w.jsxs("div",{style:{display:"flex",justifyContent:"space-evenly"},children:[w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/users"),children:"Users"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/friends"),children:"Friends"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/received-friend-requests"),children:"Incoming Requests"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/sent-friend-requests"),children:"OutGoing Requests"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:i,children:"Log Out"}),w.jsx("h3",{style:{margin:10,marginTop:15},children:n.username})]})]})}):w.jsx(w.Fragment,{children:w.jsxs(Tr,{style:{display:"flex",justifyContent:"space-between",height:50},children:[w.jsx("h3",{style:{margin:10},children:w.jsx(Pt,{onClick:()=>t("/"),children:"Kaizoku"})}),w.jsx(Pt,{variant:"contained",style:{height:35,marginLeft:10},onClick:()=>t("/"),children:"Login"})]})})}const Dx=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/friends",{headers:e})).data}catch(t){return console.log(t),{friends:[]}}},u3=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/users",{headers:e})).data}catch(t){return console.log(t),{Users:[]}}},c3=async e=>{const t={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/send-friend-request",{username:e},{headers:t})).data}catch(n){return console.error(n),{message:"Could not send friend request"}}},Ux=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/sent-friend-requests",{headers:e})).data}catch(t){return console.error(t),{sentFriendRequestsUsername:[""]}}},Bx=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/received-friend-requests",{headers:e})).data}catch(t){return console.error(t),{receivedFriendRequestsUsername:[""]}}},d3=async e=>{const t={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/accept-friend-request",{username:e},{headers:t})).data}catch(n){return console.error(n),{message:""}}},f3=async e=>{const t={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/chat/get",{with:e},{headers:t})).data}catch(n){return console.error(n),{message:""}}},p3=async(e,t)=>{const n={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/chat/send",{receiver:e,message:t},{headers:n})).data}catch(r){return console.error(r),{message:""}}};function h3(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[o,i]=S.useState(!1);S.useEffect(()=>{r(!0);async function a(){const l=await u3(),u=await Dx(),c=await Ux(),d=await Bx();l.Users?(l.Users=l.Users.filter(p=>!u.friends.includes(p.username)&&!c.sentFriendRequestsUsername.includes(p.username)&&!d.receivedFriendRequestsUsername.includes(p.username)),t(l.Users),r(!1)):console.log("Users not loaded")}a()},[]);const s=async a=>{await c3(a),t(l=>l.filter(u=>u.username!=a)),i(!0)};return n?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):e.length>0?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Users"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:"Friend Request Sent Successfully",open:o,setOpen:i}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:e.map(a=>w.jsx(fc,{username:a.username,handleClick:s,buttonText:"Add Friend",button:!0},a.username))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Users To Send Request To."})," "]})}const fc=e=>e.button?w.jsxs(Tr,{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:200,width:150,marginBottom:10,margin:10},children:[w.jsx("h3",{style:{textAlign:"center",marginTop:10},children:e.username}),w.jsx(Pt,{style:{marginRight:10,margin:10},onClick:()=>e.handleClick(e.username),variant:"contained",children:e.buttonText})]}):w.jsx(Tr,{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:200,margin:10,width:150,marginBottom:10},children:w.jsx("h3",{style:{marginLeft:10},children:e.username})});function m3(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[o,i]=S.useState(!1);return S.useEffect(()=>{async function s(){console.log("response");const a=await Ux();console.log(a),t(a.sentFriendRequestsUsername),r(!1)}s()},[]),n?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):e.length>0?e[0]!=""?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Sent Friend Requests"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:"Friend Request Sent Successfully",open:o,setOpen:i}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:e.map(s=>w.jsx(fc,{username:s,handleClick:()=>{},buttonText:"Unsend Friend Request",button:!1},s))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Users To Send Request To."})," "]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Users To Send Request To."})," "]})}function g3(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[o,i]=S.useState(!1),[s,a]=S.useState("");S.useEffect(()=>{async function u(){console.log("response");const c=await Bx();console.log(c),t(c.receivedFriendRequestsUsername),r(!1)}u()},[]);const l=async u=>{const c=await d3(u);c.message?(a(c.message),t(d=>d.filter(p=>p!=u)),i(!0)):(a("Could not accept Request"),i(!0))};return n?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):e.length>0?e[0]!=""?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Received Friend Requests"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:s,open:o,setOpen:i}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:e.map(u=>w.jsx(fc,{username:u,handleClick:()=>l(u),buttonText:"Accept",button:!0},u))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Request Received."})," "]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Request Received."})," "]})}function v3(){const e=pi(),[t,n]=S.useState([]),[r,o]=S.useState(!0),[i,s]=S.useState(!1);S.useEffect(()=>{async function l(){console.log("response");const u=await Dx();console.log(u),n(u.friends),o(!1)}l()},[]);const a=async l=>{try{const c=(await Te.get(yn+"/user/me",{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})).data.username;e(`/chat/:${c}/:${l}`)}catch{}};return r?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):t.length>0?t[0]!=""?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Received Friend Requests"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:"yo",open:i,setOpen:s}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:t.map(l=>w.jsx(fc,{username:l,handleClick:()=>a(l),buttonText:"Chat",button:!0},l))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"You Don't have any Friends. Fuck."})," "]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"You Don't have any Friends. Fuck."})," "]})}function y3(){var u;const[e,t]=S.useState("");let{sender:n,receiver:r}=WR();n=n==null?void 0:n.substring(1),r=r==null?void 0:r.substring(1);const o=async()=>{if(r){const c=await f3(r);c.chat&&l(c)}};S.useEffect(()=>{const c=setInterval(o,500);return o(),()=>clearInterval(c)},[]);const i=c=>{t(c.target.value)},s=async()=>{r&&(p3(r,e),n&&l(c=>c.chat?{...a,chat:[...c.chat,{sender:n,message:e}]}:{...c,chat:[{sender:n,message:e}]}),t(""))},[a,l]=S.useState({message:"not yet"});return w.jsxs(w.Fragment,{children:[w.jsx("h2",{style:{margin:1,justifyContent:"center",alignContent:"center",display:"flex"},children:r}),w.jsx(Tr,{style:{margin:5,height:"75vh",display:"flex",flexDirection:"column",overflowY:"auto"},children:(u=a.chat)==null?void 0:u.map(c=>w.jsx("div",{style:{alignSelf:c.sender===r?"flex-start":"flex-end",margin:5},children:c.message},c.message+c.sender+Math.random()))}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(Is,{value:e,label:"message",id:"contained-basic",variant:"outlined",onChange:i}),w.jsx(Pt,{variant:"contained",onClick:s,children:"Send Message"})]})]})}function S3(){return w.jsx(w.Fragment,{children:w.jsx(o3,{children:w.jsxs(aE,{children:[w.jsx(l3,{}),w.jsxs(oE,{children:[w.jsx(cr,{path:"/",Component:W$}),w.jsx(cr,{path:"signin",Component:K$}),w.jsx(cr,{path:"/users",Component:h3}),w.jsx(cr,{path:"/sent-friend-requests",Component:m3}),w.jsx(cr,{path:"/received-friend-requests",Component:g3}),w.jsx(cr,{path:"/friends",Component:v3}),w.jsx(cr,{path:"/chat/:sender/:receiver",Component:y3})]})]})})})}ld.createRoot(document.getElementById("root")).render(w.jsx(be.StrictMode,{children:w.jsx(S3,{})})); + hot module replacement.`;console.warn(t)}}function qA(e){bi.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&KA(e.key),lo.set(e.key,e);const t=e.set==null?new ii.RecoilValueReadOnly(e.key):new ii.RecoilState(e.key);return ph.set(e.key,t),t}class NS extends Error{}function GA(e){const t=lo.get(e);if(t==null)throw new NS(`Missing definition for RecoilValue: "${e}""`);return t}function XA(e){return lo.get(e)}const Al=new Map;function QA(e){var t;if(!Me("recoil_memory_managament_2020"))return;const n=lo.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;lo.delete(e),(r=$S(e))===null||r===void 0||r(),Al.delete(e)}}function YA(e,t){Me("recoil_memory_managament_2020")&&(t===void 0?Al.delete(e):Al.set(e,t))}function $S(e){return Al.get(e)}var Vt={nodes:lo,recoilValues:ph,registerNode:qA,getNode:GA,getNodeMaybe:XA,deleteNodeConfigIfPossible:QA,setConfigDeletionHandler:YA,getConfigDeletionHandler:$S,recoilValuesForKeys:HA,NodeMissingError:NS,DefaultValue:PS,DEFAULT_VALUE:WA};function ZA(e,t){t()}var JA={enqueueExecution:ZA};function eL(e,t){return t={exports:{}},e(t,t.exports),t.exports}var tL=eL(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},n={},r=5,o=Math.pow(2,r),i=o-1,s=o/2,a=o/4,l={},u=function(k){return function(){return k}},c=n.hash=function(P){var k=typeof P>"u"?"undefined":t(P);if(k==="number")return P;k!=="string"&&(P+="");for(var I=0,G=0,X=P.length;G>1&1431655765,k=(k&858993459)+(k>>2&858993459),k=k+(k>>4)&252645135,k+=k>>8,k+=k>>16,k&127},p=function(k,I){return I>>>k&i},y=function(k){return 1<=I;)X[pe--]=X[pe];return X[I]=G,X}for(var ce=0,de=0,Se=new Array(te+1);ce>>=1;return pe[I]=G,K(k,de+1,pe)},B=function(k,I,G,X){for(var te=new Array(I-1),pe=0,ce=0,de=0,Se=X.length;de1?j(k,this.hash,Se):Se[0]}var Ke=X();return Ke===l?this:(++ce.value,H(k,G,this.hash,this,te,$(k,te,pe,Ke)))},F=function(k,I,G,X,te,pe,ce){var de=this.mask,Se=this.children,Ke=p(G,te),Mt=y(Ke),dt=h(de,Mt),nn=de&Mt,wn=nn?Se[dt]:T,go=wn._modify(k,I,G+r,X,te,pe,ce);if(wn===go)return this;var ia=Y(k,this),Ei=de,_i=void 0;if(nn&&E(go)){if(Ei&=~Mt,!Ei)return T;if(Se.length<=2&&Z(Se[dt^1]))return Se[dt^1];_i=b(ia,dt,Se)}else if(!nn&&!E(go)){if(Se.length>=s)return U(k,Ke,go,de,Se);Ei|=Mt,_i=g(ia,dt,go,Se)}else _i=m(ia,dt,go,Se);return ia?(this.mask=Ei,this.children=_i,this):A(k,Ei,_i)},J=function(k,I,G,X,te,pe,ce){var de=this.size,Se=this.children,Ke=p(G,te),Mt=Se[Ke],dt=(Mt||T)._modify(k,I,G+r,X,te,pe,ce);if(Mt===dt)return this;var nn=Y(k,this),wn=void 0;if(E(Mt)&&!E(dt))++de,wn=m(nn,Ke,dt,Se);else if(!E(Mt)&&E(dt)){if(--de,de<=a)return B(k,de,Ke,Se);wn=m(nn,Ke,T,Se)}else wn=m(nn,Ke,dt,Se);return nn?(this.size=de,this.children=wn,this):K(k,de,wn)};T._modify=function(P,k,I,G,X,te,pe){var ce=G();return ce===l?T:(++pe.value,$(P,X,te,ce))};function C(P,k,I,G,X){this._editable=P,this._edit=k,this._config=I,this._root=G,this._size=X}C.prototype.setTree=function(P,k){return this._editable?(this._root=P,this._size=k,this):P===this._root?this:new C(this._editable,this._edit,this._config,P,k)};var M=n.tryGetHash=function(P,k,I,G){for(var X=G._root,te=0,pe=G._config.keyEq;;)switch(X.type){case f:return pe(I,X.key)?X.value:P;case v:{if(k===X.hash)for(var ce=X.children,de=0,Se=ce.length;de{n.set(o,t(r,o))}),n}var Ll=aL;function lL(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function uL(e){return{nodeDeps:Ll(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:Ll(e.nodeToNodeSubscriptions,t=>new Set(t))}}function rd(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:i}=n,s=o.get(e);if(s&&r&&s!==r.nodeDeps.get(e))return;o.set(e,t);const a=s==null?t:cs(t,s);for(const l of a)i.has(l)||i.set(l,new Set),Xe(i.get(l)).add(e);if(s){const l=cs(s,t);for(const u of l){if(!i.has(u))return;const c=Xe(i.get(u));c.delete(e),c.size===0&&i.delete(u)}}}function cL(e,t,n,r){var o,i,s,a;const l=n.getState();r===l.currentTree.version||r===((o=l.nextTree)===null||o===void 0?void 0:o.version)||((i=l.previousTree)===null||i===void 0||i.version);const u=n.getGraph(r);if(rd(e,t,u),r===((s=l.previousTree)===null||s===void 0?void 0:s.version)){const d=n.getGraph(l.currentTree.version);rd(e,t,d,u)}if(r===((a=l.previousTree)===null||a===void 0?void 0:a.version)||r===l.currentTree.version){var c;const d=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(d!==void 0){const p=n.getGraph(d);rd(e,t,p,u)}}}var ta={cloneGraph:uL,graph:lL,saveDepsToStore:cL};let dL=0;const fL=()=>dL++;let pL=0;const hL=()=>pL++;let mL=0;const gL=()=>mL++;var Yu={getNextTreeStateVersion:fL,getNextStoreID:hL,getNextComponentID:gL};const{persistentMap:av}=iL,{graph:vL}=ta,{getNextTreeStateVersion:AS}=Yu;function LS(){const e=AS();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:av(),nonvalidatedAtoms:av()}}function yL(){const e=LS();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,vL()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var OS={makeEmptyTreeState:LS,makeEmptyStoreState:yL,getNextTreeStateVersion:AS};class MS{}function SL(){return new MS}var Zu={RetentionZone:MS,retentionZone:SL};function xL(e,t){const n=new Set(e);return n.add(t),n}function wL(e,t){const n=new Set(e);return n.delete(t),n}function bL(e,t,n){const r=new Map(e);return r.set(t,n),r}function RL(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function EL(e,t){const n=new Map(e);return n.delete(t),n}function _L(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var IS={setByAddingToSet:xL,setByDeletingFromSet:wL,mapBySettingInMap:bL,mapByUpdatingInMap:RL,mapByDeletingFromMap:EL,mapByDeletingMultipleFromMap:_L};function*CL(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var gh=CL;function kL(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var FS=kL;const{getNode:na,getNodeMaybe:TL,recoilValuesForKeys:lv}=Vt,{RetentionZone:uv}=Zu,{setByAddingToSet:PL}=IS,NL=Object.freeze(new Set);class $L extends Error{}function AL(e,t,n){if(!Me("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(i){let s=r.get(i);s||r.set(i,s=new Set),s.add(t)}if(n instanceof uv)o(n);else if(Array.isArray(n))for(const i of n)o(i);return()=>{if(!Me("recoil_memory_managament_2020"))return;const{retention:i}=e.getState();function s(a){const l=i.nodesRetainedByZone.get(a);l==null||l.delete(t),l&&l.size===0&&i.nodesRetainedByZone.delete(a)}if(n instanceof uv)s(n);else if(Array.isArray(n))for(const a of n)s(a)}}function vh(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=na(n),s=AL(e,n,i.retainedBy),a=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{a(),s()})}function LL(e,t,n){vh(e,e.getState().currentTree,t,n)}function OL(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function ML(e,t,n){return vh(e,t,n,"get"),na(n).get(e,t)}function jS(e,t,n){return na(n).peek(e,t)}function IL(e,t,n){var r;const o=TL(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:PL(e.dirtyAtoms,t)}}function FL(e,t,n,r){const o=na(n);if(o.set==null)throw new $L(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return vh(e,t,n,"set"),i(e,t,r)}function jL(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=na(n).nodeType;return FS({type:i},{loadable:()=>jS(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>i==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var s;return lv((s=o.nodeDeps.get(n))!==null&&s!==void 0?s:[])},subscribers:()=>{var s,a;return{nodes:lv(gh(zS(e,t,new Set([n])),l=>l!==n)),components:Qu((s=(a=r.nodeToComponentSubscriptions.get(n))===null||a===void 0?void 0:a.values())!==null&&s!==void 0?s:[],([l])=>({name:l}))}}})}function zS(e,t,n){const r=new Set,o=Array.from(n),i=e.getGraph(t.version);for(let a=o.pop();a;a=o.pop()){var s;r.add(a);const l=(s=i.nodeToNodeSubscriptions.get(a))!==null&&s!==void 0?s:NL;for(const u of l)r.has(u)||o.push(u)}return r}var Mr={getNodeLoadable:ML,peekNodeLoadable:jS,setNodeValue:FL,initializeNode:LL,cleanUpNode:OL,setUnvalidatedAtomValue_DEPRECATED:IL,peekNodeInfo:jL,getDownstreamNodes:zS};let DS=null;function zL(e){DS=e}function DL(){var e;(e=DS)===null||e===void 0||e()}var US={setInvalidateMemoizedSnapshot:zL,invalidateMemoizedSnapshot:DL};const{getDownstreamNodes:UL,getNodeLoadable:BS,setNodeValue:BL}=Mr,{getNextComponentID:VL}=Yu,{getNode:WL,getNodeMaybe:VS}=Vt,{DefaultValue:yh}=Vt,{reactMode:HL}=ea,{AbstractRecoilValue:KL,RecoilState:qL,RecoilValueReadOnly:GL,isRecoilValue:XL}=ii,{invalidateMemoizedSnapshot:QL}=US;function YL(e,{key:t},n=e.getState().currentTree){var r,o;const i=e.getState();n.version===i.currentTree.version||n.version===((r=i.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=i.previousTree)===null||o===void 0||o.version);const s=BS(e,n,t);return s.state==="loading"&&s.contents.catch(()=>{}),s}function ZL(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof yh?n.delete(o):n.set(o,r)}),n}function JL(e,t,{key:n},r){if(typeof r=="function"){const o=BS(e,t,n);if(o.state==="loading"){const i=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw ve(i)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function eO(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,s=JL(e,t,o,i),a=BL(e,t,o.key,s);for(const[l,u]of a.entries())Rf(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;Rf(t,o,i)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:i}=n,s=VS(o);s==null||(r=s.invalidate)===null||r===void 0||r.call(s,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,i),t.dirtyAtoms.add(o)}else dh(`Unknown action ${n.type}`)}function Rf(e,t,n){n.state==="hasValue"&&n.contents instanceof yh?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function WS(e,t){e.replaceState(n=>{const r=HS(n);for(const o of t)eO(e,r,o);return KS(e,r),QL(),r})}function Ju(e,t){if(ds.length){const n=ds[ds.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else WS(e,[t])}const ds=[];function tO(){const e=new Map;return ds.push(e),()=>{for(const[t,n]of e)WS(t,n);ds.pop()}}function HS(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function KS(e,t){const n=UL(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=VS(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function qS(e,t,n){Ju(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function nO(e,t,n){if(n instanceof yh)return qS(e,t,n);Ju(e,{type:"setLoadable",recoilValue:t,loadable:n})}function rO(e,t){Ju(e,{type:"markModified",recoilValue:t})}function oO(e,t,n){Ju(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function iO(e,{key:t},n,r=null){const o=VL(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),Xe(i.nodeToComponentSubscriptions.get(t)).set(o,[r??"",n]);const s=HL();if(s.early&&(s.mode==="LEGACY"||s.mode==="MUTABLE_SOURCE")){const a=e.getState().nextTree;a&&a.dirtyAtoms.has(t)&&n(a)}return{release:()=>{const a=e.getState(),l=a.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(o)||(l.delete(o),l.size===0&&a.nodeToComponentSubscriptions.delete(t))}}}function sO(e,t){var n;const{currentTree:r}=e.getState(),o=WL(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var Vn={RecoilValueReadOnly:GL,AbstractRecoilValue:KL,RecoilState:qL,getRecoilValueAsLoadable:YL,setRecoilValue:qS,setRecoilValueLoadable:nO,markRecoilValueModified:rO,setUnvalidatedRecoilValue:oO,subscribeToRecoilValue:iO,isRecoilValue:XL,applyAtomValueWrites:ZL,batchStart:tO,writeLoadableToTreeState:Rf,invalidateDownstreams:KS,copyTreeState:HS,refreshRecoilValue:sO};function aO(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const i=o.value;if(t.call(n,i[1],i[0],e))return!0;o=r.next()}return!1}var lO=aO;const{cleanUpNode:uO}=Mr,{deleteNodeConfigIfPossible:cO,getNode:GS}=Vt,{RetentionZone:XS}=Zu,dO=12e4,QS=new Set;function YS(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const s of t)if(s instanceof XS)for(const a of mO(n,s))o.add(a);else o.add(s);const i=fO(e,o);for(const s of i)hO(e,r,s)}function fO(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),i=new Set,s=new Set;return a(t),i;function a(l){const u=new Set,c=pO(e,r,l,i,s);for(const h of c){var d;if(GS(h).retainedBy==="recoilRoot"){s.add(h);continue}if(((d=n.retention.referenceCounts.get(h))!==null&&d!==void 0?d:0)>0){s.add(h);continue}if(ZS(h).some(b=>n.retention.referenceCounts.get(b))){s.add(h);continue}const m=o.nodeToNodeSubscriptions.get(h);if(m&&lO(m,b=>s.has(b))){s.add(h);continue}i.add(h),u.add(h)}const p=new Set;for(const h of u)for(const m of(y=o.nodeDeps.get(h))!==null&&y!==void 0?y:QS){var y;i.has(m)||p.add(m)}p.size&&a(p)}}function pO(e,t,n,r,o){const i=e.getGraph(t.version),s=[],a=new Set;for(;n.size>0;)l(Xe(n.values().next().value));return s;function l(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(a.has(u))return;const c=i.nodeToNodeSubscriptions.get(u);if(c)for(const d of c)l(d);a.add(u),n.delete(u),s.push(u)}}function hO(e,t,n){if(!Me("recoil_memory_managament_2020"))return;uO(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=ZS(n);for(const l of o){var i;(i=r.retention.nodesRetainedByZone.get(l))===null||i===void 0||i.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const s=r.graphsByVersion.get(t.version);if(s){const l=s.nodeDeps.get(n);if(l!==void 0){s.nodeDeps.delete(n);for(const u of l){var a;(a=s.nodeToNodeSubscriptions.get(u))===null||a===void 0||a.delete(n)}}s.nodeToNodeSubscriptions.delete(n)}cO(n)}function mO(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:QS}function ZS(e){const t=GS(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof XS?[t]:t}function gO(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):YS(e,new Set([t]))}function vO(e,t,n){var r;if(!Me("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,i=((r=o.get(t))!==null&&r!==void 0?r:0)+n;i===0?JS(e,t):o.set(t,i)}function JS(e,t){if(!Me("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),gO(e,t)}function yO(e){if(!Me("recoil_memory_managament_2020"))return;const t=e.getState();YS(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function SO(e){return e===void 0?"recoilRoot":e}var mo={SUSPENSE_TIMEOUT_MS:dO,updateRetainCount:vO,updateRetainCountToZero:JS,releaseScheduledRetainablesNow:yO,retainedByOptionWithDefault:SO};const{unstable_batchedUpdates:xO}=Xi;var wO={unstable_batchedUpdates:xO};const{unstable_batchedUpdates:bO}=wO;var RO={unstable_batchedUpdates:bO};const{batchStart:EO}=Vn,{unstable_batchedUpdates:_O}=RO;let Sh=_O||(e=>e());const CO=e=>{Sh=e},kO=()=>Sh,TO=e=>{Sh(()=>{let t=()=>{};try{t=EO(),e()}finally{t()}})};var ec={getBatcher:kO,setBatcher:CO,batchUpdates:TO};function*PO(e){for(const t of e)for(const n of t)yield n}var ex=PO;const tx=typeof Window>"u"||typeof window>"u",NO=e=>!tx&&(e===window||e instanceof Window),$O=typeof navigator<"u"&&navigator.product==="ReactNative";var tc={isSSR:tx,isReactNative:$O,isWindow:NO};function AO(e,t){let n;return(...r)=>{n||(n={});const o=t(...r);return Object.hasOwnProperty.call(n,o)||(n[o]=e(...r)),n[o]}}function LO(e,t){let n,r;return(...o)=>{const i=t(...o);return n===i||(n=i,r=e(...o)),r}}function OO(e,t){let n,r;return[(...s)=>{const a=t(...s);return n===a||(n=a,r=e(...s)),r},()=>{n=null}]}var MO={memoizeWithArgsHash:AO,memoizeOneWithArgsHash:LO,memoizeOneWithArgsHashAndInvalidation:OO};const{batchUpdates:Ef}=ec,{initializeNode:IO,peekNodeInfo:FO}=Mr,{graph:jO}=ta,{getNextStoreID:zO}=Yu,{DEFAULT_VALUE:DO,recoilValues:cv,recoilValuesForKeys:dv}=Vt,{AbstractRecoilValue:UO,getRecoilValueAsLoadable:BO,setRecoilValue:fv,setUnvalidatedRecoilValue:VO}=Vn,{updateRetainCount:Ya}=mo,{setInvalidateMemoizedSnapshot:WO}=US,{getNextTreeStateVersion:HO,makeEmptyStoreState:KO}=OS,{isSSR:qO}=tc,{memoizeOneWithArgsHashAndInvalidation:GO}=MO;class nc{constructor(t,n){me(this,"_store",void 0),me(this,"_refCount",1),me(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),BO(this._store,r))),me(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),me(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const s=this._store.getState().currentTree;return dv(s.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?cv.values():r.isInitialized===!0?dv(ex([o,i])):gh(cv.values(),({key:s})=>!o.has(s)&&!i.has(s))}),me(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),FO(this._store,this._store.getState().currentTree,r))),me(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new _f(this,Ef);return r(o),o}),me(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new _f(this,Ef);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:zO(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return Xe(o.get(r));const i=jO();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw ve("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)IO(this._store,r,"get"),Ya(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){qO||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!Me("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Me("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function nx(e,t,n=!1){const r=e.getState(),o=n?HO():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(Qu(r.nodeCleanupFunctions.entries(),([i])=>[i,()=>{}]))}}function XO(e){const t=new nc(KO());return e!=null?t.map(e):t}const[pv,rx]=GO((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Xe(r.previousTree);return new nc(nx(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});WO(rx);function QO(e,t="latest"){const n=pv(e,t);return n.isRetained()?n:(rx(),pv(e,t))}class _f extends nc{constructor(t,n){super(nx(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),me(this,"_batch",void 0),me(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Ya(i,r.key,1),fv(this.getStore_INTERNAL(),r,o)})}),me(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ya(o,r.key,1),fv(this.getStore_INTERNAL(),r,DO)})}),me(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();Ef(()=>{for(const[i,s]of r.entries())Ya(o,i,1),VO(o,new UO(i),s)})}),this._batch=n}}var rc={Snapshot:nc,MutableSnapshot:_f,freshSnapshot:XO,cloneSnapshot:QO},YO=rc.Snapshot,ZO=rc.MutableSnapshot,JO=rc.freshSnapshot,eM=rc.cloneSnapshot,oc=Object.freeze({__proto__:null,Snapshot:YO,MutableSnapshot:ZO,freshSnapshot:JO,cloneSnapshot:eM});function tM(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var nM=tM;const{useRef:rM}=be;function oM(e){const t=rM(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var hv=oM;const{getNextTreeStateVersion:iM,makeEmptyStoreState:ox}=OS,{cleanUpNode:sM,getDownstreamNodes:aM,initializeNode:lM,setNodeValue:uM,setUnvalidatedAtomValue_DEPRECATED:cM}=Mr,{graph:dM}=ta,{cloneGraph:fM}=ta,{getNextStoreID:ix}=Yu,{createMutableSource:od,reactMode:sx}=ea,{applyAtomValueWrites:pM}=Vn,{releaseScheduledRetainablesNow:ax}=mo,{freshSnapshot:hM}=oc,{useCallback:mM,useContext:lx,useEffect:Cf,useMemo:gM,useRef:vM,useState:yM}=be;function Di(){throw ve("This component must be used inside a component.")}const ux=Object.freeze({storeID:ix(),getState:Di,replaceState:Di,getGraph:Di,subscribeToTransactions:Di,addTransactionMetadata:Di});let kf=!1;function mv(e){if(kf)throw ve("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){Me("recoil_memory_managament_2020")&&Me("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&ax(e);const n=t.currentTree.version,r=iM();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,fM(Xe(t.graphsByVersion.get(n))))}}const cx=be.createContext({current:ux}),ic=()=>lx(cx),dx=be.createContext(null);function SM(){return lx(dx)}function xh(e,t,n){const r=aM(e,n,n.dirtyAtoms);for(const o of r){const i=t.nodeToComponentSubscriptions.get(o);if(i)for(const[s,[a,l]]of i)l(n)}}function fx(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,i]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[s,a]of i)a(e);for(const[o,i]of t.transactionSubscriptions)i(e);(!sx().early||t.suspendedComponentResolvers.size>0)&&(xh(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function xM(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,fx(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):dh("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Me("recoil_memory_managament_2020")&&n==null&&ax(e)}finally{t.commitDepth--}}function wM({setNotifyBatcherOfChange:e}){const t=ic(),[,n]=yM([]);return e(()=>n({})),Cf(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),Cf(()=>{JA.enqueueExecution("Batcher",()=>{xM(t.current)})}),null}function bM(e,t){const n=ox();return t({set:(r,o)=>{const i=n.currentTree,s=uM(e,i,r.key,o),a=new Set(s.keys()),l=i.nonvalidatedAtoms.clone();for(const u of a)l.delete(u);n.currentTree={...i,dirtyAtoms:nM(i.dirtyAtoms,a),atomValues:pM(i.atomValues,s),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=cM(n.currentTree,i,o)})}}),n}function RM(e){const t=hM(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let gv=0;function EM({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const i=y=>{const h=o.current.graphsByVersion;if(h.has(y))return Xe(h.get(y));const m=dM();return h.set(y,m),m},s=(y,h)=>{if(h==null){const{transactionSubscriptions:m}=d.current.getState(),b=gv++;return m.set(b,y),{release:()=>{m.delete(b)}}}else{const{nodeTransactionSubscriptions:m}=d.current.getState();m.has(h)||m.set(h,new Map);const b=gv++;return Xe(m.get(h)).set(b,y),{release:()=>{const g=m.get(h);g&&(g.delete(b),g.size===0&&m.delete(h))}}}},a=y=>{mv(d.current);for(const h of Object.keys(y))Xe(d.current.getState().nextTree).transactionMetadata[h]=y[h]},l=y=>{mv(d.current);const h=Xe(o.current.nextTree);let m;try{kf=!0,m=y(h)}finally{kf=!1}m!==h&&(o.current.nextTree=m,sx().early&&xh(d.current,o.current,m),Xe(u.current)())},u=vM(null),c=mM(y=>{u.current=y},[u]),d=hv(()=>n??{storeID:ix(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:s,addTransactionMetadata:a});n!=null&&(d.current=n),o=hv(()=>e!=null?bM(d.current,e):t!=null?RM(t):ox());const p=gM(()=>od==null?void 0:od(o,()=>o.current.currentTree.version),[o]);return Cf(()=>{const y=d.current;for(const h of new Set(y.getState().knownAtoms))lM(y,h,"get");return()=>{for(const h of y.getState().knownAtoms)sM(y,h)}},[d]),be.createElement(cx.Provider,{value:d},be.createElement(dx.Provider,{value:p},be.createElement(wM,{setNotifyBatcherOfChange:c}),r))}function _M(e){const{override:t,...n}=e,r=ic();return t===!1&&r.current!==ux?e.children:be.createElement(EM,n)}function CM(){return ic().current.storeID}var or={RecoilRoot:_M,useStoreRef:ic,useRecoilMutableSource:SM,useRecoilStoreID:CM,notifyComponents_FOR_TESTING:xh,sendEndOfBatchNotifications_FOR_TESTING:fx};function kM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var px=$M;const{useStoreRef:AM}=or,{SUSPENSE_TIMEOUT_MS:LM}=mo,{updateRetainCount:Ui}=mo,{RetentionZone:OM}=Zu,{useEffect:MM,useRef:IM}=be,{isSSR:vv}=tc;function FM(e){if(Me("recoil_memory_managament_2020"))return jM(e)}function jM(e){const n=(Array.isArray(e)?e:[e]).map(s=>s instanceof OM?s:s.key),r=AM();MM(()=>{if(!Me("recoil_memory_managament_2020"))return;const s=r.current;if(o.current&&!vv)window.clearTimeout(o.current),o.current=null;else for(const a of n)Ui(s,a,1);return()=>{for(const a of n)Ui(s,a,-1)}},[r,...n]);const o=IM(),i=px(n);if(!vv&&(i===void 0||!TM(i,n))){const s=r.current;for(const a of n)Ui(s,a,1);if(i)for(const a of i)Ui(s,a,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const a of n)Ui(s,a,-1)},LM)}}var wh=FM;function zM(){return""}var ra=zM;const{batchUpdates:DM}=ec,{DEFAULT_VALUE:hx}=Vt,{currentRendererSupportsUseSyncExternalStore:UM,reactMode:Ri,useMutableSource:BM,useSyncExternalStore:VM}=ea,{useRecoilMutableSource:WM,useStoreRef:Wn}=or,{AbstractRecoilValue:Tf,getRecoilValueAsLoadable:oa,setRecoilValue:Ol,setUnvalidatedRecoilValue:HM,subscribeToRecoilValue:si}=Vn,{useCallback:Ut,useEffect:ai,useMemo:mx,useRef:fs,useState:bh}=be,{setByAddingToSet:KM}=IS,{isSSR:qM}=tc;function Rh(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{const i=n.current.getState().suspendedComponentResolvers;i.add(o),qM&&Be(e.contents)&&e.contents.finally(()=>{i.delete(o)})}):e.state==="hasError"?e.contents:ve(`Invalid value of loadable atom "${t.key}"`)}function GM(){const e=ra(),t=Wn(),[,n]=bh([]),r=fs(new Set);r.current=new Set;const o=fs(new Set),i=fs(new Map),s=Ut(l=>{const u=i.current.get(l);u&&(u.release(),i.current.delete(l))},[i]),a=Ut((l,u)=>{i.current.has(u)&&n([])},[]);return ai(()=>{const l=t.current;cs(r.current,o.current).forEach(u=>{if(i.current.has(u))return;const c=si(l,new Tf(u),p=>a(p,u),e);i.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a(l.getState(),u)}):a(l.getState(),u)}),cs(o.current,r.current).forEach(u=>{s(u)}),o.current=r.current}),ai(()=>{const l=i.current;return cs(r.current,new Set(l.keys())).forEach(u=>{const c=si(t.current,new Tf(u),d=>a(d,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>s(c))},[e,t,s,a]),mx(()=>{function l(h){return m=>{Ol(t.current,h,m)}}function u(h){return()=>Ol(t.current,h,hx)}function c(h){var m;r.current.has(h.key)||(r.current=KM(r.current,h.key));const b=t.current.getState();return oa(t.current,h,Ri().early&&(m=b.nextTree)!==null&&m!==void 0?m:b.currentTree)}function d(h){const m=c(h);return Rh(m,h,t)}function p(h){return[d(h),l(h)]}function y(h){return[c(h),l(h)]}return{getRecoilValue:d,getRecoilValueLoadable:c,getRecoilState:p,getRecoilStateLoadable:y,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const XM={current:0};function QM(e){const t=Wn(),n=ra(),r=Ut(()=>{var a;const l=t.current,u=l.getState(),c=Ri().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return{loadable:oa(l,e,c),key:e.key}},[t,e]),o=Ut(a=>{let l;return()=>{var u,c;const d=a();return(u=l)!==null&&u!==void 0&&u.loadable.is(d.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===d.key?l:(l=d,d)}},[]),i=mx(()=>o(r),[r,o]),s=Ut(a=>{const l=t.current;return si(l,e,a,n).release},[t,e,n]);return VM(s,i,i).loadable}function YM(e){const t=Wn(),n=Ut(()=>{var u;const c=t.current,d=c.getState(),p=Ri().early&&(u=d.nextTree)!==null&&u!==void 0?u:d.currentTree;return oa(c,e,p)},[t,e]),r=Ut(()=>n(),[n]),o=ra(),i=Ut((u,c)=>{const d=t.current;return si(d,e,()=>{if(!Me("recoil_suppress_rerender_in_callback"))return c();const y=n();l.current.is(y)||c(),l.current=y},o).release},[t,e,o,n]),s=WM();if(s==null)throw ve("Recoil hooks must be used in components contained within a component.");const a=BM(s,r,i),l=fs(a);return ai(()=>{l.current=a}),a}function Pf(e){const t=Wn(),n=ra(),r=Ut(()=>{var l;const u=t.current,c=u.getState(),d=Ri().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return oa(u,e,d)},[t,e]),o=Ut(()=>({loadable:r(),key:e.key}),[r,e.key]),i=Ut(l=>{const u=o();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[o]);ai(()=>{const l=si(t.current,e,u=>{a(i)},n);return a(i),l.release},[n,e,t,i]);const[s,a]=bh(o);return s.key!==e.key?o().loadable:s.loadable}function ZM(e){const t=Wn(),[,n]=bh([]),r=ra(),o=Ut(()=>{var a;const l=t.current,u=l.getState(),c=Ri().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return oa(l,e,c)},[t,e]),i=o(),s=fs(i);return ai(()=>{s.current=i}),ai(()=>{const a=t.current,l=a.getState(),u=si(a,e,d=>{var p;if(!Me("recoil_suppress_rerender_in_callback"))return n([]);const y=o();(p=s.current)!==null&&p!==void 0&&p.is(y)||n(y),s.current=y},r);if(l.nextTree)a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s.current=null,n([])});else{var c;if(!Me("recoil_suppress_rerender_in_callback"))return n([]);const d=o();(c=s.current)!==null&&c!==void 0&&c.is(d)||n(d),s.current=d}return u.release},[r,o,e,t]),i}function Eh(e){return Me("recoil_memory_managament_2020")&&wh(e),{TRANSITION_SUPPORT:Pf,SYNC_EXTERNAL_STORE:UM()?QM:Pf,MUTABLE_SOURCE:YM,LEGACY:ZM}[Ri().mode](e)}function gx(e){const t=Wn(),n=Eh(e);return Rh(n,e,t)}function sc(e){const t=Wn();return Ut(n=>{Ol(t.current,e,n)},[t,e])}function JM(e){const t=Wn();return Ut(()=>{Ol(t.current,e,hx)},[t,e])}function eI(e){return[gx(e),sc(e)]}function tI(e){return[Eh(e),sc(e)]}function nI(){const e=Wn();return(t,n={})=>{DM(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>HM(e.current,new Tf(o),r))})}}function vx(e){return Me("recoil_memory_managament_2020")&&wh(e),Pf(e)}function yx(e){const t=Wn(),n=vx(e);return Rh(n,e,t)}function rI(e){return[yx(e),sc(e)]}var oI={recoilComponentGetRecoilValueCount_FOR_TESTING:XM,useRecoilInterface:GM,useRecoilState:eI,useRecoilStateLoadable:tI,useRecoilValue:gx,useRecoilValueLoadable:Eh,useResetRecoilState:JM,useSetRecoilState:sc,useSetUnvalidatedAtomValues:nI,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:vx,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:yx,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:rI};function iI(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var sI=iI;function aI(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var lI=aI;function uI(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function xv(e){const t=e.atomValues.toMap(),n=Ll(sI(t,(r,o)=>{const s=Sx(o).persistence_UNSTABLE;return s!=null&&s.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return cI(e.nonvalidatedAtoms.toMap(),n)}function yI(e){lc(ac(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=xv(r),i=xv(n),s=Ll(pI,l=>{var u,c,d,p;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(d=(p=l.persistence_UNSTABLE)===null||p===void 0?void 0:p.backButton)!==null&&d!==void 0?d:!1}}}),a=lI(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:s,modifiedAtoms:a,transactionMetadata:{...r.transactionMetadata}})},[e]))}function SI(e){lc(ac(t=>{const n=Ml(t,"latest"),r=Ml(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function xI(){const e=_h(),[t,n]=vI(()=>Ml(e.current)),r=px(t),o=yv(),i=yv();if(lc(ac(a=>n(Ml(a)),[])),xx(()=>{const a=t.retain();if(o.current&&!Sv){var l;window.clearTimeout(o.current),o.current=null,(l=i.current)===null||l===void 0||l.call(i),i.current=null}return()=>{window.setTimeout(a,10)}},[t]),r!==t&&!Sv){if(o.current){var s;window.clearTimeout(o.current),o.current=null,(s=i.current)===null||s===void 0||s.call(i),i.current=null}i.current=t.retain(),o.current=window.setTimeout(()=>{var a;o.current=null,(a=i.current)===null||a===void 0||a.call(i),i.current=null},gI)}return t}function wx(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,i=t.getStore_INTERNAL().getState().currentTree;dI(()=>{const s=new Set;for(const u of[o.atomValues.keys(),i.atomValues.keys()])for(const c of u){var a,l;((a=o.atomValues.get(c))===null||a===void 0?void 0:a.contents)!==((l=i.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&Sx(c).shouldRestoreFromSnapshots&&s.add(c)}s.forEach(u=>{mI(e,new hI(u),i.atomValues.has(u)?Xe(i.atomValues.get(u)):fI)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function wI(){const e=_h();return ac(t=>wx(e.current,t),[e])}var bx={useRecoilSnapshot:xI,gotoSnapshot:wx,useGotoRecoilSnapshot:wI,useRecoilTransactionObserver:SI,useTransactionObservation_DEPRECATED:yI,useTransactionSubscription_DEPRECATED:lc};const{peekNodeInfo:bI}=Mr,{useStoreRef:RI}=or;function EI(){const e=RI();return({key:t})=>bI(e.current,e.current.getState().currentTree,t)}var _I=EI;const{reactMode:CI}=ea,{RecoilRoot:kI,useStoreRef:TI}=or,{useMemo:PI}=be;function NI(){CI().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=TI().current;return PI(()=>{function t({children:n}){return be.createElement(kI,{store_INTERNAL:e},n)}return t},[e])}var $I=NI;const{loadableWithValue:AI}=Js,{initializeNode:LI}=Mr,{DEFAULT_VALUE:OI,getNode:MI}=Vt,{copyTreeState:II,getRecoilValueAsLoadable:FI,invalidateDownstreams:jI,writeLoadableToTreeState:zI}=Vn;function wv(e){return MI(e.key).nodeType==="atom"}class DI{constructor(t,n){me(this,"_store",void 0),me(this,"_treeState",void 0),me(this,"_changes",void 0),me(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!wv(r))throw ve("Reading selectors within atomicUpdate is not supported");const o=FI(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:ve(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),me(this,"set",(r,o)=>{if(!wv(r))throw ve("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const i=this.get(r);this._changes.set(r.key,o(i))}else LI(this._store,r.key,"set"),this._changes.set(r.key,o)}),me(this,"reset",r=>{this.set(r,OI)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=II(this._treeState);for(const[n,r]of this._changes)zI(t,n,AI(r));return jI(this._store,t),t}}function UI(e){return t=>{e.replaceState(n=>{const r=new DI(e,n);return t(r),r.newTreeState_INTERNAL()})}}var BI={atomicUpdater:UI},VI=BI.atomicUpdater,Rx=Object.freeze({__proto__:null,atomicUpdater:VI});function WI(e,t){if(!e)throw new Error(t)}var HI=WI,Yi=HI;const{atomicUpdater:KI}=Rx,{batchUpdates:qI}=ec,{DEFAULT_VALUE:GI}=Vt,{useStoreRef:XI}=or,{refreshRecoilValue:QI,setRecoilValue:bv}=Vn,{cloneSnapshot:YI}=oc,{gotoSnapshot:ZI}=bx,{useCallback:JI}=be;class Ex{}const e5=new Ex;function _x(e,t,n,r){let o=e5,i;if(qI(()=>{const a="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw ve(a);const l=FS({...r??{},set:(c,d)=>bv(e,c,d),reset:c=>bv(e,c,GI),refresh:c=>QI(e,c),gotoSnapshot:c=>ZI(e,c),transact_UNSTABLE:c=>KI(e)(c)},{snapshot:()=>{const c=YI(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw ve(a);o=u(...n)}),o instanceof Ex&&Yi(!1),Be(o))o=o.finally(()=>{var a;(a=i)===null||a===void 0||a()});else{var s;(s=i)===null||s===void 0||s()}return o}function t5(e,t){const n=XI();return JI((...r)=>_x(n.current,e,r),t!=null?[...t,n]:void 0)}var Cx={recoilCallback:_x,useRecoilCallback:t5};const{useStoreRef:n5}=or,{refreshRecoilValue:r5}=Vn,{useCallback:o5}=be;function i5(e){const t=n5();return o5(()=>{const n=t.current;r5(n,e)},[e,t])}var s5=i5;const{atomicUpdater:a5}=Rx,{useStoreRef:l5}=or,{useMemo:u5}=be;function c5(e,t){const n=l5();return u5(()=>(...r)=>{a5(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var d5=c5;class f5{constructor(t){me(this,"value",void 0),this.value=t}}var p5={WrappedValue:f5},h5=p5.WrappedValue,kx=Object.freeze({__proto__:null,WrappedValue:h5});const{isFastRefreshEnabled:m5}=ea;class Rv extends Error{}class g5{constructor(t){var n,r,o;me(this,"_name",void 0),me(this,"_numLeafs",void 0),me(this,"_root",void 0),me(this,"_onHit",void 0),me(this,"_onSet",void 0),me(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:i=>i}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var i,s,a,l;let u,c;for(const[b,g]of t){var d,p,y;const f=this._root;if((f==null?void 0:f.type)==="leaf")throw this.invalidCacheError();const v=u;if(u=v?v.branches.get(c):f,u=(d=u)!==null&&d!==void 0?d:{type:"branch",nodeKey:b,parent:v,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==b)throw this.invalidCacheError();v==null||v.branches.set(c,u),r==null||(p=r.onNodeVisit)===null||p===void 0||p.call(r,u),c=this._mapNodeValue(g),this._root=(y=this._root)!==null&&y!==void 0?y:u}const h=u?(i=u)===null||i===void 0?void 0:i.branches.get(c):this._root;if(h!=null&&(h.type!=="leaf"||h.branchKey!==c))throw this.invalidCacheError();const m={type:"leaf",value:n,parent:u,branchKey:c};(s=u)===null||s===void 0||s.branches.set(c,m),this._root=(a=this._root)!==null&&a!==void 0?a:m,this._numLeafs++,this._onSet(m),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,m)};try{o()}catch(i){if(i instanceof Rv)this.clear(),o();else throw i}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var i;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(i=r)===null||i===void 0?void 0:i.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=m5()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw dh(t+(this._name!=null?` - ${this._name}`:"")),new Rv}}var v5={TreeCache:g5},y5=v5.TreeCache,Tx=Object.freeze({__proto__:null,TreeCache:y5});class S5{constructor(t){var n;me(this,"_maxSize",void 0),me(this,"_size",void 0),me(this,"_head",void 0),me(this,"_tail",void 0),me(this,"_map",void 0),me(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const i=this.head(),s={key:t,right:i,left:null,value:n};i?i.left=s:this._tail=s,this._map.set(r,s),this._head=s,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Xe(this._map.get(n)),o=r.right,i=r.left;o&&(o.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=i),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var x5={LRUCache:S5},w5=x5.LRUCache,Px=Object.freeze({__proto__:null,LRUCache:w5});const{LRUCache:b5}=Px,{TreeCache:R5}=Tx;function E5({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new b5({maxSize:t}),o=new R5({name:e,mapNodeValue:n,onHit:i=>{r.set(i,!0)},onSet:i=>{const s=r.tail();r.set(i,!0),s&&o.size()>t&&o.delete(s.key)}});return o}var Ev=E5;function Rn(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw ve("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Be(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,i)=>Rn(o,t,i.toString()))}]`;if(typeof e.toJSON=="function")return Rn(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[i,s]of e)o[typeof i=="string"?i:Rn(i,t)]=s;return Rn(o,t,n)}return e instanceof Set?Rn(Array.from(e).sort((o,i)=>Rn(o,t).localeCompare(Rn(i,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?Rn(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${Rn(o,t)}:${Rn(e[o],t,o)}`).join(",")}}`}function _5(e,t={allowFunctions:!1}){return Rn(e,t)}var uc=_5;const{TreeCache:C5}=Tx,ka={equality:"reference",eviction:"keep-all",maxSize:1/0};function k5({equality:e=ka.equality,eviction:t=ka.eviction,maxSize:n=ka.maxSize}=ka,r){const o=T5(e);return P5(t,n,o,r)}function T5(e){switch(e){case"reference":return t=>t;case"value":return t=>uc(t)}throw ve(`Unrecognized equality policy ${e}`)}function P5(e,t,n,r){switch(e){case"keep-all":return new C5({name:r,mapNodeValue:n});case"lru":return Ev({name:r,maxSize:Xe(t),mapNodeValue:n});case"most-recent":return Ev({name:r,maxSize:1,mapNodeValue:n})}throw ve(`Unrecognized eviction policy ${e}`)}var N5=k5;function $5(e){return()=>null}var A5={startPerfBlock:$5};const{isLoadable:L5,loadableWithError:Ta,loadableWithPromise:O5,loadableWithValue:id}=Js,{WrappedValue:Nx}=kx,{getNodeLoadable:Pa,peekNodeLoadable:M5,setNodeValue:I5}=Mr,{saveDepsToStore:F5}=ta,{DEFAULT_VALUE:j5,getConfigDeletionHandler:z5,getNode:D5,registerNode:_v}=Vt,{isRecoilValue:U5}=ii,{markRecoilValueModified:Cv}=Vn,{retainedByOptionWithDefault:B5}=mo,{recoilCallback:V5}=Cx,{startPerfBlock:W5}=A5;class $x{}const Bi=new $x,Vi=[],Na=new Map,H5=(()=>{let e=0;return()=>e++})();function Ax(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,i=e.set!=null?e.set:void 0,s=new Set,a=N5(o??{equality:"reference",eviction:"keep-all"},n),l=B5(e.retainedBy_UNSTABLE),u=new Map;let c=0;function d(){return!Me("recoil_memory_managament_2020")||c>0}function p(C){return C.getState().knownSelectors.add(n),c++,()=>{c--}}function y(){return z5(n)!==void 0&&!d()}function h(C,M,L,Q,D){V(M,Q,D),m(C,L)}function m(C,M){B(C,M)&&U(C),g(M,!0)}function b(C,M){B(C,M)&&(Xe(A(C)).stateVersions.clear(),g(M,!1))}function g(C,M){const L=Na.get(C);if(L!=null){for(const Q of L)Cv(Q,Xe(t));M&&Na.delete(C)}}function f(C,M){let L=Na.get(M);L==null&&Na.set(M,L=new Set),L.add(C)}function v(C,M,L,Q,D,re){return M.then(ie=>{if(!d())throw U(C),Bi;const q=id(ie);return h(C,L,D,q,Q),ie}).catch(ie=>{if(!d())throw U(C),Bi;if(Be(ie))return x(C,ie,L,Q,D,re);const q=Ta(ie);throw h(C,L,D,q,Q),ie})}function x(C,M,L,Q,D,re){return M.then(ie=>{if(!d())throw U(C),Bi;re.loadingDepKey!=null&&re.loadingDepPromise===M?L.atomValues.set(re.loadingDepKey,id(ie)):C.getState().knownSelectors.forEach(se=>{L.atomValues.delete(se)});const q=E(C,L);if(q&&q.state!=="loading"){if((B(C,D)||A(C)==null)&&m(C,D),q.state==="hasValue")return q.contents;throw q.contents}if(!B(C,D)){const se=j(C,L);if(se!=null)return se.loadingLoadable.contents}const[ye,le]=T(C,L,D);if(ye.state!=="loading"&&h(C,L,D,ye,le),ye.state==="hasError")throw ye.contents;return ye.contents}).catch(ie=>{if(ie instanceof $x)throw Bi;if(!d())throw U(C),Bi;const q=Ta(ie);throw h(C,L,D,q,Q),ie})}function R(C,M,L,Q){var D,re,ie,q;if(B(C,Q)||M.version===((D=C.getState())===null||D===void 0||(re=D.currentTree)===null||re===void 0?void 0:re.version)||M.version===((ie=C.getState())===null||ie===void 0||(q=ie.nextTree)===null||q===void 0?void 0:q.version)){var ye,le,se;F5(n,L,C,(ye=(le=C.getState())===null||le===void 0||(se=le.nextTree)===null||se===void 0?void 0:se.version)!==null&&ye!==void 0?ye:C.getState().currentTree.version)}for(const ne of L)s.add(ne)}function T(C,M,L){const Q=W5(n);let D=!0,re=!0;const ie=()=>{Q(),re=!1};let q,ye=!1,le;const se={loadingDepKey:null,loadingDepPromise:null},ne=new Map;function ge({key:nt}){const Ie=Pa(C,M,nt);switch(ne.set(nt,Ie),D||(R(C,M,new Set(ne.keys()),L),b(C,L)),Ie.state){case"hasValue":return Ie.contents;case"hasError":throw Ie.contents;case"loading":throw se.loadingDepKey=nt,se.loadingDepPromise=Ie.contents,Ie.contents}throw ve("Invalid Loadable state")}const _e=nt=>(...Ie)=>{if(re)throw ve("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&Yi(!1),V5(C,nt,Ie,{node:t})};try{q=r({get:ge,getCallback:_e}),q=U5(q)?ge(q):q,L5(q)&&(q.state==="hasError"&&(ye=!0),q=q.contents),Be(q)?q=v(C,q,M,ne,L,se).finally(ie):ie(),q=q instanceof Nx?q.value:q}catch(nt){q=nt,Be(q)?q=x(C,q,M,ne,L,se).finally(ie):(ye=!0,ie())}return ye?le=Ta(q):Be(q)?le=O5(q):le=id(q),D=!1,Z(C,L,ne),R(C,M,new Set(ne.keys()),L),[le,ne]}function E(C,M){let L=M.atomValues.get(n);if(L!=null)return L;const Q=new Set;try{L=a.get(re=>(typeof re!="string"&&Yi(!1),Pa(C,M,re).contents),{onNodeVisit:re=>{re.type==="branch"&&re.nodeKey!==n&&Q.add(re.nodeKey)}})}catch(re){throw ve(`Problem with cache lookup for selector "${n}": ${re.message}`)}if(L){var D;M.atomValues.set(n,L),R(C,M,Q,(D=A(C))===null||D===void 0?void 0:D.executionID)}return L}function $(C,M){const L=E(C,M);if(L!=null)return U(C),L;const Q=j(C,M);if(Q!=null){var D;return((D=Q.loadingLoadable)===null||D===void 0?void 0:D.state)==="loading"&&f(C,Q.executionID),Q.loadingLoadable}const re=H5(),[ie,q]=T(C,M,re);return ie.state==="loading"?(K(C,re,ie,q,M),f(C,re)):(U(C),V(M,ie,q)),ie}function j(C,M){const L=ex([u.has(C)?[Xe(u.get(C))]:[],Qu(gh(u,([D])=>D!==C),([,D])=>D)]);function Q(D){for(const[re,ie]of D)if(!Pa(C,M,re).is(ie))return!0;return!1}for(const D of L){if(D.stateVersions.get(M.version)||!Q(D.depValuesDiscoveredSoFarDuringAsyncWork))return D.stateVersions.set(M.version,!0),D;D.stateVersions.set(M.version,!1)}}function A(C){return u.get(C)}function K(C,M,L,Q,D){u.set(C,{depValuesDiscoveredSoFarDuringAsyncWork:Q,executionID:M,loadingLoadable:L,stateVersions:new Map([[D.version,!0]])})}function Z(C,M,L){if(B(C,M)){const Q=A(C);Q!=null&&(Q.depValuesDiscoveredSoFarDuringAsyncWork=L)}}function U(C){u.delete(C)}function B(C,M){var L;return M===((L=A(C))===null||L===void 0?void 0:L.executionID)}function H(C){return Array.from(C.entries()).map(([M,L])=>[M,L.contents])}function V(C,M,L){C.atomValues.set(n,M);try{a.set(H(L),M)}catch(Q){throw ve(`Problem with setting cache for selector "${n}": ${Q.message}`)}}function Y(C){if(Vi.includes(n)){const M=`Recoil selector has circular dependencies: ${Vi.slice(Vi.indexOf(n)).join(" → ")}`;return Ta(ve(M))}Vi.push(n);try{return C()}finally{Vi.pop()}}function N(C,M){const L=M.atomValues.get(n);return L??a.get(Q=>{var D;return typeof Q!="string"&&Yi(!1),(D=M5(C,M,Q))===null||D===void 0?void 0:D.contents})}function W(C,M){return Y(()=>$(C,M))}function F(C){C.atomValues.delete(n)}function J(C,M){t==null&&Yi(!1);for(const Q of s){var L;const D=D5(Q);(L=D.clearCache)===null||L===void 0||L.call(D,C,M)}s.clear(),F(M),a.clear(),Cv(C,t)}return i!=null?t=_v({key:n,nodeType:"selector",peek:N,get:W,set:(M,L,Q)=>{let D=!1;const re=new Map;function ie({key:se}){if(D)throw ve("Recoil: Async selector sets are not currently supported.");const ne=Pa(M,L,se);if(ne.state==="hasValue")return ne.contents;if(ne.state==="loading"){const ge=`Getting value of asynchronous atom or selector "${se}" in a pending state while setting selector "${n}" is not yet supported.`;throw ve(ge)}else throw ne.contents}function q(se,ne){if(D)throw ve("Recoil: Async selector sets are not currently supported.");const ge=typeof ne=="function"?ne(ie(se)):ne;I5(M,L,se.key,ge).forEach((nt,Ie)=>re.set(Ie,nt))}function ye(se){q(se,j5)}const le=i({set:q,get:ie,reset:ye},Q);if(le!==void 0)throw Be(le)?ve("Recoil: Async selector sets are not currently supported."):ve("Recoil: selector set should be a void function.");return D=!0,re},init:p,invalidate:F,clearCache:J,shouldDeleteConfigOnRelease:y,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=_v({key:n,nodeType:"selector",peek:N,get:W,init:p,invalidate:F,clearCache:J,shouldDeleteConfigOnRelease:y,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}Ax.value=e=>new Nx(e);var li=Ax;const{isLoadable:K5,loadableWithError:sd,loadableWithPromise:ad,loadableWithValue:Eo}=Js,{WrappedValue:Lx}=kx,{peekNodeInfo:q5}=Mr,{DEFAULT_VALUE:Vr,DefaultValue:pr,getConfigDeletionHandler:Ox,registerNode:G5,setConfigDeletionHandler:X5}=Vt,{isRecoilValue:Q5}=ii,{getRecoilValueAsLoadable:Y5,markRecoilValueModified:Z5,setRecoilValue:kv,setRecoilValueLoadable:J5}=Vn,{retainedByOptionWithDefault:eF}=mo,Wi=e=>e instanceof Lx?e.value:e;function tF(e){const{key:t,persistence_UNSTABLE:n}=e,r=eF(e.retainedBy_UNSTABLE);let o=0;function i(f){return ad(f.then(v=>(s=Eo(v),v)).catch(v=>{throw s=sd(v),v}))}let s=Be(e.default)?i(e.default):K5(e.default)?e.default.state==="loading"?i(e.default.contents):e.default:Eo(Wi(e.default));s.contents;let a;const l=new Map;function u(f){return f}function c(f,v){const x=v.then(R=>{var T,E;return((E=((T=f.getState().nextTree)!==null&&T!==void 0?T:f.getState().currentTree).atomValues.get(t))===null||E===void 0?void 0:E.contents)===x&&kv(f,g,R),R}).catch(R=>{var T,E;throw((E=((T=f.getState().nextTree)!==null&&T!==void 0?T:f.getState().currentTree).atomValues.get(t))===null||E===void 0?void 0:E.contents)===x&&J5(f,g,sd(R)),R});return x}function d(f,v,x){var R;o++;const T=()=>{var A;o--,(A=l.get(f))===null||A===void 0||A.forEach(K=>K()),l.delete(f)};if(f.getState().knownAtoms.add(t),s.state==="loading"){const A=()=>{var K;((K=f.getState().nextTree)!==null&&K!==void 0?K:f.getState().currentTree).atomValues.has(t)||Z5(f,g)};s.contents.finally(A)}const E=(R=e.effects)!==null&&R!==void 0?R:e.effects_UNSTABLE;if(E!=null){let A=function(F){if(B&&F.key===t){const J=U;return J instanceof pr?p(f,v):Be(J)?ad(J.then(C=>C instanceof pr?s.toPromise():C)):Eo(J)}return Y5(f,F)},K=function(F){return A(F).toPromise()},Z=function(F){var J;const C=q5(f,(J=f.getState().nextTree)!==null&&J!==void 0?J:f.getState().currentTree,F.key);return B&&F.key===t&&!(U instanceof pr)?{...C,isSet:!0,loadable:A(F)}:C},U=Vr,B=!0,H=!1,V=null;const Y=F=>J=>{if(B){const C=A(g),M=C.state==="hasValue"?C.contents:Vr;U=typeof J=="function"?J(M):J,Be(U)&&(U=U.then(L=>(V={effect:F,value:L},L)))}else{if(Be(J))throw ve("Setting atoms to async values is not implemented.");typeof J!="function"&&(V={effect:F,value:Wi(J)}),kv(f,g,typeof J=="function"?C=>{const M=Wi(J(C));return V={effect:F,value:M},M}:Wi(J))}},N=F=>()=>Y(F)(Vr),W=F=>J=>{var C;const{release:M}=f.subscribeToTransactions(L=>{var Q;let{currentTree:D,previousTree:re}=L.getState();re||(re=D);const ie=(Q=D.atomValues.get(t))!==null&&Q!==void 0?Q:s;if(ie.state==="hasValue"){var q,ye,le,se;const ne=ie.contents,ge=(q=re.atomValues.get(t))!==null&&q!==void 0?q:s,_e=ge.state==="hasValue"?ge.contents:Vr;((ye=V)===null||ye===void 0?void 0:ye.effect)!==F||((le=V)===null||le===void 0?void 0:le.value)!==ne?J(ne,_e,!D.atomValues.has(t)):((se=V)===null||se===void 0?void 0:se.effect)===F&&(V=null)}},t);l.set(f,[...(C=l.get(f))!==null&&C!==void 0?C:[],M])};for(const F of E)try{const J=F({node:g,storeID:f.storeID,parentStoreID_UNSTABLE:f.parentStoreID,trigger:x,setSelf:Y(F),resetSelf:N(F),onSet:W(F),getPromise:K,getLoadable:A,getInfo_UNSTABLE:Z});if(J!=null){var $;l.set(f,[...($=l.get(f))!==null&&$!==void 0?$:[],J])}}catch(J){U=J,H=!0}if(B=!1,!(U instanceof pr)){var j;const F=H?sd(U):Be(U)?ad(c(f,U)):Eo(Wi(U));F.contents,v.atomValues.set(t,F),(j=f.getState().nextTree)===null||j===void 0||j.atomValues.set(t,F)}}return T}function p(f,v){var x,R;return(x=(R=v.atomValues.get(t))!==null&&R!==void 0?R:a)!==null&&x!==void 0?x:s}function y(f,v){if(v.atomValues.has(t))return Xe(v.atomValues.get(t));if(v.nonvalidatedAtoms.has(t)){if(a!=null)return a;if(n==null)return s;const x=v.nonvalidatedAtoms.get(t),R=n.validator(x,Vr);return a=R instanceof pr?s:Eo(R),a}else return s}function h(){a=void 0}function m(f,v,x){if(v.atomValues.has(t)){const R=Xe(v.atomValues.get(t));if(R.state==="hasValue"&&x===R.contents)return new Map}else if(!v.nonvalidatedAtoms.has(t)&&x instanceof pr)return new Map;return a=void 0,new Map().set(t,Eo(x))}function b(){return Ox(t)!==void 0&&o<=0}const g=G5({key:t,nodeType:"atom",peek:p,get:y,set:m,init:d,invalidate:h,shouldDeleteConfigOnRelease:b,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return g}function Ch(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return Q5(n)?nF({...t,default:n}):tF({...t,default:n})}function nF(e){const t=Ch({...e,default:Vr,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof pr?r:Xe(e.persistence_UNSTABLE).validator(r,Vr)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=li({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof pr?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return X5(n.key,Ox(e.key)),n}Ch.value=e=>new Lx(e);var Mx=Ch;class rF{constructor(t){var n;me(this,"_map",void 0),me(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var oF={MapCache:rF},iF=oF.MapCache,sF=Object.freeze({__proto__:null,MapCache:iF});const{LRUCache:Tv}=Px,{MapCache:aF}=sF,$a={equality:"reference",eviction:"none",maxSize:1/0};function lF({equality:e=$a.equality,eviction:t=$a.eviction,maxSize:n=$a.maxSize}=$a){const r=uF(e);return cF(t,n,r)}function uF(e){switch(e){case"reference":return t=>t;case"value":return t=>uc(t)}throw ve(`Unrecognized equality policy ${e}`)}function cF(e,t,n){switch(e){case"keep-all":return new aF({mapKey:n});case"lru":return new Tv({mapKey:n,maxSize:Xe(t)});case"most-recent":return new Tv({mapKey:n,maxSize:1})}throw ve(`Unrecognized eviction policy ${e}`)}var Ix=lF;const{setConfigDeletionHandler:dF}=Vt;function fF(e){var t,n;const r=Ix({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i,s;const a=r.get(o);if(a!=null)return a;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),d=Mx({...u,key:`${e.key}__${(i=uc(o))!==null&&i!==void 0?i:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(s=e.effects)!==null&&s!==void 0?s:e.effects_UNSTABLE});return r.set(o,d),dF(d.key,()=>{r.delete(o)}),d}}var pF=fF;const{setConfigDeletionHandler:hF}=Vt;let mF=0;function gF(e){var t,n;const r=Ix({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i;let s;try{s=r.get(o)}catch(p){throw ve(`Problem with cache lookup for selector ${e.key}: ${p.message}`)}if(s!=null)return s;const a=`${e.key}__selectorFamily/${(i=uc(o,{allowFunctions:!0}))!==null&&i!==void 0?i:"void"}/${mF++}`,l=p=>e.get(o)(p),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let d;if(e.set!=null){const p=e.set;d=li({key:a,get:l,set:(h,m)=>p(o)(h,m),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else d=li({key:a,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,d),hF(d.key,()=>{r.delete(o)}),d}}var Ir=gF;const vF=Ir({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function yF(e){return vF(e)}var SF=yF;const xF=Ir({key:"__error",get:e=>()=>{throw ve(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function wF(e){return xF(e)}var bF=wF;function RF(e){return e}var EF=RF;const{loadableWithError:Fx,loadableWithPromise:jx,loadableWithValue:zx}=Js;function cc(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,i]of t.entries())try{n[o]=e(i)}catch(s){r[o]=s}return[n,r]}function _F(e){return e!=null&&!Be(e)}function dc(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function Nf(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function qo(e,t,n){const r=n.map((o,i)=>o==null?zx(t[i]):Be(o)?jx(o):Fx(o));return Nf(e,r)}function CF(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const kF=Ir({key:"__waitForNone",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);return qo(e,r,o)},dangerouslyAllowMutability:!0}),TF=Ir({key:"__waitForAny",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);return o.some(i=>!Be(i))?qo(e,r,o):new Promise(i=>{for(const[s,a]of o.entries())Be(a)&&a.then(l=>{r[s]=l,o[s]=void 0,i(qo(e,r,o))}).catch(l=>{o[s]=l,i(qo(e,r,o))})})},dangerouslyAllowMutability:!0}),PF=Ir({key:"__waitForAll",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);if(o.every(s=>s==null))return Nf(e,r);const i=o.find(_F);if(i!=null)throw i;return Promise.all(o).then(s=>Nf(e,CF(r,s)))},dangerouslyAllowMutability:!0}),NF=Ir({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=dc(e),[r,o]=cc(t,n);return o.every(i=>!Be(i))?qo(e,r,o):Promise.all(o.map((i,s)=>Be(i)?i.then(a=>{r[s]=a,o[s]=void 0}).catch(a=>{r[s]=void 0,o[s]=a}):null)).then(()=>qo(e,r,o))},dangerouslyAllowMutability:!0}),$F=Ir({key:"__noWait",get:e=>({get:t})=>{try{return li.value(zx(t(e)))}catch(n){return li.value(Be(n)?jx(n):Fx(n))}},dangerouslyAllowMutability:!0});var AF={waitForNone:kF,waitForAny:TF,waitForAll:PF,waitForAllSettled:NF,noWait:$F};const{RecoilLoadable:LF}=Js,{DefaultValue:OF}=Vt,{RecoilRoot:MF,useRecoilStoreID:IF}=or,{isRecoilValue:FF}=ii,{retentionZone:jF}=Zu,{freshSnapshot:zF}=oc,{useRecoilState:DF,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:UF,useRecoilStateLoadable:BF,useRecoilValue:VF,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:WF,useRecoilValueLoadable:HF,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:KF,useResetRecoilState:qF,useSetRecoilState:GF}=oI,{useGotoRecoilSnapshot:XF,useRecoilSnapshot:QF,useRecoilTransactionObserver:YF}=bx,{useRecoilCallback:ZF}=Cx,{noWait:JF,waitForAll:e3,waitForAllSettled:t3,waitForAny:n3,waitForNone:r3}=AF;var kh={DefaultValue:OF,isRecoilValue:FF,RecoilLoadable:LF,RecoilEnv:bi,RecoilRoot:MF,useRecoilStoreID:IF,useRecoilBridgeAcrossReactRoots_UNSTABLE:$I,atom:Mx,selector:li,atomFamily:pF,selectorFamily:Ir,constSelector:SF,errorSelector:bF,readOnlySelector:EF,noWait:JF,waitForNone:r3,waitForAny:n3,waitForAll:e3,waitForAllSettled:t3,useRecoilValue:VF,useRecoilValueLoadable:HF,useRecoilState:DF,useRecoilStateLoadable:BF,useSetRecoilState:GF,useResetRecoilState:qF,useGetRecoilValueInfo_UNSTABLE:_I,useRecoilRefresher_UNSTABLE:s5,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:KF,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:WF,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:UF,useRecoilCallback:ZF,useRecoilTransaction_UNSTABLE:d5,useGotoRecoilSnapshot:XF,useRecoilSnapshot:QF,useRecoilTransactionObserver_UNSTABLE:YF,snapshot_UNSTABLE:zF,useRetain:wh,retentionZone:jF},o3=kh.RecoilRoot,i3=kh.atom,s3=kh.useRecoilState;const a3=i3({key:"userState",default:{username:null,isLoading:!0}});function l3(){const e=kp(),t=pi(),[n,r]=s3(a3),o=async()=>{console.log("from function"),await Te.get(yn+"/user/me",{headers:{authorization:"bearer "+localStorage.getItem("token")}}).then(s=>{console.log("data"+s.data),r({username:s.data.username,isLoading:!1})}).catch(s=>{console.log(s),r({username:"",isLoading:!1})})};S.useEffect(()=>{async function s(){await o(),console.log("pathname"),console.log(e.pathname),n.username&&["/signin","/"].includes(e.pathname)&&t("/users")}s()},[e]);const i=async()=>{localStorage.removeItem("token"),await o(),t("/signin")};return n.isLoading?w.jsx(w.Fragment,{children:w.jsxs(Tr,{style:{display:"flex",justifyContent:"space-between",height:50},children:[w.jsx("h3",{style:{margin:10},children:w.jsx(Pt,{onClick:()=>t("/"),children:"Kaizoku"})}),w.jsx(Ys,{})]})}):n.username?w.jsx(w.Fragment,{children:w.jsxs(Tr,{style:{display:"flex",justifyContent:"space-between",height:50},children:[w.jsx("h3",{style:{margin:10},children:w.jsx(Pt,{onClick:()=>t("/"),children:"Kaizoku"})}),w.jsxs("div",{style:{display:"flex",justifyContent:"space-evenly"},children:[w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/users"),children:"Users"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/friends"),children:"Friends"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/received-friend-requests"),children:"Incoming Requests"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:()=>t("/sent-friend-requests"),children:"OutGoing Requests"}),w.jsx(Pt,{variant:"contained",style:{height:35,margin:10},onClick:i,children:"Log Out"}),w.jsx("h3",{style:{margin:10,marginTop:15},children:n.username})]})]})}):w.jsx(w.Fragment,{children:w.jsxs(Tr,{style:{display:"flex",justifyContent:"space-between",height:50},children:[w.jsx("h3",{style:{margin:10},children:w.jsx(Pt,{onClick:()=>t("/"),children:"Kaizoku"})}),w.jsx(Pt,{variant:"contained",style:{height:35,marginLeft:10},onClick:()=>t("/"),children:"Login"})]})})}const Dx=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/friends",{headers:e})).data}catch(t){return console.log(t),{friends:[]}}},u3=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/users",{headers:e})).data}catch(t){return console.log(t),{Users:[]}}},c3=async e=>{const t={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/send-friend-request",{username:e},{headers:t})).data}catch(n){return console.error(n),{message:"Could not send friend request"}}},Ux=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/sent-friend-requests",{headers:e})).data}catch(t){return console.error(t),{sentFriendRequestsUsername:[""]}}},Bx=async()=>{const e={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.get(yn+"/user/received-friend-requests",{headers:e})).data}catch(t){return console.error(t),{receivedFriendRequestsUsername:[""]}}},d3=async e=>{const t={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/accept-friend-request",{username:e},{headers:t})).data}catch(n){return console.error(n),{message:""}}},f3=async e=>{const t={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/chat/get",{with:e},{headers:t})).data}catch(n){return console.error(n),{message:""}}},p3=async(e,t)=>{const n={authorization:`bearer ${localStorage.getItem("token")}`};try{return(await Te.post(yn+"/user/chat/send",{receiver:e,message:t},{headers:n})).data}catch(r){return console.error(r),{message:""}}};function h3(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[o,i]=S.useState(!1);S.useEffect(()=>{r(!0);async function a(){const l=await u3(),u=await Dx(),c=await Ux(),d=await Bx();l.Users?(l.Users=l.Users.filter(p=>!u.friends.includes(p.username)&&!c.sentFriendRequestsUsername.includes(p.username)&&!d.receivedFriendRequestsUsername.includes(p.username)),t(l.Users),r(!1)):console.dir(l)}a()},[]);const s=async a=>{await c3(a),t(l=>l.filter(u=>u.username!=a)),i(!0)};return n?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):e.length>0?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Users"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:"Friend Request Sent Successfully",open:o,setOpen:i}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:e.map(a=>w.jsx(fc,{username:a.username,handleClick:s,buttonText:"Add Friend",button:!0},a.username))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Users To Send Request To."})," "]})}const fc=e=>e.button?w.jsxs(Tr,{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:200,width:150,marginBottom:10,margin:10},children:[w.jsx("h3",{style:{textAlign:"center",marginTop:10},children:e.username}),w.jsx(Pt,{style:{marginRight:10,margin:10},onClick:()=>e.handleClick(e.username),variant:"contained",children:e.buttonText})]}):w.jsx(Tr,{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:200,margin:10,width:150,marginBottom:10},children:w.jsx("h3",{style:{marginLeft:10},children:e.username})});function m3(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[o,i]=S.useState(!1);return S.useEffect(()=>{async function s(){console.log("response");const a=await Ux();console.log(a),t(a.sentFriendRequestsUsername),r(!1)}s()},[]),n?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):e.length>0?e[0]!=""?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Sent Friend Requests"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:"Friend Request Sent Successfully",open:o,setOpen:i}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:e.map(s=>w.jsx(fc,{username:s,handleClick:()=>{},buttonText:"Unsend Friend Request",button:!1},s))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Users To Send Request To."})," "]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Users To Send Request To."})," "]})}function g3(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[o,i]=S.useState(!1),[s,a]=S.useState("");S.useEffect(()=>{async function u(){console.log("response");const c=await Bx();console.log(c),t(c.receivedFriendRequestsUsername),r(!1)}u()},[]);const l=async u=>{const c=await d3(u);c.message?(a(c.message),t(d=>d.filter(p=>p!=u)),i(!0)):(a("Could not accept Request"),i(!0))};return n?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):e.length>0?e[0]!=""?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Received Friend Requests"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:s,open:o,setOpen:i}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:e.map(u=>w.jsx(fc,{username:u,handleClick:()=>l(u),buttonText:"Accept",button:!0},u))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Request Received."})," "]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"No New Request Received."})," "]})}function v3(){const e=pi(),[t,n]=S.useState([]),[r,o]=S.useState(!0),[i,s]=S.useState(!1);S.useEffect(()=>{async function l(){console.log("response");const u=await Dx();console.log(u),n(u.friends),o(!1)}l()},[]);const a=async l=>{try{const c=(await Te.get(yn+"/user/me",{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})).data.username;e(`/chat/:${c}/:${l}`)}catch{}};return r?w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[" ",w.jsx("div",{style:{alignContent:"center",justifyContent:"center",marginTop:-200},children:w.jsx(Ys,{})})," "]}):t.length>0?t[0]!=""?w.jsxs(w.Fragment,{children:[w.jsx("h1",{style:{display:"flex",justifyContent:"center",marginBottom:-25},children:"Received Friend Requests"}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(xi,{message:"yo",open:i,setOpen:s}),w.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:50,alignContent:"center",flexWrap:"wrap"},children:t.map(l=>w.jsx(fc,{username:l,handleClick:()=>a(l),buttonText:"Chat",button:!0},l))})]})]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"You Don't have any Friends. Fuck."})," "]}):w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center",height:"100vh"},children:[w.jsx("h1",{children:"You Don't have any Friends. Fuck."})," "]})}function y3(){var u;const[e,t]=S.useState("");let{sender:n,receiver:r}=WR();n=n==null?void 0:n.substring(1),r=r==null?void 0:r.substring(1);const o=async()=>{if(r){const c=await f3(r);c.chat&&l(c)}};S.useEffect(()=>{const c=setInterval(o,500);return o(),()=>clearInterval(c)},[]);const i=c=>{t(c.target.value)},s=async()=>{r&&(p3(r,e),n&&l(c=>c.chat?{...a,chat:[...c.chat,{sender:n,message:e}]}:{...c,chat:[{sender:n,message:e}]}),t(""))},[a,l]=S.useState({message:"not yet"});return w.jsxs(w.Fragment,{children:[w.jsx("h2",{style:{margin:1,justifyContent:"center",alignContent:"center",display:"flex"},children:r}),w.jsx(Tr,{style:{margin:5,height:"75vh",display:"flex",flexDirection:"column",overflowY:"auto"},children:(u=a.chat)==null?void 0:u.map(c=>w.jsx("div",{style:{alignSelf:c.sender===r?"flex-start":"flex-end",margin:5},children:c.message},c.message+c.sender+Math.random()))}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[w.jsx(Is,{value:e,label:"message",id:"contained-basic",variant:"outlined",onChange:i}),w.jsx(Pt,{variant:"contained",onClick:s,children:"Send Message"})]})]})}function S3(){return w.jsx(w.Fragment,{children:w.jsx(o3,{children:w.jsxs(aE,{children:[w.jsx(l3,{}),w.jsxs(oE,{children:[w.jsx(cr,{path:"/",Component:W$}),w.jsx(cr,{path:"signin",Component:K$}),w.jsx(cr,{path:"/users",Component:h3}),w.jsx(cr,{path:"/sent-friend-requests",Component:m3}),w.jsx(cr,{path:"/received-friend-requests",Component:g3}),w.jsx(cr,{path:"/friends",Component:v3}),w.jsx(cr,{path:"/chat/:sender/:receiver",Component:y3})]})]})})})}ld.createRoot(document.getElementById("root")).render(w.jsx(be.StrictMode,{children:w.jsx(S3,{})})); diff --git a/server/public/index.html b/server/public/index.html index 527ebd7..9d7a91d 100644 --- a/server/public/index.html +++ b/server/public/index.html @@ -14,7 +14,7 @@ Chattin App - +