@its/core 1.1.33 → 1.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.es.js +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
package/dist/core.umd.js
CHANGED
|
@@ -69,7 +69,7 @@ Recoil Snapshots only last for the duration of the callback they are provided to
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
This is currently a DEV-only warning but will become a thrown exception in the next release of Recoil.
|
|
72
|
-
`;class jg{constructor(t,r){jt(this,"_store",void 0),jt(this,"_refCount",1),jt(this,"getLoadable",n=>(this.checkRefCount_INTERNAL(),Use(this._store,n))),jt(this,"getPromise",n=>(this.checkRefCount_INTERNAL(),this.getLoadable(n).toPromise())),jt(this,"getNodes_UNSTABLE",n=>{if(this.checkRefCount_INTERNAL(),n?.isModified===!0){if(n?.isInitialized===!1)return[];const o=this._store.getState().currentTree;return n5(o.dirtyAtoms)}const i=this._store.getState().knownAtoms,a=this._store.getState().knownSelectors;return n?.isInitialized==null?r5.values():n.isInitialized===!0?n5(e5([i,a])):qS(r5.values(),({key:o})=>!i.has(o)&&!a.has(o))}),jt(this,"getInfo_UNSTABLE",({key:n})=>(this.checkRefCount_INTERNAL(),Fse(this._store,this._store.getState().currentTree,n))),jt(this,"map",n=>{this.checkRefCount_INTERNAL();const i=new GS(this,HS);return n(i),i}),jt(this,"asyncMap",async n=>{this.checkRefCount_INTERNAL();const i=new GS(this,HS);return i.retain(),await n(i),i.autoRelease_INTERNAL(),i}),this._store={storeID:Vse(),parentStoreID:r,getState:()=>t,replaceState:n=>{t.currentTree=n(t.currentTree)},getGraph:n=>{const i=t.graphsByVersion;if(i.has(n))return zr(i.get(n));const a=$se();return i.set(n,a),a},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw Pt("Cannot subscribe to Snapshots")}};for(const n of this._store.getState().knownAtoms)jse(this._store,n,"get"),Lg(this._store,n,1);this.autoRelease_INTERNAL()}retain(){if(this._refCount<=0){if(process.env.NODE_ENV!=="production")throw Pt("Snapshot has already been released.");Xn("Attempt to retain() Snapshot that was already released.")}this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){Kse||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(),!Mr("recoil_memory_managament_2020"))return}else this._refCount<0&&process.env.NODE_ENV!=="production"&&Xn("Snapshot released an extra time.")}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Mr("recoil_memory_managament_2020")&&this._refCount<=0&&process.env.NODE_ENV!=="production"&&Xn(Qse)}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 a5(e,t,r=!1){const n=e.getState(),i=r?Hse():t.version;return{currentTree:{version:r?i:t.version,stateID:r?i: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(n.knownAtoms),knownSelectors:new Set(n.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(i,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(Ng(n.nodeCleanupFunctions.entries(),([a])=>[a,()=>{}]))}}function Xse(e){const t=new jg(Gse());return e!=null?t.map(e):t}const[o5,s5]=Yse((e,t)=>{var r;const n=e.getState(),i=t==="latest"?(r=n.nextTree)!==null&&r!==void 0?r:n.currentTree:zr(n.previousTree);return new jg(a5(e,i),e.storeID)},(e,t)=>{var r,n;return String(t)+String(e.storeID)+String((r=e.getState().nextTree)===null||r===void 0?void 0:r.version)+String(e.getState().currentTree.version)+String((n=e.getState().previousTree)===null||n===void 0?void 0:n.version)});Wse(s5);function Zse(e,t="latest"){const r=o5(e,t);return r.isRetained()?r:(s5(),o5(e,t))}class GS extends jg{constructor(t,r){super(a5(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),jt(this,"_batch",void 0),jt(this,"set",(n,i)=>{this.checkRefCount_INTERNAL();const a=this.getStore_INTERNAL();this._batch(()=>{Lg(a,n.key,1),i5(this.getStore_INTERNAL(),n,i)})}),jt(this,"reset",n=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Lg(i,n.key,1),i5(this.getStore_INTERNAL(),n,qse)})}),jt(this,"setUnvalidatedAtomValues_DEPRECATED",n=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();HS(()=>{for(const[a,o]of n.entries())Lg(i,a,1),zse(i,new Bse(a),o)})}),this._batch=r}}var Fg={Snapshot:jg,MutableSnapshot:GS,freshSnapshot:Xse,cloneSnapshot:Zse},Jse=Fg.Snapshot,eue=Fg.MutableSnapshot,tue=Fg.freshSnapshot,rue=Fg.cloneSnapshot,$g=Object.freeze({__proto__:null,Snapshot:Jse,MutableSnapshot:eue,freshSnapshot:tue,cloneSnapshot:rue});function nue(...e){const t=new Set;for(const r of e)for(const n of r)t.add(n);return t}var iue=nue;const{useRef:aue}=K;function oue(e){const t=aue(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var u5=oue;const{getNextTreeStateVersion:sue,makeEmptyStoreState:l5}=Mj,{cleanUpNode:uue,getDownstreamNodes:lue,initializeNode:cue,setNodeValue:fue,setUnvalidatedAtomValue_DEPRECATED:due}=nl,{graph:hue}=Xd,{cloneGraph:pue}=Xd,{getNextStoreID:c5}=Ig,{createMutableSource:KS,reactMode:f5}=IS,{applyAtomValueWrites:vue}=es,{releaseScheduledRetainablesNow:d5}=Ic,{freshSnapshot:gue}=$g,{useCallback:mue,useContext:h5,useEffect:YS,useMemo:yue,useRef:_ue,useState:bue}=K;function eh(){throw Pt("This component must be used inside a <RecoilRoot> component.")}const p5=Object.freeze({storeID:c5(),getState:eh,replaceState:eh,getGraph:eh,subscribeToTransactions:eh,addTransactionMetadata:eh});let QS=!1;function v5(e){if(QS)throw Pt("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){Mr("recoil_memory_managament_2020")&&Mr("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&d5(e);const r=t.currentTree.version,n=sue();t.nextTree={...t.currentTree,version:n,stateID:n,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(n,pue(zr(t.graphsByVersion.get(r))))}}const g5=K.createContext({current:p5}),XS=()=>h5(g5),m5=K.createContext(null);function Eue(){const e=h5(m5);return e==null&&MS("Attempted to use a Recoil hook outside of a <RecoilRoot>. <RecoilRoot> must be an ancestor of any component that uses Recoil hooks."),e}function y5(e,t,r){const n=lue(e,r,r.dirtyAtoms);for(const i of n){const a=t.nodeToComponentSubscriptions.get(i);if(a)for(const[o,[s,u]]of a)u(r)}}function wue(e){const t=e.getState(),r=t.currentTree,n=r.dirtyAtoms;if(n.size){for(const[i,a]of t.nodeTransactionSubscriptions)if(n.has(i))for(const[o,s]of a)s(e);for(const[i,a]of t.transactionSubscriptions)a(e);(!f5().early||t.suspendedComponentResolvers.size>0)&&(y5(e,t,r),t.suspendedComponentResolvers.forEach(i=>i()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(i=>i(r)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function xue(e){const t=e.getState();t.commitDepth++;try{const{nextTree:r}=t;if(r==null)return;t.previousTree=t.currentTree,t.currentTree=r,t.nextTree=null,wue(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):Xn("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Mr("recoil_memory_managament_2020")&&r==null&&d5(e)}finally{t.commitDepth--}}function Sue({setNotifyBatcherOfChange:e}){const t=XS(),[,r]=bue([]);return e(()=>r({})),YS(()=>(e(()=>r({})),()=>{e(()=>{})}),[e]),YS(()=>{coe.enqueueExecution("Batcher",()=>{xue(t.current)})}),null}process.env.NODE_ENV!=="production"&&typeof window<"u"&&!window.$recoilDebugStates&&(window.$recoilDebugStates=[]);function Rue(e,t){const r=l5();return t({set:(n,i)=>{const a=r.currentTree,o=fue(e,a,n.key,i),s=new Set(o.keys()),u=a.nonvalidatedAtoms.clone();for(const l of s)u.delete(l);r.currentTree={...a,dirtyAtoms:iue(a.dirtyAtoms,s),atomValues:vue(a.atomValues,o),nonvalidatedAtoms:u}},setUnvalidatedAtomValues:n=>{n.forEach((i,a)=>{r.currentTree=due(r.currentTree,a,i)})}}),r}function Oue(e){const t=gue(e),r=t.getStore_INTERNAL().getState();return t.retain(),r.nodeCleanupFunctions.forEach(n=>n()),r.nodeCleanupFunctions.clear(),r}let _5=0;function Aue({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:r,children:n}){let i;const a=h=>{const m=i.current.graphsByVersion;if(m.has(h))return zr(m.get(h));const p=hue();return m.set(h,p),p},o=(h,m)=>{if(m==null){const{transactionSubscriptions:p}=f.current.getState(),g=_5++;return p.set(g,h),{release:()=>{p.delete(g)}}}else{const{nodeTransactionSubscriptions:p}=f.current.getState();p.has(m)||p.set(m,new Map);const g=_5++;return zr(p.get(m)).set(g,h),{release:()=>{const y=p.get(m);y&&(y.delete(g),y.size===0&&p.delete(m))}}}},s=h=>{v5(f.current);for(const m of Object.keys(h))zr(f.current.getState().nextTree).transactionMetadata[m]=h[m]},u=h=>{v5(f.current);const m=zr(i.current.nextTree);let p;try{QS=!0,p=h(m)}finally{QS=!1}p!==m&&(process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.$recoilDebugStates.push(p),i.current.nextTree=p,f5().early&&y5(f.current,i.current,p),zr(l.current)())},l=_ue(null),c=mue(h=>{l.current=h},[l]),f=u5(()=>r??{storeID:c5(),getState:()=>i.current,replaceState:u,getGraph:a,subscribeToTransactions:o,addTransactionMetadata:s});r!=null&&(f.current=r),i=u5(()=>e!=null?Rue(f.current,e):t!=null?Oue(t):l5());const d=yue(()=>KS?.(i,()=>i.current.currentTree.version),[i]);return YS(()=>{const h=f.current;for(const m of new Set(h.getState().knownAtoms))cue(h,m,"get");return()=>{for(const m of h.getState().knownAtoms)uue(h,m)}},[f]),K.createElement(g5.Provider,{value:f},K.createElement(m5.Provider,{value:d},K.createElement(Sue,{setNotifyBatcherOfChange:c}),n))}function Tue(e){const{override:t,...r}=e,n=XS();return t===!1&&n.current!==p5?e.children:K.createElement(Aue,r)}var Vg={RecoilRoot:Tue,useStoreRef:XS,useRecoilMutableSource:Eue};function Cue(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}var Pue=Cue;const{useEffect:Nue,useRef:Due}=K;function Iue(e){const t=Due();return Nue(()=>{t.current=e}),t.current}var kue=Iue;const{useStoreRef:Mue}=Vg,{SUSPENSE_TIMEOUT_MS:Lue}=Ic,{updateRetainCount:th}=Ic,{RetentionZone:jue}=VS,{useEffect:Fue,useRef:$ue}=K,{isSSR:b5}=Mg;function Vue(e){if(Mr("recoil_memory_managament_2020"))return que(e)}function que(e){const r=(Array.isArray(e)?e:[e]).map(o=>o instanceof jue?o:o.key),n=Mue();Fue(()=>{if(!Mr("recoil_memory_managament_2020"))return;const o=n.current;if(i.current&&!b5)window.clearTimeout(i.current),i.current=null;else for(const s of r)th(o,s,1);return()=>{for(const s of r)th(o,s,-1)}},[n,...r]);const i=$ue(),a=kue(r);if(!b5&&(a===void 0||!Pue(a,r))){const o=n.current;for(const s of r)th(o,s,1);if(a)for(const s of a)th(o,s,-1);i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null;for(const s of r)th(o,s,-1)},Lue)}}var Bue=Vue;function Uue(){return"<component name not available>"}var qg=Uue;const{currentRendererSupportsUseSyncExternalStore:zue,reactMode:rh,useMutableSource:Wue,useSyncExternalStore:Hue}=IS,{useRecoilMutableSource:Gue,useStoreRef:kc}=Vg,{isRecoilValue:Kue}=rl,{getRecoilValueAsLoadable:Bg,setRecoilValue:Yue,subscribeToRecoilValue:Ug}=es,{useCallback:Ga,useEffect:zg,useMemo:Que,useRef:E5,useState:w5}=K,{isSSR:Xue}=Mg;function Zue(e,t,r){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(i=>{const a=r.current.getState().suspendedComponentResolvers;a.add(i),Xue&&Tr(e.contents)&&e.contents.finally(()=>{a.delete(i)})}):e.state==="hasError"?e.contents:Pt(`Invalid value of loadable atom "${t.key}"`)}function ZS(e,t){if(!Kue(e))throw Pt(`Invalid argument to ${t}: expected an atom or selector but got ${String(e)}`)}function Jue(e){const t=kc(),r=qg(),n=Ga(()=>{var s;process.env.NODE_ENV;const u=t.current,l=u.getState(),c=rh().early&&(s=l.nextTree)!==null&&s!==void 0?s:l.currentTree;return{loadable:Bg(u,e,c),key:e.key}},[t,e]),i=Ga(s=>{let u;return()=>{var l,c;const f=s();return(l=u)!==null&&l!==void 0&&l.loadable.is(f.loadable)&&((c=u)===null||c===void 0?void 0:c.key)===f.key?u:(u=f,f)}},[]),a=Que(()=>i(n),[n,i]),o=Ga(s=>{const u=t.current;return Ug(u,e,s,r).release},[t,e,r]);return Hue(o,a,a).loadable}function ele(e){const t=kc(),r=Ga(()=>{var l;const c=t.current,f=c.getState(),d=rh().early&&(l=f.nextTree)!==null&&l!==void 0?l:f.currentTree;return Bg(c,e,d)},[t,e]),n=Ga(()=>(process.env.NODE_ENV,r()),[r]),i=qg(),a=Ga((l,c)=>{const f=t.current;return Ug(f,e,()=>{if(!Mr("recoil_suppress_rerender_in_callback"))return c();const h=r();u.current.is(h)||c(),u.current=h},i).release},[t,e,i,r]),o=Gue();if(o==null)throw Pt("Recoil hooks must be used in components contained within a <RecoilRoot> component.");const s=Wue(o,n,a),u=E5(s);return zg(()=>{u.current=s}),s}function x5(e){const t=kc(),r=qg(),n=Ga(()=>{var u;process.env.NODE_ENV;const l=t.current,c=l.getState(),f=rh().early&&(u=c.nextTree)!==null&&u!==void 0?u:c.currentTree;return Bg(l,e,f)},[t,e]),i=Ga(()=>({loadable:n(),key:e.key}),[n,e.key]),a=Ga(u=>{const l=i();return u.loadable.is(l.loadable)&&u.key===l.key?u:l},[i]);zg(()=>{const u=Ug(t.current,e,l=>{s(a)},r);return s(a),u.release},[r,e,t,a]);const[o,s]=w5(i);return o.key!==e.key?i().loadable:o.loadable}function tle(e){const t=kc(),[,r]=w5([]),n=qg(),i=Ga(()=>{var s;process.env.NODE_ENV;const u=t.current,l=u.getState(),c=rh().early&&(s=l.nextTree)!==null&&s!==void 0?s:l.currentTree;return Bg(u,e,c)},[t,e]),a=i(),o=E5(a);return zg(()=>{o.current=a}),zg(()=>{const s=t.current,u=s.getState(),l=Ug(s,e,f=>{var d;if(!Mr("recoil_suppress_rerender_in_callback"))return r([]);const h=i();(d=o.current)!==null&&d!==void 0&&d.is(h)||r(h),o.current=h},n);if(u.nextTree)s.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{o.current=null,r([])});else{var c;if(!Mr("recoil_suppress_rerender_in_callback"))return r([]);const f=i();(c=o.current)!==null&&c!==void 0&&c.is(f)||r(f),o.current=f}return l.release},[n,i,e,t]),a}function rle(e){return process.env.NODE_ENV!=="production"&&ZS(e,"useRecoilValueLoadable"),Mr("recoil_memory_managament_2020")&&Bue(e),{TRANSITION_SUPPORT:x5,SYNC_EXTERNAL_STORE:zue()?Jue:x5,MUTABLE_SOURCE:ele,LEGACY:tle}[rh().mode](e)}function nle(e){process.env.NODE_ENV!=="production"&&ZS(e,"useRecoilValue");const t=kc(),r=rle(e);return Zue(r,e,t)}function ile(e){process.env.NODE_ENV!=="production"&&ZS(e,"useSetRecoilState");const t=kc();return Ga(r=>{Yue(t.current,e,r)},[t,e])}var ale={useRecoilValue:nle,useSetRecoilState:ile};const{batchUpdates:ole}=WS,{DEFAULT_VALUE:sle,getNode:ule}=Ha,{AbstractRecoilValue:lle,setRecoilValueLoadable:cle}=es,{cloneSnapshot:wGe}=$g,{useCallback:xGe,useEffect:SGe,useRef:RGe,useState:OGe}=K;function fle(e,t){var r;const n=e.getState(),i=(r=n.nextTree)!==null&&r!==void 0?r:n.currentTree,a=t.getStore_INTERNAL().getState().currentTree;ole(()=>{const o=new Set;for(const l of[i.atomValues.keys(),a.atomValues.keys()])for(const c of l){var s,u;((s=i.atomValues.get(c))===null||s===void 0?void 0:s.contents)!==((u=a.atomValues.get(c))===null||u===void 0?void 0:u.contents)&&ule(c).shouldRestoreFromSnapshots&&o.add(c)}o.forEach(l=>{cle(e,new lle(l),a.atomValues.has(l)?zr(a.atomValues.get(l)):sle)}),e.replaceState(l=>({...l,stateID:t.getID()}))})}var dle={gotoSnapshot:fle};const{useMemo:AGe}=K,{loadableWithValue:hle}=Yd,{initializeNode:ple}=nl,{DEFAULT_VALUE:vle,getNode:gle}=Ha,{copyTreeState:mle,getRecoilValueAsLoadable:yle,invalidateDownstreams:_le,writeLoadableToTreeState:ble}=es;function S5(e){return gle(e.key).nodeType==="atom"}class Ele{constructor(t,r){jt(this,"_store",void 0),jt(this,"_treeState",void 0),jt(this,"_changes",void 0),jt(this,"get",n=>{if(this._changes.has(n.key))return this._changes.get(n.key);if(!S5(n))throw Pt("Reading selectors within atomicUpdate is not supported");const i=yle(this._store,n,this._treeState);if(i.state==="hasValue")return i.contents;throw i.state==="hasError"?i.contents:Pt(`Expected Recoil atom ${n.key} to have a value, but it is in a loading state.`)}),jt(this,"set",(n,i)=>{if(!S5(n))throw Pt("Setting selectors within atomicUpdate is not supported");if(typeof i=="function"){const a=this.get(n);this._changes.set(n.key,i(a))}else ple(this._store,n.key,"set"),this._changes.set(n.key,i)}),jt(this,"reset",n=>{this.set(n,vle)}),this._store=t,this._treeState=r,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=mle(this._treeState);for(const[r,n]of this._changes)ble(t,r,hle(n));return _le(this._store,t),t}}function wle(e){return t=>{e.replaceState(r=>{const n=new Ele(e,r);return t(n),n.newTreeState_INTERNAL()})}}var xle={atomicUpdater:wle},Sle=xle.atomicUpdater,R5=Object.freeze({__proto__:null,atomicUpdater:Sle});function Rle(e,t){if(!e)throw new Error(t)}var Ole=Rle,Eo=Ole;const{atomicUpdater:Ale}=R5,{batchUpdates:Tle}=WS,{DEFAULT_VALUE:Cle}=Ha,{useStoreRef:Ple}=Vg,{refreshRecoilValue:Nle,setRecoilValue:O5}=es,{cloneSnapshot:Dle}=$g,{gotoSnapshot:Ile}=dle,{useCallback:kle}=K;class A5{}const Mle=new A5;function T5(e,t,r,n){let i=Mle,a;if(Tle(()=>{const s="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 Pt(s);const u=Lj({...n??{},set:(c,f)=>O5(e,c,f),reset:c=>O5(e,c,Cle),refresh:c=>Nle(e,c),gotoSnapshot:c=>Ile(e,c),transact_UNSTABLE:c=>Ale(e)(c)},{snapshot:()=>{const c=Dle(e);return a=c.retain(),c}}),l=t(u);if(typeof l!="function")throw Pt(s);i=l(...r)}),i instanceof A5&&(process.env.NODE_ENV!=="production"?Eo(!1,"batchUpdates should return immediately"):Eo(!1)),Tr(i))i=i.finally(()=>{var s;(s=a)===null||s===void 0||s()});else{var o;(o=a)===null||o===void 0||o()}return i}function Lle(e,t){const r=Ple();return kle((...n)=>T5(r.current,e,n),t!=null?[...t,r]:void 0)}var C5={recoilCallback:T5,useRecoilCallback:Lle};const{useCallback:TGe}=K,{atomicUpdater:CGe}=R5,{useMemo:PGe}=K;class jle{constructor(t){jt(this,"value",void 0),this.value=t}}var Fle={WrappedValue:jle},$le=Fle.WrappedValue,P5=Object.freeze({__proto__:null,WrappedValue:$le});class N5 extends Error{}class Vle{constructor(t){var r,n,i;jt(this,"_name",void 0),jt(this,"_numLeafs",void 0),jt(this,"_root",void 0),jt(this,"_onHit",void 0),jt(this,"_onSet",void 0),jt(this,"_mapNodeValue",void 0),this._name=t?.name,this._numLeafs=0,this._root=null,this._onHit=(r=t?.onHit)!==null&&r!==void 0?r:()=>{},this._onSet=(n=t?.onSet)!==null&&n!==void 0?n:()=>{},this._mapNodeValue=(i=t?.mapNodeValue)!==null&&i!==void 0?i:a=>a}size(){return this._numLeafs}root(){return this._root}get(t,r){var n;return(n=this.getLeafNode(t,r))===null||n===void 0?void 0:n.value}getLeafNode(t,r){if(this._root==null)return;let n=this._root;for(;n;){if(r?.onNodeVisit(n),n.type==="leaf")return this._onHit(n),n;const i=this._mapNodeValue(t(n.nodeKey));n=n.branches.get(i)}}set(t,r,n){const i=()=>{var a,o,s,u;let l,c;for(const[g,y]of t){var f,d,h;const b=this._root;if(b?.type==="leaf")throw this.invalidCacheError();const E=l;if(l=E?E.branches.get(c):b,l=(f=l)!==null&&f!==void 0?f:{type:"branch",nodeKey:g,parent:E,branches:new Map,branchKey:c},l.type!=="branch"||l.nodeKey!==g)throw this.invalidCacheError();E?.branches.set(c,l),n==null||(d=n.onNodeVisit)===null||d===void 0||d.call(n,l),c=this._mapNodeValue(y),this._root=(h=this._root)!==null&&h!==void 0?h:l}const m=l?(a=l)===null||a===void 0?void 0:a.branches.get(c):this._root;if(m!=null&&(m.type!=="leaf"||m.branchKey!==c))throw this.invalidCacheError();const p={type:"leaf",value:r,parent:l,branchKey:c};(o=l)===null||o===void 0||o.branches.set(c,p),this._root=(s=this._root)!==null&&s!==void 0?s:p,this._numLeafs++,this._onSet(p),n==null||(u=n.onNodeVisit)===null||u===void 0||u.call(n,p)};try{i()}catch(a){if(a instanceof N5)this.clear(),i();else throw a}}delete(t){const r=this.root();if(!r)return!1;if(t===r)return this._root=null,this._numLeafs=0,!0;let n=t.parent,i=t.branchKey;for(;n;){var a;if(n.branches.delete(i),n===r)return n.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(n.branches.size>0)break;i=(a=n)===null||a===void 0?void 0:a.branchKey,n=n.parent}for(;n!==r;n=n.parent)if(n==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){throw Xn("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."+(this._name!=null?` - ${this._name}`:"")),new N5}}var qle={TreeCache:Vle},Ble=qle.TreeCache,D5=Object.freeze({__proto__:null,TreeCache:Ble});class Ule{constructor(t){var r;jt(this,"_maxSize",void 0),jt(this,"_size",void 0),jt(this,"_head",void 0),jt(this,"_tail",void 0),jt(this,"_map",void 0),jt(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(r=t.mapKey)!==null&&r!==void 0?r:n=>n}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 r=this._keyMapper(t),n=this._map.get(r);if(n)return this.set(t,n.value),n.value}set(t,r){const n=this._keyMapper(t);this._map.get(n)&&this.delete(t);const a=this.head(),o={key:t,right:a,left:null,value:r};a?a.left=o:this._tail=o,this._map.set(n,o),this._head=o,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const r=this._keyMapper(t);if(!this._size||!this._map.has(r))return;const n=zr(this._map.get(r)),i=n.right,a=n.left;i&&(i.left=n.left),a&&(a.right=n.right),n===this.head()&&(this._head=i),n===this.tail()&&(this._tail=a),this._map.delete(r),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var zle={LRUCache:Ule},Wle=zle.LRUCache,I5=Object.freeze({__proto__:null,LRUCache:Wle});const{LRUCache:Hle}=I5,{TreeCache:Gle}=D5;function Kle({name:e,maxSize:t,mapNodeValue:r=n=>n}){const n=new Hle({maxSize:t}),i=new Gle({name:e,mapNodeValue:r,onHit:a=>{n.set(a,!0)},onSet:a=>{const o=n.tail();n.set(a,!0),o&&i.size()>t&&i.delete(o.key)}});return i}var k5=Kle;const Yle=15;function ma(e,t,r){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?.allowFunctions!==!0)throw Pt("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var n;return(n=JSON.stringify(e))!==null&&n!==void 0?n:""}if(Tr(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((i,a)=>ma(i,t,a.toString()))}]`;if(typeof e.toJSON=="function")return ma(e.toJSON(r),t,r);if(e instanceof Map){const i={};for(const[a,o]of e)i[typeof a=="string"?a:ma(a,t)]=o;return ma(i,t,r)}return e instanceof Set?ma(Array.from(e).sort((i,a)=>ma(i,t).localeCompare(ma(a,t))),t,r):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?ma(Array.from(e),t,r):`{${Object.keys(e).filter(i=>e[i]!==void 0).sort().map(i=>`${ma(i,t)}:${ma(e[i],t,i)}`).join(",")}}`}function Qle(e,t={allowFunctions:!1}){if(process.env.NODE_ENV!=="production"&&typeof window<"u"){const r=window.performance?window.performance.now():0,n=ma(e,t),i=window.performance?window.performance.now():0;return i-r>Yle&&(console.groupCollapsed(`Recoil: Spent ${i-r}ms computing a cache key`),console.warn(e,n),console.groupEnd()),n}return ma(e,t)}var JS=Qle;const{TreeCache:Xle}=D5,Wg={equality:"reference",eviction:"keep-all",maxSize:1/0};function Zle({equality:e=Wg.equality,eviction:t=Wg.eviction,maxSize:r=Wg.maxSize}=Wg,n){const i=Jle(e);return ece(t,r,i,n)}function Jle(e){switch(e){case"reference":return t=>t;case"value":return t=>JS(t)}throw Pt(`Unrecognized equality policy ${e}`)}function ece(e,t,r,n){switch(e){case"keep-all":return new Xle({name:n,mapNodeValue:r});case"lru":return k5({name:n,maxSize:zr(t),mapNodeValue:r});case"most-recent":return k5({name:n,maxSize:1,mapNodeValue:r})}throw Pt(`Unrecognized eviction policy ${e}`)}var tce=Zle;function rce(e){var t,r;if(typeof window>"u")return!1;const i=(r=(e!=null?(t=e.ownerDocument)!==null&&t!==void 0?t:e:document).defaultView)!==null&&r!==void 0?r:window;return e!=null&&(typeof i.Node=="function"?e instanceof i.Node:typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string")}var nce=rce;const{isReactNative:ice,isWindow:ace}=Mg;function oce(e){if(e===null||typeof e!="object")return!0;switch(typeof e.$$typeof){case"symbol":return!0;case"number":return!0}return!!(e["@@__IMMUTABLE_ITERABLE__@@"]!=null||e["@@__IMMUTABLE_KEYED__@@"]!=null||e["@@__IMMUTABLE_INDEXED__@@"]!=null||e["@@__IMMUTABLE_ORDERED__@@"]!=null||e["@@__IMMUTABLE_RECORD__@@"]!=null||nce(e)||Tr(e)||e instanceof Error||ArrayBuffer.isView(e)||!ice&&ace(e))}function M5(e){if(!(typeof e!="object"||oce(e))){Object.freeze(e);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];typeof r=="object"&&r!=null&&!Object.isFrozen(r)&&M5(r)}Object.seal(e)}}var eR=M5;const{isLoadable:sce,loadableWithError:Hg,loadableWithPromise:uce,loadableWithValue:tR}=Yd,{WrappedValue:L5}=P5,{getNodeLoadable:Gg,peekNodeLoadable:lce,setNodeValue:cce}=nl,{saveDepsToStore:fce}=Xd,{DEFAULT_VALUE:dce,getConfigDeletionHandler:hce,getNode:pce,registerNode:j5}=Ha,{isRecoilValue:vce}=rl,{markRecoilValueModified:F5}=es,{retainedByOptionWithDefault:gce}=Ic,{recoilCallback:mce}=C5;class $5{}const nh=new $5,ih=[],Kg=new Map,yce=(()=>{let e=0;return()=>e++})();function V5(e){let t=null;const{key:r,get:n,cachePolicy_UNSTABLE:i}=e,a=e.set!=null?e.set:void 0;if(process.env.NODE_ENV!=="production"){if(typeof r!="string")throw Pt("A key option with a unique string value must be provided when creating a selector.");if(typeof n!="function")throw Pt("Selectors must specify a get callback option to get the selector value.")}const o=new Set,s=tce(i??{equality:"reference",eviction:"keep-all"},r),u=gce(e.retainedBy_UNSTABLE),l=new Map;let c=0;function f(){return!Mr("recoil_memory_managament_2020")||c>0}function d(O){return O.getState().knownSelectors.add(r),c++,()=>{c--}}function h(){return hce(r)!==void 0&&!f()}function m(O,$,q,W,z){L($,W,z),p(O,q)}function p(O,$){A(O,$)&&P(O),y($,!0)}function g(O,$){A(O,$)&&(zr(k(O)).stateVersions.clear(),y($,!1))}function y(O,$){const q=Kg.get(O);if(q!=null){for(const W of q)F5(W,zr(t));$&&Kg.delete(O)}}function b(O,$){let q=Kg.get($);q==null&&Kg.set($,q=new Set),q.add(O)}function E(O,$,q,W,z,Y){return $.then(Q=>{if(!f())throw P(O),nh;const Z=tR(Q);return m(O,q,z,Z,W),Q}).catch(Q=>{if(!f())throw P(O),nh;if(Tr(Q))return w(O,Q,q,W,z,Y);const Z=Hg(Q);throw m(O,q,z,Z,W),Q})}function w(O,$,q,W,z,Y){return $.then(Q=>{if(!f())throw P(O),nh;Y.loadingDepKey!=null&&Y.loadingDepPromise===$?q.atomValues.set(Y.loadingDepKey,tR(Q)):O.getState().knownSelectors.forEach(ee=>{q.atomValues.delete(ee)});const Z=S(O,q);if(Z&&Z.state!=="loading"){if((A(O,z)||k(O)==null)&&p(O,z),Z.state==="hasValue")return Z.contents;throw Z.contents}if(!A(O,z)){const ee=M(O,q);if(ee!=null)return ee.loadingLoadable.contents}const[re,ie]=R(O,q,z);if(re.state!=="loading"&&m(O,q,z,re,ie),re.state==="hasError")throw re.contents;return re.contents}).catch(Q=>{if(Q instanceof $5)throw nh;if(!f())throw P(O),nh;const Z=Hg(Q);throw m(O,q,z,Z,W),Q})}function x(O,$,q,W){var z,Y,Q,Z;if(A(O,W)||$.version===((z=O.getState())===null||z===void 0||(Y=z.currentTree)===null||Y===void 0?void 0:Y.version)||$.version===((Q=O.getState())===null||Q===void 0||(Z=Q.nextTree)===null||Z===void 0?void 0:Z.version)){var re,ie,ee;fce(r,q,O,(re=(ie=O.getState())===null||ie===void 0||(ee=ie.nextTree)===null||ee===void 0?void 0:ee.version)!==null&&re!==void 0?re:O.getState().currentTree.version)}for(const fe of q)o.add(fe)}function R(O,$,q){let W=!0,z=!0;const Y=()=>{z=!1};let Q,Z=!1,re;const ie={loadingDepKey:null,loadingDepPromise:null},ee=new Map;function fe({key:se}){const ce=Gg(O,$,se);switch(ee.set(se,ce),W||(x(O,$,new Set(ee.keys()),q),g(O,q)),ce.state){case"hasValue":return ce.contents;case"hasError":throw ce.contents;case"loading":throw ie.loadingDepKey=se,ie.loadingDepPromise=ce.contents,ce.contents}throw Pt("Invalid Loadable state")}const ue=se=>(...ce)=>{if(z)throw Pt("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&&(process.env.NODE_ENV!=="production"?Eo(!1,"Recoil Value can never be null"):Eo(!1)),mce(O,se,ce,{node:t})};try{Q=n({get:fe,getCallback:ue}),Q=vce(Q)?fe(Q):Q,sce(Q)&&(Q.state==="hasError"&&(Z=!0),Q=Q.contents),Tr(Q)?Q=E(O,Q,$,ee,q,ie).finally(Y):Y(),Q=Q instanceof L5?Q.value:Q}catch(se){Q=se,Tr(Q)?Q=w(O,Q,$,ee,q,ie).finally(Y):(Z=!0,Y())}return Z?re=Hg(Q):Tr(Q)?re=uce(Q):re=tR(Q),W=!1,V(O,q,ee),x(O,$,new Set(ee.keys()),q),[re,ee]}function S(O,$){let q=$.atomValues.get(r);if(q!=null)return q;const W=new Set;try{q=s.get(Y=>(typeof Y!="string"&&(process.env.NODE_ENV!=="production"?Eo(!1,"Cache nodeKey is type string"):Eo(!1)),Gg(O,$,Y).contents),{onNodeVisit:Y=>{Y.type==="branch"&&Y.nodeKey!==r&&W.add(Y.nodeKey)}})}catch(Y){throw Pt(`Problem with cache lookup for selector "${r}": ${Y.message}`)}if(q){var z;$.atomValues.set(r,q),x(O,$,W,(z=k(O))===null||z===void 0?void 0:z.executionID)}return q}function j(O,$){const q=S(O,$);if(q!=null)return P(O),q;const W=M(O,$);if(W!=null){var z;return((z=W.loadingLoadable)===null||z===void 0?void 0:z.state)==="loading"&&b(O,W.executionID),W.loadingLoadable}const Y=yce(),[Q,Z]=R(O,$,Y);return Q.state==="loading"?(F(O,Y,Q,Z,$),b(O,Y)):(P(O),L($,Q,Z)),Q}function M(O,$){const q=e5([l.has(O)?[zr(l.get(O))]:[],Ng(qS(l,([z])=>z!==O),([,z])=>z)]);function W(z){for(const[Y,Q]of z)if(!Gg(O,$,Y).is(Q))return!0;return!1}for(const z of q){if(z.stateVersions.get($.version)||!W(z.depValuesDiscoveredSoFarDuringAsyncWork))return z.stateVersions.set($.version,!0),z;z.stateVersions.set($.version,!1)}}function k(O){return l.get(O)}function F(O,$,q,W,z){l.set(O,{depValuesDiscoveredSoFarDuringAsyncWork:W,executionID:$,loadingLoadable:q,stateVersions:new Map([[z.version,!0]])})}function V(O,$,q){if(A(O,$)){const W=k(O);W!=null&&(W.depValuesDiscoveredSoFarDuringAsyncWork=q)}}function P(O){l.delete(O)}function A(O,$){var q;return $===((q=k(O))===null||q===void 0?void 0:q.executionID)}function I(O){return Array.from(O.entries()).map(([$,q])=>[$,q.contents])}function L(O,$,q){process.env.NODE_ENV!=="production"&&$.state!=="loading"&&!e.dangerouslyAllowMutability&&eR($.contents),O.atomValues.set(r,$);try{s.set(I(q),$)}catch(W){throw Pt(`Problem with setting cache for selector "${r}": ${W.message}`)}}function B(O){if(ih.includes(r)){const $=`Recoil selector has circular dependencies: ${ih.slice(ih.indexOf(r)).join(" → ")}`;return Hg(Pt($))}ih.push(r);try{return O()}finally{ih.pop()}}function H(O,$){const q=$.atomValues.get(r);return q??s.get(W=>{var z;return typeof W!="string"&&(process.env.NODE_ENV!=="production"?Eo(!1,"Cache nodeKey is type string"):Eo(!1)),(z=lce(O,$,W))===null||z===void 0?void 0:z.contents})}function U(O,$){return B(()=>j(O,$))}function T(O){O.atomValues.delete(r)}function D(O,$){t==null&&(process.env.NODE_ENV!=="production"?Eo(!1,"Recoil Value can never be null"):Eo(!1));for(const W of o){var q;const z=pce(W);(q=z.clearCache)===null||q===void 0||q.call(z,O,$)}o.clear(),T($),s.clear(),F5(O,t)}return a!=null?t=j5({key:r,nodeType:"selector",peek:H,get:U,set:($,q,W)=>{let z=!1;const Y=new Map;function Q({key:ee}){if(z)throw Pt("Recoil: Async selector sets are not currently supported.");const fe=Gg($,q,ee);if(fe.state==="hasValue")return fe.contents;if(fe.state==="loading"){const ue=`Getting value of asynchronous atom or selector "${ee}" in a pending state while setting selector "${r}" is not yet supported.`;throw Xn(ue),Pt(ue)}else throw fe.contents}function Z(ee,fe){if(z){const ce="Recoil: Async selector sets are not currently supported.";throw Xn(ce),Pt(ce)}const ue=typeof fe=="function"?fe(Q(ee)):fe;cce($,q,ee.key,ue).forEach((ce,ae)=>Y.set(ae,ce))}function re(ee){Z(ee,dce)}const ie=a({set:Z,get:Q,reset:re},W);if(ie!==void 0)throw Tr(ie)?Pt("Recoil: Async selector sets are not currently supported."):Pt("Recoil: selector set should be a void function.");return z=!0,Y},init:d,invalidate:T,clearCache:D,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:u}):t=j5({key:r,nodeType:"selector",peek:H,get:U,init:d,invalidate:T,clearCache:D,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:u})}V5.value=e=>new L5(e);var ah=V5;const{isLoadable:_ce,loadableWithError:rR,loadableWithPromise:nR,loadableWithValue:Mc}=Yd,{WrappedValue:q5}=P5,{peekNodeInfo:bce}=nl,{DEFAULT_VALUE:il,DefaultValue:au,getConfigDeletionHandler:B5,registerNode:Ece,setConfigDeletionHandler:wce}=Ha,{isRecoilValue:xce}=rl,{getRecoilValueAsLoadable:Sce,markRecoilValueModified:Rce,setRecoilValue:U5,setRecoilValueLoadable:Oce}=es,{retainedByOptionWithDefault:Ace}=Ic,oh=e=>e instanceof q5?e.value:e;function Tce(e){const{key:t,persistence_UNSTABLE:r}=e,n=Ace(e.retainedBy_UNSTABLE);let i=0;function a(b){return nR(b.then(E=>(o=Mc(E),E)).catch(E=>{throw o=rR(E),E}))}let o=Tr(e.default)?a(e.default):_ce(e.default)?e.default.state==="loading"?a(e.default.contents):e.default:Mc(oh(e.default));l(o.contents);let s;const u=new Map;function l(b){return process.env.NODE_ENV!=="production"&&e.dangerouslyAllowMutability!==!0?Tr(b)?b.then(E=>(eR(E),E)):(eR(b),b):b}function c(b,E){const w=E.then(x=>{var R,S;return((S=((R=b.getState().nextTree)!==null&&R!==void 0?R:b.getState().currentTree).atomValues.get(t))===null||S===void 0?void 0:S.contents)===w&&U5(b,y,x),x}).catch(x=>{var R,S;throw((S=((R=b.getState().nextTree)!==null&&R!==void 0?R:b.getState().currentTree).atomValues.get(t))===null||S===void 0?void 0:S.contents)===w&&Oce(b,y,rR(x)),x});return w}function f(b,E,w){var x;i++;const R=()=>{var k;i--,(k=u.get(b))===null||k===void 0||k.forEach(F=>F()),u.delete(b)};if(b.getState().knownAtoms.add(t),o.state==="loading"){const k=()=>{var F;((F=b.getState().nextTree)!==null&&F!==void 0?F:b.getState().currentTree).atomValues.has(t)||Rce(b,y)};o.contents.finally(k)}const S=(x=e.effects)!==null&&x!==void 0?x:e.effects_UNSTABLE;if(S!=null){let A=function(T){if(F&&T.key===t){const D=k;return D instanceof au?d(b,E):Tr(D)?nR(D.then(O=>O instanceof au?o.toPromise():O)):Mc(D)}return Sce(b,T)},I=function(T){return A(T).toPromise()},L=function(T){var D;const O=bce(b,(D=b.getState().nextTree)!==null&&D!==void 0?D:b.getState().currentTree,T.key);return F&&T.key===t&&!(k instanceof au)?{...O,isSet:!0,loadable:A(T)}:O},k=il,F=!0,V=!1,P=null;const B=T=>D=>{if(F){const O=A(y),$=O.state==="hasValue"?O.contents:il;k=typeof D=="function"?D($):D,Tr(k)&&(k=k.then(q=>(P={effect:T,value:q},q)))}else{if(Tr(D))throw Pt("Setting atoms to async values is not implemented.");typeof D!="function"&&(P={effect:T,value:oh(D)}),U5(b,y,typeof D=="function"?O=>{const $=oh(D(O));return P={effect:T,value:$},$}:oh(D))}},H=T=>()=>B(T)(il),U=T=>D=>{var O;const{release:$}=b.subscribeToTransactions(q=>{var W;let{currentTree:z,previousTree:Y}=q.getState();Y||(Xn("Transaction subscribers notified without a next tree being present -- this is a bug in Recoil"),Y=z);const Q=(W=z.atomValues.get(t))!==null&&W!==void 0?W:o;if(Q.state==="hasValue"){var Z,re,ie,ee;const fe=Q.contents,ue=(Z=Y.atomValues.get(t))!==null&&Z!==void 0?Z:o,se=ue.state==="hasValue"?ue.contents:il;((re=P)===null||re===void 0?void 0:re.effect)!==T||((ie=P)===null||ie===void 0?void 0:ie.value)!==fe?D(fe,se,!z.atomValues.has(t)):((ee=P)===null||ee===void 0?void 0:ee.effect)===T&&(P=null)}},t);u.set(b,[...(O=u.get(b))!==null&&O!==void 0?O:[],$])};for(const T of S)try{const D=T({node:y,storeID:b.storeID,parentStoreID_UNSTABLE:b.parentStoreID,trigger:w,setSelf:B(T),resetSelf:H(T),onSet:U(T),getPromise:I,getLoadable:A,getInfo_UNSTABLE:L});if(D!=null){var j;u.set(b,[...(j=u.get(b))!==null&&j!==void 0?j:[],D])}}catch(D){k=D,V=!0}if(F=!1,!(k instanceof au)){var M;const T=V?rR(k):Tr(k)?nR(c(b,k)):Mc(oh(k));l(T.contents),E.atomValues.set(t,T),(M=b.getState().nextTree)===null||M===void 0||M.atomValues.set(t,T)}}return R}function d(b,E){var w,x;return(w=(x=E.atomValues.get(t))!==null&&x!==void 0?x:s)!==null&&w!==void 0?w:o}function h(b,E){if(E.atomValues.has(t))return zr(E.atomValues.get(t));if(E.nonvalidatedAtoms.has(t)){if(s!=null)return s;if(r==null)return MS(`Tried to restore a persisted value for atom ${t} but it has no persistence settings.`),o;const w=E.nonvalidatedAtoms.get(t),x=r.validator(w,il);return s=x instanceof au?o:Mc(x),s}else return o}function m(){s=void 0}function p(b,E,w){if(E.atomValues.has(t)){const x=zr(E.atomValues.get(t));if(x.state==="hasValue"&&w===x.contents)return new Map}else if(!E.nonvalidatedAtoms.has(t)&&w instanceof au)return new Map;return l(w),s=void 0,new Map().set(t,Mc(w))}function g(){return B5(t)!==void 0&&i<=0}const y=Ece({key:t,nodeType:"atom",peek:d,get:h,set:p,init:f,invalidate:m,shouldDeleteConfigOnRelease:g,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:n});return y}function iR(e){if(process.env.NODE_ENV!=="production"&&typeof e.key!="string")throw Pt("A key option with a unique string value must be provided when creating an atom.");const{...t}=e,r="default"in e?e.default:new Promise(()=>{});return xce(r)?Cce({...t,default:r}):Tce({...t,default:r})}function Cce(e){const t=iR({...e,default:il,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:n=>n instanceof au?n:zr(e.persistence_UNSTABLE).validator(n,il)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),r=ah({key:`${e.key}__withFallback`,get:({get:n})=>{const i=n(t);return i instanceof au?e.default:i},set:({set:n},i)=>n(t,i),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return wce(r.key,B5(e.key)),r}iR.value=e=>new q5(e);var Pce=iR;class Nce{constructor(t){var r;jt(this,"_map",void 0),jt(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(r=t?.mapKey)!==null&&r!==void 0?r:n=>n}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,r){this._map.set(this._keyMapper(t),r)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var Dce={MapCache:Nce},Ice=Dce.MapCache,kce=Object.freeze({__proto__:null,MapCache:Ice});const{LRUCache:z5}=I5,{MapCache:Mce}=kce,Yg={equality:"reference",eviction:"none",maxSize:1/0};function Lce({equality:e=Yg.equality,eviction:t=Yg.eviction,maxSize:r=Yg.maxSize}=Yg){const n=jce(e);return Fce(t,r,n)}function jce(e){switch(e){case"reference":return t=>t;case"value":return t=>JS(t)}throw Pt(`Unrecognized equality policy ${e}`)}function Fce(e,t,r){switch(e){case"keep-all":return new Mce({mapKey:r});case"lru":return new z5({mapKey:r,maxSize:zr(t)});case"most-recent":return new z5({mapKey:r,maxSize:1})}throw Pt(`Unrecognized eviction policy ${e}`)}var $ce=Lce;const{setConfigDeletionHandler:Vce}=Ha;let qce=0;function Bce(e){var t,r;const n=$ce({equality:(t=(r=e.cachePolicyForParams_UNSTABLE)===null||r===void 0?void 0:r.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return i=>{var a;let o;try{o=n.get(i)}catch(d){throw Pt(`Problem with cache lookup for selector ${e.key}: ${d.message}`)}if(o!=null)return o;const s=`${e.key}__selectorFamily/${(a=JS(i,{allowFunctions:!0}))!==null&&a!==void 0?a:"void"}/${qce++}`,u=d=>e.get(i)(d),l=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(i):e.retainedBy_UNSTABLE;let f;if(e.set!=null){const d=e.set;f=ah({key:s,get:u,set:(m,p)=>d(i)(m,p),cachePolicy_UNSTABLE:l,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else f=ah({key:s,get:u,cachePolicy_UNSTABLE:l,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return n.set(i,f),Vce(f.key,()=>{n.delete(i)}),f}}var al=Bce;al({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}}),al({key:"__error",get:e=>()=>{throw Pt(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});const{loadableWithError:W5,loadableWithPromise:H5,loadableWithValue:G5}=Yd;function Qg(e,t){const r=Array(t.length).fill(void 0),n=Array(t.length).fill(void 0);for(const[i,a]of t.entries())try{r[i]=e(a)}catch(o){n[i]=o}return[r,n]}function Uce(e){return e!=null&&!Tr(e)}function Xg(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function aR(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((r,n,i)=>({...r,[n]:t[i]}),{})}function Lc(e,t,r){const n=r.map((i,a)=>i==null?G5(t[a]):Tr(i)?H5(i):W5(i));return aR(e,n)}function zce(e,t){return t.map((r,n)=>r===void 0?e[n]:r)}al({key:"__waitForNone",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);return Lc(e,n,i)},dangerouslyAllowMutability:!0}),al({key:"__waitForAny",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);return i.some(a=>!Tr(a))?Lc(e,n,i):new Promise(a=>{for(const[o,s]of i.entries())Tr(s)&&s.then(u=>{n[o]=u,i[o]=void 0,a(Lc(e,n,i))}).catch(u=>{i[o]=u,a(Lc(e,n,i))})})},dangerouslyAllowMutability:!0}),al({key:"__waitForAll",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);if(i.every(o=>o==null))return aR(e,n);const a=i.find(Uce);if(a!=null)throw a;return Promise.all(i).then(o=>aR(e,zce(n,o)))},dangerouslyAllowMutability:!0}),al({key:"__waitForAllSettled",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);return i.every(a=>!Tr(a))?Lc(e,n,i):Promise.all(i.map((a,o)=>Tr(a)?a.then(s=>{n[o]=s,i[o]=void 0}).catch(s=>{n[o]=void 0,i[o]=s}):null)).then(()=>Lc(e,n,i))},dangerouslyAllowMutability:!0}),al({key:"__noWait",get:e=>({get:t})=>{try{return ah.value(G5(t(e)))}catch(r){return ah.value(Tr(r)?H5(r):W5(r))}},dangerouslyAllowMutability:!0});const{RecoilLoadable:NGe}=Yd,{RecoilRoot:Wce}=Vg,{isRecoilValue:DGe}=rl,{freshSnapshot:IGe}=$g,{useRecoilValue:Hce,useSetRecoilState:Gce}=ale,{useRecoilCallback:Kce}=C5;var sh={RecoilRoot:Wce,atom:Pce,useRecoilValue:Hce,useSetRecoilState:Gce,useRecoilCallback:Kce},Yce=sh.RecoilRoot,Qce=sh.atom,Xce=sh.useRecoilValue,Zce=sh.useSetRecoilState,Jce=sh.useRecoilCallback;const K5=K.createContext(null);function efe({adapter:e,children:t}){const[r]=K.useState({}),n=C.jsx(K5.Provider,{value:{stateFactory:r,adapter:e},children:t});return e.type==="recoilAdapter"?C.jsx(Yce,{children:n}):n}function tfe(){const e=K.useContext(K5);if(!e)throw new Error("useStateContext must be used within a StateProvider");return e}function Ka(e,t){const{stateFactory:r,adapter:n}=tfe();let i=r[e];if(!i){if(t===void 0)throw new Error(`State manager for key "${e}" does not exist and no initial value was provided.`);i=n.createState(t),r[e]=i}const[a,o]=K.useState(i.get());return K.useEffect(()=>{const u=i.subscribe(l=>{o(l)});return()=>u()},[i]),[a,u=>{typeof u=="function"?i.set(u(i.get())):Array.isArray(u)?i.set(u.filter(l=>l!==null)):i.set(u)}]}function Y5(){return window.innerHeight>window.innerWidth}function rfe(){const[e,t]=K.useState(Y5());return K.useEffect(()=>{function r(){t(Y5())}return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e}function nfe(){const[e,t]=K.useState(!document.hidden),r=()=>{t(!document.hidden)};return K.useEffect(()=>(document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)})),e}function oR(e,t){const[r,n]=K.useState(e),i=K.useRef(null);function a(o){i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{n(o)},t)}return[r,a]}const ife=1e3*30,afe=["mousedown","mousemove","wheel","keydown","touchstart","scroll"],ofe=(e,t)=>(e.forEach(r=>window.addEventListener(r,t,{passive:!0})),()=>{e.forEach(r=>window.removeEventListener(r,t))});function Q5(e=ife){const t=K.useRef(null),[r,n]=K.useState(!1),[i,a]=K.useState(!1),[o,s]=K.useState(!0),u=K.useCallback(()=>{!o||i||(t.current&&clearTimeout(t.current),n(!1),t.current=window.setTimeout(()=>{n(!0)},e))},[e,i,o]),l=()=>{a(!0),n(!0)},c=()=>{a(!1),u()},f=()=>{s(!1),n(!1),t.current&&clearTimeout(t.current)},d=()=>{s(!0),u()};return K.useEffect(()=>{if(!o)return;const m=ofe(afe,u);return u(),()=>{t.current&&clearTimeout(t.current),m()}},[u,o]),[r,{disableIdleMode:f,enableIdleMode:d,lockInIdleMode:l,unlockIdleMode:c}]}function jc(e){const[t,r]=K.useState(()=>matchMedia(e).matches);return K.useLayoutEffect(()=>{const n=matchMedia(e);function i(){r(n.matches)}return n.addEventListener("change",i),()=>{n.removeEventListener("change",i)}},[e]),t}var ts=(e=>(e[e.equal=1]="equal",e[e.greater=2]="greater",e[e.lessThan=3]="lessThan",e[e.like=4]="like",e[e.endsWith=5]="endsWith",e[e.startsWith=6]="startsWith",e[e.in=7]="in",e))(ts||{}),rs=(e=>(e[e.readOnly=1]="readOnly",e[e.search=2]="search",e[e.select=3]="select",e[e.multipleSelect=4]="multipleSelect",e[e.boolean=5]="boolean",e[e.date=6]="date",e[e.dateTime=7]="dateTime",e))(rs||{});const X5=K.createContext(null),Z5=K.createContext(null),J5=K.createContext(null),e4=K.createContext(null);function sR(){return K.useContext(X5)}function uR(){return K.useContext(Z5)}function lR(){return K.useContext(J5)}function cR(){return K.useContext(e4)}const Fc=(e,t,r="")=>btoa(`After=0${sfe(t)}${ufe(e)}${r?`&${r}`:""}`),sfe=e=>{const t="&Sort=";if(Object.keys(e).length===0)throw new Error("No sortings found");return Object.keys(e).reduce((r,n)=>{const i=e[n];return r===t?`${r}${i.name}:${i.direction}`:`${r},${i.name}:${i.direction}`},t)},ufe=e=>{if(Object.keys(e).length===0)return"";const t="&Filter=[";return Object.keys(e).reduce((r,n,i)=>{const a=e[n];if(!a.value||a.value.length===0)return r;if(a.names.length===1)return r===t?`${r}{"${a.names[0]}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`:`${r},{"${a.names[0]}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`;const o=a.names.reduce((s,u)=>s===""?`${s}{"${u}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`:`${s},{"${u}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`,"");return r===t?`${r}${o}`:`${r},${o}`},t)+"]"};function Zg(e){switch(e){case ts.equal:return"eq";case ts.greater:return"gt";case ts.lessThan:return"lt";case ts.like:return"like";case ts.endsWith:return"like*";case ts.startsWith:return"*like";case ts.in:return"in";default:throw`Operator ${e} unknown`}}function t4({children:e,contextKey:t,defaultSorting:r,defaultFilters:n,defaultPersistance:i,canTogglePersistance:a}){function o(){if(!i||a&&!localStorage.getItem(t)&&!Object.values(n).find(k=>k.isShared))return n;let S={...n};const j=Object.keys(n).filter(k=>n[k].isShared);if(j.length>0){const k=localStorage.getItem("sharedFilters")??"{}";let F=JSON.parse(k);S=j.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:n[P]},V),S),localStorage.setItem("sharedFilters",JSON.stringify(F))}const M=Object.keys(n).filter(k=>!n[k].isShared);if(M.length>0){const k=localStorage.getItem(t)??"{}";let F=JSON.parse(k);S=M.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:n[P]},V),S),localStorage.setItem(t,JSON.stringify(F))}return S}function s(){if(!i||a&&!localStorage.getItem(t)&&!Object.values(r).find(k=>k.isShared))return r;let S={...r};const j=Object.keys(r).filter(k=>r[k].isShared);if(j.length>0){const k=localStorage.getItem("sharedSortings")??"{}";let F=JSON.parse(k);S=j.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:r[P]},V),S),localStorage.setItem("sharedSortings",JSON.stringify(F))}const M=Object.keys(r).filter(k=>!r[k].isShared);if(M.length>0){const k=localStorage.getItem(t)??"{}";let F=JSON.parse(k);S=M.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:r[P]},V),S),localStorage.setItem(t,JSON.stringify(F))}return S}const[u,l]=K.useState(o),[c,f]=K.useState(s),[d,h]=K.useState(()=>Fc(u,c,t)),[m,p]=K.useState(i),[g,y]=K.useState(t);K.useEffect(()=>y(t),[t]),K.useEffect(()=>l(o),[n]),K.useEffect(()=>f(s),[r]),K.useEffect(()=>h(Fc(n,r,t)),[t]);const b=K.useCallback(()=>{throw a&&(m&&localStorage.removeItem(t),p(!m)),new Error("Context is not configured to allow persistance toggle")},[]),E=K.useMemo(()=>({settings:{currentPersistance:m,canToggle:a,contextKey:t},setPersistance:b}),[m,t]),w=K.useMemo(()=>({filters:u,setFilters:l}),[u,t]),x=K.useMemo(()=>({sortings:c,setSortings:f}),[c,t]),R=K.useMemo(()=>({cursor:g!==t?Fc(n,r,t):d,updateCursor:()=>{h(()=>Fc(u,c,t))},updateRawCursor:(S,j)=>{const M=Fc(S,j,t);h(M)}}),[d,w,x,n,r,t]);return C.jsx(e4.Provider,{value:E,children:C.jsx(X5.Provider,{value:w,children:C.jsx(Z5.Provider,{value:x,children:C.jsx(J5.Provider,{value:R,children:e})})})})}function fR(){const e=sR(),t=uR(),r=lR(),n=cR();if(!e||!t||!r||!n)throw new Error("usePagination must be used within PaginationProvider");return{getFilterValue:u=>{const{filters:l}=e;return l[u].value},updateFilters:(u,l=!1)=>{const c={...e.filters,...u};e.setFilters(c);const f=Object.keys(c).filter(d=>c[d].isShared);if(f.length>0){const d=localStorage.getItem("sharedFilters")??"{}",h=JSON.parse(d),m=f.reduce((p,g)=>({...p,[g]:c[g]}),{...h});localStorage.setItem("sharedFilters",JSON.stringify(m))}if(n.settings.currentPersistance){const d=Object.keys(c).filter(g=>!c[g].isShared),h=localStorage.getItem(n.settings.contextKey)??"{}",m=JSON.parse(h),p=d.reduce((g,y)=>({...g,[y]:c[y]}),{...m});localStorage.setItem(n.settings.contextKey,JSON.stringify(p))}l&&r.updateRawCursor(c,t.sortings)},getSortingValue:u=>{const{sortings:l}=t;return l[u].direction},updateSortings:(u,l=!1)=>{const c={...t.sortings,...u};t.setSortings(c);const f=Object.keys(c).filter(d=>c[d].isShared);if(f.length>0){const d=localStorage.getItem("sharedSortings"),h=d?JSON.parse(d):{},m=f.reduce((p,g)=>({...p,[g]:h[g]}),{...h});localStorage.setItem("sharedSortings",JSON.stringify(m))}if(n.settings.currentPersistance){const d=Object.keys(c).filter(g=>!c[g].isShared),h=localStorage.getItem(n.settings.contextKey),m=h?JSON.parse(h):{},p=d.reduce((g,y)=>({...g,[y]:m[y]}),{...m});localStorage.setItem(n.settings.contextKey,JSON.stringify(p))}l&&r.updateRawCursor(e.filters,c)}}}function lfe(e=99){const[t,r]=K.useState(!1),[n,i]=K.useState(!1),[a,o]=K.useState([]),[s,u]=Ka("tagDistance",0);window.stopRunningLocate=function(){window.rfid.stop()};const l=b=>{try{h(0,"Beginning enumerate");const E=JSON.stringify(b);h(0,`readerID = ${E}`),window.rfid.readerID=b.RFID_Array[0].ID,i(!0),h(0,"Finished enumerate")}catch(E){i(!1),h(3,String(E))}};function c(b){console.log(b),b&&(b.errorCode,b.errorCode==1e3&&b?.vendorMessage==="CONNECTION_EVENT"?(h(0,"Connection event"),m()):h(3,`Error code: ${b.errorCode} Vendor message: ${b.vendorMessage}`))}K.useEffect(()=>{h(0,"Beginning connect"),n&&window.rfid.connect(),h(0,"Finished connect")},[n]);function f(){h(1,n.toString()),h(1,window.rfid),!n&&window.rfid&&(h(0,"Mount hook"),window.onEnumerate=l,window.statusLogger=c,window.rfid.statusEvent="statusLogger(%json);",h(0,`Set statusEvent = ${window.rfid.statusEvent}`),window.rfid.enumRFIDEvent="onEnumerate(%json);",h(0,`Set reportTrigger = ${window.rfid.reportTrigger}`),window.rfid.enumerate())}function d(){window.rfid&&(h(0,"Unomunt hook"),window.scanSingleRfidHandler=()=>{},window.rfid.tagEvent="",window._locate=void 0,window._inventory=()=>{},window.onEnumerate=()=>{},window.rfid.tagID="",h(0,"Stopping rfid"),window.rfid.stop(),h(0,"Rfid stopped"),h(0,"Disconnecting"),window.rfid.disconnect(),h(0,"Disconnected"),r(!1),i(!1))}K.useEffect(()=>{h(0,`isConnected = ${t}`)},[t]);function h(b,E){if(e<=b){let w="";switch(b){case 0:w="Trace -";break;case 1:w="Information -";break;case 2:w="Warning -";break;case 3:w="Error -";break;default:w="Unknown -"}o(x=>[...x,`${w} ${E}`])}}function m(){r(!0)}function p(b){window.rfid.reportTrigger=1,window.rfid.useSoftTrigger=0,window.rfid.reportUniqueTags="false",window.rfid.transport="serial",window.rfid.beepOnRead=1,window.rfid.lowerTriggerType="RFID_SCAN",window.rfid.upperTriggerType="RFID_SCAN",window.rfid.startTriggerType="triggerPress",window.rfid.stopTriggerType="triggerRelease",t&&(window.scanSingleRfidHandler=E=>{const w=E.TagData[0].tagID,x=JSON.stringify(E);h(0,`data = ${x}`),b(w)},window.rfid.tagEvent="scanSingleRfidHandler(%json);")}function g(b){window.rfid.tagEvent="TagLocateHandler(%json)";function E(w){u(w.TagLocate)}window.rfid.reportUniqueTags="false",window.rfid.transport="serial",window.rfid.reportTrigger=0,window.TagLocateHandler=E,window.rfid.beepOnRead=1,window.rfid.lowerTriggerType="NO_ACTION",window.rfid.upperTriggerType="NO_ACTION",window.rfid.startTriggerType="immediate",window.rfid.useSoftTrigger=0,window.rfid.antennaSelected=1,window.rfid.tagID=b,window.rfid.locateTag()}function y(b){try{t&&(h(0,"Beginning inventoryScan"),window.rfid.reportTrigger=0,window.rfid.useSoftTrigger=0,window.rfid.reportUniqueTags="true",window.rfid.transport="serial",window.rfid.beepOnRead=1,window.rfid.lowerTriggerType="RFID_SCAN",window.rfid.upperTriggerType="RFID_SCAN",window.rfid.startTriggerType="triggerPress",window.rfid.stopTriggerType="triggerRelease",window._inventory=E=>{b(E.TagData),h(0,`data = ${E.TagData[0].tagID}`),h(0,`datacomplete = ${E}`)},window.rfid.tagEvent="_inventory(%json);",h(0,`tagEvent = ${window.rfid.tagEvent}`),h(0,"Ended inventoryScan"))}catch(E){h(3,String(E))}}return{locateTag:g,inventoryScan:y,isConnected:t,canConnect:n,debugLog:a,mount:f,unMount:d,logDebug:h,scanSingleElement:p}}function Jg(e=".scrollable-container"){const t=new Map;K.useEffect(()=>{const r=document.querySelectorAll(e),n=a=>{a.classList.add("show-scrollbar"),setTimeout(()=>{a.classList.remove("show-scrollbar")},2e3)},i=a=>{a.classList.add("show-scrollbar"),t.has(a)&&clearTimeout(t.get(a));const o=window.setTimeout(()=>{a.classList.remove("show-scrollbar")},1e3);t.set(a,o)};return r.forEach(a=>{n(a);const o=()=>i(a);return a.addEventListener("scroll",o),()=>{a.removeEventListener("scroll",o),t.has(a)&&clearTimeout(t.get(a))}}),()=>{t.forEach(a=>clearTimeout(a))}},[e])}function r4({bufferName:e,callback:t}){const[r,n]=K.useState("- - - - - - - -"),[i,a]=K.useState(!1),[o,s]=K.useState(0),[u,l]=K.useState([]),c=K.useRef("- - - - - - - -"),f=K.useRef(null),d=x=>{const R=JSON.parse(localStorage.getItem(e)||"[]");!R.includes(x)&&x!=="- - - - - - - -"&&(R.push(x),localStorage.setItem(e,JSON.stringify(R)))},h=x=>{const S=JSON.parse(localStorage.getItem(e)||"[]").filter(j=>j!==x);localStorage.setItem(e,JSON.stringify(S))},m=x=>{n(c.current);const R=c.current;if(x!=="- - - - - - - -"&&typeof x=="string"){const S=t(c.current);if(S instanceof Promise)S.then(j=>{l(M=>[...M,j]),h(c.current)}).catch(()=>{d(R),p()});else return S}},p=()=>{const x=e,R=localStorage.getItem(x);if(R){const S=setInterval(async()=>{const j=o;if(j>=9){clearInterval(S);return}await g(JSON.parse(R))?(clearInterval(S),s(0)):s(j+1)},5e3);return()=>clearInterval(S)}},g=async x=>{let R=!0;for(const S of x)try{const j=await t(S);if(j instanceof Promise)j.then(M=>{l(k=>[...k,M])}),h(S);else return j}catch(j){console.trace("Error:",S,j),R=!1}return R},y=x=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{m(x),c.current="- - - - - - - -"},250)},b=K.useCallback(x=>{!x.repeat&&x.key.length===1&&x.key!=="Unidentified"&&(c.current==="- - - - - - - -"?c.current=x.key:(c.current+=x.key,y(c.current)))},[]),E={activateScanner:()=>{window.addEventListener("keydown",b),a(!0),w(),console.log(`${e} scanner activated`)},disableScanner:()=>{window.removeEventListener("keydown",b),a(!1),console.log(`${e} scanner disabled`)}},w=()=>{c.current="- - - - - - - -"};return{lastScanned:r,scannerActions:E,isScannerActive:i,labelRead:u}}const n4=K.createContext(void 0);function i4(){const e=K.useContext(n4);if(e===void 0)throw new Error("BreadCrumbContext must be used within an BreadCrumbProvider");return e}function a4(){const[e,t]=Ka("hotKeysDialogState",!1),r=K.useCallback(()=>{t(o=>!o)},[t]),n=K.useCallback(()=>{t(!1)},[t]),i=K.useCallback(()=>{t(!0)},[t]),a=K.useMemo(()=>({toggle:r,close:n,open:i}),[r,n,i]);return[e,a]}function dR(e){const[t,r]=Ka("languageDialogState",!1),[n]=Ka("languageDialogPopover",!1),{i18n:i}=Qt(),a=i.resolvedLanguage??"",o=K.useCallback(()=>{r(!1)},[r]),s=K.useCallback(()=>{r(!0)},[r]),u=K.useCallback(()=>{r(!0);const c=Object.keys(e),f=c.indexOf(a);let d;f!==-1&&f<c.length-1?d=c[f+1]:d=c[0],i.changeLanguage(d)},[r,i,a,e]),l=K.useMemo(()=>({close:o,open:s,toggle:u}),[o,s,u]);return[t,l,n]}const o4=Qn(Iee,{shouldForwardProp:e=>e==="children"||e==="elevation"||e==="variant"})(({theme:e,backgroundColor:t,blur:r,saturate:n="180%",color:i,borderRadius:a="24px",border:o,padding:s="2vw",width:u="100%",height:l="100%",marginLeft:c="auto",marginRight:f="auto",marginTop:d="auto",marginBottom:h="auto",style:m={}})=>({display:"flex",flexDirection:"column",width:u,height:l,backgroundColor:t||e.palette.background.paper,backdropFilter:r&&`blur(${r}) saturate(${n})`,color:i||e.palette.primary.main,border:o,padding:s,borderRadius:a,marginLeft:c,marginRight:f,marginTop:d,marginBottom:h,...m}));function s4({children:e,value:t,index:r,styles:n}){return C.jsx(Gv,{id:`tabpanel-${r}`,role:"tabpanel","aria-labelledby":`tab-${r}`,display:t!==r?"none":"flex",sx:n,children:e})}function u4({tabs:e,value:t,onChange:r,color:n="primary.main",textColor:i="inherit",fullWidth:a=!1,size:o="medium",height:s,width:u}){const{t:l}=Qt(),c=(f,d)=>{d!==null&&r(f,d)};return C.jsx(Se.ToggleButtonGroup,{value:t,exclusive:!0,onChange:c,fullWidth:a,"aria-label":"toggle buttons as custom rounded tabs",children:e.map((f,d)=>C.jsx(Se.ToggleButton,{disableRipple:!0,disableFocusRipple:!0,size:o,value:typeof f=="string"?d:f?.value,selected:typeof f=="string"?t===d:t===f?.value,sx:{height:s,width:u,fontWeight:600,minWidth:"160px",textTransform:"capitalize","&.Mui-selected":{color:i,backgroundColor:n,transition:"background-color 0.2s ease-in-out",":hover":{backgroundColor:n}},borderRadius:d===0?"24px 0px 0px 24px":d===e.length-1?"0px 24px 24px 0px":void 0},children:C.jsxs(Kr,{gap:"4px",alignItems:"center",children:[typeof f!="string"&&f?.icon?f?.icon:typeof f=="string"?t===d&&C.jsx(v1,{}):t===f?.value&&C.jsx(v1,{}),l(typeof f=="string"?f:f?.label)]})},typeof f=="string"?f:f?.label))})}function l4({tabs:e,value:t,onChange:r,color:n="primary.main",textColor:i="inherit",fullWidth:a=!1}){const{t:o}=Qt();return C.jsx(Se.Tabs,{value:t,onChange:r,"aria-label":"custom tabs",variant:"scrollable",scrollButtons:e.length>3,slotProps:{indicator:{children:C.jsx("span",{className:"MuiTabs-indicatorSpan"})}},sx:{"& .Mui-selected":{color:`${i}!important`},"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:n}},children:e.map((s,u)=>C.jsx(Se.Tab,{value:typeof s=="string"?u:s?.value,id:typeof s=="string"?s:s?.label,label:o(typeof s=="string"?s:s?.label),"aria-controls":`tabPanel-${u}`,icon:typeof s=="string"?void 0:s?.icon,sx:a?{minWidth:"fit-content",flex:1}:{}},typeof s=="string"?s:s?.label))})}function c4({tabs:e,value:t,onChange:r,color:n,textColor:i="inherit",variant:a="standard",fullWidth:o=!1,size:s="medium"}){return a==="rounded"?C.jsx(u4,{tabs:e,value:t,onChange:r,color:n,fullWidth:o,size:s,textColor:i}):C.jsx(l4,{tabs:e,value:t,onChange:r,color:n,textColor:i,fullWidth:o})}function cfe({doLogin:e,pendingLogin:t,doLogout:r,pendingLogout:n}){const i=Rg([]),a=Og(),o=[f=>{const d={credentials:{username:f.get("username")?.toString()||"",password:f.get("password")?.toString()||"",rFID:f.get("rfid")?.toString()||"",client_id:a.CLIENT_ID}};e({variables:d,onCompleted:h=>{const m=h.authMutation.login,{expires:p,token:g,errors:y,username:b}=m;if(y&&y.length>0){i.set((m.errors??[]).map(({code:E,description:w})=>({code:E,description:w})));return}a.AUTH_SCHEMA!=="Cookies"&&g&&localStorage.setItem("token",`Bearer ${g}`),p&&localStorage.setItem("authExpiration",p),b&&localStorage.setItem("username",b)}})},t],s=[()=>{r({variables:{},onCompleted:()=>{localStorage.removeItem("token"),localStorage.removeItem("authExpiration"),localStorage.removeItem("username")}})},n],u=localStorage.getItem("authExpiration")!==void 0&&localStorage.getItem("authExpiration")!==null&&new Date(localStorage.getItem("authExpiration")).getTime()>new Date().getTime(),l=!!(a.AUTH_SCHEMA!=="Cookies"?localStorage.getItem("token")&&u:u),c={login:o,logout:s,removeError:i.remove};return[l,i.value,c]}const f4=K.createContext(null);function ffe({children:e,doLogin:t,pendingLogin:r,doLogout:n,pendingLogout:i}){const[a,o,{login:s,logout:u,removeError:l}]=cfe({doLogin:t,pendingLogin:r,doLogout:n,pendingLogout:i});return C.jsx(f4.Provider,{value:[a,o,{login:s,logout:u,removeError:l}],children:e})}function d4(){const e=K.useContext(f4);if(e===null)throw new Error("useAuthContext must be used within an AuthProvider");return e}const h4={tabPanel:{width:"100%",flexDirection:"column",justifyContent:"flex-end",padding:"18px 0px 0px px",gap:"32px",flexGrow:1},contentFadeOut:{transition:"opacity 0.5s ease-out",opacity:0,pointerEvents:"none"}};function dfe({ChangePasswordWidget:e,children:t,title:r,tabs:n,backgroundColor:i,blur:a,elevation:o,color:s,borderRadius:u,border:l,padding:c,width:f,height:d,redirect:h=!0,redirectPath:m="/",loggedCallback:p,logo:g}){const{t:y}=Qt(),[b,E]=K.useState(!1),[w,x,{login:R,removeError:S}]=d4(),j=jc("(min-height:700px)"),[M,k]=R,[F,V]=K.useState(0),[P,A]=K.useState(!1),[I,L]=K.useState(!1),[B,H]=K.useState(!1),U=(T,D)=>{V(D)};return K.useEffect(()=>{x.length>0&&x.find(({code:T})=>T==="PASSWORD_EXPIRED")&&E(!0)},[x]),K.useEffect(()=>{p&&w&&p()},[w,p]),K.useEffect(()=>{const T=x.map((D,O)=>setTimeout(()=>S(O),2e3));return()=>{T.forEach(clearTimeout)}},[x,S]),K.useEffect(()=>{if(w&&h){L(!0);const T=setTimeout(()=>{A(!0)},500),D=setTimeout(()=>{H(!0)},2500);return()=>{clearTimeout(T),clearTimeout(D)}}},[w,h]),w&&h&&B?C.jsx(cre,{to:m,replace:!0}):C.jsxs(C.Fragment,{children:[P?C.jsx(Sg,{}):null,C.jsx(o4,{elevation:o,variant:o!==void 0?"elevation":"outlined",blur:a,border:l,color:s,backgroundColor:i,borderRadius:u,padding:c,width:P?"0px":f,height:P?"0px":d,style:I?h4.contentFadeOut:{flexGrow:0},children:C.jsxs(AS,{height:"100%",marginTop:"auto",marginBottom:"auto",justifyContent:"space-between",children:[n&&C.jsx(Kr,{borderBottom:"1px solid",borderColor:"divider",children:n&&n.length>0&&C.jsx(c4,{value:F,onChange:U,tabs:n,color:s})}),x.length>0&&C.jsx(Se.Stack,{spacing:1,sx:{padding:"16px",minHeight:"20%",justifyContent:"center"},children:x.map(({code:T,description:D},O)=>C.jsx(Se.Alert,{variant:"filled",severity:"error",onClose:()=>S(O),children:y(T||D)},T))}),C.jsx(Kr,{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",flex:1},children:C.jsx("img",{src:g,alt:"Logo",width:j?"60px":"40px"})}),C.jsx(Kr,{flex:1,alignContent:"center",flexDirection:"column",children:C.jsx(Se.Typography,{variant:j?"h4":"h5",sx:{fontWeight:300,textAlign:"center",marginTop:"auto",marginBottom:"auto"},children:r})}),C.jsx("form",{id:"authForm",action:M,children:b&&e?C.jsx(e,{pending:k}):n&&n.length>0?n.map(({label:T,child:D},O)=>C.jsx(s4,{value:F,index:O,styles:h4.tabPanel,children:C.jsx(D,{pending:k})},T)):t})]})})]})}const Ct=e=>typeof e=="string",uh=()=>{let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r},p4=e=>e==null?"":""+e,hfe=(e,t,r)=>{e.forEach(n=>{t[n]&&(r[n]=t[n])})},pfe=/###/g,v4=e=>e&&e.indexOf("###")>-1?e.replace(pfe,"."):e,g4=e=>!e||Ct(e),lh=(e,t,r)=>{const n=Ct(t)?t.split("."):t;let i=0;for(;i<n.length-1;){if(g4(e))return{};const a=v4(n[i]);!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++i}return g4(e)?{}:{obj:e,k:v4(n[i])}},m4=(e,t,r)=>{const{obj:n,k:i}=lh(e,t,Object);if(n!==void 0||t.length===1){n[i]=r;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=lh(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=lh(e,o,Object),s?.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},vfe=(e,t,r,n)=>{const{obj:i,k:a}=lh(e,t,Object);i[a]=i[a]||[],i[a].push(r)},em=(e,t)=>{const{obj:r,k:n}=lh(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},gfe=(e,t,r)=>{const n=em(e,r);return n!==void 0?n:em(t,r)},y4=(e,t,r)=>{for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?Ct(e[n])||e[n]instanceof String||Ct(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):y4(e[n],t[n],r):e[n]=t[n]);return e},$c=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var mfe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const yfe=e=>Ct(e)?e.replace(/[&<>"'\/]/g,t=>mfe[t]):e;class _fe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}const bfe=[" ",",","?","!",";"],Efe=new _fe(20),wfe=(e,t,r)=>{t=t||"",r=r||"";const n=bfe.filter(o=>t.indexOf(o)<0&&r.indexOf(o)<0);if(n.length===0)return!0;const i=Efe.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(e);if(!a){const o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a},hR=(e,t,r=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const n=t.split(r);let i=e;for(let a=0;a<n.length;){if(!i||typeof i!="object")return;let o,s="";for(let u=a;u<n.length;++u)if(u!==a&&(s+=r),s+=n[u],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&u<n.length-1)continue;a+=u-a+1;break}i=o}return i},ch=e=>e?.replace("_","-"),xfe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class tm{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||xfe,this.options=r,this.debug=r.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(Ct(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new tm(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new tm(this.logger,t)}}var wo=new tm;let rm=class{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,a])=>{for(let o=0;o<a;o++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,a])=>{for(let o=0;o<a;o++)i.apply(i,[t,...r])})}};class _4 extends rm{constructor(t,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n,i={}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,r],n&&(Array.isArray(n)?s.push(...n):Ct(n)&&a?s.push(...n.split(a)):s.push(n)));const u=em(this.data,s);return!u&&!r&&!n&&t.indexOf(".")>-1&&(t=s[0],r=s[1],n=s.slice(2).join(".")),u||!o||!Ct(n)?u:hR(this.data?.[t]?.[r],n,a)}addResource(t,r,n,i,a={silent:!1}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[t,r];n&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(s=t.split("."),i=r,r=s[1]),this.addNamespaces(r),m4(this.data,s,i),a.silent||this.emit("added",t,r,n,i)}addResources(t,r,n,i={silent:!1}){for(const a in n)(Ct(n[a])||Array.isArray(n[a]))&&this.addResource(t,r,a,n[a],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,a,o={silent:!1,skipCopy:!1}){let s=[t,r];t.indexOf(".")>-1&&(s=t.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let u=em(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?y4(u,n,a):u={...u,...n},m4(this.data,s,u),o.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var b4={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(a=>{t=this.processors[a]?.process(t,r,n,i)??t}),t}};const E4={},w4=e=>!Ct(e)&&typeof e!="boolean"&&typeof e!="number";class nm extends rm{constructor(t,r={}){super(),hfe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wo.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const n={...r};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const o=n&&t.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!wfe(t,n,i);if(o&&!s){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:Ct(a)?[a]:a};const l=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),t=l.join(i)}return{key:t,namespaces:Ct(a)?[a]:a}}translate(t,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(i={...i}),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:u}=this.extractFromKey(t[t.length-1],i),l=u[u.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=i.lng||this.language,d=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode")return d?a?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${c}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;const h=this.resolve(t,i);let m=h?.res;const p=h?.usedKey||s,g=h?.exactUsedKey||s,y=["[object Number]","[object Function]","[object RegExp]"],b=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,w=i.count!==void 0&&!Ct(i.count),x=nm.hasDefaultValue(i),R=w?this.pluralResolver.getSuffix(f,i.count,i):"",S=i.ordinal&&w?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",j=w&&!i.ordinal&&i.count===0,M=j&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${R}`]||i[`defaultValue${S}`]||i.defaultValue;let k=m;E&&!m&&x&&(k=M);const F=w4(k),V=Object.prototype.toString.apply(k);if(E&&k&&F&&y.indexOf(V)<0&&!(Ct(b)&&Array.isArray(k))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,k,{...i,ns:u}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(h.res=P,h.usedParams=this.getUsedParamsDetails(i),h):P}if(o){const P=Array.isArray(k),A=P?[]:{},I=P?g:p;for(const L in k)if(Object.prototype.hasOwnProperty.call(k,L)){const B=`${I}${o}${L}`;x&&!m?A[L]=this.translate(B,{...i,defaultValue:w4(M)?M[L]:void 0,joinArrays:!1,ns:u}):A[L]=this.translate(B,{...i,joinArrays:!1,ns:u}),A[L]===B&&(A[L]=k[L])}m=A}}else if(E&&Ct(b)&&Array.isArray(m))m=m.join(b),m&&(m=this.extendTranslation(m,t,i,n));else{let P=!1,A=!1;!this.isValidLookup(m)&&x&&(P=!0,m=M),this.isValidLookup(m)||(A=!0,m=s);const L=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:m,B=x&&M!==m&&this.options.updateMissing;if(A||P||B){if(this.logger.log(B?"updateKey":"missingKey",f,l,s,B?M:m),o){const D=this.resolve(s,{...i,keySeparator:!1});D&&D.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let D=0;D<U.length;D++)H.push(U[D]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(i.lng||this.language):H.push(i.lng||this.language);const T=(D,O,$)=>{const q=x&&$!==m?$:L;this.options.missingKeyHandler?this.options.missingKeyHandler(D,l,O,q,B,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(D,l,O,q,B,i),this.emit("missingKey",D,l,O,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?H.forEach(D=>{const O=this.pluralResolver.getSuffixes(D,i);j&&i[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach($=>{T([D],s+$,i[`defaultValue${$}`]||M)})}):T(H,s,M))}m=this.extendTranslation(m,t,i,h,n),A&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${c}${s}`),(A||P)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,P?m:void 0,i))}return a?(h.res=m,h.usedParams=this.getUsedParamsDetails(i),h):m}extendTranslation(t,r,n,i,a){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=Ct(t)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(u){const f=t.match(this.interpolator.nestingRegexp);l=f&&f.length}let c=n.replace&&!Ct(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),t=this.interpolator.interpolate(t,c,n.lng||this.language||i.usedLng,n),u){const f=t.match(this.interpolator.nestingRegexp),d=f&&f.length;l<d&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,(...f)=>a?.[0]===f[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${r[0]}`),null):this.translate(...f,r),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,s=Ct(o)?[o]:o;return t!=null&&s?.length&&n.applyPostProcessor!==!1&&(t=b4.handle(s,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t,r={}){let n,i,a,o,s;return Ct(t)&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(u,r),c=l.key;i=c;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const d=r.count!==void 0&&!Ct(r.count),h=d&&!r.ordinal&&r.count===0,m=r.context!==void 0&&(Ct(r.context)||typeof r.context=="number")&&r.context!=="",p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);f.forEach(g=>{this.isValidLookup(n)||(s=g,!E4[`${p[0]}-${g}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(E4[`${p[0]}-${g}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(y=>{if(this.isValidLookup(n))return;o=y;const b=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,c,y,g,r);else{let w;d&&(w=this.pluralResolver.getSuffix(y,r.count,r));const x=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(b.push(c+w),r.ordinal&&w.indexOf(R)===0&&b.push(c+w.replace(R,this.options.pluralSeparator)),h&&b.push(c+x)),m){const S=`${c}${this.options.contextSeparator}${r.context}`;b.push(S),d&&(b.push(S+w),r.ordinal&&w.indexOf(R)===0&&b.push(S+w.replace(R,this.options.pluralSeparator)),h&&b.push(S+x))}}let E;for(;E=b.pop();)this.isValidLookup(n)||(a=E,n=this.getResource(y,g,E,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!Ct(t.replace);let i=n?t.replace:t;if(n&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}class x4{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wo.create("languageUtils")}getScriptPartFromCode(t){if(t=ch(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=ch(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(Ct(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(o=>{if(o===a)return o;if(!(o.indexOf("-")<0&&a.indexOf("-")<0)&&(o.indexOf("-")>0&&a.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===a||o.indexOf(a)===0&&a.length>1))return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),Ct(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Ct(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):Ct(t)&&a(this.formatLanguageCode(t)),n.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}const S4={zero:0,one:1,two:2,few:3,many:4,other:5},R4={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Sfe{constructor(t,r={}){this.languageUtils=t,this.options=r,this.logger=wo.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,r){this.rules[t]=r}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const n=ch(t==="dev"?"en":t),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),R4;if(!t.match(/-|_/))return R4;const u=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(u,r)}return this.pluralRulesCache[a]=o,o}needsPlural(t,r={}){let n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,r,n={}){return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t,r={}){let n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>S4[i]-S4[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,r,n={}){const i=this.getRule(t,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,n))}}const O4=(e,t,r,n=".",i=!0)=>{let a=gfe(e,t,r);return!a&&i&&Ct(r)&&(a=hR(e,r,n),a===void 0&&(a=hR(t,r,n))),a},pR=e=>e.replace(/\$/g,"$$$$");class Rfe{constructor(t={}){this.logger=wo.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:u,formatSeparator:l,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:b}=t.interpolation;this.escape=r!==void 0?r:yfe,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?$c(a):o||"{{",this.suffix=s?$c(s):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?$c(d):h||$c("$t("),this.nestingSuffix=m?$c(m):p||$c(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,n)=>r?.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,r,n,i){let a,o,s;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=h=>{if(h.indexOf(this.formatSeparator)<0){const y=O4(r,u,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,n,{...i,...r,interpolationkey:h}):y}const m=h.split(this.formatSeparator),p=m.shift().trim(),g=m.join(this.formatSeparator).trim();return this.format(O4(r,u,p,this.options.keySeparator,this.options.ignoreJSONStructure),g,n,{...i,...r,interpolationkey:p})};this.resetRegExp();const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>pR(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?pR(this.escape(h)):pR(h)}].forEach(h=>{for(s=0;a=h.regex.exec(t);){const m=a[1].trim();if(o=l(m),o===void 0)if(typeof c=="function"){const g=c(t,a,i);o=Ct(g)?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(f){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),o="";else!Ct(o)&&!this.useRawValueToEscape&&(o=p4(o));const p=h.safeValue(o);if(t=t.replace(a[0],p),f?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=a[0].length):h.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r,n={}){let i,a,o;const s=(u,l)=>{const c=this.nestingOptionsSeparator;if(u.indexOf(c)<0)return u;const f=u.split(new RegExp(`${c}[ ]*{`));let d=`{${f[1]}`;u=f[0],d=this.interpolate(d,o);const h=d.match(/'/g),m=d.match(/"/g);((h?.length??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{o=JSON.parse(d),l&&(o={...l,...o})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,p),`${u}${c}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,u};for(;i=this.nestingRegexp.exec(t);){let u=[];o={...n},o=o.replace&&!Ct(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(l!==-1&&(u=i[1].slice(l).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,l)),a=r(s.call(this,i[1].trim(),o),o),a&&i[0]===t&&!Ct(a))return a;Ct(a)||(a=p4(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),a=""),u.length&&(a=u.reduce((c,f)=>this.format(c,f,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),t=t.replace(i[0],a),this.regexp.lastIndex=0}return t}}const Ofe=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...u]=o.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),c=s.trim();r[c]||(r[c]=l),l==="false"&&(r[c]=!1),l==="true"&&(r[c]=!0),isNaN(l)||(r[c]=parseInt(l,10))}})}return{formatName:t,formatOptions:r}},A4=e=>{const t={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=n+JSON.stringify(a);let s=t[o];return s||(s=e(ch(n),i),t[o]=s),s(r)}},Afe=e=>(t,r,n)=>e(ch(r),n)(t);class Tfe{constructor(t={}){this.logger=wo.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?A4:Afe;this.formats={number:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a});return s=>o.format(s)}),currency:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a,style:"currency"});return s=>o.format(s)}),datetime:n((i,a)=>{const o=new Intl.DateTimeFormat(i,{...a});return s=>o.format(s)}),relativetime:n((i,a)=>{const o=new Intl.RelativeTimeFormat(i,{...a});return s=>o.format(s,a.range||"day")}),list:n((i,a)=>{const o=new Intl.ListFormat(i,{...a});return s=>o.format(s)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=A4(r)}format(t,r,n,i={}){const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(u=>u.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,u)=>{const{formatName:l,formatOptions:c}=Ofe(u);if(this.formats[l]){let f=s;try{const d=i?.formatParams?.[i.interpolationkey]||{},h=d.locale||d.lng||i.locale||i.lng||n;f=this.formats[l](s,h,{...c,...i,...d})}catch(d){this.logger.warn(d)}return f}else this.logger.warn(`there was no format function for ${l}`);return s},t)}}const Cfe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Pfe extends rm{constructor(t,r,n,i={}){super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=wo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,i.backend,i)}queueLoad(t,r,n,i){const a={},o={},s={},u={};return t.forEach(l=>{let c=!0;r.forEach(f=>{const d=`${l}|${f}`;!n.reload&&this.store.hasResourceBundle(l,f)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,c=!1,o[d]===void 0&&(o[d]=!0),a[d]===void 0&&(a[d]=!0),u[f]===void 0&&(u[f]=!0)))}),c||(s[l]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(u)}}loaded(t,r,n){const i=t.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&n&&(this.state[t]=0);const s={};this.queue.forEach(u=>{vfe(u.loaded,[a],o),Cfe(u,t),r&&u.errors.push(r),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{s[l]||(s[l]={});const c=u.loaded[l];c.length&&c.forEach(f=>{s[l][f]===void 0&&(s[l][f]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(u=>!u.done)}read(t,r,n,i=0,a=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(l,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,i+1,a*2,o)},a);return}o(l,c)},u=this.backend[n].bind(this.backend);if(u.length===2){try{const l=u(t,r);l&&typeof l.then=="function"?l.then(c=>s(null,c)).catch(s):s(null,l)}catch(l){s(l)}return}return u(t,r,s)}prepareLoading(t,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Ct(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ct(r)&&(r=[r]);const a=this.queueLoad(t,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t,r=""){const n=t.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(t,o,s)})}saveMissing(t,r,n,i,a,o={},s=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend?.create){const u={...o,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let c;l.length===5?c=l(t,r,n,i,u):c=l(t,r,n,i),c&&typeof c.then=="function"?c.then(f=>s(null,f)).catch(s):s(null,c)}catch(c){s(c)}else l(t,r,n,i,s,u)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}const T4=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ct(e[1])&&(t.defaultValue=e[1]),Ct(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),C4=e=>(Ct(e.ns)&&(e.ns=[e.ns]),Ct(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ct(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),im=()=>{},Nfe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class fh extends rm{constructor(t={},r){if(super(),this.options=C4(t),this.services={},this.logger=wo,this.modules={external:[]},Nfe(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Ct(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=T4();this.options={...n,...this.options,...C4(t)},this.options.interpolation={...n.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?wo.init(i(this.modules.logger),this.options):wo.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Tfe;const c=new x4(this.options);this.store=new _4(this.options.resources,this.options);const f=this.services;f.logger=wo,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new Sfe(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(f.formatter=i(l),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Rfe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Pfe(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new nm(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=im),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...c)=>this.store[l](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...c)=>(this.store[l](...c),this)});const s=uh(),u=()=>{const l=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(f),r(c,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),s}loadResources(t,r=im){let n=r;const i=Ct(t)?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],o=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(l=>{l!=="cimode"&&a.indexOf(l)<0&&a.push(l)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>o(u)),this.options.preload?.forEach?.(s=>o(s)),this.services.backendConnector.load(a,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(t,r,n){const i=uh();return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),n||(n=im),this.services.backendConnector.reload(t,r,a=>{i.resolve(),n(a)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&b4.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const n=uh();this.emit("languageChanging",t);const i=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,u)=>{u?this.isLanguageChangingTo===t&&(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),r&&r(s,(...l)=>this.t(...l))},o=s=>{!t&&!s&&this.services.languageDetector&&(s=[]);const u=Ct(s)?s:s&&s[0],l=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(Ct(s)?[s]:s);l&&(this.language||i(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector?.cacheUserLanguage?.(l)),this.loadResources(l,c=>{a(c,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),n}getFixedT(t,r,n){const i=(a,o,...s)=>{let u;typeof o!="object"?u=this.options.overloadTranslationOptionHandler([a,o].concat(s)):u={...o},u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||n||i.keyPrefix);const l=this.options.keySeparator||".";let c;return u.keyPrefix&&Array.isArray(a)?c=a.map(f=>`${u.keyPrefix}${l}${f}`):c=u.keyPrefix?`${u.keyPrefix}${l}${a}`:a,this.t(c,u)};return Ct(t)?i.lng=t:i.lngs=t,i.ns=r,i.keyPrefix=n,i}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(s,u)=>{const l=this.services.backendConnector.state[`${s}|${u}`];return l===-1||l===0||l===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,t)&&(!i||o(a,t)))}loadNamespaces(t,r){const n=uh();return this.options.ns?(Ct(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=uh();Ct(t)&&(t=[t]);const i=this.options.preload||[],a=t.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const a=i.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services?.languageUtils||new x4(T4());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){return new fh(t,r)}cloneInstance(t={},r=im){const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},a=new fh(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=Object.keys(this.store.data).reduce((u,l)=>(u[l]={...this.store.data[l]},u[l]=Object.keys(u[l]).reduce((c,f)=>(c[f]={...u[l][f]},c),u[l]),u),{});a.store=new _4(s,i),a.services.resourceStore=a.store}return a.translator=new nm(a.services,i),a.translator.on("*",(s,...u)=>{a.emit(s,...u)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hn=fh.createInstance();hn.createInstance=fh.createInstance,hn.createInstance,hn.dir,hn.init,hn.loadResources,hn.reloadResources,hn.use,hn.changeLanguage,hn.getFixedT;const P4=hn.t;hn.exists,hn.setDefaultNamespace,hn.hasLoadedNamespace,hn.loadNamespaces,hn.loadLanguages;function Dfe({callback:e,title:t,subtitle:r}){const{scannerActions:n}=r4({bufferName:"BadgeScanner",callback:e});return K.useEffect(()=>(n.activateScanner(),()=>{n.disableScanner()}),[n]),C.jsxs(Gd,{sx:{flexDirection:"column",justifyContent:"space-around",height:"100%"},children:[C.jsxs(Se.Box,{children:[C.jsx(Se.Typography,{variant:"h4",children:P4(t)}),C.jsx(Se.Typography,{variant:"h6",children:P4(r)})]}),C.jsx(kee,{sx:{fontSize:"10rem"}})]})}function N4({id:e,children:t,ratio:r=0,unit:n=1}){const i=100/r,a=Array.from({length:r}).reduce((o,s,u)=>{const l=u*i,c=u%2===0?1:0;return o[`${l}%`]={opacity:c},o},{});return C.jsx(Gv,{sx:{[`@keyframes blink-${e}`]:a,animation:`blink-${e} ${n}s infinite`,display:"inline-flex"},children:t})}function D4(){const{crumbs:e,slice:t}=i4(),{t:r}=Qt();return K.useEffect(()=>console.log("Crumbs:",e),[e]),C.jsxs(Ju,{children:[C.jsx(Se.Breadcrumbs,{"aria-label":"breadcrumb",sx:{padding:"8px"},children:e.map((n,i)=>C.jsx(Se.Link,{color:"inherit",underline:"hover",sx:{cursor:"pointer"},onClick:()=>{console.log("Clicked crumb:",n.text),console.log("index:",i),t(i)},children:r(n.text)},i))}),C.jsx(Se.Divider,{}),C.jsx(Pc,{gap:2,flexWrap:"wrap",alignContent:"center",overflow:"hidden",padding:0,children:e[e.length-1].component})]})}function Ife({root:e}){const[t,r]=K.useState([e]),n=a=>r(o=>[...o,a]),i=a=>r(o=>o.slice(0,a+1));return C.jsx(n4.Provider,{value:{crumbs:t,push:n,slice:i},children:C.jsx(D4,{})})}function I4({value:e}){const{t}=Qt(),[r,n]=K.useState(!1),i=()=>{e&&(n(!0),navigator.clipboard.writeText(e))};return K.useEffect(()=>{r&&setTimeout(()=>{n(!1)},1e3)},[r]),C.jsx(Se.Tooltip,{placement:"top",title:t(r?"COPIED":"COPY"),disableFocusListener:!0,disableTouchListener:!0,arrow:!0,children:C.jsx(Se.IconButton,{id:"copy-to-clipboard-icnBtn",onClick:i,color:r?"primary":"default",disabled:!e,size:"small",children:r?C.jsx(v1,{}):C.jsx(Mee,{})})})}function k4({id:e,anchor:t,onClose:r,children:n,width:i,centerPopover:a}){return C.jsx(Se.Popover,{id:e,open:!!t,anchorEl:t,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:a?"center":"left"},transformOrigin:{vertical:"top",horizontal:a?"center":"left"},slotProps:{paper:{sx:{overflow:"hidden",minWidth:i,width:i}}},children:n})}function vR({Icon:e,label:t,menuContent:r,centerPopover:n}){const{t:i}=Qt(),[a,o]=K.useState(null),s=c=>{o(c.currentTarget)},u=()=>{o(null)},l=K.Children.map(r,c=>K.isValidElement(c)?K.cloneElement(c,{onClose:u}):c);return C.jsxs(C.Fragment,{children:[C.jsx(Se.Tooltip,{title:i("OPEN_MENU",{value:i(t)}),children:C.jsx(Se.Button,{id:`${t}-btn`,variant:"outlined",onClick:s,startIcon:C.jsx(e,{}),children:i(t)})}),C.jsx(k4,{centerPopover:n,id:`${t}-menu`,anchor:a,onClose:u,children:l})]})}function M4({styles:e={},languages:t,flags:r,isPopover:n}){const{i18n:i}=Qt(),[,a]=Ka("languageDialogPopover");K.useEffect(()=>{a(n??!1)},[n,a]);const[o,s]=dR(t),u=r[i.language];return u?C.jsx(Lee,{id:"flags-btn",role:"button","aria-label":"change language flag button",onClick:s.open,sx:e,children:C.jsx(u,{size:36})}):(console.warn(`No flag component found for language: ${i.language}`),null)}function am(){const[e,t]=Ka("sidebarIsOpenState",!1),r=K.useCallback(()=>{t(o=>!o)},[t]),n=K.useCallback(()=>{t(!1)},[t]),i=K.useCallback(()=>{t(!0)},[t]),a=K.useMemo(()=>({toggle:r,close:n,open:i}),[r,n,i]);return[e,a]}const L4="300px",j4="56px",gR=.5,F4=Qn(jee,{shouldForwardProp:e=>e!=="open"&&e!=="isMobile"&&e!=="isIdle"})(({theme:e,open:t,isMobile:r,isIdle:n})=>({flexShrink:0,boxSizing:"border-box",whiteSpace:"nowrap",height:"100% !important","& .MuiDrawer-paper":{opacity:r&&!t||n?0:1,position:"relative",width:n?0:r?t?"98vw":"0":t?L4:j4,transition:`all ${gR}s ease-in-out`,overflow:"hidden",backgroundColor:e.palette.background.paper}}));function kfe({children:e,Logo:t,theme:r,isIdle:n}){const{i18n:i}=Qt(),a=jc("(max-width: 600px)"),[o,s]=am(),[u,l]=K.Children.toArray(e),c=i.dir();return C.jsxs(F4,{id:"sidebar-drawer",dir:c,variant:"permanent",anchor:c==="rtl"?"right":"left",open:o,onClose:s.close,slotProps:{paper:{variant:"outlined"}},isMobile:a,"data-pw":"sidebar",isIdle:n,children:[t&&C.jsx(Kr,{pt:"1vw",pb:"1vw",alignItems:"center",justifyContent:"center",minHeight:"64px",marginTop:"1vh",children:C.jsx(Se.Collapse,{in:o,timeout:500,orientation:"horizontal",collapsedSize:"0px",children:C.jsx(t,{width:"200px",height:"64px",theme:r})})}),C.jsx(Se.Box,{sx:{flexGrow:1,overflowY:"scroll",overflowX:"hidden",scrollbarWidth:"none"},children:u}),C.jsx(Se.Divider,{}),l]})}var Vc=(e=>(e.DARK="dark",e.LIGHT="light",e))(Vc||{});function qc(){const[e,t]=Ka("themeModeState",localStorage.getItem("theme-mode")||Vc.DARK);K.useEffect(()=>{localStorage.setItem("theme-mode",e)},[e]);const r=K.useCallback(()=>{t(i=>i===Vc.DARK?Vc.LIGHT:Vc.DARK)},[t]),n=K.useMemo(()=>({toggle:r}),[r]);return[e,n]}function Mfe({onClick:e,isIdle:t}){const[r]=qc(),[n]=am(),[i,a]=K.useState(n);K.useEffect(()=>{t&&n&&(a(!1),e())},[t,n,e]),K.useEffect(()=>{a(n)},[n]);const o=()=>{a(!i),e()};return C.jsxs("div",{id:"menu-icon","aria-label":"menu-icon",style:{marginRight:"19px"},className:`${r} ${i?"open":"closed"}`,onClick:o,children:[C.jsx("span",{}),C.jsx("span",{}),C.jsx("span",{})]})}const Lfe=g1.styled(e=>C.jsx($ee,{disableRipple:!0,...e}))(({theme:e})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:2,margin:3,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,border:0},"& .MuiSwitch-thumb:before":{content:"''",position:"absolute",width:"100%",height:"100%",left:0,top:0,backgroundColor:"#fff",borderRadius:"50%",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundImage:`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="${encodeURIComponent("#111")}" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"/></svg>')`}},"&.Mui-disabled .MuiSwitch-thumb":{color:e.palette.grey[100]}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:16,height:16,"&::before":{content:"''",position:"absolute",width:"100%",height:"100%",left:0,top:0,backgroundColor:"#79747e",borderRadius:"50%",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundImage:`url('data:image/svg+xml;utf8,<svg fill="${encodeURIComponent("#fff")}" width="16" height="16" viewBox="-6 -6 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.314 5.9l3.535-3.536A1 1 0 1 0 9.435.95L5.899 4.485 2.364.95A1 1 0 1 0 .95 2.364l3.535 3.535L.95 9.435a1 1 0 1 0 1.414 1.414l3.535-3.535 3.536 3.535a1 1 0 1 0 1.414-1.414L7.314 5.899z" /></svg>')`}},"& .MuiSwitch-track":{border:"2px solid #79747e",borderRadius:26/2,backgroundColor:"#e6e0e9",opacity:1,transition:e.transitions.create(["background-color"],{duration:500})}}));function $4({label:e,value:t,onChange:r}){const{t:n}=Qt();return C.jsx(Fee,{labelPlacement:"start",control:C.jsx(Lfe,{sx:{ml:1.69},checked:t,onChange:r}),label:e&&n(e),slotProps:{typography:{noWrap:!0}}})}function jfe({translation:e,globalStateString:t,defaultValue:r}){const[n,i]=Ka(t,r),a=o=>{i(o.target.checked)};return C.jsx($4,{label:e,value:n,onChange:a})}var om=(e=>(e.Column="column",e.Row="row",e))(om||{});function mR({caption:e,value:t,captionColor:r="textSecondary",valueColor:n="textPrimary",reverse:i,direction:a=om.Column,width:o,height:s,gap:u="4px",flex:l,padding:c,textAlign:f,captionStyle:d,valueStyle:h,fallback:m="N/A",enableCopy:p,className:g}){const{t:y}=Qt();return C.jsxs(Kr,{className:g,flexDirection:i?`${a}-reverse`:a,alignItems:a===om.Row?"center":"stretch",width:o,gap:u,height:s,flex:l,padding:c,children:[C.jsx(Se.Typography,{variant:"body2",color:r,sx:{textAlign:f,userSelect:"none",...d},noWrap:!0,children:y(e)}),typeof t=="string"||typeof t=="number"||!t&&(typeof m=="string"||typeof m=="number")?C.jsxs(Kr,{alignItems:"center",gap:"8px",children:[C.jsx(Se.Typography,{variant:"body1",color:n,sx:{textAlign:f,userSelect:"none",...h},noWrap:!0,children:t||m}),p&&C.jsx(I4,{value:t?.toString()})]}):t||m]})}function Ffe({CustomAvatarIcon:e,title:t,displayValue:r,subtitle:n}){const{t:i}=Qt(),[a]=qc(),o=a==="light"?"#e0e0e0":"#303030";return C.jsxs(Se.Paper,{sx:{borderRadius:"10px",border:"1px solid "+o,padding:"8px",gap:"8px",alignItems:"center",minWidth:"230px",display:"flex"},children:[C.jsx(Se.Avatar,{sx:{backgroundColor:"#12322f",width:"80px",height:"80px"},children:e}),C.jsxs(bo,{textAlign:"left",margin:"auto",children:[C.jsx(Se.Typography,{variant:"caption",color:"grey",sx:{margin:0,lineHeight:1},children:i(t)}),C.jsx(Se.Typography,{variant:"body1",sx:{padding:"0!important",fontSize:"2rem",margin:1,ml:0,fontWeight:600,lineHeight:1.1},children:i(r)}),typeof n=="string"?C.jsx(Se.Typography,{sx:{margin:0,lineHeight:1.2,fontSize:".75rem"},variant:"body2",children:i(n||"")}):n]})]})}function V4(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=V4(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ht(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=V4(e))&&(n&&(n+=" "),n+=t);return n}var yR={},_R={},q4;function $fe(){return q4||(q4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t}(_R)),_R}var bR={},B4;function U4(){return B4||(B4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t}(bR)),bR}var ER={},z4;function W4(){return z4||(z4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="string"||typeof r=="symbol"?r:Object.is(r?.valueOf?.(),-0)?"-0":String(r)}e.toKey=t}(ER)),ER}var wR={},H4;function xR(){return H4||(H4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){const n=[],i=r.length;if(i===0)return n;let a=0,o="",s="",u=!1;for(r.charCodeAt(0)===46&&(n.push(""),a++);a<i;){const l=r[a];s?l==="\\"&&a+1<i?(a++,o+=r[a]):l===s?s="":o+=l:u?l==='"'||l==="'"?s=l:l==="]"?(u=!1,n.push(o),o=""):o+=l:l==="["?(u=!0,o&&(n.push(o),o="")):l==="."?o&&(n.push(o),o=""):o+=l,a++}return o&&n.push(o),n}e.toPath=t}(wR)),wR}var G4;function SR(){return G4||(G4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$fe(),r=U4(),n=W4(),i=xR();function a(s,u,l){if(s==null)return l;switch(typeof u){case"string":{if(t.isUnsafeProperty(u))return l;const c=s[u];return c===void 0?r.isDeepKey(u)?a(s,i.toPath(u),l):l:c}case"number":case"symbol":{typeof u=="number"&&(u=n.toKey(u));const c=s[u];return c===void 0?l:c}default:{if(Array.isArray(u))return o(s,u,l);if(Object.is(u?.valueOf(),-0)?u="-0":u=String(u),t.isUnsafeProperty(u))return l;const c=s[u];return c===void 0?l:c}}}function o(s,u,l){if(u.length===0)return l;let c=s;for(let f=0;f<u.length;f++){if(c==null||t.isUnsafeProperty(u[f]))return l;c=c[u[f]]}return c===void 0?l:c}e.get=a}(yR)),yR}var RR,K4;function Vfe(){return K4||(K4=1,RR=SR().get),RR}var qfe=Vfe();const ou=Ua(qfe);var Bfe=SS(),Cn=e=>e===0?0:e>0?1:-1,Zn=e=>typeof e=="number"&&e!=+e,ol=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Xe=e=>(typeof e=="number"||e instanceof Number)&&!Zn(e),Ni=e=>Xe(e)||typeof e=="string",Ufe=0,ns=e=>{var t=++Ufe;return"".concat(e||"").concat(t)},fi=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Xe(t)&&typeof t!="string")return n;var a;if(ol(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Zn(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},Y4=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[e[n]])r[e[n]]=!0;else return!0;return!1},Fn=(e,t)=>Xe(e)&&Xe(t)?r=>e+r*(t-e):()=>t;function Bc(e,t,r){return Xe(e)&&Xe(t)?e+r*(t-e):t}function Q4(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):ou(n,t))===r)}var zfe=e=>{if(!e||!e.length)return null;for(var t=e.length,r=0,n=0,i=0,a=0,o=1/0,s=-1/0,u=0,l=0,c=0;c<t;c++)u=e[c].cx||0,l=e[c].cy||0,r+=u,n+=l,i+=u*l,a+=u*u,o=Math.min(o,u),s=Math.max(s,u);var f=t*a!==r*r?(t*i-r*n)/(t*a-r*r):0;return{xmin:o,xmax:s,a:f,b:(n-f*r)/t}},rr=e=>e===null||typeof e>"u",dh=e=>rr(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),Wfe=["viewBox","children"],Hfe=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],X4=["points","pathLength"],OR={svg:Wfe,polygon:X4,polyline:X4},AR=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],TR=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(K.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{AR.includes(i)&&(n[i]=a=>r[i](r,a))}),n},Gfe=(e,t,r)=>n=>(e(t,r,n),null),Uc=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];AR.includes(i)&&typeof a=="function"&&(n||(n={}),n[i]=Gfe(a,t,r))}),n},Z4=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",J4=null,CR=null,e6=e=>{if(e===J4&&Array.isArray(CR))return CR;var t=[];return K.Children.forEach(e,r=>{rr(r)||(Bfe.isFragment(r)?t=t.concat(e6(r.props.children)):t.push(r))}),CR=t,J4=e,t};function zc(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(i=>Z4(i)):n=[Z4(t)],e6(e).forEach(i=>{var a=ou(i,"type.displayName")||ou(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}var sm=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Kfe=(e,t,r,n)=>{var i,a=(i=n&&OR?.[n])!==null&&i!==void 0?i:[];return t.startsWith("data-")||typeof e!="function"&&(n&&a.includes(t)||Hfe.includes(t))||r&&AR.includes(t)},xt=(e,t,r)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(K.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var i={};return Object.keys(n).forEach(a=>{var o;Kfe((o=n)===null||o===void 0?void 0:o[a],a,t,r)&&(i[a]=n[a])}),i},Yfe=["children","width","height","viewBox","className","style","title","desc"];function PR(){return PR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PR.apply(null,arguments)}function Qfe(e,t){if(e==null)return{};var r,n,i=Xfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Xfe(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var NR=K.forwardRef((e,t)=>{var{children:r,width:n,height:i,viewBox:a,className:o,style:s,title:u,desc:l}=e,c=Qfe(e,Yfe),f=a||{width:n,height:i,x:0,y:0},d=Ht("recharts-surface",o);return X.createElement("svg",PR({},xt(c,!0,"svg"),{className:d,width:n,height:i,style:s,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),X.createElement("title",null,u),X.createElement("desc",null,l),r)}),Zfe=["children","className"];function DR(){return DR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DR.apply(null,arguments)}function Jfe(e,t){if(e==null)return{};var r,n,i=ede(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ede(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var hr=X.forwardRef((e,t)=>{var{children:r,className:n}=e,i=Jfe(e,Zfe),a=Ht("recharts-layer",n);return X.createElement("g",DR({className:a},xt(i,!0),{ref:t}),r)}),t6=K.createContext(null),tde=()=>K.useContext(t6);function Mt(e){return function(){return e}}const r6=Math.abs,Jn=Math.atan2,is=Math.cos,rde=Math.max,Wc=Math.min,Di=Math.sin,Fr=Math.sqrt,ei=1e-12,su=Math.PI,um=su/2,uu=2*su;function nde(e){return e>1?0:e<-1?su:Math.acos(e)}function n6(e){return e>=1?um:e<=-1?-um:Math.asin(e)}const IR=Math.PI,kR=2*IR,sl=1e-6,ide=kR-sl;function i6(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function ade(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return i6;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}let hh=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?i6:ade(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,u=n-t,l=i-r,c=o-t,f=s-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>sl)if(!(Math.abs(f*u-l*c)>sl)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,m=i-s,p=u*u+l*l,g=h*h+m*m,y=Math.sqrt(p),b=Math.sqrt(d),E=a*Math.tan((IR-Math.acos((p+d-g)/(2*y*b)))/2),w=E/b,x=E/y;Math.abs(w-1)>sl&&this._append`L${t+w*c},${r+w*f}`,this._append`A${a},${a},0,0,${+(f*h>c*m)},${this._x1=t+x*u},${this._y1=r+x*l}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),u=n*Math.sin(i),l=t+s,c=r+u,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>sl||Math.abs(this._y1-c)>sl)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%kR+kR),d>ide?this._append`A${n},${n},0,1,${f},${t-s},${r-u}A${n},${n},0,1,${f},${this._x1=l},${this._y1=c}`:d>sl&&this._append`A${n},${n},0,${+(d>=IR)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function MR(){return new hh}MR.prototype=hh.prototype;function ode(e=3){return new hh(+e)}function ph(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new hh(t)}function sde(e){return e.innerRadius}function ude(e){return e.outerRadius}function lde(e){return e.startAngle}function cde(e){return e.endAngle}function fde(e){return e&&e.padAngle}function dde(e,t,r,n,i,a,o,s){var u=r-e,l=n-t,c=o-i,f=s-a,d=f*u-c*l;if(!(d*d<ei))return d=(c*(t-a)-f*(e-i))/d,[e+d*u,t+d*l]}function lm(e,t,r,n,i,a,o){var s=e-r,u=t-n,l=(o?a:-a)/Fr(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,m=r+c,p=n+f,g=(d+m)/2,y=(h+p)/2,b=m-d,E=p-h,w=b*b+E*E,x=i-a,R=d*p-m*h,S=(E<0?-1:1)*Fr(rde(0,x*x*w-R*R)),j=(R*E-b*S)/w,M=(-R*b-E*S)/w,k=(R*E+b*S)/w,F=(-R*b+E*S)/w,V=j-g,P=M-y,A=k-g,I=F-y;return V*V+P*P>A*A+I*I&&(j=k,M=F),{cx:j,cy:M,x01:-c,y01:-f,x11:j*(i/x-1),y11:M*(i/x-1)}}function hde(){var e=sde,t=ude,r=Mt(0),n=null,i=lde,a=cde,o=fde,s=null,u=ph(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),m=i.apply(this,arguments)-um,p=a.apply(this,arguments)-um,g=r6(p-m),y=p>m;if(s||(s=c=u()),h<d&&(f=h,h=d,d=f),!(h>ei))s.moveTo(0,0);else if(g>uu-ei)s.moveTo(h*is(m),h*Di(m)),s.arc(0,0,h,m,p,!y),d>ei&&(s.moveTo(d*is(p),d*Di(p)),s.arc(0,0,d,p,m,y));else{var b=m,E=p,w=m,x=p,R=g,S=g,j=o.apply(this,arguments)/2,M=j>ei&&(n?+n.apply(this,arguments):Fr(d*d+h*h)),k=Wc(r6(h-d)/2,+r.apply(this,arguments)),F=k,V=k,P,A;if(M>ei){var I=n6(M/d*Di(j)),L=n6(M/h*Di(j));(R-=I*2)>ei?(I*=y?1:-1,w+=I,x-=I):(R=0,w=x=(m+p)/2),(S-=L*2)>ei?(L*=y?1:-1,b+=L,E-=L):(S=0,b=E=(m+p)/2)}var B=h*is(b),H=h*Di(b),U=d*is(x),T=d*Di(x);if(k>ei){var D=h*is(E),O=h*Di(E),$=d*is(w),q=d*Di(w),W;if(g<su)if(W=dde(B,H,$,q,D,O,U,T)){var z=B-W[0],Y=H-W[1],Q=D-W[0],Z=O-W[1],re=1/Di(nde((z*Q+Y*Z)/(Fr(z*z+Y*Y)*Fr(Q*Q+Z*Z)))/2),ie=Fr(W[0]*W[0]+W[1]*W[1]);F=Wc(k,(d-ie)/(re-1)),V=Wc(k,(h-ie)/(re+1))}else F=V=0}S>ei?V>ei?(P=lm($,q,B,H,h,V,y),A=lm(D,O,U,T,h,V,y),s.moveTo(P.cx+P.x01,P.cy+P.y01),V<k?s.arc(P.cx,P.cy,V,Jn(P.y01,P.x01),Jn(A.y01,A.x01),!y):(s.arc(P.cx,P.cy,V,Jn(P.y01,P.x01),Jn(P.y11,P.x11),!y),s.arc(0,0,h,Jn(P.cy+P.y11,P.cx+P.x11),Jn(A.cy+A.y11,A.cx+A.x11),!y),s.arc(A.cx,A.cy,V,Jn(A.y11,A.x11),Jn(A.y01,A.x01),!y))):(s.moveTo(B,H),s.arc(0,0,h,b,E,!y)):s.moveTo(B,H),!(d>ei)||!(R>ei)?s.lineTo(U,T):F>ei?(P=lm(U,T,D,O,d,-F,y),A=lm(B,H,$,q,d,-F,y),s.lineTo(P.cx+P.x01,P.cy+P.y01),F<k?s.arc(P.cx,P.cy,F,Jn(P.y01,P.x01),Jn(A.y01,A.x01),!y):(s.arc(P.cx,P.cy,F,Jn(P.y01,P.x01),Jn(P.y11,P.x11),!y),s.arc(0,0,d,Jn(P.cy+P.y11,P.cx+P.x11),Jn(A.cy+A.y11,A.cx+A.x11),y),s.arc(A.cx,A.cy,F,Jn(A.y11,A.x11),Jn(A.y01,A.x01),!y))):s.arc(0,0,d,x,w,y)}if(s.closePath(),c)return s=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-su/2;return[is(f)*c,Di(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Mt(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Mt(+c),l):t},l.cornerRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Mt(+c),l):r},l.padRadius=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:Mt(+c),l):n},l.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:Mt(+c),l):i},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Mt(+c),l):a},l.padAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Mt(+c),l):o},l.context=function(c){return arguments.length?(s=c??null,l):s},l}var pde=Array.prototype.slice;function cm(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function a6(e){this._context=e}a6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Hc(e){return new a6(e)}function LR(e){return e[0]}function jR(e){return e[1]}function fm(e,t){var r=Mt(!0),n=null,i=Hc,a=null,o=ph(s);e=typeof e=="function"?e:e===void 0?LR:Mt(e),t=typeof t=="function"?t:t===void 0?jR:Mt(t);function s(u){var l,c=(u=cm(u)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),l=0;l<=c;++l)!(l<c&&r(f=u[l],l,u))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(f,l,u),+t(f,l,u));if(h)return a=null,h+""||null}return s.x=function(u){return arguments.length?(e=typeof u=="function"?u:Mt(+u),s):e},s.y=function(u){return arguments.length?(t=typeof u=="function"?u:Mt(+u),s):t},s.defined=function(u){return arguments.length?(r=typeof u=="function"?u:Mt(!!u),s):r},s.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),s):i},s.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),s):n},s}function Gc(e,t,r){var n=null,i=Mt(!0),a=null,o=Hc,s=null,u=ph(l);e=typeof e=="function"?e:e===void 0?LR:Mt(+e),t=typeof t=="function"?t:Mt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?jR:Mt(+r);function l(f){var d,h,m,p=(f=cm(f)).length,g,y=!1,b,E=new Array(p),w=new Array(p);for(a==null&&(s=o(b=u())),d=0;d<=p;++d){if(!(d<p&&i(g=f[d],d,f))===y)if(y=!y)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),m=d-1;m>=h;--m)s.point(E[m],w[m]);s.lineEnd(),s.areaEnd()}y&&(E[d]=+e(g,d,f),w[d]=+t(g,d,f),s.point(n?+n(g,d,f):E[d],r?+r(g,d,f):w[d]))}if(b)return s=null,b+""||null}function c(){return fm().defined(i).curve(o).context(a)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Mt(+f),n=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Mt(+f),l):e},l.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Mt(+f),l):n},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Mt(+f),r=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Mt(+f),l):t},l.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Mt(+f),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(n).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Mt(!!f),l):i},l.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),l):o},l.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),l):a},l}function vde(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function gde(e){return e}function mde(){var e=gde,t=vde,r=null,n=Mt(0),i=Mt(uu),a=Mt(0);function o(s){var u,l=(s=cm(s)).length,c,f,d=0,h=new Array(l),m=new Array(l),p=+n.apply(this,arguments),g=Math.min(uu,Math.max(-uu,i.apply(this,arguments)-p)),y,b=Math.min(Math.abs(g)/l,a.apply(this,arguments)),E=b*(g<0?-1:1),w;for(u=0;u<l;++u)(w=m[h[u]=u]=+e(s[u],u,s))>0&&(d+=w);for(t!=null?h.sort(function(x,R){return t(m[x],m[R])}):r!=null&&h.sort(function(x,R){return r(s[x],s[R])}),u=0,f=d?(g-l*E)/d:0;u<l;++u,p=y)c=h[u],w=m[c],y=p+(w>0?w*f:0)+E,m[c]={data:s[c],index:u,value:w,startAngle:p,endAngle:y,padAngle:b};return m}return o.value=function(s){return arguments.length?(e=typeof s=="function"?s:Mt(+s),o):e},o.sortValues=function(s){return arguments.length?(t=s,r=null,o):t},o.sort=function(s){return arguments.length?(r=s,t=null,o):r},o.startAngle=function(s){return arguments.length?(n=typeof s=="function"?s:Mt(+s),o):n},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:Mt(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:Mt(+s),o):a},o}var o6=FR(Hc);function s6(e){this._curve=e}s6.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function FR(e){function t(r){return new s6(e(r))}return t._curve=e,t}function vh(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(r){return arguments.length?t(FR(r)):t()._curve},e}function u6(){return vh(fm().curve(o6))}function l6(){var e=Gc().curve(o6),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return vh(r())},delete e.lineX0,e.lineEndAngle=function(){return vh(n())},delete e.lineX1,e.lineInnerRadius=function(){return vh(i())},delete e.lineY0,e.lineOuterRadius=function(){return vh(a())},delete e.lineY1,e.curve=function(o){return arguments.length?t(FR(o)):t()._curve},e}function gh(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class c6{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}class yde{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,r){if(t=+t,r=+r,this._point===0)this._point=1;else{const n=gh(this._x0,this._y0),i=gh(this._x0,this._y0=(this._y0+r)/2),a=gh(t,this._y0),o=gh(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...a,...o)}this._x0=t,this._y0=r}}function $R(e){return new c6(e,!0)}function VR(e){return new c6(e,!1)}function _de(e){return new yde(e)}function bde(e){return e.source}function Ede(e){return e.target}function dm(e){let t=bde,r=Ede,n=LR,i=jR,a=null,o=null,s=ph(u);function u(){let l;const c=pde.call(arguments),f=t.apply(this,c),d=r.apply(this,c);if(a==null&&(o=e(l=s())),o.lineStart(),c[0]=f,o.point(+n.apply(this,c),+i.apply(this,c)),c[0]=d,o.point(+n.apply(this,c),+i.apply(this,c)),o.lineEnd(),l)return o=null,l+""||null}return u.source=function(l){return arguments.length?(t=l,u):t},u.target=function(l){return arguments.length?(r=l,u):r},u.x=function(l){return arguments.length?(n=typeof l=="function"?l:Mt(+l),u):n},u.y=function(l){return arguments.length?(i=typeof l=="function"?l:Mt(+l),u):i},u.context=function(l){return arguments.length?(l==null?a=o=null:o=e(a=l),u):a},u}function wde(){return dm($R)}function xde(){return dm(VR)}function Sde(){const e=dm(_de);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const Rde=Fr(3),f6={draw(e,t){const r=Fr(t+Wc(t/28,.75))*.59436,n=r/2,i=n*Rde;e.moveTo(0,r),e.lineTo(0,-r),e.moveTo(-i,-n),e.lineTo(i,n),e.moveTo(-i,n),e.lineTo(i,-n)}},Kc={draw(e,t){const r=Fr(t/su);e.moveTo(r,0),e.arc(0,0,r,0,uu)}},qR={draw(e,t){const r=Fr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},d6=Fr(1/3),Ode=d6*2,BR={draw(e,t){const r=Fr(t/Ode),n=r*d6;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},h6={draw(e,t){const r=Fr(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}},p6={draw(e,t){const r=Fr(t-Wc(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}},UR={draw(e,t){const r=Fr(t),n=-r/2;e.rect(n,n,r,r)}},v6={draw(e,t){const r=Fr(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}},Ade=.8908130915292852,g6=Di(su/10)/Di(7*su/10),Tde=Di(uu/10)*g6,Cde=-is(uu/10)*g6,zR={draw(e,t){const r=Fr(t*Ade),n=Tde*r,i=Cde*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=uu*a/5,s=is(o),u=Di(o);e.lineTo(u*r,-s*r),e.lineTo(s*n-u*i,u*n+s*i)}e.closePath()}},WR=Fr(3),HR={draw(e,t){const r=-Fr(t/(WR*3));e.moveTo(0,r*2),e.lineTo(-WR*r,-r),e.lineTo(WR*r,-r),e.closePath()}},Pde=Fr(3),m6={draw(e,t){const r=Fr(t)*.6824,n=r/2,i=r*Pde/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}},ya=-.5,_a=Fr(3)/2,GR=1/Fr(12),Nde=(GR/2+1)*3,KR={draw(e,t){const r=Fr(t/Nde),n=r/2,i=r*GR,a=n,o=r*GR+r,s=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,u),e.lineTo(ya*n-_a*i,_a*n+ya*i),e.lineTo(ya*a-_a*o,_a*a+ya*o),e.lineTo(ya*s-_a*u,_a*s+ya*u),e.lineTo(ya*n+_a*i,ya*i-_a*n),e.lineTo(ya*a+_a*o,ya*o-_a*a),e.lineTo(ya*s+_a*u,ya*u-_a*s),e.closePath()}},YR={draw(e,t){const r=Fr(t-Wc(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}},y6=[Kc,qR,BR,UR,zR,HR,KR],Dde=[Kc,p6,YR,m6,f6,v6,h6];function _6(e,t){let r=null,n=ph(i);e=typeof e=="function"?e:Mt(e||Kc),t=typeof t=="function"?t:Mt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Mt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Mt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function lu(){}function hm(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function pm(e){this._context=e}pm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:hm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:hm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function b6(e){return new pm(e)}function E6(e){this._context=e}E6.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:hm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function w6(e){return new E6(e)}function x6(e){this._context=e}x6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:hm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function S6(e){return new x6(e)}function R6(e,t){this._basis=new pm(e),this._beta=t}R6.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,o=t[r]-i,s=-1,u;++s<=r;)u=s/r,this._basis.point(this._beta*e[s]+(1-this._beta)*(n+u*a),this._beta*t[s]+(1-this._beta)*(i+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Ide=function e(t){function r(n){return t===1?new pm(n):new R6(n,t)}return r.beta=function(n){return e(+n)},r}(.85);function vm(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function QR(e,t){this._context=e,this._k=(1-t)/6}QR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vm(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:vm(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const kde=function e(t){function r(n){return new QR(n,t)}return r.tension=function(n){return e(+n)},r}(0);function XR(e,t){this._context=e,this._k=(1-t)/6}XR.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:vm(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Mde=function e(t){function r(n){return new XR(n,t)}return r.tension=function(n){return e(+n)},r}(0);function ZR(e,t){this._context=e,this._k=(1-t)/6}ZR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vm(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Lde=function e(t){function r(n){return new ZR(n,t)}return r.tension=function(n){return e(+n)},r}(0);function JR(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>ei){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>ei){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function O6(e,t){this._context=e,this._alpha=t}O6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:JR(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jde=function e(t){function r(n){return t?new O6(n,t):new QR(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function A6(e,t){this._context=e,this._alpha=t}A6.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:JR(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Fde=function e(t){function r(n){return t?new A6(n,t):new XR(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function T6(e,t){this._context=e,this._alpha=t}T6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:JR(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $de=function e(t){function r(n){return t?new T6(n,t):new ZR(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function C6(e){this._context=e}C6.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function P6(e){return new C6(e)}function N6(e){return e<0?-1:1}function D6(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(N6(a)+N6(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function I6(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function eO(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function gm(e){this._context=e}gm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:eO(this,this._t0,I6(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,eO(this,I6(this,r=D6(this,e,t)),r);break;default:eO(this,this._t0,r=D6(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function k6(e){this._context=new M6(e)}(k6.prototype=Object.create(gm.prototype)).point=function(e,t){gm.prototype.point.call(this,t,e)};function M6(e){this._context=e}M6.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function L6(e){return new gm(e)}function j6(e){return new k6(e)}function F6(e){this._context=e}F6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=$6(e),i=$6(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $6(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function V6(e){return new F6(e)}function mm(e,t){this._context=e,this._t=t}mm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function q6(e){return new mm(e,.5)}function B6(e){return new mm(e,0)}function U6(e){return new mm(e,1)}function ul(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function ll(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Vde(e,t){return e[t]}function qde(e){const t=[];return t.key=e,t}function z6(){var e=Mt([]),t=ll,r=ul,n=Vde;function i(a){var o=Array.from(e.apply(this,arguments),qde),s,u=o.length,l=-1,c;for(const f of a)for(s=0,++l;s<u;++s)(o[s][l]=[0,+n(f,o[s].key,l,a)]).data=f;for(s=0,c=cm(t(o));s<u;++s)o[c[s]].index=s;return r(o,c),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Mt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Mt(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?ll:typeof a=="function"?a:Mt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??ul,i):r},i}function W6(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}ul(e,t)}}function Bde(e,t){if((u=e.length)>0)for(var r,n=0,i,a,o,s,u,l=e[t[0]].length;n<l;++n)for(o=s=0,r=0;r<u;++r)(a=(i=e[t[r]][n])[1]-i[0])>0?(i[0]=o,i[1]=o+=a):a<0?(i[1]=s,i[0]=s+=a):(i[0]=0,i[1]=a)}function H6(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,s=0;o<i;++o)s+=e[o][r][1]||0;n[r][1]+=n[r][0]=-s/2}ul(e,t)}}function G6(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var s=0,u=0,l=0;s<o;++s){for(var c=e[t[s]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,m=0;m<s;++m){var p=e[t[m]],g=p[n][1]||0,y=p[n-1][1]||0;h+=g-y}u+=f,l+=h*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=l/u)}i[n-1][1]+=i[n-1][0]=r,ul(e,t)}}function K6(e){var t=e.map(Ude);return ll(e).sort(function(r,n){return t[r]-t[n]})}function Ude(e){for(var t=-1,r=0,n=e.length,i,a=-1/0;++t<n;)(i=+e[t][1])>a&&(a=i,r=t);return r}function Y6(e){var t=e.map(Q6);return ll(e).sort(function(r,n){return t[r]-t[n]})}function Q6(e){for(var t=0,r=-1,n=e.length,i;++r<n;)(i=+e[r][1])&&(t+=i);return t}function zde(e){return Y6(e).reverse()}function Wde(e){var t=e.length,r,n,i=e.map(Q6),a=K6(e),o=0,s=0,u=[],l=[];for(r=0;r<t;++r)n=a[r],o<s?(o+=i[n],u.push(n)):(s+=i[n],l.push(n));return l.reverse().concat(u)}function Hde(e){return ll(e).reverse()}var Gde=["type","size","sizeType"];function tO(){return tO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tO.apply(null,arguments)}function X6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Z6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X6(Object(r),!0).forEach(function(n){Kde(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kde(e,t,r){return(t=Yde(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yde(e){var t=Qde(e,"string");return typeof t=="symbol"?t:t+""}function Qde(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xde(e,t){if(e==null)return{};var r,n,i=Zde(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Zde(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var J6={symbolCircle:Kc,symbolCross:qR,symbolDiamond:BR,symbolSquare:UR,symbolStar:zR,symbolTriangle:HR,symbolWye:KR},Jde=Math.PI/180,ehe=e=>{var t="symbol".concat(dh(e));return J6[t]||Kc},the=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Jde;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},rhe=(e,t)=>{J6["symbol".concat(dh(e))]=t},ym=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=Xde(e,Gde),a=Z6(Z6({},i),{},{type:t,size:r,sizeType:n}),o=()=>{var f=ehe(t),d=_6().type(f).size(the(r,n,t));return d()},{className:s,cx:u,cy:l}=a,c=xt(a,!0);return u===+u&&l===+l&&r===+r?X.createElement("path",tO({},c,{className:Ht("recharts-symbols",s),transform:"translate(".concat(u,", ").concat(l,")"),d:o()})):null};ym.registerSymbol=rhe;function rO(){return rO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rO.apply(null,arguments)}function eF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nhe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eF(Object(r),!0).forEach(function(n){nO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nO(e,t,r){return(t=ihe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ihe(e){var t=ahe(e,"string");return typeof t=="symbol"?t:t+""}function ahe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ba=32;class iO extends K.PureComponent{renderIcon(t,r){var{inactiveColor:n}=this.props,i=ba/2,a=ba/6,o=ba/3,s=t.inactive?n:t.color,u=r??t.type;if(u==="none")return null;if(u==="plainline")return X.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:t.payload.strokeDasharray,x1:0,y1:i,x2:ba,y2:i,className:"recharts-legend-icon"});if(u==="line")return X.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(o,`
|
|
72
|
+
`;class jg{constructor(t,r){jt(this,"_store",void 0),jt(this,"_refCount",1),jt(this,"getLoadable",n=>(this.checkRefCount_INTERNAL(),Use(this._store,n))),jt(this,"getPromise",n=>(this.checkRefCount_INTERNAL(),this.getLoadable(n).toPromise())),jt(this,"getNodes_UNSTABLE",n=>{if(this.checkRefCount_INTERNAL(),n?.isModified===!0){if(n?.isInitialized===!1)return[];const o=this._store.getState().currentTree;return n5(o.dirtyAtoms)}const i=this._store.getState().knownAtoms,a=this._store.getState().knownSelectors;return n?.isInitialized==null?r5.values():n.isInitialized===!0?n5(e5([i,a])):qS(r5.values(),({key:o})=>!i.has(o)&&!a.has(o))}),jt(this,"getInfo_UNSTABLE",({key:n})=>(this.checkRefCount_INTERNAL(),Fse(this._store,this._store.getState().currentTree,n))),jt(this,"map",n=>{this.checkRefCount_INTERNAL();const i=new GS(this,HS);return n(i),i}),jt(this,"asyncMap",async n=>{this.checkRefCount_INTERNAL();const i=new GS(this,HS);return i.retain(),await n(i),i.autoRelease_INTERNAL(),i}),this._store={storeID:Vse(),parentStoreID:r,getState:()=>t,replaceState:n=>{t.currentTree=n(t.currentTree)},getGraph:n=>{const i=t.graphsByVersion;if(i.has(n))return zr(i.get(n));const a=$se();return i.set(n,a),a},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw Pt("Cannot subscribe to Snapshots")}};for(const n of this._store.getState().knownAtoms)jse(this._store,n,"get"),Lg(this._store,n,1);this.autoRelease_INTERNAL()}retain(){if(this._refCount<=0){if(process.env.NODE_ENV!=="production")throw Pt("Snapshot has already been released.");Xn("Attempt to retain() Snapshot that was already released.")}this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){Kse||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(),!Mr("recoil_memory_managament_2020"))return}else this._refCount<0&&process.env.NODE_ENV!=="production"&&Xn("Snapshot released an extra time.")}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Mr("recoil_memory_managament_2020")&&this._refCount<=0&&process.env.NODE_ENV!=="production"&&Xn(Qse)}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 a5(e,t,r=!1){const n=e.getState(),i=r?Hse():t.version;return{currentTree:{version:r?i:t.version,stateID:r?i: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(n.knownAtoms),knownSelectors:new Set(n.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(i,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(Ng(n.nodeCleanupFunctions.entries(),([a])=>[a,()=>{}]))}}function Xse(e){const t=new jg(Gse());return e!=null?t.map(e):t}const[o5,s5]=Yse((e,t)=>{var r;const n=e.getState(),i=t==="latest"?(r=n.nextTree)!==null&&r!==void 0?r:n.currentTree:zr(n.previousTree);return new jg(a5(e,i),e.storeID)},(e,t)=>{var r,n;return String(t)+String(e.storeID)+String((r=e.getState().nextTree)===null||r===void 0?void 0:r.version)+String(e.getState().currentTree.version)+String((n=e.getState().previousTree)===null||n===void 0?void 0:n.version)});Wse(s5);function Zse(e,t="latest"){const r=o5(e,t);return r.isRetained()?r:(s5(),o5(e,t))}class GS extends jg{constructor(t,r){super(a5(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),jt(this,"_batch",void 0),jt(this,"set",(n,i)=>{this.checkRefCount_INTERNAL();const a=this.getStore_INTERNAL();this._batch(()=>{Lg(a,n.key,1),i5(this.getStore_INTERNAL(),n,i)})}),jt(this,"reset",n=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Lg(i,n.key,1),i5(this.getStore_INTERNAL(),n,qse)})}),jt(this,"setUnvalidatedAtomValues_DEPRECATED",n=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();HS(()=>{for(const[a,o]of n.entries())Lg(i,a,1),zse(i,new Bse(a),o)})}),this._batch=r}}var Fg={Snapshot:jg,MutableSnapshot:GS,freshSnapshot:Xse,cloneSnapshot:Zse},Jse=Fg.Snapshot,eue=Fg.MutableSnapshot,tue=Fg.freshSnapshot,rue=Fg.cloneSnapshot,$g=Object.freeze({__proto__:null,Snapshot:Jse,MutableSnapshot:eue,freshSnapshot:tue,cloneSnapshot:rue});function nue(...e){const t=new Set;for(const r of e)for(const n of r)t.add(n);return t}var iue=nue;const{useRef:aue}=K;function oue(e){const t=aue(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var u5=oue;const{getNextTreeStateVersion:sue,makeEmptyStoreState:l5}=Mj,{cleanUpNode:uue,getDownstreamNodes:lue,initializeNode:cue,setNodeValue:fue,setUnvalidatedAtomValue_DEPRECATED:due}=nl,{graph:hue}=Xd,{cloneGraph:pue}=Xd,{getNextStoreID:c5}=Ig,{createMutableSource:KS,reactMode:f5}=IS,{applyAtomValueWrites:vue}=es,{releaseScheduledRetainablesNow:d5}=Ic,{freshSnapshot:gue}=$g,{useCallback:mue,useContext:h5,useEffect:YS,useMemo:yue,useRef:_ue,useState:bue}=K;function eh(){throw Pt("This component must be used inside a <RecoilRoot> component.")}const p5=Object.freeze({storeID:c5(),getState:eh,replaceState:eh,getGraph:eh,subscribeToTransactions:eh,addTransactionMetadata:eh});let QS=!1;function v5(e){if(QS)throw Pt("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){Mr("recoil_memory_managament_2020")&&Mr("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&d5(e);const r=t.currentTree.version,n=sue();t.nextTree={...t.currentTree,version:n,stateID:n,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(n,pue(zr(t.graphsByVersion.get(r))))}}const g5=K.createContext({current:p5}),XS=()=>h5(g5),m5=K.createContext(null);function Eue(){const e=h5(m5);return e==null&&MS("Attempted to use a Recoil hook outside of a <RecoilRoot>. <RecoilRoot> must be an ancestor of any component that uses Recoil hooks."),e}function y5(e,t,r){const n=lue(e,r,r.dirtyAtoms);for(const i of n){const a=t.nodeToComponentSubscriptions.get(i);if(a)for(const[o,[s,u]]of a)u(r)}}function wue(e){const t=e.getState(),r=t.currentTree,n=r.dirtyAtoms;if(n.size){for(const[i,a]of t.nodeTransactionSubscriptions)if(n.has(i))for(const[o,s]of a)s(e);for(const[i,a]of t.transactionSubscriptions)a(e);(!f5().early||t.suspendedComponentResolvers.size>0)&&(y5(e,t,r),t.suspendedComponentResolvers.forEach(i=>i()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(i=>i(r)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function xue(e){const t=e.getState();t.commitDepth++;try{const{nextTree:r}=t;if(r==null)return;t.previousTree=t.currentTree,t.currentTree=r,t.nextTree=null,wue(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):Xn("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Mr("recoil_memory_managament_2020")&&r==null&&d5(e)}finally{t.commitDepth--}}function Sue({setNotifyBatcherOfChange:e}){const t=XS(),[,r]=bue([]);return e(()=>r({})),YS(()=>(e(()=>r({})),()=>{e(()=>{})}),[e]),YS(()=>{coe.enqueueExecution("Batcher",()=>{xue(t.current)})}),null}process.env.NODE_ENV!=="production"&&typeof window<"u"&&!window.$recoilDebugStates&&(window.$recoilDebugStates=[]);function Rue(e,t){const r=l5();return t({set:(n,i)=>{const a=r.currentTree,o=fue(e,a,n.key,i),s=new Set(o.keys()),u=a.nonvalidatedAtoms.clone();for(const l of s)u.delete(l);r.currentTree={...a,dirtyAtoms:iue(a.dirtyAtoms,s),atomValues:vue(a.atomValues,o),nonvalidatedAtoms:u}},setUnvalidatedAtomValues:n=>{n.forEach((i,a)=>{r.currentTree=due(r.currentTree,a,i)})}}),r}function Oue(e){const t=gue(e),r=t.getStore_INTERNAL().getState();return t.retain(),r.nodeCleanupFunctions.forEach(n=>n()),r.nodeCleanupFunctions.clear(),r}let _5=0;function Aue({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:r,children:n}){let i;const a=h=>{const m=i.current.graphsByVersion;if(m.has(h))return zr(m.get(h));const p=hue();return m.set(h,p),p},o=(h,m)=>{if(m==null){const{transactionSubscriptions:p}=f.current.getState(),g=_5++;return p.set(g,h),{release:()=>{p.delete(g)}}}else{const{nodeTransactionSubscriptions:p}=f.current.getState();p.has(m)||p.set(m,new Map);const g=_5++;return zr(p.get(m)).set(g,h),{release:()=>{const y=p.get(m);y&&(y.delete(g),y.size===0&&p.delete(m))}}}},s=h=>{v5(f.current);for(const m of Object.keys(h))zr(f.current.getState().nextTree).transactionMetadata[m]=h[m]},u=h=>{v5(f.current);const m=zr(i.current.nextTree);let p;try{QS=!0,p=h(m)}finally{QS=!1}p!==m&&(process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.$recoilDebugStates.push(p),i.current.nextTree=p,f5().early&&y5(f.current,i.current,p),zr(l.current)())},l=_ue(null),c=mue(h=>{l.current=h},[l]),f=u5(()=>r??{storeID:c5(),getState:()=>i.current,replaceState:u,getGraph:a,subscribeToTransactions:o,addTransactionMetadata:s});r!=null&&(f.current=r),i=u5(()=>e!=null?Rue(f.current,e):t!=null?Oue(t):l5());const d=yue(()=>KS?.(i,()=>i.current.currentTree.version),[i]);return YS(()=>{const h=f.current;for(const m of new Set(h.getState().knownAtoms))cue(h,m,"get");return()=>{for(const m of h.getState().knownAtoms)uue(h,m)}},[f]),K.createElement(g5.Provider,{value:f},K.createElement(m5.Provider,{value:d},K.createElement(Sue,{setNotifyBatcherOfChange:c}),n))}function Tue(e){const{override:t,...r}=e,n=XS();return t===!1&&n.current!==p5?e.children:K.createElement(Aue,r)}var Vg={RecoilRoot:Tue,useStoreRef:XS,useRecoilMutableSource:Eue};function Cue(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}var Pue=Cue;const{useEffect:Nue,useRef:Due}=K;function Iue(e){const t=Due();return Nue(()=>{t.current=e}),t.current}var kue=Iue;const{useStoreRef:Mue}=Vg,{SUSPENSE_TIMEOUT_MS:Lue}=Ic,{updateRetainCount:th}=Ic,{RetentionZone:jue}=VS,{useEffect:Fue,useRef:$ue}=K,{isSSR:b5}=Mg;function Vue(e){if(Mr("recoil_memory_managament_2020"))return que(e)}function que(e){const r=(Array.isArray(e)?e:[e]).map(o=>o instanceof jue?o:o.key),n=Mue();Fue(()=>{if(!Mr("recoil_memory_managament_2020"))return;const o=n.current;if(i.current&&!b5)window.clearTimeout(i.current),i.current=null;else for(const s of r)th(o,s,1);return()=>{for(const s of r)th(o,s,-1)}},[n,...r]);const i=$ue(),a=kue(r);if(!b5&&(a===void 0||!Pue(a,r))){const o=n.current;for(const s of r)th(o,s,1);if(a)for(const s of a)th(o,s,-1);i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null;for(const s of r)th(o,s,-1)},Lue)}}var Bue=Vue;function Uue(){return"<component name not available>"}var qg=Uue;const{currentRendererSupportsUseSyncExternalStore:zue,reactMode:rh,useMutableSource:Wue,useSyncExternalStore:Hue}=IS,{useRecoilMutableSource:Gue,useStoreRef:kc}=Vg,{isRecoilValue:Kue}=rl,{getRecoilValueAsLoadable:Bg,setRecoilValue:Yue,subscribeToRecoilValue:Ug}=es,{useCallback:Ga,useEffect:zg,useMemo:Que,useRef:E5,useState:w5}=K,{isSSR:Xue}=Mg;function Zue(e,t,r){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(i=>{const a=r.current.getState().suspendedComponentResolvers;a.add(i),Xue&&Tr(e.contents)&&e.contents.finally(()=>{a.delete(i)})}):e.state==="hasError"?e.contents:Pt(`Invalid value of loadable atom "${t.key}"`)}function ZS(e,t){if(!Kue(e))throw Pt(`Invalid argument to ${t}: expected an atom or selector but got ${String(e)}`)}function Jue(e){const t=kc(),r=qg(),n=Ga(()=>{var s;process.env.NODE_ENV;const u=t.current,l=u.getState(),c=rh().early&&(s=l.nextTree)!==null&&s!==void 0?s:l.currentTree;return{loadable:Bg(u,e,c),key:e.key}},[t,e]),i=Ga(s=>{let u;return()=>{var l,c;const f=s();return(l=u)!==null&&l!==void 0&&l.loadable.is(f.loadable)&&((c=u)===null||c===void 0?void 0:c.key)===f.key?u:(u=f,f)}},[]),a=Que(()=>i(n),[n,i]),o=Ga(s=>{const u=t.current;return Ug(u,e,s,r).release},[t,e,r]);return Hue(o,a,a).loadable}function ele(e){const t=kc(),r=Ga(()=>{var l;const c=t.current,f=c.getState(),d=rh().early&&(l=f.nextTree)!==null&&l!==void 0?l:f.currentTree;return Bg(c,e,d)},[t,e]),n=Ga(()=>(process.env.NODE_ENV,r()),[r]),i=qg(),a=Ga((l,c)=>{const f=t.current;return Ug(f,e,()=>{if(!Mr("recoil_suppress_rerender_in_callback"))return c();const h=r();u.current.is(h)||c(),u.current=h},i).release},[t,e,i,r]),o=Gue();if(o==null)throw Pt("Recoil hooks must be used in components contained within a <RecoilRoot> component.");const s=Wue(o,n,a),u=E5(s);return zg(()=>{u.current=s}),s}function x5(e){const t=kc(),r=qg(),n=Ga(()=>{var u;process.env.NODE_ENV;const l=t.current,c=l.getState(),f=rh().early&&(u=c.nextTree)!==null&&u!==void 0?u:c.currentTree;return Bg(l,e,f)},[t,e]),i=Ga(()=>({loadable:n(),key:e.key}),[n,e.key]),a=Ga(u=>{const l=i();return u.loadable.is(l.loadable)&&u.key===l.key?u:l},[i]);zg(()=>{const u=Ug(t.current,e,l=>{s(a)},r);return s(a),u.release},[r,e,t,a]);const[o,s]=w5(i);return o.key!==e.key?i().loadable:o.loadable}function tle(e){const t=kc(),[,r]=w5([]),n=qg(),i=Ga(()=>{var s;process.env.NODE_ENV;const u=t.current,l=u.getState(),c=rh().early&&(s=l.nextTree)!==null&&s!==void 0?s:l.currentTree;return Bg(u,e,c)},[t,e]),a=i(),o=E5(a);return zg(()=>{o.current=a}),zg(()=>{const s=t.current,u=s.getState(),l=Ug(s,e,f=>{var d;if(!Mr("recoil_suppress_rerender_in_callback"))return r([]);const h=i();(d=o.current)!==null&&d!==void 0&&d.is(h)||r(h),o.current=h},n);if(u.nextTree)s.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{o.current=null,r([])});else{var c;if(!Mr("recoil_suppress_rerender_in_callback"))return r([]);const f=i();(c=o.current)!==null&&c!==void 0&&c.is(f)||r(f),o.current=f}return l.release},[n,i,e,t]),a}function rle(e){return process.env.NODE_ENV!=="production"&&ZS(e,"useRecoilValueLoadable"),Mr("recoil_memory_managament_2020")&&Bue(e),{TRANSITION_SUPPORT:x5,SYNC_EXTERNAL_STORE:zue()?Jue:x5,MUTABLE_SOURCE:ele,LEGACY:tle}[rh().mode](e)}function nle(e){process.env.NODE_ENV!=="production"&&ZS(e,"useRecoilValue");const t=kc(),r=rle(e);return Zue(r,e,t)}function ile(e){process.env.NODE_ENV!=="production"&&ZS(e,"useSetRecoilState");const t=kc();return Ga(r=>{Yue(t.current,e,r)},[t,e])}var ale={useRecoilValue:nle,useSetRecoilState:ile};const{batchUpdates:ole}=WS,{DEFAULT_VALUE:sle,getNode:ule}=Ha,{AbstractRecoilValue:lle,setRecoilValueLoadable:cle}=es,{cloneSnapshot:wGe}=$g,{useCallback:xGe,useEffect:SGe,useRef:RGe,useState:OGe}=K;function fle(e,t){var r;const n=e.getState(),i=(r=n.nextTree)!==null&&r!==void 0?r:n.currentTree,a=t.getStore_INTERNAL().getState().currentTree;ole(()=>{const o=new Set;for(const l of[i.atomValues.keys(),a.atomValues.keys()])for(const c of l){var s,u;((s=i.atomValues.get(c))===null||s===void 0?void 0:s.contents)!==((u=a.atomValues.get(c))===null||u===void 0?void 0:u.contents)&&ule(c).shouldRestoreFromSnapshots&&o.add(c)}o.forEach(l=>{cle(e,new lle(l),a.atomValues.has(l)?zr(a.atomValues.get(l)):sle)}),e.replaceState(l=>({...l,stateID:t.getID()}))})}var dle={gotoSnapshot:fle};const{useMemo:AGe}=K,{loadableWithValue:hle}=Yd,{initializeNode:ple}=nl,{DEFAULT_VALUE:vle,getNode:gle}=Ha,{copyTreeState:mle,getRecoilValueAsLoadable:yle,invalidateDownstreams:_le,writeLoadableToTreeState:ble}=es;function S5(e){return gle(e.key).nodeType==="atom"}class Ele{constructor(t,r){jt(this,"_store",void 0),jt(this,"_treeState",void 0),jt(this,"_changes",void 0),jt(this,"get",n=>{if(this._changes.has(n.key))return this._changes.get(n.key);if(!S5(n))throw Pt("Reading selectors within atomicUpdate is not supported");const i=yle(this._store,n,this._treeState);if(i.state==="hasValue")return i.contents;throw i.state==="hasError"?i.contents:Pt(`Expected Recoil atom ${n.key} to have a value, but it is in a loading state.`)}),jt(this,"set",(n,i)=>{if(!S5(n))throw Pt("Setting selectors within atomicUpdate is not supported");if(typeof i=="function"){const a=this.get(n);this._changes.set(n.key,i(a))}else ple(this._store,n.key,"set"),this._changes.set(n.key,i)}),jt(this,"reset",n=>{this.set(n,vle)}),this._store=t,this._treeState=r,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=mle(this._treeState);for(const[r,n]of this._changes)ble(t,r,hle(n));return _le(this._store,t),t}}function wle(e){return t=>{e.replaceState(r=>{const n=new Ele(e,r);return t(n),n.newTreeState_INTERNAL()})}}var xle={atomicUpdater:wle},Sle=xle.atomicUpdater,R5=Object.freeze({__proto__:null,atomicUpdater:Sle});function Rle(e,t){if(!e)throw new Error(t)}var Ole=Rle,Eo=Ole;const{atomicUpdater:Ale}=R5,{batchUpdates:Tle}=WS,{DEFAULT_VALUE:Cle}=Ha,{useStoreRef:Ple}=Vg,{refreshRecoilValue:Nle,setRecoilValue:O5}=es,{cloneSnapshot:Dle}=$g,{gotoSnapshot:Ile}=dle,{useCallback:kle}=K;class A5{}const Mle=new A5;function T5(e,t,r,n){let i=Mle,a;if(Tle(()=>{const s="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 Pt(s);const u=Lj({...n??{},set:(c,f)=>O5(e,c,f),reset:c=>O5(e,c,Cle),refresh:c=>Nle(e,c),gotoSnapshot:c=>Ile(e,c),transact_UNSTABLE:c=>Ale(e)(c)},{snapshot:()=>{const c=Dle(e);return a=c.retain(),c}}),l=t(u);if(typeof l!="function")throw Pt(s);i=l(...r)}),i instanceof A5&&(process.env.NODE_ENV!=="production"?Eo(!1,"batchUpdates should return immediately"):Eo(!1)),Tr(i))i=i.finally(()=>{var s;(s=a)===null||s===void 0||s()});else{var o;(o=a)===null||o===void 0||o()}return i}function Lle(e,t){const r=Ple();return kle((...n)=>T5(r.current,e,n),t!=null?[...t,r]:void 0)}var C5={recoilCallback:T5,useRecoilCallback:Lle};const{useCallback:TGe}=K,{atomicUpdater:CGe}=R5,{useMemo:PGe}=K;class jle{constructor(t){jt(this,"value",void 0),this.value=t}}var Fle={WrappedValue:jle},$le=Fle.WrappedValue,P5=Object.freeze({__proto__:null,WrappedValue:$le});class N5 extends Error{}class Vle{constructor(t){var r,n,i;jt(this,"_name",void 0),jt(this,"_numLeafs",void 0),jt(this,"_root",void 0),jt(this,"_onHit",void 0),jt(this,"_onSet",void 0),jt(this,"_mapNodeValue",void 0),this._name=t?.name,this._numLeafs=0,this._root=null,this._onHit=(r=t?.onHit)!==null&&r!==void 0?r:()=>{},this._onSet=(n=t?.onSet)!==null&&n!==void 0?n:()=>{},this._mapNodeValue=(i=t?.mapNodeValue)!==null&&i!==void 0?i:a=>a}size(){return this._numLeafs}root(){return this._root}get(t,r){var n;return(n=this.getLeafNode(t,r))===null||n===void 0?void 0:n.value}getLeafNode(t,r){if(this._root==null)return;let n=this._root;for(;n;){if(r?.onNodeVisit(n),n.type==="leaf")return this._onHit(n),n;const i=this._mapNodeValue(t(n.nodeKey));n=n.branches.get(i)}}set(t,r,n){const i=()=>{var a,o,s,u;let l,c;for(const[g,y]of t){var f,d,h;const b=this._root;if(b?.type==="leaf")throw this.invalidCacheError();const E=l;if(l=E?E.branches.get(c):b,l=(f=l)!==null&&f!==void 0?f:{type:"branch",nodeKey:g,parent:E,branches:new Map,branchKey:c},l.type!=="branch"||l.nodeKey!==g)throw this.invalidCacheError();E?.branches.set(c,l),n==null||(d=n.onNodeVisit)===null||d===void 0||d.call(n,l),c=this._mapNodeValue(y),this._root=(h=this._root)!==null&&h!==void 0?h:l}const m=l?(a=l)===null||a===void 0?void 0:a.branches.get(c):this._root;if(m!=null&&(m.type!=="leaf"||m.branchKey!==c))throw this.invalidCacheError();const p={type:"leaf",value:r,parent:l,branchKey:c};(o=l)===null||o===void 0||o.branches.set(c,p),this._root=(s=this._root)!==null&&s!==void 0?s:p,this._numLeafs++,this._onSet(p),n==null||(u=n.onNodeVisit)===null||u===void 0||u.call(n,p)};try{i()}catch(a){if(a instanceof N5)this.clear(),i();else throw a}}delete(t){const r=this.root();if(!r)return!1;if(t===r)return this._root=null,this._numLeafs=0,!0;let n=t.parent,i=t.branchKey;for(;n;){var a;if(n.branches.delete(i),n===r)return n.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(n.branches.size>0)break;i=(a=n)===null||a===void 0?void 0:a.branchKey,n=n.parent}for(;n!==r;n=n.parent)if(n==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){throw Xn("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."+(this._name!=null?` - ${this._name}`:"")),new N5}}var qle={TreeCache:Vle},Ble=qle.TreeCache,D5=Object.freeze({__proto__:null,TreeCache:Ble});class Ule{constructor(t){var r;jt(this,"_maxSize",void 0),jt(this,"_size",void 0),jt(this,"_head",void 0),jt(this,"_tail",void 0),jt(this,"_map",void 0),jt(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(r=t.mapKey)!==null&&r!==void 0?r:n=>n}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 r=this._keyMapper(t),n=this._map.get(r);if(n)return this.set(t,n.value),n.value}set(t,r){const n=this._keyMapper(t);this._map.get(n)&&this.delete(t);const a=this.head(),o={key:t,right:a,left:null,value:r};a?a.left=o:this._tail=o,this._map.set(n,o),this._head=o,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const r=this._keyMapper(t);if(!this._size||!this._map.has(r))return;const n=zr(this._map.get(r)),i=n.right,a=n.left;i&&(i.left=n.left),a&&(a.right=n.right),n===this.head()&&(this._head=i),n===this.tail()&&(this._tail=a),this._map.delete(r),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var zle={LRUCache:Ule},Wle=zle.LRUCache,I5=Object.freeze({__proto__:null,LRUCache:Wle});const{LRUCache:Hle}=I5,{TreeCache:Gle}=D5;function Kle({name:e,maxSize:t,mapNodeValue:r=n=>n}){const n=new Hle({maxSize:t}),i=new Gle({name:e,mapNodeValue:r,onHit:a=>{n.set(a,!0)},onSet:a=>{const o=n.tail();n.set(a,!0),o&&i.size()>t&&i.delete(o.key)}});return i}var k5=Kle;const Yle=15;function ma(e,t,r){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?.allowFunctions!==!0)throw Pt("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var n;return(n=JSON.stringify(e))!==null&&n!==void 0?n:""}if(Tr(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((i,a)=>ma(i,t,a.toString()))}]`;if(typeof e.toJSON=="function")return ma(e.toJSON(r),t,r);if(e instanceof Map){const i={};for(const[a,o]of e)i[typeof a=="string"?a:ma(a,t)]=o;return ma(i,t,r)}return e instanceof Set?ma(Array.from(e).sort((i,a)=>ma(i,t).localeCompare(ma(a,t))),t,r):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?ma(Array.from(e),t,r):`{${Object.keys(e).filter(i=>e[i]!==void 0).sort().map(i=>`${ma(i,t)}:${ma(e[i],t,i)}`).join(",")}}`}function Qle(e,t={allowFunctions:!1}){if(process.env.NODE_ENV!=="production"&&typeof window<"u"){const r=window.performance?window.performance.now():0,n=ma(e,t),i=window.performance?window.performance.now():0;return i-r>Yle&&(console.groupCollapsed(`Recoil: Spent ${i-r}ms computing a cache key`),console.warn(e,n),console.groupEnd()),n}return ma(e,t)}var JS=Qle;const{TreeCache:Xle}=D5,Wg={equality:"reference",eviction:"keep-all",maxSize:1/0};function Zle({equality:e=Wg.equality,eviction:t=Wg.eviction,maxSize:r=Wg.maxSize}=Wg,n){const i=Jle(e);return ece(t,r,i,n)}function Jle(e){switch(e){case"reference":return t=>t;case"value":return t=>JS(t)}throw Pt(`Unrecognized equality policy ${e}`)}function ece(e,t,r,n){switch(e){case"keep-all":return new Xle({name:n,mapNodeValue:r});case"lru":return k5({name:n,maxSize:zr(t),mapNodeValue:r});case"most-recent":return k5({name:n,maxSize:1,mapNodeValue:r})}throw Pt(`Unrecognized eviction policy ${e}`)}var tce=Zle;function rce(e){var t,r;if(typeof window>"u")return!1;const i=(r=(e!=null?(t=e.ownerDocument)!==null&&t!==void 0?t:e:document).defaultView)!==null&&r!==void 0?r:window;return e!=null&&(typeof i.Node=="function"?e instanceof i.Node:typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string")}var nce=rce;const{isReactNative:ice,isWindow:ace}=Mg;function oce(e){if(e===null||typeof e!="object")return!0;switch(typeof e.$$typeof){case"symbol":return!0;case"number":return!0}return!!(e["@@__IMMUTABLE_ITERABLE__@@"]!=null||e["@@__IMMUTABLE_KEYED__@@"]!=null||e["@@__IMMUTABLE_INDEXED__@@"]!=null||e["@@__IMMUTABLE_ORDERED__@@"]!=null||e["@@__IMMUTABLE_RECORD__@@"]!=null||nce(e)||Tr(e)||e instanceof Error||ArrayBuffer.isView(e)||!ice&&ace(e))}function M5(e){if(!(typeof e!="object"||oce(e))){Object.freeze(e);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];typeof r=="object"&&r!=null&&!Object.isFrozen(r)&&M5(r)}Object.seal(e)}}var eR=M5;const{isLoadable:sce,loadableWithError:Hg,loadableWithPromise:uce,loadableWithValue:tR}=Yd,{WrappedValue:L5}=P5,{getNodeLoadable:Gg,peekNodeLoadable:lce,setNodeValue:cce}=nl,{saveDepsToStore:fce}=Xd,{DEFAULT_VALUE:dce,getConfigDeletionHandler:hce,getNode:pce,registerNode:j5}=Ha,{isRecoilValue:vce}=rl,{markRecoilValueModified:F5}=es,{retainedByOptionWithDefault:gce}=Ic,{recoilCallback:mce}=C5;class $5{}const nh=new $5,ih=[],Kg=new Map,yce=(()=>{let e=0;return()=>e++})();function V5(e){let t=null;const{key:r,get:n,cachePolicy_UNSTABLE:i}=e,a=e.set!=null?e.set:void 0;if(process.env.NODE_ENV!=="production"){if(typeof r!="string")throw Pt("A key option with a unique string value must be provided when creating a selector.");if(typeof n!="function")throw Pt("Selectors must specify a get callback option to get the selector value.")}const o=new Set,s=tce(i??{equality:"reference",eviction:"keep-all"},r),u=gce(e.retainedBy_UNSTABLE),l=new Map;let c=0;function f(){return!Mr("recoil_memory_managament_2020")||c>0}function d(O){return O.getState().knownSelectors.add(r),c++,()=>{c--}}function h(){return hce(r)!==void 0&&!f()}function m(O,$,q,W,z){L($,W,z),p(O,q)}function p(O,$){A(O,$)&&P(O),y($,!0)}function g(O,$){A(O,$)&&(zr(k(O)).stateVersions.clear(),y($,!1))}function y(O,$){const q=Kg.get(O);if(q!=null){for(const W of q)F5(W,zr(t));$&&Kg.delete(O)}}function b(O,$){let q=Kg.get($);q==null&&Kg.set($,q=new Set),q.add(O)}function E(O,$,q,W,z,Y){return $.then(Q=>{if(!f())throw P(O),nh;const Z=tR(Q);return m(O,q,z,Z,W),Q}).catch(Q=>{if(!f())throw P(O),nh;if(Tr(Q))return w(O,Q,q,W,z,Y);const Z=Hg(Q);throw m(O,q,z,Z,W),Q})}function w(O,$,q,W,z,Y){return $.then(Q=>{if(!f())throw P(O),nh;Y.loadingDepKey!=null&&Y.loadingDepPromise===$?q.atomValues.set(Y.loadingDepKey,tR(Q)):O.getState().knownSelectors.forEach(ee=>{q.atomValues.delete(ee)});const Z=S(O,q);if(Z&&Z.state!=="loading"){if((A(O,z)||k(O)==null)&&p(O,z),Z.state==="hasValue")return Z.contents;throw Z.contents}if(!A(O,z)){const ee=M(O,q);if(ee!=null)return ee.loadingLoadable.contents}const[re,ie]=R(O,q,z);if(re.state!=="loading"&&m(O,q,z,re,ie),re.state==="hasError")throw re.contents;return re.contents}).catch(Q=>{if(Q instanceof $5)throw nh;if(!f())throw P(O),nh;const Z=Hg(Q);throw m(O,q,z,Z,W),Q})}function x(O,$,q,W){var z,Y,Q,Z;if(A(O,W)||$.version===((z=O.getState())===null||z===void 0||(Y=z.currentTree)===null||Y===void 0?void 0:Y.version)||$.version===((Q=O.getState())===null||Q===void 0||(Z=Q.nextTree)===null||Z===void 0?void 0:Z.version)){var re,ie,ee;fce(r,q,O,(re=(ie=O.getState())===null||ie===void 0||(ee=ie.nextTree)===null||ee===void 0?void 0:ee.version)!==null&&re!==void 0?re:O.getState().currentTree.version)}for(const fe of q)o.add(fe)}function R(O,$,q){let W=!0,z=!0;const Y=()=>{z=!1};let Q,Z=!1,re;const ie={loadingDepKey:null,loadingDepPromise:null},ee=new Map;function fe({key:se}){const ce=Gg(O,$,se);switch(ee.set(se,ce),W||(x(O,$,new Set(ee.keys()),q),g(O,q)),ce.state){case"hasValue":return ce.contents;case"hasError":throw ce.contents;case"loading":throw ie.loadingDepKey=se,ie.loadingDepPromise=ce.contents,ce.contents}throw Pt("Invalid Loadable state")}const ue=se=>(...ce)=>{if(z)throw Pt("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&&(process.env.NODE_ENV!=="production"?Eo(!1,"Recoil Value can never be null"):Eo(!1)),mce(O,se,ce,{node:t})};try{Q=n({get:fe,getCallback:ue}),Q=vce(Q)?fe(Q):Q,sce(Q)&&(Q.state==="hasError"&&(Z=!0),Q=Q.contents),Tr(Q)?Q=E(O,Q,$,ee,q,ie).finally(Y):Y(),Q=Q instanceof L5?Q.value:Q}catch(se){Q=se,Tr(Q)?Q=w(O,Q,$,ee,q,ie).finally(Y):(Z=!0,Y())}return Z?re=Hg(Q):Tr(Q)?re=uce(Q):re=tR(Q),W=!1,V(O,q,ee),x(O,$,new Set(ee.keys()),q),[re,ee]}function S(O,$){let q=$.atomValues.get(r);if(q!=null)return q;const W=new Set;try{q=s.get(Y=>(typeof Y!="string"&&(process.env.NODE_ENV!=="production"?Eo(!1,"Cache nodeKey is type string"):Eo(!1)),Gg(O,$,Y).contents),{onNodeVisit:Y=>{Y.type==="branch"&&Y.nodeKey!==r&&W.add(Y.nodeKey)}})}catch(Y){throw Pt(`Problem with cache lookup for selector "${r}": ${Y.message}`)}if(q){var z;$.atomValues.set(r,q),x(O,$,W,(z=k(O))===null||z===void 0?void 0:z.executionID)}return q}function j(O,$){const q=S(O,$);if(q!=null)return P(O),q;const W=M(O,$);if(W!=null){var z;return((z=W.loadingLoadable)===null||z===void 0?void 0:z.state)==="loading"&&b(O,W.executionID),W.loadingLoadable}const Y=yce(),[Q,Z]=R(O,$,Y);return Q.state==="loading"?(F(O,Y,Q,Z,$),b(O,Y)):(P(O),L($,Q,Z)),Q}function M(O,$){const q=e5([l.has(O)?[zr(l.get(O))]:[],Ng(qS(l,([z])=>z!==O),([,z])=>z)]);function W(z){for(const[Y,Q]of z)if(!Gg(O,$,Y).is(Q))return!0;return!1}for(const z of q){if(z.stateVersions.get($.version)||!W(z.depValuesDiscoveredSoFarDuringAsyncWork))return z.stateVersions.set($.version,!0),z;z.stateVersions.set($.version,!1)}}function k(O){return l.get(O)}function F(O,$,q,W,z){l.set(O,{depValuesDiscoveredSoFarDuringAsyncWork:W,executionID:$,loadingLoadable:q,stateVersions:new Map([[z.version,!0]])})}function V(O,$,q){if(A(O,$)){const W=k(O);W!=null&&(W.depValuesDiscoveredSoFarDuringAsyncWork=q)}}function P(O){l.delete(O)}function A(O,$){var q;return $===((q=k(O))===null||q===void 0?void 0:q.executionID)}function I(O){return Array.from(O.entries()).map(([$,q])=>[$,q.contents])}function L(O,$,q){process.env.NODE_ENV!=="production"&&$.state!=="loading"&&!e.dangerouslyAllowMutability&&eR($.contents),O.atomValues.set(r,$);try{s.set(I(q),$)}catch(W){throw Pt(`Problem with setting cache for selector "${r}": ${W.message}`)}}function B(O){if(ih.includes(r)){const $=`Recoil selector has circular dependencies: ${ih.slice(ih.indexOf(r)).join(" → ")}`;return Hg(Pt($))}ih.push(r);try{return O()}finally{ih.pop()}}function H(O,$){const q=$.atomValues.get(r);return q??s.get(W=>{var z;return typeof W!="string"&&(process.env.NODE_ENV!=="production"?Eo(!1,"Cache nodeKey is type string"):Eo(!1)),(z=lce(O,$,W))===null||z===void 0?void 0:z.contents})}function U(O,$){return B(()=>j(O,$))}function T(O){O.atomValues.delete(r)}function D(O,$){t==null&&(process.env.NODE_ENV!=="production"?Eo(!1,"Recoil Value can never be null"):Eo(!1));for(const W of o){var q;const z=pce(W);(q=z.clearCache)===null||q===void 0||q.call(z,O,$)}o.clear(),T($),s.clear(),F5(O,t)}return a!=null?t=j5({key:r,nodeType:"selector",peek:H,get:U,set:($,q,W)=>{let z=!1;const Y=new Map;function Q({key:ee}){if(z)throw Pt("Recoil: Async selector sets are not currently supported.");const fe=Gg($,q,ee);if(fe.state==="hasValue")return fe.contents;if(fe.state==="loading"){const ue=`Getting value of asynchronous atom or selector "${ee}" in a pending state while setting selector "${r}" is not yet supported.`;throw Xn(ue),Pt(ue)}else throw fe.contents}function Z(ee,fe){if(z){const ce="Recoil: Async selector sets are not currently supported.";throw Xn(ce),Pt(ce)}const ue=typeof fe=="function"?fe(Q(ee)):fe;cce($,q,ee.key,ue).forEach((ce,ae)=>Y.set(ae,ce))}function re(ee){Z(ee,dce)}const ie=a({set:Z,get:Q,reset:re},W);if(ie!==void 0)throw Tr(ie)?Pt("Recoil: Async selector sets are not currently supported."):Pt("Recoil: selector set should be a void function.");return z=!0,Y},init:d,invalidate:T,clearCache:D,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:u}):t=j5({key:r,nodeType:"selector",peek:H,get:U,init:d,invalidate:T,clearCache:D,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:u})}V5.value=e=>new L5(e);var ah=V5;const{isLoadable:_ce,loadableWithError:rR,loadableWithPromise:nR,loadableWithValue:Mc}=Yd,{WrappedValue:q5}=P5,{peekNodeInfo:bce}=nl,{DEFAULT_VALUE:il,DefaultValue:au,getConfigDeletionHandler:B5,registerNode:Ece,setConfigDeletionHandler:wce}=Ha,{isRecoilValue:xce}=rl,{getRecoilValueAsLoadable:Sce,markRecoilValueModified:Rce,setRecoilValue:U5,setRecoilValueLoadable:Oce}=es,{retainedByOptionWithDefault:Ace}=Ic,oh=e=>e instanceof q5?e.value:e;function Tce(e){const{key:t,persistence_UNSTABLE:r}=e,n=Ace(e.retainedBy_UNSTABLE);let i=0;function a(b){return nR(b.then(E=>(o=Mc(E),E)).catch(E=>{throw o=rR(E),E}))}let o=Tr(e.default)?a(e.default):_ce(e.default)?e.default.state==="loading"?a(e.default.contents):e.default:Mc(oh(e.default));l(o.contents);let s;const u=new Map;function l(b){return process.env.NODE_ENV!=="production"&&e.dangerouslyAllowMutability!==!0?Tr(b)?b.then(E=>(eR(E),E)):(eR(b),b):b}function c(b,E){const w=E.then(x=>{var R,S;return((S=((R=b.getState().nextTree)!==null&&R!==void 0?R:b.getState().currentTree).atomValues.get(t))===null||S===void 0?void 0:S.contents)===w&&U5(b,y,x),x}).catch(x=>{var R,S;throw((S=((R=b.getState().nextTree)!==null&&R!==void 0?R:b.getState().currentTree).atomValues.get(t))===null||S===void 0?void 0:S.contents)===w&&Oce(b,y,rR(x)),x});return w}function f(b,E,w){var x;i++;const R=()=>{var k;i--,(k=u.get(b))===null||k===void 0||k.forEach(F=>F()),u.delete(b)};if(b.getState().knownAtoms.add(t),o.state==="loading"){const k=()=>{var F;((F=b.getState().nextTree)!==null&&F!==void 0?F:b.getState().currentTree).atomValues.has(t)||Rce(b,y)};o.contents.finally(k)}const S=(x=e.effects)!==null&&x!==void 0?x:e.effects_UNSTABLE;if(S!=null){let A=function(T){if(F&&T.key===t){const D=k;return D instanceof au?d(b,E):Tr(D)?nR(D.then(O=>O instanceof au?o.toPromise():O)):Mc(D)}return Sce(b,T)},I=function(T){return A(T).toPromise()},L=function(T){var D;const O=bce(b,(D=b.getState().nextTree)!==null&&D!==void 0?D:b.getState().currentTree,T.key);return F&&T.key===t&&!(k instanceof au)?{...O,isSet:!0,loadable:A(T)}:O},k=il,F=!0,V=!1,P=null;const B=T=>D=>{if(F){const O=A(y),$=O.state==="hasValue"?O.contents:il;k=typeof D=="function"?D($):D,Tr(k)&&(k=k.then(q=>(P={effect:T,value:q},q)))}else{if(Tr(D))throw Pt("Setting atoms to async values is not implemented.");typeof D!="function"&&(P={effect:T,value:oh(D)}),U5(b,y,typeof D=="function"?O=>{const $=oh(D(O));return P={effect:T,value:$},$}:oh(D))}},H=T=>()=>B(T)(il),U=T=>D=>{var O;const{release:$}=b.subscribeToTransactions(q=>{var W;let{currentTree:z,previousTree:Y}=q.getState();Y||(Xn("Transaction subscribers notified without a next tree being present -- this is a bug in Recoil"),Y=z);const Q=(W=z.atomValues.get(t))!==null&&W!==void 0?W:o;if(Q.state==="hasValue"){var Z,re,ie,ee;const fe=Q.contents,ue=(Z=Y.atomValues.get(t))!==null&&Z!==void 0?Z:o,se=ue.state==="hasValue"?ue.contents:il;((re=P)===null||re===void 0?void 0:re.effect)!==T||((ie=P)===null||ie===void 0?void 0:ie.value)!==fe?D(fe,se,!z.atomValues.has(t)):((ee=P)===null||ee===void 0?void 0:ee.effect)===T&&(P=null)}},t);u.set(b,[...(O=u.get(b))!==null&&O!==void 0?O:[],$])};for(const T of S)try{const D=T({node:y,storeID:b.storeID,parentStoreID_UNSTABLE:b.parentStoreID,trigger:w,setSelf:B(T),resetSelf:H(T),onSet:U(T),getPromise:I,getLoadable:A,getInfo_UNSTABLE:L});if(D!=null){var j;u.set(b,[...(j=u.get(b))!==null&&j!==void 0?j:[],D])}}catch(D){k=D,V=!0}if(F=!1,!(k instanceof au)){var M;const T=V?rR(k):Tr(k)?nR(c(b,k)):Mc(oh(k));l(T.contents),E.atomValues.set(t,T),(M=b.getState().nextTree)===null||M===void 0||M.atomValues.set(t,T)}}return R}function d(b,E){var w,x;return(w=(x=E.atomValues.get(t))!==null&&x!==void 0?x:s)!==null&&w!==void 0?w:o}function h(b,E){if(E.atomValues.has(t))return zr(E.atomValues.get(t));if(E.nonvalidatedAtoms.has(t)){if(s!=null)return s;if(r==null)return MS(`Tried to restore a persisted value for atom ${t} but it has no persistence settings.`),o;const w=E.nonvalidatedAtoms.get(t),x=r.validator(w,il);return s=x instanceof au?o:Mc(x),s}else return o}function m(){s=void 0}function p(b,E,w){if(E.atomValues.has(t)){const x=zr(E.atomValues.get(t));if(x.state==="hasValue"&&w===x.contents)return new Map}else if(!E.nonvalidatedAtoms.has(t)&&w instanceof au)return new Map;return l(w),s=void 0,new Map().set(t,Mc(w))}function g(){return B5(t)!==void 0&&i<=0}const y=Ece({key:t,nodeType:"atom",peek:d,get:h,set:p,init:f,invalidate:m,shouldDeleteConfigOnRelease:g,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:n});return y}function iR(e){if(process.env.NODE_ENV!=="production"&&typeof e.key!="string")throw Pt("A key option with a unique string value must be provided when creating an atom.");const{...t}=e,r="default"in e?e.default:new Promise(()=>{});return xce(r)?Cce({...t,default:r}):Tce({...t,default:r})}function Cce(e){const t=iR({...e,default:il,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:n=>n instanceof au?n:zr(e.persistence_UNSTABLE).validator(n,il)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),r=ah({key:`${e.key}__withFallback`,get:({get:n})=>{const i=n(t);return i instanceof au?e.default:i},set:({set:n},i)=>n(t,i),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return wce(r.key,B5(e.key)),r}iR.value=e=>new q5(e);var Pce=iR;class Nce{constructor(t){var r;jt(this,"_map",void 0),jt(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(r=t?.mapKey)!==null&&r!==void 0?r:n=>n}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,r){this._map.set(this._keyMapper(t),r)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var Dce={MapCache:Nce},Ice=Dce.MapCache,kce=Object.freeze({__proto__:null,MapCache:Ice});const{LRUCache:z5}=I5,{MapCache:Mce}=kce,Yg={equality:"reference",eviction:"none",maxSize:1/0};function Lce({equality:e=Yg.equality,eviction:t=Yg.eviction,maxSize:r=Yg.maxSize}=Yg){const n=jce(e);return Fce(t,r,n)}function jce(e){switch(e){case"reference":return t=>t;case"value":return t=>JS(t)}throw Pt(`Unrecognized equality policy ${e}`)}function Fce(e,t,r){switch(e){case"keep-all":return new Mce({mapKey:r});case"lru":return new z5({mapKey:r,maxSize:zr(t)});case"most-recent":return new z5({mapKey:r,maxSize:1})}throw Pt(`Unrecognized eviction policy ${e}`)}var $ce=Lce;const{setConfigDeletionHandler:Vce}=Ha;let qce=0;function Bce(e){var t,r;const n=$ce({equality:(t=(r=e.cachePolicyForParams_UNSTABLE)===null||r===void 0?void 0:r.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return i=>{var a;let o;try{o=n.get(i)}catch(d){throw Pt(`Problem with cache lookup for selector ${e.key}: ${d.message}`)}if(o!=null)return o;const s=`${e.key}__selectorFamily/${(a=JS(i,{allowFunctions:!0}))!==null&&a!==void 0?a:"void"}/${qce++}`,u=d=>e.get(i)(d),l=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(i):e.retainedBy_UNSTABLE;let f;if(e.set!=null){const d=e.set;f=ah({key:s,get:u,set:(m,p)=>d(i)(m,p),cachePolicy_UNSTABLE:l,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else f=ah({key:s,get:u,cachePolicy_UNSTABLE:l,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return n.set(i,f),Vce(f.key,()=>{n.delete(i)}),f}}var al=Bce;al({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}}),al({key:"__error",get:e=>()=>{throw Pt(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});const{loadableWithError:W5,loadableWithPromise:H5,loadableWithValue:G5}=Yd;function Qg(e,t){const r=Array(t.length).fill(void 0),n=Array(t.length).fill(void 0);for(const[i,a]of t.entries())try{r[i]=e(a)}catch(o){n[i]=o}return[r,n]}function Uce(e){return e!=null&&!Tr(e)}function Xg(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function aR(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((r,n,i)=>({...r,[n]:t[i]}),{})}function Lc(e,t,r){const n=r.map((i,a)=>i==null?G5(t[a]):Tr(i)?H5(i):W5(i));return aR(e,n)}function zce(e,t){return t.map((r,n)=>r===void 0?e[n]:r)}al({key:"__waitForNone",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);return Lc(e,n,i)},dangerouslyAllowMutability:!0}),al({key:"__waitForAny",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);return i.some(a=>!Tr(a))?Lc(e,n,i):new Promise(a=>{for(const[o,s]of i.entries())Tr(s)&&s.then(u=>{n[o]=u,i[o]=void 0,a(Lc(e,n,i))}).catch(u=>{i[o]=u,a(Lc(e,n,i))})})},dangerouslyAllowMutability:!0}),al({key:"__waitForAll",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);if(i.every(o=>o==null))return aR(e,n);const a=i.find(Uce);if(a!=null)throw a;return Promise.all(i).then(o=>aR(e,zce(n,o)))},dangerouslyAllowMutability:!0}),al({key:"__waitForAllSettled",get:e=>({get:t})=>{const r=Xg(e),[n,i]=Qg(t,r);return i.every(a=>!Tr(a))?Lc(e,n,i):Promise.all(i.map((a,o)=>Tr(a)?a.then(s=>{n[o]=s,i[o]=void 0}).catch(s=>{n[o]=void 0,i[o]=s}):null)).then(()=>Lc(e,n,i))},dangerouslyAllowMutability:!0}),al({key:"__noWait",get:e=>({get:t})=>{try{return ah.value(G5(t(e)))}catch(r){return ah.value(Tr(r)?H5(r):W5(r))}},dangerouslyAllowMutability:!0});const{RecoilLoadable:NGe}=Yd,{RecoilRoot:Wce}=Vg,{isRecoilValue:DGe}=rl,{freshSnapshot:IGe}=$g,{useRecoilValue:Hce,useSetRecoilState:Gce}=ale,{useRecoilCallback:Kce}=C5;var sh={RecoilRoot:Wce,atom:Pce,useRecoilValue:Hce,useSetRecoilState:Gce,useRecoilCallback:Kce},Yce=sh.RecoilRoot,Qce=sh.atom,Xce=sh.useRecoilValue,Zce=sh.useSetRecoilState,Jce=sh.useRecoilCallback;const K5=K.createContext(null);function efe({adapter:e,children:t}){const[r]=K.useState({}),n=C.jsx(K5.Provider,{value:{stateFactory:r,adapter:e},children:t});return e.type==="recoilAdapter"?C.jsx(Yce,{children:n}):n}function tfe(){const e=K.useContext(K5);if(!e)throw new Error("useStateContext must be used within a StateProvider");return e}function Ka(e,t){const{stateFactory:r,adapter:n}=tfe();let i=r[e];if(!i){if(t===void 0)throw new Error(`State manager for key "${e}" does not exist and no initial value was provided.`);i=n.createState(t),r[e]=i}const[a,o]=K.useState(i.get());return K.useEffect(()=>{const u=i.subscribe(l=>{o(l)});return()=>u()},[i]),[a,u=>{typeof u=="function"?i.set(u(i.get())):Array.isArray(u)?i.set(u.filter(l=>l!==null)):i.set(u)}]}function Y5(){return window.innerHeight>window.innerWidth}function rfe(){const[e,t]=K.useState(Y5());return K.useEffect(()=>{function r(){t(Y5())}return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e}function nfe(){const[e,t]=K.useState(!document.hidden),r=()=>{t(!document.hidden)};return K.useEffect(()=>(document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)})),e}function oR(e,t){const[r,n]=K.useState(e),i=K.useRef(null);function a(o){i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{n(o)},t)}return[r,a]}const ife=1e3*30,afe=["mousedown","mousemove","wheel","keydown","touchstart","scroll"],ofe=(e,t)=>(e.forEach(r=>window.addEventListener(r,t,{passive:!0})),()=>{e.forEach(r=>window.removeEventListener(r,t))});function Q5(e=ife){const t=K.useRef(null),[r,n]=K.useState(!1),[i,a]=K.useState(!1),[o,s]=K.useState(!0),u=K.useCallback(()=>{!o||i||(t.current&&clearTimeout(t.current),n(!1),t.current=window.setTimeout(()=>{n(!0)},e))},[e,i,o]),l=()=>{a(!0),n(!0)},c=()=>{a(!1),u()},f=()=>{s(!1),n(!1),t.current&&clearTimeout(t.current)},d=()=>{s(!0),u()};return K.useEffect(()=>{if(!o)return;const m=ofe(afe,u);return u(),()=>{t.current&&clearTimeout(t.current),m()}},[u,o]),[r,{disableIdleMode:f,enableIdleMode:d,lockInIdleMode:l,unlockIdleMode:c}]}function jc(e){const[t,r]=K.useState(()=>matchMedia(e).matches);return K.useLayoutEffect(()=>{const n=matchMedia(e);function i(){r(n.matches)}return n.addEventListener("change",i),()=>{n.removeEventListener("change",i)}},[e]),t}var ts=(e=>(e[e.equal=1]="equal",e[e.greater=2]="greater",e[e.lessThan=3]="lessThan",e[e.like=4]="like",e[e.endsWith=5]="endsWith",e[e.startsWith=6]="startsWith",e[e.in=7]="in",e))(ts||{}),rs=(e=>(e[e.readOnly=1]="readOnly",e[e.search=2]="search",e[e.select=3]="select",e[e.multipleSelect=4]="multipleSelect",e[e.boolean=5]="boolean",e[e.date=6]="date",e[e.dateTime=7]="dateTime",e))(rs||{});const X5=K.createContext(null),Z5=K.createContext(null),J5=K.createContext(null),e4=K.createContext(null);function sR(){return K.useContext(X5)}function uR(){return K.useContext(Z5)}function lR(){return K.useContext(J5)}function cR(){return K.useContext(e4)}const Fc=(e,t,r="")=>btoa(`After=0${sfe(t)}${ufe(e)}${r?`&${r}`:""}`),sfe=e=>{const t="&Sort=";if(Object.keys(e).length===0)throw new Error("No sortings found");return Object.keys(e).reduce((r,n)=>{const i=e[n];return r===t?`${r}${i.name}:${i.direction}`:`${r},${i.name}:${i.direction}`},t)},ufe=e=>{if(Object.keys(e).length===0)return"";const t="&Filter=[";return Object.keys(e).reduce((r,n,i)=>{const a=e[n];if(!a.value||a.value.length===0)return r;if(a.names.length===1)return r===t?`${r}{"${a.names[0]}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`:`${r},{"${a.names[0]}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`;const o=a.names.reduce((s,u)=>s===""?`${s}{"${u}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`:`${s},{"${u}":{"${Zg(a.operator)}":${JSON.stringify(a.value)}},"g":${i}}`,"");return r===t?`${r}${o}`:`${r},${o}`},t)+"]"};function Zg(e){switch(e){case ts.equal:return"eq";case ts.greater:return"gt";case ts.lessThan:return"lt";case ts.like:return"like";case ts.endsWith:return"like*";case ts.startsWith:return"*like";case ts.in:return"in";default:throw`Operator ${e} unknown`}}function t4({children:e,contextKey:t,defaultSorting:r,defaultFilters:n,defaultPersistance:i,canTogglePersistance:a}){function o(){if(!i||a&&!localStorage.getItem(t)&&!Object.values(n).find(k=>k.isShared))return n;let S={...n};const j=Object.keys(n).filter(k=>n[k].isShared);if(j.length>0){const k=localStorage.getItem("sharedFilters")??"{}";let F=JSON.parse(k);S=j.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:n[P]},V),S),localStorage.setItem("sharedFilters",JSON.stringify(F))}const M=Object.keys(n).filter(k=>!n[k].isShared);if(M.length>0){const k=localStorage.getItem(t)??"{}";let F=JSON.parse(k);S=M.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:n[P]},V),S),localStorage.setItem(t,JSON.stringify(F))}return S}function s(){if(!i||a&&!localStorage.getItem(t)&&!Object.values(r).find(k=>k.isShared))return r;let S={...r};const j=Object.keys(r).filter(k=>r[k].isShared);if(j.length>0){const k=localStorage.getItem("sharedSortings")??"{}";let F=JSON.parse(k);S=j.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:r[P]},V),S),localStorage.setItem("sharedSortings",JSON.stringify(F))}const M=Object.keys(r).filter(k=>!r[k].isShared);if(M.length>0){const k=localStorage.getItem(t)??"{}";let F=JSON.parse(k);S=M.reduce((V,P)=>F.hasOwnProperty(P)?{...V,[P]:F[P]}:(F={...F,[P]:r[P]},V),S),localStorage.setItem(t,JSON.stringify(F))}return S}const[u,l]=K.useState(o),[c,f]=K.useState(s),[d,h]=K.useState(()=>Fc(u,c,t)),[m,p]=K.useState(i),[g,y]=K.useState(t);K.useEffect(()=>y(t),[t]),K.useEffect(()=>l(o),[n]),K.useEffect(()=>f(s),[r]),K.useEffect(()=>h(Fc(n,r,t)),[t]);const b=K.useCallback(()=>{throw a&&(m&&localStorage.removeItem(t),p(!m)),new Error("Context is not configured to allow persistance toggle")},[]),E=K.useMemo(()=>({settings:{currentPersistance:m,canToggle:a,contextKey:t},setPersistance:b}),[m,t]),w=K.useMemo(()=>({filters:u,setFilters:l}),[u,t]),x=K.useMemo(()=>({sortings:c,setSortings:f}),[c,t]),R=K.useMemo(()=>({cursor:g!==t?Fc(n,r,t):d,updateCursor:()=>{h(()=>Fc(u,c,t))},updateRawCursor:(S,j)=>{const M=Fc(S,j,t);h(M)}}),[d,w,x,n,r,t]);return C.jsx(e4.Provider,{value:E,children:C.jsx(X5.Provider,{value:w,children:C.jsx(Z5.Provider,{value:x,children:C.jsx(J5.Provider,{value:R,children:e})})})})}function fR(){const e=sR(),t=uR(),r=lR(),n=cR();if(!e||!t||!r||!n)throw new Error("usePagination must be used within PaginationProvider");return{getFilterValue:u=>{const{filters:l}=e;return l[u].value},updateFilters:(u,l=!1)=>{const c={...e.filters,...u};e.setFilters(c);const f=Object.keys(c).filter(d=>c[d].isShared);if(f.length>0){const d=localStorage.getItem("sharedFilters")??"{}",h=JSON.parse(d),m=f.reduce((p,g)=>({...p,[g]:c[g]}),{...h});localStorage.setItem("sharedFilters",JSON.stringify(m))}if(n.settings.currentPersistance){const d=Object.keys(c).filter(g=>!c[g].isShared),h=localStorage.getItem(n.settings.contextKey)??"{}",m=JSON.parse(h),p=d.reduce((g,y)=>({...g,[y]:c[y]}),{...m});localStorage.setItem(n.settings.contextKey,JSON.stringify(p))}l&&r.updateRawCursor(c,t.sortings)},getSortingValue:u=>{const{sortings:l}=t;return l[u].direction},updateSortings:(u,l=!1)=>{const c={...t.sortings,...u};t.setSortings(c);const f=Object.keys(c).filter(d=>c[d].isShared);if(f.length>0){const d=localStorage.getItem("sharedSortings"),h=d?JSON.parse(d):{},m=f.reduce((p,g)=>({...p,[g]:h[g]}),{...h});localStorage.setItem("sharedSortings",JSON.stringify(m))}if(n.settings.currentPersistance){const d=Object.keys(c).filter(g=>!c[g].isShared),h=localStorage.getItem(n.settings.contextKey),m=h?JSON.parse(h):{},p=d.reduce((g,y)=>({...g,[y]:m[y]}),{...m});localStorage.setItem(n.settings.contextKey,JSON.stringify(p))}l&&r.updateRawCursor(e.filters,c)}}}function lfe(e=99){const[t,r]=K.useState(!1),[n,i]=K.useState(!1),[a,o]=K.useState([]),[s,u]=Ka("tagDistance",0);window.stopRunningLocate=function(){window.rfid.stop()};const l=b=>{try{h(0,"Beginning enumerate");const E=JSON.stringify(b);h(0,`readerID = ${E}`),window.rfid.readerID=b.RFID_Array[0].ID,i(!0),h(0,"Finished enumerate")}catch(E){i(!1),h(3,String(E))}};function c(b){console.log(b),b&&(b.errorCode,b.errorCode==1e3&&b?.vendorMessage==="CONNECTION_EVENT"?(h(0,"Connection event"),m()):h(3,`Error code: ${b.errorCode} Vendor message: ${b.vendorMessage}`))}K.useEffect(()=>{h(0,"Beginning connect"),n&&window.rfid.connect(),h(0,"Finished connect")},[n]);function f(){h(1,n.toString()),h(1,window.rfid),!n&&window.rfid&&(h(0,"Mount hook"),window.onEnumerate=l,window.statusLogger=c,window.rfid.statusEvent="statusLogger(%json);",h(0,`Set statusEvent = ${window.rfid.statusEvent}`),window.rfid.enumRFIDEvent="onEnumerate(%json);",h(0,`Set reportTrigger = ${window.rfid.reportTrigger}`),window.rfid.enumerate())}function d(){window.rfid&&(h(0,"Unomunt hook"),window.scanSingleRfidHandler=()=>{},window.rfid.tagEvent="",window._locate=void 0,window._inventory=()=>{},window.onEnumerate=()=>{},window.rfid.tagID="",h(0,"Stopping rfid"),window.rfid.stop(),h(0,"Rfid stopped"),h(0,"Disconnecting"),window.rfid.disconnect(),h(0,"Disconnected"),r(!1),i(!1))}K.useEffect(()=>{h(0,`isConnected = ${t}`)},[t]);function h(b,E){if(e<=b){let w="";switch(b){case 0:w="Trace -";break;case 1:w="Information -";break;case 2:w="Warning -";break;case 3:w="Error -";break;default:w="Unknown -"}o(x=>[...x,`${w} ${E}`])}}function m(){r(!0)}function p(b){window.rfid.reportTrigger=1,window.rfid.useSoftTrigger=0,window.rfid.reportUniqueTags="false",window.rfid.transport="serial",window.rfid.beepOnRead=1,window.rfid.lowerTriggerType="RFID_SCAN",window.rfid.upperTriggerType="RFID_SCAN",window.rfid.startTriggerType="triggerPress",window.rfid.stopTriggerType="triggerRelease",t&&(window.scanSingleRfidHandler=E=>{const w=E.TagData[0].tagID,x=JSON.stringify(E);h(0,`data = ${x}`),b(w)},window.rfid.tagEvent="scanSingleRfidHandler(%json);")}function g(b){window.rfid.tagEvent="TagLocateHandler(%json)";function E(w){u(w.TagLocate)}window.rfid.reportUniqueTags="false",window.rfid.transport="serial",window.rfid.reportTrigger=0,window.TagLocateHandler=E,window.rfid.beepOnRead=1,window.rfid.lowerTriggerType="NO_ACTION",window.rfid.upperTriggerType="NO_ACTION",window.rfid.startTriggerType="immediate",window.rfid.useSoftTrigger=0,window.rfid.antennaSelected=1,window.rfid.tagID=b,window.rfid.locateTag()}function y(b){try{t&&(h(0,"Beginning inventoryScan"),window.rfid.reportTrigger=0,window.rfid.useSoftTrigger=0,window.rfid.reportUniqueTags="true",window.rfid.transport="serial",window.rfid.beepOnRead=1,window.rfid.lowerTriggerType="RFID_SCAN",window.rfid.upperTriggerType="RFID_SCAN",window.rfid.startTriggerType="triggerPress",window.rfid.stopTriggerType="triggerRelease",window._inventory=E=>{b(E.TagData),h(0,`data = ${E.TagData[0].tagID}`),h(0,`datacomplete = ${E}`)},window.rfid.tagEvent="_inventory(%json);",h(0,`tagEvent = ${window.rfid.tagEvent}`),h(0,"Ended inventoryScan"))}catch(E){h(3,String(E))}}return{locateTag:g,inventoryScan:y,isConnected:t,canConnect:n,debugLog:a,mount:f,unMount:d,logDebug:h,scanSingleElement:p}}function Jg(e=".scrollable-container"){const t=new Map;K.useEffect(()=>{const r=document.querySelectorAll(e),n=a=>{a.classList.add("show-scrollbar"),setTimeout(()=>{a.classList.remove("show-scrollbar")},2e3)},i=a=>{a.classList.add("show-scrollbar"),t.has(a)&&clearTimeout(t.get(a));const o=window.setTimeout(()=>{a.classList.remove("show-scrollbar")},1e3);t.set(a,o)};return r.forEach(a=>{n(a);const o=()=>i(a);return a.addEventListener("scroll",o),()=>{a.removeEventListener("scroll",o),t.has(a)&&clearTimeout(t.get(a))}}),()=>{t.forEach(a=>clearTimeout(a))}},[e])}function r4({bufferName:e,callback:t}){const[r,n]=K.useState("- - - - - - - -"),[i,a]=K.useState(!1),[o,s]=K.useState(0),[u,l]=K.useState([]),c=K.useRef("- - - - - - - -"),f=K.useRef(null),d=x=>{const R=JSON.parse(localStorage.getItem(e)||"[]");!R.includes(x)&&x!=="- - - - - - - -"&&(R.push(x),localStorage.setItem(e,JSON.stringify(R)))},h=x=>{const S=JSON.parse(localStorage.getItem(e)||"[]").filter(j=>j!==x);localStorage.setItem(e,JSON.stringify(S))},m=x=>{n(c.current);const R=c.current;if(x!=="- - - - - - - -"&&typeof x=="string"){const S=t(c.current);if(S instanceof Promise)S.then(j=>{l(M=>[...M,j]),h(c.current)}).catch(()=>{d(R),p()});else return S}},p=()=>{const x=e,R=localStorage.getItem(x);if(R){const S=setInterval(async()=>{const j=o;if(j>=9){clearInterval(S);return}await g(JSON.parse(R))?(clearInterval(S),s(0)):s(j+1)},5e3);return()=>clearInterval(S)}},g=async x=>{let R=!0;for(const S of x)try{const j=await t(S);if(j instanceof Promise)j.then(M=>{l(k=>[...k,M])}),h(S);else return j}catch(j){console.trace("Error:",S,j),R=!1}return R},y=x=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{m(x),c.current="- - - - - - - -"},250)},b=K.useCallback(x=>{!x.repeat&&x.key.length===1&&x.key!=="Unidentified"&&(c.current==="- - - - - - - -"?c.current=x.key:(c.current+=x.key,y(c.current)))},[]),E={activateScanner:()=>{window.addEventListener("keydown",b),a(!0),w(),console.log(`${e} scanner activated`)},disableScanner:()=>{window.removeEventListener("keydown",b),a(!1),console.log(`${e} scanner disabled`)}},w=()=>{c.current="- - - - - - - -"};return{lastScanned:r,scannerActions:E,isScannerActive:i,labelRead:u}}const n4=K.createContext(void 0);function i4(){const e=K.useContext(n4);if(e===void 0)throw new Error("BreadCrumbContext must be used within an BreadCrumbProvider");return e}function a4(){const[e,t]=Ka("hotKeysDialogState",!1),r=K.useCallback(()=>{t(o=>!o)},[t]),n=K.useCallback(()=>{t(!1)},[t]),i=K.useCallback(()=>{t(!0)},[t]),a=K.useMemo(()=>({toggle:r,close:n,open:i}),[r,n,i]);return[e,a]}function dR(e){const[t,r]=Ka("languageDialogState",!1),[n]=Ka("languageDialogPopover",!1),{i18n:i}=Qt(),a=i.resolvedLanguage??"",o=K.useCallback(()=>{r(!1)},[r]),s=K.useCallback(()=>{r(!0)},[r]),u=K.useCallback(()=>{r(!0);const c=Object.keys(e),f=c.indexOf(a);let d;f!==-1&&f<c.length-1?d=c[f+1]:d=c[0],i.changeLanguage(d)},[r,i,a,e]),l=K.useMemo(()=>({close:o,open:s,toggle:u}),[o,s,u]);return[t,l,n]}const o4=Qn(Iee,{shouldForwardProp:e=>e==="children"||e==="elevation"||e==="variant"})(({theme:e,backgroundColor:t,blur:r,saturate:n="180%",color:i,borderRadius:a="24px",border:o,padding:s="2vw",width:u="100%",height:l="100%",marginLeft:c="auto",marginRight:f="auto",marginTop:d="auto",marginBottom:h="auto",style:m={}})=>({display:"flex",flexDirection:"column",width:u,height:l,backgroundColor:t||e.palette.background.paper,backdropFilter:r&&`blur(${r}) saturate(${n})`,color:i||e.palette.primary.main,border:o,padding:s,borderRadius:a,marginLeft:c,marginRight:f,marginTop:d,marginBottom:h,...m}));function s4({children:e,value:t,index:r,styles:n}){return C.jsx(Gv,{id:`tabpanel-${r}`,role:"tabpanel","aria-labelledby":`tab-${r}`,display:t!==r?"none":"flex",sx:n,children:e})}function u4({tabs:e,value:t,onChange:r,color:n="primary.main",textColor:i="inherit",fullWidth:a=!1,size:o="medium",height:s,width:u}){const{t:l}=Qt(),c=(f,d)=>{d!==null&&r(f,d)};return C.jsx(Se.ToggleButtonGroup,{value:t,exclusive:!0,onChange:c,fullWidth:a,"aria-label":"toggle buttons as custom rounded tabs",children:e.map((f,d)=>C.jsx(Se.ToggleButton,{disableRipple:!0,disableFocusRipple:!0,size:o,value:typeof f=="string"?d:f?.value,selected:typeof f=="string"?t===d:t===f?.value,sx:{height:s,width:u,fontWeight:600,minWidth:"160px",textTransform:"capitalize","&.Mui-selected":{color:i,backgroundColor:n,transition:"background-color 0.2s ease-in-out",":hover":{backgroundColor:n}},borderRadius:d===0?"24px 0px 0px 24px":d===e.length-1?"0px 24px 24px 0px":void 0},children:C.jsxs(Kr,{gap:"4px",alignItems:"center",children:[typeof f!="string"&&f?.icon?f?.icon:typeof f=="string"?t===d&&C.jsx(v1,{}):t===f?.value&&C.jsx(v1,{}),l(typeof f=="string"?f:f?.label)]})},typeof f=="string"?f:f?.label))})}function l4({tabs:e,value:t,onChange:r,color:n="primary.main",textColor:i="inherit",fullWidth:a=!1}){const{t:o}=Qt();return C.jsx(Se.Tabs,{value:t,onChange:r,"aria-label":"custom tabs",variant:"scrollable",scrollButtons:e.length>3,slotProps:{indicator:{children:C.jsx("span",{className:"MuiTabs-indicatorSpan"})}},sx:{"& .Mui-selected":{color:`${i}!important`},"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:n}},children:e.map((s,u)=>C.jsx(Se.Tab,{value:typeof s=="string"?u:s?.value,id:typeof s=="string"?s:s?.label,label:o(typeof s=="string"?s:s?.label),"aria-controls":`tabPanel-${u}`,icon:typeof s=="string"?void 0:s?.icon,sx:a?{minWidth:"fit-content",flex:1}:{}},typeof s=="string"?s:s?.label))})}function c4({tabs:e,value:t,onChange:r,color:n,textColor:i="inherit",variant:a="standard",fullWidth:o=!1,size:s="medium"}){return a==="rounded"?C.jsx(u4,{tabs:e,value:t,onChange:r,color:n,fullWidth:o,size:s,textColor:i}):C.jsx(l4,{tabs:e,value:t,onChange:r,color:n,textColor:i,fullWidth:o})}function cfe({doLogin:e,pendingLogin:t,doLogout:r,pendingLogout:n}){const i=Rg([]),a=Og(),o=[f=>{const d={credentials:{username:f.get("username")?.toString()||"",password:f.get("password")?.toString()||"",rFID:f.get("rfid")?.toString()||"",client_id:a.CLIENT_ID}};e({variables:d,onCompleted:h=>{const m=h.authMutation.login,{expires:p,token:g,errors:y,username:b}=m;if(y&&y.length>0){i.set((m.errors??[]).map(({code:E,description:w})=>({code:E,description:w})));return}a.AUTH_SCHEMA!=="Cookies"&&g&&localStorage.setItem("token",`Bearer ${g}`),p&&localStorage.setItem("authExpiration",p),b&&localStorage.setItem("username",b)}})},t],s=[()=>{r({variables:{},onCompleted:()=>{localStorage.removeItem("token"),localStorage.removeItem("authExpiration"),localStorage.removeItem("username")}})},n],u=localStorage.getItem("authExpiration")!==void 0&&localStorage.getItem("authExpiration")!==null&&new Date(localStorage.getItem("authExpiration")).getTime()>new Date().getTime(),l=!!(a.AUTH_SCHEMA!=="Cookies"?localStorage.getItem("token")&&u:u),c={login:o,logout:s,removeError:i.remove};return[l,i.value,c]}const f4=K.createContext(null);function ffe({children:e,doLogin:t,pendingLogin:r,doLogout:n,pendingLogout:i}){const[a,o,{login:s,logout:u,removeError:l}]=cfe({doLogin:t,pendingLogin:r,doLogout:n,pendingLogout:i});return C.jsx(f4.Provider,{value:[a,o,{login:s,logout:u,removeError:l}],children:e})}function d4(){const e=K.useContext(f4);if(e===null)throw new Error("useAuthContext must be used within an AuthProvider");return e}const h4={tabPanel:{width:"100%",flexDirection:"column",justifyContent:"flex-end",padding:"18px 0px 0px px",gap:"32px",flexGrow:1},contentFadeOut:{transition:"opacity 0.5s ease-out",opacity:0,pointerEvents:"none"}};function dfe({ChangePasswordWidget:e,children:t,title:r,tabs:n,backgroundColor:i,blur:a,elevation:o,color:s,borderRadius:u,border:l,padding:c,width:f,height:d,redirect:h=!0,redirectPath:m="/",loggedCallback:p,logo:g}){const{t:y}=Qt(),[b,E]=K.useState(!1),[w,x,{login:R,removeError:S}]=d4(),j=jc("(min-height:700px)"),[M,k]=R,[F,V]=K.useState(0),[P,A]=K.useState(!1),[I,L]=K.useState(!1),[B,H]=K.useState(!1),U=(T,D)=>{V(D)};return K.useEffect(()=>{x.length>0&&x.find(({code:T})=>T==="PASSWORD_EXPIRED")&&E(!0)},[x]),K.useEffect(()=>{p&&w&&p()},[w,p]),K.useEffect(()=>{const T=x.map((D,O)=>setTimeout(()=>S(O),2e3));return()=>{T.forEach(clearTimeout)}},[x,S]),K.useEffect(()=>{if(w&&h){L(!0);const T=setTimeout(()=>{A(!0)},500),D=setTimeout(()=>{H(!0)},2500);return()=>{clearTimeout(T),clearTimeout(D)}}},[w,h]),w&&h&&B?C.jsx(cre,{to:m,replace:!0}):C.jsxs(C.Fragment,{children:[P?C.jsx(Sg,{}):null,C.jsx(o4,{elevation:o,variant:o!==void 0?"elevation":"outlined",blur:a,border:l,color:s,backgroundColor:i,borderRadius:u,padding:c,width:P?"0px":f,height:P?"0px":d,style:I?h4.contentFadeOut:{flexGrow:0},children:C.jsxs(AS,{height:"100%",marginTop:"auto",marginBottom:"auto",justifyContent:"space-between",children:[n&&C.jsx(Kr,{borderBottom:"1px solid",borderColor:"divider",children:n&&n.length>0&&C.jsx(c4,{value:F,onChange:U,tabs:n,color:s})}),x.length>0&&C.jsx(Se.Stack,{spacing:1,sx:{padding:"16px",minHeight:"20%",justifyContent:"center"},children:x.map(({code:T,description:D},O)=>C.jsx(Se.Alert,{variant:"filled",severity:"error",onClose:()=>S(O),children:y(T||D)},T))}),C.jsx(Kr,{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",flex:1},children:C.jsx("img",{src:g,alt:"Logo",width:j?"60px":"40px"})}),C.jsx(Kr,{flex:1,alignContent:"center",flexDirection:"column",children:C.jsx(Se.Typography,{variant:j?"h4":"h5",sx:{fontWeight:300,textAlign:"center",marginTop:"auto",marginBottom:"auto"},children:r})}),C.jsx("form",{id:"authForm",action:M,children:b&&e?C.jsx(e,{pending:k}):n&&n.length>0?n.map(({label:T,child:D},O)=>C.jsx(s4,{value:F,index:O,styles:h4.tabPanel,children:C.jsx(D,{pending:k})},T)):t})]})})]})}const Ct=e=>typeof e=="string",uh=()=>{let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r},p4=e=>e==null?"":""+e,hfe=(e,t,r)=>{e.forEach(n=>{t[n]&&(r[n]=t[n])})},pfe=/###/g,v4=e=>e&&e.indexOf("###")>-1?e.replace(pfe,"."):e,g4=e=>!e||Ct(e),lh=(e,t,r)=>{const n=Ct(t)?t.split("."):t;let i=0;for(;i<n.length-1;){if(g4(e))return{};const a=v4(n[i]);!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++i}return g4(e)?{}:{obj:e,k:v4(n[i])}},m4=(e,t,r)=>{const{obj:n,k:i}=lh(e,t,Object);if(n!==void 0||t.length===1){n[i]=r;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=lh(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=lh(e,o,Object),s?.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},vfe=(e,t,r,n)=>{const{obj:i,k:a}=lh(e,t,Object);i[a]=i[a]||[],i[a].push(r)},em=(e,t)=>{const{obj:r,k:n}=lh(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},gfe=(e,t,r)=>{const n=em(e,r);return n!==void 0?n:em(t,r)},y4=(e,t,r)=>{for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?Ct(e[n])||e[n]instanceof String||Ct(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):y4(e[n],t[n],r):e[n]=t[n]);return e},$c=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var mfe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const yfe=e=>Ct(e)?e.replace(/[&<>"'\/]/g,t=>mfe[t]):e;class _fe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}const bfe=[" ",",","?","!",";"],Efe=new _fe(20),wfe=(e,t,r)=>{t=t||"",r=r||"";const n=bfe.filter(o=>t.indexOf(o)<0&&r.indexOf(o)<0);if(n.length===0)return!0;const i=Efe.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(e);if(!a){const o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a},hR=(e,t,r=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const n=t.split(r);let i=e;for(let a=0;a<n.length;){if(!i||typeof i!="object")return;let o,s="";for(let u=a;u<n.length;++u)if(u!==a&&(s+=r),s+=n[u],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&u<n.length-1)continue;a+=u-a+1;break}i=o}return i},ch=e=>e?.replace("_","-"),xfe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class tm{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||xfe,this.options=r,this.debug=r.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(Ct(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new tm(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new tm(this.logger,t)}}var wo=new tm;let rm=class{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,a])=>{for(let o=0;o<a;o++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,a])=>{for(let o=0;o<a;o++)i.apply(i,[t,...r])})}};class _4 extends rm{constructor(t,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n,i={}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,r],n&&(Array.isArray(n)?s.push(...n):Ct(n)&&a?s.push(...n.split(a)):s.push(n)));const u=em(this.data,s);return!u&&!r&&!n&&t.indexOf(".")>-1&&(t=s[0],r=s[1],n=s.slice(2).join(".")),u||!o||!Ct(n)?u:hR(this.data?.[t]?.[r],n,a)}addResource(t,r,n,i,a={silent:!1}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[t,r];n&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(s=t.split("."),i=r,r=s[1]),this.addNamespaces(r),m4(this.data,s,i),a.silent||this.emit("added",t,r,n,i)}addResources(t,r,n,i={silent:!1}){for(const a in n)(Ct(n[a])||Array.isArray(n[a]))&&this.addResource(t,r,a,n[a],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,a,o={silent:!1,skipCopy:!1}){let s=[t,r];t.indexOf(".")>-1&&(s=t.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let u=em(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?y4(u,n,a):u={...u,...n},m4(this.data,s,u),o.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var b4={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(a=>{t=this.processors[a]?.process(t,r,n,i)??t}),t}};const E4={},w4=e=>!Ct(e)&&typeof e!="boolean"&&typeof e!="number";class nm extends rm{constructor(t,r={}){super(),hfe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wo.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const n={...r};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const o=n&&t.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!wfe(t,n,i);if(o&&!s){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:Ct(a)?[a]:a};const l=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),t=l.join(i)}return{key:t,namespaces:Ct(a)?[a]:a}}translate(t,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(i={...i}),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:u}=this.extractFromKey(t[t.length-1],i),l=u[u.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=i.lng||this.language,d=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode")return d?a?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${c}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;const h=this.resolve(t,i);let m=h?.res;const p=h?.usedKey||s,g=h?.exactUsedKey||s,y=["[object Number]","[object Function]","[object RegExp]"],b=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,w=i.count!==void 0&&!Ct(i.count),x=nm.hasDefaultValue(i),R=w?this.pluralResolver.getSuffix(f,i.count,i):"",S=i.ordinal&&w?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",j=w&&!i.ordinal&&i.count===0,M=j&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${R}`]||i[`defaultValue${S}`]||i.defaultValue;let k=m;E&&!m&&x&&(k=M);const F=w4(k),V=Object.prototype.toString.apply(k);if(E&&k&&F&&y.indexOf(V)<0&&!(Ct(b)&&Array.isArray(k))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,k,{...i,ns:u}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(h.res=P,h.usedParams=this.getUsedParamsDetails(i),h):P}if(o){const P=Array.isArray(k),A=P?[]:{},I=P?g:p;for(const L in k)if(Object.prototype.hasOwnProperty.call(k,L)){const B=`${I}${o}${L}`;x&&!m?A[L]=this.translate(B,{...i,defaultValue:w4(M)?M[L]:void 0,joinArrays:!1,ns:u}):A[L]=this.translate(B,{...i,joinArrays:!1,ns:u}),A[L]===B&&(A[L]=k[L])}m=A}}else if(E&&Ct(b)&&Array.isArray(m))m=m.join(b),m&&(m=this.extendTranslation(m,t,i,n));else{let P=!1,A=!1;!this.isValidLookup(m)&&x&&(P=!0,m=M),this.isValidLookup(m)||(A=!0,m=s);const L=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:m,B=x&&M!==m&&this.options.updateMissing;if(A||P||B){if(this.logger.log(B?"updateKey":"missingKey",f,l,s,B?M:m),o){const D=this.resolve(s,{...i,keySeparator:!1});D&&D.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let D=0;D<U.length;D++)H.push(U[D]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(i.lng||this.language):H.push(i.lng||this.language);const T=(D,O,$)=>{const q=x&&$!==m?$:L;this.options.missingKeyHandler?this.options.missingKeyHandler(D,l,O,q,B,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(D,l,O,q,B,i),this.emit("missingKey",D,l,O,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?H.forEach(D=>{const O=this.pluralResolver.getSuffixes(D,i);j&&i[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach($=>{T([D],s+$,i[`defaultValue${$}`]||M)})}):T(H,s,M))}m=this.extendTranslation(m,t,i,h,n),A&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${c}${s}`),(A||P)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,P?m:void 0,i))}return a?(h.res=m,h.usedParams=this.getUsedParamsDetails(i),h):m}extendTranslation(t,r,n,i,a){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=Ct(t)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(u){const f=t.match(this.interpolator.nestingRegexp);l=f&&f.length}let c=n.replace&&!Ct(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),t=this.interpolator.interpolate(t,c,n.lng||this.language||i.usedLng,n),u){const f=t.match(this.interpolator.nestingRegexp),d=f&&f.length;l<d&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,(...f)=>a?.[0]===f[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${r[0]}`),null):this.translate(...f,r),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,s=Ct(o)?[o]:o;return t!=null&&s?.length&&n.applyPostProcessor!==!1&&(t=b4.handle(s,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t,r={}){let n,i,a,o,s;return Ct(t)&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(u,r),c=l.key;i=c;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const d=r.count!==void 0&&!Ct(r.count),h=d&&!r.ordinal&&r.count===0,m=r.context!==void 0&&(Ct(r.context)||typeof r.context=="number")&&r.context!=="",p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);f.forEach(g=>{this.isValidLookup(n)||(s=g,!E4[`${p[0]}-${g}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(E4[`${p[0]}-${g}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(y=>{if(this.isValidLookup(n))return;o=y;const b=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,c,y,g,r);else{let w;d&&(w=this.pluralResolver.getSuffix(y,r.count,r));const x=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(b.push(c+w),r.ordinal&&w.indexOf(R)===0&&b.push(c+w.replace(R,this.options.pluralSeparator)),h&&b.push(c+x)),m){const S=`${c}${this.options.contextSeparator}${r.context}`;b.push(S),d&&(b.push(S+w),r.ordinal&&w.indexOf(R)===0&&b.push(S+w.replace(R,this.options.pluralSeparator)),h&&b.push(S+x))}}let E;for(;E=b.pop();)this.isValidLookup(n)||(a=E,n=this.getResource(y,g,E,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!Ct(t.replace);let i=n?t.replace:t;if(n&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}class x4{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wo.create("languageUtils")}getScriptPartFromCode(t){if(t=ch(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=ch(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(Ct(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(o=>{if(o===a)return o;if(!(o.indexOf("-")<0&&a.indexOf("-")<0)&&(o.indexOf("-")>0&&a.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===a||o.indexOf(a)===0&&a.length>1))return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),Ct(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Ct(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):Ct(t)&&a(this.formatLanguageCode(t)),n.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}const S4={zero:0,one:1,two:2,few:3,many:4,other:5},R4={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Sfe{constructor(t,r={}){this.languageUtils=t,this.options=r,this.logger=wo.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,r){this.rules[t]=r}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const n=ch(t==="dev"?"en":t),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),R4;if(!t.match(/-|_/))return R4;const u=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(u,r)}return this.pluralRulesCache[a]=o,o}needsPlural(t,r={}){let n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,r,n={}){return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t,r={}){let n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>S4[i]-S4[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,r,n={}){const i=this.getRule(t,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,n))}}const O4=(e,t,r,n=".",i=!0)=>{let a=gfe(e,t,r);return!a&&i&&Ct(r)&&(a=hR(e,r,n),a===void 0&&(a=hR(t,r,n))),a},pR=e=>e.replace(/\$/g,"$$$$");class Rfe{constructor(t={}){this.logger=wo.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:u,formatSeparator:l,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:b}=t.interpolation;this.escape=r!==void 0?r:yfe,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?$c(a):o||"{{",this.suffix=s?$c(s):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?$c(d):h||$c("$t("),this.nestingSuffix=m?$c(m):p||$c(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,n)=>r?.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,r,n,i){let a,o,s;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=h=>{if(h.indexOf(this.formatSeparator)<0){const y=O4(r,u,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,n,{...i,...r,interpolationkey:h}):y}const m=h.split(this.formatSeparator),p=m.shift().trim(),g=m.join(this.formatSeparator).trim();return this.format(O4(r,u,p,this.options.keySeparator,this.options.ignoreJSONStructure),g,n,{...i,...r,interpolationkey:p})};this.resetRegExp();const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>pR(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?pR(this.escape(h)):pR(h)}].forEach(h=>{for(s=0;a=h.regex.exec(t);){const m=a[1].trim();if(o=l(m),o===void 0)if(typeof c=="function"){const g=c(t,a,i);o=Ct(g)?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(f){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),o="";else!Ct(o)&&!this.useRawValueToEscape&&(o=p4(o));const p=h.safeValue(o);if(t=t.replace(a[0],p),f?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=a[0].length):h.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r,n={}){let i,a,o;const s=(u,l)=>{const c=this.nestingOptionsSeparator;if(u.indexOf(c)<0)return u;const f=u.split(new RegExp(`${c}[ ]*{`));let d=`{${f[1]}`;u=f[0],d=this.interpolate(d,o);const h=d.match(/'/g),m=d.match(/"/g);((h?.length??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{o=JSON.parse(d),l&&(o={...l,...o})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,p),`${u}${c}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,u};for(;i=this.nestingRegexp.exec(t);){let u=[];o={...n},o=o.replace&&!Ct(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(l!==-1&&(u=i[1].slice(l).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,l)),a=r(s.call(this,i[1].trim(),o),o),a&&i[0]===t&&!Ct(a))return a;Ct(a)||(a=p4(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),a=""),u.length&&(a=u.reduce((c,f)=>this.format(c,f,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),t=t.replace(i[0],a),this.regexp.lastIndex=0}return t}}const Ofe=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...u]=o.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),c=s.trim();r[c]||(r[c]=l),l==="false"&&(r[c]=!1),l==="true"&&(r[c]=!0),isNaN(l)||(r[c]=parseInt(l,10))}})}return{formatName:t,formatOptions:r}},A4=e=>{const t={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=n+JSON.stringify(a);let s=t[o];return s||(s=e(ch(n),i),t[o]=s),s(r)}},Afe=e=>(t,r,n)=>e(ch(r),n)(t);class Tfe{constructor(t={}){this.logger=wo.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?A4:Afe;this.formats={number:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a});return s=>o.format(s)}),currency:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a,style:"currency"});return s=>o.format(s)}),datetime:n((i,a)=>{const o=new Intl.DateTimeFormat(i,{...a});return s=>o.format(s)}),relativetime:n((i,a)=>{const o=new Intl.RelativeTimeFormat(i,{...a});return s=>o.format(s,a.range||"day")}),list:n((i,a)=>{const o=new Intl.ListFormat(i,{...a});return s=>o.format(s)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=A4(r)}format(t,r,n,i={}){const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(u=>u.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,u)=>{const{formatName:l,formatOptions:c}=Ofe(u);if(this.formats[l]){let f=s;try{const d=i?.formatParams?.[i.interpolationkey]||{},h=d.locale||d.lng||i.locale||i.lng||n;f=this.formats[l](s,h,{...c,...i,...d})}catch(d){this.logger.warn(d)}return f}else this.logger.warn(`there was no format function for ${l}`);return s},t)}}const Cfe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Pfe extends rm{constructor(t,r,n,i={}){super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=wo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,i.backend,i)}queueLoad(t,r,n,i){const a={},o={},s={},u={};return t.forEach(l=>{let c=!0;r.forEach(f=>{const d=`${l}|${f}`;!n.reload&&this.store.hasResourceBundle(l,f)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,c=!1,o[d]===void 0&&(o[d]=!0),a[d]===void 0&&(a[d]=!0),u[f]===void 0&&(u[f]=!0)))}),c||(s[l]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(u)}}loaded(t,r,n){const i=t.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&n&&(this.state[t]=0);const s={};this.queue.forEach(u=>{vfe(u.loaded,[a],o),Cfe(u,t),r&&u.errors.push(r),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{s[l]||(s[l]={});const c=u.loaded[l];c.length&&c.forEach(f=>{s[l][f]===void 0&&(s[l][f]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(u=>!u.done)}read(t,r,n,i=0,a=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(l,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,i+1,a*2,o)},a);return}o(l,c)},u=this.backend[n].bind(this.backend);if(u.length===2){try{const l=u(t,r);l&&typeof l.then=="function"?l.then(c=>s(null,c)).catch(s):s(null,l)}catch(l){s(l)}return}return u(t,r,s)}prepareLoading(t,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Ct(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ct(r)&&(r=[r]);const a=this.queueLoad(t,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t,r=""){const n=t.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(t,o,s)})}saveMissing(t,r,n,i,a,o={},s=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend?.create){const u={...o,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let c;l.length===5?c=l(t,r,n,i,u):c=l(t,r,n,i),c&&typeof c.then=="function"?c.then(f=>s(null,f)).catch(s):s(null,c)}catch(c){s(c)}else l(t,r,n,i,s,u)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}const T4=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ct(e[1])&&(t.defaultValue=e[1]),Ct(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),C4=e=>(Ct(e.ns)&&(e.ns=[e.ns]),Ct(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ct(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),im=()=>{},Nfe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class fh extends rm{constructor(t={},r){if(super(),this.options=C4(t),this.services={},this.logger=wo,this.modules={external:[]},Nfe(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Ct(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=T4();this.options={...n,...this.options,...C4(t)},this.options.interpolation={...n.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?wo.init(i(this.modules.logger),this.options):wo.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Tfe;const c=new x4(this.options);this.store=new _4(this.options.resources,this.options);const f=this.services;f.logger=wo,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new Sfe(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(f.formatter=i(l),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Rfe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Pfe(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new nm(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=im),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...c)=>this.store[l](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...c)=>(this.store[l](...c),this)});const s=uh(),u=()=>{const l=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(f),r(c,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),s}loadResources(t,r=im){let n=r;const i=Ct(t)?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],o=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(l=>{l!=="cimode"&&a.indexOf(l)<0&&a.push(l)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>o(u)),this.options.preload?.forEach?.(s=>o(s)),this.services.backendConnector.load(a,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(t,r,n){const i=uh();return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),n||(n=im),this.services.backendConnector.reload(t,r,a=>{i.resolve(),n(a)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&b4.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const n=uh();this.emit("languageChanging",t);const i=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,u)=>{u?this.isLanguageChangingTo===t&&(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),r&&r(s,(...l)=>this.t(...l))},o=s=>{!t&&!s&&this.services.languageDetector&&(s=[]);const u=Ct(s)?s:s&&s[0],l=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(Ct(s)?[s]:s);l&&(this.language||i(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector?.cacheUserLanguage?.(l)),this.loadResources(l,c=>{a(c,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),n}getFixedT(t,r,n){const i=(a,o,...s)=>{let u;typeof o!="object"?u=this.options.overloadTranslationOptionHandler([a,o].concat(s)):u={...o},u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||n||i.keyPrefix);const l=this.options.keySeparator||".";let c;return u.keyPrefix&&Array.isArray(a)?c=a.map(f=>`${u.keyPrefix}${l}${f}`):c=u.keyPrefix?`${u.keyPrefix}${l}${a}`:a,this.t(c,u)};return Ct(t)?i.lng=t:i.lngs=t,i.ns=r,i.keyPrefix=n,i}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(s,u)=>{const l=this.services.backendConnector.state[`${s}|${u}`];return l===-1||l===0||l===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,t)&&(!i||o(a,t)))}loadNamespaces(t,r){const n=uh();return this.options.ns?(Ct(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=uh();Ct(t)&&(t=[t]);const i=this.options.preload||[],a=t.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const a=i.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services?.languageUtils||new x4(T4());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){return new fh(t,r)}cloneInstance(t={},r=im){const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},a=new fh(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=Object.keys(this.store.data).reduce((u,l)=>(u[l]={...this.store.data[l]},u[l]=Object.keys(u[l]).reduce((c,f)=>(c[f]={...u[l][f]},c),u[l]),u),{});a.store=new _4(s,i),a.services.resourceStore=a.store}return a.translator=new nm(a.services,i),a.translator.on("*",(s,...u)=>{a.emit(s,...u)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hn=fh.createInstance();hn.createInstance=fh.createInstance,hn.createInstance,hn.dir,hn.init,hn.loadResources,hn.reloadResources,hn.use,hn.changeLanguage,hn.getFixedT;const P4=hn.t;hn.exists,hn.setDefaultNamespace,hn.hasLoadedNamespace,hn.loadNamespaces,hn.loadLanguages;function Dfe({callback:e,title:t,subtitle:r}){const{scannerActions:n}=r4({bufferName:"BadgeScanner",callback:e});return K.useEffect(()=>(n.activateScanner(),()=>{n.disableScanner()}),[n]),C.jsxs(Gd,{sx:{flexDirection:"column",justifyContent:"space-around",height:"100%"},children:[C.jsxs(Se.Box,{children:[C.jsx(Se.Typography,{variant:"h4",children:P4(t)}),C.jsx(Se.Typography,{variant:"h6",children:P4(r)})]}),C.jsx(kee,{sx:{fontSize:"10rem"}})]})}function N4({id:e,children:t,ratio:r=0,unit:n=1}){const i=100/r,a=Array.from({length:r}).reduce((o,s,u)=>{const l=u*i,c=u%2===0?1:0;return o[`${l}%`]={opacity:c},o},{});return C.jsx(Gv,{sx:{[`@keyframes blink-${e}`]:a,animation:`blink-${e} ${n}s infinite`,display:"inline-flex"},children:t})}function D4(){const{crumbs:e,slice:t}=i4(),{t:r}=Qt();return K.useEffect(()=>console.log("Crumbs:",e),[e]),C.jsxs(Ju,{children:[C.jsx(Se.Breadcrumbs,{"aria-label":"breadcrumb",sx:{padding:"8px"},children:e.map((n,i)=>C.jsx(Se.Link,{color:"inherit",underline:"hover",sx:{cursor:"pointer"},onClick:()=>{console.log("Clicked crumb:",n.text),console.log("index:",i),t(i)},children:r(n.text)},i))}),C.jsx(Se.Divider,{}),C.jsx(Pc,{gap:2,flexWrap:"wrap",alignContent:"center",overflow:"hidden",padding:0,children:e[e.length-1].component})]})}function Ife({root:e}){const[t,r]=K.useState([e]),n=a=>r(o=>[...o,a]),i=a=>r(o=>o.slice(0,a+1));return C.jsx(n4.Provider,{value:{crumbs:t,push:n,slice:i},children:C.jsx(D4,{})})}function I4({value:e}){const{t}=Qt(),[r,n]=K.useState(!1),i=()=>{e&&(n(!0),navigator.clipboard.writeText(e))};return K.useEffect(()=>{r&&setTimeout(()=>{n(!1)},1e3)},[r]),C.jsx(Se.Tooltip,{placement:"top",title:t(r?"COPIED":"COPY"),disableFocusListener:!0,disableTouchListener:!0,arrow:!0,children:C.jsx(Se.IconButton,{id:"copy-to-clipboard-icnBtn",onClick:i,color:r?"primary":"default",disabled:!e,size:"small",children:r?C.jsx(v1,{}):C.jsx(Mee,{})})})}function k4({id:e,anchor:t,onClose:r,children:n,width:i,centerPopover:a}){return C.jsx(Se.Popover,{id:e,open:!!t,anchorEl:t,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:a?"center":"left"},transformOrigin:{vertical:"top",horizontal:a?"center":"left"},slotProps:{paper:{sx:{overflow:"hidden",minWidth:i,width:i}}},children:n})}function vR({Icon:e,label:t,menuContent:r,centerPopover:n}){const{t:i}=Qt(),[a,o]=K.useState(null),s=c=>{o(c.currentTarget)},u=()=>{o(null)},l=K.Children.map(r,c=>K.isValidElement(c)?K.cloneElement(c,{onClose:u}):c);return C.jsxs(C.Fragment,{children:[C.jsx(Se.Tooltip,{title:i("OPEN_MENU",{value:i(t)}),children:C.jsx(Se.Button,{id:`${t}-btn`,variant:"outlined",onClick:s,startIcon:C.jsx(e,{}),children:i(t)})}),C.jsx(k4,{centerPopover:n,id:`${t}-menu`,anchor:a,onClose:u,children:l})]})}function M4({styles:e={},languages:t,flags:r,isPopover:n}){const{i18n:i}=Qt(),[,a]=Ka("languageDialogPopover",!1);K.useEffect(()=>{a(n??!1)},[n,a]);const[o,s]=dR(t),u=r[i.language];return u?C.jsx(Lee,{id:"flags-btn",role:"button","aria-label":"change language flag button",onClick:s.open,sx:e,children:C.jsx(u,{size:36})}):(console.warn(`No flag component found for language: ${i.language}`),null)}function am(){const[e,t]=Ka("sidebarIsOpenState",!1),r=K.useCallback(()=>{t(o=>!o)},[t]),n=K.useCallback(()=>{t(!1)},[t]),i=K.useCallback(()=>{t(!0)},[t]),a=K.useMemo(()=>({toggle:r,close:n,open:i}),[r,n,i]);return[e,a]}const L4="300px",j4="56px",gR=.5,F4=Qn(jee,{shouldForwardProp:e=>e!=="open"&&e!=="isMobile"&&e!=="isIdle"})(({theme:e,open:t,isMobile:r,isIdle:n})=>({flexShrink:0,boxSizing:"border-box",whiteSpace:"nowrap",height:"100% !important","& .MuiDrawer-paper":{opacity:r&&!t||n?0:1,position:"relative",width:n?0:r?t?"98vw":"0":t?L4:j4,transition:`all ${gR}s ease-in-out`,overflow:"hidden",backgroundColor:e.palette.background.paper}}));function kfe({children:e,Logo:t,theme:r,isIdle:n}){const{i18n:i}=Qt(),a=jc("(max-width: 600px)"),[o,s]=am(),[u,l]=K.Children.toArray(e),c=i.dir();return C.jsxs(F4,{id:"sidebar-drawer",dir:c,variant:"permanent",anchor:c==="rtl"?"right":"left",open:o,onClose:s.close,slotProps:{paper:{variant:"outlined"}},isMobile:a,"data-pw":"sidebar",isIdle:n,children:[t&&C.jsx(Kr,{pt:"1vw",pb:"1vw",alignItems:"center",justifyContent:"center",minHeight:"64px",marginTop:"1vh",children:C.jsx(Se.Collapse,{in:o,timeout:500,orientation:"horizontal",collapsedSize:"0px",children:C.jsx(t,{width:"200px",height:"64px",theme:r})})}),C.jsx(Se.Box,{sx:{flexGrow:1,overflowY:"scroll",overflowX:"hidden",scrollbarWidth:"none"},children:u}),C.jsx(Se.Divider,{}),l]})}var Vc=(e=>(e.DARK="dark",e.LIGHT="light",e))(Vc||{});function qc(){const[e,t]=Ka("themeModeState",localStorage.getItem("theme-mode")||Vc.DARK);K.useEffect(()=>{localStorage.setItem("theme-mode",e)},[e]);const r=K.useCallback(()=>{t(i=>i===Vc.DARK?Vc.LIGHT:Vc.DARK)},[t]),n=K.useMemo(()=>({toggle:r}),[r]);return[e,n]}function Mfe({onClick:e,isIdle:t}){const[r]=qc(),[n]=am(),[i,a]=K.useState(n);K.useEffect(()=>{t&&n&&(a(!1),e())},[t,n,e]),K.useEffect(()=>{a(n)},[n]);const o=()=>{a(!i),e()};return C.jsxs("div",{id:"menu-icon","aria-label":"menu-icon",style:{marginRight:"19px"},className:`${r} ${i?"open":"closed"}`,onClick:o,children:[C.jsx("span",{}),C.jsx("span",{}),C.jsx("span",{})]})}const Lfe=g1.styled(e=>C.jsx($ee,{disableRipple:!0,...e}))(({theme:e})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:2,margin:3,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,border:0},"& .MuiSwitch-thumb:before":{content:"''",position:"absolute",width:"100%",height:"100%",left:0,top:0,backgroundColor:"#fff",borderRadius:"50%",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundImage:`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="${encodeURIComponent("#111")}" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"/></svg>')`}},"&.Mui-disabled .MuiSwitch-thumb":{color:e.palette.grey[100]}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:16,height:16,"&::before":{content:"''",position:"absolute",width:"100%",height:"100%",left:0,top:0,backgroundColor:"#79747e",borderRadius:"50%",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundImage:`url('data:image/svg+xml;utf8,<svg fill="${encodeURIComponent("#fff")}" width="16" height="16" viewBox="-6 -6 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.314 5.9l3.535-3.536A1 1 0 1 0 9.435.95L5.899 4.485 2.364.95A1 1 0 1 0 .95 2.364l3.535 3.535L.95 9.435a1 1 0 1 0 1.414 1.414l3.535-3.535 3.536 3.535a1 1 0 1 0 1.414-1.414L7.314 5.899z" /></svg>')`}},"& .MuiSwitch-track":{border:"2px solid #79747e",borderRadius:26/2,backgroundColor:"#e6e0e9",opacity:1,transition:e.transitions.create(["background-color"],{duration:500})}}));function $4({label:e,value:t,onChange:r}){const{t:n}=Qt();return C.jsx(Fee,{labelPlacement:"start",control:C.jsx(Lfe,{sx:{ml:1.69},checked:t,onChange:r}),label:e&&n(e),slotProps:{typography:{noWrap:!0}}})}function jfe({translation:e,globalStateString:t,defaultValue:r}){const[n,i]=Ka(t,r),a=o=>{i(o.target.checked)};return C.jsx($4,{label:e,value:n,onChange:a})}var om=(e=>(e.Column="column",e.Row="row",e))(om||{});function mR({caption:e,value:t,captionColor:r="textSecondary",valueColor:n="textPrimary",reverse:i,direction:a=om.Column,width:o,height:s,gap:u="4px",flex:l,padding:c,textAlign:f,captionStyle:d,valueStyle:h,fallback:m="N/A",enableCopy:p,className:g}){const{t:y}=Qt();return C.jsxs(Kr,{className:g,flexDirection:i?`${a}-reverse`:a,alignItems:a===om.Row?"center":"stretch",width:o,gap:u,height:s,flex:l,padding:c,children:[C.jsx(Se.Typography,{variant:"body2",color:r,sx:{textAlign:f,userSelect:"none",...d},noWrap:!0,children:y(e)}),typeof t=="string"||typeof t=="number"||!t&&(typeof m=="string"||typeof m=="number")?C.jsxs(Kr,{alignItems:"center",gap:"8px",children:[C.jsx(Se.Typography,{variant:"body1",color:n,sx:{textAlign:f,userSelect:"none",...h},noWrap:!0,children:t||m}),p&&C.jsx(I4,{value:t?.toString()})]}):t||m]})}function Ffe({CustomAvatarIcon:e,title:t,displayValue:r,subtitle:n}){const{t:i}=Qt(),[a]=qc(),o=a==="light"?"#e0e0e0":"#303030";return C.jsxs(Se.Paper,{sx:{borderRadius:"10px",border:"1px solid "+o,padding:"8px",gap:"8px",alignItems:"center",minWidth:"230px",display:"flex"},children:[C.jsx(Se.Avatar,{sx:{backgroundColor:"#12322f",width:"80px",height:"80px"},children:e}),C.jsxs(bo,{textAlign:"left",margin:"auto",children:[C.jsx(Se.Typography,{variant:"caption",color:"grey",sx:{margin:0,lineHeight:1},children:i(t)}),C.jsx(Se.Typography,{variant:"body1",sx:{padding:"0!important",fontSize:"2rem",margin:1,ml:0,fontWeight:600,lineHeight:1.1},children:i(r)}),typeof n=="string"?C.jsx(Se.Typography,{sx:{margin:0,lineHeight:1.2,fontSize:".75rem"},variant:"body2",children:i(n||"")}):n]})]})}function V4(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=V4(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ht(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=V4(e))&&(n&&(n+=" "),n+=t);return n}var yR={},_R={},q4;function $fe(){return q4||(q4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t}(_R)),_R}var bR={},B4;function U4(){return B4||(B4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t}(bR)),bR}var ER={},z4;function W4(){return z4||(z4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="string"||typeof r=="symbol"?r:Object.is(r?.valueOf?.(),-0)?"-0":String(r)}e.toKey=t}(ER)),ER}var wR={},H4;function xR(){return H4||(H4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){const n=[],i=r.length;if(i===0)return n;let a=0,o="",s="",u=!1;for(r.charCodeAt(0)===46&&(n.push(""),a++);a<i;){const l=r[a];s?l==="\\"&&a+1<i?(a++,o+=r[a]):l===s?s="":o+=l:u?l==='"'||l==="'"?s=l:l==="]"?(u=!1,n.push(o),o=""):o+=l:l==="["?(u=!0,o&&(n.push(o),o="")):l==="."?o&&(n.push(o),o=""):o+=l,a++}return o&&n.push(o),n}e.toPath=t}(wR)),wR}var G4;function SR(){return G4||(G4=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$fe(),r=U4(),n=W4(),i=xR();function a(s,u,l){if(s==null)return l;switch(typeof u){case"string":{if(t.isUnsafeProperty(u))return l;const c=s[u];return c===void 0?r.isDeepKey(u)?a(s,i.toPath(u),l):l:c}case"number":case"symbol":{typeof u=="number"&&(u=n.toKey(u));const c=s[u];return c===void 0?l:c}default:{if(Array.isArray(u))return o(s,u,l);if(Object.is(u?.valueOf(),-0)?u="-0":u=String(u),t.isUnsafeProperty(u))return l;const c=s[u];return c===void 0?l:c}}}function o(s,u,l){if(u.length===0)return l;let c=s;for(let f=0;f<u.length;f++){if(c==null||t.isUnsafeProperty(u[f]))return l;c=c[u[f]]}return c===void 0?l:c}e.get=a}(yR)),yR}var RR,K4;function Vfe(){return K4||(K4=1,RR=SR().get),RR}var qfe=Vfe();const ou=Ua(qfe);var Bfe=SS(),Cn=e=>e===0?0:e>0?1:-1,Zn=e=>typeof e=="number"&&e!=+e,ol=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Xe=e=>(typeof e=="number"||e instanceof Number)&&!Zn(e),Ni=e=>Xe(e)||typeof e=="string",Ufe=0,ns=e=>{var t=++Ufe;return"".concat(e||"").concat(t)},fi=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Xe(t)&&typeof t!="string")return n;var a;if(ol(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Zn(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},Y4=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[e[n]])r[e[n]]=!0;else return!0;return!1},Fn=(e,t)=>Xe(e)&&Xe(t)?r=>e+r*(t-e):()=>t;function Bc(e,t,r){return Xe(e)&&Xe(t)?e+r*(t-e):t}function Q4(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):ou(n,t))===r)}var zfe=e=>{if(!e||!e.length)return null;for(var t=e.length,r=0,n=0,i=0,a=0,o=1/0,s=-1/0,u=0,l=0,c=0;c<t;c++)u=e[c].cx||0,l=e[c].cy||0,r+=u,n+=l,i+=u*l,a+=u*u,o=Math.min(o,u),s=Math.max(s,u);var f=t*a!==r*r?(t*i-r*n)/(t*a-r*r):0;return{xmin:o,xmax:s,a:f,b:(n-f*r)/t}},rr=e=>e===null||typeof e>"u",dh=e=>rr(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),Wfe=["viewBox","children"],Hfe=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],X4=["points","pathLength"],OR={svg:Wfe,polygon:X4,polyline:X4},AR=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],TR=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(K.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{AR.includes(i)&&(n[i]=a=>r[i](r,a))}),n},Gfe=(e,t,r)=>n=>(e(t,r,n),null),Uc=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];AR.includes(i)&&typeof a=="function"&&(n||(n={}),n[i]=Gfe(a,t,r))}),n},Z4=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",J4=null,CR=null,e6=e=>{if(e===J4&&Array.isArray(CR))return CR;var t=[];return K.Children.forEach(e,r=>{rr(r)||(Bfe.isFragment(r)?t=t.concat(e6(r.props.children)):t.push(r))}),CR=t,J4=e,t};function zc(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(i=>Z4(i)):n=[Z4(t)],e6(e).forEach(i=>{var a=ou(i,"type.displayName")||ou(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}var sm=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Kfe=(e,t,r,n)=>{var i,a=(i=n&&OR?.[n])!==null&&i!==void 0?i:[];return t.startsWith("data-")||typeof e!="function"&&(n&&a.includes(t)||Hfe.includes(t))||r&&AR.includes(t)},xt=(e,t,r)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(K.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var i={};return Object.keys(n).forEach(a=>{var o;Kfe((o=n)===null||o===void 0?void 0:o[a],a,t,r)&&(i[a]=n[a])}),i},Yfe=["children","width","height","viewBox","className","style","title","desc"];function PR(){return PR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PR.apply(null,arguments)}function Qfe(e,t){if(e==null)return{};var r,n,i=Xfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Xfe(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var NR=K.forwardRef((e,t)=>{var{children:r,width:n,height:i,viewBox:a,className:o,style:s,title:u,desc:l}=e,c=Qfe(e,Yfe),f=a||{width:n,height:i,x:0,y:0},d=Ht("recharts-surface",o);return X.createElement("svg",PR({},xt(c,!0,"svg"),{className:d,width:n,height:i,style:s,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),X.createElement("title",null,u),X.createElement("desc",null,l),r)}),Zfe=["children","className"];function DR(){return DR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DR.apply(null,arguments)}function Jfe(e,t){if(e==null)return{};var r,n,i=ede(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ede(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var hr=X.forwardRef((e,t)=>{var{children:r,className:n}=e,i=Jfe(e,Zfe),a=Ht("recharts-layer",n);return X.createElement("g",DR({className:a},xt(i,!0),{ref:t}),r)}),t6=K.createContext(null),tde=()=>K.useContext(t6);function Mt(e){return function(){return e}}const r6=Math.abs,Jn=Math.atan2,is=Math.cos,rde=Math.max,Wc=Math.min,Di=Math.sin,Fr=Math.sqrt,ei=1e-12,su=Math.PI,um=su/2,uu=2*su;function nde(e){return e>1?0:e<-1?su:Math.acos(e)}function n6(e){return e>=1?um:e<=-1?-um:Math.asin(e)}const IR=Math.PI,kR=2*IR,sl=1e-6,ide=kR-sl;function i6(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function ade(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return i6;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}let hh=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?i6:ade(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,u=n-t,l=i-r,c=o-t,f=s-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>sl)if(!(Math.abs(f*u-l*c)>sl)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,m=i-s,p=u*u+l*l,g=h*h+m*m,y=Math.sqrt(p),b=Math.sqrt(d),E=a*Math.tan((IR-Math.acos((p+d-g)/(2*y*b)))/2),w=E/b,x=E/y;Math.abs(w-1)>sl&&this._append`L${t+w*c},${r+w*f}`,this._append`A${a},${a},0,0,${+(f*h>c*m)},${this._x1=t+x*u},${this._y1=r+x*l}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),u=n*Math.sin(i),l=t+s,c=r+u,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>sl||Math.abs(this._y1-c)>sl)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%kR+kR),d>ide?this._append`A${n},${n},0,1,${f},${t-s},${r-u}A${n},${n},0,1,${f},${this._x1=l},${this._y1=c}`:d>sl&&this._append`A${n},${n},0,${+(d>=IR)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function MR(){return new hh}MR.prototype=hh.prototype;function ode(e=3){return new hh(+e)}function ph(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new hh(t)}function sde(e){return e.innerRadius}function ude(e){return e.outerRadius}function lde(e){return e.startAngle}function cde(e){return e.endAngle}function fde(e){return e&&e.padAngle}function dde(e,t,r,n,i,a,o,s){var u=r-e,l=n-t,c=o-i,f=s-a,d=f*u-c*l;if(!(d*d<ei))return d=(c*(t-a)-f*(e-i))/d,[e+d*u,t+d*l]}function lm(e,t,r,n,i,a,o){var s=e-r,u=t-n,l=(o?a:-a)/Fr(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,m=r+c,p=n+f,g=(d+m)/2,y=(h+p)/2,b=m-d,E=p-h,w=b*b+E*E,x=i-a,R=d*p-m*h,S=(E<0?-1:1)*Fr(rde(0,x*x*w-R*R)),j=(R*E-b*S)/w,M=(-R*b-E*S)/w,k=(R*E+b*S)/w,F=(-R*b+E*S)/w,V=j-g,P=M-y,A=k-g,I=F-y;return V*V+P*P>A*A+I*I&&(j=k,M=F),{cx:j,cy:M,x01:-c,y01:-f,x11:j*(i/x-1),y11:M*(i/x-1)}}function hde(){var e=sde,t=ude,r=Mt(0),n=null,i=lde,a=cde,o=fde,s=null,u=ph(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),m=i.apply(this,arguments)-um,p=a.apply(this,arguments)-um,g=r6(p-m),y=p>m;if(s||(s=c=u()),h<d&&(f=h,h=d,d=f),!(h>ei))s.moveTo(0,0);else if(g>uu-ei)s.moveTo(h*is(m),h*Di(m)),s.arc(0,0,h,m,p,!y),d>ei&&(s.moveTo(d*is(p),d*Di(p)),s.arc(0,0,d,p,m,y));else{var b=m,E=p,w=m,x=p,R=g,S=g,j=o.apply(this,arguments)/2,M=j>ei&&(n?+n.apply(this,arguments):Fr(d*d+h*h)),k=Wc(r6(h-d)/2,+r.apply(this,arguments)),F=k,V=k,P,A;if(M>ei){var I=n6(M/d*Di(j)),L=n6(M/h*Di(j));(R-=I*2)>ei?(I*=y?1:-1,w+=I,x-=I):(R=0,w=x=(m+p)/2),(S-=L*2)>ei?(L*=y?1:-1,b+=L,E-=L):(S=0,b=E=(m+p)/2)}var B=h*is(b),H=h*Di(b),U=d*is(x),T=d*Di(x);if(k>ei){var D=h*is(E),O=h*Di(E),$=d*is(w),q=d*Di(w),W;if(g<su)if(W=dde(B,H,$,q,D,O,U,T)){var z=B-W[0],Y=H-W[1],Q=D-W[0],Z=O-W[1],re=1/Di(nde((z*Q+Y*Z)/(Fr(z*z+Y*Y)*Fr(Q*Q+Z*Z)))/2),ie=Fr(W[0]*W[0]+W[1]*W[1]);F=Wc(k,(d-ie)/(re-1)),V=Wc(k,(h-ie)/(re+1))}else F=V=0}S>ei?V>ei?(P=lm($,q,B,H,h,V,y),A=lm(D,O,U,T,h,V,y),s.moveTo(P.cx+P.x01,P.cy+P.y01),V<k?s.arc(P.cx,P.cy,V,Jn(P.y01,P.x01),Jn(A.y01,A.x01),!y):(s.arc(P.cx,P.cy,V,Jn(P.y01,P.x01),Jn(P.y11,P.x11),!y),s.arc(0,0,h,Jn(P.cy+P.y11,P.cx+P.x11),Jn(A.cy+A.y11,A.cx+A.x11),!y),s.arc(A.cx,A.cy,V,Jn(A.y11,A.x11),Jn(A.y01,A.x01),!y))):(s.moveTo(B,H),s.arc(0,0,h,b,E,!y)):s.moveTo(B,H),!(d>ei)||!(R>ei)?s.lineTo(U,T):F>ei?(P=lm(U,T,D,O,d,-F,y),A=lm(B,H,$,q,d,-F,y),s.lineTo(P.cx+P.x01,P.cy+P.y01),F<k?s.arc(P.cx,P.cy,F,Jn(P.y01,P.x01),Jn(A.y01,A.x01),!y):(s.arc(P.cx,P.cy,F,Jn(P.y01,P.x01),Jn(P.y11,P.x11),!y),s.arc(0,0,d,Jn(P.cy+P.y11,P.cx+P.x11),Jn(A.cy+A.y11,A.cx+A.x11),y),s.arc(A.cx,A.cy,F,Jn(A.y11,A.x11),Jn(A.y01,A.x01),!y))):s.arc(0,0,d,x,w,y)}if(s.closePath(),c)return s=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-su/2;return[is(f)*c,Di(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Mt(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Mt(+c),l):t},l.cornerRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Mt(+c),l):r},l.padRadius=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:Mt(+c),l):n},l.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:Mt(+c),l):i},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Mt(+c),l):a},l.padAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Mt(+c),l):o},l.context=function(c){return arguments.length?(s=c??null,l):s},l}var pde=Array.prototype.slice;function cm(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function a6(e){this._context=e}a6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Hc(e){return new a6(e)}function LR(e){return e[0]}function jR(e){return e[1]}function fm(e,t){var r=Mt(!0),n=null,i=Hc,a=null,o=ph(s);e=typeof e=="function"?e:e===void 0?LR:Mt(e),t=typeof t=="function"?t:t===void 0?jR:Mt(t);function s(u){var l,c=(u=cm(u)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),l=0;l<=c;++l)!(l<c&&r(f=u[l],l,u))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(f,l,u),+t(f,l,u));if(h)return a=null,h+""||null}return s.x=function(u){return arguments.length?(e=typeof u=="function"?u:Mt(+u),s):e},s.y=function(u){return arguments.length?(t=typeof u=="function"?u:Mt(+u),s):t},s.defined=function(u){return arguments.length?(r=typeof u=="function"?u:Mt(!!u),s):r},s.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),s):i},s.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),s):n},s}function Gc(e,t,r){var n=null,i=Mt(!0),a=null,o=Hc,s=null,u=ph(l);e=typeof e=="function"?e:e===void 0?LR:Mt(+e),t=typeof t=="function"?t:Mt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?jR:Mt(+r);function l(f){var d,h,m,p=(f=cm(f)).length,g,y=!1,b,E=new Array(p),w=new Array(p);for(a==null&&(s=o(b=u())),d=0;d<=p;++d){if(!(d<p&&i(g=f[d],d,f))===y)if(y=!y)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),m=d-1;m>=h;--m)s.point(E[m],w[m]);s.lineEnd(),s.areaEnd()}y&&(E[d]=+e(g,d,f),w[d]=+t(g,d,f),s.point(n?+n(g,d,f):E[d],r?+r(g,d,f):w[d]))}if(b)return s=null,b+""||null}function c(){return fm().defined(i).curve(o).context(a)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Mt(+f),n=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Mt(+f),l):e},l.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Mt(+f),l):n},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Mt(+f),r=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Mt(+f),l):t},l.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Mt(+f),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(n).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Mt(!!f),l):i},l.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),l):o},l.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),l):a},l}function vde(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function gde(e){return e}function mde(){var e=gde,t=vde,r=null,n=Mt(0),i=Mt(uu),a=Mt(0);function o(s){var u,l=(s=cm(s)).length,c,f,d=0,h=new Array(l),m=new Array(l),p=+n.apply(this,arguments),g=Math.min(uu,Math.max(-uu,i.apply(this,arguments)-p)),y,b=Math.min(Math.abs(g)/l,a.apply(this,arguments)),E=b*(g<0?-1:1),w;for(u=0;u<l;++u)(w=m[h[u]=u]=+e(s[u],u,s))>0&&(d+=w);for(t!=null?h.sort(function(x,R){return t(m[x],m[R])}):r!=null&&h.sort(function(x,R){return r(s[x],s[R])}),u=0,f=d?(g-l*E)/d:0;u<l;++u,p=y)c=h[u],w=m[c],y=p+(w>0?w*f:0)+E,m[c]={data:s[c],index:u,value:w,startAngle:p,endAngle:y,padAngle:b};return m}return o.value=function(s){return arguments.length?(e=typeof s=="function"?s:Mt(+s),o):e},o.sortValues=function(s){return arguments.length?(t=s,r=null,o):t},o.sort=function(s){return arguments.length?(r=s,t=null,o):r},o.startAngle=function(s){return arguments.length?(n=typeof s=="function"?s:Mt(+s),o):n},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:Mt(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:Mt(+s),o):a},o}var o6=FR(Hc);function s6(e){this._curve=e}s6.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function FR(e){function t(r){return new s6(e(r))}return t._curve=e,t}function vh(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(r){return arguments.length?t(FR(r)):t()._curve},e}function u6(){return vh(fm().curve(o6))}function l6(){var e=Gc().curve(o6),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return vh(r())},delete e.lineX0,e.lineEndAngle=function(){return vh(n())},delete e.lineX1,e.lineInnerRadius=function(){return vh(i())},delete e.lineY0,e.lineOuterRadius=function(){return vh(a())},delete e.lineY1,e.curve=function(o){return arguments.length?t(FR(o)):t()._curve},e}function gh(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class c6{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}class yde{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,r){if(t=+t,r=+r,this._point===0)this._point=1;else{const n=gh(this._x0,this._y0),i=gh(this._x0,this._y0=(this._y0+r)/2),a=gh(t,this._y0),o=gh(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...a,...o)}this._x0=t,this._y0=r}}function $R(e){return new c6(e,!0)}function VR(e){return new c6(e,!1)}function _de(e){return new yde(e)}function bde(e){return e.source}function Ede(e){return e.target}function dm(e){let t=bde,r=Ede,n=LR,i=jR,a=null,o=null,s=ph(u);function u(){let l;const c=pde.call(arguments),f=t.apply(this,c),d=r.apply(this,c);if(a==null&&(o=e(l=s())),o.lineStart(),c[0]=f,o.point(+n.apply(this,c),+i.apply(this,c)),c[0]=d,o.point(+n.apply(this,c),+i.apply(this,c)),o.lineEnd(),l)return o=null,l+""||null}return u.source=function(l){return arguments.length?(t=l,u):t},u.target=function(l){return arguments.length?(r=l,u):r},u.x=function(l){return arguments.length?(n=typeof l=="function"?l:Mt(+l),u):n},u.y=function(l){return arguments.length?(i=typeof l=="function"?l:Mt(+l),u):i},u.context=function(l){return arguments.length?(l==null?a=o=null:o=e(a=l),u):a},u}function wde(){return dm($R)}function xde(){return dm(VR)}function Sde(){const e=dm(_de);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const Rde=Fr(3),f6={draw(e,t){const r=Fr(t+Wc(t/28,.75))*.59436,n=r/2,i=n*Rde;e.moveTo(0,r),e.lineTo(0,-r),e.moveTo(-i,-n),e.lineTo(i,n),e.moveTo(-i,n),e.lineTo(i,-n)}},Kc={draw(e,t){const r=Fr(t/su);e.moveTo(r,0),e.arc(0,0,r,0,uu)}},qR={draw(e,t){const r=Fr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},d6=Fr(1/3),Ode=d6*2,BR={draw(e,t){const r=Fr(t/Ode),n=r*d6;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},h6={draw(e,t){const r=Fr(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}},p6={draw(e,t){const r=Fr(t-Wc(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}},UR={draw(e,t){const r=Fr(t),n=-r/2;e.rect(n,n,r,r)}},v6={draw(e,t){const r=Fr(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}},Ade=.8908130915292852,g6=Di(su/10)/Di(7*su/10),Tde=Di(uu/10)*g6,Cde=-is(uu/10)*g6,zR={draw(e,t){const r=Fr(t*Ade),n=Tde*r,i=Cde*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=uu*a/5,s=is(o),u=Di(o);e.lineTo(u*r,-s*r),e.lineTo(s*n-u*i,u*n+s*i)}e.closePath()}},WR=Fr(3),HR={draw(e,t){const r=-Fr(t/(WR*3));e.moveTo(0,r*2),e.lineTo(-WR*r,-r),e.lineTo(WR*r,-r),e.closePath()}},Pde=Fr(3),m6={draw(e,t){const r=Fr(t)*.6824,n=r/2,i=r*Pde/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}},ya=-.5,_a=Fr(3)/2,GR=1/Fr(12),Nde=(GR/2+1)*3,KR={draw(e,t){const r=Fr(t/Nde),n=r/2,i=r*GR,a=n,o=r*GR+r,s=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,u),e.lineTo(ya*n-_a*i,_a*n+ya*i),e.lineTo(ya*a-_a*o,_a*a+ya*o),e.lineTo(ya*s-_a*u,_a*s+ya*u),e.lineTo(ya*n+_a*i,ya*i-_a*n),e.lineTo(ya*a+_a*o,ya*o-_a*a),e.lineTo(ya*s+_a*u,ya*u-_a*s),e.closePath()}},YR={draw(e,t){const r=Fr(t-Wc(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}},y6=[Kc,qR,BR,UR,zR,HR,KR],Dde=[Kc,p6,YR,m6,f6,v6,h6];function _6(e,t){let r=null,n=ph(i);e=typeof e=="function"?e:Mt(e||Kc),t=typeof t=="function"?t:Mt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Mt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Mt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function lu(){}function hm(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function pm(e){this._context=e}pm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:hm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:hm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function b6(e){return new pm(e)}function E6(e){this._context=e}E6.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:hm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function w6(e){return new E6(e)}function x6(e){this._context=e}x6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:hm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function S6(e){return new x6(e)}function R6(e,t){this._basis=new pm(e),this._beta=t}R6.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,o=t[r]-i,s=-1,u;++s<=r;)u=s/r,this._basis.point(this._beta*e[s]+(1-this._beta)*(n+u*a),this._beta*t[s]+(1-this._beta)*(i+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Ide=function e(t){function r(n){return t===1?new pm(n):new R6(n,t)}return r.beta=function(n){return e(+n)},r}(.85);function vm(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function QR(e,t){this._context=e,this._k=(1-t)/6}QR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vm(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:vm(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const kde=function e(t){function r(n){return new QR(n,t)}return r.tension=function(n){return e(+n)},r}(0);function XR(e,t){this._context=e,this._k=(1-t)/6}XR.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:vm(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Mde=function e(t){function r(n){return new XR(n,t)}return r.tension=function(n){return e(+n)},r}(0);function ZR(e,t){this._context=e,this._k=(1-t)/6}ZR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vm(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Lde=function e(t){function r(n){return new ZR(n,t)}return r.tension=function(n){return e(+n)},r}(0);function JR(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>ei){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>ei){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function O6(e,t){this._context=e,this._alpha=t}O6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:JR(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jde=function e(t){function r(n){return t?new O6(n,t):new QR(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function A6(e,t){this._context=e,this._alpha=t}A6.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:JR(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Fde=function e(t){function r(n){return t?new A6(n,t):new XR(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function T6(e,t){this._context=e,this._alpha=t}T6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:JR(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $de=function e(t){function r(n){return t?new T6(n,t):new ZR(n,0)}return r.alpha=function(n){return e(+n)},r}(.5);function C6(e){this._context=e}C6.prototype={areaStart:lu,areaEnd:lu,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function P6(e){return new C6(e)}function N6(e){return e<0?-1:1}function D6(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(N6(a)+N6(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function I6(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function eO(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function gm(e){this._context=e}gm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:eO(this,this._t0,I6(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,eO(this,I6(this,r=D6(this,e,t)),r);break;default:eO(this,this._t0,r=D6(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function k6(e){this._context=new M6(e)}(k6.prototype=Object.create(gm.prototype)).point=function(e,t){gm.prototype.point.call(this,t,e)};function M6(e){this._context=e}M6.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function L6(e){return new gm(e)}function j6(e){return new k6(e)}function F6(e){this._context=e}F6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=$6(e),i=$6(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $6(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function V6(e){return new F6(e)}function mm(e,t){this._context=e,this._t=t}mm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function q6(e){return new mm(e,.5)}function B6(e){return new mm(e,0)}function U6(e){return new mm(e,1)}function ul(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function ll(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Vde(e,t){return e[t]}function qde(e){const t=[];return t.key=e,t}function z6(){var e=Mt([]),t=ll,r=ul,n=Vde;function i(a){var o=Array.from(e.apply(this,arguments),qde),s,u=o.length,l=-1,c;for(const f of a)for(s=0,++l;s<u;++s)(o[s][l]=[0,+n(f,o[s].key,l,a)]).data=f;for(s=0,c=cm(t(o));s<u;++s)o[c[s]].index=s;return r(o,c),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Mt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Mt(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?ll:typeof a=="function"?a:Mt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??ul,i):r},i}function W6(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}ul(e,t)}}function Bde(e,t){if((u=e.length)>0)for(var r,n=0,i,a,o,s,u,l=e[t[0]].length;n<l;++n)for(o=s=0,r=0;r<u;++r)(a=(i=e[t[r]][n])[1]-i[0])>0?(i[0]=o,i[1]=o+=a):a<0?(i[1]=s,i[0]=s+=a):(i[0]=0,i[1]=a)}function H6(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,s=0;o<i;++o)s+=e[o][r][1]||0;n[r][1]+=n[r][0]=-s/2}ul(e,t)}}function G6(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var s=0,u=0,l=0;s<o;++s){for(var c=e[t[s]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,m=0;m<s;++m){var p=e[t[m]],g=p[n][1]||0,y=p[n-1][1]||0;h+=g-y}u+=f,l+=h*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=l/u)}i[n-1][1]+=i[n-1][0]=r,ul(e,t)}}function K6(e){var t=e.map(Ude);return ll(e).sort(function(r,n){return t[r]-t[n]})}function Ude(e){for(var t=-1,r=0,n=e.length,i,a=-1/0;++t<n;)(i=+e[t][1])>a&&(a=i,r=t);return r}function Y6(e){var t=e.map(Q6);return ll(e).sort(function(r,n){return t[r]-t[n]})}function Q6(e){for(var t=0,r=-1,n=e.length,i;++r<n;)(i=+e[r][1])&&(t+=i);return t}function zde(e){return Y6(e).reverse()}function Wde(e){var t=e.length,r,n,i=e.map(Q6),a=K6(e),o=0,s=0,u=[],l=[];for(r=0;r<t;++r)n=a[r],o<s?(o+=i[n],u.push(n)):(s+=i[n],l.push(n));return l.reverse().concat(u)}function Hde(e){return ll(e).reverse()}var Gde=["type","size","sizeType"];function tO(){return tO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tO.apply(null,arguments)}function X6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Z6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X6(Object(r),!0).forEach(function(n){Kde(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kde(e,t,r){return(t=Yde(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yde(e){var t=Qde(e,"string");return typeof t=="symbol"?t:t+""}function Qde(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xde(e,t){if(e==null)return{};var r,n,i=Zde(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Zde(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var J6={symbolCircle:Kc,symbolCross:qR,symbolDiamond:BR,symbolSquare:UR,symbolStar:zR,symbolTriangle:HR,symbolWye:KR},Jde=Math.PI/180,ehe=e=>{var t="symbol".concat(dh(e));return J6[t]||Kc},the=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Jde;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},rhe=(e,t)=>{J6["symbol".concat(dh(e))]=t},ym=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=Xde(e,Gde),a=Z6(Z6({},i),{},{type:t,size:r,sizeType:n}),o=()=>{var f=ehe(t),d=_6().type(f).size(the(r,n,t));return d()},{className:s,cx:u,cy:l}=a,c=xt(a,!0);return u===+u&&l===+l&&r===+r?X.createElement("path",tO({},c,{className:Ht("recharts-symbols",s),transform:"translate(".concat(u,", ").concat(l,")"),d:o()})):null};ym.registerSymbol=rhe;function rO(){return rO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rO.apply(null,arguments)}function eF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nhe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eF(Object(r),!0).forEach(function(n){nO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nO(e,t,r){return(t=ihe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ihe(e){var t=ahe(e,"string");return typeof t=="symbol"?t:t+""}function ahe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ba=32;class iO extends K.PureComponent{renderIcon(t,r){var{inactiveColor:n}=this.props,i=ba/2,a=ba/6,o=ba/3,s=t.inactive?n:t.color,u=r??t.type;if(u==="none")return null;if(u==="plainline")return X.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:t.payload.strokeDasharray,x1:0,y1:i,x2:ba,y2:i,className:"recharts-legend-icon"});if(u==="line")return X.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(o,`
|
|
73
73
|
A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
|
|
74
74
|
H`).concat(ba,"M").concat(2*o,",").concat(i,`
|
|
75
75
|
A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(u==="rect")return X.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(ba/8,"h").concat(ba,"v").concat(ba*3/4,"h").concat(-ba,"z"),className:"recharts-legend-icon"});if(X.isValidElement(t.legendIcon)){var l=nhe({},t);return delete l.legendIcon,X.cloneElement(t.legendIcon,l)}return X.createElement(ym,{fill:s,cx:i,cy:i,size:ba,sizeType:"diameter",type:u})}renderItems(){var{payload:t,iconSize:r,layout:n,formatter:i,inactiveColor:a,iconType:o}=this.props,s={x:0,y:0,width:ba,height:ba},u={display:n==="horizontal"?"inline-block":"block",marginRight:10},l={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((c,f)=>{var d=c.formatter||i,h=Ht({"recharts-legend-item":!0,["legend-item-".concat(f)]:!0,inactive:c.inactive});if(c.type==="none")return null;var m=c.inactive?a:c.color,p=d?d(c.value,c,f):c.value;return X.createElement("li",rO({className:h,style:u,key:"legend-item-".concat(f)},Uc(this.props,c,f)),X.createElement(NR,{width:r,height:r,viewBox:s,style:l,"aria-label":"".concat(p," legend icon")},this.renderIcon(c,o)),X.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},p))})}render(){var{payload:t,layout:r,align:n}=this.props;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:r==="horizontal"?n:"left"};return X.createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}nO(iO,"displayName","Legend"),nO(iO,"defaultProps",{align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle"});var aO={},oO={},tF;function ohe(){return tF||(tF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const i=new Map;for(let a=0;a<r.length;a++){const o=r[a],s=n(o);i.has(s)||i.set(s,o)}return Array.from(i.values())}e.uniqBy=t}(oO)),oO}var sO={},rF;function nF(){return rF||(rF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t}(sO)),sO}var uO={},lO={},cO={},iF;function she(){return iF||(iF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t}(cO)),cO}var aF;function fO(){return aF||(aF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=she();function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r}(lO)),lO}var dO={},oF;function uhe(){return oF||(oF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t}(dO)),dO}var sF;function lhe(){return sF||(sF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fO(),r=uhe();function n(i){return r.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=n}(uO)),uO}var hO={},pO={},uF;function che(){return uF||(uF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SR();function r(n){return function(i){return t.get(i,n)}}e.property=r}(pO)),pO}var vO={},gO={},mO={},yO={},lF;function cF(){return lF||(lF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t}(yO)),yO}var _O={},fF;function dF(){return fF||(fF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t}(_O)),_O}var bO={},hF;function EO(){return hF||(hF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.eq=t}(bO)),bO}var pF;function fhe(){return pF||(pF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wO(),r=cF(),n=dF(),i=EO();function a(f,d,h){return typeof h!="function"?t.isMatch(f,d):o(f,d,function m(p,g,y,b,E,w){const x=h(p,g,y,b,E,w);return x!==void 0?!!x:o(p,g,m,w)},new Map)}function o(f,d,h,m){if(d===f)return!0;switch(typeof d){case"object":return s(f,d,h,m);case"function":return Object.keys(d).length>0?o(f,{...d},h,m):i.eq(f,d);default:return r.isObject(f)?typeof d=="string"?d==="":!0:i.eq(f,d)}}function s(f,d,h,m){if(d==null)return!0;if(Array.isArray(d))return l(f,d,h,m);if(d instanceof Map)return u(f,d,h,m);if(d instanceof Set)return c(f,d,h,m);const p=Object.keys(d);if(f==null)return p.length===0;if(p.length===0)return!0;if(m&&m.has(d))return m.get(d)===f;m&&m.set(d,f);try{for(let g=0;g<p.length;g++){const y=p[g];if(!n.isPrimitive(f)&&!(y in f)||d[y]===void 0&&f[y]!==void 0||d[y]===null&&f[y]!==null||!h(f[y],d[y],y,f,d,m))return!1}return!0}finally{m&&m.delete(d)}}function u(f,d,h,m){if(d.size===0)return!0;if(!(f instanceof Map))return!1;for(const[p,g]of d.entries()){const y=f.get(p);if(h(y,g,p,f,d,m)===!1)return!1}return!0}function l(f,d,h,m){if(d.length===0)return!0;if(!Array.isArray(f))return!1;const p=new Set;for(let g=0;g<d.length;g++){const y=d[g];let b=!1;for(let E=0;E<f.length;E++){if(p.has(E))continue;const w=f[E];let x=!1;if(h(w,y,g,f,d,m)&&(x=!0),x){p.add(E),b=!0;break}}if(!b)return!1}return!0}function c(f,d,h,m){return d.size===0?!0:f instanceof Set?l([...f],[...d],h,m):!1}e.isMatchWith=a,e.isSetMatch=c}(mO)),mO}var vF;function wO(){return vF||(vF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fhe();function r(n,i){return t.isMatchWith(n,i,()=>{})}e.isMatch=r}(gO)),gO}var xO={},SO={},RO={},gF;function mF(){return gF||(gF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t}(RO)),RO}var OO={},yF;function AO(){return yF||(yF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t}(OO)),OO}var TO={},_F;function CO(){return _F||(_F=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",s="[object Date]",u="[object Map]",l="[object Set]",c="[object Array]",f="[object Function]",d="[object ArrayBuffer]",h="[object Object]",m="[object Error]",p="[object DataView]",g="[object Uint8Array]",y="[object Uint8ClampedArray]",b="[object Uint16Array]",E="[object Uint32Array]",w="[object BigUint64Array]",x="[object Int8Array]",R="[object Int16Array]",S="[object Int32Array]",j="[object BigInt64Array]",M="[object Float32Array]",k="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=d,e.arrayTag=c,e.bigInt64ArrayTag=j,e.bigUint64ArrayTag=w,e.booleanTag=i,e.dataViewTag=p,e.dateTag=s,e.errorTag=m,e.float32ArrayTag=M,e.float64ArrayTag=k,e.functionTag=f,e.int16ArrayTag=R,e.int32ArrayTag=S,e.int8ArrayTag=x,e.mapTag=u,e.numberTag=n,e.objectTag=h,e.regexpTag=t,e.setTag=l,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=b,e.uint32ArrayTag=E,e.uint8ArrayTag=g,e.uint8ClampedArrayTag=y}(TO)),TO}var PO={},bF;function dhe(){return bF||(bF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t}(PO)),PO}var EF;function wF(){return EF||(EF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mF(),r=AO(),n=CO(),i=dF(),a=dhe();function o(c,f){return s(c,void 0,c,new Map,f)}function s(c,f,d,h=new Map,m=void 0){const p=m?.(c,f,d,h);if(p!=null)return p;if(i.isPrimitive(c))return c;if(h.has(c))return h.get(c);if(Array.isArray(c)){const g=new Array(c.length);h.set(c,g);for(let y=0;y<c.length;y++)g[y]=s(c[y],y,d,h,m);return Object.hasOwn(c,"index")&&(g.index=c.index),Object.hasOwn(c,"input")&&(g.input=c.input),g}if(c instanceof Date)return new Date(c.getTime());if(c instanceof RegExp){const g=new RegExp(c.source,c.flags);return g.lastIndex=c.lastIndex,g}if(c instanceof Map){const g=new Map;h.set(c,g);for(const[y,b]of c)g.set(y,s(b,y,d,h,m));return g}if(c instanceof Set){const g=new Set;h.set(c,g);for(const y of c)g.add(s(y,void 0,d,h,m));return g}if(typeof Buffer<"u"&&Buffer.isBuffer(c))return c.subarray();if(a.isTypedArray(c)){const g=new(Object.getPrototypeOf(c)).constructor(c.length);h.set(c,g);for(let y=0;y<c.length;y++)g[y]=s(c[y],y,d,h,m);return g}if(c instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&c instanceof SharedArrayBuffer)return c.slice(0);if(c instanceof DataView){const g=new DataView(c.buffer.slice(0),c.byteOffset,c.byteLength);return h.set(c,g),u(g,c,d,h,m),g}if(typeof File<"u"&&c instanceof File){const g=new File([c],c.name,{type:c.type});return h.set(c,g),u(g,c,d,h,m),g}if(c instanceof Blob){const g=new Blob([c],{type:c.type});return h.set(c,g),u(g,c,d,h,m),g}if(c instanceof Error){const g=new c.constructor;return h.set(c,g),g.message=c.message,g.name=c.name,g.stack=c.stack,g.cause=c.cause,u(g,c,d,h,m),g}if(typeof c=="object"&&l(c)){const g=Object.create(Object.getPrototypeOf(c));return h.set(c,g),u(g,c,d,h,m),g}return c}function u(c,f,d=c,h,m){const p=[...Object.keys(f),...t.getSymbols(f)];for(let g=0;g<p.length;g++){const y=p[g],b=Object.getOwnPropertyDescriptor(c,y);(b==null||b.writable)&&(c[y]=s(f[y],y,d,h,m))}}function l(c){switch(r.getTag(c)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=s,e.copyProperties=u}(SO)),SO}var xF;function hhe(){return xF||(xF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wF();function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r}(xO)),xO}var SF;function phe(){return SF||(SF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wO(),r=hhe();function n(i){return i=r.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=n}(vO)),vO}var NO={},DO={},IO={},RF;function vhe(){return RF||(RF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wF(),r=CO();function n(i,a){return t.cloneDeepWith(i,(o,s,u,l)=>{const c=a?.(o,s,u,l);if(c!=null)return c;if(typeof i=="object")switch(Object.prototype.toString.call(i)){case r.numberTag:case r.stringTag:case r.booleanTag:{const f=new i.constructor(i?.valueOf());return t.copyProperties(f,i),f}case r.argumentsTag:{const f={};return t.copyProperties(f,i),f.length=i.length,f[Symbol.iterator]=i[Symbol.iterator],f}default:return}})}e.cloneDeepWith=n}(IO)),IO}var OF;function ghe(){return OF||(OF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vhe();function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r}(DO)),DO}var kO={},MO={},AF;function TF(){return AF||(AF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,i=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<i;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r}(MO)),MO}var LO={},CF;function mhe(){return CF||(CF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AO();function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r}(LO)),LO}var PF;function yhe(){return PF||(PF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=U4(),r=TF(),n=mhe(),i=xR();function a(o,s){let u;if(Array.isArray(s)?u=s:typeof s=="string"&&t.isDeepKey(s)&&o?.[s]==null?u=i.toPath(s):u=[s],u.length===0)return!1;let l=o;for(let c=0;c<u.length;c++){const f=u[c];if((l==null||!Object.hasOwn(l,f))&&!((Array.isArray(l)||n.isArguments(l))&&r.isIndex(f)&&f<l.length))return!1;l=l[f]}return!0}e.has=a}(kO)),kO}var NF;function _he(){return NF||(NF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wO(),r=W4(),n=ghe(),i=SR(),a=yhe();function o(s,u){switch(typeof s){case"object":{Object.is(s?.valueOf(),-0)&&(s="-0");break}case"number":{s=r.toKey(s);break}}return u=n.cloneDeep(u),function(l){const c=i.get(l,s);return c===void 0?a.has(l,s):u===void 0?c===void 0:t.isMatch(c,u)}}e.matchesProperty=o}(NO)),NO}var DF;function bhe(){return DF||(DF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nF(),r=che(),n=phe(),i=_he();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}e.iteratee=a}(hO)),hO}var IF;function Ehe(){return IF||(IF=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ohe(),r=nF(),n=lhe(),i=bhe();function a(o,s=r.identity){return n.isArrayLikeObject(o)?t.uniqBy(Array.from(o),i.iteratee(s)):[]}e.uniqBy=a}(aO)),aO}var jO,kF;function whe(){return kF||(kF=1,jO=Ehe().uniqBy),jO}var xhe=whe();const MF=Ua(xhe);function LF(e,t,r){return t===!0?MF(e,r):typeof t=="function"?MF(e,t):e}var _m={exports:{}},FO={},bm={exports:{}},$O={};/**
|