tokmon 0.29.3 → 0.29.5
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 +2 -1
- package/dist/{bootstrap-ink-MPWICEIJ.js → bootstrap-ink-VORCPVK4.js} +38 -21
- package/dist/{chunk-AUUBRLBG.js → chunk-3SXVUTV2.js} +2 -2
- package/dist/{chunk-BLUQGJKM.js → chunk-6NJLM5IZ.js} +2 -2
- package/dist/{chunk-BYLWQ46U.js → chunk-6RPYSOBA.js} +6 -3
- package/dist/{chunk-WPZTPMBX.js → chunk-EZHV4R74.js} +20 -8
- package/dist/{chunk-G2A3DVPU.js → chunk-GQCFGAQ6.js} +40 -10
- package/dist/{chunk-5Q5HUOP4.js → chunk-LAJV5JMV.js} +160 -133
- package/dist/{chunk-3D6TO5TS.js → chunk-U2FQXNIU.js} +98 -66
- package/dist/{chunk-YWDMEU3L.js → chunk-UD2IPQK3.js} +1 -1
- package/dist/{cli-command-WL2K5WWR.js → cli-command-X75NGQON.js} +6 -6
- package/dist/cli.js +6 -6
- package/dist/{config-B7QJQTU2.js → config-4JC6X5QT.js} +3 -1
- package/dist/{daemon-A3WGDRFT.js → daemon-O7TOISBH.js} +6 -6
- package/dist/daemon-handle-NBGZUDKE.js +11 -0
- package/dist/server-VWBW53QU.js +12 -0
- package/dist/web/assets/{Area-CEpf7_6d.js → Area-B3FdWS80.js} +1 -1
- package/dist/web/assets/{analytics-CdjcYtmK.js → analytics-DSLBg5Lx.js} +2 -2
- package/dist/web/assets/{breakdown-DM6g0evr.js → breakdown-B1vg0Xn1.js} +1 -1
- package/dist/web/assets/{button-Cu4co7ZR.js → button-CDipMD0w.js} +1 -1
- package/dist/web/assets/{chart-YlnVH1If.js → chart-BRXIwVtE.js} +1 -1
- package/dist/web/assets/{explore-kLpZWR-_.js → explore-DyJiyG0m.js} +1 -1
- package/dist/web/assets/index-CEXpTvdh.js +83 -0
- package/dist/web/assets/{models-XKfoWTDv.js → models-_DeHctpR.js} +2 -2
- package/dist/web/assets/{overview-DC-WVKZ6.js → overview-CmPN-0w3.js} +2 -2
- package/dist/web/assets/{panel-B_U9oe1x.js → panel-DzILyYlc.js} +1 -1
- package/dist/web/assets/settings-sheet-AfoLwoCy.js +1 -0
- package/dist/web/assets/{share-sheet-BaEXe1m9.js → share-sheet-Cfl7PIrk.js} +1 -1
- package/dist/web/assets/{timeline-ar9mdhcb.js → timeline-D_JPTxAw.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/daemon-handle-4E7RSSDB.js +0 -11
- package/dist/server-P6BRXBZ5.js +0 -12
- package/dist/web/assets/index-Dd37pBKy.js +0 -83
- package/dist/web/assets/settings-sheet-B7BuJ3j8.js +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./share-sheet-Cfl7PIrk.js","./button-CDipMD0w.js","./chart-BRXIwVtE.js","./Area-B3FdWS80.js","./overview-CmPN-0w3.js","./panel-DzILyYlc.js","./timeline-D_JPTxAw.js","./analytics-DSLBg5Lx.js","./breakdown-B1vg0Xn1.js","./models-_DeHctpR.js","./explore-DyJiyG0m.js","./settings-sheet-AfoLwoCy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Gb=Object.defineProperty;var Yb=(e,t,n)=>t in e?Gb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L=(e,t,n)=>Yb(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 c of i)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(i){if(i.ep)return;i.ep=!0;const c=n(i);fetch(i.href,c)}})();var T$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dh={exports:{}},da={},hh={exports:{}},Re={};/**
|
|
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 Av;function Zb(){if(Av)return Re;Av=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"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,k={};function P(I,Z,me){this.props=I,this.context=Z,this.refs=k,this.updater=me||x}P.prototype.isReactComponent={},P.prototype.setState=function(I,Z){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,Z,"setState")},P.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function q(){}q.prototype=P.prototype;function _(I,Z,me){this.props=I,this.context=Z,this.refs=k,this.updater=me||x}var A=_.prototype=new q;A.constructor=_,w(A,P.prototype),A.isPureReactComponent=!0;var C=Array.isArray,D=Object.prototype.hasOwnProperty,U={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function T(I,Z,me){var pe,fe={},Pe=null,Le=null;if(Z!=null)for(pe in Z.ref!==void 0&&(Le=Z.ref),Z.key!==void 0&&(Pe=""+Z.key),Z)D.call(Z,pe)&&!O.hasOwnProperty(pe)&&(fe[pe]=Z[pe]);var Ce=arguments.length-2;if(Ce===1)fe.children=me;else if(1<Ce){for(var ue=Array(Ce),$e=0;$e<Ce;$e++)ue[$e]=arguments[$e+2];fe.children=ue}if(I&&I.defaultProps)for(pe in Ce=I.defaultProps,Ce)fe[pe]===void 0&&(fe[pe]=Ce[pe]);return{$$typeof:e,type:I,key:Pe,ref:Le,props:fe,_owner:U.current}}function V(I,Z){return{$$typeof:e,type:I.type,key:Z,ref:I.ref,props:I.props,_owner:I._owner}}function ee(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function ne(I){var Z={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(me){return Z[me]})}var K=/\/+/g;function E(I,Z){return typeof I=="object"&&I!==null&&I.key!=null?ne(""+I.key):Z.toString(36)}function $(I,Z,me,pe,fe){var Pe=typeof I;(Pe==="undefined"||Pe==="boolean")&&(I=null);var Le=!1;if(I===null)Le=!0;else switch(Pe){case"string":case"number":Le=!0;break;case"object":switch(I.$$typeof){case e:case t:Le=!0}}if(Le)return Le=I,fe=fe(Le),I=pe===""?"."+E(Le,0):pe,C(fe)?(me="",I!=null&&(me=I.replace(K,"$&/")+"/"),$(fe,Z,me,"",function($e){return $e})):fe!=null&&(ee(fe)&&(fe=V(fe,me+(!fe.key||Le&&Le.key===fe.key?"":(""+fe.key).replace(K,"$&/")+"/")+I)),Z.push(fe)),1;if(Le=0,pe=pe===""?".":pe+":",C(I))for(var Ce=0;Ce<I.length;Ce++){Pe=I[Ce];var ue=pe+E(Pe,Ce);Le+=$(Pe,Z,me,ue,fe)}else if(ue=v(I),typeof ue=="function")for(I=ue.call(I),Ce=0;!(Pe=I.next()).done;)Pe=Pe.value,ue=pe+E(Pe,Ce++),Le+=$(Pe,Z,me,ue,fe);else if(Pe==="object")throw Z=String(I),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return Le}function W(I,Z,me){if(I==null)return I;var pe=[],fe=0;return $(I,pe,"","",function(Pe){return Z.call(me,Pe,fe++)}),pe}function J(I){if(I._status===-1){var Z=I._result;Z=Z(),Z.then(function(me){(I._status===0||I._status===-1)&&(I._status=1,I._result=me)},function(me){(I._status===0||I._status===-1)&&(I._status=2,I._result=me)}),I._status===-1&&(I._status=0,I._result=Z)}if(I._status===1)return I._result.default;throw I._result}var B={current:null},G={transition:null},re={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:G,ReactCurrentOwner:U};function te(){throw Error("act(...) is not supported in production builds of React.")}return Re.Children={map:W,forEach:function(I,Z,me){W(I,function(){Z.apply(this,arguments)},me)},count:function(I){var Z=0;return W(I,function(){Z++}),Z},toArray:function(I){return W(I,function(Z){return Z})||[]},only:function(I){if(!ee(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Re.Component=P,Re.Fragment=n,Re.Profiler=i,Re.PureComponent=_,Re.StrictMode=o,Re.Suspense=h,Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,Re.act=te,Re.cloneElement=function(I,Z,me){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var pe=w({},I.props),fe=I.key,Pe=I.ref,Le=I._owner;if(Z!=null){if(Z.ref!==void 0&&(Pe=Z.ref,Le=U.current),Z.key!==void 0&&(fe=""+Z.key),I.type&&I.type.defaultProps)var Ce=I.type.defaultProps;for(ue in Z)D.call(Z,ue)&&!O.hasOwnProperty(ue)&&(pe[ue]=Z[ue]===void 0&&Ce!==void 0?Ce[ue]:Z[ue])}var ue=arguments.length-2;if(ue===1)pe.children=me;else if(1<ue){Ce=Array(ue);for(var $e=0;$e<ue;$e++)Ce[$e]=arguments[$e+2];pe.children=Ce}return{$$typeof:e,type:I.type,key:fe,ref:Pe,props:pe,_owner:Le}},Re.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:c,_context:I},I.Consumer=I},Re.createElement=T,Re.createFactory=function(I){var Z=T.bind(null,I);return Z.type=I,Z},Re.createRef=function(){return{current:null}},Re.forwardRef=function(I){return{$$typeof:d,render:I}},Re.isValidElement=ee,Re.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:J}},Re.memo=function(I,Z){return{$$typeof:p,type:I,compare:Z===void 0?null:Z}},Re.startTransition=function(I){var Z=G.transition;G.transition={};try{I()}finally{G.transition=Z}},Re.unstable_act=te,Re.useCallback=function(I,Z){return B.current.useCallback(I,Z)},Re.useContext=function(I){return B.current.useContext(I)},Re.useDebugValue=function(){},Re.useDeferredValue=function(I){return B.current.useDeferredValue(I)},Re.useEffect=function(I,Z){return B.current.useEffect(I,Z)},Re.useId=function(){return B.current.useId()},Re.useImperativeHandle=function(I,Z,me){return B.current.useImperativeHandle(I,Z,me)},Re.useInsertionEffect=function(I,Z){return B.current.useInsertionEffect(I,Z)},Re.useLayoutEffect=function(I,Z){return B.current.useLayoutEffect(I,Z)},Re.useMemo=function(I,Z){return B.current.useMemo(I,Z)},Re.useReducer=function(I,Z,me){return B.current.useReducer(I,Z,me)},Re.useRef=function(I){return B.current.useRef(I)},Re.useState=function(I){return B.current.useState(I)},Re.useSyncExternalStore=function(I,Z,me){return B.current.useSyncExternalStore(I,Z,me)},Re.useTransition=function(){return B.current.useTransition()},Re.version="18.3.1",Re}var Lv;function Ya(){return Lv||(Lv=1,hh.exports=Zb()),hh.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 Ov;function e2(){if(Ov)return da;Ov=1;var e=Ya(),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,c={key:!0,ref:!0,__self:!0,__source:!0};function l(d,h,p){var y,g={},v=null,x=null;p!==void 0&&(v=""+p),h.key!==void 0&&(v=""+h.key),h.ref!==void 0&&(x=h.ref);for(y in h)o.call(h,y)&&!c.hasOwnProperty(y)&&(g[y]=h[y]);if(d&&d.defaultProps)for(y in h=d.defaultProps,h)g[y]===void 0&&(g[y]=h[y]);return{$$typeof:t,type:d,key:v,ref:x,props:g,_owner:i.current}}return da.Fragment=n,da.jsx=l,da.jsxs=l,da}var Nv;function t2(){return Nv||(Nv=1,dh.exports=e2()),dh.exports}var F=t2(),X=Ya();const Ma=Xb(X);var bu={},mh={exports:{}},hn={},ph={exports:{}},gh={};/**
|
|
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 Dv;function n2(){return Dv||(Dv=1,(function(e){function t(G,re){var te=G.length;G.push(re);e:for(;0<te;){var I=te-1>>>1,Z=G[I];if(0<i(Z,re))G[I]=re,G[te]=Z,te=I;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],te=G.pop();if(te!==re){G[0]=te;e:for(var I=0,Z=G.length,me=Z>>>1;I<me;){var pe=2*(I+1)-1,fe=G[pe],Pe=pe+1,Le=G[Pe];if(0>i(fe,te))Pe<Z&&0>i(Le,fe)?(G[I]=Le,G[Pe]=te,I=Pe):(G[I]=fe,G[pe]=te,I=pe);else if(Pe<Z&&0>i(Le,te))G[I]=Le,G[Pe]=te,I=Pe;else break e}}return re}function i(G,re){var te=G.sortIndex-re.sortIndex;return te!==0?te:G.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var h=[],p=[],y=1,g=null,v=3,x=!1,w=!1,k=!1,P=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(G){for(var re=n(p);re!==null;){if(re.callback===null)o(p);else if(re.startTime<=G)o(p),re.sortIndex=re.expirationTime,t(h,re);else break;re=n(p)}}function C(G){if(k=!1,A(G),!w)if(n(h)!==null)w=!0,J(D);else{var re=n(p);re!==null&&B(C,re.startTime-G)}}function D(G,re){w=!1,k&&(k=!1,q(T),T=-1),x=!0;var te=v;try{for(A(re),g=n(h);g!==null&&(!(g.expirationTime>re)||G&&!ne());){var I=g.callback;if(typeof I=="function"){g.callback=null,v=g.priorityLevel;var Z=I(g.expirationTime<=re);re=e.unstable_now(),typeof Z=="function"?g.callback=Z:g===n(h)&&o(h),A(re)}else o(h);g=n(h)}if(g!==null)var me=!0;else{var pe=n(p);pe!==null&&B(C,pe.startTime-re),me=!1}return me}finally{g=null,v=te,x=!1}}var U=!1,O=null,T=-1,V=5,ee=-1;function ne(){return!(e.unstable_now()-ee<V)}function K(){if(O!==null){var G=e.unstable_now();ee=G;var re=!0;try{re=O(!0,G)}finally{re?E():(U=!1,O=null)}}else U=!1}var E;if(typeof _=="function")E=function(){_(K)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,W=$.port2;$.port1.onmessage=K,E=function(){W.postMessage(null)}}else E=function(){P(K,0)};function J(G){O=G,U||(U=!0,E())}function B(G,re){T=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(){w||x||(w=!0,J(D))},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"):V=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(G){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var te=v;v=re;try{return G()}finally{v=te}},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 te=v;v=G;try{return re()}finally{v=te}},e.unstable_scheduleCallback=function(G,re,te){var I=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?I+te:I):te=I,G){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=te+Z,G={id:y++,callback:re,priorityLevel:G,startTime:te,expirationTime:Z,sortIndex:-1},te>I?(G.sortIndex=te,t(p,G),n(h)===null&&G===n(p)&&(k?(q(T),T=-1):k=!0,B(C,te-I))):(G.sortIndex=Z,t(h,G),w||x||(w=!0,J(D))),G},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(G){var re=v;return function(){var te=v;v=re;try{return G.apply(this,arguments)}finally{v=te}}}})(gh)),gh}var jv;function r2(){return jv||(jv=1,ph.exports=n2()),ph.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 $v;function s2(){if($v)return hn;$v=1;var e=Ya(),t=r2();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 c(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"),h=Object.prototype.hasOwnProperty,p=/^[: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={},g={};function v(r){return h.call(g,r)?!0:h.call(y,r)?!1:p.test(r)?g[r]=!0:(y[r]=!0,!1)}function x(r,s,a,u){if(a!==null&&a.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return u?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function w(r,s,a,u){if(s===null||typeof s>"u"||x(r,s,a,u))return!0;if(u)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 k(r,s,a,u,f,m,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=u,this.attributeNamespace=f,this.mustUseProperty=a,this.propertyName=r,this.type=s,this.sanitizeURL=m,this.removeEmptyString=S}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){P[r]=new k(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 k(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){P[r]=new k(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){P[r]=new k(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 k(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){P[r]=new k(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){P[r]=new k(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){P[r]=new k(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){P[r]=new k(r,5,!1,r.toLowerCase(),null,!1,!1)});var q=/[\-:]([a-z])/g;function _(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(q,_);P[s]=new k(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(q,_);P[s]=new k(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(q,_);P[s]=new k(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){P[r]=new k(r,1,!1,r.toLowerCase(),null,!1,!1)}),P.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){P[r]=new k(r,1,!1,r.toLowerCase(),null,!0,!0)});function A(r,s,a,u){var f=P.hasOwnProperty(s)?P[s]:null;(f!==null?f.type!==0:u||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(w(s,a,f,u)&&(a=null),u||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,u=f.attributeNamespace,a===null?r.removeAttribute(s):(f=f.type,a=f===3||f===4&&a===!0?"":""+a,u?r.setAttributeNS(u,s,a):r.setAttribute(s,a))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),U=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),ne=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),B=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 te=Object.assign,I;function Z(r){if(I===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);I=s&&s[1]||""}return`
|
|
35
|
+
`+I+r}var me=!1;function pe(r,s){if(!r||me)return"";me=!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(Y){var u=Y}Reflect.construct(r,[],s)}else{try{s.call()}catch(Y){u=Y}r.call(s.prototype)}else{try{throw Error()}catch(Y){u=Y}r()}}catch(Y){if(Y&&u&&typeof Y.stack=="string"){for(var f=Y.stack.split(`
|
|
36
|
+
`),m=u.stack.split(`
|
|
37
|
+
`),S=f.length-1,b=m.length-1;1<=S&&0<=b&&f[S]!==m[b];)b--;for(;1<=S&&0<=b;S--,b--)if(f[S]!==m[b]){if(S!==1||b!==1)do if(S--,b--,0>b||f[S]!==m[b]){var R=`
|
|
38
|
+
`+f[S].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),R}while(1<=S&&0<=b);break}}}finally{me=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?Z(r):""}function fe(r){switch(r.tag){case 5:return Z(r.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return r=pe(r.type,!1),r;case 11:return r=pe(r.type.render,!1),r;case 1:return r=pe(r.type,!0),r;default:return""}}function Pe(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 O:return"Fragment";case U:return"Portal";case V:return"Profiler";case T:return"StrictMode";case E:return"Suspense";case $:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case ne:return(r.displayName||"Context")+".Consumer";case ee:return(r._context.displayName||"Context")+".Provider";case K:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case W:return s=r.displayName||null,s!==null?s:Pe(r.type)||"Memo";case J:s=r._payload,r=r._init;try{return Pe(r(s))}catch{}}return null}function Le(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 Pe(s);case 8:return s===T?"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 Ce(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ue(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function $e(r){var s=ue(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),u=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,m=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return f.call(this)},set:function(S){u=""+S,m.call(this,S)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return u},setValue:function(S){u=""+S},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Yt(r){r._valueTracker||(r._valueTracker=$e(r))}function an(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),u="";return r&&(u=ue(r)?r.checked?"true":"false":r.value),r=u,r!==a?(s.setValue(r),!0):!1}function An(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 Ln(r,s){var a=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function _o(r,s){var a=s.defaultValue==null?"":s.defaultValue,u=s.checked!=null?s.checked:s.defaultChecked;a=Ce(s.value!=null?s.value:a),r._wrapperState={initialChecked:u,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Os(r,s){s=s.checked,s!=null&&A(r,"checked",s,!1)}function Co(r,s){Os(r,s);var a=Ce(s.value),u=s.type;if(a!=null)u==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(u==="submit"||u==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Ns(r,s.type,a):s.hasOwnProperty("defaultValue")&&Ns(r,s.type,Ce(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Rr(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var u=s.type;if(!(u!=="submit"&&u!=="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 Ns(r,s,a){(s!=="number"||An(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var wn=Array.isArray;function Qr(r,s,a,u){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&&u&&(r[a].defaultSelected=!0)}else{for(a=""+Ce(a),s=null,f=0;f<r.length;f++){if(r[f].value===a){r[f].selected=!0,u&&(r[f].defaultSelected=!0);return}s!==null||r[f].disabled||(s=r[f])}s!==null&&(s.selected=!0)}}function bo(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return te({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function vc(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(wn(a)){if(1<a.length)throw Error(n(93));a=a[0]}s=a}s==null&&(s=""),a=s}r._wrapperState={initialValue:Ce(a)}}function Pi(r,s){var a=Ce(s.value),u=Ce(s.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),s.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),u!=null&&(r.defaultValue=""+u)}function ze(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Lt(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 Jn(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?Lt(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Po,Kg=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,a,u,f){MSApp.execUnsafeLocalFunction(function(){return r(s,a,u,f)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(Po=Po||document.createElement("div"),Po.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Po.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function Fi(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var Ii={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},eC=["Webkit","ms","Moz","O"];Object.keys(Ii).forEach(function(r){eC.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Ii[s]=Ii[r]})});function Qg(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||Ii.hasOwnProperty(r)&&Ii[r]?(""+s).trim():s+"px"}function Jg(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var u=a.indexOf("--")===0,f=Qg(a,s[a],u);a==="float"&&(a="cssFloat"),u?r.setProperty(a,f):r[a]=f}}var tC=te({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 _f(r,s){if(s){if(tC[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 Cf(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 bf=null;function Pf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ff=null,Fo=null,Io=null;function Gg(r){if(r=Yi(r)){if(typeof Ff!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Bc(s),Ff(r.stateNode,r.type,s))}}function Yg(r){Fo?Io?Io.push(r):Io=[r]:Fo=r}function Xg(){if(Fo){var r=Fo,s=Io;if(Io=Fo=null,Gg(r),s)for(r=0;r<s.length;r++)Gg(s[r])}}function Zg(r,s){return r(s)}function e0(){}var If=!1;function t0(r,s,a){if(If)return r(s,a);If=!0;try{return Zg(r,s,a)}finally{If=!1,(Fo!==null||Io!==null)&&(e0(),Xg())}}function Ri(r,s){var a=r.stateNode;if(a===null)return null;var u=Bc(a);if(u===null)return null;a=u[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":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var Rf=!1;if(d)try{var Ti={};Object.defineProperty(Ti,"passive",{get:function(){Rf=!0}}),window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{Rf=!1}function nC(r,s,a,u,f,m,S,b,R){var Y=Array.prototype.slice.call(arguments,3);try{s.apply(a,Y)}catch(ie){this.onError(ie)}}var Mi=!1,Sc=null,xc=!1,Tf=null,rC={onError:function(r){Mi=!0,Sc=r}};function sC(r,s,a,u,f,m,S,b,R){Mi=!1,Sc=null,nC.apply(rC,arguments)}function oC(r,s,a,u,f,m,S,b,R){if(sC.apply(this,arguments),Mi){if(Mi){var Y=Sc;Mi=!1,Sc=null}else throw Error(n(198));xc||(xc=!0,Tf=Y)}}function Ds(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 n0(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 r0(r){if(Ds(r)!==r)throw Error(n(188))}function iC(r){var s=r.alternate;if(!s){if(s=Ds(r),s===null)throw Error(n(188));return s!==r?null:r}for(var a=r,u=s;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(u=f.return,u!==null){a=u;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return r0(f),r;if(m===u)return r0(f),s;m=m.sibling}throw Error(n(188))}if(a.return!==u.return)a=f,u=m;else{for(var S=!1,b=f.child;b;){if(b===a){S=!0,a=f,u=m;break}if(b===u){S=!0,u=f,a=m;break}b=b.sibling}if(!S){for(b=m.child;b;){if(b===a){S=!0,a=m,u=f;break}if(b===u){S=!0,u=m,a=f;break}b=b.sibling}if(!S)throw Error(n(189))}}if(a.alternate!==u)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:s}function s0(r){return r=iC(r),r!==null?o0(r):null}function o0(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=o0(r);if(s!==null)return s;r=r.sibling}return null}var i0=t.unstable_scheduleCallback,a0=t.unstable_cancelCallback,aC=t.unstable_shouldYield,cC=t.unstable_requestPaint,mt=t.unstable_now,uC=t.unstable_getCurrentPriorityLevel,Mf=t.unstable_ImmediatePriority,c0=t.unstable_UserBlockingPriority,wc=t.unstable_NormalPriority,lC=t.unstable_LowPriority,u0=t.unstable_IdlePriority,kc=null,mr=null;function fC(r){if(mr&&typeof mr.onCommitFiberRoot=="function")try{mr.onCommitFiberRoot(kc,r,void 0,(r.current.flags&128)===128)}catch{}}var Gn=Math.clz32?Math.clz32:mC,dC=Math.log,hC=Math.LN2;function mC(r){return r>>>=0,r===0?32:31-(dC(r)/hC|0)|0}var Ec=64,_c=4194304;function Ai(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 Cc(r,s){var a=r.pendingLanes;if(a===0)return 0;var u=0,f=r.suspendedLanes,m=r.pingedLanes,S=a&268435455;if(S!==0){var b=S&~f;b!==0?u=Ai(b):(m&=S,m!==0&&(u=Ai(m)))}else S=a&~f,S!==0?u=Ai(S):m!==0&&(u=Ai(m));if(u===0)return 0;if(s!==0&&s!==u&&(s&f)===0&&(f=u&-u,m=s&-s,f>=m||f===16&&(m&4194240)!==0))return s;if((u&4)!==0&&(u|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=u;0<s;)a=31-Gn(s),f=1<<a,u|=r[a],s&=~f;return u}function pC(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 gC(r,s){for(var a=r.suspendedLanes,u=r.pingedLanes,f=r.expirationTimes,m=r.pendingLanes;0<m;){var S=31-Gn(m),b=1<<S,R=f[S];R===-1?((b&a)===0||(b&u)!==0)&&(f[S]=pC(b,s)):R<=s&&(r.expiredLanes|=b),m&=~b}}function Af(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function l0(){var r=Ec;return Ec<<=1,(Ec&4194240)===0&&(Ec=64),r}function Lf(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function Li(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Gn(s),r[s]=a}function yC(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 u=r.eventTimes;for(r=r.expirationTimes;0<a;){var f=31-Gn(a),m=1<<f;s[f]=0,u[f]=-1,r[f]=-1,a&=~m}}function Of(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var u=31-Gn(a),f=1<<u;f&s|r[u]&s&&(r[u]|=s),a&=~f}}var Ve=0;function f0(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var d0,Nf,h0,m0,p0,Df=!1,bc=[],Jr=null,Gr=null,Yr=null,Oi=new Map,Ni=new Map,Xr=[],vC="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 g0(r,s){switch(r){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":Gr=null;break;case"mouseover":case"mouseout":Yr=null;break;case"pointerover":case"pointerout":Oi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ni.delete(s.pointerId)}}function Di(r,s,a,u,f,m){return r===null||r.nativeEvent!==m?(r={blockedOn:s,domEventName:a,eventSystemFlags:u,nativeEvent:m,targetContainers:[f]},s!==null&&(s=Yi(s),s!==null&&Nf(s)),r):(r.eventSystemFlags|=u,s=r.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),r)}function SC(r,s,a,u,f){switch(s){case"focusin":return Jr=Di(Jr,r,s,a,u,f),!0;case"dragenter":return Gr=Di(Gr,r,s,a,u,f),!0;case"mouseover":return Yr=Di(Yr,r,s,a,u,f),!0;case"pointerover":var m=f.pointerId;return Oi.set(m,Di(Oi.get(m)||null,r,s,a,u,f)),!0;case"gotpointercapture":return m=f.pointerId,Ni.set(m,Di(Ni.get(m)||null,r,s,a,u,f)),!0}return!1}function y0(r){var s=js(r.target);if(s!==null){var a=Ds(s);if(a!==null){if(s=a.tag,s===13){if(s=n0(a),s!==null){r.blockedOn=s,p0(r.priority,function(){h0(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 Pc(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=$f(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var u=new a.constructor(a.type,a);bf=u,a.target.dispatchEvent(u),bf=null}else return s=Yi(a),s!==null&&Nf(s),r.blockedOn=a,!1;s.shift()}return!0}function v0(r,s,a){Pc(r)&&a.delete(s)}function xC(){Df=!1,Jr!==null&&Pc(Jr)&&(Jr=null),Gr!==null&&Pc(Gr)&&(Gr=null),Yr!==null&&Pc(Yr)&&(Yr=null),Oi.forEach(v0),Ni.forEach(v0)}function ji(r,s){r.blockedOn===s&&(r.blockedOn=null,Df||(Df=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,xC)))}function $i(r){function s(f){return ji(f,r)}if(0<bc.length){ji(bc[0],r);for(var a=1;a<bc.length;a++){var u=bc[a];u.blockedOn===r&&(u.blockedOn=null)}}for(Jr!==null&&ji(Jr,r),Gr!==null&&ji(Gr,r),Yr!==null&&ji(Yr,r),Oi.forEach(s),Ni.forEach(s),a=0;a<Xr.length;a++)u=Xr[a],u.blockedOn===r&&(u.blockedOn=null);for(;0<Xr.length&&(a=Xr[0],a.blockedOn===null);)y0(a),a.blockedOn===null&&Xr.shift()}var Ro=C.ReactCurrentBatchConfig,Fc=!0;function wC(r,s,a,u){var f=Ve,m=Ro.transition;Ro.transition=null;try{Ve=1,jf(r,s,a,u)}finally{Ve=f,Ro.transition=m}}function kC(r,s,a,u){var f=Ve,m=Ro.transition;Ro.transition=null;try{Ve=4,jf(r,s,a,u)}finally{Ve=f,Ro.transition=m}}function jf(r,s,a,u){if(Fc){var f=$f(r,s,a,u);if(f===null)nd(r,s,u,Ic,a),g0(r,u);else if(SC(f,r,s,a,u))u.stopPropagation();else if(g0(r,u),s&4&&-1<vC.indexOf(r)){for(;f!==null;){var m=Yi(f);if(m!==null&&d0(m),m=$f(r,s,a,u),m===null&&nd(r,s,u,Ic,a),m===f)break;f=m}f!==null&&u.stopPropagation()}else nd(r,s,u,null,a)}}var Ic=null;function $f(r,s,a,u){if(Ic=null,r=Pf(u),r=js(r),r!==null)if(s=Ds(r),s===null)r=null;else if(a=s.tag,a===13){if(r=n0(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 Ic=r,null}function S0(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(uC()){case Mf:return 1;case c0:return 4;case wc:case lC:return 16;case u0:return 536870912;default:return 16}default:return 16}}var Zr=null,Uf=null,Rc=null;function x0(){if(Rc)return Rc;var r,s=Uf,a=s.length,u,f="value"in Zr?Zr.value:Zr.textContent,m=f.length;for(r=0;r<a&&s[r]===f[r];r++);var S=a-r;for(u=1;u<=S&&s[a-u]===f[m-u];u++);return Rc=f.slice(r,1<u?1-u:void 0)}function Tc(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 Mc(){return!0}function w0(){return!1}function kn(r){function s(a,u,f,m,S){this._reactName=a,this._targetInst=f,this.type=u,this.nativeEvent=m,this.target=S,this.currentTarget=null;for(var b in r)r.hasOwnProperty(b)&&(a=r[b],this[b]=a?a(m):m[b]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Mc:w0,this.isPropagationStopped=w0,this}return te(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=Mc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Mc)},persist:function(){},isPersistent:Mc}),s}var To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bf=kn(To),Ui=te({},To,{view:0,detail:0}),EC=kn(Ui),zf,Vf,Bi,Ac=te({},Ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wf,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!==Bi&&(Bi&&r.type==="mousemove"?(zf=r.screenX-Bi.screenX,Vf=r.screenY-Bi.screenY):Vf=zf=0,Bi=r),zf)},movementY:function(r){return"movementY"in r?r.movementY:Vf}}),k0=kn(Ac),_C=te({},Ac,{dataTransfer:0}),CC=kn(_C),bC=te({},Ui,{relatedTarget:0}),qf=kn(bC),PC=te({},To,{animationName:0,elapsedTime:0,pseudoElement:0}),FC=kn(PC),IC=te({},To,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),RC=kn(IC),TC=te({},To,{data:0}),E0=kn(TC),MC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AC={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"},LC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OC(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=LC[r])?!!s[r]:!1}function Wf(){return OC}var NC=te({},Ui,{key:function(r){if(r.key){var s=MC[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Tc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?AC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wf,charCode:function(r){return r.type==="keypress"?Tc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Tc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),DC=kn(NC),jC=te({},Ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_0=kn(jC),$C=te({},Ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wf}),UC=kn($C),BC=te({},To,{propertyName:0,elapsedTime:0,pseudoElement:0}),zC=kn(BC),VC=te({},Ac,{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}),qC=kn(VC),WC=[9,13,27,32],Hf=d&&"CompositionEvent"in window,zi=null;d&&"documentMode"in document&&(zi=document.documentMode);var HC=d&&"TextEvent"in window&&!zi,C0=d&&(!Hf||zi&&8<zi&&11>=zi),b0=" ",P0=!1;function F0(r,s){switch(r){case"keyup":return WC.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function I0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Mo=!1;function KC(r,s){switch(r){case"compositionend":return I0(s);case"keypress":return s.which!==32?null:(P0=!0,b0);case"textInput":return r=s.data,r===b0&&P0?null:r;default:return null}}function QC(r,s){if(Mo)return r==="compositionend"||!Hf&&F0(r,s)?(r=x0(),Rc=Uf=Zr=null,Mo=!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 C0&&s.locale!=="ko"?null:s.data;default:return null}}var JC={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 R0(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!JC[r.type]:s==="textarea"}function T0(r,s,a,u){Yg(u),s=jc(s,"onChange"),0<s.length&&(a=new Bf("onChange","change",null,a,u),r.push({event:a,listeners:s}))}var Vi=null,qi=null;function GC(r){J0(r,0)}function Lc(r){var s=Do(r);if(an(s))return r}function YC(r,s){if(r==="change")return s}var M0=!1;if(d){var Kf;if(d){var Qf="oninput"in document;if(!Qf){var A0=document.createElement("div");A0.setAttribute("oninput","return;"),Qf=typeof A0.oninput=="function"}Kf=Qf}else Kf=!1;M0=Kf&&(!document.documentMode||9<document.documentMode)}function L0(){Vi&&(Vi.detachEvent("onpropertychange",O0),qi=Vi=null)}function O0(r){if(r.propertyName==="value"&&Lc(qi)){var s=[];T0(s,qi,r,Pf(r)),t0(GC,s)}}function XC(r,s,a){r==="focusin"?(L0(),Vi=s,qi=a,Vi.attachEvent("onpropertychange",O0)):r==="focusout"&&L0()}function ZC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Lc(qi)}function eb(r,s){if(r==="click")return Lc(s)}function tb(r,s){if(r==="input"||r==="change")return Lc(s)}function nb(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Yn=typeof Object.is=="function"?Object.is:nb;function Wi(r,s){if(Yn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),u=Object.keys(s);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var f=a[u];if(!h.call(s,f)||!Yn(r[f],s[f]))return!1}return!0}function N0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function D0(r,s){var a=N0(r);r=0;for(var u;a;){if(a.nodeType===3){if(u=r+a.textContent.length,r<=s&&u>=s)return{node:a,offset:s-r};r=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=N0(a)}}function j0(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?j0(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function $0(){for(var r=window,s=An();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=An(r.document)}return s}function Jf(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 rb(r){var s=$0(),a=r.focusedElem,u=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&j0(a.ownerDocument.documentElement,a)){if(u!==null&&Jf(a)){if(s=u.start,r=u.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,m=Math.min(u.start,f);u=u.end===void 0?m:Math.min(u.end,f),!r.extend&&m>u&&(f=u,u=m,m=f),f=D0(a,m);var S=D0(a,u);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(),m>u?(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 sb=d&&"documentMode"in document&&11>=document.documentMode,Ao=null,Gf=null,Hi=null,Yf=!1;function U0(r,s,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Yf||Ao==null||Ao!==An(u)||(u=Ao,"selectionStart"in u&&Jf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Hi&&Wi(Hi,u)||(Hi=u,u=jc(Gf,"onSelect"),0<u.length&&(s=new Bf("onSelect","select",null,s,a),r.push({event:s,listeners:u}),s.target=Ao)))}function Oc(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var Lo={animationend:Oc("Animation","AnimationEnd"),animationiteration:Oc("Animation","AnimationIteration"),animationstart:Oc("Animation","AnimationStart"),transitionend:Oc("Transition","TransitionEnd")},Xf={},B0={};d&&(B0=document.createElement("div").style,"AnimationEvent"in window||(delete Lo.animationend.animation,delete Lo.animationiteration.animation,delete Lo.animationstart.animation),"TransitionEvent"in window||delete Lo.transitionend.transition);function Nc(r){if(Xf[r])return Xf[r];if(!Lo[r])return r;var s=Lo[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in B0)return Xf[r]=s[a];return r}var z0=Nc("animationend"),V0=Nc("animationiteration"),q0=Nc("animationstart"),W0=Nc("transitionend"),H0=new Map,K0="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 es(r,s){H0.set(r,s),c(s,[r])}for(var Zf=0;Zf<K0.length;Zf++){var ed=K0[Zf],ob=ed.toLowerCase(),ib=ed[0].toUpperCase()+ed.slice(1);es(ob,"on"+ib)}es(z0,"onAnimationEnd"),es(V0,"onAnimationIteration"),es(q0,"onAnimationStart"),es("dblclick","onDoubleClick"),es("focusin","onFocus"),es("focusout","onBlur"),es(W0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ki="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(" "),ab=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ki));function Q0(r,s,a){var u=r.type||"unknown-event";r.currentTarget=a,oC(u,s,void 0,r),r.currentTarget=null}function J0(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var u=r[a],f=u.event;u=u.listeners;e:{var m=void 0;if(s)for(var S=u.length-1;0<=S;S--){var b=u[S],R=b.instance,Y=b.currentTarget;if(b=b.listener,R!==m&&f.isPropagationStopped())break e;Q0(f,b,Y),m=R}else for(S=0;S<u.length;S++){if(b=u[S],R=b.instance,Y=b.currentTarget,b=b.listener,R!==m&&f.isPropagationStopped())break e;Q0(f,b,Y),m=R}}}if(xc)throw r=Tf,xc=!1,Tf=null,r}function Xe(r,s){var a=s[cd];a===void 0&&(a=s[cd]=new Set);var u=r+"__bubble";a.has(u)||(G0(s,r,2,!1),a.add(u))}function td(r,s,a){var u=0;s&&(u|=4),G0(a,r,u,s)}var Dc="_reactListening"+Math.random().toString(36).slice(2);function Qi(r){if(!r[Dc]){r[Dc]=!0,o.forEach(function(a){a!=="selectionchange"&&(ab.has(a)||td(a,!1,r),td(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Dc]||(s[Dc]=!0,td("selectionchange",!1,s))}}function G0(r,s,a,u){switch(S0(s)){case 1:var f=wC;break;case 4:f=kC;break;default:f=jf}a=f.bind(null,s,a,r),f=void 0,!Rf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),u?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 nd(r,s,a,u,f){var m=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var S=u.tag;if(S===3||S===4){var b=u.stateNode.containerInfo;if(b===f||b.nodeType===8&&b.parentNode===f)break;if(S===4)for(S=u.return;S!==null;){var R=S.tag;if((R===3||R===4)&&(R=S.stateNode.containerInfo,R===f||R.nodeType===8&&R.parentNode===f))return;S=S.return}for(;b!==null;){if(S=js(b),S===null)return;if(R=S.tag,R===5||R===6){u=m=S;continue e}b=b.parentNode}}u=u.return}t0(function(){var Y=m,ie=Pf(a),ae=[];e:{var oe=H0.get(r);if(oe!==void 0){var he=Bf,ye=r;switch(r){case"keypress":if(Tc(a)===0)break e;case"keydown":case"keyup":he=DC;break;case"focusin":ye="focus",he=qf;break;case"focusout":ye="blur",he=qf;break;case"beforeblur":case"afterblur":he=qf;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":he=k0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=CC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=UC;break;case z0:case V0:case q0:he=FC;break;case W0:he=zC;break;case"scroll":he=EC;break;case"wheel":he=qC;break;case"copy":case"cut":case"paste":he=RC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=_0}var ve=(s&4)!==0,pt=!ve&&r==="scroll",z=ve?oe!==null?oe+"Capture":null:oe;ve=[];for(var M=Y,H;M!==null;){H=M;var ce=H.stateNode;if(H.tag===5&&ce!==null&&(H=ce,z!==null&&(ce=Ri(M,z),ce!=null&&ve.push(Ji(M,ce,H)))),pt)break;M=M.return}0<ve.length&&(oe=new he(oe,ye,null,a,ie),ae.push({event:oe,listeners:ve}))}}if((s&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",he=r==="mouseout"||r==="pointerout",oe&&a!==bf&&(ye=a.relatedTarget||a.fromElement)&&(js(ye)||ye[Tr]))break e;if((he||oe)&&(oe=ie.window===ie?ie:(oe=ie.ownerDocument)?oe.defaultView||oe.parentWindow:window,he?(ye=a.relatedTarget||a.toElement,he=Y,ye=ye?js(ye):null,ye!==null&&(pt=Ds(ye),ye!==pt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(he=null,ye=Y),he!==ye)){if(ve=k0,ce="onMouseLeave",z="onMouseEnter",M="mouse",(r==="pointerout"||r==="pointerover")&&(ve=_0,ce="onPointerLeave",z="onPointerEnter",M="pointer"),pt=he==null?oe:Do(he),H=ye==null?oe:Do(ye),oe=new ve(ce,M+"leave",he,a,ie),oe.target=pt,oe.relatedTarget=H,ce=null,js(ie)===Y&&(ve=new ve(z,M+"enter",ye,a,ie),ve.target=H,ve.relatedTarget=pt,ce=ve),pt=ce,he&&ye)t:{for(ve=he,z=ye,M=0,H=ve;H;H=Oo(H))M++;for(H=0,ce=z;ce;ce=Oo(ce))H++;for(;0<M-H;)ve=Oo(ve),M--;for(;0<H-M;)z=Oo(z),H--;for(;M--;){if(ve===z||z!==null&&ve===z.alternate)break t;ve=Oo(ve),z=Oo(z)}ve=null}else ve=null;he!==null&&Y0(ae,oe,he,ve,!1),ye!==null&&pt!==null&&Y0(ae,pt,ye,ve,!0)}}e:{if(oe=Y?Do(Y):window,he=oe.nodeName&&oe.nodeName.toLowerCase(),he==="select"||he==="input"&&oe.type==="file")var Se=YC;else if(R0(oe))if(M0)Se=tb;else{Se=ZC;var ke=XC}else(he=oe.nodeName)&&he.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Se=eb);if(Se&&(Se=Se(r,Y))){T0(ae,Se,a,ie);break e}ke&&ke(r,oe,Y),r==="focusout"&&(ke=oe._wrapperState)&&ke.controlled&&oe.type==="number"&&Ns(oe,"number",oe.value)}switch(ke=Y?Do(Y):window,r){case"focusin":(R0(ke)||ke.contentEditable==="true")&&(Ao=ke,Gf=Y,Hi=null);break;case"focusout":Hi=Gf=Ao=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,U0(ae,a,ie);break;case"selectionchange":if(sb)break;case"keydown":case"keyup":U0(ae,a,ie)}var Ee;if(Hf)e:{switch(r){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else Mo?F0(r,a)&&(_e="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(_e="onCompositionStart");_e&&(C0&&a.locale!=="ko"&&(Mo||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&Mo&&(Ee=x0()):(Zr=ie,Uf="value"in Zr?Zr.value:Zr.textContent,Mo=!0)),ke=jc(Y,_e),0<ke.length&&(_e=new E0(_e,r,null,a,ie),ae.push({event:_e,listeners:ke}),Ee?_e.data=Ee:(Ee=I0(a),Ee!==null&&(_e.data=Ee)))),(Ee=HC?KC(r,a):QC(r,a))&&(Y=jc(Y,"onBeforeInput"),0<Y.length&&(ie=new E0("onBeforeInput","beforeinput",null,a,ie),ae.push({event:ie,listeners:Y}),ie.data=Ee))}J0(ae,s)})}function Ji(r,s,a){return{instance:r,listener:s,currentTarget:a}}function jc(r,s){for(var a=s+"Capture",u=[];r!==null;){var f=r,m=f.stateNode;f.tag===5&&m!==null&&(f=m,m=Ri(r,a),m!=null&&u.unshift(Ji(r,m,f)),m=Ri(r,s),m!=null&&u.push(Ji(r,m,f))),r=r.return}return u}function Oo(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Y0(r,s,a,u,f){for(var m=s._reactName,S=[];a!==null&&a!==u;){var b=a,R=b.alternate,Y=b.stateNode;if(R!==null&&R===u)break;b.tag===5&&Y!==null&&(b=Y,f?(R=Ri(a,m),R!=null&&S.unshift(Ji(a,R,b))):f||(R=Ri(a,m),R!=null&&S.push(Ji(a,R,b)))),a=a.return}S.length!==0&&r.push({event:s,listeners:S})}var cb=/\r\n?/g,ub=/\u0000|\uFFFD/g;function X0(r){return(typeof r=="string"?r:""+r).replace(cb,`
|
|
39
|
+
`).replace(ub,"")}function $c(r,s,a){if(s=X0(s),X0(r)!==s&&a)throw Error(n(425))}function Uc(){}var rd=null,sd=null;function od(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 id=typeof setTimeout=="function"?setTimeout:void 0,lb=typeof clearTimeout=="function"?clearTimeout:void 0,Z0=typeof Promise=="function"?Promise:void 0,fb=typeof queueMicrotask=="function"?queueMicrotask:typeof Z0<"u"?function(r){return Z0.resolve(null).then(r).catch(db)}:id;function db(r){setTimeout(function(){throw r})}function ad(r,s){var a=s,u=0;do{var f=a.nextSibling;if(r.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(u===0){r.removeChild(f),$i(s);return}u--}else a!=="$"&&a!=="$?"&&a!=="$!"||u++;a=f}while(a);$i(s)}function ts(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 ey(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 No=Math.random().toString(36).slice(2),pr="__reactFiber$"+No,Gi="__reactProps$"+No,Tr="__reactContainer$"+No,cd="__reactEvents$"+No,hb="__reactListeners$"+No,mb="__reactHandles$"+No;function js(r){var s=r[pr];if(s)return s;for(var a=r.parentNode;a;){if(s=a[Tr]||a[pr]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=ey(r);r!==null;){if(a=r[pr])return a;r=ey(r)}return s}r=a,a=r.parentNode}return null}function Yi(r){return r=r[pr]||r[Tr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Do(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Bc(r){return r[Gi]||null}var ud=[],jo=-1;function ns(r){return{current:r}}function Ze(r){0>jo||(r.current=ud[jo],ud[jo]=null,jo--)}function Qe(r,s){jo++,ud[jo]=r.current,r.current=s}var rs={},Bt=ns(rs),cn=ns(!1),$s=rs;function $o(r,s){var a=r.type.contextTypes;if(!a)return rs;var u=r.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var f={},m;for(m in a)f[m]=s[m];return u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=f),f}function un(r){return r=r.childContextTypes,r!=null}function zc(){Ze(cn),Ze(Bt)}function ty(r,s,a){if(Bt.current!==rs)throw Error(n(168));Qe(Bt,s),Qe(cn,a)}function ny(r,s,a){var u=r.stateNode;if(s=s.childContextTypes,typeof u.getChildContext!="function")return a;u=u.getChildContext();for(var f in u)if(!(f in s))throw Error(n(108,Le(r)||"Unknown",f));return te({},a,u)}function Vc(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||rs,$s=Bt.current,Qe(Bt,r),Qe(cn,cn.current),!0}function ry(r,s,a){var u=r.stateNode;if(!u)throw Error(n(169));a?(r=ny(r,s,$s),u.__reactInternalMemoizedMergedChildContext=r,Ze(cn),Ze(Bt),Qe(Bt,r)):Ze(cn),Qe(cn,a)}var Mr=null,qc=!1,ld=!1;function sy(r){Mr===null?Mr=[r]:Mr.push(r)}function pb(r){qc=!0,sy(r)}function ss(){if(!ld&&Mr!==null){ld=!0;var r=0,s=Ve;try{var a=Mr;for(Ve=1;r<a.length;r++){var u=a[r];do u=u(!0);while(u!==null)}Mr=null,qc=!1}catch(f){throw Mr!==null&&(Mr=Mr.slice(r+1)),i0(Mf,ss),f}finally{Ve=s,ld=!1}}return null}var Uo=[],Bo=0,Wc=null,Hc=0,On=[],Nn=0,Us=null,Ar=1,Lr="";function Bs(r,s){Uo[Bo++]=Hc,Uo[Bo++]=Wc,Wc=r,Hc=s}function oy(r,s,a){On[Nn++]=Ar,On[Nn++]=Lr,On[Nn++]=Us,Us=r;var u=Ar;r=Lr;var f=32-Gn(u)-1;u&=~(1<<f),a+=1;var m=32-Gn(s)+f;if(30<m){var S=f-f%5;m=(u&(1<<S)-1).toString(32),u>>=S,f-=S,Ar=1<<32-Gn(s)+f|a<<f|u,Lr=m+r}else Ar=1<<m|a<<f|u,Lr=r}function fd(r){r.return!==null&&(Bs(r,1),oy(r,1,0))}function dd(r){for(;r===Wc;)Wc=Uo[--Bo],Uo[Bo]=null,Hc=Uo[--Bo],Uo[Bo]=null;for(;r===Us;)Us=On[--Nn],On[Nn]=null,Lr=On[--Nn],On[Nn]=null,Ar=On[--Nn],On[Nn]=null}var En=null,_n=null,et=!1,Xn=null;function iy(r,s){var a=Un(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 ay(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,En=r,_n=ts(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,En=r,_n=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(a=Us!==null?{id:Ar,overflow:Lr}:null,r.memoizedState={dehydrated:s,treeContext:a,retryLane:1073741824},a=Un(18,null,null,0),a.stateNode=s,a.return=r,r.child=a,En=r,_n=null,!0):!1;default:return!1}}function hd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function md(r){if(et){var s=_n;if(s){var a=s;if(!ay(r,s)){if(hd(r))throw Error(n(418));s=ts(a.nextSibling);var u=En;s&&ay(r,s)?iy(u,a):(r.flags=r.flags&-4097|2,et=!1,En=r)}}else{if(hd(r))throw Error(n(418));r.flags=r.flags&-4097|2,et=!1,En=r}}}function cy(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;En=r}function Kc(r){if(r!==En)return!1;if(!et)return cy(r),et=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!od(r.type,r.memoizedProps)),s&&(s=_n)){if(hd(r))throw uy(),Error(n(418));for(;s;)iy(r,s),s=ts(s.nextSibling)}if(cy(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){_n=ts(r.nextSibling);break e}s--}else a!=="$"&&a!=="$!"&&a!=="$?"||s++}r=r.nextSibling}_n=null}}else _n=En?ts(r.stateNode.nextSibling):null;return!0}function uy(){for(var r=_n;r;)r=ts(r.nextSibling)}function zo(){_n=En=null,et=!1}function pd(r){Xn===null?Xn=[r]:Xn.push(r)}var gb=C.ReactCurrentBatchConfig;function Xi(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 u=a.stateNode}if(!u)throw Error(n(147,r));var f=u,m=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===m?s.ref:(s=function(S){var b=f.refs;S===null?delete b[m]:b[m]=S},s._stringRef=m,s)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Qc(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function ly(r){var s=r._init;return s(r._payload)}function fy(r){function s(z,M){if(r){var H=z.deletions;H===null?(z.deletions=[M],z.flags|=16):H.push(M)}}function a(z,M){if(!r)return null;for(;M!==null;)s(z,M),M=M.sibling;return null}function u(z,M){for(z=new Map;M!==null;)M.key!==null?z.set(M.key,M):z.set(M.index,M),M=M.sibling;return z}function f(z,M){return z=ds(z,M),z.index=0,z.sibling=null,z}function m(z,M,H){return z.index=H,r?(H=z.alternate,H!==null?(H=H.index,H<M?(z.flags|=2,M):H):(z.flags|=2,M)):(z.flags|=1048576,M)}function S(z){return r&&z.alternate===null&&(z.flags|=2),z}function b(z,M,H,ce){return M===null||M.tag!==6?(M=ih(H,z.mode,ce),M.return=z,M):(M=f(M,H),M.return=z,M)}function R(z,M,H,ce){var Se=H.type;return Se===O?ie(z,M,H.props.children,ce,H.key):M!==null&&(M.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&ly(Se)===M.type)?(ce=f(M,H.props),ce.ref=Xi(z,M,H),ce.return=z,ce):(ce=vu(H.type,H.key,H.props,null,z.mode,ce),ce.ref=Xi(z,M,H),ce.return=z,ce)}function Y(z,M,H,ce){return M===null||M.tag!==4||M.stateNode.containerInfo!==H.containerInfo||M.stateNode.implementation!==H.implementation?(M=ah(H,z.mode,ce),M.return=z,M):(M=f(M,H.children||[]),M.return=z,M)}function ie(z,M,H,ce,Se){return M===null||M.tag!==7?(M=Js(H,z.mode,ce,Se),M.return=z,M):(M=f(M,H),M.return=z,M)}function ae(z,M,H){if(typeof M=="string"&&M!==""||typeof M=="number")return M=ih(""+M,z.mode,H),M.return=z,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case D:return H=vu(M.type,M.key,M.props,null,z.mode,H),H.ref=Xi(z,null,M),H.return=z,H;case U:return M=ah(M,z.mode,H),M.return=z,M;case J:var ce=M._init;return ae(z,ce(M._payload),H)}if(wn(M)||re(M))return M=Js(M,z.mode,H,null),M.return=z,M;Qc(z,M)}return null}function oe(z,M,H,ce){var Se=M!==null?M.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Se!==null?null:b(z,M,""+H,ce);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case D:return H.key===Se?R(z,M,H,ce):null;case U:return H.key===Se?Y(z,M,H,ce):null;case J:return Se=H._init,oe(z,M,Se(H._payload),ce)}if(wn(H)||re(H))return Se!==null?null:ie(z,M,H,ce,null);Qc(z,H)}return null}function he(z,M,H,ce,Se){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return z=z.get(H)||null,b(M,z,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case D:return z=z.get(ce.key===null?H:ce.key)||null,R(M,z,ce,Se);case U:return z=z.get(ce.key===null?H:ce.key)||null,Y(M,z,ce,Se);case J:var ke=ce._init;return he(z,M,H,ke(ce._payload),Se)}if(wn(ce)||re(ce))return z=z.get(H)||null,ie(M,z,ce,Se,null);Qc(M,ce)}return null}function ye(z,M,H,ce){for(var Se=null,ke=null,Ee=M,_e=M=0,bt=null;Ee!==null&&_e<H.length;_e++){Ee.index>_e?(bt=Ee,Ee=null):bt=Ee.sibling;var je=oe(z,Ee,H[_e],ce);if(je===null){Ee===null&&(Ee=bt);break}r&&Ee&&je.alternate===null&&s(z,Ee),M=m(je,M,_e),ke===null?Se=je:ke.sibling=je,ke=je,Ee=bt}if(_e===H.length)return a(z,Ee),et&&Bs(z,_e),Se;if(Ee===null){for(;_e<H.length;_e++)Ee=ae(z,H[_e],ce),Ee!==null&&(M=m(Ee,M,_e),ke===null?Se=Ee:ke.sibling=Ee,ke=Ee);return et&&Bs(z,_e),Se}for(Ee=u(z,Ee);_e<H.length;_e++)bt=he(Ee,z,_e,H[_e],ce),bt!==null&&(r&&bt.alternate!==null&&Ee.delete(bt.key===null?_e:bt.key),M=m(bt,M,_e),ke===null?Se=bt:ke.sibling=bt,ke=bt);return r&&Ee.forEach(function(hs){return s(z,hs)}),et&&Bs(z,_e),Se}function ve(z,M,H,ce){var Se=re(H);if(typeof Se!="function")throw Error(n(150));if(H=Se.call(H),H==null)throw Error(n(151));for(var ke=Se=null,Ee=M,_e=M=0,bt=null,je=H.next();Ee!==null&&!je.done;_e++,je=H.next()){Ee.index>_e?(bt=Ee,Ee=null):bt=Ee.sibling;var hs=oe(z,Ee,je.value,ce);if(hs===null){Ee===null&&(Ee=bt);break}r&&Ee&&hs.alternate===null&&s(z,Ee),M=m(hs,M,_e),ke===null?Se=hs:ke.sibling=hs,ke=hs,Ee=bt}if(je.done)return a(z,Ee),et&&Bs(z,_e),Se;if(Ee===null){for(;!je.done;_e++,je=H.next())je=ae(z,je.value,ce),je!==null&&(M=m(je,M,_e),ke===null?Se=je:ke.sibling=je,ke=je);return et&&Bs(z,_e),Se}for(Ee=u(z,Ee);!je.done;_e++,je=H.next())je=he(Ee,z,_e,je.value,ce),je!==null&&(r&&je.alternate!==null&&Ee.delete(je.key===null?_e:je.key),M=m(je,M,_e),ke===null?Se=je:ke.sibling=je,ke=je);return r&&Ee.forEach(function(Jb){return s(z,Jb)}),et&&Bs(z,_e),Se}function pt(z,M,H,ce){if(typeof H=="object"&&H!==null&&H.type===O&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case D:e:{for(var Se=H.key,ke=M;ke!==null;){if(ke.key===Se){if(Se=H.type,Se===O){if(ke.tag===7){a(z,ke.sibling),M=f(ke,H.props.children),M.return=z,z=M;break e}}else if(ke.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&ly(Se)===ke.type){a(z,ke.sibling),M=f(ke,H.props),M.ref=Xi(z,ke,H),M.return=z,z=M;break e}a(z,ke);break}else s(z,ke);ke=ke.sibling}H.type===O?(M=Js(H.props.children,z.mode,ce,H.key),M.return=z,z=M):(ce=vu(H.type,H.key,H.props,null,z.mode,ce),ce.ref=Xi(z,M,H),ce.return=z,z=ce)}return S(z);case U:e:{for(ke=H.key;M!==null;){if(M.key===ke)if(M.tag===4&&M.stateNode.containerInfo===H.containerInfo&&M.stateNode.implementation===H.implementation){a(z,M.sibling),M=f(M,H.children||[]),M.return=z,z=M;break e}else{a(z,M);break}else s(z,M);M=M.sibling}M=ah(H,z.mode,ce),M.return=z,z=M}return S(z);case J:return ke=H._init,pt(z,M,ke(H._payload),ce)}if(wn(H))return ye(z,M,H,ce);if(re(H))return ve(z,M,H,ce);Qc(z,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,M!==null&&M.tag===6?(a(z,M.sibling),M=f(M,H),M.return=z,z=M):(a(z,M),M=ih(H,z.mode,ce),M.return=z,z=M),S(z)):a(z,M)}return pt}var Vo=fy(!0),dy=fy(!1),Jc=ns(null),Gc=null,qo=null,gd=null;function yd(){gd=qo=Gc=null}function vd(r){var s=Jc.current;Ze(Jc),r._currentValue=s}function Sd(r,s,a){for(;r!==null;){var u=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),r===a)break;r=r.return}}function Wo(r,s){Gc=r,gd=qo=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(ln=!0),r.firstContext=null)}function Dn(r){var s=r._currentValue;if(gd!==r)if(r={context:r,memoizedValue:s,next:null},qo===null){if(Gc===null)throw Error(n(308));qo=r,Gc.dependencies={lanes:0,firstContext:r}}else qo=qo.next=r;return s}var zs=null;function xd(r){zs===null?zs=[r]:zs.push(r)}function hy(r,s,a,u){var f=s.interleaved;return f===null?(a.next=a,xd(s)):(a.next=f.next,f.next=a),s.interleaved=a,Or(r,u)}function Or(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 os=!1;function wd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function my(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 Nr(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function is(r,s,a){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(De&2)!==0){var f=u.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),u.pending=s,Or(r,a)}return f=u.interleaved,f===null?(s.next=s,xd(u)):(s.next=f.next,f.next=s),u.interleaved=s,Or(r,a)}function Yc(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194240)!==0)){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Of(r,a)}}function py(r,s){var a=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var f=null,m=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};m===null?f=m=S:m=m.next=S,a=a.next}while(a!==null);m===null?f=m=s:m=m.next=s}else f=m=s;a={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:u.shared,effects:u.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}function Xc(r,s,a,u){var f=r.updateQueue;os=!1;var m=f.firstBaseUpdate,S=f.lastBaseUpdate,b=f.shared.pending;if(b!==null){f.shared.pending=null;var R=b,Y=R.next;R.next=null,S===null?m=Y:S.next=Y,S=R;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,b=ie.lastBaseUpdate,b!==S&&(b===null?ie.firstBaseUpdate=Y:b.next=Y,ie.lastBaseUpdate=R))}if(m!==null){var ae=f.baseState;S=0,ie=Y=R=null,b=m;do{var oe=b.lane,he=b.eventTime;if((u&oe)===oe){ie!==null&&(ie=ie.next={eventTime:he,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ye=r,ve=b;switch(oe=s,he=a,ve.tag){case 1:if(ye=ve.payload,typeof ye=="function"){ae=ye.call(he,ae,oe);break e}ae=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ve.payload,oe=typeof ye=="function"?ye.call(he,ae,oe):ye,oe==null)break e;ae=te({},ae,oe);break e;case 2:os=!0}}b.callback!==null&&b.lane!==0&&(r.flags|=64,oe=f.effects,oe===null?f.effects=[b]:oe.push(b))}else he={eventTime:he,lane:oe,tag:b.tag,payload:b.payload,callback:b.callback,next:null},ie===null?(Y=ie=he,R=ae):ie=ie.next=he,S|=oe;if(b=b.next,b===null){if(b=f.shared.pending,b===null)break;oe=b,b=oe.next,oe.next=null,f.lastBaseUpdate=oe,f.shared.pending=null}}while(!0);if(ie===null&&(R=ae),f.baseState=R,f.firstBaseUpdate=Y,f.lastBaseUpdate=ie,s=f.shared.interleaved,s!==null){f=s;do S|=f.lane,f=f.next;while(f!==s)}else m===null&&(f.shared.lanes=0);Ws|=S,r.lanes=S,r.memoizedState=ae}}function gy(r,s,a){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var u=r[s],f=u.callback;if(f!==null){if(u.callback=null,u=a,typeof f!="function")throw Error(n(191,f));f.call(u)}}}var Zi={},gr=ns(Zi),ea=ns(Zi),ta=ns(Zi);function Vs(r){if(r===Zi)throw Error(n(174));return r}function kd(r,s){switch(Qe(ta,s),Qe(ea,r),Qe(gr,Zi),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Jn(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Jn(s,r)}Ze(gr),Qe(gr,s)}function Ho(){Ze(gr),Ze(ea),Ze(ta)}function yy(r){Vs(ta.current);var s=Vs(gr.current),a=Jn(s,r.type);s!==a&&(Qe(ea,r),Qe(gr,a))}function Ed(r){ea.current===r&&(Ze(gr),Ze(ea))}var st=ns(0);function Zc(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 _d=[];function Cd(){for(var r=0;r<_d.length;r++)_d[r]._workInProgressVersionPrimary=null;_d.length=0}var eu=C.ReactCurrentDispatcher,bd=C.ReactCurrentBatchConfig,qs=0,ot=null,xt=null,_t=null,tu=!1,na=!1,ra=0,yb=0;function zt(){throw Error(n(321))}function Pd(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!Yn(r[a],s[a]))return!1;return!0}function Fd(r,s,a,u,f,m){if(qs=m,ot=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,eu.current=r===null||r.memoizedState===null?wb:kb,r=a(u,f),na){m=0;do{if(na=!1,ra=0,25<=m)throw Error(n(301));m+=1,_t=xt=null,s.updateQueue=null,eu.current=Eb,r=a(u,f)}while(na)}if(eu.current=su,s=xt!==null&&xt.next!==null,qs=0,_t=xt=ot=null,tu=!1,s)throw Error(n(300));return r}function Id(){var r=ra!==0;return ra=0,r}function yr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?ot.memoizedState=_t=r:_t=_t.next=r,_t}function jn(){if(xt===null){var r=ot.alternate;r=r!==null?r.memoizedState:null}else r=xt.next;var s=_t===null?ot.memoizedState:_t.next;if(s!==null)_t=s,xt=r;else{if(r===null)throw Error(n(310));xt=r,r={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},_t===null?ot.memoizedState=_t=r:_t=_t.next=r}return _t}function sa(r,s){return typeof s=="function"?s(r):s}function Rd(r){var s=jn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=xt,f=u.baseQueue,m=a.pending;if(m!==null){if(f!==null){var S=f.next;f.next=m.next,m.next=S}u.baseQueue=f=m,a.pending=null}if(f!==null){m=f.next,u=u.baseState;var b=S=null,R=null,Y=m;do{var ie=Y.lane;if((qs&ie)===ie)R!==null&&(R=R.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),u=Y.hasEagerState?Y.eagerState:r(u,Y.action);else{var ae={lane:ie,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};R===null?(b=R=ae,S=u):R=R.next=ae,ot.lanes|=ie,Ws|=ie}Y=Y.next}while(Y!==null&&Y!==m);R===null?S=u:R.next=b,Yn(u,s.memoizedState)||(ln=!0),s.memoizedState=u,s.baseState=S,s.baseQueue=R,a.lastRenderedState=u}if(r=a.interleaved,r!==null){f=r;do m=f.lane,ot.lanes|=m,Ws|=m,f=f.next;while(f!==r)}else f===null&&(a.lanes=0);return[s.memoizedState,a.dispatch]}function Td(r){var s=jn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=a.dispatch,f=a.pending,m=s.memoizedState;if(f!==null){a.pending=null;var S=f=f.next;do m=r(m,S.action),S=S.next;while(S!==f);Yn(m,s.memoizedState)||(ln=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),a.lastRenderedState=m}return[m,u]}function vy(){}function Sy(r,s){var a=ot,u=jn(),f=s(),m=!Yn(u.memoizedState,f);if(m&&(u.memoizedState=f,ln=!0),u=u.queue,Md(ky.bind(null,a,u,r),[r]),u.getSnapshot!==s||m||_t!==null&&_t.memoizedState.tag&1){if(a.flags|=2048,oa(9,wy.bind(null,a,u,f,s),void 0,null),Ct===null)throw Error(n(349));(qs&30)!==0||xy(a,s,f)}return f}function xy(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function wy(r,s,a,u){s.value=a,s.getSnapshot=u,Ey(s)&&_y(r)}function ky(r,s,a){return a(function(){Ey(s)&&_y(r)})}function Ey(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!Yn(r,a)}catch{return!0}}function _y(r){var s=Or(r,1);s!==null&&nr(s,r,1,-1)}function Cy(r){var s=yr();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:r},s.queue=r,r=r.dispatch=xb.bind(null,ot,r),[s.memoizedState,r]}function oa(r,s,a,u){return r={tag:r,create:s,destroy:a,deps:u,next:null},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.lastEffect=r.next=r):(a=s.lastEffect,a===null?s.lastEffect=r.next=r:(u=a.next,a.next=r,r.next=u,s.lastEffect=r)),r}function by(){return jn().memoizedState}function nu(r,s,a,u){var f=yr();ot.flags|=r,f.memoizedState=oa(1|s,a,void 0,u===void 0?null:u)}function ru(r,s,a,u){var f=jn();u=u===void 0?null:u;var m=void 0;if(xt!==null){var S=xt.memoizedState;if(m=S.destroy,u!==null&&Pd(u,S.deps)){f.memoizedState=oa(s,a,m,u);return}}ot.flags|=r,f.memoizedState=oa(1|s,a,m,u)}function Py(r,s){return nu(8390656,8,r,s)}function Md(r,s){return ru(2048,8,r,s)}function Fy(r,s){return ru(4,2,r,s)}function Iy(r,s){return ru(4,4,r,s)}function Ry(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 Ty(r,s,a){return a=a!=null?a.concat([r]):null,ru(4,4,Ry.bind(null,s,r),a)}function Ad(){}function My(r,s){var a=jn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&Pd(s,u[1])?u[0]:(a.memoizedState=[r,s],r)}function Ay(r,s){var a=jn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&Pd(s,u[1])?u[0]:(r=r(),a.memoizedState=[r,s],r)}function Ly(r,s,a){return(qs&21)===0?(r.baseState&&(r.baseState=!1,ln=!0),r.memoizedState=a):(Yn(a,s)||(a=l0(),ot.lanes|=a,Ws|=a,r.baseState=!0),s)}function vb(r,s){var a=Ve;Ve=a!==0&&4>a?a:4,r(!0);var u=bd.transition;bd.transition={};try{r(!1),s()}finally{Ve=a,bd.transition=u}}function Oy(){return jn().memoizedState}function Sb(r,s,a){var u=ls(r);if(a={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null},Ny(r))Dy(s,a);else if(a=hy(r,s,a,u),a!==null){var f=Zt();nr(a,r,u,f),jy(a,s,u)}}function xb(r,s,a){var u=ls(r),f={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ny(r))Dy(s,f);else{var m=r.alternate;if(r.lanes===0&&(m===null||m.lanes===0)&&(m=s.lastRenderedReducer,m!==null))try{var S=s.lastRenderedState,b=m(S,a);if(f.hasEagerState=!0,f.eagerState=b,Yn(b,S)){var R=s.interleaved;R===null?(f.next=f,xd(s)):(f.next=R.next,R.next=f),s.interleaved=f;return}}catch{}finally{}a=hy(r,s,f,u),a!==null&&(f=Zt(),nr(a,r,u,f),jy(a,s,u))}}function Ny(r){var s=r.alternate;return r===ot||s!==null&&s===ot}function Dy(r,s){na=tu=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function jy(r,s,a){if((a&4194240)!==0){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Of(r,a)}}var su={readContext:Dn,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},wb={readContext:Dn,useCallback:function(r,s){return yr().memoizedState=[r,s===void 0?null:s],r},useContext:Dn,useEffect:Py,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,nu(4194308,4,Ry.bind(null,s,r),a)},useLayoutEffect:function(r,s){return nu(4194308,4,r,s)},useInsertionEffect:function(r,s){return nu(4,2,r,s)},useMemo:function(r,s){var a=yr();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var u=yr();return s=a!==void 0?a(s):s,u.memoizedState=u.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},u.queue=r,r=r.dispatch=Sb.bind(null,ot,r),[u.memoizedState,r]},useRef:function(r){var s=yr();return r={current:r},s.memoizedState=r},useState:Cy,useDebugValue:Ad,useDeferredValue:function(r){return yr().memoizedState=r},useTransition:function(){var r=Cy(!1),s=r[0];return r=vb.bind(null,r[1]),yr().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var u=ot,f=yr();if(et){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),Ct===null)throw Error(n(349));(qs&30)!==0||xy(u,s,a)}f.memoizedState=a;var m={value:a,getSnapshot:s};return f.queue=m,Py(ky.bind(null,u,m,r),[r]),u.flags|=2048,oa(9,wy.bind(null,u,m,a,s),void 0,null),a},useId:function(){var r=yr(),s=Ct.identifierPrefix;if(et){var a=Lr,u=Ar;a=(u&~(1<<32-Gn(u)-1)).toString(32)+a,s=":"+s+"R"+a,a=ra++,0<a&&(s+="H"+a.toString(32)),s+=":"}else a=yb++,s=":"+s+"r"+a.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},kb={readContext:Dn,useCallback:My,useContext:Dn,useEffect:Md,useImperativeHandle:Ty,useInsertionEffect:Fy,useLayoutEffect:Iy,useMemo:Ay,useReducer:Rd,useRef:by,useState:function(){return Rd(sa)},useDebugValue:Ad,useDeferredValue:function(r){var s=jn();return Ly(s,xt.memoizedState,r)},useTransition:function(){var r=Rd(sa)[0],s=jn().memoizedState;return[r,s]},useMutableSource:vy,useSyncExternalStore:Sy,useId:Oy,unstable_isNewReconciler:!1},Eb={readContext:Dn,useCallback:My,useContext:Dn,useEffect:Md,useImperativeHandle:Ty,useInsertionEffect:Fy,useLayoutEffect:Iy,useMemo:Ay,useReducer:Td,useRef:by,useState:function(){return Td(sa)},useDebugValue:Ad,useDeferredValue:function(r){var s=jn();return xt===null?s.memoizedState=r:Ly(s,xt.memoizedState,r)},useTransition:function(){var r=Td(sa)[0],s=jn().memoizedState;return[r,s]},useMutableSource:vy,useSyncExternalStore:Sy,useId:Oy,unstable_isNewReconciler:!1};function Zn(r,s){if(r&&r.defaultProps){s=te({},s),r=r.defaultProps;for(var a in r)s[a]===void 0&&(s[a]=r[a]);return s}return s}function Ld(r,s,a,u){s=r.memoizedState,a=a(u,s),a=a==null?s:te({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var ou={isMounted:function(r){return(r=r._reactInternals)?Ds(r)===r:!1},enqueueSetState:function(r,s,a){r=r._reactInternals;var u=Zt(),f=ls(r),m=Nr(u,f);m.payload=s,a!=null&&(m.callback=a),s=is(r,m,f),s!==null&&(nr(s,r,f,u),Yc(s,r,f))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var u=Zt(),f=ls(r),m=Nr(u,f);m.tag=1,m.payload=s,a!=null&&(m.callback=a),s=is(r,m,f),s!==null&&(nr(s,r,f,u),Yc(s,r,f))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=Zt(),u=ls(r),f=Nr(a,u);f.tag=2,s!=null&&(f.callback=s),s=is(r,f,u),s!==null&&(nr(s,r,u,a),Yc(s,r,u))}};function $y(r,s,a,u,f,m,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,m,S):s.prototype&&s.prototype.isPureReactComponent?!Wi(a,u)||!Wi(f,m):!0}function Uy(r,s,a){var u=!1,f=rs,m=s.contextType;return typeof m=="object"&&m!==null?m=Dn(m):(f=un(s)?$s:Bt.current,u=s.contextTypes,m=(u=u!=null)?$o(r,f):rs),s=new s(a,m),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=ou,r.stateNode=s,s._reactInternals=r,u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=f,r.__reactInternalMemoizedMaskedChildContext=m),s}function By(r,s,a,u){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,u),s.state!==r&&ou.enqueueReplaceState(s,s.state,null)}function Od(r,s,a,u){var f=r.stateNode;f.props=a,f.state=r.memoizedState,f.refs={},wd(r);var m=s.contextType;typeof m=="object"&&m!==null?f.context=Dn(m):(m=un(s)?$s:Bt.current,f.context=$o(r,m)),f.state=r.memoizedState,m=s.getDerivedStateFromProps,typeof m=="function"&&(Ld(r,s,m,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&&ou.enqueueReplaceState(f,f.state,null),Xc(r,a,f,u),f.state=r.memoizedState),typeof f.componentDidMount=="function"&&(r.flags|=4194308)}function Ko(r,s){try{var a="",u=s;do a+=fe(u),u=u.return;while(u);var f=a}catch(m){f=`
|
|
40
|
+
Error generating stack: `+m.message+`
|
|
41
|
+
`+m.stack}return{value:r,source:s,stack:f,digest:null}}function Nd(r,s,a){return{value:r,source:null,stack:a??null,digest:s??null}}function Dd(r,s){try{console.error(s.value)}catch(a){setTimeout(function(){throw a})}}var _b=typeof WeakMap=="function"?WeakMap:Map;function zy(r,s,a){a=Nr(-1,a),a.tag=3,a.payload={element:null};var u=s.value;return a.callback=function(){du||(du=!0,Xd=u),Dd(r,s)},a}function Vy(r,s,a){a=Nr(-1,a),a.tag=3;var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;a.payload=function(){return u(f)},a.callback=function(){Dd(r,s)}}var m=r.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(a.callback=function(){Dd(r,s),typeof u!="function"&&(cs===null?cs=new Set([this]):cs.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),a}function qy(r,s,a){var u=r.pingCache;if(u===null){u=r.pingCache=new _b;var f=new Set;u.set(s,f)}else f=u.get(s),f===void 0&&(f=new Set,u.set(s,f));f.has(a)||(f.add(a),r=jb.bind(null,r,s,a),s.then(r,r))}function Wy(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 Hy(r,s,a,u,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=Nr(-1,1),s.tag=2,is(a,s,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=f,r)}var Cb=C.ReactCurrentOwner,ln=!1;function Xt(r,s,a,u){s.child=r===null?dy(s,null,a,u):Vo(s,r.child,a,u)}function Ky(r,s,a,u,f){a=a.render;var m=s.ref;return Wo(s,f),u=Fd(r,s,a,u,m,f),a=Id(),r!==null&&!ln?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Dr(r,s,f)):(et&&a&&fd(s),s.flags|=1,Xt(r,s,u,f),s.child)}function Qy(r,s,a,u,f){if(r===null){var m=a.type;return typeof m=="function"&&!oh(m)&&m.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(s.tag=15,s.type=m,Jy(r,s,m,u,f)):(r=vu(a.type,null,u,s,s.mode,f),r.ref=s.ref,r.return=s,s.child=r)}if(m=r.child,(r.lanes&f)===0){var S=m.memoizedProps;if(a=a.compare,a=a!==null?a:Wi,a(S,u)&&r.ref===s.ref)return Dr(r,s,f)}return s.flags|=1,r=ds(m,u),r.ref=s.ref,r.return=s,s.child=r}function Jy(r,s,a,u,f){if(r!==null){var m=r.memoizedProps;if(Wi(m,u)&&r.ref===s.ref)if(ln=!1,s.pendingProps=u=m,(r.lanes&f)!==0)(r.flags&131072)!==0&&(ln=!0);else return s.lanes=r.lanes,Dr(r,s,f)}return jd(r,s,a,u,f)}function Gy(r,s,a){var u=s.pendingProps,f=u.children,m=r!==null?r.memoizedState:null;if(u.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(Jo,Cn),Cn|=a;else{if((a&1073741824)===0)return r=m!==null?m.baseLanes|a:a,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Qe(Jo,Cn),Cn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=m!==null?m.baseLanes:a,Qe(Jo,Cn),Cn|=u}else m!==null?(u=m.baseLanes|a,s.memoizedState=null):u=a,Qe(Jo,Cn),Cn|=u;return Xt(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 jd(r,s,a,u,f){var m=un(a)?$s:Bt.current;return m=$o(s,m),Wo(s,f),a=Fd(r,s,a,u,m,f),u=Id(),r!==null&&!ln?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Dr(r,s,f)):(et&&u&&fd(s),s.flags|=1,Xt(r,s,a,f),s.child)}function Xy(r,s,a,u,f){if(un(a)){var m=!0;Vc(s)}else m=!1;if(Wo(s,f),s.stateNode===null)au(r,s),Uy(s,a,u),Od(s,a,u,f),u=!0;else if(r===null){var S=s.stateNode,b=s.memoizedProps;S.props=b;var R=S.context,Y=a.contextType;typeof Y=="object"&&Y!==null?Y=Dn(Y):(Y=un(a)?$s:Bt.current,Y=$o(s,Y));var ie=a.getDerivedStateFromProps,ae=typeof ie=="function"||typeof S.getSnapshotBeforeUpdate=="function";ae||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(b!==u||R!==Y)&&By(s,S,u,Y),os=!1;var oe=s.memoizedState;S.state=oe,Xc(s,u,S,f),R=s.memoizedState,b!==u||oe!==R||cn.current||os?(typeof ie=="function"&&(Ld(s,a,ie,u),R=s.memoizedState),(b=os||$y(s,a,b,u,oe,R,Y))?(ae||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=u,s.memoizedState=R),S.props=u,S.state=R,S.context=Y,u=b):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{S=s.stateNode,my(r,s),b=s.memoizedProps,Y=s.type===s.elementType?b:Zn(s.type,b),S.props=Y,ae=s.pendingProps,oe=S.context,R=a.contextType,typeof R=="object"&&R!==null?R=Dn(R):(R=un(a)?$s:Bt.current,R=$o(s,R));var he=a.getDerivedStateFromProps;(ie=typeof he=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(b!==ae||oe!==R)&&By(s,S,u,R),os=!1,oe=s.memoizedState,S.state=oe,Xc(s,u,S,f);var ye=s.memoizedState;b!==ae||oe!==ye||cn.current||os?(typeof he=="function"&&(Ld(s,a,he,u),ye=s.memoizedState),(Y=os||$y(s,a,Y,u,oe,ye,R)||!1)?(ie||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(u,ye,R),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(u,ye,R)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=ye),S.props=u,S.state=ye,S.context=R,u=Y):(typeof S.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),u=!1)}return $d(r,s,a,u,m,f)}function $d(r,s,a,u,f,m){Yy(r,s);var S=(s.flags&128)!==0;if(!u&&!S)return f&&ry(s,a,!1),Dr(r,s,m);u=s.stateNode,Cb.current=s;var b=S&&typeof a.getDerivedStateFromError!="function"?null:u.render();return s.flags|=1,r!==null&&S?(s.child=Vo(s,r.child,null,m),s.child=Vo(s,null,b,m)):Xt(r,s,b,m),s.memoizedState=u.state,f&&ry(s,a,!0),s.child}function Zy(r){var s=r.stateNode;s.pendingContext?ty(r,s.pendingContext,s.pendingContext!==s.context):s.context&&ty(r,s.context,!1),kd(r,s.containerInfo)}function ev(r,s,a,u,f){return zo(),pd(f),s.flags|=256,Xt(r,s,a,u),s.child}var Ud={dehydrated:null,treeContext:null,retryLane:0};function Bd(r){return{baseLanes:r,cachePool:null,transitions:null}}function tv(r,s,a){var u=s.pendingProps,f=st.current,m=!1,S=(s.flags&128)!==0,b;if((b=S)||(b=r!==null&&r.memoizedState===null?!1:(f&2)!==0),b?(m=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(f|=1),Qe(st,f&1),r===null)return md(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=u.children,r=u.fallback,m?(u=s.mode,m=s.child,S={mode:"hidden",children:S},(u&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=S):m=Su(S,u,0,null),r=Js(r,u,a,null),m.return=s,r.return=s,m.sibling=r,s.child=m,s.child.memoizedState=Bd(a),s.memoizedState=Ud,r):zd(s,S));if(f=r.memoizedState,f!==null&&(b=f.dehydrated,b!==null))return bb(r,s,S,u,b,f,a);if(m){m=u.fallback,S=s.mode,f=r.child,b=f.sibling;var R={mode:"hidden",children:u.children};return(S&1)===0&&s.child!==f?(u=s.child,u.childLanes=0,u.pendingProps=R,s.deletions=null):(u=ds(f,R),u.subtreeFlags=f.subtreeFlags&14680064),b!==null?m=ds(b,m):(m=Js(m,S,a,null),m.flags|=2),m.return=s,u.return=s,u.sibling=m,s.child=u,u=m,m=s.child,S=r.child.memoizedState,S=S===null?Bd(a):{baseLanes:S.baseLanes|a,cachePool:null,transitions:S.transitions},m.memoizedState=S,m.childLanes=r.childLanes&~a,s.memoizedState=Ud,u}return m=r.child,r=m.sibling,u=ds(m,{mode:"visible",children:u.children}),(s.mode&1)===0&&(u.lanes=a),u.return=s,u.sibling=null,r!==null&&(a=s.deletions,a===null?(s.deletions=[r],s.flags|=16):a.push(r)),s.child=u,s.memoizedState=null,u}function zd(r,s){return s=Su({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function iu(r,s,a,u){return u!==null&&pd(u),Vo(s,r.child,null,a),r=zd(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function bb(r,s,a,u,f,m,S){if(a)return s.flags&256?(s.flags&=-257,u=Nd(Error(n(422))),iu(r,s,S,u)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(m=u.fallback,f=s.mode,u=Su({mode:"visible",children:u.children},f,0,null),m=Js(m,f,S,null),m.flags|=2,u.return=s,m.return=s,u.sibling=m,s.child=u,(s.mode&1)!==0&&Vo(s,r.child,null,S),s.child.memoizedState=Bd(S),s.memoizedState=Ud,m);if((s.mode&1)===0)return iu(r,s,S,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var b=u.dgst;return u=b,m=Error(n(419)),u=Nd(m,u,void 0),iu(r,s,S,u)}if(b=(S&r.childLanes)!==0,ln||b){if(u=Ct,u!==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&(u.suspendedLanes|S))!==0?0:f,f!==0&&f!==m.retryLane&&(m.retryLane=f,Or(r,f),nr(u,r,f,-1))}return sh(),u=Nd(Error(n(421))),iu(r,s,S,u)}return f.data==="$?"?(s.flags|=128,s.child=r.child,s=$b.bind(null,r),f._reactRetry=s,null):(r=m.treeContext,_n=ts(f.nextSibling),En=s,et=!0,Xn=null,r!==null&&(On[Nn++]=Ar,On[Nn++]=Lr,On[Nn++]=Us,Ar=r.id,Lr=r.overflow,Us=s),s=zd(s,u.children),s.flags|=4096,s)}function nv(r,s,a){r.lanes|=s;var u=r.alternate;u!==null&&(u.lanes|=s),Sd(r.return,s,a)}function Vd(r,s,a,u,f){var m=r.memoizedState;m===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:f}:(m.isBackwards=s,m.rendering=null,m.renderingStartTime=0,m.last=u,m.tail=a,m.tailMode=f)}function rv(r,s,a){var u=s.pendingProps,f=u.revealOrder,m=u.tail;if(Xt(r,s,u.children,a),u=st.current,(u&2)!==0)u=u&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&&nv(r,a,s);else if(r.tag===19)nv(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}u&=1}if(Qe(st,u),(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&&Zc(r)===null&&(f=a),a=a.sibling;a=f,a===null?(f=s.child,s.child=null):(f=a.sibling,a.sibling=null),Vd(s,!1,f,a,m);break;case"backwards":for(a=null,f=s.child,s.child=null;f!==null;){if(r=f.alternate,r!==null&&Zc(r)===null){s.child=f;break}r=f.sibling,f.sibling=a,a=f,f=r}Vd(s,!0,a,null,m);break;case"together":Vd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function au(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Dr(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),Ws|=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=ds(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=ds(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function Pb(r,s,a){switch(s.tag){case 3:Zy(s),zo();break;case 5:yy(s);break;case 1:un(s.type)&&Vc(s);break;case 4:kd(s,s.stateNode.containerInfo);break;case 10:var u=s.type._context,f=s.memoizedProps.value;Qe(Jc,u._currentValue),u._currentValue=f;break;case 13:if(u=s.memoizedState,u!==null)return u.dehydrated!==null?(Qe(st,st.current&1),s.flags|=128,null):(a&s.child.childLanes)!==0?tv(r,s,a):(Qe(st,st.current&1),r=Dr(r,s,a),r!==null?r.sibling:null);Qe(st,st.current&1);break;case 19:if(u=(a&s.childLanes)!==0,(r.flags&128)!==0){if(u)return rv(r,s,a);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Qe(st,st.current),u)break;return null;case 22:case 23:return s.lanes=0,Gy(r,s,a)}return Dr(r,s,a)}var sv,qd,ov,iv;sv=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}},qd=function(){},ov=function(r,s,a,u){var f=r.memoizedProps;if(f!==u){r=s.stateNode,Vs(gr.current);var m=null;switch(a){case"input":f=Ln(r,f),u=Ln(r,u),m=[];break;case"select":f=te({},f,{value:void 0}),u=te({},u,{value:void 0}),m=[];break;case"textarea":f=bo(r,f),u=bo(r,u),m=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(r.onclick=Uc)}_f(a,u);var S;a=null;for(Y in f)if(!u.hasOwnProperty(Y)&&f.hasOwnProperty(Y)&&f[Y]!=null)if(Y==="style"){var b=f[Y];for(S in b)b.hasOwnProperty(S)&&(a||(a={}),a[S]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(i.hasOwnProperty(Y)?m||(m=[]):(m=m||[]).push(Y,null));for(Y in u){var R=u[Y];if(b=f!=null?f[Y]:void 0,u.hasOwnProperty(Y)&&R!==b&&(R!=null||b!=null))if(Y==="style")if(b){for(S in b)!b.hasOwnProperty(S)||R&&R.hasOwnProperty(S)||(a||(a={}),a[S]="");for(S in R)R.hasOwnProperty(S)&&b[S]!==R[S]&&(a||(a={}),a[S]=R[S])}else a||(m||(m=[]),m.push(Y,a)),a=R;else Y==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,b=b?b.__html:void 0,R!=null&&b!==R&&(m=m||[]).push(Y,R)):Y==="children"?typeof R!="string"&&typeof R!="number"||(m=m||[]).push(Y,""+R):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(i.hasOwnProperty(Y)?(R!=null&&Y==="onScroll"&&Xe("scroll",r),m||b===R||(m=[])):(m=m||[]).push(Y,R))}a&&(m=m||[]).push("style",a);var Y=m;(s.updateQueue=Y)&&(s.flags|=4)}},iv=function(r,s,a,u){a!==u&&(s.flags|=4)};function ia(r,s){if(!et)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 u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function Vt(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,u=0;if(s)for(var f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=r,f=f.sibling;else for(f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=r,f=f.sibling;return r.subtreeFlags|=u,r.childLanes=a,s}function Fb(r,s,a){var u=s.pendingProps;switch(dd(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(s),null;case 1:return un(s.type)&&zc(),Vt(s),null;case 3:return u=s.stateNode,Ho(),Ze(cn),Ze(Bt),Cd(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Kc(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Xn!==null&&(th(Xn),Xn=null))),qd(r,s),Vt(s),null;case 5:Ed(s);var f=Vs(ta.current);if(a=s.type,r!==null&&s.stateNode!=null)ov(r,s,a,u,f),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!u){if(s.stateNode===null)throw Error(n(166));return Vt(s),null}if(r=Vs(gr.current),Kc(s)){u=s.stateNode,a=s.type;var m=s.memoizedProps;switch(u[pr]=s,u[Gi]=m,r=(s.mode&1)!==0,a){case"dialog":Xe("cancel",u),Xe("close",u);break;case"iframe":case"object":case"embed":Xe("load",u);break;case"video":case"audio":for(f=0;f<Ki.length;f++)Xe(Ki[f],u);break;case"source":Xe("error",u);break;case"img":case"image":case"link":Xe("error",u),Xe("load",u);break;case"details":Xe("toggle",u);break;case"input":_o(u,m),Xe("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!m.multiple},Xe("invalid",u);break;case"textarea":vc(u,m),Xe("invalid",u)}_f(a,m),f=null;for(var S in m)if(m.hasOwnProperty(S)){var b=m[S];S==="children"?typeof b=="string"?u.textContent!==b&&(m.suppressHydrationWarning!==!0&&$c(u.textContent,b,r),f=["children",b]):typeof b=="number"&&u.textContent!==""+b&&(m.suppressHydrationWarning!==!0&&$c(u.textContent,b,r),f=["children",""+b]):i.hasOwnProperty(S)&&b!=null&&S==="onScroll"&&Xe("scroll",u)}switch(a){case"input":Yt(u),Rr(u,m,!0);break;case"textarea":Yt(u),ze(u);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(u.onclick=Uc)}u=f,s.updateQueue=u,u!==null&&(s.flags|=4)}else{S=f.nodeType===9?f:f.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Lt(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=S.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof u.is=="string"?r=S.createElement(a,{is:u.is}):(r=S.createElement(a),a==="select"&&(S=r,u.multiple?S.multiple=!0:u.size&&(S.size=u.size))):r=S.createElementNS(r,a),r[pr]=s,r[Gi]=u,sv(r,s,!1,!1),s.stateNode=r;e:{switch(S=Cf(a,u),a){case"dialog":Xe("cancel",r),Xe("close",r),f=u;break;case"iframe":case"object":case"embed":Xe("load",r),f=u;break;case"video":case"audio":for(f=0;f<Ki.length;f++)Xe(Ki[f],r);f=u;break;case"source":Xe("error",r),f=u;break;case"img":case"image":case"link":Xe("error",r),Xe("load",r),f=u;break;case"details":Xe("toggle",r),f=u;break;case"input":_o(r,u),f=Ln(r,u),Xe("invalid",r);break;case"option":f=u;break;case"select":r._wrapperState={wasMultiple:!!u.multiple},f=te({},u,{value:void 0}),Xe("invalid",r);break;case"textarea":vc(r,u),f=bo(r,u),Xe("invalid",r);break;default:f=u}_f(a,f),b=f;for(m in b)if(b.hasOwnProperty(m)){var R=b[m];m==="style"?Jg(r,R):m==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Kg(r,R)):m==="children"?typeof R=="string"?(a!=="textarea"||R!=="")&&Fi(r,R):typeof R=="number"&&Fi(r,""+R):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(i.hasOwnProperty(m)?R!=null&&m==="onScroll"&&Xe("scroll",r):R!=null&&A(r,m,R,S))}switch(a){case"input":Yt(r),Rr(r,u,!1);break;case"textarea":Yt(r),ze(r);break;case"option":u.value!=null&&r.setAttribute("value",""+Ce(u.value));break;case"select":r.multiple=!!u.multiple,m=u.value,m!=null?Qr(r,!!u.multiple,m,!1):u.defaultValue!=null&&Qr(r,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(r.onclick=Uc)}switch(a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Vt(s),null;case 6:if(r&&s.stateNode!=null)iv(r,s,r.memoizedProps,u);else{if(typeof u!="string"&&s.stateNode===null)throw Error(n(166));if(a=Vs(ta.current),Vs(gr.current),Kc(s)){if(u=s.stateNode,a=s.memoizedProps,u[pr]=s,(m=u.nodeValue!==a)&&(r=En,r!==null))switch(r.tag){case 3:$c(u.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&$c(u.nodeValue,a,(r.mode&1)!==0)}m&&(s.flags|=4)}else u=(a.nodeType===9?a:a.ownerDocument).createTextNode(u),u[pr]=s,s.stateNode=u}return Vt(s),null;case 13:if(Ze(st),u=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(et&&_n!==null&&(s.mode&1)!==0&&(s.flags&128)===0)uy(),zo(),s.flags|=98560,m=!1;else if(m=Kc(s),u!==null&&u.dehydrated!==null){if(r===null){if(!m)throw Error(n(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(n(317));m[pr]=s}else zo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Vt(s),m=!1}else Xn!==null&&(th(Xn),Xn=null),m=!0;if(!m)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=a,s):(u=u!==null,u!==(r!==null&&r.memoizedState!==null)&&u&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(st.current&1)!==0?wt===0&&(wt=3):sh())),s.updateQueue!==null&&(s.flags|=4),Vt(s),null);case 4:return Ho(),qd(r,s),r===null&&Qi(s.stateNode.containerInfo),Vt(s),null;case 10:return vd(s.type._context),Vt(s),null;case 17:return un(s.type)&&zc(),Vt(s),null;case 19:if(Ze(st),m=s.memoizedState,m===null)return Vt(s),null;if(u=(s.flags&128)!==0,S=m.rendering,S===null)if(u)ia(m,!1);else{if(wt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(S=Zc(r),S!==null){for(s.flags|=128,ia(m,!1),u=S.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),s.subtreeFlags=0,u=a,a=s.child;a!==null;)m=a,r=u,m.flags&=14680066,S=m.alternate,S===null?(m.childLanes=0,m.lanes=r,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=S.childLanes,m.lanes=S.lanes,m.child=S.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=S.memoizedProps,m.memoizedState=S.memoizedState,m.updateQueue=S.updateQueue,m.type=S.type,r=S.dependencies,m.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return Qe(st,st.current&1|2),s.child}r=r.sibling}m.tail!==null&&mt()>Go&&(s.flags|=128,u=!0,ia(m,!1),s.lanes=4194304)}else{if(!u)if(r=Zc(S),r!==null){if(s.flags|=128,u=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),ia(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!et)return Vt(s),null}else 2*mt()-m.renderingStartTime>Go&&a!==1073741824&&(s.flags|=128,u=!0,ia(m,!1),s.lanes=4194304);m.isBackwards?(S.sibling=s.child,s.child=S):(a=m.last,a!==null?a.sibling=S:s.child=S,m.last=S)}return m.tail!==null?(s=m.tail,m.rendering=s,m.tail=s.sibling,m.renderingStartTime=mt(),s.sibling=null,a=st.current,Qe(st,u?a&1|2:a&1),s):(Vt(s),null);case 22:case 23:return rh(),u=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==u&&(s.flags|=8192),u&&(s.mode&1)!==0?(Cn&1073741824)!==0&&(Vt(s),s.subtreeFlags&6&&(s.flags|=8192)):Vt(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function Ib(r,s){switch(dd(s),s.tag){case 1:return un(s.type)&&zc(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Ho(),Ze(cn),Ze(Bt),Cd(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return Ed(s),null;case 13:if(Ze(st),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));zo()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Ze(st),null;case 4:return Ho(),null;case 10:return vd(s.type._context),null;case 22:case 23:return rh(),null;case 24:return null;default:return null}}var cu=!1,qt=!1,Rb=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Qo(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(u){ct(r,s,u)}else a.current=null}function Wd(r,s,a){try{a()}catch(u){ct(r,s,u)}}var av=!1;function Tb(r,s){if(rd=Fc,r=$0(),Jf(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var f=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var S=0,b=-1,R=-1,Y=0,ie=0,ae=r,oe=null;t:for(;;){for(var he;ae!==a||f!==0&&ae.nodeType!==3||(b=S+f),ae!==m||u!==0&&ae.nodeType!==3||(R=S+u),ae.nodeType===3&&(S+=ae.nodeValue.length),(he=ae.firstChild)!==null;)oe=ae,ae=he;for(;;){if(ae===r)break t;if(oe===a&&++Y===f&&(b=S),oe===m&&++ie===u&&(R=S),(he=ae.nextSibling)!==null)break;ae=oe,oe=ae.parentNode}ae=he}a=b===-1||R===-1?null:{start:b,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(sd={focusedElem:r,selectionRange:a},Fc=!1,ge=s;ge!==null;)if(s=ge,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ge=r;else for(;ge!==null;){s=ge;try{var ye=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var ve=ye.memoizedProps,pt=ye.memoizedState,z=s.stateNode,M=z.getSnapshotBeforeUpdate(s.elementType===s.type?ve:Zn(s.type,ve),pt);z.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var H=s.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){ct(s,s.return,ce)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ye=av,av=!1,ye}function aa(r,s,a){var u=s.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&r)===r){var m=f.destroy;f.destroy=void 0,m!==void 0&&Wd(s,a,m)}f=f.next}while(f!==u)}}function uu(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 u=a.create;a.destroy=u()}a=a.next}while(a!==s)}}function Hd(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 cv(r){var s=r.alternate;s!==null&&(r.alternate=null,cv(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[pr],delete s[Gi],delete s[cd],delete s[hb],delete s[mb])),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 uv(r){return r.tag===5||r.tag===3||r.tag===4}function lv(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||uv(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 Kd(r,s,a){var u=r.tag;if(u===5||u===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=Uc));else if(u!==4&&(r=r.child,r!==null))for(Kd(r,s,a),r=r.sibling;r!==null;)Kd(r,s,a),r=r.sibling}function Qd(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(u!==4&&(r=r.child,r!==null))for(Qd(r,s,a),r=r.sibling;r!==null;)Qd(r,s,a),r=r.sibling}var Ot=null,er=!1;function as(r,s,a){for(a=a.child;a!==null;)fv(r,s,a),a=a.sibling}function fv(r,s,a){if(mr&&typeof mr.onCommitFiberUnmount=="function")try{mr.onCommitFiberUnmount(kc,a)}catch{}switch(a.tag){case 5:qt||Qo(a,s);case 6:var u=Ot,f=er;Ot=null,as(r,s,a),Ot=u,er=f,Ot!==null&&(er?(r=Ot,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Ot.removeChild(a.stateNode));break;case 18:Ot!==null&&(er?(r=Ot,a=a.stateNode,r.nodeType===8?ad(r.parentNode,a):r.nodeType===1&&ad(r,a),$i(r)):ad(Ot,a.stateNode));break;case 4:u=Ot,f=er,Ot=a.stateNode.containerInfo,er=!0,as(r,s,a),Ot=u,er=f;break;case 0:case 11:case 14:case 15:if(!qt&&(u=a.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var m=f,S=m.destroy;m=m.tag,S!==void 0&&((m&2)!==0||(m&4)!==0)&&Wd(a,s,S),f=f.next}while(f!==u)}as(r,s,a);break;case 1:if(!qt&&(Qo(a,s),u=a.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=a.memoizedProps,u.state=a.memoizedState,u.componentWillUnmount()}catch(b){ct(a,s,b)}as(r,s,a);break;case 21:as(r,s,a);break;case 22:a.mode&1?(qt=(u=qt)||a.memoizedState!==null,as(r,s,a),qt=u):as(r,s,a);break;default:as(r,s,a)}}function dv(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new Rb),s.forEach(function(u){var f=Ub.bind(null,r,u);a.has(u)||(a.add(u),u.then(f,f))})}}function tr(r,s){var a=s.deletions;if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];try{var m=r,S=s,b=S;e:for(;b!==null;){switch(b.tag){case 5:Ot=b.stateNode,er=!1;break e;case 3:Ot=b.stateNode.containerInfo,er=!0;break e;case 4:Ot=b.stateNode.containerInfo,er=!0;break e}b=b.return}if(Ot===null)throw Error(n(160));fv(m,S,f),Ot=null,er=!1;var R=f.alternate;R!==null&&(R.return=null),f.return=null}catch(Y){ct(f,s,Y)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)hv(s,r),s=s.sibling}function hv(r,s){var a=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(tr(s,r),vr(r),u&4){try{aa(3,r,r.return),uu(3,r)}catch(ve){ct(r,r.return,ve)}try{aa(5,r,r.return)}catch(ve){ct(r,r.return,ve)}}break;case 1:tr(s,r),vr(r),u&512&&a!==null&&Qo(a,a.return);break;case 5:if(tr(s,r),vr(r),u&512&&a!==null&&Qo(a,a.return),r.flags&32){var f=r.stateNode;try{Fi(f,"")}catch(ve){ct(r,r.return,ve)}}if(u&4&&(f=r.stateNode,f!=null)){var m=r.memoizedProps,S=a!==null?a.memoizedProps:m,b=r.type,R=r.updateQueue;if(r.updateQueue=null,R!==null)try{b==="input"&&m.type==="radio"&&m.name!=null&&Os(f,m),Cf(b,S);var Y=Cf(b,m);for(S=0;S<R.length;S+=2){var ie=R[S],ae=R[S+1];ie==="style"?Jg(f,ae):ie==="dangerouslySetInnerHTML"?Kg(f,ae):ie==="children"?Fi(f,ae):A(f,ie,ae,Y)}switch(b){case"input":Co(f,m);break;case"textarea":Pi(f,m);break;case"select":var oe=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!m.multiple;var he=m.value;he!=null?Qr(f,!!m.multiple,he,!1):oe!==!!m.multiple&&(m.defaultValue!=null?Qr(f,!!m.multiple,m.defaultValue,!0):Qr(f,!!m.multiple,m.multiple?[]:"",!1))}f[Gi]=m}catch(ve){ct(r,r.return,ve)}}break;case 6:if(tr(s,r),vr(r),u&4){if(r.stateNode===null)throw Error(n(162));f=r.stateNode,m=r.memoizedProps;try{f.nodeValue=m}catch(ve){ct(r,r.return,ve)}}break;case 3:if(tr(s,r),vr(r),u&4&&a!==null&&a.memoizedState.isDehydrated)try{$i(s.containerInfo)}catch(ve){ct(r,r.return,ve)}break;case 4:tr(s,r),vr(r);break;case 13:tr(s,r),vr(r),f=r.child,f.flags&8192&&(m=f.memoizedState!==null,f.stateNode.isHidden=m,!m||f.alternate!==null&&f.alternate.memoizedState!==null||(Yd=mt())),u&4&&dv(r);break;case 22:if(ie=a!==null&&a.memoizedState!==null,r.mode&1?(qt=(Y=qt)||ie,tr(s,r),qt=Y):tr(s,r),vr(r),u&8192){if(Y=r.memoizedState!==null,(r.stateNode.isHidden=Y)&&!ie&&(r.mode&1)!==0)for(ge=r,ie=r.child;ie!==null;){for(ae=ge=ie;ge!==null;){switch(oe=ge,he=oe.child,oe.tag){case 0:case 11:case 14:case 15:aa(4,oe,oe.return);break;case 1:Qo(oe,oe.return);var ye=oe.stateNode;if(typeof ye.componentWillUnmount=="function"){u=oe,a=oe.return;try{s=u,ye.props=s.memoizedProps,ye.state=s.memoizedState,ye.componentWillUnmount()}catch(ve){ct(u,a,ve)}}break;case 5:Qo(oe,oe.return);break;case 22:if(oe.memoizedState!==null){gv(ae);continue}}he!==null?(he.return=oe,ge=he):gv(ae)}ie=ie.sibling}e:for(ie=null,ae=r;;){if(ae.tag===5){if(ie===null){ie=ae;try{f=ae.stateNode,Y?(m=f.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(b=ae.stateNode,R=ae.memoizedProps.style,S=R!=null&&R.hasOwnProperty("display")?R.display:null,b.style.display=Qg("display",S))}catch(ve){ct(r,r.return,ve)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=Y?"":ae.memoizedProps}catch(ve){ct(r,r.return,ve)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===r)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===r)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===r)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:tr(s,r),vr(r),u&4&&dv(r);break;case 21:break;default:tr(s,r),vr(r)}}function vr(r){var s=r.flags;if(s&2){try{e:{for(var a=r.return;a!==null;){if(uv(a)){var u=a;break e}a=a.return}throw Error(n(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(Fi(f,""),u.flags&=-33);var m=lv(r);Qd(r,m,f);break;case 3:case 4:var S=u.stateNode.containerInfo,b=lv(r);Kd(r,b,S);break;default:throw Error(n(161))}}catch(R){ct(r,r.return,R)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Mb(r,s,a){ge=r,mv(r)}function mv(r,s,a){for(var u=(r.mode&1)!==0;ge!==null;){var f=ge,m=f.child;if(f.tag===22&&u){var S=f.memoizedState!==null||cu;if(!S){var b=f.alternate,R=b!==null&&b.memoizedState!==null||qt;b=cu;var Y=qt;if(cu=S,(qt=R)&&!Y)for(ge=f;ge!==null;)S=ge,R=S.child,S.tag===22&&S.memoizedState!==null?yv(f):R!==null?(R.return=S,ge=R):yv(f);for(;m!==null;)ge=m,mv(m),m=m.sibling;ge=f,cu=b,qt=Y}pv(r)}else(f.subtreeFlags&8772)!==0&&m!==null?(m.return=f,ge=m):pv(r)}}function pv(r){for(;ge!==null;){var s=ge;if((s.flags&8772)!==0){var a=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:qt||uu(5,s);break;case 1:var u=s.stateNode;if(s.flags&4&&!qt)if(a===null)u.componentDidMount();else{var f=s.elementType===s.type?a.memoizedProps:Zn(s.type,a.memoizedProps);u.componentDidUpdate(f,a.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var m=s.updateQueue;m!==null&&gy(s,m,u);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}gy(s,S,a)}break;case 5:var b=s.stateNode;if(a===null&&s.flags&4){a=b;var R=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&a.focus();break;case"img":R.src&&(a.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var Y=s.alternate;if(Y!==null){var ie=Y.memoizedState;if(ie!==null){var ae=ie.dehydrated;ae!==null&&$i(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}qt||s.flags&512&&Hd(s)}catch(oe){ct(s,s.return,oe)}}if(s===r){ge=null;break}if(a=s.sibling,a!==null){a.return=s.return,ge=a;break}ge=s.return}}function gv(r){for(;ge!==null;){var s=ge;if(s===r){ge=null;break}var a=s.sibling;if(a!==null){a.return=s.return,ge=a;break}ge=s.return}}function yv(r){for(;ge!==null;){var s=ge;try{switch(s.tag){case 0:case 11:case 15:var a=s.return;try{uu(4,s)}catch(R){ct(s,a,R)}break;case 1:var u=s.stateNode;if(typeof u.componentDidMount=="function"){var f=s.return;try{u.componentDidMount()}catch(R){ct(s,f,R)}}var m=s.return;try{Hd(s)}catch(R){ct(s,m,R)}break;case 5:var S=s.return;try{Hd(s)}catch(R){ct(s,S,R)}}}catch(R){ct(s,s.return,R)}if(s===r){ge=null;break}var b=s.sibling;if(b!==null){b.return=s.return,ge=b;break}ge=s.return}}var Ab=Math.ceil,lu=C.ReactCurrentDispatcher,Jd=C.ReactCurrentOwner,$n=C.ReactCurrentBatchConfig,De=0,Ct=null,St=null,Nt=0,Cn=0,Jo=ns(0),wt=0,ca=null,Ws=0,fu=0,Gd=0,ua=null,fn=null,Yd=0,Go=1/0,jr=null,du=!1,Xd=null,cs=null,hu=!1,us=null,mu=0,la=0,Zd=null,pu=-1,gu=0;function Zt(){return(De&6)!==0?mt():pu!==-1?pu:pu=mt()}function ls(r){return(r.mode&1)===0?1:(De&2)!==0&&Nt!==0?Nt&-Nt:gb.transition!==null?(gu===0&&(gu=l0()),gu):(r=Ve,r!==0||(r=window.event,r=r===void 0?16:S0(r.type)),r)}function nr(r,s,a,u){if(50<la)throw la=0,Zd=null,Error(n(185));Li(r,a,u),((De&2)===0||r!==Ct)&&(r===Ct&&((De&2)===0&&(fu|=a),wt===4&&fs(r,Nt)),dn(r,u),a===1&&De===0&&(s.mode&1)===0&&(Go=mt()+500,qc&&ss()))}function dn(r,s){var a=r.callbackNode;gC(r,s);var u=Cc(r,r===Ct?Nt:0);if(u===0)a!==null&&a0(a),r.callbackNode=null,r.callbackPriority=0;else if(s=u&-u,r.callbackPriority!==s){if(a!=null&&a0(a),s===1)r.tag===0?pb(Sv.bind(null,r)):sy(Sv.bind(null,r)),fb(function(){(De&6)===0&&ss()}),a=null;else{switch(f0(u)){case 1:a=Mf;break;case 4:a=c0;break;case 16:a=wc;break;case 536870912:a=u0;break;default:a=wc}a=Pv(a,vv.bind(null,r))}r.callbackPriority=s,r.callbackNode=a}}function vv(r,s){if(pu=-1,gu=0,(De&6)!==0)throw Error(n(327));var a=r.callbackNode;if(Yo()&&r.callbackNode!==a)return null;var u=Cc(r,r===Ct?Nt:0);if(u===0)return null;if((u&30)!==0||(u&r.expiredLanes)!==0||s)s=yu(r,u);else{s=u;var f=De;De|=2;var m=wv();(Ct!==r||Nt!==s)&&(jr=null,Go=mt()+500,Ks(r,s));do try{Nb();break}catch(b){xv(r,b)}while(!0);yd(),lu.current=m,De=f,St!==null?s=0:(Ct=null,Nt=0,s=wt)}if(s!==0){if(s===2&&(f=Af(r),f!==0&&(u=f,s=eh(r,f))),s===1)throw a=ca,Ks(r,0),fs(r,u),dn(r,mt()),a;if(s===6)fs(r,u);else{if(f=r.current.alternate,(u&30)===0&&!Lb(f)&&(s=yu(r,u),s===2&&(m=Af(r),m!==0&&(u=m,s=eh(r,m))),s===1))throw a=ca,Ks(r,0),fs(r,u),dn(r,mt()),a;switch(r.finishedWork=f,r.finishedLanes=u,s){case 0:case 1:throw Error(n(345));case 2:Qs(r,fn,jr);break;case 3:if(fs(r,u),(u&130023424)===u&&(s=Yd+500-mt(),10<s)){if(Cc(r,0)!==0)break;if(f=r.suspendedLanes,(f&u)!==u){Zt(),r.pingedLanes|=r.suspendedLanes&f;break}r.timeoutHandle=id(Qs.bind(null,r,fn,jr),s);break}Qs(r,fn,jr);break;case 4:if(fs(r,u),(u&4194240)===u)break;for(s=r.eventTimes,f=-1;0<u;){var S=31-Gn(u);m=1<<S,S=s[S],S>f&&(f=S),u&=~m}if(u=f,u=mt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Ab(u/1960))-u,10<u){r.timeoutHandle=id(Qs.bind(null,r,fn,jr),u);break}Qs(r,fn,jr);break;case 5:Qs(r,fn,jr);break;default:throw Error(n(329))}}}return dn(r,mt()),r.callbackNode===a?vv.bind(null,r):null}function eh(r,s){var a=ua;return r.current.memoizedState.isDehydrated&&(Ks(r,s).flags|=256),r=yu(r,s),r!==2&&(s=fn,fn=a,s!==null&&th(s)),r}function th(r){fn===null?fn=r:fn.push.apply(fn,r)}function Lb(r){for(var s=r;;){if(s.flags&16384){var a=s.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var u=0;u<a.length;u++){var f=a[u],m=f.getSnapshot;f=f.value;try{if(!Yn(m(),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 fs(r,s){for(s&=~Gd,s&=~fu,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var a=31-Gn(s),u=1<<a;r[a]=-1,s&=~u}}function Sv(r){if((De&6)!==0)throw Error(n(327));Yo();var s=Cc(r,0);if((s&1)===0)return dn(r,mt()),null;var a=yu(r,s);if(r.tag!==0&&a===2){var u=Af(r);u!==0&&(s=u,a=eh(r,u))}if(a===1)throw a=ca,Ks(r,0),fs(r,s),dn(r,mt()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Qs(r,fn,jr),dn(r,mt()),null}function nh(r,s){var a=De;De|=1;try{return r(s)}finally{De=a,De===0&&(Go=mt()+500,qc&&ss())}}function Hs(r){us!==null&&us.tag===0&&(De&6)===0&&Yo();var s=De;De|=1;var a=$n.transition,u=Ve;try{if($n.transition=null,Ve=1,r)return r()}finally{Ve=u,$n.transition=a,De=s,(De&6)===0&&ss()}}function rh(){Cn=Jo.current,Ze(Jo)}function Ks(r,s){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,lb(a)),St!==null)for(a=St.return;a!==null;){var u=a;switch(dd(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&zc();break;case 3:Ho(),Ze(cn),Ze(Bt),Cd();break;case 5:Ed(u);break;case 4:Ho();break;case 13:Ze(st);break;case 19:Ze(st);break;case 10:vd(u.type._context);break;case 22:case 23:rh()}a=a.return}if(Ct=r,St=r=ds(r.current,null),Nt=Cn=s,wt=0,ca=null,Gd=fu=Ws=0,fn=ua=null,zs!==null){for(s=0;s<zs.length;s++)if(a=zs[s],u=a.interleaved,u!==null){a.interleaved=null;var f=u.next,m=a.pending;if(m!==null){var S=m.next;m.next=f,u.next=S}a.pending=u}zs=null}return r}function xv(r,s){do{var a=St;try{if(yd(),eu.current=su,tu){for(var u=ot.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}tu=!1}if(qs=0,_t=xt=ot=null,na=!1,ra=0,Jd.current=null,a===null||a.return===null){wt=1,ca=s,St=null;break}e:{var m=r,S=a.return,b=a,R=s;if(s=Nt,b.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var Y=R,ie=b,ae=ie.tag;if((ie.mode&1)===0&&(ae===0||ae===11||ae===15)){var oe=ie.alternate;oe?(ie.updateQueue=oe.updateQueue,ie.memoizedState=oe.memoizedState,ie.lanes=oe.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var he=Wy(S);if(he!==null){he.flags&=-257,Hy(he,S,b,m,s),he.mode&1&&qy(m,Y,s),s=he,R=Y;var ye=s.updateQueue;if(ye===null){var ve=new Set;ve.add(R),s.updateQueue=ve}else ye.add(R);break e}else{if((s&1)===0){qy(m,Y,s),sh();break e}R=Error(n(426))}}else if(et&&b.mode&1){var pt=Wy(S);if(pt!==null){(pt.flags&65536)===0&&(pt.flags|=256),Hy(pt,S,b,m,s),pd(Ko(R,b));break e}}m=R=Ko(R,b),wt!==4&&(wt=2),ua===null?ua=[m]:ua.push(m),m=S;do{switch(m.tag){case 3:m.flags|=65536,s&=-s,m.lanes|=s;var z=zy(m,R,s);py(m,z);break e;case 1:b=R;var M=m.type,H=m.stateNode;if((m.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(cs===null||!cs.has(H)))){m.flags|=65536,s&=-s,m.lanes|=s;var ce=Vy(m,b,s);py(m,ce);break e}}m=m.return}while(m!==null)}Ev(a)}catch(Se){s=Se,St===a&&a!==null&&(St=a=a.return);continue}break}while(!0)}function wv(){var r=lu.current;return lu.current=su,r===null?su:r}function sh(){(wt===0||wt===3||wt===2)&&(wt=4),Ct===null||(Ws&268435455)===0&&(fu&268435455)===0||fs(Ct,Nt)}function yu(r,s){var a=De;De|=2;var u=wv();(Ct!==r||Nt!==s)&&(jr=null,Ks(r,s));do try{Ob();break}catch(f){xv(r,f)}while(!0);if(yd(),De=a,lu.current=u,St!==null)throw Error(n(261));return Ct=null,Nt=0,wt}function Ob(){for(;St!==null;)kv(St)}function Nb(){for(;St!==null&&!aC();)kv(St)}function kv(r){var s=bv(r.alternate,r,Cn);r.memoizedProps=r.pendingProps,s===null?Ev(r):St=s,Jd.current=null}function Ev(r){var s=r;do{var a=s.alternate;if(r=s.return,(s.flags&32768)===0){if(a=Fb(a,s,Cn),a!==null){St=a;return}}else{if(a=Ib(a,s),a!==null){a.flags&=32767,St=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{wt=6,St=null;return}}if(s=s.sibling,s!==null){St=s;return}St=s=r}while(s!==null);wt===0&&(wt=5)}function Qs(r,s,a){var u=Ve,f=$n.transition;try{$n.transition=null,Ve=1,Db(r,s,a,u)}finally{$n.transition=f,Ve=u}return null}function Db(r,s,a,u){do Yo();while(us!==null);if((De&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 m=a.lanes|a.childLanes;if(yC(r,m),r===Ct&&(St=Ct=null,Nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||hu||(hu=!0,Pv(wc,function(){return Yo(),null})),m=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||m){m=$n.transition,$n.transition=null;var S=Ve;Ve=1;var b=De;De|=4,Jd.current=null,Tb(r,a),hv(a,r),rb(sd),Fc=!!rd,sd=rd=null,r.current=a,Mb(a),cC(),De=b,Ve=S,$n.transition=m}else r.current=a;if(hu&&(hu=!1,us=r,mu=f),m=r.pendingLanes,m===0&&(cs=null),fC(a.stateNode),dn(r,mt()),s!==null)for(u=r.onRecoverableError,a=0;a<s.length;a++)f=s[a],u(f.value,{componentStack:f.stack,digest:f.digest});if(du)throw du=!1,r=Xd,Xd=null,r;return(mu&1)!==0&&r.tag!==0&&Yo(),m=r.pendingLanes,(m&1)!==0?r===Zd?la++:(la=0,Zd=r):la=0,ss(),null}function Yo(){if(us!==null){var r=f0(mu),s=$n.transition,a=Ve;try{if($n.transition=null,Ve=16>r?16:r,us===null)var u=!1;else{if(r=us,us=null,mu=0,(De&6)!==0)throw Error(n(331));var f=De;for(De|=4,ge=r.current;ge!==null;){var m=ge,S=m.child;if((ge.flags&16)!==0){var b=m.deletions;if(b!==null){for(var R=0;R<b.length;R++){var Y=b[R];for(ge=Y;ge!==null;){var ie=ge;switch(ie.tag){case 0:case 11:case 15:aa(8,ie,m)}var ae=ie.child;if(ae!==null)ae.return=ie,ge=ae;else for(;ge!==null;){ie=ge;var oe=ie.sibling,he=ie.return;if(cv(ie),ie===Y){ge=null;break}if(oe!==null){oe.return=he,ge=oe;break}ge=he}}}var ye=m.alternate;if(ye!==null){var ve=ye.child;if(ve!==null){ye.child=null;do{var pt=ve.sibling;ve.sibling=null,ve=pt}while(ve!==null)}}ge=m}}if((m.subtreeFlags&2064)!==0&&S!==null)S.return=m,ge=S;else e:for(;ge!==null;){if(m=ge,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:aa(9,m,m.return)}var z=m.sibling;if(z!==null){z.return=m.return,ge=z;break e}ge=m.return}}var M=r.current;for(ge=M;ge!==null;){S=ge;var H=S.child;if((S.subtreeFlags&2064)!==0&&H!==null)H.return=S,ge=H;else e:for(S=M;ge!==null;){if(b=ge,(b.flags&2048)!==0)try{switch(b.tag){case 0:case 11:case 15:uu(9,b)}}catch(Se){ct(b,b.return,Se)}if(b===S){ge=null;break e}var ce=b.sibling;if(ce!==null){ce.return=b.return,ge=ce;break e}ge=b.return}}if(De=f,ss(),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(kc,r)}catch{}u=!0}return u}finally{Ve=a,$n.transition=s}}return!1}function _v(r,s,a){s=Ko(a,s),s=zy(r,s,1),r=is(r,s,1),s=Zt(),r!==null&&(Li(r,1,s),dn(r,s))}function ct(r,s,a){if(r.tag===3)_v(r,r,a);else for(;s!==null;){if(s.tag===3){_v(s,r,a);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(cs===null||!cs.has(u))){r=Ko(a,r),r=Vy(s,r,1),s=is(s,r,1),r=Zt(),s!==null&&(Li(s,1,r),dn(s,r));break}}s=s.return}}function jb(r,s,a){var u=r.pingCache;u!==null&&u.delete(s),s=Zt(),r.pingedLanes|=r.suspendedLanes&a,Ct===r&&(Nt&a)===a&&(wt===4||wt===3&&(Nt&130023424)===Nt&&500>mt()-Yd?Ks(r,0):Gd|=a),dn(r,s)}function Cv(r,s){s===0&&((r.mode&1)===0?s=1:(s=_c,_c<<=1,(_c&130023424)===0&&(_c=4194304)));var a=Zt();r=Or(r,s),r!==null&&(Li(r,s,a),dn(r,a))}function $b(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),Cv(r,a)}function Ub(r,s){var a=0;switch(r.tag){case 13:var u=r.stateNode,f=r.memoizedState;f!==null&&(a=f.retryLane);break;case 19:u=r.stateNode;break;default:throw Error(n(314))}u!==null&&u.delete(s),Cv(r,a)}var bv;bv=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||cn.current)ln=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return ln=!1,Pb(r,s,a);ln=(r.flags&131072)!==0}else ln=!1,et&&(s.flags&1048576)!==0&&oy(s,Hc,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;au(r,s),r=s.pendingProps;var f=$o(s,Bt.current);Wo(s,a),f=Fd(null,s,u,r,f,a);var m=Id();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,un(u)?(m=!0,Vc(s)):m=!1,s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,wd(s),f.updater=ou,s.stateNode=f,f._reactInternals=s,Od(s,u,r,a),s=$d(null,s,u,!0,m,a)):(s.tag=0,et&&m&&fd(s),Xt(null,s,f,a),s=s.child),s;case 16:u=s.elementType;e:{switch(au(r,s),r=s.pendingProps,f=u._init,u=f(u._payload),s.type=u,f=s.tag=zb(u),r=Zn(u,r),f){case 0:s=jd(null,s,u,r,a);break e;case 1:s=Xy(null,s,u,r,a);break e;case 11:s=Ky(null,s,u,r,a);break e;case 14:s=Qy(null,s,u,Zn(u.type,r),a);break e}throw Error(n(306,u,""))}return s;case 0:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Zn(u,f),jd(r,s,u,f,a);case 1:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Zn(u,f),Xy(r,s,u,f,a);case 3:e:{if(Zy(s),r===null)throw Error(n(387));u=s.pendingProps,m=s.memoizedState,f=m.element,my(r,s),Xc(s,u,null,a);var S=s.memoizedState;if(u=S.element,m.isDehydrated)if(m={element:u,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=m,s.memoizedState=m,s.flags&256){f=Ko(Error(n(423)),s),s=ev(r,s,u,a,f);break e}else if(u!==f){f=Ko(Error(n(424)),s),s=ev(r,s,u,a,f);break e}else for(_n=ts(s.stateNode.containerInfo.firstChild),En=s,et=!0,Xn=null,a=dy(s,null,u,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(zo(),u===f){s=Dr(r,s,a);break e}Xt(r,s,u,a)}s=s.child}return s;case 5:return yy(s),r===null&&md(s),u=s.type,f=s.pendingProps,m=r!==null?r.memoizedProps:null,S=f.children,od(u,f)?S=null:m!==null&&od(u,m)&&(s.flags|=32),Yy(r,s),Xt(r,s,S,a),s.child;case 6:return r===null&&md(s),null;case 13:return tv(r,s,a);case 4:return kd(s,s.stateNode.containerInfo),u=s.pendingProps,r===null?s.child=Vo(s,null,u,a):Xt(r,s,u,a),s.child;case 11:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Zn(u,f),Ky(r,s,u,f,a);case 7:return Xt(r,s,s.pendingProps,a),s.child;case 8:return Xt(r,s,s.pendingProps.children,a),s.child;case 12:return Xt(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(u=s.type._context,f=s.pendingProps,m=s.memoizedProps,S=f.value,Qe(Jc,u._currentValue),u._currentValue=S,m!==null)if(Yn(m.value,S)){if(m.children===f.children&&!cn.current){s=Dr(r,s,a);break e}}else for(m=s.child,m!==null&&(m.return=s);m!==null;){var b=m.dependencies;if(b!==null){S=m.child;for(var R=b.firstContext;R!==null;){if(R.context===u){if(m.tag===1){R=Nr(-1,a&-a),R.tag=2;var Y=m.updateQueue;if(Y!==null){Y=Y.shared;var ie=Y.pending;ie===null?R.next=R:(R.next=ie.next,ie.next=R),Y.pending=R}}m.lanes|=a,R=m.alternate,R!==null&&(R.lanes|=a),Sd(m.return,a,s),b.lanes|=a;break}R=R.next}}else if(m.tag===10)S=m.type===s.type?null:m.child;else if(m.tag===18){if(S=m.return,S===null)throw Error(n(341));S.lanes|=a,b=S.alternate,b!==null&&(b.lanes|=a),Sd(S,a,s),S=m.sibling}else S=m.child;if(S!==null)S.return=m;else for(S=m;S!==null;){if(S===s){S=null;break}if(m=S.sibling,m!==null){m.return=S.return,S=m;break}S=S.return}m=S}Xt(r,s,f.children,a),s=s.child}return s;case 9:return f=s.type,u=s.pendingProps.children,Wo(s,a),f=Dn(f),u=u(f),s.flags|=1,Xt(r,s,u,a),s.child;case 14:return u=s.type,f=Zn(u,s.pendingProps),f=Zn(u.type,f),Qy(r,s,u,f,a);case 15:return Jy(r,s,s.type,s.pendingProps,a);case 17:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Zn(u,f),au(r,s),s.tag=1,un(u)?(r=!0,Vc(s)):r=!1,Wo(s,a),Uy(s,u,f),Od(s,u,f,a),$d(null,s,u,!0,r,a);case 19:return rv(r,s,a);case 22:return Gy(r,s,a)}throw Error(n(156,s.tag))};function Pv(r,s){return i0(r,s)}function Bb(r,s,a,u){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=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Un(r,s,a,u){return new Bb(r,s,a,u)}function oh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function zb(r){if(typeof r=="function")return oh(r)?1:0;if(r!=null){if(r=r.$$typeof,r===K)return 11;if(r===W)return 14}return 2}function ds(r,s){var a=r.alternate;return a===null?(a=Un(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 vu(r,s,a,u,f,m){var S=2;if(u=r,typeof r=="function")oh(r)&&(S=1);else if(typeof r=="string")S=5;else e:switch(r){case O:return Js(a.children,f,m,s);case T:S=8,f|=8;break;case V:return r=Un(12,a,s,f|2),r.elementType=V,r.lanes=m,r;case E:return r=Un(13,a,s,f),r.elementType=E,r.lanes=m,r;case $:return r=Un(19,a,s,f),r.elementType=$,r.lanes=m,r;case B:return Su(a,f,m,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case ee:S=10;break e;case ne:S=9;break e;case K:S=11;break e;case W:S=14;break e;case J:S=16,u=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Un(S,a,s,f),s.elementType=r,s.type=u,s.lanes=m,s}function Js(r,s,a,u){return r=Un(7,r,u,s),r.lanes=a,r}function Su(r,s,a,u){return r=Un(22,r,u,s),r.elementType=B,r.lanes=a,r.stateNode={isHidden:!1},r}function ih(r,s,a){return r=Un(6,r,null,s),r.lanes=a,r}function ah(r,s,a){return s=Un(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function Vb(r,s,a,u,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=Lf(0),this.expirationTimes=Lf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lf(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function ch(r,s,a,u,f,m,S,b,R){return r=new Vb(r,s,a,b,R),s===1?(s=1,m===!0&&(s|=8)):s=0,m=Un(3,null,null,s),r.current=m,m.stateNode=r,m.memoizedState={element:u,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},wd(m),r}function qb(r,s,a){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:u==null?null:""+u,children:r,containerInfo:s,implementation:a}}function Fv(r){if(!r)return rs;r=r._reactInternals;e:{if(Ds(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(un(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(un(a))return ny(r,a,s)}return s}function Iv(r,s,a,u,f,m,S,b,R){return r=ch(a,u,!0,r,f,m,S,b,R),r.context=Fv(null),a=r.current,u=Zt(),f=ls(a),m=Nr(u,f),m.callback=s??null,is(a,m,f),r.current.lanes=f,Li(r,f,u),dn(r,u),r}function xu(r,s,a,u){var f=s.current,m=Zt(),S=ls(f);return a=Fv(a),s.context===null?s.context=a:s.pendingContext=a,s=Nr(m,S),s.payload={element:r},u=u===void 0?null:u,u!==null&&(s.callback=u),r=is(f,s,S),r!==null&&(nr(r,f,S,m),Yc(r,f,S)),S}function wu(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 Rv(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function uh(r,s){Rv(r,s),(r=r.alternate)&&Rv(r,s)}function Wb(){return null}var Tv=typeof reportError=="function"?reportError:function(r){console.error(r)};function lh(r){this._internalRoot=r}ku.prototype.render=lh.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));xu(r,s,null,null)},ku.prototype.unmount=lh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Hs(function(){xu(null,r,null,null)}),s[Tr]=null}};function ku(r){this._internalRoot=r}ku.prototype.unstable_scheduleHydration=function(r){if(r){var s=m0();r={blockedOn:null,target:r,priority:s};for(var a=0;a<Xr.length&&s!==0&&s<Xr[a].priority;a++);Xr.splice(a,0,r),a===0&&y0(r)}};function fh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Eu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Mv(){}function Hb(r,s,a,u,f){if(f){if(typeof u=="function"){var m=u;u=function(){var Y=wu(S);m.call(Y)}}var S=Iv(s,u,r,0,null,!1,!1,"",Mv);return r._reactRootContainer=S,r[Tr]=S.current,Qi(r.nodeType===8?r.parentNode:r),Hs(),S}for(;f=r.lastChild;)r.removeChild(f);if(typeof u=="function"){var b=u;u=function(){var Y=wu(R);b.call(Y)}}var R=ch(r,0,!1,null,null,!1,!1,"",Mv);return r._reactRootContainer=R,r[Tr]=R.current,Qi(r.nodeType===8?r.parentNode:r),Hs(function(){xu(s,R,a,u)}),R}function _u(r,s,a,u,f){var m=a._reactRootContainer;if(m){var S=m;if(typeof f=="function"){var b=f;f=function(){var R=wu(S);b.call(R)}}xu(s,S,r,f)}else S=Hb(a,s,r,f,u);return wu(S)}d0=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var a=Ai(s.pendingLanes);a!==0&&(Of(s,a|1),dn(s,mt()),(De&6)===0&&(Go=mt()+500,ss()))}break;case 13:Hs(function(){var u=Or(r,1);if(u!==null){var f=Zt();nr(u,r,1,f)}}),uh(r,1)}},Nf=function(r){if(r.tag===13){var s=Or(r,134217728);if(s!==null){var a=Zt();nr(s,r,134217728,a)}uh(r,134217728)}},h0=function(r){if(r.tag===13){var s=ls(r),a=Or(r,s);if(a!==null){var u=Zt();nr(a,r,s,u)}uh(r,s)}},m0=function(){return Ve},p0=function(r,s){var a=Ve;try{return Ve=r,s()}finally{Ve=a}},Ff=function(r,s,a){switch(s){case"input":if(Co(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 u=a[s];if(u!==r&&u.form===r.form){var f=Bc(u);if(!f)throw Error(n(90));an(u),Co(u,f)}}}break;case"textarea":Pi(r,a);break;case"select":s=a.value,s!=null&&Qr(r,!!a.multiple,s,!1)}},Zg=nh,e0=Hs;var Kb={usingClientEntryPoint:!1,Events:[Yi,Do,Bc,Yg,Xg,nh]},fa={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Qb={bundleType:fa.bundleType,version:fa.version,rendererPackageName:fa.rendererPackageName,rendererConfig:fa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=s0(r),r===null?null:r.stateNode},findFiberByHostInstance:fa.findFiberByHostInstance||Wb,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 Cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cu.isDisabled&&Cu.supportsFiber)try{kc=Cu.inject(Qb),mr=Cu}catch{}}return hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kb,hn.createPortal=function(r,s){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fh(s))throw Error(n(200));return qb(r,s,null,a)},hn.createRoot=function(r,s){if(!fh(r))throw Error(n(299));var a=!1,u="",f=Tv;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onRecoverableError!==void 0&&(f=s.onRecoverableError)),s=ch(r,1,!1,null,null,a,!1,u,f),r[Tr]=s.current,Qi(r.nodeType===8?r.parentNode:r),new lh(s)},hn.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=s0(s),r=r===null?null:r.stateNode,r},hn.flushSync=function(r){return Hs(r)},hn.hydrate=function(r,s,a){if(!Eu(s))throw Error(n(200));return _u(null,r,s,!0,a)},hn.hydrateRoot=function(r,s,a){if(!fh(r))throw Error(n(405));var u=a!=null&&a.hydratedSources||null,f=!1,m="",S=Tv;if(a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(S=a.onRecoverableError)),s=Iv(s,null,r,1,a??null,f,!1,m,S),r[Tr]=s.current,Qi(r),u)for(r=0;r<u.length;r++)a=u[r],f=a._getVersion,f=f(a._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[a,f]:s.mutableSourceEagerHydrationData.push(a,f);return new ku(s)},hn.render=function(r,s,a){if(!Eu(s))throw Error(n(200));return _u(null,r,s,!1,a)},hn.unmountComponentAtNode=function(r){if(!Eu(r))throw Error(n(40));return r._reactRootContainer?(Hs(function(){_u(null,null,r,!1,function(){r._reactRootContainer=null,r[Tr]=null})}),!0):!1},hn.unstable_batchedUpdates=nh,hn.unstable_renderSubtreeIntoContainer=function(r,s,a,u){if(!Eu(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return _u(r,s,a,!1,u)},hn.version="18.3.1-next-f1338f8080-20240426",hn}var Uv;function Cw(){if(Uv)return mh.exports;Uv=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(),mh.exports=s2(),mh.exports}var Bv;function o2(){if(Bv)return bu;Bv=1;var e=Cw();return bu.createRoot=e.createRoot,bu.hydrateRoot=e.hydrateRoot,bu}var i2=o2(),a2={};const dp=l2();function nt(e,...t){if(!dp)return;const n=u2(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function c2(e,...t){dp&&console.warn(e,...t)}function u2(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 l2(){if(typeof window>"u")return(a2.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 f2={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 Xa(e){return`[nuqs] ${f2[e]}
|
|
42
|
+
See https://nuqs.dev/NUQS-${e}`}function d2(e){if(e.size===0)return"";const t=[];for(const[o,i]of e.entries()){const c=o.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${c}=${h2(i)}`)}return"?"+t.join("&")}function h2(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 fo=X.createContext({useAdapter(){throw new Error(Xa(404))}});fo.displayName="NuqsAdapterContext";dp&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==fo&&console.error(Xa(303)),window.__NuqsAdapterContext=fo);function m2(e){return({children:t,defaultOptions:n,processUrlSearchParams:o,...i})=>X.createElement(fo.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:o}},t)}function p2(e){const t=X.useContext(fo);if(!("useAdapter"in t))throw new Error(Xa(404));return t.useAdapter(e)}const g2=()=>X.useContext(fo).defaultOptions,y2=()=>X.useContext(fo).processUrlSearchParams;function v2(){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 S2(e){return{method:"throttle",timeMs:e}}const ba=S2(v2());function x2(e){return e===null||Array.isArray(e)&&e.length===0}function w2(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 hp(){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 am(e,t,n){function o(){e(),n.removeEventListener("abort",c)}const i=setTimeout(o,t);function c(){clearTimeout(i),n.removeEventListener("abort",c)}n.addEventListener("abort",c)}function cm(){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 k2(e,t){let n=t;for(let o=e.length-1;o>=0;o--){const i=e[o];if(!i)continue;const c=n;n=()=>i(c)}n()}function um(){return new URLSearchParams(location.search)}var bw=class{constructor(){L(this,"updateMap",new Map);L(this,"options",{history:"replace",scroll:!1,shallow:!0});L(this,"timeMs",ba.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=ba.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),nt("[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=um}){var t;return((t=this.resolvers)==null?void 0:t.promise)??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=um,rateLimitFactor:t=1,...n},o){if(this.controller??(this.controller=new AbortController),!Number.isFinite(this.timeMs))return nt("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=cm();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 am(()=>{const l=performance.now()-this.lastFlushedAt,d=this.timeMs,h=t*Math.max(0,d-l);nt("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",h,d,t),h===0?i():am(i,h,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 nt("[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=ba.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:o}=e;let i=o();if(nt("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];const c=Array.from(this.updateMap.entries()),l={...this.options},d=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),nt("[nuqs gtq] Flushing queue %O with options %O",c,l);for(const[h,p]of c)p===null?i.delete(h):i=w2(p,h,i);t&&(i=t(i));try{return k2(d,()=>{n(i,l)}),[i,null]}catch(h){return console.error(Xa(429),c.map(([p])=>p).join(),h),[i,h]}}};const $u=new bw;function E2(e,t,n){const o=X.useCallback(()=>{const c=Object.fromEntries(e.map(l=>[l,n(l)]));return[JSON.stringify(c),c]},[e.join(","),n]),i=X.useRef(null);return i.current===null&&(i.current=o()),X.useSyncExternalStore(X.useCallback(c=>{const l=e.map(d=>t(d,c));return()=>l.forEach(d=>d())},[e.join(","),t]),()=>{const[c,l]=o();return i.current[0]===c?i.current[1]:(i.current=[c,l],l)},()=>i.current[1])}var _2=class{constructor(e){L(this,"callback");L(this,"resolvers",cm());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,am(()=>{const n=this.resolvers;try{nt("[nuqs dq] Flushing debounce queue",e);const o=this.callback(e);nt("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=cm(),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}},C2=class{constructor(e=new bw){L(this,"throttleQueue");L(this,"queues",new Map);L(this,"queuedQuerySync",hp());this.throttleQueue=e}useQueuedQueries(e){return E2(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??um;return Promise.resolve(l())}const i=e.key;if(!this.queues.has(i)){nt("[nuqs dqc] Creating debounce queue for `%s`",i);const l=new _2(d=>(this.throttleQueue.push(d),this.throttleQueue.flush(n,o).finally(()=>{var h;((h=this.queues.get(d.key))==null?void 0:h.queuedValue)===void 0&&(nt("[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)}nt("[nuqs dqc] Enqueueing debounce update %O",e);const c=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),c}abort(e){var n;const t=this.queues.get(e);return t?(nt("[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())nt("[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 yh=new C2($u);function Pw(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 zv(e,t,n){return o=>{if(!(t.length===0||t.some(c=>!Pw(o.getAll(c),e.getAll(c)))))return nt("[nuqs `%s`] no change, returning previous",t.join(","),o),o;const i=Fw(e,t,n);return nt("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),o,i),i}}function Fw(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 b2="__nuqs__",lm=hp();function P2(e){return function(n,o){const i=new URL(location.href);i.search=d2(n),nt("[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,b2,i),lm.emit("update",n),o.scroll===!0&&window.scrollTo({top:0})}}const Iw=X.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function F2(e){const{fullPageNavigationOnShallowFalseUpdates:t}=X.useContext(Iw),[n,o]=X.useState(()=>typeof location>"u"?new URLSearchParams:Fw(new URLSearchParams(location.search),e,!1));return X.useEffect(()=>{const i=()=>{o(zv(new URLSearchParams(location.search),e,!1))},c=l=>{o(zv(l,e,!0))};return lm.on("update",c),window.addEventListener("popstate",i),()=>{lm.off("update",c),window.removeEventListener("popstate",i)}},[e.join("&")]),{searchParams:n,updateUrl:X.useMemo(()=>P2(t),[t])}}const I2=m2(F2);function R2({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return X.createElement(Iw.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},X.createElement(I2,{...n,children:e}))}const T2="modulepreload",M2=function(e,t){return new URL(e,t).href},Vv={},wr=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let l=function(y){return Promise.all(y.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),p=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));i=l(n.map(y=>{if(y=M2(y,o),y in Vv)return;Vv[y]=!0;const g=y.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(!!o)for(let k=d.length-1;k>=0;k--){const P=d[k];if(P.href===y&&(!g||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const w=document.createElement("link");if(w.rel=g?"stylesheet":T2,g||(w.as="script"),w.crossOrigin="",w.href=y,p&&w.setAttribute("nonce",p),document.head.appendChild(w),g)return new Promise((k,P)=>{w.addEventListener("load",k),w.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${y}`)))})}))}function c(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"&&c(d.reason);return t().catch(c)})};var xa=typeof window<"u"?X.useLayoutEffect:X.useEffect;function vh(e){const t=X.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function A2(e,t,n={},o={}){X.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([c])=>{t(c)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,o.disabled,e])}function L2(e){const t=X.useRef(null);return X.useImperativeHandle(e,()=>t.current,[]),t}const Rw=!1;function Aa(e){return e[e.length-1]}function O2(e){return typeof e=="function"}function eo(e,t){return O2(e)?e(t):e}const Tw=Object.prototype.hasOwnProperty,qv=Object.prototype.propertyIsEnumerable;function Mw(e){for(const t in e)if(Tw.call(e,t))return!0;return!1}const N2=()=>Object.create(null),Gs=(e,t)=>to(e,t,N2);function to(e,t,n=()=>({}),o=0){if(e===t)return e;if(o>500)return t;const i=t,c=Kv(e)&&Kv(i);if(!c&&!(nl(e)&&nl(i)))return i;const l=c?e:Wv(e);if(!l)return i;const d=c?i:Wv(i);if(!d)return i;const h=l.length,p=d.length,y=c?new Array(p):n();let g=0;for(let v=0;v<p;v++){const x=c?v:d[v],w=e[x],k=i[x];if(w===k){y[x]=w,(c?v<h:Tw.call(e,x))&&g++;continue}if(w===null||k===null||typeof w!="object"||typeof k!="object"){y[x]=k;continue}const P=to(w,k,n,o+1);y[x]=P,P===w&&g++}return h===p&&g===h?e:y}function Wv(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!qv.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(!qv.call(e,i))return!1;o.push(i)}return o}function nl(e){if(!Hv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Hv(n)||!n.hasOwnProperty("isPrototypeOf"))}function Hv(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function so(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(!so(e[o],t[o],n))return!1;return!0}if(nl(e)&&nl(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)&&!so(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 c=0;for(const l in t)if((!o||t[l]!==void 0)&&(c++,c>i||!so(e[l],t[l],n)))return!1;return i===c}return!1}function fi(e){let t,n;const o=new Promise((i,c)=>{t=i,n=c});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 La(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function D2(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Qv(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 D2(t)}const j2=["http:","https:","mailto:","tel:"];function rl(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ha(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+=Qv(e.slice(n,i.index))+i[0],n=t.lastIndex;o=o+Qv(n?e.slice(n):e);let c=!1;return o.startsWith("//")&&(c=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:c}}function $2(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function U2(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 qr(){throw new Error("Invariant failed")}function Oa(e){const t=new Map;let n,o;const i=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,o&&(o.next=c,c.prev=o)):(c.next.prev=void 0,n=c.next,c.next=void 0,o&&(c.prev=o,o.next=c)),o=c)};return{get(c){const l=t.get(c);if(l)return i(l),l.value},set(c,l){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===o&&(o=void 0)}const d=t.get(c);if(d)d.value=l,i(d);else{const h={key:c,value:l,prev:o};o&&(o.next=h),o=h,n||(n=h),t.set(c,h)}},clear(){t.clear(),n=void 0,o=void 0}}}const ys=4,Aw=5;function B2(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 Lw(e,t,n=new Uint16Array(6)){const o=e.indexOf("/",t),i=o===-1?e.length:o,c=e.substring(t,i);if(!c||!c.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(c==="$"){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(c.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=B2(c);if(l){const[d,h]=l,p=c.charCodeAt(d+1);if(p===45){if(d+2<c.length&&c.charCodeAt(d+2)===36){const y=d+3,g=h;if(y<g)return n[0]=3,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=i,n}}else if(p===36){const y=d+1,g=d+2;return g===h?(n[0]=2,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=1,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+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 Ol(e,t,n,o,i,c,l){var h,p,y,g,v,x,w,k,P,q;l==null||l(n);let d=o;{const _=n.fullPath??n.from,A=_.length,C=((h=n.options)==null?void 0:h.caseSensitive)??e,D=((y=(p=n.options)==null?void 0:p.params)==null?void 0:y.parse)??((g=n.options)==null?void 0:g.parseParams);for(;d<A;){const O=Lw(_,d,t);let T;const V=d,ee=O[5];switch(d=ee+1,c++,O[0]){case 0:{const ne=_.substring(O[2],O[3]);if(C){const K=(v=i.static)==null?void 0:v.get(ne);if(K)T=K;else{i.static??(i.static=new Map);const E=no(n.fullPath??n.from);E.parent=i,E.depth=c,T=E,i.static.set(ne,E)}}else{const K=ne.toLowerCase(),E=(x=i.staticInsensitive)==null?void 0:x.get(K);if(E)T=E;else{i.staticInsensitive??(i.staticInsensitive=new Map);const $=no(n.fullPath??n.from);$.parent=i,$.depth=c,T=$,i.staticInsensitive.set(K,$)}}break}case 1:{const ne=_.substring(V,O[1]),K=_.substring(O[4],ee),E=C&&!!(ne||K),$=ne?E?ne:ne.toLowerCase():void 0,W=K?E?K:K.toLowerCase():void 0,J=!D&&((w=i.dynamic)==null?void 0:w.find(B=>!B.parse&&B.caseSensitive===E&&B.prefix===$&&B.suffix===W));if(J)T=J;else{const B=xh(1,n.fullPath??n.from,E,$,W);T=B,B.depth=c,B.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(B)}break}case 3:{const ne=_.substring(V,O[1]),K=_.substring(O[4],ee),E=C&&!!(ne||K),$=ne?E?ne:ne.toLowerCase():void 0,W=K?E?K:K.toLowerCase():void 0,J=!D&&((k=i.optional)==null?void 0:k.find(B=>!B.parse&&B.caseSensitive===E&&B.prefix===$&&B.suffix===W));if(J)T=J;else{const B=xh(3,n.fullPath??n.from,E,$,W);T=B,B.parent=i,B.depth=c,i.optional??(i.optional=[]),i.optional.push(B)}break}case 2:{const ne=_.substring(V,O[1]),K=_.substring(O[4],ee),E=C&&!!(ne||K),$=ne?E?ne:ne.toLowerCase():void 0,W=K?E?K:K.toLowerCase():void 0,J=xh(2,n.fullPath??n.from,E,$,W);T=J,J.parent=i,J.depth=c,i.wildcard??(i.wildcard=[]),i.wildcard.push(J)}}i=T}if(D&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const O=no(n.fullPath??n.from);O.kind=Aw,O.parent=i,c++,O.depth=c,i.pathless??(i.pathless=[]),i.pathless.push(O),i=O}const U=(n.path||!n.children)&&!n.isRoot;if(U&&_.endsWith("/")){const O=no(n.fullPath??n.from);O.kind=ys,O.parent=i,c++,O.depth=c,i.index=O,i=O}i.parse=D??null,i.priority=((q=(P=n.options)==null?void 0:P.params)==null?void 0:q.priority)??0,U&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)Ol(e,t,_,d,i,c,l)}function Sh(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 gs(e){var t,n,o;if(e.pathless)for(const i of e.pathless)gs(i);if(e.static)for(const i of e.static.values())gs(i);if(e.staticInsensitive)for(const i of e.staticInsensitive.values())gs(i);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Sh);for(const i of e.dynamic)gs(i)}if((n=e.optional)!=null&&n.length){e.optional.sort(Sh);for(const i of e.optional)gs(i)}if((o=e.wildcard)!=null&&o.length){e.wildcard.sort(Sh);for(const i of e.wildcard)gs(i)}}function no(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 xh(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 z2(e,t){const n=no("/"),o=new Uint16Array(6);for(const i of e)Ol(!1,o,i,1,n,0);gs(n),t.masksTree=n,t.flatCache=Oa(1e3)}function V2(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const o=mp(e,t.masksTree);return t.flatCache.set(e,o),o}function q2(e,t,n,o,i){e||(e="/"),o||(o="/");const c=t?`case\0${e}`:e;let l=i.singleCache.get(c);return l||(l=no("/"),Ol(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(c,l)),mp(o,l,n)}function W2(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 c;try{c=mp(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)c=null;else throw l}return c&&(c.branch=Nw(c.route)),t.matchCache.set(o,c),c}function H2(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function K2(e,t=!1,n){const o=no(e.fullPath),i=new Uint16Array(6),c={},l={};let d=0;return Ol(t,i,e,1,o,0,h=>{if(n==null||n(h,d),h.id in c&&qr(),c[h.id]=h,d!==0&&h.path){const p=H2(h.fullPath);(!l[p]||h.fullPath.endsWith("/"))&&(l[p]=h)}d++}),gs(o),{processedTree:{segmentTree:o,singleCache:Oa(1e3),matchCache:Oa(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:l}}function mp(e,t,n=!1){const o=e.split("/"),i=J2(e,o,t,n);if(!i)return null;const[c]=Ow(e,o,i);return{route:i.node.route,rawParams:c}}function Ow(e,t,n){var y,g,v,x,w,k,P,q,_,A;const o=Q2(n.node);let i=null;const c=Object.create(null);let l=((y=n.extract)==null?void 0:y.part)??0,d=((g=n.extract)==null?void 0:g.node)??0,h=((v=n.extract)==null?void 0:v.path)??0,p=((x=n.extract)==null?void 0:x.segment)??0;for(;d<o.length;l++,d++,h++,p++){const C=o[d];if(C.kind===ys)break;if(C.kind===Aw){p--,l--,h--;continue}const D=t[l],U=h;if(D&&(h+=D.length),C.kind===1){i??(i=n.node.fullPath.split("/"));const O=i[p],T=((w=C.prefix)==null?void 0:w.length)??0;if(O.charCodeAt(T)===123){const V=((k=C.suffix)==null?void 0:k.length)??0,ee=O.substring(T+2,O.length-V-1),ne=D.substring(T,D.length-V);c[ee]=decodeURIComponent(ne)}else{const V=O.substring(1);c[V]=decodeURIComponent(D)}}else if(C.kind===3){if(n.skipped&1<<d){l--,h=U-1;continue}i??(i=n.node.fullPath.split("/"));const O=i[p],T=((P=C.prefix)==null?void 0:P.length)??0,V=((q=C.suffix)==null?void 0:q.length)??0,ee=O.substring(T+3,O.length-V-1),ne=C.suffix||C.prefix?D.substring(T,D.length-V):D;ne&&(c[ee]=decodeURIComponent(ne))}else if(C.kind===2){const O=C,T=e.substring(U+(((_=O.prefix)==null?void 0:_.length)??0),e.length-(((A=O.suffix)==null?void 0:A.length)??0)),V=decodeURIComponent(T);c["*"]=V,c._splat=V;break}}return n.rawParams&&Object.assign(c,n.rawParams),[c,{part:l,node:d,path:h,segment:p}]}function Nw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Q2(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function J2(e,t,n,o){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Aa(t),c=i&&e!=="/",l=t.length-(i?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let h=null,p=null;for(;d.length;){const y=d.pop(),{node:g,index:v,skipped:x,depth:w,statics:k,dynamics:P,optionals:q}=y;let{extract:_,rawParams:A}=y;if(g.kind===2&&g.route&&!Fu(p,y))continue;if(g.parse){if(!Jv(e,t,y))continue;A=y.rawParams,_=y.extract}o&&g.route&&g.kind!==ys&&Fu(h,y)&&(h=y);const C=v===l;if(C&&(g.route&&(!c||g.kind===ys||g.kind===2)&&Fu(p,y)&&(p=y),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const D=C?void 0:t[v];let U;if(C&&g.index){const O={node:g.index,index:v,skipped:x,depth:w+1,statics:k,dynamics:P,optionals:q,extract:_,rawParams:A};let T=!0;if(g.index.parse&&(Jv(e,t,O)||(T=!1)),T){if(!P&&!q&&!x&&G2(k,l))return O;Fu(p,O)&&(p=O)}}if(g.wildcard)for(let O=g.wildcard.length-1;O>=0;O--){const T=g.wildcard[O],{prefix:V,suffix:ee}=T;if(!(V&&(C||!(T.caseSensitive?D:U??(U=D.toLowerCase())).startsWith(V)))){if(ee){if(C)continue;const ne=t.slice(v).join("/").slice(-ee.length);if((T.caseSensitive?ne:ne.toLowerCase())!==ee)continue}d.push({node:T,index:l,skipped:x,depth:w+1,statics:k,dynamics:P,optionals:q,extract:_,rawParams:A})}}if(g.optional){const O=x|1<<w,T=w+1;for(let V=g.optional.length-1;V>=0;V--){const ee=g.optional[V];d.push({node:ee,index:v,skipped:O,depth:T,statics:k,dynamics:P,optionals:q,extract:_,rawParams:A})}if(!C)for(let V=g.optional.length-1;V>=0;V--){const ee=g.optional[V],{prefix:ne,suffix:K}=ee;if(ne||K){const E=ee.caseSensitive?D:U??(U=D.toLowerCase());if(ne&&!E.startsWith(ne)||K&&!E.endsWith(K))continue}d.push({node:ee,index:v+1,skipped:x,depth:T,statics:k,dynamics:P,optionals:q+Pu(l,v),extract:_,rawParams:A})}}if(!C&&g.dynamic&&D)for(let O=g.dynamic.length-1;O>=0;O--){const T=g.dynamic[O],{prefix:V,suffix:ee}=T;if(V||ee){const ne=T.caseSensitive?D:U??(U=D.toLowerCase());if(V&&!ne.startsWith(V)||ee&&!ne.endsWith(ee))continue}d.push({node:T,index:v+1,skipped:x,depth:w+1,statics:k,dynamics:P+Pu(l,v),optionals:q,extract:_,rawParams:A})}if(!C&&g.staticInsensitive){const O=g.staticInsensitive.get(U??(U=D.toLowerCase()));O&&d.push({node:O,index:v+1,skipped:x,depth:w+1,statics:k+Pu(l,v),dynamics:P,optionals:q,extract:_,rawParams:A})}if(!C&&g.static){const O=g.static.get(D);O&&d.push({node:O,index:v+1,skipped:x,depth:w+1,statics:k+Pu(l,v),dynamics:P,optionals:q,extract:_,rawParams:A})}if(g.pathless){const O=w+1;for(let T=g.pathless.length-1;T>=0;T--){const V=g.pathless[T];d.push({node:V,index:v,skipped:x,depth:O,statics:k,dynamics:P,optionals:q,extract:_,rawParams:A})}}}if(p)return p;if(o&&h){let y=h.index;for(let v=0;v<h.index;v++)y+=t[v].length;const g=y===e.length?"/":e.slice(y);return h.rawParams??(h.rawParams=Object.create(null)),h.rawParams["**"]=decodeURIComponent(g),h}return null}function Pu(e,t){return 2**(e-t-1)}function G2(e,t){return e===2**(t-1)-1}function Jv(e,t,n){let o,i;try{[o,i]=Ow(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 Fu(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===ys)>(e.node.kind===ys)||t.node.kind===ys==(e.node.kind===ys)&&t.depth>e.depth))):!0}function Uu(e){return pp(e.filter(t=>t!==void 0).join("/"))}function pp(e){return e.replace(/\/{2,}/g,"/")}function Dw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function zr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function jw(e){return zr(Dw(e))}function sl(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Y2(e,t,n){return sl(e,n)===sl(t,n)}function X2({base:e,to:t,trailingSlash:n="never",cache:o}){const i=t.startsWith("/"),c=!i&&t===".";let l;if(o){l=i?t:c?e:e+"\0"+t;const p=o.get(l);if(p)return p}let d;if(c)d=e.split("/");else if(i)d=t.split("/");else{for(d=e.split("/");d.length>1&&Aa(d)==="";)d.pop();const p=t.split("/");for(let y=0,g=p.length;y<g;y++){const v=p[y];v===""?y?y===g-1&&d.push(v):d=[v]:v===".."?d.pop():v==="."||d.push(v)}}d.length>1&&(Aa(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));const h=pp(d.join("/"))||"/";return l&&o&&o.set(l,h),h}function Z2(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,c=>t.get(c)??c)}function wh(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 c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:i};const l=e.length;let d=0,h,p="";for(;d<l;){const y=d;h=Lw(e,y,h);const g=h[5];if(d=g+1,y===g)continue;const v=h[0];if(v===0){p+="/"+e.substring(y,g);continue}if(v===2){const x=t._splat;c._splat=x,c["*"]=x;const w=e.substring(y,h[1]),k=e.substring(h[4],g);if(!x){i=!0,(w||k)&&(p+="/"+w+k);continue}const P=wh("_splat",t,n);p+="/"+w+P+k;continue}if(v===1){const x=e.substring(h[2],h[3]);!i&&!(x in t)&&(i=!0),c[x]=t[x];const w=e.substring(y,h[1]),k=e.substring(h[4],g),P=wh(x,t,n)??"undefined";p+="/"+w+P+k;continue}if(v===3){const x=e.substring(h[2],h[3]),w=t[x];if(w==null)continue;c[x]=w;const k=e.substring(y,h[1]),P=e.substring(h[4],g),q=wh(x,t,n)??"";p+="/"+k+q+P;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:i}}function Yv(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function Kt(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 kh(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 c=n[o];c==null?n[o]=kh(i):Array.isArray(c)?c.push(kh(i)):n[o]=[c,kh(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 c=eP(i,o);return c?`?${c}`:""}}const oo="__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 pn(e){return e instanceof Response&&!!e.options}const fm=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}),Nl=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),io=(e,t,n=!0)=>{const o={...e.router.options.context??{}},i=n?t:t-1;for(let c=0;c<=i;c++){const l=e.matches[c];if(!l)continue;const d=e.router.getMatch(l.id);d&&Object.assign(o,d.__routeContext,d.__beforeLoadContext)}return o},Xv=(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 c=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=i);for(let l=c;l>=0;l--){const d=e.matches[l];if(e.router.looseRoutesById[d.routeId].options.notFoundComponent)return l}return n?c:i},vs=(e,t,n)=>{var o,i,c;if(!(!pn(n)&&!Kt(n)))throw pn(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:pn(n)?"redirected":Kt(n)?"notFound":l.status==="pending"?"success":l.status,context:io(e,t.index),isFetching:!1,error:n})),Kt(n)&&!n.routeId&&(n.routeId=t.routeId),(c=t._nonReactive.loadPromise)==null||c.resolve()),pn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},$w=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Zv=(e,t,n)=>{const o=io(e,n);e.updateMatch(t,i=>({...i,context:o}))},ma=(e,t,n)=>{var l,d;const{id:o,routeId:i}=e.matches[t],c=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??(e.firstBadMatchIndex=t),vs(e,e.router.getMatch(o),n);try{(d=(l=c.options).onError)==null||d.call(l,n)}catch(h){n=h,vs(e,e.router.getMatch(o),n)}e.updateMatch(o,h=>{var p,y;return(p=h._nonReactive.beforeLoadPromise)==null||p.resolve(),h._nonReactive.beforeLoadPromise=void 0,(y=h._nonReactive.loadPromise)==null||y.resolve(),{...h,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!pn(n)&&!Kt(n)&&(e.serialError??(e.serialError=n))},Uw=(e,t,n,o)=>{var c;if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Nl(e,t)&&(n.options.loader||n.options.beforeLoad||zw(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((c=e.router.options)==null?void 0:c.defaultPendingComponent))){const l=setTimeout(()=>{fm(e)},i);o._nonReactive.pendingTimeout=l}},cP=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Uw(e,t,n,o);const i=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&vs(e,c,c.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(i):i()},uP=(e,t,n,o)=>{const i=e.router.getMatch(t);let c=i._nonReactive.loadPromise;i._nonReactive.loadPromise=fi(()=>{c==null||c.resolve(),c=void 0});const{paramsError:l,searchError:d}=i;l&&ma(e,n,l),d&&ma(e,n,d),Uw(e,t,o,i);const h=new AbortController;let p=!1;const y=()=>{p||(p=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:h})))},g=()=>{var C;(C=i._nonReactive.beforeLoadPromise)==null||C.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,D=>({...D,isFetching:!1}))};if(!o.options.beforeLoad){e.router.batch(()=>{y(),g()});return}i._nonReactive.beforeLoadPromise=fi();const v={...io(e,n,!1),...i.__routeContext},{search:x,params:w,cause:k}=i,P=Nl(e,t),q={search:x,abortController:h,params:w,preload:P,context:v,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:P?"preload":k,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},_=C=>{if(C===void 0){e.router.batch(()=>{y(),g()});return}(pn(C)||Kt(C))&&(y(),ma(e,n,C)),e.router.batch(()=>{y(),e.updateMatch(t,D=>({...D,__beforeLoadContext:C})),g()})};let A;try{if(A=o.options.beforeLoad(q),La(A))return y(),A.catch(C=>{ma(e,n,C)}).then(_)}catch(C){y(),ma(e,n,C)}_(A)},lP=(e,t)=>{const{id:n,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o],c=()=>d(),l=()=>uP(e,n,t,i),d=()=>{if($w(e,n))return;const h=cP(e,n,i);return La(h)?h.then(l):l()};return c()},fP=(e,t,n)=>{var c,l,d,h,p,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=(c=n.options).head)==null?void 0:l.call(c,i),(h=(d=n.options).scripts)==null?void 0:h.call(d,i),(y=(p=n.options).headers)==null?void 0:y.call(p,i)]).then(([g,v,x])=>({meta:g==null?void 0:g.meta,links:g==null?void 0:g.links,headScripts:g==null?void 0:g.scripts,headers:x,scripts:v,styles:g==null?void 0:g.styles}))},Bw=(e,t,n,o,i)=>{const c=t[o-1],{params:l,loaderDeps:d,abortController:h,cause:p}=e.router.getMatch(n),y=io(e,o),g=Nl(e,n);return{params:l,deps:d,preload:!!g,parentMatchPromise:c,abortController:h,context:y,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":p,route:i,...e.router.options.additionalContext}},eS=async(e,t,n,o,i)=>{var c,l,d,h,p;try{const y=e.router.getMatch(n);try{(!(Rw??e.router.isServer)||y.ssr===!0)&&Na(i);const g=i.options.loader,v=typeof g=="function"?g:g==null?void 0:g.handler,x=v==null?void 0:v(Bw(e,t,n,o,i)),w=!!v&&La(x);if((w||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=w?await x:x;vs(e,e.router.getMatch(n),P),P!==void 0&&e.updateMatch(n,q=>({...q,loaderData:P}))}i._lazyPromise&&await i._lazyPromise;const k=y._nonReactive.minPendingPromise;k&&await k,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,P=>({...P,error:void 0,context:io(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(g){let v=g;if((v==null?void 0:v.name)==="AbortError"){if(y.abortController.signal.aborted){(c=y._nonReactive.loaderPromise)==null||c.resolve(),y._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,w=>({...w,status:w.status==="pending"?"success":w.status,isFetching:!1,context:io(e,o)}));return}const x=y._nonReactive.minPendingPromise;x&&await x,Kt(g)&&await((d=(l=i.options.notFoundComponent)==null?void 0:l.preload)==null?void 0:d.call(l)),vs(e,e.router.getMatch(n),g);try{(p=(h=i.options).onError)==null||p.call(h,g)}catch(w){v=w,vs(e,e.router.getMatch(n),w)}!pn(v)&&!Kt(v)&&await Na(i,["errorComponent"]),e.updateMatch(n,w=>({...w,error:v,context:io(e,o),status:"error",isFetching:!1}))}}catch(y){const g=e.router.getMatch(n);g&&(g._nonReactive.loaderPromise=void 0),vs(e,g,y)}},dP=async(e,t,n)=>{var x,w,k,P;async function o(q,_,A,C,D){const U=Date.now()-_.updatedAt,O=q?D.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:D.options.staleTime??e.router.options.defaultStaleTime??0,T=D.options.shouldReload,V=typeof T=="function"?T(Bw(e,t,i,n,D)):T,{status:ee,invalid:ne}=C,K=U>=O&&(!!e.forceStaleReload||C.cause==="enter"||A!==void 0&&A!==C.id);l=ee==="success"&&(ne||(V??K)),q&&D.options.preload===!1||(l&&!e.sync&&y?(d=!0,(async()=>{var E,$;try{await eS(e,t,i,n,D);const W=e.router.getMatch(i);(E=W._nonReactive.loaderPromise)==null||E.resolve(),($=W._nonReactive.loadPromise)==null||$.resolve(),W._nonReactive.loaderPromise=void 0,W._nonReactive.loadPromise=void 0}catch(W){pn(W)&&await e.router.navigate(W.options)}})()):ee!=="success"||l?await eS(e,t,i,n,D):Zv(e,i,n))}const{id:i,routeId:c}=e.matches[n];let l=!1,d=!1;const h=e.router.looseRoutesById[c],p=h.options.loader,y=((typeof p=="function"||p==null?void 0:p.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if($w(e,i)){if(!e.router.getMatch(i))return e.matches[n];Zv(e,i,n)}else{const q=e.router.getMatch(i),_=e.router.stores.matchesId.get()[n],A=((x=_&&e.router.stores.matchStores.get(_)||null)==null?void 0:x.routeId)===c?_:(w=e.router.stores.matches.get().find(D=>D.routeId===c))==null?void 0:w.id,C=Nl(e,i);if(q._nonReactive.loaderPromise){if(q.status==="success"&&!e.sync&&!q.preload&&y)return q;await q._nonReactive.loaderPromise;const D=e.router.getMatch(i),U=D._nonReactive.error||D.error;U&&vs(e,D,U),D.status==="pending"&&await o(C,q,A,D,h)}else{const D=C&&!e.router.stores.matchStores.has(i),U=e.router.getMatch(i);U._nonReactive.loaderPromise=fi(),D!==U.preload&&e.updateMatch(i,O=>({...O,preload:D})),await o(C,q,A,U,h)}}const g=e.router.getMatch(i);d||((k=g._nonReactive.loaderPromise)==null||k.resolve(),(P=g._nonReactive.loadPromise)==null||P.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,d||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=d?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,q=>({...q,isFetching:v,invalid:!1})),e.router.getMatch(i)):g};async function tS(e){var v,x;const t=e,n=[];aP(t.router)&&fm(t);let o;for(let w=0;w<t.matches.length;w++){try{const k=lP(t,w);La(k)&&await k}catch(k){if(pn(k))throw k;if(Kt(k))o=k;else if(!t.preload)throw k;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,c=o&&!t.preload?Xv(t,o):void 0,l=o&&t.preload?0:c!==void 0?Math.min(c+1,i):i;let d,h;for(let w=0;w<l;w++)n.push(dP(t,n,w));try{await Promise.all(n)}catch{const w=await Promise.allSettled(n);for(const k of w){if(k.status!=="rejected")continue;const P=k.reason;if(pn(P))throw P;Kt(P)?d??(d=P):h??(h=P)}if(h!==void 0)throw h}const p=d??(o&&!t.preload?o:void 0);let y=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!p&&o&&t.preload)return t.matches;if(p){const w=Xv(t,p);w===void 0&&qr();const k=t.matches[w],P=t.router.looseRoutesById[k.routeId],q=(v=t.router.options)==null?void 0:v.defaultNotFoundComponent;!P.options.notFoundComponent&&q&&(P.options.notFoundComponent=q),p.routeId=k.routeId;const _=k.routeId===t.router.routeTree.id;t.updateMatch(k.id,A=>({...A,..._?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),y=w,await Na(P,["notFoundComponent"])}else if(!t.preload){const w=t.matches[0];w.globalNotFound||(x=t.router.getMatch(w.id))!=null&&x.globalNotFound&&t.updateMatch(w.id,k=>({...k,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const w=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Na(w,["errorComponent"])}for(let w=0;w<=y;w++){const{id:k,routeId:P}=t.matches[w],q=t.router.looseRoutesById[P];try{const _=fP(t,k,q);if(_){const A=await _;t.updateMatch(k,C=>({...C,...A}))}}catch(_){console.error(`Error executing head for route ${P}:`,_)}}const g=fm(t);if(La(g)&&await g,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function nS(e,t){const n=t.map(o=>{var i,c;return(c=(i=e.options[o])==null?void 0:i.preload)==null?void 0:c.call(i)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Na(e,t=Bu){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(o=>{const{id:i,...c}=o.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Bu?(()=>{if(e._componentsPromise===void 0){const o=nS(e,Bu);o?e._componentsPromise=o.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():nS(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function zw(e){var t;for(const n of Bu)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Bu=["component","errorComponent","pendingComponent","notFoundComponent"];function hP(e){return{input:({url:t})=>{for(const n of e)t=dm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Vw(e[n],t);return t}}}function mP(e){const t=jw(e.basepath),n=`/${t}`,o=e.caseSensitive?n:n.toLowerCase(),i=`${o}/`;return{input:({url:c})=>{const l=e.caseSensitive?c.pathname:c.pathname.toLowerCase();return l===o?c.pathname="/":l.startsWith(i)&&(c.pathname=c.pathname.slice(n.length)),c},output:({url:c})=>(c.pathname=Uu(["/",t,c.pathname]),c)}}function dm(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 Vw(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 pP(e,t){const{createMutableStore:n,createReadonlyStore:o,batch:i,init:c}=t,l=new Map,d=new Map,h=new Map,p=n(e.status),y=n(e.loadedAt),g=n(e.isLoading),v=n(e.isTransitioning),x=n(e.location),w=n(e.resolvedLocation),k=n(e.statusCode),P=n(e.redirect),q=n([]),_=n([]),A=n([]),C=o(()=>Eh(l,q.get())),D=o(()=>Eh(d,_.get())),U=o(()=>Eh(h,A.get())),O=o(()=>q.get()[0]),T=o(()=>q.get().some(B=>{var G;return((G=l.get(B))==null?void 0:G.get().status)==="pending"})),V=o(()=>{var B;return{locationHref:x.get().href,resolvedLocationHref:(B=w.get())==null?void 0:B.href,status:p.get()}}),ee=o(()=>({status:p.get(),loadedAt:y.get(),isLoading:g.get(),isTransitioning:v.get(),matches:C.get(),location:x.get(),resolvedLocation:w.get(),statusCode:k.get(),redirect:P.get()})),ne=Oa(64);function K(B){let G=ne.get(B);return G||(G=o(()=>{const re=q.get();for(const te of re){const I=l.get(te);if(I&&I.routeId===B)return I.get()}}),ne.set(B,G)),G}const E={status:p,loadedAt:y,isLoading:g,isTransitioning:v,location:x,resolvedLocation:w,statusCode:k,redirect:P,matchesId:q,pendingIds:_,cachedIds:A,matches:C,pendingMatches:D,cachedMatches:U,firstId:O,hasPending:T,matchRouteDeps:V,matchStores:l,pendingMatchStores:d,cachedMatchStores:h,__store:ee,getRouteMatchStore:K,setMatches:$,setPending:W,setCached:J};$(e.matches),c==null||c(E);function $(B){_h(B,l,q,n,i)}function W(B){_h(B,d,_,n,i)}function J(B){_h(B,h,A,n,i)}return E}function Eh(e,t){const n=[];for(const o of t){const i=e.get(o);i&&n.push(i.get())}return n}function _h(e,t,n,o,i){const c=e.map(d=>d.id),l=new Set(c);i(()=>{for(const d of t.keys())l.has(d)||t.delete(d);for(const d of e){const h=t.get(d.id);if(!h){const p=o(d);p.routeId=d.routeId,t.set(d.id,p);continue}h.routeId=d.routeId,h.get()!==d&&h.set(d)}U2(n.get(),c)||n.set(c)})}var xs="__TSR_index",rS="popstate",sS="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()},c=async({task:l,navigateOpts:d,...h})=>{var g,v;if((d==null?void 0:d.ignoreBlocker)??!1){l();return}const p=((g=e.getBlockers)==null?void 0:g.call(e))??[],y=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&p.length&&y)for(const x of p){const w=Da(h.path,h.state);if(await x.blockerFn({currentLocation:t,nextLocation:w,action:h.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,h)=>{const p=t.state[xs];d=oS(p+1,d),c({task:()=>{e.pushState(l,d),o({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:l,state:d})},replace:(l,d,h)=>{const p=t.state[xs];d=oS(p,d),c({task:()=>{e.replaceState(l,d),o({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:l,state:d})},go:(l,d)=>{c({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:d,type:"GO"})},back:l=>{c({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{c({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[xs]!==0,createHref:l=>e.createHref(l),block:l=>{var h;if(!e.setBlockers)return()=>{};const d=((h=e.getBlockers)==null?void 0:h.call(e))??[];return e.setBlockers([...d,l]),()=>{var y,g;const p=((y=e.getBlockers)==null?void 0:y.call(e))??[];(g=e.setBlockers)==null||g.call(e,p.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 oS(e,t){t||(t={});const n=gp();return{...t,key:n,__TSR_key:n,[xs]:e}}function qw(e){var T,V;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 c=()=>i,l=ee=>i=ee,d=(e==null?void 0:e.createHref)??(ee=>ee),h=(e==null?void 0:e.parseLocation)??(()=>Da(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((T=t.history.state)!=null&&T.__TSR_key)&&!((V=t.history.state)!=null&&V.key)){const ee=gp();t.history.replaceState({[xs]:0,key:ee,__TSR_key:ee},"")}let p=h(),y,g=!1,v=!1,x=!1,w=!1;const k=()=>p;let P,q;const _=()=>{P&&(O._ignoreSubscribers=!0,(P.isPush?t.history.pushState:t.history.replaceState)(P.state,"",P.href),O._ignoreSubscribers=!1,P=void 0,q=void 0,y=void 0)},A=(ee,ne,K)=>{const E=d(ne);q||(y=p),p=Da(ne,K),P={href:E,state:K,isPush:(P==null?void 0:P.isPush)||ee==="push"},q||(q=Promise.resolve().then(()=>_()))},C=ee=>{p=h(),O.notify({type:ee})},D=async()=>{if(v){v=!1;return}const ee=h(),ne=ee.state[xs]-p.state[xs],K=ne===1,E=ne===-1,$=!K&&!E||g;g=!1;const W=$?"GO":E?"BACK":"FORWARD",J=$?{type:"GO",index:ne}:{type:E?"BACK":"FORWARD"};if(x)x=!1;else{const B=c();if(typeof document<"u"&&B.length){for(const G of B)if(await G.blockerFn({currentLocation:p,nextLocation:ee,action:W})){v=!0,t.history.go(1),O.notify(J);return}}}p=h(),O.notify(J)},U=ee=>{if(w){w=!1;return}let ne=!1;const K=c();if(typeof document<"u"&&K.length)for(const E of K){const $=E.enableBeforeUnload??!0;if($===!0){ne=!0;break}if(typeof $=="function"&&$()===!0){ne=!0;break}}if(ne)return ee.preventDefault(),ee.returnValue=""},O=gP({getLocation:k,getLength:()=>t.history.length,pushState:(ee,ne)=>A("push",ee,ne),replaceState:(ee,ne)=>A("replace",ee,ne),back:ee=>(ee&&(x=!0),w=!0,t.history.back()),forward:ee=>{ee&&(x=!0),w=!0,t.history.forward()},go:ee=>{g=!0,t.history.go(ee)},createHref:ee=>d(ee),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(sS,U,{capture:!0}),t.removeEventListener(rS,D)},onBlocked:()=>{y&&p!==y&&(p=y)},getBlockers:c,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(sS,U,{capture:!0}),t.addEventListener(rS,D),t.history.pushState=function(...ee){const ne=n.apply(t.history,ee);return O._ignoreSubscribers||C("PUSH"),ne},t.history.replaceState=function(...ee){const ne=o.apply(t.history,ee);return O._ignoreSubscribers||C("REPLACE"),ne},O}function yP(e){const t=typeof document<"u"?window:void 0;return qw({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),o=n[0]??"/",i=t.location.search,c=n.slice(1);return Da(`${o}${i}${c.length===0?"":`#${c.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 Da(e,t){const n=vP(e),o=n.indexOf("#"),i=n.indexOf("?"),c=gp();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||{[xs]:0,key:c,__TSR_key:c}}}function gp(){return(Math.random()+1).toString(36).substring(7)}function ii(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 hm=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)??"/",c=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=Z2(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=qw()),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 g;this.resolvePathCache=Oa(1e3),g=this.buildRouteTree(),this.setRoutes(g)}if(!this.stores&&this.latestLocation){const g=this.getStoreConfig(this);this.batch=g.batch,this.stores=pP(wP(this.latestLocation),g),MP(this)}let d=!1;const h=this.options.basepath??"/",p=this.options.rewrite;if(c||i!==h||l!==p){this.basepath=h;const g=[],v=jw(h);v&&v!=="/"&&g.push(mP({basepath:h})),p&&g.push(p),this.rewrite=g.length===0?void 0:g.length===1?g[0]:hP(g),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=K2(this.routeTree,this.options.caseSensitive,(o,i)=>{o.init({originalIndex:i})});return this.options.routeMasks&&z2(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:h,search:p,hash:y,href:g,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const q=this.options.parseSearch(p),_=this.options.stringifySearch(q);return{href:h+_+y,publicHref:h+_+y,pathname:ha(h).path,external:!1,searchStr:_,search:Gs(o==null?void 0:o.search,q),hash:ha(y.slice(1)).path,state:to(o==null?void 0:o.state,v)}}const x=new URL(g,this.origin),w=dm(this.rewrite,x),k=this.options.parseSearch(w.search),P=this.options.stringifySearch(k);return w.search=P,{href:w.href.replace(w.origin,""),publicHref:g,pathname:ha(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:P,search:Gs(o==null?void 0:o.search,k),hash:ha(w.hash.slice(1)).path,state:to(o==null?void 0:o.state,v)}},c=i(n),{__tempLocation:l,__tempKey:d}=c.state;if(l&&(!d||d===this.tempLocationKey)){const h=i(l);return h.state.key=c.state.key,h.state.__TSR_key=c.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:c}}return c},this.resolvePathWithBase=(n,o)=>X2({base:n,to:o.includes("//")?pp(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=(c={})=>{var ne,K;const l=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(l);c.from;const h=c.unsafeRelative==="path"?l.pathname:c.from??d.fullPath,p=c.to?`${c.to}`:void 0,y=d.search,g=Object.assign(Object.create(null),d.params),v=(p==null?void 0:p.charCodeAt(0))===47?"/":this.resolvePathWithBase(h,"."),x=p?this.resolvePathWithBase(v,p):v,w=c.params===!1||c.params===null?Object.create(null):(c.params??!0)===!0?g:Object.assign(g,eo(c.params,g)),k=this.routesByPath[zr(x)];let P;if(k)P=this.getRouteBranch(k);else if(x.includes("$"))P=[];else{const E=this.getMatchedRoutes(x);P=E.matchedRoutes,this.options.notFoundRoute&&(!E.foundRoute||E.foundRoute.path!=="/"&&E.routeParams["**"])&&(P=[...P,this.options.notFoundRoute])}if(P.length&&Mw(w))for(const E of P){const $=((ne=E.options.params)==null?void 0:ne.stringify)??E.options.stringifyParams;if($)try{Object.assign(w,$(w))}catch{}}const q=n.leaveParams?x:ha(Gv({path:x,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let _=y;if(n._includeValidateSearch&&((K=this.options.search)!=null&&K.strict)){const E={};P.forEach($=>{if($.options.validateSearch)try{Object.assign(E,zu($.options.validateSearch,{...E,..._}))}catch{}}),_=E}_=EP({search:_,dest:c,destRoutes:P,_includeValidateSearch:n._includeValidateSearch}),_=Gs(y,_);const A=this.options.stringifySearch(_),C=c.hash===!0?l.hash:c.hash?eo(c.hash,l.hash):void 0,D=C?`#${C}`:"";let U=c.state===!0?l.state:c.state?eo(c.state,l.state):{};U=to(l.state,U);const O=`${q}${A}${D}`;let T,V,ee=!1;if(this.rewrite){const E=new URL(O,this.origin),$=Vw(this.rewrite,E);T=E.href.replace(E.origin,""),$.origin!==this.origin?(V=$.href,ee=!0):V=$.pathname+$.search+$.hash}else T=$2(O),V=T;return{publicHref:V,href:T,pathname:q,search:_,searchStr:A,state:U,hash:C??"",external:ee,unmaskOnReload:c.unmaskOnReload}},i=(c={},l)=>{const d=o(c);let h=l?o(l):void 0;if(!h){const p=Object.create(null);if(this.options.routeMasks){const y=V2(d.pathname,this.processedTree);if(y){Object.assign(p,y.rawParams);const{from:g,params:v,...x}=y.route,w=v===!1||v===null?Object.create(null):(v??!0)===!0?p:Object.assign(p,eo(v,p));l={from:n.from,...x,params:w},h=o(l)}}}return h&&(d.maskedLocation=h),d};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...i})=>{let c;const l=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(g=>{i.state[g]=this.latestLocation.state[g]});const y=so(i.state,this.latestLocation.state);return p.forEach(g=>{delete i.state[g]}),y},d=zr(this.latestLocation.href)===zr(i.href);let h=this.commitLocationPromise;if(this.commitLocationPromise=fi(()=>{h==null||h.resolve(),h=void 0}),d&&l())this.load();else{let{maskedLocation:p,hashScrollIntoView:y,...g}=i;p&&(g={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=y??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,c=i.replace?"REPLACE":"PUSH",this.history[c==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:o})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(c?{action:{type:c}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:i,viewTransition:c,ignoreBlocker:l,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,v=Da(d,{__TSR_index:n?g:g+1}),x=new URL(v.pathname,this.origin);h.to=dm(this.rewrite,x).pathname,h.search=this.options.parseSearch(v.search),h.hash=v.hash.slice(1)}const p=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const y=this.commitLocation({...p,viewTransition:c,replace:n,resetScroll:o,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:o,href:i,publicHref:c,...l})=>{var h,p;let d=!1;if(i)try{new URL(`${i}`),d=!0}catch{}if(d&&!o&&(o=!0),o){if(n!==void 0||!i){const g=this.buildLocation({to:n,...l});i=i??g.publicHref,c=c??g.publicHref}const y=!d&&c?c:i;if(rl(y,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const g=((p=(h=this.history).getBlockers)==null?void 0:p.call(h))??[];for(const v of g)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(c=>c.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 p;const o=(p=n==null?void 0:n.action)==null?void 0:p.type;let i,c,l;const d=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(y=>{this.startTransition(async()=>{var g;try{this.beforeLoad(),o?hm.set(this.latestLocation,o):hm.delete(this.latestLocation);const v=this.latestLocation,x=ii(v,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...x}),this.emit({type:"onBeforeLoad",...x}),await tS({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 _,A;let w=null,k=null,P=null,q=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),D=C.length,U=this.stores.matches.get();w=D?U.filter(V=>!this.stores.pendingMatchStores.has(V.id)):null;const O=new Set;for(const V of this.stores.pendingMatchStores.values())V.routeId&&O.add(V.routeId);const T=new Set;for(const V of this.stores.matchStores.values())V.routeId&&T.add(V.routeId);k=D?U.filter(V=>!O.has(V.routeId)):null,P=D?C.filter(V=>!T.has(V.routeId)):null,q=D?C.filter(V=>T.has(V.routeId)):U,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),D&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...w.filter(V=>V.status!=="error"&&V.status!=="notFound"&&V.status!=="redirected")]),this.clearExpiredCache())});for(const[C,D]of[[k,"onLeave"],[P,"onEnter"],[q,"onStay"]])if(C)for(const U of C)(A=(_=this.looseRoutesById[U.routeId].options)[D])==null||A.call(_,U)})})}})}catch(v){pn(v)?(i=v,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):Kt(v)&&(c=v);const x=i?i.status:c?404:this.stores.matches.get().some(w=>w.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(x),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&((g=this.commitLocationPromise)==null||g.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),y()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.stores.matches.get().some(y=>y.status==="error")&&(h=500),h!==void 0&&this.stores.statusCode.set(h)},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 c=this.latestLocation,l=this.stores.resolvedLocation.get(),d=typeof o.types=="function"?o.types(ii(c,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 c=this.stores.matchStores.get(n);if(c){c.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(h=>h.filter(p=>p!==n)):l.set(d)}})},this.getMatch=n=>{var o,i,c;return((o=this.stores.cachedMatchStores.get(n))==null?void 0:o.get())??((i=this.stores.pendingMatchStores.get(n))==null?void 0:i.get())??((c=this.stores.matchStores.get(n))==null?void 0:c.get())},this.invalidate=n=>{const o=i=>{var c;return((c=n==null?void 0:n.filter)==null?void 0:c.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),c=this.getParsedLocationHref(i);n.options.href=c,n.headers.set("Location",c)}else if(o)try{const i=new URL(o);if(this.origin&&i.origin===this.origin){const c=i.pathname+i.search+i.hash;n.options.href=c,n.headers.set("Location",c)}}catch{}if(n.options.href&&!n.options._builtLocation&&rl(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 c=this.looseRoutesById[i.routeId];if(!c.options.loader)return!0;const l=(i.preload?c.options.preloadGcTime??this.options.defaultPreloadGcTime:c.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:o})},this.loadRouteChunk=Na,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const c=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...c,...this.stores.cachedIds.get()]),d=i.filter(h=>!l.has(h.id));if(d.length){const h=this.stores.cachedMatches.get();this.stores.setCached([...h,...d])}try{return i=await tS({router:this,matches:i,location:o,preload:!0,updateMatch:(h,p)=>{c.has(h)?i=i.map(y=>y.id===h?p(y):y):this.updateMatch(h,p)}}),i}catch(h){if(pn(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:o});Kt(h)||console.error(h);return}},this.matchRoute=(n,o)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},c=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=q2(c.pathname,(o==null?void 0:o.caseSensitive)??!1,(o==null?void 0:o.fuzzy)??!1,l.pathname,this.processedTree);return!d||n.params&&!so(d.rawParams,n.params,{partial:!0})?!1:(o==null?void 0:o.includeSearch)??!0?so(l.search,c.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??j2}),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=Nw(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,g;const n=this.getMatchedRoutes(e.pathname),{foundRoute:o,routeParams:i}=n;let{matchedRoutes:c}=n,l=!1;(o?o.path!=="/"&&i["**"]:zr(e.pathname))&&(this.options.notFoundRoute?c=[...c,this.options.notFoundRoute]:l=!0);const d=l?CP(this.options.notFoundMode,c):void 0,h=new Array(c.length),p=new Map;for(const v of this.stores.matchStores.values())v.routeId&&p.set(v.routeId,v.get());for(let v=0;v<c.length;v++){const x=c[v],w=h[v-1];let k,P,q;{const $=(w==null?void 0:w.search)??e.search,W=(w==null?void 0:w._strictSearch)??void 0;try{const J=zu(x.options.validateSearch,{...$})??void 0;k={...$,...J},P={...W,...J},q=void 0}catch(J){let B=J;if(J instanceof ol||(B=new ol(J.message,{cause:J})),t!=null&&t.throwOnError)throw B;k=$,P={},q=B}}const _=((g=(y=x.options).loaderDeps)==null?void 0:g.call(y,{search:k}))??"",A=_?JSON.stringify(_):"",{interpolatedPath:C,usedParams:D}=Gv({path:x.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),U=x.id+C+A,O=this.getMatch(U),T=p.get(x.id),V=(O==null?void 0:O._strictParams)??D;let ee;if(!O)try{iS(x,V)}catch($){if(Kt($)||pn($)?ee=$:ee=new xP($.message,{cause:$}),t!=null&&t.throwOnError)throw ee}Object.assign(i,V);const ne=T?"stay":"enter";let K;if(O)K={...O,cause:ne,params:(T==null?void 0:T.params)??i,_strictParams:V,search:Gs(T?T.search:O.search,k),_strictSearch:P};else{const $=x.options.loader||x.options.beforeLoad||x.lazyFn||zw(x)?"pending":"success";K={id:U,ssr:x.options.ssr,index:v,routeId:x.id,params:(T==null?void 0:T.params)??i,_strictParams:V,pathname:C,updatedAt:Date.now(),search:T?Gs(T.search,k):k,_strictSearch:P,searchError:void 0,status:$,isFetching:!1,error:void 0,paramsError:ee,__routeContext:void 0,_nonReactive:{loadPromise:fi()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ne,loaderDeps:T?to(T.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}t!=null&&t.preload||(K.globalNotFound=d===x.id),K.searchError=q;const E=this.getParentContext(w);K.context={...E,...K.__routeContext,...K.__beforeLoadContext},h[v]=K}for(let v=0;v<h.length;v++){const x=h[v],w=this.looseRoutesById[x.routeId],k=this.getMatch(x.id),P=p.get(x.routeId);if(x.params=P?Gs(P.params,i):i,!k){const q=h[v-1],_=this.getParentContext(q);if(w.options.context){const A={deps:x.loaderDeps,params:x.params,context:_??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:h,routeId:w.id};x.__routeContext=w.options.context(A)??void 0}x.context={..._,...x.__routeContext,...x.__beforeLoadContext}}}return h}matchRoutesLightweight(e){var p;const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),o=Aa(t),i={...e.search};for(const y of t)try{Object.assign(i,zu(y.options.validateSearch,i))}catch{}const c=Aa(this.stores.matchesId.get()),l=c&&((p=this.stores.matchStores.get(c))==null?void 0:p.get()),d=l&&l.routeId===o.id&&l.pathname===e.pathname;let h;if(d)h=l.params;else{const y=Object.assign(Object.create(null),n);for(const g of t)try{iS(g,y)}catch{}h=y}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:h}}},ol=class extends Error{},xP=class extends Error{};function wP(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function zu(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ol("Async validation not supported");if(n.issues)throw new ol(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=zr(e);let c;const l=W2(i,n,!0);return l&&(c=l.route,Object.assign(o,l.rawParams)),{matchedRoutes:(l==null?void 0:l.branch)||[t.__root__],routeParams:o,foundRoute:c}}function EP({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return _P(n)(e,t,o??!1)}function _P(e){var c;let t,n;const o=[];for(const l of e){const d=l.options;if("search"in d)(c=d.search)!=null&&c.middlewares&&o.push(...d.search.middlewares);else if(d.preSearchFilters||d.postSearchFilters){const p=({search:y,next:g})=>{const v=g(d.preSearchFilters?d.preSearchFilters.reduce((x,w)=>w(x),y):y);return d.postSearchFilters?d.postSearchFilters.reduce((x,w)=>w(x),v):v};o.push(p)}const h=d.validateSearch;if(h){const p=({search:y,next:g,meta:v})=>{const x=g(y);if(n)try{const w=zu(h,x);if(v&&w)for(const k in w)k in x||(v.defaulted||(v.defaulted=new Map)).set(k,w[k]);return{...x,...w}}catch{}return x};o.push(p)}}const i=(l,d,h)=>{if(l>=o.length){if(!t.search)return{};if(t.search===!0)return d;const y=eo(t.search,d);return h&&(h.explicit=y),y}const p=(y,g)=>{if(g){const v=h||{};return{search:i(l+1,y,v),meta:v}}return i(l+1,y,h)};return o[l]({search:d,next:p,meta:h})};return function(d,h,p){return t=h,n=p,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 oo}function iS(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",ai=bP();function FP(){try{return JSON.parse((ai==null?void 0:ai.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function IP(){try{ai==null||ai.setItem(PP,JSON.stringify(ms))}catch{}}const ms=FP(),aS="data-scroll-restoration-id",RP=e=>e.state.__TSR_key||e.href;function TP(e){const t=e.getAttribute(aS);if(t)return`[${aS}="${t}"]`;let n="",o=e,i;for(;i=o.parentNode;){let c=1,l=o;for(;l=l.previousElementSibling;)c++;const d=`${o.localName}:nth-child(${c})`;n=n?`${d} > ${n}`:d,o=i}return n}let Iu=!1;const ni="window";function mm(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function cS(e){const t=[];for(const n of e){if(n===ni)continue;const o=mm(n);o&&t.push(o)}return t}function MP(e,t){const n=e.options.scrollRestoration,o=e._scroll;n&&(o.restoring=!0);const i=e.options.getScrollRestorationKey||RP,c=new Map,l=(p,y,g)=>{const v=c.get(p)||{};v.scrollX=y,v.scrollY=g,c.set(p,v)},d=p=>{if(!(Iu||!o.restoring))if(p.target===document)l(ni,scrollX,scrollY);else{const y=p.target;l(y,y.scrollLeft,y.scrollTop)}},h=p=>{if(!o.restoring)return;const y=ms[p]||(ms[p]={});for(const[g,v]of c)g===ni?y[ni]=v:g.isConnected&&(y[TP(g)]=v)};n&&!o.restoration&&(o.restoration=!0,Iu=!1,history.scrollRestoration="manual",document.addEventListener("scroll",d,!0),e.subscribe("onBeforeLoad",p=>{p.fromLocation&&h(i(p.fromLocation)),c.clear()}),addEventListener("pagehide",()=>{h(i(e.stores.resolvedLocation.get()??e.stores.location.get())),IP()})),!o.reset&&(o.reset=!0,e.subscribe("onRendered",p=>{var P;const y=e.options.scrollRestorationBehavior,g=e.options.scrollToTopSelectors,v=o.next;let x;if(c.clear(),v||(o.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const w=i(p.toLocation),k=p.fromLocation&&i(p.fromLocation);if(o.restoring&&k&&k!==w){const q=ms[k];if(q){let _=ms[w];for(const A in q){if(A===ni){if(v)continue}else{const C=mm(A);if(!C||v&&g&&(x??(x=cS(g)),x.includes(C)))continue}_||(_=ms[w]={}),_[A]??(_[A]=q[A])}}}Iu=!0;try{const q=p.toLocation.hash,_=p.toLocation.state.__hashScrollIntoViewOptions??!0;let A=!1;if(v){const C=hm.get(p.toLocation),D=q&&_&&(C==="PUSH"||C==="REPLACE"),U=o.restoring?ms[w]:void 0;if(U)for(const O in U){const{scrollX:T,scrollY:V}=U[O];if(O===ni){if(D)continue;scrollTo({top:V,left:T,behavior:y}),A=!0}else{const ee=mm(O);ee&&(ee.scrollLeft=T,ee.scrollTop=V)}}if(!A&&!q){const O={top:0,left:0,behavior:y};if(scrollTo(O),g){x??(x=cS(g));for(const T of x)T.scrollTo(O)}}}!A&&q&&_&&((P=document.getElementById(q))==null||P.scrollIntoView(_))}finally{Iu=!1}}))}const AP="Error preloading route! ☝️";var Ww=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 h,p;this.originalIndex=t.originalIndex;const n=this.options,o=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(p=(h=this.options).getParentRoute)==null?void 0:p.call(h),o?this._path=oo:this.parentRoute||qr();let i=o?oo:n==null?void 0:n.path;i&&i!=="/"&&(i=Dw(i));const c=(n==null?void 0:n.id)||i;let l=o?oo:Uu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Uu(["/",l]));const d=l==="__root__"?"/":Uu([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=d,this._to=zr(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.")}},LP=class extends Ww{constructor(e){super(e)}};function yp(e){const t=e.errorComponent??vp;return F.jsx(OP,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?X.createElement(t,{error:n,reset:o}):e.children})}var OP=class extends X.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 vp({error:e}){const[t,n]=X.useState(!1);return F.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[F.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),F.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"})]}),F.jsx("div",{style:{height:".25rem"}}),t?F.jsx("div",{children:F.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?F.jsx("code",{children:e.message}):null})}):null]})}function NP({children:e,fallback:t=null}){return Hw()?F.jsx(Ma.Fragment,{children:e}):F.jsx(Ma.Fragment,{children:t})}function Hw(){return Ma.useSyncExternalStore(DP,()=>!0,()=>!1)}function DP(){return()=>{}}var Kw=X.createContext(null);function Mn(e){return X.useContext(Kw)}var Dl=X.createContext(void 0),jP=X.createContext(void 0),tt=(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))(tt||{});function $P({update:e,notify:t,unwatched:n}){return{link:o,unlink:i,propagate:c,checkDirty:l,shallowPropagate:d};function o(p,y,g){const v=y.depsTail;if(v!==void 0&&v.dep===p)return;const x=v!==void 0?v.nextDep:y.deps;if(x!==void 0&&x.dep===p){x.version=g,y.depsTail=x;return}const w=p.subsTail;if(w!==void 0&&w.version===g&&w.sub===y)return;const k=y.depsTail=p.subsTail={version:g,dep:p,sub:y,prevDep:v,nextDep:x,prevSub:w,nextSub:void 0};x!==void 0&&(x.prevDep=k),v!==void 0?v.nextDep=k:y.deps=k,w!==void 0?w.nextSub=k:p.subs=k}function i(p,y=p.sub){const g=p.dep,v=p.prevDep,x=p.nextDep,w=p.nextSub,k=p.prevSub;return x!==void 0?x.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=x:y.deps=x,w!==void 0?w.prevSub=k:g.subsTail=k,k!==void 0?k.nextSub=w:(g.subs=w)===void 0&&n(g),x}function c(p){let y=p.nextSub,g;e:do{const v=p.sub;let x=v.flags;if(x&60?x&12?x&4?!(x&48)&&h(p,v)?(v.flags=x|40,x&=1):x=0:v.flags=x&-9|32:x=0:v.flags=x|32,x&2&&t(v),x&1){const w=v.subs;if(w!==void 0){const k=(p=w).nextSub;k!==void 0&&(g={value:y,prev:g},y=k);continue}}if((p=y)!==void 0){y=p.nextSub;continue}for(;g!==void 0;)if(p=g.value,g=g.prev,p!==void 0){y=p.nextSub;continue e}break}while(!0)}function l(p,y){let g,v=0,x=!1;e:do{const w=p.dep,k=w.flags;if(y.flags&16)x=!0;else if((k&17)===17){if(e(w)){const P=w.subs;P.nextSub!==void 0&&d(P),x=!0}}else if((k&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(g={value:p,prev:g}),p=w.deps,y=w,++v;continue}if(!x){const P=p.nextDep;if(P!==void 0){p=P;continue}}for(;v--;){const P=y.subs,q=P.nextSub!==void 0;if(q?(p=g.value,g=g.prev):p=P,x){if(e(y)){q&&d(P),y=p.sub;continue}x=!1}else y.flags&=-33;y=p.sub;const _=p.nextDep;if(_!==void 0){p=_;continue e}}return x}while(!0)}function d(p){do{const y=p.sub,g=y.flags;(g&48)===32&&(y.flags=g|16,(g&6)===2&&t(y))}while((p=p.nextSub)!==void 0)}function h(p,y){let g=y.depsTail;for(;g!==void 0;){if(g===p)return!0;g=g.prevDep}return!1}}function UP(e,t,n){var c,l,d;const o=typeof e=="object",i=o?e:void 0;return{next:(c=o?e.next:e)==null?void 0:c.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 pm=[];let Vu=0;const{link:uS,unlink:BP,propagate:zP,checkDirty:Qw,shallowPropagate:lS}=$P({update(e){return e._update()},notify(e){pm[gm++]=e,e.flags&=~tt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=tt.Mutable|tt.Dirty,il(e))}});let Ru=0,gm=0,Sr,ym=0;function Jw(e){try{++ym,e()}finally{--ym||Gw()}}function il(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=BP(n,e)}function Gw(){if(!(ym>0)){for(;Ru<gm;){const e=pm[Ru];pm[Ru++]=void 0,e.notify()}Ru=0,gm=0}}function fS(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?tt.None:tt.Mutable,get(){return Sr!==void 0&&uS(i,Sr,Vu),i._snapshot},subscribe(c){const l=UP(c),d={current:!1},h=VP(()=>{var p;i.get(),d.current?(p=l.next)==null||p.call(l,i._snapshot):d.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(c){const l=Sr,d=(t==null?void 0:t.compare)??Object.is;if(n)Sr=i,++Vu,i.depsTail=void 0;else if(c===void 0)return!1;n&&(i.flags=tt.Mutable|tt.RecursedCheck);try{const h=i._snapshot,p=typeof c=="function"?c(h):c===void 0&&n?o(h):c;return h===void 0||!d(h,p)?(i._snapshot=p,!0):!1}finally{Sr=l,n&&(i.flags&=~tt.RecursedCheck),il(i)}}};return n?(i.flags=tt.Mutable|tt.Dirty,i.get=function(){const c=i.flags;if(c&tt.Dirty||c&tt.Pending&&Qw(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&lS(l)}}else c&tt.Pending&&(i.flags=c&~tt.Pending);return Sr!==void 0&&uS(i,Sr,Vu),i._snapshot}):i.set=function(c){if(i._update(c)){const l=i.subs;l!==void 0&&(zP(l),lS(l),Gw())}},i}function VP(e){const t=()=>{const o=Sr;Sr=n,++Vu,n.depsTail=void 0,n.flags=tt.Watching|tt.RecursedCheck;try{return e()}finally{Sr=o,n.flags&=~tt.RecursedCheck,il(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:tt.Watching|tt.RecursedCheck,notify(){const o=this.flags;o&tt.Dirty||o&tt.Pending&&Qw(this.deps,this)?t():this.flags=tt.Watching},stop(){this.flags=tt.None,this.depsTail=void 0,il(this)}};return t(),n}var Ch={exports:{}},bh={},Ph={exports:{}},Fh={};/**
|
|
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 dS;function qP(){if(dS)return Fh;dS=1;var e=Ya();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,i=e.useEffect,c=e.useLayoutEffect,l=e.useDebugValue;function d(g,v){var x=v(),w=o({inst:{value:x,getSnapshot:v}}),k=w[0].inst,P=w[1];return c(function(){k.value=x,k.getSnapshot=v,h(k)&&P({inst:k})},[g,x,v]),i(function(){return h(k)&&P({inst:k}),g(function(){h(k)&&P({inst:k})})},[g]),l(x),x}function h(g){var v=g.getSnapshot;g=g.value;try{var x=v();return!n(g,x)}catch{return!0}}function p(g,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Fh}var hS;function WP(){return hS||(hS=1,Ph.exports=qP()),Ph.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 mS;function HP(){if(mS)return bh;mS=1;var e=Ya(),t=WP();function n(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,c=e.useRef,l=e.useEffect,d=e.useMemo,h=e.useDebugValue;return bh.useSyncExternalStoreWithSelector=function(p,y,g,v,x){var w=c(null);if(w.current===null){var k={hasValue:!1,value:null};w.current=k}else k=w.current;w=d(function(){function q(U){if(!_){if(_=!0,A=U,U=v(U),x!==void 0&&k.hasValue){var O=k.value;if(x(O,U))return C=O}return C=U}if(O=C,o(A,U))return O;var T=v(U);return x!==void 0&&x(O,T)?(A=U,O):(A=U,C=T)}var _=!1,A,C,D=g===void 0?null:g;return[function(){return q(y())},D===null?void 0:function(){return q(D())}]},[y,g,v,x]);var P=i(p,w[0],w[1]);return l(function(){k.hasValue=!0,k.value=P},[P]),h(P),P},bh}var pS;function KP(){return pS||(pS=1,Ch.exports=HP()),Ch.exports}var QP=KP();function JP(e,t){return e===t}function tn(e,t,n=JP){const o=X.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:d}=e.subscribe(l);return d},[e]),i=X.useCallback(()=>e==null?void 0:e.get(),[e]);return QP.useSyncExternalStoreWithSelector(o,i,i,t,n)}var Ih={get(){},subscribe(){return{unsubscribe(){}}}};function Yw(e,t){const n=X.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=to(n.current,i):i}}function yo(e){const t=Mn(),n=X.useContext(e.from?jP:Dl),o=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Yw(e,t),c=tn(o??Ih,l=>l?i(l):Ih);if(c!==Ih)return c;(e.shouldThrow??!0)&&qr()}function Xw(e){return yo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Zw(e){const{select:t,...n}=e;return yo({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function e1(e){return yo({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 t1(e){return yo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Sp(e){const t=Mn();return X.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function n1(e){return yo({...e,select:t=>e.select?e.select(t.context):t.context})}var GP=Cw();function YP(e,t){const n=Mn(),o=L2(t),{activeProps:i,inactiveProps:c,activeOptions:l,to:d,preload:h,preloadDelay:p,preloadIntentProximity:y,hashScrollIntoView:g,replace:v,startTransition:x,resetScroll:w,viewTransition:k,children:P,target:q,disabled:_,style:A,className:C,onClick:D,onBlur:U,onFocus:O,onMouseEnter:T,onMouseLeave:V,onTouchStart:ee,ignoreBlocker:ne,params:K,search:E,hash:$,state:W,mask:J,reloadDocument:B,unsafeRelative:G,from:re,_fromLocation:te,...I}=e,Z=Hw(),me=X.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),pe=tn(n.stores.location,ze=>ze,(ze,Lt)=>ze.href===Lt.href),fe=X.useMemo(()=>{const ze={_fromLocation:pe,...me};return n.buildLocation(ze)},[n,pe,me]),Pe=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,Le=fe.maskedLocation?fe.maskedLocation.external:fe.external,Ce=X.useMemo(()=>rF(Pe,Le,n.history,_),[_,Le,Pe,n.history]),ue=X.useMemo(()=>{if(Ce!=null&&Ce.external)return rl(Ce.href,n.protocolAllowlist)?void 0:Ce.href;if(!sF(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),rl(d,n.protocolAllowlist)?void 0:d}catch{}},[d,Ce,n.protocolAllowlist]),$e=X.useMemo(()=>{if(ue)return!1;if(l!=null&&l.exact){if(!Y2(pe.pathname,fe.pathname,n.basepath))return!1}else{const ze=sl(pe.pathname,n.basepath),Lt=sl(fe.pathname,n.basepath);if(!(ze.startsWith(Lt)&&(ze.length===Lt.length||ze[Lt.length]==="/")))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!so(pe.search,fe.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndefined)})?!1:l!=null&&l.includeHash?Z&&pe.hash===fe.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,pe,ue,Z,fe.hash,fe.pathname,fe.search,n.basepath]),Yt=$e?eo(i,{})??XP:Rh,an=$e?Rh:eo(c,{})??Rh,An=[C,Yt.className,an.className].filter(Boolean).join(" "),Ln=(A||Yt.style||an.style)&&{...A,...Yt.style,...an.style},[_o,Os]=X.useState(!1),Co=X.useRef(!1),Rr=e.reloadDocument||ue?!1:h??n.options.defaultPreload,Ns=p??n.options.defaultPreloadDelay??0,wn=X.useCallback(()=>{n.preloadRoute({...me,_builtLocation:fe}).catch(ze=>{console.warn(ze),console.warn(AP)})},[n,me,fe]);A2(o,X.useCallback(ze=>{ze!=null&&ze.isIntersecting&&wn()},[wn]),nF,{disabled:!!_||Rr!=="viewport"}),X.useEffect(()=>{Co.current||!_&&Rr==="render"&&(wn(),Co.current=!0)},[_,wn,Rr]);const Qr=ze=>{const Lt=ze.currentTarget.getAttribute("target"),Jn=q!==void 0?q:Lt;if(!_&&!oF(ze)&&!ze.defaultPrevented&&(!Jn||Jn==="_self")&&ze.button===0){ze.preventDefault(),GP.flushSync(()=>{Os(!0)});const Po=n.subscribe("onResolved",()=>{Po(),Os(!1)});n.navigate({...me,replace:v,resetScroll:w,hashScrollIntoView:g,startTransition:x,viewTransition:k,ignoreBlocker:ne})}};if(ue)return{...I,ref:o,href:ue,...P&&{children:P},...q&&{target:q},..._&&{disabled:_},...A&&{style:A},...C&&{className:C},...D&&{onClick:D},...U&&{onBlur:U},...O&&{onFocus:O},...T&&{onMouseEnter:T},...V&&{onMouseLeave:V},...ee&&{onTouchStart:ee}};const bo=ze=>{if(_||Rr!=="intent")return;if(!Ns){wn();return}const Lt=ze.currentTarget;if(pa.has(Lt))return;const Jn=setTimeout(()=>{pa.delete(Lt),wn()},Ns);pa.set(Lt,Jn)},vc=ze=>{_||Rr!=="intent"||wn()},Pi=ze=>{if(_||!Rr||!Ns)return;const Lt=ze.currentTarget,Jn=pa.get(Lt);Jn&&(clearTimeout(Jn),pa.delete(Lt))};return{...I,...Yt,...an,href:Ce==null?void 0:Ce.href,ref:o,onClick:Xo([D,Qr]),onBlur:Xo([U,Pi]),onFocus:Xo([O,bo]),onMouseEnter:Xo([T,bo]),onMouseLeave:Xo([V,Pi]),onTouchStart:Xo([ee,vc]),disabled:!!_,target:q,...Ln&&{style:Ln},...An&&{className:An},..._&&ZP,...$e&&eF,...Z&&_o&&tF}}var Rh={},XP={className:"active"},ZP={role:"link","aria-disabled":!0},eF={"data-status":"active","aria-current":"page"},tF={"data-transitioning":"transitioning"},pa=new WeakMap,nF={rootMargin:"100px"},Xo=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function rF(e,t,n,o){if(!o)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function sF(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var xp=X.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:i,...c}=YP(o,t),l=typeof o.children=="function"?o.children({isActive:c["data-status"]==="active"}):o.children;if(!n){const{disabled:d,...h}=c;return X.createElement("a",h,l)}return X.createElement(n,c,l)});function oF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var iF=class extends Ww{constructor(e){super(e),this.useMatch=t=>yo({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>n1({...t,from:this.id}),this.useSearch=t=>t1({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>e1({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Zw({...t,from:this.id}),this.useLoaderData=t=>Xw({...t,from:this.id}),this.useNavigate=()=>Sp({from:this.fullPath}),this.Link=Ma.forwardRef((t,n)=>F.jsx(xp,{ref:n,from:this.fullPath,...t}))}};function qu(e){return new iF(e)}var aF=class extends LP{constructor(e){super(e),this.useMatch=t=>yo({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>n1({...t,from:this.id}),this.useSearch=t=>t1({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>e1({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Zw({...t,from:this.id}),this.useLoaderData=t=>Xw({...t,from:this.id}),this.useNavigate=()=>Sp({from:this.fullPath}),this.Link=Ma.forwardRef((t,n)=>F.jsx(xp,{ref:n,from:this.fullPath,...t}))}};function cF(e){return new aF(e)}function uF(e){const t=Mn(),n=`not-found-${tn(t.stores.location,o=>o.pathname)}-${tn(t.stores.status,o=>o)}`;return F.jsx(yp,{getResetKey:()=>n,onCatch:(o,i)=>{var c;if(Kt(o))(c=e.onCatch)==null||c.call(e,o,i);else throw o},errorComponent:({error:o})=>{var i;if(Kt(o))return(i=e.fallback)==null?void 0:i.call(e,o);throw o},children:e.children})}function lF(){return F.jsx("p",{children:"Not Found"})}function ri(e){return F.jsx(F.Fragment,{children:e.children})}function r1(e,t,n){return t.options.notFoundComponent?F.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?F.jsx(e.options.defaultNotFoundComponent,{...n}):F.jsx(lF,{})}function fF(e){return null}function dF(){return fF(Mn()),null}var hF=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,mF=(e,t)=>e[0]===t[0]&&e[1]===t[1],s1=X.memo(function({matchId:t}){const n=Mn(),o=n.stores.matchStores.get(t);o||qr();const i=tn(n.stores.loadedAt,l=>l),c=tn(o,l=>l,hF);return F.jsx(pF,{router:n,matchId:t,resetKey:i,matchState:X.useMemo(()=>{var h;const l=c.routeId,d=(h=n.routesById[l].parentRoute)==null?void 0:h.id;return{routeId:l,ssr:c.ssr,_displayPending:c._displayPending,parentRouteId:d}},[c._displayPending,c.routeId,c.ssr,n.routesById])})});function pF({router:e,matchId:t,resetKey:n,matchState:o}){var w,k;const i=e.routesById[o.routeId],c=i.options.pendingComponent??e.options.defaultPendingComponent,l=c?F.jsx(c,{}):null,d=i.options.errorComponent??e.options.defaultErrorComponent,h=i.options.onCatch??e.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??((w=e.options.notFoundRoute)==null?void 0:w.options.component):i.options.notFoundComponent,y=o.ssr===!1||o.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??c??(((k=i.options.errorComponent)==null?void 0:k.preload)||y))?X.Suspense:ri,v=d?yp:ri,x=p?uF:ri;return F.jsxs(i.isRoot?i.options.shellComponent??ri:ri,{children:[F.jsx(Dl.Provider,{value:t,children:F.jsx(g,{fallback:l,children:F.jsx(v,{getResetKey:()=>n,errorComponent:d||vp,onCatch:(P,q)=>{if(Kt(P))throw P.routeId??(P.routeId=o.routeId),P;h==null||h(P,q)},children:F.jsx(x,{fallback:P=>{if(P.routeId??(P.routeId=o.routeId),!p||P.routeId&&P.routeId!==o.routeId||!P.routeId&&!i.isRoot)throw P;return X.createElement(p,P)},children:y||o._displayPending?F.jsx(NP,{fallback:l,children:F.jsx(gS,{matchId:t})}):F.jsx(gS,{matchId:t})})})})}),o.parentRouteId===oo?F.jsxs(F.Fragment,{children:[F.jsx(gF,{}),e.options.scrollRestoration&&Rw?F.jsx(dF,{}):null]}):null]})}function gF(){const e=Mn(),t=X.useRef();return xa(()=>{const n=e.stores.resolvedLocation.get(),o=t.current;n&&(!o||o.href!==n.href)&&e.emit({type:"onRendered",...ii(e.stores.location.get(),o??n)}),t.current=n},[tn(e.stores.resolvedLocation,n=>n==null?void 0:n.state.__TSR_key),e]),null}var gS=X.memo(function({matchId:t}){const n=Mn(),o=(y,g)=>{var v;return((v=n.getMatch(y.id))==null?void 0:v._nonReactive[g])??y._nonReactive[g]},i=n.stores.matchStores.get(t);i||qr();const c=tn(i,y=>y),l=c.routeId,d=n.routesById[l],h=X.useMemo(()=>{var g;const y=(g=n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:g({routeId:l,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return y?JSON.stringify(y):void 0},[l,c.loaderDeps,c._strictParams,c._strictSearch,n.options.defaultRemountDeps,n.routesById]),p=X.useMemo(()=>{const y=d.options.component??n.options.defaultComponent;return y?F.jsx(y,{},h):F.jsx(o1,{})},[h,d.options.component,n.options.defaultComponent]);if(c._displayPending)throw o(c,"displayPendingPromise");if(c._forcePending)throw o(c,"minPendingPromise");if(c.status==="pending"){const y=d.options.pendingMinMs??n.options.defaultPendingMinMs;if(y){const g=n.getMatch(c.id);if(g&&!g._nonReactive.minPendingPromise){const v=fi();g._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),g._nonReactive.minPendingPromise=void 0},y)}}throw o(c,"loadPromise")}if(c.status==="notFound")return Kt(c.error)||qr(),r1(n,d,c.error);if(c.status==="redirected")throw pn(c.error)||qr(),o(c,"loadPromise");if(c.status==="error")throw c.error;return p}),o1=X.memo(function(){const t=Mn(),n=X.useContext(Dl);let o,i=!1,c;{const p=n?t.stores.matchStores.get(n):void 0;[o,i]=tn(p,y=>[y==null?void 0:y.routeId,(y==null?void 0:y.globalNotFound)??!1],mF),c=tn(t.stores.matchesId,y=>y[y.findIndex(g=>g===n)+1])}const l=o?t.routesById[o]:void 0,d=t.options.defaultPendingComponent?F.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||qr(),r1(t,l,void 0);if(!c)return null;const h=F.jsx(s1,{matchId:c});return o===oo?F.jsx(X.Suspense,{fallback:d,children:h}):h});function yF(){const e=Mn(),t=X.useRef({router:e,mounted:!1}),[n,o]=X.useState(!1),i=tn(e.stores.isLoading,g=>g),c=tn(e.stores.hasPending,g=>g),l=vh(i),d=i||n||c,h=vh(d),p=i||c,y=vh(p);return e.startTransition=g=>{o(!0),X.startTransition(()=>{g(),o(!1)})},X.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return zr(e.latestLocation.publicHref)!==zr(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),xa(()=>{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]),xa(()=>{l&&!i&&e.emit({type:"onLoad",...ii(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),xa(()=>{y&&!p&&e.emit({type:"onBeforeRouteMount",...ii(e.stores.location.get(),e.stores.resolvedLocation.get())})},[p,y,e]),xa(()=>{if(h&&!d){const g=ii(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...g}),Jw(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[d,h,e]),null}function vF(){const e=Mn(),t=e.routesById[oo].options.pendingComponent??e.options.defaultPendingComponent,n=t?F.jsx(t,{}):null,o=F.jsxs(typeof document<"u"&&e.ssr?ri:X.Suspense,{fallback:n,children:[F.jsx(yF,{}),F.jsx(SF,{})]});return e.options.InnerWrap?F.jsx(e.options.InnerWrap,{children:o}):o}function SF(){const e=Mn(),t=tn(e.stores.firstId,i=>i),n=tn(e.stores.loadedAt,i=>i),o=t?F.jsx(s1,{matchId:t}):null;return F.jsx(Dl.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:F.jsx(yp,{getResetKey:()=>n,errorComponent:vp,onCatch:void 0,children:o})})}var xF=e=>({createMutableStore:fS,createReadonlyStore:fS,batch:Jw}),wF=e=>new kF(e),kF=class extends SP{constructor(e){super(e,xF)}};function EF({router:e,children:t,...n}){Mw(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=F.jsx(Kw.Provider,{value:e,children:t});return e.options.Wrap?F.jsx(e.options.Wrap,{children:o}):o}function _F({router:e,...t}){return F.jsx(EF,{router:e,...t,children:F.jsx(vF,{})})}function CF(e){const t=Mn({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t;return tn(n.stores.__store,Yw(e,n))}const bF=e=>Math.max(0,Math.min(100,e));function M$(e){return e===null||!Number.isFinite(e)?null:bF(100-e)}function A$(e){return e===null||!Number.isFinite(e)?"unknown":e<=10?"crit":e<=25?"warn":"ok"}function PF(e,t){const n=e.identity;return n?[n.title,n.subtitle].filter(i=>!!(i!=null&&i.trim())).filter((i,c,l)=>l.indexOf(i)===c).filter(i=>i.toLocaleLowerCase()!==t.toLocaleLowerCase()).join(" · ")||n.title||t:e.name||t}const wp=["claude","codex","cursor","copilot","pi","opencode","antigravity","gemini","grok"],kp=["vscode","monokai","dracula","github","nord","one-dark-pro","solarized","tokyo-night","catppuccin","midnight","forest","sunset","cyberpunk","synthwave","luxury","minimal"],vm={vscode:{name:"VS Code",light:{name:"Light+",primary:"#007ACC",background:"#FFFFFF",foreground:"#333333",card:"#F3F3F3",cardForeground:"#1E1E1E",border:"#E5E5E5",accent:"#0066BF",accentForeground:"#FFFFFF",muted:"#F6F6F6",mutedForeground:"#6E6E6E"},dark:{name:"Dark+",primary:"#007ACC",background:"#1E1E1E",foreground:"#CCCCCC",card:"#252526",cardForeground:"#CCCCCC",border:"#3E3E42",accent:"#0E639C",accentForeground:"#FFFFFF",muted:"#2D2D30",mutedForeground:"#858585"}},monokai:{name:"Monokai",light:{name:"Monokai Light",primary:"#A6E22E",background:"#F8F8F2",foreground:"#272822",card:"#E6E6E0",cardForeground:"#272822",border:"#C4C4B8",accent:"#66D9EF",accentForeground:"#272822",muted:"#E6E6E0",mutedForeground:"#75715E"},dark:{name:"Monokai",primary:"#A6E22E",background:"#272822",foreground:"#F8F8F2",card:"#3E3D32",cardForeground:"#F8F8F2",border:"#75715E",accent:"#66D9EF",accentForeground:"#272822",muted:"#49483E",mutedForeground:"#75715E"}},dracula:{name:"Dracula",light:{name:"Dracula Light",primary:"#BD93F9",background:"#F8F8F2",foreground:"#282A36",card:"#E6E6E0",cardForeground:"#282A36",border:"#C4C4B8",accent:"#FF79C6",accentForeground:"#282A36",muted:"#E6E6E0",mutedForeground:"#6272A4"},dark:{name:"Dracula",primary:"#BD93F9",background:"#282A36",foreground:"#F8F8F2",card:"#343746",cardForeground:"#F8F8F2",border:"#44475A",accent:"#FF79C6",accentForeground:"#282A36",muted:"#44475A",mutedForeground:"#6272A4"}},github:{name:"GitHub",light:{name:"GitHub Light",primary:"#0969DA",background:"#FFFFFF",foreground:"#24292F",card:"#F6F8FA",cardForeground:"#24292F",border:"#D0D7DE",accent:"#0969DA",accentForeground:"#FFFFFF",muted:"#F6F8FA",mutedForeground:"#57606A"},dark:{name:"GitHub Dark",primary:"#58A6FF",background:"#0D1117",foreground:"#C9D1D9",card:"#161B22",cardForeground:"#C9D1D9",border:"#30363D",accent:"#1F6FEB",accentForeground:"#FFFFFF",muted:"#161B22",mutedForeground:"#8B949E"}},nord:{name:"Nord",light:{name:"Nord Light",primary:"#5E81AC",background:"#ECEFF4",foreground:"#2E3440",card:"#E5E9F0",cardForeground:"#2E3440",border:"#D8DEE9",accent:"#88C0D0",accentForeground:"#2E3440",muted:"#E5E9F0",mutedForeground:"#4C566A"},dark:{name:"Nord",primary:"#88C0D0",background:"#2E3440",foreground:"#D8DEE9",card:"#3B4252",cardForeground:"#E5E9F0",border:"#434C5E",accent:"#5E81AC",accentForeground:"#ECEFF4",muted:"#434C5E",mutedForeground:"#88C0D0"}},"one-dark-pro":{name:"One Dark Pro",light:{name:"One Light Pro",primary:"#528BFF",background:"#FAFAFA",foreground:"#383A42",card:"#F0F0F0",cardForeground:"#383A42",border:"#E0E0E0",accent:"#61AFEF",accentForeground:"#FAFAFA",muted:"#F0F0F0",mutedForeground:"#5C6370"},dark:{name:"One Dark Pro",primary:"#61AFEF",background:"#282C34",foreground:"#ABB2BF",card:"#2C313C",cardForeground:"#ABB2BF",border:"#3E4451",accent:"#528BFF",accentForeground:"#FFFFFF",muted:"#3E4451",mutedForeground:"#5C6370"}},solarized:{name:"Solarized",light:{name:"Solarized Light",primary:"#268BD2",background:"#FDF6E3",foreground:"#657B83",card:"#EEE8D5",cardForeground:"#586E75",border:"#93A1A1",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#FDF6E3",mutedForeground:"#839496"},dark:{name:"Solarized Dark",primary:"#268BD2",background:"#002B36",foreground:"#839496",card:"#073642",cardForeground:"#93A1A1",border:"#586E75",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#073642",mutedForeground:"#657B83"}},"tokyo-night":{name:"Tokyo Night",light:{name:"Tokyo Night Day",primary:"#2E7DE9",background:"#E1E2E7",foreground:"#343B58",card:"#D5D6DB",cardForeground:"#343B58",border:"#9699A3",accent:"#7AA2F7",accentForeground:"#343B58",muted:"#D5D6DB",mutedForeground:"#565F89"},dark:{name:"Tokyo Night",primary:"#7AA2F7",background:"#1A1B26",foreground:"#C0CAF5",card:"#24283B",cardForeground:"#C0CAF5",border:"#414868",accent:"#BB9AF7",accentForeground:"#1A1B26",muted:"#2F3549",mutedForeground:"#565F89"}},catppuccin:{name:"Catppuccin",light:{name:"Catppuccin Latte",primary:"#1E66F5",background:"#EFF1F5",foreground:"#4C4F69",card:"#E6E9EF",cardForeground:"#4C4F69",border:"#BCC0CC",accent:"#EA76CB",accentForeground:"#EFF1F5",muted:"#E6E9EF",mutedForeground:"#6C6F85"},dark:{name:"Catppuccin Mocha",primary:"#89B4FA",background:"#1E1E2E",foreground:"#CDD6F4",card:"#313244",cardForeground:"#CDD6F4",border:"#45475A",accent:"#F38BA8",accentForeground:"#1E1E2E",muted:"#313244",mutedForeground:"#6C7086"}},midnight:{name:"Midnight",light:{name:"Midnight Light",primary:"#3B82F6",background:"#F8FAFC",foreground:"#0F172A",card:"#E2E8F0",cardForeground:"#0F172A",border:"#CBD5E1",accent:"#1D4ED8",accentForeground:"#F8FAFC",muted:"#E2E8F0",mutedForeground:"#64748B"},dark:{name:"Midnight",primary:"#3B82F6",background:"#0F172A",foreground:"#F8FAFC",card:"#1E293B",cardForeground:"#F8FAFC",border:"#334155",accent:"#1D4ED8",accentForeground:"#FFFFFF",muted:"#1E293B",mutedForeground:"#94A3B8"}},forest:{name:"Forest",light:{name:"Forest Light",primary:"#22C55E",background:"#F0FDF4",foreground:"#052E16",card:"#DCFCE7",cardForeground:"#052E16",border:"#BBF7D0",accent:"#15803D",accentForeground:"#F0FDF4",muted:"#DCFCE7",mutedForeground:"#166534"},dark:{name:"Forest",primary:"#22C55E",background:"#052E16",foreground:"#DCFCE7",card:"#14532D",cardForeground:"#DCFCE7",border:"#166534",accent:"#15803D",accentForeground:"#FFFFFF",muted:"#14532D",mutedForeground:"#86EFAC"}},sunset:{name:"Sunset",light:{name:"Sunset Light",primary:"#F97316",background:"#FFF7ED",foreground:"#431407",card:"#FFEDD5",cardForeground:"#431407",border:"#FED7AA",accent:"#EA580C",accentForeground:"#FFF7ED",muted:"#FFEDD5",mutedForeground:"#9A3412"},dark:{name:"Sunset",primary:"#F97316",background:"#431407",foreground:"#FFEDD5",card:"#7C2D12",cardForeground:"#FFEDD5",border:"#9A3412",accent:"#EA580C",accentForeground:"#FFFFFF",muted:"#7C2D12",mutedForeground:"#FDBA74"}},cyberpunk:{name:"Cyberpunk",light:{name:"Cyberpunk Light",primary:"#F472B6",background:"#FFFFFF",foreground:"#000000",card:"#F3F4F6",cardForeground:"#000000",border:"#E5E7EB",accent:"#E879F9",accentForeground:"#000000",muted:"#F3F4F6",mutedForeground:"#22D3EE"},dark:{name:"Cyberpunk",primary:"#F472B6",background:"#000000",foreground:"#22D3EE",card:"#111111",cardForeground:"#E879F9",border:"#F472B6",accent:"#FFFF00",accentForeground:"#000000",muted:"#111111",mutedForeground:"#22D3EE"}},synthwave:{name:"Synthwave",light:{name:"Synthwave Light",primary:"#D946EF",background:"#FAF5FF",foreground:"#2A0A3B",card:"#F3E8FF",cardForeground:"#2A0A3B",border:"#E9D5FF",accent:"#06B6D4",accentForeground:"#FAF5FF",muted:"#F3E8FF",mutedForeground:"#C026D3"},dark:{name:"Synthwave",primary:"#D946EF",background:"#2A0A3B",foreground:"#F5D0FE",card:"#4A1D66",cardForeground:"#F5D0FE",border:"#C026D3",accent:"#06B6D4",accentForeground:"#FFFFFF",muted:"#4A1D66",mutedForeground:"#E879F9"}},luxury:{name:"Luxury",light:{name:"Luxury Light",primary:"#D4AF37",background:"#FAFAF9",foreground:"#1C1917",card:"#F5F5F4",cardForeground:"#1C1917",border:"#E7E5E4",accent:"#B45309",accentForeground:"#FAFAF9",muted:"#F5F5F4",mutedForeground:"#78716C"},dark:{name:"Luxury",primary:"#D4AF37",background:"#1C1917",foreground:"#E7E5E4",card:"#292524",cardForeground:"#D4AF37",border:"#78716C",accent:"#B45309",accentForeground:"#FFFFFF",muted:"#292524",mutedForeground:"#A8A29E"}},minimal:{name:"Minimal",light:{name:"Minimal",primary:"#18181B",background:"#FFFFFF",foreground:"#18181B",card:"#FFFFFF",cardForeground:"#18181B",border:"#E4E4E7",accent:"#F4F4F5",accentForeground:"#18181B",muted:"#FAFAFA",mutedForeground:"#71717A"},dark:{name:"Minimal Dark",primary:"#FAFAFA",background:"#18181B",foreground:"#FAFAFA",card:"#27272A",cardForeground:"#FAFAFA",border:"#3F3F46",accent:"#27272A",accentForeground:"#FAFAFA",muted:"#27272A",mutedForeground:"#A1A1AA"}}},Ep=["tokmon","phosphor",...kp],i1=[...Ep,"custom"],FF={vscode:"VS Code Light+ and Dark+",monokai:"Classic editor green and cyan",dracula:"Purple and pink on deep slate",github:"GitHub light and dark",nord:"Arctic blue-gray palette","one-dark-pro":"Atom-inspired editor palette",solarized:"Precision blue and teal","tokyo-night":"Cool blue and violet",catppuccin:"Latte and Mocha palettes",midnight:"Deep navy and bright blue",forest:"Natural green surfaces",sunset:"Warm orange and earth tones",cyberpunk:"Neon cyan, pink, and yellow",synthwave:"Purple and electric cyan",luxury:"Gold on warm neutrals",minimal:"High-contrast monochrome"},yS=[{id:"tokmon",name:"Tokmon",hint:"Calm system utility",darkOnly:!1,custom:!1},{id:"phosphor",name:"Phosphor",hint:"Black terminal green",darkOnly:!0,custom:!1},...kp.map(e=>({id:e,name:vm[e].name,hint:FF[e],darkOnly:!1,custom:!1})),{id:"custom",name:"Custom",hint:"Your shared palette",darkOnly:!1,custom:!0}];function IF(e){return typeof e=="string"&&i1.includes(e)}function RF(e){return typeof e=="string"&&Ep.includes(e)}function TF(e){return yS.find(t=>t.id===e)??yS[0]}function a1(e){return TF(e).darkOnly}const MF=["canvas","panel","inset","insetStrong","chrome","line","lineStrong","lineFaint","text","textDim","textFaint","textStrong","accent","cost","positive"],ci=Object.freeze({version:1,mode:"auto",preset:"tokmon",terminal:"ansi"}),c1={canvas:"#0a0a0a",panel:"#101011",inset:"#161617",insetStrong:"#1d1d1e",chrome:"#1e1f22",line:"#262627",lineStrong:"#343435",lineFaint:"#1a1a1b",text:"#d4d6d6",textDim:"#8d9090",textFaint:"#585b5b",textStrong:"#f3f5f5",accent:"#79be7e",cost:"#d9c074",positive:"#6caa71",ok:"#79be7e",warn:"#e0b84c",crit:"#e5584b",unknown:"#8d9090"},u1={canvas:"#f4f5f5",panel:"#ffffff",inset:"#eceeee",insetStrong:"#e1e4e4",chrome:"#f4f5f5",line:"#d4d9d9",lineStrong:"#bcc2c2",lineFaint:"#e7eaea",text:"#2b2e2e",textDim:"#5a6060",textFaint:"#979d9d",textStrong:"#0d1010",accent:"#2f8f57",cost:"#9a7b1c",positive:"#2f8f57",ok:"#2f8f57",warn:"#9a7b1c",crit:"#b0403a",unknown:"#5a6060"},AF={canvas:"#000000",panel:"#050705",inset:"#0a0f0b",insetStrong:"#101710",chrome:"#070b08",line:"#1a2a1e",lineStrong:"#2c4634",lineFaint:"#101812",text:"#c6f7d3",textDim:"#7fc98d",textFaint:"#4c7d57",textStrong:"#eafff0",accent:"#35f38a",cost:"#ffd24a",positive:"#35f38a",ok:"#35f38a",warn:"#ffc44d",crit:"#ff6b5b",unknown:"#7fc98d"},LF={canvas:"#f3f5f0",panel:"#ffffff",inset:"#e8ede7",insetStrong:"#dce5dc",chrome:"#f3f5f0",line:"#cad7ca",lineStrong:"#a9bca9",lineFaint:"#e4ebe4",text:"#0b2610",textDim:"#426b49",textFaint:"#748c78",textStrong:"#031507",accent:"#128a2e",cost:"#826500",positive:"#128a2e",ok:"#128a2e",warn:"#826500",crit:"#b23a32",unknown:"#5c705f"},OF=/^#[0-9a-f]{6}$/i;function sr(e){return typeof e=="string"&&OF.test(e)?e.toLowerCase():null}function Sm(e){return[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)]}function Th(e){return Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0")}function Vr(e,t,n){const[o,i,c]=Sm(e),[l,d,h]=Sm(t),p=Math.max(0,Math.min(1,n));return`#${Th(o+(l-o)*p)}${Th(i+(d-i)*p)}${Th(c+(h-c)*p)}`}function vS(e){const t=sr(e);if(!t)throw new TypeError("expected a #RRGGBB color");const n=Sm(t).map(o=>{const i=o/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n[0]+.7152*n[1]+.0722*n[2]}function ro(e,t){const n=vS(e),o=vS(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function $r(e,t,n,o){const i=sr(e);if(t.every(h=>ro(i,h)>=n))return i;const c=[o,"#000000","#ffffff"].reduce((h,p)=>Math.min(...t.map(y=>ro(p,y)))>Math.min(...t.map(y=>ro(h,y)))?p:h);let l=0,d=1;for(let h=0;h<16;h++){const p=(l+d)/2,y=Vr(i,c,p);t.every(g=>ro(y,g)>=n)?d=p:l=p}return Vr(i,c,d)}function SS(e,t){const n=sr(e.background),o=sr(e.card),i=sr(e.foreground),c=t==="dark"?"#ffffff":"#000000",l=$r(i,[n,o],4.5,c),d=$r(e.cardForeground,[n,o],4.5,c),h=$r(e.mutedForeground,[n],3,l),p=$r(e.primary,[n,o],3,l),y=$r(e.accent,[o],3,l),g=$r(e.primary,[o],3,l),v=t==="dark"?c1:u1;return{canvas:n,panel:o,inset:sr(e.muted),insetStrong:Vr(e.muted,e.foreground,.08),chrome:n,line:sr(e.border),lineStrong:Vr(e.border,e.foreground,.18),lineFaint:Vr(e.background,e.border,.5),text:l,textDim:h,textFaint:sr(e.mutedForeground),textStrong:d,accent:p,cost:y,positive:g,ok:$r(v.ok,[o],3,l),warn:$r(v.warn,[o],3,l),crit:$r(v.crit,[o],3,l),unknown:h}}const NF=Object.fromEntries(kp.map(e=>[e,{light:SS(vm[e].light,"light"),dark:SS(vm[e].dark,"dark")}])),xm={tokmon:{light:u1,dark:c1},phosphor:{light:LF,dark:AF},...NF},DF=[["text","canvas",4.5],["text","panel",4.5],["textStrong","canvas",4.5],["textStrong","panel",4.5],["textDim","canvas",3],["accent","canvas",3],["accent","panel",3],["cost","panel",3],["positive","panel",3],["ok","panel",3],["warn","panel",3],["crit","panel",3]];function l1(e){return DF.flatMap(([t,n,o])=>{const i=ro(e[t],e[n]);return i+Number.EPSILON<o?[{foreground:t,background:n,minimum:o,actual:i}]:[]})}function wm(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function xS(e,t,n,o){if(!wm(e))return e!==void 0&&o.push(`custom.${t} was not an object`),{};const i={};for(const c of MF){if(!(c in e))continue;const l=sr(e[c]);l?i[c]=l:o.push(`custom.${t}.${c} was not a #RRGGBB color`)}for(;;){const c={...n,...i},l=l1(c)[0];if(!l)break;const d=l.foreground,h=l.background;if(d in i)delete i[d],o.push(`custom.${t}.${d} did not meet WCAG contrast`);else if(h in i)delete i[h],o.push(`custom.${t}.${h} did not meet WCAG contrast`);else break}return i}function f1(e){const t=[],n=wm(e)?e:{};n!==e&&e!==void 0&&t.push("appearance was not an object");const o=n.mode==="light"||n.mode==="dark"||n.mode==="auto"?n.mode:ci.mode;n.mode!==void 0&&n.mode!==o&&t.push("appearance.mode was invalid");const i=IF(n.preset)?n.preset:ci.preset;n.preset!==void 0&&n.preset!==i&&t.push("appearance.preset was invalid");const c=n.terminal==="dark"||n.terminal==="light"||n.terminal==="off"||n.terminal==="ansi"?n.terminal:ci.terminal;n.terminal!==void 0&&n.terminal!==c&&t.push("appearance.terminal was invalid"),n.version!==void 0&&n.version!==1&&t.push("appearance.version was invalid");let l;if(i==="custom"||n.custom!==void 0){const h=wm(n.custom)?n.custom:{};n.custom!==void 0&&h!==n.custom&&t.push("appearance.custom was not an object");const p=RF(h.base)?h.base:"tokmon";h.base!==void 0&&h.base!==p&&t.push("custom.base was invalid"),l={base:p,light:xS(h.light,"light",xm[p].light,t),dark:xS(h.dark,"dark",xm[p].dark,t)}}const d={version:1,mode:o,preset:i,terminal:c,...l?{custom:l}:{}};return{appearance:d,repaired:t.length>0||JSON.stringify(n)!==JSON.stringify(d),reasons:t}}function jF(e){return f1(e).appearance}function $F(e){return{...e,card:Vr(e.panel,e.text,.06),cardHover:Vr(e.panel,e.text,.1),divider:e.line,track:Vr(e.panel,e.text,.1),accentTint:Vr(e.panel,e.accent,.14),accentOn:ro(e.accent,"#000000")>=ro(e.accent,"#ffffff")?"#000000":"#ffffff",focusRing:e.accent}}function d1(e,t="dark"){var h,p;const n=jF(e),o=n.mode==="auto"?t:n.mode,i=a1(n.preset)?"dark":o,c=n.preset==="custom"?((h=n.custom)==null?void 0:h.base)??"tokmon":n.preset,l=xm[c][i],d=n.preset==="custom"?((p=n.custom)==null?void 0:p[i])??{}:{};return{mode:i,tokens:$F({...l,...d})}}const h1=[7,14,30];function UF(e,t){const n=Array.isArray(e)?e:t&&typeof t=="string"&&t.trim()?[t]:[];return al(n,2)}function al(e,t){if(!Array.isArray(e))return[];const n=new Set,o=[];for(const i of e){if(typeof i!="string")continue;const c=i.trim();if(!(!c||n.has(c))&&(n.add(c),o.push(c),o.length>=t))break}return o}const BF=2;function zF(e,t,n=Number.POSITIVE_INFINITY){return al(e.filter(o=>t.has(o)),n)}function L$(e,t,n,o=Number.POSITIVE_INFINITY){const i=zF(e,n,o);return i.includes(t)?i.filter(c=>c!==t):!n.has(t)||i.length>=o?i:[...i,t]}const rr={version:1,mode:"auto",elements:{providerMark:!0,value:!0,progress:!1},density:"comfortable",customSpacing:{edgePaddingPt:1,markValueGapPt:3,providerGapPt:8}},Dt={enabled:!0,menuBar:rr,showMenuBarText:!0,menuBarValue:"usage",displayMetric:"smartHeadroom",pollIntervalSec:30,activeTimeoutMin:10,graceMin:30,promotionHoldMin:5,lowWatermarkPct:20,criticalWatermarkPct:5,pinnedAccount:null,pins:[],pinnedProviders:[],launchAtLogin:!1,theme:"dark"},VF=32,_p={expandedProviders:[],graphRangeDays:14},Cp={enabled:!0,disabledProviders:[],excludedAccounts:[]},bn={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:[],appearance:{...ci},accountDetection:{...Cp},tray:{...Dt},desktop:{..._p}},qF=["claude","codex","cursor"],Mh=["cyan","magenta","green","yellow","blue","red"],wS=[...wp],O$=["cyan","magenta","green","yellow","blue","red","cyanBright","magentaBright","greenBright"],Tu={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"}},WF=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i,HF=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi;function KF(e){return typeof e=="string"&&WF.test(e)}function m1(e){return e.replace(HF,"[redacted]")}function N$(e,t=wS.filter(o=>!e.disabledProviders.includes(o)),n){const o=new Set(t),i=new Set,c=new Set,l=new Set,d=new Set,h=[],p=e.accountDetection.enabled,y=new Set(e.accountDetection.disabledProviders),g=(k,P)=>`${k}:${P&&P!=="~"?P:"~"}`,v=new Set(e.accountDetection.excludedAccounts.map(k=>g(k.providerId,k.homeDir))),x=new Map((n??[]).map(k=>[k.id,k])),w=k=>{l.add(k.id),d.add(g(k.providerId,k.homeDir)),h.push(k)};if(e.accounts.forEach((k,P)=>{const q=Tu[k.providerId];i.add(k.id),c.add(g(k.providerId,k.homeDir));const _=x.get(k.id);_&&c.add(g(k.providerId,_.homeDir)),w({id:k.id,providerId:k.providerId,name:k.name,homeDir:k.homeDir||"~",color:k.color||q.color,source:"configured",enabled:k.enabled!==!1,explicitId:k.id,explicitIndex:P})}),n)for(const k of n){if(!p||y.has(k.providerId)||e.disabledProviders.includes(k.providerId))continue;const P=g(k.providerId,k.homeDir);if(v.has(P)||i.has(k.id)||c.has(P)||l.has(k.id)||d.has(P))continue;const q=Tu[k.providerId];w({id:k.id,providerId:k.providerId,name:k.name,homeDir:k.homeDir||"~",color:k.color||q.color,source:"auto",enabled:!0})}if(n===void 0)for(const k of wS){if(!p||y.has(k)||e.disabledProviders.includes(k)||!o.has(k))continue;const P=g(k,"~");if(v.has(P)||i.has(k)||c.has(P)||l.has(k)||d.has(P))continue;const q=Tu[k];w({id:k,providerId:k,name:q.name,homeDir:"~",color:q.color,source:"auto",enabled:!0})}for(const k of e.accountDetection.excludedAccounts){if(c.has(g(k.providerId,k.homeDir)))continue;const P=Tu[k.providerId];w({id:`ignored:${k.providerId}:${k.homeDir}`,providerId:k.providerId,name:`${P.name} account`,homeDir:k.homeDir,color:P.color,source:"ignored",enabled:!1,excludedRef:k})}return h}function D$(e,t){return e.enabled&&!e.disabledProviders.includes(t)}function j$(e,t,n){const o=e.disabledProviders.filter(i=>i!==t);return{...e,knownProviders:e.knownProviders.includes(t)?e.knownProviders:[...e.knownProviders,t],disabledProviders:n?o:[...o,t]}}function $$(e,t,n){const o=e.disabledProviders.filter(i=>i!==t);return{...e,disabledProviders:n?o:[...o,t]}}function U$(e,t,n){const o=t.homeDir.trim()||"~",i=l=>l.providerId===t.providerId&&l.homeDir===o,c=e.excludedAccounts.filter(l=>!i(l));return{...e,excludedAccounts:n?[...c,{providerId:t.providerId,homeDir:o}]:c}}function kS(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=n?e:t}function Zo(e,t,n,o){return typeof e=="number"&&Number.isFinite(e)&&e>=n&&e<=o?e:t}function Ah(e,t,n,o){return typeof e!="number"||!Number.isFinite(e)?t:Math.min(o,Math.max(n,Math.round(e*2)/2))}function QF(e){try{return new Intl.DateTimeFormat("en-CA",{timeZone:e}),!0}catch{return!1}}function Bn(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ga(e){return wp.includes(e)}function ya(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function JF(e,t=Dt.showMenuBarText){if(!Bn(e))return{...rr,elements:{...rr.elements,value:t},customSpacing:{...rr.customSpacing}};const n=Bn(e.elements)?e.elements:{},o=Bn(e.customSpacing)?e.customSpacing:{};return{version:1,mode:e.mode==="custom"?"custom":"auto",elements:{providerMark:typeof n.providerMark=="boolean"?n.providerMark:rr.elements.providerMark,value:typeof n.value=="boolean"?n.value:rr.elements.value,progress:typeof n.progress=="boolean"?n.progress:rr.elements.progress},density:e.density==="compact"||e.density==="tight"?e.density:rr.density,customSpacing:{edgePaddingPt:Ah(o.edgePaddingPt,rr.customSpacing.edgePaddingPt,0,6),markValueGapPt:Ah(o.markValueGapPt,rr.customSpacing.markValueGapPt,0,8),providerGapPt:Ah(o.providerGapPt,rr.customSpacing.providerGapPt,0,16)}}}function GF(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(c=>!c||c.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(c))?null:o}catch{return null}}function YF(e){if(!Array.isArray(e))return[];const t=e.map(GF).filter(n=>n!==null);return[...new Set(t)]}function p1(e){const t=[],n=Bn(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=[],c=new Set;o.forEach((T,V)=>{if(!Bn(T)){t.push(`accounts[${V}] was not an object`);return}const ee=T.providerId??"claude";if(!ga(ee)){t.push(`accounts[${V}].providerId was invalid`);return}const ne=typeof T.id=="string"&&T.id.trim()?T.id.trim():"",K=typeof T.name=="string"&&T.name.trim()?T.name.trim():"";if(!ne||!K){t.push(`accounts[${V}] was missing id or name`);return}if(c.has(ne)){t.push(`accounts[${V}].id was duplicated`);return}c.add(ne),i.push({id:ne,providerId:ee,name:K,homeDir:typeof T.homeDir=="string"&&T.homeDir.trim()?T.homeDir:"~",...typeof T.color=="string"&&T.color.trim()?{color:T.color}:{},...T.enabled===!1?{enabled:!1}:{}})});const l=(Array.isArray(n.disabledProviders)?n.disabledProviders:[]).filter(ga);n.disabledProviders!==void 0&&!Array.isArray(n.disabledProviders)&&t.push("disabledProviders was not an array");const d=Array.isArray(n.knownProviders)?n.knownProviders.filter(ga):n.onboarded===!0?[...qF]:[];n.knownProviders!==void 0&&!Array.isArray(n.knownProviders)&&t.push("knownProviders was not an array");const h=YF(n.allowedHosts);n.allowedHosts!==void 0&&!ya(n.allowedHosts,h)&&t.push("allowedHosts contained invalid or duplicate hostnames");const p=f1(n.appearance);n.appearance!==void 0&&p.repaired&&t.push(...p.reasons);const y=Bn(n.accountDetection)?n.accountDetection:{};n.accountDetection!==void 0&&!Bn(n.accountDetection)&&t.push("accountDetection was not an object");const g=Array.isArray(y.disabledProviders)?[...new Set(y.disabledProviders.filter(ga))]:[],v=[],x=new Set;Array.isArray(y.excludedAccounts)?y.excludedAccounts.forEach((T,V)=>{if(!Bn(T)||!ga(T.providerId)||typeof T.homeDir!="string"||!T.homeDir.trim()){t.push(`accountDetection.excludedAccounts[${V}] was invalid`);return}const ee=T.homeDir.trim(),ne=`${T.providerId}:${ee}`;x.has(ne)||(x.add(ne),v.push({providerId:T.providerId,homeDir:ee}))}):y.excludedAccounts!==void 0&&t.push("accountDetection.excludedAccounts was not an array");const w={enabled:typeof y.enabled=="boolean"?y.enabled:Cp.enabled,disabledProviders:g,excludedAccounts:v};n.accountDetection!==void 0&&!ya(n.accountDetection,w)&&t.push("accountDetection contained invalid settings");const k=Bn(n.tray)?n.tray:{};n.tray!==void 0&&!Bn(n.tray)&&t.push("tray was not an object");const P=typeof k.showMenuBarText=="boolean"?k.showMenuBarText:Dt.showMenuBarText,q=JF(k.menuBar,P),_={enabled:typeof k.enabled=="boolean"?k.enabled:Dt.enabled,menuBar:q,showMenuBarText:q.elements.value,menuBarValue:k.menuBarValue==="todayTokens"||k.menuBarValue==="usage"?k.menuBarValue:Dt.menuBarValue,displayMetric:k.displayMetric==="tightestRemaining"||k.displayMetric==="smartHeadroom"?k.displayMetric:Dt.displayMetric,pollIntervalSec:Zo(k.pollIntervalSec,Dt.pollIntervalSec,1,86400),activeTimeoutMin:Zo(k.activeTimeoutMin,Dt.activeTimeoutMin,1,1440),graceMin:Zo(k.graceMin,Dt.graceMin,1,10080),promotionHoldMin:Zo(k.promotionHoldMin,Dt.promotionHoldMin,0,1440),lowWatermarkPct:Zo(k.lowWatermarkPct,Dt.lowWatermarkPct,0,100),criticalWatermarkPct:Zo(k.criticalWatermarkPct,Dt.criticalWatermarkPct,0,100),pinnedAccount:typeof k.pinnedAccount=="string"&&k.pinnedAccount.trim()?k.pinnedAccount.trim():null,pins:UF(k.pins,typeof k.pinnedAccount=="string"?k.pinnedAccount:null),pinnedProviders:al(k.pinnedProviders,BF),launchAtLogin:typeof k.launchAtLogin=="boolean"?k.launchAtLogin:Dt.launchAtLogin,theme:k.theme==="dark"?k.theme:Dt.theme};_.graceMin<_.activeTimeoutMin&&(_.graceMin=Math.max(Dt.graceMin,_.activeTimeoutMin)),_.criticalWatermarkPct>_.lowWatermarkPct&&(_.criticalWatermarkPct=Math.min(Dt.criticalWatermarkPct,_.lowWatermarkPct)),n.tray!==void 0&&!ya(n.tray,_)&&t.push("tray contained invalid settings");const A=Bn(n.desktop)?n.desktop:{};n.desktop!==void 0&&!Bn(n.desktop)&&t.push("desktop was not an object");const C={expandedProviders:al(A.expandedProviders,VF),graphRangeDays:h1.includes(A.graphRangeDays)?A.graphRangeDays:_p.graphRangeDays};n.desktop!==void 0&&!ya(n.desktop,C)&&t.push("desktop contained invalid settings");const D=typeof n.activeAccountId=="string"&&n.activeAccountId.trim()?n.activeAccountId.trim():null;n.activeAccountId!==void 0&&n.activeAccountId!==null&&D===null&&t.push("activeAccountId did not match a known account/provider");const U=typeof n.timezone=="string"&&n.timezone.trim()&&QF(n.timezone.trim())?n.timezone.trim():null;n.timezone!==void 0&&n.timezone!==null&&U===null&&t.push("timezone was invalid");const O={...bn,revision:typeof n.revision=="number"&&Number.isSafeInteger(n.revision)&&n.revision>=0?n.revision:bn.revision,interval:kS(n.interval,bn.interval,1),billingInterval:kS(n.billingInterval,bn.billingInterval,1),clearScreen:typeof n.clearScreen=="boolean"?n.clearScreen:bn.clearScreen,privacyMode:typeof n.privacyMode=="boolean"?n.privacyMode:bn.privacyMode,privacyToggleKey:typeof n.privacyToggleKey=="string"&&n.privacyToggleKey.length===1?n.privacyToggleKey:bn.privacyToggleKey,timezone:U,accounts:i,activeAccountId:D,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:h,resetDisplay:n.resetDisplay==="absolute"?"absolute":"relative",knownProviders:d,appearance:p.appearance,accountDetection:w,tray:_,desktop:C};for(const T of Object.keys(bn))T in n||t.push(`missing ${T}`);return{config:O,repaired:t.length>0||!ya(n,O),reasons:t}}function XF(e){try{return p1(e).config}catch{return{...bn,appearance:{...ci},accountDetection:{...Cp},tray:{...Dt},desktop:{..._p}}}}function ZF(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48)}function B$(e,t){const n=ZF(e)||"account",o=new Set(t.map(i=>i.id));if(!o.has(n))return n;for(let i=2;i<1e3;i++){const c=`${n}_${i}`;if(!o.has(c))return c}return`${n}_${Date.now()}`}function z$(e){const t=new Set(e.map(n=>n.color).filter(Boolean));for(const n of Mh)if(!t.has(n))return n;return Mh[e.length%Mh.length]}function V$(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,""):""}function q$(e,t,n,o){return n?{draft:e,revision:t,conflict:t!==null&&o.config.revision>t}:t!==null&&o.config.revision<t?{draft:e,revision:t,conflict:!1}:{draft:o.config,revision:o.config.revision,conflict:!1}}function bp(e){var t;if(e&&typeof e=="object"){const n=e;if(n.kind==="conflict"){const o=n.state,i=(t=o==null?void 0:o.config)==null?void 0:t.revision;return{message:typeof i=="number"?`configuration changed elsewhere (daemon revision ${i})`:"settings changed elsewhere; reload before saving",conflictState:o!=null&&o.config&&typeof i=="number"?o:null}}if(n.kind==="persistence"&&typeof n.message=="string")return{message:n.message,conflictState:null}}return{message:e instanceof Error?e.message:"config update failed",conflictState:null}}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}}},eI={pipe(){return $t(this,arguments)}},jl=(function(){function e(){}return e.prototype=eI,e})(),se=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(c){return t(c,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(o){return t(o,...n)}}}},Fe=e=>e,Ps=e=>()=>e,Pp=Ps(!0),g1=Ps(!1),$l=Ps(void 0),Za=$l;function y1(e,t,n,o,i,c,l,d,h){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 c(i(o(n(t(e.apply(this,arguments))))))};case 7:return function(){return l(c(i(o(n(t(e.apply(this,arguments)))))))};case 8:return function(){return d(l(c(i(o(n(t(e.apply(this,arguments))))))))};case 9:return function(){return h(d(l(c(i(o(n(t(e.apply(this,arguments)))))))))}}}function Fs(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 km=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 c=0;c<i.length;c++)t.add(i[c]);o=Object.getPrototypeOf(o)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},Em=new WeakSet;function Fp(e){return typeof e=="string"}function v1(e){return typeof e=="number"}function tI(e){return typeof e=="boolean"}function Ul(e){return typeof e=="function"}function nI(e){return e!==void 0}function rI(e){return e!=null}function sI(e){return!1}function S1(e){return!0}function oI(e){return typeof e=="object"&&e!==null||Ul(e)}const Be=se(2,(e,t)=>oI(e)&&t in e);function iI(e){return Be(e,Symbol.iterator)||Fp(e)}const sn="~effect/interfaces/Hash",vt=e=>{switch(typeof e){case"number":return Ip(e);case"bigint":return Ft(e.toString(10));case"boolean":return Ft(String(e));case"symbol":return Ft(String(e));case"string":return Ft(e);case"undefined":return Ft("undefined");case"function":case"object":{if(e===null)return Ft("null");if(e instanceof Date)return Ft(e.toISOString());if(e instanceof RegExp)return Ft(e.toString());{if(Em.has(e))return _m(e);if(Oh.has(e))return Oh.get(e);const t=fI(e,()=>aI(e)?e[sn]():typeof e=="function"?_m(e):Array.isArray(e)||ArrayBuffer.isView(e)?x1(e):e instanceof Map?uI(e):e instanceof Set?lI(e):Rp(e));return Oh.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`)}},_m=e=>(Lh.has(e)||Lh.set(e,Ip(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),Lh.get(e)),ir=se(2,(e,t)=>e*53^t),Bl=e=>e&3221225471|e>>>1&1073741824,aI=e=>Be(e,sn),Ip=e=>{if(e!==e)return Ft("NaN");if(e===1/0)return Ft("Infinity");if(e===-1/0)return Ft("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Bl(t)},Ft=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Bl(t)},cI=(e,t)=>{let n=12289;for(const o of t)n^=ir(vt(o),vt(e[o]));return Bl(n)},Rp=e=>cI(e,km(e)),Tp=(e,t)=>n=>{let o=e;for(const i of n)o^=t(i);return Bl(o)},x1=Tp(6151,vt),uI=Tp(Ft("Map"),([e,t])=>ir(vt(e),vt(t))),lI=Tp(Ft("Set"),vt),Lh=new WeakMap,Oh=new WeakMap,Nh=new WeakSet;function fI(e,t){if(Nh.has(e))return Ft("[Circular]");Nh.add(e);const n=t();return Nh.delete(e),n}const on="~effect/interfaces/Equal";function Pn(){return arguments.length===1?e=>ho(e,arguments[0]):ho(arguments[0],arguments[1])}function ho(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"||Em.has(e)||Em.has(t)?!1:mI(e,t,hI)}function dI(e,t,n){const o=Dh.has(e),i=jh.has(t);if(o&&i)return!0;if(o||i)return!1;Dh.add(e),jh.add(t);const c=n();return Dh.delete(e),jh.delete(t),c}const Dh=new WeakSet,jh=new WeakSet;function hI(e,t){if(vt(e)!==vt(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=ES(e),o=ES(t);if(n!==o)return!1;const i=n&&o;return typeof e=="function"&&!i?!1:dI(e,t,()=>i?e[on](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:pI(e,t):ArrayBuffer.isView(e)?!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength?!1:gI(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:SI(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:wI(e,t):yI(e,t))}function mI(e,t,n){let o=Mu.get(e);if(!o)o=new WeakMap,Mu.set(e,o);else if(o.has(t))return o.get(t);const i=n(e,t);o.set(t,i);let c=Mu.get(t);return c||(c=new WeakMap,Mu.set(t,c)),c.set(e,i),i}const Mu=new WeakMap;function pI(e,t){for(let n=0;n<e.length;n++)if(!ho(e[n],t[n]))return!1;return!0}function gI(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 yI(e,t){const n=km(e),o=km(t);if(n.size!==o.size)return!1;for(const i of n)if(!o.has(i)||!ho(e[i],t[i]))return!1;return!0}function vI(e,t){return function(o,i){for(const[c,l]of o){let d=!1;for(const[h,p]of i)if(e(c,h)&&t(l,p)){d=!0;break}if(!d)return!1}return!0}}const SI=vI(ho,ho);function xI(e){return function(n,o){for(const i of n){let c=!1;for(const l of o)if(e(i,l)){c=!0;break}if(!c)return!1}return!0}}const wI=xI(ho),ES=e=>Be(e,on),kI=()=>Pn,EI=e=>(t,n)=>t===n||e(t,n),_I=(e,t)=>e===t,CI=()=>_I;function bI(e){return EI((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 w1=e=>e.length>0,zl=Symbol.for("~effect/Redactable"),PI=e=>Be(e,zl);function Vl(e){return PI(e)?k1(e):e}function k1(e){var t;return e[zl](((t=globalThis[Pa])==null?void 0:t.context)??FI)}const Pa="~effect/Fiber/currentFiber",FI={"~effect/Context":{},mapUnsafe:new Map,pipe(){return $t(this,arguments)}};function ht(e,t){const n=(t==null?void 0:t.space)??0,o=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",c=p=>i.repeat(p),l=(p,y)=>{const g=p==null?void 0:p.constructor;return g&&g!==Object.prototype.constructor&&g.name?`${g.name}(${y})`:y},d=p=>{try{return Reflect.ownKeys(p)}catch{return["[ownKeys threw]"]}};function h(p,y=0){if(Array.isArray(p)){if(o.has(p))return _S;if(o.add(p),!i||p.length<=1)return`[${p.map(v=>h(v,y)).join(",")}]`;const g=p.map(v=>h(v,y+1)).join(`,
|
|
59
|
+
`+c(y+1));return`[
|
|
60
|
+
${c(y+1)}${g}
|
|
61
|
+
${c(y)}]`}if(p instanceof Date)return RI(p);if(!(t!=null&&t.ignoreToString)&&Be(p,"toString")&&typeof p.toString=="function"&&p.toString!==Object.prototype.toString&&p.toString!==Array.prototype.toString){const g=TI(p);return p instanceof Error&&p.cause?`${g} (cause: ${h(p.cause,y)})`:g}if(typeof p=="string")return JSON.stringify(p);if(typeof p=="number"||p==null||typeof p=="boolean"||typeof p=="symbol")return String(p);if(typeof p=="bigint")return String(p)+"n";if(typeof p=="object"||typeof p=="function"){if(o.has(p))return _S;if(o.add(p),zl in p)return ht(k1(p));if(Symbol.iterator in p)return`${p.constructor.name}(${h(Array.from(p),y)})`;const g=d(p);if(!i||g.length<=1){const x=`{${g.map(w=>`${cl(w)}:${h(p[w],y)}`).join(",")}}`;return l(p,x)}const v=`{
|
|
62
|
+
${g.map(x=>`${c(y+1)}${cl(x)}: ${h(p[x],y+1)}`).join(`,
|
|
63
|
+
`)}
|
|
64
|
+
${c(y)}}`;return l(p,v)}return String(p)}return h(e,0)}const _S="[Circular]";function cl(e){return typeof e=="string"?JSON.stringify(e):String(e)}function II(e){return e.map(t=>`[${cl(t)}]`).join("")}function RI(e){try{return e.toISOString()}catch{return"Invalid Date"}}function TI(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function E1(e,t){let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&Vl(c):c,t==null?void 0:t.space);return n=void 0,o}const mo=Symbol.for("nodejs.util.inspect.custom"),ec=e=>{try{if(Be(e,"toJSON")&&Ul(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(ec)}catch{return"[toJSON threw]"}return Vl(e)},MI=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?AI(e,t):String(e)}catch{return String(e)}},AI=(e,t)=>{let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&Vl(c):c,t);return n=void 0,o},CS={toJSON(){return ec(this)},[mo](){return this.toJSON()},toString(){return ht(this.toJSON())}};class ql{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 ql(this.self)}}const di="~effect/Utils/internal",_1={[di]:e=>e()},LI={[di]:e=>{try{return e()}finally{}}};var aw;const OI=((aw=_1[di](()=>new Error().stack))==null?void 0:aw.includes(di))===!0,nn=OI?_1[di]:LI[di],Is="~effect/Effect",ja="~effect/Exit",NI={_A:Fe,_E:Fe,_R:Fe},C1=`${Is}/identifier`,Te=`${Is}/args`,Tt=`${Is}/evaluate`,Fn=`${Is}/successCont`,kr=`${Is}/failureCont`,po=`${Is}/ensureCont`,Xs=Symbol.for("effect/Effect/Yield"),Rs={pipe(){return $t(this,arguments)},toJSON(){return{...this}},toString(){return ht(this.toJSON(),{ignoreToString:!0,space:2})},[mo](){return this.toJSON()}},Wl={[Symbol.iterator](){return new ql(this)}},DI={...Wl,pipe(){return $t(this,arguments)}},jI={[Is]:NI,...Rs,[Symbol.iterator](){return new ql(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[C1],...Te in this?{args:this[Te]}:void 0}}},Jt=e=>Be(e,Is),b1=e=>Be(e,ja),Wu="~effect/Cause",Hu="~effect/Cause/Reason",Hl=e=>Be(e,Wu),$I=e=>Be(e,Hu);var cw;class vo{constructor(t){L(this,cw);L(this,"reasons");this[Wu]=Wu,this.reasons=t}pipe(){return $t(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${ht(this.reasons)})`}[(cw=Wu,mo)](){return this.toJSON()}[on](t){return Hl(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,o)=>Pn(n,t.reasons[o]))}[sn](){return x1(this.reasons)}}const bS=new WeakMap;var uw;class Mp{constructor(t,n,o){L(this,uw);L(this,"annotations");L(this,"_tag");if(this[Hu]=Hu,this._tag=t,n!==Kl&&typeof o=="object"&&o!==null&&n.size>0){const i=bS.get(o);i&&(n=new Map([...i,...n])),bS.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((c,l)=>{(n==null?void 0:n.overwrite)!==!0&&o.has(l)||o.set(l,c)});const i=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return i.annotations=o,i}pipe(){return $t(this,arguments)}toString(){return ht(this)}[(uw=Hu,mo)](){return this.toString()}}const Kl=new Map;class P1 extends Mp{constructor(n,o=Kl){super("Fail",o,n);L(this,"error");this.error=n}toString(){return`Fail(${ht(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[on](n){return Ap(n)&&Pn(this.error,n.error)&&Pn(this.annotations,n.annotations)}[sn](){return ir(Ft(this._tag))(ir(vt(this.error))(vt(this.annotations)))}}const $a=e=>new vo(e),UI=new vo([]),F1=e=>new vo([new P1(e)]);class I1 extends Mp{constructor(n,o=Kl){super("Die",o,n);L(this,"defect");this.defect=n}toString(){return`Die(${ht(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[on](n){return zI(n)&&Pn(this.defect,n.defect)&&Pn(this.annotations,n.annotations)}[sn](){return ir(Ft(this._tag))(ir(vt(this.defect))(vt(this.annotations)))}}const BI=e=>new vo([new I1(e)]),Cm=se(e=>Hl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new vo(e.reasons.map(o=>o.annotate(t,n)))),Ap=e=>e._tag==="Fail",zI=e=>e._tag==="Die",Lp=e=>e._tag==="Interrupt";function VI(e){return hi("Effect.evaluate: Not implemented")}const tc=e=>({...jI,[C1]:e.op,[Tt]:e[Tt]??VI,[Fn]:e[Fn],[kr]:e[kr],[po]:e[po]}),lr=e=>{const t=tc(e);return function(){const n=Object.create(t);return n[Te]=e.single===!1?arguments:arguments[0],n}},R1=e=>{const t={...tc(e),[ja]:ja,_tag:e.op,get[e.prop](){return this[Te]},toString(){return`${e.op}(${ht(this[Te])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[Te]}},[on](n){return b1(n)&&n._tag===this._tag&&Pn(this[Te],n[Te])},[sn](){return ir(Ft(e.op),vt(this[Te]))}};return function(n){const o=Object.create(t);return o[Te]=n,o}},lt=R1({op:"Success",prop:"value",[Tt](e){const t=e.getCont(Fn);return t?t[Fn](this[Te],e,this):e.yieldWith(this)}}),Ql={key:"effect/Cause/StackTrace"},qI={key:"effect/Cause/InterruptorStackTrace"},qn=R1({op:"Failure",prop:"cause",[Tt](e){let t=this[Te],n=!1;e.currentStackFrame&&(t=Cm(t,{mapUnsafe:new Map([[Ql.key,e.currentStackFrame]])}),n=!0);let o=e.getCont(kr);for(;e.interruptible&&e._interruptedCause&&o;)o=e.getCont(kr);return o?o[kr](t,e,n?void 0:this):e.yieldWith(n?this:qn(t))}}),Pr=e=>qn(F1(e)),hi=e=>qn(BI(e)),Ke=lr({op:"WithFiber",[Tt](e){return this[Te](e)}}),WI=(function(){class e extends globalThis.Error{asEffect(){return Pr(this)}}return Object.assign(e.prototype,DI),e})(),T1=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return class extends WI{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}}}})(),Op=e=>{class t extends T1{constructor(){super(...arguments);L(this,"_tag",e)}}return t.prototype.name=e,t},PS="~effect/Cause/NoSuchElementError";var lw,fw;class HI extends(fw=Op("NoSuchElementError"),lw=PS,fw){constructor(n){super({message:n});L(this,lw,PS)}}const Ua="~effect/Cause/Done",KI=e=>Be(e,Ua),M1={[Ua]:Ua,_tag:"Done",value:void 0},Np=e=>e===void 0?M1:{[Ua]:Ua,_tag:"Done",value:e},QI=Pr(M1),JI=e=>e===void 0?QI:Pr(Np(e)),A1="~effect/data/Option",L1={[A1]:{_A:e=>e},...Rs,...Wl},O1=Object.assign(Object.create(L1),{_tag:"Some",_op:"Some",[on](e){return N1(e)&&j1(e)&&Pn(this.value,e.value)},[sn](){return ir(vt(this._tag))(vt(this.value))},toString(){return`some(${ht(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:ec(this.value)}},asEffect(){return lt(this.value)}});Object.defineProperty(O1,"valueOrUndefined",{get(){return this.value}});const GI=vt("None"),YI=Object.assign(Object.create(L1),{_tag:"None",_op:"None",valueOrUndefined:void 0,[on](e){return N1(e)&&D1(e)},[sn](){return GI},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return Pr(new HI)}}),N1=e=>Be(e,A1),D1=e=>e._tag==="None",j1=e=>e._tag==="Some",XI=Object.create(YI),ZI=e=>{const t=Object.create(O1);return t.value=e,t},$1="~effect/data/Result",U1={[$1]:{_A:e=>e,_E:e=>e},...Rs,...Wl},eR=Object.assign(Object.create(U1),{_tag:"Success",_op:"Success",[on](e){return B1(e)&&V1(e)&&Pn(this.success,e.success)},[sn](){return ir(vt(this._tag))(vt(this.success))},toString(){return`success(${ht(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:ec(this.success)}},asEffect(){return lt(this.success)}}),tR=Object.assign(Object.create(U1),{_tag:"Failure",_op:"Failure",[on](e){return B1(e)&&z1(e)&&Pn(this.failure,e.failure)},[sn](){return ir(vt(this._tag))(vt(this.failure))},toString(){return`failure(${ht(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:ec(this.failure)}},asEffect(){return Pr(this.failure)}}),B1=e=>Be(e,$1),z1=e=>e._tag==="Failure",V1=e=>e._tag==="Success",nR=e=>{const t=Object.create(tR);return t.failure=e,t},rR=e=>{const t=Object.create(eR);return t.success=e,t};function Dp(e){return(t,n)=>t===n?0:e(t,n)}const jp=Dp((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),sR=se(2,(e,t)=>Dp((n,o)=>e(t(n),t(o)))),oR=e=>se(2,(t,n)=>e(t,n)===-1),q1=e=>se(2,(t,n)=>e(t,n)===1),iR=e=>se(2,(t,n)=>e(t,n)!==1),W1=e=>se(2,(t,n)=>e(t,n)!==-1),aR=e=>se(2,(t,n)=>t===n||e(t,n)<1?t:n),Wn=()=>XI,Ne=ZI,So=D1,_s=j1,cR=se(2,(e,t)=>So(e)?t():e.value),H1=cR($l),$p=se(2,(e,t)=>So(e)?Wn():Ne(t(e.value))),uR=se(2,(e,t)=>So(e)?Wn():t(e.value)?Ne(e.value):Wn()),Kr=rR,ar=nR,Mt=z1,lR=V1,fR={[Symbol.iterator](){return dR}},dR={next(){return{done:!0,value:void 0}}},hR=()=>fR,mR=se(2,(e,t)=>Object.hasOwn(e,t)),pR=e=>Object.keys(e),gR=e=>se(2,(t,n)=>{for(const o of pR(t))if(!mR(n,o)||!e(t[o],n[o]))return!1;return!0}),yR=e=>{const t=gR(e);return(n,o)=>t(n,o)&&t(o,n)},FS=globalThis.Array,_r=e=>FS.isArray(e)?e:FS.from(e),K1=se(2,(e,t)=>[...e,t]),vR=se(2,(e,t)=>_r(e).concat(_r(t))),IS=w1,ul=w1;function SR(e,t){return e<0||e>=t.length}const xR=se(2,(e,t)=>{const n=Math.floor(t);if(SR(n,e))throw new Error(`Index out of bounds: ${n}`);return e[n]}),wR=xR(0),kR=e=>e.slice(1),ER=se(3,(e,t,n)=>{const o=_r(e),i=_r(t);return ul(o)?ul(i)?bR(n)(vR(o,i)):o:i}),_R=se(2,(e,t)=>ER(e,t,kI())),CR=()=>[],Q1=se(2,(e,t)=>e.map(t)),bR=se(2,(e,t)=>{const n=_r(e);if(ul(n)){const o=[wR(n)],i=kR(n);for(const c of i)o.every(l=>!t(c,l))&&o.push(c);return o}return[]}),RS="~effect/Context/Service",Kn=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,PR),Object.defineProperty(o,"stack",{get(){return t.stack}}),arguments.length>0?(o.key=arguments[0],(i=arguments[1])!=null&&i.defaultValue&&(o[ll]=ll,o.defaultValue=arguments[1].defaultValue),o):function(c,l){return o.key=c,l!=null&&l.make&&(o.make=l.make),o}},PR={[RS]:RS,...Rs,...Wl,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=Ps(Ke(t=>lt(ao(t.context,this)))))()},of(e){return e},context(e){return mi(this,e)},use(e){return Ke(t=>e(ao(t.context,this)))},useSync(e){return Ke(t=>lt(e(ao(t.context,this))))}},ll="~effect/Context/Reference",J1="~effect/Context",ws=e=>{const t=Object.create(FR);return t.mapUnsafe=e,t.mutable=!1,t},FR={...Rs,[J1]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[on](e){if(!G1(e)||this.mapUnsafe.size!==e.mapUnsafe.size)return!1;for(const t of this.mapUnsafe.keys())if(!e.mapUnsafe.has(t)||!Pn(this.mapUnsafe.get(t),e.mapUnsafe.get(t)))return!1;return!0},[sn](){return Ip(this.mapUnsafe.size)}},G1=e=>Be(e,J1),Y1=e=>Be(e,ll),cr=()=>IR,IR=ws(new Map),mi=(e,t)=>ws(new Map([[e.key,t]])),Ts=se(3,(e,t,n)=>X1(e,o=>{o.set(t.key,n)})),RR=se(3,(e,t,n)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):Y1(t)?Gl(t):n()),Jl=se(2,(e,t)=>{if(!e.mapUnsafe.has(t.key)){if(ll in t)return Gl(t);throw MR(t)}return e.mapUnsafe.get(t.key)}),ao=Jl,TR=(e,t)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):Gl(t),$h="~effect/Context/defaultValue",Gl=e=>$h in e?e[$h]:e[$h]=e.defaultValue(),MR=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},AR=se(2,(e,t)=>e.mapUnsafe.has(t.key)?Ne(e.mapUnsafe.get(t.key)):Y1(t)?Ne(Gl(t)):Wn()),pi=se(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:X1(e,n=>{t.mapUnsafe.forEach((o,i)=>n.set(i,o))})),LR=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((o,i)=>{t.set(i,o)});return ws(t)},X1=(e,t)=>{if(e.mutable)return t(e.mapUnsafe),e;const n=new Map(e.mapUnsafe);return t(n),ws(n)},rt=Kn,fl="~effect/time/Duration",OR=BigInt(0),Z1=BigInt(1e3),NR=BigInt(1e6),DR=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Up=e=>{switch(typeof e){case"number":return Ba(e);case"bigint":return AS(e);case"string":{const t=DR.exec(e);if(!t)break;const[n,o,i]=t,c=Number(o);switch(i){case"nano":case"nanos":return AS(BigInt(o));case"micro":case"micros":return qR(BigInt(o));case"milli":case"millis":return Ba(c);case"second":case"seconds":return WR(c);case"minute":case"minutes":return HR(c);case"hour":case"hours":return KR(c);case"day":case"days":return QR(c);case"week":case"weeks":return JR(c)}break}case"object":{if(e===null)break;if(fl in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(v1)?TS(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Bp:e[0]===-1/0||e[1]===-1/0?VR:e[0]===1/0||e[1]===1/0?zR:gn(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 gn(n);let o=BigInt(n)*NR;return t.microseconds&&(o+=BigInt(t.microseconds)*Z1),t.nanoseconds&&(o+=BigInt(t.nanoseconds)),gn(o)}}return TS(e)},TS=e=>{throw new Error(`Invalid Input: ${e}`)},MS={_tag:"Millis",millis:0},jR={_tag:"Infinity"},$R={_tag:"NegativeInfinity"},UR={[fl]:fl,[sn](){return Rp(this.value)},[on](e){return BR(e)&&eT(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"}}},[mo](){return this.toJSON()},pipe(){return $t(this,arguments)}},gn=e=>{const t=Object.create(UR);return typeof e=="number"?isNaN(e)||e===0||Object.is(e,-0)?t.value=MS: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?jR:$R:e===OR?t.value=MS:t.value={_tag:"Nanos",nanos:e},t},BR=e=>Be(e,fl),Bp=gn(0),zR=gn(1/0),VR=gn(-1/0),AS=e=>gn(e),qR=e=>gn(e*Z1),Ba=e=>gn(e),WR=e=>gn(e*1e3),HR=e=>gn(e*6e4),KR=e=>gn(e*36e5),QR=e=>gn(e*864e5),JR=e=>gn(e*6048e5),ek=e=>GR(e,{onMillis:Fe,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),LS=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))}},GR=se(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)()}}),tk=se(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(LS(e),t.value.nanos):n.onNanos(e.value.nanos,LS(t))),YR=Dp((e,t)=>tk(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})),XR=(e,t)=>tk(e,t,{onMillis:(n,o)=>n===o,onNanos:(n,o)=>n===o,onInfinity:(n,o)=>n.value._tag===o.value._tag}),ZR=aR(YR),eT=se(2,(e,t)=>XR(e,t)),tT=e=>t=>!Mt(e(t)),nT=e=>t=>t.has(e)?Kr(t):ar(t),rT=se(2,(e,t)=>n=>{const o=e(n);return Mt(o)?o:t(o.success)}),nk=se(2,(e,t)=>n=>{const o=e(n);if(Mt(o))return ar(n);const i=t(o.success);return Mt(i)?ar(n):i}),rk=rt("effect/Scheduler",{defaultValue:()=>new ok}),sk="setImmediate"in globalThis?e=>{const t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{const t=setTimeout(e,0);return()=>clearTimeout(t)};class sT{constructor(){L(this,"buckets",[])}scheduleTask(t,n){const o=this.buckets,i=o.length;let c,l=0;for(;l<i&&!(o[l][0]>n);l++)c=o[l];c&&c[0]===n?c[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 ok{constructor(t="async",n=sk){L(this,"executionMode");L(this,"setImmediate");this.executionMode=t,this.setImmediate=n}shouldYield(t){return t.currentOpCount>=t.maxOpsBeforeYield}makeDispatcher(){return new oT(this.setImmediate)}}class oT{constructor(t=sk){L(this,"tasks",new sT);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 iT=rt("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),aT=rt("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1}),ik="effect/Tracer/ParentSpan";class cT extends Kn()(ik){}const uT=e=>e,bm=rt("effect/Tracer/DisablePropagation",{defaultValue:g1}),lT=rt("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),fT=rt("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),ak="effect/Tracer",dT=rt(ak,{defaultValue:()=>uT({span:e=>new hT(e)})});class hT{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=H1(t.parent))==null?void 0:n.traceId)??OS(32),this.spanId=OS(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 OS=(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}})(),mT="effect/observability/Metric/FiberRuntimeMetricsKey",pT=rt("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),ck=rt("effect/References/CurrentStackFrame",{defaultValue:$l}),gT=rt("effect/References/TracerEnabled",{defaultValue:Pp}),uk=rt("effect/References/TracerTimingEnabled",{defaultValue:Pp}),yT=rt("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),vT=rt("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),zp=rt("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),ST=rt("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),xT=rt("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),wT=rt("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),kT=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:_T(()=>n.stack)}},ET=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}},_T=ET(3),CT="dev";class lk extends Mp{constructor(n,o=Kl){super("Interrupt",o,"Interrupted");L(this,"fiberId");this.fiberId=n}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[on](n){return Lp(n)&&this.fiberId===n.fiberId&&this.annotations===n.annotations}[sn](){return ir(Ft(`${this._tag}:${this.fiberId}`))(_m(this.annotations))}}const bT=e=>new lk(e),Vp=e=>new vo([new lk(e)]),PT=e=>{const t=e.reasons.find(Ap);return t?Kr(t):ar(e)},xo=e=>{for(let t=0;t<e.reasons.length;t++){const n=e.reasons[t];if(n._tag==="Fail")return Kr(n.error)}return ar(e)},FT=e=>e.reasons.some(Lp),qp=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?Kr(t):ar(e)},IT=e=>{const t=qp(e);return Mt(t)?RT:t.success},RT=new Set,TT=e=>e.reasons.length>0&&e.reasons.every(Lp),MT=se(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;const n=new vo(_R(e.reasons,t.reasons));return Pn(e,n)?e:n}),AT=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},Wp=e=>{const t=AT(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")},LT=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(Pm(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=jT(i,n);const c=new globalThis.Error("All fibers interrupted without error",{cause:i});c.name="InterruptError",c.stack=`${c.name}: ${c.message}`,t.push(Pm(c,n[0].annotations))}return Error.stackTraceLimit=o,t},Pm=(e,t)=>{const n=typeof e;let o;if(e&&n==="object"){if(o=new globalThis.Error(OT(e),{cause:e.cause?Pm(e.cause):void 0}),typeof e.name=="string"&&(o.name=e.name),typeof e.stack=="string")o.stack=DT(e.stack,o,t);else{const i=`${o.name}: ${o.message}`;o.stack=t?fk(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:E1(e):`Unknown error: ${e}`);return o},OT=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 E1(e)},NT=/\((.*)\)/g,DT=(e,t,n)=>{const o=`${t.name}: ${t.message}`,i=(e.startsWith(o)?e.slice(o.length):e).split(`
|
|
69
|
+
`),c=[o];for(let l=1;l<i.length&&!/(?:Generator\.next|~effect\/Effect)/.test(i[l]);l++)c.push(i[l]);return n?fk(c.join(`
|
|
70
|
+
`),n):c.join(`
|
|
71
|
+
`)},fk=(e,t)=>{const n=t==null?void 0:t.get(Ql.key);return n&&(e=`${e}
|
|
72
|
+
${dk(n)}`),e},jT=(e,t)=>{const n=[`${e.name}: ${e.message}`];for(const o of t){const i=o.fiberId!==void 0?`#${o.fiberId}`:"unknown",c=o.annotations.get(qI.key);n.push(` at fiber (${i})`),c&&n.push(dk(c))}return n.join(`
|
|
73
|
+
`)},dk=e=>{const t=[];let n=e,o=0;for(;n&&o<10;){const i=n.stack();if(i){const c=i.matchAll(NT);let l=!1;for(const[,d]of c)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
|
+
`)},hk=e=>LT(e).map(t=>t.cause?`${t.stack} {
|
|
75
|
+
${mk(t.cause," ")}
|
|
76
|
+
}`:t.stack).join(`
|
|
77
|
+
`),mk=(e,t)=>{const n=e.stack.split(`
|
|
78
|
+
`);let o=`${t}[cause]: ${n[0]}`;for(let i=1,c=n.length;i<c;i++)o+=`
|
|
79
|
+
${t}${n[i]}`;return e.cause&&(o+=` {
|
|
80
|
+
${mk(e.cause,`${t} `)}
|
|
81
|
+
${t}}`),o},Fm=`~effect/Fiber/${CT}`,$T={_A:Fe,_E:Fe},UT={id:0},Hp=()=>globalThis[Pa];var dw;dw=Fm;class pk{constructor(t,n=!0){L(this,dw);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[Fm]=$T,this.setContext(t),this.id=++UT.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 TR(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Za):(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=Vp(t);this.currentStackFrame&&(o=Cm(o,mi(Ql,this.currentStackFrame))),n&&(o=Cm(o,n)),this._interruptedCause=this._interruptedCause?MT(this._interruptedCause,o):o,this.interruptible&&this.evaluate(Gt(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 c=this._yielded;this._yielded=void 0,c()}const n=this.runLoop(t);if(n!==Xs){this._exit=n,(i=this.runtimeMetrics)==null||i.recordFiberEnd(this.context,this._exit);for(let c=0;c<this._observers.length;c++)this._observers[c](n);this._observers.length=0}}runLoop(t){const n=globalThis[Pa];globalThis[Pa]=this;let o=!1,i=t;this.currentOpCount=0;const c=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!o&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){o=!0;const l=i;i=Ue(Qp,()=>l)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Tt](this),c!==this.currentLoopCount)return Xs;if(i===Xs){const l=this._yielded;return ja in l?(this._yielded=void 0,l):Xs}}}catch(l){return Be(i,Tt)?this.runLoop(hi(l)):hi(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{globalThis[Pa]=n}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const o=n[po]&&n[po](this);if(o)return o[t]=o,o;if(n[t])return n}}yieldWith(t){return this._yielded=t,Xs}children(){return this._children??(this._children=new Set)}pipe(){return $t(this,arguments)}setContext(t){this.context=t;const n=this.getRef(rk);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=t.mapUnsafe.get(ik),this.currentLogLevel=this.getRef(ST),this.minimumLogLevel=this.getRef(xT),this.currentStackFrame=t.mapUnsafe.get(ck.key),this.maxOpsBeforeYield=this.getRef(iT),this.currentPreventYield=this.getRef(aT),this.runtimeMetrics=t.mapUnsafe.get(mT);const o=t.mapUnsafe.get(ak);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 Yl=e=>{if(!e.currentStackFrame)return;const t=new Map;return t.set(Ql.key,e.currentStackFrame),ws(t)},gk=e=>{const t=e;return t._exit?Ie(t._exit):fr(n=>t._exit?n(Ie(t._exit)):kt(e.addObserver(o=>n(Ie(o)))))},yk=e=>fr(t=>{const n=e[Symbol.iterator](),o=[];let i;function c(){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),c()});return}t(Ie(o))}return c(),kt(()=>i==null?void 0:i())}),Kp=e=>Ke(t=>BT(e,t.id)),BT=se(e=>Be(e[0],Fm),(e,t,n)=>Ke(o=>{let i=Yl(o);return i=i&&n?pi(i,n):i??n,e.interruptUnsafe(t,i),Ek(gk(e))})),dl=e=>Ke(t=>{const n=Yl(t);for(const o of e)o.interruptUnsafe(t.id,n);return Ek(yk(e))}),Ie=lt,Gt=qn,Xl=Pr,kt=lr({op:"Sync",[Tt](e){const t=this[Te](),n=e.getCont(Fn);return n?n[Fn](t,e):e.yieldWith(lt(t))}}),Et=lr({op:"Suspend",[Tt](e){return this[Te]()}}),zT=lr({op:"Yield",[Tt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Hn)},this[Te]??0),e.yieldWith(()=>{t=!0})}}),Qp=zT(0),VT=e=>Ie(Ne(e)),qT=Ie(Wn()),Zl=e=>hi(e),vk=e=>Et(()=>Xl(nn(e))),ut=Ie(void 0),WT=e=>Sk(function(t,n){nn(()=>e(n)).then(o=>t(Ie(o)),o=>t(Zl(o)))},e.length!==0),HT=e=>Ke(t=>e(t.id)),Sk=lr({op:"Async",single:!1,[Tt](e){const t=nn(()=>this[Te][0].bind(e.currentScheduler));let n=!1,o=!1;const i=this[Te][1]?new AbortController:void 0,c=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&&c===void 0||e._stack.push(KT(()=>(n=!0,i==null||i.abort(),c??Hn))),Xs)}}),KT=lr({op:"AsyncFinalizer",[po](e){e.interruptible&&(e.interruptible=!1,e._stack.push(of))},[kr](e,t){return FT(e)?Ue(this[Te](),()=>Gt(e)):Gt(e)}}),fr=e=>Sk(e,e.length>=2),QT=fr(Za),JT=(...e)=>Et(()=>za(e.length===1?e[0]():e[1].call(e[0].self))),xk=(e,...t)=>{const n=t.length===0?function(){return Et(()=>za(e.apply(this,arguments)))}:function(){let o=Et(()=>za(e.apply(this,arguments)));for(let i=0;i<t.length;i++)o=t[i](o,...arguments);return o};return wk(e.length,n)},wk=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),GT=(e,...t)=>wk(e.length,t.length===0?function(){return NS(()=>e.apply(this,arguments))}:function(){let n=NS(()=>e.apply(this,arguments));for(const o of t)n=o(n);return n}),NS=e=>{try{const t=e();let n;for(;;){const o=t.next(n);if(o.done)return Ie(o.value);const c=o.value.asEffect(),l=c;if(l&&l._tag==="Success"){n=l.value;continue}else{if(l&&l._tag==="Failure")return c;{let d=!0;return Et(()=>d?(d=!1,Ue(c,h=>za(t,h))):Et(()=>za(e())))}}}}catch(t){return Zl(t)}},za=lr({op:"Iterator",single:!1,[Fn](e,t){const n=this[Te][0];for(;;){const o=n.next(e);if(o.done)return Ie(o.value);const i=o.value.asEffect();if(In(i)){if(i._tag==="Failure")return i}else return t._stack.push(this),i;e=i.value}},[Tt](e){return this[Fn](this[Te][1],e)}}),ki=se(2,(e,t)=>{const n=Ie(t);return Ue(e,o=>n)}),nc=se(2,(e,t)=>Ue(e,n=>Jt(t)?t:nn(()=>t(n)))),kk=se(2,(e,t)=>Ue(e,n=>ki(Jt(t)?t:nn(()=>t(n)),n))),Ek=e=>Ue(e,t=>Hn),YT=(e,t)=>Ke(n=>fr(o=>{let i=!1;const c=new Set,l=h=>{i=!0,o(c.size===0?h:Ue(Lk(dl(c)),()=>h))};let d=0;for(const h of e){if(i)break;const p=d++,y=cf(n,h,!0,!0,!1);c.add(y),y.addObserver(g=>{c.delete(y);const v=!i;l(g),v&&(t!=null&&t.onWinner)&&t.onWinner({fiber:y,index:p,parentFiber:n})})}return dl(c)})),_k=se(e=>Jt(e[1]),(e,t,n)=>YT([e,t],n)),Ue=se(2,(e,t)=>{const n=Object.create(XT);return n[Te]=e,n[Fn]=t.length!==1?o=>t(o):t,n}),XT=tc({op:"OnSuccess",[Tt](e){return e._stack.push(this),this[Te]}}),In=e=>ja in e,ZT=se(2,(e,t)=>In(e)?e._tag==="Success"?t(e.value):e:Ue(e,t)),eM=e=>Ue(e,Fe),jt=se(2,(e,t)=>Ue(e,n=>Ie(nn(()=>t(n))))),tM=se(2,(e,t)=>In(e)?cM(e,t):jt(e,t)),nM=se(2,(e,t)=>In(e)?uM(e,t):EM(e,t)),rM=se(2,(e,t)=>In(e)?lM(e,t):_M(e,t)),sM=se(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return e;const n=xo(e.cause);return Mt(n)?e:t(n.success)}return tf(e,t)}),oM=e=>qn(Vp(e)),Jp=e=>e._tag==="Success",iM=e=>e._tag==="Failure",aM=e=>e._tag==="Failure"?Kr(e.cause):ar(e),Hn=lt(void 0),cM=se(2,(e,t)=>e._tag==="Success"?lt(t(e.value)):e),uM=se(2,(e,t)=>{if(e._tag==="Success")return e;const n=xo(e.cause);return Mt(n)?e:Pr(t(n.success))}),lM=se(2,(e,t)=>{if(e._tag==="Success")return lt(t.onSuccess(e.value));const n=xo(e.cause);return Mt(n)?e:Pr(t.onFailure(n.success))}),fM=se(2,(e,t)=>Jp(e)?t:e),dM=e=>{const t=[];for(const n of e)n._tag==="Failure"&&t.push(...n.cause.reasons);return t.length===0?Hn:qn($a(t))},hM=e=>Jp(e)?Ne(e.value):Wn(),mM=e=>Ke(t=>Ie(AR(t.context,e))),ef=se(2,(e,t)=>Ke(n=>{const o=n.context,i=t(o);return o===i?e:(n.setContext(i),Ak(e,()=>{n.setContext(o)}))})),Ck=se(3,(e,t,n)=>ef(e,o=>{const i=Jl(o,t),c=n(i);return i===c?o:Ts(o,t,c)})),pM=()=>gM,gM=Ke(e=>Ie(e.context)),bk=e=>Ke(t=>e(t.context)),rc=se(2,(e,t)=>In(e)?e:ef(e,pi(t))),sc=function(){return arguments.length===1?se(2,(e,t)=>DS(e,arguments[0],t)):se(3,(e,t,n)=>DS(e,t,n)).apply(this,arguments)},DS=(e,t,n)=>ef(e,o=>o.mapUnsafe.get(t.key)===n?o:Ts(o,t,n)),yM=se(e=>Jt(e[1]),(e,t,n)=>vM(e,t,(o,i)=>[o,i],n)),vM=se(e=>Jt(e[1]),(e,t,n,o)=>o!=null&&o.concurrent?jt(HM([e,t],{concurrency:2}),([i,c])=>nn(()=>n(i,c))):Ue(e,i=>jt(t,c=>nn(()=>n(i,c))))),SM=se(e=>Jt(e[0]),(e,t)=>Zp({while:Pp,body:Ps(t!=null&&t.disableYield?e:Ue(e,n=>Qp)),step:Za})),oc=se(2,(e,t)=>{const n=Object.create(xM);return n[Te]=e,n[kr]=t.length!==1?o=>t(o):t,n}),xM=tc({op:"OnFailure",[Tt](e){return e._stack.push(this),this[Te]}}),Pk=se(3,(e,t,n)=>oc(e,o=>{const i=t(o);return Mt(i)?Gt(i.failure):nn(()=>n(i.success,o))})),tf=se(2,(e,t)=>Pk(e,xo,n=>t(n))),wM=se(2,(e,t)=>oc(e,n=>nc(nn(()=>t(n)),Gt(n)))),kM=se(e=>Jt(e[0]),(e,t,n,o)=>oc(e,i=>{const c=xo(i);if(Mt(c))return Gt(c.failure);const l=t(c.success);return Mt(l)?o?nn(()=>o(l.failure)):Gt(i):nn(()=>n(l.success))})),EM=se(2,(e,t)=>tf(e,n=>vk(()=>t(n)))),_M=se(2,(e,t)=>Gp(e,{onFailure:n=>vk(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),CM=e=>tf(e,Zl),bM=se(e=>Jt(e[0]),(e,t)=>{if(!(t!=null&&t.log))return Gp(e,{onFailure:o=>ut,onSuccess:o=>ut});const n=Qk(t.log===!0?void 0:t.log);return nf(e,{onFailure(o){const i=PT(o);return Mt(i)?Gt(i.failure):t.message===void 0?n(o):n(t.message,o)},onSuccess:o=>ut})}),Uh=e=>IM(e,{onFailure:ar,onSuccess:Kr}),nf=se(2,(e,t)=>{const n=Object.create(PM);return n[Te]=e,n[Fn]=t.onSuccess.length!==1?o=>t.onSuccess(o):t.onSuccess,n[kr]=t.onFailure.length!==1?o=>t.onFailure(o):t.onFailure,n}),PM=tc({op:"OnSuccessAndFailure",[Tt](e){return e._stack.push(this),this[Te]}}),Gp=se(2,(e,t)=>nf(e,{onFailure:n=>{const o=n.reasons.find(Ap);return o?nn(()=>t.onFailure(o.error)):Gt(n)},onSuccess:t.onSuccess})),FM=se(2,(e,t)=>Gp(e,{onFailure:n=>kt(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),IM=se(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return lt(t.onSuccess(e.value));const n=xo(e.cause);return Mt(n)?e:lt(t.onFailure(n.success))}return FM(e,t)}),rf=e=>In(e)?lt(e):RM(e),RM=lr({op:"Exit",[Tt](e){return e._stack.push(this),this[Te]},[Fn](e,t,n){return Ie(n??lt(e))},[kr](e,t,n){return Ie(n??qn(e))}}),TM=se(2,(e,t)=>nc(ng(t),e)),Fk=se(2,(e,t)=>_k(e,Ue(ng(t.duration),t.orElse))),MM=se(2,(e,t)=>Fk(e,{duration:t,orElse:()=>Xl(new pA)})),jS="~effect/Scope",$S="~effect/Scope/Closeable",sf=Kn("effect/Scope"),Ik=(e,t)=>Et(()=>Rk(e,t)??ut),Rk=(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):AM(e,o,t)},AM=xk(function*(e,t,n){let o=[];const i=[],c=Array.from(t.values()),l=Hp();for(let d=c.length-1;d>=0;d--){const h=c[d];e.strategy==="sequential"?o.push(yield*rf(h(n))):i.push(cf(l,h(n),!0,!0,"inherit"))}return i.length>0&&(o=yield*yk(i)),yield*dM(o)}),LM=(e,t)=>{const n=Xp(t);if(e.state._tag==="Closed")return n.state=e.state,n;const o={};return Va(e,o,i=>Ik(n,i)),Va(n,o,i=>kt(()=>Yp(e,o))),n},gi=(e,t)=>Et(()=>e.state._tag==="Closed"?t(e.state.exit):(Va(e,{},t),ut)),OM=(e,t)=>gi(e,Ps(t)),Va=(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)},Yp=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.delete(t)},Xp=(e="sequential")=>({[$S]:$S,[jS]:jS,strategy:e,state:NM}),NM={_tag:"Empty"},Tk=sf.asEffect(),DM=sc(sf),Mk=e=>Et(()=>{const t=Xp();return Ms(e(t),n=>Et(()=>Rk(t,n)??ut))}),jM=(e,t,n)=>bk(o=>Dk(i=>Ue(Tk,c=>kk(n!=null&&n.interruptible?i(e):e,l=>gi(c,d=>rc(t(l,d),o)))))),Ak=lr({op:"OnExit",single:!1,[Tt](e){return e._stack.push(this),this[Te][0]},[po](e){e.interruptible&&this[Te][2]!==!0&&(e._stack.push(of),e.interruptible=!1)},[Fn](e,t,n){n??(n=lt(e));const o=this[Te][1](n);return o?Ue(o,i=>n):n},[kr](e,t,n){n??(n=qn(e));const o=this[Te][1](n);return o?Ue(o,i=>n):n}}),Ms=se(2,Ak),$M=se(2,(e,t)=>Ms(e,n=>t)),UM=se(3,(e,t,n)=>Ms(e,o=>{const i=t(o);return Mt(i)?ut:n(i.success,o)})),BM=se(2,(e,t)=>UM(e,aM,t)),zM=se(3,(e,t,n)=>Ms(e,o=>{if(o._tag!=="Failure")return ut;const i=t(o.cause);return Mt(i)?ut:n(i.success,o.cause)})),VM=se(2,(e,t)=>zM(qp,t)(e)),qM=Ke(e=>Gt(Vp(e.id))),Lk=e=>Ke(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(of)),e)),Ok=lr({op:"SetInterruptible",[po](e){if(e.interruptible=this[Te],e._interruptedCause&&e.interruptible)return()=>Gt(e._interruptedCause)}}),of=Ok(!0),WM=Ok(!1),Nk=e=>Ke(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(WM),t._interruptedCause?Gt(t._interruptedCause):e)),Dk=e=>Ke(t=>t.interruptible?(t.interruptible=!1,t._stack.push(of),e(Nk)):e(Fe)),HM=(e,t)=>iI(e)?(t==null?void 0:t.mode)==="result"?Zs(e,Uh,t):Zs(e,Fe,t):t!=null&&t.discard?t.mode==="result"?Zs(Object.values(e),Uh,t):Zs(Object.values(e),Fe,t):Et(()=>{const n={};return ki(Zs(Object.entries(e),([o,i])=>jt((t==null?void 0:t.mode)==="result"?Uh(i):i,c=>{n[o]=c}),{discard:!0,concurrency:t==null?void 0:t.concurrency}),n)}),Zp=lr({op:"While",[Fn](e,t){return this[Te].step(e),this[Te].while()?(t._stack.push(this),this[Te].body()):Hn},[Tt](e){return this[Te].while()?(e._stack.push(this),this[Te].body()):Hn}}),Zs=se(e=>typeof e[1]=="function",(e,t,n)=>Ke(o=>{const i=(n==null?void 0:n.concurrency)==="inherit"?o.getRef(pT):(n==null?void 0:n.concurrency)??1,c=i==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,i);if(c===1)return KM(e,t,n);const l=_r(e);let d=l.length;if(d===0)return n!=null&&n.discard?ut:Ie([]);const h=n!=null&&n.discard?void 0:new Array(d),p=QM({f:t,out:h},l,{concurrency:c});return p?ki(p,h):Ie(h)})),KM=(e,t,n)=>Et(()=>{const o=n!=null&&n.discard?void 0:[],i=e[Symbol.iterator]();let c=i.next(),l=0;return ki(Zp({while:()=>!c.done,body:()=>t(c.value,l++),step:d=>{o&&o.push(d),c=i.next()}}),o)}),jk=e=>{const t=e.onItem,n=e.step;return(o,i,c)=>{let l=(c==null?void 0:c.start)??0;const d=(c==null?void 0:c.end)??i.length,h=(c==null?void 0:c.concurrency)??1;let p=!1,y,g,v,x=!1,w,k;const P=()=>{let q=!1;for(;!w&&l<d;l++){const _=i[l],A=k??t(o,_,l);if(In(A)){if(w=n(o,_,A,l),w)break}else{if(h===1)return Ue(rf(A),C=>(w=n(o,_,C,l),l++,w??P()??ut));if(y){k=void 0;const C=cf(y,A,!0,!0,"inherit");if(C._exit){if(w=n(o,_,C._exit,l),w)break;continue}g?g.add(C):g=new Set([C]);const D=l;if(C.addObserver(U=>{if(g.delete(C),w){if(!x&&U._tag==="Failure")for(const O of U.cause.reasons)O._tag!=="Interrupt"&&(w._tag==="Failure"?w.cause.reasons.push(O):w=qn($a([O])))}else{const O=n(o,_,U,D);O&&(w=O._tag==="Failure"?qn($a(O.cause.reasons.slice())):O,P())}if(q){const O=P();O&&v(O)}else p&&g.size===0&&v(w??ut)}),g.size<h)continue;q=!0,l++;return}else return fr(C=>{y=Hp(),k=A,v=C;const D=P();return D?C(D):Et(()=>(w=Hn,x=!0,g?dl(g):ut))})}}if(p=!0,w){if(g&&g.size>0){const _=Yl(y);g.forEach(A=>A.interruptUnsafe(y.id,_));return}if(v||w._tag==="Failure")return w}else if(v)if(g)g.size===0&&v(ut);else return Hn};return P()}},af=()=>jk,QM=jk({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)}}),cf=(e,t,n=!1,o=!1,i=!1)=>{const c=i==="inherit"?e.interruptible:!i,l=new pk(e.context,c);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},$k=se(e=>Jt(e[0]),(e,t,n)=>Ke(o=>{const i=cf(o,e,n==null?void 0:n.startImmediately,!0,n==null?void 0:n.uninterruptible);if(!i._exit)if(t.state._tag!=="Closed"){const c={};Va(t,c,()=>HT(d=>d===i.id?ut:Kp(i))),i.addObserver(()=>Yp(t,c))}else i.interruptUnsafe(o.id,Yl(o));return Ie(i)})),JM=se(e=>Jt(e[0]),(e,t)=>Ue(Tk,n=>$k(e,n,t))),ic=e=>(t,n)=>{const o=new pk(n!=null&&n.scheduler?Ts(e,rk,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},GM=se(2,(e,t)=>{if(e._exit)return e;if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;const n={};return Va(t,n,()=>Kp(e)),e.addObserver(()=>Yp(t,n)),e}),YM=ic(cr()),Uk=e=>{const t=ic(e);return(n,o)=>{const i=t(n,o);return o!=null&&o.onExit&&i.addObserver(o.onExit),c=>i.interruptUnsafe(c)}},XM=Uk(cr()),eg=e=>{const t=ic(e);return(n,o)=>{const i=t(n,o);return new Promise(c=>{i.addObserver(l=>c(l))})}},ZM=eg(cr()),Bk=e=>{const t=eg(e);return(n,o)=>t(n,o).then(i=>{if(i._tag==="Failure")throw Wp(i.cause);return i.value})},eA=Bk(cr()),tg=e=>{const t=ic(e);return n=>{var c;if(In(n))return n;const o=new ok("sync"),i=t(n,{scheduler:o});return(c=i.currentDispatcher)==null||c.flush(),i._exit??hi(new gA(i))}},tA=tg(cr()),zk=e=>{const t=tg(e);return n=>{const o=t(n);if(o._tag==="Failure")throw Wp(o.cause);return o.value}},nA=zk(cr()),US=Ie(!0),BS=Ie(!1);class rA{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](Hn)});L(this,"open",Ke(t=>this.isOpen?BS:(this.isOpen=!0,this.scheduleUnsafe(t))));L(this,"release",Ke(t=>this.isOpen?BS:this.scheduleUnsafe(t)));L(this,"await",fr(t=>this.isOpen?t(ut):(this.waiters.push(t),kt(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)}))));L(this,"close",kt(()=>this.closeUnsafe()));L(this,"whenOpen",t=>Ue(this.await,()=>t));this.isOpen=t}scheduleUnsafe(t){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,t.currentDispatcher.scheduleTask(this.flushWaiters,0)),US}openUnsafe(){return this.isOpen?!1:(this.isOpen=!0,this.flushWaiters(),!0)}closeUnsafe(){return this.isOpen?(this.isOpen=!1,!0):!1}}const sA=e=>new rA(e??!1),Im=BigInt(0),oA={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:Im,endTime:Im,exit:Hn},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},iA=e=>Object.assign(Object.create(oA),e),Vk=e=>e?ao(e.annotations,bm)?e._tag==="Span"?Vk(H1(e.parent)):Wn():Ne(e):Wn(),qk=(e,t,n)=>{const o=!e.getRef(gT)||(n==null?void 0:n.annotations)&&ao(n.annotations,bm),i=(n==null?void 0:n.parent)!==void 0?Ne(n.parent):n!=null&&n.root?Wn():Vk(e.currentSpan);let c;if(o)c=iA({name:t,parent:i,annotations:Ts((n==null?void 0:n.annotations)??cr(),bm,!0)});else{const l=e.getRef(dT),d=e.getRef(Ei),h=e.getRef(uk),p=e.getRef(yT),y=e.getRef(vT),g=(n==null?void 0:n.level)??e.getRef(lT),v=(n==null?void 0:n.links)!==void 0?[...y,...n.links]:y.slice();c=l.span({name:t,parent:i,annotations:(n==null?void 0:n.annotations)??cr(),links:v,startTime:h?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)??(_s(i)&&i.value.sampled===!1?!1:!Hk(e.getRef(fT),g))});for(const[x,w]of Object.entries(p))c.attribute(x,w);if((n==null?void 0:n.attributes)!==void 0)for(const[x,w]of Object.entries(n.attributes))c.attribute(x,w)}return c},aA=(e,t)=>Lk(Ke(n=>{const o=Jl(n.context,sf),i=qk(n,e,t??{}),c=n.getRef(Ei),l=n.getRef(uk);return ki(gi(o,d=>uA(i,d,c,l)),i)})),cA=(e,t)=>(t=typeof t=="function"?t:$l,Ck(ck,n=>({name:e,stack:t,parent:n}))),uA=(e,t,n,o)=>kt(()=>{e.status._tag!=="Ended"&&e.end(o?n.currentTimeNanosUnsafe():Im,t)}),lA=(e,...t)=>{const n=t.length===1?void 0:t[0],o=t[t.length-1];return Ke(i=>{const c=qk(i,e,n),l=i.getRef(Ei);return Ms(nn(()=>o(c)),d=>kt(()=>{c.status._tag!=="Ended"&&c.end(l.currentTimeNanosUnsafe(),d)}))})},zS=sc(cT),fA=function(){const e=Jt(arguments[0]),t=e?arguments[1]:arguments[0];let n=e?arguments[2]:arguments[1],o=Fe;return t._tag==="Span"&&(n=kT(n),o=cA(t.name,n==null?void 0:n.captureStackTrace)),e?zS(o(arguments[0]),t):i=>zS(o(i),t)},Ei=rt("effect/Clock",{defaultValue:()=>new hA}),dA=2**31-1;class hA{constructor(){L(this,"currentTimeMillis",kt(()=>this.currentTimeMillisUnsafe()));L(this,"currentTimeNanos",kt(()=>this.currentTimeNanosUnsafe()))}currentTimeMillisUnsafe(){return Date.now()}currentTimeNanosUnsafe(){return mA()}sleep(t){const n=ek(t);return n<=0?Qp:fr(o=>{if(n>dA)return;const i=setTimeout(()=>o(ut),n);return kt(()=>clearTimeout(i))})}}const VS=(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))})(),mA=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return VS;const t=VS()-e.bigint();return()=>t+e.bigint()})(),Wk=e=>Ke(t=>e(t.getRef(Ei))),ng=e=>Wk(t=>t.sleep(Up(e))),qS="~effect/Cause/TimeoutError";var hw,mw;class pA extends(mw=Op("TimeoutError"),hw=qS,mw){constructor(n){super({message:n});L(this,hw,qS)}}const WS="~effect/Cause/AsyncFiberError";var pw,gw;class gA extends(gw=Op("AsyncFiberError"),pw=WS,gw){constructor(n){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:n});L(this,pw,WS)}}const yA=rt("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),vA=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}},SA=sR(jp,vA),Hk=q1(SA),xA=rt("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([FA,IA])}),wA=rt("effect/Logger/LogToStderr",{defaultValue:g1}),kA="~effect/Logger",EA={[kA]:{_Message:Fe,_Output:Fe},pipe(){return $t(this,arguments)}},Kk=e=>{const t=Object.create(EA);return t.log=e,t},_A=e=>e.replace(/[\s="]/g,"_"),CA=(e,t)=>`${_A(e[0])}=${t-e[1]}ms`,Qk=e=>(...t)=>{let n;for(let o=0,i=t.length;o<i;o++){const c=t[o];Hl(c)&&(n?t.splice(o,1):t=t.slice(0,o).concat(t.slice(o+1)),n=n?$a(n.reasons.concat(c.reasons)):c,o--)}return n===void 0&&(n=UI),Ke(o=>{const i=e??o.currentLogLevel;if(Hk(o.minimumLogLevel,i))return ut;const c=o.getRef(Ei),l=o.getRef(xA);if(l.size>0){const d=new Date(c.currentTimeMillisUnsafe());for(const h of l)h.log({cause:n,fiber:o,date:d,logLevel:i,message:t})}return ut})},bA=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")}`,PA=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;PA&&process.stdout.isTTY;const FA=Kk(({cause:e,date:t,fiber:n,logLevel:o,message:i})=>{const c=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&c.push(hk(e));const l=t.getTime(),d=n.getRef(wT);let h="";for(const v of d)h+=` ${CA(v,l)}`;const p=n.getRef(zp);Object.keys(p).length>0&&c.push(p);const y=n.getRef(yA);(n.getRef(wA)?y.error:y.log)(`[${bA(t)}] ${o.toUpperCase()} (#${n.id})${h}:`,...c)}),IA=Kk(({cause:e,fiber:t,logLevel:n,message:o})=>{const i=t.getRef(Ei),c=t.getRef(zp),l=t.currentSpan;if(l===void 0||l._tag==="ExternalSpan")return;const d={};for(const[h,p]of Object.entries(c))d[h]=p;d["effect.fiberId"]=t.id,d["effect.logLevel"]=n.toUpperCase(),e.reasons.length>0&&(d["effect.cause"]=hk(e)),l.event(MI(Array.isArray(o)&&o.length===1?o[0]:o),i.currentTimeNanosUnsafe(),d)}),RA=Hl,TA=$I,Rm=$a,Tm=e=>new P1(e),Mm=e=>new I1(e),Am=bT,MA=TT,Jk=Wp,ac=xo,AA=IT,LA=qp,rg=KI,uf=JI,OA=b1,Bh=lt,Fa=qn,cc=Pr,NA=hi,DA=oM,Gk=Hn,Yk=Jp,Xk=iM,jA=hM,$A="~effect/Deferred",UA={[$A]:{_A:Fe,_E:Fe},pipe(){return $t(this,arguments)}},sg=()=>{const e=Object.create(UA);return e.resumes=void 0,e.effect=void 0,e},og=e=>fr(t=>e.effect?t(e.effect):(e.resumes??(e.resumes=[]),e.resumes.push(t),kt(()=>{const n=e.resumes.indexOf(t);e.resumes.splice(n,1)}))),BA=se(2,(e,t)=>kt(()=>Ia(e,t))),Zk=BA,Ia=(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},zA=se(2,(e,t)=>Dk(n=>Ue(rf(n(e)),o=>Zk(t,o)))),VA=zp,HS=sf,ig=Xp,hl=DM,qA=gi,WA=OM,ml=LM,lf=Ik,HA="~effect/Layer",KS="~effect/Layer/MemoMap",KA={[HA]:{_ROut:Fe,_E:Fe,_RIn:Fe},pipe(){return $t(this,arguments)}},eE=e=>{const t=Object.create(KA);return t.build=e,t},ag=e=>eE((t,n)=>{const o=ml(n);return Ms(e(t,o),i=>i._tag==="Failure"?lf(o,i):ut)}),QA=e=>{const t=ag((n,o)=>n.getOrElseMemoize(t,o,e));return t};class JA{constructor(){L(this,"map",new Map)}get[KS](){return KS}getOrElseMemoize(t,n,o){if(this.map.has(t)){const d=this.map.get(t);return d.observers++,nc(gi(n,h=>d.finalizer(h)),d.effect)}const i=ig(),c=sg(),l={observers:1,effect:og(c),finalizer:d=>Et(()=>(l.observers--,l.observers===0?(this.map.delete(t),lf(i,d)):ut))};return this.map.set(t,l),gi(n,l.finalizer).pipe(Ue(()=>o(this,i)),Ms(d=>(l.effect=d,Zk(c,d))))}}const cg=()=>new JA,Al=class Al extends Kn()("effect/Layer/CurrentMemoMap"){};L(Al,"getOrCreate",RR(Al,cg));let qa=Al;const ug=se(3,(e,t,n)=>sc(jt(e.build(t,n),Ts(qa,t)),qa,t)),GA=se(2,(e,t)=>Ke(n=>ug(e,qa.getOrCreate(n.context),t))),lg=function(){return arguments.length===1?e=>QS(mi(arguments[0],e)):QS(mi(arguments[0],arguments[1]))},QS=e=>eE(Ps(Ie(e))),Lm=function(){return arguments.length===1?e=>JS(arguments[0],e):JS(arguments[0],arguments[1])},JS=(e,t)=>Om(jt(t,n=>mi(e,n))),Om=e=>QA((t,n)=>hl(e,n)),tE=(e,t,n)=>{const o=ml(n,"parallel");return Zs(e,i=>i.build(t,ml(o,"sequential")),{concurrency:e.length}).pipe(jt(i=>LR(...i)))},nE=(...e)=>ag((t,n)=>tE(e,t,n)),YA=(e,t,n)=>ag((o,i)=>Ue(Array.isArray(t)?tE(t,o,i):t.build(o,i),c=>e.build(o,i).pipe(rc(c),jt(l=>n(l,c))))),Nm=se(2,(e,t)=>YA(e,t,Fe)),XA=class extends jl{constructor(t){super(),t&&Object.assign(this,t)}},ZA=se(2,(e,t)=>{const n=GS(e),o=GS(t),i=n>o?n:o,c=parseInt(e.toFixed(i).replace(".","")),l=parseInt(t.toFixed(i).replace(".",""));return c%l/Math.pow(10,i)});function GS(e){const t=e.toString(),n=t.indexOf("e-");if(n!==-1){const o=parseInt(t.slice(n+2));return(t.slice(0,n).split(".")[1]||"").length+o}return(t.split(".")[1]||"").length}const pl=se(2,(e,t)=>Pk(e,nL,n=>t(n))),YS=e=>e.reasons.some(eL),eL=e=>e._tag==="Fail"&&rg(e.error),tL=nk(ac,e=>rg(e)?Kr(e):ar(e)),nL=nk(ac,e=>rg(e)?Kr(e.value):ar(e)),rE=se(2,(e,t)=>nf(e,{onSuccess:t.onSuccess,onFailure:n=>{const o=tL(n);return Mt(o)?t.onFailure(o.failure):t.onDone(o.success.value)}})),sE="~effect/Schedule",XS=rt("effect/Schedule/CurrentMetadata",{defaultValue:Ps({input:void 0,output:void 0,duration:Bp,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),rL={[sE]:{_Out:Fe,_In:Fe,_Env:Fe},pipe(){return $t(this,arguments)}},sL=e=>Be(e,sE),ff=e=>{const t=Object.create(rL);return t.step=e,t},fg=()=>{let e=0,t,n;return(o,i)=>{n===void 0&&(n=o);const c=o-n,l=t===void 0?0:o-t;return t=o,{input:i,attempt:++e,start:n,now:o,elapsed:c,elapsedSincePrevious:l}}},oE=e=>ff(jt(e,t=>{const n=fg();return(o,i)=>t(n(o,i))})),Wa=e=>oc(e.step,t=>Ie(()=>Gt(t))),oL=e=>Wk(t=>jt(Wa(e),n=>{const o=fg();return i=>Et(()=>{const c=t.currentTimeMillisUnsafe();return Ue(n(c,i),([l,d])=>{const h=o(c,i);return h.output=l,h.duration=d,ki(ng(d),h)})})})),iL=se(2,(e,t)=>aL(e,t,(n,o)=>[n,o])),aL=se(3,(e,t,n)=>ff(jt(yM(Wa(e),Wa(t)),([o,i])=>(c,l)=>rE(o(c,l),{onSuccess:d=>i(c,l).pipe(jt(h=>[n(d[0],h[0]),ZR(d[1],h[1])]),pl(h=>Ie([n(d[0],h),d[1]]))),onFailure:Gt,onDone:d=>i(c,l).pipe(jt(h=>[n(d,h[0]),h[1]]),pl(h=>uf(n(d,h))))})))),cL=(e,t=2)=>{const n=ek(Up(e));return oE(Ie(o=>{const i=Ba(n*Math.pow(t,o.attempt-1));return Ie([i,i])}))},iE=e=>ff(jt(Wa(e),t=>(n,o)=>rE(t(n,o),{onSuccess:i=>Ie([o,i[1]]),onFailure:Gt,onDone:()=>uf(o)}))),uL=e=>Ku(cE,({attempt:t})=>Ie(t<=e)),aE=e=>{const t=Up(e);return oE(Ie(n=>Ie([n.attempt-1,t])))},Ku=se(2,(e,t)=>ff(jt(Wa(e),n=>{const o=fg();return(i,c)=>Ue(n(i,c),l=>{const[d,h]=l,p=t({...o(i,c),output:d,duration:h});return Ue(Jt(p)?p:Ie(p),y=>y?Ie(l):uf(d))})}))),cE=aE(Bp),lL=(e,t,n)=>Mk(o=>Ue(n!=null&&n.local?ug(t,cg(),o):GA(t,o),i=>rc(e,i))),fL=se(e=>Jt(e[0]),(e,t,n)=>G1(t)?rc(e,t):lL(e,Array.isArray(t)?nE(...t):t,n)),dL=se(3,(e,t,n)=>Ue(oL(t),o=>{let i=XS.defaultValue(),c;const l=tf(Et(()=>sc(e,XS,i)),d=>(c=d,Ue(o(d),h=>(i=h,l))));return pl(l,d=>nn(()=>n(c,d)))})),hL=se(2,(e,t)=>{const n=typeof t=="function"?t(Fe):sL(t)?t:pL(t);return dL(e,n,Xl)}),mL=iE(cE),pL=e=>{let t=e.schedule?iE(e.schedule):mL;return e.while&&(t=Ku(t,({input:n})=>{const o=e.while(n);return Jt(o)?o:Ie(o)})),e.until&&(t=Ku(t,({input:n})=>{const o=e.until(n);return Jt(o)?jt(o,i=>!i):Ie(!o)})),e.times!==void 0&&(t=Ku(t,({attempt:n})=>Ie(n<=e.times))),t},ui=Jt,uE=Zs,lE=Zp,gL=WT,ft=Ie,dg=qT,yL=VT,Cr=Et,Vn=kt,gt=ut,ZS=fr,vL=QT,Dm=JT,Ge=Xl,SL=Gt,xL=Zl,gl=Ke,Rn=Ue,wL=eM,kL=nc,EL=kk,ex=rf,As=jt,yl=oc,_L=kM,Qu=CM,CL=wM,bL=hL,PL=bM,FL=MM,fE=Fk,IL=TM,dE=_k,RL=nf,vl=pM,hE=bk,TL=fL,co=rc,ML=mM,AL=ef,LL=sc,OL=Mk,mE=jM,pE=$M,NL=BM,gE=Ms,jm=qM,hg=Nk,DL=VM,yE=SM,jL=aA,$L=lA,tx=fA,UL=$k,mg=JM,$m=YM,Sl=ic,BL=Uk,zL=XM,Ju=eA,VL=Bk,qL=ZM,WL=eg,pg=nA,HL=zk,vE=tA,KL=tg,uo=xk,QL=Qk("Error"),JL=se(e=>ui(e[0]),(e,...t)=>Ck(e,VA,n=>{const o={...n};return t.length===1?Object.assign(o,t[0]):o[t[0]]=t[1],o})),SE=tM,wo=nM,Ha=rM,oi=ZT,GL=sM,Um=GT;function wa(e,t,n){return t==="__proto__"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n,e}function xE(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function YL(e){return t=>{var n;return(n=xE(t))==null?void 0:n[e]}}const XL=YL("identifier"),gg=Fs(e=>{const t=XL(e);return typeof t=="string"?t:e.getExpected(gg)}),ZL=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),Gu=new WeakMap,wE="~effect/data/Redacted",eO=e=>Be(e,wE),nx=(e,t)=>{const n=Object.create(tO);return Gu.set(n,e),n},tO={[wE]:{_A:e=>e},label:void 0,...Rs,toJSON(){return this.toString()},toString(){return`<redacted${Fp(this.label)?":"+this.label:""}>`},[sn](){return vt(Gu.get(this))},[on](e){return eO(e)&&Pn(Gu.get(this),Gu.get(e))}},Bm="~effect/SchemaIssue/Issue";function nO(e){return Be(e,Bm)}var yw;let Fr=(yw=Bm,class{constructor(){L(this,yw,Bm)}toString(){return fO(this)}}),rO=class extends Fr{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 sO extends Fr{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 ur extends Fr{constructor(n,o){super();L(this,"_tag","Pointer");L(this,"path");L(this,"issue");this.path=n,this.issue=o}}class kE extends Fr{constructor(n){super();L(this,"_tag","MissingKey");L(this,"annotations");this.annotations=n}}class EE extends Fr{constructor(n,o){super();L(this,"_tag","UnexpectedKey");L(this,"ast");L(this,"actual");this.ast=n,this.actual=o}}class Qt extends Fr{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 Ir extends Fr{constructor(n,o){super();L(this,"_tag","InvalidType");L(this,"ast");L(this,"actual");this.ast=n,this.actual=o}}class xl extends Fr{constructor(n,o){super();L(this,"_tag","InvalidValue");L(this,"actual");L(this,"annotations");this.actual=n,this.annotations=o}}class rx extends Fr{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 oO extends Fr{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 zm(e,t){if(nO(t))return t;if(typeof t=="string")return new xl(Ne(e),{message:t});const n=typeof t.issue=="string"?new xl(Ne(e),{message:t.issue}):t.issue;return new ur(t.path,n)}function iO(e,t){if(t!==void 0)return typeof t=="boolean"?t?void 0:new xl(Ne(e)):zm(e,t)}function aO(e,t,n){return Array.isArray(n)?ul(n)?n.length===1?zm(e,n[0]):new Qt(t,Ne(e),Q1(n,o=>zm(e,o))):void 0:iO(e,n)}const cO=e=>{const t=Ka(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return Vm(gg(e.ast),sx(e.actual));case"InvalidValue":return`Invalid data ${sx(e.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${ht(e.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${ht(e.actual)}`}},uO=e=>Ka(e.issue)??Ka(e);function Vm(e,t){return`Expected ${e}, got ${t}`}function si(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:Vm(_E(e.filter),ht(e.actual))}];default:return si(e.issue,t,n,o)}}case"Encoding":return si(e.issue,t,n,o);case"Pointer":return si(e.issue,[...t,...e.path],n,o);case"Composite":return e.issues.flatMap(i=>si(i,t,n,o));case"AnyOf":{const i=Ka(e);if(e.issues.length===0){if(i!==void 0)return[{path:t,message:i}];const c=Vm(gg(e.ast),ht(e.actual));return[{path:t,message:c}]}return e.issues.flatMap(c=>si(c,t,n,o))}default:return[{path:t,message:n(e)}]}}function _E(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=>_E(o)).join(" & ")}}function lO(){return e=>si(e,[],cO,uO).map(dO).join(`
|
|
82
|
+
`)}const fO=lO();function dO(e){let t=e.message;if(e.path&&e.path.length>0){const n=II(e.path);t+=`
|
|
83
|
+
at ${n}`}return t}function Ka(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return va(e.ast.annotations);case"InvalidValue":case"Forbidden":return va(e.annotations);case"MissingKey":return va(e.annotations,"messageMissingKey");case"UnexpectedKey":return va(e.ast.annotations,"messageUnexpectedKey");case"Filter":return va(e.filter.annotations);case"Encoding":return Ka(e.issue)}}function va(e,t="message"){const n=e==null?void 0:e[t];if(typeof n=="string")return n}function sx(e){return So(e)?"no value provided":ht(e.value)}class yi extends jl{constructor(n){super();L(this,"run");this.run=n}map(n){return new yi((o,i)=>this.run(o,i).pipe(SE($p(n))))}compose(n){return ox(this)?n:ox(n)?this:new yi((o,i)=>this.run(o,i).pipe(oi(c=>n.run(c,i))))}}const CE=new yi(ft);function ox(e){return e.run===CE.run}function vi(){return CE}function yn(e){return hO($p(e))}function hO(e){return new yi(t=>ft(e(t)))}function mO(e){return new yi(t=>{const n=uR(t,nI);return _s(n)?ft(n):As(e,Ne)})}function pO(){return yn(globalThis.String)}function bE(){return yn(globalThis.Number)}const qm="~effect/SchemaTransformation/Transformation";var vw;vw=qm;const Ll=class Ll{constructor(t,n){L(this,vw,qm);L(this,"_tag","Transformation");L(this,"decode");L(this,"encode");this.decode=t,this.encode=n}flip(){return new Ll(this.encode,this.decode)}compose(t){return new Ll(this.decode.compose(t.decode),t.encode.compose(this.encode))}};let Tn=Ll;function gO(e){return Be(e,qm)}const PE=e=>gO(e)?e:new Tn(e.decode,e.encode);function df(e){return new Tn(yn(e.decode),yn(e.encode))}const yO=new Tn(vi(),vi());function yg(){return yO}const FE=new Tn(bE(),pO()),IE=e=>df({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 ko(e){return t=>t._tag===e}const RE=ko("Declaration"),vO=ko("Never"),wl=ko("Literal"),SO=ko("UniqueSymbol"),xO=ko("Arrays"),wO=ko("Objects"),kO=ko("Union");class At{constructor(t,n){L(this,"to");L(this,"transformation");this.to=t,this.transformation=n}}const EO={};class Si{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 ix="~effect/Schema";var Sw;Sw=ix;class Sn{constructor(t=void 0,n=void 0,o=void 0,i=void 0){L(this,Sw,ix);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 uc extends Sn{constructor(n,o,i,c,l,d){super(i,c,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)?dg:SE(n(o.value,this,i),Ne)}recur(n){const o=xi(this.typeParameters,n);return o===this.typeParameters?this:new uc(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 _O=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Null")}getParser(){return pf(this,null)}getExpected(){return"null"}};const vg=new _O;let CO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Undefined")}getParser(){return pf(this,void 0)}toCodecJson(){return Rt(this,[TE])}getExpected(){return"undefined"}};const TE=new At(vg,new Tn(yn(()=>{}),yn(()=>null))),bO=new CO;let PO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Void")}getParser(){return pf(this,void 0)}toCodecJson(){return Rt(this,[TE])}getExpected(){return"void"}};const FO=new PO;let IO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Never")}getParser(){return Eo(this,sI)}getExpected(){return"never"}};const RO=new IO;let TO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Any")}getParser(){return Eo(this,S1)}getExpected(){return"any"}};const MO=new TO;let AO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Unknown")}getParser(){return Eo(this,S1)}getExpected(){return"unknown"}};const Sg=new AO;let Ra=class extends Sn{constructor(n,o,i,c,l){super(o,i,c,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 ${ht(n)}`);this.literal=n}getParser(){return pf(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?ax(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:ax(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function ax(e){const t=globalThis.String(e.literal);return Rt(e,[new At(new Ra(t),new Tn(yn(()=>e.literal),yn(()=>t)))])}let LO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","String")}getParser(){return Eo(this,Fp)}getExpected(){return"string"}};const ME=new LO;let OO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Number")}getParser(){return Eo(this,v1)}toCodecJson(){return this.checks&&(ka(this.checks,"isFinite")||ka(this.checks,"isInt"))?this:Rt(this,[HO])}toCodecStringTree(){return this.checks&&(ka(this.checks,"isFinite")||ka(this.checks,"isInt"))?Rt(this,[n3]):Rt(this,[r3])}getExpected(){return"number"}};function ka(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 ka(n.checks,t)}})}const AE=new OO;let NO=class extends Sn{constructor(){super(...arguments);L(this,"_tag","Boolean")}getParser(){return Eo(this,tI)}getExpected(){return"boolean"}};const DO=new NO;class hf extends Sn{constructor(n,o,i,c,l,d,h){super(c,l,d,h);L(this,"_tag","Arrays");L(this,"isMutable");L(this,"elements");L(this,"rest");this.isMutable=n,this.elements=o,this.rest=i;const p=o.findIndex(Wr);if(p!==-1&&(o.slice(p+1).some(y=>!Wr(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(Wr))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(n){const o=this,i=o.elements.map(g=>({ast:g,parser:n(g)})),c=o.rest.map(g=>({ast:g,parser:n(g)})),l=i.length,[d,...h]=c,p=h.length;function y(g,v){return v<l?i[v]:v>=g?h[v-g]:d}return Um(function*(g,v){if(g._tag==="None")return g;const x=g.value;if(!Array.isArray(x))return yield*Ge(new Ir(o,g));const w=x.length,k={ast:o,getParser:y,oinput:g,len:w,tailThreshold:$O(w,l,p),output:new globalThis.Array(w),issues:void 0,options:v},P=xg(v==null?void 0:v.concurrency),q=jO(k,x,{concurrency:P==null?void 0:P.concurrency,end:o.rest.length===0?l:Math.max(w,l+p)});if(q&&(yield*q),o.rest.length===0&&w>l)for(let _=l;_<=w-1;_++){const A=new ur([_],new EE(o,x[_]));if(v.errors==="all")k.issues?k.issues.push(A):k.issues=[A];else return yield*Ge(new Qt(o,g,[A]))}return k.issues?yield*Ge(new Qt(o,g,k.issues)):Ne(k.output)})}recur(n){const o=xi(this.elements,n),i=xi(this.rest,n);return o===this.elements&&i===this.rest?this:new hf(this.isMutable,o,i,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}const jO=af()({onItem(e,t,n){const o=n<e.len?Ne(t):Wn();return e.getParser(e.tailThreshold,n).parser(o,e.options)},step(e,t,n,o){var i;if(n._tag==="Failure")return kl(e,e.ast,o,n);if(n.value._tag==="Some")e.output[o]=n.value.value;else{const c=e.getParser(e.tailThreshold,o);if(Wr(c.ast))return;const l=new ur([o],new kE((i=c.ast.context)==null?void 0:i.annotations));if(e.options.errors==="all")e.issues?e.issues.push(l):e.issues=[l];else return cc(new Qt(e.ast,e.oinput,[l]))}}});function $O(e,t,n){return Math.max(t,e-n)}const xg=e=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),kl=(e,t,n,o)=>{const i=ac(o.cause);if(Mt(i))return o;const c=new ur([n],i.success);if(e.options.errors==="all")e.issues?e.issues.push(c):e.issues=[c];else return cc(new Qt(t,e.oinput,[c]))},wg="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",UO=new globalThis.RegExp(`(?:${wg}|Infinity|-Infinity|NaN)`);function LE(e,t){const n=ks(t);switch(n._tag){case"String":return Object.keys(e);case"TemplateLiteral":{const o=XO(n);return Object.keys(e).filter(i=>o.test(i))}case"Symbol":return Object.getOwnPropertySymbols(e);case"Number":return Object.keys(e).filter(o=>UO.test(o));case"Union":return[...new Set(n.types.flatMap(o=>LE(e,o)))];default:return[]}}class OE{constructor(t,n){L(this,"name");L(this,"type");this.name=t,this.type=n}}class BO{constructor(t,n,o){L(this,"parameter");L(this,"type");L(this,"merge");if(this.parameter=t,this.type=n,this.merge=o,Wr(n)&&!QE(n))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class kg extends Sn{constructor(n,o,i,c,l,d){super(i,c,l,d);L(this,"_tag","Objects");L(this,"propertySignatures");L(this,"indexSignatures");this.propertySignatures=n,this.indexSignatures=o;const h=n.map(p=>p.name).filter((p,y,g)=>g.indexOf(p)!==y);if(h.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(h)}. ts(2300)`)}getParser(n){const o=this,i=[],c=new Set,l=[];for(const p of o.propertySignatures)i.push(p.name),c.add(p.name),l.push({ps:p,parser:n(p.type),name:p.name,type:p.type});const d=o.indexSignatures.length;if(o.propertySignatures.length===0&&o.indexSignatures.length===0)return Eo(o,rI);const h=d>0?af()({onItem:Um(function*(p,[y,g]){const x=n(XE(g.parameter))(Ne(y),p.options),w=In(x)?x:yield*ex(x);if(w._tag==="Failure"){const A=kl(p,o,y,w);A&&(yield*A);return}const k=Ne(p.input[y]),q=n(g.type)(k,p.options),_=In(q)?q:yield*ex(q);if(_._tag==="Failure"){const A=kl(p,o,y,_);A&&(yield*A);return}else if(w.value._tag==="Some"&&_.value._tag==="Some"){const A=w.value.value,C=_.value.value;if(g.merge&&g.merge.decode&&Object.hasOwn(p.out,A)){const[D,U]=g.merge.decode.combine([A,p.out[A]],[A,C]);wa(p.out,D,U)}else wa(p.out,A,C)}}),step:(p,y,g)=>g._tag==="Failure"?g:void 0}):void 0;return Um(function*(p,y){if(p._tag==="None")return p;const g=p.value;if(!(typeof g=="object"&&g!==null&&!Array.isArray(g)))return yield*Ge(new Ir(o,p));const v={},x={ast:o,oinput:p,input:g,out:v,issues:void 0,options:y},w=y.errors==="all",k=y.onExcessProperty==="error",P=y.onExcessProperty==="preserve";let q;if(o.indexSignatures.length===0&&(k||P)){q=Reflect.ownKeys(g);for(let C=0;C<q.length;C++){const D=q[C];if(!c.has(D))if(k){const U=new ur([D],new EE(o,g[D]));if(w){x.issues?x.issues.push(U):x.issues=[U];continue}else return yield*Ge(new Qt(o,p,[U]))}else wa(v,D,g[D])}}const _=xg(y==null?void 0:y.concurrency),A=zO(x,l,_);if(A&&(yield*A),h){const C=CR();for(let U=0;U<d;U++){const O=o.indexSignatures[U],T=LE(g,O.parameter);for(let V=0;V<T.length;V++){const ee=T[V];C.push([ee,O])}}const D=h(x,C,_);D&&(yield*D)}if(x.issues)return yield*Ge(new Qt(o,p,x.issues));if(y.propertyOrder==="original"){const C=(q??Reflect.ownKeys(g)).concat(i),D={};for(const U of C)Object.hasOwn(v,U)&&wa(D,U,v[U]);return Ne(D)}return Ne(v)})}rebuild(n,o){const i=xi(this.propertySignatures,l=>{const d=n(l.type);return d===l.type?l:new OE(l.name,d)}),c=xi(this.indexSignatures,l=>{var y;const d=n(l.parameter),h=n(l.type),p=o?(y=l.merge)==null?void 0:y.flip():l.merge;return d===l.parameter&&h===l.type&&p===l.merge?l:new BO(d,h,p)});return i===this.propertySignatures&&c===this.indexSignatures?this:new kg(i,c,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 zO=af()({onItem(e,t){const n=Object.hasOwn(e.input,t.name)?Ne(e.input[t.name]):Wn();return t.parser(n,e.options)},step(e,t,n){var o;if(n._tag==="Failure")return kl(e,e.ast,t.name,n);if(n.value._tag==="Some")wa(e.out,t.name,n.value.value);else if(!Wr(t.type)){const i=new ur([t.name],new kE((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 cc(new Qt(e.ast,e.oinput,[i]))}}});function Eg(e,t,n){return new kg(Reflect.ownKeys(e).map(o=>new OE(o,e[o].ast)),[],n,t)}function NE(e){return e.ast}function _g(e,t,n){return new lc(e.map(NE),t,void 0,n)}function DE(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(DE)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function Cg(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(!Wr(o)){if(wl(o))return[{key:n.name,literal:o.literal}];if(SO(o))return[{key:n.name,literal:o.symbol}]}return[]});case"Arrays":return e.elements.flatMap((n,o)=>wl(n)&&!Wr(n)?[{key:o,literal:n.literal}]:[]);case"Suspend":return Cg(e.thunk())}}const cx=new WeakMap;function VO(e){var n,o;let t=cx.get(e);if(t)return t;t={};for(const i of e){const c=ks(i);if(vO(c))continue;const l=DE(c),d=Cg(c);t.byType??(t.byType={});for(const h of l)((n=t.byType)[h]??(n[h]=[])).push(i);if(d.length>0){t.bySentinel??(t.bySentinel=new Map);for(const{key:h,literal:p}of d){let y=t.bySentinel.get(h);y||t.bySentinel.set(h,y=new Map);let g=y.get(p);g||y.set(p,g=[]),g.push(i)}}else{t.otherwise??(t.otherwise={});for(const h of l)((o=t.otherwise)[h]??(o[h]=[])).push(i)}}return cx.set(e,t),t}function ux(e){return t=>{const n=ks(t);return n._tag==="Literal"?n.literal===e:n._tag==="UniqueSymbol"?n.symbol===e:!0}}function qO(e,t){var i,c;const n=VO(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,h]of n.bySentinel)if(Object.hasOwn(e,d)){const p=h.get(e[d]);if(p)return[...p,...l].filter(ux(e))}}return l}return(((c=n.byType)==null?void 0:c[o])??[]).filter(ux(e))}let lc=class jE extends Sn{constructor(n,o,i,c,l,d){super(i,c,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,c)=>{if(i._tag==="None")return ft(i);const l=i.value,d=qO(l,o.types),h={ast:o,recur:n,oinput:i,input:l,out:void 0,successes:[],issues:void 0,options:c},p=xg(c==null?void 0:c.concurrency),y=WO(h,d,p);return y?Rn(y,g=>h.out?ft(h.out):Ge(new rx(o,l,h.issues??[]))):h.out?ft(h.out):Ge(new rx(o,l,h.issues??[]))}}recur(n){const o=xi(this.types,n);return o===this.types?this:new jE(o,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(n){var c;const o=(c=this.annotations)==null?void 0:c.expected;if(typeof o=="string")return o;if(this.types.length===0)return"never";const i=this.types.map(l=>{const d=ks(l);switch(d._tag){case"Arrays":{const h=d.elements.filter(wl);if(h.length>0)return`${lx(d.isMutable)}[ ${h.map(p=>{var y;return n(p)+fx((y=p.context)==null?void 0:y.isOptional)}).join(", ")}, ... ]`;break}case"Objects":{const h=d.propertySignatures.filter(p=>wl(p.type));if(h.length>0)return`{ ${h.map(p=>{var y,g;return`${lx((y=p.type.context)==null?void 0:y.isMutable)}${cl(p.name)}${fx((g=p.type.context)==null?void 0:g.isOptional)}: ${n(p.type)}`}).join(", ")}, ... }`;break}}return n(d)});return Array.from(new Set(i)).join(" | ")}};const WO=af()({onItem(e,t){return e.recur(t)(e.oinput,e.options)},step(e,t,n){if(n._tag==="Failure"){const o=ac(n.cause);if(Mt(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),cc(new oO(e.ast,e.input,e.successes));if(e.out=n.value,e.successes.push(t),e.ast.mode==="anyOf")return Gk}}}),$E=new lc([new Ra("Infinity"),new Ra("-Infinity"),new Ra("NaN")],"anyOf"),HO=new At(new lc([AE,$E],"anyOf"),new Tn(bE(),yn(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function lx(e){return e?"":"readonly "}function fx(e){return e?"?":""}class El extends jl{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 El(this.run,{...this.annotations,...n},this.aborted)}abort(){return new El(this.run,this.annotations,!0)}and(n,o){return new _l([this,n],o)}}class _l extends jl{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 _l(this.checks,{...this.annotations,...n})}and(n,o){return new _l([this,n],o)}}function UE(e,t,n=!1){return new El((o,i,c)=>aO(o,i,e(o,i,c)),t,n)}function BE(e,t){const n=e.source;return UE(o=>e.test(o),{expected:`a string matching the RegExp ${n}`,meta:{_tag:"isPattern",regExp:e},toArbitraryConstraint:{string:{patterns:[e.source]}},...t})}function mf(e,t){const n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}function Rt(e,t){return e.encoding===t?e:mf(e,n=>{n.encoding.value=t})}function bg(e,t){return e.context===t?e:mf(e,n=>{n.context.value=t})}function zE(e,t){if(e.checks){const n=e.checks[e.checks.length-1];return VE(e,K1(e.checks.slice(0,-1),n.annotate(t)))}return mf(e,n=>{n.annotations.value={...n.annotations.value,...t}})}function VE(e,t){return e.checks===t?e:mf(e,n=>{n.checks.value=t})}function Pg(e,t){return VE(e,e.checks?[...e.checks,...t]:t)}function qE(e,t){const n=e,o=n[n.length-1],i=t(o.to);return i!==o.to?K1(e.slice(0,e.length-1),new At(i,o.transformation)):e}function KO(e){return t=>t.encoding?Rt(t,qE(t.encoding,e)):t}function QO(e,t,n){const o=new At(e,t);return Rt(n,n.encoding?[...n.encoding,o]:[o])}function xi(e,t){let n=!1;const o=new Array(e.length);for(let i=0;i<e.length;i++){const c=e[i],l=t(c);l!==c&&(n=!0),o[i]=l}return n?o:e}function WE(e,t){const n=e.context?new Si(e.context.isOptional,e.context.isMutable,e.context.defaultValue,{...e.context.annotations,...t}):new Si(!1,!1,void 0,t);return bg(e,n)}const HE=KO(KE);function KE(e){const t=e.context?e.context.isOptional===!1?new Si(!0,e.context.isMutable,e.context.defaultValue,e.context.annotations):e.context:new Si(!0,!1);return HE(bg(e,t))}function JO(e,t){const n=new Tn(mO(t),vi()),o=[new At(Sg,n)],i=e.context?new Si(e.context.isOptional,e.context.isMutable,o,e.context.annotations):new Si(!1,!1,o);return bg(e,i)}function GO(e,t,n){return QO(e,n,t)}function Wr(e){var t;return((t=e.context)==null?void 0:t.isOptional)??!1}const Cl=Fs(e=>{var n;if(e.encoding)return Cl(Rt(e,void 0));const t=e;return((n=t.recur)==null?void 0:n.call(t,Cl))??t}),ks=Fs(e=>Cl(lo(e)));function YO(e,t){const n=t,o=n.length,i=n[o-1],c=[new At(lo(Rt(e,void 0)),n[0].transformation.flip())];for(let d=1;d<o;d++)c.unshift(new At(lo(n[d-1].to),n[d].transformation.flip()));const l=lo(i.to);return l.encoding?Rt(l,[...l.encoding,...c]):Rt(l,c)}const lo=Fs(e=>{var n,o;if(e.encoding)return YO(e,e.encoding);const t=e;return((n=t.flip)==null?void 0:n.call(t,lo))??((o=t.recur)==null?void 0:o.call(t,lo))??t});function QE(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(QE);default:return!1}}function JE(e,t){return e.encodedParts.map(n=>ZO(n,GE(n),t)).join("")}const XO=Fs(e=>new globalThis.RegExp(`^${JE(e,!0)}$`));function GE(e){switch(e._tag){case"Literal":return ZL(globalThis.String(e.literal));case"String":return e3;case"Number":return wg;case"BigInt":return s3;case"TemplateLiteral":return JE(e,!1);case"Union":return e.types.map(GE).join("|")}}function ZO(e,t,n){if(kO(e)){if(!n)return`(?:${t})`}else if(!n)return t;return`(${t})`}function pf(e,t){const n=yL(t);return o=>o._tag==="None"?dg:o.value===t?n:Ge(new Ir(e,o))}function Eo(e,t){return n=>n._tag==="None"?dg:t(n.value)?ft(n):Ge(new Ir(e,n))}function YE(e){function t(n){return n.encoding?Rt(n,qE(n.encoding,t)):e(n)}return Fs(t)}const XE=YE(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(XE)}}),e3="[\\s\\S]*?",dx=new globalThis.RegExp(`^${wg}$`);function t3(e){return BE(dx,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:dx},...e})}const ZE=Pg(ME,[t3()]),n3=new At(ZE,FE),r3=new At(new lc([ZE,$E],"anyOf"),FE),s3="-?\\d+";function Wm(e,t,n,o,i){for(let c=0;c<e.length;c++){const l=e[c];if(l._tag==="FilterGroup")Wm(l.checks,t,n,o,i);else{const d=l.run(t,o,i);if(d&&(n.push(new rO(t,l,d)),l.aborted||(i==null?void 0:i.errors)!=="all"))return}}}const e_="~effect/Schema/Class",o3="~structural";function i3(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 c=Array.isArray(i)?i.every(o):Object.keys(i).every(l=>o(i[l]));return t.delete(i),c&&n.add(i),c}}const a3=new uc([],()=>(e,t)=>i3(e)?ft(e):Ge(new Ir(t,Ne(e))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new At(Sg,yg())}),c3=new At(vg,new Tn(vi(),yn(()=>null))),u3=new At(a3,yg()),l3=gk,t_=Kp,f3=dl,Hm=Hp,d3=GM,n_=sA,h3=Symbol.for("effect/MutableList/Empty"),m3=()=>({head:void 0,tail:void 0,length:0}),hx=()=>({array:[],mutable:!0,offset:0,next:void 0}),Km=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=hx(),e.tail=e.tail.next):e.head=e.tail=hx(),e.tail.array.push(t),e.length++},p3=(e,t)=>g3(e,_r(t),!Array.isArray(t)),g3=(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},Yu=e=>{e.head=e.tail=void 0,e.length=0},r_=(e,t)=>{var c;if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&((c=e.head)==null?void 0:c.offset)===0&&!e.head.next){const l=e.head.array;return Yu(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&&Yu(e),n;i=i.next}return Yu(e),n},y3=e=>{if(!e.head)return h3;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:Yu(e)),t},v3="~effect/Queue",S3="~effect/Queue/Enqueue",x3="~effect/Queue/Dequeue",zh={_A:Fe,_E:Fe},w3={[v3]:zh,[S3]:zh,[x3]:zh,...Rs,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:F3(this)}}},k3=e=>Ke(t=>{const n=Object.create(w3);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=m3(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},Ie(n)}),E3=e=>k3({capacity:e}),_3=(e,t)=>Et(()=>{if(e.state._tag!=="Open")return Ie(_r(t));const n=C3(e,t);return n.length===0?lt([]):e.strategy==="dropping"?Ie(n):A3(e,n)}),C3=(e,t)=>{if(e.state._tag!=="Open")return _r(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy==="sliding")return p3(e.messages,t),e.strategy==="sliding"&&r_(e.messages,e.messages.length-e.capacity),px(e),[];const n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return _r(t);const o=[];let i=0;for(const c of t)i<n?Km(e.messages,c):o.push(c),i++;return px(e),o},Ea=se(2,(e,t)=>kt(()=>b3(e,t))),b3=(e,t)=>{if(e.state._tag!=="Open")return!1;const n=qn(t),o=fM(n,R3);return e.state.offers.size===0&&e.messages.length===0?(o_(e,o),!0):(e.state={...e.state,_tag:"Closing",exit:o},!0)},mx=e=>Ea(e,F1(Np())),P3=e=>s_(e,1,Number.POSITIVE_INFINITY),s_=(e,t,n)=>Et(()=>M3(e,t,n)??nc(L3(e),s_(e,1,n))),F3=e=>e.state._tag==="Done"?0:e.messages.length,I3=lt(!0),R3=Pr(Np()),T3=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(Hn),e.messages.length===0)break}},px=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>T3(e),0))},M3=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;if(n<=0||t<=0)return lt([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Vh(e),e.capacity=0;const o=[y3(e.messages)];return Vh(e),lt(o)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){const o=r_(e.messages,n);return Vh(e),lt(o)}},A3=(e,t)=>fr(n=>{if(e.state._tag!=="Open")return n(lt(t));const o={_tag:"Array",remaining:t,offset:0,resume:n};return e.state.offers.add(o),kt(()=>{e.state._tag==="Open"&&e.state.offers.delete(o)})}),Vh=e=>{if(e.state._tag==="Done")return YS(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(o_(e,e.state.exit),YS(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")Km(e.messages,n.message),t--,n.resume(I3),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;Km(e.messages,n.remaining[n.offset]),t--}n.resume(lt([])),e.state.offers.delete(n)}}return!1},L3=e=>fr(t=>e.state._tag==="Done"?t(e.state.exit):(e.state.takers.add(t),kt(()=>{e.state._tag!=="Done"&&e.state.takers.delete(t)}))),o_=(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()},O3="~effect/Channel",N3={[O3]:{_Env:Fe,_InErr:Fe,_InElem:Fe,_OutErr:Fe,_OutElem:Fe},pipe(){return $t(this,arguments)}},fc=e=>{const t=Object.create(N3);return t.transform=(n,o)=>yl(e(n,o),i=>ft(SL(i))),t},D3=(e,t)=>fc((n,o)=>Rn(dc(e)(n,o),i=>t(i,o))),j3=e=>fc((t,n)=>e),dc=e=>e.transform,$3=e=>fc((t,n)=>Cr(()=>dc(e())(t,n))),U3=e=>j3(ft(P3(e))),B3=se(2,(e,t)=>D3(e,n=>Vn(()=>{let o=0;return As(n,i=>t(i,o++))}))),z3=e=>fc((t,n)=>{let o;return ft(Cr(()=>o||e.pipe(hl(n),Rn(i=>dc(i)(t,n)),Rn(i=>o=i))))}),V3=(e,t,n)=>Cr(()=>{const o=ig(),i=dc(e)(uf(),o);return pl(Rn(i,t),ft).pipe(gE(c=>lf(o,c)))}),q3=se(2,(e,t)=>fc((n,o)=>As(co(dc(e)(n,o),t),co(t)))),W3=se(2,(e,t)=>V3(e,n=>yE(Rn(n,t),{disableYield:!0}))),_i=e=>e,_a=Fs(e=>{var t;switch(e._tag){case"Declaration":{const n=(t=e.annotations)==null?void 0:t[e_];if(Ul(n)){const o=n(e.typeParameters),i=_a(o.to);return Rt(e,i===o.to?[o]:[new At(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?Rt(_a(n),o):_a(n)});case"Suspend":return e.recur(_a);default:return e}});function gf(e){const t=_a(Cl(e.ast)),n=Fg(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 i_(e){const t=gf(e);return(n,o)=>jA(vE(t(n,o)))}function H3(e){const t=gf(e);return(n,o)=>pg(wo(t(n,o),i=>new Error(i.toString(),{cause:i})))}function go(e){return Fg(e.ast)}function K3(e){return G3(go(e))}const Q3=K3;function J3(e){return Fg(lo(e.ast))}function Fg(e){const t=Xu(e);return(n,o)=>oi(t(Ne(n),o??EO),i=>i._tag==="None"?Ge(new xl(i)):ft(i.value))}function G3(e){return(t,n)=>pg(wo(e(t,n),o=>new Error(o.toString(),{cause:o})))}const Xu=Fs(e=>{var i;let t;const n=(i=xE(e))==null?void 0:i.parseOptions;if(!e.context&&!e.encoding&&!e.checks)return(c,l)=>(t??(t=e.getParser(Xu)),n&&(l={...l,...n}),t(c,l));const o=xO(e)||wO(e)||RE(e)&&e.typeParameters.length>0;return(c,l)=>{n&&(l={...l,...n});const d=e.encoding;let h;if(d){const y=d,g=y.length;for(let v=g-1;v>=0;v--){const x=y[v],w=x.to,k=Xu(w);if(h=h?oi(h,P=>k(P,l)):k(c,l),x.transformation._tag==="Transformation"){const P=x.transformation.decode;h=oi(h,q=>P.run(q,l))}else h=x.transformation.decode(h,l)}h=wo(h,v=>new sO(e,c,v))}t??(t=e.getParser(Xu));let p=h?oi(h,y=>t(y,l)):t(c,l);if(e.checks&&!(l!=null&&l.disableChecks)){const y=e.checks;(l==null?void 0:l.errors)==="all"&&o&&_s(c)&&(p=GL(p,g=>{const v=[];Wm(y.filter(w=>{var k;return(k=w.annotations)==null?void 0:k[o3]}),c.value,v,e,l);const x=IS(v)?g._tag==="Composite"&&g.ast===e?new Qt(e,g.actual,[...g.issues,...v]):new Qt(e,c,[g,...v]):g;return Ge(x)})),p=oi(p,g=>{if(_s(g)){const v=g.value,x=[];if(Wm(y,v,x,e,l),IS(x))return Ge(new Qt(e,g,x))}return ft(g)})}return p}}),Qm="~effect/Schema/Schema",Y3={[Qm]:Qm,pipe(){return $t(this,arguments)},annotate(e){return this.rebuild(zE(this.ast,e))},annotateKey(e){return this.rebuild(WE(this.ast,e))},check(...e){return this.rebuild(Pg(this.ast,e))}};function Ig(e,t){const n=Object.create(Y3);return t&&Object.assign(n,t),n.ast=e,n.rebuild=o=>Ig(o,t),n.makeEffect=y1(gf(n),wo(o=>new yf(o))),n.make=H3(n),n.makeOption=i_(n),n}const Jm="~effect/Schema/SchemaError";var xw;xw=Jm;class yf{constructor(t){L(this,xw,Jm);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 X3=eN(Z3);function Z3(e){switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function eN(e){return t=>{const n=new Map;for(let c=0;c<t.length;c++)n.set(ks(t[c]),c);const o=[...t].sort((c,l)=>{c=ks(c),l=ks(l);const d=e(c),h=e(l);return d!==h?d-h:n.get(c)-n.get(l)});return o.some((c,l)=>c!==t[l])?o:t}}const Ta=Qm;function vf(){return(e,t,n)=>Ye(new uc(e.map(NE),o=>t(o.map(i=>Ye(i))),n))}function a_(e,t){return vf()([],()=>(n,o)=>e(n)?ft(n):Ge(new Ir(o,Ne(n))),t)}function tN(e){return Be(e,Jm)}function gx(e){const t=go(e);return(n,o)=>wo(t(n,o),i=>new yf(i))}const nN=Q3;function rN(e){const t=J3(e);return(n,o)=>wo(t(n,o),i=>new yf(i))}const sN=rN,Ye=Ig;function Rg(e){return Be(e,Ta)&&e[Ta]===Ta}const xe=_i(e=>Ye(KE(e.ast),{schema:e})),Ci=_i(e=>xe(u_(e)));function dt(e){const t=Ye(new Ra(e),{literal:e,transform(n){return t.pipe(Pl(dt(n),{decode:yn(()=>n),encode:yn(()=>e)}))}});return t}const yx=Ye(RO),vx=Ye(MO),oN=Ye(Sg),iN=Ye(vg),aN=Ye(bO),de=Ye(ME),Tg=Ye(AE),at=Ye(DO),bl=Ye(FO);function Mg(e,t){return Ye(e,{fields:t,mapFields(n,o){const i=n(this.fields);return Mg(Eg(i,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function we(e){return Mg(Eg(e,void 0),e)}const qe=_i(e=>Ye(new hf(!1,[],[e.ast]),{schema:e})),cN=_i(e=>Ye(new hf(!1,[e.ast],[e.ast]),{schema:e}));function c_(e,t){return Ye(e,{members:t,mapMembers(n,o){const i=n(this.members);return c_(_g(i,this.ast.mode,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function rn(e,t){return c_(_g(e,"anyOf",void 0),e)}function We(e){const t=e.map(dt);return Ye(_g(t,"anyOf",void 0),{literals:e,members:t,mapMembers(n){return rn(n(this.members))},pick(n){return We(n)},transform(n){return rn(t.map((o,i)=>o.transform(n[i])))}})}const Me=_i(e=>rn([e,iN])),u_=_i(e=>rn([e,aN]));function Pl(e,t){return n=>Ye(GO(n.ast,e.ast,t?PE(t):yg()),{from:n,to:e})}function uN(e){return t=>Ye(JO(t.ast,e),{schema:t})}function xn(e){return dt(e).pipe(uN(ft(e)))}function lN(e,t){return we({_tag:xn(e),...t})}function fN(e,t){return a_(n=>n instanceof e,t)}function hc(){return(e,t)=>new At(e.ast,PE(t))}const mc=UE,dN=BE;function hN(e){return mc(t=>globalThis.Number.isFinite(t),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...e})}function mN(e){const t=W1(e.order),n=e.formatter??ht;return(o,i)=>{var c;return mc(l=>t(l,o),{expected:`a value greater than or equal to ${n(o)}`,...(c=e.annotate)==null?void 0:c.call(e,o),...i})}}function pN(e){const t=W1(e.order),n=q1(e.order),o=iR(e.order),i=oR(e.order),c=e.formatter??ht;return(l,d)=>{var y;const h=l.exclusiveMinimum?n:t,p=l.exclusiveMaximum?i:o;return mc(g=>h(g,l.minimum)&&p(g,l.maximum),{expected:`a value between ${c(l.minimum)}${l.exclusiveMinimum?" (excluded)":""} and ${c(l.maximum)}${l.exclusiveMaximum?" (excluded)":""}`,...(y=e.annotate)==null?void 0:y.call(e,l),...d})}}function gN(e){return(t,n)=>{var i;const o=e.formatter??ht;return mc(c=>e.remainder(c,t)===e.zero,{expected:`a value that is a multiple of ${o(t)}`,...(i=e.annotate)==null?void 0:i.call(e,t),...n})}}const l_=mN({order:jp,annotate:e=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:e},toArbitraryConstraint:{number:{min:e}}})}),Ur=pN({order:jp,annotate:e=>({meta:{_tag:"isBetween",...e},toArbitraryConstraint:{number:{min:e.minimum,max:e.maximum,...e.exclusiveMinimum&&{minExcluded:!0},...e.exclusiveMaximum&&{maxExcluded:!0}}}})}),qh=gN({remainder:ZA,zero:0,annotate:e=>({expected:`a value that is a multiple of ${e}`,meta:{_tag:"isMultipleOf",divisor:e}})});function yN(e){return mc(t=>globalThis.Number.isSafeInteger(t),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...e})}function Sx(e,t){const n=vf()([e,t],([o,i])=>(c,l,d)=>{if(!TA(c))return Ge(new Ir(l,Ne(c)));switch(c._tag){case"Fail":return Ha(go(o)(c.error,d),{onSuccess:Tm,onFailure:h=>new Qt(l,Ne(c),[new ur(["error"],h)])});case"Die":return Ha(go(i)(c.defect,d),{onSuccess:Mm,onFailure:h=>new Qt(l,Ne(c),[new ur(["defect"],h)])});case"Interrupt":return ft(c)}},{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])=>hc()(rn([we({_tag:dt("Fail"),error:o}),we({_tag:dt("Die"),defect:i}),we({_tag:dt("Interrupt"),fiberId:u_(be)})]),df({decode:c=>{switch(c._tag){case"Fail":return Tm(c.error);case"Die":return Mm(c.defect);case"Interrupt":return Am(c.fiberId)}},encode:Fe})),toArbitrary:([o,i])=>f_(o,i),toEquivalence:([o,i])=>d_(o,i),toFormatter:([o,i])=>h_(o,i)});return Ye(n.ast,{error:e,defect:t})}function f_(e,t){return(n,o)=>n.oneof(o!=null&&o.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},n.constant(Am()),n.integer({min:1}).map(Am),e.map(i=>Tm(i)),t.map(i=>Mm(i)))}function d_(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 h_(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 xx(e,t){const n=vf()([e,t],([o,i])=>{const c=qe(Sx(o,i));return(l,d,h)=>RA(l)?Ha(go(c)(l.reasons,h),{onSuccess:Rm,onFailure:p=>new Qt(d,Ne(l),[new ur(["failures"],p)])}):Ge(new Ir(d,Ne(l)))},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([o,i])=>hc()(qe(Sx(o,i)),df({decode:Rm,encode:({reasons:c})=>c})),toArbitrary:([o,i])=>m_(o,i),toEquivalence:([o,i])=>p_(o,i),toFormatter:([o,i])=>g_(o,i)});return Ye(n.ast,{error:e,defect:t})}function m_(e,t){return(n,o)=>n.array(f_(e,t)(n,o)).map(Rm)}function p_(e,t){const n=bI(d_(e,t));return(o,i)=>n(o.reasons,i.reasons)}function g_(e,t){const n=h_(e,t);return o=>`Cause([${o.reasons.map(n).join(", ")}])`}const y_=we({message:de,name:xe(de),stack:xe(de)}),vN=fN(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>hc()(y_,IE()),toArbitrary:()=>e=>e.string().map(t=>new globalThis.Error(t))}),wx=new Tn(vi(),yn(e=>{try{return JSON.parse(JSON.stringify(e))}catch{return ht(e)}})),dr=rn([y_.pipe(Pl(vN,IE())),vx.pipe(Pl(oN.annotate({toCodecJson:()=>hc()(vx,wx),toArbitrary:()=>e=>e.json()}),wx))]);function SN(e,t,n){const o=vf()([e,t,n],([i,c,l])=>{const d=xx(c,l);return(h,p,y)=>{if(!OA(h))return Ge(new Ir(p,Ne(h)));switch(h._tag){case"Success":return Ha(go(i)(h.value,y),{onSuccess:Bh,onFailure:g=>new Qt(p,Ne(h),[new ur(["value"],g)])});case"Failure":return Ha(go(d)(h.cause,y),{onSuccess:Fa,onFailure:g=>new Qt(p,Ne(h),[new ur(["cause"],g)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([i,c,l])=>hc()(rn([we({_tag:dt("Success"),value:i}),we({_tag:dt("Failure"),cause:xx(c,l)})]),df({decode:d=>d._tag==="Success"?Bh(d.value):Fa(d.cause),encode:d=>Yk(d)?{_tag:"Success",value:d.value}:{_tag:"Failure",cause:d.cause}})),toArbitrary:([i,c,l])=>(d,h)=>d.oneof(h!=null&&h.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},i.map(p=>Bh(p)),m_(c,l)(d,h).map(p=>Fa(p))),toEquivalence:([i,c,l])=>{const d=p_(c,l);return(h,p)=>{if(h._tag!==p._tag)return!1;switch(h._tag){case"Success":return i(h.value,p.value);case"Failure":return d(h.cause,p.cause)}}},toFormatter:([i,c,l])=>{const d=g_(c,l);return h=>{switch(h._tag){case"Success":return`Exit.Success(${i(h.value)})`;case"Failure":return`Exit.Failure(${d(h.cause)})`}}}});return Ye(o.ast,{value:e,error:t,defect:n})}const be=Tg.check(hN()),xN=Tg.check(yN()),wN=globalThis.Symbol.for("immer-draftable");function Ag(e,t,n,o,i){var h,p,y,g;const c=EN(n,t,o),l=v_(t),d=(g=class extends e{constructor(...[v,x]){v=v??{};const w=n.make(v,x);super({...v,...w},{...x,disableChecks:!0})}get[(y=Ta,p=l,h=wN,p)](){return l}static get ast(){return c(this).ast}static pipe(){return $t(this,arguments)}static rebuild(v){return c(this).rebuild(v)}static make(v,x){return new this(v,x)}static makeOption(v,x){return i_(c(this))(v??{},x)}static makeEffect(v,x){return wo(gf(c(this))(v??{},x),w=>new yf(w))}static annotate(v){return this.rebuild(zE(this.ast,v))}static annotateKey(v){return this.rebuild(WE(this.ast,v))}static check(...v){return this.rebuild(Pg(this.ast,v))}static extend(v){return(x,w)=>{const k={...n.fields,...x};return Ag(this,v,Mg(Eg(k,n.ast.checks,{identifier:v}),k),w,i)}}static mapFields(v,x){return n.mapFields(v,x)}},L(g,y,Ta),L(g,h,!0),L(g,"identifier",t),L(g,"fields",n.fields),g);return i!==void 0&&Object.assign(d.prototype,i(t)),d}function kN(e){return new Tn(yn(t=>new e(t)),vi())}function v_(e){return`~effect/Schema/Class/${e}`}function EN(e,t,n){let o;return i=>{if(o===void 0){const c=kN(i),l=Ye(new uc([e.ast],()=>(d,h)=>d instanceof i||Be(d,v_(t))?ft(d):Ge(new Ir(h,Ne(d))),{identifier:t,[e_]:([d])=>new At(d,c),toCodec:([d])=>new At(d.ast,c),toArbitrary:([d])=>()=>d.map(h=>new i(h)),toFormatter:([d])=>h=>`${i.identifier}(${d(h)})`,"~sentinels":Cg(e.ast),...n}));o=e.pipe(Pl(l,c))}return o}}function Lg(e){return Rg(e)}const _N=e=>(t,n)=>{const o=Lg(t)?t:we(t);return Ag(XA,e,o,n,i=>({toString(){return`${i}(${ht({...this})})`}}))},Qn=e=>(t,n)=>{const o=Lg(t)?t:we(t);return Ag(T1,e,o,n,c=>({name:c}))},Sf=e=>(t,n,o)=>Qn(e??t)(Lg(n)?n.mapFields(i=>({_tag:xn(t),...i}),{unsafePreserveChecks:!0}):lN(t,n),o);function Wh(e){return Ye(S_(e.ast))}const S_=YE(e=>{const t=CN(e,S_);return t!==e&&Wr(e)?HE(t):t});function CN(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(Ul(i)){const c=RE(e)?e.typeParameters.map(h=>Ig(ks(h))):[],l=i(c),d=t(l.to);return Rt(e,d===l.to?[l]:[new At(d,l.transformation)])}return Rt(e,[c3])}case"Unknown":case"ObjectKeyword":return Rt(e,[u3]);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=X3(e.types);return i!==e.types?new lc(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 bN="~effect/Stream",PN={_R:Fe,_E:Fe,_A:Fe},FN={[bN]:PN,pipe(){return $t(this,arguments)}},IN=e=>{const t=Object.create(FN);return t.channel=e,t},RN="~effect/Stream",TN=e=>Be(e,RN),pc=IN,MN=e=>e.channel,AN=e=>pc($3(()=>e().channel)),LN=e=>pc(U3(e)),ON=e=>pc(z3(As(e,MN))),kx=se(2,(e,t)=>AN(()=>{let n=0;return pc(B3(e.channel,Q1(o=>t(o,n++))))})),NN=se(2,(e,t)=>pc(q3(e.channel,t))),DN=se(2,(e,t)=>W3(e.channel,n=>{let o=0;return lE({while:()=>o<n.length,body:()=>t(n[o++]),step:Za})})),Gm="~effect/FiberSet",jN=e=>Be(e,Gm),$N={[Gm]:Gm,[Symbol.iterator](){return this.state._tag==="Closed"?hR():this.state.backing[Symbol.iterator]()},...Rs,toJSON(){return{_id:"FiberMap",state:this.state}}},UN=(e,t)=>{const n=Object.create($N);return n.state={_tag:"Open",backing:e},n.deferred=t,n},BN=()=>mE(Vn(()=>UN(new Set,sg())),e=>Cr(()=>{const t=e.state;if(t._tag==="Closed")return gt;e.state={_tag:"Closed"};const n=t.backing;return f3(n).pipe(zA(e.deferred))})),x_=-1,zN=tT(rT(LA,nT(x_))),VN=se(e=>jN(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.interruptUnsafe(x_);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),Xk(o)&&((n==null?void 0:n.propagateInterruption)===!0?!zN(o.cause):!MA(o.cause))&&Ia(e.deferred,o))})}),qN=(function(){let e;return()=>(e===void 0&&(e=$m(jm)),e)})(),WN=e=>()=>As(vl(),t=>{const n=Sl(t);return(o,i)=>{if(e.state._tag==="Closed")return qN();const c=n(o,i);return VN(e,c),c}}),Ex=e=>og(e.deferred),HN="~effect/interfaces/PrimaryKey",_x="~effect/ManagedRuntime",KN=(e,t)=>{const n=(t==null?void 0:t.memoMap)??cg(),o=ig("parallel"),i=ml(o,"sequential"),c={onFiberStart:d3(o)},l=y=>y?{...y,onFiberStart:y.onFiberStart?g=>{c.onFiberStart(g),y.onFiberStart(g)}:c.onFiberStart}:c;let d;const h=gl(y=>(d||(d=$m(EL(ug(e,n,i),g=>Vn(()=>{p.cachedContext=g})),{...c,scheduler:y.currentScheduler})),wL(l3(d)))),p={[_x]:_x,memoMap:n,scope:o,contextEffect:h,cachedContext:void 0,context(){return p.cachedContext===void 0?Ju(p.contextEffect):Promise.resolve(p.cachedContext)},dispose(){return Ju(p.disposeEffect)},disposeEffect:Cr(()=>(p.contextEffect=xL("ManagedRuntime disposed"),p.cachedContext=void 0,lf(p.scope,Gk))),runFork(y,g){return p.cachedContext===void 0?$m(ei(p,y),l(g)):Sl(p.cachedContext)(y,l(g))},runCallback(y,g){return p.cachedContext===void 0?zL(ei(p,y),l(g)):BL(p.cachedContext)(y,l(g))},runSyncExit(y){return p.cachedContext===void 0?vE(ei(p,y)):KL(p.cachedContext)(y)},runSync(y){return p.cachedContext===void 0?pg(ei(p,y)):HL(p.cachedContext)(y)},runPromiseExit(y,g){return p.cachedContext===void 0?qL(ei(p,y),l(g)):WL(p.cachedContext)(y,l(g))},runPromise(y,g){return p.cachedContext===void 0?Ju(ei(p,y),l(g)):VL(p.cachedContext)(y,l(g))}};return p};function ei(e,t){return Rn(e.contextEffect,n=>co(t,n))}const Ym="~effect/rpc/RpcSchema/StreamSchema";function w_(e){return Be(e,Ym)}function k_(e){return w_(e)?Ne({success:e.success,error:e.error}):Wn()}const QN=a_(TN);function JN(e,t){return Ye(QN.ast,{[Ym]:Ym,success:e,error:t})}const Cx="~effect/rpc/Rpc",GN={[Cx]:Cx,pipe(){return $t(this,arguments)},setSuccess(e){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return ps({_tag:this._tag,payloadSchema:Rg(e)?e:we(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return ps({_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 ps({_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 ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Ts(this.annotations,e,t)})},annotateMerge(e){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:pi(this.annotations,e)})}},ps=e=>{function t(){}return Object.setPrototypeOf(t,GN),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},bi=(e,t)=>{const n=(t==null?void 0:t.success)??bl,o=(t==null?void 0:t.error)??yx,i=(t==null?void 0:t.defect)??dr;let c;return t!=null&&t.primaryKey?c=class extends _N(`effect/rpc/Rpc/${e}`)(t.payload){[HN](){return t.primaryKey(this)}}:c=Rg(t==null?void 0:t.payload)?t==null?void 0:t.payload:t!=null&&t.payload?we(t==null?void 0:t.payload):bl,ps({_tag:e,payloadSchema:c,successSchema:t!=null&&t.stream?JN(n,o):n,errorSchema:t!=null&&t.stream?yx:o,defectSchema:i,annotations:cr(),middlewares:new Set})},Hh=new WeakMap,YN=e=>{if(Hh.has(e))return Hh.get(e);const t=e,n=new Set([t.errorSchema]),o=k_(t.successSchema);_s(o)&&n.add(o.value.error);for(const c of t.middlewares)n.add(c.error);const i=SN(_s(o)?bl:t.successSchema,rn([...n]),t.defectSchema);return Hh.set(e,i),i},XN="~effect/rpc/Rpc/Wrapper",ZN=e=>XN in e,eD={add(...e){const t=new Map(this.requests);for(const n of e)t.set(n._tag,n);return Br({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,c]of o.requests)t.set(i,c);for(const[i,c]of o.annotations.mapUnsafe)n.set(i,c)}return Br({requests:t,annotations:ws(n)})},omit(...e){const t=new Map(this.requests);for(const n of e)t.delete(n);return Br({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 Br({requests:t,annotations:this.annotations})},toHandlers(e){const t=this;return Dm(function*(){const n=yield*vl(),o=ui(e)?yield*e:e,i=new Map;for(const[c,l]of Object.entries(o)){const d=t.requests.get(c);i.set(d.key,{tag:d._tag,handler:l,context:n})}return ws(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 Br({requests:t,annotations:this.annotations})},toLayer(e){return Om(this.toHandlers(e))},of:Fe,toLayerHandler(e,t){const n=this;return Om(Dm(function*(){const o=yield*vl(),i=ui(t)?yield*t:t,c=new Map,l=n.requests.get(e);return c.set(l.key,{handler:i,context:o}),ws(c)}))},accessHandler(e){return hE(t=>{const n=this.requests.get(e),{handler:o,context:i}=t.mapUnsafe.get(n.key);return ft((c,l)=>{l.rpc=n;const d=o(c,l),h=ZN(d)?d.value:d;return ui(h)?TL(h,i):NN(h,i)})})},annotate(e,t){return Br({requests:this.requests,annotations:Ts(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(mi(e,t))},annotateMerge(e){return Br({requests:this.requests,annotations:pi(this.annotations,e)})},annotateRpcsMerge(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.annotateMerge(pi(e,o.annotations)));return Br({requests:t,annotations:this.annotations})}},Br=e=>Object.assign(function(){},eD,{requests:e.requests,annotations:e.annotations}),tD=(...e)=>Br({requests:new Map(e.map(t=>[t._tag,t])),annotations:cr()}),nD="/ws",rD=4,Ht={getConfig:"tokmon.getConfig",setConfig:"tokmon.setConfig",refresh:"tokmon.refresh",browseFs:"tokmon.browseFs",snapshot:"tokmon.snapshot",config:"tokmon.config"},sD=We(["all","summary","table","billing","peak"]),Cs=We(wp),or=xN.check(l_(0)),Fl=be.check(l_(1)),oD=we({id:de,providerId:Cs,name:de,homeDir:de,color:xe(de),enabled:xe(at)}),iD=we({enabled:at,menuBar:xe(we({version:dt(1),mode:We(["auto","custom"]),elements:we({providerMark:at,value:at,progress:at}),density:We(["comfortable","compact","tight"]),customSpacing:we({edgePaddingPt:be.check(Ur({minimum:0,maximum:6})).check(qh(.5)),markValueGapPt:be.check(Ur({minimum:0,maximum:8})).check(qh(.5)),providerGapPt:be.check(Ur({minimum:0,maximum:16})).check(qh(.5))})})),showMenuBarText:at,menuBarValue:xe(We(["usage","todayTokens"])),displayMetric:We(["smartHeadroom","tightestRemaining"]),pollIntervalSec:be.check(Ur({minimum:1,maximum:86400})),activeTimeoutMin:be.check(Ur({minimum:1,maximum:1440})),graceMin:be.check(Ur({minimum:1,maximum:10080})),promotionHoldMin:be.check(Ur({minimum:0,maximum:1440})),lowWatermarkPct:be.check(Ur({minimum:0,maximum:100})),criticalWatermarkPct:be.check(Ur({minimum:0,maximum:100})),pinnedAccount:Me(de),pins:qe(de),pinnedProviders:xe(qe(de)),launchAtLogin:at,theme:dt("dark")}),aD=we({expandedProviders:qe(de),graphRangeDays:xe(We(h1))}),cD=we({enabled:at,disabledProviders:qe(Cs),excludedAccounts:qe(we({providerId:Cs,homeDir:de}))}),en=de.check(dN(/^#[0-9a-f]{6}$/i)),bx=we({canvas:xe(en),panel:xe(en),inset:xe(en),insetStrong:xe(en),chrome:xe(en),line:xe(en),lineStrong:xe(en),lineFaint:xe(en),text:xe(en),textDim:xe(en),textFaint:xe(en),textStrong:xe(en),accent:xe(en),cost:xe(en),positive:xe(en)}),uD=we({version:dt(1),mode:We(["auto","light","dark"]),preset:We(i1),terminal:We(["ansi","dark","light","off"]),custom:xe(we({base:We(Ep),light:bx,dark:bx}))}),E_=we({revision:or,interval:Fl,billingInterval:Fl,clearScreen:at,privacyMode:at,privacyToggleKey:de,timezone:Me(de),accounts:qe(oD),activeAccountId:Me(de),disabledProviders:qe(Cs),onboarded:at,dashboardLayout:We(["grid","single"]),defaultFocus:We(["all","last"]),ascii:We(["auto","on","off"]),allowNetworkAccess:at,allowedHosts:qe(de),resetDisplay:We(["relative","absolute"]),knownProviders:qe(Cs),appearance:xe(uD),accountDetection:xe(cD),tray:xe(iD),desktop:xe(aD)}),lD=we({version:dt(rD),capabilities:qe(de)}),gc=we({protocol:lD,config:E_}),fD=we({expectedRevision:or,config:E_}),dD=we({kind:dt("conflict"),state:gc});class Xm extends Sf()("ConfigUpdateConflictFailure",{kind:dt("conflict"),state:gc}){}const hD=we({kind:dt("persistence"),message:de});class mD extends Sf()("ConfigPersistenceFailure",{kind:dt("persistence"),message:de}){}const pD=rn([Xm,dD]),gD=rn([mD,hD]);class yD extends Sf()("RefreshFailure",{kind:dt("refresh"),message:de}){}const vD=we({name:de,path:de,dir:at}),SD=we({path:de,parent:Me(de),entries:qe(vD)}),Kh=we({cost:be,tokens:be,input:be,cacheRead:be,cacheSavings:be}),xD=we({name:de,input:be,output:be,cacheCreate:be,cacheRead:be,cacheSavings:be,cost:be,count:be}),Qh=we({label:de,models:qe(de),input:be,output:be,cacheCreate:be,cacheRead:be,cacheSavings:be,total:be,cost:be,count:be,breakdown:qe(xD)}),wD=we({today:Kh,week:Kh,month:Kh,burnRate:be,series:qe(be),lastActivityAt:Me(or)}),kD=we({daily:qe(Qh),weekly:qe(Qh),monthly:qe(Qh)}),ED=rn([we({kind:dt("percent")}),we({kind:dt("dollars"),currency:xe(de)}),we({kind:dt("count"),suffix:xe(de)})]),_D=we({key:xe(de),role:xe(We(["session","weekly","model","other","unbounded"])),modelId:xe(Me(de)),active:xe(at),label:de,used:be,limit:Me(be),format:ED,resetsAt:xe(Me(de)),primary:xe(at)}),__=We(["session","weekly","model","other","unbounded"]),CD=we({title:de,subtitle:Me(de),accessibleLabel:de,redacted:at}),bD=we({key:de,label:de,role:__,modelId:Me(de),usedPct:Me(be),remainingPct:Me(be),resetsAt:Me(or),bounded:at,primary:at,active:at,displayOrder:or,valueText:de,value:xe(we({kind:dt("money"),used:be,limit:Me(be),remaining:Me(be),currency:de}))}),PD=we({key:de,label:de,role:__,remainingPct:be,included:at,reason:We(["session","active-model","weekly-cap","primary","fallback-floor"])}),C_=we({value:Me(be),unit:dt("index-100"),mode:We(["smart","single-window","fallback-floor","unavailable"]),basis:We(["active","idle-runway","unavailable"]),representativeAccountId:Me(de),activeAccountIds:qe(de),factors:qe(PD),explanation:de}),FD=we({plan:Me(de),metrics:qe(_D),error:Me(de),email:xe(Me(de)),displayName:xe(Me(de)),activity:xe(Me(we({series:qe(be),summary:de}))),modelSpend:xe(Me(qe(we({name:de,usd:be,requests:be})))),asOfMs:xe(or)}),ID=we({id:de,providerId:Cs,name:de,color:de,homeDir:Me(de),source:xe(We(["auto","configured"])),hasUsage:at,hasBilling:at,email:xe(Me(de)),displayName:xe(Me(de)),identity:xe(CD),quotas:xe(qe(bD)),headroom:xe(C_),plan:xe(Me(de)),lastActivityAt:Me(or),dashboard:Me(wD),table:Me(kD),billing:Me(FD),summaryState:We(["pending","ready","error"]),billingState:We(["pending","ready","error"]),tableState:We(["pending","ready","error"]),summaryUpdatedAt:xe(Me(or)),billingUpdatedAt:xe(Me(or)),tableUpdatedAt:xe(Me(or))}),RD=we({version:de,generatedAt:or,tz:de,intervalMs:Fl,billingIntervalMs:xe(Fl),installedProviders:xe(qe(Cs)),providers:qe(we({id:Cs,name:de,color:de,headroom:xe(C_)})),accounts:qe(ID),seeded:at,peak:Me(we({state:We(["peak","off-peak","weekend"]),label:de,minutesUntilChange:Me(be),changesAt:xe(Me(de))}))}),Og=we({}),TD=bi(Ht.getConfig,{payload:Og,success:gc}),MD=bi(Ht.setConfig,{payload:fD,success:gc,error:rn([pD,gD])}),AD=bi(Ht.refresh,{payload:we({scope:sD}),success:bl,error:yD}),LD=bi(Ht.browseFs,{payload:we({path:de}),success:SD}),OD=bi(Ht.snapshot,{payload:Og,success:RD,stream:!0}),ND=bi(Ht.config,{payload:Og,success:gc,stream:!0}),DD=tD(TD,MD,AD,LD,OD,ND);function jD(e){if(!e||typeof e!="object")return!1;const t=e;return t.isContentEditable?!0:typeof t.tagName=="string"&&["INPUT","TEXTAREA","SELECT"].includes(t.tagName.toUpperCase())}function $D(e,t){return t.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.repeat&&!e.editable&&!jD(e.target)&&e.key.toLowerCase()===t.toLowerCase()}const Qa="#8d9090",mn={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:Qa,grey:Qa},UD={claude:mn.green,codex:mn.cyan,cursor:mn.magenta,copilot:mn.white,pi:mn.blue,opencode:mn.yellow,antigravity:mn.red,gemini:mn.greenBright,grok:mn.yellowBright};function BD(e){return e?e.startsWith("#")?e:mn[e]??Qa:Qa}const i6=BD;function a6(e){return UD[e]??Qa}const Px=["#00d7ff","#00d787","#e6b450","#d75f87","#5f87ff","#af87ff","#5fd7a7","#ff8787","#d7af5f","#87d7ff","#d787d7","#9ee493","#ffb454","#7aa2f7","#bb9af7"],Fx=new Map;function zD(e){const t=Fx.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=Px[n%Px.length];return Fx.set(e,o),o}const c6={input:mn.blue,output:mn.green,cacheCreate:mn.yellow,cacheRead:mn.cyan};function Ix(e){return e.replace(/^claude-/,"").replace(/^gpt-/,"gpt-").replace(/-\d{8}$/,"").replace(/-latest$/,"")}const Rx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function u6(e,t={}){if(!Number.isFinite(e))return"$0.00";const n=t.sign&&e>0?"+":"",o=Math.abs(e);if(o>=1e5)return`${n}$${(e/1e3).toFixed(0)}k`;if(o>=1e4)return`${n}$${(e/1e3).toFixed(1)}k`;if(o>=1){const i=e<0?"-":"";return`${n}${i}$${o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}return o>=.01?`${n}$${e.toFixed(3)}`:o===0?"$0.00":`${n}$${e.toFixed(4)}`}function l6(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 f6(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 d6(e){return Number.isFinite(e)?Math.round(e).toLocaleString("en-US"):"0"}function h6(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 m6(e,t=0){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"0%"}function VD(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 p6(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(t)return`${Rx[Number(t[2])-1]} ${Number(t[3])}`;const n=/^(\d{4})-(\d{2})$/.exec(e);return n?`${Rx[Number(n[2])-1]} ${n[1]}`:e}function qD(e){if(!Number.isFinite(e)||e<=0)return null;const t=Math.max(1,Math.ceil(e/6e4));return{days:Math.floor(t/1440),hours:Math.floor(t%1440/60),minutes:t%60,totalMinutes:t}}function WD(e,t=Date.now()){const n=qD(new Date(e).getTime()-t);return n?n.days>0?`${n.days}d ${n.hours}h`:n.hours>0?`${n.hours}h ${n.minutes}m`:`${n.minutes}m`:"now"}function HD(e,t,n=Date.now(),o){const i=Date.parse(e);return Number.isFinite(i)?t==="relative"?WD(e,n):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:o}).format(new Date(i)):e}function b_(e){return e.input+e.output+e.cacheCreate+e.cacheRead}const Ng=864e5,g6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Il=e=>{const[t,n,o]=e.split("-").map(Number);return Date.UTC(t,(n||1)-1,o||1)},Rl=e=>new Date(e).toISOString().slice(0,10),KD=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)}},QD=e=>(new Date(e).getUTCDay()+6)%7,y6=e=>{const t=Il(e);return Rl(t-QD(t)*Ng)},JD={period:"6m"},Dg=[{key:"7d",label:"7 days",shortLabel:"7d"},{key:"30d",label:"30 days",shortLabel:"30d"},{key:"90d",label:"90 days",shortLabel:"90d"},{key:"mtd",label:"month to date",shortLabel:"MTD"},{key:"6m",label:"6 months",shortLabel:"6M"},{key:"all",label:"all time",shortLabel:"All"}];function P_(e){return e.providers.length?new Set(e.providers):null}function GD(e,t){const n=P_(t);return e.accounts.filter(o=>!(!o.hasUsage||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function Zm(e){var t,n,o,i,c,l,d,h,p;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=(c=e.billing)==null?void 0:c.activity)==null?void 0:l.series)!=null&&d.length||(p=(h=e.billing)==null?void 0:h.modelSpend)!=null&&p.length))}function YD(e,t){const n=P_(t);return e.accounts.filter(o=>!(!o.hasUsage&&!Zm(o)||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function XD(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 F_(e,t,n){if(!t||e==="all")return null;if(e==="mtd")return KD(n).slice(0,7)+"-01";if(e==="6m"){const i=new Date(Il(t)),c=i.getUTCMonth()-6,l=i.getUTCFullYear()+Math.floor(c/12),d=(c%12+12)%12,h=new Date(Date.UTC(l,d+1,0)).getUTCDate();return Rl(Date.UTC(l,d,Math.min(i.getUTCDate(),h)))}const o=e==="7d"?7:e==="90d"?90:30;return Rl(Il(t)-(o-1)*Ng)}function v6(e,t,n,o){if(!n||e==="all")return null;const i=F_(e,n,o);if(t==="daily")return i;const c=t==="monthly"?365:84,l=Rl(Il(n)-(c-1)*Ng);return i&&i<l?i:l}function ZD(e,t){const n=PF(e,t);return n.toLocaleLowerCase()===t.toLocaleLowerCase()?t:`${t} · ${n}`}const e4=()=>({cost:0,tokens:0,cacheSavings:0,calls:0}),t4=(e,t,n,o,i)=>{e.cost+=t,e.tokens+=n,e.cacheSavings+=o,e.calls+=i};function n4(){return{totals:e4(),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 r4(e,t,n,o,i){let c=0,l=0,d=0,h=0;for(const g of t.breakdown){if(e.modelOptionSet.add(g.name),i&&!i.has(g.name))continue;const v=b_(g);c+=g.cost,l+=v,d+=g.cacheSavings,h+=g.count,e.tokenComposition.input+=g.input,e.tokenComposition.output+=g.output,e.tokenComposition.cacheCreate+=g.cacheCreate,e.tokenComposition.cacheRead+=g.cacheRead;const x=e.modelAgg.get(g.name)??{cost:0,tokens:0,cacheSavings:0,calls:0};x.cost+=g.cost,x.tokens+=v,x.cacheSavings+=g.cacheSavings,x.calls+=g.count,e.modelAgg.set(g.name,x);let w=e.modelTrend.get(g.name);w||(w=new Map,e.modelTrend.set(g.name,w)),w.set(t.label,(w.get(t.label)??0)+g.cost)}if(i&&h===0&&c===0)return;t4(e.totals,c,l,d,h);const p=e.timelineMap.get(t.label)??{date:t.label,total:0,tokens:0,byProvider:{}};p.total+=c,p.tokens+=l,p.byProvider[n]=(p.byProvider[n]??0)+c,e.timelineMap.set(t.label,p),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+=c,y.tokens+=l,y.calls+=h,e.provAgg.set(n,y)}function s4(e){return[...e.timelineMap.values()].sort((t,n)=>t.date.localeCompare(n.date))}function o4(e,t,n){const o=t.map(i=>i.date);return[...e.modelAgg.entries()].map(([i,c])=>{const l=e.modelTrend.get(i);return{model:i,color:zD(i),cost:c.cost,tokens:c.tokens,cacheSavings:c.cacheSavings,calls:c.calls,share:n>0?c.cost/n:0,tokenShare:e.totals.tokens>0?c.tokens/e.totals.tokens:0,callShare:e.totals.calls>0?c.calls/e.totals.calls:0,trend:o.map(d=>(l==null?void 0:l.get(d))??0)}}).sort((i,c)=>c.cost-i.cost)}function i4(e,t){var _,A,C;const n=e?GD(e,t):[],o=XD(n),i=F_(t.period,o,(e==null?void 0:e.tz)??""),c=t.models.length?new Set(t.models):null,l=new Map,d=new Map;for(const D of(e==null?void 0:e.providers)??[])l.set(D.id,D.color),d.set(D.id,D.name);const h=n4(),p=D=>!i||D>=i;for(const D of n){h.burnRate+=((_=D.dashboard)==null?void 0:_.burnRate)??0;const U=D.providerId,O=l.get(U)??D.color;for(const T of((A=D.table)==null?void 0:A.daily)??[])p(T.label)&&r4(h,T,U,O,c)}for(const D of h.provAgg.values()){const U=d.get(D.id);U&&(D.name=U)}const y=s4(h);let g=0;const v=y.map(D=>(g+=D.total,{date:D.date,total:g})),x=y.map(D=>({date:D.date,value:h.cacheByDay.get(D.date)??0})),w=new Map;for(const D of n)for(const U of((C=D.table)==null?void 0:C.daily)??[]){if(!p(U.label))continue;const O=c?U.breakdown.filter(V=>c.has(V.name)):U.breakdown;if(c&&O.length===0)continue;let T=w.get(U.label);T||(T={tokens:0,calls:0,cacheSavings:0,models:new Map},w.set(U.label,T));for(const V of O)T.tokens+=b_(V),T.calls+=V.count,T.cacheSavings+=V.cacheSavings,T.models.set(V.name,(T.models.get(V.name)??0)+V.cost)}const k=y.map(D=>{const U=w.get(D.date);return{date:D.date,cost:D.total,tokens:(U==null?void 0:U.tokens)??0,calls:(U==null?void 0:U.calls)??0,cacheSavings:(U==null?void 0:U.cacheSavings)??0,models:U?[...U.models.entries()].map(([O,T])=>({name:O,cost:T})).sort((O,T)=>T.cost-O.cost):[]}}),P=[...h.provAgg.values()].sort((D,U)=>U.cost-D.cost),q=o4(h,y,h.totals.cost);return{filteredAccounts:n,totals:h.totals,burnRate:h.burnRate,timeline:y,cumulative:v,cacheSavingsSeries:x,calendar:k,cardAccounts:e?YD(e,t):[],byProvider:P,byModel:q,tokenComposition:h.tokenComposition,modelOptions:[...h.modelOptionSet].sort(),latestDay:o,rangeStart:i}}function Ut({children:e,className:t="size-4",...n}){return F.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 S6=e=>F.jsxs(Ut,{...e,children:[F.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"}),F.jsx("circle",{cx:"12",cy:"13",r:"4"})]}),x6=e=>F.jsx(Ut,{...e,children:F.jsx("path",{d:"M20 6 9 17l-5-5"})}),w6=e=>F.jsxs(Ut,{...e,children:[F.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),F.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),k6=e=>F.jsxs(Ut,{...e,children:[F.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),F.jsx("path",{d:"m7 10 5 5 5-5"}),F.jsx("path",{d:"M12 15V3"})]}),E6=e=>F.jsx(Ut,{...e,children:F.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"})}),a4=e=>F.jsxs(Ut,{...e,children:[F.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),F.jsx("path",{d:"m16 6-4-4-4 4"}),F.jsx("path",{d:"M12 2v13"})]}),c4=e=>F.jsx(Ut,{...e,children:F.jsx("path",{d:"m6 9 6 6 6-6"})}),_6=e=>F.jsxs(Ut,{...e,children:[F.jsx("circle",{cx:"11",cy:"11",r:"8"}),F.jsx("path",{d:"m21 21-4.3-4.3"})]}),u4=e=>F.jsxs(Ut,{...e,children:[F.jsx("path",{d:"M18 6 6 18"}),F.jsx("path",{d:"m6 6 12 12"})]}),l4=e=>F.jsxs(Ut,{...e,children:[F.jsx("circle",{cx:"12",cy:"12",r:"4"}),F.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"})]}),f4=e=>F.jsx(Ut,{...e,children:F.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"})}),d4=e=>F.jsxs(Ut,{...e,children:[F.jsx("circle",{cx:"12",cy:"12",r:"3"}),F.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"})]}),h4=e=>F.jsxs(Ut,{...e,children:[F.jsx("path",{d:"M20 6v5h-5"}),F.jsx("path",{d:"M4 18v-5h5"}),F.jsx("path",{d:"M18.7 9A7 7 0 0 0 6.3 6.3L4 8"}),F.jsx("path",{d:"M5.3 15A7 7 0 0 0 17.7 17.7L20 16"})]}),C6=e=>F.jsx(Ut,{...e,children:F.jsx("path",{d:"M12 5v14M5 12h14"})}),b6=e=>F.jsx(Ut,{...e,children:F.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"})}),P6=e=>F.jsxs(Ut,{...e,children:[F.jsx("path",{d:"M12 20h9"}),F.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]}),F6=e=>F.jsx(Ut,{...e,children:F.jsx("path",{d:"m18 15-6-6-6 6"})}),br="focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",Jh=["▁","▂","▃","▄","▅","▆","▇","█"];function I6({data:e,color:t="var(--color-accent)",className:n=""}){const o=Jh.length-1,i=Math.max(...e,0),c=Math.min(...e,0),l=i>0&&c===i;return F.jsx("span",{className:`font-mono leading-none ${n}`,style:{color:t},"aria-hidden":!0,children:e.length===0?"·":l?Jh[Math.floor(o/2)].repeat(e.length):e.map(d=>Jh[i<=0?0:Math.max(0,Math.min(o,Math.floor(d/i*(o+.999))))]).join("")})}function R6({label:e,value:t,sub:n,valueClass:o="text-fg-bright"}){return F.jsxs("div",{children:[F.jsx("div",{className:"font-display text-[10px] uppercase tracking-wide text-fg-faint",children:e}),F.jsx("div",{className:`tnum mt-1 text-xl ${o}`,children:t}),n!=null&&F.jsx("div",{className:"mt-0.5 text-xs text-fg-dim",children:n})]})}function T6({children:e}){return F.jsx("div",{className:"flex h-full min-h-24 items-center justify-center text-center text-xs text-fg-faint",children:e})}function m4(e,t){return t?m1(e):e}function Tx({value:e,privacyMode:t,className:n,title:o}){const[i,c]=X.useState(!1);return!(t&&KF(e))||i?F.jsx("span",{className:n,title:o??e,children:e}):F.jsx("button",{type:"button",onClick:()=>c(!0),className:`min-w-0 cursor-pointer truncate rounded text-left ${br} ${n??""}`,title:"Click to reveal email","aria-label":"Email hidden. Click to reveal.",children:F.jsx("span",{className:"inline-block max-w-full truncate blur-sm transition hover:blur-[2px]",children:m1(e)})})}function p4({options:e,value:t,onChange:n,size:o="sm",btnClassName:i,containerClassName:c,ariaLabel:l}){const d="flex items-center overflow-hidden rounded border border-line",h=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",p=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 F.jsx("div",{className:c??d,role:"radiogroup","aria-label":l,children:e.map(g=>F.jsx("button",{type:"button",role:"radio","aria-checked":t===g.value,onClick:()=>n(g.value),className:`${i??h} ${br} ${t===g.value?p:y}`,children:g.label},String(g.value)))})}function Mx({label:e,value:t,children:n}){const[o,i]=X.useState(!1),c=X.useRef(null),l=X.useRef(null),d=X.useRef(null),h=X.useId(),p=(g=!1)=>{i(!1),g&&requestAnimationFrame(()=>{var v;return(v=l.current)==null?void 0:v.focus()})};X.useEffect(()=>{if(!o)return;const g=v=>{c.current&&!c.current.contains(v.target)&&p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]);const y=g=>{var k;const v=Array.from(((k=d.current)==null?void 0:k.querySelectorAll('[role="menuitem"]:not([disabled])'))??[]),x=v.indexOf(document.activeElement);let w=null;if(g.key==="Escape"){g.preventDefault(),p(!0);return}g.key==="Home"&&(w=0),g.key==="End"&&(w=v.length-1),g.key==="ArrowDown"&&(w=x<0?0:(x+1)%v.length),g.key==="ArrowUp"&&(w=x<0?v.length-1:(x-1+v.length)%v.length),w!==null&&v[w]&&(g.preventDefault(),v[w].focus())};return F.jsxs("div",{ref:c,className:"relative",children:[F.jsxs("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?h:void 0,onClick:()=>i(g=>!g),onKeyDown:g=>{g.key!=="ArrowDown"&&g.key!=="ArrowUp"||(g.preventDefault(),i(!0),requestAnimationFrame(()=>{var x,w;const v=(x=d.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not([disabled])');(w=v==null?void 0:v[g.key==="ArrowDown"?0:v.length-1])==null||w.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 ${br}`,children:[F.jsxs("span",{className:"text-fg-faint",children:[e,":"]}),F.jsx("span",{className:"text-fg",children:t}),F.jsx(c4,{className:`size-3 transition ${o?"rotate-180":""}`})]}),o&&F.jsx("div",{id:h,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(()=>p(!0))})]})}function Ax({children:e}){return F.jsx("div",{className:"flex flex-col",children:e})}function Au({active:e,onClick:t,children:n}){return F.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 ${br} ${e?"bg-bg-3 text-fg-bright":"text-fg-dim hover:bg-bg-3 hover:text-fg"}`,children:n})}function g4({snapshot:e,derived:t,filters:n,setFilters:o,privacyMode:i=!0}){const c=(e==null?void 0:e.providers)??[],d=((e==null?void 0:e.accounts)??[]).filter(_=>_.hasUsage),h=new Set(d.map(_=>_.providerId)),p=c.filter(_=>h.has(_.id)),y=new Set(t.cardAccounts.map(_=>_.providerId)),g=c.filter(_=>!h.has(_.id)&&y.has(_.id)),v=n.providers.length?d.filter(_=>n.providers.includes(_.providerId)):d,x=_=>{var A;return((A=c.find(C=>C.id===_))==null?void 0:A.name)??_},w=_=>ZD(_,x(_.providerId)),k=d.find(_=>_.id===n.account),P=_=>o(A=>{const C=A.providers.includes(_);return{...A,providers:C?A.providers.filter(D=>D!==_):[...A.providers,_]}}),q=n.providers.length>0||n.models.length>0||n.account!=="all";return F.jsx("div",{className:"border-t border-line bg-bg-0/70",children:F.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:[F.jsx("span",{className:"hidden text-xs text-fg-faint sm:inline",children:"filter:"}),F.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[p.map(_=>{const A=n.providers.includes(_.id),C=n.providers.length>0&&!A;return F.jsxs("button",{type:"button","aria-pressed":A,onClick:()=>P(_.id),className:`flex items-center gap-1.5 rounded border px-2 py-0.5 text-xs transition max-sm:py-1.5 ${br}`,style:{borderColor:A?_.color:"var(--color-line)",color:C?"var(--color-fg-faint)":A?_.color:"var(--color-fg-dim)",background:A?"var(--color-bg-2)":"transparent"},title:A?`hide ${_.name}`:n.providers.length?`add ${_.name}`:`show only ${_.name}`,children:[F.jsx("span",{style:{color:_.color,opacity:C?.4:1},"aria-hidden":!0,children:A?"●":"○"}),_.name]},_.id)}),g.length>0&&F.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:[p.length>0&&F.jsx("span",{className:"text-line-2",children:"|"}),F.jsx("span",{children:"billing-only:"}),g.map(_=>F.jsxs("span",{className:"flex items-center gap-1 text-fg-dim",children:[F.jsx("span",{style:{color:_.color,opacity:.55},"aria-hidden":!0,children:"·"}),_.name]},_.id))]})]}),F.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 md:ml-auto md:w-auto",children:[v.length>1?F.jsx(Mx,{label:"account",value:n.account==="all"?"all":k?m4(w(k),i):"all",children:_=>F.jsxs(Ax,{children:[F.jsx(Au,{active:n.account==="all",onClick:()=>{o(A=>({...A,account:"all"})),_()},children:"All accounts"}),F.jsx("div",{className:"my-1 h-px bg-line"}),F.jsx("div",{className:"max-h-64 overflow-y-auto",children:v.map(A=>F.jsxs(Au,{active:n.account===A.id,onClick:()=>{o(C=>({...C,account:A.id})),_()},children:[F.jsx("span",{style:{color:A.color},"aria-hidden":!0,children:"●"})," ",F.jsx(Tx,{value:w(A),privacyMode:i,className:"truncate"})]},A.id))})]})}):v.length===1?F.jsxs("span",{className:"rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim",children:["account: ",F.jsx(Tx,{value:w(v[0]),privacyMode:i,className:"text-fg"})]}):null,F.jsx(Mx,{label:"model",value:n.models.length===0?"all":n.models.length===1?Ix(n.models[0]):`${n.models.length} models`,children:()=>F.jsxs(Ax,{children:[F.jsx(Au,{active:n.models.length===0,onClick:()=>o(_=>({..._,models:[]})),children:"All models"}),F.jsx("div",{className:"my-1 h-px bg-line"}),F.jsxs("div",{className:"max-h-64 overflow-y-auto",children:[t.modelOptions.length===0&&F.jsx("div",{className:"px-2 py-1 text-xs text-fg-faint",children:"no models in range"}),t.modelOptions.map(_=>{const A=n.models.includes(_);return F.jsxs(Au,{active:A,onClick:()=>o(C=>({...C,models:A?C.models.filter(D=>D!==_):[...C.models,_]})),children:[F.jsx("span",{className:A?"text-accent":"text-fg-faint","aria-hidden":!0,children:A?"◉":"○"})," ",Ix(_)]},_)})]})]})}),F.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[F.jsx("span",{className:"text-xs text-fg-faint",children:"range:"}),F.jsx(p4,{options:Dg.map(_=>({value:_.key,label:_.shortLabel})),value:n.period,onChange:_=>o(A=>({...A,period:_})),size:"sm",ariaLabel:"time range"})]}),q&&F.jsxs("button",{type:"button",onClick:()=>o(_=>({..._,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-line-2 hover:text-fg ${br}`,title:"Clear provider, model & account filters","aria-label":"Clear provider, model and account filters",children:[F.jsx(u4,{className:"size-3","aria-hidden":!0})," clear"]})]})]})})}const y4=X.lazy(()=>wr(()=>import("./share-sheet-Cfl7PIrk.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>({default:e.ShareSheet}))),I_=X.createContext(null),v4=()=>{const e=X.useContext(I_);if(!e)throw new Error("useShare must be used inside ShareProvider");return e};function S4({children:e}){const[t,n]=X.useState(null);return F.jsxs(I_.Provider,{value:n,children:[e,t?F.jsx(X.Suspense,{fallback:F.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:F.jsx(y4,{source:t,onClose:()=>n(null)})}):null]})}function x4({derived:e,periodLabel:t,tz:n,version:o}){const i=v4();return F.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] max-sm:py-2 ${br}`,title:"Create a shareable image",children:[F.jsx(a4,{className:"size-3.5"}),F.jsx("span",{children:"share"})]})}const Lx=[{key:"overview",label:"overview"},{key:"analytics",label:"analytics"},{key:"models",label:"models"},{key:"explore",label:"explore"}];function w4(e=1e3){const[t,n]=X.useState(()=>Date.now());return X.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function k4({mode:e,resolvedMode:t,disabled:n,onToggle:o}){const i=e==="auto"?"light":e==="light"?"dark":"auto";return F.jsxs("button",{type:"button",onClick:o,disabled:n,title:`Theme: ${e}${e==="auto"?` (${t})`:""}. Switch to ${i}`,"aria-label":`Theme mode ${e}${e==="auto"?`, currently ${t}`:""}; switch to ${i}`,className:`relative rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg disabled:opacity-40 max-sm:p-2.5 ${br}`,children:[t==="dark"?F.jsx(l4,{className:"size-3.5"}):F.jsx(f4,{className:"size-3.5"}),e==="auto"&&F.jsx("span",{className:"absolute -right-1 -top-1 text-[8px] font-bold text-accent","aria-hidden":!0,children:"A"})]})}function E4({conn:e,freshAt:t}){const n=w4(),o=e==="live"?"var(--color-ok)":e==="error"?"var(--color-critical)":"var(--color-warning)",i=t?VD(t,n):null,c=e==="live"?i??"live":e==="connecting"?"connecting…":e==="reconnecting"?i?`reconnecting · ${i}`:"reconnecting…":i?`offline · ${i}`:"offline";return F.jsxs("span",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[F.jsxs("span",{className:"relative flex size-2","aria-hidden":!0,children:[e==="live"&&F.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full opacity-60",style:{background:o}}),F.jsx("span",{className:"relative inline-flex size-2 rounded-full",style:{background:o}})]}),F.jsx("span",{className:"inline-block truncate text-fg-dim max-sm:max-w-[7rem]",children:c})]})}function Gh({label:e}){return F.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:[F.jsxs("span",{className:"font-display text-lg text-fg-dim","aria-hidden":!0,children:["tokmon",F.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),F.jsx("span",{className:"text-fg-faint",children:e})]})}function Yh(e,t){return e==="error"||e==="reconnecting"?"Connection lost — waiting for the local tokmon daemon…":t}function _4(){const e=document.getElementById("dashboard-content");e&&(e.scrollIntoView({block:"start"}),requestAnimationFrame(()=>e.focus({preventScroll:!0})))}function C4({onOpen:e}){return F.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 max-sm:p-2.5 ${br}`,children:F.jsx(d4,{className:"size-3.5"})})}function b4({phase:e,onRefresh:t}){const n=e==="refreshing"?"refreshing…":e==="success"?"updated":e==="error"?"refresh failed":"refresh";return F.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 ${br}`,children:[F.jsx(h4,{className:`size-3.5 ${e==="refreshing"?"animate-spin motion-reduce:animate-none":""}`}),F.jsx("span",{className:e==="error"?"text-critical":"",children:n})]})}function P4({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 F.jsxs("span",{className:"hidden items-center gap-1 text-xs text-fg-dim lg:flex",children:[F.jsx("span",{"aria-hidden":!0,style:{color:o},children:"●"}),F.jsx("span",{style:{color:o},children:e.label}),i&&F.jsxs("span",{className:"tnum text-fg-faint",children:["(",HD(i,t,Date.now(),n),")"]})]})}function F4(e,t){const n=e.providers.filter(c=>t.providers.has(c)),o=e.account==="all"||t.accounts.has(e.account)?e.account:"all",i=t.modelsReady?e.models.filter(c=>t.models.has(c)):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 jg(e,t,n){try{return e(t)}catch(o){return c2("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,o,n),null}}function hr(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),jg(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 Xh=hr({parse:e=>e,serialize:String});hr({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});hr({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});hr({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}});hr({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});hr({parse:e=>e.toLowerCase()==="true",serialize:String});function $g(e,t){return e.valueOf()===t.valueOf()}hr({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:$g});hr({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:$g});hr({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:$g});function I4(e){return R4(e)}function R4(e){return hr({parse:t=>{const n=t;return e.includes(n)?n:null},serialize:String})}function Ox(e,t=","){const n=e.eq??((i,c)=>i===c),o=encodeURIComponent(t);return hr({parse:i=>i===""?[]:i.split(t).map((c,l)=>jg(e.parse,c.replaceAll(o,t),`[${l}]`)).filter(c=>c!=null),serialize:i=>i.map(c=>(e.serialize?e.serialize(c):String(c)).replaceAll(t,o)).join(t),eq(i,c){return i===c?!0:i.length!==c.length?!1:i.every((l,d)=>n(l,c[d]))}})}const Zh=hp(),T4={};function M4(e,t={}){const n=X.useId(),o=g2(),i=y2(),{history:c="replace",scroll:l=(o==null?void 0:o.scroll)??!1,shallow:d=(o==null?void 0:o.shallow)??!0,throttleMs:h=ba.timeMs,limitUrlUpdates:p=o==null?void 0:o.limitUrlUpdates,clearOnDefault:y=(o==null?void 0:o.clearOnDefault)??!0,startTransition:g,urlKeys:v=T4}=t,x=Object.keys(e).join(","),w=X.useMemo(()=>Object.fromEntries(Object.keys(e).map(T=>[T,v[T]??T])),[x,JSON.stringify(v)]),k=p2(Object.values(w)),P=k.searchParams,q=X.useRef({}),_=X.useMemo(()=>Object.fromEntries(Object.keys(e).map(T=>[T,e[T].defaultValue??null])),[Object.values(e).map(({defaultValue:T})=>T).join(",")]),A=yh.useQueuedQueries(Object.values(w)),[C,D]=X.useState(()=>em(e,v,P??new URLSearchParams,A).state),U=X.useRef(C);if(nt("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,x,C,P),Object.keys(q.current).join("&")!==Object.values(w).join("&")){const{state:T,hasChanged:V}=em(e,v,P,A,q.current,U.current);V&&(nt("[nuq+ %s `%s`] State changed: %O",n,x,{state:T,initialSearchParams:P,queuedQueries:A,queryRef:q.current,stateRef:U.current}),U.current=T,D(T)),q.current=Object.fromEntries(Object.entries(w).map(([ee,ne])=>{var K;return[ne,((K=e[ee])==null?void 0:K.type)==="multi"?P==null?void 0:P.getAll(ne):(P==null?void 0:P.get(ne))??null]}))}X.useEffect(()=>{const{state:T,hasChanged:V}=em(e,v,P,A,q.current,U.current);V&&(nt("[nuq+ %s `%s`] State changed: %O",n,x,{state:T,initialSearchParams:P,queuedQueries:A,queryRef:q.current,stateRef:U.current}),U.current=T,D(T))},[Object.values(w).map(T=>`${T}=${P==null?void 0:P.getAll(T)}`).join("&"),JSON.stringify(A)]),X.useEffect(()=>{const T=Object.keys(e).reduce((V,ee)=>(V[ee]=({state:ne,query:K})=>{D(E=>{const{defaultValue:$}=e[ee],W=w[ee],J=ne??$??null,B=E[ee]??$??null;return Object.is(B,J)?(nt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,x,W,ne,$,U.current),E):(U.current={...U.current,[ee]:J},q.current[W]=K,nt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,x,W,ne,$,U.current),U.current)})},V),{});for(const V of Object.keys(e)){const ee=w[V];nt("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,ee,x),Zh.on(ee,T[V])}return()=>{for(const V of Object.keys(e)){const ee=w[V];nt("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,ee,x),Zh.off(ee,T[V])}}},[x,w]);const O=X.useCallback((T,V={})=>{var B,G,re,te,I,Z;const ee=Object.fromEntries(Object.keys(e).map(me=>[me,null])),ne=typeof T=="function"?T(Nx(U.current,_))??ee:T??ee;nt("[nuq+ %s `%s`] setState: %O",n,x,ne);let K,E=0,$=!1;const W=[];for(let[me,pe]of Object.entries(ne)){const fe=e[me],Pe=w[me];if(!fe||pe===void 0)continue;(V.clearOnDefault??fe.clearOnDefault??y)&&pe!==null&&fe.defaultValue!==void 0&&(fe.eq??((ue,$e)=>ue===$e))(pe,fe.defaultValue)&&(pe=null);const Le=pe===null?null:(fe.serialize??String)(pe);Zh.emit(Pe,{state:pe,query:Le});const Ce={key:Pe,query:Le,options:{history:V.history??fe.history??c,shallow:V.shallow??fe.shallow??d,scroll:V.scroll??fe.scroll??l,startTransition:V.startTransition??fe.startTransition??g}};if(((B=V==null?void 0:V.limitUrlUpdates)==null?void 0:B.method)==="debounce"||(p==null?void 0:p.method)==="debounce"||((G=fe.limitUrlUpdates)==null?void 0:G.method)==="debounce"){Ce.options.shallow===!0&&console.warn(Xa(422));const ue=((re=V==null?void 0:V.limitUrlUpdates)==null?void 0:re.timeMs)??(p==null?void 0:p.timeMs)??((te=fe.limitUrlUpdates)==null?void 0:te.timeMs)??ba.timeMs,$e=yh.push(Ce,ue,k,i);E<ue&&(K=$e,E=ue)}else{const ue=((I=V==null?void 0:V.limitUrlUpdates)==null?void 0:I.timeMs)??((Z=fe==null?void 0:fe.limitUrlUpdates)==null?void 0:Z.timeMs)??(p==null?void 0:p.timeMs)??V.throttleMs??fe.throttleMs??h;W.push(yh.abort(Pe)),$u.push(Ce,ue),$=!0}}const J=W.reduce((me,pe)=>pe(me),$?$u.flush(k,i):$u.getPendingPromise(k));return K??J},[x,c,d,l,h,p==null?void 0:p.method,p==null?void 0:p.timeMs,g,w,k.updateUrl,k.getSearchParamsSnapshot,k.rateLimitFactor,i,_]);return[X.useMemo(()=>Nx(C,_),[C,_]),O]}function em(e,t,n,o,i,c){let l=!1;const d=Object.entries(e).reduce((h,[p,y])=>{const g=(t==null?void 0:t[p])??p,v=o[g],x=y.type==="multi"?[]:null,w=v===void 0?(y.type==="multi"?n==null?void 0:n.getAll(g):n==null?void 0:n.get(g))??x:v;return i&&c&&Pw(i[g]??x,w)?(h[p]=c[p]??null,h):(l=!0,h[p]=(x2(w)?null:jg(y.parse,w,g))??null,i&&(i[g]=w),h)},{});if(!l){const h=Object.keys(e),p=Object.keys(c??{});l=h.length!==p.length||h.some(y=>!p.includes(y))}return{state:d,hasChanged:l}}function Nx(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function A4(){const[e,t]=M4({p:Ox(Xh).withDefault([]),m:Ox(Xh).withDefault([]),a:Xh.withDefault("all"),period:I4(Dg.map(i=>i.key)).withDefault(JD.period)},{history:"replace"}),n=X.useMemo(()=>({providers:e.p,models:e.m,account:e.a,period:e.period}),[e.p,e.m,e.a,e.period]),o=X.useCallback(i=>{t(c=>{const l={providers:c.p,models:c.m,account:c.a,period:c.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 Dx=Symbol.for("~effect/http/Headers"),Ja=Object.create(null);Object.defineProperties(Ja,{[Dx]:{value:Dx},[zl]:{value(e){return D4(this,ao(e,j4))}},toJSON:{value(){return Vl(this)}},[on]:{value(e){return O4(this,e)}},[sn]:{value(){return Rp(this)}},toString:{value:CS.toString},[mo]:{value:CS[mo]}});const L4=e=>Object.assign(Object.create(Ja),e),O4=yR(CI()),Ug=Object.create(Ja),N4=e=>{if(e===void 0)return Ug;if(Symbol.iterator in e){const n=Object.create(Ja);for(const[o,i]of e)n[o.toLowerCase()]=i;return n}const t=Object.create(Ja);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},jx=se(2,(e,t)=>{const n=L4(e);return Object.assign(n,t),n}),D4=se(2,(e,t)=>{const n={...e},o=i=>{if(typeof i=="string"){const c=i.toLowerCase();c in e&&(n[c]=nx(e[c]))}else for(const c in e)i.test(c)&&(n[c]=nx(e[c]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)o(t[i]);else o(t);return n}),j4=rt("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),$4="~effect/http/HttpClientError";class Bg extends Qn($4)({_tag:xn("HttpError"),kind:We(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:Ci(dr)}){static fromHttpClientError(t){return new Bg({_tag:"HttpError",kind:t.reason._tag,cause:t.reason})}}const $x="~effect/socket/Socket",zg=Kn("effect/socket/Socket"),U4=e=>zg.of({[$x]:$x,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(o=>typeof o=="string"?t(B4.encode(o)):o instanceof Uint8Array?t(o):t(new Uint8Array(o)),n)),runString:e.runString??(e.run?(t,n)=>e.run(o=>t(tm.decode(o)),n):(t,n)=>e.runRaw(o=>typeof o=="string"?t(o):o instanceof Uint8Array?t(tm.decode(o)):t(tm.decode(new Uint8Array(o))),n)),writer:e.writer}),B4=new TextEncoder,tm=new TextDecoder,z4="~effect/socket/Socket/CloseEvent",V4=e=>Be(e,z4),Zu="~effect/socket/Socket/SocketError",q4=e=>Be(e,Zu);class R_ extends Qn("effect/socket/Socket/SocketReadError")({_tag:xn("SocketReadError"),cause:dr}){constructor(){super(...arguments);L(this,"message","An error occurred during Read")}}class W4 extends Qn("effect/socket/Socket/SocketWriteError")({_tag:xn("SocketWriteError"),cause:dr}){constructor(){super(...arguments);L(this,"message","An error occurred during Write")}}class Tl extends Qn("effect/socket/Socket/SocketOpenError")({_tag:xn("SocketOpenError"),kind:We(["Unknown","Timeout"]),cause:dr}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Ml extends Qn("effect/socket/Socket/SocketCloseError")({_tag:xn("SocketCloseError"),code:Tg,closeReason:Ci(de)}){static filterClean(t){return function(n){return li.is(n)&&n.reason._tag==="SocketCloseError"&&t(n.reason.code)?Kr(n.reason):ar(n)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}const T_=rn([R_,W4,Tl,Ml]);var ww,kw;class li extends(kw=Sf(Zu)("SocketError",{_tag:xn("SocketError"),reason:T_}),ww=Zu,kw){constructor(n){var t=(...J6)=>(super(...J6),L(this,ww,Zu),L(this,"message",this.reason.message),this);"cause"in n.reason?t({...n,cause:n.reason.cause}):t(n)}static is(n){return q4(n)}}const H4=e=>!0;class K4 extends Kn()("~effect/socket/Socket/WebSocket"){}class M_ extends Kn()("@effect/platform/Socket/WebSocketConstructor"){}const Q4=lg(M_)((e,t)=>new globalThis.WebSocket(e,t)),J4=(e,t)=>M_.use(n=>G4(mE((typeof e=="string"?ft(e):e).pipe(As(o=>n(o,t==null?void 0:t.protocols))),o=>Vn(()=>o.close(1e3))),t)),G4=(e,t)=>gl(n=>{let o;const i=n_(!1),c=n.context,l=(t==null?void 0:t.closeCodeIsError)??H4,d=(y,g)=>OL(uo(function*(v){const x=yield*BN().pipe(hl(v)),w=yield*hl(e,v),k=yield*LL(WN(x)(),K4,w);let P=!1;function q(C){if(C.data instanceof Blob){const U=Rn(gL(()=>C.data.arrayBuffer()),O=>{const T=y(new Uint8Array(O));return ui(T)?T:gt});return k(U)}const D=y(C.data);ui(D)&&k(D)}function _(C){w.removeEventListener("message",q),w.removeEventListener("close",A),Ia(x.deferred,Ge(new li({reason:P?new R_({cause:C}):new Tl({kind:"Unknown",cause:C})})))}function A(C){const D=typeof C.code=="number"?C.code:1001;w.removeEventListener("message",q),w.removeEventListener("error",_),Ia(x.deferred,Ge(new li({reason:new Ml({code:D,closeReason:C.reason})})))}if(w.addEventListener("close",A,{once:!0}),w.addEventListener("error",_,{once:!0}),w.addEventListener("message",q),w.readyState!==1){const C=sg();w.addEventListener("open",()=>{P=!0,Ia(C,gt)},{once:!0}),yield*og(C).pipe(fE({duration:(t==null?void 0:t.openTimeout)??1e4,orElse:()=>Ge(new li({reason:new Tl({kind:"Timeout",cause:new Error('timeout waiting for "open"')})}))}),dE(Ex(x)))}return P=!0,o=w,i.openUnsafe(),g!=null&&g.onOpen&&(yield*g.onOpen),yield*_L(Ex(x),Ml.filterClean(C=>!l(C)),()=>gt)})).pipe(AL(v=>pi(c,v)),pE(Vn(()=>{i.closeUnsafe(),o=void 0}))),p=ft(y=>i.whenOpen(Vn(()=>{const g=o;V4(y)?g.close(y.code,y.reason):g.send(y)})));return ft(U4({runRaw:d,writer:p}))}),Y4=y1(J4,Lm(zg));class A_ extends Kn()("effect/workers/Transferable/Collector"){}const X4=()=>{let e=[];const t=i=>{e.push(...i)},n=()=>e,o=()=>{const i=e;return e=[],i};return A_.of({addAllUnsafe:t,addAll:i=>Vn(()=>t(i)),readUnsafe:n,read:Vn(n),clearUnsafe:o,clear:Vn(o)})};class Z4 extends Qn("effect/workers/WorkerError/WorkerSpawnError")({_tag:xn("WorkerSpawnError"),message:de,cause:Ci(dr)}){}class ej extends Qn("effect/workers/WorkerError/WorkerSendError")({_tag:xn("WorkerSendError"),message:de,cause:Ci(dr)}){}class tj extends Qn("effect/workers/WorkerError/WorkerReceiveError")({_tag:xn("WorkerReceiveError"),message:de,cause:Ci(dr)}){}class nj extends Qn("effect/workers/WorkerError/WorkerUnknownError")({_tag:xn("WorkerUnknownError"),message:de,cause:Ci(dr)}){}const rj=rn([Z4,ej,tj,nj]),nm="~effect/rpc/RpcClientError";class ep extends Qn("effect/rpc/RpcClientError/RpcClientDefect")({_tag:xn("RpcClientDefect"),message:de,cause:dr}){}var Ew,_w;class tp extends(_w=Qn(nm)({_tag:xn("RpcClientError"),reason:rn([rj,T_,Bg,ep])}),Ew=nm,_w){constructor(){super(...arguments);L(this,Ew,nm)}get message(){return`${this.reason._tag}: ${this.reason.message}`}}const Lu=e=>typeof e=="bigint"?e:BigInt(e),sj={_tag:"Ping"};var np;try{np=new TextDecoder}catch{}var le,Er,N=0,Je={},Oe,Ss,zn=0,xr=0,It,Hr,vn=[],Ae,Ux={useRecords:!1,mapsAsObjects:!0};class L_{}const O_=new L_;O_.name="MessagePack 0xC1";var Es=!1,Bx=2,oj;class Ga{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 B_(()=>(sp(),this?this.unpack(t,n):Ga.prototype.unpack.call(Ux,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<"u"?Buffer.from(t):new Uint8Array(t)),typeof n=="object"?(Er=n.end||t.length,N=n.start||0):(N=0,Er=n>-1?n:t.length),xr=0,Ss=null,It=null,le=t;try{Ae=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 Ga){if(Je=this,this.structures)return Oe=this.structures,Ou(n);(!Oe||Oe.length>0)&&(Oe=[])}else Je=Ux,(!Oe||Oe.length>0)&&(Oe=[]);return Ou(n)}unpackMultiple(t,n){let o,i=0;try{Es=!0;let c=t.length,l=this?this.unpack(t,c):xf.unpack(t,c);if(n){if(n(l,i,N)===!1)return;for(;N<c;)if(i=N,n(Ou(),i,N)===!1)return}else{for(o=[l];N<c;)i=N,o.push(Ou());return o}}catch(c){throw c.lastPosition=i,c.values=o,c}finally{Es=!1,sp()}}_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 c=t[o];c&&(c.isShared=!0,o>=32&&(c.highByte=o-32>>5))}t.sharedLength=t.length;for(let o in n||[])if(o>=0){let i=t[o],c=n[o];c&&(i&&((t.restoreStructures||(t.restoreStructures=[]))[o]=i),t[o]=c)}return this.structures=t}decode(t,n){return this.unpack(t,n)}}function Ou(e){try{if(!Je.trusted&&!Es){let n=Oe.sharedLength||0;n<Oe.length&&(Oe.length=n)}let t;if(Je.randomAccessStructure&&le[N]<64&&le[N]>=32&&oj||(t=yt()),It&&(N=It.postBundlePosition,It=null),Es&&(Oe.restoreStructures=null),N==Er)Oe&&Oe.restoreStructures&&zx(),Oe=null,le=null,Hr&&(Hr=null);else{if(N>Er)throw new Error("Unexpected end of MessagePack data");if(!Es){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 Oe&&Oe.restoreStructures&&zx(),sp(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||N>Er)&&(t.incomplete=!0),t}}function zx(){for(let e in Oe.restoreStructures)Oe[e]=Oe.restoreStructures[e];Oe.restoreStructures=null}function yt(){let e=le[N++];if(e<160)if(e<128){if(e<64)return e;{let t=Oe[e&63]||Je.getStructures&&N_()[e&63];return t?(t.read||(t.read=Vg(t,e&63)),t.read()):e}}else if(e<144)if(e-=128,Je.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=j_();o==="__proto__"&&(o="__proto_"),t[o]=yt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(yt(),yt());return t}else{e-=144;let t=new Array(e);for(let n=0;n<e;n++)t[n]=yt();return Je.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(xr>=N)return Ss.slice(N-zn,(N+=t)-zn);if(xr==0&&Er<140){let n=t<16?qg(t):D_(t);if(n!=null)return n}return rp(t)}else{let t;switch(e){case 192:return null;case 193:return It?(t=yt(),t>0?It[1].slice(It.position1,It.position1+=t):It[0].slice(It.position0,It.position0-=t)):O_;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 rm(t);case 197:return t=Ae.getUint16(N),N+=2,rm(t);case 198:return t=Ae.getUint32(N),N+=4,rm(t);case 199:return Ys(le[N++]);case 200:return t=Ae.getUint16(N),N+=2,Ys(t);case 201:return t=Ae.getUint32(N),N+=4,Ys(t);case 202:if(t=Ae.getFloat32(N),Je.useFloat32>2){let n=Wg[(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=Ae.getFloat64(N),N+=8,t;case 204:return le[N++];case 205:return t=Ae.getUint16(N),N+=2,t;case 206:return t=Ae.getUint32(N),N+=4,t;case 207:return Je.int64AsType==="number"?(t=Ae.getUint32(N)*4294967296,t+=Ae.getUint32(N+4)):Je.int64AsType==="string"?t=Ae.getBigUint64(N).toString():Je.int64AsType==="auto"?(t=Ae.getBigUint64(N),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Ae.getBigUint64(N),N+=8,t;case 208:return Ae.getInt8(N++);case 209:return t=Ae.getInt16(N),N+=2,t;case 210:return t=Ae.getInt32(N),N+=4,t;case 211:return Je.int64AsType==="number"?(t=Ae.getInt32(N)*4294967296,t+=Ae.getUint32(N+4)):Je.int64AsType==="string"?t=Ae.getBigInt64(N).toString():Je.int64AsType==="auto"?(t=Ae.getBigInt64(N),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Ae.getBigInt64(N),N+=8,t;case 212:if(t=le[N++],t==114)return Qx(le[N++]&63);{let n=vn[t];if(n)return n.read?(N++,n.read(yt())):n.noBuffer?(N++,n()):n(le.subarray(N,++N));throw new Error("Unknown extension "+t)}case 213:return t=le[N],t==114?(N++,Qx(le[N++]&63,le[N++])):Ys(2);case 214:return Ys(4);case 215:return Ys(8);case 216:return Ys(16);case 217:return t=le[N++],xr>=N?Ss.slice(N-zn,(N+=t)-zn):aj(t);case 218:return t=Ae.getUint16(N),N+=2,xr>=N?Ss.slice(N-zn,(N+=t)-zn):cj(t);case 219:return t=Ae.getUint32(N),N+=4,xr>=N?Ss.slice(N-zn,(N+=t)-zn):uj(t);case 220:return t=Ae.getUint16(N),N+=2,qx(t);case 221:return t=Ae.getUint32(N),N+=4,qx(t);case 222:return t=Ae.getUint16(N),N+=2,Wx(t);case 223:return t=Ae.getUint32(N),N+=4,Wx(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 ij=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function Vg(e,t){function n(){if(n.count++>Bx){let i;try{i=e.read=new Function("r","return function(){return "+(Je.freezeData?"Object.freeze":"")+"({"+e.map(c=>c==="__proto__"?"__proto_:r()":ij.test(c)?c+":r()":"["+JSON.stringify(c)+"]:r()").join(",")+"})}")(yt)}catch{return Bx=1/0,n()}return e.read0=i,e.highByte===0&&(e.read=Vx(t,e.read)),i()}let o={};for(let i=0,c=e.length;i<c;i++){let l=e[i];l==="__proto__"&&(l="__proto_"),o[l]=yt()}return Je.freezeData?Object.freeze(o):o}return n.count=0,e.read0=n,e.highByte===0?Vx(t,n):n}const Vx=(e,t)=>function(){let n=le[N++];if(n===0)return t();let o=e<32?-(e+(n<<5)):e+(n<<5),i=Oe[o]||N_()[o];if(!i)throw new Error("Record id is not defined for "+o);return i.read||(i.read=Vg(i,e)),i.read()};function N_(){let e=B_(()=>(le=null,Je.getStructures()));return Oe=Je._mergeStructures(e,Oe)}var rp=yc,aj=yc,cj=yc,uj=yc;function yc(e){let t;if(e<16&&(t=qg(e)))return t;if(e>64&&np)return np.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 c=le[N++]&63,l=(i&31)<<6|c;l<128?o.push(65533):o.push(l)}else if((i&240)===224){const c=le[N++]&63,l=le[N++]&63,d=(i&31)<<12|c<<6|l;d<2048||d>=55296&&d<=57343?o.push(65533):o.push(d)}else if((i&248)===240){const c=le[N++]&63,l=le[N++]&63,d=le[N++]&63;let h=(i&7)<<18|c<<12|l<<6|d;h<65536||h>1114111?o.push(65533):(h>65535&&(h-=65536,o.push(h>>>10&1023|55296),h=56320|h&1023),o.push(h))}else o.push(65533);o.length>=4096&&(t+=Pt.apply(String,o),o.length=0)}return o.length>0&&(t+=Pt.apply(String,o)),t}function qx(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=yt();return Je.freezeData?Object.freeze(t):t}function Wx(e){if(Je.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=j_();o==="__proto__"&&(o="__proto_"),t[o]=yt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(yt(),yt());return t}}var Pt=String.fromCharCode;function D_(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 Pt.apply(String,n)}function qg(e){if(e<4)if(e<2){if(e===0)return"";{let t=le[N++];if((t&128)>1){N-=1;return}return Pt(t)}}else{let t=le[N++],n=le[N++];if((t&128)>0||(n&128)>0){N-=2;return}if(e<3)return Pt(t,n);let o=le[N++];if((o&128)>0){N-=3;return}return Pt(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 Pt(t,n,o,i);{let c=le[N++];if((c&128)>0){N-=5;return}return Pt(t,n,o,i,c)}}else if(e<8){let c=le[N++],l=le[N++];if((c&128)>0||(l&128)>0){N-=6;return}if(e<7)return Pt(t,n,o,i,c,l);let d=le[N++];if((d&128)>0){N-=7;return}return Pt(t,n,o,i,c,l,d)}else{let c=le[N++],l=le[N++],d=le[N++],h=le[N++];if((c&128)>0||(l&128)>0||(d&128)>0||(h&128)>0){N-=8;return}if(e<10){if(e===8)return Pt(t,n,o,i,c,l,d,h);{let p=le[N++];if((p&128)>0){N-=9;return}return Pt(t,n,o,i,c,l,d,h,p)}}else if(e<12){let p=le[N++],y=le[N++];if((p&128)>0||(y&128)>0){N-=10;return}if(e<11)return Pt(t,n,o,i,c,l,d,h,p,y);let g=le[N++];if((g&128)>0){N-=11;return}return Pt(t,n,o,i,c,l,d,h,p,y,g)}else{let p=le[N++],y=le[N++],g=le[N++],v=le[N++];if((p&128)>0||(y&128)>0||(g&128)>0||(v&128)>0){N-=12;return}if(e<14){if(e===12)return Pt(t,n,o,i,c,l,d,h,p,y,g,v);{let x=le[N++];if((x&128)>0){N-=13;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,x)}}else{let x=le[N++],w=le[N++];if((x&128)>0||(w&128)>0){N-=14;return}if(e<15)return Pt(t,n,o,i,c,l,d,h,p,y,g,v,x,w);let k=le[N++];if((k&128)>0){N-=15;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,x,w,k)}}}}}function Hx(){let e=le[N++],t;if(e<192)t=e-160;else switch(e){case 217:t=le[N++];break;case 218:t=Ae.getUint16(N),N+=2;break;case 219:t=Ae.getUint32(N),N+=4;break;default:throw new Error("Expected string")}return yc(t)}function rm(e){return Je.copyBuffers?Uint8Array.prototype.slice.call(le,N,N+=e):le.subarray(N,N+=e)}function Ys(e){let t=le[N++];if(vn[t]){let n;return vn[t](le.subarray(N,n=N+=e),o=>{N=o;try{return yt()}finally{N=n}})}else throw new Error("Unknown extension type "+t)}var Kx=new Array(4096);function j_(){let e=le[N++];if(e>=160&&e<192){if(e=e-160,xr>=N)return Ss.slice(N-zn,(N+=e)-zn);if(!(xr==0&&Er<180))return rp(e)}else return N--,$_(yt());let t=(e<<5^(e>1?Ae.getUint16(N):e>0?le[N]:0))&4095,n=Kx[t],o=N,i=N+e-3,c,l=0;if(n&&n.bytes==e){for(;o<i;){if(c=Ae.getUint32(o),c!=n[l++]){o=1879048192;break}o+=4}for(i+=3;o<i;)if(c=le[o++],c!=n[l++]){o=1879048192;break}if(o===i)return N=o,n.string;i-=3,o=N}for(n=[],Kx[t]=n,n.bytes=e;o<i;)c=Ae.getUint32(o),n.push(c),o+=4;for(i+=3;o<i;)c=le[o++],n.push(c);let d=e<16?qg(e):D_(e);return d!=null?n.string=d:n.string=rp(e)}function $_(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(Je.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 Qx=(e,t)=>{let n=yt().map($_),o=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=Oe[e];return i&&(i.isShared||Es)&&((Oe.restoreStructures||(Oe.restoreStructures=[]))[e]=i),Oe[e]=n,n.read=Vg(n,o),(n.read0||n.read)()};vn[0]=()=>{};vn[0].noBuffer=!0;vn[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=(c,l)=>{let d=l-c;if(d<=40){let g=o.getBigUint64(c);for(let v=c+8;v<l;v+=8)g<<=BigInt(64),g|=o.getBigUint64(v);return g}let h=c+(d>>4<<3),p=i(c,h),y=i(h,l);return p<<BigInt((l-h)*8)|y};n=n<<BigInt((o.byteLength-t)*8)|i(t,o.byteLength)}return n};let Jx={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError=="function"?AggregateError:null};vn[101]=()=>{let e=yt();if(!Jx[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return Jx[e[0]](e[1],{cause:e[2]})};vn[105]=e=>{if(Je.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Ae.getUint32(N-4);Hr||(Hr=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};Hr.set(t,i);let c=yt();if(i.used)Object.assign(o,c);else return i.target=c;if(o instanceof Map)for(let[l,d]of c.entries())o.set(l,d);if(o instanceof Set)for(let l of Array.from(c))o.add(l);return o};vn[112]=e=>{if(Je.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Ae.getUint32(N-4),n=Hr.get(t);return n.used=!0,n.target};vn[115]=()=>new Set(yt());const U_=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(e=>e+"Array");let lj=typeof globalThis=="object"?globalThis:window;vn[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,o=U_[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 lj[o](n)};vn[120]=()=>{let e=yt();return new RegExp(e[0],e[1])};const fj=[];vn[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=N;return N+=t-e.length,It=fj,It=[Hx(),Hx()],It.position0=0,It.position1=0,It.postBundlePosition=N,N=n,yt()};vn[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 B_(e){let t=Er,n=N,o=zn,i=xr,c=Ss,l=Hr,d=It,h=new Uint8Array(le.slice(0,Er)),p=Oe,y=Oe.slice(0,Oe.length),g=Je,v=Es,x=e();return Er=t,N=n,zn=o,xr=i,Ss=c,Hr=l,It=d,le=h,Es=v,Oe=p,Oe.splice(0,Oe.length,...y),Je=g,Ae=new DataView(le.buffer,le.byteOffset,le.byteLength),x}function sp(){le=null,Hr=null,Oe=null}const Wg=new Array(147);for(let e=0;e<256;e++)Wg[e]=+("1e"+Math.floor(45.15-e*.30103));var xf=new Ga({useRecords:!1});xf.unpack;xf.unpackMultiple;xf.unpack;let dj=new Float32Array(1);new Uint8Array(dj.buffer,0,4);let el;try{el=new TextEncoder}catch{}let op,ip;const wi=typeof Buffer<"u",Nu=wi?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,z_=wi?Buffer:Uint8Array,Gx=wi?4294967296:2144337920;let Q,Sa,He,j=0,Wt,it=null,hj;const mj=21760,pj=/[\u0080-\uFFFF]/,ti=Symbol("record-id");class gj extends Ga{constructor(t){super(t),this.offset=0;let n,o,i,c,l=z_.prototype.utf8Write?function(E,$){return Q.utf8Write(E,$,Q.byteLength-$)}:el&&el.encodeInto?function(E,$){return el.encodeInto(E,Q.subarray($)).written}:!1,d=this;t||(t={});let h=t&&t.sequential,p=t.structures||t.saveStructures,y=t.maxSharedStructures;if(y==null&&(y=p?32:0),y>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&t.moreTypes==null&&(this.moreTypes=!0);let g=t.maxOwnStructures;g==null&&(g=p?32:64),!this.structures&&t.useRecords!=!1&&(this.structures=[]);let v=y>32||g+y>64,x=y+64,w=y+g+64;if(w>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let k=[],P=0,q=0;this.pack=this.encode=function(E,$){if(Q||(Q=new Nu(8192),He=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,8192)),j=0),Wt=Q.length-10,Wt-j<2048?(Q=new Nu(Q.length),He=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,Q.length)),Wt=Q.length-10,j=0):j=j+7&2147483640,n=j,$&wj&&(j+=$&255),c=d.structuredClone?new Map:null,d.bundleStrings&&typeof E!="string"?(it=[],it.size=1/0):it=null,i=d.structures,i){i.uninitialized&&(i=d._mergeStructures(d.getStructures()));let J=i.sharedLength||0;if(J>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 B=0;B<J;B++){let G=i[B];if(!G)continue;let re,te=i.transitions;for(let I=0,Z=G.length;I<Z;I++){let me=G[I];re=te[me],re||(re=te[me]=Object.create(null)),te=re}te[ti]=B+64}this.lastNamedStructuresLength=J}h||(i.nextId=J+64)}o&&(o=!1);let W;try{d.randomAccessStructure&&!d.readOnlyStructures&&E&&typeof E=="object"?E.constructor===Object?K(E):E.constructor!==Map&&!Array.isArray(E)&&!ip.some(B=>E instanceof B)?K(E.toJSON?E.toJSON():E):C(E):C(E);let J=it;if(it&&Xx(n,C,0),c&&c.idsToInsert){let B=c.idsToInsert.sort((I,Z)=>I.offset>Z.offset?1:-1),G=B.length,re=-1;for(;J&&G>0;){let I=B[--G].offset+n;I<J.stringsPosition+n&&re===-1&&(re=0),I>J.position+n?re>=0&&(re+=6):(re>=0&&(He.setUint32(J.position+n,He.getUint32(J.position+n)+re),re=-1),J=J.previous,G++)}re>=0&&J&&He.setUint32(J.position+n,He.getUint32(J.position+n)+re),j+=B.length*6,j>Wt&&V(j),d.offset=j;let te=yj(Q.subarray(n,j),B);return c=null,te}return d.offset=j,$&Sj?(Q.start=n,Q.end=j,Q):Q.subarray(n,j)}catch(J){throw W=J,J}finally{if(i&&(_(),o&&d.saveStructures)){let J=i.sharedLength||0,B=Q.subarray(n,j),G=vj(i,d);if(!W)return d.saveStructures(G,G.isCompatible)===!1?(i.uninitialized=!0,d.pack(E,$)):(d.lastNamedStructuresLength=J,Q.length>1073741824&&(Q=null),B)}Q.length>1073741824&&(Q=null),$&xj&&(j=n)}};const _=()=>{q<10&&q++;let E=i.sharedLength||0;if(i.length>E&&!h&&(i.length=E),P>1e4)i.transitions=null,q=0,P=0,k.length>0&&(k=[]);else if(k.length>0&&!h){for(let $=0,W=k.length;$<W;$++)k[$][ti]=0;k=[]}},A=E=>{var $=E.length;$<16?Q[j++]=144|$:$<65536?(Q[j++]=220,Q[j++]=$>>8,Q[j++]=$&255):(Q[j++]=221,He.setUint32(j,$),j+=4);for(let W=0;W<$;W++)C(E[W])},C=E=>{j>Wt&&(Q=V(j));var $=typeof E,W;if($==="string"){let J=E.length;if(it&&J>=4&&J<4096){if((it.size+=J)>mj){let te,I=(it[0]?it[0].length*3+it[1].length:0)+10;j+I>Wt&&(Q=V(j+I));let Z;it.position?(Z=it,Q[j]=200,j+=3,Q[j++]=98,te=j-n,j+=4,Xx(n,C,0),He.setUint16(te+n-3,j-n-te)):(Q[j++]=214,Q[j++]=98,te=j-n,j+=4),it=["",""],it.previous=Z,it.size=0,it.position=te}let re=pj.test(E);it[re?0:1]+=E,Q[j++]=193,C(re?-J:J);return}let B;J<32?B=1:J<256?B=2:J<65536?B=3:B=5;let G=J*3;if(j+G>Wt&&(Q=V(j+G)),J<64||!l){let re,te,I,Z=j+B;for(re=0;re<J;re++)te=E.charCodeAt(re),te<128?Q[Z++]=te:te<2048?(Q[Z++]=te>>6|192,Q[Z++]=te&63|128):(te&64512)===55296&&((I=E.charCodeAt(re+1))&64512)===56320?(te=65536+((te&1023)<<10)+(I&1023),re++,Q[Z++]=te>>18|240,Q[Z++]=te>>12&63|128,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128):(Q[Z++]=te>>12|224,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128);W=Z-j-B}else W=l(E,j+B);W<32?Q[j++]=160|W:W<256?(B<2&&Q.copyWithin(j+2,j+1,j+1+W),Q[j++]=217,Q[j++]=W):W<65536?(B<3&&Q.copyWithin(j+3,j+2,j+2+W),Q[j++]=218,Q[j++]=W>>8,Q[j++]=W&255):(B<5&&Q.copyWithin(j+5,j+3,j+3+W),Q[j++]=219,He.setUint32(j,W),j+=4),j+=W}else if($==="number")if(E>>>0===E)E<32||E<128&&this.useRecords===!1||E<64&&!this.randomAccessStructure?Q[j++]=E:E<256?(Q[j++]=204,Q[j++]=E):E<65536?(Q[j++]=205,Q[j++]=E>>8,Q[j++]=E&255):(Q[j++]=206,He.setUint32(j,E),j+=4);else if(E>>0===E)E>=-32?Q[j++]=256+E:E>=-128?(Q[j++]=208,Q[j++]=E+256):E>=-32768?(Q[j++]=209,He.setInt16(j,E),j+=2):(Q[j++]=210,He.setInt32(j,E),j+=4);else{let J;if((J=this.useFloat32)>0&&E<4294967296&&E>=-2147483648){Q[j++]=202,He.setFloat32(j,E);let B;if(J<4||(B=E*Wg[(Q[j]&127)<<1|Q[j+1]>>7])>>0===B){j+=4;return}else j--}Q[j++]=203,He.setFloat64(j,E),j+=8}else if($==="object"||$==="function")if(!E)Q[j++]=192;else{if(c){let B=c.get(E);if(B){if(!B.id){let G=c.idsToInsert||(c.idsToInsert=[]);B.id=G.push(B)}Q[j++]=214,Q[j++]=112,He.setUint32(j,B.id),j+=4;return}else c.set(E,{offset:j-n})}let J=E.constructor;if(J===Object)T(E);else if(J===Array)A(E);else if(J===Map)if(this.mapAsEmptyObject)Q[j++]=128;else{W=E.size,W<16?Q[j++]=128|W:W<65536?(Q[j++]=222,Q[j++]=W>>8,Q[j++]=W&255):(Q[j++]=223,He.setUint32(j,W),j+=4);for(let[B,G]of E)C(B),C(G)}else{for(let B=0,G=op.length;B<G;B++){let re=ip[B];if(E instanceof re){let te=op[B];if(te.write){te.type&&(Q[j++]=212,Q[j++]=te.type,Q[j++]=0);let fe=te.write.call(this,E);fe===E?Array.isArray(E)?A(E):T(E):C(fe);return}let I=Q,Z=He,me=j;Q=null;let pe;try{pe=te.pack.call(this,E,fe=>(Q=I,I=null,j+=fe,j>Wt&&V(j),{target:Q,targetView:He,position:j-fe}),C)}finally{I&&(Q=I,He=Z,j=me,Wt=Q.length-10)}pe&&(pe.length+j>Wt&&V(pe.length+j),j=Yx(pe,Q,j,te.type));return}}if(Array.isArray(E))A(E);else{if(E.toJSON){const B=E.toJSON();if(B!==E)return C(B)}if($==="function")return C(this.writeFunction&&this.writeFunction(E));T(E)}}}else if($==="boolean")Q[j++]=E?195:194;else if($==="bigint"){if(E<9223372036854776e3&&E>=-9223372036854776e3)Q[j++]=211,He.setBigInt64(j,E);else if(E<18446744073709552e3&&E>0)Q[j++]=207,He.setBigUint64(j,E);else if(this.largeBigIntToFloat)Q[j++]=203,He.setFloat64(j,Number(E));else{if(this.largeBigIntToString)return C(E.toString());if(this.useBigIntExtension||this.moreTypes){let J=E<0?BigInt(-1):BigInt(0),B;if(E>>BigInt(65536)===J){let G=BigInt(18446744073709552e3)-BigInt(1),re=[];for(;re.push(E&G),E>>BigInt(63)!==J;)E>>=BigInt(64);B=new Uint8Array(new BigUint64Array(re).buffer),B.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),wi)B=Buffer.from(re,"hex");else{B=new Uint8Array(re.length/2);for(let te=0;te<B.length;te++)B[te]=parseInt(re.slice(te*2,te*2+2),16)}if(G)for(let te=0;te<B.length;te++)B[te]=~B[te]}B.length+j>Wt&&V(B.length+j),j=Yx(B,Q,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($==="undefined")this.encodeUndefinedAsNil?Q[j++]=192:(Q[j++]=212,Q[j++]=0,Q[j++]=0);else throw new Error("Unknown type: "+$)},D=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?E=>{let $;if(this.skipValues){$=[];for(let B in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(B))&&!this.skipValues.includes(E[B])&&$.push(B)}else $=Object.keys(E);let W=$.length;W<16?Q[j++]=128|W:W<65536?(Q[j++]=222,Q[j++]=W>>8,Q[j++]=W&255):(Q[j++]=223,He.setUint32(j,W),j+=4);let J;if(this.coercibleKeyAsNumber)for(let B=0;B<W;B++){J=$[B];let G=Number(J);C(isNaN(G)?J:G),C(E[J])}else for(let B=0;B<W;B++)C(J=$[B]),C(E[J])}:E=>{Q[j++]=222;let $=j-n;j+=2;let W=0;for(let J in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(J))&&(C(J),C(E[J]),W++);if(W>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');Q[$+++n]=W>>8,Q[$+n]=W&255},U=this.useRecords===!1?D:t.progressiveRecords&&!v?E=>{let $,W=i.transitions||(i.transitions=Object.create(null)),J=j++-n,B;for(let G in E)if(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(G)){if($=W[G],$)W=$;else{let re=Object.keys(E),te=W;W=i.transitions;let I=0;for(let Z=0,me=re.length;Z<me;Z++){let pe=re[Z];$=W[pe],$||($=W[pe]=Object.create(null),I++),W=$}J+n+1==j?(j--,ee(W,re,I)):ne(W,re,J,I),B=!0,W=te[G]}C(E[G])}if(!B){let G=W[ti];G?Q[J+n]=G:ne(W,Object.keys(E),J,0)}}:E=>{let $,W=i.transitions||(i.transitions=Object.create(null)),J=0;for(let G in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(G))&&($=W[G],$||($=W[G]=Object.create(null),J++),W=$);let B=W[ti];B?B>=96&&v?(Q[j++]=((B-=96)&31)+96,Q[j++]=B>>5):Q[j++]=B:ee(W,W.__keys__||Object.keys(E),J);for(let G in E)(typeof E.hasOwnProperty!="function"||E.hasOwnProperty(G))&&C(E[G])},O=typeof this.useRecords=="function"&&this.useRecords,T=O?E=>{O(E)?U(E):D(E)}:U,V=E=>{let $;if(E>16777216){if(E-n>Gx)throw new Error("Packed buffer would be larger than maximum buffer size");$=Math.min(Gx,Math.round(Math.max((E-n)*(E>67108864?1.25:2),4194304)/4096)*4096)}else $=(Math.max(E-n<<2,Q.length-1)>>12)+1<<12;let W=new Nu($);return He=W.dataView||(W.dataView=new DataView(W.buffer,0,$)),E=Math.min(E,Q.length),Q.copy?Q.copy(W,0,n,E):W.set(Q.slice(n,E)),j-=n,n=0,Wt=W.length-10,Q=W},ee=(E,$,W)=>{let J=i.nextId;J||(J=64),J<x&&this.shouldShareStructure&&!this.shouldShareStructure($)?(J=i.nextOwnId,J<w||(J=x),i.nextOwnId=J+1):(J>=w&&(J=x),i.nextId=J+1);let B=$.highByte=J>=96&&v?J-96>>5:-1;E[ti]=J,E.__keys__=$,i[J-64]=$,J<x?($.isShared=!0,i.sharedLength=J-63,o=!0,B>=0?(Q[j++]=(J&31)+96,Q[j++]=B):Q[j++]=J):(B>=0?(Q[j++]=213,Q[j++]=114,Q[j++]=(J&31)+96,Q[j++]=B):(Q[j++]=212,Q[j++]=114,Q[j++]=J),W&&(P+=q*W),k.length>=g&&(k.shift()[ti]=0),k.push(E),C($))},ne=(E,$,W,J)=>{let B=Q,G=j,re=Wt,te=n;Q=Sa,j=0,n=0,Q||(Sa=Q=new Nu(8192)),Wt=Q.length-10,ee(E,$,J),Sa=Q;let I=j;if(Q=B,j=G,Wt=re,n=te,I>1){let Z=j+I-1;Z>Wt&&V(Z);let me=W+n;Q.copyWithin(me+I,me+1,j),Q.set(Sa.slice(0,I),me),j=Z}else Q[W+n]=Sa[0]},K=E=>{let $=hj(E,Q,n,j,i,V,(W,J,B)=>{if(B)return o=!0;j=J;let G=Q;return C(W),_(),G!==Q?{position:j,targetView:He,target:Q}:j},this);if($===0)return T(E);j=$}}useBuffer(t){Q=t,Q.dataView||(Q.dataView=new DataView(Q.buffer,Q.byteOffset,Q.byteLength)),He=Q.dataView,j=0}set position(t){j=t}get position(){return j}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}ip=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,L_];op=[{pack(e,t,n){let o=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&o>=0&&o<4294967296){let{target:i,targetView:c,position:l}=t(6);i[l++]=214,i[l++]=255,c.setUint32(l,o)}else if(o>0&&o<4294967296){let{target:i,targetView:c,position:l}=t(10);i[l++]=215,i[l++]=255,c.setUint32(l,e.getMilliseconds()*4e6+(o/1e3/4294967296>>0)),c.setUint32(l+4,o)}else if(isNaN(o)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:i,targetView:c,position:l}=t(3);i[l++]=212,i[l++]=255,i[l++]=255}else{let{target:i,targetView:c,position:l}=t(15);i[l++]=199,i[l++]=12,i[l++]=255,c.setUint32(l,e.getMilliseconds()*1e6),c.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:c}=t(this.moreTypes?3:0);this.moreTypes&&(i[c++]=212,i[c++]=115,i[c++]=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?sm(e,16,t):om(wi?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==z_&&this.moreTypes?sm(e,U_.indexOf(n.name),t):om(e,t)}},{pack(e,t){this.moreTypes?sm(e,17,t):om(wi?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:o}=t(1);n[o]=193}}];function sm(e,t,n,o){let i=e.byteLength;if(i+1<256){var{target:c,position:l}=n(4+i);c[l++]=199,c[l++]=i+1}else if(i+1<65536){var{target:c,position:l}=n(5+i);c[l++]=200,c[l++]=i+1>>8,c[l++]=i+1&255}else{var{target:c,position:l,targetView:d}=n(7+i);c[l++]=201,d.setUint32(l,i+1),l+=4}c[l++]=116,c[l++]=t,e.buffer||(e=new Uint8Array(e)),c.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l)}function om(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:c}=t(n+5);o[i++]=198,c.setUint32(i,n),i+=4}o.set(e,i)}function Yx(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 yj(e,t){let n,o=t.length*6,i=e.length-o;for(;n=t.pop();){let c=n.offset,l=n.id;e.copyWithin(c+o,c,i),o-=6;let d=c+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=c}return e}function Xx(e,t,n){if(it.length>0){He.setUint32(it.position+e,j+n-it.position-e),it.stringsPosition=j-e;let o=it;it=null,t(o[0]),t(o[1])}}function vj(e,t){return e.isCompatible=n=>{let o=!n||(t.lastNamedStructuresLength||0)===n.length;return o||t._mergeStructures(n),o},e}let V_=new gj({useRecords:!1});V_.pack;V_.pack;const Sj=512,xj=1024,wj=2048;class Hg extends Kn()("effect/rpc/RpcSerialization"){}const kj=Hg.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)}}}),Ej=lg(Hg)(kj),_j=e=>Cr(()=>{const t=new Set,n=new Map,o=new Map;let i=(c,l)=>hE(d=>{let h=n.get(c);return h||(h=[],n.set(c,h)),h.push([l,d]),gt});return As(e((c,l)=>{const d=o.get(c);return d?d(l):i(c,l)},t),c=>({...c,run(l,d){return Dm(function*(){t.add(l),o.set(l,d);const h=n.get(l);if(h){n.delete(l);for(const[p,y]of h)yield*co(Cr(()=>d(p)),y)}return yield*gE(vL,()=>(t.delete(l),o.delete(l),gt))})}}))});let Cj=BigInt(0);const bj=uo(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,c=(t==null?void 0:t.generateRequestId)??(()=>Cj++),l=yield*vl(),d=ao(l,HS),h=new Map;let p=!1;yield*WA(d,gl(_=>(p=!0,y(DA(_.id)))));const y=uo(function*(_){for(const[A,C]of h)h.delete(A),C._tag==="Queue"?yield*_._tag==="Success"?mx(C.queue):Ea(C.queue,_.cause):C.resume(_)}),g=_=>{const A=w_(_.successSchema),C=w(_);return(D,U)=>{const O=U!=null&&U.headers?N4(U.headers):Ug,T=(U==null?void 0:U.context)??cr();if(!A){const ee=ne=>v(_,C,ne,_.payloadSchema.make(D),O,T,(U==null?void 0:U.discard)??!1);return i?ee(void 0):$L(`${n}.${_._tag}`,{attributes:t.spanAttributes},ee)}const V=x(_,C,_.payloadSchema.make(D),O,(U==null?void 0:U.streamBufferSize)??16,T);return U!=null&&U.asQueue?V:ON(As(V,LN))}},v=(_,A,C,D,U,O,T)=>gl(V=>{if(p)return jm;const ee=c(),ne=A(E=>t.onFromClient({message:E,context:O,discard:T}),{_tag:"Request",id:ee,tag:_._tag,payload:D,...C?{traceId:C.traceId,spanId:C.spanId,sampled:C.sampled}:{},headers:jx(V.getRef(ew),U)});if(T)return ne;let K;return DL(ZS(E=>{const $={_tag:"Effect",rpc:_,context:O,resume(W){E(W),K&&!K.pollUnsafe()&&V.currentDispatcher.scheduleTask(()=>{K.interruptUnsafe(V.id)},0)}};h.set(ee,$),K=ne.pipe(C?tx(C,{captureStackTrace:!1}):Fe,Sl(V.context)),K.addObserver(W=>{if(W._tag==="Failure")return E(W)})}),E=>(h.delete(ee),kL(t_(K),k(ee,Array.from(E),O))))}),x=uo(function*(_,A,C,D,U,O){if(p)return yield*jm;const T=i?void 0:yield*jL(`${n}.${_._tag}`,{attributes:t.spanAttributes}),V=Hm(),ee=c(),ne=Jl(V.context,HS);yield*qA(ne,E=>h.has(ee)?(h.delete(ee),k(ee,Xk(E)?Array.from(AA(E.cause)):[],O)):gt);const K=yield*E3(U);return h.set(ee,{_tag:"Queue",rpc:_,queue:K,scope:ne,context:O}),yield*A(E=>t.onFromClient({message:E,context:O,discard:!1}),{_tag:"Request",id:ee,tag:_._tag,payload:C,...T?{traceId:T.traceId,spanId:T.spanId,sampled:T.sampled}:{},headers:jx(V.getRef(ew),D)}).pipe(T?tx(T,{captureStackTrace:!1}):Fe,yl(E=>Ea(K,E)),hg,UL(ne,{startImmediately:!0})),K}),w=_=>{const A=[];for(const C of _.middlewares.values()){const D=l.mapUnsafe.get(`${C.key}/Client`);D&&A.push(D)}return A.length===0?(C,D)=>C(D):function C(D,U,O=A.length-1){return O===-1?D(U):A[O]({rpc:_,request:U,next(T){return C(D,T,O-1)}})}},k=(_,A,C)=>ZS(D=>{const U=Hm();t.onFromClient({message:{_tag:"Interrupt",requestId:_,interruptors:A},context:C,discard:!1}).pipe(FL(1e3),Sl(U.context)).addObserver(()=>{D(gt)})}),P=_=>{switch(_._tag){case"Chunk":{const A=_.requestId,C=h.get(A);return!C||C._tag!=="Queue"?gt:_3(C.queue,_.values).pipe(o?Rn(()=>t.onFromClient({message:{_tag:"Ack",requestId:_.requestId},context:C.context,discard:!1})):Fe,yl(D=>Ea(C.queue,D)))}case"Exit":{const A=_.requestId,C=h.get(A);return C?(h.delete(A),C._tag==="Effect"?(C.resume(_.exit),gt):_.exit._tag==="Success"?mx(C.queue):Ea(C.queue,_.exit.cause)):gt}case"Defect":return y(NA(_.defect));case"ClientEnd":return gt}};let q;if(t.flatten){const _=new Map;q=function(C,D,U){let O=_.get(C);return O||(O=g(e.requests.get(C)),_.set(C,O)),O(D,U)}}else q={},e.requests.forEach(_=>{q[_._tag]=g(_)});return{client:q,write:P}});let Pj=0;const Fj=uo(function*(e,t){const n=Pj++,{run:o,send:i,supportsAck:c,supportsTransferables:l}=yield*wf,d=new Map,{client:h,write:p}=yield*bj(e,{...t,supportsAck:c,onFromClient({message:y}){switch(y._tag){case"Request":{const g=e.requests.get(y.tag),v=l?X4():void 0,x=Hm(),w={rpc:g,context:v?Ts(x.context,A_,v):x.context,schemas:Ij(g)};return d.set(y.id,w),w.schemas.encodePayload(y.payload).pipe(co(w.context),Qu,Rn(k=>i(n,{...y,id:String(y.id),payload:k,headers:Object.entries(y.headers)},v&&v.readUnsafe())))}case"Ack":return d.get(y.requestId)?i(n,{_tag:"Ack",requestId:String(y.requestId)}):gt;case"Interrupt":return d.get(y.requestId)?(d.delete(y.requestId),i(n,{_tag:"Interrupt",requestId:String(y.requestId)})):gt;case"Eof":return gt}}});return yield*o(n,y=>{switch(y._tag){case"Chunk":{const g=Lu(y.requestId),v=d.get(g);return!v||So(v.schemas.decodeChunk)?gt:v.schemas.decodeChunk.value(y.values).pipe(co(v.context),Qu,Rn(x=>p({_tag:"Chunk",clientId:0,requestId:Lu(y.requestId),values:x})),NL(x=>p({_tag:"Exit",clientId:0,requestId:Lu(y.requestId),exit:Fa(x)})))}case"Exit":{const g=Lu(y.requestId),v=d.get(g);return v?(d.delete(g),v.schemas.decodeExit(y.exit).pipe(co(v.context),Qu,RL({onSuccess:x=>p({_tag:"Exit",clientId:0,requestId:g,exit:x}),onFailure:x=>p({_tag:"Exit",clientId:0,requestId:g,exit:Fa(x)})}))):gt}case"Defect":return p({_tag:"Defect",clientId:0,defect:Aj(y.defect)});case"ClientProtocolError":{const g=cc(y.error);return uE(d.keys(),v=>p({_tag:"Exit",clientId:0,requestId:v,exit:g}))}default:return gt}}).pipe(yl(QL),hg,mg),h}),Zx=new WeakMap,Ij=e=>{let t=Zx.get(e);if(t!==void 0)return t;const n=k_(e.successSchema);return t={decodeChunk:$p(n,o=>gx(Wh(cN(o.success)))),encodePayload:sN(Wh(e.payloadSchema)),decodeExit:gx(Wh(YN(e)))},Zx.set(e,t),t},ew=rt("effect/rpc/RpcClient/CurrentHeaders",{defaultValue:()=>Ug});class wf extends Kn()("effect/rpc/RpcClient/Protocol"){}L(wf,"make",_j);const Rj=e=>wf.make(uo(function*(t,n){const o=yield*zg,i=yield*Hg,c=yield*ML(ap),l=new Map,d=yield*o.writer;let h=i.makeUnsafe();const p=yield*Mj(d(h.encode(sj)));let y;const g=Cr(()=>(y=void 0,_s(c)?c.value.onConnect:gt)),v=x=>uE(n,w=>t(w,x));return yield*Cr(()=>(h=i.makeUnsafe(),p.reset(),o.runRaw(x=>{try{const w=h.decode(x);if(w.length===0)return;let k=0;return lE({while:()=>k<w.length,body:()=>{const P=w[k++];if(P._tag==="Pong")return p.onPong(),gt;if("requestId"in P){const q=l.get(P.requestId);if(q!==void 0)return P._tag==="Exit"&&l.delete(P.requestId),t(q,P)}return v(P)},step:Za})}catch(w){return v({_tag:"ClientProtocolError",error:new tp({reason:new ep({message:"Error decoding message",cause:w})})})}},{onOpen:g}).pipe(dE(Rn(p.timeout,()=>Ge(new li({reason:new Tl({kind:"Timeout",cause:new Error("ping timeout")})}))))))).pipe(Rn(()=>Ge(new li({reason:new Ml({code:1e3})}))),_s(c)?pE(c.value.onDisconnect):Fe,CL(x=>{const w=ac(x),k=lR(w);return y=new tp({reason:k?w.success.reason:new ep({message:"Unknown socket error",cause:Jk(x)})}),v({_tag:"ClientProtocolError",error:y})}),bL((e==null?void 0:e.retryPolicy)??Tj),JL({module:"RpcClient",method:"makeProtocolSocket"}),mg),{send(x,w){if(y)return Ge(y);w._tag==="Request"&&l.set(w.id,x);const k=h.encode(w);return k===void 0?gt:Qu(d(k))},supportsAck:!0,supportsTransferables:!1}})),Tj=cL(500,1.5).pipe(iL(aE(5e3))),Mj=uo(function*(e){let t=!0;const n=n_(),o=()=>{t=!0,n.closeUnsafe()},i=()=>{t=!0};return yield*Cr(()=>t?(t=!1,e):n.open).pipe(IL("5 seconds"),PL,yE,hg,mg),{timeout:n.await,reset:o,onPong:i}});class ap extends Kn()("effect/rpc/RpcClient/ConnectionHooks"){}const Aj=nN(dr);class q_ extends Error{constructor(t="daemon RPC connection closed"){super(t),this.name="DaemonRpcConnectionError"}}class Lj extends Error{constructor(t,n){super(`${t} timed out after ${n}ms`),this.method=t,this.timeoutMs=n,this.name="DaemonRpcRequestTimeoutError"}}class Du extends Kn()("tokmon/client/DaemonRpcClient/TokmonRpcClient"){}const Oj=new Function("specifier","return import(specifier)");function tw(){let e=!1,t;return{promise:new Promise(o=>{t=o}),resolve:o=>{e||(e=!0,t(o))}}}function Nj(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=nD,n.toString()}function Dj(e){return e==="node"?!0:e==="browser"?!1:typeof window>"u"}async function jj(e,t,n){const o={openTimeout:Ba(n)};return Dj(t)?(await Oj("@effect/platform-node/NodeSocket")).layerWebSocket(e,o):Y4(e,o).pipe(Nm(Q4))}function tl(e){return{protocol:{version:e.protocol.version,capabilities:[...e.protocol.capabilities]},config:XF(e.config)}}function $j(e){const t=o=>o?{...o,activeAccountIds:[...o.activeAccountIds],factors:o.factors.map(i=>({...i}))}:void 0,n=o=>o.map(i=>({...i,models:[...i.models],breakdown:i.breakdown.map(c=>({...c}))}));return{...e,providers:e.providers.map(o=>({...o,headroom:t(o.headroom)})),accounts:e.accounts.map(o=>{var i;return{...o,identity:o.identity?{...o.identity}:void 0,quotas:(i=o.quotas)==null?void 0:i.map(c=>({...c})),headroom:t(o.headroom),dashboard:o.dashboard?{...o.dashboard,today:{...o.dashboard.today},week:{...o.dashboard.week},month:{...o.dashboard.month},series:[...o.dashboard.series]}:null,table:o.table?{daily:n(o.table.daily),weekly:n(o.table.weekly),monthly:n(o.table.monthly)}:null,billing:o.billing?{...o.billing,metrics:o.billing.metrics.map(c=>({...c,format:{...c.format}})),activity:o.billing.activity?{...o.billing.activity,series:[...o.billing.activity.series]}:o.billing.activity,modelSpend:o.billing.modelSpend==null?o.billing.modelSpend:o.billing.modelSpend.map(c=>({...c}))}:null,summaryUpdatedAt:o.summaryUpdatedAt??null,billingUpdatedAt:o.billingUpdatedAt??null,tableUpdatedAt:o.tableUpdatedAt??null}}),peak:e.peak?{...e.peak}:null}}function Uj(e){if(!e||typeof e!="object"||e.kind!=="conflict")return e;const t=e.state;if(!t)return e;const n=tl(t);return e instanceof Xm?new Xm({kind:"conflict",state:n}):{...e,state:n}}function Bj(e){return e instanceof tp||tN(e)}async function zj(e,t,n){let o=null;try{await Promise.race([e.promise,t.promise.then(i=>Promise.reject(i)),new Promise((i,c)=>{var l;o=setTimeout(()=>c(new q_(`daemon RPC connection timed out after ${n}ms`)),n),(l=o.unref)==null||l.call(o)})])}finally{o&&clearTimeout(o)}}function Vj(e,t={}){const n=Nj(e),o=Math.max(1,t.requestTimeoutMs??3e4),i=Math.max(1,t.reconnectBaseDelayMs??250),c=new Set;let l=null,d=null,h=null,p=null,y=null,g=0,v=!1,x=!1;const w=K=>{if(t.onSubscriberError){try{t.onSubscriberError(K)}catch(E){console.error("[tokmon] daemon RPC subscriber error reporter failed",E)}return}console.error("[tokmon] daemon RPC subscriber failed",K)},k=(K,E)=>{var $;try{($=t.onConn)==null||$.call(t,K,E)}catch(W){w(W)}},P=()=>{y&&(clearTimeout(y),y=null)},q=K=>{const E=K.fiber;return K.fiber=null,K.owner=null,E?Ju(t_(E)).catch(()=>{}):Promise.resolve()},_=K=>(K.active=!1,c.delete(K),K.watchdogTimer&&(clearInterval(K.watchdogTimer),K.watchdogTimer=null),q(K)),A=()=>{var E;if(x||c.size===0||y||l||d||typeof t.reconnectAttempts=="number"&&g>=t.reconnectAttempts)return;const K=Math.min(2500,i*1.5**g);y=setTimeout(()=>{y=null,g++,ee()},K),(E=y.unref)==null||E.call(y)},C=(K,E,$)=>{K.invalidated||(K.invalidated=!0,l===K&&(l=null),K.runtime.dispose().catch(()=>{}),x||k(E,$),A())},D=async(K,E)=>{const $=await jj(n,t.transport,o),W=lg(ap,ap.of({onConnect:Vn(()=>{K.resolve()}),onDisconnect:Vn(()=>{E.resolve(new q_)})}));return Lm(wf,Rj({retryPolicy:uL(0)})).pipe(Nm(nE($,Ej,W)))},U=async()=>{if(x)throw new Error("daemon RPC client is closed");if(l)return l;if(d)return d;k(v?"reconnecting":"connecting");const K=(async()=>{let E=null;try{const $=tw(),W=tw(),J=await D($,W),B=Lm(Du,Fj(DD)).pipe(Nm(J));if(E=KN(B),h=E,await E.runPromise(Du.asEffect()),await zj($,W,o),x)throw new Error("daemon RPC client is closed");const G={runtime:E,disconnected:W.promise,invalidated:!1};return l=G,h=null,v=!0,g=0,k("live"),G.disconnected.then(re=>{C(G,"reconnecting",re)}),V(G),G}catch($){throw h===E&&(h=null),await(E==null?void 0:E.dispose().catch(()=>{})),x||k("error",$),$}})();d=K;try{return await K}finally{d===K&&(d=null)}},O=async(K,E)=>{const $=await U();try{return await $.runtime.runPromise(Du.use(W=>E(W)).pipe(fE({duration:Ba(o),orElse:()=>Ge(new Lj(K,o))})))}catch(W){const J=Uj(W);throw!x&&Bj(J)&&C($,"error",J),J}},T=(K,E)=>{if(x||!K.active||K.fiber||E.invalidated)return;K.lastValueAt=Date.now(),K.staleAfterMs=t.snapshotStaleFloorMs??9e4,K.owner=E;const $=E.runtime.runFork(Du.use(W=>K.streamFor(W).pipe(DN(J=>Vn(()=>{K.lastValueAt=Date.now(),K.staleAfterFor&&(K.staleAfterMs=K.staleAfterFor(J));try{K.onValue(J)}catch(B){w(B)}})))));K.fiber=$,$.addObserver(W=>{K.fiber===$&&(K.fiber=null),K.owner===E&&(K.owner=null),!(x||!K.active||E.invalidated)&&(Yk(W)?C(E,"reconnecting"):C(E,"error",Jk(W.cause)))})},V=K=>{for(const E of c)T(E,K)};function ee(){x||c.size===0||p||(p=U().then(()=>{}).catch(()=>{A()}).finally(()=>{p=null}))}const ne=(K,E,$)=>{var J,B;if(x)return()=>{};const W={streamFor:K,onValue:E,staleAfterFor:$,active:!0,fiber:null,owner:null,watchdogTimer:null,lastValueAt:0,staleAfterMs:Number.POSITIVE_INFINITY};if(c.add(W),$){const G=Math.min(5e3,Math.max(10,(t.snapshotStaleFloorMs??9e4)/2));W.watchdogTimer=setInterval(()=>{!W.fiber||!W.owner||W.lastValueAt===0||Date.now()-W.lastValueAt<=W.staleAfterMs||(W.lastValueAt=Date.now(),C(W.owner,"reconnecting"))},G),(B=(J=W.watchdogTimer).unref)==null||B.call(J)}return l?T(W,l):ee(),()=>{_(W),c.size===0&&P()}};return{getConfig:()=>O(Ht.getConfig,K=>K[Ht.getConfig]({})).then(tl),setConfig:K=>O(Ht.setConfig,E=>E[Ht.setConfig](K)).then(tl),refresh:(K="all")=>O(Ht.refresh,E=>E[Ht.refresh]({scope:K})),browseFs:K=>O(Ht.browseFs,E=>E[Ht.browseFs]({path:K})),subscribeSnapshot:K=>ne(E=>E[Ht.snapshot]({}).pipe(kx($j)),K,E=>Math.max(t.snapshotStaleFloorMs??9e4,E.intervalMs*3)),subscribeConfig:K=>ne(E=>E[Ht.config]({}).pipe(kx(tl)),K),async close(){if(x)return;x=!0,k("closed"),P();const K=[...c].map(_);c.clear();const E=l;l=null,await(h==null?void 0:h.dispose().catch(()=>{})),await Promise.all(K),await(E==null?void 0:E.runtime.dispose().catch(()=>{})),await(d==null?void 0:d.catch(()=>{})),h=null,d=null,p=null}}}let im=null;const cp=new Set;function qj(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 p=new URLSearchParams(i.slice(d+1));p.has("tokmonToken")&&(p.delete("tokmonToken"),i=`${i.slice(0,d)}${p.size?`#${p.toString()}`:""}`)}const h=i.indexOf("?");if(h!==-1){const p=new URLSearchParams(i.slice(h+1));p.delete("tokmonToken"),i=`${i.slice(0,h)}${p.size?`?${p.toString()}`:""}`}}const c=o.size?`?${o.toString()}`:"",l=i?`#${i}`:"";return`${e}${c}${l}`}if(typeof window<"u"){const e=`${window.location.pathname}${window.location.search}${window.location.hash}`,t=qj(window.location.pathname,window.location.search,window.location.hash);t!==e&&window.history.replaceState(window.history.state,"",t)}function Wj(e){for(const t of cp)t(e)}function Hj(e){e!=="closed"&&Wj(e)}function Ls(){return im||(im=Vj(window.location.origin,{transport:"browser",onConn:Hj})),im}function Kj(e){return cp.add(e),()=>{cp.delete(e)}}function Qj(){const[e,t]=X.useState(null),[n,o]=X.useState("connecting"),i=X.useRef(null);return X.useEffect(()=>{let c=!1,l=null;const d=Ls();return l=Kj(h=>{c||o(h)}),i.current=d.subscribeSnapshot(h=>{c||(t(h),o("live"))}),()=>{var h;c=!0,l==null||l(),(h=i.current)==null||h.call(i),i.current=null}},[]),{snapshot:e,conn:n}}function bs(e){return{...e,config:p1(e.config).config}}async function Jj(){return bs(await Ls().getConfig())}async function up(e,t,n=Ls()){return bs(await n.setConfig({config:e,expectedRevision:t}))}async function Gj(e,t=Ls()){const n=bs(e),o=!n.config.privacyMode;try{return await up({...n.config,privacyMode:o},n.config.revision,t)}catch(i){const c=bp(i).conflictState;if(!c)throw i;const l=bs(c);return l.config.privacyMode===o?l:up({...l.config,privacyMode:o},l.config.revision,t)}}async function Yj(e,t,n=Ls()){const o=bs(e),i=c=>up({...c.config,appearance:{...c.config.appearance,mode:t}},c.config.revision,n);try{return await i(o)}catch(c){const l=bp(c).conflictState;if(!l)throw c;const d=bs(l);return d.config.appearance.mode===t?d:i(d)}}function Xj(e){const t=bp(e).conflictState;return t?bs(t):null}async function M6(e){return Ls().browseFs(e)}function W_(e){return Ls().subscribeConfig(t=>{e(bs(t))})}async function Zj(){return Ls().refresh("all")}function e$(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 t$="tokmon-theme-cache-v1",n$=1,r$={canvas:"--color-bg-0",panel:"--color-bg-1",inset:"--color-bg-2",insetStrong:"--color-bg-3",line:"--color-line",lineStrong:"--color-line-2",lineFaint:"--color-line-faint",text:"--color-fg",textDim:"--color-fg-dim",textFaint:"--color-fg-faint",textStrong:"--color-fg-bright",accent:"--color-accent",cost:"--color-cost",positive:"--color-positive",ok:"--color-ok",warn:"--color-warning",crit:"--color-critical",unknown:"--color-unknown",card:"--color-card",cardHover:"--color-card-hover",divider:"--color-divider",track:"--color-track",accentTint:"--color-accent-tint",accentOn:"--color-accent-on",focusRing:"--color-focus-ring"};function s$(e,t){const n=d1(e,t?"dark":"light");return{appearance:e,...n}}function H_(e){return Object.fromEntries(Object.entries(r$).map(([t,n])=>[n,e[t]]))}function o$(e,t){e.classList.toggle("light",t.mode==="light"),e.classList.toggle("dark",t.mode==="dark"),e.dataset.themeMode=t.mode,e.dataset.themePreset=t.appearance.preset;for(const[n,o]of Object.entries(H_(t.tokens)))e.style.setProperty(n,o)}function i$(e){return JSON.stringify({version:n$,mode:e.mode,preset:e.appearance.preset,vars:H_(e.tokens)})}function a$(e,t){var n,o;document.documentElement.style.colorScheme=e,(n=document.querySelector('meta[name="color-scheme"]'))==null||n.setAttribute("content",e),(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",t)}function c$(e){try{localStorage.setItem(t$,i$(e))}catch{}}function u$(e){return e==="auto"?"light":e==="light"?"dark":"auto"}function A6(e){return e.preset!=="custom"||!e.custom?[]:["light","dark"].flatMap(t=>{var d;const n=((d=e.custom)==null?void 0:d[t])??{},i=Object.entries(n).filter(h=>sr(h[1])===null).map(([h])=>({mode:t,keys:[h],message:"Use #RRGGBB."})),c=Object.fromEntries(Object.entries(n).filter(([,h])=>sr(h)!==null)),l=d1({...e,preset:"custom",mode:t,custom:{base:e.custom.base,light:{},dark:{}}},t).tokens;for(const h of l1({...l,...c}))i.push({mode:t,keys:[h.foreground,h.background],message:`${h.foreground} needs ${h.minimum}:1 contrast on ${h.background}.`});return i})}const K_=X.createContext(null);function l$(e){const t=window.matchMedia("(prefers-color-scheme: dark)"),n=o=>e(o.matches);return t.addEventListener("change",n),e(t.matches),()=>t.removeEventListener("change",n)}function f$({children:e}){const[t,n]=X.useState(null),[o,i]=X.useState(null),[c,l]=X.useState(()=>window.matchMedia("(prefers-color-scheme: dark)").matches),d=X.useRef(null),h=X.useCallback(x=>{d.current=x,n(x)},[]);X.useEffect(()=>l$(l),[]),X.useEffect(()=>{let x=!0;Jj().then(k=>{x&&h(k)}).catch(()=>{});const w=W_(k=>{x&&h(k)});return()=>{x=!1,w()}},[h]);const p=o??(t==null?void 0:t.config.appearance)??ci,y=X.useMemo(()=>s$(p,c),[p,c]);X.useEffect(()=>{!t&&!o||(o$(document.documentElement,y),a$(y.mode,y.tokens.canvas),o||c$(y))},[o,y,t]);const g=X.useCallback(async()=>{const x=d.current;if(!x)return;const w=u$(x.config.appearance.mode);try{h(await Yj(x,w))}catch{}},[h]),v=X.useMemo(()=>({appearance:p,resolved:y,ready:t!==null,setPreview:i,commit:x=>{i(null),h(x)},toggleMode:g}),[h,p,y,t,g]);return F.jsx(K_.Provider,{value:v,children:e})}function d$(){const e=X.useContext(K_);if(!e)throw new Error("useTheme must be used inside ThemeProvider");return e}const nw=[100,86,72,58,46,92,78,64,52,82,68,56];function lp(e){return`color-mix(in oklab, var(--color-accent) ${nw[e%nw.length]}%, var(--color-fg-dim))`}function Q_(e){return e==="phosphor"}function L6(e,t,n){return Q_(e)?lp(t):n}function h$(e,t){return Q_(t.preset)?{...e,byProvider:e.byProvider.map((n,o)=>({...n,color:lp(o)})),byModel:e.byModel.map((n,o)=>({...n,color:lp(o)}))}:e}const J_=()=>Promise.all([wr(()=>import("./overview-CmPN-0w3.js"),__vite__mapDeps([4,5]),import.meta.url),wr(()=>import("./timeline-D_JPTxAw.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),G_=()=>Promise.all([wr(()=>import("./analytics-DSLBg5Lx.js"),__vite__mapDeps([7,5]),import.meta.url),wr(()=>import("./breakdown-B1vg0Xn1.js"),__vite__mapDeps([8,2,5]),import.meta.url),wr(()=>import("./timeline-D_JPTxAw.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),Y_=()=>Promise.all([wr(()=>import("./models-_DeHctpR.js"),__vite__mapDeps([9,5]),import.meta.url),wr(()=>import("./breakdown-B1vg0Xn1.js"),__vite__mapDeps([8,2,5]),import.meta.url)]).then(([e])=>e),X_=()=>wr(()=>import("./explore-DyJiyG0m.js"),__vite__mapDeps([10,5]),import.meta.url),m$={overview:J_,analytics:G_,models:Y_,explore:X_},p$=X.lazy(()=>J_().then(e=>({default:e.OverviewTab}))),g$=X.lazy(()=>G_().then(e=>({default:e.AnalyticsTab}))),y$=X.lazy(()=>Y_().then(e=>({default:e.ModelsTab}))),v$=X.lazy(()=>X_().then(e=>({default:e.ExploreTab}))),S$=X.lazy(()=>wr(()=>import("./settings-sheet-AfoLwoCy.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>({default:e.SettingsSheet}))),rw=e=>{m$[e]()},fp=e=>`/${e}`,Z_=X.createContext(null),kf=()=>{const e=X.useContext(Z_);if(!e)throw new Error("useDashboard outside provider");return e};function x$(){var Le,Ce;const e=CF({select:ue=>ue.location.pathname}),t=Sp(),{snapshot:n,conn:o}=Qj(),[i,c]=A4(),l=d$(),d=e==="/settings/accounts"?"accounts":e==="/settings"?"general":null,[h,p]=X.useState(()=>d!==null),[y,g]=X.useState(bn.privacyMode),[v,x]=X.useState(bn.privacyToggleKey),[w,k]=X.useState(bn.allowNetworkAccess),[P,q]=X.useState(bn.resetDisplay),[_,A]=X.useState("idle"),C=X.useRef(null),D=X.useRef(null),U=X.useRef(null),O=X.useRef(null),T=X.useRef(null);X.useEffect(()=>{d&&p(!0)},[d]);const V=X.useCallback(ue=>{U.current=ue,g(O.current??ue.config.privacyMode),x(ue.config.privacyToggleKey),k(ue.config.allowNetworkAccess),q(ue.config.resetDisplay)},[]);X.useEffect(()=>{if(o==="live")return W_(V)},[V,o]);const ee=X.useCallback(()=>{if(C.current)return;T.current&&clearTimeout(T.current),A("refreshing");const ue=Zj().then(()=>A("success")).catch(()=>A("error")).finally(()=>{C.current=null,T.current=setTimeout(()=>A("idle"),3e3)});C.current=ue},[]),ne=X.useCallback(()=>{if(D.current)return;const ue=U.current;if(!ue)return;const $e=!ue.config.privacyMode;O.current=$e,g($e);const Yt=Gj(ue).then(an=>{O.current=null,V(an)}).catch(an=>{O.current=null;const An=Xj(an);V(An??U.current??ue)}).finally(()=>{D.current=null});D.current=Yt.then(()=>{})},[V]);X.useEffect(()=>{if(o!=="live"||h)return;const ue=$e=>{if($D($e,v)){$e.preventDefault(),ne();return}e$($e)&&($e.preventDefault(),ee())};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[o,v,ne,ee,h]),X.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const K=X.useMemo(()=>i4(n,i),[n,i]),E=X.useMemo(()=>h$(K,l.appearance),[K,l.appearance]),$=((Le=Dg.find(ue=>ue.key===i.period))==null?void 0:Le.label)??i.period,W=i.period==="all"?void 0:$,J=((Ce=Lx.find(ue=>fp(ue.key)===e))==null?void 0:Ce.key)??"overview";X.useEffect(()=>{var An;if(!n)return;const ue=new Set(n.providers.map(Ln=>Ln.id)),$e=new Set(n.accounts.map(Ln=>Ln.id)),Yt=new Set;for(const Ln of n.accounts)for(const _o of((An=Ln.table)==null?void 0:An.monthly)??[])for(const Os of _o.breakdown)Yt.add(Os.name);const an=F4(i,{providers:ue,accounts:$e,models:Yt,modelsReady:Yt.size>0});an!==i&&c(an)},[n,i,c]);const B=(n==null?void 0:n.accounts.filter(ue=>ue.hasUsage))??[],G=B.length>0,re=((n==null?void 0:n.accounts)??[]).some(Zm),te=((n==null?void 0:n.accounts)??[]).some(ue=>ue.hasBilling&&!Zm(ue)),I=G&&B.every(ue=>ue.table!=null),Z=X.useRef(!1);X.useEffect(()=>{I&&(Z.current=!0)},[I]);const[me,pe]=X.useState(!1);X.useEffect(()=>{const ue=setTimeout(()=>pe(!0),12e3);return()=>clearTimeout(ue)},[]);const fe=!G||I||Z.current||me,Pe=X.useMemo(()=>n?{snapshot:n,filters:i,derived:E,periodLabel:$,scopeLabel:W,privacyMode:y,resetDisplay:P}:null,[n,i,E,$,W,y,P]);return F.jsxs("div",{className:"min-h-screen",children:[F.jsx("button",{type:"button",onClick:_4,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"}),F.jsxs("header",{className:"relative z-30 border-b border-line bg-bg-0/80 backdrop-blur",children:[F.jsxs("div",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px]",children:[F.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3.5",children:[F.jsx("h1",{className:"font-display text-2xl text-fg-bright",children:"TOKMON"}),F.jsxs("span",{className:"hidden text-sm text-fg-faint sm:inline",children:["~/usage ",F.jsx("span",{className:"text-prompt",children:"$"})," ",F.jsx("span",{className:"text-fg-dim",children:J}),F.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),F.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-3",children:[(n==null?void 0:n.peak)&&F.jsx(P4,{peak:n.peak,resetDisplay:P,tz:n.tz}),F.jsx(E4,{conn:o,freshAt:(n==null?void 0:n.generatedAt)??null}),o==="live"&&F.jsx(b4,{phase:_,onRefresh:ee}),o==="live"&&F.jsx(C4,{onOpen:()=>p(!0)}),F.jsx(k4,{mode:l.appearance.mode,resolvedMode:l.resolved.mode,disabled:!l.ready||a1(l.appearance.preset),onToggle:()=>{l.toggleMode()}}),fe&&(G||re)&&F.jsx(x4,{derived:E,periodLabel:$,tz:(n==null?void 0:n.tz)??"",version:(n==null?void 0:n.version)??""})]})]}),F.jsx("nav",{className:"-mb-px flex items-center gap-1 overflow-x-auto","aria-label":"Dashboard sections",children:Lx.map(ue=>F.jsx(xp,{to:fp(ue.key),"aria-current":J===ue.key?"page":void 0,onMouseEnter:()=>rw(ue.key),onFocus:()=>rw(ue.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 ${J===ue.key?"border-accent text-fg-bright":"border-transparent text-fg-faint hover:text-fg-dim"}`,children:ue.label},ue.key))})]}),F.jsx(g4,{snapshot:n,derived:E,filters:i,setFilters:c,privacyMode:y})]}),F.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:[w&&F.jsx("div",{className:"mb-4 rounded border border-critical/60 bg-critical/10 px-3 py-2 text-xs text-critical",role:"alert",children:"Unsafe network access is enabled. This dashboard may be reachable from your LAN after the daemon restarts."}),n&&o!=="live"&&F.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:Yh(o,"Reconnecting…")}),(n==null?void 0:n.seeded)&&F.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:[F.jsx("span",{className:"inline-flex size-2 rounded-full",style:{background:"var(--color-cost)"},"aria-hidden":!0}),"showing cached data — refreshing…"]}),n?!G&&!re?te&&!me&&o!=="error"?F.jsx(Gh,{label:"reading billing…"}):F.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."}):!fe||!Pe?F.jsx(Gh,{label:Yh(o,"reading usage history…")}):F.jsx(Z_.Provider,{value:Pe,children:F.jsx(o1,{})}):F.jsx(Gh,{label:Yh(o,"reading usage…")})]}),F.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",n!=null&&n.version?` v${n.version}`:""," · by David Ilie · live LLM usage dashboard"]}),h?F.jsx(X.Suspense,{fallback:F.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:F.jsx(S$,{snapshot:n,initialTab:d??"general",requestedTab:d,onClose:()=>{p(!1),d&&t({to:"/overview"})}})}):null]})}function sw(){const{derived:e,periodLabel:t,scopeLabel:n,snapshot:o,privacyMode:i,resetDisplay:c}=kf();return F.jsx(X.Suspense,{fallback:F.jsx(Ef,{label:"overview"}),children:F.jsx(p$,{derived:e,periodLabel:t,scopeLabel:n,providers:o.providers,privacyMode:i,resetDisplay:c,tz:o.tz})})}function w$(){const{derived:e,scopeLabel:t}=kf();return F.jsx(X.Suspense,{fallback:F.jsx(Ef,{label:"analytics"}),children:F.jsx(g$,{derived:e,scopeLabel:t})})}function k$(){const{derived:e,scopeLabel:t}=kf();return F.jsx(X.Suspense,{fallback:F.jsx(Ef,{label:"models"}),children:F.jsx(y$,{derived:e,scopeLabel:t})})}function E$(){const{snapshot:e,filters:t,periodLabel:n,privacyMode:o}=kf();return F.jsx(X.Suspense,{fallback:F.jsx(Ef,{label:"explore"}),children:F.jsx(v$,{snapshot:e,filters:t,periodLabel:n,privacyMode:o})})}function ow(){return null}function Ef({label:e}){return F.jsxs("div",{className:"min-h-[50vh] content-center text-center text-sm text-fg-faint",role:"status","aria-live":"polite",children:["Loading ",e,"…"]})}const Ca=cF({component:x$}),ju=(e,t)=>qu({getParentRoute:()=>Ca,path:fp(e),component:t}),_$=Ca.addChildren([qu({getParentRoute:()=>Ca,path:"/",component:sw}),ju("overview",sw),ju("analytics",w$),ju("models",k$),ju("explore",E$),qu({getParentRoute:()=>Ca,path:"/settings",component:ow}),qu({getParentRoute:()=>Ca,path:"/settings/accounts",component:ow})]),C$=wF({routeTree:_$,history:yP(),defaultViewTransition:!0});function b$(){return F.jsx(_F,{router:C$})}const iw="tokmon.preloadReloadAt",P$=3e4;function F$(e,t){return!Number.isFinite(e)||t-e>=P$}function I$(){const e=t=>{t.preventDefault();let n=Number.NaN;try{n=Number(window.sessionStorage.getItem(iw))}catch{}const o=Date.now();if(F$(n,o)){try{window.sessionStorage.setItem(iw,String(o))}catch{}window.location.reload()}};return window.addEventListener("vite:preloadError",e),()=>window.removeEventListener("vite:preloadError",e)}I$();i2.createRoot(document.getElementById("root")).render(F.jsx(X.StrictMode,{children:F.jsx(R2,{children:F.jsx(f$,{children:F.jsx(S4,{children:F.jsx(b$,{})})})})}));export{D$ as $,GD as A,XD as B,v6 as C,Ng as D,T6 as E,br as F,y6 as G,F_ as H,h6 as I,v4 as J,a4 as K,_6 as L,g6 as M,S6 as N,wS as O,Tx as P,z$ as Q,Ma as R,I6 as S,c6 as T,Tu as U,B$ as V,V$ as W,u4 as X,QF as Y,GF as Z,wr as _,Q_ as a,i6 as a0,x6 as a1,$$ as a2,j$ as a3,N$ as a4,F6 as a5,c4 as a6,P6 as a7,b6 as a8,U$ as a9,C6 as aa,O$ as ab,M6 as ac,E6 as ad,rr as ae,zF as af,h1 as ag,L$ as ah,d1 as ai,A6 as aj,a1 as ak,yS as al,TF as am,RF as an,Ep as ao,sr as ap,q$ as aq,Jj as ar,W_ as as,up as at,bp as au,s$ as av,H_ as aw,w6 as ax,k6 as ay,T$ as az,f6 as b,d6 as c,L6 as d,PF as e,u6 as f,M$ as g,Ix as h,m4 as i,F as j,HD as k,p6 as l,l6 as m,p4 as n,QD as o,a6 as p,Il as q,X as r,A$ as s,Rl as t,d$ as u,R6 as v,zD as w,Xb as x,m6 as y,b_ as z};
|