tokmon 0.28.2 → 0.28.4
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/README.md +156 -234
- package/THIRD_PARTY_NOTICES.md +62 -0
- package/dist/{bootstrap-ink-IMT3S5HU.js → bootstrap-ink-WG4WG3R2.js} +1579 -1136
- package/dist/chunk-5B3XCEMC.js +294 -0
- package/dist/chunk-7CH6S7BR.js +447 -0
- package/dist/{chunk-LCAHTRGP.js → chunk-CFKUZCMB.js} +56 -29
- package/dist/{chunk-LKYOWBD4.js → chunk-FLANGRI6.js} +21 -42
- package/dist/chunk-HNWEJ6MS.js +1094 -0
- package/dist/{chunk-WUK3MQUB.js → chunk-JZSZEHVD.js} +167 -10
- package/dist/{chunk-6ZEW2M6P.js → chunk-P57DVFNH.js} +125 -25
- package/dist/chunk-TN6V7XSL.js +512 -0
- package/dist/chunk-UYPDMVW5.js +21 -0
- package/dist/{cli-command-DCENRCO3.js → cli-command-I4GRR3MF.js} +249 -15
- package/dist/cli.js +6 -6
- package/dist/{config-HXFJTNLM.js → config-3DGZ47F7.js} +23 -3
- package/dist/daemon-ZXV3V5CS.js +384 -0
- package/dist/daemon-handle-G4OGPFR3.js +11 -0
- package/dist/server-EPSH52DR.js +12 -0
- package/dist/web/assets/{Area-CMXvOw33.js → Area-stRnp8Km.js} +1 -1
- package/dist/web/assets/analytics-moZZt9L_.js +2 -0
- package/dist/web/assets/breakdown-km9w7myU.js +4 -0
- package/dist/web/assets/button-DrX04Cc2.js +1 -0
- package/dist/web/assets/{chart-cZoLgpmG.js → chart-D0CtuL2k.js} +1 -1
- package/dist/web/assets/explore-B11uNJV1.js +22 -0
- package/dist/web/assets/index-RDhXsCNG.js +83 -0
- package/dist/web/assets/index-ZmOS8p9O.css +1 -0
- package/dist/web/assets/models-DYbZnY34.js +2 -0
- package/dist/web/assets/overview-CruICbfJ.js +2 -0
- package/dist/web/assets/panel-xckM3_GC.js +1 -0
- package/dist/web/assets/settings-sheet-G-BTSIF6.js +1 -0
- package/dist/web/assets/share-sheet-weIdd4DW.js +2 -0
- package/dist/web/assets/timeline-BHgniliZ.js +1 -0
- package/dist/web/index.html +30 -4
- package/package.json +13 -4
- package/site/THIRD_PARTY_NOTICES.md +83 -0
- package/site/public/fonts/OFL.txt +93 -0
- package/dist/chunk-44ZSQEOS.js +0 -299
- package/dist/chunk-HP5UZCXP.js +0 -436
- package/dist/chunk-J3JW3RFP.js +0 -196
- package/dist/chunk-M7XMV36F.js +0 -275
- package/dist/daemon-6Y4O7NXS.js +0 -241
- package/dist/daemon-handle-GVCYVDPO.js +0 -10
- package/dist/server-GXXOWUVZ.js +0 -11
- package/dist/web/assets/analytics-DqdZXOJL.js +0 -2
- package/dist/web/assets/breakdown-kOSSJ3mI.js +0 -4
- package/dist/web/assets/explore-vcsM8K9I.js +0 -22
- package/dist/web/assets/index-BErCXT7f.css +0 -1
- package/dist/web/assets/index-DH3dOnbg.js +0 -83
- package/dist/web/assets/models-B5ikm83_.js +0 -2
- package/dist/web/assets/overview-DD1kP8CP.js +0 -2
- package/dist/web/assets/panel-DTQBwExW.js +0 -1
- package/dist/web/assets/primitives-C36qJlA2.js +0 -1
- package/dist/web/assets/settings-sheet-_i2zTQjf.js +0 -1
- package/dist/web/assets/share-sheet-BLHmrFbm.js +0 -2
- package/dist/web/assets/timeline-B4uG-Emo.js +0 -1
- package/dist/web/assets/use-dialog-trap-bfaXEMz9.js +0 -1
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./share-sheet-BLHmrFbm.js","./primitives-C36qJlA2.js","./chart-cZoLgpmG.js","./Area-CMXvOw33.js","./use-dialog-trap-bfaXEMz9.js","./overview-DD1kP8CP.js","./panel-DTQBwExW.js","./timeline-B4uG-Emo.js","./analytics-DqdZXOJL.js","./breakdown-kOSSJ3mI.js","./models-B5ikm83_.js","./explore-vcsM8K9I.js","./settings-sheet-_i2zTQjf.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var GC=Object.defineProperty;var YC=(e,t,n)=>t in e?GC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L=(e,t,n)=>YC(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const u of i)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const u={};return i.integrity&&(u.integrity=i.integrity),i.referrerPolicy&&(u.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?u.credentials="include":i.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(i){if(i.ep)return;i.ep=!0;const u=n(i);fetch(i.href,u)}})();var TF=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function XC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qd={exports:{}},ea={},Wd={exports:{}},Ie={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Zy;function ZC(){if(Zy)return Ie;Zy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=m&&R[m]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function P(R,J,he){this.props=R,this.context=J,this.refs=_,this.updater=he||w}P.prototype.isReactComponent={},P.prototype.setState=function(R,J){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,J,"setState")},P.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function B(){}B.prototype=P.prototype;function k(R,J,he){this.props=R,this.context=J,this.refs=_,this.updater=he||w}var O=k.prototype=new B;O.constructor=k,x(O,P.prototype),O.isPureReactComponent=!0;var b=Array.isArray,$=Object.prototype.hasOwnProperty,D={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function F(R,J,he){var de,ce={},_e=null,Oe=null;if(J!=null)for(de in J.ref!==void 0&&(Oe=J.ref),J.key!==void 0&&(_e=""+J.key),J)$.call(J,de)&&!A.hasOwnProperty(de)&&(ce[de]=J[de]);var ke=arguments.length-2;if(ke===1)ce.children=he;else if(1<ke){for(var Pe=Array(ke),ut=0;ut<ke;ut++)Pe[ut]=arguments[ut+2];ce.children=Pe}if(R&&R.defaultProps)for(de in ke=R.defaultProps,ke)ce[de]===void 0&&(ce[de]=ke[de]);return{$$typeof:e,type:R,key:_e,ref:Oe,props:ce,_owner:D.current}}function W(R,J){return{$$typeof:e,type:R.type,key:J,ref:R.ref,props:R.props,_owner:R._owner}}function X(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function te(R){var J={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(he){return J[he]})}var ae=/\/+/g;function E(R,J){return typeof R=="object"&&R!==null&&R.key!=null?te(""+R.key):J.toString(36)}function H(R,J,he,de,ce){var _e=typeof R;(_e==="undefined"||_e==="boolean")&&(R=null);var Oe=!1;if(R===null)Oe=!0;else switch(_e){case"string":case"number":Oe=!0;break;case"object":switch(R.$$typeof){case e:case t:Oe=!0}}if(Oe)return Oe=R,ce=ce(Oe),R=de===""?"."+E(Oe,0):de,b(ce)?(he="",R!=null&&(he=R.replace(ae,"$&/")+"/"),H(ce,J,he,"",function(ut){return ut})):ce!=null&&(X(ce)&&(ce=W(ce,he+(!ce.key||Oe&&Oe.key===ce.key?"":(""+ce.key).replace(ae,"$&/")+"/")+R)),J.push(ce)),1;if(Oe=0,de=de===""?".":de+":",b(R))for(var ke=0;ke<R.length;ke++){_e=R[ke];var Pe=de+E(_e,ke);Oe+=H(_e,J,he,Pe,ce)}else if(Pe=v(R),typeof Pe=="function")for(R=Pe.call(R),ke=0;!(_e=R.next()).done;)_e=_e.value,Pe=de+E(_e,ke++),Oe+=H(_e,J,he,Pe,ce);else if(_e==="object")throw J=String(R),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.");return Oe}function Z(R,J,he){if(R==null)return R;var de=[],ce=0;return H(R,de,"","",function(_e){return J.call(he,_e,ce++)}),de}function Y(R){if(R._status===-1){var J=R._result;J=J(),J.then(function(he){(R._status===0||R._status===-1)&&(R._status=1,R._result=he)},function(he){(R._status===0||R._status===-1)&&(R._status=2,R._result=he)}),R._status===-1&&(R._status=0,R._result=J)}if(R._status===1)return R._result.default;throw R._result}var z={current:null},G={transition:null},re={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:G,ReactCurrentOwner:D};function V(){throw Error("act(...) is not supported in production builds of React.")}return Ie.Children={map:Z,forEach:function(R,J,he){Z(R,function(){J.apply(this,arguments)},he)},count:function(R){var J=0;return Z(R,function(){J++}),J},toArray:function(R){return Z(R,function(J){return J})||[]},only:function(R){if(!X(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},Ie.Component=P,Ie.Fragment=n,Ie.Profiler=i,Ie.PureComponent=k,Ie.StrictMode=o,Ie.Suspense=p,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,Ie.act=V,Ie.cloneElement=function(R,J,he){if(R==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+R+".");var de=x({},R.props),ce=R.key,_e=R.ref,Oe=R._owner;if(J!=null){if(J.ref!==void 0&&(_e=J.ref,Oe=D.current),J.key!==void 0&&(ce=""+J.key),R.type&&R.type.defaultProps)var ke=R.type.defaultProps;for(Pe in J)$.call(J,Pe)&&!A.hasOwnProperty(Pe)&&(de[Pe]=J[Pe]===void 0&&ke!==void 0?ke[Pe]:J[Pe])}var Pe=arguments.length-2;if(Pe===1)de.children=he;else if(1<Pe){ke=Array(Pe);for(var ut=0;ut<Pe;ut++)ke[ut]=arguments[ut+2];de.children=ke}return{$$typeof:e,type:R.type,key:ce,ref:_e,props:de,_owner:Oe}},Ie.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},R.Provider={$$typeof:u,_context:R},R.Consumer=R},Ie.createElement=F,Ie.createFactory=function(R){var J=F.bind(null,R);return J.type=R,J},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(R){return{$$typeof:d,render:R}},Ie.isValidElement=X,Ie.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:Y}},Ie.memo=function(R,J){return{$$typeof:g,type:R,compare:J===void 0?null:J}},Ie.startTransition=function(R){var J=G.transition;G.transition={};try{R()}finally{G.transition=J}},Ie.unstable_act=V,Ie.useCallback=function(R,J){return z.current.useCallback(R,J)},Ie.useContext=function(R){return z.current.useContext(R)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(R){return z.current.useDeferredValue(R)},Ie.useEffect=function(R,J){return z.current.useEffect(R,J)},Ie.useId=function(){return z.current.useId()},Ie.useImperativeHandle=function(R,J,he){return z.current.useImperativeHandle(R,J,he)},Ie.useInsertionEffect=function(R,J){return z.current.useInsertionEffect(R,J)},Ie.useLayoutEffect=function(R,J){return z.current.useLayoutEffect(R,J)},Ie.useMemo=function(R,J){return z.current.useMemo(R,J)},Ie.useReducer=function(R,J,he){return z.current.useReducer(R,J,he)},Ie.useRef=function(R){return z.current.useRef(R)},Ie.useState=function(R){return z.current.useState(R)},Ie.useSyncExternalStore=function(R,J,he){return z.current.useSyncExternalStore(R,J,he)},Ie.useTransition=function(){return z.current.useTransition()},Ie.version="18.3.1",Ie}var ev;function Fa(){return ev||(ev=1,Wd.exports=ZC()),Wd.exports}/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var tv;function eb(){if(tv)return ea;tv=1;var e=Fa(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function l(d,p,g){var y,m={},v=null,w=null;g!==void 0&&(v=""+g),p.key!==void 0&&(v=""+p.key),p.ref!==void 0&&(w=p.ref);for(y in p)o.call(p,y)&&!u.hasOwnProperty(y)&&(m[y]=p[y]);if(d&&d.defaultProps)for(y in p=d.defaultProps,p)m[y]===void 0&&(m[y]=p[y]);return{$$typeof:t,type:d,key:v,ref:w,props:m,_owner:i.current}}return ea.Fragment=n,ea.jsx=l,ea.jsxs=l,ea}var nv;function tb(){return nv||(nv=1,qd.exports=eb()),qd.exports}var I=tb(),ee=Fa();const Sa=XC(ee);var hc={},Hd={exports:{}},rn={},Kd={exports:{}},Qd={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.min.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var rv;function nb(){return rv||(rv=1,(function(e){function t(G,re){var V=G.length;G.push(re);e:for(;0<V;){var R=V-1>>>1,J=G[R];if(0<i(J,re))G[R]=re,G[V]=J,V=R;else break e}}function n(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var re=G[0],V=G.pop();if(V!==re){G[0]=V;e:for(var R=0,J=G.length,he=J>>>1;R<he;){var de=2*(R+1)-1,ce=G[de],_e=de+1,Oe=G[_e];if(0>i(ce,V))_e<J&&0>i(Oe,ce)?(G[R]=Oe,G[_e]=V,R=_e):(G[R]=ce,G[de]=V,R=de);else if(_e<J&&0>i(Oe,V))G[R]=Oe,G[_e]=V,R=_e;else break e}}return re}function i(G,re){var V=G.sortIndex-re.sortIndex;return V!==0?V:G.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var p=[],g=[],y=1,m=null,v=3,w=!1,x=!1,_=!1,P=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(G){for(var re=n(g);re!==null;){if(re.callback===null)o(g);else if(re.startTime<=G)o(g),re.sortIndex=re.expirationTime,t(p,re);else break;re=n(g)}}function b(G){if(_=!1,O(G),!x)if(n(p)!==null)x=!0,Y($);else{var re=n(g);re!==null&&z(b,re.startTime-G)}}function $(G,re){x=!1,_&&(_=!1,B(F),F=-1),w=!0;var V=v;try{for(O(re),m=n(p);m!==null&&(!(m.expirationTime>re)||G&&!te());){var R=m.callback;if(typeof R=="function"){m.callback=null,v=m.priorityLevel;var J=R(m.expirationTime<=re);re=e.unstable_now(),typeof J=="function"?m.callback=J:m===n(p)&&o(p),O(re)}else o(p);m=n(p)}if(m!==null)var he=!0;else{var de=n(g);de!==null&&z(b,de.startTime-re),he=!1}return he}finally{m=null,v=V,w=!1}}var D=!1,A=null,F=-1,W=5,X=-1;function te(){return!(e.unstable_now()-X<W)}function ae(){if(A!==null){var G=e.unstable_now();X=G;var re=!0;try{re=A(!0,G)}finally{re?E():(D=!1,A=null)}}else D=!1}var E;if(typeof k=="function")E=function(){k(ae)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Z=H.port2;H.port1.onmessage=ae,E=function(){Z.postMessage(null)}}else E=function(){P(ae,0)};function Y(G){A=G,D||(D=!0,E())}function z(G,re){F=P(function(){G(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){x||w||(x=!0,Y($))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(p)},e.unstable_next=function(G){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var V=v;v=re;try{return G()}finally{v=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,re){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var V=v;v=G;try{return re()}finally{v=V}},e.unstable_scheduleCallback=function(G,re,V){var R=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?R+V:R):V=R,G){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=V+J,G={id:y++,callback:re,priorityLevel:G,startTime:V,expirationTime:J,sortIndex:-1},V>R?(G.sortIndex=V,t(g,G),n(p)===null&&G===n(g)&&(_?(B(F),F=-1):_=!0,z(b,V-R))):(G.sortIndex=J,t(p,G),x||w||(x=!0,Y($))),G},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(G){var re=v;return function(){var V=v;v=re;try{return G.apply(this,arguments)}finally{v=V}}}})(Qd)),Qd}var sv;function rb(){return sv||(sv=1,Kd.exports=nb()),Kd.exports}/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.min.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var ov;function sb(){if(ov)return rn;ov=1;var e=Fa(),t=rb();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,a=1;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,i={};function u(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(i[r]=s,r=0;r<s.length;r++)o.add(s[r])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},m={};function v(r){return p.call(m,r)?!0:p.call(y,r)?!1:g.test(r)?m[r]=!0:(y[r]=!0,!1)}function w(r,s,a,c){if(a!==null&&a.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return c?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,s,a,c){if(s===null||typeof s>"u"||w(r,s,a,c))return!0;if(c)return!1;if(a!==null)switch(a.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function _(r,s,a,c,f,h,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=c,this.attributeNamespace=f,this.mustUseProperty=a,this.propertyName=r,this.type=s,this.sanitizeURL=h,this.removeEmptyString=S}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){P[r]=new _(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];P[s]=new _(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){P[r]=new _(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){P[r]=new _(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){P[r]=new _(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){P[r]=new _(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){P[r]=new _(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){P[r]=new _(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){P[r]=new _(r,5,!1,r.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function k(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(B,k);P[s]=new _(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(B,k);P[s]=new _(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(B,k);P[s]=new _(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){P[r]=new _(r,1,!1,r.toLowerCase(),null,!1,!1)}),P.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){P[r]=new _(r,1,!1,r.toLowerCase(),null,!0,!0)});function O(r,s,a,c){var f=P.hasOwnProperty(s)?P[s]:null;(f!==null?f.type!==0:c||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(x(s,a,f,c)&&(a=null),c||f===null?v(s)&&(a===null?r.removeAttribute(s):r.setAttribute(s,""+a)):f.mustUseProperty?r[f.propertyName]=a===null?f.type===3?!1:"":a:(s=f.attributeName,c=f.attributeNamespace,a===null?r.removeAttribute(s):(f=f.type,a=f===3||f===4&&a===!0?"":""+a,c?r.setAttributeNS(c,s,a):r.setAttribute(s,a))))}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),D=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),te=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),G=Symbol.iterator;function re(r){return r===null||typeof r!="object"?null:(r=G&&r[G]||r["@@iterator"],typeof r=="function"?r:null)}var V=Object.assign,R;function J(r){if(R===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);R=s&&s[1]||""}return`
|
|
35
|
-
`+R+r}var he=!1;function de(r,s){if(!r||he)return"";he=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(Q){var c=Q}Reflect.construct(r,[],s)}else{try{s.call()}catch(Q){c=Q}r.call(s.prototype)}else{try{throw Error()}catch(Q){c=Q}r()}}catch(Q){if(Q&&c&&typeof Q.stack=="string"){for(var f=Q.stack.split(`
|
|
36
|
-
`),h=c.stack.split(`
|
|
37
|
-
`),S=f.length-1,C=h.length-1;1<=S&&0<=C&&f[S]!==h[C];)C--;for(;1<=S&&0<=C;S--,C--)if(f[S]!==h[C]){if(S!==1||C!==1)do if(S--,C--,0>C||f[S]!==h[C]){var T=`
|
|
38
|
-
`+f[S].replace(" at new "," at ");return r.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",r.displayName)),T}while(1<=S&&0<=C);break}}}finally{he=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?J(r):""}function ce(r){switch(r.tag){case 5:return J(r.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return r=de(r.type,!1),r;case 11:return r=de(r.type.render,!1),r;case 1:return r=de(r.type,!0),r;default:return""}}function _e(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case A:return"Fragment";case D:return"Portal";case W:return"Profiler";case F:return"StrictMode";case E:return"Suspense";case H:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case te:return(r.displayName||"Context")+".Consumer";case X:return(r._context.displayName||"Context")+".Provider";case ae:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Z:return s=r.displayName||null,s!==null?s:_e(r.type)||"Memo";case Y:s=r._payload,r=r._init;try{return _e(r(s))}catch{}}return null}function Oe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _e(s);case 8:return s===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ke(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Pe(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ut(r){var s=Pe(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),c=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,h=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return f.call(this)},set:function(S){c=""+S,h.call(this,S)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return c},setValue:function(S){c=""+S},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function vr(r){r._valueTracker||(r._valueTracker=ut(r))}function Ss(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),c="";return r&&(c=Pe(r)?r.checked?"true":"false":r.value),r=c,r!==a?(s.setValue(r),!0):!1}function ws(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function co(r,s){var a=s.checked;return V({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function su(r,s){var a=s.defaultValue==null?"":s.defaultValue,c=s.checked!=null?s.checked:s.defaultChecked;a=ke(s.value!=null?s.value:a),r._wrapperState={initialChecked:c,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function pi(r,s){s=s.checked,s!=null&&O(r,"checked",s,!1)}function lo(r,s){pi(r,s);var a=ke(s.value),c=s.type;if(a!=null)c==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(c==="submit"||c==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?xs(r,s.type,a):s.hasOwnProperty("defaultValue")&&xs(r,s.type,ke(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Sr(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var c=s.type;if(!(c!=="submit"&&c!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,a||s===r.value||(r.value=s),r.defaultValue=s}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function xs(r,s,a){(s!=="number"||ws(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var hn=Array.isArray;function Ar(r,s,a,c){if(r=r.options,s){s={};for(var f=0;f<a.length;f++)s["$"+a[f]]=!0;for(a=0;a<r.length;a++)f=s.hasOwnProperty("$"+r[a].value),r[a].selected!==f&&(r[a].selected=f),f&&c&&(r[a].defaultSelected=!0)}else{for(a=""+ke(a),s=null,f=0;f<r.length;f++){if(r[f].value===a){r[f].selected=!0,c&&(r[f].defaultSelected=!0);return}s!==null||r[f].disabled||(s=r[f])}s!==null&&(s.selected=!0)}}function fo(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function ou(r,s){var a=s.value;if(a==null){if(a=s.children,s=s.defaultValue,a!=null){if(s!=null)throw Error(n(92));if(hn(a)){if(1<a.length)throw Error(n(93));a=a[0]}s=a}s==null&&(s=""),a=s}r._wrapperState={initialValue:ke(a)}}function mi(r,s){var a=ke(s.value),c=ke(s.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),s.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),c!=null&&(r.defaultValue=""+c)}function Fe(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Ot(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Un(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?Ot(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var ho,hg=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,a,c,f){MSApp.execUnsafeLocalFunction(function(){return r(s,a,c,f)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(ho=ho||document.createElement("div"),ho.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=ho.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function gi(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var yi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eE=["Webkit","ms","Moz","O"];Object.keys(yi).forEach(function(r){eE.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),yi[s]=yi[r]})});function pg(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||yi.hasOwnProperty(r)&&yi[r]?(""+s).trim():s+"px"}function mg(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var c=a.indexOf("--")===0,f=pg(a,s[a],c);a==="float"&&(a="cssFloat"),c?r.setProperty(a,f):r[a]=f}}var tE=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tf(r,s){if(s){if(tE[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function nf(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rf=null;function sf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var of=null,po=null,mo=null;function gg(r){if(r=Di(r)){if(typeof of!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Iu(s),of(r.stateNode,r.type,s))}}function yg(r){po?mo?mo.push(r):mo=[r]:po=r}function vg(){if(po){var r=po,s=mo;if(mo=po=null,gg(r),s)for(r=0;r<s.length;r++)gg(s[r])}}function Sg(r,s){return r(s)}function wg(){}var af=!1;function xg(r,s,a){if(af)return r(s,a);af=!0;try{return Sg(r,s,a)}finally{af=!1,(po!==null||mo!==null)&&(wg(),vg())}}function vi(r,s){var a=r.stateNode;if(a===null)return null;var c=Iu(a);if(c===null)return null;a=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var uf=!1;if(d)try{var Si={};Object.defineProperty(Si,"passive",{get:function(){uf=!0}}),window.addEventListener("test",Si,Si),window.removeEventListener("test",Si,Si)}catch{uf=!1}function nE(r,s,a,c,f,h,S,C,T){var Q=Array.prototype.slice.call(arguments,3);try{s.apply(a,Q)}catch(oe){this.onError(oe)}}var wi=!1,iu=null,au=!1,cf=null,rE={onError:function(r){wi=!0,iu=r}};function sE(r,s,a,c,f,h,S,C,T){wi=!1,iu=null,nE.apply(rE,arguments)}function oE(r,s,a,c,f,h,S,C,T){if(sE.apply(this,arguments),wi){if(wi){var Q=iu;wi=!1,iu=null}else throw Error(n(198));au||(au=!0,cf=Q)}}function ks(r){var s=r,a=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(a=s.return),r=s.return;while(r)}return s.tag===3?a:null}function kg(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function _g(r){if(ks(r)!==r)throw Error(n(188))}function iE(r){var s=r.alternate;if(!s){if(s=ks(r),s===null)throw Error(n(188));return s!==r?null:r}for(var a=r,c=s;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(c=f.return,c!==null){a=c;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return _g(f),r;if(h===c)return _g(f),s;h=h.sibling}throw Error(n(188))}if(a.return!==c.return)a=f,c=h;else{for(var S=!1,C=f.child;C;){if(C===a){S=!0,a=f,c=h;break}if(C===c){S=!0,c=f,a=h;break}C=C.sibling}if(!S){for(C=h.child;C;){if(C===a){S=!0,a=h,c=f;break}if(C===c){S=!0,c=h,a=f;break}C=C.sibling}if(!S)throw Error(n(189))}}if(a.alternate!==c)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:s}function Eg(r){return r=iE(r),r!==null?Cg(r):null}function Cg(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=Cg(r);if(s!==null)return s;r=r.sibling}return null}var bg=t.unstable_scheduleCallback,Pg=t.unstable_cancelCallback,aE=t.unstable_shouldYield,uE=t.unstable_requestPaint,ct=t.unstable_now,cE=t.unstable_getCurrentPriorityLevel,lf=t.unstable_ImmediatePriority,Ig=t.unstable_UserBlockingPriority,uu=t.unstable_NormalPriority,lE=t.unstable_LowPriority,Rg=t.unstable_IdlePriority,cu=null,rr=null;function fE(r){if(rr&&typeof rr.onCommitFiberRoot=="function")try{rr.onCommitFiberRoot(cu,r,void 0,(r.current.flags&128)===128)}catch{}}var zn=Math.clz32?Math.clz32:pE,dE=Math.log,hE=Math.LN2;function pE(r){return r>>>=0,r===0?32:31-(dE(r)/hE|0)|0}var lu=64,fu=4194304;function xi(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function du(r,s){var a=r.pendingLanes;if(a===0)return 0;var c=0,f=r.suspendedLanes,h=r.pingedLanes,S=a&268435455;if(S!==0){var C=S&~f;C!==0?c=xi(C):(h&=S,h!==0&&(c=xi(h)))}else S=a&~f,S!==0?c=xi(S):h!==0&&(c=xi(h));if(c===0)return 0;if(s!==0&&s!==c&&(s&f)===0&&(f=c&-c,h=s&-s,f>=h||f===16&&(h&4194240)!==0))return s;if((c&4)!==0&&(c|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=c;0<s;)a=31-zn(s),f=1<<a,c|=r[a],s&=~f;return c}function mE(r,s){switch(r){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gE(r,s){for(var a=r.suspendedLanes,c=r.pingedLanes,f=r.expirationTimes,h=r.pendingLanes;0<h;){var S=31-zn(h),C=1<<S,T=f[S];T===-1?((C&a)===0||(C&c)!==0)&&(f[S]=mE(C,s)):T<=s&&(r.expiredLanes|=C),h&=~C}}function ff(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Tg(){var r=lu;return lu<<=1,(lu&4194240)===0&&(lu=64),r}function df(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function ki(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-zn(s),r[s]=a}function yE(r,s){var a=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var c=r.eventTimes;for(r=r.expirationTimes;0<a;){var f=31-zn(a),h=1<<f;s[f]=0,c[f]=-1,r[f]=-1,a&=~h}}function hf(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var c=31-zn(a),f=1<<c;f&s|r[c]&s&&(r[c]|=s),a&=~f}}var De=0;function Mg(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Og,pf,Lg,Ng,Ag,mf=!1,hu=[],jr=null,$r=null,Fr=null,_i=new Map,Ei=new Map,Dr=[],vE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function jg(r,s){switch(r){case"focusin":case"focusout":jr=null;break;case"dragenter":case"dragleave":$r=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":_i.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ei.delete(s.pointerId)}}function Ci(r,s,a,c,f,h){return r===null||r.nativeEvent!==h?(r={blockedOn:s,domEventName:a,eventSystemFlags:c,nativeEvent:h,targetContainers:[f]},s!==null&&(s=Di(s),s!==null&&pf(s)),r):(r.eventSystemFlags|=c,s=r.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),r)}function SE(r,s,a,c,f){switch(s){case"focusin":return jr=Ci(jr,r,s,a,c,f),!0;case"dragenter":return $r=Ci($r,r,s,a,c,f),!0;case"mouseover":return Fr=Ci(Fr,r,s,a,c,f),!0;case"pointerover":var h=f.pointerId;return _i.set(h,Ci(_i.get(h)||null,r,s,a,c,f)),!0;case"gotpointercapture":return h=f.pointerId,Ei.set(h,Ci(Ei.get(h)||null,r,s,a,c,f)),!0}return!1}function $g(r){var s=_s(r.target);if(s!==null){var a=ks(s);if(a!==null){if(s=a.tag,s===13){if(s=kg(a),s!==null){r.blockedOn=s,Ag(r.priority,function(){Lg(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function pu(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=yf(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var c=new a.constructor(a.type,a);rf=c,a.target.dispatchEvent(c),rf=null}else return s=Di(a),s!==null&&pf(s),r.blockedOn=a,!1;s.shift()}return!0}function Fg(r,s,a){pu(r)&&a.delete(s)}function wE(){mf=!1,jr!==null&&pu(jr)&&(jr=null),$r!==null&&pu($r)&&($r=null),Fr!==null&&pu(Fr)&&(Fr=null),_i.forEach(Fg),Ei.forEach(Fg)}function bi(r,s){r.blockedOn===s&&(r.blockedOn=null,mf||(mf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wE)))}function Pi(r){function s(f){return bi(f,r)}if(0<hu.length){bi(hu[0],r);for(var a=1;a<hu.length;a++){var c=hu[a];c.blockedOn===r&&(c.blockedOn=null)}}for(jr!==null&&bi(jr,r),$r!==null&&bi($r,r),Fr!==null&&bi(Fr,r),_i.forEach(s),Ei.forEach(s),a=0;a<Dr.length;a++)c=Dr[a],c.blockedOn===r&&(c.blockedOn=null);for(;0<Dr.length&&(a=Dr[0],a.blockedOn===null);)$g(a),a.blockedOn===null&&Dr.shift()}var go=b.ReactCurrentBatchConfig,mu=!0;function xE(r,s,a,c){var f=De,h=go.transition;go.transition=null;try{De=1,gf(r,s,a,c)}finally{De=f,go.transition=h}}function kE(r,s,a,c){var f=De,h=go.transition;go.transition=null;try{De=4,gf(r,s,a,c)}finally{De=f,go.transition=h}}function gf(r,s,a,c){if(mu){var f=yf(r,s,a,c);if(f===null)Nf(r,s,c,gu,a),jg(r,c);else if(SE(f,r,s,a,c))c.stopPropagation();else if(jg(r,c),s&4&&-1<vE.indexOf(r)){for(;f!==null;){var h=Di(f);if(h!==null&&Og(h),h=yf(r,s,a,c),h===null&&Nf(r,s,c,gu,a),h===f)break;f=h}f!==null&&c.stopPropagation()}else Nf(r,s,c,null,a)}}var gu=null;function yf(r,s,a,c){if(gu=null,r=sf(c),r=_s(r),r!==null)if(s=ks(r),s===null)r=null;else if(a=s.tag,a===13){if(r=kg(s),r!==null)return r;r=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return gu=r,null}function Dg(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cE()){case lf:return 1;case Ig:return 4;case uu:case lE:return 16;case Rg:return 536870912;default:return 16}default:return 16}}var Ur=null,vf=null,yu=null;function Ug(){if(yu)return yu;var r,s=vf,a=s.length,c,f="value"in Ur?Ur.value:Ur.textContent,h=f.length;for(r=0;r<a&&s[r]===f[r];r++);var S=a-r;for(c=1;c<=S&&s[a-c]===f[h-c];c++);return yu=f.slice(r,1<c?1-c:void 0)}function vu(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Su(){return!0}function zg(){return!1}function pn(r){function s(a,c,f,h,S){this._reactName=a,this._targetInst=f,this.type=c,this.nativeEvent=h,this.target=S,this.currentTarget=null;for(var C in r)r.hasOwnProperty(C)&&(a=r[C],this[C]=a?a(h):h[C]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Su:zg,this.isPropagationStopped=zg,this}return V(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Su)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Su)},persist:function(){},isPersistent:Su}),s}var yo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sf=pn(yo),Ii=V({},yo,{view:0,detail:0}),_E=pn(Ii),wf,xf,Ri,wu=V({},Ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_f,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Ri&&(Ri&&r.type==="mousemove"?(wf=r.screenX-Ri.screenX,xf=r.screenY-Ri.screenY):xf=wf=0,Ri=r),wf)},movementY:function(r){return"movementY"in r?r.movementY:xf}}),Bg=pn(wu),EE=V({},wu,{dataTransfer:0}),CE=pn(EE),bE=V({},Ii,{relatedTarget:0}),kf=pn(bE),PE=V({},yo,{animationName:0,elapsedTime:0,pseudoElement:0}),IE=pn(PE),RE=V({},yo,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),TE=pn(RE),ME=V({},yo,{data:0}),Vg=pn(ME),OE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},NE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AE(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=NE[r])?!!s[r]:!1}function _f(){return AE}var jE=V({},Ii,{key:function(r){if(r.key){var s=OE[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=vu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?LE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_f,charCode:function(r){return r.type==="keypress"?vu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?vu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),$E=pn(jE),FE=V({},wu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qg=pn(FE),DE=V({},Ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_f}),UE=pn(DE),zE=V({},yo,{propertyName:0,elapsedTime:0,pseudoElement:0}),BE=pn(zE),VE=V({},wu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),qE=pn(VE),WE=[9,13,27,32],Ef=d&&"CompositionEvent"in window,Ti=null;d&&"documentMode"in document&&(Ti=document.documentMode);var HE=d&&"TextEvent"in window&&!Ti,Wg=d&&(!Ef||Ti&&8<Ti&&11>=Ti),Hg=" ",Kg=!1;function Qg(r,s){switch(r){case"keyup":return WE.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jg(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var vo=!1;function KE(r,s){switch(r){case"compositionend":return Jg(s);case"keypress":return s.which!==32?null:(Kg=!0,Hg);case"textInput":return r=s.data,r===Hg&&Kg?null:r;default:return null}}function QE(r,s){if(vo)return r==="compositionend"||!Ef&&Qg(r,s)?(r=Ug(),yu=vf=Ur=null,vo=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Wg&&s.locale!=="ko"?null:s.data;default:return null}}var JE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gg(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!JE[r.type]:s==="textarea"}function Yg(r,s,a,c){yg(c),s=Cu(s,"onChange"),0<s.length&&(a=new Sf("onChange","change",null,a,c),r.push({event:a,listeners:s}))}var Mi=null,Oi=null;function GE(r){m0(r,0)}function xu(r){var s=_o(r);if(Ss(s))return r}function YE(r,s){if(r==="change")return s}var Xg=!1;if(d){var Cf;if(d){var bf="oninput"in document;if(!bf){var Zg=document.createElement("div");Zg.setAttribute("oninput","return;"),bf=typeof Zg.oninput=="function"}Cf=bf}else Cf=!1;Xg=Cf&&(!document.documentMode||9<document.documentMode)}function e0(){Mi&&(Mi.detachEvent("onpropertychange",t0),Oi=Mi=null)}function t0(r){if(r.propertyName==="value"&&xu(Oi)){var s=[];Yg(s,Oi,r,sf(r)),xg(GE,s)}}function XE(r,s,a){r==="focusin"?(e0(),Mi=s,Oi=a,Mi.attachEvent("onpropertychange",t0)):r==="focusout"&&e0()}function ZE(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return xu(Oi)}function eC(r,s){if(r==="click")return xu(s)}function tC(r,s){if(r==="input"||r==="change")return xu(s)}function nC(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Bn=typeof Object.is=="function"?Object.is:nC;function Li(r,s){if(Bn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),c=Object.keys(s);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var f=a[c];if(!p.call(s,f)||!Bn(r[f],s[f]))return!1}return!0}function n0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function r0(r,s){var a=n0(r);r=0;for(var c;a;){if(a.nodeType===3){if(c=r+a.textContent.length,r<=s&&c>=s)return{node:a,offset:s-r};r=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=n0(a)}}function s0(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?s0(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function o0(){for(var r=window,s=ws();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=ws(r.document)}return s}function Pf(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function rC(r){var s=o0(),a=r.focusedElem,c=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&s0(a.ownerDocument.documentElement,a)){if(c!==null&&Pf(a)){if(s=c.start,r=c.end,r===void 0&&(r=s),"selectionStart"in a)a.selectionStart=s,a.selectionEnd=Math.min(r,a.value.length);else if(r=(s=a.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var f=a.textContent.length,h=Math.min(c.start,f);c=c.end===void 0?h:Math.min(c.end,f),!r.extend&&h>c&&(f=c,c=h,h=f),f=r0(a,h);var S=r0(a,c);f&&S&&(r.rangeCount!==1||r.anchorNode!==f.node||r.anchorOffset!==f.offset||r.focusNode!==S.node||r.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(f.node,f.offset),r.removeAllRanges(),h>c?(r.addRange(s),r.extend(S.node,S.offset)):(s.setEnd(S.node,S.offset),r.addRange(s)))}}for(s=[],r=a;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<s.length;a++)r=s[a],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var sC=d&&"documentMode"in document&&11>=document.documentMode,So=null,If=null,Ni=null,Rf=!1;function i0(r,s,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Rf||So==null||So!==ws(c)||(c=So,"selectionStart"in c&&Pf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ni&&Li(Ni,c)||(Ni=c,c=Cu(If,"onSelect"),0<c.length&&(s=new Sf("onSelect","select",null,s,a),r.push({event:s,listeners:c}),s.target=So)))}function ku(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var wo={animationend:ku("Animation","AnimationEnd"),animationiteration:ku("Animation","AnimationIteration"),animationstart:ku("Animation","AnimationStart"),transitionend:ku("Transition","TransitionEnd")},Tf={},a0={};d&&(a0=document.createElement("div").style,"AnimationEvent"in window||(delete wo.animationend.animation,delete wo.animationiteration.animation,delete wo.animationstart.animation),"TransitionEvent"in window||delete wo.transitionend.transition);function _u(r){if(Tf[r])return Tf[r];if(!wo[r])return r;var s=wo[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in a0)return Tf[r]=s[a];return r}var u0=_u("animationend"),c0=_u("animationiteration"),l0=_u("animationstart"),f0=_u("transitionend"),d0=new Map,h0="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function zr(r,s){d0.set(r,s),u(s,[r])}for(var Mf=0;Mf<h0.length;Mf++){var Of=h0[Mf],oC=Of.toLowerCase(),iC=Of[0].toUpperCase()+Of.slice(1);zr(oC,"on"+iC)}zr(u0,"onAnimationEnd"),zr(c0,"onAnimationIteration"),zr(l0,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(f0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ai="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),aC=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ai));function p0(r,s,a){var c=r.type||"unknown-event";r.currentTarget=a,oE(c,s,void 0,r),r.currentTarget=null}function m0(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var c=r[a],f=c.event;c=c.listeners;e:{var h=void 0;if(s)for(var S=c.length-1;0<=S;S--){var C=c[S],T=C.instance,Q=C.currentTarget;if(C=C.listener,T!==h&&f.isPropagationStopped())break e;p0(f,C,Q),h=T}else for(S=0;S<c.length;S++){if(C=c[S],T=C.instance,Q=C.currentTarget,C=C.listener,T!==h&&f.isPropagationStopped())break e;p0(f,C,Q),h=T}}}if(au)throw r=cf,au=!1,cf=null,r}function He(r,s){var a=s[Uf];a===void 0&&(a=s[Uf]=new Set);var c=r+"__bubble";a.has(c)||(g0(s,r,2,!1),a.add(c))}function Lf(r,s,a){var c=0;s&&(c|=4),g0(a,r,c,s)}var Eu="_reactListening"+Math.random().toString(36).slice(2);function ji(r){if(!r[Eu]){r[Eu]=!0,o.forEach(function(a){a!=="selectionchange"&&(aC.has(a)||Lf(a,!1,r),Lf(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Eu]||(s[Eu]=!0,Lf("selectionchange",!1,s))}}function g0(r,s,a,c){switch(Dg(s)){case 1:var f=xE;break;case 4:f=kE;break;default:f=gf}a=f.bind(null,s,a,r),f=void 0,!uf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),c?f!==void 0?r.addEventListener(s,a,{capture:!0,passive:f}):r.addEventListener(s,a,!0):f!==void 0?r.addEventListener(s,a,{passive:f}):r.addEventListener(s,a,!1)}function Nf(r,s,a,c,f){var h=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var C=c.stateNode.containerInfo;if(C===f||C.nodeType===8&&C.parentNode===f)break;if(S===4)for(S=c.return;S!==null;){var T=S.tag;if((T===3||T===4)&&(T=S.stateNode.containerInfo,T===f||T.nodeType===8&&T.parentNode===f))return;S=S.return}for(;C!==null;){if(S=_s(C),S===null)return;if(T=S.tag,T===5||T===6){c=h=S;continue e}C=C.parentNode}}c=c.return}xg(function(){var Q=h,oe=sf(a),ie=[];e:{var se=d0.get(r);if(se!==void 0){var fe=Sf,me=r;switch(r){case"keypress":if(vu(a)===0)break e;case"keydown":case"keyup":fe=$E;break;case"focusin":me="focus",fe=kf;break;case"focusout":me="blur",fe=kf;break;case"beforeblur":case"afterblur":fe=kf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=Bg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=CE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=UE;break;case u0:case c0:case l0:fe=IE;break;case f0:fe=BE;break;case"scroll":fe=_E;break;case"wheel":fe=qE;break;case"copy":case"cut":case"paste":fe=TE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=qg}var ge=(s&4)!==0,lt=!ge&&r==="scroll",U=ge?se!==null?se+"Capture":null:se;ge=[];for(var M=Q,q;M!==null;){q=M;var ue=q.stateNode;if(q.tag===5&&ue!==null&&(q=ue,U!==null&&(ue=vi(M,U),ue!=null&&ge.push($i(M,ue,q)))),lt)break;M=M.return}0<ge.length&&(se=new fe(se,me,null,a,oe),ie.push({event:se,listeners:ge}))}}if((s&7)===0){e:{if(se=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",se&&a!==rf&&(me=a.relatedTarget||a.fromElement)&&(_s(me)||me[wr]))break e;if((fe||se)&&(se=oe.window===oe?oe:(se=oe.ownerDocument)?se.defaultView||se.parentWindow:window,fe?(me=a.relatedTarget||a.toElement,fe=Q,me=me?_s(me):null,me!==null&&(lt=ks(me),me!==lt||me.tag!==5&&me.tag!==6)&&(me=null)):(fe=null,me=Q),fe!==me)){if(ge=Bg,ue="onMouseLeave",U="onMouseEnter",M="mouse",(r==="pointerout"||r==="pointerover")&&(ge=qg,ue="onPointerLeave",U="onPointerEnter",M="pointer"),lt=fe==null?se:_o(fe),q=me==null?se:_o(me),se=new ge(ue,M+"leave",fe,a,oe),se.target=lt,se.relatedTarget=q,ue=null,_s(oe)===Q&&(ge=new ge(U,M+"enter",me,a,oe),ge.target=q,ge.relatedTarget=lt,ue=ge),lt=ue,fe&&me)t:{for(ge=fe,U=me,M=0,q=ge;q;q=xo(q))M++;for(q=0,ue=U;ue;ue=xo(ue))q++;for(;0<M-q;)ge=xo(ge),M--;for(;0<q-M;)U=xo(U),q--;for(;M--;){if(ge===U||U!==null&&ge===U.alternate)break t;ge=xo(ge),U=xo(U)}ge=null}else ge=null;fe!==null&&y0(ie,se,fe,ge,!1),me!==null&<!==null&&y0(ie,lt,me,ge,!0)}}e:{if(se=Q?_o(Q):window,fe=se.nodeName&&se.nodeName.toLowerCase(),fe==="select"||fe==="input"&&se.type==="file")var ye=YE;else if(Gg(se))if(Xg)ye=tC;else{ye=ZE;var ve=XE}else(fe=se.nodeName)&&fe.toLowerCase()==="input"&&(se.type==="checkbox"||se.type==="radio")&&(ye=eC);if(ye&&(ye=ye(r,Q))){Yg(ie,ye,a,oe);break e}ve&&ve(r,se,Q),r==="focusout"&&(ve=se._wrapperState)&&ve.controlled&&se.type==="number"&&xs(se,"number",se.value)}switch(ve=Q?_o(Q):window,r){case"focusin":(Gg(ve)||ve.contentEditable==="true")&&(So=ve,If=Q,Ni=null);break;case"focusout":Ni=If=So=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,i0(ie,a,oe);break;case"selectionchange":if(sC)break;case"keydown":case"keyup":i0(ie,a,oe)}var Se;if(Ef)e:{switch(r){case"compositionstart":var xe="onCompositionStart";break e;case"compositionend":xe="onCompositionEnd";break e;case"compositionupdate":xe="onCompositionUpdate";break e}xe=void 0}else vo?Qg(r,a)&&(xe="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(xe="onCompositionStart");xe&&(Wg&&a.locale!=="ko"&&(vo||xe!=="onCompositionStart"?xe==="onCompositionEnd"&&vo&&(Se=Ug()):(Ur=oe,vf="value"in Ur?Ur.value:Ur.textContent,vo=!0)),ve=Cu(Q,xe),0<ve.length&&(xe=new Vg(xe,r,null,a,oe),ie.push({event:xe,listeners:ve}),Se?xe.data=Se:(Se=Jg(a),Se!==null&&(xe.data=Se)))),(Se=HE?KE(r,a):QE(r,a))&&(Q=Cu(Q,"onBeforeInput"),0<Q.length&&(oe=new Vg("onBeforeInput","beforeinput",null,a,oe),ie.push({event:oe,listeners:Q}),oe.data=Se))}m0(ie,s)})}function $i(r,s,a){return{instance:r,listener:s,currentTarget:a}}function Cu(r,s){for(var a=s+"Capture",c=[];r!==null;){var f=r,h=f.stateNode;f.tag===5&&h!==null&&(f=h,h=vi(r,a),h!=null&&c.unshift($i(r,h,f)),h=vi(r,s),h!=null&&c.push($i(r,h,f))),r=r.return}return c}function xo(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function y0(r,s,a,c,f){for(var h=s._reactName,S=[];a!==null&&a!==c;){var C=a,T=C.alternate,Q=C.stateNode;if(T!==null&&T===c)break;C.tag===5&&Q!==null&&(C=Q,f?(T=vi(a,h),T!=null&&S.unshift($i(a,T,C))):f||(T=vi(a,h),T!=null&&S.push($i(a,T,C)))),a=a.return}S.length!==0&&r.push({event:s,listeners:S})}var uC=/\r\n?/g,cC=/\u0000|\uFFFD/g;function v0(r){return(typeof r=="string"?r:""+r).replace(uC,`
|
|
39
|
-
`).replace(cC,"")}function bu(r,s,a){if(s=v0(s),v0(r)!==s&&a)throw Error(n(425))}function Pu(){}var Af=null,jf=null;function $f(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Ff=typeof setTimeout=="function"?setTimeout:void 0,lC=typeof clearTimeout=="function"?clearTimeout:void 0,S0=typeof Promise=="function"?Promise:void 0,fC=typeof queueMicrotask=="function"?queueMicrotask:typeof S0<"u"?function(r){return S0.resolve(null).then(r).catch(dC)}:Ff;function dC(r){setTimeout(function(){throw r})}function Df(r,s){var a=s,c=0;do{var f=a.nextSibling;if(r.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(c===0){r.removeChild(f),Pi(s);return}c--}else a!=="$"&&a!=="$?"&&a!=="$!"||c++;a=f}while(a);Pi(s)}function Br(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function w0(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"){if(s===0)return r;s--}else a==="/$"&&s++}r=r.previousSibling}return null}var ko=Math.random().toString(36).slice(2),sr="__reactFiber$"+ko,Fi="__reactProps$"+ko,wr="__reactContainer$"+ko,Uf="__reactEvents$"+ko,hC="__reactListeners$"+ko,pC="__reactHandles$"+ko;function _s(r){var s=r[sr];if(s)return s;for(var a=r.parentNode;a;){if(s=a[wr]||a[sr]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=w0(r);r!==null;){if(a=r[sr])return a;r=w0(r)}return s}r=a,a=r.parentNode}return null}function Di(r){return r=r[sr]||r[wr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function _o(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Iu(r){return r[Fi]||null}var zf=[],Eo=-1;function Vr(r){return{current:r}}function Ke(r){0>Eo||(r.current=zf[Eo],zf[Eo]=null,Eo--)}function Ve(r,s){Eo++,zf[Eo]=r.current,r.current=s}var qr={},Ft=Vr(qr),Xt=Vr(!1),Es=qr;function Co(r,s){var a=r.type.contextTypes;if(!a)return qr;var c=r.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===s)return c.__reactInternalMemoizedMaskedChildContext;var f={},h;for(h in a)f[h]=s[h];return c&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=f),f}function Zt(r){return r=r.childContextTypes,r!=null}function Ru(){Ke(Xt),Ke(Ft)}function x0(r,s,a){if(Ft.current!==qr)throw Error(n(168));Ve(Ft,s),Ve(Xt,a)}function k0(r,s,a){var c=r.stateNode;if(s=s.childContextTypes,typeof c.getChildContext!="function")return a;c=c.getChildContext();for(var f in c)if(!(f in s))throw Error(n(108,Oe(r)||"Unknown",f));return V({},a,c)}function Tu(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||qr,Es=Ft.current,Ve(Ft,r),Ve(Xt,Xt.current),!0}function _0(r,s,a){var c=r.stateNode;if(!c)throw Error(n(169));a?(r=k0(r,s,Es),c.__reactInternalMemoizedMergedChildContext=r,Ke(Xt),Ke(Ft),Ve(Ft,r)):Ke(Xt),Ve(Xt,a)}var xr=null,Mu=!1,Bf=!1;function E0(r){xr===null?xr=[r]:xr.push(r)}function mC(r){Mu=!0,E0(r)}function Wr(){if(!Bf&&xr!==null){Bf=!0;var r=0,s=De;try{var a=xr;for(De=1;r<a.length;r++){var c=a[r];do c=c(!0);while(c!==null)}xr=null,Mu=!1}catch(f){throw xr!==null&&(xr=xr.slice(r+1)),bg(lf,Wr),f}finally{De=s,Bf=!1}}return null}var bo=[],Po=0,Ou=null,Lu=0,bn=[],Pn=0,Cs=null,kr=1,_r="";function bs(r,s){bo[Po++]=Lu,bo[Po++]=Ou,Ou=r,Lu=s}function C0(r,s,a){bn[Pn++]=kr,bn[Pn++]=_r,bn[Pn++]=Cs,Cs=r;var c=kr;r=_r;var f=32-zn(c)-1;c&=~(1<<f),a+=1;var h=32-zn(s)+f;if(30<h){var S=f-f%5;h=(c&(1<<S)-1).toString(32),c>>=S,f-=S,kr=1<<32-zn(s)+f|a<<f|c,_r=h+r}else kr=1<<h|a<<f|c,_r=r}function Vf(r){r.return!==null&&(bs(r,1),C0(r,1,0))}function qf(r){for(;r===Ou;)Ou=bo[--Po],bo[Po]=null,Lu=bo[--Po],bo[Po]=null;for(;r===Cs;)Cs=bn[--Pn],bn[Pn]=null,_r=bn[--Pn],bn[Pn]=null,kr=bn[--Pn],bn[Pn]=null}var mn=null,gn=null,Je=!1,Vn=null;function b0(r,s){var a=Mn(5,null,null,0);a.elementType="DELETED",a.stateNode=s,a.return=r,s=r.deletions,s===null?(r.deletions=[a],r.flags|=16):s.push(a)}function P0(r,s){switch(r.tag){case 5:var a=r.type;return s=s.nodeType!==1||a.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,mn=r,gn=Br(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,mn=r,gn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(a=Cs!==null?{id:kr,overflow:_r}:null,r.memoizedState={dehydrated:s,treeContext:a,retryLane:1073741824},a=Mn(18,null,null,0),a.stateNode=s,a.return=r,r.child=a,mn=r,gn=null,!0):!1;default:return!1}}function Wf(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Hf(r){if(Je){var s=gn;if(s){var a=s;if(!P0(r,s)){if(Wf(r))throw Error(n(418));s=Br(a.nextSibling);var c=mn;s&&P0(r,s)?b0(c,a):(r.flags=r.flags&-4097|2,Je=!1,mn=r)}}else{if(Wf(r))throw Error(n(418));r.flags=r.flags&-4097|2,Je=!1,mn=r}}}function I0(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;mn=r}function Nu(r){if(r!==mn)return!1;if(!Je)return I0(r),Je=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!$f(r.type,r.memoizedProps)),s&&(s=gn)){if(Wf(r))throw R0(),Error(n(418));for(;s;)b0(r,s),s=Br(s.nextSibling)}if(I0(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"){if(s===0){gn=Br(r.nextSibling);break e}s--}else a!=="$"&&a!=="$!"&&a!=="$?"||s++}r=r.nextSibling}gn=null}}else gn=mn?Br(r.stateNode.nextSibling):null;return!0}function R0(){for(var r=gn;r;)r=Br(r.nextSibling)}function Io(){gn=mn=null,Je=!1}function Kf(r){Vn===null?Vn=[r]:Vn.push(r)}var gC=b.ReactCurrentBatchConfig;function Ui(r,s,a){if(r=a.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(n(309));var c=a.stateNode}if(!c)throw Error(n(147,r));var f=c,h=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===h?s.ref:(s=function(S){var C=f.refs;S===null?delete C[h]:C[h]=S},s._stringRef=h,s)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Au(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function T0(r){var s=r._init;return s(r._payload)}function M0(r){function s(U,M){if(r){var q=U.deletions;q===null?(U.deletions=[M],U.flags|=16):q.push(M)}}function a(U,M){if(!r)return null;for(;M!==null;)s(U,M),M=M.sibling;return null}function c(U,M){for(U=new Map;M!==null;)M.key!==null?U.set(M.key,M):U.set(M.index,M),M=M.sibling;return U}function f(U,M){return U=Zr(U,M),U.index=0,U.sibling=null,U}function h(U,M,q){return U.index=q,r?(q=U.alternate,q!==null?(q=q.index,q<M?(U.flags|=2,M):q):(U.flags|=2,M)):(U.flags|=1048576,M)}function S(U){return r&&U.alternate===null&&(U.flags|=2),U}function C(U,M,q,ue){return M===null||M.tag!==6?(M=Fd(q,U.mode,ue),M.return=U,M):(M=f(M,q),M.return=U,M)}function T(U,M,q,ue){var ye=q.type;return ye===A?oe(U,M,q.props.children,ue,q.key):M!==null&&(M.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Y&&T0(ye)===M.type)?(ue=f(M,q.props),ue.ref=Ui(U,M,q),ue.return=U,ue):(ue=oc(q.type,q.key,q.props,null,U.mode,ue),ue.ref=Ui(U,M,q),ue.return=U,ue)}function Q(U,M,q,ue){return M===null||M.tag!==4||M.stateNode.containerInfo!==q.containerInfo||M.stateNode.implementation!==q.implementation?(M=Dd(q,U.mode,ue),M.return=U,M):(M=f(M,q.children||[]),M.return=U,M)}function oe(U,M,q,ue,ye){return M===null||M.tag!==7?(M=Ns(q,U.mode,ue,ye),M.return=U,M):(M=f(M,q),M.return=U,M)}function ie(U,M,q){if(typeof M=="string"&&M!==""||typeof M=="number")return M=Fd(""+M,U.mode,q),M.return=U,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case $:return q=oc(M.type,M.key,M.props,null,U.mode,q),q.ref=Ui(U,null,M),q.return=U,q;case D:return M=Dd(M,U.mode,q),M.return=U,M;case Y:var ue=M._init;return ie(U,ue(M._payload),q)}if(hn(M)||re(M))return M=Ns(M,U.mode,q,null),M.return=U,M;Au(U,M)}return null}function se(U,M,q,ue){var ye=M!==null?M.key:null;if(typeof q=="string"&&q!==""||typeof q=="number")return ye!==null?null:C(U,M,""+q,ue);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case $:return q.key===ye?T(U,M,q,ue):null;case D:return q.key===ye?Q(U,M,q,ue):null;case Y:return ye=q._init,se(U,M,ye(q._payload),ue)}if(hn(q)||re(q))return ye!==null?null:oe(U,M,q,ue,null);Au(U,q)}return null}function fe(U,M,q,ue,ye){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return U=U.get(q)||null,C(M,U,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case $:return U=U.get(ue.key===null?q:ue.key)||null,T(M,U,ue,ye);case D:return U=U.get(ue.key===null?q:ue.key)||null,Q(M,U,ue,ye);case Y:var ve=ue._init;return fe(U,M,q,ve(ue._payload),ye)}if(hn(ue)||re(ue))return U=U.get(q)||null,oe(M,U,ue,ye,null);Au(M,ue)}return null}function me(U,M,q,ue){for(var ye=null,ve=null,Se=M,xe=M=0,Et=null;Se!==null&&xe<q.length;xe++){Se.index>xe?(Et=Se,Se=null):Et=Se.sibling;var Ae=se(U,Se,q[xe],ue);if(Ae===null){Se===null&&(Se=Et);break}r&&Se&&Ae.alternate===null&&s(U,Se),M=h(Ae,M,xe),ve===null?ye=Ae:ve.sibling=Ae,ve=Ae,Se=Et}if(xe===q.length)return a(U,Se),Je&&bs(U,xe),ye;if(Se===null){for(;xe<q.length;xe++)Se=ie(U,q[xe],ue),Se!==null&&(M=h(Se,M,xe),ve===null?ye=Se:ve.sibling=Se,ve=Se);return Je&&bs(U,xe),ye}for(Se=c(U,Se);xe<q.length;xe++)Et=fe(Se,U,xe,q[xe],ue),Et!==null&&(r&&Et.alternate!==null&&Se.delete(Et.key===null?xe:Et.key),M=h(Et,M,xe),ve===null?ye=Et:ve.sibling=Et,ve=Et);return r&&Se.forEach(function(es){return s(U,es)}),Je&&bs(U,xe),ye}function ge(U,M,q,ue){var ye=re(q);if(typeof ye!="function")throw Error(n(150));if(q=ye.call(q),q==null)throw Error(n(151));for(var ve=ye=null,Se=M,xe=M=0,Et=null,Ae=q.next();Se!==null&&!Ae.done;xe++,Ae=q.next()){Se.index>xe?(Et=Se,Se=null):Et=Se.sibling;var es=se(U,Se,Ae.value,ue);if(es===null){Se===null&&(Se=Et);break}r&&Se&&es.alternate===null&&s(U,Se),M=h(es,M,xe),ve===null?ye=es:ve.sibling=es,ve=es,Se=Et}if(Ae.done)return a(U,Se),Je&&bs(U,xe),ye;if(Se===null){for(;!Ae.done;xe++,Ae=q.next())Ae=ie(U,Ae.value,ue),Ae!==null&&(M=h(Ae,M,xe),ve===null?ye=Ae:ve.sibling=Ae,ve=Ae);return Je&&bs(U,xe),ye}for(Se=c(U,Se);!Ae.done;xe++,Ae=q.next())Ae=fe(Se,U,xe,Ae.value,ue),Ae!==null&&(r&&Ae.alternate!==null&&Se.delete(Ae.key===null?xe:Ae.key),M=h(Ae,M,xe),ve===null?ye=Ae:ve.sibling=Ae,ve=Ae);return r&&Se.forEach(function(JC){return s(U,JC)}),Je&&bs(U,xe),ye}function lt(U,M,q,ue){if(typeof q=="object"&&q!==null&&q.type===A&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case $:e:{for(var ye=q.key,ve=M;ve!==null;){if(ve.key===ye){if(ye=q.type,ye===A){if(ve.tag===7){a(U,ve.sibling),M=f(ve,q.props.children),M.return=U,U=M;break e}}else if(ve.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Y&&T0(ye)===ve.type){a(U,ve.sibling),M=f(ve,q.props),M.ref=Ui(U,ve,q),M.return=U,U=M;break e}a(U,ve);break}else s(U,ve);ve=ve.sibling}q.type===A?(M=Ns(q.props.children,U.mode,ue,q.key),M.return=U,U=M):(ue=oc(q.type,q.key,q.props,null,U.mode,ue),ue.ref=Ui(U,M,q),ue.return=U,U=ue)}return S(U);case D:e:{for(ve=q.key;M!==null;){if(M.key===ve)if(M.tag===4&&M.stateNode.containerInfo===q.containerInfo&&M.stateNode.implementation===q.implementation){a(U,M.sibling),M=f(M,q.children||[]),M.return=U,U=M;break e}else{a(U,M);break}else s(U,M);M=M.sibling}M=Dd(q,U.mode,ue),M.return=U,U=M}return S(U);case Y:return ve=q._init,lt(U,M,ve(q._payload),ue)}if(hn(q))return me(U,M,q,ue);if(re(q))return ge(U,M,q,ue);Au(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,M!==null&&M.tag===6?(a(U,M.sibling),M=f(M,q),M.return=U,U=M):(a(U,M),M=Fd(q,U.mode,ue),M.return=U,U=M),S(U)):a(U,M)}return lt}var Ro=M0(!0),O0=M0(!1),ju=Vr(null),$u=null,To=null,Qf=null;function Jf(){Qf=To=$u=null}function Gf(r){var s=ju.current;Ke(ju),r._currentValue=s}function Yf(r,s,a){for(;r!==null;){var c=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),r===a)break;r=r.return}}function Mo(r,s){$u=r,Qf=To=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(en=!0),r.firstContext=null)}function In(r){var s=r._currentValue;if(Qf!==r)if(r={context:r,memoizedValue:s,next:null},To===null){if($u===null)throw Error(n(308));To=r,$u.dependencies={lanes:0,firstContext:r}}else To=To.next=r;return s}var Ps=null;function Xf(r){Ps===null?Ps=[r]:Ps.push(r)}function L0(r,s,a,c){var f=s.interleaved;return f===null?(a.next=a,Xf(s)):(a.next=f.next,f.next=a),s.interleaved=a,Er(r,c)}function Er(r,s){r.lanes|=s;var a=r.alternate;for(a!==null&&(a.lanes|=s),a=r,r=r.return;r!==null;)r.childLanes|=s,a=r.alternate,a!==null&&(a.childLanes|=s),a=r,r=r.return;return a.tag===3?a.stateNode:null}var Hr=!1;function Zf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function N0(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Cr(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function Kr(r,s,a){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(Ne&2)!==0){var f=c.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),c.pending=s,Er(r,a)}return f=c.interleaved,f===null?(s.next=s,Xf(c)):(s.next=f.next,f.next=s),c.interleaved=s,Er(r,a)}function Fu(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194240)!==0)){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,hf(r,a)}}function A0(r,s){var a=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var S={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};h===null?f=h=S:h=h.next=S,a=a.next}while(a!==null);h===null?f=h=s:h=h.next=s}else f=h=s;a={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:c.shared,effects:c.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}function Du(r,s,a,c){var f=r.updateQueue;Hr=!1;var h=f.firstBaseUpdate,S=f.lastBaseUpdate,C=f.shared.pending;if(C!==null){f.shared.pending=null;var T=C,Q=T.next;T.next=null,S===null?h=Q:S.next=Q,S=T;var oe=r.alternate;oe!==null&&(oe=oe.updateQueue,C=oe.lastBaseUpdate,C!==S&&(C===null?oe.firstBaseUpdate=Q:C.next=Q,oe.lastBaseUpdate=T))}if(h!==null){var ie=f.baseState;S=0,oe=Q=T=null,C=h;do{var se=C.lane,fe=C.eventTime;if((c&se)===se){oe!==null&&(oe=oe.next={eventTime:fe,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var me=r,ge=C;switch(se=s,fe=a,ge.tag){case 1:if(me=ge.payload,typeof me=="function"){ie=me.call(fe,ie,se);break e}ie=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ge.payload,se=typeof me=="function"?me.call(fe,ie,se):me,se==null)break e;ie=V({},ie,se);break e;case 2:Hr=!0}}C.callback!==null&&C.lane!==0&&(r.flags|=64,se=f.effects,se===null?f.effects=[C]:se.push(C))}else fe={eventTime:fe,lane:se,tag:C.tag,payload:C.payload,callback:C.callback,next:null},oe===null?(Q=oe=fe,T=ie):oe=oe.next=fe,S|=se;if(C=C.next,C===null){if(C=f.shared.pending,C===null)break;se=C,C=se.next,se.next=null,f.lastBaseUpdate=se,f.shared.pending=null}}while(!0);if(oe===null&&(T=ie),f.baseState=T,f.firstBaseUpdate=Q,f.lastBaseUpdate=oe,s=f.shared.interleaved,s!==null){f=s;do S|=f.lane,f=f.next;while(f!==s)}else h===null&&(f.shared.lanes=0);Ts|=S,r.lanes=S,r.memoizedState=ie}}function j0(r,s,a){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var c=r[s],f=c.callback;if(f!==null){if(c.callback=null,c=a,typeof f!="function")throw Error(n(191,f));f.call(c)}}}var zi={},or=Vr(zi),Bi=Vr(zi),Vi=Vr(zi);function Is(r){if(r===zi)throw Error(n(174));return r}function ed(r,s){switch(Ve(Vi,s),Ve(Bi,r),Ve(or,zi),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Un(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Un(s,r)}Ke(or),Ve(or,s)}function Oo(){Ke(or),Ke(Bi),Ke(Vi)}function $0(r){Is(Vi.current);var s=Is(or.current),a=Un(s,r.type);s!==a&&(Ve(Bi,r),Ve(or,a))}function td(r){Bi.current===r&&(Ke(or),Ke(Bi))}var et=Vr(0);function Uu(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var nd=[];function rd(){for(var r=0;r<nd.length;r++)nd[r]._workInProgressVersionPrimary=null;nd.length=0}var zu=b.ReactCurrentDispatcher,sd=b.ReactCurrentBatchConfig,Rs=0,tt=null,gt=null,kt=null,Bu=!1,qi=!1,Wi=0,yC=0;function Dt(){throw Error(n(321))}function od(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!Bn(r[a],s[a]))return!1;return!0}function id(r,s,a,c,f,h){if(Rs=h,tt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,zu.current=r===null||r.memoizedState===null?xC:kC,r=a(c,f),qi){h=0;do{if(qi=!1,Wi=0,25<=h)throw Error(n(301));h+=1,kt=gt=null,s.updateQueue=null,zu.current=_C,r=a(c,f)}while(qi)}if(zu.current=Wu,s=gt!==null&>.next!==null,Rs=0,kt=gt=tt=null,Bu=!1,s)throw Error(n(300));return r}function ad(){var r=Wi!==0;return Wi=0,r}function ir(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kt===null?tt.memoizedState=kt=r:kt=kt.next=r,kt}function Rn(){if(gt===null){var r=tt.alternate;r=r!==null?r.memoizedState:null}else r=gt.next;var s=kt===null?tt.memoizedState:kt.next;if(s!==null)kt=s,gt=r;else{if(r===null)throw Error(n(310));gt=r,r={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},kt===null?tt.memoizedState=kt=r:kt=kt.next=r}return kt}function Hi(r,s){return typeof s=="function"?s(r):s}function ud(r){var s=Rn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var c=gt,f=c.baseQueue,h=a.pending;if(h!==null){if(f!==null){var S=f.next;f.next=h.next,h.next=S}c.baseQueue=f=h,a.pending=null}if(f!==null){h=f.next,c=c.baseState;var C=S=null,T=null,Q=h;do{var oe=Q.lane;if((Rs&oe)===oe)T!==null&&(T=T.next={lane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),c=Q.hasEagerState?Q.eagerState:r(c,Q.action);else{var ie={lane:oe,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null};T===null?(C=T=ie,S=c):T=T.next=ie,tt.lanes|=oe,Ts|=oe}Q=Q.next}while(Q!==null&&Q!==h);T===null?S=c:T.next=C,Bn(c,s.memoizedState)||(en=!0),s.memoizedState=c,s.baseState=S,s.baseQueue=T,a.lastRenderedState=c}if(r=a.interleaved,r!==null){f=r;do h=f.lane,tt.lanes|=h,Ts|=h,f=f.next;while(f!==r)}else f===null&&(a.lanes=0);return[s.memoizedState,a.dispatch]}function cd(r){var s=Rn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var c=a.dispatch,f=a.pending,h=s.memoizedState;if(f!==null){a.pending=null;var S=f=f.next;do h=r(h,S.action),S=S.next;while(S!==f);Bn(h,s.memoizedState)||(en=!0),s.memoizedState=h,s.baseQueue===null&&(s.baseState=h),a.lastRenderedState=h}return[h,c]}function F0(){}function D0(r,s){var a=tt,c=Rn(),f=s(),h=!Bn(c.memoizedState,f);if(h&&(c.memoizedState=f,en=!0),c=c.queue,ld(B0.bind(null,a,c,r),[r]),c.getSnapshot!==s||h||kt!==null&&kt.memoizedState.tag&1){if(a.flags|=2048,Ki(9,z0.bind(null,a,c,f,s),void 0,null),_t===null)throw Error(n(349));(Rs&30)!==0||U0(a,s,f)}return f}function U0(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=tt.updateQueue,s===null?(s={lastEffect:null,stores:null},tt.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function z0(r,s,a,c){s.value=a,s.getSnapshot=c,V0(s)&&q0(r)}function B0(r,s,a){return a(function(){V0(s)&&q0(r)})}function V0(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!Bn(r,a)}catch{return!0}}function q0(r){var s=Er(r,1);s!==null&&Kn(s,r,1,-1)}function W0(r){var s=ir();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:r},s.queue=r,r=r.dispatch=wC.bind(null,tt,r),[s.memoizedState,r]}function Ki(r,s,a,c){return r={tag:r,create:s,destroy:a,deps:c,next:null},s=tt.updateQueue,s===null?(s={lastEffect:null,stores:null},tt.updateQueue=s,s.lastEffect=r.next=r):(a=s.lastEffect,a===null?s.lastEffect=r.next=r:(c=a.next,a.next=r,r.next=c,s.lastEffect=r)),r}function H0(){return Rn().memoizedState}function Vu(r,s,a,c){var f=ir();tt.flags|=r,f.memoizedState=Ki(1|s,a,void 0,c===void 0?null:c)}function qu(r,s,a,c){var f=Rn();c=c===void 0?null:c;var h=void 0;if(gt!==null){var S=gt.memoizedState;if(h=S.destroy,c!==null&&od(c,S.deps)){f.memoizedState=Ki(s,a,h,c);return}}tt.flags|=r,f.memoizedState=Ki(1|s,a,h,c)}function K0(r,s){return Vu(8390656,8,r,s)}function ld(r,s){return qu(2048,8,r,s)}function Q0(r,s){return qu(4,2,r,s)}function J0(r,s){return qu(4,4,r,s)}function G0(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Y0(r,s,a){return a=a!=null?a.concat([r]):null,qu(4,4,G0.bind(null,s,r),a)}function fd(){}function X0(r,s){var a=Rn();s=s===void 0?null:s;var c=a.memoizedState;return c!==null&&s!==null&&od(s,c[1])?c[0]:(a.memoizedState=[r,s],r)}function Z0(r,s){var a=Rn();s=s===void 0?null:s;var c=a.memoizedState;return c!==null&&s!==null&&od(s,c[1])?c[0]:(r=r(),a.memoizedState=[r,s],r)}function ey(r,s,a){return(Rs&21)===0?(r.baseState&&(r.baseState=!1,en=!0),r.memoizedState=a):(Bn(a,s)||(a=Tg(),tt.lanes|=a,Ts|=a,r.baseState=!0),s)}function vC(r,s){var a=De;De=a!==0&&4>a?a:4,r(!0);var c=sd.transition;sd.transition={};try{r(!1),s()}finally{De=a,sd.transition=c}}function ty(){return Rn().memoizedState}function SC(r,s,a){var c=Yr(r);if(a={lane:c,action:a,hasEagerState:!1,eagerState:null,next:null},ny(r))ry(s,a);else if(a=L0(r,s,a,c),a!==null){var f=Kt();Kn(a,r,c,f),sy(a,s,c)}}function wC(r,s,a){var c=Yr(r),f={lane:c,action:a,hasEagerState:!1,eagerState:null,next:null};if(ny(r))ry(s,f);else{var h=r.alternate;if(r.lanes===0&&(h===null||h.lanes===0)&&(h=s.lastRenderedReducer,h!==null))try{var S=s.lastRenderedState,C=h(S,a);if(f.hasEagerState=!0,f.eagerState=C,Bn(C,S)){var T=s.interleaved;T===null?(f.next=f,Xf(s)):(f.next=T.next,T.next=f),s.interleaved=f;return}}catch{}finally{}a=L0(r,s,f,c),a!==null&&(f=Kt(),Kn(a,r,c,f),sy(a,s,c))}}function ny(r){var s=r.alternate;return r===tt||s!==null&&s===tt}function ry(r,s){qi=Bu=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function sy(r,s,a){if((a&4194240)!==0){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,hf(r,a)}}var Wu={readContext:In,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},xC={readContext:In,useCallback:function(r,s){return ir().memoizedState=[r,s===void 0?null:s],r},useContext:In,useEffect:K0,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,Vu(4194308,4,G0.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Vu(4194308,4,r,s)},useInsertionEffect:function(r,s){return Vu(4,2,r,s)},useMemo:function(r,s){var a=ir();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var c=ir();return s=a!==void 0?a(s):s,c.memoizedState=c.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},c.queue=r,r=r.dispatch=SC.bind(null,tt,r),[c.memoizedState,r]},useRef:function(r){var s=ir();return r={current:r},s.memoizedState=r},useState:W0,useDebugValue:fd,useDeferredValue:function(r){return ir().memoizedState=r},useTransition:function(){var r=W0(!1),s=r[0];return r=vC.bind(null,r[1]),ir().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var c=tt,f=ir();if(Je){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),_t===null)throw Error(n(349));(Rs&30)!==0||U0(c,s,a)}f.memoizedState=a;var h={value:a,getSnapshot:s};return f.queue=h,K0(B0.bind(null,c,h,r),[r]),c.flags|=2048,Ki(9,z0.bind(null,c,h,a,s),void 0,null),a},useId:function(){var r=ir(),s=_t.identifierPrefix;if(Je){var a=_r,c=kr;a=(c&~(1<<32-zn(c)-1)).toString(32)+a,s=":"+s+"R"+a,a=Wi++,0<a&&(s+="H"+a.toString(32)),s+=":"}else a=yC++,s=":"+s+"r"+a.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},kC={readContext:In,useCallback:X0,useContext:In,useEffect:ld,useImperativeHandle:Y0,useInsertionEffect:Q0,useLayoutEffect:J0,useMemo:Z0,useReducer:ud,useRef:H0,useState:function(){return ud(Hi)},useDebugValue:fd,useDeferredValue:function(r){var s=Rn();return ey(s,gt.memoizedState,r)},useTransition:function(){var r=ud(Hi)[0],s=Rn().memoizedState;return[r,s]},useMutableSource:F0,useSyncExternalStore:D0,useId:ty,unstable_isNewReconciler:!1},_C={readContext:In,useCallback:X0,useContext:In,useEffect:ld,useImperativeHandle:Y0,useInsertionEffect:Q0,useLayoutEffect:J0,useMemo:Z0,useReducer:cd,useRef:H0,useState:function(){return cd(Hi)},useDebugValue:fd,useDeferredValue:function(r){var s=Rn();return gt===null?s.memoizedState=r:ey(s,gt.memoizedState,r)},useTransition:function(){var r=cd(Hi)[0],s=Rn().memoizedState;return[r,s]},useMutableSource:F0,useSyncExternalStore:D0,useId:ty,unstable_isNewReconciler:!1};function qn(r,s){if(r&&r.defaultProps){s=V({},s),r=r.defaultProps;for(var a in r)s[a]===void 0&&(s[a]=r[a]);return s}return s}function dd(r,s,a,c){s=r.memoizedState,a=a(c,s),a=a==null?s:V({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var Hu={isMounted:function(r){return(r=r._reactInternals)?ks(r)===r:!1},enqueueSetState:function(r,s,a){r=r._reactInternals;var c=Kt(),f=Yr(r),h=Cr(c,f);h.payload=s,a!=null&&(h.callback=a),s=Kr(r,h,f),s!==null&&(Kn(s,r,f,c),Fu(s,r,f))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var c=Kt(),f=Yr(r),h=Cr(c,f);h.tag=1,h.payload=s,a!=null&&(h.callback=a),s=Kr(r,h,f),s!==null&&(Kn(s,r,f,c),Fu(s,r,f))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=Kt(),c=Yr(r),f=Cr(a,c);f.tag=2,s!=null&&(f.callback=s),s=Kr(r,f,c),s!==null&&(Kn(s,r,c,a),Fu(s,r,c))}};function oy(r,s,a,c,f,h,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,h,S):s.prototype&&s.prototype.isPureReactComponent?!Li(a,c)||!Li(f,h):!0}function iy(r,s,a){var c=!1,f=qr,h=s.contextType;return typeof h=="object"&&h!==null?h=In(h):(f=Zt(s)?Es:Ft.current,c=s.contextTypes,h=(c=c!=null)?Co(r,f):qr),s=new s(a,h),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Hu,r.stateNode=s,s._reactInternals=r,c&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=f,r.__reactInternalMemoizedMaskedChildContext=h),s}function ay(r,s,a,c){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,c),s.state!==r&&Hu.enqueueReplaceState(s,s.state,null)}function hd(r,s,a,c){var f=r.stateNode;f.props=a,f.state=r.memoizedState,f.refs={},Zf(r);var h=s.contextType;typeof h=="object"&&h!==null?f.context=In(h):(h=Zt(s)?Es:Ft.current,f.context=Co(r,h)),f.state=r.memoizedState,h=s.getDerivedStateFromProps,typeof h=="function"&&(dd(r,s,h,a),f.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(s=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),s!==f.state&&Hu.enqueueReplaceState(f,f.state,null),Du(r,a,f,c),f.state=r.memoizedState),typeof f.componentDidMount=="function"&&(r.flags|=4194308)}function Lo(r,s){try{var a="",c=s;do a+=ce(c),c=c.return;while(c);var f=a}catch(h){f=`
|
|
40
|
-
Error generating stack: `+h.message+`
|
|
41
|
-
`+h.stack}return{value:r,source:s,stack:f,digest:null}}function pd(r,s,a){return{value:r,source:null,stack:a??null,digest:s??null}}function md(r,s){try{console.error(s.value)}catch(a){setTimeout(function(){throw a})}}var EC=typeof WeakMap=="function"?WeakMap:Map;function uy(r,s,a){a=Cr(-1,a),a.tag=3,a.payload={element:null};var c=s.value;return a.callback=function(){Zu||(Zu=!0,Td=c),md(r,s)},a}function cy(r,s,a){a=Cr(-1,a),a.tag=3;var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var f=s.value;a.payload=function(){return c(f)},a.callback=function(){md(r,s)}}var h=r.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(a.callback=function(){md(r,s),typeof c!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),a}function ly(r,s,a){var c=r.pingCache;if(c===null){c=r.pingCache=new EC;var f=new Set;c.set(s,f)}else f=c.get(s),f===void 0&&(f=new Set,c.set(s,f));f.has(a)||(f.add(a),r=FC.bind(null,r,s,a),s.then(r,r))}function fy(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function dy(r,s,a,c,f){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(s=Cr(-1,1),s.tag=2,Kr(a,s,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=f,r)}var CC=b.ReactCurrentOwner,en=!1;function Ht(r,s,a,c){s.child=r===null?O0(s,null,a,c):Ro(s,r.child,a,c)}function hy(r,s,a,c,f){a=a.render;var h=s.ref;return Mo(s,f),c=id(r,s,a,c,h,f),a=ad(),r!==null&&!en?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,br(r,s,f)):(Je&&a&&Vf(s),s.flags|=1,Ht(r,s,c,f),s.child)}function py(r,s,a,c,f){if(r===null){var h=a.type;return typeof h=="function"&&!$d(h)&&h.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(s.tag=15,s.type=h,my(r,s,h,c,f)):(r=oc(a.type,null,c,s,s.mode,f),r.ref=s.ref,r.return=s,s.child=r)}if(h=r.child,(r.lanes&f)===0){var S=h.memoizedProps;if(a=a.compare,a=a!==null?a:Li,a(S,c)&&r.ref===s.ref)return br(r,s,f)}return s.flags|=1,r=Zr(h,c),r.ref=s.ref,r.return=s,s.child=r}function my(r,s,a,c,f){if(r!==null){var h=r.memoizedProps;if(Li(h,c)&&r.ref===s.ref)if(en=!1,s.pendingProps=c=h,(r.lanes&f)!==0)(r.flags&131072)!==0&&(en=!0);else return s.lanes=r.lanes,br(r,s,f)}return gd(r,s,a,c,f)}function gy(r,s,a){var c=s.pendingProps,f=c.children,h=r!==null?r.memoizedState:null;if(c.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ve(Ao,yn),yn|=a;else{if((a&1073741824)===0)return r=h!==null?h.baseLanes|a:a,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Ve(Ao,yn),yn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=h!==null?h.baseLanes:a,Ve(Ao,yn),yn|=c}else h!==null?(c=h.baseLanes|a,s.memoizedState=null):c=a,Ve(Ao,yn),yn|=c;return Ht(r,s,f,a),s.child}function yy(r,s){var a=s.ref;(r===null&&a!==null||r!==null&&r.ref!==a)&&(s.flags|=512,s.flags|=2097152)}function gd(r,s,a,c,f){var h=Zt(a)?Es:Ft.current;return h=Co(s,h),Mo(s,f),a=id(r,s,a,c,h,f),c=ad(),r!==null&&!en?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,br(r,s,f)):(Je&&c&&Vf(s),s.flags|=1,Ht(r,s,a,f),s.child)}function vy(r,s,a,c,f){if(Zt(a)){var h=!0;Tu(s)}else h=!1;if(Mo(s,f),s.stateNode===null)Qu(r,s),iy(s,a,c),hd(s,a,c,f),c=!0;else if(r===null){var S=s.stateNode,C=s.memoizedProps;S.props=C;var T=S.context,Q=a.contextType;typeof Q=="object"&&Q!==null?Q=In(Q):(Q=Zt(a)?Es:Ft.current,Q=Co(s,Q));var oe=a.getDerivedStateFromProps,ie=typeof oe=="function"||typeof S.getSnapshotBeforeUpdate=="function";ie||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(C!==c||T!==Q)&&ay(s,S,c,Q),Hr=!1;var se=s.memoizedState;S.state=se,Du(s,c,S,f),T=s.memoizedState,C!==c||se!==T||Xt.current||Hr?(typeof oe=="function"&&(dd(s,a,oe,c),T=s.memoizedState),(C=Hr||oy(s,a,C,c,se,T,Q))?(ie||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=T),S.props=c,S.state=T,S.context=Q,c=C):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{S=s.stateNode,N0(r,s),C=s.memoizedProps,Q=s.type===s.elementType?C:qn(s.type,C),S.props=Q,ie=s.pendingProps,se=S.context,T=a.contextType,typeof T=="object"&&T!==null?T=In(T):(T=Zt(a)?Es:Ft.current,T=Co(s,T));var fe=a.getDerivedStateFromProps;(oe=typeof fe=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(C!==ie||se!==T)&&ay(s,S,c,T),Hr=!1,se=s.memoizedState,S.state=se,Du(s,c,S,f);var me=s.memoizedState;C!==ie||se!==me||Xt.current||Hr?(typeof fe=="function"&&(dd(s,a,fe,c),me=s.memoizedState),(Q=Hr||oy(s,a,Q,c,se,me,T)||!1)?(oe||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(c,me,T),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(c,me,T)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=me),S.props=c,S.state=me,S.context=T,c=Q):(typeof S.componentDidUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(s.flags|=1024),c=!1)}return yd(r,s,a,c,h,f)}function yd(r,s,a,c,f,h){yy(r,s);var S=(s.flags&128)!==0;if(!c&&!S)return f&&_0(s,a,!1),br(r,s,h);c=s.stateNode,CC.current=s;var C=S&&typeof a.getDerivedStateFromError!="function"?null:c.render();return s.flags|=1,r!==null&&S?(s.child=Ro(s,r.child,null,h),s.child=Ro(s,null,C,h)):Ht(r,s,C,h),s.memoizedState=c.state,f&&_0(s,a,!0),s.child}function Sy(r){var s=r.stateNode;s.pendingContext?x0(r,s.pendingContext,s.pendingContext!==s.context):s.context&&x0(r,s.context,!1),ed(r,s.containerInfo)}function wy(r,s,a,c,f){return Io(),Kf(f),s.flags|=256,Ht(r,s,a,c),s.child}var vd={dehydrated:null,treeContext:null,retryLane:0};function Sd(r){return{baseLanes:r,cachePool:null,transitions:null}}function xy(r,s,a){var c=s.pendingProps,f=et.current,h=!1,S=(s.flags&128)!==0,C;if((C=S)||(C=r!==null&&r.memoizedState===null?!1:(f&2)!==0),C?(h=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(f|=1),Ve(et,f&1),r===null)return Hf(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(S=c.children,r=c.fallback,h?(c=s.mode,h=s.child,S={mode:"hidden",children:S},(c&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=S):h=ic(S,c,0,null),r=Ns(r,c,a,null),h.return=s,r.return=s,h.sibling=r,s.child=h,s.child.memoizedState=Sd(a),s.memoizedState=vd,r):wd(s,S));if(f=r.memoizedState,f!==null&&(C=f.dehydrated,C!==null))return bC(r,s,S,c,C,f,a);if(h){h=c.fallback,S=s.mode,f=r.child,C=f.sibling;var T={mode:"hidden",children:c.children};return(S&1)===0&&s.child!==f?(c=s.child,c.childLanes=0,c.pendingProps=T,s.deletions=null):(c=Zr(f,T),c.subtreeFlags=f.subtreeFlags&14680064),C!==null?h=Zr(C,h):(h=Ns(h,S,a,null),h.flags|=2),h.return=s,c.return=s,c.sibling=h,s.child=c,c=h,h=s.child,S=r.child.memoizedState,S=S===null?Sd(a):{baseLanes:S.baseLanes|a,cachePool:null,transitions:S.transitions},h.memoizedState=S,h.childLanes=r.childLanes&~a,s.memoizedState=vd,c}return h=r.child,r=h.sibling,c=Zr(h,{mode:"visible",children:c.children}),(s.mode&1)===0&&(c.lanes=a),c.return=s,c.sibling=null,r!==null&&(a=s.deletions,a===null?(s.deletions=[r],s.flags|=16):a.push(r)),s.child=c,s.memoizedState=null,c}function wd(r,s){return s=ic({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function Ku(r,s,a,c){return c!==null&&Kf(c),Ro(s,r.child,null,a),r=wd(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function bC(r,s,a,c,f,h,S){if(a)return s.flags&256?(s.flags&=-257,c=pd(Error(n(422))),Ku(r,s,S,c)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(h=c.fallback,f=s.mode,c=ic({mode:"visible",children:c.children},f,0,null),h=Ns(h,f,S,null),h.flags|=2,c.return=s,h.return=s,c.sibling=h,s.child=c,(s.mode&1)!==0&&Ro(s,r.child,null,S),s.child.memoizedState=Sd(S),s.memoizedState=vd,h);if((s.mode&1)===0)return Ku(r,s,S,null);if(f.data==="$!"){if(c=f.nextSibling&&f.nextSibling.dataset,c)var C=c.dgst;return c=C,h=Error(n(419)),c=pd(h,c,void 0),Ku(r,s,S,c)}if(C=(S&r.childLanes)!==0,en||C){if(c=_t,c!==null){switch(S&-S){case 4:f=2;break;case 16:f=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(c.suspendedLanes|S))!==0?0:f,f!==0&&f!==h.retryLane&&(h.retryLane=f,Er(r,f),Kn(c,r,f,-1))}return jd(),c=pd(Error(n(421))),Ku(r,s,S,c)}return f.data==="$?"?(s.flags|=128,s.child=r.child,s=DC.bind(null,r),f._reactRetry=s,null):(r=h.treeContext,gn=Br(f.nextSibling),mn=s,Je=!0,Vn=null,r!==null&&(bn[Pn++]=kr,bn[Pn++]=_r,bn[Pn++]=Cs,kr=r.id,_r=r.overflow,Cs=s),s=wd(s,c.children),s.flags|=4096,s)}function ky(r,s,a){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s),Yf(r.return,s,a)}function xd(r,s,a,c,f){var h=r.memoizedState;h===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:f}:(h.isBackwards=s,h.rendering=null,h.renderingStartTime=0,h.last=c,h.tail=a,h.tailMode=f)}function _y(r,s,a){var c=s.pendingProps,f=c.revealOrder,h=c.tail;if(Ht(r,s,c.children,a),c=et.current,(c&2)!==0)c=c&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&ky(r,a,s);else if(r.tag===19)ky(r,a,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}c&=1}if(Ve(et,c),(s.mode&1)===0)s.memoizedState=null;else switch(f){case"forwards":for(a=s.child,f=null;a!==null;)r=a.alternate,r!==null&&Uu(r)===null&&(f=a),a=a.sibling;a=f,a===null?(f=s.child,s.child=null):(f=a.sibling,a.sibling=null),xd(s,!1,f,a,h);break;case"backwards":for(a=null,f=s.child,s.child=null;f!==null;){if(r=f.alternate,r!==null&&Uu(r)===null){s.child=f;break}r=f.sibling,f.sibling=a,a=f,f=r}xd(s,!0,a,null,h);break;case"together":xd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Qu(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function br(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),Ts|=s.lanes,(a&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,a=Zr(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=Zr(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function PC(r,s,a){switch(s.tag){case 3:Sy(s),Io();break;case 5:$0(s);break;case 1:Zt(s.type)&&Tu(s);break;case 4:ed(s,s.stateNode.containerInfo);break;case 10:var c=s.type._context,f=s.memoizedProps.value;Ve(ju,c._currentValue),c._currentValue=f;break;case 13:if(c=s.memoizedState,c!==null)return c.dehydrated!==null?(Ve(et,et.current&1),s.flags|=128,null):(a&s.child.childLanes)!==0?xy(r,s,a):(Ve(et,et.current&1),r=br(r,s,a),r!==null?r.sibling:null);Ve(et,et.current&1);break;case 19:if(c=(a&s.childLanes)!==0,(r.flags&128)!==0){if(c)return _y(r,s,a);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ve(et,et.current),c)break;return null;case 22:case 23:return s.lanes=0,gy(r,s,a)}return br(r,s,a)}var Ey,kd,Cy,by;Ey=function(r,s){for(var a=s.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},kd=function(){},Cy=function(r,s,a,c){var f=r.memoizedProps;if(f!==c){r=s.stateNode,Is(or.current);var h=null;switch(a){case"input":f=co(r,f),c=co(r,c),h=[];break;case"select":f=V({},f,{value:void 0}),c=V({},c,{value:void 0}),h=[];break;case"textarea":f=fo(r,f),c=fo(r,c),h=[];break;default:typeof f.onClick!="function"&&typeof c.onClick=="function"&&(r.onclick=Pu)}tf(a,c);var S;a=null;for(Q in f)if(!c.hasOwnProperty(Q)&&f.hasOwnProperty(Q)&&f[Q]!=null)if(Q==="style"){var C=f[Q];for(S in C)C.hasOwnProperty(S)&&(a||(a={}),a[S]="")}else Q!=="dangerouslySetInnerHTML"&&Q!=="children"&&Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?h||(h=[]):(h=h||[]).push(Q,null));for(Q in c){var T=c[Q];if(C=f!=null?f[Q]:void 0,c.hasOwnProperty(Q)&&T!==C&&(T!=null||C!=null))if(Q==="style")if(C){for(S in C)!C.hasOwnProperty(S)||T&&T.hasOwnProperty(S)||(a||(a={}),a[S]="");for(S in T)T.hasOwnProperty(S)&&C[S]!==T[S]&&(a||(a={}),a[S]=T[S])}else a||(h||(h=[]),h.push(Q,a)),a=T;else Q==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,C=C?C.__html:void 0,T!=null&&C!==T&&(h=h||[]).push(Q,T)):Q==="children"?typeof T!="string"&&typeof T!="number"||(h=h||[]).push(Q,""+T):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&(i.hasOwnProperty(Q)?(T!=null&&Q==="onScroll"&&He("scroll",r),h||C===T||(h=[])):(h=h||[]).push(Q,T))}a&&(h=h||[]).push("style",a);var Q=h;(s.updateQueue=Q)&&(s.flags|=4)}},by=function(r,s,a,c){a!==c&&(s.flags|=4)};function Qi(r,s){if(!Je)switch(r.tailMode){case"hidden":s=r.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function Ut(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,c=0;if(s)for(var f=r.child;f!==null;)a|=f.lanes|f.childLanes,c|=f.subtreeFlags&14680064,c|=f.flags&14680064,f.return=r,f=f.sibling;else for(f=r.child;f!==null;)a|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=r,f=f.sibling;return r.subtreeFlags|=c,r.childLanes=a,s}function IC(r,s,a){var c=s.pendingProps;switch(qf(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(s),null;case 1:return Zt(s.type)&&Ru(),Ut(s),null;case 3:return c=s.stateNode,Oo(),Ke(Xt),Ke(Ft),rd(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Nu(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Vn!==null&&(Ld(Vn),Vn=null))),kd(r,s),Ut(s),null;case 5:td(s);var f=Is(Vi.current);if(a=s.type,r!==null&&s.stateNode!=null)Cy(r,s,a,c,f),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!c){if(s.stateNode===null)throw Error(n(166));return Ut(s),null}if(r=Is(or.current),Nu(s)){c=s.stateNode,a=s.type;var h=s.memoizedProps;switch(c[sr]=s,c[Fi]=h,r=(s.mode&1)!==0,a){case"dialog":He("cancel",c),He("close",c);break;case"iframe":case"object":case"embed":He("load",c);break;case"video":case"audio":for(f=0;f<Ai.length;f++)He(Ai[f],c);break;case"source":He("error",c);break;case"img":case"image":case"link":He("error",c),He("load",c);break;case"details":He("toggle",c);break;case"input":su(c,h),He("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!h.multiple},He("invalid",c);break;case"textarea":ou(c,h),He("invalid",c)}tf(a,h),f=null;for(var S in h)if(h.hasOwnProperty(S)){var C=h[S];S==="children"?typeof C=="string"?c.textContent!==C&&(h.suppressHydrationWarning!==!0&&bu(c.textContent,C,r),f=["children",C]):typeof C=="number"&&c.textContent!==""+C&&(h.suppressHydrationWarning!==!0&&bu(c.textContent,C,r),f=["children",""+C]):i.hasOwnProperty(S)&&C!=null&&S==="onScroll"&&He("scroll",c)}switch(a){case"input":vr(c),Sr(c,h,!0);break;case"textarea":vr(c),Fe(c);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(c.onclick=Pu)}c=f,s.updateQueue=c,c!==null&&(s.flags|=4)}else{S=f.nodeType===9?f:f.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Ot(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=S.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof c.is=="string"?r=S.createElement(a,{is:c.is}):(r=S.createElement(a),a==="select"&&(S=r,c.multiple?S.multiple=!0:c.size&&(S.size=c.size))):r=S.createElementNS(r,a),r[sr]=s,r[Fi]=c,Ey(r,s,!1,!1),s.stateNode=r;e:{switch(S=nf(a,c),a){case"dialog":He("cancel",r),He("close",r),f=c;break;case"iframe":case"object":case"embed":He("load",r),f=c;break;case"video":case"audio":for(f=0;f<Ai.length;f++)He(Ai[f],r);f=c;break;case"source":He("error",r),f=c;break;case"img":case"image":case"link":He("error",r),He("load",r),f=c;break;case"details":He("toggle",r),f=c;break;case"input":su(r,c),f=co(r,c),He("invalid",r);break;case"option":f=c;break;case"select":r._wrapperState={wasMultiple:!!c.multiple},f=V({},c,{value:void 0}),He("invalid",r);break;case"textarea":ou(r,c),f=fo(r,c),He("invalid",r);break;default:f=c}tf(a,f),C=f;for(h in C)if(C.hasOwnProperty(h)){var T=C[h];h==="style"?mg(r,T):h==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,T!=null&&hg(r,T)):h==="children"?typeof T=="string"?(a!=="textarea"||T!=="")&&gi(r,T):typeof T=="number"&&gi(r,""+T):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(i.hasOwnProperty(h)?T!=null&&h==="onScroll"&&He("scroll",r):T!=null&&O(r,h,T,S))}switch(a){case"input":vr(r),Sr(r,c,!1);break;case"textarea":vr(r),Fe(r);break;case"option":c.value!=null&&r.setAttribute("value",""+ke(c.value));break;case"select":r.multiple=!!c.multiple,h=c.value,h!=null?Ar(r,!!c.multiple,h,!1):c.defaultValue!=null&&Ar(r,!!c.multiple,c.defaultValue,!0);break;default:typeof f.onClick=="function"&&(r.onclick=Pu)}switch(a){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Ut(s),null;case 6:if(r&&s.stateNode!=null)by(r,s,r.memoizedProps,c);else{if(typeof c!="string"&&s.stateNode===null)throw Error(n(166));if(a=Is(Vi.current),Is(or.current),Nu(s)){if(c=s.stateNode,a=s.memoizedProps,c[sr]=s,(h=c.nodeValue!==a)&&(r=mn,r!==null))switch(r.tag){case 3:bu(c.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&bu(c.nodeValue,a,(r.mode&1)!==0)}h&&(s.flags|=4)}else c=(a.nodeType===9?a:a.ownerDocument).createTextNode(c),c[sr]=s,s.stateNode=c}return Ut(s),null;case 13:if(Ke(et),c=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Je&&gn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)R0(),Io(),s.flags|=98560,h=!1;else if(h=Nu(s),c!==null&&c.dehydrated!==null){if(r===null){if(!h)throw Error(n(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(n(317));h[sr]=s}else Io(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ut(s),h=!1}else Vn!==null&&(Ld(Vn),Vn=null),h=!0;if(!h)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=a,s):(c=c!==null,c!==(r!==null&&r.memoizedState!==null)&&c&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(et.current&1)!==0?yt===0&&(yt=3):jd())),s.updateQueue!==null&&(s.flags|=4),Ut(s),null);case 4:return Oo(),kd(r,s),r===null&&ji(s.stateNode.containerInfo),Ut(s),null;case 10:return Gf(s.type._context),Ut(s),null;case 17:return Zt(s.type)&&Ru(),Ut(s),null;case 19:if(Ke(et),h=s.memoizedState,h===null)return Ut(s),null;if(c=(s.flags&128)!==0,S=h.rendering,S===null)if(c)Qi(h,!1);else{if(yt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(S=Uu(r),S!==null){for(s.flags|=128,Qi(h,!1),c=S.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),s.subtreeFlags=0,c=a,a=s.child;a!==null;)h=a,r=c,h.flags&=14680066,S=h.alternate,S===null?(h.childLanes=0,h.lanes=r,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=S.childLanes,h.lanes=S.lanes,h.child=S.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=S.memoizedProps,h.memoizedState=S.memoizedState,h.updateQueue=S.updateQueue,h.type=S.type,r=S.dependencies,h.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return Ve(et,et.current&1|2),s.child}r=r.sibling}h.tail!==null&&ct()>jo&&(s.flags|=128,c=!0,Qi(h,!1),s.lanes=4194304)}else{if(!c)if(r=Uu(S),r!==null){if(s.flags|=128,c=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),Qi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!S.alternate&&!Je)return Ut(s),null}else 2*ct()-h.renderingStartTime>jo&&a!==1073741824&&(s.flags|=128,c=!0,Qi(h,!1),s.lanes=4194304);h.isBackwards?(S.sibling=s.child,s.child=S):(a=h.last,a!==null?a.sibling=S:s.child=S,h.last=S)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=ct(),s.sibling=null,a=et.current,Ve(et,c?a&1|2:a&1),s):(Ut(s),null);case 22:case 23:return Ad(),c=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==c&&(s.flags|=8192),c&&(s.mode&1)!==0?(yn&1073741824)!==0&&(Ut(s),s.subtreeFlags&6&&(s.flags|=8192)):Ut(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function RC(r,s){switch(qf(s),s.tag){case 1:return Zt(s.type)&&Ru(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Oo(),Ke(Xt),Ke(Ft),rd(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return td(s),null;case 13:if(Ke(et),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Io()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Ke(et),null;case 4:return Oo(),null;case 10:return Gf(s.type._context),null;case 22:case 23:return Ad(),null;case 24:return null;default:return null}}var Ju=!1,zt=!1,TC=typeof WeakSet=="function"?WeakSet:Set,pe=null;function No(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(c){rt(r,s,c)}else a.current=null}function _d(r,s,a){try{a()}catch(c){rt(r,s,c)}}var Py=!1;function MC(r,s){if(Af=mu,r=o0(),Pf(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var f=c.anchorOffset,h=c.focusNode;c=c.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var S=0,C=-1,T=-1,Q=0,oe=0,ie=r,se=null;t:for(;;){for(var fe;ie!==a||f!==0&&ie.nodeType!==3||(C=S+f),ie!==h||c!==0&&ie.nodeType!==3||(T=S+c),ie.nodeType===3&&(S+=ie.nodeValue.length),(fe=ie.firstChild)!==null;)se=ie,ie=fe;for(;;){if(ie===r)break t;if(se===a&&++Q===f&&(C=S),se===h&&++oe===c&&(T=S),(fe=ie.nextSibling)!==null)break;ie=se,se=ie.parentNode}ie=fe}a=C===-1||T===-1?null:{start:C,end:T}}else a=null}a=a||{start:0,end:0}}else a=null;for(jf={focusedElem:r,selectionRange:a},mu=!1,pe=s;pe!==null;)if(s=pe,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,pe=r;else for(;pe!==null;){s=pe;try{var me=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(me!==null){var ge=me.memoizedProps,lt=me.memoizedState,U=s.stateNode,M=U.getSnapshotBeforeUpdate(s.elementType===s.type?ge:qn(s.type,ge),lt);U.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var q=s.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ue){rt(s,s.return,ue)}if(r=s.sibling,r!==null){r.return=s.return,pe=r;break}pe=s.return}return me=Py,Py=!1,me}function Ji(r,s,a){var c=s.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&r)===r){var h=f.destroy;f.destroy=void 0,h!==void 0&&_d(s,a,h)}f=f.next}while(f!==c)}}function Gu(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&r)===r){var c=a.create;a.destroy=c()}a=a.next}while(a!==s)}}function Ed(r){var s=r.ref;if(s!==null){var a=r.stateNode;switch(r.tag){case 5:r=a;break;default:r=a}typeof s=="function"?s(r):s.current=r}}function Iy(r){var s=r.alternate;s!==null&&(r.alternate=null,Iy(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[sr],delete s[Fi],delete s[Uf],delete s[hC],delete s[pC])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Ry(r){return r.tag===5||r.tag===3||r.tag===4}function Ty(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Ry(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Cd(r,s,a){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?a.nodeType===8?a.parentNode.insertBefore(r,s):a.insertBefore(r,s):(a.nodeType===8?(s=a.parentNode,s.insertBefore(r,a)):(s=a,s.appendChild(r)),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=Pu));else if(c!==4&&(r=r.child,r!==null))for(Cd(r,s,a),r=r.sibling;r!==null;)Cd(r,s,a),r=r.sibling}function bd(r,s,a){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(c!==4&&(r=r.child,r!==null))for(bd(r,s,a),r=r.sibling;r!==null;)bd(r,s,a),r=r.sibling}var Lt=null,Wn=!1;function Qr(r,s,a){for(a=a.child;a!==null;)My(r,s,a),a=a.sibling}function My(r,s,a){if(rr&&typeof rr.onCommitFiberUnmount=="function")try{rr.onCommitFiberUnmount(cu,a)}catch{}switch(a.tag){case 5:zt||No(a,s);case 6:var c=Lt,f=Wn;Lt=null,Qr(r,s,a),Lt=c,Wn=f,Lt!==null&&(Wn?(r=Lt,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Lt.removeChild(a.stateNode));break;case 18:Lt!==null&&(Wn?(r=Lt,a=a.stateNode,r.nodeType===8?Df(r.parentNode,a):r.nodeType===1&&Df(r,a),Pi(r)):Df(Lt,a.stateNode));break;case 4:c=Lt,f=Wn,Lt=a.stateNode.containerInfo,Wn=!0,Qr(r,s,a),Lt=c,Wn=f;break;case 0:case 11:case 14:case 15:if(!zt&&(c=a.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){f=c=c.next;do{var h=f,S=h.destroy;h=h.tag,S!==void 0&&((h&2)!==0||(h&4)!==0)&&_d(a,s,S),f=f.next}while(f!==c)}Qr(r,s,a);break;case 1:if(!zt&&(No(a,s),c=a.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=a.memoizedProps,c.state=a.memoizedState,c.componentWillUnmount()}catch(C){rt(a,s,C)}Qr(r,s,a);break;case 21:Qr(r,s,a);break;case 22:a.mode&1?(zt=(c=zt)||a.memoizedState!==null,Qr(r,s,a),zt=c):Qr(r,s,a);break;default:Qr(r,s,a)}}function Oy(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new TC),s.forEach(function(c){var f=UC.bind(null,r,c);a.has(c)||(a.add(c),c.then(f,f))})}}function Hn(r,s){var a=s.deletions;if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];try{var h=r,S=s,C=S;e:for(;C!==null;){switch(C.tag){case 5:Lt=C.stateNode,Wn=!1;break e;case 3:Lt=C.stateNode.containerInfo,Wn=!0;break e;case 4:Lt=C.stateNode.containerInfo,Wn=!0;break e}C=C.return}if(Lt===null)throw Error(n(160));My(h,S,f),Lt=null,Wn=!1;var T=f.alternate;T!==null&&(T.return=null),f.return=null}catch(Q){rt(f,s,Q)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Ly(s,r),s=s.sibling}function Ly(r,s){var a=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Hn(s,r),ar(r),c&4){try{Ji(3,r,r.return),Gu(3,r)}catch(ge){rt(r,r.return,ge)}try{Ji(5,r,r.return)}catch(ge){rt(r,r.return,ge)}}break;case 1:Hn(s,r),ar(r),c&512&&a!==null&&No(a,a.return);break;case 5:if(Hn(s,r),ar(r),c&512&&a!==null&&No(a,a.return),r.flags&32){var f=r.stateNode;try{gi(f,"")}catch(ge){rt(r,r.return,ge)}}if(c&4&&(f=r.stateNode,f!=null)){var h=r.memoizedProps,S=a!==null?a.memoizedProps:h,C=r.type,T=r.updateQueue;if(r.updateQueue=null,T!==null)try{C==="input"&&h.type==="radio"&&h.name!=null&&pi(f,h),nf(C,S);var Q=nf(C,h);for(S=0;S<T.length;S+=2){var oe=T[S],ie=T[S+1];oe==="style"?mg(f,ie):oe==="dangerouslySetInnerHTML"?hg(f,ie):oe==="children"?gi(f,ie):O(f,oe,ie,Q)}switch(C){case"input":lo(f,h);break;case"textarea":mi(f,h);break;case"select":var se=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!h.multiple;var fe=h.value;fe!=null?Ar(f,!!h.multiple,fe,!1):se!==!!h.multiple&&(h.defaultValue!=null?Ar(f,!!h.multiple,h.defaultValue,!0):Ar(f,!!h.multiple,h.multiple?[]:"",!1))}f[Fi]=h}catch(ge){rt(r,r.return,ge)}}break;case 6:if(Hn(s,r),ar(r),c&4){if(r.stateNode===null)throw Error(n(162));f=r.stateNode,h=r.memoizedProps;try{f.nodeValue=h}catch(ge){rt(r,r.return,ge)}}break;case 3:if(Hn(s,r),ar(r),c&4&&a!==null&&a.memoizedState.isDehydrated)try{Pi(s.containerInfo)}catch(ge){rt(r,r.return,ge)}break;case 4:Hn(s,r),ar(r);break;case 13:Hn(s,r),ar(r),f=r.child,f.flags&8192&&(h=f.memoizedState!==null,f.stateNode.isHidden=h,!h||f.alternate!==null&&f.alternate.memoizedState!==null||(Rd=ct())),c&4&&Oy(r);break;case 22:if(oe=a!==null&&a.memoizedState!==null,r.mode&1?(zt=(Q=zt)||oe,Hn(s,r),zt=Q):Hn(s,r),ar(r),c&8192){if(Q=r.memoizedState!==null,(r.stateNode.isHidden=Q)&&!oe&&(r.mode&1)!==0)for(pe=r,oe=r.child;oe!==null;){for(ie=pe=oe;pe!==null;){switch(se=pe,fe=se.child,se.tag){case 0:case 11:case 14:case 15:Ji(4,se,se.return);break;case 1:No(se,se.return);var me=se.stateNode;if(typeof me.componentWillUnmount=="function"){c=se,a=se.return;try{s=c,me.props=s.memoizedProps,me.state=s.memoizedState,me.componentWillUnmount()}catch(ge){rt(c,a,ge)}}break;case 5:No(se,se.return);break;case 22:if(se.memoizedState!==null){jy(ie);continue}}fe!==null?(fe.return=se,pe=fe):jy(ie)}oe=oe.sibling}e:for(oe=null,ie=r;;){if(ie.tag===5){if(oe===null){oe=ie;try{f=ie.stateNode,Q?(h=f.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(C=ie.stateNode,T=ie.memoizedProps.style,S=T!=null&&T.hasOwnProperty("display")?T.display:null,C.style.display=pg("display",S))}catch(ge){rt(r,r.return,ge)}}}else if(ie.tag===6){if(oe===null)try{ie.stateNode.nodeValue=Q?"":ie.memoizedProps}catch(ge){rt(r,r.return,ge)}}else if((ie.tag!==22&&ie.tag!==23||ie.memoizedState===null||ie===r)&&ie.child!==null){ie.child.return=ie,ie=ie.child;continue}if(ie===r)break e;for(;ie.sibling===null;){if(ie.return===null||ie.return===r)break e;oe===ie&&(oe=null),ie=ie.return}oe===ie&&(oe=null),ie.sibling.return=ie.return,ie=ie.sibling}}break;case 19:Hn(s,r),ar(r),c&4&&Oy(r);break;case 21:break;default:Hn(s,r),ar(r)}}function ar(r){var s=r.flags;if(s&2){try{e:{for(var a=r.return;a!==null;){if(Ry(a)){var c=a;break e}a=a.return}throw Error(n(160))}switch(c.tag){case 5:var f=c.stateNode;c.flags&32&&(gi(f,""),c.flags&=-33);var h=Ty(r);bd(r,h,f);break;case 3:case 4:var S=c.stateNode.containerInfo,C=Ty(r);Cd(r,C,S);break;default:throw Error(n(161))}}catch(T){rt(r,r.return,T)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function OC(r,s,a){pe=r,Ny(r)}function Ny(r,s,a){for(var c=(r.mode&1)!==0;pe!==null;){var f=pe,h=f.child;if(f.tag===22&&c){var S=f.memoizedState!==null||Ju;if(!S){var C=f.alternate,T=C!==null&&C.memoizedState!==null||zt;C=Ju;var Q=zt;if(Ju=S,(zt=T)&&!Q)for(pe=f;pe!==null;)S=pe,T=S.child,S.tag===22&&S.memoizedState!==null?$y(f):T!==null?(T.return=S,pe=T):$y(f);for(;h!==null;)pe=h,Ny(h),h=h.sibling;pe=f,Ju=C,zt=Q}Ay(r)}else(f.subtreeFlags&8772)!==0&&h!==null?(h.return=f,pe=h):Ay(r)}}function Ay(r){for(;pe!==null;){var s=pe;if((s.flags&8772)!==0){var a=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:zt||Gu(5,s);break;case 1:var c=s.stateNode;if(s.flags&4&&!zt)if(a===null)c.componentDidMount();else{var f=s.elementType===s.type?a.memoizedProps:qn(s.type,a.memoizedProps);c.componentDidUpdate(f,a.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var h=s.updateQueue;h!==null&&j0(s,h,c);break;case 3:var S=s.updateQueue;if(S!==null){if(a=null,s.child!==null)switch(s.child.tag){case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}j0(s,S,a)}break;case 5:var C=s.stateNode;if(a===null&&s.flags&4){a=C;var T=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":T.autoFocus&&a.focus();break;case"img":T.src&&(a.src=T.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var Q=s.alternate;if(Q!==null){var oe=Q.memoizedState;if(oe!==null){var ie=oe.dehydrated;ie!==null&&Pi(ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}zt||s.flags&512&&Ed(s)}catch(se){rt(s,s.return,se)}}if(s===r){pe=null;break}if(a=s.sibling,a!==null){a.return=s.return,pe=a;break}pe=s.return}}function jy(r){for(;pe!==null;){var s=pe;if(s===r){pe=null;break}var a=s.sibling;if(a!==null){a.return=s.return,pe=a;break}pe=s.return}}function $y(r){for(;pe!==null;){var s=pe;try{switch(s.tag){case 0:case 11:case 15:var a=s.return;try{Gu(4,s)}catch(T){rt(s,a,T)}break;case 1:var c=s.stateNode;if(typeof c.componentDidMount=="function"){var f=s.return;try{c.componentDidMount()}catch(T){rt(s,f,T)}}var h=s.return;try{Ed(s)}catch(T){rt(s,h,T)}break;case 5:var S=s.return;try{Ed(s)}catch(T){rt(s,S,T)}}}catch(T){rt(s,s.return,T)}if(s===r){pe=null;break}var C=s.sibling;if(C!==null){C.return=s.return,pe=C;break}pe=s.return}}var LC=Math.ceil,Yu=b.ReactCurrentDispatcher,Pd=b.ReactCurrentOwner,Tn=b.ReactCurrentBatchConfig,Ne=0,_t=null,pt=null,Nt=0,yn=0,Ao=Vr(0),yt=0,Gi=null,Ts=0,Xu=0,Id=0,Yi=null,tn=null,Rd=0,jo=1/0,Pr=null,Zu=!1,Td=null,Jr=null,ec=!1,Gr=null,tc=0,Xi=0,Md=null,nc=-1,rc=0;function Kt(){return(Ne&6)!==0?ct():nc!==-1?nc:nc=ct()}function Yr(r){return(r.mode&1)===0?1:(Ne&2)!==0&&Nt!==0?Nt&-Nt:gC.transition!==null?(rc===0&&(rc=Tg()),rc):(r=De,r!==0||(r=window.event,r=r===void 0?16:Dg(r.type)),r)}function Kn(r,s,a,c){if(50<Xi)throw Xi=0,Md=null,Error(n(185));ki(r,a,c),((Ne&2)===0||r!==_t)&&(r===_t&&((Ne&2)===0&&(Xu|=a),yt===4&&Xr(r,Nt)),nn(r,c),a===1&&Ne===0&&(s.mode&1)===0&&(jo=ct()+500,Mu&&Wr()))}function nn(r,s){var a=r.callbackNode;gE(r,s);var c=du(r,r===_t?Nt:0);if(c===0)a!==null&&Pg(a),r.callbackNode=null,r.callbackPriority=0;else if(s=c&-c,r.callbackPriority!==s){if(a!=null&&Pg(a),s===1)r.tag===0?mC(Dy.bind(null,r)):E0(Dy.bind(null,r)),fC(function(){(Ne&6)===0&&Wr()}),a=null;else{switch(Mg(c)){case 1:a=lf;break;case 4:a=Ig;break;case 16:a=uu;break;case 536870912:a=Rg;break;default:a=uu}a=Ky(a,Fy.bind(null,r))}r.callbackPriority=s,r.callbackNode=a}}function Fy(r,s){if(nc=-1,rc=0,(Ne&6)!==0)throw Error(n(327));var a=r.callbackNode;if($o()&&r.callbackNode!==a)return null;var c=du(r,r===_t?Nt:0);if(c===0)return null;if((c&30)!==0||(c&r.expiredLanes)!==0||s)s=sc(r,c);else{s=c;var f=Ne;Ne|=2;var h=zy();(_t!==r||Nt!==s)&&(Pr=null,jo=ct()+500,Os(r,s));do try{jC();break}catch(C){Uy(r,C)}while(!0);Jf(),Yu.current=h,Ne=f,pt!==null?s=0:(_t=null,Nt=0,s=yt)}if(s!==0){if(s===2&&(f=ff(r),f!==0&&(c=f,s=Od(r,f))),s===1)throw a=Gi,Os(r,0),Xr(r,c),nn(r,ct()),a;if(s===6)Xr(r,c);else{if(f=r.current.alternate,(c&30)===0&&!NC(f)&&(s=sc(r,c),s===2&&(h=ff(r),h!==0&&(c=h,s=Od(r,h))),s===1))throw a=Gi,Os(r,0),Xr(r,c),nn(r,ct()),a;switch(r.finishedWork=f,r.finishedLanes=c,s){case 0:case 1:throw Error(n(345));case 2:Ls(r,tn,Pr);break;case 3:if(Xr(r,c),(c&130023424)===c&&(s=Rd+500-ct(),10<s)){if(du(r,0)!==0)break;if(f=r.suspendedLanes,(f&c)!==c){Kt(),r.pingedLanes|=r.suspendedLanes&f;break}r.timeoutHandle=Ff(Ls.bind(null,r,tn,Pr),s);break}Ls(r,tn,Pr);break;case 4:if(Xr(r,c),(c&4194240)===c)break;for(s=r.eventTimes,f=-1;0<c;){var S=31-zn(c);h=1<<S,S=s[S],S>f&&(f=S),c&=~h}if(c=f,c=ct()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*LC(c/1960))-c,10<c){r.timeoutHandle=Ff(Ls.bind(null,r,tn,Pr),c);break}Ls(r,tn,Pr);break;case 5:Ls(r,tn,Pr);break;default:throw Error(n(329))}}}return nn(r,ct()),r.callbackNode===a?Fy.bind(null,r):null}function Od(r,s){var a=Yi;return r.current.memoizedState.isDehydrated&&(Os(r,s).flags|=256),r=sc(r,s),r!==2&&(s=tn,tn=a,s!==null&&Ld(s)),r}function Ld(r){tn===null?tn=r:tn.push.apply(tn,r)}function NC(r){for(var s=r;;){if(s.flags&16384){var a=s.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var c=0;c<a.length;c++){var f=a[c],h=f.getSnapshot;f=f.value;try{if(!Bn(h(),f))return!1}catch{return!1}}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Xr(r,s){for(s&=~Id,s&=~Xu,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var a=31-zn(s),c=1<<a;r[a]=-1,s&=~c}}function Dy(r){if((Ne&6)!==0)throw Error(n(327));$o();var s=du(r,0);if((s&1)===0)return nn(r,ct()),null;var a=sc(r,s);if(r.tag!==0&&a===2){var c=ff(r);c!==0&&(s=c,a=Od(r,c))}if(a===1)throw a=Gi,Os(r,0),Xr(r,s),nn(r,ct()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Ls(r,tn,Pr),nn(r,ct()),null}function Nd(r,s){var a=Ne;Ne|=1;try{return r(s)}finally{Ne=a,Ne===0&&(jo=ct()+500,Mu&&Wr())}}function Ms(r){Gr!==null&&Gr.tag===0&&(Ne&6)===0&&$o();var s=Ne;Ne|=1;var a=Tn.transition,c=De;try{if(Tn.transition=null,De=1,r)return r()}finally{De=c,Tn.transition=a,Ne=s,(Ne&6)===0&&Wr()}}function Ad(){yn=Ao.current,Ke(Ao)}function Os(r,s){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,lC(a)),pt!==null)for(a=pt.return;a!==null;){var c=a;switch(qf(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&Ru();break;case 3:Oo(),Ke(Xt),Ke(Ft),rd();break;case 5:td(c);break;case 4:Oo();break;case 13:Ke(et);break;case 19:Ke(et);break;case 10:Gf(c.type._context);break;case 22:case 23:Ad()}a=a.return}if(_t=r,pt=r=Zr(r.current,null),Nt=yn=s,yt=0,Gi=null,Id=Xu=Ts=0,tn=Yi=null,Ps!==null){for(s=0;s<Ps.length;s++)if(a=Ps[s],c=a.interleaved,c!==null){a.interleaved=null;var f=c.next,h=a.pending;if(h!==null){var S=h.next;h.next=f,c.next=S}a.pending=c}Ps=null}return r}function Uy(r,s){do{var a=pt;try{if(Jf(),zu.current=Wu,Bu){for(var c=tt.memoizedState;c!==null;){var f=c.queue;f!==null&&(f.pending=null),c=c.next}Bu=!1}if(Rs=0,kt=gt=tt=null,qi=!1,Wi=0,Pd.current=null,a===null||a.return===null){yt=1,Gi=s,pt=null;break}e:{var h=r,S=a.return,C=a,T=s;if(s=Nt,C.flags|=32768,T!==null&&typeof T=="object"&&typeof T.then=="function"){var Q=T,oe=C,ie=oe.tag;if((oe.mode&1)===0&&(ie===0||ie===11||ie===15)){var se=oe.alternate;se?(oe.updateQueue=se.updateQueue,oe.memoizedState=se.memoizedState,oe.lanes=se.lanes):(oe.updateQueue=null,oe.memoizedState=null)}var fe=fy(S);if(fe!==null){fe.flags&=-257,dy(fe,S,C,h,s),fe.mode&1&&ly(h,Q,s),s=fe,T=Q;var me=s.updateQueue;if(me===null){var ge=new Set;ge.add(T),s.updateQueue=ge}else me.add(T);break e}else{if((s&1)===0){ly(h,Q,s),jd();break e}T=Error(n(426))}}else if(Je&&C.mode&1){var lt=fy(S);if(lt!==null){(lt.flags&65536)===0&&(lt.flags|=256),dy(lt,S,C,h,s),Kf(Lo(T,C));break e}}h=T=Lo(T,C),yt!==4&&(yt=2),Yi===null?Yi=[h]:Yi.push(h),h=S;do{switch(h.tag){case 3:h.flags|=65536,s&=-s,h.lanes|=s;var U=uy(h,T,s);A0(h,U);break e;case 1:C=T;var M=h.type,q=h.stateNode;if((h.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(Jr===null||!Jr.has(q)))){h.flags|=65536,s&=-s,h.lanes|=s;var ue=cy(h,C,s);A0(h,ue);break e}}h=h.return}while(h!==null)}Vy(a)}catch(ye){s=ye,pt===a&&a!==null&&(pt=a=a.return);continue}break}while(!0)}function zy(){var r=Yu.current;return Yu.current=Wu,r===null?Wu:r}function jd(){(yt===0||yt===3||yt===2)&&(yt=4),_t===null||(Ts&268435455)===0&&(Xu&268435455)===0||Xr(_t,Nt)}function sc(r,s){var a=Ne;Ne|=2;var c=zy();(_t!==r||Nt!==s)&&(Pr=null,Os(r,s));do try{AC();break}catch(f){Uy(r,f)}while(!0);if(Jf(),Ne=a,Yu.current=c,pt!==null)throw Error(n(261));return _t=null,Nt=0,yt}function AC(){for(;pt!==null;)By(pt)}function jC(){for(;pt!==null&&!aE();)By(pt)}function By(r){var s=Hy(r.alternate,r,yn);r.memoizedProps=r.pendingProps,s===null?Vy(r):pt=s,Pd.current=null}function Vy(r){var s=r;do{var a=s.alternate;if(r=s.return,(s.flags&32768)===0){if(a=IC(a,s,yn),a!==null){pt=a;return}}else{if(a=RC(a,s),a!==null){a.flags&=32767,pt=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{yt=6,pt=null;return}}if(s=s.sibling,s!==null){pt=s;return}pt=s=r}while(s!==null);yt===0&&(yt=5)}function Ls(r,s,a){var c=De,f=Tn.transition;try{Tn.transition=null,De=1,$C(r,s,a,c)}finally{Tn.transition=f,De=c}return null}function $C(r,s,a,c){do $o();while(Gr!==null);if((Ne&6)!==0)throw Error(n(327));a=r.finishedWork;var f=r.finishedLanes;if(a===null)return null;if(r.finishedWork=null,r.finishedLanes=0,a===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var h=a.lanes|a.childLanes;if(yE(r,h),r===_t&&(pt=_t=null,Nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||ec||(ec=!0,Ky(uu,function(){return $o(),null})),h=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||h){h=Tn.transition,Tn.transition=null;var S=De;De=1;var C=Ne;Ne|=4,Pd.current=null,MC(r,a),Ly(a,r),rC(jf),mu=!!Af,jf=Af=null,r.current=a,OC(a),uE(),Ne=C,De=S,Tn.transition=h}else r.current=a;if(ec&&(ec=!1,Gr=r,tc=f),h=r.pendingLanes,h===0&&(Jr=null),fE(a.stateNode),nn(r,ct()),s!==null)for(c=r.onRecoverableError,a=0;a<s.length;a++)f=s[a],c(f.value,{componentStack:f.stack,digest:f.digest});if(Zu)throw Zu=!1,r=Td,Td=null,r;return(tc&1)!==0&&r.tag!==0&&$o(),h=r.pendingLanes,(h&1)!==0?r===Md?Xi++:(Xi=0,Md=r):Xi=0,Wr(),null}function $o(){if(Gr!==null){var r=Mg(tc),s=Tn.transition,a=De;try{if(Tn.transition=null,De=16>r?16:r,Gr===null)var c=!1;else{if(r=Gr,Gr=null,tc=0,(Ne&6)!==0)throw Error(n(331));var f=Ne;for(Ne|=4,pe=r.current;pe!==null;){var h=pe,S=h.child;if((pe.flags&16)!==0){var C=h.deletions;if(C!==null){for(var T=0;T<C.length;T++){var Q=C[T];for(pe=Q;pe!==null;){var oe=pe;switch(oe.tag){case 0:case 11:case 15:Ji(8,oe,h)}var ie=oe.child;if(ie!==null)ie.return=oe,pe=ie;else for(;pe!==null;){oe=pe;var se=oe.sibling,fe=oe.return;if(Iy(oe),oe===Q){pe=null;break}if(se!==null){se.return=fe,pe=se;break}pe=fe}}}var me=h.alternate;if(me!==null){var ge=me.child;if(ge!==null){me.child=null;do{var lt=ge.sibling;ge.sibling=null,ge=lt}while(ge!==null)}}pe=h}}if((h.subtreeFlags&2064)!==0&&S!==null)S.return=h,pe=S;else e:for(;pe!==null;){if(h=pe,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:Ji(9,h,h.return)}var U=h.sibling;if(U!==null){U.return=h.return,pe=U;break e}pe=h.return}}var M=r.current;for(pe=M;pe!==null;){S=pe;var q=S.child;if((S.subtreeFlags&2064)!==0&&q!==null)q.return=S,pe=q;else e:for(S=M;pe!==null;){if(C=pe,(C.flags&2048)!==0)try{switch(C.tag){case 0:case 11:case 15:Gu(9,C)}}catch(ye){rt(C,C.return,ye)}if(C===S){pe=null;break e}var ue=C.sibling;if(ue!==null){ue.return=C.return,pe=ue;break e}pe=C.return}}if(Ne=f,Wr(),rr&&typeof rr.onPostCommitFiberRoot=="function")try{rr.onPostCommitFiberRoot(cu,r)}catch{}c=!0}return c}finally{De=a,Tn.transition=s}}return!1}function qy(r,s,a){s=Lo(a,s),s=uy(r,s,1),r=Kr(r,s,1),s=Kt(),r!==null&&(ki(r,1,s),nn(r,s))}function rt(r,s,a){if(r.tag===3)qy(r,r,a);else for(;s!==null;){if(s.tag===3){qy(s,r,a);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Jr===null||!Jr.has(c))){r=Lo(a,r),r=cy(s,r,1),s=Kr(s,r,1),r=Kt(),s!==null&&(ki(s,1,r),nn(s,r));break}}s=s.return}}function FC(r,s,a){var c=r.pingCache;c!==null&&c.delete(s),s=Kt(),r.pingedLanes|=r.suspendedLanes&a,_t===r&&(Nt&a)===a&&(yt===4||yt===3&&(Nt&130023424)===Nt&&500>ct()-Rd?Os(r,0):Id|=a),nn(r,s)}function Wy(r,s){s===0&&((r.mode&1)===0?s=1:(s=fu,fu<<=1,(fu&130023424)===0&&(fu=4194304)));var a=Kt();r=Er(r,s),r!==null&&(ki(r,s,a),nn(r,a))}function DC(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),Wy(r,a)}function UC(r,s){var a=0;switch(r.tag){case 13:var c=r.stateNode,f=r.memoizedState;f!==null&&(a=f.retryLane);break;case 19:c=r.stateNode;break;default:throw Error(n(314))}c!==null&&c.delete(s),Wy(r,a)}var Hy;Hy=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||Xt.current)en=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return en=!1,PC(r,s,a);en=(r.flags&131072)!==0}else en=!1,Je&&(s.flags&1048576)!==0&&C0(s,Lu,s.index);switch(s.lanes=0,s.tag){case 2:var c=s.type;Qu(r,s),r=s.pendingProps;var f=Co(s,Ft.current);Mo(s,a),f=id(null,s,c,r,f,a);var h=ad();return s.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Zt(c)?(h=!0,Tu(s)):h=!1,s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Zf(s),f.updater=Hu,s.stateNode=f,f._reactInternals=s,hd(s,c,r,a),s=yd(null,s,c,!0,h,a)):(s.tag=0,Je&&h&&Vf(s),Ht(null,s,f,a),s=s.child),s;case 16:c=s.elementType;e:{switch(Qu(r,s),r=s.pendingProps,f=c._init,c=f(c._payload),s.type=c,f=s.tag=BC(c),r=qn(c,r),f){case 0:s=gd(null,s,c,r,a);break e;case 1:s=vy(null,s,c,r,a);break e;case 11:s=hy(null,s,c,r,a);break e;case 14:s=py(null,s,c,qn(c.type,r),a);break e}throw Error(n(306,c,""))}return s;case 0:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),gd(r,s,c,f,a);case 1:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),vy(r,s,c,f,a);case 3:e:{if(Sy(s),r===null)throw Error(n(387));c=s.pendingProps,h=s.memoizedState,f=h.element,N0(r,s),Du(s,c,null,a);var S=s.memoizedState;if(c=S.element,h.isDehydrated)if(h={element:c,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=h,s.memoizedState=h,s.flags&256){f=Lo(Error(n(423)),s),s=wy(r,s,c,a,f);break e}else if(c!==f){f=Lo(Error(n(424)),s),s=wy(r,s,c,a,f);break e}else for(gn=Br(s.stateNode.containerInfo.firstChild),mn=s,Je=!0,Vn=null,a=O0(s,null,c,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Io(),c===f){s=br(r,s,a);break e}Ht(r,s,c,a)}s=s.child}return s;case 5:return $0(s),r===null&&Hf(s),c=s.type,f=s.pendingProps,h=r!==null?r.memoizedProps:null,S=f.children,$f(c,f)?S=null:h!==null&&$f(c,h)&&(s.flags|=32),yy(r,s),Ht(r,s,S,a),s.child;case 6:return r===null&&Hf(s),null;case 13:return xy(r,s,a);case 4:return ed(s,s.stateNode.containerInfo),c=s.pendingProps,r===null?s.child=Ro(s,null,c,a):Ht(r,s,c,a),s.child;case 11:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),hy(r,s,c,f,a);case 7:return Ht(r,s,s.pendingProps,a),s.child;case 8:return Ht(r,s,s.pendingProps.children,a),s.child;case 12:return Ht(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(c=s.type._context,f=s.pendingProps,h=s.memoizedProps,S=f.value,Ve(ju,c._currentValue),c._currentValue=S,h!==null)if(Bn(h.value,S)){if(h.children===f.children&&!Xt.current){s=br(r,s,a);break e}}else for(h=s.child,h!==null&&(h.return=s);h!==null;){var C=h.dependencies;if(C!==null){S=h.child;for(var T=C.firstContext;T!==null;){if(T.context===c){if(h.tag===1){T=Cr(-1,a&-a),T.tag=2;var Q=h.updateQueue;if(Q!==null){Q=Q.shared;var oe=Q.pending;oe===null?T.next=T:(T.next=oe.next,oe.next=T),Q.pending=T}}h.lanes|=a,T=h.alternate,T!==null&&(T.lanes|=a),Yf(h.return,a,s),C.lanes|=a;break}T=T.next}}else if(h.tag===10)S=h.type===s.type?null:h.child;else if(h.tag===18){if(S=h.return,S===null)throw Error(n(341));S.lanes|=a,C=S.alternate,C!==null&&(C.lanes|=a),Yf(S,a,s),S=h.sibling}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===s){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}Ht(r,s,f.children,a),s=s.child}return s;case 9:return f=s.type,c=s.pendingProps.children,Mo(s,a),f=In(f),c=c(f),s.flags|=1,Ht(r,s,c,a),s.child;case 14:return c=s.type,f=qn(c,s.pendingProps),f=qn(c.type,f),py(r,s,c,f,a);case 15:return my(r,s,s.type,s.pendingProps,a);case 17:return c=s.type,f=s.pendingProps,f=s.elementType===c?f:qn(c,f),Qu(r,s),s.tag=1,Zt(c)?(r=!0,Tu(s)):r=!1,Mo(s,a),iy(s,c,f),hd(s,c,f,a),yd(null,s,c,!0,r,a);case 19:return _y(r,s,a);case 22:return gy(r,s,a)}throw Error(n(156,s.tag))};function Ky(r,s){return bg(r,s)}function zC(r,s,a,c){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(r,s,a,c){return new zC(r,s,a,c)}function $d(r){return r=r.prototype,!(!r||!r.isReactComponent)}function BC(r){if(typeof r=="function")return $d(r)?1:0;if(r!=null){if(r=r.$$typeof,r===ae)return 11;if(r===Z)return 14}return 2}function Zr(r,s){var a=r.alternate;return a===null?(a=Mn(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function oc(r,s,a,c,f,h){var S=2;if(c=r,typeof r=="function")$d(r)&&(S=1);else if(typeof r=="string")S=5;else e:switch(r){case A:return Ns(a.children,f,h,s);case F:S=8,f|=8;break;case W:return r=Mn(12,a,s,f|2),r.elementType=W,r.lanes=h,r;case E:return r=Mn(13,a,s,f),r.elementType=E,r.lanes=h,r;case H:return r=Mn(19,a,s,f),r.elementType=H,r.lanes=h,r;case z:return ic(a,f,h,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case X:S=10;break e;case te:S=9;break e;case ae:S=11;break e;case Z:S=14;break e;case Y:S=16,c=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Mn(S,a,s,f),s.elementType=r,s.type=c,s.lanes=h,s}function Ns(r,s,a,c){return r=Mn(7,r,c,s),r.lanes=a,r}function ic(r,s,a,c){return r=Mn(22,r,c,s),r.elementType=z,r.lanes=a,r.stateNode={isHidden:!1},r}function Fd(r,s,a){return r=Mn(6,r,null,s),r.lanes=a,r}function Dd(r,s,a){return s=Mn(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function VC(r,s,a,c,f){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=df(0),this.expirationTimes=df(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=df(0),this.identifierPrefix=c,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function Ud(r,s,a,c,f,h,S,C,T){return r=new VC(r,s,a,C,T),s===1?(s=1,h===!0&&(s|=8)):s=0,h=Mn(3,null,null,s),r.current=h,h.stateNode=r,h.memoizedState={element:c,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zf(h),r}function qC(r,s,a){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:c==null?null:""+c,children:r,containerInfo:s,implementation:a}}function Qy(r){if(!r)return qr;r=r._reactInternals;e:{if(ks(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Zt(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var a=r.type;if(Zt(a))return k0(r,a,s)}return s}function Jy(r,s,a,c,f,h,S,C,T){return r=Ud(a,c,!0,r,f,h,S,C,T),r.context=Qy(null),a=r.current,c=Kt(),f=Yr(a),h=Cr(c,f),h.callback=s??null,Kr(a,h,f),r.current.lanes=f,ki(r,f,c),nn(r,c),r}function ac(r,s,a,c){var f=s.current,h=Kt(),S=Yr(f);return a=Qy(a),s.context===null?s.context=a:s.pendingContext=a,s=Cr(h,S),s.payload={element:r},c=c===void 0?null:c,c!==null&&(s.callback=c),r=Kr(f,s,S),r!==null&&(Kn(r,f,S,h),Fu(r,f,S)),S}function uc(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Gy(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function zd(r,s){Gy(r,s),(r=r.alternate)&&Gy(r,s)}function WC(){return null}var Yy=typeof reportError=="function"?reportError:function(r){console.error(r)};function Bd(r){this._internalRoot=r}cc.prototype.render=Bd.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));ac(r,s,null,null)},cc.prototype.unmount=Bd.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Ms(function(){ac(null,r,null,null)}),s[wr]=null}};function cc(r){this._internalRoot=r}cc.prototype.unstable_scheduleHydration=function(r){if(r){var s=Ng();r={blockedOn:null,target:r,priority:s};for(var a=0;a<Dr.length&&s!==0&&s<Dr[a].priority;a++);Dr.splice(a,0,r),a===0&&$g(r)}};function Vd(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function lc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Xy(){}function HC(r,s,a,c,f){if(f){if(typeof c=="function"){var h=c;c=function(){var Q=uc(S);h.call(Q)}}var S=Jy(s,c,r,0,null,!1,!1,"",Xy);return r._reactRootContainer=S,r[wr]=S.current,ji(r.nodeType===8?r.parentNode:r),Ms(),S}for(;f=r.lastChild;)r.removeChild(f);if(typeof c=="function"){var C=c;c=function(){var Q=uc(T);C.call(Q)}}var T=Ud(r,0,!1,null,null,!1,!1,"",Xy);return r._reactRootContainer=T,r[wr]=T.current,ji(r.nodeType===8?r.parentNode:r),Ms(function(){ac(s,T,a,c)}),T}function fc(r,s,a,c,f){var h=a._reactRootContainer;if(h){var S=h;if(typeof f=="function"){var C=f;f=function(){var T=uc(S);C.call(T)}}ac(s,S,r,f)}else S=HC(a,s,r,f,c);return uc(S)}Og=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var a=xi(s.pendingLanes);a!==0&&(hf(s,a|1),nn(s,ct()),(Ne&6)===0&&(jo=ct()+500,Wr()))}break;case 13:Ms(function(){var c=Er(r,1);if(c!==null){var f=Kt();Kn(c,r,1,f)}}),zd(r,1)}},pf=function(r){if(r.tag===13){var s=Er(r,134217728);if(s!==null){var a=Kt();Kn(s,r,134217728,a)}zd(r,134217728)}},Lg=function(r){if(r.tag===13){var s=Yr(r),a=Er(r,s);if(a!==null){var c=Kt();Kn(a,r,s,c)}zd(r,s)}},Ng=function(){return De},Ag=function(r,s){var a=De;try{return De=r,s()}finally{De=a}},of=function(r,s,a){switch(s){case"input":if(lo(r,a),s=a.name,a.type==="radio"&&s!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<a.length;s++){var c=a[s];if(c!==r&&c.form===r.form){var f=Iu(c);if(!f)throw Error(n(90));Ss(c),lo(c,f)}}}break;case"textarea":mi(r,a);break;case"select":s=a.value,s!=null&&Ar(r,!!a.multiple,s,!1)}},Sg=Nd,wg=Ms;var KC={usingClientEntryPoint:!1,Events:[Di,_o,Iu,yg,vg,Nd]},Zi={findFiberByHostInstance:_s,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},QC={bundleType:Zi.bundleType,version:Zi.version,rendererPackageName:Zi.rendererPackageName,rendererConfig:Zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Eg(r),r===null?null:r.stateNode},findFiberByHostInstance:Zi.findFiberByHostInstance||WC,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dc.isDisabled&&dc.supportsFiber)try{cu=dc.inject(QC),rr=dc}catch{}}return rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KC,rn.createPortal=function(r,s){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vd(s))throw Error(n(200));return qC(r,s,null,a)},rn.createRoot=function(r,s){if(!Vd(r))throw Error(n(299));var a=!1,c="",f=Yy;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onRecoverableError!==void 0&&(f=s.onRecoverableError)),s=Ud(r,1,!1,null,null,a,!1,c,f),r[wr]=s.current,ji(r.nodeType===8?r.parentNode:r),new Bd(s)},rn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Eg(s),r=r===null?null:r.stateNode,r},rn.flushSync=function(r){return Ms(r)},rn.hydrate=function(r,s,a){if(!lc(s))throw Error(n(200));return fc(null,r,s,!0,a)},rn.hydrateRoot=function(r,s,a){if(!Vd(r))throw Error(n(405));var c=a!=null&&a.hydratedSources||null,f=!1,h="",S=Yy;if(a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onRecoverableError!==void 0&&(S=a.onRecoverableError)),s=Jy(s,null,r,1,a??null,f,!1,h,S),r[wr]=s.current,ji(r),c)for(r=0;r<c.length;r++)a=c[r],f=a._getVersion,f=f(a._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[a,f]:s.mutableSourceEagerHydrationData.push(a,f);return new cc(s)},rn.render=function(r,s,a){if(!lc(s))throw Error(n(200));return fc(null,r,s,!1,a)},rn.unmountComponentAtNode=function(r){if(!lc(r))throw Error(n(40));return r._reactRootContainer?(Ms(function(){fc(null,null,r,!1,function(){r._reactRootContainer=null,r[wr]=null})}),!0):!1},rn.unstable_batchedUpdates=Nd,rn.unstable_renderSubtreeIntoContainer=function(r,s,a,c){if(!lc(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return fc(r,s,a,!1,c)},rn.version="18.3.1-next-f1338f8080-20240426",rn}var iv;function Uw(){if(iv)return Hd.exports;iv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hd.exports=sb(),Hd.exports}var av;function ob(){if(av)return hc;av=1;var e=Uw();return hc.createRoot=e.createRoot,hc.hydrateRoot=e.hydrateRoot,hc}var ib=ob(),ab={};const Np=lb();function Xe(e,...t){if(!Np)return;const n=cb(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function ub(e,...t){Np&&console.warn(e,...t)}function cb(e,...t){return e.replace(/%[sfdO]/g,n=>{const o=t.shift();return n==="%O"&&o?JSON.stringify(o).replace(/"([^"]+)":/g,"$1:"):String(o)})}function lb(){if(typeof window>"u")return(ab.DEBUG||"").includes("nuqs");try{const e="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(e,e);const t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const fb={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function Da(e){return`[nuqs] ${fb[e]}
|
|
42
|
-
See https://nuqs.dev/NUQS-${e}`}function db(e){if(e.size===0)return"";const t=[];for(const[o,i]of e.entries()){const u=o.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${u}=${hb(i)}`)}return"?"+t.join("&")}function hb(e){return e.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,t=>encodeURIComponent(t))}const Gs=ee.createContext({useAdapter(){throw new Error(Da(404))}});Gs.displayName="NuqsAdapterContext";Np&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==Gs&&console.error(Da(303)),window.__NuqsAdapterContext=Gs);function pb(e){return({children:t,defaultOptions:n,processUrlSearchParams:o,...i})=>ee.createElement(Gs.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:o}},t)}function mb(e){const t=ee.useContext(Gs);if(!("useAdapter"in t))throw new Error(Da(404));return t.useAdapter(e)}const gb=()=>ee.useContext(Gs).defaultOptions,yb=()=>ee.useContext(Gs).processUrlSearchParams;function vb(){var e;if(typeof window>"u"||!window.GestureEvent)return 50;try{const t=(e=navigator.userAgent)==null?void 0:e.match(/version\/([\d\.]+) safari/i);return parseFloat(t[1])>=17?120:320}catch{return 320}}function Sb(e){return{method:"throttle",timeMs:e}}const da=Sb(vb());function wb(e){return e===null||Array.isArray(e)&&e.length===0}function xb(e,t,n){if(typeof e=="string")n.set(t,e);else{n.delete(t);for(const o of e)n.append(t,o);n.has(t)||n.set(t,"")}return n}function Ap(){const e=new Map;return{on(t,n){const o=e.get(t)||[];return o.push(n),e.set(t,o),()=>this.off(t,n)},off(t,n){const o=e.get(t);o&&e.set(t,o.filter(i=>i!==n))},emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(n))}}}function $h(e,t,n){function o(){e(),n.removeEventListener("abort",u)}const i=setTimeout(o,t);function u(){clearTimeout(i),n.removeEventListener("abort",u)}n.addEventListener("abort",u)}function Fh(){const e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((o,i)=>{t=o,n=i}),resolve:t,reject:n}}function kb(e,t){let n=t;for(let o=e.length-1;o>=0;o--){const i=e[o];if(!i)continue;const u=n;n=()=>i(u)}n()}function Dh(){return new URLSearchParams(location.search)}var zw=class{constructor(){L(this,"updateMap",new Map);L(this,"options",{history:"replace",scroll:!1,shallow:!0});L(this,"timeMs",da.timeMs);L(this,"transitions",new Set);L(this,"resolvers",null);L(this,"controller",null);L(this,"lastFlushedAt",0);L(this,"resetQueueOnNextPush",!1)}push({key:e,query:t,options:n},o=da.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),Xe("[nuqs gtq] Enqueueing %s=%s %O",e,t,n),this.updateMap.set(e,t),n.history==="push"&&(this.options.history="push"),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||o>this.timeMs)&&(this.timeMs=o)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=Dh}){var t;return((t=this.resolvers)==null?void 0:t.promise)??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=Dh,rateLimitFactor:t=1,...n},o){if(this.controller??(this.controller=new AbortController),!Number.isFinite(this.timeMs))return Xe("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=Fh();const i=()=>{this.lastFlushedAt=performance.now();const[l,d]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},o);d===null?(this.resolvers.resolve(l),this.resetQueueOnNextPush=!0):this.resolvers.reject(l),this.resolvers=null};return $h(()=>{const l=performance.now()-this.lastFlushedAt,d=this.timeMs,p=t*Math.max(0,d-l);Xe("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",p,d,t),p===0?i():$h(i,p,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){var e,t;return(e=this.controller)==null||e.abort(),this.controller=new AbortController,(t=this.resolvers)==null||t.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const e=Array.from(this.updateMap.keys());return Xe("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=da.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:o}=e;let i=o();if(Xe("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];const u=Array.from(this.updateMap.entries()),l={...this.options},d=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),Xe("[nuqs gtq] Flushing queue %O with options %O",u,l);for(const[p,g]of u)g===null?i.delete(p):i=xb(g,p,i);t&&(i=t(i));try{return kb(d,()=>{n(i,l)}),[i,null]}catch(p){return console.error(Da(429),u.map(([g])=>g).join(),p),[i,p]}}};const Cc=new zw;function _b(e,t,n){const o=ee.useCallback(()=>{const u=Object.fromEntries(e.map(l=>[l,n(l)]));return[JSON.stringify(u),u]},[e.join(","),n]),i=ee.useRef(null);return i.current===null&&(i.current=o()),ee.useSyncExternalStore(ee.useCallback(u=>{const l=e.map(d=>t(d,u));return()=>l.forEach(d=>d())},[e.join(","),t]),()=>{const[u,l]=o();return i.current[0]===u?i.current[1]:(i.current=[u,l],l)},()=>i.current[1])}var Eb=class{constructor(e){L(this,"callback");L(this,"resolvers",Fh());L(this,"controller",new AbortController);L(this,"queuedValue");this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,$h(()=>{const n=this.resolvers;try{Xe("[nuqs dq] Flushing debounce queue",e);const o=this.callback(e);Xe("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=Fh(),o.then(i=>n.resolve(i)).catch(i=>n.reject(i))}catch(o){this.queuedValue=void 0,n.reject(o)}},t,this.controller.signal),this.resolvers.promise}},Cb=class{constructor(e=new zw){L(this,"throttleQueue");L(this,"queues",new Map);L(this,"queuedQuerySync",Ap());this.throttleQueue=e}useQueuedQueries(e){return _b(e,(t,n)=>this.queuedQuerySync.on(t,n),t=>this.getQueuedQuery(t))}push(e,t,n,o){if(!Number.isFinite(t)){const l=n.getSearchParamsSnapshot??Dh;return Promise.resolve(l())}const i=e.key;if(!this.queues.has(i)){Xe("[nuqs dqc] Creating debounce queue for `%s`",i);const l=new Eb(d=>(this.throttleQueue.push(d),this.throttleQueue.flush(n,o).finally(()=>{var p;((p=this.queues.get(d.key))==null?void 0:p.queuedValue)===void 0&&(Xe("[nuqs dqc] Cleaning up empty queue for `%s`",d.key),this.queues.delete(d.key)),this.queuedQuerySync.emit(d.key)})));this.queues.set(i,l)}Xe("[nuqs dqc] Enqueueing debounce update %O",e);const u=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),u}abort(e){var n;const t=this.queues.get(e);return t?(Xe("[nuqs dqc] Aborting debounce queue %s=%s",e,(n=t.queuedValue)==null?void 0:n.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),o=>(o.then(t.resolvers.resolve,t.resolvers.reject),o)):o=>o}abortAll(){var e;for(const[t,n]of this.queues.entries())Xe("[nuqs dqc] Aborting debounce queue %s=%s",t,(e=n.queuedValue)==null?void 0:e.query),n.abort(),n.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(t);this.queues.clear()}getQueuedQuery(e){var n,o;const t=(o=(n=this.queues.get(e))==null?void 0:n.queuedValue)==null?void 0:o.query;return t!==void 0?t:this.throttleQueue.getQueuedQuery(e)}};const Jd=new Cb(Cc);function Bw(e,t){return e===t?!0:e===null||t===null||typeof e=="string"||typeof t=="string"||e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function uv(e,t,n){return o=>{if(!(t.length===0||t.some(u=>!Bw(o.getAll(u),e.getAll(u)))))return Xe("[nuqs `%s`] no change, returning previous",t.join(","),o),o;const i=Vw(e,t,n);return Xe("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),o,i),i}}function Vw(e,t,n){if(t.length===0)return e;const o=n?new URLSearchParams(e):e;for(const i of e.keys())t.includes(i)||o.delete(i);return o}const bb="__nuqs__",Uh=Ap();function Pb(e){return function(n,o){const i=new URL(location.href);i.search=db(n),Xe("[nuqs react] Updating url: %s",i),e&&o.shallow===!1?(o.history==="push"?location.assign:location.replace).call(location,i):(o.history==="push"?history.pushState:history.replaceState).call(history,history.state,bb,i),Uh.emit("update",n),o.scroll===!0&&window.scrollTo({top:0})}}const qw=ee.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function Ib(e){const{fullPageNavigationOnShallowFalseUpdates:t}=ee.useContext(qw),[n,o]=ee.useState(()=>typeof location>"u"?new URLSearchParams:Vw(new URLSearchParams(location.search),e,!1));return ee.useEffect(()=>{const i=()=>{o(uv(new URLSearchParams(location.search),e,!1))},u=l=>{o(uv(l,e,!0))};return Uh.on("update",u),window.addEventListener("popstate",i),()=>{Uh.off("update",u),window.removeEventListener("popstate",i)}},[e.join("&")]),{searchParams:n,updateUrl:ee.useMemo(()=>Pb(t),[t])}}const Rb=pb(Ib);function Tb({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return ee.createElement(qw.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},ee.createElement(Rb,{...n,children:e}))}const Mb="modulepreload",Ob=function(e,t){return new URL(e,t).href},cv={},lr=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let l=function(y){return Promise.all(y.map(m=>Promise.resolve(m).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));i=l(n.map(y=>{if(y=Ob(y,o),y in cv)return;cv[y]=!0;const m=y.endsWith(".css"),v=m?'[rel="stylesheet"]':"";if(!!o)for(let _=d.length-1;_>=0;_--){const P=d[_];if(P.href===y&&(!m||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":Mb,m||(x.as="script"),x.crossOrigin="",x.href=y,g&&x.setAttribute("nonce",g),document.head.appendChild(x),m)return new Promise((_,P)=>{x.addEventListener("load",_),x.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${y}`)))})}))}function u(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return i.then(l=>{for(const d of l||[])d.status==="rejected"&&u(d.reason);return t().catch(u)})};var ia=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;function Gd(e){const t=ee.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Lb(e,t,n={},o={}){ee.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([u])=>{t(u)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,o.disabled,e])}function Nb(e){const t=ee.useRef(null);return ee.useImperativeHandle(e,()=>t.current,[]),t}const Ww=!1;function wa(e){return e[e.length-1]}function Ab(e){return typeof e=="function"}function Ds(e,t){return Ab(e)?e(t):e}const Hw=Object.prototype.hasOwnProperty,lv=Object.prototype.propertyIsEnumerable;function Kw(e){for(const t in e)if(Hw.call(e,t))return!0;return!1}const jb=()=>Object.create(null),As=(e,t)=>Us(e,t,jb);function Us(e,t,n=()=>({}),o=0){if(e===t)return e;if(o>500)return t;const i=t,u=hv(e)&&hv(i);if(!u&&!(Dc(e)&&Dc(i)))return i;const l=u?e:fv(e);if(!l)return i;const d=u?i:fv(i);if(!d)return i;const p=l.length,g=d.length,y=u?new Array(g):n();let m=0;for(let v=0;v<g;v++){const w=u?v:d[v],x=e[w],_=i[w];if(x===_){y[w]=x,(u?v<p:Hw.call(e,w))&&m++;continue}if(x===null||_===null||typeof x!="object"||typeof _!="object"){y[w]=_;continue}const P=Us(x,_,n,o+1);y[w]=P,P===x&&m++}return p===g&&m===p?e:y}function fv(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!lv.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const o=t;for(const i of n){if(!lv.call(e,i))return!1;o.push(i)}return o}function Dc(e){if(!dv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!dv(n)||!n.hasOwnProperty("isPrototypeOf"))}function dv(e){return Object.prototype.toString.call(e)==="[object Object]"}function hv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bs(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let o=0,i=e.length;o<i;o++)if(!Bs(e[o],t[o],n))return!1;return!0}if(Dc(e)&&Dc(t)){const o=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const l in t)if((!o||t[l]!==void 0)&&!Bs(e[l],t[l],n))return!1;return!0}let i=0;if(!o)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let u=0;for(const l in t)if((!o||t[l]!==void 0)&&(u++,u>i||!Bs(e[l],t[l],n)))return!1;return i===u}return!1}function Go(e){let t,n;const o=new Promise((i,u)=>{t=i,n=u});return o.status="pending",o.resolve=i=>{o.status="resolved",o.value=i,t(i),e==null||e(i)},o.reject=i=>{o.status="rejected",n(i)},o}function xa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function $b(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function pv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return $b(t)}const Fb=["http:","https:","mailto:","tel:"];function Uc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ta(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,o="",i;for(;(i=t.exec(e))!==null;)o+=pv(e.slice(n,i.index))+i[0],n=t.lastIndex;o=o+pv(n?e.slice(n):e);let u=!1;return o.startsWith("//")&&(u=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:u}}function Db(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Ub(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mr(){throw new Error("Invariant failed")}function ka(e){const t=new Map;let n,o;const i=u=>{u.next&&(u.prev?(u.prev.next=u.next,u.next.prev=u.prev,u.next=void 0,o&&(o.next=u,u.prev=o)):(u.next.prev=void 0,n=u.next,u.next=void 0,o&&(u.prev=o,o.next=u)),o=u)};return{get(u){const l=t.get(u);if(l)return i(l),l.value},set(u,l){if(t.size>=e&&n){const p=n;t.delete(p.key),p.next&&(n=p.next,p.next.prev=void 0),p===o&&(o=void 0)}const d=t.get(u);if(d)d.value=l,i(d);else{const p={key:u,value:l,prev:o};o&&(o.next=p),o=p,n||(n=p),t.set(u,p)}},clear(){t.clear(),n=void 0,o=void 0}}}const ss=4,Qw=5;function zb(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Jw(e,t,n=new Uint16Array(6)){const o=e.indexOf("/",t),i=o===-1?e.length:o,u=e.substring(t,i);if(!u||!u.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(u==="$"){const d=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(u.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=zb(u);if(l){const[d,p]=l,g=u.charCodeAt(d+1);if(g===45){if(d+2<u.length&&u.charCodeAt(d+2)===36){const y=d+3,m=p;if(y<m)return n[0]=3,n[1]=t+d,n[2]=t+y,n[3]=t+m,n[4]=t+p+1,n[5]=i,n}}else if(g===36){const y=d+1,m=d+2;return m===p?(n[0]=2,n[1]=t+d,n[2]=t+y,n[3]=t+m,n[4]=t+p+1,n[5]=e.length,n):(n[0]=1,n[1]=t+d,n[2]=t+m,n[3]=t+p,n[4]=t+p+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function pl(e,t,n,o,i,u,l){var p,g,y,m,v,w,x,_,P,B;l==null||l(n);let d=o;{const k=n.fullPath??n.from,O=k.length,b=((p=n.options)==null?void 0:p.caseSensitive)??e,$=((y=(g=n.options)==null?void 0:g.params)==null?void 0:y.parse)??((m=n.options)==null?void 0:m.parseParams);for(;d<O;){const A=Jw(k,d,t);let F;const W=d,X=A[5];switch(d=X+1,u++,A[0]){case 0:{const te=k.substring(A[2],A[3]);if(b){const ae=(v=i.static)==null?void 0:v.get(te);if(ae)F=ae;else{i.static??(i.static=new Map);const E=zs(n.fullPath??n.from);E.parent=i,E.depth=u,F=E,i.static.set(te,E)}}else{const ae=te.toLowerCase(),E=(w=i.staticInsensitive)==null?void 0:w.get(ae);if(E)F=E;else{i.staticInsensitive??(i.staticInsensitive=new Map);const H=zs(n.fullPath??n.from);H.parent=i,H.depth=u,F=H,i.staticInsensitive.set(ae,H)}}break}case 1:{const te=k.substring(W,A[1]),ae=k.substring(A[4],X),E=b&&!!(te||ae),H=te?E?te:te.toLowerCase():void 0,Z=ae?E?ae:ae.toLowerCase():void 0,Y=!$&&((x=i.dynamic)==null?void 0:x.find(z=>!z.parse&&z.caseSensitive===E&&z.prefix===H&&z.suffix===Z));if(Y)F=Y;else{const z=Xd(1,n.fullPath??n.from,E,H,Z);F=z,z.depth=u,z.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(z)}break}case 3:{const te=k.substring(W,A[1]),ae=k.substring(A[4],X),E=b&&!!(te||ae),H=te?E?te:te.toLowerCase():void 0,Z=ae?E?ae:ae.toLowerCase():void 0,Y=!$&&((_=i.optional)==null?void 0:_.find(z=>!z.parse&&z.caseSensitive===E&&z.prefix===H&&z.suffix===Z));if(Y)F=Y;else{const z=Xd(3,n.fullPath??n.from,E,H,Z);F=z,z.parent=i,z.depth=u,i.optional??(i.optional=[]),i.optional.push(z)}break}case 2:{const te=k.substring(W,A[1]),ae=k.substring(A[4],X),E=b&&!!(te||ae),H=te?E?te:te.toLowerCase():void 0,Z=ae?E?ae:ae.toLowerCase():void 0,Y=Xd(2,n.fullPath??n.from,E,H,Z);F=Y,Y.parent=i,Y.depth=u,i.wildcard??(i.wildcard=[]),i.wildcard.push(Y)}}i=F}if($&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const A=zs(n.fullPath??n.from);A.kind=Qw,A.parent=i,u++,A.depth=u,i.pathless??(i.pathless=[]),i.pathless.push(A),i=A}const D=(n.path||!n.children)&&!n.isRoot;if(D&&k.endsWith("/")){const A=zs(n.fullPath??n.from);A.kind=ss,A.parent=i,u++,A.depth=u,i.index=A,i=A}i.parse=$??null,i.priority=((B=(P=n.options)==null?void 0:P.params)==null?void 0:B.priority)??0,D&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const k of n.children)pl(e,t,k,d,i,u,l)}function Yd(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function rs(e){var t,n,o;if(e.pathless)for(const i of e.pathless)rs(i);if(e.static)for(const i of e.static.values())rs(i);if(e.staticInsensitive)for(const i of e.staticInsensitive.values())rs(i);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Yd);for(const i of e.dynamic)rs(i)}if((n=e.optional)!=null&&n.length){e.optional.sort(Yd);for(const i of e.optional)rs(i)}if((o=e.wildcard)!=null&&o.length){e.wildcard.sort(Yd);for(const i of e.wildcard)rs(i)}}function zs(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Xd(e,t,n,o,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:o,suffix:i}}function Bb(e,t){const n=zs("/"),o=new Uint16Array(6);for(const i of e)pl(!1,o,i,1,n,0);rs(n),t.masksTree=n,t.flatCache=ka(1e3)}function Vb(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const o=jp(e,t.masksTree);return t.flatCache.set(e,o),o}function qb(e,t,n,o,i){e||(e="/"),o||(o="/");const u=t?`case\0${e}`:e;let l=i.singleCache.get(u);return l||(l=zs("/"),pl(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(u,l)),jp(o,l,n)}function Wb(e,t,n=!1){const o=n?e:`nofuzz\0${e}`,i=t.matchCache.get(o);if(i!==void 0)return i;e||(e="/");let u;try{u=jp(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)u=null;else throw l}return u&&(u.branch=Yw(u.route)),t.matchCache.set(o,u),u}function Hb(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Kb(e,t=!1,n){const o=zs(e.fullPath),i=new Uint16Array(6),u={},l={};let d=0;return pl(t,i,e,1,o,0,p=>{if(n==null||n(p,d),p.id in u&&Mr(),u[p.id]=p,d!==0&&p.path){const g=Hb(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}d++}),rs(o),{processedTree:{segmentTree:o,singleCache:ka(1e3),matchCache:ka(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:l}}function jp(e,t,n=!1){const o=e.split("/"),i=Jb(e,o,t,n);if(!i)return null;const[u]=Gw(e,o,i);return{route:i.node.route,rawParams:u}}function Gw(e,t,n){var y,m,v,w,x,_,P,B,k,O;const o=Qb(n.node);let i=null;const u=Object.create(null);let l=((y=n.extract)==null?void 0:y.part)??0,d=((m=n.extract)==null?void 0:m.node)??0,p=((v=n.extract)==null?void 0:v.path)??0,g=((w=n.extract)==null?void 0:w.segment)??0;for(;d<o.length;l++,d++,p++,g++){const b=o[d];if(b.kind===ss)break;if(b.kind===Qw){g--,l--,p--;continue}const $=t[l],D=p;if($&&(p+=$.length),b.kind===1){i??(i=n.node.fullPath.split("/"));const A=i[g],F=((x=b.prefix)==null?void 0:x.length)??0;if(A.charCodeAt(F)===123){const W=((_=b.suffix)==null?void 0:_.length)??0,X=A.substring(F+2,A.length-W-1),te=$.substring(F,$.length-W);u[X]=decodeURIComponent(te)}else{const W=A.substring(1);u[W]=decodeURIComponent($)}}else if(b.kind===3){if(n.skipped&1<<d){l--,p=D-1;continue}i??(i=n.node.fullPath.split("/"));const A=i[g],F=((P=b.prefix)==null?void 0:P.length)??0,W=((B=b.suffix)==null?void 0:B.length)??0,X=A.substring(F+3,A.length-W-1),te=b.suffix||b.prefix?$.substring(F,$.length-W):$;te&&(u[X]=decodeURIComponent(te))}else if(b.kind===2){const A=b,F=e.substring(D+(((k=A.prefix)==null?void 0:k.length)??0),e.length-(((O=A.suffix)==null?void 0:O.length)??0)),W=decodeURIComponent(F);u["*"]=W,u._splat=W;break}}return n.rawParams&&Object.assign(u,n.rawParams),[u,{part:l,node:d,path:p,segment:g}]}function Yw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Qb(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Jb(e,t,n,o){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!wa(t),u=i&&e!=="/",l=t.length-(i?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let p=null,g=null;for(;d.length;){const y=d.pop(),{node:m,index:v,skipped:w,depth:x,statics:_,dynamics:P,optionals:B}=y;let{extract:k,rawParams:O}=y;if(m.kind===2&&m.route&&!mc(g,y))continue;if(m.parse){if(!mv(e,t,y))continue;O=y.rawParams,k=y.extract}o&&m.route&&m.kind!==ss&&mc(p,y)&&(p=y);const b=v===l;if(b&&(m.route&&(!u||m.kind===ss||m.kind===2)&&mc(g,y)&&(g=y),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const $=b?void 0:t[v];let D;if(b&&m.index){const A={node:m.index,index:v,skipped:w,depth:x+1,statics:_,dynamics:P,optionals:B,extract:k,rawParams:O};let F=!0;if(m.index.parse&&(mv(e,t,A)||(F=!1)),F){if(!P&&!B&&!w&&Gb(_,l))return A;mc(g,A)&&(g=A)}}if(m.wildcard)for(let A=m.wildcard.length-1;A>=0;A--){const F=m.wildcard[A],{prefix:W,suffix:X}=F;if(!(W&&(b||!(F.caseSensitive?$:D??(D=$.toLowerCase())).startsWith(W)))){if(X){if(b)continue;const te=t.slice(v).join("/").slice(-X.length);if((F.caseSensitive?te:te.toLowerCase())!==X)continue}d.push({node:F,index:l,skipped:w,depth:x+1,statics:_,dynamics:P,optionals:B,extract:k,rawParams:O})}}if(m.optional){const A=w|1<<x,F=x+1;for(let W=m.optional.length-1;W>=0;W--){const X=m.optional[W];d.push({node:X,index:v,skipped:A,depth:F,statics:_,dynamics:P,optionals:B,extract:k,rawParams:O})}if(!b)for(let W=m.optional.length-1;W>=0;W--){const X=m.optional[W],{prefix:te,suffix:ae}=X;if(te||ae){const E=X.caseSensitive?$:D??(D=$.toLowerCase());if(te&&!E.startsWith(te)||ae&&!E.endsWith(ae))continue}d.push({node:X,index:v+1,skipped:w,depth:F,statics:_,dynamics:P,optionals:B+pc(l,v),extract:k,rawParams:O})}}if(!b&&m.dynamic&&$)for(let A=m.dynamic.length-1;A>=0;A--){const F=m.dynamic[A],{prefix:W,suffix:X}=F;if(W||X){const te=F.caseSensitive?$:D??(D=$.toLowerCase());if(W&&!te.startsWith(W)||X&&!te.endsWith(X))continue}d.push({node:F,index:v+1,skipped:w,depth:x+1,statics:_,dynamics:P+pc(l,v),optionals:B,extract:k,rawParams:O})}if(!b&&m.staticInsensitive){const A=m.staticInsensitive.get(D??(D=$.toLowerCase()));A&&d.push({node:A,index:v+1,skipped:w,depth:x+1,statics:_+pc(l,v),dynamics:P,optionals:B,extract:k,rawParams:O})}if(!b&&m.static){const A=m.static.get($);A&&d.push({node:A,index:v+1,skipped:w,depth:x+1,statics:_+pc(l,v),dynamics:P,optionals:B,extract:k,rawParams:O})}if(m.pathless){const A=x+1;for(let F=m.pathless.length-1;F>=0;F--){const W=m.pathless[F];d.push({node:W,index:v,skipped:w,depth:A,statics:_,dynamics:P,optionals:B,extract:k,rawParams:O})}}}if(g)return g;if(o&&p){let y=p.index;for(let v=0;v<p.index;v++)y+=t[v].length;const m=y===e.length?"/":e.slice(y);return p.rawParams??(p.rawParams=Object.create(null)),p.rawParams["**"]=decodeURIComponent(m),p}return null}function pc(e,t){return 2**(e-t-1)}function Gb(e,t){return e===2**(t-1)-1}function mv(e,t,n){let o,i;try{[o,i]=Gw(e,t,n)}catch{return null}if(n.rawParams=o,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(o)===!1)return null}catch{}return!0}function mc(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ss)>(e.node.kind===ss)||t.node.kind===ss==(e.node.kind===ss)&&t.depth>e.depth))):!0}function bc(e){return $p(e.filter(t=>t!==void 0).join("/"))}function $p(e){return e.replace(/\/{2,}/g,"/")}function Xw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Zw(e){return Rr(Xw(e))}function zc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Yb(e,t,n){return zc(e,n)===zc(t,n)}function Xb({base:e,to:t,trailingSlash:n="never",cache:o}){const i=t.startsWith("/"),u=!i&&t===".";let l;if(o){l=i?t:u?e:e+"\0"+t;const g=o.get(l);if(g)return g}let d;if(u)d=e.split("/");else if(i)d=t.split("/");else{for(d=e.split("/");d.length>1&&wa(d)==="";)d.pop();const g=t.split("/");for(let y=0,m=g.length;y<m;y++){const v=g[y];v===""?y?y===m-1&&d.push(v):d=[v]:v===".."?d.pop():v==="."||d.push(v)}}d.length>1&&(wa(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));const p=$p(d.join("/"))||"/";return l&&o&&o.set(l,p),p}function Zb(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(n,"g");return i=>i.replace(o,u=>t.get(u)??u)}function Zd(e,t,n){const o=t[e];return typeof o!="string"?o:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(i=>yv(i,n)).join("/"):yv(o,n)}function gv({path:e,params:t,decoder:n,...o}){let i=!1;const u=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:u,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:u,isMissingParams:i};const l=e.length;let d=0,p,g="";for(;d<l;){const y=d;p=Jw(e,y,p);const m=p[5];if(d=m+1,y===m)continue;const v=p[0];if(v===0){g+="/"+e.substring(y,m);continue}if(v===2){const w=t._splat;u._splat=w,u["*"]=w;const x=e.substring(y,p[1]),_=e.substring(p[4],m);if(!w){i=!0,(x||_)&&(g+="/"+x+_);continue}const P=Zd("_splat",t,n);g+="/"+x+P+_;continue}if(v===1){const w=e.substring(p[2],p[3]);!i&&!(w in t)&&(i=!0),u[w]=t[w];const x=e.substring(y,p[1]),_=e.substring(p[4],m),P=Zd(w,t,n)??"undefined";g+="/"+x+P+_;continue}if(v===3){const w=e.substring(p[2],p[3]),x=t[w];if(x==null)continue;u[w]=x;const _=e.substring(y,p[1]),P=e.substring(p[4],m),B=Zd(w,t,n)??"";g+="/"+_+B+P;continue}}return e.endsWith("/")&&(g+="/"),{usedParams:u,interpolatedPath:g||"/",isMissingParams:i}}function yv(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function Vt(e){return(e==null?void 0:e.isNotFound)===!0}function eP(e,t=String){const n=new URLSearchParams;for(const o in e){const i=e[o];i!==void 0&&n.set(o,t(i))}return n.toString()}function eh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function tP(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[o,i]of t.entries()){const u=n[o];u==null?n[o]=eh(i):Array.isArray(u)?u.push(eh(i)):n[o]=[u,eh(i)]}return n}const nP=sP(JSON.parse),rP=oP(JSON.stringify,JSON.parse);function sP(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=tP(t);for(const o in n){const i=n[o];if(typeof i=="string")try{n[o]=e(i)}catch{}}return n}}function oP(e,t){const n=typeof t=="function";function o(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const u=eP(i,o);return u?`?${u}`:""}}const Vs="__root__";function iP(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function on(e){return e instanceof Response&&!!e.options}const zh=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},aP=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),ml=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),qs=(e,t,n=!0)=>{const o={...e.router.options.context??{}},i=n?t:t-1;for(let u=0;u<=i;u++){const l=e.matches[u];if(!l)continue;const d=e.router.getMatch(l.id);d&&Object.assign(o,d.__routeContext,d.__beforeLoadContext)}return o},vv=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=o>=0?o:0;let u=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;u<0&&(u=i);for(let l=u;l>=0;l--){const d=e.matches[l];if(e.router.looseRoutesById[d.routeId].options.notFoundComponent)return l}return n?u:i},os=(e,t,n)=>{var o,i,u;if(!(!on(n)&&!Vt(n)))throw on(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((o=t._nonReactive.beforeLoadPromise)==null||o.resolve(),(i=t._nonReactive.loaderPromise)==null||i.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,l=>({...l,status:on(n)?"redirected":Vt(n)?"notFound":l.status==="pending"?"success":l.status,context:qs(e,t.index),isFetching:!1,error:n})),Vt(n)&&!n.routeId&&(n.routeId=t.routeId),(u=t._nonReactive.loadPromise)==null||u.resolve()),on(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},ex=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Sv=(e,t,n)=>{const o=qs(e,n);e.updateMatch(t,i=>({...i,context:o}))},na=(e,t,n)=>{var l,d;const{id:o,routeId:i}=e.matches[t],u=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??(e.firstBadMatchIndex=t),os(e,e.router.getMatch(o),n);try{(d=(l=u.options).onError)==null||d.call(l,n)}catch(p){n=p,os(e,e.router.getMatch(o),n)}e.updateMatch(o,p=>{var g,y;return(g=p._nonReactive.beforeLoadPromise)==null||g.resolve(),p._nonReactive.beforeLoadPromise=void 0,(y=p._nonReactive.loadPromise)==null||y.resolve(),{...p,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!on(n)&&!Vt(n)&&(e.serialError??(e.serialError=n))},tx=(e,t,n,o)=>{var u;if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!ml(e,t)&&(n.options.loader||n.options.beforeLoad||rx(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((u=e.router.options)==null?void 0:u.defaultPendingComponent))){const l=setTimeout(()=>{zh(e)},i);o._nonReactive.pendingTimeout=l}},uP=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;tx(e,t,n,o);const i=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&os(e,u,u.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(i):i()},cP=(e,t,n,o)=>{const i=e.router.getMatch(t);let u=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Go(()=>{u==null||u.resolve(),u=void 0});const{paramsError:l,searchError:d}=i;l&&na(e,n,l),d&&na(e,n,d),tx(e,t,o,i);const p=new AbortController;let g=!1;const y=()=>{g||(g=!0,e.updateMatch(t,b=>({...b,isFetching:"beforeLoad",fetchCount:b.fetchCount+1,abortController:p})))},m=()=>{var b;(b=i._nonReactive.beforeLoadPromise)==null||b.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,$=>({...$,isFetching:!1}))};if(!o.options.beforeLoad){e.router.batch(()=>{y(),m()});return}i._nonReactive.beforeLoadPromise=Go();const v={...qs(e,n,!1),...i.__routeContext},{search:w,params:x,cause:_}=i,P=ml(e,t),B={search:w,abortController:p,params:x,preload:P,context:v,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:P?"preload":_,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},k=b=>{if(b===void 0){e.router.batch(()=>{y(),m()});return}(on(b)||Vt(b))&&(y(),na(e,n,b)),e.router.batch(()=>{y(),e.updateMatch(t,$=>({...$,__beforeLoadContext:b})),m()})};let O;try{if(O=o.options.beforeLoad(B),xa(O))return y(),O.catch(b=>{na(e,n,b)}).then(k)}catch(b){y(),na(e,n,b)}k(O)},lP=(e,t)=>{const{id:n,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o],u=()=>d(),l=()=>cP(e,n,t,i),d=()=>{if(ex(e,n))return;const p=uP(e,n,i);return xa(p)?p.then(l):l()};return u()},fP=(e,t,n)=>{var u,l,d,p,g,y;const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([(l=(u=n.options).head)==null?void 0:l.call(u,i),(p=(d=n.options).scripts)==null?void 0:p.call(d,i),(y=(g=n.options).headers)==null?void 0:y.call(g,i)]).then(([m,v,w])=>({meta:m==null?void 0:m.meta,links:m==null?void 0:m.links,headScripts:m==null?void 0:m.scripts,headers:w,scripts:v,styles:m==null?void 0:m.styles}))},nx=(e,t,n,o,i)=>{const u=t[o-1],{params:l,loaderDeps:d,abortController:p,cause:g}=e.router.getMatch(n),y=qs(e,o),m=ml(e,n);return{params:l,deps:d,preload:!!m,parentMatchPromise:u,abortController:p,context:y,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:m?"preload":g,route:i,...e.router.options.additionalContext}},wv=async(e,t,n,o,i)=>{var u,l,d,p,g;try{const y=e.router.getMatch(n);try{(!(Ww??e.router.isServer)||y.ssr===!0)&&_a(i);const m=i.options.loader,v=typeof m=="function"?m:m==null?void 0:m.handler,w=v==null?void 0:v(nx(e,t,n,o,i)),x=!!v&&xa(w);if((x||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||y._nonReactive.minPendingPromise)&&e.updateMatch(n,P=>({...P,isFetching:"loader"})),v){const P=x?await w:w;os(e,e.router.getMatch(n),P),P!==void 0&&e.updateMatch(n,B=>({...B,loaderData:P}))}i._lazyPromise&&await i._lazyPromise;const _=y._nonReactive.minPendingPromise;_&&await _,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,P=>({...P,error:void 0,context:qs(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(m){let v=m;if((v==null?void 0:v.name)==="AbortError"){if(y.abortController.signal.aborted){(u=y._nonReactive.loaderPromise)==null||u.resolve(),y._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,x=>({...x,status:x.status==="pending"?"success":x.status,isFetching:!1,context:qs(e,o)}));return}const w=y._nonReactive.minPendingPromise;w&&await w,Vt(m)&&await((d=(l=i.options.notFoundComponent)==null?void 0:l.preload)==null?void 0:d.call(l)),os(e,e.router.getMatch(n),m);try{(g=(p=i.options).onError)==null||g.call(p,m)}catch(x){v=x,os(e,e.router.getMatch(n),x)}!on(v)&&!Vt(v)&&await _a(i,["errorComponent"]),e.updateMatch(n,x=>({...x,error:v,context:qs(e,o),status:"error",isFetching:!1}))}}catch(y){const m=e.router.getMatch(n);m&&(m._nonReactive.loaderPromise=void 0),os(e,m,y)}},dP=async(e,t,n)=>{var w,x,_,P;async function o(B,k,O,b,$){const D=Date.now()-k.updatedAt,A=B?$.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:$.options.staleTime??e.router.options.defaultStaleTime??0,F=$.options.shouldReload,W=typeof F=="function"?F(nx(e,t,i,n,$)):F,{status:X,invalid:te}=b,ae=D>=A&&(!!e.forceStaleReload||b.cause==="enter"||O!==void 0&&O!==b.id);l=X==="success"&&(te||(W??ae)),B&&$.options.preload===!1||(l&&!e.sync&&y?(d=!0,(async()=>{var E,H;try{await wv(e,t,i,n,$);const Z=e.router.getMatch(i);(E=Z._nonReactive.loaderPromise)==null||E.resolve(),(H=Z._nonReactive.loadPromise)==null||H.resolve(),Z._nonReactive.loaderPromise=void 0,Z._nonReactive.loadPromise=void 0}catch(Z){on(Z)&&await e.router.navigate(Z.options)}})()):X!=="success"||l?await wv(e,t,i,n,$):Sv(e,i,n))}const{id:i,routeId:u}=e.matches[n];let l=!1,d=!1;const p=e.router.looseRoutesById[u],g=p.options.loader,y=((typeof g=="function"||g==null?void 0:g.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(ex(e,i)){if(!e.router.getMatch(i))return e.matches[n];Sv(e,i,n)}else{const B=e.router.getMatch(i),k=e.router.stores.matchesId.get()[n],O=((w=k&&e.router.stores.matchStores.get(k)||null)==null?void 0:w.routeId)===u?k:(x=e.router.stores.matches.get().find($=>$.routeId===u))==null?void 0:x.id,b=ml(e,i);if(B._nonReactive.loaderPromise){if(B.status==="success"&&!e.sync&&!B.preload&&y)return B;await B._nonReactive.loaderPromise;const $=e.router.getMatch(i),D=$._nonReactive.error||$.error;D&&os(e,$,D),$.status==="pending"&&await o(b,B,O,$,p)}else{const $=b&&!e.router.stores.matchStores.has(i),D=e.router.getMatch(i);D._nonReactive.loaderPromise=Go(),$!==D.preload&&e.updateMatch(i,A=>({...A,preload:$})),await o(b,B,O,D,p)}}const m=e.router.getMatch(i);d||((_=m._nonReactive.loaderPromise)==null||_.resolve(),(P=m._nonReactive.loadPromise)==null||P.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,d||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const v=d?m.isFetching:!1;return v!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,B=>({...B,isFetching:v,invalid:!1})),e.router.getMatch(i)):m};async function xv(e){var v,w;const t=e,n=[];aP(t.router)&&zh(t);let o;for(let x=0;x<t.matches.length;x++){try{const _=lP(t,x);xa(_)&&await _}catch(_){if(on(_))throw _;if(Vt(_))o=_;else if(!t.preload)throw _;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,u=o&&!t.preload?vv(t,o):void 0,l=o&&t.preload?0:u!==void 0?Math.min(u+1,i):i;let d,p;for(let x=0;x<l;x++)n.push(dP(t,n,x));try{await Promise.all(n)}catch{const x=await Promise.allSettled(n);for(const _ of x){if(_.status!=="rejected")continue;const P=_.reason;if(on(P))throw P;Vt(P)?d??(d=P):p??(p=P)}if(p!==void 0)throw p}const g=d??(o&&!t.preload?o:void 0);let y=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!g&&o&&t.preload)return t.matches;if(g){const x=vv(t,g);x===void 0&&Mr();const _=t.matches[x],P=t.router.looseRoutesById[_.routeId],B=(v=t.router.options)==null?void 0:v.defaultNotFoundComponent;!P.options.notFoundComponent&&B&&(P.options.notFoundComponent=B),g.routeId=_.routeId;const k=_.routeId===t.router.routeTree.id;t.updateMatch(_.id,O=>({...O,...k?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:g},isFetching:!1})),y=x,await _a(P,["notFoundComponent"])}else if(!t.preload){const x=t.matches[0];x.globalNotFound||(w=t.router.getMatch(x.id))!=null&&w.globalNotFound&&t.updateMatch(x.id,_=>({..._,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const x=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await _a(x,["errorComponent"])}for(let x=0;x<=y;x++){const{id:_,routeId:P}=t.matches[x],B=t.router.looseRoutesById[P];try{const k=fP(t,_,B);if(k){const O=await k;t.updateMatch(_,b=>({...b,...O}))}}catch(k){console.error(`Error executing head for route ${P}:`,k)}}const m=zh(t);if(xa(m)&&await m,g)throw g;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function kv(e,t){const n=t.map(o=>{var i,u;return(u=(i=e.options[o])==null?void 0:i.preload)==null?void 0:u.call(i)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function _a(e,t=Pc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(o=>{const{id:i,...u}=o.options;Object.assign(e.options,u),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Pc?(()=>{if(e._componentsPromise===void 0){const o=kv(e,Pc);o?e._componentsPromise=o.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():kv(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function rx(e){var t;for(const n of Pc)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Pc=["component","errorComponent","pendingComponent","notFoundComponent"];function hP(e){return{input:({url:t})=>{for(const n of e)t=Bh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=sx(e[n],t);return t}}}function pP(e){const t=Zw(e.basepath),n=`/${t}`,o=e.caseSensitive?n:n.toLowerCase(),i=`${o}/`;return{input:({url:u})=>{const l=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return l===o?u.pathname="/":l.startsWith(i)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=bc(["/",t,u.pathname]),u)}}function Bh(e,t){var o;const n=(o=e==null?void 0:e.input)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function sx(e,t){var o;const n=(o=e==null?void 0:e.output)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function mP(e,t){const{createMutableStore:n,createReadonlyStore:o,batch:i,init:u}=t,l=new Map,d=new Map,p=new Map,g=n(e.status),y=n(e.loadedAt),m=n(e.isLoading),v=n(e.isTransitioning),w=n(e.location),x=n(e.resolvedLocation),_=n(e.statusCode),P=n(e.redirect),B=n([]),k=n([]),O=n([]),b=o(()=>th(l,B.get())),$=o(()=>th(d,k.get())),D=o(()=>th(p,O.get())),A=o(()=>B.get()[0]),F=o(()=>B.get().some(z=>{var G;return((G=l.get(z))==null?void 0:G.get().status)==="pending"})),W=o(()=>{var z;return{locationHref:w.get().href,resolvedLocationHref:(z=x.get())==null?void 0:z.href,status:g.get()}}),X=o(()=>({status:g.get(),loadedAt:y.get(),isLoading:m.get(),isTransitioning:v.get(),matches:b.get(),location:w.get(),resolvedLocation:x.get(),statusCode:_.get(),redirect:P.get()})),te=ka(64);function ae(z){let G=te.get(z);return G||(G=o(()=>{const re=B.get();for(const V of re){const R=l.get(V);if(R&&R.routeId===z)return R.get()}}),te.set(z,G)),G}const E={status:g,loadedAt:y,isLoading:m,isTransitioning:v,location:w,resolvedLocation:x,statusCode:_,redirect:P,matchesId:B,pendingIds:k,cachedIds:O,matches:b,pendingMatches:$,cachedMatches:D,firstId:A,hasPending:F,matchRouteDeps:W,matchStores:l,pendingMatchStores:d,cachedMatchStores:p,__store:X,getRouteMatchStore:ae,setMatches:H,setPending:Z,setCached:Y};H(e.matches),u==null||u(E);function H(z){nh(z,l,B,n,i)}function Z(z){nh(z,d,k,n,i)}function Y(z){nh(z,p,O,n,i)}return E}function th(e,t){const n=[];for(const o of t){const i=e.get(o);i&&n.push(i.get())}return n}function nh(e,t,n,o,i){const u=e.map(d=>d.id),l=new Set(u);i(()=>{for(const d of t.keys())l.has(d)||t.delete(d);for(const d of e){const p=t.get(d.id);if(!p){const g=o(d);g.routeId=d.routeId,t.set(d.id,g);continue}p.routeId=d.routeId,p.get()!==d&&p.set(d)}Ub(n.get(),u)||n.set(u)})}var as="__TSR_index",_v="popstate",Ev="beforeunload";function gP(e){let t=e.getLocation();const n=new Set,o=l=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?o(l):t=e.getLocation()},u=async({task:l,navigateOpts:d,...p})=>{var m,v;if((d==null?void 0:d.ignoreBlocker)??!1){l();return}const g=((m=e.getBlockers)==null?void 0:m.call(e))??[],y=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const w of g){const x=Ea(p.path,p.state);if(await w.blockerFn({currentLocation:t,nextLocation:x,action:p.type})){(v=e.onBlocked)==null||v.call(e);return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,d,p)=>{const g=t.state[as];d=Cv(g+1,d),u({task:()=>{e.pushState(l,d),o({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:l,state:d})},replace:(l,d,p)=>{const g=t.state[as];d=Cv(g,d),u({task:()=>{e.replaceState(l,d),o({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:l,state:d})},go:(l,d)=>{u({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:d,type:"GO"})},back:l=>{u({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{u({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[as]!==0,createHref:l=>e.createHref(l),block:l=>{var p;if(!e.setBlockers)return()=>{};const d=((p=e.getBlockers)==null?void 0:p.call(e))??[];return e.setBlockers([...d,l]),()=>{var y,m;const g=((y=e.getBlockers)==null?void 0:y.call(e))??[];(m=e.setBlockers)==null||m.call(e,g.filter(v=>v!==l))}},flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:o}}function Cv(e,t){t||(t={});const n=Fp();return{...t,key:n,__TSR_key:n,[as]:e}}function ox(e){var F,W;const t=(e==null?void 0:e.window)??(typeof document<"u"?window:void 0),n=t.history.pushState,o=t.history.replaceState;let i=[];const u=()=>i,l=X=>i=X,d=(e==null?void 0:e.createHref)??(X=>X),p=(e==null?void 0:e.parseLocation)??(()=>Ea(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((F=t.history.state)!=null&&F.__TSR_key)&&!((W=t.history.state)!=null&&W.key)){const X=Fp();t.history.replaceState({[as]:0,key:X,__TSR_key:X},"")}let g=p(),y,m=!1,v=!1,w=!1,x=!1;const _=()=>g;let P,B;const k=()=>{P&&(A._ignoreSubscribers=!0,(P.isPush?t.history.pushState:t.history.replaceState)(P.state,"",P.href),A._ignoreSubscribers=!1,P=void 0,B=void 0,y=void 0)},O=(X,te,ae)=>{const E=d(te);B||(y=g),g=Ea(te,ae),P={href:E,state:ae,isPush:(P==null?void 0:P.isPush)||X==="push"},B||(B=Promise.resolve().then(()=>k()))},b=X=>{g=p(),A.notify({type:X})},$=async()=>{if(v){v=!1;return}const X=p(),te=X.state[as]-g.state[as],ae=te===1,E=te===-1,H=!ae&&!E||m;m=!1;const Z=H?"GO":E?"BACK":"FORWARD",Y=H?{type:"GO",index:te}:{type:E?"BACK":"FORWARD"};if(w)w=!1;else{const z=u();if(typeof document<"u"&&z.length){for(const G of z)if(await G.blockerFn({currentLocation:g,nextLocation:X,action:Z})){v=!0,t.history.go(1),A.notify(Y);return}}}g=p(),A.notify(Y)},D=X=>{if(x){x=!1;return}let te=!1;const ae=u();if(typeof document<"u"&&ae.length)for(const E of ae){const H=E.enableBeforeUnload??!0;if(H===!0){te=!0;break}if(typeof H=="function"&&H()===!0){te=!0;break}}if(te)return X.preventDefault(),X.returnValue=""},A=gP({getLocation:_,getLength:()=>t.history.length,pushState:(X,te)=>O("push",X,te),replaceState:(X,te)=>O("replace",X,te),back:X=>(X&&(w=!0),x=!0,t.history.back()),forward:X=>{X&&(w=!0),x=!0,t.history.forward()},go:X=>{m=!0,t.history.go(X)},createHref:X=>d(X),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(Ev,D,{capture:!0}),t.removeEventListener(_v,$)},onBlocked:()=>{y&&g!==y&&(g=y)},getBlockers:u,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Ev,D,{capture:!0}),t.addEventListener(_v,$),t.history.pushState=function(...X){const te=n.apply(t.history,X);return A._ignoreSubscribers||b("PUSH"),te},t.history.replaceState=function(...X){const te=o.apply(t.history,X);return A._ignoreSubscribers||b("REPLACE"),te},A}function yP(e){const t=typeof document<"u"?window:void 0;return ox({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),o=n[0]??"/",i=t.location.search,u=n.slice(1);return Ea(`${o}${i}${u.length===0?"":`#${u.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function vP(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ea(e,t){const n=vP(e),o=n.indexOf("#"),i=n.indexOf("?"),u=Fp();return{href:n,pathname:n.substring(0,o>0?i>0?Math.min(o,i):o:i>0?i:n.length),hash:o>-1?n.substring(o):"",search:i>-1?n.slice(i,o===-1?void 0:o):"",state:t||{[as]:0,key:u,__TSR_key:u}}}function Fp(){return(Math.random()+1).toString(36).substring(7)}function Wo(e,t){const n=t,o=e;return{fromLocation:n,toLocation:o,pathChanged:(n==null?void 0:n.pathname)!==o.pathname,hrefChanged:(n==null?void 0:n.href)!==o.href,hashChanged:(n==null?void 0:n.hash)!==o.hash}}const Vh=new WeakMap;var SP=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{var y;const o=this.options,i=this.basepath??(o==null?void 0:o.basepath)??"/",u=this.basepath===void 0,l=o==null?void 0:o.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Zb(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ox()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=ka(1e3),m=this.buildRouteTree(),this.setRoutes(m)}if(!this.stores&&this.latestLocation){const m=this.getStoreConfig(this);this.batch=m.batch,this.stores=mP(xP(this.latestLocation),m),OP(this)}let d=!1;const p=this.options.basepath??"/",g=this.options.rewrite;if(u||i!==p||l!==g){this.basepath=p;const m=[],v=Zw(p);v&&v!=="/"&&m.push(pP({basepath:p})),g&&m.push(g),this.rewrite=m.length===0?void 0:m.length===1?m[0]:hP(m),this.history&&this.updateLatestLocation(),d=!0}d&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((y=window.CSS)==null?void 0:y.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Kb(this.routeTree,this.options.caseSensitive,(o,i)=>{o.init({originalIndex:i})});return this.options.routeMasks&&Bb(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const i={eventType:n,fn:o};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const i=({pathname:p,search:g,hash:y,href:m,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(p)){const B=this.options.parseSearch(g),k=this.options.stringifySearch(B);return{href:p+k+y,publicHref:p+k+y,pathname:ta(p).path,external:!1,searchStr:k,search:As(o==null?void 0:o.search,B),hash:ta(y.slice(1)).path,state:Us(o==null?void 0:o.state,v)}}const w=new URL(m,this.origin),x=Bh(this.rewrite,w),_=this.options.parseSearch(x.search),P=this.options.stringifySearch(_);return x.search=P,{href:x.href.replace(x.origin,""),publicHref:m,pathname:ta(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:P,search:As(o==null?void 0:o.search,_),hash:ta(x.hash.slice(1)).path,state:Us(o==null?void 0:o.state,v)}},u=i(n),{__tempLocation:l,__tempKey:d}=u.state;if(l&&(!d||d===this.tempLocationKey)){const p=i(l);return p.state.key=u.state.key,p.state.__TSR_key=u.state.__TSR_key,delete p.state.__tempLocation,{...p,maskedLocation:u}}return u},this.resolvePathWithBase=(n,o)=>Xb({base:n,to:o.includes("//")?$p(o):o,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},i):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>kP({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var i;if(this.stores.pendingMatchStores.has(n))return;const o=(i=this.stores.matchStores.get(n))==null?void 0:i.get();o&&(o.status==="pending"||o.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const o=(u={})=>{var te,ae;const l=u._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(l);u.from;const p=u.unsafeRelative==="path"?l.pathname:u.from??d.fullPath,g=u.to?`${u.to}`:void 0,y=d.search,m=Object.assign(Object.create(null),d.params),v=(g==null?void 0:g.charCodeAt(0))===47?"/":this.resolvePathWithBase(p,"."),w=g?this.resolvePathWithBase(v,g):v,x=u.params===!1||u.params===null?Object.create(null):(u.params??!0)===!0?m:Object.assign(m,Ds(u.params,m)),_=this.routesByPath[Rr(w)];let P;if(_)P=this.getRouteBranch(_);else if(w.includes("$"))P=[];else{const E=this.getMatchedRoutes(w);P=E.matchedRoutes,this.options.notFoundRoute&&(!E.foundRoute||E.foundRoute.path!=="/"&&E.routeParams["**"])&&(P=[...P,this.options.notFoundRoute])}if(P.length&&Kw(x))for(const E of P){const H=((te=E.options.params)==null?void 0:te.stringify)??E.options.stringifyParams;if(H)try{Object.assign(x,H(x))}catch{}}const B=n.leaveParams?w:ta(gv({path:w,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let k=y;if(n._includeValidateSearch&&((ae=this.options.search)!=null&&ae.strict)){const E={};P.forEach(H=>{if(H.options.validateSearch)try{Object.assign(E,Ic(H.options.validateSearch,{...E,...k}))}catch{}}),k=E}k=_P({search:k,dest:u,destRoutes:P,_includeValidateSearch:n._includeValidateSearch}),k=As(y,k);const O=this.options.stringifySearch(k),b=u.hash===!0?l.hash:u.hash?Ds(u.hash,l.hash):void 0,$=b?`#${b}`:"";let D=u.state===!0?l.state:u.state?Ds(u.state,l.state):{};D=Us(l.state,D);const A=`${B}${O}${$}`;let F,W,X=!1;if(this.rewrite){const E=new URL(A,this.origin),H=sx(this.rewrite,E);F=E.href.replace(E.origin,""),H.origin!==this.origin?(W=H.href,X=!0):W=H.pathname+H.search+H.hash}else F=Db(A),W=F;return{publicHref:W,href:F,pathname:B,search:k,searchStr:O,state:D,hash:b??"",external:X,unmaskOnReload:u.unmaskOnReload}},i=(u={},l)=>{const d=o(u);let p=l?o(l):void 0;if(!p){const g=Object.create(null);if(this.options.routeMasks){const y=Vb(d.pathname,this.processedTree);if(y){Object.assign(g,y.rawParams);const{from:m,params:v,...w}=y.route,x=v===!1||v===null?Object.create(null):(v??!0)===!0?g:Object.assign(g,Ds(v,g));l={from:n.from,...w,params:x},p=o(l)}}}return p&&(d.maskedLocation=p),d};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...i})=>{let u;const l=()=>{const g=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];g.forEach(m=>{i.state[m]=this.latestLocation.state[m]});const y=Bs(i.state,this.latestLocation.state);return g.forEach(m=>{delete i.state[m]}),y},d=Rr(this.latestLocation.href)===Rr(i.href);let p=this.commitLocationPromise;if(this.commitLocationPromise=Go(()=>{p==null||p.resolve(),p=void 0}),d&&l())this.load();else{let{maskedLocation:g,hashScrollIntoView:y,...m}=i;g&&(m={...g,state:{...g.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=y??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,u=i.replace?"REPLACE":"PUSH",this.history[u==="REPLACE"?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:o})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(u?{action:{type:u}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:i,viewTransition:u,ignoreBlocker:l,href:d,...p}={})=>{if(d){const m=this.history.location.state.__TSR_index,v=Ea(d,{__TSR_index:n?m:m+1}),w=new URL(v.pathname,this.origin);p.to=Bh(this.rewrite,w).pathname,p.search=this.options.parseSearch(v.search),p.hash=v.hash.slice(1)}const g=this.buildLocation({...p,_includeValidateSearch:!0});this.pendingBuiltLocation=g;const y=this.commitLocation({...g,viewTransition:u,replace:n,resetScroll:o,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===g&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:o,href:i,publicHref:u,...l})=>{var p,g;let d=!1;if(i)try{new URL(`${i}`),d=!0}catch{}if(d&&!o&&(o=!0),o){if(n!==void 0||!i){const m=this.buildLocation({to:n,...l});i=i??m.publicHref,u=u??m.publicHref}const y=!d&&u?u:i;if(Uc(y,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const m=((g=(p=this.history).getBlockers)==null?void 0:g.call(p))??[];for(const v of m)if(v!=null&&v.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(y):window.location.href=y,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),o=this.stores.cachedMatches.get().filter(i=>!n.some(u=>u.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(o)})},this.load=async n=>{var g;const o=(g=n==null?void 0:n.action)==null?void 0:g.type;let i,u,l;const d=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(y=>{this.startTransition(async()=>{var m;try{this.beforeLoad(),o?Vh.set(this.latestLocation,o):Vh.delete(this.latestLocation);const v=this.latestLocation,w=Wo(v,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...w}),this.emit({type:"onBeforeLoad",...w}),await xv({router:this,sync:n==null?void 0:n.sync,forceStaleReload:d.href===v.href,matches:this.stores.pendingMatches.get(),location:v,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var k,O;let x=null,_=null,P=null,B=null;this.batch(()=>{const b=this.stores.pendingMatches.get(),$=b.length,D=this.stores.matches.get();x=$?D.filter(W=>!this.stores.pendingMatchStores.has(W.id)):null;const A=new Set;for(const W of this.stores.pendingMatchStores.values())W.routeId&&A.add(W.routeId);const F=new Set;for(const W of this.stores.matchStores.values())W.routeId&&F.add(W.routeId);_=$?D.filter(W=>!A.has(W.routeId)):null,P=$?b.filter(W=>!F.has(W.routeId)):null,B=$?b.filter(W=>F.has(W.routeId)):D,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),$&&(this.stores.setMatches(b),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...x.filter(W=>W.status!=="error"&&W.status!=="notFound"&&W.status!=="redirected")]),this.clearExpiredCache())});for(const[b,$]of[[_,"onLeave"],[P,"onEnter"],[B,"onStay"]])if(b)for(const D of b)(O=(k=this.looseRoutesById[D.routeId].options)[$])==null||O.call(k,D)})})}})}catch(v){on(v)?(i=v,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):Vt(v)&&(u=v);const w=i?i.status:u?404:this.stores.matches.get().some(x=>x.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(w),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&((m=this.commitLocationPromise)==null||m.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),y()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let p;this.hasNotFoundMatch()?p=404:this.stores.matches.get().some(y=>y.status==="error")&&(p=500),p!==void 0&&this.stores.statusCode.set(p)},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const u=this.latestLocation,l=this.stores.resolvedLocation.get(),d=typeof o.types=="function"?o.types(Wo(u,l)):o.types;if(d===!1){n();return}i={update:n,types:d}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(o);return}const u=this.stores.matchStores.get(n);if(u){u.set(o);return}const l=this.stores.cachedMatchStores.get(n);if(l){const d=o(l.get());d.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(p=>p.filter(g=>g!==n)):l.set(d)}})},this.getMatch=n=>{var o,i,u;return((o=this.stores.cachedMatchStores.get(n))==null?void 0:o.get())??((i=this.stores.pendingMatchStores.get(n))==null?void 0:i.get())??((u=this.stores.matchStores.get(n))==null?void 0:u.get())},this.invalidate=n=>{const o=i=>{var u;return((u=n==null?void 0:n.filter)==null?void 0:u.call(n,i))??!0?{...i,invalid:!0,...n!=null&&n.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(o)),this.stores.setCached(this.stores.cachedMatches.get().map(o)),this.stores.setPending(this.stores.pendingMatches.get().map(o))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),u=this.getParsedLocationHref(i);n.options.href=u,n.headers.set("Location",u)}else if(o)try{const i=new URL(o);if(this.origin&&i.origin===this.origin){const u=i.pathname+i.search+i.hash;n.options.href=u,n.headers.set("Location",u)}}catch{}if(n.options.href&&!n.options._builtLocation&&Uc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n==null?void 0:n.filter;o!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!o(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),o=i=>{const u=this.looseRoutesById[i.routeId];if(!u.options.loader)return!0;const l=(i.preload?u.options.preloadGcTime??this.options.defaultPreloadGcTime:u.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:o})},this.loadRouteChunk=_a,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const u=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...u,...this.stores.cachedIds.get()]),d=i.filter(p=>!l.has(p.id));if(d.length){const p=this.stores.cachedMatches.get();this.stores.setCached([...p,...d])}try{return i=await xv({router:this,matches:i,location:o,preload:!0,updateMatch:(p,g)=>{u.has(p)?i=i.map(y=>y.id===p?g(y):y):this.updateMatch(p,g)}}),i}catch(p){if(on(p))return p.options.reloadDocument?void 0:await this.preloadRoute({...p.options,_fromLocation:o});Vt(p)||console.error(p);return}},this.matchRoute=(n,o)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},u=this.buildLocation(i);if(o!=null&&o.pending&&this.stores.status.get()!=="pending")return!1;const l=((o==null?void 0:o.pending)===void 0?!this.stores.isLoading.get():o.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),d=qb(u.pathname,(o==null?void 0:o.caseSensitive)??!1,(o==null?void 0:o.fuzzy)??!1,l.pathname,this.processedTree);return!d||n.params&&!Bs(d.rawParams,n.params,{partial:!0})?!1:(o==null?void 0:o.includeSearch)??!0?Bs(l.search,u.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??rP,parseSearch:e.parseSearch??nP,protocolAllowlist:e.protocolAllowlist??Fb}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Yw(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var y,m;const n=this.getMatchedRoutes(e.pathname),{foundRoute:o,routeParams:i}=n;let{matchedRoutes:u}=n,l=!1;(o?o.path!=="/"&&i["**"]:Rr(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:l=!0);const d=l?CP(this.options.notFoundMode,u):void 0,p=new Array(u.length),g=new Map;for(const v of this.stores.matchStores.values())v.routeId&&g.set(v.routeId,v.get());for(let v=0;v<u.length;v++){const w=u[v],x=p[v-1];let _,P,B;{const H=(x==null?void 0:x.search)??e.search,Z=(x==null?void 0:x._strictSearch)??void 0;try{const Y=Ic(w.options.validateSearch,{...H})??void 0;_={...H,...Y},P={...Z,...Y},B=void 0}catch(Y){let z=Y;if(Y instanceof Bc||(z=new Bc(Y.message,{cause:Y})),t!=null&&t.throwOnError)throw z;_=H,P={},B=z}}const k=((m=(y=w.options).loaderDeps)==null?void 0:m.call(y,{search:_}))??"",O=k?JSON.stringify(k):"",{interpolatedPath:b,usedParams:$}=gv({path:w.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),D=w.id+b+O,A=this.getMatch(D),F=g.get(w.id),W=(A==null?void 0:A._strictParams)??$;let X;if(!A)try{bv(w,W)}catch(H){if(Vt(H)||on(H)?X=H:X=new wP(H.message,{cause:H}),t!=null&&t.throwOnError)throw X}Object.assign(i,W);const te=F?"stay":"enter";let ae;if(A)ae={...A,cause:te,params:(F==null?void 0:F.params)??i,_strictParams:W,search:As(F?F.search:A.search,_),_strictSearch:P};else{const H=w.options.loader||w.options.beforeLoad||w.lazyFn||rx(w)?"pending":"success";ae={id:D,ssr:w.options.ssr,index:v,routeId:w.id,params:(F==null?void 0:F.params)??i,_strictParams:W,pathname:b,updatedAt:Date.now(),search:F?As(F.search,_):_,_strictSearch:P,searchError:void 0,status:H,isFetching:!1,error:void 0,paramsError:X,__routeContext:void 0,_nonReactive:{loadPromise:Go()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:te,loaderDeps:F?Us(F.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:w.options.staticData||{},fullPath:w.fullPath}}t!=null&&t.preload||(ae.globalNotFound=d===w.id),ae.searchError=B;const E=this.getParentContext(x);ae.context={...E,...ae.__routeContext,...ae.__beforeLoadContext},p[v]=ae}for(let v=0;v<p.length;v++){const w=p[v],x=this.looseRoutesById[w.routeId],_=this.getMatch(w.id),P=g.get(w.routeId);if(w.params=P?As(P.params,i):i,!_){const B=p[v-1],k=this.getParentContext(B);if(x.options.context){const O={deps:w.loaderDeps,params:w.params,context:k??{},location:e,navigate:b=>this.navigate({...b,_fromLocation:e}),buildLocation:this.buildLocation,cause:w.cause,abortController:w.abortController,preload:!!w.preload,matches:p,routeId:x.id};w.__routeContext=x.options.context(O)??void 0}w.context={...k,...w.__routeContext,...w.__beforeLoadContext}}}return p}matchRoutesLightweight(e){var g;const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),o=wa(t),i={...e.search};for(const y of t)try{Object.assign(i,Ic(y.options.validateSearch,i))}catch{}const u=wa(this.stores.matchesId.get()),l=u&&((g=this.stores.matchStores.get(u))==null?void 0:g.get()),d=l&&l.routeId===o.id&&l.pathname===e.pathname;let p;if(d)p=l.params;else{const y=Object.assign(Object.create(null),n);for(const m of t)try{bv(m,y)}catch{}p=y}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:p}}},Bc=class extends Error{},wP=class extends Error{};function xP(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ic(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Bc("Async validation not supported");if(n.issues)throw new Bc(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function kP({pathname:e,routesById:t,processedTree:n}){const o=Object.create(null),i=Rr(e);let u;const l=Wb(i,n,!0);return l&&(u=l.route,Object.assign(o,l.rawParams)),{matchedRoutes:(l==null?void 0:l.branch)||[t.__root__],routeParams:o,foundRoute:u}}function _P({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return EP(n)(e,t,o??!1)}function EP(e){var u;let t,n;const o=[];for(const l of e){const d=l.options;if("search"in d)(u=d.search)!=null&&u.middlewares&&o.push(...d.search.middlewares);else if(d.preSearchFilters||d.postSearchFilters){const g=({search:y,next:m})=>{const v=m(d.preSearchFilters?d.preSearchFilters.reduce((w,x)=>x(w),y):y);return d.postSearchFilters?d.postSearchFilters.reduce((w,x)=>x(w),v):v};o.push(g)}const p=d.validateSearch;if(p){const g=({search:y,next:m,meta:v})=>{const w=m(y);if(n)try{const x=Ic(p,w);if(v&&x)for(const _ in x)_ in w||(v.defaulted||(v.defaulted=new Map)).set(_,x[_]);return{...w,...x}}catch{}return w};o.push(g)}}const i=(l,d,p)=>{if(l>=o.length){if(!t.search)return{};if(t.search===!0)return d;const y=Ds(t.search,d);return p&&(p.explicit=y),y}const g=(y,m)=>{if(m){const v=p||{};return{search:i(l+1,y,v),meta:v}}return i(l+1,y,p)};return o[l]({search:d,next:g,meta:p})};return function(d,p,g){return t=p,n=g,i(0,d)}}function CP(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return Vs}function bv(e,t){var o;const n=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(n){const i=n(t);if(i===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,i)}}function bP(){try{return sessionStorage}catch{return}}const PP="tsr-scroll-restoration-v1_3",Ho=bP();function IP(){try{return JSON.parse((Ho==null?void 0:Ho.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function RP(){try{Ho==null||Ho.setItem(PP,JSON.stringify(ts))}catch{}}const ts=IP(),Pv="data-scroll-restoration-id",TP=e=>e.state.__TSR_key||e.href;function MP(e){const t=e.getAttribute(Pv);if(t)return`[${Pv}="${t}"]`;let n="",o=e,i;for(;i=o.parentNode;){let u=1,l=o;for(;l=l.previousElementSibling;)u++;const d=`${o.localName}:nth-child(${u})`;n=n?`${d} > ${n}`:d,o=i}return n}let gc=!1;const zo="window";function qh(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function Iv(e){const t=[];for(const n of e){if(n===zo)continue;const o=qh(n);o&&t.push(o)}return t}function OP(e,t){const n=e.options.scrollRestoration,o=e._scroll;n&&(o.restoring=!0);const i=e.options.getScrollRestorationKey||TP,u=new Map,l=(g,y,m)=>{const v=u.get(g)||{};v.scrollX=y,v.scrollY=m,u.set(g,v)},d=g=>{if(!(gc||!o.restoring))if(g.target===document)l(zo,scrollX,scrollY);else{const y=g.target;l(y,y.scrollLeft,y.scrollTop)}},p=g=>{if(!o.restoring)return;const y=ts[g]||(ts[g]={});for(const[m,v]of u)m===zo?y[zo]=v:m.isConnected&&(y[MP(m)]=v)};n&&!o.restoration&&(o.restoration=!0,gc=!1,history.scrollRestoration="manual",document.addEventListener("scroll",d,!0),e.subscribe("onBeforeLoad",g=>{g.fromLocation&&p(i(g.fromLocation)),u.clear()}),addEventListener("pagehide",()=>{p(i(e.stores.resolvedLocation.get()??e.stores.location.get())),RP()})),!o.reset&&(o.reset=!0,e.subscribe("onRendered",g=>{var P;const y=e.options.scrollRestorationBehavior,m=e.options.scrollToTopSelectors,v=o.next;let w;if(u.clear(),v||(o.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const x=i(g.toLocation),_=g.fromLocation&&i(g.fromLocation);if(o.restoring&&_&&_!==x){const B=ts[_];if(B){let k=ts[x];for(const O in B){if(O===zo){if(v)continue}else{const b=qh(O);if(!b||v&&m&&(w??(w=Iv(m)),w.includes(b)))continue}k||(k=ts[x]={}),k[O]??(k[O]=B[O])}}}gc=!0;try{const B=g.toLocation.hash,k=g.toLocation.state.__hashScrollIntoViewOptions??!0;let O=!1;if(v){const b=Vh.get(g.toLocation),$=B&&k&&(b==="PUSH"||b==="REPLACE"),D=o.restoring?ts[x]:void 0;if(D)for(const A in D){const{scrollX:F,scrollY:W}=D[A];if(A===zo){if($)continue;scrollTo({top:W,left:F,behavior:y}),O=!0}else{const X=qh(A);X&&(X.scrollLeft=F,X.scrollTop=W)}}if(!O&&!B){const A={top:0,left:0,behavior:y};if(scrollTo(A),m){w??(w=Iv(m));for(const F of w)F.scrollTo(A)}}}!O&&B&&k&&((P=document.getElementById(B))==null||P.scrollIntoView(k))}finally{gc=!1}}))}const LP="Error preloading route! ☝️";var ix=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var p,g;this.originalIndex=t.originalIndex;const n=this.options,o=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(g=(p=this.options).getParentRoute)==null?void 0:g.call(p),o?this._path=Vs:this.parentRoute||Mr();let i=o?Vs:n==null?void 0:n.path;i&&i!=="/"&&(i=Xw(i));const u=(n==null?void 0:n.id)||i;let l=o?Vs:bc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,u]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=bc(["/",l]));const d=l==="__root__"?"/":bc([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=d,this._to=Rr(d)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>iP({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},NP=class extends ix{constructor(e){super(e)}};function Dp(e){const t=e.errorComponent??Up;return I.jsx(AP,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?ee.createElement(t,{error:n,reset:o}):e.children})}var AP=class extends ee.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Up({error:e}){const[t,n]=ee.useState(!1);return I.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[I.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[I.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),I.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),I.jsx("div",{style:{height:".25rem"}}),t?I.jsx("div",{children:I.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?I.jsx("code",{children:e.message}):null})}):null]})}function jP({children:e,fallback:t=null}){return ax()?I.jsx(Sa.Fragment,{children:e}):I.jsx(Sa.Fragment,{children:t})}function ax(){return Sa.useSyncExternalStore($P,()=>!0,()=>!1)}function $P(){return()=>{}}var ux=ee.createContext(null);function Cn(e){return ee.useContext(ux)}var gl=ee.createContext(void 0),FP=ee.createContext(void 0),Ge=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Ge||{});function DP({update:e,notify:t,unwatched:n}){return{link:o,unlink:i,propagate:u,checkDirty:l,shallowPropagate:d};function o(g,y,m){const v=y.depsTail;if(v!==void 0&&v.dep===g)return;const w=v!==void 0?v.nextDep:y.deps;if(w!==void 0&&w.dep===g){w.version=m,y.depsTail=w;return}const x=g.subsTail;if(x!==void 0&&x.version===m&&x.sub===y)return;const _=y.depsTail=g.subsTail={version:m,dep:g,sub:y,prevDep:v,nextDep:w,prevSub:x,nextSub:void 0};w!==void 0&&(w.prevDep=_),v!==void 0?v.nextDep=_:y.deps=_,x!==void 0?x.nextSub=_:g.subs=_}function i(g,y=g.sub){const m=g.dep,v=g.prevDep,w=g.nextDep,x=g.nextSub,_=g.prevSub;return w!==void 0?w.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=w:y.deps=w,x!==void 0?x.prevSub=_:m.subsTail=_,_!==void 0?_.nextSub=x:(m.subs=x)===void 0&&n(m),w}function u(g){let y=g.nextSub,m;e:do{const v=g.sub;let w=v.flags;if(w&60?w&12?w&4?!(w&48)&&p(g,v)?(v.flags=w|40,w&=1):w=0:v.flags=w&-9|32:w=0:v.flags=w|32,w&2&&t(v),w&1){const x=v.subs;if(x!==void 0){const _=(g=x).nextSub;_!==void 0&&(m={value:y,prev:m},y=_);continue}}if((g=y)!==void 0){y=g.nextSub;continue}for(;m!==void 0;)if(g=m.value,m=m.prev,g!==void 0){y=g.nextSub;continue e}break}while(!0)}function l(g,y){let m,v=0,w=!1;e:do{const x=g.dep,_=x.flags;if(y.flags&16)w=!0;else if((_&17)===17){if(e(x)){const P=x.subs;P.nextSub!==void 0&&d(P),w=!0}}else if((_&33)===33){(g.nextSub!==void 0||g.prevSub!==void 0)&&(m={value:g,prev:m}),g=x.deps,y=x,++v;continue}if(!w){const P=g.nextDep;if(P!==void 0){g=P;continue}}for(;v--;){const P=y.subs,B=P.nextSub!==void 0;if(B?(g=m.value,m=m.prev):g=P,w){if(e(y)){B&&d(P),y=g.sub;continue}w=!1}else y.flags&=-33;y=g.sub;const k=g.nextDep;if(k!==void 0){g=k;continue e}}return w}while(!0)}function d(g){do{const y=g.sub,m=y.flags;(m&48)===32&&(y.flags=m|16,(m&6)===2&&t(y))}while((g=g.nextSub)!==void 0)}function p(g,y){let m=y.depsTail;for(;m!==void 0;){if(m===g)return!0;m=m.prevDep}return!1}}function UP(e,t,n){var u,l,d;const o=typeof e=="object",i=o?e:void 0;return{next:(u=o?e.next:e)==null?void 0:u.bind(i),error:(l=o?e.error:t)==null?void 0:l.bind(i),complete:(d=o?e.complete:n)==null?void 0:d.bind(i)}}const Wh=[];let Rc=0;const{link:Rv,unlink:zP,propagate:BP,checkDirty:cx,shallowPropagate:Tv}=DP({update(e){return e._update()},notify(e){Wh[Hh++]=e,e.flags&=~Ge.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ge.Mutable|Ge.Dirty,Vc(e))}});let yc=0,Hh=0,ur,Kh=0;function lx(e){try{++Kh,e()}finally{--Kh||fx()}}function Vc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=zP(n,e)}function fx(){if(!(Kh>0)){for(;yc<Hh;){const e=Wh[yc];Wh[yc++]=void 0,e.notify()}yc=0,Hh=0}}function Mv(e,t){const n=typeof e=="function",o=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Ge.None:Ge.Mutable,get(){return ur!==void 0&&Rv(i,ur,Rc),i._snapshot},subscribe(u){const l=UP(u),d={current:!1},p=VP(()=>{var g;i.get(),d.current?(g=l.next)==null||g.call(l,i._snapshot):d.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(u){const l=ur,d=(t==null?void 0:t.compare)??Object.is;if(n)ur=i,++Rc,i.depsTail=void 0;else if(u===void 0)return!1;n&&(i.flags=Ge.Mutable|Ge.RecursedCheck);try{const p=i._snapshot,g=typeof u=="function"?u(p):u===void 0&&n?o(p):u;return p===void 0||!d(p,g)?(i._snapshot=g,!0):!1}finally{ur=l,n&&(i.flags&=~Ge.RecursedCheck),Vc(i)}}};return n?(i.flags=Ge.Mutable|Ge.Dirty,i.get=function(){const u=i.flags;if(u&Ge.Dirty||u&Ge.Pending&&cx(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&Tv(l)}}else u&Ge.Pending&&(i.flags=u&~Ge.Pending);return ur!==void 0&&Rv(i,ur,Rc),i._snapshot}):i.set=function(u){if(i._update(u)){const l=i.subs;l!==void 0&&(BP(l),Tv(l),fx())}},i}function VP(e){const t=()=>{const o=ur;ur=n,++Rc,n.depsTail=void 0,n.flags=Ge.Watching|Ge.RecursedCheck;try{return e()}finally{ur=o,n.flags&=~Ge.RecursedCheck,Vc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ge.Watching|Ge.RecursedCheck,notify(){const o=this.flags;o&Ge.Dirty||o&Ge.Pending&&cx(this.deps,this)?t():this.flags=Ge.Watching},stop(){this.flags=Ge.None,this.depsTail=void 0,Vc(this)}};return t(),n}var rh={exports:{}},sh={},oh={exports:{}},ih={};/**
|
|
43
|
-
* @license React
|
|
44
|
-
* use-sync-external-store-shim.production.js
|
|
45
|
-
*
|
|
46
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
47
|
-
*
|
|
48
|
-
* This source code is licensed under the MIT license found in the
|
|
49
|
-
* LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/var Ov;function qP(){if(Ov)return ih;Ov=1;var e=Fa();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,i=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function d(m,v){var w=v(),x=o({inst:{value:w,getSnapshot:v}}),_=x[0].inst,P=x[1];return u(function(){_.value=w,_.getSnapshot=v,p(_)&&P({inst:_})},[m,w,v]),i(function(){return p(_)&&P({inst:_}),m(function(){p(_)&&P({inst:_})})},[m]),l(w),w}function p(m){var v=m.getSnapshot;m=m.value;try{var w=v();return!n(m,w)}catch{return!0}}function g(m,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:d;return ih.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,ih}var Lv;function WP(){return Lv||(Lv=1,oh.exports=qP()),oh.exports}/**
|
|
51
|
-
* @license React
|
|
52
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
53
|
-
*
|
|
54
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the MIT license found in the
|
|
57
|
-
* LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/var Nv;function HP(){if(Nv)return sh;Nv=1;var e=Fa(),t=WP();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,u=e.useRef,l=e.useEffect,d=e.useMemo,p=e.useDebugValue;return sh.useSyncExternalStoreWithSelector=function(g,y,m,v,w){var x=u(null);if(x.current===null){var _={hasValue:!1,value:null};x.current=_}else _=x.current;x=d(function(){function B(D){if(!k){if(k=!0,O=D,D=v(D),w!==void 0&&_.hasValue){var A=_.value;if(w(A,D))return b=A}return b=D}if(A=b,o(O,D))return A;var F=v(D);return w!==void 0&&w(A,F)?(O=D,A):(O=D,b=F)}var k=!1,O,b,$=m===void 0?null:m;return[function(){return B(y())},$===null?void 0:function(){return B($())}]},[y,m,v,w]);var P=i(g,x[0],x[1]);return l(function(){_.hasValue=!0,_.value=P},[P]),p(P),P},sh}var Av;function KP(){return Av||(Av=1,rh.exports=HP()),rh.exports}var QP=KP();function JP(e,t){return e===t}function Qt(e,t,n=JP){const o=ee.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:d}=e.subscribe(l);return d},[e]),i=ee.useCallback(()=>e==null?void 0:e.get(),[e]);return QP.useSyncExternalStoreWithSelector(o,i,i,t,n)}var ah={get(){},subscribe(){return{unsubscribe(){}}}};function dx(e,t){const n=ee.useRef();return o=>{const i=e!=null&&e.select?e.select(o):o;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=Us(n.current,i):i}}function no(e){const t=Cn(),n=ee.useContext(e.from?FP:gl),o=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=dx(e,t),u=Qt(o??ah,l=>l?i(l):ah);if(u!==ah)return u;(e.shouldThrow??!0)&&Mr()}function hx(e){return no({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function px(e){const{select:t,...n}=e;return no({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function mx(e){return no({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function gx(e){return no({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function yx(e){const t=Cn();return ee.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function vx(e){return no({...e,select:t=>e.select?e.select(t.context):t.context})}var GP=Uw();function YP(e,t){const n=Cn(),o=Nb(t),{activeProps:i,inactiveProps:u,activeOptions:l,to:d,preload:p,preloadDelay:g,preloadIntentProximity:y,hashScrollIntoView:m,replace:v,startTransition:w,resetScroll:x,viewTransition:_,children:P,target:B,disabled:k,style:O,className:b,onClick:$,onBlur:D,onFocus:A,onMouseEnter:F,onMouseLeave:W,onTouchStart:X,ignoreBlocker:te,params:ae,search:E,hash:H,state:Z,mask:Y,reloadDocument:z,unsafeRelative:G,from:re,_fromLocation:V,...R}=e,J=ax(),he=ee.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),de=Qt(n.stores.location,Fe=>Fe,(Fe,Ot)=>Fe.href===Ot.href),ce=ee.useMemo(()=>{const Fe={_fromLocation:de,...he};return n.buildLocation(Fe)},[n,de,he]),_e=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,Oe=ce.maskedLocation?ce.maskedLocation.external:ce.external,ke=ee.useMemo(()=>rI(_e,Oe,n.history,k),[k,Oe,_e,n.history]),Pe=ee.useMemo(()=>{if(ke!=null&&ke.external)return Uc(ke.href,n.protocolAllowlist)?void 0:ke.href;if(!sI(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),Uc(d,n.protocolAllowlist)?void 0:d}catch{}},[d,ke,n.protocolAllowlist]),ut=ee.useMemo(()=>{if(Pe)return!1;if(l!=null&&l.exact){if(!Yb(de.pathname,ce.pathname,n.basepath))return!1}else{const Fe=zc(de.pathname,n.basepath),Ot=zc(ce.pathname,n.basepath);if(!(Fe.startsWith(Ot)&&(Fe.length===Ot.length||Fe[Ot.length]==="/")))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!Bs(de.search,ce.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndefined)})?!1:l!=null&&l.includeHash?J&&de.hash===ce.hash:!0},[l==null?void 0:l.exact,l==null?void 0:l.explicitUndefined,l==null?void 0:l.includeHash,l==null?void 0:l.includeSearch,de,Pe,J,ce.hash,ce.pathname,ce.search,n.basepath]),vr=ut?Ds(i,{})??XP:uh,Ss=ut?uh:Ds(u,{})??uh,ws=[b,vr.className,Ss.className].filter(Boolean).join(" "),co=(O||vr.style||Ss.style)&&{...O,...vr.style,...Ss.style},[su,pi]=ee.useState(!1),lo=ee.useRef(!1),Sr=e.reloadDocument||Pe?!1:p??n.options.defaultPreload,xs=g??n.options.defaultPreloadDelay??0,hn=ee.useCallback(()=>{n.preloadRoute({...he,_builtLocation:ce}).catch(Fe=>{console.warn(Fe),console.warn(LP)})},[n,he,ce]);Lb(o,ee.useCallback(Fe=>{Fe!=null&&Fe.isIntersecting&&hn()},[hn]),nI,{disabled:!!k||Sr!=="viewport"}),ee.useEffect(()=>{lo.current||!k&&Sr==="render"&&(hn(),lo.current=!0)},[k,hn,Sr]);const Ar=Fe=>{const Ot=Fe.currentTarget.getAttribute("target"),Un=B!==void 0?B:Ot;if(!k&&!oI(Fe)&&!Fe.defaultPrevented&&(!Un||Un==="_self")&&Fe.button===0){Fe.preventDefault(),GP.flushSync(()=>{pi(!0)});const ho=n.subscribe("onResolved",()=>{ho(),pi(!1)});n.navigate({...he,replace:v,resetScroll:x,hashScrollIntoView:m,startTransition:w,viewTransition:_,ignoreBlocker:te})}};if(Pe)return{...R,ref:o,href:Pe,...P&&{children:P},...B&&{target:B},...k&&{disabled:k},...O&&{style:O},...b&&{className:b},...$&&{onClick:$},...D&&{onBlur:D},...A&&{onFocus:A},...F&&{onMouseEnter:F},...W&&{onMouseLeave:W},...X&&{onTouchStart:X}};const fo=Fe=>{if(k||Sr!=="intent")return;if(!xs){hn();return}const Ot=Fe.currentTarget;if(ra.has(Ot))return;const Un=setTimeout(()=>{ra.delete(Ot),hn()},xs);ra.set(Ot,Un)},ou=Fe=>{k||Sr!=="intent"||hn()},mi=Fe=>{if(k||!Sr||!xs)return;const Ot=Fe.currentTarget,Un=ra.get(Ot);Un&&(clearTimeout(Un),ra.delete(Ot))};return{...R,...vr,...Ss,href:ke==null?void 0:ke.href,ref:o,onClick:Fo([$,Ar]),onBlur:Fo([D,mi]),onFocus:Fo([A,fo]),onMouseEnter:Fo([F,fo]),onMouseLeave:Fo([W,mi]),onTouchStart:Fo([X,ou]),disabled:!!k,target:B,...co&&{style:co},...ws&&{className:ws},...k&&ZP,...ut&&eI,...J&&su&&tI}}var uh={},XP={className:"active"},ZP={role:"link","aria-disabled":!0},eI={"data-status":"active","aria-current":"page"},tI={"data-transitioning":"transitioning"},ra=new WeakMap,nI={rootMargin:"100px"},Fo=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function rI(e,t,n,o){if(!o)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function sI(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var zp=ee.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:i,...u}=YP(o,t),l=typeof o.children=="function"?o.children({isActive:u["data-status"]==="active"}):o.children;if(!n){const{disabled:d,...p}=u;return ee.createElement("a",p,l)}return ee.createElement(n,u,l)});function oI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var iI=class extends ix{constructor(e){super(e),this.useMatch=t=>no({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>vx({...t,from:this.id}),this.useSearch=t=>gx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>mx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>px({...t,from:this.id}),this.useLoaderData=t=>hx({...t,from:this.id}),this.useNavigate=()=>yx({from:this.fullPath}),this.Link=Sa.forwardRef((t,n)=>I.jsx(zp,{ref:n,from:this.fullPath,...t}))}};function Sx(e){return new iI(e)}var aI=class extends NP{constructor(e){super(e),this.useMatch=t=>no({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>vx({...t,from:this.id}),this.useSearch=t=>gx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>mx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>px({...t,from:this.id}),this.useLoaderData=t=>hx({...t,from:this.id}),this.useNavigate=()=>yx({from:this.fullPath}),this.Link=Sa.forwardRef((t,n)=>I.jsx(zp,{ref:n,from:this.fullPath,...t}))}};function uI(e){return new aI(e)}function cI(e){const t=Cn(),n=`not-found-${Qt(t.stores.location,o=>o.pathname)}-${Qt(t.stores.status,o=>o)}`;return I.jsx(Dp,{getResetKey:()=>n,onCatch:(o,i)=>{var u;if(Vt(o))(u=e.onCatch)==null||u.call(e,o,i);else throw o},errorComponent:({error:o})=>{var i;if(Vt(o))return(i=e.fallback)==null?void 0:i.call(e,o);throw o},children:e.children})}function lI(){return I.jsx("p",{children:"Not Found"})}function Bo(e){return I.jsx(I.Fragment,{children:e.children})}function wx(e,t,n){return t.options.notFoundComponent?I.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?I.jsx(e.options.defaultNotFoundComponent,{...n}):I.jsx(lI,{})}function fI(e){return null}function dI(){return fI(Cn()),null}var hI=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,pI=(e,t)=>e[0]===t[0]&&e[1]===t[1],xx=ee.memo(function({matchId:t}){const n=Cn(),o=n.stores.matchStores.get(t);o||Mr();const i=Qt(n.stores.loadedAt,l=>l),u=Qt(o,l=>l,hI);return I.jsx(mI,{router:n,matchId:t,resetKey:i,matchState:ee.useMemo(()=>{var p;const l=u.routeId,d=(p=n.routesById[l].parentRoute)==null?void 0:p.id;return{routeId:l,ssr:u.ssr,_displayPending:u._displayPending,parentRouteId:d}},[u._displayPending,u.routeId,u.ssr,n.routesById])})});function mI({router:e,matchId:t,resetKey:n,matchState:o}){var x,_;const i=e.routesById[o.routeId],u=i.options.pendingComponent??e.options.defaultPendingComponent,l=u?I.jsx(u,{}):null,d=i.options.errorComponent??e.options.defaultErrorComponent,p=i.options.onCatch??e.options.defaultOnCatch,g=i.isRoot?i.options.notFoundComponent??((x=e.options.notFoundRoute)==null?void 0:x.options.component):i.options.notFoundComponent,y=o.ssr===!1||o.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??u??(((_=i.options.errorComponent)==null?void 0:_.preload)||y))?ee.Suspense:Bo,v=d?Dp:Bo,w=g?cI:Bo;return I.jsxs(i.isRoot?i.options.shellComponent??Bo:Bo,{children:[I.jsx(gl.Provider,{value:t,children:I.jsx(m,{fallback:l,children:I.jsx(v,{getResetKey:()=>n,errorComponent:d||Up,onCatch:(P,B)=>{if(Vt(P))throw P.routeId??(P.routeId=o.routeId),P;p==null||p(P,B)},children:I.jsx(w,{fallback:P=>{if(P.routeId??(P.routeId=o.routeId),!g||P.routeId&&P.routeId!==o.routeId||!P.routeId&&!i.isRoot)throw P;return ee.createElement(g,P)},children:y||o._displayPending?I.jsx(jP,{fallback:l,children:I.jsx(jv,{matchId:t})}):I.jsx(jv,{matchId:t})})})})}),o.parentRouteId===Vs?I.jsxs(I.Fragment,{children:[I.jsx(gI,{}),e.options.scrollRestoration&&Ww?I.jsx(dI,{}):null]}):null]})}function gI(){const e=Cn(),t=ee.useRef();return ia(()=>{const n=e.stores.resolvedLocation.get(),o=t.current;n&&(!o||o.href!==n.href)&&e.emit({type:"onRendered",...Wo(e.stores.location.get(),o??n)}),t.current=n},[Qt(e.stores.resolvedLocation,n=>n==null?void 0:n.state.__TSR_key),e]),null}var jv=ee.memo(function({matchId:t}){const n=Cn(),o=(y,m)=>{var v;return((v=n.getMatch(y.id))==null?void 0:v._nonReactive[m])??y._nonReactive[m]},i=n.stores.matchStores.get(t);i||Mr();const u=Qt(i,y=>y),l=u.routeId,d=n.routesById[l],p=ee.useMemo(()=>{var m;const y=(m=n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:m({routeId:l,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return y?JSON.stringify(y):void 0},[l,u.loaderDeps,u._strictParams,u._strictSearch,n.options.defaultRemountDeps,n.routesById]),g=ee.useMemo(()=>{const y=d.options.component??n.options.defaultComponent;return y?I.jsx(y,{},p):I.jsx(kx,{})},[p,d.options.component,n.options.defaultComponent]);if(u._displayPending)throw o(u,"displayPendingPromise");if(u._forcePending)throw o(u,"minPendingPromise");if(u.status==="pending"){const y=d.options.pendingMinMs??n.options.defaultPendingMinMs;if(y){const m=n.getMatch(u.id);if(m&&!m._nonReactive.minPendingPromise){const v=Go();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},y)}}throw o(u,"loadPromise")}if(u.status==="notFound")return Vt(u.error)||Mr(),wx(n,d,u.error);if(u.status==="redirected")throw on(u.error)||Mr(),o(u,"loadPromise");if(u.status==="error")throw u.error;return g}),kx=ee.memo(function(){const t=Cn(),n=ee.useContext(gl);let o,i=!1,u;{const g=n?t.stores.matchStores.get(n):void 0;[o,i]=Qt(g,y=>[y==null?void 0:y.routeId,(y==null?void 0:y.globalNotFound)??!1],pI),u=Qt(t.stores.matchesId,y=>y[y.findIndex(m=>m===n)+1])}const l=o?t.routesById[o]:void 0,d=t.options.defaultPendingComponent?I.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||Mr(),wx(t,l,void 0);if(!u)return null;const p=I.jsx(xx,{matchId:u});return o===Vs?I.jsx(ee.Suspense,{fallback:d,children:p}):p});function yI(){const e=Cn(),t=ee.useRef({router:e,mounted:!1}),[n,o]=ee.useState(!1),i=Qt(e.stores.isLoading,m=>m),u=Qt(e.stores.hasPending,m=>m),l=Gd(i),d=i||n||u,p=Gd(d),g=i||u,y=Gd(g);return e.startTransition=m=>{o(!0),ee.startTransition(()=>{m(),o(!1)})},ee.useEffect(()=>{const m=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Rr(e.latestLocation.publicHref)!==Rr(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{m()}},[e,e.history]),ia(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),ia(()=>{l&&!i&&e.emit({type:"onLoad",...Wo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),ia(()=>{y&&!g&&e.emit({type:"onBeforeRouteMount",...Wo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[g,y,e]),ia(()=>{if(p&&!d){const m=Wo(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...m}),lx(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[d,p,e]),null}function vI(){const e=Cn(),t=e.routesById[Vs].options.pendingComponent??e.options.defaultPendingComponent,n=t?I.jsx(t,{}):null,o=I.jsxs(typeof document<"u"&&e.ssr?Bo:ee.Suspense,{fallback:n,children:[I.jsx(yI,{}),I.jsx(SI,{})]});return e.options.InnerWrap?I.jsx(e.options.InnerWrap,{children:o}):o}function SI(){const e=Cn(),t=Qt(e.stores.firstId,i=>i),n=Qt(e.stores.loadedAt,i=>i),o=t?I.jsx(xx,{matchId:t}):null;return I.jsx(gl.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:I.jsx(Dp,{getResetKey:()=>n,errorComponent:Up,onCatch:void 0,children:o})})}var wI=e=>({createMutableStore:Mv,createReadonlyStore:Mv,batch:lx}),xI=e=>new kI(e),kI=class extends SP{constructor(e){super(e,wI)}};function _I({router:e,children:t,...n}){Kw(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=I.jsx(ux.Provider,{value:e,children:t});return e.options.Wrap?I.jsx(e.options.Wrap,{children:o}):o}function EI({router:e,...t}){return I.jsx(_I,{router:e,...t,children:I.jsx(vI,{})})}function CI(e){const t=Cn({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t;return Qt(n.stores.__store,dx(e,n))}const yl=["claude","codex","cursor","copilot","pi","opencode","antigravity","gemini","grok"],Qn={revision:0,interval:2,billingInterval:5,clearScreen:!0,privacyMode:!0,privacyToggleKey:"p",timezone:null,accounts:[],activeAccountId:null,disabledProviders:[],onboarded:!1,dashboardLayout:"grid",defaultFocus:"all",ascii:"auto",allowNetworkAccess:!1,allowedHosts:[],resetDisplay:"relative",knownProviders:[]},bI=["claude","codex","cursor"],ch=["cyan","magenta","green","yellow","blue","red"],$v=[...yl],MF=["cyan","magenta","green","yellow","blue","red","cyanBright","magentaBright","greenBright"],lh={claude:{name:"Claude",color:"green"},codex:{name:"Codex",color:"cyan"},cursor:{name:"Cursor",color:"magenta"},copilot:{name:"Copilot",color:"white"},pi:{name:"Pi",color:"blue"},opencode:{name:"opencode",color:"yellow"},antigravity:{name:"Antigravity",color:"red"},gemini:{name:"Gemini",color:"greenBright"},grok:{name:"Grok",color:"yellowBright"}},PI=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i,II=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi;function RI(e){return typeof e=="string"&&PI.test(e)}function _x(e){return e.replace(II,"[redacted]")}function OF(e,t=$v.filter(o=>!e.disabledProviders.includes(o)),n){const o=new Set(t),i=new Set,u=new Set,l=new Set,d=new Set,p=[],g=(m,v)=>`${m}:${v&&v!=="~"?v:"~"}`,y=m=>{l.add(m.id),d.add(g(m.providerId,m.homeDir)),p.push(m)};if(e.accounts.forEach((m,v)=>{const w=lh[m.providerId];i.add(m.id),u.add(g(m.providerId,m.homeDir)),y({id:m.id,providerId:m.providerId,name:m.name,homeDir:m.homeDir||"~",color:m.color||w.color,source:"configured",explicitId:m.id,explicitIndex:v})}),n)for(const m of n){if(e.disabledProviders.includes(m.providerId))continue;const v=g(m.providerId,m.homeDir);if(i.has(m.id)||u.has(v)||l.has(m.id)||d.has(v))continue;const w=lh[m.providerId];y({id:m.id,providerId:m.providerId,name:m.name,homeDir:m.homeDir||"~",color:m.color||w.color,source:"auto"})}for(const m of $v){if(e.disabledProviders.includes(m)||!o.has(m))continue;const v=g(m,"~");if(i.has(m)||u.has(v)||l.has(m)||d.has(v))continue;const w=lh[m];y({id:m,providerId:m,name:w.name,homeDir:"~",color:w.color,source:"auto"})}return p}function Fv(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=n?e:t}function TI(e){try{return new Intl.DateTimeFormat("en-CA",{timeZone:e}),!0}catch{return!1}}function Dv(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function fh(e){return yl.includes(e)}function Uv(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function MI(e){if(typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const n=new URL(`http://${t}`);if(n.username||n.password||n.port||n.pathname!=="/"||n.search||n.hash)return null;const o=n.hostname.toLowerCase().replace(/\.$/,"");return!o||o.length>253||o.includes("*")||o.split(".").some(u=>!u||u.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(u))?null:o}catch{return null}}function OI(e){if(!Array.isArray(e))return[];const t=e.map(MI).filter(n=>n!==null);return[...new Set(t)]}function Bp(e){const t=[],n=Dv(e)?e:{};n!==e&&t.push("config root was not an object");const o=Array.isArray(n.accounts)?n.accounts:[];!Array.isArray(n.accounts)&&n.accounts!==void 0&&t.push("accounts was not an array");const i=[],u=new Set;o.forEach((v,w)=>{if(!Dv(v)){t.push(`accounts[${w}] was not an object`);return}const x=v.providerId??"claude";if(!fh(x)){t.push(`accounts[${w}].providerId was invalid`);return}const _=typeof v.id=="string"&&v.id.trim()?v.id.trim():"",P=typeof v.name=="string"&&v.name.trim()?v.name.trim():"";if(!_||!P){t.push(`accounts[${w}] was missing id or name`);return}if(u.has(_)){t.push(`accounts[${w}].id was duplicated`);return}u.add(_),i.push({id:_,providerId:x,name:P,homeDir:typeof v.homeDir=="string"&&v.homeDir.trim()?v.homeDir:"~",...typeof v.color=="string"&&v.color.trim()?{color:v.color}:{}})});const l=(Array.isArray(n.disabledProviders)?n.disabledProviders:[]).filter(fh);n.disabledProviders!==void 0&&!Array.isArray(n.disabledProviders)&&t.push("disabledProviders was not an array");const d=Array.isArray(n.knownProviders)?n.knownProviders.filter(fh):n.onboarded===!0?[...bI]:[];n.knownProviders!==void 0&&!Array.isArray(n.knownProviders)&&t.push("knownProviders was not an array");const p=OI(n.allowedHosts);n.allowedHosts!==void 0&&!Uv(n.allowedHosts,p)&&t.push("allowedHosts contained invalid or duplicate hostnames");const g=typeof n.activeAccountId=="string"&&(u.has(n.activeAccountId)||yl.includes(n.activeAccountId))?n.activeAccountId:null;n.activeAccountId!==void 0&&n.activeAccountId!==null&&g===null&&t.push("activeAccountId did not match a known account/provider");const y=typeof n.timezone=="string"&&n.timezone.trim()&&TI(n.timezone.trim())?n.timezone.trim():null;n.timezone!==void 0&&n.timezone!==null&&y===null&&t.push("timezone was invalid");const m={...Qn,revision:typeof n.revision=="number"&&Number.isSafeInteger(n.revision)&&n.revision>=0?n.revision:Qn.revision,interval:Fv(n.interval,Qn.interval,1),billingInterval:Fv(n.billingInterval,Qn.billingInterval,1),clearScreen:typeof n.clearScreen=="boolean"?n.clearScreen:Qn.clearScreen,privacyMode:typeof n.privacyMode=="boolean"?n.privacyMode:Qn.privacyMode,privacyToggleKey:typeof n.privacyToggleKey=="string"&&n.privacyToggleKey.length===1?n.privacyToggleKey:Qn.privacyToggleKey,timezone:y,accounts:i,activeAccountId:g,disabledProviders:l,onboarded:n.onboarded===!0,dashboardLayout:n.dashboardLayout==="single"?"single":"grid",defaultFocus:n.defaultFocus==="last"?"last":"all",ascii:n.ascii==="on"?"on":n.ascii==="off"?"off":"auto",allowNetworkAccess:n.allowNetworkAccess===!0,allowedHosts:p,resetDisplay:n.resetDisplay==="absolute"?"absolute":"relative",knownProviders:d};for(const v of Object.keys(Qn))v in n||t.push(`missing ${v}`);return{config:m,repaired:t.length>0||!Uv(n,m),reasons:t}}function LI(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48)}function LF(e,t){const n=LI(e)||"account",o=new Set(t.map(i=>i.id));if(!o.has(n))return n;for(let i=2;i<1e3;i++){const u=`${n}_${i}`;if(!o.has(u))return u}return`${n}_${Date.now()}`}function NF(e){const t=new Set(e.map(n=>n.color).filter(Boolean));for(const n of ch)if(!t.has(n))return n;return ch[e.length%ch.length]}function AF(e){return e?e.replace(/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,"").replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1bO./g,"").replace(/\x1b/g,"").replace(/[\x00-\x1f\x7f-\x9f]/g,"").replace(/\[20[01]~/g,""):""}const Ca="#8d9090",sn={green:"#6caa71",greenBright:"#79be7e",cyan:"#7ccbcd",cyanBright:"#84dde0",blue:"#6d96b4",blueBright:"#67b5ed",magenta:"#bd7bcd",magentaBright:"#d389e5",yellow:"#c4ac62",yellowBright:"#d9c074",red:"#b45648",redBright:"#cf6a5a",white:"#dee5eb",whiteBright:"#f3f5f5",gray:Ca,grey:Ca},NI={claude:sn.green,codex:sn.cyan,cursor:sn.magenta,copilot:sn.white,pi:sn.blue,opencode:sn.yellow,antigravity:sn.red,gemini:sn.greenBright,grok:sn.yellowBright};function AI(e){return e?e.startsWith("#")?e:sn[e]??Ca:Ca}const jF=AI;function $F(e){return NI[e]??Ca}const zv=["#00d7ff","#00d787","#e6b450","#d75f87","#5f87ff","#af87ff","#5fd7a7","#ff8787","#d7af5f","#87d7ff","#d787d7","#9ee493","#ffb454","#7aa2f7","#bb9af7"],Bv=new Map;function jI(e){const t=Bv.get(e);if(t)return t;let n=0;for(let i=0;i<e.length;i++)n=n*31+e.charCodeAt(i)>>>0;const o=zv[n%zv.length];return Bv.set(e,o),o}const FF={input:sn.blue,output:sn.green,cacheCreate:sn.yellow,cacheRead:sn.cyan};function Vv(e){return e.replace(/^claude-/,"").replace(/^gpt-/,"gpt-").replace(/-\d{8}$/,"").replace(/-latest$/,"")}const qv=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function DF(e,t={}){if(!Number.isFinite(e))return"$0.00";const n=t.sign&&e>0?"+":"",o=Math.abs(e);return o>=1e5?`${n}$${(e/1e3).toFixed(0)}k`:o>=1e4?`${n}$${(e/1e3).toFixed(1)}k`:o>=1?`${n}$${e.toFixed(2)}`:o>=.01?`${n}$${e.toFixed(3)}`:o===0?"$0.00":`${n}$${e.toFixed(4)}`}function UF(e){if(!Number.isFinite(e))return"$0";const t=Math.abs(e);return t>=1e6?`$${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:t>=1e3?`$${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:t>=1?`$${Math.round(e)}`:t===0?"$0":`$${e.toFixed(2)}`}function zF(e){if(!Number.isFinite(e)||e===0)return"0";const t=Math.abs(e);return t>=1e9?`${(e/1e9).toFixed(2)}B`:t>=1e6?`${(e/1e6).toFixed(2)}M`:t>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function BF(e){return Number.isFinite(e)?Math.round(e).toLocaleString("en-US"):"0"}function VF(e){if(!Number.isFinite(e))return"0";const t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(1)}M`:t>=1e4?`${Math.round(e/1e3)}k`:Math.round(e).toLocaleString("en-US")}function qF(e,t=0){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"0%"}function $I(e,t){const n=Math.max(0,Math.round((t-e)/1e3));if(n<2)return"just now";if(n<60)return`${n}s ago`;const o=Math.round(n/60);if(o<60)return`${o}m ago`;const i=Math.round(o/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function WF(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(t)return`${qv[Number(t[2])-1]} ${Number(t[3])}`;const n=/^(\d{4})-(\d{2})$/.exec(e);return n?`${qv[Number(n[2])-1]} ${n[1]}`:e}function FI(e,t=Date.now()){const n=new Date(e).getTime()-t;if(!Number.isFinite(n)||n<=0)return"now";const o=Math.round(n/6e4);if(o<60)return`${o}m`;const i=Math.floor(o/60),u=o%60;if(i<24)return`${i}h ${u}m`;const l=Math.floor(i/24),d=i%24;return`${l}d ${d}h`}function DI(e,t,n=Date.now(),o){const i=Date.parse(e);return Number.isFinite(i)?t==="relative"?FI(e,n):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:o}).format(new Date(i)):e}function Ex(e){return e.input+e.output+e.cacheCreate+e.cacheRead}const Vp=864e5,HF=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qp=e=>{const[t,n,o]=e.split("-").map(Number);return Date.UTC(t,(n||1)-1,o||1)},Wp=e=>new Date(e).toISOString().slice(0,10),UI=e=>{try{return new Intl.DateTimeFormat("en-CA",{timeZone:e||void 0,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}catch{return new Date().toISOString().slice(0,10)}},zI=e=>(new Date(e).getUTCDay()+6)%7,KF=e=>{const t=qp(e);return Wp(t-zI(t)*Vp)},BI={period:"all"},Cx=[{key:"7d",label:"7 days"},{key:"30d",label:"30 days"},{key:"90d",label:"90 days"},{key:"mtd",label:"month"},{key:"all",label:"6 months"}];function bx(e){return e.providers.length?new Set(e.providers):null}function VI(e,t){const n=bx(t);return e.accounts.filter(o=>!(!o.hasUsage||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function Qh(e){var t,n,o,i,u,l,d,p,g;return!!(e.hasBilling&&((n=(t=e.billing)==null?void 0:t.metrics)!=null&&n.length||(o=e.billing)!=null&&o.plan||(i=e.billing)!=null&&i.error||(d=(l=(u=e.billing)==null?void 0:u.activity)==null?void 0:l.series)!=null&&d.length||(g=(p=e.billing)==null?void 0:p.modelSpend)!=null&&g.length))}function qI(e,t){const n=bx(t);return e.accounts.filter(o=>!(!o.hasUsage&&!Qh(o)||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function WI(e){var n;let t=null;for(const o of e)for(const i of((n=o.table)==null?void 0:n.daily)??[])(!t||i.label>t)&&(t=i.label);return t}function Px(e,t,n){if(!t||e==="all")return null;if(e==="mtd")return UI(n).slice(0,7)+"-01";const o=e==="7d"?7:e==="90d"?90:30;return Wp(qp(t)-(o-1)*Vp)}function QF(e,t,n,o){if(!n||e==="all")return null;const i=Px(e,n,o);if(t==="daily")return i;const u=t==="monthly"?365:84,l=Wp(qp(n)-(u-1)*Vp);return i&&i<l?i:l}const HI=()=>({cost:0,tokens:0,cacheSavings:0,calls:0}),KI=(e,t,n,o,i)=>{e.cost+=t,e.tokens+=n,e.cacheSavings+=o,e.calls+=i};function QI(){return{totals:HI(),burnRate:0,timelineMap:new Map,cacheByDay:new Map,provAgg:new Map,modelAgg:new Map,modelTrend:new Map,modelOptionSet:new Set,tokenComposition:{input:0,output:0,cacheCreate:0,cacheRead:0}}}function JI(e,t,n,o,i){let u=0,l=0,d=0,p=0;for(const m of t.breakdown){if(e.modelOptionSet.add(m.name),i&&!i.has(m.name))continue;const v=Ex(m);u+=m.cost,l+=v,d+=m.cacheSavings,p+=m.count,e.tokenComposition.input+=m.input,e.tokenComposition.output+=m.output,e.tokenComposition.cacheCreate+=m.cacheCreate,e.tokenComposition.cacheRead+=m.cacheRead;const w=e.modelAgg.get(m.name)??{cost:0,tokens:0,cacheSavings:0,calls:0};w.cost+=m.cost,w.tokens+=v,w.cacheSavings+=m.cacheSavings,w.calls+=m.count,e.modelAgg.set(m.name,w);let x=e.modelTrend.get(m.name);x||(x=new Map,e.modelTrend.set(m.name,x)),x.set(t.label,(x.get(t.label)??0)+m.cost)}if(i&&p===0&&u===0)return;KI(e.totals,u,l,d,p);const g=e.timelineMap.get(t.label)??{date:t.label,total:0,tokens:0,byProvider:{}};g.total+=u,g.tokens+=l,g.byProvider[n]=(g.byProvider[n]??0)+u,e.timelineMap.set(t.label,g),e.cacheByDay.set(t.label,(e.cacheByDay.get(t.label)??0)+d);const y=e.provAgg.get(n)??{id:n,name:n,color:o,cost:0,tokens:0,calls:0};y.cost+=u,y.tokens+=l,y.calls+=p,e.provAgg.set(n,y)}function GI(e){return[...e.timelineMap.values()].sort((t,n)=>t.date.localeCompare(n.date))}function YI(e,t,n){const o=t.map(i=>i.date);return[...e.modelAgg.entries()].map(([i,u])=>{const l=e.modelTrend.get(i);return{model:i,color:jI(i),cost:u.cost,tokens:u.tokens,cacheSavings:u.cacheSavings,calls:u.calls,share:n>0?u.cost/n:0,tokenShare:e.totals.tokens>0?u.tokens/e.totals.tokens:0,callShare:e.totals.calls>0?u.calls/e.totals.calls:0,trend:o.map(d=>(l==null?void 0:l.get(d))??0)}}).sort((i,u)=>u.cost-i.cost)}function XI(e,t){var k,O,b;const n=e?VI(e,t):[],o=WI(n),i=Px(t.period,o,(e==null?void 0:e.tz)??""),u=t.models.length?new Set(t.models):null,l=new Map,d=new Map;for(const $ of(e==null?void 0:e.providers)??[])l.set($.id,$.color),d.set($.id,$.name);const p=QI(),g=$=>!i||$>=i;for(const $ of n){p.burnRate+=((k=$.dashboard)==null?void 0:k.burnRate)??0;const D=$.providerId,A=l.get(D)??$.color;for(const F of((O=$.table)==null?void 0:O.daily)??[])g(F.label)&&JI(p,F,D,A,u)}for(const $ of p.provAgg.values()){const D=d.get($.id);D&&($.name=D)}const y=GI(p);let m=0;const v=y.map($=>(m+=$.total,{date:$.date,total:m})),w=y.map($=>({date:$.date,value:p.cacheByDay.get($.date)??0})),x=new Map;for(const $ of n)for(const D of((b=$.table)==null?void 0:b.daily)??[]){if(!g(D.label))continue;const A=u?D.breakdown.filter(W=>u.has(W.name)):D.breakdown;if(u&&A.length===0)continue;let F=x.get(D.label);F||(F={tokens:0,calls:0,cacheSavings:0,models:new Map},x.set(D.label,F));for(const W of A)F.tokens+=Ex(W),F.calls+=W.count,F.cacheSavings+=W.cacheSavings,F.models.set(W.name,(F.models.get(W.name)??0)+W.cost)}const _=y.map($=>{const D=x.get($.date);return{date:$.date,cost:$.total,tokens:(D==null?void 0:D.tokens)??0,calls:(D==null?void 0:D.calls)??0,cacheSavings:(D==null?void 0:D.cacheSavings)??0,models:D?[...D.models.entries()].map(([A,F])=>({name:A,cost:F})).sort((A,F)=>F.cost-A.cost):[]}}),P=[...p.provAgg.values()].sort(($,D)=>D.cost-$.cost),B=YI(p,y,p.totals.cost);return{filteredAccounts:n,totals:p.totals,burnRate:p.burnRate,timeline:y,cumulative:v,cacheSavingsSeries:w,calendar:_,cardAccounts:e?qI(e,t):[],byProvider:P,byModel:B,tokenComposition:p.tokenComposition,modelOptions:[...p.modelOptionSet].sort(),latestDay:o,rangeStart:i}}function jt({children:e,className:t="size-4",...n}){return I.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":!0,...n,children:e})}const JF=e=>I.jsxs(jt,{...e,children:[I.jsx("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),I.jsx("circle",{cx:"12",cy:"13",r:"4"})]}),GF=e=>I.jsx(jt,{...e,children:I.jsx("path",{d:"M20 6 9 17l-5-5"})}),YF=e=>I.jsxs(jt,{...e,children:[I.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),I.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),XF=e=>I.jsxs(jt,{...e,children:[I.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),I.jsx("path",{d:"m7 10 5 5 5-5"}),I.jsx("path",{d:"M12 15V3"})]}),ZF=e=>I.jsx(jt,{...e,children:I.jsx("path",{d:"M3 6.5A2.5 2.5 0 0 1 5.5 4H9l2 2h7.5A2.5 2.5 0 0 1 21 8.5v8A2.5 2.5 0 0 1 18.5 19h-13A2.5 2.5 0 0 1 3 16.5z"})}),ZI=e=>I.jsxs(jt,{...e,children:[I.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),I.jsx("path",{d:"m16 6-4-4-4 4"}),I.jsx("path",{d:"M12 2v13"})]}),eR=e=>I.jsx(jt,{...e,children:I.jsx("path",{d:"m6 9 6 6 6-6"})}),e4=e=>I.jsxs(jt,{...e,children:[I.jsx("circle",{cx:"11",cy:"11",r:"8"}),I.jsx("path",{d:"m21 21-4.3-4.3"})]}),tR=e=>I.jsxs(jt,{...e,children:[I.jsx("path",{d:"M18 6 6 18"}),I.jsx("path",{d:"m6 6 12 12"})]}),nR=e=>I.jsxs(jt,{...e,children:[I.jsx("circle",{cx:"12",cy:"12",r:"4"}),I.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),rR=e=>I.jsx(jt,{...e,children:I.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"})}),sR=e=>I.jsxs(jt,{...e,children:[I.jsx("circle",{cx:"12",cy:"12",r:"3"}),I.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),oR=e=>I.jsxs(jt,{...e,children:[I.jsx("path",{d:"M20 6v5h-5"}),I.jsx("path",{d:"M4 18v-5h5"}),I.jsx("path",{d:"M18.7 9A7 7 0 0 0 6.3 6.3L4 8"}),I.jsx("path",{d:"M5.3 15A7 7 0 0 0 17.7 17.7L20 16"})]}),t4=e=>I.jsx(jt,{...e,children:I.jsx("path",{d:"M12 5v14M5 12h14"})}),n4=e=>I.jsx(jt,{...e,children:I.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"})}),r4=e=>I.jsxs(jt,{...e,children:[I.jsx("path",{d:"M12 20h9"}),I.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]}),s4=e=>I.jsx(jt,{...e,children:I.jsx("path",{d:"m18 15-6-6-6 6"})});function iR(e,t){return t?_x(e):e}function Wv({value:e,privacyMode:t,className:n,title:o}){const[i,u]=ee.useState(!1);return!(t&&RI(e))||i?I.jsx("span",{className:n,title:o??e,children:e}):I.jsx("button",{type:"button",onClick:()=>u(!0),className:`min-w-0 cursor-pointer truncate rounded text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent ${n??""}`,title:"Click to reveal email","aria-label":"Email hidden. Click to reveal.",children:I.jsx("span",{className:"inline-block max-w-full truncate blur-sm transition hover:blur-[2px]",children:_x(e)})})}const Hp="focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent";function aR({options:e,value:t,onChange:n,size:o="sm",btnClassName:i,containerClassName:u,ariaLabel:l}){const d="flex items-center overflow-hidden rounded border border-line",p=o==="xs"?"px-1.5 py-0.5 text-[10px] transition max-sm:py-1.5":"px-2 py-1 text-xs transition max-sm:py-2",g=o==="xs"?"bg-bg-3 text-accent":"bg-bg-2 text-accent",y=o==="xs"?"text-fg-faint hover:text-fg":"text-fg-dim hover:text-fg";return I.jsx("div",{className:u??d,role:"group","aria-label":l,children:e.map(m=>I.jsx("button",{type:"button","aria-pressed":t===m.value,onClick:()=>n(m.value),className:`${i??p} ${Hp} ${t===m.value?g:y}`,children:m.label},String(m.value)))})}function Hv({label:e,value:t,children:n}){const[o,i]=ee.useState(!1),u=ee.useRef(null),l=ee.useRef(null),d=ee.useRef(null),p=ee.useId(),g=(m=!1)=>{i(!1),m&&requestAnimationFrame(()=>{var v;return(v=l.current)==null?void 0:v.focus()})};ee.useEffect(()=>{if(!o)return;const m=v=>{u.current&&!u.current.contains(v.target)&&g()};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]);const y=m=>{var _;const v=Array.from(((_=d.current)==null?void 0:_.querySelectorAll('[role="menuitem"]:not([disabled])'))??[]),w=v.indexOf(document.activeElement);let x=null;if(m.key==="Escape"){m.preventDefault(),g(!0);return}m.key==="Home"&&(x=0),m.key==="End"&&(x=v.length-1),m.key==="ArrowDown"&&(x=w<0?0:(w+1)%v.length),m.key==="ArrowUp"&&(x=w<0?v.length-1:(w-1+v.length)%v.length),x!==null&&v[x]&&(m.preventDefault(),v[x].focus())};return I.jsxs("div",{ref:u,className:"relative",children:[I.jsxs("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?p:void 0,onClick:()=>i(m=>!m),onKeyDown:m=>{m.key!=="ArrowDown"&&m.key!=="ArrowUp"||(m.preventDefault(),i(!0),requestAnimationFrame(()=>{var w,x;const v=(w=d.current)==null?void 0:w.querySelectorAll('[role="menuitem"]:not([disabled])');(x=v==null?void 0:v[m.key==="ArrowDown"?0:v.length-1])==null||x.focus()}))},className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg max-sm:py-2 ${Hp}`,children:[I.jsxs("span",{className:"text-fg-faint",children:[e,":"]}),I.jsx("span",{className:"text-fg",children:t}),I.jsx(eR,{className:`size-3 transition ${o?"rotate-180":""}`})]}),o&&I.jsx("div",{id:p,ref:d,role:"menu",onKeyDown:y,className:"absolute right-0 z-50 mt-1 min-w-44 max-w-[calc(100vw-2.5rem)] rounded-md border border-line-2 bg-bg-2 p-1 shadow-xl",children:n(()=>g(!0))})]})}function Kv({children:e}){return I.jsx("div",{className:"flex flex-col",children:e})}function vc({active:e,onClick:t,children:n}){return I.jsx("button",{type:"button",role:"menuitem",onClick:t,className:`flex min-w-0 items-center gap-2 rounded px-2 py-1 text-left text-xs transition ${Hp} ${e?"bg-bg-3 text-fg-bright":"text-fg-dim hover:bg-bg-3 hover:text-fg"}`,children:n})}function uR({snapshot:e,derived:t,filters:n,setFilters:o,privacyMode:i=!0}){const u=(e==null?void 0:e.providers)??[],d=((e==null?void 0:e.accounts)??[]).filter(k=>k.hasUsage),p=new Set(d.map(k=>k.providerId)),g=u.filter(k=>p.has(k.id)),y=new Set(t.cardAccounts.map(k=>k.providerId)),m=u.filter(k=>!p.has(k.id)&&y.has(k.id)),v=n.providers.length?d.filter(k=>n.providers.includes(k.providerId)):d,w=k=>{var O;return((O=u.find(b=>b.id===k))==null?void 0:O.name)??k},x=k=>k.name&&k.name!==w(k.providerId)?`${w(k.providerId)} · ${k.name}`:w(k.providerId),_=d.find(k=>k.id===n.account),P=k=>o(O=>{const b=O.providers.includes(k);return{...O,providers:b?O.providers.filter($=>$!==k):[...O.providers,k]}}),B=n.providers.length>0||n.models.length>0||n.account!=="all";return I.jsx("div",{className:"border-t border-line bg-bg-0/70",children:I.jsxs("div",{className:"mx-auto flex max-w-[1600px] flex-wrap items-center gap-x-4 gap-y-2 px-5 py-2.5 2xl:max-w-[1920px]",children:[I.jsx("span",{className:"hidden text-xs text-fg-faint sm:inline",children:"filter:"}),I.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[g.map(k=>{const O=n.providers.includes(k.id),b=n.providers.length>0&&!O;return I.jsxs("button",{type:"button","aria-pressed":O,onClick:()=>P(k.id),className:"flex items-center gap-1.5 rounded border px-2 py-0.5 text-xs transition focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:py-1.5",style:{borderColor:O?k.color:"var(--color-line)",color:b?"var(--color-fg-faint)":O?k.color:"var(--color-fg-dim)",background:O?"var(--color-bg-2)":"transparent"},title:O?`hide ${k.name}`:n.providers.length?`add ${k.name}`:`show only ${k.name}`,children:[I.jsx("span",{style:{color:k.color,opacity:b?.4:1},"aria-hidden":!0,children:O?"●":"○"}),k.name]},k.id)}),m.length>0&&I.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-fg-faint",title:"Billing-only providers — shown as cards with plan & quota; no usage timeline to filter",children:[g.length>0&&I.jsx("span",{className:"text-line-2",children:"|"}),I.jsx("span",{children:"billing-only:"}),m.map(k=>I.jsxs("span",{className:"flex items-center gap-1 text-fg-dim",children:[I.jsx("span",{style:{color:k.color,opacity:.55},"aria-hidden":!0,children:"·"}),k.name]},k.id))]})]}),I.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 md:ml-auto md:w-auto",children:[v.length>1?I.jsx(Hv,{label:"account",value:n.account==="all"?"all":_?iR(x(_),i):"all",children:k=>I.jsxs(Kv,{children:[I.jsx(vc,{active:n.account==="all",onClick:()=>{o(O=>({...O,account:"all"})),k()},children:"All accounts"}),I.jsx("div",{className:"my-1 h-px bg-line"}),I.jsx("div",{className:"max-h-64 overflow-y-auto",children:v.map(O=>I.jsxs(vc,{active:n.account===O.id,onClick:()=>{o(b=>({...b,account:O.id})),k()},children:[I.jsx("span",{style:{color:O.color},"aria-hidden":!0,children:"●"})," ",I.jsx(Wv,{value:x(O),privacyMode:i,className:"truncate"})]},O.id))})]})}):v.length===1?I.jsxs("span",{className:"rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim",children:["account: ",I.jsx(Wv,{value:x(v[0]),privacyMode:i,className:"text-fg"})]}):null,I.jsx(Hv,{label:"model",value:n.models.length===0?"all":n.models.length===1?Vv(n.models[0]):`${n.models.length} models`,children:()=>I.jsxs(Kv,{children:[I.jsx(vc,{active:n.models.length===0,onClick:()=>o(k=>({...k,models:[]})),children:"All models"}),I.jsx("div",{className:"my-1 h-px bg-line"}),I.jsxs("div",{className:"max-h-64 overflow-y-auto",children:[t.modelOptions.length===0&&I.jsx("div",{className:"px-2 py-1 text-xs text-fg-faint",children:"no models in range"}),t.modelOptions.map(k=>{const O=n.models.includes(k);return I.jsxs(vc,{active:O,onClick:()=>o(b=>({...b,models:O?b.models.filter($=>$!==k):[...b.models,k]})),children:[I.jsx("span",{className:O?"text-accent":"text-fg-faint","aria-hidden":!0,children:O?"◉":"○"})," ",Vv(k)]},k)})]})]})}),I.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[I.jsx("span",{className:"text-xs text-fg-faint",children:"range:"}),I.jsx(aR,{options:Cx.map(k=>({value:k.key,label:k.key==="mtd"?"MTD":k.key==="all"?"6M":k.key})),value:n.period,onChange:k=>o(O=>({...O,period:k})),size:"sm",ariaLabel:"time range"})]}),B&&I.jsxs("button",{type:"button",onClick:()=>o(k=>({...k,providers:[],models:[],account:"all"})),className:"flex items-center gap-1 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-faint transition hover:border-warning/60 hover:text-warning focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",title:"Clear provider, model & account filters","aria-label":"Clear provider, model and account filters",children:[I.jsx(tR,{className:"size-3","aria-hidden":!0})," clear"]})]})]})})}const cR=ee.lazy(()=>lr(()=>import("./share-sheet-BLHmrFbm.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(e=>({default:e.ShareSheet}))),Ix=ee.createContext(null),lR=()=>{const e=ee.useContext(Ix);if(!e)throw new Error("useShare must be used inside ShareProvider");return e};function fR({children:e}){const[t,n]=ee.useState(null);return I.jsxs(Ix.Provider,{value:n,children:[e,t?I.jsx(ee.Suspense,{fallback:I.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Preparing share preview…"}),children:I.jsx(cR,{source:t,onClose:()=>n(null)})}):null]})}function dR({derived:e,periodLabel:t,tz:n,version:o}){const i=lR();return I.jsxs("button",{type:"button",onClick:()=>i({kind:"summary",derived:e,periodLabel:t,tz:n,version:o}),className:"flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2.5 py-1 text-xs text-fg-dim transition hover:border-accent/60 hover:text-accent active:scale-[0.97] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:py-2",title:"Create a shareable image",children:[I.jsx(ZI,{className:"size-3.5"}),I.jsx("span",{children:"share"})]})}const Qv=[{key:"overview",label:"overview"},{key:"analytics",label:"analytics"},{key:"models",label:"models"},{key:"explore",label:"explore"}];function hR(e,t){const n=e.providers.filter(u=>t.providers.has(u)),o=e.account==="all"||t.accounts.has(e.account)?e.account:"all",i=t.modelsReady?e.models.filter(u=>t.models.has(u)):e.models;return n.length===e.providers.length&&i.length===e.models.length&&o===e.account?e:{...e,providers:n,account:o,models:i}}function Kp(e,t,n){try{return e(t)}catch(o){return ub("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,o,n),null}}function Zn(e){function t(n){if(typeof n>"u")return null;let o="";if(Array.isArray(n)){if(n[0]===void 0)return null;o=n[0]}return typeof n=="string"&&(o=n),Kp(e.parse,o)}return{type:"single",eq:(n,o)=>n===o,...e,parseServerSide:t,withDefault(n){return{...this,defaultValue:n,parseServerSide(o){return t(o)??n}}},withOptions(n){return{...this,...n}}}}const dh=Zn({parse:e=>e,serialize:String});Zn({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});Zn({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});Zn({parse:e=>{const t=parseInt(e,16);return t==t?t:null},serialize:e=>{const t=Math.round(e).toString(16);return(t.length&1?"0":"")+t}});Zn({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});Zn({parse:e=>e.toLowerCase()==="true",serialize:String});function Qp(e,t){return e.valueOf()===t.valueOf()}Zn({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:Qp});Zn({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:Qp});Zn({parse:e=>{const t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:Qp});function pR(e){return mR(e)}function mR(e){return Zn({parse:t=>{const n=t;return e.includes(n)?n:null},serialize:String})}function Jv(e,t=","){const n=e.eq??((i,u)=>i===u),o=encodeURIComponent(t);return Zn({parse:i=>i===""?[]:i.split(t).map((u,l)=>Kp(e.parse,u.replaceAll(o,t),`[${l}]`)).filter(u=>u!=null),serialize:i=>i.map(u=>(e.serialize?e.serialize(u):String(u)).replaceAll(t,o)).join(t),eq(i,u){return i===u?!0:i.length!==u.length?!1:i.every((l,d)=>n(l,u[d]))}})}const hh=Ap(),gR={};function yR(e,t={}){const n=ee.useId(),o=gb(),i=yb(),{history:u="replace",scroll:l=(o==null?void 0:o.scroll)??!1,shallow:d=(o==null?void 0:o.shallow)??!0,throttleMs:p=da.timeMs,limitUrlUpdates:g=o==null?void 0:o.limitUrlUpdates,clearOnDefault:y=(o==null?void 0:o.clearOnDefault)??!0,startTransition:m,urlKeys:v=gR}=t,w=Object.keys(e).join(","),x=ee.useMemo(()=>Object.fromEntries(Object.keys(e).map(F=>[F,v[F]??F])),[w,JSON.stringify(v)]),_=mb(Object.values(x)),P=_.searchParams,B=ee.useRef({}),k=ee.useMemo(()=>Object.fromEntries(Object.keys(e).map(F=>[F,e[F].defaultValue??null])),[Object.values(e).map(({defaultValue:F})=>F).join(",")]),O=Jd.useQueuedQueries(Object.values(x)),[b,$]=ee.useState(()=>ph(e,v,P??new URLSearchParams,O).state),D=ee.useRef(b);if(Xe("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,w,b,P),Object.keys(B.current).join("&")!==Object.values(x).join("&")){const{state:F,hasChanged:W}=ph(e,v,P,O,B.current,D.current);W&&(Xe("[nuq+ %s `%s`] State changed: %O",n,w,{state:F,initialSearchParams:P,queuedQueries:O,queryRef:B.current,stateRef:D.current}),D.current=F,$(F)),B.current=Object.fromEntries(Object.entries(x).map(([X,te])=>{var ae;return[te,((ae=e[X])==null?void 0:ae.type)==="multi"?P==null?void 0:P.getAll(te):(P==null?void 0:P.get(te))??null]}))}ee.useEffect(()=>{const{state:F,hasChanged:W}=ph(e,v,P,O,B.current,D.current);W&&(Xe("[nuq+ %s `%s`] State changed: %O",n,w,{state:F,initialSearchParams:P,queuedQueries:O,queryRef:B.current,stateRef:D.current}),D.current=F,$(F))},[Object.values(x).map(F=>`${F}=${P==null?void 0:P.getAll(F)}`).join("&"),JSON.stringify(O)]),ee.useEffect(()=>{const F=Object.keys(e).reduce((W,X)=>(W[X]=({state:te,query:ae})=>{$(E=>{const{defaultValue:H}=e[X],Z=x[X],Y=te??H??null,z=E[X]??H??null;return Object.is(z,Y)?(Xe("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,w,Z,te,H,D.current),E):(D.current={...D.current,[X]:Y},B.current[Z]=ae,Xe("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,w,Z,te,H,D.current),D.current)})},W),{});for(const W of Object.keys(e)){const X=x[W];Xe("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,X,w),hh.on(X,F[W])}return()=>{for(const W of Object.keys(e)){const X=x[W];Xe("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,X,w),hh.off(X,F[W])}}},[w,x]);const A=ee.useCallback((F,W={})=>{var z,G,re,V,R,J;const X=Object.fromEntries(Object.keys(e).map(he=>[he,null])),te=typeof F=="function"?F(Gv(D.current,k))??X:F??X;Xe("[nuq+ %s `%s`] setState: %O",n,w,te);let ae,E=0,H=!1;const Z=[];for(let[he,de]of Object.entries(te)){const ce=e[he],_e=x[he];if(!ce||de===void 0)continue;(W.clearOnDefault??ce.clearOnDefault??y)&&de!==null&&ce.defaultValue!==void 0&&(ce.eq??((Pe,ut)=>Pe===ut))(de,ce.defaultValue)&&(de=null);const Oe=de===null?null:(ce.serialize??String)(de);hh.emit(_e,{state:de,query:Oe});const ke={key:_e,query:Oe,options:{history:W.history??ce.history??u,shallow:W.shallow??ce.shallow??d,scroll:W.scroll??ce.scroll??l,startTransition:W.startTransition??ce.startTransition??m}};if(((z=W==null?void 0:W.limitUrlUpdates)==null?void 0:z.method)==="debounce"||(g==null?void 0:g.method)==="debounce"||((G=ce.limitUrlUpdates)==null?void 0:G.method)==="debounce"){ke.options.shallow===!0&&console.warn(Da(422));const Pe=((re=W==null?void 0:W.limitUrlUpdates)==null?void 0:re.timeMs)??(g==null?void 0:g.timeMs)??((V=ce.limitUrlUpdates)==null?void 0:V.timeMs)??da.timeMs,ut=Jd.push(ke,Pe,_,i);E<Pe&&(ae=ut,E=Pe)}else{const Pe=((R=W==null?void 0:W.limitUrlUpdates)==null?void 0:R.timeMs)??((J=ce==null?void 0:ce.limitUrlUpdates)==null?void 0:J.timeMs)??(g==null?void 0:g.timeMs)??W.throttleMs??ce.throttleMs??p;Z.push(Jd.abort(_e)),Cc.push(ke,Pe),H=!0}}const Y=Z.reduce((he,de)=>de(he),H?Cc.flush(_,i):Cc.getPendingPromise(_));return ae??Y},[w,u,d,l,p,g==null?void 0:g.method,g==null?void 0:g.timeMs,m,x,_.updateUrl,_.getSearchParamsSnapshot,_.rateLimitFactor,i,k]);return[ee.useMemo(()=>Gv(b,k),[b,k]),A]}function ph(e,t,n,o,i,u){let l=!1;const d=Object.entries(e).reduce((p,[g,y])=>{const m=(t==null?void 0:t[g])??g,v=o[m],w=y.type==="multi"?[]:null,x=v===void 0?(y.type==="multi"?n==null?void 0:n.getAll(m):n==null?void 0:n.get(m))??w:v;return i&&u&&Bw(i[m]??w,x)?(p[g]=u[g]??null,p):(l=!0,p[g]=(wb(x)?null:Kp(y.parse,x,m))??null,i&&(i[m]=x),p)},{});if(!l){const p=Object.keys(e),g=Object.keys(u??{});l=p.length!==g.length||p.some(y=>!g.includes(y))}return{state:d,hasChanged:l}}function Gv(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}const vR=["7d","30d","90d","mtd","all"];function SR(){const[e,t]=yR({p:Jv(dh).withDefault([]),m:Jv(dh).withDefault([]),a:dh.withDefault("all"),period:pR(vR).withDefault(BI.period)},{history:"replace"}),n=ee.useMemo(()=>({providers:e.p,models:e.m,account:e.a,period:e.period}),[e.p,e.m,e.a,e.period]),o=ee.useCallback(i=>{t(u=>{const l={providers:u.p,models:u.m,account:u.a,period:u.period},d=typeof i=="function"?i(l):i;return{p:d.providers,m:d.models,a:d.account,period:d.period}})},[t]);return[n,o]}const $t=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let o=0,i=t.length;o<i;o++)n=t[o](n);return n}}},wR={pipe(){return $t(this,arguments)}},vl=(function(){function e(){}return e.prototype=wR,e})(),ne=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,o){return arguments.length>=2?t(n,o):function(i){return t(i,n)}};case 3:return function(n,o,i){return arguments.length>=3?t(n,o,i):function(u){return t(u,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(o){return t(o,...n)}}}},Ee=e=>e,ds=e=>()=>e,Jp=ds(!0),Rx=ds(!1),Sl=ds(void 0),Ua=Sl;function Tx(e,t,n,o,i,u,l,d,p){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return o(n(t(e.apply(this,arguments))))};case 5:return function(){return i(o(n(t(e.apply(this,arguments)))))};case 6:return function(){return u(i(o(n(t(e.apply(this,arguments))))))};case 7:return function(){return l(u(i(o(n(t(e.apply(this,arguments)))))))};case 8:return function(){return d(l(u(i(o(n(t(e.apply(this,arguments))))))))};case 9:return function(){return p(d(l(u(i(o(n(t(e.apply(this,arguments)))))))))}}}function hs(e){const t=new WeakMap;return n=>{if(t.has(n))return t.get(n);const o=e(n);return t.set(n,o),o}}const Jh=e=>{const t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");const n=Object.getPrototypeOf(e);let o=n;for(;o!==null&&o!==Object.prototype;){const i=Reflect.ownKeys(o);for(let u=0;u<i.length;u++)t.add(i[u]);o=Object.getPrototypeOf(o)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},Gh=new WeakSet;function Gp(e){return typeof e=="string"}function Mx(e){return typeof e=="number"}function xR(e){return typeof e=="boolean"}function wl(e){return typeof e=="function"}function kR(e){return e!==void 0}function _R(e){return e!=null}function ER(e){return!1}function Ox(e){return!0}function CR(e){return typeof e=="object"&&e!==null||wl(e)}const Ue=ne(2,(e,t)=>CR(e)&&t in e);function bR(e){return Ue(e,Symbol.iterator)||Gp(e)}const Gt="~effect/interfaces/Hash",ht=e=>{switch(typeof e){case"number":return Yp(e);case"bigint":return bt(e.toString(10));case"boolean":return bt(String(e));case"symbol":return bt(String(e));case"string":return bt(e);case"undefined":return bt("undefined");case"function":case"object":{if(e===null)return bt("null");if(e instanceof Date)return bt(e.toISOString());if(e instanceof RegExp)return bt(e.toString());{if(Gh.has(e))return Yh(e);if(gh.has(e))return gh.get(e);const t=MR(e,()=>PR(e)?e[Gt]():typeof e=="function"?Yh(e):Array.isArray(e)||ArrayBuffer.isView(e)?Lx(e):e instanceof Map?RR(e):e instanceof Set?TR(e):Xp(e));return gh.set(e,t),t}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Yh=e=>(mh.has(e)||mh.set(e,Yp(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),mh.get(e)),Jn=ne(2,(e,t)=>e*53^t),xl=e=>e&3221225471|e>>>1&1073741824,PR=e=>Ue(e,Gt),Yp=e=>{if(e!==e)return bt("NaN");if(e===1/0)return bt("Infinity");if(e===-1/0)return bt("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return xl(t)},bt=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return xl(t)},IR=(e,t)=>{let n=12289;for(const o of t)n^=Jn(ht(o),ht(e[o]));return xl(n)},Xp=e=>IR(e,Jh(e)),Zp=(e,t)=>n=>{let o=e;for(const i of n)o^=t(i);return xl(o)},Lx=Zp(6151,ht),RR=Zp(bt("Map"),([e,t])=>Jn(ht(e),ht(t))),TR=Zp(bt("Set"),ht),mh=new WeakMap,gh=new WeakMap,yh=new WeakSet;function MR(e,t){if(yh.has(e))return bt("[Circular]");yh.add(e);const n=t();return yh.delete(e),n}const Yt="~effect/interfaces/Equal";function Sn(){return arguments.length===1?e=>Ys(e,arguments[0]):Ys(arguments[0],arguments[1])}function Ys(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=typeof e;return n!==typeof t?!1:n==="number"&&e!==e&&t!==t?!0:n!=="object"&&n!=="function"||Gh.has(e)||Gh.has(t)?!1:NR(e,t,LR)}function OR(e,t,n){const o=vh.has(e),i=Sh.has(t);if(o&&i)return!0;if(o||i)return!1;vh.add(e),Sh.add(t);const u=n();return vh.delete(e),Sh.delete(t),u}const vh=new WeakSet,Sh=new WeakSet;function LR(e,t){if(ht(e)!==ht(t))return!1;if(e instanceof Date)return t instanceof Date?e.toISOString()===t.toISOString():!1;if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;const n=Yv(e),o=Yv(t);if(n!==o)return!1;const i=n&&o;return typeof e=="function"&&!i?!1:OR(e,t,()=>i?e[Yt](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:AR(e,t):ArrayBuffer.isView(e)?!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength?!1:jR(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:DR(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:zR(e,t):$R(e,t))}function NR(e,t,n){let o=Sc.get(e);if(!o)o=new WeakMap,Sc.set(e,o);else if(o.has(t))return o.get(t);const i=n(e,t);o.set(t,i);let u=Sc.get(t);return u||(u=new WeakMap,Sc.set(t,u)),u.set(e,i),i}const Sc=new WeakMap;function AR(e,t){for(let n=0;n<e.length;n++)if(!Ys(e[n],t[n]))return!1;return!0}function jR(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function $R(e,t){const n=Jh(e),o=Jh(t);if(n.size!==o.size)return!1;for(const i of n)if(!o.has(i)||!Ys(e[i],t[i]))return!1;return!0}function FR(e,t){return function(o,i){for(const[u,l]of o){let d=!1;for(const[p,g]of i)if(e(u,p)&&t(l,g)){d=!0;break}if(!d)return!1}return!0}}const DR=FR(Ys,Ys);function UR(e){return function(n,o){for(const i of n){let u=!1;for(const l of o)if(e(i,l)){u=!0;break}if(!u)return!1}return!0}}const zR=UR(Ys),Yv=e=>Ue(e,Yt),BR=()=>Sn,VR=e=>(t,n)=>t===n||e(t,n),qR=(e,t)=>e===t,WR=()=>qR;function HR(e){return VR((t,n)=>{if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!e(t[o],n[o]))return!1;return!0})}const Nx=e=>e.length>0,kl=Symbol.for("~effect/Redactable"),KR=e=>Ue(e,kl);function _l(e){return KR(e)?Ax(e):e}function Ax(e){var t;return e[kl](((t=globalThis[ha])==null?void 0:t.context)??QR)}const ha="~effect/Fiber/currentFiber",QR={"~effect/Context":{},mapUnsafe:new Map,pipe(){return $t(this,arguments)}};function mt(e,t){const n=(t==null?void 0:t.space)??0,o=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",u=g=>i.repeat(g),l=(g,y)=>{const m=g==null?void 0:g.constructor;return m&&m!==Object.prototype.constructor&&m.name?`${m.name}(${y})`:y},d=g=>{try{return Reflect.ownKeys(g)}catch{return["[ownKeys threw]"]}};function p(g,y=0){if(Array.isArray(g)){if(o.has(g))return Xv;if(o.add(g),!i||g.length<=1)return`[${g.map(v=>p(v,y)).join(",")}]`;const m=g.map(v=>p(v,y+1)).join(`,
|
|
59
|
-
`+u(y+1));return`[
|
|
60
|
-
${u(y+1)}${m}
|
|
61
|
-
${u(y)}]`}if(g instanceof Date)return GR(g);if(!(t!=null&&t.ignoreToString)&&Ue(g,"toString")&&typeof g.toString=="function"&&g.toString!==Object.prototype.toString&&g.toString!==Array.prototype.toString){const m=YR(g);return g instanceof Error&&g.cause?`${m} (cause: ${p(g.cause,y)})`:m}if(typeof g=="string")return JSON.stringify(g);if(typeof g=="number"||g==null||typeof g=="boolean"||typeof g=="symbol")return String(g);if(typeof g=="bigint")return String(g)+"n";if(typeof g=="object"||typeof g=="function"){if(o.has(g))return Xv;if(o.add(g),kl in g)return mt(Ax(g));if(Symbol.iterator in g)return`${g.constructor.name}(${p(Array.from(g),y)})`;const m=d(g);if(!i||m.length<=1){const w=`{${m.map(x=>`${qc(x)}:${p(g[x],y)}`).join(",")}}`;return l(g,w)}const v=`{
|
|
62
|
-
${m.map(w=>`${u(y+1)}${qc(w)}: ${p(g[w],y+1)}`).join(`,
|
|
63
|
-
`)}
|
|
64
|
-
${u(y)}}`;return l(g,v)}return String(g)}return p(e,0)}const Xv="[Circular]";function qc(e){return typeof e=="string"?JSON.stringify(e):String(e)}function JR(e){return e.map(t=>`[${qc(t)}]`).join("")}function GR(e){try{return e.toISOString()}catch{return"Invalid Date"}}function YR(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function jx(e,t){let n=[];const o=JSON.stringify(e,(i,u)=>typeof u=="object"&&u!==null?n.includes(u)?void 0:n.push(u)&&_l(u):u,t==null?void 0:t.space);return n=void 0,o}const Xs=Symbol.for("nodejs.util.inspect.custom"),za=e=>{try{if(Ue(e,"toJSON")&&wl(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(za)}catch{return"[toJSON threw]"}return _l(e)},XR=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?ZR(e,t):String(e)}catch{return String(e)}},ZR=(e,t)=>{let n=[];const o=JSON.stringify(e,(i,u)=>typeof u=="object"&&u!==null?n.includes(u)?void 0:n.push(u)&&_l(u):u,t);return n=void 0,o},Zv={toJSON(){return za(this)},[Xs](){return this.toJSON()},toString(){return mt(this.toJSON())}};class El{constructor(t){L(this,"called",!1);L(this,"self");this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new El(this.self)}}const Yo="~effect/Utils/internal",$x={[Yo]:e=>e()},e2={[Yo]:e=>{try{return e()}finally{}}};var kw;const t2=((kw=$x[Yo](()=>new Error().stack))==null?void 0:kw.includes(Yo))===!0,Jt=t2?$x[Yo]:e2[Yo],ps="~effect/Effect",ba="~effect/Exit",n2={_A:Ee,_E:Ee,_R:Ee},Fx=`${ps}/identifier`,Re=`${ps}/args`,Rt=`${ps}/evaluate`,wn=`${ps}/successCont`,fr=`${ps}/failureCont`,Zs=`${ps}/ensureCont`,$s=Symbol.for("effect/Effect/Yield"),ms={pipe(){return $t(this,arguments)},toJSON(){return{...this}},toString(){return mt(this.toJSON(),{ignoreToString:!0,space:2})},[Xs](){return this.toJSON()}},Cl={[Symbol.iterator](){return new El(this)}},r2={...Cl,pipe(){return $t(this,arguments)}},s2={[ps]:n2,...ms,[Symbol.iterator](){return new El(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[Fx],...Re in this?{args:this[Re]}:void 0}}},Wt=e=>Ue(e,ps),Dx=e=>Ue(e,ba),Tc="~effect/Cause",Mc="~effect/Cause/Reason",bl=e=>Ue(e,Tc),o2=e=>Ue(e,Mc);var _w;class ro{constructor(t){L(this,_w);L(this,"reasons");this[Tc]=Tc,this.reasons=t}pipe(){return $t(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${mt(this.reasons)})`}[(_w=Tc,Xs)](){return this.toJSON()}[Yt](t){return bl(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,o)=>Sn(n,t.reasons[o]))}[Gt](){return Lx(this.reasons)}}const eS=new WeakMap;var Ew;class em{constructor(t,n,o){L(this,Ew);L(this,"annotations");L(this,"_tag");if(this[Mc]=Mc,this._tag=t,n!==Pl&&typeof o=="object"&&o!==null&&n.size>0){const i=eS.get(o);i&&(n=new Map([...i,...n])),eS.set(o,n)}this.annotations=n}annotate(t,n){if(t.mapUnsafe.size===0)return this;const o=new Map(this.annotations);t.mapUnsafe.forEach((u,l)=>{(n==null?void 0:n.overwrite)!==!0&&o.has(l)||o.set(l,u)});const i=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return i.annotations=o,i}pipe(){return $t(this,arguments)}toString(){return mt(this)}[(Ew=Mc,Xs)](){return this.toString()}}const Pl=new Map;class Ux extends em{constructor(n,o=Pl){super("Fail",o,n);L(this,"error");this.error=n}toString(){return`Fail(${mt(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[Yt](n){return tm(n)&&Sn(this.error,n.error)&&Sn(this.annotations,n.annotations)}[Gt](){return Jn(bt(this._tag))(Jn(ht(this.error))(ht(this.annotations)))}}const Pa=e=>new ro(e),i2=new ro([]),zx=e=>new ro([new Ux(e)]);class Bx extends em{constructor(n,o=Pl){super("Die",o,n);L(this,"defect");this.defect=n}toString(){return`Die(${mt(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[Yt](n){return u2(n)&&Sn(this.defect,n.defect)&&Sn(this.annotations,n.annotations)}[Gt](){return Jn(bt(this._tag))(Jn(ht(this.defect))(ht(this.annotations)))}}const a2=e=>new ro([new Bx(e)]),Xh=ne(e=>bl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new ro(e.reasons.map(o=>o.annotate(t,n)))),tm=e=>e._tag==="Fail",u2=e=>e._tag==="Die",nm=e=>e._tag==="Interrupt";function c2(e){return Xo("Effect.evaluate: Not implemented")}const Ba=e=>({...s2,[Fx]:e.op,[Rt]:e[Rt]??c2,[wn]:e[wn],[fr]:e[fr],[Zs]:e[Zs]}),er=e=>{const t=Ba(e);return function(){const n=Object.create(t);return n[Re]=e.single===!1?arguments:arguments[0],n}},Vx=e=>{const t={...Ba(e),[ba]:ba,_tag:e.op,get[e.prop](){return this[Re]},toString(){return`${e.op}(${mt(this[Re])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[Re]}},[Yt](n){return Dx(n)&&n._tag===this._tag&&Sn(this[Re],n[Re])},[Gt](){return Jn(bt(e.op),ht(this[Re]))}};return function(n){const o=Object.create(t);return o[Re]=n,o}},it=Vx({op:"Success",prop:"value",[Rt](e){const t=e.getCont(wn);return t?t[wn](this[Re],e,this):e.yieldWith(this)}}),Il={key:"effect/Cause/StackTrace"},l2={key:"effect/Cause/InterruptorStackTrace"},An=Vx({op:"Failure",prop:"cause",[Rt](e){let t=this[Re],n=!1;e.currentStackFrame&&(t=Xh(t,{mapUnsafe:new Map([[Il.key,e.currentStackFrame]])}),n=!0);let o=e.getCont(fr);for(;e.interruptible&&e._interruptedCause&&o;)o=e.getCont(fr);return o?o[fr](t,e,n?void 0:this):e.yieldWith(n?this:An(t))}}),mr=e=>An(zx(e)),Xo=e=>An(a2(e)),Be=er({op:"WithFiber",[Rt](e){return this[Re](e)}}),f2=(function(){class e extends globalThis.Error{asEffect(){return mr(this)}}return Object.assign(e.prototype,r2),e})(),qx=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return class extends f2{constructor(n){super(n==null?void 0:n.message,n!=null&&n.cause?{cause:n.cause}:void 0),n&&(Object.assign(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),rm=e=>{class t extends qx{constructor(){super(...arguments);L(this,"_tag",e)}}return t.prototype.name=e,t},tS="~effect/Cause/NoSuchElementError";var Cw,bw;class d2 extends(bw=rm("NoSuchElementError"),Cw=tS,bw){constructor(n){super({message:n});L(this,Cw,tS)}}const Ia="~effect/Cause/Done",h2=e=>Ue(e,Ia),Wx={[Ia]:Ia,_tag:"Done",value:void 0},sm=e=>e===void 0?Wx:{[Ia]:Ia,_tag:"Done",value:e},p2=mr(Wx),m2=e=>e===void 0?p2:mr(sm(e)),Hx="~effect/data/Option",Kx={[Hx]:{_A:e=>e},...ms,...Cl},Qx=Object.assign(Object.create(Kx),{_tag:"Some",_op:"Some",[Yt](e){return Jx(e)&&Yx(e)&&Sn(this.value,e.value)},[Gt](){return Jn(ht(this._tag))(ht(this.value))},toString(){return`some(${mt(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:za(this.value)}},asEffect(){return it(this.value)}});Object.defineProperty(Qx,"valueOrUndefined",{get(){return this.value}});const g2=ht("None"),y2=Object.assign(Object.create(Kx),{_tag:"None",_op:"None",valueOrUndefined:void 0,[Yt](e){return Jx(e)&&Gx(e)},[Gt](){return g2},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return mr(new d2)}}),Jx=e=>Ue(e,Hx),Gx=e=>e._tag==="None",Yx=e=>e._tag==="Some",v2=Object.create(y2),S2=e=>{const t=Object.create(Qx);return t.value=e,t},Xx="~effect/data/Result",Zx={[Xx]:{_A:e=>e,_E:e=>e},...ms,...Cl},w2=Object.assign(Object.create(Zx),{_tag:"Success",_op:"Success",[Yt](e){return e1(e)&&n1(e)&&Sn(this.success,e.success)},[Gt](){return Jn(ht(this._tag))(ht(this.success))},toString(){return`success(${mt(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:za(this.success)}},asEffect(){return it(this.success)}}),x2=Object.assign(Object.create(Zx),{_tag:"Failure",_op:"Failure",[Yt](e){return e1(e)&&t1(e)&&Sn(this.failure,e.failure)},[Gt](){return Jn(ht(this._tag))(ht(this.failure))},toString(){return`failure(${mt(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:za(this.failure)}},asEffect(){return mr(this.failure)}}),e1=e=>Ue(e,Xx),t1=e=>e._tag==="Failure",n1=e=>e._tag==="Success",k2=e=>{const t=Object.create(x2);return t.failure=e,t},_2=e=>{const t=Object.create(w2);return t.success=e,t};function om(e){return(t,n)=>t===n?0:e(t,n)}const r1=om((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),E2=ne(2,(e,t)=>om((n,o)=>e(t(n),t(o)))),C2=e=>ne(2,(t,n)=>e(t,n)===1),b2=e=>ne(2,(t,n)=>e(t,n)!==-1),P2=e=>ne(2,(t,n)=>t===n||e(t,n)<1?t:n),I2=e=>ne(2,(t,n)=>t===n||e(t,n)>-1?t:n),jn=()=>v2,Le=S2,so=Gx,fs=Yx,R2=ne(2,(e,t)=>so(e)?t():e.value),s1=R2(Sl),im=ne(2,(e,t)=>so(e)?jn():Le(t(e.value))),T2=ne(2,(e,t)=>so(e)?jn():t(e.value)?Le(e.value):jn()),Nr=_2,Gn=k2,Tt=t1,M2=n1,O2={[Symbol.iterator](){return L2}},L2={next(){return{done:!0,value:void 0}}},N2=()=>O2,A2=ne(2,(e,t)=>Object.hasOwn(e,t)),j2=e=>Object.keys(e),$2=e=>ne(2,(t,n)=>{for(const o of j2(t))if(!A2(n,o)||!e(t[o],n[o]))return!1;return!0}),F2=e=>{const t=$2(e);return(n,o)=>t(n,o)&&t(o,n)},nS=globalThis.Array,hr=e=>nS.isArray(e)?e:nS.from(e),o1=ne(2,(e,t)=>[...e,t]),D2=ne(2,(e,t)=>hr(e).concat(hr(t))),rS=Nx,Wc=Nx;function U2(e,t){return e<0||e>=t.length}const z2=ne(2,(e,t)=>{const n=Math.floor(t);if(U2(n,e))throw new Error(`Index out of bounds: ${n}`);return e[n]}),B2=z2(0),V2=e=>e.slice(1),q2=ne(3,(e,t,n)=>{const o=hr(e),i=hr(t);return Wc(o)?Wc(i)?K2(n)(D2(o,i)):o:i}),W2=ne(2,(e,t)=>q2(e,t,BR())),H2=()=>[],i1=ne(2,(e,t)=>e.map(t)),K2=ne(2,(e,t)=>{const n=hr(e);if(Wc(n)){const o=[B2(n)],i=V2(n);for(const u of i)o.every(l=>!t(u,l))&&o.push(u);return o}return[]}),sS="~effect/Context/Service",Fn=function(){var i;const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const t=new Error;Error.stackTraceLimit=e;function n(){}const o=n;return Object.setPrototypeOf(o,Q2),Object.defineProperty(o,"stack",{get(){return t.stack}}),arguments.length>0?(o.key=arguments[0],(i=arguments[1])!=null&&i.defaultValue&&(o[Hc]=Hc,o.defaultValue=arguments[1].defaultValue),o):function(u,l){return o.key=u,l!=null&&l.make&&(o.make=l.make),o}},Q2={[sS]:sS,...ms,...Cl,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=ds(Be(t=>it(Ws(t.context,this)))))()},of(e){return e},context(e){return Zo(this,e)},use(e){return Be(t=>e(Ws(t.context,this)))},useSync(e){return Be(t=>it(e(Ws(t.context,this))))}},Hc="~effect/Context/Reference",a1="~effect/Context",us=e=>{const t=Object.create(J2);return t.mapUnsafe=e,t.mutable=!1,t},J2={...ms,[a1]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Yt](e){if(!u1(e)||this.mapUnsafe.size!==e.mapUnsafe.size)return!1;for(const t of this.mapUnsafe.keys())if(!e.mapUnsafe.has(t)||!Sn(this.mapUnsafe.get(t),e.mapUnsafe.get(t)))return!1;return!0},[Gt](){return Yp(this.mapUnsafe.size)}},u1=e=>Ue(e,a1),c1=e=>Ue(e,Hc),Yn=()=>G2,G2=us(new Map),Zo=(e,t)=>us(new Map([[e.key,t]])),gs=ne(3,(e,t,n)=>l1(e,o=>{o.set(t.key,n)})),Y2=ne(3,(e,t,n)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):c1(t)?Tl(t):n()),Rl=ne(2,(e,t)=>{if(!e.mapUnsafe.has(t.key)){if(Hc in t)return Tl(t);throw Z2(t)}return e.mapUnsafe.get(t.key)}),Ws=Rl,X2=(e,t)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):Tl(t),wh="~effect/Context/defaultValue",Tl=e=>wh in e?e[wh]:e[wh]=e.defaultValue(),Z2=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
|
|
65
|
-
`);if(n.length>2){const o=n[2].match(/at (.*)/);o&&(t.message=t.message+` (defined at ${o[1]})`)}}if(t.stack){const n=t.stack.split(`
|
|
66
|
-
`);n.splice(1,3),t.stack=n.join(`
|
|
67
|
-
`)}return t},eT=ne(2,(e,t)=>e.mapUnsafe.has(t.key)?Le(e.mapUnsafe.get(t.key)):c1(t)?Le(Tl(t)):jn()),ei=ne(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:l1(e,n=>{t.mapUnsafe.forEach((o,i)=>n.set(i,o))})),tT=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((o,i)=>{t.set(i,o)});return us(t)},l1=(e,t)=>{if(e.mutable)return t(e.mapUnsafe),e;const n=new Map(e.mapUnsafe);return t(n),us(n)},Ze=Fn,Kc="~effect/time/Duration",nT=BigInt(0),f1=BigInt(1e3),rT=BigInt(1e6),sT=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,am=e=>{switch(typeof e){case"number":return Ra(e);case"bigint":return aS(e);case"string":{const t=sT.exec(e);if(!t)break;const[n,o,i]=t,u=Number(o);switch(i){case"nano":case"nanos":return aS(BigInt(o));case"micro":case"micros":return fT(BigInt(o));case"milli":case"millis":return Ra(u);case"second":case"seconds":return dT(u);case"minute":case"minutes":return hT(u);case"hour":case"hours":return pT(u);case"day":case"days":return mT(u);case"week":case"weeks":return gT(u)}break}case"object":{if(e===null)break;if(Kc in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Mx)?oS(e):Number.isNaN(e[0])||Number.isNaN(e[1])?um:e[0]===-1/0||e[1]===-1/0?lT:e[0]===1/0||e[1]===1/0?cT:an(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));const t=e;let n=0;if(t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds)return an(n);let o=BigInt(n)*rT;return t.microseconds&&(o+=BigInt(t.microseconds)*f1),t.nanoseconds&&(o+=BigInt(t.nanoseconds)),an(o)}}return oS(e)},oS=e=>{throw new Error(`Invalid Input: ${e}`)},iS={_tag:"Millis",millis:0},oT={_tag:"Infinity"},iT={_tag:"NegativeInfinity"},aT={[Kc]:Kc,[Gt](){return Xp(this.value)},[Yt](e){return uT(e)&&xT(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[Xs](){return this.toJSON()},pipe(){return $t(this,arguments)}},an=e=>{const t=Object.create(aT);return typeof e=="number"?isNaN(e)||e===0||Object.is(e,-0)?t.value=iS:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=e>0?oT:iT:e===nT?t.value=iS:t.value={_tag:"Nanos",nanos:e},t},uT=e=>Ue(e,Kc),um=an(0),cT=an(1/0),lT=an(-1/0),aS=e=>an(e),fT=e=>an(e*f1),Ra=e=>an(e),dT=e=>an(e*1e3),hT=e=>an(e*6e4),pT=e=>an(e*36e5),mT=e=>an(e*864e5),gT=e=>an(e*6048e5),d1=e=>yT(e,{onMillis:Ee,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),uS=e=>{switch(e.value._tag){case"Infinity":case"NegativeInfinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return e.value.nanos;case"Millis":return BigInt(Math.round(e.value.millis*1e6))}},yT=ne(2,(e,t)=>{switch(e.value._tag){case"Millis":return t.onMillis(e.value.millis);case"Nanos":return t.onNanos(e.value.nanos);case"Infinity":return t.onInfinity();case"NegativeInfinity":return(t.onNegativeInfinity??t.onInfinity)()}}),h1=ne(3,(e,t,n)=>e.value._tag==="Infinity"||e.value._tag==="NegativeInfinity"||t.value._tag==="Infinity"||t.value._tag==="NegativeInfinity"?n.onInfinity(e,t):e.value._tag==="Millis"?t.value._tag==="Millis"?n.onMillis(e.value.millis,t.value.millis):n.onNanos(uS(e),t.value.nanos):n.onNanos(e.value.nanos,uS(t))),p1=om((e,t)=>h1(e,t,{onMillis:(n,o)=>n<o?-1:n>o?1:0,onNanos:(n,o)=>n<o?-1:n>o?1:0,onInfinity:(n,o)=>n.value._tag===o.value._tag?0:n.value._tag==="Infinity"?1:n.value._tag==="NegativeInfinity"||o.value._tag==="Infinity"?-1:1})),vT=(e,t)=>h1(e,t,{onMillis:(n,o)=>n===o,onNanos:(n,o)=>n===o,onInfinity:(n,o)=>n.value._tag===o.value._tag}),ST=P2(p1),wT=I2(p1),xT=ne(2,(e,t)=>vT(e,t)),kT=e=>t=>!Tt(e(t)),_T=e=>t=>t.has(e)?Nr(t):Gn(t),ET=ne(2,(e,t)=>n=>{const o=e(n);return Tt(o)?o:t(o.success)}),m1=ne(2,(e,t)=>n=>{const o=e(n);if(Tt(o))return Gn(n);const i=t(o.success);return Tt(i)?Gn(n):i}),g1=Ze("effect/Scheduler",{defaultValue:()=>new v1}),y1="setImmediate"in globalThis?e=>{const t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{const t=setTimeout(e,0);return()=>clearTimeout(t)};class CT{constructor(){L(this,"buckets",[])}scheduleTask(t,n){const o=this.buckets,i=o.length;let u,l=0;for(;l<i&&!(o[l][0]>n);l++)u=o[l];u&&u[0]===n?u[1].push(t):l===i?o.push([n,[t]]):o.splice(l,0,[n,[t]])}drain(){const t=this.buckets;return this.buckets=[],t}}class v1{constructor(t="async",n=y1){L(this,"executionMode");L(this,"setImmediate");this.executionMode=t,this.setImmediate=n}shouldYield(t){return t.currentOpCount>=t.maxOpsBeforeYield}makeDispatcher(){return new bT(this.setImmediate)}}class bT{constructor(t=y1){L(this,"tasks",new CT);L(this,"running");L(this,"setImmediate");L(this,"afterScheduled",()=>{this.running=void 0,this.runTasks()});this.setImmediate=t}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}runTasks(){const t=this.tasks.drain();for(let n=0;n<t.length;n++){const o=t[n][1];for(let i=0;i<o.length;i++)o[i]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}}const PT=Ze("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),IT=Ze("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1}),S1="effect/Tracer/ParentSpan";class RT extends Fn()(S1){}const TT=e=>e,Zh=Ze("effect/Tracer/DisablePropagation",{defaultValue:Rx}),MT=Ze("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),OT=Ze("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),w1="effect/Tracer",LT=Ze(w1,{defaultValue:()=>TT({span:e=>new NT(e)})});class NT{constructor(t){L(this,"_tag","Span");L(this,"spanId");L(this,"traceId","native");L(this,"sampled");L(this,"name");L(this,"parent");L(this,"annotations");L(this,"links");L(this,"startTime");L(this,"kind");L(this,"status");L(this,"attributes");L(this,"events",[]);var n;this.name=t.name,this.parent=t.parent,this.annotations=t.annotations,this.links=t.links,this.startTime=t.startTime,this.kind=t.kind,this.sampled=t.sampled,this.status={_tag:"Started",startTime:t.startTime},this.attributes=new Map,this.traceId=((n=s1(t.parent))==null?void 0:n.traceId)??cS(32),this.spanId=cS(16)}end(t,n){this.status={_tag:"Ended",endTime:t,exit:n,startTime:this.status.startTime}}attribute(t,n){this.attributes.set(t,n)}event(t,n,o){this.events.push([t,n,o??{}])}addLinks(t){this.links.push(...t)}}const cS=(function(){const e="abcdef0123456789",t=e.length;return function(n){let o="";for(let i=0;i<n;i++)o+=e.charAt(Math.floor(Math.random()*t));return o}})(),AT="effect/observability/Metric/FiberRuntimeMetricsKey",jT=Ze("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),x1=Ze("effect/References/CurrentStackFrame",{defaultValue:Sl}),$T=Ze("effect/References/TracerEnabled",{defaultValue:Jp}),k1=Ze("effect/References/TracerTimingEnabled",{defaultValue:Jp}),FT=Ze("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),DT=Ze("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),cm=Ze("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),UT=Ze("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),zT=Ze("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),BT=Ze("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),VT=e=>{if((e==null?void 0:e.captureStackTrace)===!1)return e;if((e==null?void 0:e.captureStackTrace)!==void 0&&typeof e.captureStackTrace!="boolean")return e;const t=Error.stackTraceLimit;Error.stackTraceLimit=3;const n=new Error;return Error.stackTraceLimit=t,{...e,captureStackTrace:WT(()=>n.stack)}},qT=e=>t=>{let n;return()=>{if(n!==void 0)return n;const o=t();if(!o)return;const i=o.split(`
|
|
68
|
-
`);if(i[e]!==void 0)return n=i[e].trim(),n}},WT=qT(3),HT="dev";class _1 extends em{constructor(n,o=Pl){super("Interrupt",o,"Interrupted");L(this,"fiberId");this.fiberId=n}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[Yt](n){return nm(n)&&this.fiberId===n.fiberId&&this.annotations===n.annotations}[Gt](){return Jn(bt(`${this._tag}:${this.fiberId}`))(Yh(this.annotations))}}const KT=e=>new _1(e),lm=e=>new ro([new _1(e)]),QT=e=>{const t=e.reasons.find(tm);return t?Nr(t):Gn(e)},oo=e=>{for(let t=0;t<e.reasons.length;t++){const n=e.reasons[t];if(n._tag==="Fail")return Nr(n.error)}return Gn(e)},JT=e=>e.reasons.some(nm),fm=e=>{let t;for(let n=0;n<e.reasons.length;n++){const o=e.reasons[n];o._tag==="Interrupt"&&(t??(t=new Set),o.fiberId!==void 0&&t.add(o.fiberId))}return t?Nr(t):Gn(e)},GT=e=>{const t=fm(e);return Tt(t)?YT:t.success},YT=new Set,XT=e=>e.reasons.length>0&&e.reasons.every(nm),ZT=ne(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;const n=new ro(W2(e.reasons,t.reasons));return Sn(e,n)?e:n}),eM=e=>{const t={Fail:[],Die:[],Interrupt:[]};for(let n=0;n<e.reasons.length;n++)t[e.reasons[n]._tag].push(e.reasons[n]);return t},dm=e=>{const t=eM(e);return t.Fail.length>0?t.Fail[0].error:t.Die.length>0?t.Die[0].defect:t.Interrupt.length>0?new globalThis.Error("All fibers interrupted without error"):new globalThis.Error("Empty cause")},tM=e=>{const t=[],n=[];if(e.reasons.length===0)return t;const o=Error.stackTraceLimit;Error.stackTraceLimit=1;for(const i of e.reasons){if(i._tag==="Interrupt"){n.push(i);continue}t.push(ep(i._tag==="Die"?i.defect:i.error,i.annotations))}if(t.length===0){const i=new Error("The fiber was interrupted by:");i.name="InterruptCause",i.stack=oM(i,n);const u=new globalThis.Error("All fibers interrupted without error",{cause:i});u.name="InterruptError",u.stack=`${u.name}: ${u.message}`,t.push(ep(u,n[0].annotations))}return Error.stackTraceLimit=o,t},ep=(e,t)=>{const n=typeof e;let o;if(e&&n==="object"){if(o=new globalThis.Error(nM(e),{cause:e.cause?ep(e.cause):void 0}),typeof e.name=="string"&&(o.name=e.name),typeof e.stack=="string")o.stack=sM(e.stack,o,t);else{const i=`${o.name}: ${o.message}`;o.stack=t?E1(i,t):i}for(const i of Object.keys(e))i in o||(o[i]=e[i])}else o=new globalThis.Error(e?n==="string"?e:jx(e):`Unknown error: ${e}`);return o},nM=e=>{if(typeof e.message=="string")return e.message;if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return jx(e)},rM=/\((.*)\)/g,sM=(e,t,n)=>{const o=`${t.name}: ${t.message}`,i=(e.startsWith(o)?e.slice(o.length):e).split(`
|
|
69
|
-
`),u=[o];for(let l=1;l<i.length&&!/(?:Generator\.next|~effect\/Effect)/.test(i[l]);l++)u.push(i[l]);return n?E1(u.join(`
|
|
70
|
-
`),n):u.join(`
|
|
71
|
-
`)},E1=(e,t)=>{const n=t==null?void 0:t.get(Il.key);return n&&(e=`${e}
|
|
72
|
-
${C1(n)}`),e},oM=(e,t)=>{const n=[`${e.name}: ${e.message}`];for(const o of t){const i=o.fiberId!==void 0?`#${o.fiberId}`:"unknown",u=o.annotations.get(l2.key);n.push(` at fiber (${i})`),u&&n.push(C1(u))}return n.join(`
|
|
73
|
-
`)},C1=e=>{const t=[];let n=e,o=0;for(;n&&o<10;){const i=n.stack();if(i){const u=i.matchAll(rM);let l=!1;for(const[,d]of u)l=!0,t.push(` at ${n.name} (${d})`);l||t.push(` at ${n.name} (${i.replace(/^at /,"")})`)}else t.push(` at ${n.name}`);n=n.parent,o++}return t.join(`
|
|
74
|
-
`)},b1=e=>tM(e).map(t=>t.cause?`${t.stack} {
|
|
75
|
-
${P1(t.cause," ")}
|
|
76
|
-
}`:t.stack).join(`
|
|
77
|
-
`),P1=(e,t)=>{const n=e.stack.split(`
|
|
78
|
-
`);let o=`${t}[cause]: ${n[0]}`;for(let i=1,u=n.length;i<u;i++)o+=`
|
|
79
|
-
${t}${n[i]}`;return e.cause&&(o+=` {
|
|
80
|
-
${P1(e.cause,`${t} `)}
|
|
81
|
-
${t}}`),o},tp=`~effect/Fiber/${HT}`,iM={_A:Ee,_E:Ee},aM={id:0},hm=()=>globalThis[ha];var Pw;Pw=tp;class I1{constructor(t,n=!0){L(this,Pw);L(this,"id");L(this,"interruptible");L(this,"currentOpCount");L(this,"currentLoopCount");L(this,"_stack");L(this,"_observers");L(this,"_exit");L(this,"_currentExit");L(this,"_children");L(this,"_interruptedCause");L(this,"_yielded");L(this,"context");L(this,"currentScheduler");L(this,"currentTracerContext");L(this,"currentSpan");L(this,"currentLogLevel");L(this,"minimumLogLevel");L(this,"currentStackFrame");L(this,"runtimeMetrics");L(this,"maxOpsBeforeYield");L(this,"currentPreventYield");L(this,"_dispatcher");this[tp]=iM,this.setContext(t),this.id=++aM.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=n,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0}get currentDispatcher(){return this._dispatcher??(this._dispatcher=this.currentScheduler.makeDispatcher())}getRef(t){return X2(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Ua):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}interruptUnsafe(t,n){if(this._exit)return;let o=lm(t);this.currentStackFrame&&(o=Xh(o,Zo(Il,this.currentStackFrame))),n&&(o=Xh(o,n)),this._interruptedCause=this._interruptedCause?ZT(this._interruptedCause,o):o,this.interruptible&&this.evaluate(At(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(t){var o,i;if((o=this.runtimeMetrics)==null||o.recordFiberStart(this.context),this._exit)return;if(this._yielded!==void 0){const u=this._yielded;this._yielded=void 0,u()}const n=this.runLoop(t);if(n!==$s){this._exit=n,(i=this.runtimeMetrics)==null||i.recordFiberEnd(this.context,this._exit);for(let u=0;u<this._observers.length;u++)this._observers[u](n);this._observers.length=0}}runLoop(t){const n=globalThis[ha];globalThis[ha]=this;let o=!1,i=t;this.currentOpCount=0;const u=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!o&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){o=!0;const l=i;i=$e(mm,()=>l)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Rt](this),u!==this.currentLoopCount)return $s;if(i===$s){const l=this._yielded;return ba in l?(this._yielded=void 0,l):$s}}}catch(l){return Ue(i,Rt)?this.runLoop(Xo(l)):Xo(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{globalThis[ha]=n}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const o=n[Zs]&&n[Zs](this);if(o)return o[t]=o,o;if(n[t])return n}}yieldWith(t){return this._yielded=t,$s}children(){return this._children??(this._children=new Set)}pipe(){return $t(this,arguments)}setContext(t){this.context=t;const n=this.getRef(g1);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=t.mapUnsafe.get(S1),this.currentLogLevel=this.getRef(UT),this.minimumLogLevel=this.getRef(zT),this.currentStackFrame=t.mapUnsafe.get(x1.key),this.maxOpsBeforeYield=this.getRef(PT),this.currentPreventYield=this.getRef(IT),this.runtimeMetrics=t.mapUnsafe.get(AT);const o=t.mapUnsafe.get(w1);this.currentTracerContext=o?o.context:void 0}get currentSpanLocal(){var t;return((t=this.currentSpan)==null?void 0:t._tag)==="Span"?this.currentSpan:void 0}}const Ml=e=>{if(!e.currentStackFrame)return;const t=new Map;return t.set(Il.key,e.currentStackFrame),us(t)},R1=e=>{const t=e;return t._exit?Ce(t._exit):tr(n=>t._exit?n(Ce(t._exit)):St(e.addObserver(o=>n(Ce(o)))))},T1=e=>tr(t=>{const n=e[Symbol.iterator](),o=[];let i;function u(){let l=n.next();for(;!l.done;){if(l.value._exit){o.push(l.value._exit),l=n.next();continue}i=l.value.addObserver(d=>{o.push(d),u()});return}t(Ce(o))}return u(),St(()=>i==null?void 0:i())}),pm=e=>Be(t=>uM(e,t.id)),uM=ne(e=>Ue(e[0],tp),(e,t,n)=>Be(o=>{let i=Ml(o);return i=i&&n?ei(i,n):i??n,e.interruptUnsafe(t,i),j1(R1(e))})),Qc=e=>Be(t=>{const n=Ml(t);for(const o of e)o.interruptUnsafe(t.id,n);return j1(T1(e))}),Ce=it,At=An,Ol=mr,St=er({op:"Sync",[Rt](e){const t=this[Re](),n=e.getCont(wn);return n?n[wn](t,e):e.yieldWith(it(t))}}),xt=er({op:"Suspend",[Rt](e){return this[Re]()}}),cM=er({op:"Yield",[Rt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate($n)},this[Re]??0),e.yieldWith(()=>{t=!0})}}),mm=cM(0),lM=e=>Ce(Le(e)),fM=Ce(jn()),Ll=e=>Xo(e),M1=e=>xt(()=>Ol(Jt(e))),ot=Ce(void 0),dM=e=>O1(function(t,n){Jt(()=>e(n)).then(o=>t(Ce(o)),o=>t(Ll(o)))},e.length!==0),hM=e=>Be(t=>e(t.id)),O1=er({op:"Async",single:!1,[Rt](e){const t=Jt(()=>this[Re][0].bind(e.currentScheduler));let n=!1,o=!1;const i=this[Re][1]?new AbortController:void 0,u=t(l=>{n||(n=!0,o?e.evaluate(l):o=l)},i==null?void 0:i.signal);return o!==!1?o:(o=!0,e._yielded=()=>{n=!0},i===void 0&&u===void 0||e._stack.push(pM(()=>(n=!0,i==null||i.abort(),u??$n))),$s)}}),pM=er({op:"AsyncFinalizer",[Zs](e){e.interruptible&&(e.interruptible=!1,e._stack.push(Dl))},[fr](e,t){return JT(e)?$e(this[Re](),()=>At(e)):At(e)}}),tr=e=>O1(e,e.length>=2),mM=tr(Ua),gM=(...e)=>xt(()=>Ta(e.length===1?e[0]():e[1].call(e[0].self))),L1=(e,...t)=>{const n=t.length===0?function(){return xt(()=>Ta(e.apply(this,arguments)))}:function(){let o=xt(()=>Ta(e.apply(this,arguments)));for(let i=0;i<t.length;i++)o=t[i](o,...arguments);return o};return N1(e.length,n)},N1=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),yM=(e,...t)=>N1(e.length,t.length===0?function(){return lS(()=>e.apply(this,arguments))}:function(){let n=lS(()=>e.apply(this,arguments));for(const o of t)n=o(n);return n}),lS=e=>{try{const t=e();let n;for(;;){const o=t.next(n);if(o.done)return Ce(o.value);const u=o.value.asEffect(),l=u;if(l&&l._tag==="Success"){n=l.value;continue}else{if(l&&l._tag==="Failure")return u;{let d=!0;return xt(()=>d?(d=!1,$e(u,p=>Ta(t,p))):xt(()=>Ta(e())))}}}}catch(t){return Ll(t)}},Ta=er({op:"Iterator",single:!1,[wn](e,t){const n=this[Re][0];for(;;){const o=n.next(e);if(o.done)return Ce(o.value);const i=o.value.asEffect();if(xn(i)){if(i._tag==="Failure")return i}else return t._stack.push(this),i;e=i.value}},[Rt](e){return this[wn](this[Re][1],e)}}),ui=ne(2,(e,t)=>{const n=Ce(t);return $e(e,o=>n)}),Va=ne(2,(e,t)=>$e(e,n=>Wt(t)?t:Jt(()=>t(n)))),A1=ne(2,(e,t)=>$e(e,n=>ui(Wt(t)?t:Jt(()=>t(n)),n))),j1=e=>$e(e,t=>$n),vM=(e,t)=>Be(n=>tr(o=>{let i=!1;const u=new Set,l=p=>{i=!0,o(u.size===0?p:$e(Q1(Qc(u)),()=>p))};let d=0;for(const p of e){if(i)break;const g=d++,y=zl(n,p,!0,!0,!1);u.add(y),y.addObserver(m=>{u.delete(y);const v=!i;l(m),v&&(t!=null&&t.onWinner)&&t.onWinner({fiber:y,index:g,parentFiber:n})})}return Qc(u)})),$1=ne(e=>Wt(e[1]),(e,t,n)=>vM([e,t],n)),$e=ne(2,(e,t)=>{const n=Object.create(SM);return n[Re]=e,n[wn]=t.length!==1?o=>t(o):t,n}),SM=Ba({op:"OnSuccess",[Rt](e){return e._stack.push(this),this[Re]}}),xn=e=>ba in e,wM=ne(2,(e,t)=>xn(e)?e._tag==="Success"?t(e.value):e:$e(e,t)),xM=e=>$e(e,Ee),wt=ne(2,(e,t)=>$e(e,n=>Ce(Jt(()=>t(n))))),kM=ne(2,(e,t)=>xn(e)?RM(e,t):wt(e,t)),_M=ne(2,(e,t)=>xn(e)?TM(e,t):VM(e,t)),EM=ne(2,(e,t)=>xn(e)?MM(e,t):qM(e,t)),CM=ne(2,(e,t)=>{if(xn(e)){if(e._tag==="Success")return e;const n=oo(e.cause);return Tt(n)?e:t(n.success)}return Al(e,t)}),bM=e=>An(lm(e)),gm=e=>e._tag==="Success",PM=e=>e._tag==="Failure",IM=e=>e._tag==="Failure"?Nr(e.cause):Gn(e),$n=it(void 0),RM=ne(2,(e,t)=>e._tag==="Success"?it(t(e.value)):e),TM=ne(2,(e,t)=>{if(e._tag==="Success")return e;const n=oo(e.cause);return Tt(n)?e:mr(t(n.success))}),MM=ne(2,(e,t)=>{if(e._tag==="Success")return it(t.onSuccess(e.value));const n=oo(e.cause);return Tt(n)?e:mr(t.onFailure(n.success))}),OM=ne(2,(e,t)=>gm(e)?t:e),LM=e=>{const t=[];for(const n of e)n._tag==="Failure"&&t.push(...n.cause.reasons);return t.length===0?$n:An(Pa(t))},NM=e=>gm(e)?Le(e.value):jn(),AM=e=>Be(t=>Ce(eT(t.context,e))),Nl=ne(2,(e,t)=>Be(n=>{const o=n.context,i=t(o);return o===i?e:(n.setContext(i),K1(e,()=>{n.setContext(o)}))})),F1=ne(3,(e,t,n)=>Nl(e,o=>{const i=Rl(o,t),u=n(i);return i===u?o:gs(o,t,u)})),jM=()=>$M,$M=Be(e=>Ce(e.context)),D1=e=>Be(t=>e(t.context)),qa=ne(2,(e,t)=>xn(e)?e:Nl(e,ei(t))),Wa=function(){return arguments.length===1?ne(2,(e,t)=>fS(e,arguments[0],t)):ne(3,(e,t,n)=>fS(e,t,n)).apply(this,arguments)},fS=(e,t,n)=>Nl(e,o=>o.mapUnsafe.get(t.key)===n?o:gs(o,t,n)),U1=ne(e=>Wt(e[1]),(e,t,n)=>FM(e,t,(o,i)=>[o,i],n)),FM=ne(e=>Wt(e[1]),(e,t,n,o)=>o!=null&&o.concurrent?wt(dO([e,t],{concurrency:2}),([i,u])=>Jt(()=>n(i,u))):$e(e,i=>wt(t,u=>Jt(()=>n(i,u))))),DM=ne(e=>Wt(e[0]),(e,t)=>wm({while:Jp,body:ds(t!=null&&t.disableYield?e:$e(e,n=>mm)),step:Ua})),Ha=ne(2,(e,t)=>{const n=Object.create(UM);return n[Re]=e,n[fr]=t.length!==1?o=>t(o):t,n}),UM=Ba({op:"OnFailure",[Rt](e){return e._stack.push(this),this[Re]}}),z1=ne(3,(e,t,n)=>Ha(e,o=>{const i=t(o);return Tt(i)?At(i.failure):Jt(()=>n(i.success,o))})),Al=ne(2,(e,t)=>z1(e,oo,n=>t(n))),zM=ne(2,(e,t)=>Ha(e,n=>Va(Jt(()=>t(n)),At(n)))),BM=ne(e=>Wt(e[0]),(e,t,n,o)=>Ha(e,i=>{const u=oo(i);if(Tt(u))return At(u.failure);const l=t(u.success);return Tt(l)?o?Jt(()=>o(l.failure)):At(i):Jt(()=>n(l.success))})),VM=ne(2,(e,t)=>Al(e,n=>M1(()=>t(n)))),qM=ne(2,(e,t)=>ym(e,{onFailure:n=>M1(()=>t.onFailure(n)),onSuccess:n=>St(()=>t.onSuccess(n))})),WM=e=>Al(e,Ll),HM=ne(e=>Wt(e[0]),(e,t)=>{if(!(t!=null&&t.log))return ym(e,{onFailure:o=>ot,onSuccess:o=>ot});const n=uk(t.log===!0?void 0:t.log);return jl(e,{onFailure(o){const i=QT(o);return Tt(i)?At(i.failure):t.message===void 0?n(o):n(t.message,o)},onSuccess:o=>ot})}),xh=e=>JM(e,{onFailure:Gn,onSuccess:Nr}),jl=ne(2,(e,t)=>{const n=Object.create(KM);return n[Re]=e,n[wn]=t.onSuccess.length!==1?o=>t.onSuccess(o):t.onSuccess,n[fr]=t.onFailure.length!==1?o=>t.onFailure(o):t.onFailure,n}),KM=Ba({op:"OnSuccessAndFailure",[Rt](e){return e._stack.push(this),this[Re]}}),ym=ne(2,(e,t)=>jl(e,{onFailure:n=>{const o=n.reasons.find(tm);return o?Jt(()=>t.onFailure(o.error)):At(n)},onSuccess:t.onSuccess})),QM=ne(2,(e,t)=>ym(e,{onFailure:n=>St(()=>t.onFailure(n)),onSuccess:n=>St(()=>t.onSuccess(n))})),JM=ne(2,(e,t)=>{if(xn(e)){if(e._tag==="Success")return it(t.onSuccess(e.value));const n=oo(e.cause);return Tt(n)?e:it(t.onFailure(n.success))}return QM(e,t)}),$l=e=>xn(e)?it(e):GM(e),GM=er({op:"Exit",[Rt](e){return e._stack.push(this),this[Re]},[wn](e,t,n){return Ce(n??it(e))},[fr](e,t,n){return Ce(n??An(e))}}),YM=ne(2,(e,t)=>Va(_m(t),e)),B1=ne(2,(e,t)=>$1(e,$e(_m(t.duration),t.orElse))),XM=ne(2,(e,t)=>B1(e,{duration:t,orElse:()=>Ol(new AO)})),dS="~effect/Scope",hS="~effect/Scope/Closeable",Fl=Fn("effect/Scope"),V1=(e,t)=>xt(()=>q1(e,t)??ot),q1=(e,t)=>{if(e.state._tag==="Closed")return;const n={_tag:"Closed",exit:t};if(e.state._tag==="Empty"){e.state=n;return}const{finalizers:o}=e.state;if(e.state=n,o.size!==0)return o.size===1?o.values().next().value(t):ZM(e,o,t)},ZM=L1(function*(e,t,n){let o=[];const i=[],u=Array.from(t.values()),l=hm();for(let d=u.length-1;d>=0;d--){const p=u[d];e.strategy==="sequential"?o.push(yield*$l(p(n))):i.push(zl(l,p(n),!0,!0,"inherit"))}return i.length>0&&(o=yield*T1(i)),yield*LM(o)}),eO=(e,t)=>{const n=Sm(t);if(e.state._tag==="Closed")return n.state=e.state,n;const o={};return Ma(e,o,i=>V1(n,i)),Ma(n,o,i=>St(()=>vm(e,o))),n},ti=(e,t)=>xt(()=>e.state._tag==="Closed"?t(e.state.exit):(Ma(e,{},t),ot)),tO=(e,t)=>ti(e,ds(t)),Ma=(e,t,n)=>{e.state._tag==="Empty"?e.state={_tag:"Open",finalizers:new Map([[t,n]])}:e.state._tag==="Open"&&e.state.finalizers.set(t,n)},vm=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.delete(t)},Sm=(e="sequential")=>({[hS]:hS,[dS]:dS,strategy:e,state:nO}),nO={_tag:"Empty"},W1=Fl.asEffect(),rO=Wa(Fl),H1=e=>xt(()=>{const t=Sm();return ys(e(t),n=>xt(()=>q1(t,n)??ot))}),sO=(e,t,n)=>D1(o=>Y1(i=>$e(W1,u=>A1(n!=null&&n.interruptible?i(e):e,l=>ti(u,d=>qa(t(l,d),o)))))),K1=er({op:"OnExit",single:!1,[Rt](e){return e._stack.push(this),this[Re][0]},[Zs](e){e.interruptible&&this[Re][2]!==!0&&(e._stack.push(Dl),e.interruptible=!1)},[wn](e,t,n){n??(n=it(e));const o=this[Re][1](n);return o?$e(o,i=>n):n},[fr](e,t,n){n??(n=An(e));const o=this[Re][1](n);return o?$e(o,i=>n):n}}),ys=ne(2,K1),oO=ne(2,(e,t)=>ys(e,n=>t)),iO=ne(3,(e,t,n)=>ys(e,o=>{const i=t(o);return Tt(i)?ot:n(i.success,o)})),aO=ne(2,(e,t)=>iO(e,IM,t)),uO=ne(3,(e,t,n)=>ys(e,o=>{if(o._tag!=="Failure")return ot;const i=t(o.cause);return Tt(i)?ot:n(i.success,o.cause)})),cO=ne(2,(e,t)=>uO(fm,t)(e)),lO=Be(e=>At(lm(e.id))),Q1=e=>Be(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(Dl)),e)),J1=er({op:"SetInterruptible",[Zs](e){if(e.interruptible=this[Re],e._interruptedCause&&e.interruptible)return()=>At(e._interruptedCause)}}),Dl=J1(!0),fO=J1(!1),G1=e=>Be(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(fO),t._interruptedCause?At(t._interruptedCause):e)),Y1=e=>Be(t=>t.interruptible?(t.interruptible=!1,t._stack.push(Dl),e(G1)):e(Ee)),dO=(e,t)=>bR(e)?(t==null?void 0:t.mode)==="result"?Fs(e,xh,t):Fs(e,Ee,t):t!=null&&t.discard?t.mode==="result"?Fs(Object.values(e),xh,t):Fs(Object.values(e),Ee,t):xt(()=>{const n={};return ui(Fs(Object.entries(e),([o,i])=>wt((t==null?void 0:t.mode)==="result"?xh(i):i,u=>{n[o]=u}),{discard:!0,concurrency:t==null?void 0:t.concurrency}),n)}),wm=er({op:"While",[wn](e,t){return this[Re].step(e),this[Re].while()?(t._stack.push(this),this[Re].body()):$n},[Rt](e){return this[Re].while()?(e._stack.push(this),this[Re].body()):$n}}),Fs=ne(e=>typeof e[1]=="function",(e,t,n)=>Be(o=>{const i=(n==null?void 0:n.concurrency)==="inherit"?o.getRef(jT):(n==null?void 0:n.concurrency)??1,u=i==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,i);if(u===1)return hO(e,t,n);const l=hr(e);let d=l.length;if(d===0)return n!=null&&n.discard?ot:Ce([]);const p=n!=null&&n.discard?void 0:new Array(d),g=pO({f:t,out:p},l,{concurrency:u});return g?ui(g,p):Ce(p)})),hO=(e,t,n)=>xt(()=>{const o=n!=null&&n.discard?void 0:[],i=e[Symbol.iterator]();let u=i.next(),l=0;return ui(wm({while:()=>!u.done,body:()=>t(u.value,l++),step:d=>{o&&o.push(d),u=i.next()}}),o)}),X1=e=>{const t=e.onItem,n=e.step;return(o,i,u)=>{let l=(u==null?void 0:u.start)??0;const d=(u==null?void 0:u.end)??i.length,p=(u==null?void 0:u.concurrency)??1;let g=!1,y,m,v,w=!1,x,_;const P=()=>{let B=!1;for(;!x&&l<d;l++){const k=i[l],O=_??t(o,k,l);if(xn(O)){if(x=n(o,k,O,l),x)break}else{if(p===1)return $e($l(O),b=>(x=n(o,k,b,l),l++,x??P()??ot));if(y){_=void 0;const b=zl(y,O,!0,!0,"inherit");if(b._exit){if(x=n(o,k,b._exit,l),x)break;continue}m?m.add(b):m=new Set([b]);const $=l;if(b.addObserver(D=>{if(m.delete(b),x){if(!w&&D._tag==="Failure")for(const A of D.cause.reasons)A._tag!=="Interrupt"&&(x._tag==="Failure"?x.cause.reasons.push(A):x=An(Pa([A])))}else{const A=n(o,k,D,$);A&&(x=A._tag==="Failure"?An(Pa(A.cause.reasons.slice())):A,P())}if(B){const A=P();A&&v(A)}else g&&m.size===0&&v(x??ot)}),m.size<p)continue;B=!0,l++;return}else return tr(b=>{y=hm(),_=O,v=b;const $=P();return $?b($):xt(()=>(x=$n,w=!0,m?Qc(m):ot))})}}if(g=!0,x){if(m&&m.size>0){const k=Ml(y);m.forEach(O=>O.interruptUnsafe(y.id,k));return}if(v||x._tag==="Failure")return x}else if(v)if(m)m.size===0&&v(ot);else return $n};return P()}},Ul=()=>X1,pO=X1({onItem(e,t,n){return e.f(t,n)},step(e,t,n,o){if(n._tag==="Failure")return n;e.out&&(e.out[o]=n.value)}}),zl=(e,t,n=!1,o=!1,i=!1)=>{const u=i==="inherit"?e.interruptible:!i,l=new I1(e.context,u);return n?l.evaluate(t):e.currentDispatcher.scheduleTask(()=>l.evaluate(t),0),!o&&!l._exit&&(e.children().add(l),l.addObserver(()=>e._children.delete(l))),l},Z1=ne(e=>Wt(e[0]),(e,t,n)=>Be(o=>{const i=zl(o,e,n==null?void 0:n.startImmediately,!0,n==null?void 0:n.uninterruptible);if(!i._exit)if(t.state._tag!=="Closed"){const u={};Ma(t,u,()=>hM(d=>d===i.id?ot:pm(i))),i.addObserver(()=>vm(t,u))}else i.interruptUnsafe(o.id,Ml(o));return Ce(i)})),mO=ne(e=>Wt(e[0]),(e,t)=>$e(W1,n=>Z1(e,n,t))),Ka=e=>(t,n)=>{const o=new I1(n!=null&&n.scheduler?gs(e,g1,n.scheduler):e,(n==null?void 0:n.uninterruptible)!==!0);if(o.evaluate(t),o._exit)return o;if(n!=null&&n.signal)if(n.signal.aborted)o.interruptUnsafe();else{const i=()=>o.interruptUnsafe();n.signal.addEventListener("abort",i,{once:!0}),o.addObserver(()=>n.signal.removeEventListener("abort",i))}return n!=null&&n.onFiberStart&&n.onFiberStart(o),o},gO=ne(2,(e,t)=>{if(e._exit)return e;if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;const n={};return Ma(t,n,()=>pm(e)),e.addObserver(()=>vm(t,n)),e}),yO=Ka(Yn()),ek=e=>{const t=Ka(e);return(n,o)=>{const i=t(n,o);return o!=null&&o.onExit&&i.addObserver(o.onExit),u=>i.interruptUnsafe(u)}},vO=ek(Yn()),xm=e=>{const t=Ka(e);return(n,o)=>{const i=t(n,o);return new Promise(u=>{i.addObserver(l=>u(l))})}},SO=xm(Yn()),tk=e=>{const t=xm(e);return(n,o)=>t(n,o).then(i=>{if(i._tag==="Failure")throw dm(i.cause);return i.value})},wO=tk(Yn()),km=e=>{const t=Ka(e);return n=>{var u;if(xn(n))return n;const o=new v1("sync"),i=t(n,{scheduler:o});return(u=i.currentDispatcher)==null||u.flush(),i._exit??Xo(new jO(i))}},xO=km(Yn()),nk=e=>{const t=km(e);return n=>{const o=t(n);if(o._tag==="Failure")throw dm(o.cause);return o.value}},kO=nk(Yn()),pS=Ce(!0),mS=Ce(!1);class _O{constructor(t){L(this,"waiters",[]);L(this,"scheduled",!1);L(this,"isOpen");L(this,"flushWaiters",()=>{this.scheduled=!1;const t=this.waiters;this.waiters=[];for(let n=0;n<t.length;n++)t[n]($n)});L(this,"open",Be(t=>this.isOpen?mS:(this.isOpen=!0,this.scheduleUnsafe(t))));L(this,"release",Be(t=>this.isOpen?mS:this.scheduleUnsafe(t)));L(this,"await",tr(t=>this.isOpen?t(ot):(this.waiters.push(t),St(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)}))));L(this,"close",St(()=>this.closeUnsafe()));L(this,"whenOpen",t=>$e(this.await,()=>t));this.isOpen=t}scheduleUnsafe(t){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,t.currentDispatcher.scheduleTask(this.flushWaiters,0)),pS}openUnsafe(){return this.isOpen?!1:(this.isOpen=!0,this.flushWaiters(),!0)}closeUnsafe(){return this.isOpen?(this.isOpen=!1,!0):!1}}const EO=e=>new _O(e??!1),np=BigInt(0),CO={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:np,endTime:np,exit:$n},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},bO=e=>Object.assign(Object.create(CO),e),rk=e=>e?Ws(e.annotations,Zh)?e._tag==="Span"?rk(s1(e.parent)):jn():Le(e):jn(),sk=(e,t,n)=>{const o=!e.getRef($T)||(n==null?void 0:n.annotations)&&Ws(n.annotations,Zh),i=(n==null?void 0:n.parent)!==void 0?Le(n.parent):n!=null&&n.root?jn():rk(e.currentSpan);let u;if(o)u=bO({name:t,parent:i,annotations:gs((n==null?void 0:n.annotations)??Yn(),Zh,!0)});else{const l=e.getRef(LT),d=e.getRef(ci),p=e.getRef(k1),g=e.getRef(FT),y=e.getRef(DT),m=(n==null?void 0:n.level)??e.getRef(MT),v=(n==null?void 0:n.links)!==void 0?[...y,...n.links]:y.slice();u=l.span({name:t,parent:i,annotations:(n==null?void 0:n.annotations)??Yn(),links:v,startTime:p?d.currentTimeNanosUnsafe():BigInt(0),kind:(n==null?void 0:n.kind)??"internal",root:(n==null?void 0:n.root)??so(i),sampled:(n==null?void 0:n.sampled)??(fs(i)&&i.value.sampled===!1?!1:!ik(e.getRef(OT),m))});for(const[w,x]of Object.entries(g))u.attribute(w,x);if((n==null?void 0:n.attributes)!==void 0)for(const[w,x]of Object.entries(n.attributes))u.attribute(w,x)}return u},PO=(e,t)=>Q1(Be(n=>{const o=Rl(n.context,Fl),i=sk(n,e,t??{}),u=n.getRef(ci),l=n.getRef(k1);return ui(ti(o,d=>RO(i,d,u,l)),i)})),IO=(e,t)=>(t=typeof t=="function"?t:Sl,F1(x1,n=>({name:e,stack:t,parent:n}))),RO=(e,t,n,o)=>St(()=>{e.status._tag!=="Ended"&&e.end(o?n.currentTimeNanosUnsafe():np,t)}),TO=(e,...t)=>{const n=t.length===1?void 0:t[0],o=t[t.length-1];return Be(i=>{const u=sk(i,e,n),l=i.getRef(ci);return ys(Jt(()=>o(u)),d=>St(()=>{u.status._tag!=="Ended"&&u.end(l.currentTimeNanosUnsafe(),d)}))})},gS=Wa(RT),MO=function(){const e=Wt(arguments[0]),t=e?arguments[1]:arguments[0];let n=e?arguments[2]:arguments[1],o=Ee;return t._tag==="Span"&&(n=VT(n),o=IO(t.name,n==null?void 0:n.captureStackTrace)),e?gS(o(arguments[0]),t):i=>gS(o(i),t)},ci=Ze("effect/Clock",{defaultValue:()=>new LO}),OO=2**31-1;class LO{constructor(){L(this,"currentTimeMillis",St(()=>this.currentTimeMillisUnsafe()));L(this,"currentTimeNanos",St(()=>this.currentTimeNanosUnsafe()))}currentTimeMillisUnsafe(){return Date.now()}currentTimeNanosUnsafe(){return NO()}sleep(t){const n=d1(t);return n<=0?mm:tr(o=>{if(n>OO)return;const i=setTimeout(()=>o(ot),n);return St(()=>clearTimeout(i))})}}const yS=(function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*e;if(typeof performance.timeOrigin=="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));const t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return()=>t+BigInt(Math.round(performance.now()*1e6))})(),NO=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return yS;const t=yS()-e.bigint();return()=>t+e.bigint()})(),ok=e=>Be(t=>e(t.getRef(ci))),_m=e=>ok(t=>t.sleep(am(e))),vS="~effect/Cause/TimeoutError";var Iw,Rw;class AO extends(Rw=rm("TimeoutError"),Iw=vS,Rw){constructor(n){super({message:n});L(this,Iw,vS)}}const SS="~effect/Cause/AsyncFiberError";var Tw,Mw;class jO extends(Mw=rm("AsyncFiberError"),Tw=SS,Mw){constructor(n){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:n});L(this,Tw,SS)}}const $O=Ze("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),FO=e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},DO=E2(r1,FO),ik=C2(DO),UO=Ze("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([QO,JO])}),zO=Ze("effect/Logger/LogToStderr",{defaultValue:Rx}),BO="~effect/Logger",VO={[BO]:{_Message:Ee,_Output:Ee},pipe(){return $t(this,arguments)}},ak=e=>{const t=Object.create(VO);return t.log=e,t},qO=e=>e.replace(/[\s="]/g,"_"),WO=(e,t)=>`${qO(e[0])}=${t-e[1]}ms`,uk=e=>(...t)=>{let n;for(let o=0,i=t.length;o<i;o++){const u=t[o];bl(u)&&(n?t.splice(o,1):t=t.slice(0,o).concat(t.slice(o+1)),n=n?Pa(n.reasons.concat(u.reasons)):u,o--)}return n===void 0&&(n=i2),Be(o=>{const i=e??o.currentLogLevel;if(ik(o.minimumLogLevel,i))return ot;const u=o.getRef(ci),l=o.getRef(UO);if(l.size>0){const d=new Date(u.currentTimeMillisUnsafe());for(const p of l)p.log({cause:n,fiber:o,date:d,logLevel:i,message:t})}return ot})},HO=e=>`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`,KO=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;KO&&process.stdout.isTTY;const QO=ak(({cause:e,date:t,fiber:n,logLevel:o,message:i})=>{const u=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&u.push(b1(e));const l=t.getTime(),d=n.getRef(BT);let p="";for(const v of d)p+=` ${WO(v,l)}`;const g=n.getRef(cm);Object.keys(g).length>0&&u.push(g);const y=n.getRef($O);(n.getRef(zO)?y.error:y.log)(`[${HO(t)}] ${o.toUpperCase()} (#${n.id})${p}:`,...u)}),JO=ak(({cause:e,fiber:t,logLevel:n,message:o})=>{const i=t.getRef(ci),u=t.getRef(cm),l=t.currentSpan;if(l===void 0||l._tag==="ExternalSpan")return;const d={};for(const[p,g]of Object.entries(u))d[p]=g;d["effect.fiberId"]=t.id,d["effect.logLevel"]=n.toUpperCase(),e.reasons.length>0&&(d["effect.cause"]=b1(e)),l.event(XR(Array.isArray(o)&&o.length===1?o[0]:o),i.currentTimeNanosUnsafe(),d)}),GO=bl,YO=o2,rp=Pa,sp=e=>new Ux(e),op=e=>new Bx(e),ip=KT,XO=XT,ck=dm,Qa=oo,ZO=GT,eL=fm,Em=h2,Hs=m2,tL=Dx,kh=it,pa=An,Ja=mr,nL=Xo,rL=bM,lk=$n,fk=gm,dk=PM,sL=NM,oL="~effect/Deferred",iL={[oL]:{_A:Ee,_E:Ee},pipe(){return $t(this,arguments)}},Cm=()=>{const e=Object.create(iL);return e.resumes=void 0,e.effect=void 0,e},bm=e=>tr(t=>e.effect?t(e.effect):(e.resumes??(e.resumes=[]),e.resumes.push(t),St(()=>{const n=e.resumes.indexOf(t);e.resumes.splice(n,1)}))),aL=ne(2,(e,t)=>St(()=>ma(e,t))),hk=aL,ma=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){for(let n=0;n<e.resumes.length;n++)e.resumes[n](t);e.resumes=void 0}return!0},uL=ne(2,(e,t)=>Y1(n=>$e($l(n(e)),o=>hk(t,o)))),cL=cm,wS=Fl,Pm=Sm,Jc=rO,lL=ti,fL=tO,Gc=eO,Bl=V1,dL="~effect/Layer",xS="~effect/Layer/MemoMap",hL={[dL]:{_ROut:Ee,_E:Ee,_RIn:Ee},pipe(){return $t(this,arguments)}},pk=e=>{const t=Object.create(hL);return t.build=e,t},Im=e=>pk((t,n)=>{const o=Gc(n);return ys(e(t,o),i=>i._tag==="Failure"?Bl(o,i):ot)}),pL=e=>{const t=Im((n,o)=>n.getOrElseMemoize(t,o,e));return t};class mL{constructor(){L(this,"map",new Map)}get[xS](){return xS}getOrElseMemoize(t,n,o){if(this.map.has(t)){const d=this.map.get(t);return d.observers++,Va(ti(n,p=>d.finalizer(p)),d.effect)}const i=Pm(),u=Cm(),l={observers:1,effect:bm(u),finalizer:d=>xt(()=>(l.observers--,l.observers===0?(this.map.delete(t),Bl(i,d)):ot))};return this.map.set(t,l),ti(n,l.finalizer).pipe($e(()=>o(this,i)),ys(d=>(l.effect=d,hk(u,d))))}}const Rm=()=>new mL,dl=class dl extends Fn()("effect/Layer/CurrentMemoMap"){};L(dl,"getOrCreate",Y2(dl,Rm));let Oa=dl;const Tm=ne(3,(e,t,n)=>Wa(wt(e.build(t,n),gs(Oa,t)),Oa,t)),gL=ne(2,(e,t)=>Be(n=>Tm(e,Oa.getOrCreate(n.context),t))),Mm=function(){return arguments.length===1?e=>kS(Zo(arguments[0],e)):kS(Zo(arguments[0],arguments[1]))},kS=e=>pk(ds(Ce(e))),ap=function(){return arguments.length===1?e=>_S(arguments[0],e):_S(arguments[0],arguments[1])},_S=(e,t)=>up(wt(t,n=>Zo(e,n))),up=e=>pL((t,n)=>Jc(e,n)),mk=(e,t,n)=>{const o=Gc(n,"parallel");return Fs(e,i=>i.build(t,Gc(o,"sequential")),{concurrency:e.length}).pipe(wt(i=>tT(...i)))},gk=(...e)=>Im((t,n)=>mk(e,t,n)),yL=(e,t,n)=>Im((o,i)=>$e(Array.isArray(t)?mk(t,o,i):t.build(o,i),u=>e.build(o,i).pipe(qa(u),wt(l=>n(l,u))))),cp=ne(2,(e,t)=>yL(e,t,Ee)),vL=class extends vl{constructor(t){super(),t&&Object.assign(this,t)}},ni=ne(2,(e,t)=>z1(e,xL,n=>t(n))),ES=e=>e.reasons.some(SL),SL=e=>e._tag==="Fail"&&Em(e.error),wL=m1(Qa,e=>Em(e)?Nr(e):Gn(e)),xL=m1(Qa,e=>Em(e)?Nr(e.value):Gn(e)),Om=ne(2,(e,t)=>jl(e,{onSuccess:t.onSuccess,onFailure:n=>{const o=wL(n);return Tt(o)?t.onFailure(o.failure):t.onDone(o.success.value)}})),yk="~effect/Schedule",CS=Ze("effect/Schedule/CurrentMetadata",{defaultValue:ds({input:void 0,output:void 0,duration:um,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),kL={[yk]:{_Out:Ee,_In:Ee,_Env:Ee},pipe(){return $t(this,arguments)}},_L=e=>Ue(e,yk),Ga=e=>{const t=Object.create(kL);return t.step=e,t},Lm=()=>{let e=0,t,n;return(o,i)=>{n===void 0&&(n=o);const u=o-n,l=t===void 0?0:o-t;return t=o,{input:i,attempt:++e,start:n,now:o,elapsed:u,elapsedSincePrevious:l}}},vk=e=>Ga(wt(e,t=>{const n=Lm();return(o,i)=>t(n(o,i))})),eo=e=>Ha(e.step,t=>Ce(()=>At(t))),EL=e=>ok(t=>wt(eo(e),n=>{const o=Lm();return i=>xt(()=>{const u=t.currentTimeMillisUnsafe();return $e(n(u,i),([l,d])=>{const p=o(u,i);return p.output=l,p.duration=d,ui(_m(d),p)})})})),CL=ne(2,(e,t)=>bL(e,t,(n,o)=>[n,o])),bL=ne(3,(e,t,n)=>Ga(wt(U1(eo(e),eo(t)),([o,i])=>(u,l)=>Om(o(u,l),{onSuccess:d=>i(u,l).pipe(wt(p=>[n(d[0],p[0]),wT(d[1],p[1])]),ni(p=>Hs(n(d[0],p)))),onDone:d=>i(u,l).pipe($e(p=>Hs(n(d,p[0]))),ni(p=>Hs(n(d,p)))),onFailure:At})))),Sk=ne(2,(e,t)=>PL(e,t,(n,o)=>[n,o])),PL=ne(3,(e,t,n)=>Ga(wt(U1(eo(e),eo(t)),([o,i])=>(u,l)=>Om(o(u,l),{onSuccess:d=>i(u,l).pipe(wt(p=>[n(d[0],p[0]),ST(d[1],p[1])]),ni(p=>Ce([n(d[0],p),d[1]]))),onFailure:At,onDone:d=>i(u,l).pipe(wt(p=>[n(d,p[0]),p[1]]),ni(p=>Hs(n(d,p))))})))),wk=(e,t=2)=>{const n=d1(am(e));return vk(Ce(o=>{const i=Ra(n*Math.pow(t,o.attempt-1));return Ce([i,i])}))},xk=e=>Ga(wt(eo(e),t=>(n,o)=>Om(t(n,o),{onSuccess:i=>Ce([o,i[1]]),onFailure:At,onDone:()=>Hs(o)}))),IL=e=>Oc(kk,({attempt:t})=>Ce(t<=e)),Nm=e=>{const t=am(e);return vk(Ce(n=>Ce([n.attempt-1,t])))},Oc=ne(2,(e,t)=>Ga(wt(eo(e),n=>{const o=Lm();return(i,u)=>$e(n(i,u),l=>{const[d,p]=l,g=t({...o(i,u),output:d,duration:p});return $e(Wt(g)?g:Ce(g),y=>y?Ce(l):Hs(d))})}))),kk=Nm(um),RL=(e,t,n)=>H1(o=>$e(n!=null&&n.local?Tm(t,Rm(),o):gL(t,o),i=>qa(e,i))),TL=ne(e=>Wt(e[0]),(e,t,n)=>u1(t)?qa(e,t):RL(e,Array.isArray(t)?gk(...t):t,n)),ML=ne(3,(e,t,n)=>$e(EL(t),o=>{let i=CS.defaultValue(),u;const l=Al(xt(()=>Wa(e,CS,i)),d=>(u=d,$e(o(d),p=>(i=p,l))));return ni(l,d=>Jt(()=>n(u,d)))})),OL=ne(2,(e,t)=>{const n=typeof t=="function"?t(Ee):_L(t)?t:NL(t);return ML(e,n,Ol)}),LL=xk(kk),NL=e=>{let t=e.schedule?xk(e.schedule):LL;return e.while&&(t=Oc(t,({input:n})=>{const o=e.while(n);return Wt(o)?o:Ce(o)})),e.until&&(t=Oc(t,({input:n})=>{const o=e.until(n);return Wt(o)?wt(o,i=>!i):Ce(!o)})),e.times!==void 0&&(t=Oc(t,({attempt:n})=>Ce(n<=e.times))),t},Ko=Wt,_k=Fs,Ek=wm,AL=dM,at=Ce,Am=fM,jL=lM,pr=xt,Nn=St,st=ot,bS=tr,$L=mM,lp=gM,Qe=Ol,FL=At,DL=Ll,Yc=Be,kn=$e,UL=xM,zL=Va,BL=A1,PS=$l,vs=wt,Xc=Ha,VL=BM,Lc=WM,qL=zM,WL=OL,HL=HM,KL=XM,QL=B1,JL=YM,Ck=$1,GL=jl,Zc=jM,bk=D1,YL=TL,Ks=qa,XL=AM,ZL=Nl,eN=Wa,tN=H1,Pk=sO,Ik=oO,nN=aO,Rk=ys,fp=lO,jm=G1,rN=cO,Tk=DM,sN=PO,oN=TO,IS=MO,iN=Z1,$m=mO,dp=yO,el=Ka,aN=ek,uN=vO,ga=wO,cN=tk,lN=SO,fN=xm,Fm=kO,dN=nk,Mk=xO,hN=km,Qs=L1,pN=uk("Error"),mN=ne(e=>Ko(e[0]),(e,...t)=>F1(e,cL,n=>{const o={...n};return t.length===1?Object.assign(o,t[0]):o[t[0]]=t[1],o})),Ok=kM,io=_M,La=EM,qo=wM,gN=CM,hp=yM;function aa(e,t,n){return t==="__proto__"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n,e}function Lk(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function yN(e){return t=>{var n;return(n=Lk(t))==null?void 0:n[e]}}const vN=yN("identifier"),Dm=hs(e=>{const t=vN(e);return typeof t=="string"?t:e.getExpected(Dm)}),SN=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),Nc=new WeakMap,Nk="~effect/data/Redacted",wN=e=>Ue(e,Nk),RS=(e,t)=>{const n=Object.create(xN);return Nc.set(n,e),n},xN={[Nk]:{_A:e=>e},label:void 0,...ms,toJSON(){return this.toString()},toString(){return`<redacted${Gp(this.label)?":"+this.label:""}>`},[Gt](){return ht(Nc.get(this))},[Yt](e){return wN(e)&&Sn(Nc.get(this),Nc.get(e))}},pp="~effect/SchemaIssue/Issue";function kN(e){return Ue(e,pp)}var Ow;let gr=(Ow=pp,class{constructor(){L(this,Ow,pp)}toString(){return MN(this)}}),_N=class extends gr{constructor(n,o,i){super();L(this,"_tag","Filter");L(this,"actual");L(this,"filter");L(this,"issue");this.actual=n,this.filter=o,this.issue=i}};class EN extends gr{constructor(n,o,i){super();L(this,"_tag","Encoding");L(this,"ast");L(this,"actual");L(this,"issue");this.ast=n,this.actual=o,this.issue=i}}class Xn extends gr{constructor(n,o){super();L(this,"_tag","Pointer");L(this,"path");L(this,"issue");this.path=n,this.issue=o}}class Ak extends gr{constructor(n){super();L(this,"_tag","MissingKey");L(this,"annotations");this.annotations=n}}class jk extends gr{constructor(n,o){super();L(this,"_tag","UnexpectedKey");L(this,"ast");L(this,"actual");this.ast=n,this.actual=o}}class qt extends gr{constructor(n,o,i){super();L(this,"_tag","Composite");L(this,"ast");L(this,"actual");L(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class yr extends gr{constructor(n,o){super();L(this,"_tag","InvalidType");L(this,"ast");L(this,"actual");this.ast=n,this.actual=o}}class tl extends gr{constructor(n,o){super();L(this,"_tag","InvalidValue");L(this,"actual");L(this,"annotations");this.actual=n,this.annotations=o}}class TS extends gr{constructor(n,o,i){super();L(this,"_tag","AnyOf");L(this,"ast");L(this,"actual");L(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class CN extends gr{constructor(n,o,i){super();L(this,"_tag","OneOf");L(this,"ast");L(this,"actual");L(this,"successes");this.ast=n,this.actual=o,this.successes=i}}function mp(e,t){if(kN(t))return t;if(typeof t=="string")return new tl(Le(e),{message:t});const n=typeof t.issue=="string"?new tl(Le(e),{message:t.issue}):t.issue;return new Xn(t.path,n)}function bN(e,t){if(t!==void 0)return typeof t=="boolean"?t?void 0:new tl(Le(e)):mp(e,t)}function PN(e,t,n){return Array.isArray(n)?Wc(n)?n.length===1?mp(e,n[0]):new qt(t,Le(e),i1(n,o=>mp(e,o))):void 0:bN(e,n)}const IN=e=>{const t=Na(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return gp(Dm(e.ast),MS(e.actual));case"InvalidValue":return`Invalid data ${MS(e.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${mt(e.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${mt(e.actual)}`}},RN=e=>Na(e.issue)??Na(e);function gp(e,t){return`Expected ${e}, got ${t}`}function Vo(e,t,n,o){switch(e._tag){case"Filter":{const i=o(e);if(i!==void 0)return[{path:t,message:i}];switch(e.issue._tag){case"InvalidValue":return[{path:t,message:gp($k(e.filter),mt(e.actual))}];default:return Vo(e.issue,t,n,o)}}case"Encoding":return Vo(e.issue,t,n,o);case"Pointer":return Vo(e.issue,[...t,...e.path],n,o);case"Composite":return e.issues.flatMap(i=>Vo(i,t,n,o));case"AnyOf":{const i=Na(e);if(e.issues.length===0){if(i!==void 0)return[{path:t,message:i}];const u=gp(Dm(e.ast),mt(e.actual));return[{path:t,message:u}]}return e.issues.flatMap(u=>Vo(u,t,n,o))}default:return[{path:t,message:n(e)}]}}function $k(e){var n;const t=(n=e.annotations)==null?void 0:n.expected;if(typeof t=="string")return t;switch(e._tag){case"Filter":return"<filter>";case"FilterGroup":return e.checks.map(o=>$k(o)).join(" & ")}}function TN(){return e=>Vo(e,[],IN,RN).map(ON).join(`
|
|
82
|
-
`)}const MN=TN();function ON(e){let t=e.message;if(e.path&&e.path.length>0){const n=JR(e.path);t+=`
|
|
83
|
-
at ${n}`}return t}function Na(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return sa(e.ast.annotations);case"InvalidValue":case"Forbidden":return sa(e.annotations);case"MissingKey":return sa(e.annotations,"messageMissingKey");case"UnexpectedKey":return sa(e.ast.annotations,"messageUnexpectedKey");case"Filter":return sa(e.filter.annotations);case"Encoding":return Na(e.issue)}}function sa(e,t="message"){const n=e==null?void 0:e[t];if(typeof n=="string")return n}function MS(e){return so(e)?"no value provided":mt(e.value)}class ri extends vl{constructor(n){super();L(this,"run");this.run=n}map(n){return new ri((o,i)=>this.run(o,i).pipe(Ok(im(n))))}compose(n){return OS(this)?n:OS(n)?this:new ri((o,i)=>this.run(o,i).pipe(qo(u=>n.run(u,i))))}}const Fk=new ri(at);function OS(e){return e.run===Fk.run}function si(){return Fk}function cn(e){return LN(im(e))}function LN(e){return new ri(t=>at(e(t)))}function NN(e){return new ri(t=>{const n=T2(t,kR);return fs(n)?at(n):vs(e,Le)})}function AN(){return cn(globalThis.String)}function Dk(){return cn(globalThis.Number)}const yp="~effect/SchemaTransformation/Transformation";var Lw;Lw=yp;const hl=class hl{constructor(t,n){L(this,Lw,yp);L(this,"_tag","Transformation");L(this,"decode");L(this,"encode");this.decode=t,this.encode=n}flip(){return new hl(this.encode,this.decode)}compose(t){return new hl(this.decode.compose(t.decode),t.encode.compose(this.encode))}};let _n=hl;function jN(e){return Ue(e,yp)}const Uk=e=>jN(e)?e:new _n(e.decode,e.encode);function Vl(e){return new _n(cn(e.decode),cn(e.encode))}const $N=new _n(si(),si());function Um(){return $N}const zk=new _n(Dk(),AN()),Bk=e=>Vl({decode:t=>{const n=new Error(t.message);return typeof t.name=="string"&&t.name!=="Error"&&(n.name=t.name),typeof t.stack=="string"&&(n.stack=t.stack),n},encode:t=>{const n={name:t.name,message:t.message};return e!=null&&e.includeStack&&typeof t.stack=="string"&&(n.stack=t.stack),n}});function ao(e){return t=>t._tag===e}const Vk=ao("Declaration"),FN=ao("Never"),nl=ao("Literal"),DN=ao("UniqueSymbol"),UN=ao("Arrays"),zN=ao("Objects"),BN=ao("Union");class Mt{constructor(t,n){L(this,"to");L(this,"transformation");this.to=t,this.transformation=n}}const VN={};class oi{constructor(t,n,o=void 0,i=void 0){L(this,"isOptional");L(this,"isMutable");L(this,"defaultValue");L(this,"annotations");this.isOptional=t,this.isMutable=n,this.defaultValue=o,this.annotations=i}}const LS="~effect/Schema";var Nw;Nw=LS;class fn{constructor(t=void 0,n=void 0,o=void 0,i=void 0){L(this,Nw,LS);L(this,"annotations");L(this,"checks");L(this,"encoding");L(this,"context");this.annotations=t,this.checks=n,this.encoding=o,this.context=i}toString(){return`<${this._tag}>`}}class Ya extends fn{constructor(n,o,i,u,l,d){super(i,u,l,d);L(this,"_tag","Declaration");L(this,"typeParameters");L(this,"run");this.typeParameters=n,this.run=o}getParser(){const n=this.run(this.typeParameters);return(o,i)=>so(o)?Am:Ok(n(o.value,this,i),Le)}recur(n){const o=ii(this.typeParameters,n);return o===this.typeParameters?this:new Ya(o,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){var o;const n=(o=this.annotations)==null?void 0:o.expected;return typeof n=="string"?n:"<Declaration>"}}let qN=class extends fn{constructor(){super(...arguments);L(this,"_tag","Null")}getParser(){return Hl(this,null)}getExpected(){return"null"}};const zm=new qN;let WN=class extends fn{constructor(){super(...arguments);L(this,"_tag","Undefined")}getParser(){return Hl(this,void 0)}toCodecJson(){return It(this,[qk])}getExpected(){return"undefined"}};const qk=new Mt(zm,new _n(cn(()=>{}),cn(()=>null))),HN=new WN;let KN=class extends fn{constructor(){super(...arguments);L(this,"_tag","Void")}getParser(){return Hl(this,void 0)}toCodecJson(){return It(this,[qk])}getExpected(){return"void"}};const QN=new KN;let JN=class extends fn{constructor(){super(...arguments);L(this,"_tag","Never")}getParser(){return uo(this,ER)}getExpected(){return"never"}};const GN=new JN;let YN=class extends fn{constructor(){super(...arguments);L(this,"_tag","Any")}getParser(){return uo(this,Ox)}getExpected(){return"any"}};const XN=new YN;let ZN=class extends fn{constructor(){super(...arguments);L(this,"_tag","Unknown")}getParser(){return uo(this,Ox)}getExpected(){return"unknown"}};const Bm=new ZN;let ya=class extends fn{constructor(n,o,i,u,l){super(o,i,u,l);L(this,"_tag","Literal");L(this,"literal");if(typeof n=="number"&&!globalThis.Number.isFinite(n))throw new Error(`A numeric literal must be finite, got ${mt(n)}`);this.literal=n}getParser(){return Hl(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?NS(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:NS(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function NS(e){const t=globalThis.String(e.literal);return It(e,[new Mt(new ya(t),new _n(cn(()=>e.literal),cn(()=>t)))])}let eA=class extends fn{constructor(){super(...arguments);L(this,"_tag","String")}getParser(){return uo(this,Gp)}getExpected(){return"string"}};const Wk=new eA;let tA=class extends fn{constructor(){super(...arguments);L(this,"_tag","Number")}getParser(){return uo(this,Mx)}toCodecJson(){return this.checks&&(ua(this.checks,"isFinite")||ua(this.checks,"isInt"))?this:It(this,[dA])}toCodecStringTree(){return this.checks&&(ua(this.checks,"isFinite")||ua(this.checks,"isInt"))?It(this,[_A]):It(this,[EA])}getExpected(){return"number"}};function ua(e,t){return e.some(n=>{var o,i;switch(n._tag){case"Filter":return((i=(o=n.annotations)==null?void 0:o.meta)==null?void 0:i._tag)===t;case"FilterGroup":return ua(n.checks,t)}})}const Hk=new tA;let nA=class extends fn{constructor(){super(...arguments);L(this,"_tag","Boolean")}getParser(){return uo(this,xR)}getExpected(){return"boolean"}};const rA=new nA;class ql extends fn{constructor(n,o,i,u,l,d,p){super(u,l,d,p);L(this,"_tag","Arrays");L(this,"isMutable");L(this,"elements");L(this,"rest");this.isMutable=n,this.elements=o,this.rest=i;const g=o.findIndex(Or);if(g!==-1&&(o.slice(g+1).some(y=>!Or(y))||i.length>1))throw new Error("A required element cannot follow an optional element. ts(1257)");if(i.length>1&&i.slice(1).some(Or))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(n){const o=this,i=o.elements.map(m=>({ast:m,parser:n(m)})),u=o.rest.map(m=>({ast:m,parser:n(m)})),l=i.length,[d,...p]=u,g=p.length;function y(m,v){return v<l?i[v]:v>=m?p[v-m]:d}return hp(function*(m,v){if(m._tag==="None")return m;const w=m.value;if(!Array.isArray(w))return yield*Qe(new yr(o,m));const x=w.length,_={ast:o,getParser:y,oinput:m,len:x,tailThreshold:oA(x,l,g),output:new globalThis.Array(x),issues:void 0,options:v},P=Vm(v==null?void 0:v.concurrency),B=sA(_,w,{concurrency:P==null?void 0:P.concurrency,end:o.rest.length===0?l:Math.max(x,l+g)});if(B&&(yield*B),o.rest.length===0&&x>l)for(let k=l;k<=x-1;k++){const O=new Xn([k],new jk(o,w[k]));if(v.errors==="all")_.issues?_.issues.push(O):_.issues=[O];else return yield*Qe(new qt(o,m,[O]))}return _.issues?yield*Qe(new qt(o,m,_.issues)):Le(_.output)})}recur(n){const o=ii(this.elements,n),i=ii(this.rest,n);return o===this.elements&&i===this.rest?this:new ql(this.isMutable,o,i,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}const sA=Ul()({onItem(e,t,n){const o=n<e.len?Le(t):jn();return e.getParser(e.tailThreshold,n).parser(o,e.options)},step(e,t,n,o){var i;if(n._tag==="Failure")return rl(e,e.ast,o,n);if(n.value._tag==="Some")e.output[o]=n.value.value;else{const u=e.getParser(e.tailThreshold,o);if(Or(u.ast))return;const l=new Xn([o],new Ak((i=u.ast.context)==null?void 0:i.annotations));if(e.options.errors==="all")e.issues?e.issues.push(l):e.issues=[l];else return Ja(new qt(e.ast,e.oinput,[l]))}}});function oA(e,t,n){return Math.max(t,e-n)}const Vm=e=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),rl=(e,t,n,o)=>{const i=Qa(o.cause);if(Tt(i))return o;const u=new Xn([n],i.success);if(e.options.errors==="all")e.issues?e.issues.push(u):e.issues=[u];else return Ja(new qt(t,e.oinput,[u]))},qm="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",iA=new globalThis.RegExp(`(?:${qm}|Infinity|-Infinity|NaN)`);function Kk(e,t){const n=cs(t);switch(n._tag){case"String":return Object.keys(e);case"TemplateLiteral":{const o=SA(n);return Object.keys(e).filter(i=>o.test(i))}case"Symbol":return Object.getOwnPropertySymbols(e);case"Number":return Object.keys(e).filter(o=>iA.test(o));case"Union":return[...new Set(n.types.flatMap(o=>Kk(e,o)))];default:return[]}}class Qk{constructor(t,n){L(this,"name");L(this,"type");this.name=t,this.type=n}}class aA{constructor(t,n,o){L(this,"parameter");L(this,"type");L(this,"merge");if(this.parameter=t,this.type=n,this.merge=o,Or(n)&&!i_(n))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class Wm extends fn{constructor(n,o,i,u,l,d){super(i,u,l,d);L(this,"_tag","Objects");L(this,"propertySignatures");L(this,"indexSignatures");this.propertySignatures=n,this.indexSignatures=o;const p=n.map(g=>g.name).filter((g,y,m)=>m.indexOf(g)!==y);if(p.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(p)}. ts(2300)`)}getParser(n){const o=this,i=[],u=new Set,l=[];for(const g of o.propertySignatures)i.push(g.name),u.add(g.name),l.push({ps:g,parser:n(g.type),name:g.name,type:g.type});const d=o.indexSignatures.length;if(o.propertySignatures.length===0&&o.indexSignatures.length===0)return uo(o,_R);const p=d>0?Ul()({onItem:hp(function*(g,[y,m]){const w=n(l_(m.parameter))(Le(y),g.options),x=xn(w)?w:yield*PS(w);if(x._tag==="Failure"){const O=rl(g,o,y,x);O&&(yield*O);return}const _=Le(g.input[y]),B=n(m.type)(_,g.options),k=xn(B)?B:yield*PS(B);if(k._tag==="Failure"){const O=rl(g,o,y,k);O&&(yield*O);return}else if(x.value._tag==="Some"&&k.value._tag==="Some"){const O=x.value.value,b=k.value.value;if(m.merge&&m.merge.decode&&Object.hasOwn(g.out,O)){const[$,D]=m.merge.decode.combine([O,g.out[O]],[O,b]);aa(g.out,$,D)}else aa(g.out,O,b)}}),step:(g,y,m)=>m._tag==="Failure"?m:void 0}):void 0;return hp(function*(g,y){if(g._tag==="None")return g;const m=g.value;if(!(typeof m=="object"&&m!==null&&!Array.isArray(m)))return yield*Qe(new yr(o,g));const v={},w={ast:o,oinput:g,input:m,out:v,issues:void 0,options:y},x=y.errors==="all",_=y.onExcessProperty==="error",P=y.onExcessProperty==="preserve";let B;if(o.indexSignatures.length===0&&(_||P)){B=Reflect.ownKeys(m);for(let b=0;b<B.length;b++){const $=B[b];if(!u.has($))if(_){const D=new Xn([$],new jk(o,m[$]));if(x){w.issues?w.issues.push(D):w.issues=[D];continue}else return yield*Qe(new qt(o,g,[D]))}else aa(v,$,m[$])}}const k=Vm(y==null?void 0:y.concurrency),O=uA(w,l,k);if(O&&(yield*O),p){const b=H2();for(let D=0;D<d;D++){const A=o.indexSignatures[D],F=Kk(m,A.parameter);for(let W=0;W<F.length;W++){const X=F[W];b.push([X,A])}}const $=p(w,b,k);$&&(yield*$)}if(w.issues)return yield*Qe(new qt(o,g,w.issues));if(y.propertyOrder==="original"){const b=(B??Reflect.ownKeys(m)).concat(i),$={};for(const D of b)Object.hasOwn(v,D)&&aa($,D,v[D]);return Le($)}return Le(v)})}rebuild(n,o){const i=ii(this.propertySignatures,l=>{const d=n(l.type);return d===l.type?l:new Qk(l.name,d)}),u=ii(this.indexSignatures,l=>{var y;const d=n(l.parameter),p=n(l.type),g=o?(y=l.merge)==null?void 0:y.flip():l.merge;return d===l.parameter&&p===l.type&&g===l.merge?l:new aA(d,p,g)});return i===this.propertySignatures&&u===this.indexSignatures?this:new Wm(i,u,this.annotations,this.checks,void 0,this.context)}flip(n){return this.rebuild(n,!0)}recur(n){return this.rebuild(n,!1)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?"object | array":"object"}}const uA=Ul()({onItem(e,t){const n=Object.hasOwn(e.input,t.name)?Le(e.input[t.name]):jn();return t.parser(n,e.options)},step(e,t,n){var o;if(n._tag==="Failure")return rl(e,e.ast,t.name,n);if(n.value._tag==="Some")aa(e.out,t.name,n.value.value);else if(!Or(t.type)){const i=new Xn([t.name],new Ak((o=t.type.context)==null?void 0:o.annotations));if(e.options.errors==="all"){e.issues?e.issues.push(i):e.issues=[i];return}else return Ja(new qt(e.ast,e.oinput,[i]))}}});function Hm(e,t,n){return new Wm(Reflect.ownKeys(e).map(o=>new Qk(o,e[o].ast)),[],n,t)}function Jk(e){return e.ast}function Km(e,t,n){return new Xa(e.map(Jk),t,void 0,n)}function Gk(e){switch(e._tag){case"Null":return["null"];case"Undefined":case"Void":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return e.propertySignatures.length||e.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case"Literal":return[typeof e.literal];case"Union":return Array.from(new Set(e.types.flatMap(Gk)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function Qm(e){var t;switch(e._tag){default:return[];case"Declaration":{const n=(t=e.annotations)==null?void 0:t["~sentinels"];return Array.isArray(n)?n:[]}case"Objects":return e.propertySignatures.flatMap(n=>{const o=n.type;if(!Or(o)){if(nl(o))return[{key:n.name,literal:o.literal}];if(DN(o))return[{key:n.name,literal:o.symbol}]}return[]});case"Arrays":return e.elements.flatMap((n,o)=>nl(n)&&!Or(n)?[{key:o,literal:n.literal}]:[]);case"Suspend":return Qm(e.thunk())}}const AS=new WeakMap;function cA(e){var n,o;let t=AS.get(e);if(t)return t;t={};for(const i of e){const u=cs(i);if(FN(u))continue;const l=Gk(u),d=Qm(u);t.byType??(t.byType={});for(const p of l)((n=t.byType)[p]??(n[p]=[])).push(i);if(d.length>0){t.bySentinel??(t.bySentinel=new Map);for(const{key:p,literal:g}of d){let y=t.bySentinel.get(p);y||t.bySentinel.set(p,y=new Map);let m=y.get(g);m||y.set(g,m=[]),m.push(i)}}else{t.otherwise??(t.otherwise={});for(const p of l)((o=t.otherwise)[p]??(o[p]=[])).push(i)}}return AS.set(e,t),t}function jS(e){return t=>{const n=cs(t);return n._tag==="Literal"?n.literal===e:n._tag==="UniqueSymbol"?n.symbol===e:!0}}function lA(e,t){var i,u;const n=cA(t),o=e===null?"null":Array.isArray(e)?"array":typeof e;if(n.bySentinel){const l=((i=n.otherwise)==null?void 0:i[o])??[];if(o==="object"||o==="array"){for(const[d,p]of n.bySentinel)if(Object.hasOwn(e,d)){const g=p.get(e[d]);if(g)return[...g,...l].filter(jS(e))}}return l}return(((u=n.byType)==null?void 0:u[o])??[]).filter(jS(e))}let Xa=class Yk extends fn{constructor(n,o,i,u,l,d){super(i,u,l,d);L(this,"_tag","Union");L(this,"types");L(this,"mode");this.types=n,this.mode=o}getParser(n){const o=this;return(i,u)=>{if(i._tag==="None")return at(i);const l=i.value,d=lA(l,o.types),p={ast:o,recur:n,oinput:i,input:l,out:void 0,successes:[],issues:void 0,options:u},g=Vm(u==null?void 0:u.concurrency),y=fA(p,d,g);return y?kn(y,m=>p.out?at(p.out):Qe(new TS(o,l,p.issues??[]))):p.out?at(p.out):Qe(new TS(o,l,p.issues??[]))}}recur(n){const o=ii(this.types,n);return o===this.types?this:new Yk(o,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(n){var u;const o=(u=this.annotations)==null?void 0:u.expected;if(typeof o=="string")return o;if(this.types.length===0)return"never";const i=this.types.map(l=>{const d=cs(l);switch(d._tag){case"Arrays":{const p=d.elements.filter(nl);if(p.length>0)return`${$S(d.isMutable)}[ ${p.map(g=>{var y;return n(g)+FS((y=g.context)==null?void 0:y.isOptional)}).join(", ")}, ... ]`;break}case"Objects":{const p=d.propertySignatures.filter(g=>nl(g.type));if(p.length>0)return`{ ${p.map(g=>{var y,m;return`${$S((y=g.type.context)==null?void 0:y.isMutable)}${qc(g.name)}${FS((m=g.type.context)==null?void 0:m.isOptional)}: ${n(g.type)}`}).join(", ")}, ... }`;break}}return n(d)});return Array.from(new Set(i)).join(" | ")}};const fA=Ul()({onItem(e,t){return e.recur(t)(e.oinput,e.options)},step(e,t,n){if(n._tag==="Failure"){const o=Qa(n.cause);if(Tt(o))return n;e.issues?e.issues.push(o.success):e.issues=[o.success]}else{if(e.out&&e.ast.mode==="oneOf")return e.successes.push(t),Ja(new CN(e.ast,e.input,e.successes));if(e.out=n.value,e.successes.push(t),e.ast.mode==="anyOf")return lk}}}),Xk=new Xa([new ya("Infinity"),new ya("-Infinity"),new ya("NaN")],"anyOf"),dA=new Mt(new Xa([Hk,Xk],"anyOf"),new _n(Dk(),cn(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function $S(e){return e?"":"readonly "}function FS(e){return e?"?":""}class sl extends vl{constructor(n,o=void 0,i=!1){super();L(this,"_tag","Filter");L(this,"run");L(this,"annotations");L(this,"aborted");this.run=n,this.annotations=o,this.aborted=i}annotate(n){return new sl(this.run,{...this.annotations,...n},this.aborted)}abort(){return new sl(this.run,this.annotations,!0)}and(n,o){return new ol([this,n],o)}}class ol extends vl{constructor(n,o=void 0){super();L(this,"_tag","FilterGroup");L(this,"checks");L(this,"annotations");this.checks=n,this.annotations=o}annotate(n){return new ol(this.checks,{...this.annotations,...n})}and(n,o){return new ol([this,n],o)}}function Zk(e,t,n=!1){return new sl((o,i,u)=>PN(o,i,e(o,i,u)),t,n)}function hA(e,t){const n=e.source;return Zk(o=>e.test(o),{expected:`a string matching the RegExp ${n}`,meta:{_tag:"isPattern",regExp:e},toArbitraryConstraint:{string:{patterns:[e.source]}},...t})}function Wl(e,t){const n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}function It(e,t){return e.encoding===t?e:Wl(e,n=>{n.encoding.value=t})}function Jm(e,t){return e.context===t?e:Wl(e,n=>{n.context.value=t})}function e_(e,t){if(e.checks){const n=e.checks[e.checks.length-1];return t_(e,o1(e.checks.slice(0,-1),n.annotate(t)))}return Wl(e,n=>{n.annotations.value={...n.annotations.value,...t}})}function t_(e,t){return e.checks===t?e:Wl(e,n=>{n.checks.value=t})}function Gm(e,t){return t_(e,e.checks?[...e.checks,...t]:t)}function n_(e,t){const n=e,o=n[n.length-1],i=t(o.to);return i!==o.to?o1(e.slice(0,e.length-1),new Mt(i,o.transformation)):e}function pA(e){return t=>t.encoding?It(t,n_(t.encoding,e)):t}function mA(e,t,n){const o=new Mt(e,t);return It(n,n.encoding?[...n.encoding,o]:[o])}function ii(e,t){let n=!1;const o=new Array(e.length);for(let i=0;i<e.length;i++){const u=e[i],l=t(u);l!==u&&(n=!0),o[i]=l}return n?o:e}function r_(e,t){const n=e.context?new oi(e.context.isOptional,e.context.isMutable,e.context.defaultValue,{...e.context.annotations,...t}):new oi(!1,!1,void 0,t);return Jm(e,n)}const s_=pA(o_);function o_(e){const t=e.context?e.context.isOptional===!1?new oi(!0,e.context.isMutable,e.context.defaultValue,e.context.annotations):e.context:new oi(!0,!1);return s_(Jm(e,t))}function gA(e,t){const n=new _n(NN(t),si()),o=[new Mt(Bm,n)],i=e.context?new oi(e.context.isOptional,e.context.isMutable,o,e.context.annotations):new oi(!1,!1,o);return Jm(e,i)}function yA(e,t,n){return mA(e,n,t)}function Or(e){var t;return((t=e.context)==null?void 0:t.isOptional)??!1}const il=hs(e=>{var n;if(e.encoding)return il(It(e,void 0));const t=e;return((n=t.recur)==null?void 0:n.call(t,il))??t}),cs=hs(e=>il(Js(e)));function vA(e,t){const n=t,o=n.length,i=n[o-1],u=[new Mt(Js(It(e,void 0)),n[0].transformation.flip())];for(let d=1;d<o;d++)u.unshift(new Mt(Js(n[d-1].to),n[d].transformation.flip()));const l=Js(i.to);return l.encoding?It(l,[...l.encoding,...u]):It(l,u)}const Js=hs(e=>{var n,o;if(e.encoding)return vA(e,e.encoding);const t=e;return((n=t.flip)==null?void 0:n.call(t,Js))??((o=t.recur)==null?void 0:o.call(t,Js))??t});function i_(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(i_);default:return!1}}function a_(e,t){return e.encodedParts.map(n=>wA(n,u_(n),t)).join("")}const SA=hs(e=>new globalThis.RegExp(`^${a_(e,!0)}$`));function u_(e){switch(e._tag){case"Literal":return SN(globalThis.String(e.literal));case"String":return xA;case"Number":return qm;case"BigInt":return CA;case"TemplateLiteral":return a_(e,!1);case"Union":return e.types.map(u_).join("|")}}function wA(e,t,n){if(BN(e)){if(!n)return`(?:${t})`}else if(!n)return t;return`(${t})`}function Hl(e,t){const n=jL(t);return o=>o._tag==="None"?Am:o.value===t?n:Qe(new yr(e,o))}function uo(e,t){return n=>n._tag==="None"?Am:t(n.value)?at(n):Qe(new yr(e,n))}function c_(e){function t(n){return n.encoding?It(n,n_(n.encoding,t)):e(n)}return hs(t)}const l_=c_(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(l_)}}),xA="[\\s\\S]*?",DS=new globalThis.RegExp(`^${qm}$`);function kA(e){return hA(DS,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:DS},...e})}const f_=Gm(Wk,[kA()]),_A=new Mt(f_,zk),EA=new Mt(new Xa([f_,Xk],"anyOf"),zk),CA="-?\\d+";function vp(e,t,n,o,i){for(let u=0;u<e.length;u++){const l=e[u];if(l._tag==="FilterGroup")vp(l.checks,t,n,o,i);else{const d=l.run(t,o,i);if(d&&(n.push(new _N(t,l,d)),l.aborted||(i==null?void 0:i.errors)!=="all"))return}}}const d_="~effect/Schema/Class",bA="~structural";function PA(e){const t=new Set,n=new Set;return o(e);function o(i){if(i===null||typeof i=="string"||typeof i=="boolean")return!0;if(typeof i=="number")return globalThis.Number.isFinite(i);if(typeof i!="object"||i===void 0||t.has(i))return!1;if(n.has(i))return!0;t.add(i);const u=Array.isArray(i)?i.every(o):Object.keys(i).every(l=>o(i[l]));return t.delete(i),u&&n.add(i),u}}const IA=new Ya([],()=>(e,t)=>PA(e)?at(e):Qe(new yr(t,Le(e))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new Mt(Bm,Um())}),RA=new Mt(zm,new _n(si(),cn(()=>null))),TA=new Mt(IA,Um()),MA=R1,ca=pm,OA=Qc,Sp=hm,LA=gO,h_=EO,NA=Symbol.for("effect/MutableList/Empty"),AA=()=>({head:void 0,tail:void 0,length:0}),US=()=>({array:[],mutable:!0,offset:0,next:void 0}),wp=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=US(),e.tail=e.tail.next):e.head=e.tail=US(),e.tail.array.push(t),e.length++},jA=(e,t)=>$A(e,hr(t),!Array.isArray(t)),$A=(e,t,n=!1)=>{if(t.length===0)return 0;const o={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=o:e.head=e.tail=o,e.length+=t.length,t.length},Ac=e=>{e.head=e.tail=void 0,e.length=0},p_=(e,t)=>{var u;if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&((u=e.head)==null?void 0:u.offset)===0&&!e.head.next){const l=e.head.array;return Ac(e),l}const n=new Array(t);let o=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[o++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,o===t)return e.head=i,e.length-=t,e.length===0&&Ac(e),n;i=i.next}return Ac(e),n},FA=e=>{if(!e.head)return NA;const t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:Ac(e)),t},DA="~effect/Queue",UA="~effect/Queue/Enqueue",zA="~effect/Queue/Dequeue",_h={_A:Ee,_E:Ee},BA={[DA]:_h,[UA]:_h,[zA]:_h,...ms,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:JA(this)}}},VA=e=>Be(t=>{const n=Object.create(BA);return n.dispatcher=t.currentDispatcher,n.capacity=(e==null?void 0:e.capacity)??Number.POSITIVE_INFINITY,n.strategy=(e==null?void 0:e.strategy)??"suspend",n.messages=AA(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},Ce(n)}),qA=e=>VA({capacity:e}),WA=(e,t)=>xt(()=>{if(e.state._tag!=="Open")return Ce(hr(t));const n=HA(e,t);return n.length===0?it([]):e.strategy==="dropping"?Ce(n):e3(e,n)}),HA=(e,t)=>{if(e.state._tag!=="Open")return hr(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy==="sliding")return jA(e.messages,t),e.strategy==="sliding"&&p_(e.messages,e.messages.length-e.capacity),BS(e),[];const n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return hr(t);const o=[];let i=0;for(const u of t)i<n?wp(e.messages,u):o.push(u),i++;return BS(e),o},la=ne(2,(e,t)=>St(()=>KA(e,t))),KA=(e,t)=>{if(e.state._tag!=="Open")return!1;const n=An(t),o=OM(n,YA);return e.state.offers.size===0&&e.messages.length===0?(g_(e,o),!0):(e.state={...e.state,_tag:"Closing",exit:o},!0)},zS=e=>la(e,zx(sm())),QA=e=>m_(e,1,Number.POSITIVE_INFINITY),m_=(e,t,n)=>xt(()=>ZA(e,t,n)??Va(t3(e),m_(e,1,n))),JA=e=>e.state._tag==="Done"?0:e.messages.length,GA=it(!0),YA=mr(sm()),XA=e=>{if(e.scheduleRunning=!1,!(e.state._tag==="Done"||e.state.takers.size===0)){for(const t of e.state.takers)if(e.state.takers.delete(t),t($n),e.messages.length===0)break}},BS=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>XA(e),0))},ZA=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;if(n<=0||t<=0)return it([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Eh(e),e.capacity=0;const o=[FA(e.messages)];return Eh(e),it(o)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){const o=p_(e.messages,n);return Eh(e),it(o)}},e3=(e,t)=>tr(n=>{if(e.state._tag!=="Open")return n(it(t));const o={_tag:"Array",remaining:t,offset:0,resume:n};return e.state.offers.add(o),St(()=>{e.state._tag==="Open"&&e.state.offers.delete(o)})}),Eh=e=>{if(e.state._tag==="Done")return ES(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(g_(e,e.state.exit),ES(e.state.exit.cause)):!1;let t=e.capacity-e.messages.length;for(const n of e.state.offers){if(t===0)break;if(n._tag==="Single")wp(e.messages,n.message),t--,n.resume(GA),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;wp(e.messages,n.remaining[n.offset]),t--}n.resume(it([])),e.state.offers.delete(n)}}return!1},t3=e=>tr(t=>e.state._tag==="Done"?t(e.state.exit):(e.state.takers.add(t),St(()=>{e.state._tag!=="Done"&&e.state.takers.delete(t)}))),g_=(e,t)=>{if(e.state._tag==="Done")return;const n=e.state;e.state={_tag:"Done",exit:t};for(const o of n.takers)o(t);n.takers.clear();for(const o of n.awaiters)o(t);n.awaiters.clear()},n3="~effect/Channel",r3={[n3]:{_Env:Ee,_InErr:Ee,_InElem:Ee,_OutErr:Ee,_OutElem:Ee},pipe(){return $t(this,arguments)}},Za=e=>{const t=Object.create(r3);return t.transform=(n,o)=>Xc(e(n,o),i=>at(FL(i))),t},s3=(e,t)=>Za((n,o)=>kn(eu(e)(n,o),i=>t(i,o))),o3=e=>Za((t,n)=>e),eu=e=>e.transform,i3=e=>Za((t,n)=>pr(()=>eu(e())(t,n))),a3=e=>o3(at(QA(e))),u3=ne(2,(e,t)=>s3(e,n=>Nn(()=>{let o=0;return vs(n,i=>t(i,o++))}))),c3=e=>Za((t,n)=>{let o;return at(pr(()=>o||e.pipe(Jc(n),kn(i=>eu(i)(t,n)),kn(i=>o=i))))}),l3=(e,t,n)=>pr(()=>{const o=Pm(),i=eu(e)(Hs(),o);return ni(kn(i,t),at).pipe(Rk(u=>Bl(o,u)))}),f3=ne(2,(e,t)=>Za((n,o)=>vs(Ks(eu(e)(n,o),t),Ks(t)))),d3=ne(2,(e,t)=>l3(e,n=>Tk(kn(n,t),{disableYield:!0}))),li=e=>e,fa=hs(e=>{var t;switch(e._tag){case"Declaration":{const n=(t=e.annotations)==null?void 0:t[d_];if(wl(n)){const o=n(e.typeParameters),i=fa(o.to);return It(e,i===o.to?[o]:[new Mt(i,o.transformation)])}return e}case"Objects":case"Arrays":return e.recur(n=>{var i;const o=(i=n.context)==null?void 0:i.defaultValue;return o?It(fa(n),o):fa(n)});case"Suspend":return e.recur(fa);default:return e}});function Kl(e){const t=fa(il(e.ast)),n=Ym(t);return(o,i)=>n(o,i!=null&&i.disableChecks?i!=null&&i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i==null?void 0:i.parseOptions)}function y_(e){const t=Kl(e);return(n,o)=>sL(Mk(t(n,o)))}function h3(e){const t=Kl(e);return(n,o)=>Fm(io(t(n,o),i=>new Error(i.toString(),{cause:i})))}function to(e){return Ym(e.ast)}function p3(e){return y3(to(e))}const m3=p3;function g3(e){return Ym(Js(e.ast))}function Ym(e){const t=jc(e);return(n,o)=>qo(t(Le(n),o??VN),i=>i._tag==="None"?Qe(new tl(i)):at(i.value))}function y3(e){return(t,n)=>Fm(io(e(t,n),o=>new Error(o.toString(),{cause:o})))}const jc=hs(e=>{var i;let t;const n=(i=Lk(e))==null?void 0:i.parseOptions;if(!e.context&&!e.encoding&&!e.checks)return(u,l)=>(t??(t=e.getParser(jc)),n&&(l={...l,...n}),t(u,l));const o=UN(e)||zN(e)||Vk(e)&&e.typeParameters.length>0;return(u,l)=>{n&&(l={...l,...n});const d=e.encoding;let p;if(d){const y=d,m=y.length;for(let v=m-1;v>=0;v--){const w=y[v],x=w.to,_=jc(x);if(p=p?qo(p,P=>_(P,l)):_(u,l),w.transformation._tag==="Transformation"){const P=w.transformation.decode;p=qo(p,B=>P.run(B,l))}else p=w.transformation.decode(p,l)}p=io(p,v=>new EN(e,u,v))}t??(t=e.getParser(jc));let g=p?qo(p,y=>t(y,l)):t(u,l);if(e.checks&&!(l!=null&&l.disableChecks)){const y=e.checks;(l==null?void 0:l.errors)==="all"&&o&&fs(u)&&(g=gN(g,m=>{const v=[];vp(y.filter(x=>{var _;return(_=x.annotations)==null?void 0:_[bA]}),u.value,v,e,l);const w=rS(v)?m._tag==="Composite"&&m.ast===e?new qt(e,m.actual,[...m.issues,...v]):new qt(e,u,[m,...v]):m;return Qe(w)})),g=qo(g,m=>{if(fs(m)){const v=m.value,w=[];if(vp(y,v,w,e,l),rS(w))return Qe(new qt(e,m,w))}return at(m)})}return g}}),xp="~effect/Schema/Schema",v3={[xp]:xp,pipe(){return $t(this,arguments)},annotate(e){return this.rebuild(e_(this.ast,e))},annotateKey(e){return this.rebuild(r_(this.ast,e))},check(...e){return this.rebuild(Gm(this.ast,e))}};function Xm(e,t){const n=Object.create(v3);return t&&Object.assign(n,t),n.ast=e,n.rebuild=o=>Xm(o,t),n.makeEffect=Tx(Kl(n),io(o=>new Ql(o))),n.make=h3(n),n.makeOption=y_(n),n}const VS="~effect/Schema/SchemaError";var Aw;Aw=VS;class Ql{constructor(t){L(this,Aw,VS);L(this,"_tag","SchemaError");L(this,"name","SchemaError");L(this,"issue");this.issue=t}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}const S3=x3(w3);function w3(e){switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function x3(e){return t=>{const n=new Map;for(let u=0;u<t.length;u++)n.set(cs(t[u]),u);const o=[...t].sort((u,l)=>{u=cs(u),l=cs(l);const d=e(u),p=e(l);return d!==p?d-p:n.get(u)-n.get(l)});return o.some((u,l)=>u!==t[l])?o:t}}const va=xp;function Jl(){return(e,t,n)=>We(new Ya(e.map(Jk),o=>t(o.map(i=>We(i))),n))}function v_(e,t){return Jl()([],()=>(n,o)=>e(n)?at(n):Qe(new yr(o,Le(n))),t)}function qS(e){const t=to(e);return(n,o)=>io(t(n,o),i=>new Ql(i))}const k3=m3;function _3(e){const t=g3(e);return(n,o)=>io(t(n,o),i=>new Ql(i))}const E3=_3,We=Xm;function Zm(e){return Ue(e,va)&&e[va]===va}const ft=li(e=>We(o_(e.ast),{schema:e})),fi=li(e=>ft(w_(e)));function un(e){const t=We(new ya(e),{literal:e,transform(n){return t.pipe(ul(un(n),{decode:cn(()=>n),encode:cn(()=>e)}))}});return t}const WS=We(GN),HS=We(XN),C3=We(Bm),b3=We(zm),P3=We(HN),we=We(Wk),eg=We(Hk),Tr=We(rA),al=We(QN);function tg(e,t){return We(e,{fields:t,mapFields(n,o){const i=n(this.fields);return tg(Hm(i,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function be(e){return tg(Hm(e,void 0),e)}const vt=li(e=>We(new ql(!1,[],[e.ast]),{schema:e})),I3=li(e=>We(new ql(!1,[e.ast],[e.ast]),{schema:e}));function S_(e,t){return We(e,{members:t,mapMembers(n,o){const i=n(this.members);return S_(Km(i,this.ast.mode,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function En(e,t){return S_(Km(e,"anyOf",void 0),e)}function vn(e){const t=e.map(un);return We(Km(t,"anyOf",void 0),{literals:e,members:t,mapMembers(n){return En(n(this.members))},pick(n){return vn(n)},transform(n){return En(t.map((o,i)=>o.transform(n[i])))}})}const Ye=li(e=>En([e,b3])),w_=li(e=>En([e,P3]));function ul(e,t){return n=>We(yA(n.ast,e.ast,t?Uk(t):Um()),{from:n,to:e})}function R3(e){return t=>We(gA(t.ast,e),{schema:t})}function dn(e){return un(e).pipe(R3(at(e)))}function T3(e,t){return be({_tag:dn(e),...t})}function M3(e,t){return v_(n=>n instanceof e,t)}function tu(){return(e,t)=>new Mt(e.ast,Uk(t))}const ng=Zk;function O3(e){return ng(t=>globalThis.Number.isFinite(t),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...e})}function L3(e){const t=b2(e.order),n=e.formatter??mt;return(o,i)=>{var u;return ng(l=>t(l,o),{expected:`a value greater than or equal to ${n(o)}`,...(u=e.annotate)==null?void 0:u.call(e,o),...i})}}const x_=L3({order:r1,annotate:e=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:e},toArbitraryConstraint:{number:{min:e}}})});function N3(e){return ng(t=>globalThis.Number.isSafeInteger(t),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...e})}function KS(e,t){const n=Jl()([e,t],([o,i])=>(u,l,d)=>{if(!YO(u))return Qe(new yr(l,Le(u)));switch(u._tag){case"Fail":return La(to(o)(u.error,d),{onSuccess:sp,onFailure:p=>new qt(l,Le(u),[new Xn(["error"],p)])});case"Die":return La(to(i)(u.defect,d),{onSuccess:op,onFailure:p=>new qt(l,Le(u),[new Xn(["defect"],p)])});case"Interrupt":return at(u)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([o,i])=>tu()(En([be({_tag:un("Fail"),error:o}),be({_tag:un("Die"),defect:i}),be({_tag:un("Interrupt"),fiberId:w_(je)})]),Vl({decode:u=>{switch(u._tag){case"Fail":return sp(u.error);case"Die":return op(u.defect);case"Interrupt":return ip(u.fiberId)}},encode:Ee})),toArbitrary:([o,i])=>k_(o,i),toEquivalence:([o,i])=>__(o,i),toFormatter:([o,i])=>E_(o,i)});return We(n.ast,{error:e,defect:t})}function k_(e,t){return(n,o)=>n.oneof(o!=null&&o.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},n.constant(ip()),n.integer({min:1}).map(ip),e.map(i=>sp(i)),t.map(i=>op(i)))}function __(e,t){return(n,o)=>{if(n._tag!==o._tag)return!1;switch(n._tag){case"Fail":return e(n.error,o.error);case"Die":return t(n.defect,o.defect);case"Interrupt":return n.fiberId===o.fiberId}}}function E_(e,t){return n=>{switch(n._tag){case"Fail":return`Fail(${e(n.error)})`;case"Die":return`Die(${t(n.defect)})`;case"Interrupt":return"Interrupt"}}}function QS(e,t){const n=Jl()([e,t],([o,i])=>{const u=vt(KS(o,i));return(l,d,p)=>GO(l)?La(to(u)(l.reasons,p),{onSuccess:rp,onFailure:g=>new qt(d,Le(l),[new Xn(["failures"],g)])}):Qe(new yr(d,Le(l)))},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([o,i])=>tu()(vt(KS(o,i)),Vl({decode:rp,encode:({reasons:u})=>u})),toArbitrary:([o,i])=>C_(o,i),toEquivalence:([o,i])=>b_(o,i),toFormatter:([o,i])=>P_(o,i)});return We(n.ast,{error:e,defect:t})}function C_(e,t){return(n,o)=>n.array(k_(e,t)(n,o)).map(rp)}function b_(e,t){const n=HR(__(e,t));return(o,i)=>n(o.reasons,i.reasons)}function P_(e,t){const n=E_(e,t);return o=>`Cause([${o.reasons.map(n).join(", ")}])`}const I_=be({message:we,name:ft(we),stack:ft(we)}),A3=M3(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>tu()(I_,Bk()),toArbitrary:()=>e=>e.string().map(t=>new globalThis.Error(t))}),JS=new _n(si(),cn(e=>{try{return JSON.parse(JSON.stringify(e))}catch{return mt(e)}})),nr=En([I_.pipe(ul(A3,Bk())),HS.pipe(ul(C3.annotate({toCodecJson:()=>tu()(HS,JS),toArbitrary:()=>e=>e.json()}),JS))]);function j3(e,t,n){const o=Jl()([e,t,n],([i,u,l])=>{const d=QS(u,l);return(p,g,y)=>{if(!tL(p))return Qe(new yr(g,Le(p)));switch(p._tag){case"Success":return La(to(i)(p.value,y),{onSuccess:kh,onFailure:m=>new qt(g,Le(p),[new Xn(["value"],m)])});case"Failure":return La(to(d)(p.cause,y),{onSuccess:pa,onFailure:m=>new qt(g,Le(p),[new Xn(["cause"],m)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([i,u,l])=>tu()(En([be({_tag:un("Success"),value:i}),be({_tag:un("Failure"),cause:QS(u,l)})]),Vl({decode:d=>d._tag==="Success"?kh(d.value):pa(d.cause),encode:d=>fk(d)?{_tag:"Success",value:d.value}:{_tag:"Failure",cause:d.cause}})),toArbitrary:([i,u,l])=>(d,p)=>d.oneof(p!=null&&p.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},i.map(g=>kh(g)),C_(u,l)(d,p).map(g=>pa(g))),toEquivalence:([i,u,l])=>{const d=b_(u,l);return(p,g)=>{if(p._tag!==g._tag)return!1;switch(p._tag){case"Success":return i(p.value,g.value);case"Failure":return d(p.cause,g.cause)}}},toFormatter:([i,u,l])=>{const d=P_(u,l);return p=>{switch(p._tag){case"Success":return`Exit.Success(${i(p.value)})`;case"Failure":return`Exit.Failure(${d(p.cause)})`}}}});return We(o.ast,{value:e,error:t,defect:n})}const je=eg.check(O3()),$3=eg.check(N3()),F3=globalThis.Symbol.for("immer-draftable");function rg(e,t,n,o,i){var p,g,y,m;const u=U3(n,t,o),l=R_(t),d=(m=class extends e{constructor(...[v,w]){v=v??{};const x=n.make(v,w);super({...v,...x},{...w,disableChecks:!0})}get[(y=va,g=l,p=F3,g)](){return l}static get ast(){return u(this).ast}static pipe(){return $t(this,arguments)}static rebuild(v){return u(this).rebuild(v)}static make(v,w){return new this(v,w)}static makeOption(v,w){return y_(u(this))(v??{},w)}static makeEffect(v,w){return io(Kl(u(this))(v??{},w),x=>new Ql(x))}static annotate(v){return this.rebuild(e_(this.ast,v))}static annotateKey(v){return this.rebuild(r_(this.ast,v))}static check(...v){return this.rebuild(Gm(this.ast,v))}static extend(v){return(w,x)=>{const _={...n.fields,...w};return rg(this,v,tg(Hm(_,n.ast.checks,{identifier:v}),_),x,i)}}static mapFields(v,w){return n.mapFields(v,w)}},L(m,y,va),L(m,p,!0),L(m,"identifier",t),L(m,"fields",n.fields),m);return i!==void 0&&Object.assign(d.prototype,i(t)),d}function D3(e){return new _n(cn(t=>new e(t)),si())}function R_(e){return`~effect/Schema/Class/${e}`}function U3(e,t,n){let o;return i=>{if(o===void 0){const u=D3(i),l=We(new Ya([e.ast],()=>(d,p)=>d instanceof i||Ue(d,R_(t))?at(d):Qe(new yr(p,Le(d))),{identifier:t,[d_]:([d])=>new Mt(d,u),toCodec:([d])=>new Mt(d.ast,u),toArbitrary:([d])=>()=>d.map(p=>new i(p)),toFormatter:([d])=>p=>`${i.identifier}(${d(p)})`,"~sentinels":Qm(e.ast),...n}));o=e.pipe(ul(l,u))}return o}}function sg(e){return Zm(e)}const z3=e=>(t,n)=>{const o=sg(t)?t:be(t);return rg(vL,e,o,n,i=>({toString(){return`${i}(${mt({...this})})`}}))},Dn=e=>(t,n)=>{const o=sg(t)?t:be(t);return rg(qx,e,o,n,u=>({name:u}))},B3=e=>(t,n,o)=>Dn(e)(sg(n)?n.mapFields(i=>({_tag:dn(t),...i}),{unsafePreserveChecks:!0}):T3(t,n),o);function Ch(e){return We(T_(e.ast))}const T_=c_(e=>{const t=V3(e,T_);return t!==e&&Or(e)?s_(t):t});function V3(e,t){var n,o;switch(e._tag){case"Declaration":{const i=((n=e.annotations)==null?void 0:n.toCodecJson)??((o=e.annotations)==null?void 0:o.toCodec);if(wl(i)){const u=Vk(e)?e.typeParameters.map(p=>Xm(cs(p))):[],l=i(u),d=t(l.to);return It(e,d===l.to?[l]:[new Mt(d,l.transformation)])}return It(e,[RA])}case"Unknown":case"ObjectKeyword":return It(e,[TA]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":{if(e.propertySignatures.some(i=>typeof i.name!="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e});return e.recur(t)}case"Union":{const i=S3(e.types);return i!==e.types?new Xa(i,e.mode,e.annotations,e.checks,e.encoding,e.context).recur(t):e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}const q3="~effect/Stream",W3={_R:Ee,_E:Ee,_A:Ee},H3={[q3]:W3,pipe(){return $t(this,arguments)}},K3=e=>{const t=Object.create(H3);return t.channel=e,t},Q3="~effect/Stream",J3=e=>Ue(e,Q3),nu=K3,G3=e=>e.channel,Y3=e=>nu(i3(()=>e().channel)),X3=e=>nu(a3(e)),Z3=e=>nu(c3(vs(e,G3))),GS=ne(2,(e,t)=>Y3(()=>{let n=0;return nu(u3(e.channel,i1(o=>t(o,n++))))})),ej=ne(2,(e,t)=>nu(f3(e.channel,t))),tj=ne(2,(e,t)=>d3(e.channel,n=>{let o=0;return Ek({while:()=>o<n.length,body:()=>t(n[o++]),step:Ua})})),kp="~effect/FiberSet",nj=e=>Ue(e,kp),rj={[kp]:kp,[Symbol.iterator](){return this.state._tag==="Closed"?N2():this.state.backing[Symbol.iterator]()},...ms,toJSON(){return{_id:"FiberMap",state:this.state}}},sj=(e,t)=>{const n=Object.create(rj);return n.state={_tag:"Open",backing:e},n.deferred=t,n},oj=()=>Pk(Nn(()=>sj(new Set,Cm())),e=>pr(()=>{const t=e.state;if(t._tag==="Closed")return st;e.state={_tag:"Closed"};const n=t.backing;return OA(n).pipe(uL(e.deferred))})),M_=-1,ij=kT(ET(eL,_T(M_))),aj=ne(e=>nj(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.interruptUnsafe(M_);return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(o=>{e.state._tag!=="Closed"&&(e.state.backing.delete(t),dk(o)&&((n==null?void 0:n.propagateInterruption)===!0?!ij(o.cause):!XO(o.cause))&&ma(e.deferred,o))})}),uj=(function(){let e;return()=>(e===void 0&&(e=dp(fp)),e)})(),cj=e=>()=>vs(Zc(),t=>{const n=el(t);return(o,i)=>{if(e.state._tag==="Closed")return uj();const u=n(o,i);return aj(e,u),u}}),YS=e=>bm(e.deferred),lj="~effect/interfaces/PrimaryKey",XS="~effect/ManagedRuntime",fj=(e,t)=>{const n=(t==null?void 0:t.memoMap)??Rm(),o=Pm("parallel"),i=Gc(o,"sequential"),u={onFiberStart:LA(o)},l=y=>y?{...y,onFiberStart:y.onFiberStart?m=>{u.onFiberStart(m),y.onFiberStart(m)}:u.onFiberStart}:u;let d;const p=Yc(y=>(d||(d=dp(BL(Tm(e,n,i),m=>Nn(()=>{g.cachedContext=m})),{...u,scheduler:y.currentScheduler})),UL(MA(d)))),g={[XS]:XS,memoMap:n,scope:o,contextEffect:p,cachedContext:void 0,context(){return g.cachedContext===void 0?ga(g.contextEffect):Promise.resolve(g.cachedContext)},dispose(){return ga(g.disposeEffect)},disposeEffect:pr(()=>(g.contextEffect=DL("ManagedRuntime disposed"),g.cachedContext=void 0,Bl(g.scope,lk))),runFork(y,m){return g.cachedContext===void 0?dp(Do(g,y),l(m)):el(g.cachedContext)(y,l(m))},runCallback(y,m){return g.cachedContext===void 0?uN(Do(g,y),l(m)):aN(g.cachedContext)(y,l(m))},runSyncExit(y){return g.cachedContext===void 0?Mk(Do(g,y)):hN(g.cachedContext)(y)},runSync(y){return g.cachedContext===void 0?Fm(Do(g,y)):dN(g.cachedContext)(y)},runPromiseExit(y,m){return g.cachedContext===void 0?lN(Do(g,y),l(m)):fN(g.cachedContext)(y,l(m))},runPromise(y,m){return g.cachedContext===void 0?ga(Do(g,y),l(m)):cN(g.cachedContext)(y,l(m))}};return g};function Do(e,t){return kn(e.contextEffect,n=>Ks(t,n))}const _p="~effect/rpc/RpcSchema/StreamSchema";function O_(e){return Ue(e,_p)}function L_(e){return O_(e)?Le({success:e.success,error:e.error}):jn()}const dj=v_(J3);function hj(e,t){return We(dj.ast,{[_p]:_p,success:e,error:t})}const ZS="~effect/rpc/Rpc",pj={[ZS]:ZS,pipe(){return $t(this,arguments)},setSuccess(e){return ns({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return ns({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return ns({_tag:this._tag,payloadSchema:Zm(e)?e:be(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return ns({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return ns({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return ns({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:gs(this.annotations,e,t)})},annotateMerge(e){return ns({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:ei(this.annotations,e)})}},ns=e=>{function t(){}return Object.setPrototypeOf(t,pj),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},di=(e,t)=>{const n=(t==null?void 0:t.success)??al,o=(t==null?void 0:t.error)??WS,i=(t==null?void 0:t.defect)??nr;let u;return t!=null&&t.primaryKey?u=class extends z3(`effect/rpc/Rpc/${e}`)(t.payload){[lj](){return t.primaryKey(this)}}:u=Zm(t==null?void 0:t.payload)?t==null?void 0:t.payload:t!=null&&t.payload?be(t==null?void 0:t.payload):al,ns({_tag:e,payloadSchema:u,successSchema:t!=null&&t.stream?hj(n,o):n,errorSchema:t!=null&&t.stream?WS:o,defectSchema:i,annotations:Yn(),middlewares:new Set})},bh=new WeakMap,mj=e=>{if(bh.has(e))return bh.get(e);const t=e,n=new Set([t.errorSchema]),o=L_(t.successSchema);fs(o)&&n.add(o.value.error);for(const u of t.middlewares)n.add(u.error);const i=j3(fs(o)?al:t.successSchema,En([...n]),t.defectSchema);return bh.set(e,i),i},gj="~effect/rpc/Rpc/Wrapper",yj=e=>gj in e,ew=Symbol.for("~effect/http/Headers"),Aa=Object.create(null);Object.defineProperties(Aa,{[ew]:{value:ew},[kl]:{value(e){return xj(this,Ws(e,kj))}},toJSON:{value(){return _l(this)}},[Yt]:{value(e){return Sj(this,e)}},[Gt]:{value(){return Xp(this)}},toString:{value:Zv.toString},[Xs]:{value:Zv[Xs]}});const vj=e=>Object.assign(Object.create(Aa),e),Sj=F2(WR()),og=Object.create(Aa),wj=e=>{if(e===void 0)return og;if(Symbol.iterator in e){const n=Object.create(Aa);for(const[o,i]of e)n[o.toLowerCase()]=i;return n}const t=Object.create(Aa);for(const[n,o]of Object.entries(e))Array.isArray(o)?t[n.toLowerCase()]=o.join(", "):o!==void 0&&(t[n.toLowerCase()]=o);return t},tw=ne(2,(e,t)=>{const n=vj(e);return Object.assign(n,t),n}),xj=ne(2,(e,t)=>{const n={...e},o=i=>{if(typeof i=="string"){const u=i.toLowerCase();u in e&&(n[u]=RS(e[u]))}else for(const u in e)i.test(u)&&(n[u]=RS(e[u]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)o(t[i]);else o(t);return n}),kj=Ze("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),_j="~effect/http/HttpClientError";class ig extends Dn(_j)({_tag:dn("HttpError"),kind:vn(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:fi(nr)}){static fromHttpClientError(t){return new ig({_tag:"HttpError",kind:t.reason._tag,cause:t.reason})}}const nw="~effect/socket/Socket",ag=Fn("effect/socket/Socket"),Ej=e=>ag.of({[nw]:nw,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(o=>typeof o=="string"?t(Cj.encode(o)):o instanceof Uint8Array?t(o):t(new Uint8Array(o)),n)),runString:e.runString??(e.run?(t,n)=>e.run(o=>t(Ph.decode(o)),n):(t,n)=>e.runRaw(o=>typeof o=="string"?t(o):o instanceof Uint8Array?t(Ph.decode(o)):t(Ph.decode(new Uint8Array(o))),n)),writer:e.writer}),Cj=new TextEncoder,Ph=new TextDecoder,bj="~effect/socket/Socket/CloseEvent",Pj=e=>Ue(e,bj),$c="~effect/socket/Socket/SocketError",Ij=e=>Ue(e,$c);class N_ extends Dn("effect/socket/Socket/SocketReadError")({_tag:dn("SocketReadError"),cause:nr}){constructor(){super(...arguments);L(this,"message","An error occurred during Read")}}class Rj extends Dn("effect/socket/Socket/SocketWriteError")({_tag:dn("SocketWriteError"),cause:nr}){constructor(){super(...arguments);L(this,"message","An error occurred during Write")}}class cl extends Dn("effect/socket/Socket/SocketOpenError")({_tag:dn("SocketOpenError"),kind:vn(["Unknown","Timeout"]),cause:nr}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class ll extends Dn("effect/socket/Socket/SocketCloseError")({_tag:dn("SocketCloseError"),code:eg,closeReason:fi(we)}){static filterClean(t){return function(n){return Qo.is(n)&&n.reason._tag==="SocketCloseError"&&t(n.reason.code)?Nr(n.reason):Gn(n)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}const A_=En([N_,Rj,cl,ll]);var jw,$w;class Qo extends($w=B3($c)("SocketError",{_tag:dn("SocketError"),reason:A_}),jw=$c,$w){constructor(n){var t=(...$4)=>(super(...$4),L(this,jw,$c),L(this,"message",this.reason.message),this);"cause"in n.reason?t({...n,cause:n.reason.cause}):t(n)}static is(n){return Ij(n)}}const Tj=e=>!0;class Mj extends Fn()("~effect/socket/Socket/WebSocket"){}class j_ extends Fn()("@effect/platform/Socket/WebSocketConstructor"){}const Oj=Mm(j_)((e,t)=>new globalThis.WebSocket(e,t)),Lj=(e,t)=>j_.use(n=>Nj(Pk((typeof e=="string"?at(e):e).pipe(vs(o=>n(o,t==null?void 0:t.protocols))),o=>Nn(()=>o.close(1e3))),t)),Nj=(e,t)=>Yc(n=>{let o;const i=h_(!1),u=n.context,l=(t==null?void 0:t.closeCodeIsError)??Tj,d=(y,m)=>tN(Qs(function*(v){const w=yield*oj().pipe(Jc(v)),x=yield*Jc(e,v),_=yield*eN(cj(w)(),Mj,x);let P=!1;function B(b){if(b.data instanceof Blob){const D=kn(AL(()=>b.data.arrayBuffer()),A=>{const F=y(new Uint8Array(A));return Ko(F)?F:st});return _(D)}const $=y(b.data);Ko($)&&_($)}function k(b){x.removeEventListener("message",B),x.removeEventListener("close",O),ma(w.deferred,Qe(new Qo({reason:P?new N_({cause:b}):new cl({kind:"Unknown",cause:b})})))}function O(b){const $=typeof b.code=="number"?b.code:1001;x.removeEventListener("message",B),x.removeEventListener("error",k),ma(w.deferred,Qe(new Qo({reason:new ll({code:$,closeReason:b.reason})})))}if(x.addEventListener("close",O,{once:!0}),x.addEventListener("error",k,{once:!0}),x.addEventListener("message",B),x.readyState!==1){const b=Cm();x.addEventListener("open",()=>{P=!0,ma(b,st)},{once:!0}),yield*bm(b).pipe(QL({duration:(t==null?void 0:t.openTimeout)??1e4,orElse:()=>Qe(new Qo({reason:new cl({kind:"Timeout",cause:new Error('timeout waiting for "open"')})}))}),Ck(YS(w)))}return P=!0,o=x,i.openUnsafe(),m!=null&&m.onOpen&&(yield*m.onOpen),yield*VL(YS(w),ll.filterClean(b=>!l(b)),()=>st)})).pipe(ZL(v=>ei(u,v)),Ik(Nn(()=>{i.closeUnsafe(),o=void 0}))),g=at(y=>i.whenOpen(Nn(()=>{const m=o;Pj(y)?m.close(y.code,y.reason):m.send(y)})));return at(Ej({runRaw:d,writer:g}))}),Aj=Tx(Lj,ap(ag));class $_ extends Fn()("effect/workers/Transferable/Collector"){}const jj=()=>{let e=[];const t=i=>{e.push(...i)},n=()=>e,o=()=>{const i=e;return e=[],i};return $_.of({addAllUnsafe:t,addAll:i=>Nn(()=>t(i)),readUnsafe:n,read:Nn(n),clearUnsafe:o,clear:Nn(o)})};class $j extends Dn("effect/workers/WorkerError/WorkerSpawnError")({_tag:dn("WorkerSpawnError"),message:we,cause:fi(nr)}){}class Fj extends Dn("effect/workers/WorkerError/WorkerSendError")({_tag:dn("WorkerSendError"),message:we,cause:fi(nr)}){}class Dj extends Dn("effect/workers/WorkerError/WorkerReceiveError")({_tag:dn("WorkerReceiveError"),message:we,cause:fi(nr)}){}class Uj extends Dn("effect/workers/WorkerError/WorkerUnknownError")({_tag:dn("WorkerUnknownError"),message:we,cause:fi(nr)}){}const zj=En([$j,Fj,Dj,Uj]),Ih="~effect/rpc/RpcClientError";class Ep extends Dn("effect/rpc/RpcClientError/RpcClientDefect")({_tag:dn("RpcClientDefect"),message:we,cause:nr}){}var Fw,Dw;class rw extends(Dw=Dn(Ih)({_tag:dn("RpcClientError"),reason:En([zj,A_,ig,Ep])}),Fw=Ih,Dw){constructor(){super(...arguments);L(this,Fw,Ih)}get message(){return`${this.reason._tag}: ${this.reason.message}`}}const wc=e=>typeof e=="bigint"?e:BigInt(e),Bj={_tag:"Ping"};var Cp;try{Cp=new TextDecoder}catch{}var le,dr,N=0,qe={},Me,is,On=0,cr=0,Pt,Lr,ln=[],Te,sw={useRecords:!1,mapsAsObjects:!0};class F_{}const D_=new F_;D_.name="MessagePack 0xC1";var ls=!1,ow=2,Vj;class ja{constructor(t){t&&(t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.sequential&&t.trusted!==!1&&(t.trusted=!0,!t.structures&&t.useRecords!=!1&&(t.structures=[],t.maxSharedStructures||(t.maxSharedStructures=0))),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0),t.int64AsNumber&&(t.int64AsType="number")),Object.assign(this,t)}unpack(t,n){if(le)return W_(()=>(Pp(),this?this.unpack(t,n):ja.prototype.unpack.call(sw,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<"u"?Buffer.from(t):new Uint8Array(t)),typeof n=="object"?(dr=n.end||t.length,N=n.start||0):(N=0,dr=n>-1?n:t.length),cr=0,is=null,Pt=null,le=t;try{Te=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(o){throw le=null,t instanceof Uint8Array?o:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof ja){if(qe=this,this.structures)return Me=this.structures,xc(n);(!Me||Me.length>0)&&(Me=[])}else qe=sw,(!Me||Me.length>0)&&(Me=[]);return xc(n)}unpackMultiple(t,n){let o,i=0;try{ls=!0;let u=t.length,l=this?this.unpack(t,u):Gl.unpack(t,u);if(n){if(n(l,i,N)===!1)return;for(;N<u;)if(i=N,n(xc(),i,N)===!1)return}else{for(o=[l];N<u;)i=N,o.push(xc());return o}}catch(u){throw u.lastPosition=i,u.values=o,u}finally{ls=!1,Pp()}}_mergeStructures(t,n){t=t||[],Object.isFrozen(t)&&(t=t.map(o=>o.slice(0)));for(let o=0,i=t.length;o<i;o++){let u=t[o];u&&(u.isShared=!0,o>=32&&(u.highByte=o-32>>5))}t.sharedLength=t.length;for(let o in n||[])if(o>=0){let i=t[o],u=n[o];u&&(i&&((t.restoreStructures||(t.restoreStructures=[]))[o]=i),t[o]=u)}return this.structures=t}decode(t,n){return this.unpack(t,n)}}function xc(e){try{if(!qe.trusted&&!ls){let n=Me.sharedLength||0;n<Me.length&&(Me.length=n)}let t;if(qe.randomAccessStructure&&le[N]<64&&le[N]>=32&&Vj||(t=dt()),Pt&&(N=Pt.postBundlePosition,Pt=null),ls&&(Me.restoreStructures=null),N==dr)Me&&Me.restoreStructures&&iw(),Me=null,le=null,Lr&&(Lr=null);else{if(N>dr)throw new Error("Unexpected end of MessagePack data");if(!ls){let n;try{n=JSON.stringify(t,(o,i)=>typeof i=="bigint"?`${i}n`:i).slice(0,100)}catch(o){n="(JSON view not available "+o+")"}throw new Error("Data read, but end of buffer not reached "+n)}}return t}catch(t){throw Me&&Me.restoreStructures&&iw(),Pp(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||N>dr)&&(t.incomplete=!0),t}}function iw(){for(let e in Me.restoreStructures)Me[e]=Me.restoreStructures[e];Me.restoreStructures=null}function dt(){let e=le[N++];if(e<160)if(e<128){if(e<64)return e;{let t=Me[e&63]||qe.getStructures&&U_()[e&63];return t?(t.read||(t.read=ug(t,e&63)),t.read()):e}}else if(e<144)if(e-=128,qe.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=B_();o==="__proto__"&&(o="__proto_"),t[o]=dt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(dt(),dt());return t}else{e-=144;let t=new Array(e);for(let n=0;n<e;n++)t[n]=dt();return qe.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(cr>=N)return is.slice(N-On,(N+=t)-On);if(cr==0&&dr<140){let n=t<16?cg(t):z_(t);if(n!=null)return n}return bp(t)}else{let t;switch(e){case 192:return null;case 193:return Pt?(t=dt(),t>0?Pt[1].slice(Pt.position1,Pt.position1+=t):Pt[0].slice(Pt.position0,Pt.position0-=t)):D_;case 194:return!1;case 195:return!0;case 196:if(t=le[N++],t===void 0)throw new Error("Unexpected end of buffer");return Rh(t);case 197:return t=Te.getUint16(N),N+=2,Rh(t);case 198:return t=Te.getUint32(N),N+=4,Rh(t);case 199:return js(le[N++]);case 200:return t=Te.getUint16(N),N+=2,js(t);case 201:return t=Te.getUint32(N),N+=4,js(t);case 202:if(t=Te.getFloat32(N),qe.useFloat32>2){let n=lg[(le[N]&127)<<1|le[N+1]>>7];return N+=4,(n*t+(t>0?.5:-.5)>>0)/n}return N+=4,t;case 203:return t=Te.getFloat64(N),N+=8,t;case 204:return le[N++];case 205:return t=Te.getUint16(N),N+=2,t;case 206:return t=Te.getUint32(N),N+=4,t;case 207:return qe.int64AsType==="number"?(t=Te.getUint32(N)*4294967296,t+=Te.getUint32(N+4)):qe.int64AsType==="string"?t=Te.getBigUint64(N).toString():qe.int64AsType==="auto"?(t=Te.getBigUint64(N),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Te.getBigUint64(N),N+=8,t;case 208:return Te.getInt8(N++);case 209:return t=Te.getInt16(N),N+=2,t;case 210:return t=Te.getInt32(N),N+=4,t;case 211:return qe.int64AsType==="number"?(t=Te.getInt32(N)*4294967296,t+=Te.getUint32(N+4)):qe.int64AsType==="string"?t=Te.getBigInt64(N).toString():qe.int64AsType==="auto"?(t=Te.getBigInt64(N),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Te.getBigInt64(N),N+=8,t;case 212:if(t=le[N++],t==114)return dw(le[N++]&63);{let n=ln[t];if(n)return n.read?(N++,n.read(dt())):n.noBuffer?(N++,n()):n(le.subarray(N,++N));throw new Error("Unknown extension "+t)}case 213:return t=le[N],t==114?(N++,dw(le[N++]&63,le[N++])):js(2);case 214:return js(4);case 215:return js(8);case 216:return js(16);case 217:return t=le[N++],cr>=N?is.slice(N-On,(N+=t)-On):Wj(t);case 218:return t=Te.getUint16(N),N+=2,cr>=N?is.slice(N-On,(N+=t)-On):Hj(t);case 219:return t=Te.getUint32(N),N+=4,cr>=N?is.slice(N-On,(N+=t)-On):Kj(t);case 220:return t=Te.getUint16(N),N+=2,uw(t);case 221:return t=Te.getUint32(N),N+=4,uw(t);case 222:return t=Te.getUint16(N),N+=2,cw(t);case 223:return t=Te.getUint32(N),N+=4,cw(t);default:if(e>=224)return e-256;if(e===void 0){let n=new Error("Unexpected end of MessagePack data");throw n.incomplete=!0,n}throw new Error("Unknown MessagePack token "+e)}}}const qj=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function ug(e,t){function n(){if(n.count++>ow){let i;try{i=e.read=new Function("r","return function(){return "+(qe.freezeData?"Object.freeze":"")+"({"+e.map(u=>u==="__proto__"?"__proto_:r()":qj.test(u)?u+":r()":"["+JSON.stringify(u)+"]:r()").join(",")+"})}")(dt)}catch{return ow=1/0,n()}return e.read0=i,e.highByte===0&&(e.read=aw(t,e.read)),i()}let o={};for(let i=0,u=e.length;i<u;i++){let l=e[i];l==="__proto__"&&(l="__proto_"),o[l]=dt()}return qe.freezeData?Object.freeze(o):o}return n.count=0,e.read0=n,e.highByte===0?aw(t,n):n}const aw=(e,t)=>function(){let n=le[N++];if(n===0)return t();let o=e<32?-(e+(n<<5)):e+(n<<5),i=Me[o]||U_()[o];if(!i)throw new Error("Record id is not defined for "+o);return i.read||(i.read=ug(i,e)),i.read()};function U_(){let e=W_(()=>(le=null,qe.getStructures()));return Me=qe._mergeStructures(e,Me)}var bp=ru,Wj=ru,Hj=ru,Kj=ru;function ru(e){let t;if(e<16&&(t=cg(e)))return t;if(e>64&&Cp)return Cp.decode(le.subarray(N,N+=e));const n=N+e,o=[];for(t="";N<n;){const i=le[N++];if((i&128)===0)o.push(i);else if((i&224)===192){const u=le[N++]&63,l=(i&31)<<6|u;l<128?o.push(65533):o.push(l)}else if((i&240)===224){const u=le[N++]&63,l=le[N++]&63,d=(i&31)<<12|u<<6|l;d<2048||d>=55296&&d<=57343?o.push(65533):o.push(d)}else if((i&248)===240){const u=le[N++]&63,l=le[N++]&63,d=le[N++]&63;let p=(i&7)<<18|u<<12|l<<6|d;p<65536||p>1114111?o.push(65533):(p>65535&&(p-=65536,o.push(p>>>10&1023|55296),p=56320|p&1023),o.push(p))}else o.push(65533);o.length>=4096&&(t+=Ct.apply(String,o),o.length=0)}return o.length>0&&(t+=Ct.apply(String,o)),t}function uw(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=dt();return qe.freezeData?Object.freeze(t):t}function cw(e){if(qe.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=B_();o==="__proto__"&&(o="__proto_"),t[o]=dt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(dt(),dt());return t}}var Ct=String.fromCharCode;function z_(e){let t=N,n=new Array(e);for(let o=0;o<e;o++){const i=le[N++];if((i&128)>0){N=t;return}n[o]=i}return Ct.apply(String,n)}function cg(e){if(e<4)if(e<2){if(e===0)return"";{let t=le[N++];if((t&128)>1){N-=1;return}return Ct(t)}}else{let t=le[N++],n=le[N++];if((t&128)>0||(n&128)>0){N-=2;return}if(e<3)return Ct(t,n);let o=le[N++];if((o&128)>0){N-=3;return}return Ct(t,n,o)}else{let t=le[N++],n=le[N++],o=le[N++],i=le[N++];if((t&128)>0||(n&128)>0||(o&128)>0||(i&128)>0){N-=4;return}if(e<6){if(e===4)return Ct(t,n,o,i);{let u=le[N++];if((u&128)>0){N-=5;return}return Ct(t,n,o,i,u)}}else if(e<8){let u=le[N++],l=le[N++];if((u&128)>0||(l&128)>0){N-=6;return}if(e<7)return Ct(t,n,o,i,u,l);let d=le[N++];if((d&128)>0){N-=7;return}return Ct(t,n,o,i,u,l,d)}else{let u=le[N++],l=le[N++],d=le[N++],p=le[N++];if((u&128)>0||(l&128)>0||(d&128)>0||(p&128)>0){N-=8;return}if(e<10){if(e===8)return Ct(t,n,o,i,u,l,d,p);{let g=le[N++];if((g&128)>0){N-=9;return}return Ct(t,n,o,i,u,l,d,p,g)}}else if(e<12){let g=le[N++],y=le[N++];if((g&128)>0||(y&128)>0){N-=10;return}if(e<11)return Ct(t,n,o,i,u,l,d,p,g,y);let m=le[N++];if((m&128)>0){N-=11;return}return Ct(t,n,o,i,u,l,d,p,g,y,m)}else{let g=le[N++],y=le[N++],m=le[N++],v=le[N++];if((g&128)>0||(y&128)>0||(m&128)>0||(v&128)>0){N-=12;return}if(e<14){if(e===12)return Ct(t,n,o,i,u,l,d,p,g,y,m,v);{let w=le[N++];if((w&128)>0){N-=13;return}return Ct(t,n,o,i,u,l,d,p,g,y,m,v,w)}}else{let w=le[N++],x=le[N++];if((w&128)>0||(x&128)>0){N-=14;return}if(e<15)return Ct(t,n,o,i,u,l,d,p,g,y,m,v,w,x);let _=le[N++];if((_&128)>0){N-=15;return}return Ct(t,n,o,i,u,l,d,p,g,y,m,v,w,x,_)}}}}}function lw(){let e=le[N++],t;if(e<192)t=e-160;else switch(e){case 217:t=le[N++];break;case 218:t=Te.getUint16(N),N+=2;break;case 219:t=Te.getUint32(N),N+=4;break;default:throw new Error("Expected string")}return ru(t)}function Rh(e){return qe.copyBuffers?Uint8Array.prototype.slice.call(le,N,N+=e):le.subarray(N,N+=e)}function js(e){let t=le[N++];if(ln[t]){let n;return ln[t](le.subarray(N,n=N+=e),o=>{N=o;try{return dt()}finally{N=n}})}else throw new Error("Unknown extension type "+t)}var fw=new Array(4096);function B_(){let e=le[N++];if(e>=160&&e<192){if(e=e-160,cr>=N)return is.slice(N-On,(N+=e)-On);if(!(cr==0&&dr<180))return bp(e)}else return N--,V_(dt());let t=(e<<5^(e>1?Te.getUint16(N):e>0?le[N]:0))&4095,n=fw[t],o=N,i=N+e-3,u,l=0;if(n&&n.bytes==e){for(;o<i;){if(u=Te.getUint32(o),u!=n[l++]){o=1879048192;break}o+=4}for(i+=3;o<i;)if(u=le[o++],u!=n[l++]){o=1879048192;break}if(o===i)return N=o,n.string;i-=3,o=N}for(n=[],fw[t]=n,n.bytes=e;o<i;)u=Te.getUint32(o),n.push(u),o+=4;for(i+=3;o<i;)u=le[o++],n.push(u);let d=e<16?cg(e):z_(e);return d!=null?n.string=d:n.string=bp(e)}function V_(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return e.toString();if(e==null)return e+"";if(qe.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(t=>["string","number","boolean","bigint"].includes(typeof t)))return e.flat().toString();throw new Error(`Invalid property type for record: ${typeof e}`)}const dw=(e,t)=>{let n=dt().map(V_),o=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=Me[e];return i&&(i.isShared||ls)&&((Me.restoreStructures||(Me.restoreStructures=[]))[e]=i),Me[e]=n,n.read=ug(n,o),(n.read0||n.read)()};ln[0]=()=>{};ln[0].noBuffer=!0;ln[66]=e=>{let t=e.byteLength%8||8,n=BigInt(e[0]&128?e[0]-256:e[0]);for(let o=1;o<t;o++)n<<=BigInt(8),n+=BigInt(e[o]);if(e.byteLength!==t){let o=new DataView(e.buffer,e.byteOffset,e.byteLength),i=(u,l)=>{let d=l-u;if(d<=40){let m=o.getBigUint64(u);for(let v=u+8;v<l;v+=8)m<<=BigInt(64),m|=o.getBigUint64(v);return m}let p=u+(d>>4<<3),g=i(u,p),y=i(p,l);return g<<BigInt((l-p)*8)|y};n=n<<BigInt((o.byteLength-t)*8)|i(t,o.byteLength)}return n};let hw={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError=="function"?AggregateError:null};ln[101]=()=>{let e=dt();if(!hw[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return hw[e[0]](e[1],{cause:e[2]})};ln[105]=e=>{if(qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Te.getUint32(N-4);Lr||(Lr=new Map);let n=le[N],o;n>=144&&n<160||n==220||n==221?o=[]:n>=128&&n<144||n==222||n==223?o=new Map:(n>=199&&n<=201||n>=212&&n<=216)&&le[N+1]===115?o=new Set:o={};let i={target:o};Lr.set(t,i);let u=dt();if(i.used)Object.assign(o,u);else return i.target=u;if(o instanceof Map)for(let[l,d]of u.entries())o.set(l,d);if(o instanceof Set)for(let l of Array.from(u))o.add(l);return o};ln[112]=e=>{if(qe.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Te.getUint32(N-4),n=Lr.get(t);return n.used=!0,n.target};ln[115]=()=>new Set(dt());const q_=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(e=>e+"Array");let Qj=typeof globalThis=="object"?globalThis:window;ln[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,o=q_[t];if(!o){if(t===16)return n;if(t===17)return new DataView(n);throw new Error("Could not find typed array for code "+t)}return new Qj[o](n)};ln[120]=()=>{let e=dt();return new RegExp(e[0],e[1])};const Jj=[];ln[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=N;return N+=t-e.length,Pt=Jj,Pt=[lw(),lw()],Pt.position0=0,Pt.position1=0,Pt.postBundlePosition=N,N=n,dt()};ln[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date("invalid");function W_(e){let t=dr,n=N,o=On,i=cr,u=is,l=Lr,d=Pt,p=new Uint8Array(le.slice(0,dr)),g=Me,y=Me.slice(0,Me.length),m=qe,v=ls,w=e();return dr=t,N=n,On=o,cr=i,is=u,Lr=l,Pt=d,le=p,ls=v,Me=g,Me.splice(0,Me.length,...y),qe=m,Te=new DataView(le.buffer,le.byteOffset,le.byteLength),w}function Pp(){le=null,Lr=null,Me=null}const lg=new Array(147);for(let e=0;e<256;e++)lg[e]=+("1e"+Math.floor(45.15-e*.30103));var Gl=new ja({useRecords:!1});Gl.unpack;Gl.unpackMultiple;Gl.unpack;let Gj=new Float32Array(1);new Uint8Array(Gj.buffer,0,4);let Fc;try{Fc=new TextEncoder}catch{}let Ip,Rp;const ai=typeof Buffer<"u",kc=ai?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,H_=ai?Buffer:Uint8Array,pw=ai?4294967296:2144337920;let K,oa,ze,j=0,Bt,nt=null,Yj;const Xj=21760,Zj=/[\u0080-\uFFFF]/,Uo=Symbol("record-id");class e$ extends ja{constructor(t){super(t),this.offset=0;let n,o,i,u,l=H_.prototype.utf8Write?function(E,H){return K.utf8Write(E,H,K.byteLength-H)}:Fc&&Fc.encodeInto?function(E,H){return Fc.encodeInto(E,K.subarray(H)).written}:!1,d=this;t||(t={});let p=t&&t.sequential,g=t.structures||t.saveStructures,y=t.maxSharedStructures;if(y==null&&(y=g?32:0),y>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&t.moreTypes==null&&(this.moreTypes=!0);let m=t.maxOwnStructures;m==null&&(m=g?32:64),!this.structures&&t.useRecords!=!1&&(this.structures=[]);let v=y>32||m+y>64,w=y+64,x=y+m+64;if(x>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let _=[],P=0,B=0;this.pack=this.encode=function(E,H){if(K||(K=new kc(8192),ze=K.dataView||(K.dataView=new DataView(K.buffer,0,8192)),j=0),Bt=K.length-10,Bt-j<2048?(K=new kc(K.length),ze=K.dataView||(K.dataView=new DataView(K.buffer,0,K.length)),Bt=K.length-10,j=0):j=j+7&2147483640,n=j,H&o$&&(j+=H&255),u=d.structuredClone?new Map:null,d.bundleStrings&&typeof E!="string"?(nt=[],nt.size=1/0):nt=null,i=d.structures,i){i.uninitialized&&(i=d._mergeStructures(d.getStructures()));let Y=i.sharedLength||0;if(Y>y)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let z=0;z<Y;z++){let G=i[z];if(!G)continue;let re,V=i.transitions;for(let R=0,J=G.length;R<J;R++){let he=G[R];re=V[he],re||(re=V[he]=Object.create(null)),V=re}V[Uo]=z+64}this.lastNamedStructuresLength=Y}p||(i.nextId=Y+64)}o&&(o=!1);let Z;try{d.randomAccessStructure&&!d.readOnlyStructures&&E&&typeof E=="object"?E.constructor===Object?ae(E):E.constructor!==Map&&!Array.isArray(E)&&!Rp.some(z=>E instanceof z)?ae(E.toJSON?E.toJSON():E):b(E):b(E);let Y=nt;if(nt&&gw(n,b,0),u&&u.idsToInsert){let z=u.idsToInsert.sort((R,J)=>R.offset>J.offset?1:-1),G=z.length,re=-1;for(;Y&&G>0;){let R=z[--G].offset+n;R<Y.stringsPosition+n&&re===-1&&(re=0),R>Y.position+n?re>=0&&(re+=6):(re>=0&&(ze.setUint32(Y.position+n,ze.getUint32(Y.position+n)+re),re=-1),Y=Y.previous,G++)}re>=0&&Y&&ze.setUint32(Y.position+n,ze.getUint32(Y.position+n)+re),j+=z.length*6,j>Bt&&W(j),d.offset=j;let V=t$(K.subarray(n,j),z);return u=null,V}return d.offset=j,H&r$?(K.start=n,K.end=j,K):K.subarray(n,j)}catch(Y){throw Z=Y,Y}finally{if(i&&(k(),o&&d.saveStructures)){let Y=i.sharedLength||0,z=K.subarray(n,j),G=n$(i,d);if(!Z)return d.saveStructures(G,G.isCompatible)===!1?(i.uninitialized=!0,d.pack(E,H)):(d.lastNamedStructuresLength=Y,K.length>1073741824&&(K=null),z)}K.length>1073741824&&(K=null),H&s$&&(j=n)}};const k=()=>{B<10&&B++;let E=i.sharedLength||0;if(i.length>E&&!p&&(i.length=E),P>1e4)i.transitions=null,B=0,P=0,_.length>0&&(_=[]);else if(_.length>0&&!p){for(let H=0,Z=_.length;H<Z;H++)_[H][Uo]=0;_=[]}},O=E=>{var H=E.length;H<16?K[j++]=144|H:H<65536?(K[j++]=220,K[j++]=H>>8,K[j++]=H&255):(K[j++]=221,ze.setUint32(j,H),j+=4);for(let Z=0;Z<H;Z++)b(E[Z])},b=E=>{j>Bt&&(K=W(j));var H=typeof E,Z;if(H==="string"){let Y=E.length;if(nt&&Y>=4&&Y<4096){if((nt.size+=Y)>Xj){let V,R=(nt[0]?nt[0].length*3+nt[1].length:0)+10;j+R>Bt&&(K=W(j+R));let J;nt.position?(J=nt,K[j]=200,j+=3,K[j++]=98,V=j-n,j+=4,gw(n,b,0),ze.setUint16(V+n-3,j-n-V)):(K[j++]=214,K[j++]=98,V=j-n,j+=4),nt=["",""],nt.previous=J,nt.size=0,nt.position=V}let re=Zj.test(E);nt[re?0:1]+=E,K[j++]=193,b(re?-Y:Y);return}let z;Y<32?z=1:Y<256?z=2:Y<65536?z=3:z=5;let G=Y*3;if(j+G>Bt&&(K=W(j+G)),Y<64||!l){let re,V,R,J=j+z;for(re=0;re<Y;re++)V=E.charCodeAt(re),V<128?K[J++]=V:V<2048?(K[J++]=V>>6|192,K[J++]=V&63|128):(V&64512)===55296&&((R=E.charCodeAt(re+1))&64512)===56320?(V=65536+((V&1023)<<10)+(R&1023),re++,K[J++]=V>>18|240,K[J++]=V>>12&63|128,K[J++]=V>>6&63|128,K[J++]=V&63|128):(K[J++]=V>>12|224,K[J++]=V>>6&63|128,K[J++]=V&63|128);Z=J-j-z}else Z=l(E,j+z);Z<32?K[j++]=160|Z:Z<256?(z<2&&K.copyWithin(j+2,j+1,j+1+Z),K[j++]=217,K[j++]=Z):Z<65536?(z<3&&K.copyWithin(j+3,j+2,j+2+Z),K[j++]=218,K[j++]=Z>>8,K[j++]=Z&255):(z<5&&K.copyWithin(j+5,j+3,j+3+Z),K[j++]=219,ze.setUint32(j,Z),j+=4),j+=Z}else if(H==="number")if(E>>>0===E)E<32||E<128&&this.useRecords===!1||E<64&&!this.randomAccessStructure?K[j++]=E:E<256?(K[j++]=204,K[j++]=E):E<65536?(K[j++]=205,K[j++]=E>>8,K[j++]=E&255):(K[j++]=206,ze.setUint32(j,E),j+=4);else if(E>>0===E)E>=-32?K[j++]=256+E:E>=-128?(K[j++]=208,K[j++]=E+256):E>=-32768?(K[j++]=209,ze.setInt16(j,E),j+=2):(K[j++]=210,ze.setInt32(j,E),j+=4);else{let Y;if((Y=this.useFloat32)>0&&E<4294967296&&E>=-2147483648){K[j++]=202,ze.setFloat32(j,E);let z;if(Y<4||(z=E*lg[(K[j]&127)<<1|K[j+1]>>7])>>0===z){j+=4;return}else j--}K[j++]=203,ze.setFloat64(j,E),j+=8}else if(H==="object"||H==="function")if(!E)K[j++]=192;else{if(u){let z=u.get(E);if(z){if(!z.id){let G=u.idsToInsert||(u.idsToInsert=[]);z.id=G.push(z)}K[j++]=214,K[j++]=112,ze.setUint32(j,z.id),j+=4;return}else u.set(E,{offset:j-n})}let Y=E.constructor;if(Y===Object)F(E);else if(Y===Array)O(E);else if(Y===Map)if(this.mapAsEmptyObject)K[j++]=128;else{Z=E.size,Z<16?K[j++]=128|Z:Z<65536?(K[j++]=222,K[j++]=Z>>8,K[j++]=Z&255):(K[j++]=223,ze.setUint32(j,Z),j+=4);for(let[z,G]of E)b(z),b(G)}else{for(let z=0,G=Ip.length;z<G;z++){let re=Rp[z];if(E instanceof re){let V=Ip[z];if(V.write){V.type&&(K[j++]=212,K[j++]=V.type,K[j++]=0);let ce=V.write.call(this,E);ce===E?Array.isArray(E)?O(E):F(E):b(ce);return}let R=K,J=ze,he=j;K=null;let de;try{de=V.pack.call(this,E,ce=>(K=R,R=null,j+=ce,j>Bt&&W(j),{target:K,targetView:ze,position:j-ce}),b)}finally{R&&(K=R,ze=J,j=he,Bt=K.length-10)}de&&(de.length+j>Bt&&W(de.length+j),j=mw(de,K,j,V.type));return}}if(Array.isArray(E))O(E);else{if(E.toJSON){const z=E.toJSON();if(z!==E)return b(z)}if(H==="function")return b(this.writeFunction&&this.writeFunction(E));F(E)}}}else if(H==="boolean")K[j++]=E?195:194;else if(H==="bigint"){if(E<9223372036854776e3&&E>=-9223372036854776e3)K[j++]=211,ze.setBigInt64(j,E);else if(E<18446744073709552e3&&E>0)K[j++]=207,ze.setBigUint64(j,E);else if(this.largeBigIntToFloat)K[j++]=203,ze.setFloat64(j,Number(E));else{if(this.largeBigIntToString)return b(E.toString());if(this.useBigIntExtension||this.moreTypes){let Y=E<0?BigInt(-1):BigInt(0),z;if(E>>BigInt(65536)===Y){let G=BigInt(18446744073709552e3)-BigInt(1),re=[];for(;re.push(E&G),E>>BigInt(63)!==Y;)E>>=BigInt(64);z=new Uint8Array(new BigUint64Array(re).buffer),z.reverse()}else{let G=E<0,re=(G?~E:E).toString(16);if(re.length%2?re="0"+re:parseInt(re.charAt(0),16)>=8&&(re="00"+re),ai)z=Buffer.from(re,"hex");else{z=new Uint8Array(re.length/2);for(let V=0;V<z.length;V++)z[V]=parseInt(re.slice(V*2,V*2+2),16)}if(G)for(let V=0;V<z.length;V++)z[V]=~z[V]}z.length+j>Bt&&W(z.length+j),j=mw(z,K,j,66);return}else throw new RangeError(E+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}j+=8}else if(H==="undefined")this.encodeUndefinedAsNil?K[j++]=192:(K[j++]=212,K[j++]=0,K[j++]=0);else throw new Error("Unknown type: "+H)},$=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?E=>{let H;if(this.skipValues){H=[];for(let z in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(z))&&!this.skipValues.includes(E[z])&&H.push(z)}else H=Object.keys(E);let Z=H.length;Z<16?K[j++]=128|Z:Z<65536?(K[j++]=222,K[j++]=Z>>8,K[j++]=Z&255):(K[j++]=223,ze.setUint32(j,Z),j+=4);let Y;if(this.coercibleKeyAsNumber)for(let z=0;z<Z;z++){Y=H[z];let G=Number(Y);b(isNaN(G)?Y:G),b(E[Y])}else for(let z=0;z<Z;z++)b(Y=H[z]),b(E[Y])}:E=>{K[j++]=222;let H=j-n;j+=2;let Z=0;for(let Y in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(Y))&&(b(Y),b(E[Y]),Z++);if(Z>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');K[H+++n]=Z>>8,K[H+n]=Z&255},D=this.useRecords===!1?$:t.progressiveRecords&&!v?E=>{let H,Z=i.transitions||(i.transitions=Object.create(null)),Y=j++-n,z;for(let G in E)if(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(G)){if(H=Z[G],H)Z=H;else{let re=Object.keys(E),V=Z;Z=i.transitions;let R=0;for(let J=0,he=re.length;J<he;J++){let de=re[J];H=Z[de],H||(H=Z[de]=Object.create(null),R++),Z=H}Y+n+1==j?(j--,X(Z,re,R)):te(Z,re,Y,R),z=!0,Z=V[G]}b(E[G])}if(!z){let G=Z[Uo];G?K[Y+n]=G:te(Z,Object.keys(E),Y,0)}}:E=>{let H,Z=i.transitions||(i.transitions=Object.create(null)),Y=0;for(let G in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(G))&&(H=Z[G],H||(H=Z[G]=Object.create(null),Y++),Z=H);let z=Z[Uo];z?z>=96&&v?(K[j++]=((z-=96)&31)+96,K[j++]=z>>5):K[j++]=z:X(Z,Z.__keys__||Object.keys(E),Y);for(let G in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(G))&&b(E[G])},A=typeof this.useRecords=="function"&&this.useRecords,F=A?E=>{A(E)?D(E):$(E)}:D,W=E=>{let H;if(E>16777216){if(E-n>pw)throw new Error("Packed buffer would be larger than maximum buffer size");H=Math.min(pw,Math.round(Math.max((E-n)*(E>67108864?1.25:2),4194304)/4096)*4096)}else H=(Math.max(E-n<<2,K.length-1)>>12)+1<<12;let Z=new kc(H);return ze=Z.dataView||(Z.dataView=new DataView(Z.buffer,0,H)),E=Math.min(E,K.length),K.copy?K.copy(Z,0,n,E):Z.set(K.slice(n,E)),j-=n,n=0,Bt=Z.length-10,K=Z},X=(E,H,Z)=>{let Y=i.nextId;Y||(Y=64),Y<w&&this.shouldShareStructure&&!this.shouldShareStructure(H)?(Y=i.nextOwnId,Y<x||(Y=w),i.nextOwnId=Y+1):(Y>=x&&(Y=w),i.nextId=Y+1);let z=H.highByte=Y>=96&&v?Y-96>>5:-1;E[Uo]=Y,E.__keys__=H,i[Y-64]=H,Y<w?(H.isShared=!0,i.sharedLength=Y-63,o=!0,z>=0?(K[j++]=(Y&31)+96,K[j++]=z):K[j++]=Y):(z>=0?(K[j++]=213,K[j++]=114,K[j++]=(Y&31)+96,K[j++]=z):(K[j++]=212,K[j++]=114,K[j++]=Y),Z&&(P+=B*Z),_.length>=m&&(_.shift()[Uo]=0),_.push(E),b(H))},te=(E,H,Z,Y)=>{let z=K,G=j,re=Bt,V=n;K=oa,j=0,n=0,K||(oa=K=new kc(8192)),Bt=K.length-10,X(E,H,Y),oa=K;let R=j;if(K=z,j=G,Bt=re,n=V,R>1){let J=j+R-1;J>Bt&&W(J);let he=Z+n;K.copyWithin(he+R,he+1,j),K.set(oa.slice(0,R),he),j=J}else K[Z+n]=oa[0]},ae=E=>{let H=Yj(E,K,n,j,i,W,(Z,Y,z)=>{if(z)return o=!0;j=Y;let G=K;return b(Z),k(),G!==K?{position:j,targetView:ze,target:K}:j},this);if(H===0)return F(E);j=H}}useBuffer(t){K=t,K.dataView||(K.dataView=new DataView(K.buffer,K.byteOffset,K.byteLength)),ze=K.dataView,j=0}set position(t){j=t}get position(){return j}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}Rp=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,F_];Ip=[{pack(e,t,n){let o=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&o>=0&&o<4294967296){let{target:i,targetView:u,position:l}=t(6);i[l++]=214,i[l++]=255,u.setUint32(l,o)}else if(o>0&&o<4294967296){let{target:i,targetView:u,position:l}=t(10);i[l++]=215,i[l++]=255,u.setUint32(l,e.getMilliseconds()*4e6+(o/1e3/4294967296>>0)),u.setUint32(l+4,o)}else if(isNaN(o)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:i,targetView:u,position:l}=t(3);i[l++]=212,i[l++]=255,i[l++]=255}else{let{target:i,targetView:u,position:l}=t(15);i[l++]=199,i[l++]=12,i[l++]=255,u.setUint32(l,e.getMilliseconds()*1e6),u.setBigInt64(l+4,BigInt(Math.floor(o)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let o=Array.from(e),{target:i,position:u}=t(this.moreTypes?3:0);this.moreTypes&&(i[u++]=212,i[u++]=115,i[u++]=0),n(o)}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=101,o[i++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=120,o[i++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?Th(e,16,t):Mh(ai?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==H_&&this.moreTypes?Th(e,q_.indexOf(n.name),t):Mh(e,t)}},{pack(e,t){this.moreTypes?Th(e,17,t):Mh(ai?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:o}=t(1);n[o]=193}}];function Th(e,t,n,o){let i=e.byteLength;if(i+1<256){var{target:u,position:l}=n(4+i);u[l++]=199,u[l++]=i+1}else if(i+1<65536){var{target:u,position:l}=n(5+i);u[l++]=200,u[l++]=i+1>>8,u[l++]=i+1&255}else{var{target:u,position:l,targetView:d}=n(7+i);u[l++]=201,d.setUint32(l,i+1),l+=4}u[l++]=116,u[l++]=t,e.buffer||(e=new Uint8Array(e)),u.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l)}function Mh(e,t){let n=e.byteLength;var o,i;if(n<256){var{target:o,position:i}=t(n+2);o[i++]=196,o[i++]=n}else if(n<65536){var{target:o,position:i}=t(n+3);o[i++]=197,o[i++]=n>>8,o[i++]=n&255}else{var{target:o,position:i,targetView:u}=t(n+5);o[i++]=198,u.setUint32(i,n),i+=4}o.set(e,i)}function mw(e,t,n,o){let i=e.length;switch(i){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:i<256?(t[n++]=199,t[n++]=i):i<65536?(t[n++]=200,t[n++]=i>>8,t[n++]=i&255):(t[n++]=201,t[n++]=i>>24,t[n++]=i>>16&255,t[n++]=i>>8&255,t[n++]=i&255)}return t[n++]=o,t.set(e,n),n+=i,n}function t$(e,t){let n,o=t.length*6,i=e.length-o;for(;n=t.pop();){let u=n.offset,l=n.id;e.copyWithin(u+o,u,i),o-=6;let d=u+o;e[d++]=214,e[d++]=105,e[d++]=l>>24,e[d++]=l>>16&255,e[d++]=l>>8&255,e[d++]=l&255,i=u}return e}function gw(e,t,n){if(nt.length>0){ze.setUint32(nt.position+e,j+n-nt.position-e),nt.stringsPosition=j-e;let o=nt;nt=null,t(o[0]),t(o[1])}}function n$(e,t){return e.isCompatible=n=>{let o=!n||(t.lastNamedStructuresLength||0)===n.length;return o||t._mergeStructures(n),o},e}let K_=new e$({useRecords:!1});K_.pack;K_.pack;const r$=512,s$=1024,o$=2048;class fg extends Fn()("effect/rpc/RpcSerialization"){}const i$=fg.of({contentType:"application/json",includesFraming:!1,makeUnsafe:()=>{const e=new TextDecoder;return{decode:t=>{const n=JSON.parse(typeof t=="string"?t:e.decode(t));return Array.isArray(n)?n:[n]},encode:t=>JSON.stringify(t)}}}),a$=Mm(fg)(i$),u$=e=>pr(()=>{const t=new Set,n=new Map,o=new Map;let i=(u,l)=>bk(d=>{let p=n.get(u);return p||(p=[],n.set(u,p)),p.push([l,d]),st});return vs(e((u,l)=>{const d=o.get(u);return d?d(l):i(u,l)},t),u=>({...u,run(l,d){return lp(function*(){t.add(l),o.set(l,d);const p=n.get(l);if(p){n.delete(l);for(const[g,y]of p)yield*Ks(pr(()=>d(g)),y)}return yield*Rk($L,()=>(t.delete(l),o.delete(l),st))})}}))});let c$=BigInt(0);const l$=Qs(function*(e,t){const n=(t==null?void 0:t.spanPrefix)??"RpcClient",o=(t==null?void 0:t.supportsAck)??!0,i=(t==null?void 0:t.disableTracing)??!1,u=(t==null?void 0:t.generateRequestId)??(()=>c$++),l=yield*Zc(),d=Ws(l,wS),p=new Map;let g=!1;yield*fL(d,Yc(k=>(g=!0,y(rL(k.id)))));const y=Qs(function*(k){for(const[O,b]of p)p.delete(O),b._tag==="Queue"?yield*k._tag==="Success"?zS(b.queue):la(b.queue,k.cause):b.resume(k)}),m=k=>{const O=O_(k.successSchema),b=x(k);return($,D)=>{const A=D!=null&&D.headers?wj(D.headers):og,F=(D==null?void 0:D.context)??Yn();if(!O){const X=te=>v(k,b,te,k.payloadSchema.make($),A,F,(D==null?void 0:D.discard)??!1);return i?X(void 0):oN(`${n}.${k._tag}`,{attributes:t.spanAttributes},X)}const W=w(k,b,k.payloadSchema.make($),A,(D==null?void 0:D.streamBufferSize)??16,F);return D!=null&&D.asQueue?W:Z3(vs(W,X3))}},v=(k,O,b,$,D,A,F)=>Yc(W=>{if(g)return fp;const X=u(),te=O(E=>t.onFromClient({message:E,context:A,discard:F}),{_tag:"Request",id:X,tag:k._tag,payload:$,...b?{traceId:b.traceId,spanId:b.spanId,sampled:b.sampled}:{},headers:tw(W.getRef(vw),D)});if(F)return te;let ae;return rN(bS(E=>{const H={_tag:"Effect",rpc:k,context:A,resume(Z){E(Z),ae&&!ae.pollUnsafe()&&W.currentDispatcher.scheduleTask(()=>{ae.interruptUnsafe(W.id)},0)}};p.set(X,H),ae=te.pipe(b?IS(b,{captureStackTrace:!1}):Ee,el(W.context)),ae.addObserver(Z=>{if(Z._tag==="Failure")return E(Z)})}),E=>(p.delete(X),zL(ca(ae),_(X,Array.from(E),A))))}),w=Qs(function*(k,O,b,$,D,A){if(g)return yield*fp;const F=i?void 0:yield*sN(`${n}.${k._tag}`,{attributes:t.spanAttributes}),W=Sp(),X=u(),te=Rl(W.context,wS);yield*lL(te,E=>p.has(X)?(p.delete(X),_(X,dk(E)?Array.from(ZO(E.cause)):[],A)):st);const ae=yield*qA(D);return p.set(X,{_tag:"Queue",rpc:k,queue:ae,scope:te,context:A}),yield*O(E=>t.onFromClient({message:E,context:A,discard:!1}),{_tag:"Request",id:X,tag:k._tag,payload:b,...F?{traceId:F.traceId,spanId:F.spanId,sampled:F.sampled}:{},headers:tw(W.getRef(vw),$)}).pipe(F?IS(F,{captureStackTrace:!1}):Ee,Xc(E=>la(ae,E)),jm,iN(te,{startImmediately:!0})),ae}),x=k=>{const O=[];for(const b of k.middlewares.values()){const $=l.mapUnsafe.get(`${b.key}/Client`);$&&O.push($)}return O.length===0?(b,$)=>b($):function b($,D,A=O.length-1){return A===-1?$(D):O[A]({rpc:k,request:D,next(F){return b($,F,A-1)}})}},_=(k,O,b)=>bS($=>{const D=Sp();t.onFromClient({message:{_tag:"Interrupt",requestId:k,interruptors:O},context:b,discard:!1}).pipe(KL(1e3),el(D.context)).addObserver(()=>{$(st)})}),P=k=>{switch(k._tag){case"Chunk":{const O=k.requestId,b=p.get(O);return!b||b._tag!=="Queue"?st:WA(b.queue,k.values).pipe(o?kn(()=>t.onFromClient({message:{_tag:"Ack",requestId:k.requestId},context:b.context,discard:!1})):Ee,Xc($=>la(b.queue,$)))}case"Exit":{const O=k.requestId,b=p.get(O);return b?(p.delete(O),b._tag==="Effect"?(b.resume(k.exit),st):k.exit._tag==="Success"?zS(b.queue):la(b.queue,k.exit.cause)):st}case"Defect":return y(nL(k.defect));case"ClientEnd":return st}};let B;if(t.flatten){const k=new Map;B=function(b,$,D){let A=k.get(b);return A||(A=m(e.requests.get(b)),k.set(b,A)),A($,D)}}else B={},e.requests.forEach(k=>{B[k._tag]=m(k)});return{client:B,write:P}});let f$=0;const d$=Qs(function*(e,t){const n=f$++,{run:o,send:i,supportsAck:u,supportsTransferables:l}=yield*Yl,d=new Map,{client:p,write:g}=yield*l$(e,{...t,supportsAck:u,onFromClient({message:y}){switch(y._tag){case"Request":{const m=e.requests.get(y.tag),v=l?jj():void 0,w=Sp(),x={rpc:m,context:v?gs(w.context,$_,v):w.context,schemas:h$(m)};return d.set(y.id,x),x.schemas.encodePayload(y.payload).pipe(Ks(x.context),Lc,kn(_=>i(n,{...y,id:String(y.id),payload:_,headers:Object.entries(y.headers)},v&&v.readUnsafe())))}case"Ack":return d.get(y.requestId)?i(n,{_tag:"Ack",requestId:String(y.requestId)}):st;case"Interrupt":return d.get(y.requestId)?(d.delete(y.requestId),i(n,{_tag:"Interrupt",requestId:String(y.requestId)})):st;case"Eof":return st}}});return yield*o(n,y=>{switch(y._tag){case"Chunk":{const m=wc(y.requestId),v=d.get(m);return!v||so(v.schemas.decodeChunk)?st:v.schemas.decodeChunk.value(y.values).pipe(Ks(v.context),Lc,kn(w=>g({_tag:"Chunk",clientId:0,requestId:wc(y.requestId),values:w})),nN(w=>g({_tag:"Exit",clientId:0,requestId:wc(y.requestId),exit:pa(w)})))}case"Exit":{const m=wc(y.requestId),v=d.get(m);return v?(d.delete(m),v.schemas.decodeExit(y.exit).pipe(Ks(v.context),Lc,GL({onSuccess:w=>g({_tag:"Exit",clientId:0,requestId:m,exit:w}),onFailure:w=>g({_tag:"Exit",clientId:0,requestId:m,exit:pa(w)})}))):st}case"Defect":return g({_tag:"Defect",clientId:0,defect:y$(y.defect)});case"ClientProtocolError":{const m=Ja(y.error);return _k(d.keys(),v=>g({_tag:"Exit",clientId:0,requestId:v,exit:m}))}default:return st}}).pipe(Xc(pN),jm,$m),p}),yw=new WeakMap,h$=e=>{let t=yw.get(e);if(t!==void 0)return t;const n=L_(e.successSchema);return t={decodeChunk:im(n,o=>qS(Ch(I3(o.success)))),encodePayload:E3(Ch(e.payloadSchema)),decodeExit:qS(Ch(mj(e)))},yw.set(e,t),t},vw=Ze("effect/rpc/RpcClient/CurrentHeaders",{defaultValue:()=>og});class Yl extends Fn()("effect/rpc/RpcClient/Protocol"){}L(Yl,"make",u$);const p$=e=>Yl.make(Qs(function*(t,n){const o=yield*ag,i=yield*fg,u=yield*XL(Tp),l=new Map,d=yield*o.writer;let p=i.makeUnsafe();const g=yield*g$(d(p.encode(Bj)));let y;const m=pr(()=>(y=void 0,fs(u)?u.value.onConnect:st)),v=w=>_k(n,x=>t(x,w));return yield*pr(()=>(p=i.makeUnsafe(),g.reset(),o.runRaw(w=>{try{const x=p.decode(w);if(x.length===0)return;let _=0;return Ek({while:()=>_<x.length,body:()=>{const P=x[_++];if(P._tag==="Pong")return g.onPong(),st;if("requestId"in P){const B=l.get(P.requestId);if(B!==void 0)return P._tag==="Exit"&&l.delete(P.requestId),t(B,P)}return v(P)},step:Ua})}catch(x){return v({_tag:"ClientProtocolError",error:new rw({reason:new Ep({message:"Error decoding message",cause:x})})})}},{onOpen:m}).pipe(Ck(kn(g.timeout,()=>Qe(new Qo({reason:new cl({kind:"Timeout",cause:new Error("ping timeout")})}))))))).pipe(kn(()=>Qe(new Qo({reason:new ll({code:1e3})}))),fs(u)?Ik(u.value.onDisconnect):Ee,qL(w=>{const x=Qa(w),_=M2(x);return _&&x.success.reason._tag==="SocketOpenError"?st:(y=new rw({reason:_?x.success.reason:new Ep({message:"Unknown socket error",cause:ck(w)})}),v({_tag:"ClientProtocolError",error:y}))}),WL((e==null?void 0:e.retryPolicy)??m$),mN({module:"RpcClient",method:"makeProtocolSocket"}),$m),{send(w,x){if(y)return Qe(y);x._tag==="Request"&&l.set(x.id,w);const _=p.encode(x);return _===void 0?st:Lc(d(_))},supportsAck:!0,supportsTransferables:!1}})),m$=wk(500,1.5).pipe(Sk(Nm(5e3))),g$=Qs(function*(e){let t=!0;const n=h_(),o=()=>{t=!0,n.closeUnsafe()},i=()=>{t=!0};return yield*pr(()=>t?(t=!1,e):n.open).pipe(JL("5 seconds"),HL,Tk,jm,$m),{timeout:n.await,reset:o,onPong:i}});class Tp extends Fn()("effect/rpc/RpcClient/ConnectionHooks"){}const y$=k3(nr),v$={add(...e){const t=new Map(this.requests);for(const n of e)t.set(n._tag,n);return Ir({requests:t,annotations:this.annotations})},merge(...e){const t=new Map(this.requests),n=new Map(this.annotations.mapUnsafe);for(const o of e){for(const[i,u]of o.requests)t.set(i,u);for(const[i,u]of o.annotations.mapUnsafe)n.set(i,u)}return Ir({requests:t,annotations:us(n)})},omit(...e){const t=new Map(this.requests);for(const n of e)t.delete(n);return Ir({requests:t,annotations:this.annotations})},middleware(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.middleware(e));return Ir({requests:t,annotations:this.annotations})},toHandlers(e){const t=this;return lp(function*(){const n=yield*Zc(),o=Ko(e)?yield*e:e,i=new Map;for(const[u,l]of Object.entries(o)){const d=t.requests.get(u);i.set(d.key,{tag:d._tag,handler:l,context:n})}return us(i)})},prefix(e){const t=new Map;for(const n of this.requests.values()){const o=n.prefix(e);t.set(o._tag,o)}return Ir({requests:t,annotations:this.annotations})},toLayer(e){return up(this.toHandlers(e))},of:Ee,toLayerHandler(e,t){const n=this;return up(lp(function*(){const o=yield*Zc(),i=Ko(t)?yield*t:t,u=new Map,l=n.requests.get(e);return u.set(l.key,{handler:i,context:o}),us(u)}))},accessHandler(e){return bk(t=>{const n=this.requests.get(e),{handler:o,context:i}=t.mapUnsafe.get(n.key);return at((u,l)=>{l.rpc=n;const d=o(u,l),p=yj(d)?d.value:d;return Ko(p)?YL(p,i):ej(p,i)})})},annotate(e,t){return Ir({requests:this.requests,annotations:gs(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(Zo(e,t))},annotateMerge(e){return Ir({requests:this.requests,annotations:ei(this.annotations,e)})},annotateRpcsMerge(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.annotateMerge(ei(e,o.annotations)));return Ir({requests:t,annotations:this.annotations})}},Ir=e=>Object.assign(function(){},v$,{requests:e.requests,annotations:e.annotations}),S$=(...e)=>Ir({requests:new Map(e.map(t=>[t._tag,t])),annotations:Yn()}),w$="/ws",x$=3,Ln={getConfig:"tokmon.getConfig",setConfig:"tokmon.setConfig",refresh:"tokmon.refresh",browseFs:"tokmon.browseFs",snapshot:"tokmon.snapshot",config:"tokmon.config"},k$=vn(["all","summary","table","billing","peak"]),$a=vn(yl),Jo=$3.check(x_(0)),fl=je.check(x_(1)),_$=be({id:we,providerId:$a,name:we,homeDir:we,color:ft(we)}),Q_=be({revision:Jo,interval:fl,billingInterval:fl,clearScreen:Tr,privacyMode:Tr,privacyToggleKey:we,timezone:Ye(we),accounts:vt(_$),activeAccountId:Ye(we),disabledProviders:vt($a),onboarded:Tr,dashboardLayout:vn(["grid","single"]),defaultFocus:vn(["all","last"]),ascii:vn(["auto","on","off"]),allowNetworkAccess:Tr,allowedHosts:vt(we),resetDisplay:vn(["relative","absolute"]),knownProviders:vt($a)}),E$=be({version:un(x$),capabilities:vt(we)}),Xl=be({protocol:E$,config:Q_}),C$=be({expectedRevision:Jo,config:Q_}),b$=be({kind:un("conflict"),state:Xl}),P$=be({kind:un("persistence"),message:we}),I$=be({name:we,path:we,dir:Tr}),R$=be({path:we,parent:Ye(we),entries:vt(I$)}),Oh=be({cost:je,tokens:je,input:je,cacheRead:je,cacheSavings:je}),T$=be({name:we,input:je,output:je,cacheCreate:je,cacheRead:je,cacheSavings:je,cost:je,count:je}),Lh=be({label:we,models:vt(we),input:je,output:je,cacheCreate:je,cacheRead:je,cacheSavings:je,total:je,cost:je,count:je,breakdown:vt(T$)}),M$=be({today:Oh,week:Oh,month:Oh,burnRate:je,series:vt(je)}),O$=be({daily:vt(Lh),weekly:vt(Lh),monthly:vt(Lh)}),L$=En([be({kind:un("percent")}),be({kind:un("dollars"),currency:ft(we)}),be({kind:un("count"),suffix:ft(we)})]),N$=be({label:we,used:je,limit:Ye(je),format:L$,resetsAt:ft(Ye(we)),primary:ft(Tr)}),A$=be({plan:Ye(we),metrics:vt(N$),error:Ye(we),email:ft(Ye(we)),displayName:ft(Ye(we)),activity:ft(Ye(be({series:vt(je),summary:we}))),modelSpend:ft(Ye(vt(be({name:we,usd:je,requests:je})))),asOfMs:ft(je)}),j$=be({id:we,providerId:$a,name:we,color:we,homeDir:Ye(we),hasUsage:Tr,hasBilling:Tr,email:ft(Ye(we)),displayName:ft(Ye(we)),plan:ft(Ye(we)),dashboard:Ye(M$),table:Ye(O$),billing:Ye(A$),summaryState:vn(["pending","ready","error"]),billingState:vn(["pending","ready","error"]),tableState:vn(["pending","ready","error"]),summaryUpdatedAt:ft(Ye(Jo)),billingUpdatedAt:ft(Ye(Jo)),tableUpdatedAt:ft(Ye(Jo))}),$$=be({version:we,generatedAt:Jo,tz:we,intervalMs:fl,billingIntervalMs:ft(fl),providers:vt(be({id:$a,name:we,color:we})),accounts:vt(j$),seeded:Tr,peak:Ye(be({state:vn(["peak","off-peak","weekend"]),label:we,minutesUntilChange:Ye(je),changesAt:ft(Ye(we))}))}),dg=be({}),F$=di(Ln.getConfig,{payload:dg,success:Xl}),D$=di(Ln.setConfig,{payload:C$,success:Xl,error:En([b$,P$])}),U$=di(Ln.refresh,{payload:be({scope:k$}),success:al}),z$=di(Ln.browseFs,{payload:be({path:we}),success:R$}),B$=di(Ln.snapshot,{payload:dg,success:$$,stream:!0}),V$=di(Ln.config,{payload:dg,success:Xl,stream:!0}),q$=S$(F$,D$,U$,z$,B$,V$);class _c extends Fn()("tokmon/client/DaemonRpcClient/TokmonRpcClient"){}const W$=new Function("specifier","return import(specifier)");function H$(e){const t=typeof window>"u"?void 0:window.location.origin,n=new URL(e,t);if(n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),n.protocol!=="ws:"&&n.protocol!=="wss:")throw new Error(`unsupported daemon RPC protocol: ${n.protocol}`);return n.hash="",n.searchParams.delete("tokmonToken"),n.searchParams.delete("wsToken"),n.pathname=w$,n.toString()}function K$(e){return e==="node"?!0:e==="browser"?!1:typeof window>"u"}async function Q$(e,t){return K$(t)?(await W$("@effect/platform-node/NodeSocket")).layerWebSocket(e):Aj(e).pipe(cp(Oj))}function J$(e){const t=e.reconnectBaseDelayMs??250,n=wk(Ra(t),1.5).pipe(Sk(Nm(Ra(2500))));return typeof e.reconnectAttempts=="number"?n.pipe(CL(IL(e.reconnectAttempts))):n}function G$(e,t={}){const n=H$(e),o=new Set;let i=null,u=null,l=!1;const d=(w,x)=>{var _;(_=t.onConn)==null||_.call(t,w,x)},p=w=>{if(w!=null&&w!==i){w.runtime.dispose().catch(()=>{});return}const x=w??i;i=null,u=null,x&&x.runtime.dispose().catch(()=>{})},g=async()=>{const w=await Q$(n,t.transport),x=Mm(Tp,Tp.of({onConnect:Nn(()=>{d("live")}),onDisconnect:Nn(()=>{l||d("reconnecting")})}));return ap(Yl,p$({retryPolicy:J$(t)})).pipe(cp(gk(w,a$,x)))},y=async()=>{if(l)throw new Error("daemon RPC client is closed");return i||u||(d("connecting"),u=(async()=>{let w;try{const x=await g(),_=ap(_c,d$(q$)).pipe(cp(x));if(w=fj(_),await w.runPromise(_c.asEffect()),l)throw await w.dispose(),new Error("daemon RPC client is closed");return i={runtime:w},i}catch(x){throw u=null,await(w==null?void 0:w.dispose().catch(()=>{})),l||d("error",x),x}})(),u)},m=async w=>{const x=await y();try{return await x.runtime.runPromise(_c.use(_=>w(_)))}catch(_){throw l||(p(x),d("error",_)),_}},v=(w,x,_)=>{var X;if(l)return()=>{};let P=null,B=!1,k=null,O=null,b=0,$=Number.POSITIVE_INFINITY,D=!1;const A=()=>{if(!P)return;const te=P;P=null,o.delete(te),((i==null?void 0:i.runtime.runPromise(ca(te)))??ga(ca(te))).catch(()=>{})},F=()=>{var te;l||B||k||(k=setTimeout(()=>{k=null,W()},t.reconnectBaseDelayMs??250),(te=k.unref)==null||te.call(k))};if(_){const te=Math.min(5e3,Math.max(10,(t.snapshotStaleFloorMs??9e4)/2));O=setInterval(()=>{!P||b===0||Date.now()-b<=$||(D=!0,b=Date.now(),d("reconnecting"),A())},te),(X=O.unref)==null||X.call(O)}const W=()=>{(async()=>{try{const te=await y();if(l||B)return;b=Date.now(),$=t.snapshotStaleFloorMs??9e4;const ae=te.runtime.runFork(_c.use(E=>w(E).pipe(tj(H=>Nn(()=>{b=Date.now(),_&&($=_(H));try{x(H)}catch{}})))));P=ae,o.add(ae),ae.addObserver(E=>{if(o.delete(ae),P===ae&&(P=null),l||B)return;const H=D;D=!1,p(te),H||fk(E)?d("reconnecting"):d("error",ck(E.cause)),F()})}catch(te){!l&&!B&&(p(),d("error",te),F())}})()};return W(),()=>{B=!0,k&&(clearTimeout(k),k=null),O&&(clearInterval(O),O=null),A()}};return{getConfig:()=>m(w=>w[Ln.getConfig]({})).then(w=>w),setConfig:w=>m(x=>x[Ln.setConfig](w)).then(x=>x),refresh:(w="all")=>m(x=>x[Ln.refresh]({scope:w})),browseFs:w=>m(x=>x[Ln.browseFs]({path:w})),subscribeSnapshot:w=>v(x=>x[Ln.snapshot]({}).pipe(GS(_=>_)),w,x=>Math.max(t.snapshotStaleFloorMs??9e4,x.intervalMs*3)),subscribeConfig:w=>v(x=>x[Ln.config]({}).pipe(GS(_=>_)),w),async close(){if(l)return;l=!0,d("closed");const w=[...o];o.clear();const x=i??await(u==null?void 0:u.catch(()=>null))??null;await Promise.all(w.map(_=>((x==null?void 0:x.runtime.runPromise(ca(_)))??ga(ca(_))).catch(()=>{}))),i=null,u=null,x&&await x.runtime.dispose().catch(()=>{})}}}let Nh=null;const Mp=new Set;function Y$(e,t,n){const o=new URLSearchParams(t);o.delete("tokmonToken");let i=n.replace(/^#/,"");if(!i.startsWith("/"))i=new URLSearchParams(i).has("tokmonToken")?"/":i;else{const d=i.indexOf("#");if(d!==-1){const g=new URLSearchParams(i.slice(d+1));g.has("tokmonToken")&&(g.delete("tokmonToken"),i=`${i.slice(0,d)}${g.size?`#${g.toString()}`:""}`)}const p=i.indexOf("?");if(p!==-1){const g=new URLSearchParams(i.slice(p+1));g.delete("tokmonToken"),i=`${i.slice(0,p)}${g.size?`?${g.toString()}`:""}`}}const u=o.size?`?${o.toString()}`:"",l=i?`#${i}`:"";return`${e}${u}${l}`}if(typeof window<"u"){const e=`${window.location.pathname}${window.location.search}${window.location.hash}`,t=Y$(window.location.pathname,window.location.search,window.location.hash);t!==e&&window.history.replaceState(window.history.state,"",t)}function X$(e){for(const t of Mp)t(e)}function Z$(e){e!=="closed"&&X$(e)}function hi(){return Nh||(Nh=G$(window.location.origin,{transport:"browser",onConn:Z$})),Nh}function eF(e){return Mp.add(e),()=>{Mp.delete(e)}}function tF(){const[e,t]=ee.useState(null),[n,o]=ee.useState("connecting"),i=ee.useRef(null);return ee.useEffect(()=>{let u=!1,l=null;const d=hi();return l=eF(p=>{u||o(p)}),i.current=d.subscribeSnapshot(p=>{u||(t(p),o("live"))}),()=>{var p;u=!0,l==null||l(),(p=i.current)==null||p.call(i),i.current=null}},[]),{snapshot:e,conn:n}}async function w4(){const e=await hi().getConfig();return{...e,config:Bp(e.config).config}}async function x4(e,t){const n=await hi().setConfig({config:e,expectedRevision:t});return{...n,config:Bp(n.config).config}}async function k4(e){return hi().browseFs(e)}function nF(e){return hi().subscribeConfig(t=>{e({...t,config:Bp(t.config).config})})}async function rF(){return hi().refresh("all")}function sF(e){if(e.key.toLowerCase()!=="r"||e.metaKey||e.ctrlKey||e.altKey)return!1;const t=e.target;return t?t.isContentEditable?!1:!t.tagName||!["INPUT","TEXTAREA","SELECT"].includes(t.tagName):!0}const J_=()=>Promise.all([lr(()=>import("./overview-DD1kP8CP.js"),__vite__mapDeps([5,6,1]),import.meta.url),lr(()=>import("./timeline-B4uG-Emo.js"),__vite__mapDeps([7,2,6,1,3]),import.meta.url)]).then(([e])=>e),G_=()=>Promise.all([lr(()=>import("./analytics-DqdZXOJL.js"),__vite__mapDeps([8,6,1]),import.meta.url),lr(()=>import("./breakdown-kOSSJ3mI.js"),__vite__mapDeps([9,2,6,1]),import.meta.url),lr(()=>import("./timeline-B4uG-Emo.js"),__vite__mapDeps([7,2,6,1,3]),import.meta.url)]).then(([e])=>e),Y_=()=>Promise.all([lr(()=>import("./models-B5ikm83_.js"),__vite__mapDeps([10,6,1]),import.meta.url),lr(()=>import("./breakdown-kOSSJ3mI.js"),__vite__mapDeps([9,2,6,1]),import.meta.url)]).then(([e])=>e),X_=()=>lr(()=>import("./explore-vcsM8K9I.js"),__vite__mapDeps([11,6]),import.meta.url),oF={overview:J_,analytics:G_,models:Y_,explore:X_},iF=ee.lazy(()=>J_().then(e=>({default:e.OverviewTab}))),aF=ee.lazy(()=>G_().then(e=>({default:e.AnalyticsTab}))),uF=ee.lazy(()=>Y_().then(e=>({default:e.ModelsTab}))),cF=ee.lazy(()=>X_().then(e=>({default:e.ExploreTab}))),lF=ee.lazy(()=>lr(()=>import("./settings-sheet-_i2zTQjf.js"),__vite__mapDeps([12,4]),import.meta.url).then(e=>({default:e.SettingsSheet}))),Sw=e=>{oF[e]()},Op=e=>`/${e}`,Z_=ee.createContext(null),Zl=()=>{const e=ee.useContext(Z_);if(!e)throw new Error("useDashboard outside provider");return e};function fF(e=1e3){const[t,n]=ee.useState(()=>Date.now());return ee.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function dF(){const[e,t]=ee.useState(()=>document.documentElement.classList.contains("light")?"light":"dark");return ee.useEffect(()=>{var o;document.documentElement.classList.toggle("light",e==="light"),(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",e==="light"?"#f4f5f5":"#0a0a0a")},[e]),[e,()=>{const o=e==="dark"?"light":"dark";try{localStorage.setItem("tokmon-theme",o)}catch{}t(o)}]}function hF({theme:e,onToggle:t}){return I.jsx("button",{type:"button",onClick:t,title:e==="dark"?"Switch to light":"Switch to dark","aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:p-2.5",children:e==="dark"?I.jsx(nR,{className:"size-3.5"}):I.jsx(rR,{className:"size-3.5"})})}function pF({conn:e,freshAt:t}){const n=fF(),o=e==="live"?"var(--color-positive)":e==="error"?"var(--color-warning)":"var(--color-cost)",i=t?$I(t,n):null,u=e==="live"?i??"live":e==="connecting"?"connecting…":e==="reconnecting"?i?`reconnecting · ${i}`:"reconnecting…":i?`offline · ${i}`:"offline";return I.jsxs("span",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[I.jsxs("span",{className:"relative flex size-2","aria-hidden":!0,children:[e==="live"&&I.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full opacity-60",style:{background:o}}),I.jsx("span",{className:"relative inline-flex size-2 rounded-full",style:{background:o}})]}),I.jsx("span",{className:"inline-block truncate text-fg-dim max-sm:max-w-[7rem]",children:u})]})}function Ah({label:e}){return I.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-2 text-sm text-fg-dim",role:"status","aria-live":"polite",children:[I.jsxs("span",{className:"font-display text-lg text-fg-dim","aria-hidden":!0,children:["tokmon",I.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),I.jsx("span",{className:"text-fg-faint",children:e})]})}function jh(e,t){return e==="error"||e==="reconnecting"?"Connection lost — waiting for the local tokmon daemon…":t}function mF(){const e=document.getElementById("dashboard-content");e&&(e.scrollIntoView({block:"start"}),requestAnimationFrame(()=>e.focus({preventScroll:!0})))}function gF({onOpen:e}){return I.jsx("button",{type:"button",onClick:e,title:"Settings","aria-label":"Open settings",className:"rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent max-sm:p-2.5",children:I.jsx(sR,{className:"size-3.5"})})}function yF({phase:e,onRefresh:t}){const n=e==="refreshing"?"refreshing…":e==="success"?"updated":e==="error"?"refresh failed":"refresh";return I.jsxs("button",{type:"button",onClick:t,disabled:e==="refreshing",title:"Refresh all data (R)","aria-label":"Refresh all data",className:"flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1.5 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg disabled:cursor-wait focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:[I.jsx(oR,{className:`size-3.5 ${e==="refreshing"?"animate-spin motion-reduce:animate-none":""}`}),I.jsx("span",{className:e==="error"?"text-warning":"",children:n})]})}function vF({peak:e,resetDisplay:t,tz:n}){const o=e.state==="peak"?"var(--color-warning)":"var(--color-positive)",i=e.changesAt??(e.minutesUntilChange!=null?new Date(Date.now()+e.minutesUntilChange*6e4).toISOString():null);return I.jsxs("span",{className:"hidden items-center gap-1 text-xs text-fg-dim lg:flex",children:[I.jsx("span",{"aria-hidden":!0,style:{color:o},children:"●"}),I.jsx("span",{style:{color:o},children:e.label}),i&&I.jsxs("span",{className:"tnum text-fg-faint",children:["(",DI(i,t,Date.now(),n),")"]})]})}function SF(){var G,re;const{snapshot:e,conn:t}=tF(),[n,o]=SR(),[i,u]=dF(),[l,d]=ee.useState(!1),[p,g]=ee.useState(Qn.privacyMode),[y,m]=ee.useState(Qn.allowNetworkAccess),[v,w]=ee.useState(Qn.resetDisplay),[x,_]=ee.useState("idle"),P=ee.useRef(null),B=ee.useRef(null);ee.useEffect(()=>{if(t==="live")return nF(V=>{g(V.config.privacyMode),m(V.config.allowNetworkAccess),w(V.config.resetDisplay)})},[t]);const k=ee.useCallback(()=>{if(P.current)return;B.current&&clearTimeout(B.current),_("refreshing");const V=rF().then(()=>_("success")).catch(()=>_("error")).finally(()=>{P.current=null,B.current=setTimeout(()=>_("idle"),3e3)});P.current=V},[]);ee.useEffect(()=>{if(t!=="live"||l)return;const V=R=>{sF(R)&&(R.preventDefault(),k())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[t,k,l]),ee.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const O=ee.useMemo(()=>XI(e,n),[e,n]),b=((G=Cx.find(V=>V.key===n.period))==null?void 0:G.label)??n.period,$=n.period==="all"?void 0:b,D=CI({select:V=>V.location.pathname}),A=((re=Qv.find(V=>Op(V.key)===D))==null?void 0:re.key)??"overview";ee.useEffect(()=>{var de;if(!e)return;const V=new Set(e.providers.map(ce=>ce.id)),R=new Set(e.accounts.map(ce=>ce.id)),J=new Set;for(const ce of e.accounts)for(const _e of((de=ce.table)==null?void 0:de.monthly)??[])for(const Oe of _e.breakdown)J.add(Oe.name);const he=hR(n,{providers:V,accounts:R,models:J,modelsReady:J.size>0});he!==n&&o(he)},[e,n,o]);const F=(e==null?void 0:e.accounts.filter(V=>V.hasUsage))??[],W=F.length>0,X=((e==null?void 0:e.accounts)??[]).some(Qh),te=((e==null?void 0:e.accounts)??[]).some(V=>V.hasBilling&&!Qh(V)),ae=W&&F.every(V=>V.table!=null),E=ee.useRef(!1);ee.useEffect(()=>{ae&&(E.current=!0)},[ae]);const[H,Z]=ee.useState(!1);ee.useEffect(()=>{const V=setTimeout(()=>Z(!0),12e3);return()=>clearTimeout(V)},[]);const Y=!W||ae||E.current||H,z=ee.useMemo(()=>e?{snapshot:e,filters:n,derived:O,periodLabel:b,scopeLabel:$,privacyMode:p,resetDisplay:v}:null,[e,n,O,b,$,p,v]);return I.jsxs("div",{className:"min-h-screen",children:[I.jsx("button",{type:"button",onClick:mF,className:"fixed left-3 top-3 z-[100] -translate-y-20 rounded bg-bg-2 px-3 py-2 text-sm text-fg-bright shadow-lg transition-transform focus-visible:translate-y-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"Skip to dashboard"}),I.jsxs("header",{className:"relative z-30 border-b border-line bg-bg-0/80 backdrop-blur",children:[I.jsxs("div",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px]",children:[I.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3.5",children:[I.jsx("h1",{className:"font-display text-2xl text-fg-bright",children:"TOKMON"}),I.jsxs("span",{className:"hidden text-sm text-fg-faint sm:inline",children:["~/usage ",I.jsx("span",{className:"text-prompt",children:"$"})," ",I.jsx("span",{className:"text-fg-dim",children:A}),I.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),I.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-3",children:[(e==null?void 0:e.peak)&&I.jsx(vF,{peak:e.peak,resetDisplay:v,tz:e.tz}),I.jsx(pF,{conn:t,freshAt:(e==null?void 0:e.generatedAt)??null}),t==="live"&&I.jsx(yF,{phase:x,onRefresh:k}),t==="live"&&I.jsx(gF,{onOpen:()=>d(!0)}),I.jsx(hF,{theme:i,onToggle:u}),Y&&(W||X)&&I.jsx(dR,{derived:O,periodLabel:b,tz:(e==null?void 0:e.tz)??"",version:(e==null?void 0:e.version)??""})]})]}),I.jsx("nav",{className:"-mb-px flex items-center gap-1 overflow-x-auto","aria-label":"Dashboard sections",children:Qv.map(V=>I.jsx(zp,{to:Op(V.key),"aria-current":A===V.key?"page":void 0,onMouseEnter:()=>Sw(V.key),onFocus:()=>Sw(V.key),className:`relative shrink-0 border-b-2 px-3 py-2 font-display text-xs uppercase tracking-wider transition focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent ${A===V.key?"border-accent text-fg-bright":"border-transparent text-fg-faint hover:text-fg-dim"}`,children:V.label},V.key))})]}),I.jsx(uR,{snapshot:e,derived:O,filters:n,setFilters:o,privacyMode:p})]}),I.jsxs("main",{id:"dashboard-content",tabIndex:-1,className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-5 focus:outline-none",children:[y&&I.jsx("div",{className:"mb-4 rounded border border-warning/60 bg-warning/10 px-3 py-2 text-xs text-warning",role:"alert",children:"Unsafe network access is enabled. This dashboard may be reachable from your LAN after the daemon restarts."}),e&&t!=="live"&&I.jsx("div",{className:"mb-4 rounded border border-line bg-bg-1 px-3 py-2 text-xs text-fg-dim",role:"status","aria-live":"polite",children:jh(t,"Reconnecting…")}),(e==null?void 0:e.seeded)&&I.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded border border-line bg-bg-1 px-3 py-1.5 text-xs text-fg-dim",role:"status","aria-live":"polite",children:[I.jsx("span",{className:"inline-flex size-2 rounded-full",style:{background:"var(--color-cost)"},"aria-hidden":!0}),"showing cached data — refreshing…"]}),e?!W&&!X?te&&!H&&t!=="error"?I.jsx(Ah,{label:"reading billing…"}):I.jsx("div",{className:"rounded-md border border-line bg-bg-1 p-8 text-center text-sm text-fg-dim",children:"No providers detected. Open tokmon, enable a provider, then refresh."}):!Y||!z?I.jsx(Ah,{label:jh(t,"reading usage history…")}):I.jsx(Z_.Provider,{value:z,children:I.jsx(kx,{})}):I.jsx(Ah,{label:jh(t,"reading usage…")})]}),I.jsxs("footer",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-6 text-center text-[11px] text-fg-faint",children:["tokmon",e!=null&&e.version?` v${e.version}`:""," · by David Ilie · live LLM usage dashboard"]}),l?I.jsx(ee.Suspense,{fallback:I.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Opening settings…"}),children:I.jsx(lF,{snapshot:e,onClose:()=>d(!1)})}):null]})}function ww(){const{derived:e,periodLabel:t,scopeLabel:n,snapshot:o,privacyMode:i,resetDisplay:u}=Zl();return I.jsx(ee.Suspense,{fallback:I.jsx(ef,{label:"overview"}),children:I.jsx(iF,{derived:e,periodLabel:t,scopeLabel:n,providers:o.providers,privacyMode:i,resetDisplay:u,tz:o.tz})})}function wF(){const{derived:e,scopeLabel:t}=Zl();return I.jsx(ee.Suspense,{fallback:I.jsx(ef,{label:"analytics"}),children:I.jsx(aF,{derived:e,scopeLabel:t})})}function xF(){const{derived:e,scopeLabel:t}=Zl();return I.jsx(ee.Suspense,{fallback:I.jsx(ef,{label:"models"}),children:I.jsx(uF,{derived:e,scopeLabel:t})})}function kF(){const{snapshot:e,filters:t,periodLabel:n,privacyMode:o}=Zl();return I.jsx(ee.Suspense,{fallback:I.jsx(ef,{label:"explore"}),children:I.jsx(cF,{snapshot:e,filters:t,periodLabel:n,privacyMode:o})})}function ef({label:e}){return I.jsxs("div",{className:"min-h-[50vh] content-center text-center text-sm text-fg-faint",role:"status","aria-live":"polite",children:["Loading ",e,"…"]})}const Lp=uI({component:SF}),Ec=(e,t)=>Sx({getParentRoute:()=>Lp,path:Op(e),component:t}),_F=Lp.addChildren([Sx({getParentRoute:()=>Lp,path:"/",component:ww}),Ec("overview",ww),Ec("analytics",wF),Ec("models",xF),Ec("explore",kF)]),EF=xI({routeTree:_F,history:yP(),defaultViewTransition:!0});function CF(){return I.jsx(EI,{router:EF})}const xw="tokmon.preloadReloadAt",bF=3e4;function PF(e,t){return!Number.isFinite(e)||t-e>=bF}function IF(){const e=t=>{t.preventDefault();let n=Number.NaN;try{n=Number(window.sessionStorage.getItem(xw))}catch{}const o=Date.now();if(PF(n,o)){try{window.sessionStorage.setItem(xw,String(o))}catch{}window.location.reload()}};return window.addEventListener("vite:preloadError",e),()=>window.removeEventListener("vite:preloadError",e)}IF();ib.createRoot(document.getElementById("root")).render(I.jsx(ee.StrictMode,{children:I.jsx(Tb,{children:I.jsx(fR,{children:I.jsx(CF,{})})})}));export{ZF as $,e4 as A,$v as B,JF as C,Vp as D,NF as E,lh as F,LF as G,AF as H,TI as I,MI as J,GF as K,jF as L,HF as M,OF as N,s4 as O,Wv as P,eR as Q,Sa as R,aR as S,FF as T,r4 as U,n4 as V,t4 as W,tR as X,MF as Y,k4 as Z,lr as _,zF as a,w4 as a0,nF as a1,x4 as a2,YF as a3,XF as a4,TF as a5,BF as b,iR as c,DI as d,WF as e,DF as f,UF as g,zI as h,qp as i,I as j,Wp as k,XC as l,jI as m,qF as n,Ex as o,$F as p,VI as q,ee as r,Vv as s,WI as t,QF as u,Px as v,KF as w,VF as x,lR as y,ZI as z};
|